Watt-32 tcp/ip  2.2 dev-rel.10
run.h
1 #ifndef _w32_RUN_H
2 #define _w32_RUN_H
3 
4 #define DAEMON_PERIOD 500 /* run daemons every 500msec */
5 
6 #define startup_add W32_NAMESPACE (startup_add)
7 #define startup_run W32_NAMESPACE (startup_run)
8 #define startup_dump W32_NAMESPACE (startup_dump)
9 #define rundown_add W32_NAMESPACE (rundown_add)
10 #define rundown_run W32_NAMESPACE (rundown_run)
11 #define rundown_dump W32_NAMESPACE (rundown_dump)
12 #define daemon_add W32_NAMESPACE (daemon_add)
13 #define daemon_del W32_NAMESPACE (daemon_del)
14 #define daemon_run W32_NAMESPACE (daemon_run)
15 
16 /* This points to an internal Watt-32 function. ('__cdecl' or
17  * '__fastcall' depending on what $(CFLAGS) where used in the
18  * Makefile). Watch out for $(CC) warnings when calling
19  * RUNDOWN_ADD(). The function MUST mmatch the expected calling-
20  * convention. Your $(CC) may ignore an illegal cast of '(_VoidProc)func'.
21  */
22 typedef void (*_VoidProc) (void);
23 
24 extern int startup_add (_VoidProc func, const char *name,
25  int order, const char *file, unsigned line);
26 
27 extern int rundown_add (_VoidProc func, const char *name,
28  int order, const char *file, unsigned line);
29 
30 extern int daemon_add (_VoidProc func, const char *name,
31  const char *file, unsigned line);
32 
33 extern int daemon_del (_VoidProc func, const char *name,
34  const char *file, unsigned line);
35 
36 extern void startup_run (void);
37 extern void startup_dump (void);
38 
39 extern void rundown_run (void);
40 extern void rundown_dump (void);
41 
42 extern int daemon_run (void);
43 extern void daemon_clear (void);
44 
45 
46 #define STARTUP_ADD(func,order) \
47  startup_add (func, #func, order, __FILE__, __LINE__)
48 
49 #define RUNDOWN_ADD(func,order) \
50  rundown_add (func, #func, order, __FILE__, __LINE__)
51 
52 #define DAEMON_ADD(func) \
53  daemon_add (func, #func, __FILE__, __LINE__)
54 
55 #define DAEMON_DEL(func) \
56  daemon_del (func, #func, __FILE__, __LINE__)
57 
58 #endif