]>
Commit | Line | Data |
---|---|---|
db137867 AC |
1 | /* |
2 | * ircd-ratbox: A slightly useful ircd | |
3 | * helper.h: Starts and deals with ircd helpers | |
55abcbb2 | 4 | * |
db137867 AC |
5 | * Copyright (C) 2006 Aaron Sethman <androsyn@ratbox.org> |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 | |
20 | * USA | |
21 | * | |
3202e249 | 22 | * $Id: rb_helper.h 26092 2008-09-19 15:13:52Z androsyn $ |
db137867 AC |
23 | */ |
24 | ||
25 | #ifndef RB_LIB_H | |
26 | # error "Do not use helper.h directly" | |
27 | #endif | |
28 | ||
29 | #ifndef INCLUDED_helper_h | |
30 | #define INCLUDED_helper_h | |
31 | ||
32 | struct _rb_helper; | |
33 | typedef struct _rb_helper rb_helper; | |
34 | ||
35 | typedef void rb_helper_cb(rb_helper *); | |
36 | ||
37 | ||
38 | ||
3202e249 VY |
39 | rb_helper *rb_helper_start(const char *name, const char *fullpath, rb_helper_cb * read_cb, |
40 | rb_helper_cb * error_cb); | |
db137867 | 41 | |
3202e249 VY |
42 | rb_helper *rb_helper_child(rb_helper_cb * read_cb, rb_helper_cb * error_cb, |
43 | log_cb * ilog, restart_cb * irestart, die_cb * idie, | |
29c92cf9 | 44 | size_t lb_heap_size, size_t dh_size, size_t fd_heap_size); |
db137867 AC |
45 | |
46 | void rb_helper_restart(rb_helper *helper); | |
47 | #ifdef __GNUC__ | |
3202e249 VY |
48 | void |
49 | rb_helper_write(rb_helper *helper, const char *format, ...) | |
50 | __attribute((format(printf, 2, 3))); | |
51 | void rb_helper_write_queue(rb_helper *helper, const char *format, ...) | |
52 | __attribute((format(printf, 2, 3))); | |
db137867 AC |
53 | #else |
54 | void rb_helper_write(rb_helper *helper, const char *format, ...); | |
55 | void rb_helper_write_queue(rb_helper *helper, const char *format, ...); | |
56 | #endif | |
57 | void rb_helper_write_flush(rb_helper *helper); | |
3202e249 | 58 | |
db137867 AC |
59 | void rb_helper_run(rb_helper *helper); |
60 | void rb_helper_close(rb_helper *helper); | |
61 | int rb_helper_read(rb_helper *helper, void *buf, size_t bufsize); | |
62 | void rb_helper_loop(rb_helper *helper, long delay); | |
63 | #endif |