m4_include(lib/replace/win32/config.m4)
m4_include(lib/replace/repdir/config.m4)
m4_include(lib/smbreadline/readline.m4)
-m4_include(include/system/config.m4)
m4_include(build/m4/rewrite.m4)
m4_include(heimdal_build/config.m4)
m4_include(lib/util/fault.m4)
#define HAVE_ILDAP 1
#endif
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include "replace.h"
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <signal.h>
-#include <unistd.h>
-#include <fnmatch.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+#include "replace.h"
+#include "system/filesys.h"
+#include "system/network.h"
+#include "system/time.h"
#include "talloc.h"
-
#include "ldb.h"
#include "ldb_errors.h"
#include "ldb_private.h"
m4_include(getpass.m4)
m4_include(cc_features.m4)
+m4_include(system/config.m4)
LIBREPLACE_C99_STRUCT_INIT(c99_struct_initialization=yes,
c99_struct_initialization=no)
#include "replace.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#if HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
+#include "system/filesys.h"
+#include "system/time.h"
+#include "system/passwd.h"
+#include "system/syslog.h"
void replace_dummy(void);
void replace_dummy(void) {}
#define _replace_h
#include "config.h"
+
+#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <errno.h>
#if defined(_MSC_VER) || defined(__MINGW32__)
#include "lib/replace/win32/replace.h"
#include <inttypes.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
#define strerror(i) sys_errlist[i]
#endif
#if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM)
-#include <sys/time.h>
+#include "system/time.h"
#endif
#ifndef HAVE_MKTIME
#define __STRING(x) #x
#endif
-
-
#endif
+#ifndef _system_capability_h
+#define _system_capability_h
/*
Unix SMB/CIFS implementation.
#endif
+#endif
+#ifndef _system_dir_h
+#define _system_dir_h
/*
Unix SMB/CIFS implementation.
)
#endif
+#endif
+#ifndef _system_filesys_h
+#define _system_filesys_h
/*
Unix SMB/CIFS implementation.
#define SEEK_SET 0
#endif
+#endif
+#ifndef _system_glob_h
+#define _system_glob_h
/*
Unix SMB/CIFS implementation.
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
#endif
+
+#endif
+#ifndef _system_iconv_h
+#define _system_iconv_h
/*
Unix SMB/CIFS implementation.
#define EILSEQ EIO
#endif
+#endif
+#ifndef _system_kerberos_h
+#define _system_kerberos_h
+
/*
Unix SMB/CIFS implementation.
#include "heimdal/lib/gssapi/gssapi.h"
#include "heimdal/lib/com_err/com_err.h"
#endif
+
+#endif
+#ifndef _system_locale_h
+#define _system_locale_h
+
/*
Unix SMB/CIFS implementation.
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
+
+#endif
+#ifndef _system_network_h
+#define _system_network_h
/*
Unix SMB/CIFS implementation.
#define INADDR_NONE 0xffffffff
#endif
+#endif
+#ifndef _system_passwd_h
+#define _system_passwd_h
+
/*
Unix SMB/CIFS implementation.
int initgroups(char *name,gid_t id);
#endif
+#endif
+#ifndef _system_printing_h
+#define _system_printing_h
+
/*
Unix SMB/CIFS implementation.
#define PRINTCAP_NAME "/etc/printcap"
#endif
+#endif
+#ifndef _system_readline_h
+#define _system_readline_h
/*
Unix SMB/CIFS implementation.
/* This type is missing from libreadline<4.0 (approximately) */
# define RL_COMPLETION_CAST
#endif /* HAVE_NEW_LIBREADLINE */
+
+#endif
+#ifndef _system_select_h
+#define _system_select_h
/*
Unix SMB/CIFS implementation.
#if WITH_EPOLL
#include <sys/epoll.h>
#endif
+
+#endif
+#ifndef _system_shmem_h
+#define _system_shmem_h
/*
Unix SMB/CIFS implementation.
#define MAP_FILE 0
#endif
+#endif
+#ifndef _system_syslog_h
+#define _system_syslog_h
/*
Unix SMB/CIFS implementation.
#define LOG_DEBUG 7 /* debug-level messages */
#endif
+#endif
+#ifndef _system_terminal_h
+#define _system_terminal_h
/*
Unix SMB/CIFS implementation.
#include <sys/termio.h>
#endif
+#endif
+#ifndef _system_time_h
+#define _system_time_h
/*
Unix SMB/CIFS implementation.
#include <utime.h>
#endif
-#ifndef HAVE_TIMEGM
-time_t timegm(struct tm *tm);
#endif
-
+#ifndef _system_wait_h
+#define _system_wait_h
/*
Unix SMB/CIFS implementation.
#define SIGNAL_CAST (RETSIGTYPE (*)(int))
#endif
+#endif
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "../replace.h"
-#include <stdio.h>
+#include "replace.h"
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#if HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <fcntl.h>
-#include <errno.h>
+/*
+ we include all the system/*.h include files here so that libreplace tests
+ them in the build farm
+*/
+#include "system/capability.h"
+#include "system/dir.h"
+#include "system/filesys.h"
+#include "system/glob.h"
+#include "system/iconv.h"
+#include "system/locale.h"
+#include "system/network.h"
+#include "system/passwd.h"
+#include "system/printing.h"
+#include "system/readline.h"
+#include "system/select.h"
+#include "system/shmem.h"
+#include "system/syslog.h"
+#include "system/terminal.h"
+#include "system/time.h"
+#include "system/wait.h"
#define TESTFILE "testfile.dat"
#ifndef _TALLOC_SAMBA3
#include "replace.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#if defined(HAVE_STDARG_H)
-#include <stdarg.h>
-#elif defined (HAVE_VARARGS_H)
-#include <varargs.h>
-#else
-#error "no var arg header"
-#endif
-
#include "talloc.h"
#endif /* not _TALLOC_SAMBA3 */
#include "version.h"
#endif /* _SAMBA_BUILD_ */
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-
-#include <sys/time.h>
-#include <time.h>
-
+#include "replace.h"
+#include "system/time.h"
#include "talloc.h"
#ifndef False
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
-VPATH = @srcdir@
+VPATH = @srcdir@:@libreplacedir@
srcdir = @srcdir@
builddir = @builddir@
-CFLAGS = -I$(srcdir)/include -Iinclude @CFLAGS@
+CFLAGS = -I$(srcdir)/include -Iinclude -I@libreplacedir@ @CFLAGS@
PROGS = bin/tdbtool bin/tdbtorture
-TDB_OBJ = @TDBOBJ@
+TDB_OBJ = @TDBOBJ@ @LIBREPLACEOBJ@
DIRS = lib bin common tools examples
.c.o:
@echo Compiling $*.c
@mkdir -p `dirname $@`
- $(CC) $(CFLAGS) -c $< -o $@
+ @$(CC) $(CFLAGS) -c $< -o $@
dirs:
@mkdir -p $(DIRS)
rm -rf autom4te.cache
rm -f configure config.h.in
-autoheader || exit 1
-autoconf || exit 1
+IPATHS="-I libreplace -I lib/replace -I ../libreplace -I ../replace"
+autoconf $IPATHS || exit 1
+autoheader $IPATHS || exit 1
rm -rf autom4te.cache
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef _SAMBA_BUILD_
-#include "config.h"
-#include <stdlib.h>
-#include <stdio.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include "tdb.h"
-
-#else
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
+#include "replace.h"
+#include "system/filesys.h"
#include "system/time.h"
#include "system/shmem.h"
-#include "system/filesys.h"
-#endif
+#include "system/select.h"
+#include "tdb.h"
#ifndef u32
#define u32 unsigned
#define ACTIVE_LOCK 4
#define TRANSACTION_LOCK 8
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
#endif
AC_CHECK_SIZEOF(size_t,cross)
AC_CHECK_SIZEOF(ssize_t,cross)
AC_FUNC_MMAP
+m4_include(libreplace.m4)
m4_include(libtdb.m4)
AC_OUTPUT(Makefile tdb.pc)
*/
-#ifndef _SAMBA_BUILD_
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <ctype.h>
-#include <signal.h>
-
-#else
-
-#include "includes.h"
-#include "system/filesys.h"
-
-#endif
-
+#include "replace.h"
#include "tdb.h"
+#include "system/filesys.h"
/*
see if one file is newer than another
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef _SAMBA_BUILD_
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <ctype.h>
-#include <signal.h>
+#include "replace.h"
#include "tdb.h"
-
-#else
-
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
#include "system/locale.h"
#include "system/filesys.h"
-#endif
-
static void print_data(TDB_DATA d)
{
unsigned char *p = (unsigned char *)d.dptr;
/* a test program for tdb - the trivial database */
-#ifndef _SAMBA_BUILD_
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <signal.h>
+#include "replace.h"
#include "tdb.h"
-#else
-
-#include "includes.h"
#include "system/filesys.h"
#include "system/time.h"
-#include "lib/tdb/include/tdb.h"
-
-#endif
#include <gdbm.h>
writers - that stresses the locking code.
*/
-#ifndef _SAMBA_BUILD_
-#define _GNU_SOURCE
-#include <stdlib.h>
-#include <time.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/wait.h>
+#include "replace.h"
#include "tdb.h"
-
-#else
-
-#include "includes.h"
-#include "lib/tdb/include/tdb.h"
#include "system/time.h"
#include "system/wait.h"
#include "system/filesys.h"
-#endif
-
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif