2 ctrlproxy: A modular IRC proxy
3 (c) 2002 Jelmer Vernooij <jelmer@nl.linux.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __CTRLPROXY_H__
21 #define __CTRLPROXY_H__
32 * @brief Main functions
35 #if defined(STRICT_MEMORY_ALLOCS) && !defined(SWIGPYTHON)
36 #define calloc(a,b) __ERROR_USE_G_NEW0__
37 #define malloc(a) __ERROR_USE_G_MALLOC_OR_G_NEW__
38 #define realloc(a,b) __ERROR_USE_G_REALLOC_OR_G_RE_NEW__
39 #define free(a) __ERROR_USE_G_FREE__
41 #define strdup(a) __ERROR_USE_G_STRDUP__
43 #define strndup(a) __ERROR_USE_G_STRNDUP__
46 #ifndef G_MODULE_EXPORT
47 #define G_MODULE_EXPORT
54 #include "linestack.h"
64 struct ctrlproxy_config *config;
65 GList *new_network_notifiers;
67 GList *nickserv_nicks;
69 GIOChannel *unix_incoming;
70 gint unix_incoming_id;
76 gboolean (*init) (void);
80 G_MODULE_EXPORT const char *ctrlproxy_version(void);
81 G_MODULE_EXPORT const char *get_my_hostname(void);
83 typedef void (*config_load_notify_fn) (struct global *);
84 typedef void (*config_save_notify_fn) (struct global *, const char *);
85 G_MODULE_EXPORT void register_load_config_notify(config_load_notify_fn fn);
86 G_MODULE_EXPORT void register_save_config_notify(config_save_notify_fn fn);
89 G_MODULE_EXPORT char *list_make_string(GList *);
90 G_MODULE_EXPORT int verify_client(const struct network *s, const struct client *c);
91 G_MODULE_EXPORT int str_rfc1459cmp(const char *a, const char *b);
92 G_MODULE_EXPORT int str_strictrfc1459cmp(const char *a, const char *b);
93 G_MODULE_EXPORT int str_asciicmp(const char *a, const char *b);
94 G_MODULE_EXPORT char *g_io_channel_ip_get_description(GIOChannel *ch);
97 enum log_level { LOG_DATA=5, LOG_TRACE=4, LOG_INFO=3, LOG_WARNING=2, LOG_ERROR=1 };
98 G_MODULE_EXPORT void log_network(enum log_level, const struct network *, const char *fmt, ...);
99 G_MODULE_EXPORT void log_client(enum log_level, const struct client *, const char *fmt, ...);
100 G_MODULE_EXPORT void log_global(enum log_level, const char *fmt, ...);
101 G_MODULE_EXPORT void log_network_state(enum log_level l, const struct network_state *st, const char *fmt, ...);
103 #endif /* __CTRLPROXY_H__ */