summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-16 19:57:09 +0100
committerStefan Metzmacher <metze@samba.org>2008-12-17 13:31:29 +0100
commit46eda790905e0ca70d9ecd2822578dbfde456e63 (patch)
tree142d4b85c91416c02b107ed41ec3232697b4c06e /lib/tevent
parent504f8816e3058b9358a18ef42e442753fe2657ba (diff)
downloadsamba-46eda790905e0ca70d9ecd2822578dbfde456e63.tar.gz
samba-46eda790905e0ca70d9ecd2822578dbfde456e63.tar.bz2
samba-46eda790905e0ca70d9ecd2822578dbfde456e63.zip
s4:lib/tevent: add lib/events/ compat and let things compile
metze
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/Makefile.in36
-rw-r--r--lib/tevent/config.mk45
-rw-r--r--lib/tevent/configure.ac6
-rw-r--r--lib/tevent/events.i4
-rw-r--r--lib/tevent/events_wrap.c2
-rw-r--r--lib/tevent/libtevent.m448
-rw-r--r--lib/tevent/tevent.c6
-rw-r--r--lib/tevent/tevent.h6
-rw-r--r--lib/tevent/tevent.pc.in2
-rw-r--r--lib/tevent/tevent_aio.c6
-rw-r--r--lib/tevent/tevent_debug.c4
-rw-r--r--lib/tevent/tevent_epoll.c6
-rw-r--r--lib/tevent/tevent_s4.c4
-rw-r--r--lib/tevent/tevent_select.c6
-rw-r--r--lib/tevent/tevent_signal.c6
-rw-r--r--lib/tevent/tevent_standard.c6
-rw-r--r--lib/tevent/tevent_timed.c6
-rw-r--r--lib/tevent/tevent_util.c6
18 files changed, 104 insertions, 101 deletions
diff --git a/lib/tevent/Makefile.in b/lib/tevent/Makefile.in
index 4257119849..9765d35720 100644
--- a/lib/tevent/Makefile.in
+++ b/lib/tevent/Makefile.in
@@ -29,41 +29,41 @@ PYTHON_BUILD_TARGET = @PYTHON_BUILD_TARGET@
PYTHON_INSTALL_TARGET = @PYTHON_INSTALL_TARGET@
PYTHON_CHECK_TARGET = @PYTHON_CHECK_TARGET@
LIB_PATH_VAR = @LIB_PATH_VAR@
-eventsdir = @eventsdir@
+teventdir = @teventdir@
TALLOC_CFLAGS = @TALLOC_CFLAGS@
TALLOC_LDFLAGS = @TALLOC_CFLAGS@
TALLOC_LIBS = @TALLOC_LIBS@
-EVENTS_CFLAGS = @EVENTS_CFLAGS@
-EVENTS_LDFLAGS = @EVENTS_CFLAGS@
-EVENTS_LIBS = @EVENTS_LIBS@
+TEVENT_CFLAGS = @TEVENT_CFLAGS@
+TEVENT_LDFLAGS = @TEVENT_CFLAGS@
+TEVENT_LIBS = @TEVENT_LIBS@
-CFLAGS = $(CPPFLAGS) $(TALLOC_CFLAGS) $(EVENTS_CFLAGS) @CFLAGS@
-LDFLAGS = $(TALLOC_LDFLAGS) $(EVENTS_LDFLAGS) @LDFLAGS@
-LIBS = $(TALLOC_LIBS) $(EVENTS_LIBS) @LIBS@
+CFLAGS = $(CPPFLAGS) $(TALLOC_CFLAGS) $(TEVENT_CFLAGS) @CFLAGS@
+LDFLAGS = $(TALLOC_LDFLAGS) $(TEVENT_LDFLAGS) @LDFLAGS@
+LIBS = $(TALLOC_LIBS) $(TEVENT_LIBS) @LIBS@
-EVENTS_OBJ = @EVENTS_OBJ@ @LIBREPLACEOBJ@
+TEVENT_OBJ = @TEVENT_OBJ@ @LIBREPLACEOBJ@
default: all
-include $(eventsdir)/events.mk
-include $(eventsdir)/rules.mk
+include $(teventdir)/tevent.mk
+include $(teventdir)/rules.mk
-all:: showflags dirs $(PROGS) $(EVENTS_SOLIB) libevents.a $(PYTHON_BUILD_TARGET)
+all:: showflags dirs $(PROGS) $(TEVENT_SOLIB) libtevent.a $(PYTHON_BUILD_TARGET)
install:: all
-$(EVENTS_SOLIB): $(EVENTS_OBJ)
- $(SHLD) $(SHLD_FLAGS) $(LDFLAGS) $(LIBS) -o $@ $(EVENTS_OBJ) @SONAMEFLAG@$(EVENTS_SONAME)
+$(TEVENT_SOLIB): $(TEVENT_OBJ)
+ $(SHLD) $(SHLD_FLAGS) $(LDFLAGS) $(LIBS) -o $@ $(TEVENT_OBJ) @SONAMEFLAG@$(TEVENT_SONAME)
shared-build: all
${INSTALLCMD} -d $(sharedbuilddir)/lib
- ${INSTALLCMD} -m 644 libevents.a $(sharedbuilddir)/lib
- ${INSTALLCMD} -m 755 $(EVENTS_SOLIB) $(sharedbuilddir)/lib
- ln -sf $(EVENTS_SOLIB) $(sharedbuilddir)/lib/$(EVENTS_SONAME)
- ln -sf $(EVENTS_SOLIB) $(sharedbuilddir)/lib/libevents.so
+ ${INSTALLCMD} -m 644 libtevent.a $(sharedbuilddir)/lib
+ ${INSTALLCMD} -m 755 $(TEVENT_SOLIB) $(sharedbuilddir)/lib
+ ln -sf $(TEVENT_SOLIB) $(sharedbuilddir)/lib/$(TEVENT_SONAME)
+ ln -sf $(TEVENT_SOLIB) $(sharedbuilddir)/lib/libtevent.so
${INSTALLCMD} -d $(sharedbuilddir)/include
- ${INSTALLCMD} -m 644 $(srcdir)/events.h $(sharedbuilddir)/include
+ ${INSTALLCMD} -m 644 $(srcdir)/tevent.h $(sharedbuilddir)/include
check: test
diff --git a/lib/tevent/config.mk b/lib/tevent/config.mk
index 127d964775..5f9508a44f 100644
--- a/lib/tevent/config.mk
+++ b/lib/tevent/config.mk
@@ -1,58 +1,59 @@
##############################
-[MODULE::EVENTS_AIO]
+[MODULE::TEVENT_AIO]
PRIVATE_DEPENDENCIES = LIBAIO_LINUX
-SUBSYSTEM = LIBEVENTS
+SUBSYSTEM = LIBTEVENT
INIT_FUNCTION = s4_events_aio_init
##############################
-EVENTS_AIO_OBJ_FILES = $(libeventssrcdir)/events_aio.o
+TEVENT_AIO_OBJ_FILES = $(libteventsrcdir)/tevent_aio.o
##############################
-[MODULE::EVENTS_EPOLL]
-SUBSYSTEM = LIBEVENTS
+[MODULE::TEVENT_EPOLL]
+SUBSYSTEM = LIBTEVENT
INIT_FUNCTION = s4_events_epoll_init
##############################
-EVENTS_EPOLL_OBJ_FILES = $(libeventssrcdir)/events_epoll.o
+TEVENT_EPOLL_OBJ_FILES = $(libteventsrcdir)/tevent_epoll.o
##############################
-[MODULE::EVENTS_SELECT]
-SUBSYSTEM = LIBEVENTS
+[MODULE::TEVENT_SELECT]
+SUBSYSTEM = LIBTEVENT
INIT_FUNCTION = s4_events_select_init
##############################
-EVENTS_SELECT_OBJ_FILES = $(libeventssrcdir)/events_select.o
+TEVENT_SELECT_OBJ_FILES = $(libteventsrcdir)/tevent_select.o
##############################
-[MODULE::EVENTS_STANDARD]
-SUBSYSTEM = LIBEVENTS
+[MODULE::TEVENT_STANDARD]
+SUBSYSTEM = LIBTEVENT
INIT_FUNCTION = s4_events_standard_init
##############################
-EVENTS_STANDARD_OBJ_FILES = $(libeventssrcdir)/events_standard.o
+TEVENT_STANDARD_OBJ_FILES = $(libteventsrcdir)/tevent_standard.o
################################################
-# Start SUBSYSTEM LIBEVENTS
-[LIBRARY::LIBEVENTS]
+# Start SUBSYSTEM LIBTEVENT
+[LIBRARY::LIBTEVENT]
PUBLIC_DEPENDENCIES = LIBTALLOC
OUTPUT_TYPE = MERGED_OBJ
-CFLAGS = -Ilib/events
+CFLAGS = -I../lib/tevent
#
-# End SUBSYSTEM LIBEVENTS
+# End SUBSYSTEM LIBTEVENT
################################################
-LIBEVENTS_OBJ_FILES = $(addprefix $(libeventssrcdir)/, events.o events_timed.o events_signal.o events_debug.o events_util.o events_s4.o)
+LIBTEVENT_OBJ_FILES = $(addprefix $(libteventsrcdir)/, tevent.o tevent_timed.o tevent_signal.o tevent_debug.o tevent_util.o tevent_s4.o)
-PUBLIC_HEADERS += $(addprefix $(libeventssrcdir)/, events.h events_internal.h)
+PUBLIC_HEADERS += $(addprefix $(libteventsrcdir)/, tevent.h tevent_internal.h)
+# TODO: Change python stuff to tevent
[PYTHON::swig_events]
LIBRARY_REALNAME = samba/_events.$(SHLIBEXT)
-PRIVATE_DEPENDENCIES = LIBEVENTS LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL
+PRIVATE_DEPENDENCIES = LIBTEVENT LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL
-swig_events_OBJ_FILES = $(libeventssrcdir)/events_wrap.o
+swig_events_OBJ_FILES = $(libteventsrcdir)/events_wrap.o
-$(eval $(call python_py_module_template,samba/events.py,$(libeventssrcdir)/events.py))
+$(eval $(call python_py_module_template,samba/events.py,$(libteventsrcdir)/events.py))
$(swig_events_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
-PC_FILES += $(libeventssrcdir)/events.pc
+PC_FILES += $(libteventsrcdir)/tevent.pc
diff --git a/lib/tevent/configure.ac b/lib/tevent/configure.ac
index 895f2a1daa..75719d13b4 100644
--- a/lib/tevent/configure.ac
+++ b/lib/tevent/configure.ac
@@ -3,8 +3,8 @@ AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
AC_DEFUN([SMB_ENABLE], [echo -n ""])
AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
-AC_INIT(events, 1.0.0)
-AC_CONFIG_SRCDIR([events.c])
+AC_INIT(tevent, 1.0.0)
+AC_CONFIG_SRCDIR([tevent.c])
AC_CONFIG_HEADER(config.h)
AC_LIBREPLACE_ALL_CHECKS
@@ -22,7 +22,7 @@ BUILD_WITH_SHARED_BUILD_DIR
m4_include(pkg.m4)
m4_include(libtalloc.m4)
-m4_include(libevents.m4)
+m4_include(libtevent.m4)
AC_PATH_PROGS([PYTHON_CONFIG], [python2.6-config python2.5-config python2.4-config python-config])
AC_PATH_PROGS([PYTHON], [python2.6 python2.5 python2.4 python])
diff --git a/lib/tevent/events.i b/lib/tevent/events.i
index 8a0d9c4b6f..7a604a9f23 100644
--- a/lib/tevent/events.i
+++ b/lib/tevent/events.i
@@ -18,10 +18,10 @@
%module(docstring="Event management.",package="samba.events") events;
-%import "../../../lib/talloc/talloc.i";
+%import "../../lib/talloc/talloc.i";
%{
-#include "events.h"
+#include "tevent.h"
typedef struct event_context event;
%}
diff --git a/lib/tevent/events_wrap.c b/lib/tevent/events_wrap.c
index 335652101b..b8b3a962bc 100644
--- a/lib/tevent/events_wrap.c
+++ b/lib/tevent/events_wrap.c
@@ -2525,7 +2525,7 @@ static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0};
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
-#include "events.h"
+#include "tevent.h"
typedef struct event_context event;
SWIGINTERN event *new_event(TALLOC_CTX *mem_ctx){ return event_context_init(mem_ctx); }
diff --git a/lib/tevent/libtevent.m4 b/lib/tevent/libtevent.m4
index ed76b03d4f..30105d9bef 100644
--- a/lib/tevent/libtevent.m4
+++ b/lib/tevent/libtevent.m4
@@ -1,49 +1,51 @@
-dnl find the events sources. This is meant to work both for
-dnl standalone builds, and builds of packages using libevents
-if test x"$eventsdir" = "x"; then
- eventsdir=""
- eventspaths="$srcdir $srcdir/../samba4/source/lib/events $srcdir/lib/events $srcdir/events $srcdir/../events"
- for d in $eventspaths; do
- if test -f "$d/events.c"; then
- eventsdir="$d"
- AC_SUBST(eventsdir)
+dnl find the tevent sources. This is meant to work both for
+dnl standalone builds, and builds of packages using libtevent
+if test x"$teventdir" = "x"; then
+ teventdir=""
+ teventpaths="$srcdir $srcdir/../lib/tevent $srcdir/tevent $srcdir/../tevent"
+ for d in $teventpaths; do
+ if test -f "$d/tevent.c"; then
+ teventdir="$d"
+ AC_SUBST(teventdir)
break;
fi
done
- if test x"$eventsdir" = "x"; then
- AC_MSG_ERROR([cannot find libevents source in $eventspaths])
+ if test x"$teventdir" = "x"; then
+ AC_MSG_ERROR([cannot find libtevent source in $teventpaths])
fi
fi
-EVENTS_OBJ="events.o events_select.o events_signal.o events_timed.o events_standard.o events_debug.o events_util.o"
+TEVENT_OBJ="tevent.o tevent_select.o tevent_signal.o tevent_timed.o tevent_standard.o tevent_debug.o tevent_util.o"
AC_LIBREPLACE_NETWORK_CHECKS
-SMB_ENABLE(EVENTS_EPOLL, NO)
-SMB_ENABLE(EVENTS_AIO, NO)
+SMB_ENABLE(TEVENT_EPOLL, NO)
+SMB_ENABLE(TEVENT_AIO, NO)
AC_CHECK_HEADERS(sys/epoll.h)
AC_CHECK_FUNCS(epoll_create)
if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then
- EVENTS_OBJ="$EVENTS_OBJ events_epoll.o"
- SMB_ENABLE(EVENTS_EPOLL,YES)
+ TEVENT_OBJ="$TEVENT_OBJ tevent_epoll.o"
+ SMB_ENABLE(TEVENT_EPOLL,YES)
+ AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
+ #TODO: remove HAVE_EVENTS_EPOLL and use HAVE_EPOLL
AC_DEFINE(HAVE_EVENTS_EPOLL, 1, [Whether epoll available])
# check for native Linux AIO interface
AC_CHECK_HEADERS(libaio.h)
AC_CHECK_LIB_EXT(aio, AIO_LIBS, io_getevents)
if test x"$ac_cv_header_libaio_h" = x"yes" -a x"$ac_cv_lib_ext_aio_io_getevents" = x"yes";then
- EVENTS_OBJ="$EVENTS_OBJ events_aio.o"
- SMB_ENABLE(EVENTS_AIO,YES)
+ TEVENT_OBJ="$TEVENT_OBJ tevent_aio.o"
+ SMB_ENABLE(TEVENT_AIO,YES)
AC_DEFINE(HAVE_LINUX_AIO, 1, [Whether Linux AIO is available])
fi
fi
-AC_SUBST(EVENTS_OBJ)
+AC_SUBST(TEVENT_OBJ)
SMB_EXT_LIB(LIBAIO_LINUX, $AIO_LIBS)
-EVENTS_CFLAGS="-I$eventsdir"
-AC_SUBST(EVENTS_CFLAGS)
+TEVENT_CFLAGS="-I$teventdir"
+AC_SUBST(TEVENT_CFLAGS)
-EVENTS_LIBS="$AIO_LIBS"
-AC_SUBST(EVENTS_LIBS)
+TEVENT_LIBS="$AIO_LIBS"
+AC_SUBST(TEVENT_LIBS)
diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c
index 52699d968e..cd470c93ae 100644
--- a/lib/tevent/tevent.c
+++ b/lib/tevent/tevent.c
@@ -53,9 +53,9 @@
*/
#include "replace.h"
-#include "events.h"
-#include "events_internal.h"
-#include "events_util.h"
+#include "tevent.h"
+#include "tevent_internal.h"
+#include "tevent_util.h"
struct event_ops_list {
struct event_ops_list *next, *prev;
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 1ece49697f..1857f9bb10 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __EVENTS_H__
-#define __EVENTS_H__
+#ifndef __TEVENT_H__
+#define __TEVENT_H__
#include <stdint.h>
#include <talloc.h>
@@ -95,4 +95,4 @@ struct event_context *event_context_find(TALLOC_CTX *mem_ctx);
#define EVENT_FD_NOT_READABLE(fde) \
event_set_fd_flags(fde, event_get_fd_flags(fde) & ~EVENT_FD_READ)
-#endif /* __EVENTS_H__ */
+#endif /* __TEVENT_H__ */
diff --git a/lib/tevent/tevent.pc.in b/lib/tevent/tevent.pc.in
index 4a4c012d73..afd9fcc279 100644
--- a/lib/tevent/tevent.pc.in
+++ b/lib/tevent/tevent.pc.in
@@ -6,6 +6,6 @@ includedir=@includedir@
Name: events
Description: An event system library
Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -levents
+Libs: -L${libdir} -ltevent
Cflags: -I${includedir}
URL: http://samba.org/
diff --git a/lib/tevent/tevent_aio.c b/lib/tevent/tevent_aio.c
index e30213acbc..7c3473b9a7 100644
--- a/lib/tevent/tevent_aio.c
+++ b/lib/tevent/tevent_aio.c
@@ -32,9 +32,9 @@
#include "system/filesys.h"
#include "replace.h"
-#include "events.h"
-#include "events_internal.h"
-#include "events_util.h"
+#include "tevent.h"
+#include "tevent_internal.h"
+#include "tevent_util.h"
#include <sys/epoll.h>
#include <libaio.h>
diff --git a/lib/tevent/tevent_debug.c b/lib/tevent/tevent_debug.c
index 233844f024..a23ff09755 100644
--- a/lib/tevent/tevent_debug.c
+++ b/lib/tevent/tevent_debug.c
@@ -19,8 +19,8 @@
*/
#include "replace.h"
-#include "events.h"
-#include "events_internal.h"
+#include "tevent.h"
+#include "tevent_internal.h"
/********************************************************************
* Debug wrapper functions, modeled (with lot's of code copied as is)
diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c
index d46d5c2bbc..1d03b7dbf0 100644
--- a/lib/tevent/tevent_epoll.c
+++ b/lib/tevent/tevent_epoll.c
@@ -23,9 +23,9 @@
#include "replace.h"
#include "system/filesys.h"
#include "system/network.h"
-#include "events.h"
-#include "events_internal.h"
-#include "events_util.h"
+#include "tevent.h"
+#include "tevent_internal.h"
+#include "tevent_util.h"
#include <sys/epoll.h>
struct epoll_event_context {
diff --git a/lib/tevent/tevent_s4.c b/lib/tevent/tevent_s4.c
index 134f899cf8..4be92599a7 100644
--- a/lib/tevent/tevent_s4.c
+++ b/lib/tevent/tevent_s4.c
@@ -17,8 +17,8 @@
*/
#include "includes.h"
-#include "events.h"
-#include "events_internal.h"
+#include "tevent.h"
+#include "tevent_internal.h"
NTSTATUS s4_events_standard_init(void)
{
diff --git a/lib/tevent/tevent_select.c b/lib/tevent/tevent_select.c
index 54d32204f5..35c6f78599 100644
--- a/lib/tevent/tevent_select.c
+++ b/lib/tevent/tevent_select.c
@@ -26,9 +26,9 @@
#include "replace.h"
#include "system/filesys.h"
#include "system/select.h"
-#include "events.h"
-#include "events_util.h"
-#include "events_internal.h"
+#include "tevent.h"
+#include "tevent_util.h"
+#include "tevent_internal.h"
struct select_event_context {
/* a pointer back to the generic event_context */
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c
index 652df53d4b..36907af6be 100644
--- a/lib/tevent/tevent_signal.c
+++ b/lib/tevent/tevent_signal.c
@@ -23,9 +23,9 @@
#include "replace.h"
#include "system/filesys.h"
#include "system/select.h"
-#include "events.h"
-#include "events_internal.h"
-#include "events_util.h"
+#include "tevent.h"
+#include "tevent_internal.h"
+#include "tevent_util.h"
#define NUM_SIGNALS 64
diff --git a/lib/tevent/tevent_standard.c b/lib/tevent/tevent_standard.c
index 11128d7623..c63d092173 100644
--- a/lib/tevent/tevent_standard.c
+++ b/lib/tevent/tevent_standard.c
@@ -31,9 +31,9 @@
#include "system/filesys.h"
#include "system/network.h"
#include "system/select.h" /* needed for HAVE_EVENTS_EPOLL */
-#include "events.h"
-#include "events_util.h"
-#include "events_internal.h"
+#include "tevent.h"
+#include "tevent_util.h"
+#include "tevent_internal.h"
struct std_event_context {
/* a pointer back to the generic event_context */
diff --git a/lib/tevent/tevent_timed.c b/lib/tevent/tevent_timed.c
index c58c898c6d..ba8213710e 100644
--- a/lib/tevent/tevent_timed.c
+++ b/lib/tevent/tevent_timed.c
@@ -25,9 +25,9 @@
#include "replace.h"
#include "system/filesys.h"
#include "system/select.h"
-#include "events.h"
-#include "events_internal.h"
-#include "events_util.h"
+#include "tevent.h"
+#include "tevent_internal.h"
+#include "tevent_util.h"
/**
compare two timeval structures.
diff --git a/lib/tevent/tevent_util.c b/lib/tevent/tevent_util.c
index 9e7d758405..cfcca9185d 100644
--- a/lib/tevent/tevent_util.c
+++ b/lib/tevent/tevent_util.c
@@ -20,9 +20,9 @@
#include "replace.h"
#include "talloc.h"
-#include "events.h"
-#include "events_internal.h"
-#include "events_util.h"
+#include "tevent.h"
+#include "tevent_internal.h"
+#include "tevent_util.h"
#include <fcntl.h>
/**