From d1a29bfd0dbb9d00b3712d02561b6ed9109e6cb7 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sun, 17 May 2009 20:53:20 -0300 Subject: [PATCH] Accept options for the server and IDs used. --- status.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/status.c b/status.c index b3971c5..83c57d4 100644 --- a/status.c +++ b/status.c @@ -21,12 +21,13 @@ #include #include #include +#include static char * server = "vespa.holoscopio.com"; static char * username = "pubsub"; static char * password = "pubsub"; static char * pbservice = "pubsub.vespa.holoscopio.com"; -static const char * authed_jid = "vespa"; +static char * authed_jid = "vespa"; iks * createiq (char *type, char *to, char *qnam, char *xmlns, iks **query) @@ -372,6 +373,28 @@ int main (int argc, char **argv) { iksparser *parser; + int c; + while ((c = getopt (argc, argv, "s:u:p:i:a:")) != -1) + { + switch (c) + { + case 's': + server = optarg; + break; + case 'u': + username = optarg; + break; + case 'p': + password = optarg; + break; + case 'i': + pbservice = optarg; + break; + case 'a': + authed_jid = optarg; + break; + } + } parser = iks_stream_new ("jabber:client", &parser, hook); iks_connect_tcp (parser, server, 5222); while (1) -- 2.20.1