Add library init and shutdown.

This commit is contained in:
Jack Moffitt
2005-06-15 05:37:24 +00:00
parent 0d311771bb
commit 3cf080bb2d
5 changed files with 34 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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? */

View File

@@ -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);