The battle against bit rot continues!
[citadel.git] / citadel / sysdep_decls.h
index c2ef5b8fa0ff0e114bece104cca201d467e785c8..781d2c02644f4d8fbf4352215672ad2e6004c6d8 100644 (file)
@@ -1 +1,78 @@
-void sysdep_master_cleanup(void);
+
+#ifndef SYSDEP_DECLS_H
+#define SYSDEP_DECLS_H
+
+#include <stdarg.h>
+#include "sysdep.h"
+
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+
+#ifdef HAVE_DB_H
+#include <db.h>
+#error <db.h> was not found by configure. Install the Berkeley DB development package.
+#endif
+
+#if DB_VERSION_MAJOR < 5
+#error Citadel requires Berkeley DB v5 or newer.  Please upgrade.
+#endif
+
+#include "server.h"
+#include "database.h"
+
+#if SIZEOF_SIZE_T == SIZEOF_INT 
+#define SIZE_T_FMT "%d"
+#else
+#define SIZE_T_FMT "%ld"
+#endif
+
+#if SIZEOF_LOFF_T == SIZEOF_LONG 
+#define LOFF_T_FMT "%ld"
+#else
+#define LOFF_T_FMT "%lld"
+#endif
+
+void cputbuf(const StrBuf *Buf);
+
+#ifdef __GNUC__
+void cprintf (const char *format, ...) __attribute__((__format__(__printf__,1,2)));
+#else
+void cprintf (const char *format, ...);
+#endif
+
+void init_sysdep (void);
+int ctdl_tcp_server(char *ip_addr, int port_number, int queue_len, char *errormessage);
+int ctdl_uds_server(char *sockpath, int queue_len, char *errormessage);
+void buffer_output(void);
+void unbuffer_output(void);
+void flush_output(void);
+int client_write (const char *buf, int nbytes);
+int client_read_to (char *buf, int bytes, int timeout);
+int client_read (char *buf, int bytes);
+int client_getln (char *buf, int maxbytes);
+int CtdlClientGetLine(StrBuf *Target);
+int client_read_blob(StrBuf *Target, int bytes, int timeout);
+void client_set_inbound_buf(long N);
+int client_read_random_blob(StrBuf *Target, int timeout);
+void client_close(void);
+void sysdep_master_cleanup (void);
+void kill_session (int session_to_kill);
+void start_daemon (int do_close_stdio);
+void checkcrash(void);
+int convert_login (char *NameToConvert);
+void init_master_fdset(void);
+void *worker_thread(void *);
+
+extern volatile int exit_signal;
+extern volatile int shutdown_and_halt;
+extern volatile int running_as_daemon;
+extern volatile int restart_server;
+
+extern int verbosity;
+extern int rescan[];
+
+
+extern int SyslogFacility(char *name);
+
+#endif /* SYSDEP_DECLS_H */