examples/lm-register.c
author Samuel Tesla <stesla@engineyard.com>
Mon, 09 Mar 2009 18:05:59 -0500
changeset 593 2c04915af500
parent 518 cdd6a0c5b439
child 664 f57b1b61e1fe
permissions -rw-r--r--
Update release information files. * Combined AUTHORS and CONTRIBUTORS. * Added some more folks to the AUTHORS file based on commit history. * Added Makefile recipe to dynamically generate ChangeLog from last annotated tag or a specified ref. * Added ignores for tarballs and ChangeLog.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
517
6fabea75bea7 Make the emacs header changes to tests and examples
Mikael Hallendal <micke@imendio.com>
parents: 104
diff changeset
     1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
     2
/*
99
81e9d035de02 2004-10-05 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 95
diff changeset
     3
 * Copyright (C) 2004 Imendio AB
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
     4
 *
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
     5
 * This library is free software; you can redistribute it and/or
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
     6
 * modify it under the terms of the GNU Library General Public
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
     7
 * License as published by the Free Software Foundation; either
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
     8
 * version 2 of the License, or (at your option) any later version.
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
     9
 *
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    10
 * This library is distributed in the hope that it will be useful,
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    13
 * Library General Public License for more details.
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    14
 *
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    15
 * You should have received a copy of the GNU Library General Public
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    16
 * License along with this library; if not, write to the
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    17
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    18
 * Boston, MA 02111-1307, USA.
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    19
 */
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    20
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    21
/*
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    22
 * Small tool to register an account
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    23
 */
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    24
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    25
#include <loudmouth/loudmouth.h>
104
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    26
#include <string.h>
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    27
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    28
static LmSSLResponse 
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    29
ssl_func (LmSSL        *ssl,
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    30
          LmSSLStatus   status,
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    31
          gpointer      user_data)
104
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    32
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    33
    return LM_SSL_RESPONSE_CONTINUE;
104
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    34
}
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    35
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    36
static void
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    37
print_usage (const gchar *exec_name)
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    38
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    39
    g_print ("Usage: %s <server> <username> <password> [--ssl]\n",
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    40
             exec_name);
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    41
}
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    42
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    43
int
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    44
main (int argc, char **argv)
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    45
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    46
    LmConnection  *connection;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    47
    const gchar   *server;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    48
    const gchar   *username;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    49
    const gchar   *pass;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    50
    GError        *error = NULL;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    51
    LmMessage     *m, *reply;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    52
    LmMessageNode *query, *node;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    53
    gboolean       use_ssl = FALSE;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    54
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    55
    if (argc < 4) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    56
        print_usage (argv[0]);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    57
        return -1;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    58
    }
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    59
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    60
    server = argv[1];
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    61
    username = argv[2];
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    62
    pass = argv[3];
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    63
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    64
    if (argc >= 4) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    65
        int i;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    66
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    67
        for (i = 4; i < argc; ++i) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    68
            if (strcmp (argv[i], "-s") == 0 ||
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    69
                strcmp (argv[i], "--ssl") == 0) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    70
                use_ssl = TRUE;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    71
                break;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    72
            }
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    73
        }
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    74
    }
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    75
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    76
    connection = lm_connection_new (server);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    77
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    78
    if (use_ssl) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    79
        LmSSL *ssl;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    80
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    81
        if (!lm_ssl_is_supported ()) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    82
            g_print ("This loudmouth installation doesn't support SSL\n");
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    83
            return 1;
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    84
        }
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    85
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    86
        g_print ("Setting ssl\n");
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    87
        ssl = lm_ssl_new (NULL, ssl_func, NULL, NULL);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    88
        lm_connection_set_ssl (connection, ssl);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    89
        lm_ssl_unref (ssl);
104
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    90
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    91
        lm_connection_set_port (connection,
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    92
                                LM_CONNECTION_DEFAULT_PORT_SSL);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    93
    }
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
    94
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    95
    if (!lm_connection_open_and_block (connection, &error)) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    96
        g_error ("Failed to open: %s\n", error->message);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    97
    }
104
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    98
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
    99
    m = lm_message_new_with_sub_type (NULL, LM_MESSAGE_TYPE_IQ,
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   100
                                      LM_MESSAGE_SUB_TYPE_SET);
104
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
   101
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   102
    query = lm_message_node_add_child (m->node, "query", NULL);
104
f43fde0f89d4 2004-11-08 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
   103
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   104
    lm_message_node_set_attributes (query, "xmlns", "jabber:iq:register",
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   105
                                    NULL);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   106
    lm_message_node_add_child (query, "username", username);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   107
    lm_message_node_add_child (query, "password", pass);
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
   108
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   109
    reply = lm_connection_send_with_reply_and_block (connection, 
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   110
                                                     m, &error);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   111
    
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   112
    if (!reply) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   113
        g_error ("Failed to send registration request: %s\n", 
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   114
                 error->message);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   115
    }
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
   116
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   117
    switch (lm_message_get_sub_type (reply)) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   118
    case LM_MESSAGE_SUB_TYPE_RESULT:
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   119
        g_print ("Succeeded in register account '%s@%s'\n",
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   120
                 username, server);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   121
        break;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   122
    case LM_MESSAGE_SUB_TYPE_ERROR:
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   123
    default:
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   124
        g_print ("Failed to register account '%s@%s' due to: ",
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   125
                 username, server);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   126
        
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   127
        node = lm_message_node_find_child (reply->node, "error");
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   128
        if (node) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   129
            g_print ("%s\n", lm_message_node_get_value (node));
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   130
        } else {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   131
            g_print ("Unknown error\n");
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   132
        }
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   133
        break;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   134
    }
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
   135
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   136
    lm_connection_close (connection, NULL);
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
   137
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 517
diff changeset
   138
    return 0;
95
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
   139
}
5fba3df1a9a8 2004-09-03 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents:
diff changeset
   140