1 /* {{{ irc-seven: Cows like it.
3 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center.
4 * Copyright (C) 1996-2002 Hybrid Development Team.
5 * Copyright (C) 2002-2005 ircd-ratbox development team.
6 * Copyright (C) 2005 William Pitcock and Jilles Tjoelker.
8 * Based on mkpasswd.c, originally by Nelson Minar (minar@reed.edu).
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to:
23 * Free Software Foundation, Inc.
24 * 51 Franklin St - Fifth Floor
25 * Boston, MA 02110-1301
33 static seven_log_cb log_callback
= NULL
;
34 static seven_log_cb restart_callback
= NULL
;
35 static seven_log_cb die_callback
= NULL
;
37 static char errbuf
[BUFSIZE
* 2];
39 /* {{{ void libseven_log() */
40 void libseven_log(const char *str
, ...)
44 if (log_callback
== NULL
)
48 ircvsnprintf(errbuf
, BUFSIZE
* 2, str
, args
);
55 /* {{{ void libseven_restart() */
56 void libseven_restart(const char *str
, ...)
60 if (restart_callback
== NULL
)
64 ircvsnprintf(errbuf
, BUFSIZE
* 2, str
, args
);
67 restart_callback(errbuf
);
71 /* {{{ void libseven_die() */
72 void libseven_die(const char *str
, ...)
76 if (die_callback
== NULL
)
80 ircvsnprintf(errbuf
, BUFSIZE
* 2, str
, args
);
87 /* {{{ void libseven_init() */
88 void libseven_init(seven_log_cb log_cb
, seven_log_cb restart_cb
, seven_log_cb die_cb
)
90 log_callback
= log_cb
;
91 restart_callback
= restart_cb
;
92 die_callback
= die_cb
;
104 * vim: ts=8 sw=8 noet fdm=marker tw=80