Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
9f8828fc
Commit
9f8828fc
authored
Sep 07, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to add support of libevent 1.4.*
parent
d7f9fcc6
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
255 additions
and
293 deletions
+255
-293
config.h.in
config.h.in
+6
-9
configure
configure
+185
-272
configure.ac
configure.ac
+8
-12
event-old.h
event-old.h
+20
-0
interface.c
interface.c
+6
-0
loop.c
loop.c
+5
-0
lua-tg.c
lua-tg.c
+5
-0
mtproto-client.c
mtproto-client.c
+5
-0
net.c
net.c
+5
-0
queries.c
queries.c
+5
-0
tgl.c
tgl.c
+5
-0
No files found.
config.h.in
View file @
9f8828fc
/* config.h.in. Generated from configure.ac by autoheader. */
/* Use libevent v1 */
#undef EVENT_V1
/* Use libevent v2 */
#undef EVENT_V2
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
...
...
@@ -24,9 +30,6 @@
/* Define to 1 if you have the `config' library (-lconfig). */
#undef HAVE_LIBCONFIG
/* Define to 1 if you have the `edit' library (-ledit). */
#undef HAVE_LIBEDIT
/* Define to 1 if you have the `event' library (-levent). */
#undef HAVE_LIBEVENT
...
...
@@ -143,12 +146,6 @@
/* Use custom prog name */
#undef PROG_NAME
/* Use libedit */
#undef READLINE_EDIT
/* Use gnu libreadline */
#undef READLINE_GNU
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
...
...
configure
View file @
9f8828fc
This diff is collapsed.
Click to expand it.
configure.ac
View file @
9f8828fc
...
...
@@ -19,6 +19,13 @@ AC_CHECK_LIB([m], [sqrt])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([backtrace], [execinfo])
AC_CHECK_LIB([event], [event_base_new], [], [AC_MSG_ERROR([no libevent found])])
EVENT_VER=""
AC_CHECK_HEADER(event2/event.h, [AC_DEFINE([EVENT_V2], [1], [Use libevent v2])], [
AC_CHECK_HEADER(event.h, [AC_DEFINE([EVENT_V1], [1], [Use libevent v1])], [AC_MSG_ERROR([no libevent found])])
])
EXTRA_LIBS=""
# OPENSSL_INCLUDES to the include directives required
...
...
@@ -28,18 +35,7 @@ EXTRA_LIBS=""
AX_CHECK_OPENSSL(,[AC_MSG_ERROR([No openssl found])])
AX_CHECK_ZLIB(, [AC_MSG_ERROR([No zlib found])])
AC_CHECK_LIB([readline], [rl_save_prompt],
[
AC_DEFINE([READLINE_GNU], [1], [Use gnu libreadline])
[ EXTRA_LIBS="${EXTRA_LIBS} -lreadline" ; ]
],
[
AC_SEARCH_LIBS([tgetnum], [ncursesw ncurses curses])
AC_CHECK_LIB([edit], [rl_set_prompt])
AC_DEFINE([READLINE_EDIT], [1], [Use libedit])
[ EXTRA_LIBS="${EXTRA_LIBS} -ledit" ; ]
]
)
AC_CHECK_LIB([readline], [rl_save_prompt], [ EXTRA_LIBS="${EXTRA_LIBS} -lreadline" ; ], [AC_MSG_ERROR([no libreadline found])])
AC_MSG_CHECKING([for libconfig])
AC_ARG_ENABLE(libconfig,[--enable-libconfig/--disable-libconfig],
...
...
event-old.h
0 → 100644
View file @
9f8828fc
#ifndef __EVENT_OLD_H__
#define __EVENT_OLD_H__
typedef
evutil_socket_t
int
static
inline
struct
event
*
event_new
(
struct
event_base
*
base
,
int
fd
,
int
what
,
void
(
*
callback
)(
int
,
short
,
void
*
),
void
*
arg
)
{
struct
event
*
ev
=
malloc
(
sizeof
(
*
ec
));
event_set
(
ev
,
base
,
fd
,
what
,
callback
,
arg
);
}
static
inline
struct
event
*
evtimer_new
(
struct
event_base
*
base
,
void
(
*
callback
)(
int
,
short
,
void
*
),
void
*
arg
)
{
struct
event
*
ev
=
malloc
(
sizeof
(
*
ec
));
evtimer_set
(
ev
,
base
,
callback
,
arg
);
}
static
void
event_free
(
struct
event
*
ev
)
{
event_del
(
ev
);
free
(
ev
);
}
#endif
interface.c
View file @
9f8828fc
...
...
@@ -42,7 +42,13 @@
#include "interface.h"
#include "telegram.h"
#ifdef EVENT_V2
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
//#include "auto/constants.h"
//#include "tools.h"
//#include "structures.h"
...
...
loop.c
View file @
9f8828fc
...
...
@@ -43,7 +43,12 @@
#include <sys/stat.h>
#include <fcntl.h>
#ifdef EVENT_V2
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#include "interface.h"
#include "telegram.h"
...
...
lua-tg.c
View file @
9f8828fc
...
...
@@ -32,7 +32,12 @@
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#ifdef EVENT_V2
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
lua_State
*
luaState
;
//#include "interface.h"
...
...
mtproto-client.c
View file @
9f8828fc
...
...
@@ -58,7 +58,12 @@
#include "tools.h"
#include "tree.h"
#include "updates.h"
#ifdef EVENT_V2
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#if defined(__FreeBSD__)
#define __builtin_bswap32(x) bswap32(x)
...
...
net.c
View file @
9f8828fc
...
...
@@ -38,7 +38,12 @@
#include <poll.h>
#include <openssl/rand.h>
#include <arpa/inet.h>
#ifdef EVENT_V2
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#include <sys/time.h>
#include <time.h>
...
...
queries.c
View file @
9f8828fc
...
...
@@ -54,7 +54,12 @@
#include "updates.h"
#include "auto.h"
#include "tgl.h"
#ifdef EVENT_V2
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#define sha1 SHA1
...
...
tgl.c
View file @
9f8828fc
...
...
@@ -28,7 +28,12 @@
#include "structures.h"
#include "net.h"
#ifdef EVENT_V2
#include <event2/event.h>
#else
#include <event.h>
#include "event-old.h"
#endif
#include <assert.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment