diff options
Diffstat (limited to 'dbus/dbus-sysdeps.h')
-rw-r--r-- | dbus/dbus-sysdeps.h | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index cfe0cd25..363f665d 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -25,7 +25,6 @@ #ifndef DBUS_SYSDEPS_H #define DBUS_SYSDEPS_H -#include <dbus/dbus-string.h> #include <dbus/dbus-errors.h> /* this is perhaps bogus, but strcmp() etc. are faster if we use the @@ -47,6 +46,8 @@ DBUS_BEGIN_DECLS; * dbus-memory.c) */ +typedef struct DBusString DBusString; + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) \ __attribute__((__format__ (__printf__, format_idx, arg_idx))) @@ -96,12 +97,14 @@ typedef unsigned long dbus_gid_t; #define DBUS_UID_FORMAT "%lu" #define DBUS_GID_FORMAT "%lu" +/** + * Struct representing socket credentials + */ typedef struct { - /* Set to DBUS_PID_UNSET etc. if not available */ - dbus_pid_t pid; - dbus_uid_t uid; - dbus_gid_t gid; + dbus_pid_t pid; /**< process ID or DBUS_PID_UNSET */ + dbus_uid_t uid; /**< user ID or DBUS_UID_UNSET */ + dbus_gid_t gid; /**< group ID or DBUS_GID_UNSET */ } DBusCredentials; int _dbus_connect_unix_socket (const char *path, @@ -134,6 +137,9 @@ dbus_bool_t _dbus_credentials_match (const DBusCredentials *expec typedef struct DBusUserInfo DBusUserInfo; typedef struct DBusGroupInfo DBusGroupInfo; +/** + * Information about a UNIX user + */ struct DBusUserInfo { dbus_uid_t uid; /**< UID */ @@ -144,6 +150,9 @@ struct DBusUserInfo char *homedir; /**< Home directory */ }; +/** + * Information about a UNIX group + */ struct DBusGroupInfo { dbus_gid_t gid; /**< GID */ @@ -172,9 +181,13 @@ dbus_uid_t _dbus_getuid (void); dbus_gid_t _dbus_getgid (void); typedef struct DBusAtomic DBusAtomic; + +/** + * An atomic integer. + */ struct DBusAtomic { - volatile dbus_int32_t value; + volatile dbus_int32_t value; /**< Value of the atomic integer. */ }; dbus_int32_t _dbus_atomic_inc (DBusAtomic *atomic); @@ -187,11 +200,14 @@ dbus_int32_t _dbus_atomic_dec (DBusAtomic *atomic); #define _DBUS_POLLHUP 0x0010 /* Hung up */ #define _DBUS_POLLNVAL 0x0020 /* Invalid request: fd not open */ +/** + * A portable struct pollfd wrapper. + */ typedef struct { - int fd; - short events; - short revents; + int fd; /**< File descriptor */ + short events; /**< Events to poll for */ + short revents; /**< Events that occurred */ } DBusPollFD; int _dbus_poll (DBusPollFD *fds, @@ -248,16 +264,19 @@ void _dbus_fd_set_close_on_exec (int fd); void _dbus_exit (int code) _DBUS_GNUC_NORETURN; +/** + * Portable struct with stat() results + */ typedef struct { - unsigned long mode; - unsigned long nlink; - dbus_uid_t uid; - dbus_gid_t gid; - unsigned long size; - unsigned long atime; - unsigned long mtime; - unsigned long ctime; + unsigned long mode; /**< File mode */ + unsigned long nlink; /**< Number of hard links */ + dbus_uid_t uid; /**< User owning file */ + dbus_gid_t gid; /**< Group owning file */ + unsigned long size; /**< Size of file */ + unsigned long atime; /**< Access time */ + unsigned long mtime; /**< Modify time */ + unsigned long ctime; /**< Creation time */ } DBusStat; dbus_bool_t _dbus_stat (const DBusString *filename, |