Fix warnings and line endings from previous SRV commit. Get rid of domain parameter of xmpp_connect_client(). Remove usused handler.c helper left over from previous commit.

This commit is contained in:
Jack Moffitt
2008-07-03 05:20:59 +00:00
parent 561fac842c
commit 3b47afaac9
8 changed files with 64 additions and 116 deletions

View File

@@ -93,8 +93,8 @@ int main(int argc, char **argv)
xmpp_ctx_t *ctx;
xmpp_conn_t *conn;
if (argc != 4) {
fprintf(stderr, "Usage: active <jid> <pass> <server>\n\n");
if (argc != 3) {
fprintf(stderr, "Usage: active <jid> <pass>\n\n");
return 1;
}
@@ -112,7 +112,7 @@ int main(int argc, char **argv)
xmpp_conn_set_pass(conn, argv[2]);
/* initiate connection */
xmpp_connect_client(conn, argv[3], NULL, 0, conn_handler, ctx);
xmpp_connect_client(conn, NULL, 0, conn_handler, ctx);
/* start the event loop */
xmpp_run(ctx);

View File

@@ -40,22 +40,15 @@ int main(int argc, char **argv)
xmpp_conn_t *conn;
xmpp_log_t *log;
char *jid, *pass;
char *server;
/* 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");
/* take a jid and password on the command line */
if (argc != 3) {
fprintf(stderr, "Usage: basic <jid> <pass>\n\n");
return 1;
}
jid = argv[1];
pass = argv[2];
server = NULL;
/* Normally we pass NULL for the connection domain, in which case
the library derives the target host from the jid, but we can
override this for testing. */
if (argc >= 4) server = argv[3];
/* init library */
xmpp_initialize();
@@ -72,7 +65,7 @@ int main(int argc, char **argv)
xmpp_conn_set_pass(conn, pass);
/* initiate connection */
xmpp_connect_client(conn, server, NULL, 0, conn_handler, ctx);
xmpp_connect_client(conn, NULL, 0, conn_handler, ctx);
/* enter the event loop -
our connect handler will trigger an exit */

View File

@@ -133,23 +133,16 @@ int main(int argc, char **argv)
xmpp_conn_t *conn;
xmpp_log_t *log;
char *jid, *pass;
char *server;
/* 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");
/* take a jid and password on the command line */
if (argc != 3) {
fprintf(stderr, "Usage: bot <jid> <pass>\n\n");
return 1;
}
jid = argv[1];
pass = argv[2];
server = NULL;
/* Normally we pass NULL for the connection domain, in which case
the library derives the target host from the jid, but we can
override this for testing. */
if (argc >= 4) server = argv[3];
/* init library */
xmpp_initialize();
@@ -165,7 +158,7 @@ int main(int argc, char **argv)
xmpp_conn_set_pass(conn, pass);
/* initiate connection */
xmpp_connect_client(conn, server, conn_handler, ctx);
xmpp_connect_client(conn, NULL, 0, conn_handler, ctx);
/* enter the event loop -
our connect handler will trigger an exit */

View File

@@ -98,8 +98,8 @@ int main(int argc, char **argv)
xmpp_ctx_t *ctx;
xmpp_conn_t *conn;
if (argc != 4) {
fprintf(stderr, "Usage: roster <jid> <pass> <server>\n\n");
if (argc != 3) {
fprintf(stderr, "Usage: roster <jid> <pass>\n\n");
return 1;
}
@@ -117,7 +117,7 @@ int main(int argc, char **argv)
xmpp_conn_set_pass(conn, argv[2]);
/* initiate connection */
xmpp_connect_client(conn, argv[3], NULL, 0, conn_handler, ctx);
xmpp_connect_client(conn, NULL, 0, conn_handler, ctx);
/* start the event loop */
xmpp_run(ctx);