/* (C)opyleft 2001-2002 Frank DENIS */ #ifndef __PUREDB_P_H__ #define __PUREDB_P_H__ 1 #include #ifdef STDC_HEADERS # include # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #else # if HAVE_STRINGS_H # include # endif #endif #include #include #ifdef HAVE_UNISTD_H # include #endif #include #include #ifdef HAVE_FCNTL_H # include #elif defined(HAVE_SYS_FCNTL_H) # include #endif #ifdef HAVE_IOCTL_H # include #elif defined(HAVE_SYS_IOCTL_H) # include #endif #ifdef HAVE_NETINET_IN_SYSTM_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_MMAP # include #endif #ifdef HAVE_WINDOWS_H # include #endif #ifdef HAVE_IO_H # include #endif #ifdef HAVE_SYS_PARAM_H # include #endif #ifdef HAVE_ALLOCA # ifdef HAVE_ALLOCA_H # include # endif # define ALLOCA(X) alloca(X) # define ALLOCA_FREE(X) do { } while (0) #else # define ALLOCA(X) malloc(X) # define ALLOCA_FREE(X) free(X) #endif #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 #endif #ifndef O_BINARY # define O_BINARY 0 #endif #if !defined(O_NDELAY) && defined(O_NONBLOCK) # define O_NDELAY O_NONBLOCK #endif #ifndef FNDELAY # define FNDELAY O_NDELAY #endif #ifndef MAP_FILE # define MAP_FILE 0 #endif #ifndef MAP_FAILED # define MAP_FAILED ((void *) -1) #endif #if defined(HAVE_MAPVIEWOFFILE) || defined(HAVE_MMAP) # define USE_MAPPED_IO 1 #endif #ifndef errno extern int errno; #endif #ifndef HAVE_STRDUP # define strdup(X) do { char *x; if ((x = malloc(strlen(X) + 1)) != NULL) \ strcpy(x, (X)); } while(0) #endif #endif