#include #include // the state of net typedef enum { DISCONNECTED, // initial state } net_state_t; // these variables stay initialized for the whole runtime static net_state_t state; static xmpp_log_t* log; static xmpp_ctx_t* ctx; void net_init(void) { fprintf(stderr, "limox: net_init()\n"); xmpp_initialize(); log = xmpp_get_default_logger(XMPP_LEVEL_DEBUG); // or NULL for silence ctx = xmpp_ctx_new(NULL, log); state = DISCONNECTED; } void net_run_once(void) { // TODO } void net_quit(void) { fprintf(stderr, "limox: net_quit()\n"); xmpp_ctx_free(ctx); xmpp_shutdown(); } void net_connect(const char* jid, const char* password) { // TODO } void net_disconnect(void) { // TODO } void net_send_message(const char* sender, const char* content, const char* recipient) { // TODO }