2000-01-19 23:07:00 +08:00
|
|
|
/*
|
|
|
|
* BIRD Client -- Utility Functions
|
|
|
|
*
|
|
|
|
* (c) 1999--2000 Martin Mares <mj@ucw.cz>
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "nest/bird.h"
|
|
|
|
#include "client/client.h"
|
|
|
|
|
|
|
|
/* Client versions of logging functions */
|
|
|
|
|
2000-02-15 20:18:37 +08:00
|
|
|
/* FIXME: Use bsprintf, so that %m works */
|
|
|
|
|
2000-01-19 23:07:00 +08:00
|
|
|
void
|
|
|
|
bug(char *msg, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, msg);
|
2000-02-15 20:18:37 +08:00
|
|
|
cleanup();
|
2000-01-19 23:07:00 +08:00
|
|
|
fputs("Internal error: ", stderr);
|
|
|
|
vfprintf(stderr, msg, args);
|
|
|
|
fputc('\n', stderr);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
die(char *msg, ...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, msg);
|
2000-02-15 20:18:37 +08:00
|
|
|
cleanup();
|
2000-01-19 23:07:00 +08:00
|
|
|
vfprintf(stderr, msg, args);
|
|
|
|
fputc('\n', stderr);
|
|
|
|
exit(1);
|
|
|
|
}
|