dbus-message.h
上传用户:detong
上传日期:2022-06-22
资源大小:20675k
文件大小:11k
源码类别:

系统编程

开发平台:

Unix_Linux

  1. /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
  2. /* dbus-message.h DBusMessage object
  3.  *
  4.  * Copyright (C) 2002, 2003, 2005 Red Hat Inc.
  5.  *
  6.  * Licensed under the Academic Free License version 2.1
  7.  * 
  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.
  12.  *
  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.
  17.  * 
  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
  21.  *
  22.  */
  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."
  25. #endif
  26. #ifndef DBUS_MESSAGE_H
  27. #define DBUS_MESSAGE_H
  28. #include <dbus/dbus-macros.h>
  29. #include <dbus/dbus-types.h>
  30. #include <dbus/dbus-arch-deps.h>
  31. #include <dbus/dbus-memory.h>
  32. #include <dbus/dbus-errors.h>
  33. #include <stdarg.h>
  34. DBUS_BEGIN_DECLS
  35. /**
  36.  * @addtogroup DBusMessage
  37.  * @{
  38.  */
  39. typedef struct DBusMessage DBusMessage;
  40. /** Opaque type representing a message iterator. Can be copied by value, and contains no allocated memory so never needs to be freed and can be allocated on the stack. */
  41. typedef struct DBusMessageIter DBusMessageIter;
  42. /**
  43.  * DBusMessageIter struct; contains no public fields. 
  44.  */
  45. struct DBusMessageIter
  46.   void *dummy1;         /**< Don't use this */
  47.   void *dummy2;         /**< Don't use this */
  48.   dbus_uint32_t dummy3; /**< Don't use this */
  49.   int dummy4;           /**< Don't use this */
  50.   int dummy5;           /**< Don't use this */
  51.   int dummy6;           /**< Don't use this */
  52.   int dummy7;           /**< Don't use this */
  53.   int dummy8;           /**< Don't use this */
  54.   int dummy9;           /**< Don't use this */
  55.   int dummy10;          /**< Don't use this */
  56.   int dummy11;          /**< Don't use this */
  57.   int pad1;             /**< Don't use this */
  58.   int pad2;             /**< Don't use this */
  59.   void *pad3;           /**< Don't use this */
  60. };
  61. DBusMessage* dbus_message_new               (int          message_type);
  62. DBusMessage* dbus_message_new_method_call   (const char  *bus_name,
  63.                                              const char  *path,
  64.                                              const char  *interface,
  65.                                              const char  *method);
  66. DBusMessage* dbus_message_new_method_return (DBusMessage *method_call);
  67. DBusMessage* dbus_message_new_signal        (const char  *path,
  68.                                              const char  *interface,
  69.                                              const char  *name);
  70. DBusMessage* dbus_message_new_error         (DBusMessage *reply_to,
  71.                                              const char  *error_name,
  72.                                              const char  *error_message);
  73. DBusMessage* dbus_message_new_error_printf  (DBusMessage *reply_to,
  74.                                              const char  *error_name,
  75.                                              const char  *error_format,
  76.      ...);
  77. DBusMessage* dbus_message_copy              (const DBusMessage *message);
  78. DBusMessage*  dbus_message_ref              (DBusMessage   *message);
  79. void          dbus_message_unref            (DBusMessage   *message);
  80. int           dbus_message_get_type         (DBusMessage   *message);
  81. dbus_bool_t   dbus_message_set_path         (DBusMessage   *message,
  82.                                              const char    *object_path);
  83. const char*   dbus_message_get_path         (DBusMessage   *message);
  84. dbus_bool_t   dbus_message_has_path         (DBusMessage   *message, 
  85.                                              const char    *object_path);  
  86. dbus_bool_t   dbus_message_set_interface    (DBusMessage   *message,
  87.                                              const char    *interface);       
  88. const char*   dbus_message_get_interface    (DBusMessage   *message);
  89. dbus_bool_t   dbus_message_has_interface    (DBusMessage   *message, 
  90.                                              const char    *interface);
  91. dbus_bool_t   dbus_message_set_member       (DBusMessage   *message,
  92.                                              const char    *member);
  93. const char*   dbus_message_get_member       (DBusMessage   *message);
  94. dbus_bool_t   dbus_message_has_member       (DBusMessage   *message, 
  95.                                              const char    *member);
  96. dbus_bool_t   dbus_message_set_error_name   (DBusMessage   *message,
  97.                                              const char    *name);
  98. const char*   dbus_message_get_error_name   (DBusMessage   *message);
  99. dbus_bool_t   dbus_message_set_destination  (DBusMessage   *message,
  100.                                              const char    *destination);
  101. const char*   dbus_message_get_destination  (DBusMessage   *message);
  102. dbus_bool_t   dbus_message_set_sender       (DBusMessage   *message,
  103.                                              const char    *sender);
  104. const char*   dbus_message_get_sender       (DBusMessage   *message);
  105. const char*   dbus_message_get_signature    (DBusMessage   *message);
  106. void          dbus_message_set_no_reply     (DBusMessage   *message,
  107.                                              dbus_bool_t    no_reply);
  108. dbus_bool_t   dbus_message_get_no_reply     (DBusMessage   *message);
  109. dbus_bool_t   dbus_message_is_method_call   (DBusMessage   *message,
  110.                                              const char    *interface,
  111.                                              const char    *method);
  112. dbus_bool_t   dbus_message_is_signal        (DBusMessage   *message,
  113.                                              const char    *interface,
  114.                                              const char    *signal_name);
  115. dbus_bool_t   dbus_message_is_error         (DBusMessage   *message,
  116.                                              const char    *error_name);
  117. dbus_bool_t   dbus_message_has_destination  (DBusMessage   *message,
  118.                                              const char    *bus_name);
  119. dbus_bool_t   dbus_message_has_sender       (DBusMessage   *message,
  120.                                              const char    *unique_bus_name);
  121. dbus_bool_t   dbus_message_has_signature    (DBusMessage   *message,
  122.                                              const char    *signature);
  123. dbus_uint32_t dbus_message_get_serial       (DBusMessage   *message);
  124. dbus_bool_t   dbus_message_set_reply_serial (DBusMessage   *message,
  125.                                              dbus_uint32_t  reply_serial);
  126. dbus_uint32_t dbus_message_get_reply_serial (DBusMessage   *message);
  127. void          dbus_message_set_auto_start   (DBusMessage   *message,
  128.                                              dbus_bool_t    auto_start);
  129. dbus_bool_t   dbus_message_get_auto_start   (DBusMessage   *message);
  130. dbus_bool_t   dbus_message_get_path_decomposed (DBusMessage   *message,
  131.                                                 char        ***path);
  132. dbus_bool_t dbus_message_append_args          (DBusMessage     *message,
  133.        int              first_arg_type,
  134.        ...);
  135. dbus_bool_t dbus_message_append_args_valist   (DBusMessage     *message,
  136.        int              first_arg_type,
  137.        va_list          var_args);
  138. dbus_bool_t dbus_message_get_args             (DBusMessage     *message,
  139.        DBusError       *error,
  140.        int              first_arg_type,
  141.        ...);
  142. dbus_bool_t dbus_message_get_args_valist      (DBusMessage     *message,
  143.        DBusError       *error,
  144.        int              first_arg_type,
  145.        va_list          var_args);
  146. dbus_bool_t dbus_message_iter_init             (DBusMessage     *message,
  147.                                                 DBusMessageIter *iter);
  148. dbus_bool_t dbus_message_iter_has_next         (DBusMessageIter *iter);
  149. dbus_bool_t dbus_message_iter_next             (DBusMessageIter *iter);
  150. char*       dbus_message_iter_get_signature    (DBusMessageIter *iter);
  151. int         dbus_message_iter_get_arg_type     (DBusMessageIter *iter);
  152. int         dbus_message_iter_get_element_type (DBusMessageIter *iter);
  153. void        dbus_message_iter_recurse          (DBusMessageIter *iter,
  154.                                                 DBusMessageIter *sub);
  155. void        dbus_message_iter_get_basic        (DBusMessageIter *iter,
  156.                                                 void            *value);
  157. #ifndef DBUS_DISABLE_DEPRECATED
  158. /* This function returns the wire protocol size of the array in bytes,
  159.  * you do not want to know that probably
  160.  */
  161. DBUS_DEPRECATED int         dbus_message_iter_get_array_len    (DBusMessageIter *iter);
  162. #endif
  163. void        dbus_message_iter_get_fixed_array  (DBusMessageIter *iter,
  164.                                                 void            *value,
  165.                                                 int             *n_elements);
  166. void        dbus_message_iter_init_append        (DBusMessage     *message,
  167.                                                   DBusMessageIter *iter);
  168. dbus_bool_t dbus_message_iter_append_basic       (DBusMessageIter *iter,
  169.                                                   int              type,
  170.                                                   const void      *value);
  171. dbus_bool_t dbus_message_iter_append_fixed_array (DBusMessageIter *iter,
  172.                                                   int              element_type,
  173.                                                   const void      *value,
  174.                                                   int              n_elements);
  175. dbus_bool_t dbus_message_iter_open_container     (DBusMessageIter *iter,
  176.                                                   int              type,
  177.                                                   const char      *contained_signature,
  178.                                                   DBusMessageIter *sub);
  179. dbus_bool_t dbus_message_iter_close_container    (DBusMessageIter *iter,
  180.                                                   DBusMessageIter *sub);
  181. dbus_bool_t  dbus_set_error_from_message  (DBusError    *error,
  182.                                            DBusMessage  *message);
  183. dbus_bool_t dbus_message_allocate_data_slot (dbus_int32_t     *slot_p);
  184. void        dbus_message_free_data_slot     (dbus_int32_t     *slot_p);
  185. dbus_bool_t dbus_message_set_data           (DBusMessage      *message,
  186.                                              dbus_int32_t      slot,
  187.                                              void             *data,
  188.                                              DBusFreeFunction  free_data_func);
  189. void*       dbus_message_get_data           (DBusMessage      *message,
  190.                                              dbus_int32_t      slot);
  191. int         dbus_message_type_from_string (const char *type_str);
  192. const char* dbus_message_type_to_string   (int type);
  193. dbus_bool_t  dbus_message_marshal   (DBusMessage  *msg,
  194.                                      char        **marshalled_data_p,
  195.                                      int          *len_p);
  196. DBusMessage* dbus_message_demarshal (const char *str,
  197.                                      int         len,
  198.                                      DBusError  *error);
  199. /** @} */
  200. DBUS_END_DECLS
  201. #endif /* DBUS_MESSAGE_H */