Commit 6bcf34d4 authored by Simon McVittie's avatar Simon McVittie

Add DBUS_PRIVATE_EXPORT decoration to symbols used by dbus-daemon or tests

The rules are:

* symbols in libdbus-1 with neither decoration are private to libdbus-1
* symbols in libdbus-1 with DBUS_EXPORT are public API
* symbols in libdbus-1 with DBUS_PRIVATE_EXPORT are private to the
  dbus source package, but may be used by other programs in the dbus
  source tree, including tests
* symbols in libdbus-internal must not have DBUS_EXPORT or
  DBUS_PRIVATE_EXPORT, and should be used by as few things as possible

Thanks to Ralf Habacker for his contributions to this rather
large commit.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83115Reviewed-by: Ralf Habacker's avatarRalf Habacker <ralf.habacker@freenet.de>
parent dbd73149
......@@ -41,23 +41,35 @@ typedef enum
DBUS_AUTH_STATE_AUTHENTICATED
} DBusAuthState;
DBUS_PRIVATE_EXPORT
DBusAuth* _dbus_auth_server_new (const DBusString *guid);
DBUS_PRIVATE_EXPORT
DBusAuth* _dbus_auth_client_new (void);
DBUS_PRIVATE_EXPORT
DBusAuth* _dbus_auth_ref (DBusAuth *auth);
DBUS_PRIVATE_EXPORT
void _dbus_auth_unref (DBusAuth *auth);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_auth_set_mechanisms (DBusAuth *auth,
const char **mechanisms);
DBUS_PRIVATE_EXPORT
DBusAuthState _dbus_auth_do_work (DBusAuth *auth);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_auth_get_bytes_to_send (DBusAuth *auth,
const DBusString **str);
DBUS_PRIVATE_EXPORT
void _dbus_auth_bytes_sent (DBusAuth *auth,
int bytes_sent);
DBUS_PRIVATE_EXPORT
void _dbus_auth_get_buffer (DBusAuth *auth,
DBusString **buffer);
DBUS_PRIVATE_EXPORT
void _dbus_auth_return_buffer (DBusAuth *auth,
DBusString *buffer);
DBUS_PRIVATE_EXPORT
void _dbus_auth_get_unused_bytes (DBusAuth *auth,
const DBusString **str);
DBUS_PRIVATE_EXPORT
void _dbus_auth_delete_unused_bytes (DBusAuth *auth);
dbus_bool_t _dbus_auth_needs_encoding (DBusAuth *auth);
dbus_bool_t _dbus_auth_encode_data (DBusAuth *auth,
......@@ -67,9 +79,12 @@ dbus_bool_t _dbus_auth_needs_decoding (DBusAuth *auth);
dbus_bool_t _dbus_auth_decode_data (DBusAuth *auth,
const DBusString *encoded,
DBusString *plaintext);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_auth_set_credentials (DBusAuth *auth,
DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
DBusCredentials* _dbus_auth_get_identity (DBusAuth *auth);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_auth_set_context (DBusAuth *auth,
const DBusString *context);
const char* _dbus_auth_get_guid_from_server(DBusAuth *auth);
......
......@@ -46,9 +46,13 @@ typedef enum
typedef void (* DBusPendingFdsChangeFunction) (void *data);
DBUS_PRIVATE_EXPORT
void _dbus_connection_lock (DBusConnection *connection);
DBUS_PRIVATE_EXPORT
void _dbus_connection_unlock (DBusConnection *connection);
DBUS_PRIVATE_EXPORT
DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
DBUS_PRIVATE_EXPORT
void _dbus_connection_unref_unlocked (DBusConnection *connection);
void _dbus_connection_queue_received_message_link (DBusConnection *connection,
DBusList *link);
......@@ -96,21 +100,26 @@ dbus_bool_t _dbus_connection_send_and_unlock (DBusConnection
void _dbus_connection_queue_synthesized_message_link (DBusConnection *connection,
DBusList *link);
DBUS_PRIVATE_EXPORT
void _dbus_connection_test_get_locks (DBusConnection *conn,
DBusMutex **mutex_loc,
DBusMutex **dispatch_mutex_loc,
DBusMutex **io_path_mutex_loc,
DBusCondVar **dispatch_cond_loc,
DBusCondVar **io_path_cond_loc);
DBUS_PRIVATE_EXPORT
int _dbus_connection_get_pending_fds_count (DBusConnection *connection);
DBUS_PRIVATE_EXPORT
void _dbus_connection_set_pending_fds_function (DBusConnection *connection,
DBusPendingFdsChangeFunction callback,
void *data);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_connection_get_linux_security_label (DBusConnection *connection,
char **label_p);
/* if DBUS_ENABLE_STATS */
DBUS_PRIVATE_EXPORT
void _dbus_connection_get_stats (DBusConnection *connection,
dbus_uint32_t *in_messages,
dbus_uint32_t *in_bytes,
......
......@@ -38,14 +38,21 @@ typedef enum {
DBUS_CREDENTIAL_WINDOWS_SID
} DBusCredentialType;
DBUS_PRIVATE_EXPORT
DBusCredentials* _dbus_credentials_new_from_current_process (void);
DBUS_PRIVATE_EXPORT
DBusCredentials* _dbus_credentials_new (void);
DBUS_PRIVATE_EXPORT
void _dbus_credentials_ref (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
void _dbus_credentials_unref (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_add_pid (DBusCredentials *credentials,
dbus_pid_t pid);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_add_unix_uid (DBusCredentials *credentials,
dbus_uid_t uid);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_add_windows_sid (DBusCredentials *credentials,
const char *windows_sid);
dbus_bool_t _dbus_credentials_add_linux_security_label (DBusCredentials *credentials,
......@@ -53,17 +60,24 @@ dbus_bool_t _dbus_credentials_add_linux_security_label (DBusCredentials
dbus_bool_t _dbus_credentials_add_adt_audit_data (DBusCredentials *credentials,
void *audit_data,
dbus_int32_t size);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_include (DBusCredentials *credentials,
DBusCredentialType type);
DBUS_PRIVATE_EXPORT
dbus_pid_t _dbus_credentials_get_pid (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
dbus_uid_t _dbus_credentials_get_unix_uid (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
const char* _dbus_credentials_get_windows_sid (DBusCredentials *credentials);
const char * _dbus_credentials_get_linux_security_label (DBusCredentials *credentials);
void * _dbus_credentials_get_adt_audit_data (DBusCredentials *credentials);
dbus_int32_t _dbus_credentials_get_adt_audit_data_size (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_are_superset (DBusCredentials *credentials,
DBusCredentials *possible_subset);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_are_empty (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_are_anonymous (DBusCredentials *credentials);
dbus_bool_t _dbus_credentials_add_credentials (DBusCredentials *credentials,
DBusCredentials *other_credentials);
......@@ -71,10 +85,14 @@ dbus_bool_t _dbus_credentials_add_credentials (DBusCredentials
dbus_bool_t _dbus_credentials_add_credential (DBusCredentials *credentials,
DBusCredentialType which,
DBusCredentials *other_credentials);
DBUS_PRIVATE_EXPORT
void _dbus_credentials_clear (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
DBusCredentials* _dbus_credentials_copy (DBusCredentials *credentials);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_same_user (DBusCredentials *credentials,
DBusCredentials *other_credentials);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_credentials_to_string_append (DBusCredentials *credentials,
DBusString *string);
......
......@@ -40,6 +40,7 @@ DBUS_BEGIN_DECLS
* File interface
*/
dbus_bool_t _dbus_file_exists (const char *file);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_file_get_contents (DBusString *str,
const DBusString *filename,
DBusError *error);
......@@ -53,6 +54,7 @@ dbus_bool_t _dbus_make_file_world_readable (const DBusString *filename,
dbus_bool_t _dbus_create_file_exclusively (const DBusString *filename,
DBusError *error);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_delete_file (const DBusString *filename,
DBusError *error);
......
......@@ -71,47 +71,66 @@ typedef enum
DBUS_HASH_UINTPTR /**< Hash keys are integer capable to hold a pointer. */
} DBusHashType;
DBUS_PRIVATE_EXPORT
DBusHashTable* _dbus_hash_table_new (DBusHashType type,
DBusFreeFunction key_free_function,
DBusFreeFunction value_free_function);
DBusHashTable* _dbus_hash_table_ref (DBusHashTable *table);
DBUS_PRIVATE_EXPORT
void _dbus_hash_table_unref (DBusHashTable *table);
void _dbus_hash_table_remove_all (DBusHashTable *table);
DBUS_PRIVATE_EXPORT
void _dbus_hash_iter_init (DBusHashTable *table,
DBusHashIter *iter);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_hash_iter_next (DBusHashIter *iter);
DBUS_PRIVATE_EXPORT
void _dbus_hash_iter_remove_entry (DBusHashIter *iter);
DBUS_PRIVATE_EXPORT
void* _dbus_hash_iter_get_value (DBusHashIter *iter);
void _dbus_hash_iter_set_value (DBusHashIter *iter,
void *value);
DBUS_PRIVATE_EXPORT
int _dbus_hash_iter_get_int_key (DBusHashIter *iter);
DBUS_PRIVATE_EXPORT
const char* _dbus_hash_iter_get_string_key (DBusHashIter *iter);
DBUS_PRIVATE_EXPORT
uintptr_t _dbus_hash_iter_get_uintptr_key (DBusHashIter *iter);
dbus_bool_t _dbus_hash_iter_lookup (DBusHashTable *table,
void *key,
dbus_bool_t create_if_not_found,
DBusHashIter *iter);
DBUS_PRIVATE_EXPORT
void* _dbus_hash_table_lookup_string (DBusHashTable *table,
const char *key);
DBUS_PRIVATE_EXPORT
void* _dbus_hash_table_lookup_int (DBusHashTable *table,
int key);
DBUS_PRIVATE_EXPORT
void* _dbus_hash_table_lookup_uintptr (DBusHashTable *table,
uintptr_t key);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_hash_table_remove_string (DBusHashTable *table,
const char *key);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_hash_table_remove_int (DBusHashTable *table,
int key);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_hash_table_remove_uintptr (DBusHashTable *table,
uintptr_t key);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_hash_table_insert_string (DBusHashTable *table,
char *key,
void *value);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_hash_table_insert_int (DBusHashTable *table,
int key,
void *value);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_hash_table_insert_uintptr (DBusHashTable *table,
uintptr_t key,
void *value);
DBUS_PRIVATE_EXPORT
int _dbus_hash_table_get_n_entries (DBusHashTable *table);
/* Preallocation */
......@@ -119,9 +138,12 @@ int _dbus_hash_table_get_n_entries (DBusHashTable *table);
/** A preallocated hash entry */
typedef struct DBusPreallocatedHash DBusPreallocatedHash;
DBUS_PRIVATE_EXPORT
DBusPreallocatedHash *_dbus_hash_table_preallocate_entry (DBusHashTable *table);
DBUS_PRIVATE_EXPORT
void _dbus_hash_table_free_preallocated_entry (DBusHashTable *table,
DBusPreallocatedHash *preallocated);
DBUS_PRIVATE_EXPORT
void _dbus_hash_table_insert_string_preallocated (DBusHashTable *table,
DBusPreallocatedHash *preallocated,
char *key,
......
......@@ -35,9 +35,11 @@
DBUS_BEGIN_DECLS
DBUS_PRIVATE_EXPORT
void _dbus_warn (const char *format,
...) _DBUS_GNUC_PRINTF (1, 2);
DBUS_PRIVATE_EXPORT
void _dbus_warn_check_failed (const char *format,
...) _DBUS_GNUC_PRINTF (1, 2);
......@@ -89,17 +91,23 @@ void _dbus_warn_check_failed (const char *format,
#endif
#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
DBUS_PRIVATE_EXPORT
void _dbus_verbose_real (const char *file, const int line, const char *function,
const char *format,...) _DBUS_GNUC_PRINTF (4, 5);
# define _dbus_verbose(fmt,...) _dbus_verbose_real( __FILE__,__LINE__,__FUNCTION__,fmt, ## __VA_ARGS__)
#else
DBUS_PRIVATE_EXPORT
void _dbus_verbose_real (const char *format,
...) _DBUS_GNUC_PRINTF (1, 2);
# define _dbus_verbose _dbus_verbose_real
#endif
DBUS_PRIVATE_EXPORT
void _dbus_verbose_reset_real (void);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_is_verbose_real (void);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_get_verbose (void);
DBUS_PRIVATE_EXPORT
void _dbus_set_verbose (dbus_bool_t state);
# define _dbus_verbose_reset _dbus_verbose_reset_real
......@@ -124,11 +132,13 @@ void _dbus_trace_ref (const char *obj_name,
const char *env_var,
int *enabled);
DBUS_PRIVATE_EXPORT
const char* _dbus_strerror (int error_number);
#ifdef DBUS_DISABLE_ASSERT
#define _dbus_assert(condition) do { } while (0)
#else
DBUS_PRIVATE_EXPORT
void _dbus_real_assert (dbus_bool_t condition,
const char *condition_text,
const char *file,
......@@ -141,6 +151,7 @@ void _dbus_real_assert (dbus_bool_t condition,
#ifdef DBUS_DISABLE_ASSERT
#define _dbus_assert_not_reached(explanation) do { } while (0)
#else
DBUS_PRIVATE_EXPORT
void _dbus_real_assert_not_reached (const char *explanation,
const char *file,
int line) _DBUS_GNUC_NORETURN;
......@@ -153,6 +164,7 @@ void _dbus_real_assert_not_reached (const char *explanation,
#define _dbus_return_val_if_fail(condition, val)
#else
DBUS_PRIVATE_EXPORT
extern const char *_dbus_return_if_fail_warning_format;
#define _dbus_return_if_fail(condition) do { \
......@@ -215,9 +227,11 @@ extern const char *_dbus_return_if_fail_warning_format;
((void*)_DBUS_ALIGN_VALUE(this, boundary))
DBUS_PRIVATE_EXPORT
char* _dbus_strdup (const char *str);
void* _dbus_memdup (const void *mem,
size_t n_bytes);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_string_array_contains (const char **array,
const char *str);
char** _dbus_dup_string_array (const char **array);
......@@ -259,12 +273,15 @@ dbus_bool_t _dbus_set_fd_nonblocking (int fd,
void _dbus_verbose_bytes (const unsigned char *data,
int len,
int offset);
DBUS_PRIVATE_EXPORT
void _dbus_verbose_bytes_of_string (const DBusString *str,
int start,
int len);
DBUS_PRIVATE_EXPORT
extern const char *_dbus_no_memory_message;
#define _DBUS_SET_OOM(error) dbus_set_error_const ((error), DBUS_ERROR_NO_MEMORY, _dbus_no_memory_message)
DBUS_PRIVATE_EXPORT
void _dbus_set_error_valist (DBusError *error,
const char *name,
const char *format,
......@@ -278,9 +295,11 @@ void _dbus_set_fail_alloc_failures (int failures_per_failure);
int _dbus_get_fail_alloc_failures (void);
dbus_bool_t _dbus_decrement_fail_alloc_counter (void);
dbus_bool_t _dbus_disable_mem_pools (void);
DBUS_PRIVATE_EXPORT
int _dbus_get_malloc_blocks_outstanding (void);
typedef dbus_bool_t (* DBusTestMemoryFunction) (void *data);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_test_oom_handling (const char *description,
DBusTestMemoryFunction func,
void *data);
......@@ -297,6 +316,7 @@ dbus_bool_t _dbus_test_oom_handling (const char *description,
#endif /* !DBUS_ENABLE_EMBEDDED_TESTS */
typedef void (* DBusShutdownFunction) (void *data);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_register_shutdown_func (DBusShutdownFunction function,
void *data);
dbus_bool_t _dbus_register_shutdown_func_unlocked (DBusShutdownFunction function,
......@@ -335,6 +355,7 @@ void _dbus_unlock (DBusGlobalLock lock);
#define _DBUS_LOCK(name) _dbus_lock (_DBUS_LOCK_##name)
#define _DBUS_UNLOCK(name) _dbus_unlock (_DBUS_LOCK_##name)
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_threads_init_debug (void);
dbus_bool_t _dbus_address_append_escaped (DBusString *escaped,
......@@ -359,7 +380,9 @@ union DBusGUID
char as_bytes[DBUS_UUID_LENGTH_BYTES]; /**< guid as 16 single-byte values */
};
DBUS_PRIVATE_EXPORT
void _dbus_generate_uuid (DBusGUID *uuid);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_uuid_encode (const DBusGUID *uuid,
DBusString *encoded);
dbus_bool_t _dbus_read_uuid_file (const DBusString *filename,
......
......@@ -37,52 +37,78 @@ struct DBusList
DBusList *next; /**< Next list node. */
void *data; /**< Data stored at this element. */
};
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_list_append (DBusList **list,
void *data);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_list_prepend (DBusList **list,
void *data);
dbus_bool_t _dbus_list_insert_before (DBusList **list,
DBusList *before_this_link,
void *data);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_list_insert_after (DBusList **list,
DBusList *after_this_link,
void *data);
DBUS_PRIVATE_EXPORT
void _dbus_list_insert_before_link (DBusList **list,
DBusList *before_this_link,
DBusList *link);
DBUS_PRIVATE_EXPORT
void _dbus_list_insert_after_link (DBusList **list,
DBusList *after_this_link,
DBusList *link);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_list_remove (DBusList **list,
void *data);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_list_remove_last (DBusList **list,
void *data);
DBUS_PRIVATE_EXPORT
void _dbus_list_remove_link (DBusList **list,
DBusList *link);
DBUS_PRIVATE_EXPORT
DBusList* _dbus_list_find_last (DBusList **list,
void *data);
DBUS_PRIVATE_EXPORT
void _dbus_list_clear (DBusList **list);
DBUS_PRIVATE_EXPORT
DBusList* _dbus_list_get_first_link (DBusList **list);
DBUS_PRIVATE_EXPORT
DBusList* _dbus_list_get_last_link (DBusList **list);
DBUS_PRIVATE_EXPORT
void* _dbus_list_get_last (DBusList **list);
DBUS_PRIVATE_EXPORT
void* _dbus_list_get_first (DBusList **list);
DBUS_PRIVATE_EXPORT
void* _dbus_list_pop_first (DBusList **list);
DBUS_PRIVATE_EXPORT
void* _dbus_list_pop_last (DBusList **list);
DBUS_PRIVATE_EXPORT
DBusList* _dbus_list_pop_first_link (DBusList **list);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_list_copy (DBusList **list,
DBusList **dest);
DBUS_PRIVATE_EXPORT
int _dbus_list_get_length (DBusList **list);
DBUS_PRIVATE_EXPORT
DBusList* _dbus_list_alloc_link (void *data);
DBUS_PRIVATE_EXPORT
void _dbus_list_free_link (DBusList *link);
DBUS_PRIVATE_EXPORT
void _dbus_list_unlink (DBusList **list,
DBusList *link);
DBUS_PRIVATE_EXPORT
void _dbus_list_append_link (DBusList **list,
DBusList *link);
DBUS_PRIVATE_EXPORT
void _dbus_list_prepend_link (DBusList **list,
DBusList *link);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_list_length_is_one (DBusList **list);
DBUS_PRIVATE_EXPORT
void _dbus_list_foreach (DBusList **list,
DBusForeachFunction function,
void *data);
......@@ -91,6 +117,7 @@ void _dbus_list_foreach (DBusList **list,
#define _dbus_list_get_prev_link(list, link) ((link) == *(list) ? NULL : (link)->prev)
/* if DBUS_ENABLE_STATS */
DBUS_PRIVATE_EXPORT
void _dbus_list_get_stats (dbus_uint32_t *in_use_p,
dbus_uint32_t *in_free_list_p,
dbus_uint32_t *allocated_p);
......
......@@ -182,7 +182,9 @@
* platforms other than Windows.
*/
#if defined(_WIN32)
#if defined(DBUS_EXPORT)
/* value forced by compiler command line, don't redefine */
#elif defined(_WIN32)
# if defined(DBUS_STATIC_BUILD)
# define DBUS_EXPORT
# elif defined(dbus_1_EXPORTS)
......@@ -190,10 +192,28 @@
# else
# define DBUS_EXPORT __declspec(dllimport)
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4
# define DBUS_EXPORT __attribute__ ((__visibility__ ("default")))
#else
#define DBUS_EXPORT
#endif
#if defined(DBUS_PRIVATE_EXPORT)
/* value forced by compiler command line, don't redefine */
#elif defined(_WIN32)
# if defined(DBUS_STATIC_BUILD)
# define DBUS_PRIVATE_EXPORT /* no decoration */
# elif defined(dbus_1_EXPORTS)
# define DBUS_PRIVATE_EXPORT __declspec(dllexport)
# else
# define DBUS_PRIVATE_EXPORT __declspec(dllimport)
# endif
#elif defined(__GNUC__) && __GNUC__ >= 4
# define DBUS_PRIVATE_EXPORT __attribute__ ((__visibility__ ("default")))
#else
# define DBUS_PRIVATE_EXPORT /* no decoration */
#endif
/** @} */
#endif /* DBUS_MACROS_H */
......@@ -148,6 +148,7 @@
#endif
#ifndef _dbus_unpack_uint16
DBUS_PRIVATE_EXPORT
dbus_uint16_t _dbus_unpack_uint16 (int byte_order,
const unsigned char *data);
#endif
......@@ -156,6 +157,7 @@ void _dbus_pack_uint32 (dbus_uint32_t value,
int byte_order,
unsigned char *data);
#ifndef _dbus_unpack_uint32
DBUS_PRIVATE_EXPORT
dbus_uint32_t _dbus_unpack_uint32 (int byte_order,
const unsigned char *data);
#endif
......@@ -201,18 +203,22 @@ void _dbus_marshal_skip_array (const DBusString *str,
int element_type,
int byte_order,
int *pos);
DBUS_PRIVATE_EXPORT
void _dbus_marshal_set_uint32 (DBusString *str,
int pos,
dbus_uint32_t value,
int byte_order);
DBUS_PRIVATE_EXPORT
dbus_uint32_t _dbus_marshal_read_uint32 (const DBusString *str,
int pos,
int byte_order,
int *new_pos);
int _dbus_type_get_alignment (int typecode);
int _dbus_type_get_alignment (int typecode);
DBUS_PRIVATE_EXPORT
const char* _dbus_type_to_string (int typecode);
DBUS_PRIVATE_EXPORT
int _dbus_first_type_in_signature (const DBusString *str,
int pos);
......
......@@ -27,6 +27,7 @@
#include <dbus/dbus-protocol.h>
#include <dbus/dbus-marshal-recursive.h>
DBUS_PRIVATE_EXPORT
void _dbus_marshal_byteswap (const DBusString *signature,
int signature_start,
int old_byte_order,
......
......@@ -78,6 +78,7 @@ void _dbus_header_set_serial (DBusHeader *header,
dbus_uint32_t _dbus_header_get_serial (DBusHeader *header);
void _dbus_header_update_lengths (DBusHeader *header,
int body_len);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_header_set_field_basic (DBusHeader *header,
int field,
int type,
......@@ -86,10 +87,12 @@ dbus_bool_t _dbus_header_get_field_basic (DBusHeader *header,
int field,
int type,
void *value);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_header_get_field_raw (DBusHeader *header,
int field,
const DBusString **str,
int *pos);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_header_delete_field (DBusHeader *header,
int field);
void _dbus_header_toggle_flag (DBusHeader *header,
......@@ -121,6 +124,7 @@ dbus_bool_t _dbus_header_load (DBusHeader *header,
int len);
void _dbus_header_byteswap (DBusHeader *header,
int new_order);
DBUS_PRIVATE_EXPORT
char _dbus_header_get_byte_order (const DBusHeader *header);
......
......@@ -96,37 +96,48 @@ struct DBusArrayLenFixup
int new_len; /**< the new value of the length in the written-out block */
};
DBUS_PRIVATE_EXPORT
void _dbus_type_reader_init (DBusTypeReader *reader,
int byte_order,
const DBusString *type_str,
int type_pos,
const DBusString *value_str,
int value_pos);
DBUS_PRIVATE_EXPORT
void _dbus_type_reader_init_types_only (DBusTypeReader *reader,
const DBusString *type_str,
int type_pos);
DBUS_PRIVATE_EXPORT
int _dbus_type_reader_get_current_type (const DBusTypeReader *reader);
DBUS_PRIVATE_EXPORT
int _dbus_type_reader_get_element_type (const DBusTypeReader *reader);
int _dbus_type_reader_get_value_pos (const DBusTypeReader *reader);
DBUS_PRIVATE_EXPORT
void _dbus_type_reader_read_basic (const DBusTypeReader *reader,
void *value);
int _dbus_type_reader_get_array_length (const DBusTypeReader *reader);
DBUS_PRIVATE_EXPORT
void _dbus_type_reader_read_fixed_multi (const DBusTypeReader *reader,
void *value,
int *n_elements);
void _dbus_type_reader_read_raw (const DBusTypeReader *reader,
const unsigned char **value_location);
DBUS_PRIVATE_EXPORT
void _dbus_type_reader_recurse (DBusTypeReader *reader,
DBusTypeReader *subreader);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_reader_next (DBusTypeReader *reader);
dbus_bool_t _dbus_type_reader_has_next (const DBusTypeReader *reader);
DBUS_PRIVATE_EXPORT
void _dbus_type_reader_get_signature (const DBusTypeReader *reader,
const DBusString **str_p,
int *start_p,
int *len_p);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_reader_set_basic (DBusTypeReader *reader,
const void *value,
const DBusTypeReader *realign_root);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_reader_delete (DBusTypeReader *reader,
const DBusTypeReader *realign_root);
......@@ -136,6 +147,7 @@ dbus_bool_t _dbus_type_reader_equal_values (const DBusTypeReader *l
void _dbus_type_signature_next (const char *signature,
int *type_pos);
DBUS_PRIVATE_EXPORT
void _dbus_type_writer_init (DBusTypeWriter *writer,
int byte_order,
DBusString *type_str,
......@@ -150,30 +162,36 @@ void _dbus_type_writer_add_types (DBusTypeWriter *write
DBusString *type_str,
int type_pos);
void _dbus_type_writer_remove_types (DBusTypeWriter *writer);
DBUS_PRIVATE_EXPORT
void _dbus_type_writer_init_values_only (DBusTypeWriter *writer,
int byte_order,
const DBusString *type_str,
int type_pos,
DBusString *value_str,
int value_pos);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_writer_write_basic (DBusTypeWriter *writer,
int type,
const void *value);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_writer_write_fixed_multi (DBusTypeWriter *writer,
int element_type,
const void *value,
int n_elements);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_writer_recurse (DBusTypeWriter *writer,
int container_type,
const DBusString *contained_type,
int contained_type_start,
DBusTypeWriter *sub);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_writer_unrecurse (DBusTypeWriter *writer,
DBusTypeWriter *sub);
dbus_bool_t _dbus_type_writer_append_array (DBusTypeWriter *writer,
const DBusString *contained_type,
int contained_type_start,
DBusTypeWriter *sub);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_type_writer_write_reader (DBusTypeWriter *writer,
DBusTypeReader *reader);
......
......@@ -116,9 +116,11 @@ typedef enum
DBUS_VALIDITY_LAST
} DBusValidity;
DBUS_PRIVATE_EXPORT
DBusValidity _dbus_validate_signature_with_reason (const DBusString *type_str,
int type_pos,
int len);
DBUS_PRIVATE_EXPORT
DBusValidity _dbus_validate_body_with_reason (const DBusString *expected_signature,
int expected_signature_start,
int byte_order,
......@@ -129,24 +131,31 @@ DBusValidity _dbus_validate_body_with_reason (const DBusString *expected_si
const char *_dbus_validity_to_error_message (DBusValidity validity);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_validate_path (const DBusString *str,
int start,
int len);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_validate_interface (const DBusString *str,
int start,
int len);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_validate_member (const DBusString *str,
int start,
int len);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_validate_error_name (const DBusString *str,
int start,
int len);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_validate_bus_name (const DBusString *str,
int start,
int len);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_validate_bus_namespace (const DBusString *str,
int start,
int len);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_validate_signature (const DBusString *str,
int start,
int len);
......
......@@ -32,10 +32,14 @@ DBUS_BEGIN_DECLS
typedef struct DBusMemPool DBusMemPool;
DBUS_PRIVATE_EXPORT
DBusMemPool* _dbus_mem_pool_new (int element_size,
dbus_bool_t zero_elements);
DBUS_PRIVATE_EXPORT
void _dbus_mem_pool_free (DBusMemPool *pool);
DBUS_PRIVATE_EXPORT
void* _dbus_mem_pool_alloc (DBusMemPool *pool);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_mem_pool_dealloc (DBusMemPool *pool,
void *element);
......
......@@ -50,6 +50,7 @@ typedef struct DBusMessageLoader DBusMessageLoader;
void _dbus_message_get_network_data (DBusMessage *message,
const DBusString **header,
const DBusString **body);
DBUS_PRIVATE_EXPORT
void _dbus_message_get_unix_fds (DBusMessage *message,
const int **fds,