diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-04-30 02:10:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-04-30 02:10:29 +0200 |
commit | 743086cf4e69c77e139c23defaf63bfa403c1678 (patch) | |
tree | 752cb5c0427ea9ea306ee200f0b1148a8fa33ab2 /ircxmpp.h | |
parent | oh, looh, security issues already (diff) | |
download | ircxmpp-743086cf4e69c77e139c23defaf63bfa403c1678.tar ircxmpp-743086cf4e69c77e139c23defaf63bfa403c1678.tar.gz ircxmpp-743086cf4e69c77e139c23defaf63bfa403c1678.tar.bz2 ircxmpp-743086cf4e69c77e139c23defaf63bfa403c1678.tar.lz ircxmpp-743086cf4e69c77e139c23defaf63bfa403c1678.tar.xz ircxmpp-743086cf4e69c77e139c23defaf63bfa403c1678.tar.zst ircxmpp-743086cf4e69c77e139c23defaf63bfa403c1678.zip |
Diffstat (limited to 'ircxmpp.h')
-rw-r--r-- | ircxmpp.h | 74 |
1 files changed, 48 insertions, 26 deletions
@@ -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 |