Logo Search packages:      
Sourcecode: dbus version File versions

Utilities and portability
[D-BUS internal implementation details]


Detailed Description

Utility functions (_dbus_assert(), _dbus_warn(), etc.).


Classes

struct  DBusBabysitter
struct  DBusDirIter

Defines

#define _dbus_assert(condition)   _dbus_real_assert ((condition) != 0, #condition, __FILE__, __LINE__)
#define _dbus_assert_not_reached(explanation)   _dbus_real_assert_not_reached (explanation, __FILE__, __LINE__)
#define _DBUS_DECLARE_GLOBAL_LOCK(name)   extern DBusMutex *_dbus_lock_##name
#define _DBUS_DEFINE_GLOBAL_LOCK(name)   DBusMutex *_dbus_lock_##name
#define _DBUS_INT_MAX   2147483647
#define _DBUS_INT_MIN   (-_DBUS_INT_MAX - 1)
#define _DBUS_INT_TO_POINTER(integer)   ((void*)((long)(integer)))
#define _DBUS_LOCK(name)   dbus_mutex_lock (_dbus_lock_##name)
#define _DBUS_LOCK_NAME(name)   _dbus_lock_##name
#define _DBUS_MAX_SUN_PATH_LENGTH   99
#define _DBUS_N_ELEMENTS(array)   ((int) (sizeof ((array)) / sizeof ((array)[0])))
#define _DBUS_POINTER_TO_INT(pointer)   ((long)(pointer))
#define _DBUS_UNLOCK(name)   dbus_mutex_unlock (_dbus_lock_##name)
#define LIVE_CHILDREN(sitter)   ((sitter)->socket_to_babysitter >= 0 || (sitter)->error_pipe_from_child >= 0)
#define MICROSECONDS_PER_MILLISECOND   1000
#define MICROSECONDS_PER_SECOND   1000000
#define MILLISECONDS_PER_SECOND   1000
#define NANOSECONDS_PER_MILLISECOND   1000000
#define NANOSECONDS_PER_SECOND   1000000000
#define READ_END   0
#define WRITE_END   1

Typedefs

typedef void(* DBusForeachFunction )(void *element, void *data)

Enumerations

enum  { CHILD_EXITED, CHILD_FORK_FAILED, CHILD_EXEC_FAILED, CHILD_PID }
enum  ReadStatus {
  READ_STATUS_OK, READ_STATUS_ERROR, READ_STATUS_EOF, READ_STATUS_OK,
  READ_STATUS_ERROR, READ_STATUS_EOF
}

Functions

void _dbus_abort (void)
int _dbus_accept (int listen_fd)
dbus_int32_t _dbus_atomic_dec (DBusAtomic *atomic)
dbus_int32_t _dbus_atomic_inc (DBusAtomic *atomic)
dbus_bool_t _dbus_babysitter_get_child_exited (DBusBabysitter *sitter)
void _dbus_babysitter_kill_child (DBusBabysitter *sitter)
static DBusBabysitter_dbus_babysitter_new (void)
DBusBabysitter_dbus_babysitter_ref (DBusBabysitter *sitter)
void _dbus_babysitter_set_child_exit_error (DBusBabysitter *sitter, DBusError *error)
dbus_bool_t _dbus_babysitter_set_watch_functions (DBusBabysitter *sitter, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)
void _dbus_babysitter_unref (DBusBabysitter *sitter)
dbus_bool_t _dbus_become_daemon (const DBusString *pidfile, int print_pid_fd, DBusError *error)
dbus_bool_t _dbus_change_identity (dbus_uid_t uid, dbus_gid_t gid, DBusError *error)
dbus_bool_t _dbus_close (int fd, DBusError *error)
dbus_bool_t _dbus_concat_dir_and_file (DBusString *dir, const DBusString *next_component)
int _dbus_connect_tcp_socket (const char *host, dbus_uint32_t port, DBusError *error)
int _dbus_connect_unix_socket (const char *path, dbus_bool_t abstract, DBusError *error)
dbus_bool_t _dbus_create_directory (const DBusString *filename, DBusError *error)
dbus_bool_t _dbus_create_file_exclusively (const DBusString *filename, DBusError *error)
void _dbus_credentials_clear (DBusCredentials *credentials)
void _dbus_credentials_from_current_process (DBusCredentials *credentials)
dbus_bool_t _dbus_credentials_from_uid (dbus_uid_t uid, DBusCredentials *credentials)
dbus_bool_t _dbus_credentials_from_username (const DBusString *username, DBusCredentials *credentials)
dbus_bool_t _dbus_credentials_match (const DBusCredentials *expected_credentials, const DBusCredentials *provided_credentials)
 _DBUS_DEFINE_GLOBAL_LOCK (atomic)
dbus_bool_t _dbus_delete_directory (const DBusString *filename, DBusError *error)
dbus_bool_t _dbus_delete_file (const DBusString *filename, DBusError *error)
void _dbus_directory_close (DBusDirIter *iter)
dbus_bool_t _dbus_directory_get_next_file (DBusDirIter *iter, DBusString *filename, DBusError *error)
DBusDirIter_dbus_directory_open (const DBusString *filename, DBusError *error)
void _dbus_disable_sigpipe (void)
char ** _dbus_dup_string_array (const char **array)
const char * _dbus_error_from_errno (int error_number)
void _dbus_exit (int code)
void _dbus_fd_set_close_on_exec (int fd)
dbus_bool_t _dbus_file_exists (const char *file)
dbus_bool_t _dbus_file_get_contents (DBusString *str, const DBusString *filename, DBusError *error)
dbus_bool_t _dbus_full_duplex_pipe (int *fd1, int *fd2, dbus_bool_t blocking, DBusError *error)
dbus_bool_t _dbus_generate_random_ascii (DBusString *str, int n_bytes)
dbus_bool_t _dbus_generate_random_bytes (DBusString *str, int n_bytes)
void _dbus_get_current_time (long *tv_sec, long *tv_usec)
dbus_bool_t _dbus_get_group_id (const DBusString *groupname, dbus_gid_t *gid)
dbus_bool_t _dbus_get_user_id (const DBusString *username, dbus_uid_t *uid)
const char * _dbus_getenv (const char *varname)
dbus_gid_t _dbus_getgid (void)
unsigned long _dbus_getpid (void)
dbus_uid_t _dbus_getuid (void)
dbus_bool_t _dbus_group_info_fill (DBusGroupInfo *info, const DBusString *groupname, DBusError *error)
dbus_bool_t _dbus_group_info_fill_gid (DBusGroupInfo *info, dbus_gid_t gid, DBusError *error)
void _dbus_group_info_free (DBusGroupInfo *info)
const char * _dbus_header_field_to_string (int header_field)
dbus_bool_t _dbus_homedir_from_current_process (const DBusString **homedir)
dbus_bool_t _dbus_homedir_from_username (const DBusString *username, DBusString *homedir)
dbus_bool_t _dbus_is_console_user (dbus_uid_t uid, DBusError *error)
int _dbus_listen_tcp_socket (const char *host, dbus_uint32_t port, DBusError *error)
int _dbus_listen_unix_socket (const char *path, dbus_bool_t abstract, DBusError *error)
void * _dbus_memdup (const void *mem, size_t n_bytes)
dbus_bool_t _dbus_path_is_absolute (const DBusString *filename)
int _dbus_poll (DBusPollFD *fds, int n_fds, int timeout_milliseconds)
void _dbus_print_backtrace (void)
int _dbus_read (int fd, DBusString *buffer, int count)
dbus_bool_t _dbus_read_credentials_unix_socket (int client_fd, DBusCredentials *credentials, DBusError *error)
void _dbus_real_assert (dbus_bool_t condition, const char *condition_text, const char *file, int line)
void _dbus_real_assert_not_reached (const char *explanation, const char *file, int line)
dbus_bool_t _dbus_send_credentials_unix_socket (int server_fd, DBusError *error)
dbus_bool_t _dbus_set_fd_nonblocking (int fd, DBusError *error)
void _dbus_set_signal_handler (int sig, DBusSignalHandler handler)
dbus_bool_t _dbus_setenv (const char *varname, const char *value)
void _dbus_sleep_milliseconds (int milliseconds)
dbus_bool_t _dbus_spawn_async_with_babysitter (DBusBabysitter **sitter_p, char **argv, DBusSpawnChildSetupFunc child_setup, void *user_data, DBusError *error)
dbus_bool_t _dbus_stat (const DBusString *filename, DBusStat *statbuf, DBusError *error)
char * _dbus_strdup (const char *str)
const char * _dbus_strerror (int error_number)
dbus_bool_t _dbus_string_array_contains (const char **array, const char *str)
dbus_bool_t _dbus_string_get_dirname (const DBusString *filename, DBusString *dirname)
dbus_bool_t _dbus_string_save_to_file (const DBusString *str, const DBusString *filename, DBusError *error)
const char * _dbus_type_to_string (int type)
dbus_bool_t _dbus_uid_from_string (const DBusString *uid_str, dbus_uid_t *uid)
dbus_bool_t _dbus_user_at_console (const char *username, DBusError *error)
dbus_bool_t _dbus_user_database_get_gid (DBusUserDatabase *db, dbus_gid_t gid, const DBusGroupInfo **info, DBusError *error)
dbus_bool_t _dbus_user_database_get_groupname (DBusUserDatabase *db, const DBusString *groupname, const DBusGroupInfo **info, DBusError *error)
dbus_bool_t _dbus_user_database_get_groups (DBusUserDatabase *db, dbus_uid_t uid, dbus_gid_t **group_ids, int *n_group_ids, DBusError *error)
DBusUserDatabase_dbus_user_database_get_system (void)
dbus_bool_t _dbus_user_database_get_uid (DBusUserDatabase *db, dbus_uid_t uid, const DBusUserInfo **info, DBusError *error)
dbus_bool_t _dbus_user_database_get_username (DBusUserDatabase *db, const DBusString *username, const DBusUserInfo **info, DBusError *error)
void _dbus_user_database_lock_system (void)
DBusUserDatabase_dbus_user_database_new (void)
DBusUserDatabase_dbus_user_database_ref (DBusUserDatabase *db)
void _dbus_user_database_unlock_system (void)
void _dbus_user_database_unref (DBusUserDatabase *db)
dbus_bool_t _dbus_user_info_fill (DBusUserInfo *info, const DBusString *username, DBusError *error)
dbus_bool_t _dbus_user_info_fill_uid (DBusUserInfo *info, dbus_uid_t uid, DBusError *error)
void _dbus_user_info_free (DBusUserInfo *info)
dbus_bool_t _dbus_username_from_current_process (const DBusString **username)
void _dbus_verbose_real (const char *format,...)
void _dbus_verbose_reset_real (void)
void _dbus_warn (const char *format,...)
int _dbus_write (int fd, const DBusString *buffer, int start, int len)
dbus_bool_t _dbus_write_pid_file (const DBusString *filename, unsigned long pid, DBusError *error)
int _dbus_write_two (int fd, const DBusString *buffer1, int start1, int len1, const DBusString *buffer2, int start2, int len2)
static void babysit (pid_t grandchild_pid, int parent_pipe)
static void babysit_signal_handler (int signo)
static dbus_bool_t babysitter_iteration (DBusBabysitter *sitter, dbus_bool_t block)
static void check_babysit_events (pid_t grandchild_pid, int parent_pipe, int revents)
static int close_and_invalidate (int *fd)
static void close_error_pipe_from_child (DBusBabysitter *sitter)
static void close_socket_to_babysitter (DBusBabysitter *sitter)
static void do_exec (int child_err_report_fd, char **argv, DBusSpawnChildSetupFunc child_setup, void *user_data)
static void do_write (int fd, const void *buf, size_t count)
static dbus_bool_t fill_group_info (DBusGroupInfo *info, dbus_gid_t gid, const DBusString *groupname, DBusError *error)
static dbus_bool_t fill_user_info (DBusUserInfo *info, dbus_uid_t uid, const DBusString *username, DBusError *error)
static dbus_bool_t fill_user_info_from_group (struct group *g, DBusGroupInfo *info, DBusError *error)
static dbus_bool_t fill_user_info_from_passwd (struct passwd *p, DBusUserInfo *info, DBusError *error)
static void handle_babysitter_socket (DBusBabysitter *sitter, int revents)
static void handle_error_pipe (DBusBabysitter *sitter, int revents)
static dbus_bool_t handle_watch (DBusWatch *watch, unsigned int condition, void *data)
static dbus_bool_t make_pipe (int p[2], DBusError *error)
static dbus_bool_t pseudorandom_generate_random_bytes (DBusString *str, int n_bytes)
static ReadStatus read_data (DBusBabysitter *sitter, int fd)
static ReadStatus read_ints (int fd, int *buf, int n_ints_in_buf, int *n_ints_read, DBusError *error)
static ReadStatus read_pid (int fd, pid_t *buf, DBusError *error)
static dbus_bool_t write_credentials_byte (int server_fd, DBusError *error)
static void write_err_and_exit (int fd, int msg)
static void write_pid (int fd, pid_t pid)
static void write_status_and_exit (int fd, int status)

Variables

const char _dbus_no_memory_message [] = "Not enough memory"
const char _dbus_return_if_fail_warning_format []
static int babysit_sigchld_pipe = -1
static dbus_bool_t verbose_initted = FALSE


Generated by  Doxygen 1.6.0   Back to index