2003-03-12 Havoc Pennington <hp@redhat.com>
[platform/upstream/dbus.git] / dbus / dbus-internals.h
index d928a5c..2576982 100644 (file)
@@ -94,6 +94,8 @@ do {
 #define _DBUS_STRUCT_OFFSET(struct_type, member)       \
     ((long) ((unsigned char*) &((struct_type*) 0)->member))
 
+#define _DBUS_ASSERT_ERROR_IS_SET(error) _dbus_assert ((error) == NULL || dbus_error_is_set ((error)))
+
 /* This alignment thing is from ORBit2 */
 /* Align a value upward to a boundary, expressed as a number of bytes.
  * E.g. align to an 8-byte boundary with argument of 8.
@@ -115,6 +117,7 @@ char* _dbus_strdup (const char *str);
 
 #define _DBUS_INT_MIN  (-_DBUS_INT_MAX - 1)
 #define _DBUS_INT_MAX  2147483647
+#define _DBUS_UINT_MAX 0xffffffff
 #define _DBUS_MAX_SUN_PATH_LENGTH 99
 #define _DBUS_ONE_KILOBYTE 1024
 #define _DBUS_ONE_MEGABYTE 1024 * _DBUS_ONE_KILOBYTE
@@ -145,6 +148,9 @@ void _dbus_verbose_bytes_of_string (const DBusString    *str,
 
 const char* _dbus_type_to_string (int type);
 
+extern const char _dbus_no_memory_message[];
+#define _DBUS_SET_OOM(error) dbus_set_error ((error), DBUS_ERROR_NO_MEMORY, _dbus_no_memory_message)
+
 #ifdef DBUS_BUILD_TESTS
 /* Memory debugging */
 void        _dbus_set_fail_alloc_counter       (int  until_next_fail);