From: Thadeu Lima de Souza Cascardo Date: Mon, 3 Nov 2008 10:44:44 +0000 (-0200) Subject: Get server, user and password as parameters X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fchat.git;a=commitdiff_plain;h=4b94376519cf3f1064f90e8a226c54f35d4c0e6e Get server, user and password as parameters --- diff --git a/tictactoe.c b/tictactoe.c index af9de7c..e929663 100644 --- a/tictactoe.c +++ b/tictactoe.c @@ -38,10 +38,18 @@ loop (hc_xmpp_t *xmpp) int main (int argc, char **argv) { - char *server = "jabber-br.org"; - char *user = "pubsub"; - char *password = "pubsub"; + char *server; + char *user; + char *password; hc_xmpp_t *xmpp; + if (argc < 4) + { + printf ("tictactoe server user password\n"); + return 1; + } + server = argv[1]; + user = argv[2]; + password = argv[3]; dns_init (NULL, 1); xmpp = hc_xmpp_new (hc_xmpp_hook, server, user, password); hc_xmpp_send_stream (xmpp);