From 1acf5d89944dbe26b49aec9145c5a08003d4c23a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 17 Sep 2014 18:50:53 +0100 Subject: [PATCH 6/7] Explicitly export all symbols needed to compile the tests for Windows --- dbus/dbus-auth.h | 15 +++++++++++ dbus/dbus-connection-internal.h | 7 ++++++ dbus/dbus-credentials.h | 18 ++++++++++++++ dbus/dbus-file.h | 2 ++ dbus/dbus-hash.h | 22 +++++++++++++++++ dbus/dbus-internals.h | 15 +++++++++++ dbus/dbus-list.h | 25 +++++++++++++++++++ dbus/dbus-macros.h | 4 +++ dbus/dbus-marshal-basic.h | 6 +++++ dbus/dbus-marshal-byteswap.h | 1 + dbus/dbus-marshal-header.h | 4 +++ dbus/dbus-marshal-recursive.h | 18 ++++++++++++++ dbus/dbus-marshal-validate.h | 9 +++++++ dbus/dbus-mempool.h | 4 +++ dbus/dbus-message-internal.h | 9 +++++++ dbus/dbus-message-private.h | 1 + dbus/dbus-pending-call-internal.h | 3 +++ dbus/dbus-pipe.h | 7 ++++++ dbus/dbus-server-protected.h | 3 +++ dbus/dbus-string-util.c | 1 + dbus/dbus-string.h | 52 +++++++++++++++++++++++++++++++++++++++ dbus/dbus-sysdeps-win.h | 6 +++++ dbus/dbus-sysdeps.h | 19 ++++++++++++++ dbus/dbus-test.h | 43 ++++++++++++++++++++++++++++++++ dbus/dbus-threads-internal.h | 2 ++ dbus/dbus-timeout.h | 4 +++ dbus/dbus-watch.h | 11 +++++++++ 27 files changed, 311 insertions(+) diff --git a/dbus/dbus-auth.h b/dbus/dbus-auth.h index ba1975f..e032302 100644 --- a/dbus/dbus-auth.h +++ b/dbus/dbus-auth.h @@ -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); diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h index 2897404..3fbb549 100644 --- a/dbus/dbus-connection-internal.h +++ b/dbus/dbus-connection-internal.h @@ -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,13 +100,16 @@ 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); diff --git a/dbus/dbus-credentials.h b/dbus/dbus-credentials.h index abcc4bb..5384017 100644 --- a/dbus/dbus-credentials.h +++ b/dbus/dbus-credentials.h @@ -37,29 +37,43 @@ 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_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); 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); @@ -67,10 +81,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); diff --git a/dbus/dbus-file.h b/dbus/dbus-file.h index 24837f4..4fa30cd 100644 --- a/dbus/dbus-file.h +++ b/dbus/dbus-file.h @@ -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); diff --git a/dbus/dbus-hash.h b/dbus/dbus-hash.h index 5aa183c..723d267 100644 --- a/dbus/dbus-hash.h +++ b/dbus/dbus-hash.h @@ -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, diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h index 4658b67..10b8dc3 100644 --- a/dbus/dbus-internals.h +++ b/dbus/dbus-internals.h @@ -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,6 +91,7 @@ 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__) @@ -127,6 +130,7 @@ 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, @@ -139,6 +143,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; @@ -151,6 +156,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 { \ @@ -213,9 +219,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); @@ -257,10 +265,12 @@ 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) @@ -272,9 +282,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); @@ -329,6 +341,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, @@ -353,7 +366,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, diff --git a/dbus/dbus-list.h b/dbus/dbus-list.h index 910d738..9731a51 100644 --- a/dbus/dbus-list.h +++ b/dbus/dbus-list.h @@ -37,52 +37,77 @@ 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_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); diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h index 8d6c300..467ba37 100644 --- a/dbus/dbus-macros.h +++ b/dbus/dbus-macros.h @@ -185,13 +185,17 @@ #if defined(_WIN32) # if defined(DBUS_STATIC_BUILD) # define DBUS_EXPORT +# define DBUS_PRIVATE_EXPORT # elif defined(dbus_1_EXPORTS) # define DBUS_EXPORT __declspec(dllexport) +# define DBUS_PRIVATE_EXPORT __declspec(dllexport) # else # define DBUS_EXPORT __declspec(dllimport) +# define DBUS_PRIVATE_EXPORT __declspec(dllimport) # endif #else #define DBUS_EXPORT +#define DBUS_PRIVATE_EXPORT #endif /** @} */ diff --git a/dbus/dbus-marshal-basic.h b/dbus/dbus-marshal-basic.h index 9df67cb..68ff348 100644 --- a/dbus/dbus-marshal-basic.h +++ b/dbus/dbus-marshal-basic.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); diff --git a/dbus/dbus-marshal-byteswap.h b/dbus/dbus-marshal-byteswap.h index be2dd75..f66f2e2 100644 --- a/dbus/dbus-marshal-byteswap.h +++ b/dbus/dbus-marshal-byteswap.h @@ -27,6 +27,7 @@ #include #include +DBUS_PRIVATE_EXPORT void _dbus_marshal_byteswap (const DBusString *signature, int signature_start, int old_byte_order, diff --git a/dbus/dbus-marshal-header.h b/dbus/dbus-marshal-header.h index 350fe5c..c8c0112 100644 --- a/dbus/dbus-marshal-header.h +++ b/dbus/dbus-marshal-header.h @@ -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); diff --git a/dbus/dbus-marshal-recursive.h b/dbus/dbus-marshal-recursive.h index acbfd73..fa1d1ef 100644 --- a/dbus/dbus-marshal-recursive.h +++ b/dbus/dbus-marshal-recursive.h @@ -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); diff --git a/dbus/dbus-marshal-validate.h b/dbus/dbus-marshal-validate.h index 0643420..8ab024f 100644 --- a/dbus/dbus-marshal-validate.h +++ b/dbus/dbus-marshal-validate.h @@ -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); diff --git a/dbus/dbus-mempool.h b/dbus/dbus-mempool.h index 6693eeb..bc465ac 100644 --- a/dbus/dbus-mempool.h +++ b/dbus/dbus-mempool.h @@ -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); diff --git a/dbus/dbus-message-internal.h b/dbus/dbus-message-internal.h index e9a9ec0..501450f 100644 --- a/dbus/dbus-message-internal.h +++ b/dbus/dbus-message-internal.h @@ -63,12 +63,17 @@ void _dbus_message_add_counter_link (DBusMessage *message, void _dbus_message_remove_counter (DBusMessage *message, DBusCounter *counter); +DBUS_PRIVATE_EXPORT DBusMessageLoader* _dbus_message_loader_new (void); +DBUS_PRIVATE_EXPORT DBusMessageLoader* _dbus_message_loader_ref (DBusMessageLoader *loader); +DBUS_PRIVATE_EXPORT void _dbus_message_loader_unref (DBusMessageLoader *loader); +DBUS_PRIVATE_EXPORT void _dbus_message_loader_get_buffer (DBusMessageLoader *loader, DBusString **buffer); +DBUS_PRIVATE_EXPORT void _dbus_message_loader_return_buffer (DBusMessageLoader *loader, DBusString *buffer); @@ -79,18 +84,22 @@ void _dbus_message_loader_return_unix_fds (DBusMessageLoader int *fds, unsigned n_fds); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_loader_queue_messages (DBusMessageLoader *loader); DBusMessage* _dbus_message_loader_peek_message (DBusMessageLoader *loader); +DBUS_PRIVATE_EXPORT DBusMessage* _dbus_message_loader_pop_message (DBusMessageLoader *loader); DBusList* _dbus_message_loader_pop_message_link (DBusMessageLoader *loader); void _dbus_message_loader_putback_message_link (DBusMessageLoader *loader, DBusList *link); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_loader_get_is_corrupted (DBusMessageLoader *loader); DBusValidity _dbus_message_loader_get_corruption_reason (DBusMessageLoader *loader); void _dbus_message_loader_set_max_message_size (DBusMessageLoader *loader, long size); +DBUS_PRIVATE_EXPORT long _dbus_message_loader_get_max_message_size (DBusMessageLoader *loader); void _dbus_message_loader_set_max_message_unix_fds(DBusMessageLoader *loader, diff --git a/dbus/dbus-message-private.h b/dbus/dbus-message-private.h index a611b09..50c41a8 100644 --- a/dbus/dbus-message-private.h +++ b/dbus/dbus-message-private.h @@ -133,6 +133,7 @@ struct DBusMessage #endif }; +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_iter_get_args_valist (DBusMessageIter *iter, DBusError *error, int first_arg_type, diff --git a/dbus/dbus-pending-call-internal.h b/dbus/dbus-pending-call-internal.h index 1875eea..393e660 100644 --- a/dbus/dbus-pending-call-internal.h +++ b/dbus/dbus-pending-call-internal.h @@ -51,10 +51,13 @@ void _dbus_pending_call_set_reply_serial_unlocked (DBusPendingCal dbus_bool_t _dbus_pending_call_set_timeout_error_unlocked (DBusPendingCall *pending, DBusMessage *message, dbus_uint32_t serial); +DBUS_PRIVATE_EXPORT DBusPendingCall* _dbus_pending_call_new_unlocked (DBusConnection *connection, int timeout_milliseconds, DBusTimeoutHandler timeout_handler); +DBUS_PRIVATE_EXPORT DBusPendingCall* _dbus_pending_call_ref_unlocked (DBusPendingCall *pending); +DBUS_PRIVATE_EXPORT void _dbus_pending_call_unref_and_unlock (DBusPendingCall *pending); dbus_bool_t _dbus_pending_call_set_data_unlocked (DBusPendingCall *pending, dbus_int32_t slot, diff --git a/dbus/dbus-pipe.h b/dbus/dbus-pipe.h index c2063b5..ca924cc 100644 --- a/dbus/dbus-pipe.h +++ b/dbus/dbus-pipe.h @@ -42,18 +42,25 @@ struct DBusPipe { int fd; }; +DBUS_PRIVATE_EXPORT void _dbus_pipe_init (DBusPipe *pipe, int fd); +DBUS_PRIVATE_EXPORT void _dbus_pipe_init_stdout (DBusPipe *pipe); +DBUS_PRIVATE_EXPORT int _dbus_pipe_write (DBusPipe *pipe, const DBusString *buffer, int start, int len, DBusError *error); +DBUS_PRIVATE_EXPORT int _dbus_pipe_close (DBusPipe *pipe, DBusError *error); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_pipe_is_valid (DBusPipe *pipe); +DBUS_PRIVATE_EXPORT void _dbus_pipe_invalidate (DBusPipe *pipe); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_pipe_is_stdout_or_stderr (DBusPipe *pipe); #endif diff --git a/dbus/dbus-server-protected.h b/dbus/dbus-server-protected.h index e6dbd1e..44f53ee 100644 --- a/dbus/dbus-server-protected.h +++ b/dbus/dbus-server-protected.h @@ -99,6 +99,7 @@ dbus_bool_t _dbus_server_add_watch (DBusServer *server, DBusWatch *watch); void _dbus_server_remove_watch (DBusServer *server, DBusWatch *watch); +DBUS_PRIVATE_EXPORT void _dbus_server_toggle_all_watches (DBusServer *server, dbus_bool_t enabled); dbus_bool_t _dbus_server_add_timeout (DBusServer *server, @@ -109,7 +110,9 @@ void _dbus_server_toggle_timeout (DBusServer *server, DBusTimeout *timeout, dbus_bool_t enabled); +DBUS_PRIVATE_EXPORT void _dbus_server_ref_unlocked (DBusServer *server); +DBUS_PRIVATE_EXPORT void _dbus_server_unref_unlocked (DBusServer *server); typedef enum diff --git a/dbus/dbus-string-util.c b/dbus/dbus-string-util.c index 3babc05..5764d33 100644 --- a/dbus/dbus-string-util.c +++ b/dbus/dbus-string-util.c @@ -25,6 +25,7 @@ #include #include "dbus-internals.h" #include "dbus-string.h" +#include "dbus-test.h" #define DBUS_CAN_USE_DBUS_STRING_PRIVATE 1 #include "dbus-string-private.h" diff --git a/dbus/dbus-string.h b/dbus/dbus-string.h index 44860fe..0dc8df9 100644 --- a/dbus/dbus-string.h +++ b/dbus/dbus-string.h @@ -67,7 +67,9 @@ struct DBusString #define _dbus_string_get_const_data_len(s,start,len) (((const char*)(((DBusString*)(s))->dummy1)) + (start)) #endif +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_init (DBusString *str); +DBUS_PRIVATE_EXPORT void _dbus_string_init_const (DBusString *str, const char *value); void _dbus_string_init_const_len (DBusString *str, @@ -76,48 +78,60 @@ void _dbus_string_init_const_len (DBusString *str, dbus_bool_t _dbus_string_init_preallocated (DBusString *str, int allocate_size); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_init_from_string (DBusString *str, const DBusString *from); +DBUS_PRIVATE_EXPORT void _dbus_string_free (DBusString *str); void _dbus_string_lock (DBusString *str); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_compact (DBusString *str, int max_waste); #ifndef _dbus_string_get_data +DBUS_PRIVATE_EXPORT char* _dbus_string_get_data (DBusString *str); #endif /* _dbus_string_get_data */ #ifndef _dbus_string_get_const_data +DBUS_PRIVATE_EXPORT const char* _dbus_string_get_const_data (const DBusString *str); #endif /* _dbus_string_get_const_data */ char* _dbus_string_get_data_len (DBusString *str, int start, int len); #ifndef _dbus_string_get_const_data_len +DBUS_PRIVATE_EXPORT const char* _dbus_string_get_const_data_len (const DBusString *str, int start, int len); #endif #ifndef _dbus_string_set_byte +DBUS_PRIVATE_EXPORT void _dbus_string_set_byte (DBusString *str, int i, unsigned char byte); #endif #ifndef _dbus_string_get_byte +DBUS_PRIVATE_EXPORT unsigned char _dbus_string_get_byte (const DBusString *str, int start); #endif /* _dbus_string_get_byte */ +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_insert_bytes (DBusString *str, int i, int n_bytes, unsigned char byte); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_insert_byte (DBusString *str, int i, unsigned char byte); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_steal_data (DBusString *str, char **data_return); dbus_bool_t _dbus_string_steal_data_len (DBusString *str, char **data_return, int start, int len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_copy_data (const DBusString *str, char **data_return); dbus_bool_t _dbus_string_copy_data_len (const DBusString *str, @@ -131,33 +145,43 @@ void _dbus_string_copy_to_buffer_with_nul (const DBusString *str, char *buffer, int avail_len); #ifndef _dbus_string_get_length +DBUS_PRIVATE_EXPORT int _dbus_string_get_length (const DBusString *str); #endif /* !_dbus_string_get_length */ +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_lengthen (DBusString *str, int additional_length); +DBUS_PRIVATE_EXPORT void _dbus_string_shorten (DBusString *str, int length_to_remove); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_set_length (DBusString *str, int length); dbus_bool_t _dbus_string_align_length (DBusString *str, int alignment); dbus_bool_t _dbus_string_alloc_space (DBusString *str, int extra_bytes); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_append (DBusString *str, const char *buffer); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_append_len (DBusString *str, const char *buffer, int len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_append_int (DBusString *str, long value); dbus_bool_t _dbus_string_append_uint (DBusString *str, unsigned long value); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_append_byte (DBusString *str, unsigned char byte); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_append_printf (DBusString *str, const char *format, ...) _DBUS_GNUC_PRINTF (2, 3); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_append_printf_valist (DBusString *str, const char *format, va_list args); @@ -173,13 +197,16 @@ dbus_bool_t _dbus_string_insert_8_aligned (DBusString *str, dbus_bool_t _dbus_string_insert_alignment (DBusString *str, int *insert_at, int alignment); +DBUS_PRIVATE_EXPORT void _dbus_string_delete (DBusString *str, int start, int len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_move (DBusString *source, int start, DBusString *dest, int insert_at); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_copy (const DBusString *source, int start, DBusString *dest, @@ -189,36 +216,44 @@ dbus_bool_t _dbus_string_move_len (DBusString *source, int len, DBusString *dest, int insert_at); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_copy_len (const DBusString *source, int start, int len, DBusString *dest, int insert_at); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_replace_len (const DBusString *source, int start, int len, DBusString *dest, int replace_at, int replace_len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_split_on_byte (DBusString *source, unsigned char byte, DBusString *tail); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_parse_int (const DBusString *str, int start, long *value_return, int *end_return); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_parse_uint (const DBusString *str, int start, unsigned long *value_return, int *end_return); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_find (const DBusString *str, int start, const char *substr, int *found); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_find_eol (const DBusString *str, int start, int *found, int *found_len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_find_to (const DBusString *str, int start, int end, @@ -228,62 +263,79 @@ dbus_bool_t _dbus_string_find_byte_backward (const DBusString *str, int start, unsigned char byte, int *found); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_find_blank (const DBusString *str, int start, int *found); +DBUS_PRIVATE_EXPORT void _dbus_string_skip_blank (const DBusString *str, int start, int *end); +DBUS_PRIVATE_EXPORT void _dbus_string_skip_white (const DBusString *str, int start, int *end); void _dbus_string_skip_white_reverse (const DBusString *str, int end, int *start); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_equal (const DBusString *a, const DBusString *b); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_equal_c_str (const DBusString *a, const char *c_str); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_equal_len (const DBusString *a, const DBusString *b, int len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_equal_substring (const DBusString *a, int a_start, int a_len, const DBusString *b, int b_start); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_starts_with_c_str (const DBusString *a, const char *c_str); dbus_bool_t _dbus_string_ends_with_c_str (const DBusString *a, const char *c_str); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_pop_line (DBusString *source, DBusString *dest); +DBUS_PRIVATE_EXPORT void _dbus_string_delete_first_word (DBusString *str); +DBUS_PRIVATE_EXPORT void _dbus_string_delete_leading_blanks (DBusString *str); void _dbus_string_chop_white (DBusString *str); dbus_bool_t _dbus_string_append_byte_as_hex (DBusString *str, unsigned char byte); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_hex_encode (const DBusString *source, int start, DBusString *dest, int insert_at); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_hex_decode (const DBusString *source, int start, int *end_return, DBusString *dest, int insert_at); +DBUS_PRIVATE_EXPORT void _dbus_string_tolower_ascii (const DBusString *str, int start, int len); +DBUS_PRIVATE_EXPORT void _dbus_string_toupper_ascii (const DBusString *str, int start, int len); dbus_bool_t _dbus_string_validate_ascii (const DBusString *str, int start, int len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_validate_utf8 (const DBusString *str, int start, int len); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_string_validate_nul (const DBusString *str, int start, int len); diff --git a/dbus/dbus-sysdeps-win.h b/dbus/dbus-sysdeps-win.h index 02e7a83..ba00d1e 100644 --- a/dbus/dbus-sysdeps-win.h +++ b/dbus/dbus-sysdeps-win.h @@ -40,13 +40,16 @@ extern void *_dbus_win_get_dll_hmodule (void); void _dbus_win_set_errno (int err); +DBUS_PRIVATE_EXPORT const char* _dbus_win_error_from_last_error (void); dbus_bool_t _dbus_win_startup_winsock (void); void _dbus_win_warn_win_error (const char *message, unsigned long code); +DBUS_PRIVATE_EXPORT char * _dbus_win_error_string (int error_number); +DBUS_PRIVATE_EXPORT void _dbus_win_free_error_string (char *string); extern const char* _dbus_lm_strerror (int error_number); @@ -70,6 +73,7 @@ wchar_t *_dbus_win_utf8_to_utf16 (const char *str, char *_dbus_win_utf16_to_utf8 (const wchar_t *str, DBusError *error); +DBUS_PRIVATE_EXPORT void _dbus_win_set_error_from_win_error (DBusError *error, int code); dbus_bool_t @@ -80,9 +84,11 @@ _dbus_win_sid_to_name_and_domain (dbus_uid_t uid, dbus_bool_t _dbus_file_exists (const char *filename); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_get_config_file_name(DBusString *config_file, char *s); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_get_install_root(char *prefix, int len); void _dbus_threads_windows_init_global (void); diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index 955ba9a..ca9a5f5 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -88,6 +88,7 @@ typedef struct DBusPipe DBusPipe; void _dbus_abort (void) _DBUS_GNUC_NORETURN; dbus_bool_t _dbus_check_setuid (void); +DBUS_PRIVATE_EXPORT const char* _dbus_getenv (const char *varname); dbus_bool_t _dbus_clearenv (void); char ** _dbus_get_environment (void); @@ -124,6 +125,7 @@ typedef unsigned long dbus_gid_t; * */ +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_close_socket (int fd, DBusError *error); int _dbus_read_socket (int fd, @@ -191,6 +193,7 @@ dbus_bool_t _dbus_send_credentials_socket (int server_fd, dbus_bool_t _dbus_credentials_add_from_user (DBusCredentials *credentials, const DBusString *username); dbus_bool_t _dbus_credentials_add_from_current_process (DBusCredentials *credentials); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_append_user_from_current_process (DBusString *str); dbus_bool_t _dbus_parse_unix_user_from_config (const DBusString *username, @@ -314,12 +317,15 @@ typedef struct short revents; /**< Events that occurred */ } DBusPollFD; +DBUS_PRIVATE_EXPORT int _dbus_poll (DBusPollFD *fds, int n_fds, int timeout_milliseconds); +DBUS_PRIVATE_EXPORT void _dbus_sleep_milliseconds (int milliseconds); +DBUS_PRIVATE_EXPORT void _dbus_get_monotonic_time (long *tv_sec, long *tv_usec); @@ -329,15 +335,19 @@ void _dbus_get_real_time (long *tv_sec, /** * directory interface */ +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_create_directory (const DBusString *filename, DBusError *error); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_delete_directory (const DBusString *filename, DBusError *error); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_concat_dir_and_file (DBusString *dir, const DBusString *next_component); dbus_bool_t _dbus_string_get_dirname (const DBusString *filename, DBusString *dirname); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_path_is_absolute (const DBusString *filename); dbus_bool_t _dbus_get_standard_session_servicedirs (DBusList **dirs); @@ -359,6 +369,7 @@ void _dbus_directory_close (DBusDirIter *iter); dbus_bool_t _dbus_check_dir_is_private_to_user (DBusString *dir, DBusError *error); +DBUS_PRIVATE_EXPORT const char* _dbus_get_tmpdir (void); /** @@ -370,10 +381,12 @@ void _dbus_generate_random_bytes_buffer (char *buffer, int n_bytes); dbus_bool_t _dbus_generate_random_bytes (DBusString *str, int n_bytes); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_generate_random_ascii (DBusString *str, int n_bytes); const char* _dbus_error_from_errno (int error_number); +DBUS_PRIVATE_EXPORT const char* _dbus_error_from_system_errno (void); void _dbus_set_errno_to_zero (void); @@ -383,6 +396,7 @@ dbus_bool_t _dbus_get_is_errno_enomem (void); dbus_bool_t _dbus_get_is_errno_eintr (void); dbus_bool_t _dbus_get_is_errno_epipe (void); dbus_bool_t _dbus_get_is_errno_etoomanyrefs (void); +DBUS_PRIVATE_EXPORT const char* _dbus_strerror_from_errno (void); void _dbus_disable_sigpipe (void); @@ -390,6 +404,7 @@ void _dbus_disable_sigpipe (void); void _dbus_exit (int code) _DBUS_GNUC_NORETURN; +DBUS_PRIVATE_EXPORT int _dbus_printf_string_upper_bound (const char *format, va_list args); @@ -412,6 +427,7 @@ typedef struct dbus_bool_t _dbus_stat (const DBusString *filename, DBusStat *statbuf, DBusError *error); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_full_duplex_pipe (int *fd1, int *fd2, dbus_bool_t blocking, @@ -527,6 +543,7 @@ void _dbus_threads_lock_platform_specific (void); */ void _dbus_threads_unlock_platform_specific (void); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_split_paths_and_append (DBusString *dirs, const char *suffix, DBusList **dir_list); @@ -537,11 +554,13 @@ unsigned long _dbus_pid_for_log (void); * the PID file handling just needs a little more abstraction * in the bus daemon first. */ +DBUS_PRIVATE_EXPORT dbus_pid_t _dbus_getpid (void); dbus_bool_t _dbus_change_to_daemon_user (const char *user, DBusError *error); +DBUS_PRIVATE_EXPORT void _dbus_flush_caches (void); void _dbus_request_file_descriptor_limit (unsigned int limit); diff --git a/dbus/dbus-test.h b/dbus/dbus-test.h index f254388..71876a1 100644 --- a/dbus/dbus-test.h +++ b/dbus/dbus-test.h @@ -28,29 +28,72 @@ #include #include +/* Only things that are in libdbus-1.la and used from libdbus-internal.la + * need to have DBUS_PRIVATE_EXPORT. If you get + * + * warning: 'foo' redeclared without dllimport attribute: previous + * dllimport ignored [-Wattributes] + * + * then you have added too many. + */ + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_hash_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_list_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_marshal_test (void); + dbus_bool_t _dbus_marshal_recursive_test (void); dbus_bool_t _dbus_marshal_byteswap_test (void); dbus_bool_t _dbus_marshal_validate_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_misc_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_signature_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_mem_pool_test (void); + dbus_bool_t _dbus_string_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_address_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_server_test (void); + dbus_bool_t _dbus_message_test (const char *test_data_dir); dbus_bool_t _dbus_auth_test (const char *test_data_dir); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_sha_test (const char *test_data_dir); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_keyring_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_data_slot_test (void); + dbus_bool_t _dbus_sysdeps_test (void); dbus_bool_t _dbus_spawn_test (const char *test_data_dir); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_userdb_test (const char *test_data_dir); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_transport_unix_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_memory_test (void); + +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_object_tree_test (void); + dbus_bool_t _dbus_credentials_test (const char *test_data_dir); void dbus_internal_do_not_use_run_tests (const char *test_data_dir, diff --git a/dbus/dbus-threads-internal.h b/dbus/dbus-threads-internal.h index 64e8bac..076acd2 100644 --- a/dbus/dbus-threads-internal.h +++ b/dbus/dbus-threads-internal.h @@ -48,7 +48,9 @@ typedef struct DBusCMutex DBusCMutex; DBUS_BEGIN_DECLS +DBUS_PRIVATE_EXPORT void _dbus_rmutex_lock (DBusRMutex *mutex); +DBUS_PRIVATE_EXPORT void _dbus_rmutex_unlock (DBusRMutex *mutex); void _dbus_rmutex_new_at_location (DBusRMutex **location_p); void _dbus_rmutex_free_at_location (DBusRMutex **location_p); diff --git a/dbus/dbus-timeout.h b/dbus/dbus-timeout.h index d0a8af4..c652bb7 100644 --- a/dbus/dbus-timeout.h +++ b/dbus/dbus-timeout.h @@ -40,14 +40,18 @@ typedef struct DBusTimeoutList DBusTimeoutList; /** function to run when the timeout is handled */ typedef dbus_bool_t (* DBusTimeoutHandler) (void *data); +DBUS_PRIVATE_EXPORT DBusTimeout* _dbus_timeout_new (int interval, DBusTimeoutHandler handler, void *data, DBusFreeFunction free_data_function); DBusTimeout* _dbus_timeout_ref (DBusTimeout *timeout); +DBUS_PRIVATE_EXPORT void _dbus_timeout_unref (DBusTimeout *timeout); +DBUS_PRIVATE_EXPORT void _dbus_timeout_set_interval (DBusTimeout *timeout, int interval); +DBUS_PRIVATE_EXPORT void _dbus_timeout_set_enabled (DBusTimeout *timeout, dbus_bool_t enabled); diff --git a/dbus/dbus-watch.h b/dbus/dbus-watch.h index 321740e..d80c83a 100644 --- a/dbus/dbus-watch.h +++ b/dbus/dbus-watch.h @@ -44,14 +44,18 @@ typedef dbus_bool_t (* DBusWatchHandler) (DBusWatch *watch, unsigned int flags, void *data); +DBUS_PRIVATE_EXPORT DBusWatch* _dbus_watch_new (int fd, unsigned int flags, dbus_bool_t enabled, DBusWatchHandler handler, void *data, DBusFreeFunction free_data_function); +DBUS_PRIVATE_EXPORT DBusWatch* _dbus_watch_ref (DBusWatch *watch); +DBUS_PRIVATE_EXPORT void _dbus_watch_unref (DBusWatch *watch); +DBUS_PRIVATE_EXPORT void _dbus_watch_invalidate (DBusWatch *watch); void _dbus_watch_sanitize_condition (DBusWatch *watch, unsigned int *condition); @@ -61,16 +65,21 @@ void _dbus_watch_set_handler (DBusWatch *watch, DBusFreeFunction free_data_function); +DBUS_PRIVATE_EXPORT DBusWatchList* _dbus_watch_list_new (void); +DBUS_PRIVATE_EXPORT void _dbus_watch_list_free (DBusWatchList *watch_list); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_watch_list_set_functions (DBusWatchList *watch_list, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_watch_list_add_watch (DBusWatchList *watch_list, DBusWatch *watch); +DBUS_PRIVATE_EXPORT void _dbus_watch_list_remove_watch (DBusWatchList *watch_list, DBusWatch *watch); void _dbus_watch_list_toggle_watch (DBusWatchList *watch_list, @@ -80,7 +89,9 @@ void _dbus_watch_list_toggle_all_watches (DBusWatchList *watch_li dbus_bool_t enabled); dbus_bool_t _dbus_watch_get_enabled (DBusWatch *watch); +DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_watch_get_oom_last_time (DBusWatch *watch); +DBUS_PRIVATE_EXPORT void _dbus_watch_set_oom_last_time (DBusWatch *watch, dbus_bool_t oom); -- 2.1.0