summaryrefslogtreecommitdiffstats
path: root/ircxmpp.h
diff options
context:
space:
mode:
Diffstat (limited to 'ircxmpp.h')
-rw-r--r--ircxmpp.h74
1 files changed, 48 insertions, 26 deletions
diff --git a/ircxmpp.h b/ircxmpp.h
index da03aa5..89f23a8 100644
--- a/ircxmpp.h
+++ b/ircxmpp.h
@@ -1,4 +1,6 @@
-#include <libircclient.h>
+#ifdef IX_LIB /* do not use functions until #else in programs that use libircxmpp. */
+#include <libircclient.h> /* do not use members of struct ircxmpp, use opaque ircxmpp type! */
+#include <strophe.h>
enum irc_numeric { /* numerics from rfc 1459 */
ERR_NOSUCHNICK = 401,
ERR_NOSUCHSERVER,
@@ -165,32 +167,52 @@ struct ircxmpp {
char * muc;
char * channel_password;
};
-void free_bridge (struct bridge **, const char *);
-void free_bridges (struct bridge **);
-struct bridge ** find_bridge (struct bridge **, const char *, enum side);
-void jid2ircnick (char *);
-void jid2ircuser (char *);
-void bridge_forward (const char *, const char *, struct ircxmpp *, enum side);
-int message_handler (xmpp_conn_t * const, xmpp_stanza_t * const, void * const);
-int presence_handler (xmpp_conn_t * const, xmpp_stanza_t * const, void * const);
-void conn_handler (xmpp_conn_t * const, const xmpp_conn_event_t, const int,
+static void free_bridge (struct bridge **, const char *);
+static void free_bridges (struct bridge **);
+static struct bridge ** find_bridge (struct bridge **, const char *, enum side);
+static void jid2ircnick (char *);
+static void jid2ircuser (char *);
+static void bridge_forward (const char *, const char *, struct ircxmpp *, enum side);
+static int message_handler (xmpp_conn_t * const, xmpp_stanza_t * const, void * const);
+static int presence_handler (xmpp_conn_t * const, xmpp_stanza_t * const, void * const);
+static void conn_handler (xmpp_conn_t * const, const xmpp_conn_event_t, const int,
xmpp_stream_error_t * const, void * const);
-void conn_handler_bridge (xmpp_conn_t * const, const xmpp_conn_event_t, const int,
+static void conn_handler_bridge (xmpp_conn_t * const, const xmpp_conn_event_t, const int,
xmpp_stream_error_t * const, void * const);
// IRC
-void dump_event (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_connect (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_connect_control (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_privmsg (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_partquit_control (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_join_control (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_channel_control (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_nick_control(irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_topic_control (irc_session_t *, const char *, const char *, const char **, unsigned);
-void event_numeric (irc_session_t *, unsigned int, const char *, const char **, unsigned);
-void event_numeric_control (irc_session_t *, unsigned int, const char *, const char **, unsigned);
-int irc_run_once (struct bridge *);
-void init_irc (struct bridge *);
-void init_irc_control (struct ircxmpp *);
+static void dump_event (irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_connect (irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_connect_control (
+ irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_privmsg (irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_partquit_control (
+ irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_join_control (
+ irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_channel_control (
+ irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_nick_control(irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_topic_control (
+ irc_session_t *, const char *, const char *, const char **, unsigned);
+static void event_numeric (
+ irc_session_t *, unsigned int, const char *, const char **, unsigned);
+static void event_numeric_control (
+ irc_session_t *, unsigned int, const char *, const char **, unsigned);
+static int irc_run_once (struct bridge *);
+static void init_irc (struct bridge *);
+static void init_irc_control (struct ircxmpp *);
// /IRC
-int main (void);
+#endif // IX_LIB
+// ZUNANJE
+typedef struct ircxmpp ircxmpp; /* opaque handle */
+ircxmpp * ircxmpp_init (void);
+void ircxmpp_set_jid (ircxmpp *, const char *);
+void ircxmpp_set_password (ircxmpp *, const char *);
+void ircxmpp_set_hostname (ircxmpp *, const char *);
+void ircxmpp_set_port (ircxmpp *, unsigned short int);
+void ircxmpp_set_channel (ircxmpp *, const char *);
+void ircxmpp_set_muc (ircxmpp *, const char *);
+void ircxmpp_set_channel_password (ircxmpp *, const char *);
+void ircxmpp_run_once (struct ircxmpp *);
+void ircxmpp_free (struct ircxmpp *);
+// /ZUNANJE