1998-04-22 12:58:34 +00:00
|
|
|
/*
|
|
|
|
* BIRD Library
|
|
|
|
*
|
|
|
|
* (c) 1998 Martin Mares <mj@ucw.cz>
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _BIRD_BIRDLIB_H_
|
|
|
|
#define _BIRD_BIRDLIB_H_
|
|
|
|
|
|
|
|
/* Ugly structure offset handling macros */
|
|
|
|
|
|
|
|
#define OFFSETOF(s, i) ((unsigned int)&((s *)0)->i)
|
|
|
|
#define SKIP_BACK(s, i, p) ((s *)((char *)p - OFFSETOF(s, i)))
|
|
|
|
|
1998-04-23 14:01:15 +00:00
|
|
|
/* Logging and dying */
|
|
|
|
|
|
|
|
void log(char *msg, ...);
|
|
|
|
void die(char *msg, ...);
|
|
|
|
|
|
|
|
#define L_DEBUG "\001" /* Debugging messages */
|
|
|
|
#define L_INFO "\002" /* Informational messages */
|
|
|
|
#define L_WARN "\003" /* Warnings */
|
|
|
|
#define L_ERR "\004" /* Errors */
|
|
|
|
#define L_AUTH "\005" /* Authorization failed etc. */
|
|
|
|
|
|
|
|
/* Debugging */
|
|
|
|
|
|
|
|
#ifdef LOCAL_DEBUG
|
|
|
|
#define DBG(x, y...) log(L_DEBUG x, ##y)
|
|
|
|
#else
|
|
|
|
#define DBG(x, y...)
|
|
|
|
#endif
|
|
|
|
|
1998-04-22 12:58:34 +00:00
|
|
|
#endif
|