Mailing list header changes (fuck you Google)
[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 #include <db.h>
13
14 #if DB_VERSION_MAJOR < 5
15 #error Citadel requires Berkeley DB v5 or newer.  Please upgrade.
16 #endif
17
18 #include "server.h"
19 #include "database.h"
20
21 #if SIZEOF_SIZE_T == SIZEOF_INT 
22 #define SIZE_T_FMT "%d"
23 #else
24 #define SIZE_T_FMT "%ld"
25 #endif
26
27 #if SIZEOF_LOFF_T == SIZEOF_LONG 
28 #define LOFF_T_FMT "%ld"
29 #else
30 #define LOFF_T_FMT "%lld"
31 #endif
32
33 void cputbuf(const StrBuf *Buf);
34
35 #ifdef __GNUC__
36 void cprintf (const char *format, ...) __attribute__((__format__(__printf__,1,2)));
37 #else
38 void cprintf (const char *format, ...);
39 #endif
40
41 void init_sysdep (void);
42 int ctdl_tcp_server(char *ip_addr, int port_number, int queue_len, char *errormessage);
43 int ctdl_uds_server(char *sockpath, int queue_len, char *errormessage);
44 void buffer_output(void);
45 void unbuffer_output(void);
46 void flush_output(void);
47 int client_write (const char *buf, int nbytes);
48 int client_read_to (char *buf, int bytes, int timeout);
49 int client_read (char *buf, int bytes);
50 int client_getln (char *buf, int maxbytes);
51 int CtdlClientGetLine(StrBuf *Target);
52 int client_read_blob(StrBuf *Target, int bytes, int timeout);
53 void client_set_inbound_buf(long N);
54 int client_read_random_blob(StrBuf *Target, int timeout);
55 void client_close(void);
56 void sysdep_master_cleanup (void);
57 void kill_session (int session_to_kill);
58 void start_daemon (int do_close_stdio);
59 void checkcrash(void);
60 int convert_login (char *NameToConvert);
61 void init_master_fdset(void);
62 void *worker_thread(void *);
63
64 extern volatile int exit_signal;
65 extern volatile int shutdown_and_halt;
66 extern volatile int running_as_daemon;
67 extern volatile int restart_server;
68
69 extern int verbosity;
70 extern int rescan[];
71
72
73 extern int SyslogFacility(char *name);
74
75 #endif /* SYSDEP_DECLS_H */