Galago - desktop presence framework

galago-dbus-compat.h

Go to the documentation of this file.
00001 
00021 #ifndef _GALAGO_DBUS_COMPAT_H_
00022 #define _GALAGO_DBUS_COMPAT_H_
00023 
00024 #define GALAGO_CHECK_DBUS_VERSION(major, minor) \
00025     (DBUS_MAJOR_VER > (major) || \
00026      (DBUS_MAJOR_VER == (major) && DBUS_MINOR_VER >= (minor)))
00027 
00028 #if GALAGO_CHECK_DBUS_VERSION(0, 30)
00029 # define galago_dbus_message_iter_append_byte(iter, val) \
00030     dbus_message_iter_append_basic((iter), DBUS_TYPE_BYTE, &(val))
00031 # define galago_dbus_message_iter_append_boolean(iter, val) \
00032     dbus_message_iter_append_basic((iter), DBUS_TYPE_BOOLEAN, &(val))
00033 # define galago_dbus_message_iter_append_string(iter, val) \
00034     dbus_message_iter_append_basic((iter), DBUS_TYPE_STRING, &(val))
00035 # define galago_dbus_message_iter_append_int32(iter, val) \
00036     dbus_message_iter_append_basic((iter), DBUS_TYPE_INT32, &(val))
00037 # define galago_dbus_message_iter_append_uint32(iter, val) \
00038     dbus_message_iter_append_basic((iter), DBUS_TYPE_UINT32, &(val))
00039 # define galago_dbus_message_iter_append_double(iter, val) \
00040     dbus_message_iter_append_basic((iter), DBUS_TYPE_DOUBLE, &(val))
00041 
00042 # define galago_dbus_message_iter_append_byte_array(iter, data, len) \
00043     dbus_message_iter_append_fixed_array((iter), DBUS_TYPE_BYTE, &(data), \
00044                                          (len))
00045 # define galago_dbus_message_iter_append_boolean_array(iter, data, len) \
00046     dbus_message_iter_append_fixed_array((iter), DBUS_TYPE_BOOLEAN, &(data), \
00047                                          (len))
00048 # define galago_dbus_message_iter_append_int32_array(iter, data, len) \
00049     dbus_message_iter_append_fixed_array((iter), DBUS_TYPE_INT32, &(data), \
00050                                          (len))
00051 # define galago_dbus_message_iter_append_uint32_array(iter, data, len) \
00052     dbus_message_iter_append_fixed_array((iter), DBUS_TYPE_UINT32, &(data), \
00053                                          (len))
00054 # define galago_dbus_message_iter_append_string_array(iter, data, len) \
00055     dbus_message_iter_append_fixed_array((iter), DBUS_TYPE_STRING, \
00056                                          &(data), (len))
00057 
00058 # define galago_dbus_message_iter_get_byte(iter, retvar) \
00059     dbus_message_iter_get_basic((iter), &(retvar))
00060 # define galago_dbus_message_iter_get_boolean(iter, retvar) \
00061     dbus_message_iter_get_basic((iter), &(retvar))
00062 # define galago_dbus_message_iter_get_string(iter, retvar) \
00063     dbus_message_iter_get_basic((iter), &(retvar))
00064 # define galago_dbus_message_iter_get_int32(iter, retvar) \
00065     dbus_message_iter_get_basic((iter), &(retvar))
00066 # define galago_dbus_message_iter_get_uint32(iter, retvar) \
00067     dbus_message_iter_get_basic((iter), &(retvar))
00068 # define galago_dbus_message_iter_get_double(iter, retvar) \
00069     dbus_message_iter_get_basic((iter), &(retvar))
00070 
00071 # define galago_dbus_message_iter_get_byte_array \
00072     dbus_message_iter_get_fixed_array
00073 # define galago_dbus_message_iter_get_boolean_array \
00074     dbus_message_iter_get_fixed_array
00075 # define galago_dbus_message_iter_get_int32_array \
00076     dbus_message_iter_get_fixed_array
00077 # define galago_dbus_message_iter_get_uint32_array \
00078     dbus_message_iter_get_fixed_array
00079 # define galago_dbus_message_iter_get_string_array \
00080     dbus_message_iter_get_fixed_array
00081 
00082 #else /* D-BUS < 0.30 */
00083 # define DBUS_INTERFACE_DBUS        DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS
00084 # define DBUS_SERVICE_DBUS          DBUS_SERVICE_ORG_FREEDESKTOP_DBUS
00085 # define DBUS_PATH_DBUS             DBUS_PATH_ORG_FREEDESKTOP_DBUS
00086 # define DBUS_ERROR_SERVICE_UNKNOWN DBUS_ERROR_SERVICE_DOES_NOT_EXIST
00087 
00088 # define dbus_message_iter_init_append(msg, iter) \
00089     dbus_message_iter_init(msg, iter)
00090 
00091 # define galago_dbus_message_iter_append_byte(iter, val) \
00092     dbus_message_iter_append_byte((iter), (val))
00093 # define galago_dbus_message_iter_append_boolean(iter, val) \
00094     dbus_message_iter_append_boolean((iter), (val))
00095 # define galago_dbus_message_iter_append_string(iter, val) \
00096     dbus_message_iter_append_string((iter), (val))
00097 # define galago_dbus_message_iter_append_int32(iter, val) \
00098     dbus_message_iter_append_int32((iter), (val))
00099 # define galago_dbus_message_iter_append_uint32(iter, val) \
00100     dbus_message_iter_append_uint32((iter), (val))
00101 # define galago_dbus_message_iter_append_double(iter, val) \
00102     dbus_message_iter_append_double((iter), (val))
00103 
00104 # define galago_dbus_message_iter_append_byte_array(iter, data, len) \
00105     dbus_message_iter_append_byte_array((iter), (data), (len))
00106 # define galago_dbus_message_iter_append_boolean_array(iter, data, len) \
00107     dbus_message_iter_append_boolean_array((iter), (data), (len))
00108 # define galago_dbus_message_iter_append_int32_array(iter, data, len) \
00109     dbus_message_iter_append_int32_array((iter), (data), (len))
00110 # define galago_dbus_message_iter_append_uint32_array(iter, data, len) \
00111     dbus_message_iter_append_uint32_array((iter), (data), (len))
00112 # define galago_dbus_message_iter_append_string_array(iter, data, len) \
00113     dbus_message_iter_append_string_array((iter), (const char **)(data), (len))
00114 
00115 # define galago_dbus_message_iter_get_byte(iter, retvar) \
00116     retvar = dbus_message_iter_get_byte((iter))
00117 # define galago_dbus_message_iter_get_boolean(iter, retvar) \
00118     retvar = dbus_message_iter_get_boolean((iter))
00119 # define galago_dbus_message_iter_get_string(iter, retvar) \
00120     retvar = dbus_message_iter_get_string((iter))
00121 # define galago_dbus_message_iter_get_int32(iter, retvar) \
00122     retvar = dbus_message_iter_get_int32((iter))
00123 # define galago_dbus_message_iter_get_uint32(iter, retvar) \
00124     retvar = dbus_message_iter_get_uint32((iter))
00125 # define galago_dbus_message_iter_get_double(iter, retvar) \
00126     retvar = dbus_message_iter_get_double((iter))
00127 
00128 # define galago_dbus_message_iter_get_byte_array(iter, data, len) \
00129     dbus_message_iter_get_byte_array((iter), (data), (len))
00130 # define galago_dbus_message_iter_get_boolean_array(iter, data, len) \
00131     dbus_message_iter_get_boolean_array((iter), (data), (len))
00132 # define galago_dbus_message_iter_get_int32_array(iter, data, len) \
00133     dbus_message_iter_get_int32_array((iter), (data), (len))
00134 # define galago_dbus_message_iter_get_uint32_array(iter, data, len) \
00135     dbus_message_iter_get_uint32_array((iter), (data), (len))
00136 # define galago_dbus_message_iter_get_string_array(iter, data, len) \
00137     dbus_message_iter_get_string_array((iter), (data), (len))
00138 #endif
00139 
00140 #endif /* GALAGO_DBUS_COMPAT_H_ */