./configure wasnt happy if gsf is present but no wv. Its happy now. pkg-check-modules...
[beagle.git] / libbeagle / beagle / beagle-shutdown-request.c
blob5792f93731198dba56c63b7ee455cdf82127d4ff
1 /*
2 * beagle-shutdown-request.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-private.h"
34 #include "beagle-shutdown-request.h"
35 #include "beagle-empty-response.h"
37 typedef struct {
38 gint foo;
39 } BeagleShutdownRequestPrivate;
41 #define BEAGLE_SHUTDOWN_REQUEST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BEAGLE_TYPE_SHUTDOWN_REQUEST, BeagleShutdownRequestPrivate))
43 static GObjectClass *parent_class = NULL;
45 static GString *
46 beagle_shutdown_request_to_xml (BeagleRequest *request, GError **err)
48 GString *data = g_string_new (NULL);
50 _beagle_request_append_standard_header (data, "ShutdownRequest");
51 _beagle_request_append_standard_footer (data);
53 return data;
56 G_DEFINE_TYPE (BeagleShutdownRequest, beagle_shutdown_request, BEAGLE_TYPE_REQUEST)
58 static void
59 beagle_shutdown_request_finalize (GObject *obj)
61 if (G_OBJECT_CLASS (parent_class)->finalize)
62 G_OBJECT_CLASS (parent_class)->finalize (obj);
65 static void
66 beagle_shutdown_request_class_init (BeagleShutdownRequestClass *klass)
68 GObjectClass *obj_class = G_OBJECT_CLASS (klass);
69 BeagleRequestClass *request_class = BEAGLE_REQUEST_CLASS (klass);
71 parent_class = g_type_class_peek_parent (klass);
73 obj_class->finalize = beagle_shutdown_request_finalize;
74 request_class->to_xml = beagle_shutdown_request_to_xml;
76 g_type_class_add_private (klass, sizeof (BeagleShutdownRequestPrivate));
78 _beagle_request_class_set_response_types (request_class,
79 "EmptyResponse",
80 BEAGLE_TYPE_EMPTY_RESPONSE,
81 NULL);
84 static void
85 beagle_shutdown_request_init (BeagleShutdownRequest *shutdown_request)
89 /**
90 * beagle_shutdown_request_new:
92 * Creates a new #BeagleShutdownRequest.
94 * Return value: the newly created #BeagleShutdownRequest.
95 **/
96 BeagleShutdownRequest *
97 beagle_shutdown_request_new (void)
99 BeagleShutdownRequest *shutdown_request = g_object_new (BEAGLE_TYPE_SHUTDOWN_REQUEST, 0);
101 return shutdown_request;