Rename basic_logging.c to basic.c, replacing the old version.

Having debugging on by default in the example seems to help
people trying out the library, and with the default_logger()
call it's not too much extra complication.

We should also write an example/complex.c that exercises
all the callback options, a custom allocator and so on.
This commit is contained in:
Ralph Giles
2005-06-29 18:07:20 +00:00
parent a6d7d9ef96
commit 7c7e844f43
2 changed files with 7 additions and 6 deletions

View File

@@ -61,7 +61,6 @@ Headers = Split("""
Examples = Split("""
basic.c
basic_logging.c
active.c
roster.c
""")

View File

@@ -45,7 +45,7 @@ int main(int argc, char **argv)
/* take a jid and password on the command line,
with optional server to connect to */
if ((argc < 3) || (argc > 4)) {
fprintf(stderr, "Usage: basic <jid> <pass> <server>\n\n");
fprintf(stderr, "Usage: basic <jid> <pass> [<server>]\n\n");
return 1;
}
@@ -68,19 +68,21 @@ int main(int argc, char **argv)
conn = xmpp_conn_new(ctx);
/* setup authentication information */
xmpp_conn_set_jid(conn, argv[1]);
xmpp_conn_set_pass(conn, argv[2]);
xmpp_conn_set_jid(conn, jid);
xmpp_conn_set_pass(conn, pass);
/* initiate connection */
xmpp_connect_client(conn, argv[3], conn_handler, ctx);
xmpp_connect_client(conn, server, conn_handler, ctx);
/* start the event loop */
/* enter the event loop -
our connect handler will trigger an exit */
xmpp_run(ctx);
/* release our connection and context */
xmpp_conn_release(conn);
xmpp_ctx_free(ctx);
/* final shutdown of the library */
xmpp_shutdown();
return 0;