From a6d7d9ef964890536817098ee28aeb29538706b5 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Wed, 29 Jun 2005 17:54:29 +0000 Subject: [PATCH] remove basic.c in preparation for replacing it with basic_logging.c. svn is stupid. --- examples/basic.c | 71 ------------------------------------------------ 1 file changed, 71 deletions(-) delete mode 100644 examples/basic.c diff --git a/examples/basic.c b/examples/basic.c deleted file mode 100644 index 4bf337c..0000000 --- a/examples/basic.c +++ /dev/null @@ -1,71 +0,0 @@ -/* basic.c -** libstrophe XMPP client library -- basic usage example -** -** Copyright (C) 2005 OGG, LCC. All rights reserved. -** -** This software is provided AS-IS with no warranty, either express -** or implied. -** -** This software is distributed under license and may not be copied, -** modified or distributed except as expressly authorized under the -** terms of the license contained in the file LICENSE.txt in this -** distribution. -*/ - -#include - -#include - -void conn_handler(xmpp_conn_t * const conn, const xmpp_conn_event_t status, - const int error, xmpp_stream_error_t * const stream_error, - void * const userdata) -{ - xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata; - - if (status == XMPP_CONN_CONNECT) { - fprintf(stderr, "DEBUG: connected\n"); - xmpp_disconnect(conn); - } - else { - fprintf(stderr, "DEBUG: disconnected\n"); - xmpp_stop(ctx); - } -} - -int main(int argc, char **argv) -{ - xmpp_ctx_t *ctx; - xmpp_conn_t *conn; - - if (argc != 4) { - fprintf(stderr, "Usage: basic \n\n"); - return 1; - } - - /* init library */ - xmpp_initialize(); - - /* create a context */ - ctx = xmpp_ctx_new(NULL, NULL); - - /* create a connection */ - conn = xmpp_conn_new(ctx); - - /* setup authentication information */ - xmpp_conn_set_jid(conn, argv[1]); - xmpp_conn_set_pass(conn, argv[2]); - - /* initiate connection */ - xmpp_connect_client(conn, argv[3], conn_handler, ctx); - - /* start the event loop */ - xmpp_run(ctx); - - /* release our connection and context */ - xmpp_conn_release(conn); - xmpp_ctx_free(ctx); - - xmpp_shutdown(); - - return 0; -}