Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[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 #elif defined(HAVE_DB4_DB_H)
15 #include <db4/db.h>
16 #else
17 #error Neither <db.h> nor <db4/db.h> was found by configure. Install db4-devel.
18 #endif
19
20
21 #if DB_VERSION_MAJOR < 4 || DB_VERSION_MINOR < 1
22 #error Citadel requires Berkeley DB v4.1 or newer.  Please upgrade.
23 #endif
24
25 #include "server.h"
26 #include "database.h"
27
28 #if SIZEOF_SIZE_T == SIZEOF_INT 
29 #define SIZE_T_FMT "%d"
30 #else
31 #define SIZE_T_FMT "%ld"
32 #endif
33
34 void cputbuf(const StrBuf *Buf);
35
36 #ifdef __GNUC__
37 void cprintf (const char *format, ...) __attribute__((__format__(__printf__,1,2)));
38 #else
39 void cprintf (const char *format, ...);
40 #endif
41
42 void init_sysdep (void);
43 int ctdl_tcp_server(char *ip_addr, int port_number, int queue_len, char *errormessage);
44 int ctdl_uds_server(char *sockpath, int queue_len, char *errormessage);
45 void buffer_output(void);
46 void unbuffer_output(void);
47 void flush_output(void);
48 int client_write (const char *buf, int nbytes);
49 int client_read_to (char *buf, int bytes, int timeout);
50 int client_read (char *buf, int bytes);
51 int client_getln (char *buf, int maxbytes);
52 int CtdlClientGetLine(StrBuf *Target);
53 int client_read_blob(StrBuf *Target, int bytes, int timeout);
54 void client_set_inbound_buf(long N);
55 int client_read_random_blob(StrBuf *Target, int timeout);
56 void client_close(void);
57 void sysdep_master_cleanup (void);
58 void kill_session (int session_to_kill);
59 void start_daemon (int do_close_stdio);
60 void checkcrash(void);
61 void cmd_nset (char *cmdbuf);
62 int convert_login (char *NameToConvert);
63 void init_master_fdset(void);
64 void *worker_thread(void *);
65
66 extern volatile int exit_signal;
67 extern volatile int shutdown_and_halt;
68 extern volatile int running_as_daemon;
69 extern volatile int restart_server;
70
71 extern int verbosity;
72 extern int rescan[];
73
74
75 extern int SyslogFacility(char *name);
76
77 #endif /* SYSDEP_DECLS_H */