* sysdep.c: optimized MyContext() a bit, and inlined it. A little profiling
[citadel.git] / citadel / sysdep_decls.h
1 /* $Id$ */
2
3 #include <pthread.h>
4 #include "sysdep.h"
5 #include "server.h"
6
7 #ifdef __GNUC__
8 void lprintf (int loglevel, const char *format, ...) __attribute__((__format__(__printf__,2,3)));
9 void cprintf (const char *format, ...) __attribute__((__format__(__printf__,1,2)));
10 #else
11 void lprintf (int loglevel, const char *format, ...);
12 void cprintf (const char *format, ...);
13 #endif
14
15 void init_sysdep (void);
16 void begin_critical_section (int which_one);
17 void end_critical_section (int which_one);
18 int ig_tcp_server (int port_number, int queue_len);
19 int ig_uds_server(char *sockpath, int queue_len);
20 inline struct CitContext *MyContext (void);
21 struct CitContext *CreateNewContext (void);
22 void InitMyContext (struct CitContext *con);
23 void client_write (char *buf, int nbytes);
24 int client_read_to (char *buf, int bytes, int timeout);
25 int client_read (char *buf, int bytes);
26 int client_gets (char *buf);
27 void sysdep_master_cleanup (void);
28 void kill_session (int session_to_kill);
29 void *sd_context_loop (struct CitContext *con);
30 void start_daemon (int do_close_stdio);
31 void cmd_nset (char *cmdbuf);
32 int convert_login (char *NameToConvert);
33 void *worker_thread (void *arg);
34 void become_session(struct CitContext *which_con);
35 void CtdlRedirectOutput(FILE *fp, int sock);
36 void InitializeMasterCC(void);
37 void init_master_fdset(void);
38 void create_worker(void);
39
40 extern int num_sessions;
41 extern volatile int time_to_die;
42 extern int verbosity;
43 extern int rescan[];
44 extern pthread_t initial_thread;
45
46 extern struct worker_node {
47         pthread_t tid;
48         struct worker_node *next;
49 } *worker_list;