The battle against bit rot continues!
[citadel.git] / citadel / sysdep_decls.h
1
2 #ifndef SYSDEP_DECLS_H
3 #define SYSDEP_DECLS_H
4
5 #include <stdarg.h>
6 #include "sysdep.h"
7
8 #ifdef HAVE_PTHREAD_H
9 #include <pthread.h>
10 #endif
11
12 #ifdef HAVE_DB_H
13 #include <db.h>
14 #error <db.h> was not found by configure. Install the Berkeley DB development package.
15 #endif
16
17 #if DB_VERSION_MAJOR < 5
18 #error Citadel requires Berkeley DB v5 or newer.  Please upgrade.
19 #endif
20
21 #include "server.h"
22 #include "database.h"
23
24 #if SIZEOF_SIZE_T == SIZEOF_INT 
25 #define SIZE_T_FMT "%d"
26 #else
27 #define SIZE_T_FMT "%ld"
28 #endif
29
30 #if SIZEOF_LOFF_T == SIZEOF_LONG 
31 #define LOFF_T_FMT "%ld"
32 #else
33 #define LOFF_T_FMT "%lld"
34 #endif
35
36 void cputbuf(const StrBuf *Buf);
37
38 #ifdef __GNUC__
39 void cprintf (const char *format, ...) __attribute__((__format__(__printf__,1,2)));
40 #else
41 void cprintf (const char *format, ...);
42 #endif
43
44 void init_sysdep (void);
45 int ctdl_tcp_server(char *ip_addr, int port_number, int queue_len, char *errormessage);
46 int ctdl_uds_server(char *sockpath, int queue_len, char *errormessage);
47 void buffer_output(void);
48 void unbuffer_output(void);
49 void flush_output(void);
50 int client_write (const char *buf, int nbytes);
51 int client_read_to (char *buf, int bytes, int timeout);
52 int client_read (char *buf, int bytes);
53 int client_getln (char *buf, int maxbytes);
54 int CtdlClientGetLine(StrBuf *Target);
55 int client_read_blob(StrBuf *Target, int bytes, int timeout);
56 void client_set_inbound_buf(long N);
57 int client_read_random_blob(StrBuf *Target, int timeout);
58 void client_close(void);
59 void sysdep_master_cleanup (void);
60 void kill_session (int session_to_kill);
61 void start_daemon (int do_close_stdio);
62 void checkcrash(void);
63 int convert_login (char *NameToConvert);
64 void init_master_fdset(void);
65 void *worker_thread(void *);
66
67 extern volatile int exit_signal;
68 extern volatile int shutdown_and_halt;
69 extern volatile int running_as_daemon;
70 extern volatile int restart_server;
71
72 extern int verbosity;
73 extern int rescan[];
74
75
76 extern int SyslogFacility(char *name);
77
78 #endif /* SYSDEP_DECLS_H */