2 * beagle-shutdown-request.c
4 * Copyright (C) 2005 Novell, Inc.
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.
29 #include <sys/types.h>
30 #include <sys/socket.h>
33 #include "beagle-private.h"
34 #include "beagle-shutdown-request.h"
35 #include "beagle-empty-response.h"
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
;
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
);
56 G_DEFINE_TYPE (BeagleShutdownRequest
, beagle_shutdown_request
, BEAGLE_TYPE_REQUEST
)
59 beagle_shutdown_request_finalize (GObject
*obj
)
61 if (G_OBJECT_CLASS (parent_class
)->finalize
)
62 G_OBJECT_CLASS (parent_class
)->finalize (obj
);
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
,
80 BEAGLE_TYPE_EMPTY_RESPONSE
,
85 beagle_shutdown_request_init (BeagleShutdownRequest
*shutdown_request
)
90 * beagle_shutdown_request_new:
92 * Creates a new #BeagleShutdownRequest.
94 * Return value: the newly created #BeagleShutdownRequest.
96 BeagleShutdownRequest
*
97 beagle_shutdown_request_new (void)
99 BeagleShutdownRequest
*shutdown_request
= g_object_new (BEAGLE_TYPE_SHUTDOWN_REQUEST
, 0);
101 return shutdown_request
;