void _dbus_warn (const char *format,
...) _DBUS_GNUC_PRINTF (1, 2);
-void _dbus_verbose_real (const char *format,
- ...) _DBUS_GNUC_PRINTF (1, 2);
-void _dbus_verbose_reset_real (void);
#if defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#define _DBUS_FUNCTION_NAME __func__
#endif
#ifdef DBUS_ENABLE_VERBOSE_MODE
+
+void _dbus_verbose_real (const char *format,
+ ...) _DBUS_GNUC_PRINTF (1, 2);
+void _dbus_verbose_reset_real (void);
+
# define _dbus_verbose _dbus_verbose_real
# define _dbus_verbose_reset _dbus_verbose_reset_real
#else
void _dbus_real_assert (dbus_bool_t condition,
const char *condition_text,
const char *file,
- int line);
+ int line,
+ const char *func);
#define _dbus_assert(condition) \
- _dbus_real_assert ((condition) != 0, #condition, __FILE__, __LINE__)
+ _dbus_real_assert ((condition) != 0, #condition, __FILE__, __LINE__, _DBUS_FUNCTION_NAME)
#endif /* !DBUS_DISABLE_ASSERT */
#ifdef DBUS_DISABLE_ASSERT
extern const char _dbus_return_if_fail_warning_format[];
#define _dbus_return_if_fail(condition) do { \
+ _dbus_assert ((*(const char*)_DBUS_FUNCTION_NAME) != '_'); \
if (!(condition)) { \
_dbus_warn (_dbus_return_if_fail_warning_format, \
_dbus_getpid (), _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
} } while (0)
#define _dbus_return_val_if_fail(condition, val) do { \
+ _dbus_assert ((*(const char*)_DBUS_FUNCTION_NAME) != '_'); \
if (!(condition)) { \
_dbus_warn (_dbus_return_if_fail_warning_format, \
_dbus_getpid (), _DBUS_FUNCTION_NAME, #condition, __FILE__, __LINE__); \
#define _DBUS_ALIGN_ADDRESS(this, boundary) \
((void*)_DBUS_ALIGN_VALUE(this, boundary))
+
char* _dbus_strdup (const char *str);
void* _dbus_memdup (const void *mem,
size_t n_bytes);
const char *str);
char** _dbus_dup_string_array (const char **array);
-#define _DBUS_INT_MIN (-_DBUS_INT_MAX - 1)
-#define _DBUS_INT_MAX 2147483647
-#define _DBUS_UINT_MAX 0xffffffff
+#define _DBUS_INT16_MIN ((dbus_int16_t) 0x8000)
+#define _DBUS_INT16_MAX ((dbus_int16_t) 0x7fff)
+#define _DBUS_UINT16_MAX ((dbus_uint16_t)0xffff)
+#define _DBUS_INT32_MIN ((dbus_int32_t) 0x80000000)
+#define _DBUS_INT32_MAX ((dbus_int32_t) 0x7fffffff)
+#define _DBUS_UINT32_MAX ((dbus_uint32_t)0xffffffff)
+/* using 32-bit here is sort of bogus */
+#define _DBUS_INT_MIN _DBUS_INT32_MIN
+#define _DBUS_INT_MAX _DBUS_INT32_MAX
+#define _DBUS_UINT_MAX _DBUS_UINT32_MAX
#ifdef DBUS_HAVE_INT64
-#define _DBUS_INT64_MAX DBUS_INT64_CONSTANT (9223372036854775807)
+#define _DBUS_INT64_MAX DBUS_INT64_CONSTANT (0x7fffffffffffffff)
#define _DBUS_UINT64_MAX DBUS_UINT64_CONSTANT (0xffffffffffffffff)
#endif
#define _DBUS_ONE_KILOBYTE 1024
#undef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
+#define _DBUS_ISASCII(c) ((c) != '\0' && (((c) & ~0x7f) == 0))
+
typedef void (* DBusForeachFunction) (void *element,
void *data);
DBusError *error);
void _dbus_verbose_bytes (const unsigned char *data,
- int len);
+ int len,
+ int offset);
void _dbus_verbose_bytes_of_string (const DBusString *str,
int start,
int len);
-
-const char* _dbus_type_to_string (int type);
const char* _dbus_header_field_to_string (int header_field);
extern const char _dbus_no_memory_message[];
_DBUS_DECLARE_GLOBAL_LOCK (bus);
_DBUS_DECLARE_GLOBAL_LOCK (shutdown_funcs);
_DBUS_DECLARE_GLOBAL_LOCK (system_users);
-#define _DBUS_N_GLOBAL_LOCKS (9)
+_DBUS_DECLARE_GLOBAL_LOCK (message_cache);
+#define _DBUS_N_GLOBAL_LOCKS (10)
dbus_bool_t _dbus_threads_init_debug (void);