00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __LIBGIFT_H
00018
#define __LIBGIFT_H
00019
00020
00021
00028
00029
00030
00031
#ifndef LIBGIFT_DEBUG
00032
# define LIBGIFT_DEBUG
00033
#endif
00034
00035
00036
#include "giftconfig.h"
00037
00038
00039
#ifndef LIBGIFT_EXPORT
00040
# define LIBGIFT_EXPORT
00041
#endif
00042
00043
00044
00045
#include <stdio.h>
00046
#include <stdlib.h>
00047
#include <string.h>
00048
#include <stdarg.h>
00049
#include <assert.h>
00050
#include <sys/types.h>
00051
00052
#ifdef HAVE_STDINT_H
00053
# include <stdint.h>
00054
#endif
00055
00056
#ifdef HAVE_INTTYPES_H
00057
# include <inttypes.h>
00058
#endif
00059
00060
#ifdef HAVE_UNISTD_H
00061
# include <unistd.h>
00062
#endif
00063
00064
#if TIME_WITH_SYS_TIME
00065
# include <time.h>
00066
# include <sys/time.h>
00067
#else
00068
# if HAVE_SYS_TIME_H
00069
# include <sys/time.h>
00070
# else
00071
# include <time.h>
00072
# endif
00073
#endif
00074
00075
00076
00077
#ifndef MIN
00078
# define MIN(x,y) (((x)<(y))?(x):(y))
00079
#endif
00080
00081
#ifndef MAX
00082
# define MAX(x,y) (((x)>(y))?(x):(y))
00083
#endif
00084
00085
#ifndef CLAMP
00086
# define CLAMP(value,min,max) (((value)<(min))?(min):(((value)>(max))?(max):(value)))
00087
#endif
00088
00089
#ifndef INTCMP
00090
# define INTCMP(x,y) (((x)>(y))?1:(((x)<(y))?-1:0))
00091
#endif
00092
00093
#ifndef BOOL_EXPR
00094
# define BOOL_EXPR(expr) ((expr)?(TRUE):(FALSE))
00095
#endif
00096
00097
00098
00099
#include "platform.h"
00100
#include "memory.h"
00101
#include "strobj.h"
00102
#include "parse.h"
00103
00104
#include "dataset.h"
00105
#include "list.h"
00106
#include "list_lock.h"
00107
#include "tree.h"
00108
#include "array.h"
00109
00110
#include "event.h"
00111
#include "network.h"
00112
#include "tcpc.h"
00113
#include "interface.h"
00114
00115
#include "conf.h"
00116
#include "log.h"
00117
00118
00119
00120 EXTERN_C_BEGIN
00121
00122
00123
00137 LIBGIFT_EXPORT
00138
int libgift_init (
const char *prog, LogOptions opt,
const char *logfile);
00139
00144 LIBGIFT_EXPORT
00145
int libgift_finish (
void);
00146
00147
00148
00149 EXTERN_C_END
00150
00151
00152
00153
#endif