From 7c7e844f43be280cbe0f74319a15abd82f9ee8a3 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 29 Jun 2005 18:07:20 +0000 Subject: [PATCH] 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. --- SConstruct | 1 - examples/{basic_logging.c => basic.c} | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) rename examples/{basic_logging.c => basic.c} (86%) diff --git a/SConstruct b/SConstruct index d1b0f2f..691c9ba 100644 --- a/SConstruct +++ b/SConstruct @@ -61,7 +61,6 @@ Headers = Split(""" Examples = Split(""" basic.c - basic_logging.c active.c roster.c """) diff --git a/examples/basic_logging.c b/examples/basic.c similarity index 86% rename from examples/basic_logging.c rename to examples/basic.c index 34dd4cf..351c9eb 100644 --- a/examples/basic_logging.c +++ b/examples/basic.c @@ -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 \n\n"); + fprintf(stderr, "Usage: basic []\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;