Add library init and shutdown.
This commit is contained in:
@@ -98,6 +98,9 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* initialize lib */
|
||||
xmpp_initialize();
|
||||
|
||||
/* create a context */
|
||||
ctx = xmpp_ctx_new(NULL, NULL);
|
||||
|
||||
@@ -118,5 +121,8 @@ int main(int argc, char **argv)
|
||||
xmpp_conn_release(conn);
|
||||
xmpp_ctx_free(ctx);
|
||||
|
||||
/* shutdown lib */
|
||||
xmpp_shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* init library */
|
||||
xmpp_initialize();
|
||||
|
||||
/* create a context */
|
||||
ctx = xmpp_ctx_new(NULL, NULL);
|
||||
|
||||
@@ -62,5 +65,7 @@ int main(int argc, char **argv)
|
||||
xmpp_conn_release(conn);
|
||||
xmpp_ctx_free(ctx);
|
||||
|
||||
xmpp_shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -103,6 +103,9 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* initialize lib */
|
||||
xmpp_initialize();
|
||||
|
||||
/* create a context */
|
||||
ctx = xmpp_ctx_new(NULL, NULL);
|
||||
|
||||
@@ -123,5 +126,8 @@ int main(int argc, char **argv)
|
||||
xmpp_conn_release(conn);
|
||||
xmpp_ctx_free(ctx);
|
||||
|
||||
/* shutdown lib */
|
||||
xmpp_shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
12
src/ctx.c
12
src/ctx.c
@@ -25,6 +25,18 @@
|
||||
#define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
||||
/* initialization and shutdown */
|
||||
|
||||
void xmpp_initialize(void)
|
||||
{
|
||||
sock_initialize();
|
||||
}
|
||||
|
||||
void xmpp_shutdown(void)
|
||||
{
|
||||
sock_shutdown();
|
||||
}
|
||||
|
||||
/** version **/
|
||||
|
||||
/* TODO: update from the build system? */
|
||||
|
||||
@@ -22,6 +22,11 @@
|
||||
#define XMPP_NS_DISCO_ITEMS "http://jabber.org/protocol/disco#items"
|
||||
#define XMPP_NS_ROSTER "jabber:iq:roster"
|
||||
|
||||
/** initialization and shutdown **/
|
||||
|
||||
void xmpp_initialize(void);
|
||||
void xmpp_shutdown(void);
|
||||
|
||||
/** version **/
|
||||
|
||||
int xmpp_version_check(int major, int minor);
|
||||
|
||||
Reference in New Issue
Block a user