00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #if __GNUC__ >= 4
00013 #define DSL_API __attribute__ ((visibility("default")))
00014 #define DSL_API_CLASS __attribute__ ((visibility("default")))
00015 #else
00016 #define DSL_API
00017 #define DSL_API_CLASS
00018 #endif
00019 #define DSL_CC
00020
00021 #ifndef _FILE_OFFSET_BITS
00022 #define _FILE_OFFSET_BITS 64
00023 #endif
00024
00025
00026 #include <sys/cdefs.h>
00027 #include <stdlib.h>
00028 #include <stdio.h>
00029 #include <string.h>
00030 #include <stdarg.h>
00031 #include <strings.h>
00032 #include <ctype.h>
00033 #include <sys/stat.h>
00034 #include <errno.h>
00035 #include <sys/types.h>
00036 #include <time.h>
00037 #include <limits.h>
00038
00039 #include <new>
00040 #include <pthread.h>
00041 #include <signal.h>
00042 #include <dirent.h>
00043 #include <unistd.h>
00044 #include <netdb.h>
00045 #include <sys/socket.h>
00046 #include <sys/select.h>
00047 #include <sys/utsname.h>
00048 #include <arpa/inet.h>
00049 #include <netinet/in.h>
00050 #include <fcntl.h>
00051 #include <dlfcn.h>
00052
00053
00054 #if defined(__OpenBSD__)
00055 #define PLATFORM "OpenBSD"
00056 #define OPENBSD
00057 #else
00058 #define PLATFORM "FreeBSD"
00059 #endif
00060 #define FREEBSD
00061 #ifdef __i386__
00062 #define CPU "x86"
00063 #elif __amd64__
00064 #define CPU "x86_64"
00065 #else
00066 #error "ERROR: Unknown CPU Type"
00067 #endif
00068
00069
00070 #define MAX_PATH 1024
00071 #define THREADTYPE void *
00072 #define PF_INET AF_INET
00073 #define PF_UNSPEC AF_UNSPEC
00074 typedef void * (*ThreadProto)(void *);
00075
00076
00077 #define stricmp strcasecmp
00078 #define strnicmp strncasecmp
00079 #define stristr strcasestr
00080 #define snwprintf swprintf
00081 #define dsl_mkdir(x,y) mkdir(x, y)
00082 #define stat64 stat
00083 #define lseek64 lseek
00084 #define tell64(x) lseek64(x, 0, SEEK_CUR)