Fixed #374055:Only the first "tag" is detected in digikam.
[beagle.git] / libbeagle / beagle / beagle-response.c
blobca11c61652d51749e0767f52dc69dc223f449e0b
1 /*
2 * beagle-response.c
4 * Copyright (C) 2005 Novell, Inc.
6 */
8 /*
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
28 #include <stdlib.h>
29 #include <sys/types.h>
30 #include <sys/socket.h>
31 #include <sys/un.h>
33 #include "beagle-response.h"
34 #include "beagle-marshal.h"
35 #include "beagle-util.h"
36 #include "beagle-private.h"
38 typedef struct {
39 int foo;
40 } BeagleResponsePrivate;
42 #define BEAGLE_RESPONSE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BEAGLE_TYPE_RESPONSE, BeagleResponsePrivate))
44 static GObjectClass *parent_class = NULL;
46 G_DEFINE_TYPE (BeagleResponse, beagle_response, G_TYPE_OBJECT)
48 static void
49 beagle_response_finalize (GObject *obj)
51 if (G_OBJECT_CLASS (parent_class)->finalize)
52 G_OBJECT_CLASS (parent_class)->finalize (obj);
55 static void
56 beagle_response_class_init (BeagleResponseClass *klass)
58 GObjectClass *obj_class = G_OBJECT_CLASS (klass);
60 parent_class = g_type_class_peek_parent (klass);
62 obj_class->finalize = beagle_response_finalize;
64 g_type_class_add_private (klass, sizeof (BeagleResponsePrivate));
67 static void
68 beagle_response_init (BeagleResponse *response)
72 void
73 _beagle_response_class_set_parser_handlers (BeagleResponseClass *klass,
74 BeagleParserHandler *handlers)
76 int i;
78 for (i = 0; handlers[i].name != NULL; i++) {
79 if (handlers[i].src_state != -1)
80 handlers[i].src_state += _beagle_parser_state_index;
82 handlers[i].dest_state += _beagle_parser_state_index;
85 _beagle_parser_state_index += i;
87 klass->parser_handlers = handlers;