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"
66 struct ctrlproxy_config *config;
67 GList *new_network_notifiers;
69 GList *nickserv_nicks;
71 GIOChannel *unix_incoming;
72 gint unix_incoming_id;
78 gboolean (*init) (void);
82 G_MODULE_EXPORT const char *ctrlproxy_version(void);
83 G_MODULE_EXPORT const char *get_my_hostname(void);
85 typedef void (*config_load_notify_fn) (struct global *);
86 typedef void (*config_save_notify_fn) (struct global *, const char *);
87 G_MODULE_EXPORT void register_load_config_notify(config_load_notify_fn fn);
88 G_MODULE_EXPORT void register_save_config_notify(config_save_notify_fn fn);
91 G_MODULE_EXPORT char *list_make_string(GList *);
92 G_MODULE_EXPORT int verify_client(const struct network *s, const struct client *c);
93 G_MODULE_EXPORT int str_rfc1459cmp(const char *a, const char *b);
94 G_MODULE_EXPORT int str_strictrfc1459cmp(const char *a, const char *b);
95 G_MODULE_EXPORT int str_asciicmp(const char *a, const char *b);
96 G_MODULE_EXPORT char *g_io_channel_ip_get_description(GIOChannel *ch);
99 G_MODULE_EXPORT void log_network(enum log_level, const struct network *, const char *fmt, ...);
100 G_MODULE_EXPORT void log_client(enum log_level, const struct client *, const char *fmt, ...);
101 G_MODULE_EXPORT void log_global(enum log_level, const char *fmt, ...);
102 G_MODULE_EXPORT void log_network_state(enum log_level l, const struct network_state *st, const char *fmt, ...);
104 gboolean rep_g_file_get_contents (const gchar *filename,
108 gboolean rep_g_file_set_contents (const gchar *filename,
109 const gchar *contents,
112 #if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 8
113 #define g_file_get_contents rep_g_file_get_contents
114 #define g_file_set_contents rep_g_file_set_contents
117 #endif /* __CTRLPROXY_H__ */