loudmouth/lm-message-handler.c
author Frank Zschockelt <lm@freakysoft.de>
Sat, 11 May 2019 22:25:49 +0200
changeset 738 264fece7ff0d
parent 690 7ccf2113ec5f
permissions -rw-r--r--
Fix getaddrinfo() handling in blocking resolver If getaddrinfo() fails, the first call setting the result will already free the resolver. Trying to access it afterwards will lead to a warning to the console from glib. getaddrinfo() shouldn't return NULL for the result list if it returns successful.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
516
4dd3aa6b83e5 Change the tab width to 4 steps in the emacs headers
Mikael Hallendal <micke@imendio.com>
parents: 515
diff changeset
     1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     2
/*
99
81e9d035de02 2004-10-05 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 84
diff changeset
     3
 * Copyright (C) 2003 Imendio AB
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     4
 *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     6
 * modify it under the terms of the GNU Lesser General Public License as
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     7
 * published by the Free Software Foundation; either version 2 of the
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     8
 * License, or (at your option) any later version.
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
     9
 *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    13
 * Lesser General Public License for more details.
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    14
 *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    15
 * You should have received a copy of the GNU Lesser General Public
690
7ccf2113ec5f Update the postal address of the FSF
Frank Zschockelt <lm@freakysoft.de>
parents: 643
diff changeset
    16
 * License along with this program; if not, see <https://www.gnu.org/licenses>
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    17
 */
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    18
417
364c17252e5f Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents: 168
diff changeset
    19
/**
420
f40434cca022 Fixed the SECTION parts of the inlined docs so that gtk-doc finds them.
Mikael Hallendal <micke@imendio.com>
parents: 417
diff changeset
    20
 * SECTION:lm-message-handler
421
2a91651d22de Added Title to the inlined documentation
Mikael Hallendal <micke@imendio.com>
parents: 420
diff changeset
    21
 * @Title: LmMessageHandler
417
364c17252e5f Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents: 168
diff changeset
    22
 * @Short_description: A handler for incoming messages.
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    23
 *
417
364c17252e5f Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents: 168
diff changeset
    24
 *  A handler can be registered to listen to incoming messages with lm_connection_register_message_handler(). When a message is recieved the handlers of the correct type will be called.
364c17252e5f Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents: 168
diff changeset
    25
 */
364c17252e5f Added inlined documentation from generated through the Gtk-doc migration script.
Mikael Hallendal <micke@imendio.com>
parents: 168
diff changeset
    26
66
577d5059b718 2004-01-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 57
diff changeset
    27
#include <config.h>
577d5059b718 2004-01-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 57
diff changeset
    28
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    29
#include "lm-internals.h"
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    30
#include "lm-message-handler.h"
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    31
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    32
struct LmMessageHandler {
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    33
    gboolean                valid;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    34
    gint                    ref_count;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    35
    LmHandleMessageFunction function;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    36
    gpointer                user_data;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    37
    GDestroyNotify          notify;
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    38
};
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    39
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    40
LmHandlerResult
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    41
_lm_message_handler_handle_message (LmMessageHandler *handler,
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    42
                                    LmConnection     *connection,
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    43
                                    LmMessage        *message)
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    44
{
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    45
    g_return_val_if_fail (handler != NULL,
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    46
                          LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS);
19
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
    47
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    48
    if (!handler->valid) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    49
        return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    50
    }
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    51
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    52
    if (handler->function) {
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    53
        return (* handler->function) (handler, connection,
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    54
                                      message, handler->user_data);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    55
    }
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    56
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    57
    return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    58
}
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    59
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    60
/**
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    61
 * lm_message_handler_new:
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    62
 * @function: a callback
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    63
 * @user_data: user data passed to function
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    64
 * @notify: function called when the message handler is freed
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    65
 *
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    66
 * Creates a new message handler. This can be set to handle incoming messages
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    67
 * and when a message of the type the handler is registered to handle is
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    68
 * received @function will be called and @user_data will be passed to it.
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    69
 * @notify is called when the message handler is freed, that way any memory
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    70
 * allocated by @user_data can be freed.
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    71
 *
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    72
 * Return value: a newly created message handler
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    73
 **/
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    74
LmMessageHandler *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    75
lm_message_handler_new (LmHandleMessageFunction function,
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    76
                        gpointer                user_data,
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    77
                        GDestroyNotify          notify)
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    78
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    79
    LmMessageHandler *handler;
168
ac1affcd5d22 2006-09-01 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
    80
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    81
    g_return_val_if_fail (function != NULL, NULL);
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    82
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    83
    handler = g_new0 (LmMessageHandler, 1);
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    84
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    85
    if (handler == NULL) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    86
        return NULL;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    87
    }
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    88
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
    89
    handler->valid     = TRUE;
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    90
    handler->ref_count = 1;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    91
    handler->function  = function;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    92
    handler->user_data = user_data;
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
    93
    handler->notify    = notify;
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
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: 516
diff changeset
    95
    return handler;
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    96
}
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    97
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
    98
/**
19
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
    99
 * lm_message_handler_invalidate
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   100
 * @handler: an #LmMessageHandler
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   101
 *
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   102
 * Invalidates the handler. Useful if you need to cancel a reply
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   103
 **/
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   104
void
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   105
lm_message_handler_invalidate (LmMessageHandler *handler)
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   106
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   107
    handler->valid = FALSE;
19
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   108
}
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   109
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   110
/**
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   111
 * lm_message_handler_is_valid
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   112
 * @handler: an #LmMessageHandler
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   113
 *
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   114
 * Fetches whether the handler is valid or not.
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   115
 *
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   116
 * Return value: #TRUE if @handler is valid, otherwise #FALSE
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   117
 **/
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   118
gboolean
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   119
lm_message_handler_is_valid (LmMessageHandler *handler)
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   120
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   121
    g_return_val_if_fail (handler != NULL, FALSE);
168
ac1affcd5d22 2006-09-01 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 99
diff changeset
   122
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   123
    return handler->valid;
19
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   124
}
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   125
bb3195f74ac7 2003-07-17 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 7
diff changeset
   126
/**
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   127
 * lm_message_handler_ref:
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   128
 * @handler: an #LmMessageHandler
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
   129
 *
66
577d5059b718 2004-01-15 Mikael Hallendal <micke@imendio.com>
hallski <hallski>
parents: 57
diff changeset
   130
 * Adds a reference to @handler.
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
   131
 *
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   132
 * Return value: the message handler
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   133
 **/
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   134
LmMessageHandler *
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   135
lm_message_handler_ref (LmMessageHandler *handler)
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   136
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   137
    g_return_val_if_fail (handler != NULL, NULL);
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
   138
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   139
    handler->ref_count++;
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   140
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   141
    return handler;
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   142
}
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   143
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   144
/**
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   145
 * lm_message_handler_unref:
643
e7ef923056d7 Minor documentation fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents: 607
diff changeset
   146
 * @handler: an #LmMessageHandler
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
   147
 *
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
   148
 * Removes a reference from @handler. When no more references are present the
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   149
 * handler is freed.
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   150
 **/
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   151
void
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   152
lm_message_handler_unref (LmMessageHandler *handler)
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   153
{
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   154
    g_return_if_fail (handler != NULL);
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
   155
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   156
    handler->ref_count --;
607
e2bd14357c9a Some style fixes
Frank Zschockelt <lm@freakysoft.de>
parents: 518
diff changeset
   157
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   158
    if (handler->ref_count == 0) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   159
        if (handler->notify) {
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   160
            (* handler->notify) (handler->user_data);
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   161
        }
518
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   162
        g_free (handler);
cdd6a0c5b439 Went over all of the files and made sure they all were indented the same way.
Mikael Hallendal <micke@imendio.com>
parents: 516
diff changeset
   163
    }
1
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   164
}
50e230cf7818 Initial revision
hallski <hallski>
parents:
diff changeset
   165