1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-message.h DBusMessage object
4 * Copyright (C) 2002 Red Hat Inc.
6 * Licensed under the Academic Free License version 1.2
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
24 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
27 #ifndef DBUS_MESSAGE_H
28 #define DBUS_MESSAGE_H
30 #include <dbus/dbus-macros.h>
31 #include <dbus/dbus-types.h>
36 typedef struct DBusMessage DBusMessage;
37 typedef struct DBusMessageIter DBusMessageIter;
39 DBusMessage* dbus_message_new (const char *service,
41 DBusMessage* dbus_message_new_reply (DBusMessage *original_message);
42 DBusMessage* dbus_message_new_error_reply (DBusMessage *original_message,
43 const char *error_name,
44 const char *error_message);
45 DBusMessage *dbus_message_new_from_message (const DBusMessage *message);
47 void dbus_message_ref (DBusMessage *message);
48 void dbus_message_unref (DBusMessage *message);
50 const char* dbus_message_get_name (DBusMessage *message);
51 const char* dbus_message_get_service (DBusMessage *message);
52 dbus_bool_t dbus_message_set_sender (DBusMessage *message,
54 const char* dbus_message_get_sender (DBusMessage *message);
55 void dbus_message_set_is_error (DBusMessage *message,
56 dbus_bool_t is_error_reply);
57 dbus_bool_t dbus_message_get_is_error (DBusMessage *message);
59 dbus_bool_t dbus_message_name_is (DBusMessage *message,
62 dbus_bool_t dbus_message_append_args (DBusMessage *message,
65 dbus_bool_t dbus_message_append_args_valist (DBusMessage *message,
68 dbus_bool_t dbus_message_append_nil (DBusMessage *message);
69 dbus_bool_t dbus_message_append_int32 (DBusMessage *message,
71 dbus_bool_t dbus_message_append_uint32 (DBusMessage *message,
73 dbus_bool_t dbus_message_append_double (DBusMessage *message,
75 dbus_bool_t dbus_message_append_string (DBusMessage *message,
77 dbus_bool_t dbus_message_append_int32_array (DBusMessage *message,
78 const dbus_int32_t *value,
80 dbus_bool_t dbus_message_append_uint32_array (DBusMessage *message,
81 const dbus_uint32_t *value,
83 dbus_bool_t dbus_message_append_double_array (DBusMessage *message,
86 dbus_bool_t dbus_message_append_byte_array (DBusMessage *message,
87 unsigned const char *value,
89 dbus_bool_t dbus_message_append_string_array (DBusMessage *message,
93 DBusMessageIter *dbus_message_get_args_iter (DBusMessage *message);
94 DBusResultCode dbus_message_get_args (DBusMessage *message,
97 DBusResultCode dbus_message_get_args_valist (DBusMessage *message,
103 void dbus_message_iter_ref (DBusMessageIter *iter);
104 void dbus_message_iter_unref (DBusMessageIter *iter);
105 dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter);
106 dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter);
107 int dbus_message_iter_get_arg_type (DBusMessageIter *iter);
108 int dbus_message_iter_get_int32 (DBusMessageIter *iter);
109 int dbus_message_iter_get_uint32 (DBusMessageIter *iter);
110 double dbus_message_iter_get_double (DBusMessageIter *iter);
111 char * dbus_message_iter_get_string (DBusMessageIter *iter);
112 dbus_bool_t dbus_message_iter_get_int32_array (DBusMessageIter *iter,
113 dbus_int32_t **value,
115 dbus_bool_t dbus_message_iter_get_uint32_array (DBusMessageIter *iter,
116 dbus_uint32_t **value,
118 dbus_bool_t dbus_message_iter_get_double_array (DBusMessageIter *iter,
121 dbus_bool_t dbus_message_iter_get_byte_array (DBusMessageIter *iter,
122 unsigned char **value,
124 dbus_bool_t dbus_message_iter_get_string_array (DBusMessageIter *iter,
130 #endif /* DBUS_MESSAGE_H */