Revision 18c8241a lib/birdlib.h

View differences:

lib/birdlib.h
13 13

  
14 14
#define OFFSETOF(s, i) ((unsigned int)&((s *)0)->i)
15 15
#define SKIP_BACK(s, i, p) ((s *)((char *)p - OFFSETOF(s, i)))
16
#define ALIGN(s, a) (((s)+a-1)&~(a-1))
17

  
18
/* Functions which don't return */
19

  
20
#define NORET __attribute__((noreturn))
16 21

  
17 22
/* Logging and dying */
18 23

  
19 24
void log(char *msg, ...);
20
void die(char *msg, ...);
25
void die(char *msg, ...) NORET;
21 26

  
22 27
#define L_DEBUG "\001"			/* Debugging messages */
23 28
#define L_INFO "\002"			/* Informational messages */
24 29
#define L_WARN "\003"			/* Warnings */
25 30
#define L_ERR "\004"			/* Errors */
26 31
#define L_AUTH "\005"			/* Authorization failed etc. */
32
#define L_FATAL "\006"			/* Fatal errors */
33

  
34
void log_init(char *);			/* Initialize logging to given file (NULL=stderr, ""=syslog) */
35
void log_init_debug(char *);		/* Initialize debug dump to given file (NULL=stderr, ""=off) */
36

  
37
void debug(char *msg, ...);		/* Printf to debug output */
27 38

  
28 39
/* Debugging */
29 40

  

Also available in: Unified diff