Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

dbus-userdb.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* dbus-userdb.h User database abstraction
00003  * 
00004  * Copyright (C) 2003  Red Hat, Inc.
00005  *
00006  * Licensed under the Academic Free License version 2.0
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 #ifndef DBUS_USERDB_H
00025 #define DBUS_USERDB_H
00026 
00027 #include <dbus/dbus-sysdeps.h>
00028 
00029 DBUS_BEGIN_DECLS;
00030 
00031 typedef struct DBusUserDatabase DBusUserDatabase;
00032 
00033 DBusUserDatabase* _dbus_user_database_new           (void);
00034 DBusUserDatabase* _dbus_user_database_ref           (DBusUserDatabase     *db);
00035 void              _dbus_user_database_unref         (DBusUserDatabase     *db);
00036 dbus_bool_t       _dbus_user_database_get_groups    (DBusUserDatabase     *db,
00037                                                      dbus_uid_t            uid,
00038                                                      dbus_gid_t          **group_ids,
00039                                                      int                  *n_group_ids,
00040                                                      DBusError            *error);
00041 dbus_bool_t       _dbus_user_database_get_uid       (DBusUserDatabase     *db,
00042                                                      dbus_uid_t            uid,
00043                                                      const DBusUserInfo  **info,
00044                                                      DBusError            *error);
00045 dbus_bool_t       _dbus_user_database_get_gid       (DBusUserDatabase     *db,
00046                                                      dbus_gid_t            gid,
00047                                                      const DBusGroupInfo **info,
00048                                                      DBusError            *error);
00049 dbus_bool_t       _dbus_user_database_get_username  (DBusUserDatabase     *db,
00050                                                      const DBusString     *username,
00051                                                      const DBusUserInfo  **info,
00052                                                      DBusError            *error);
00053 dbus_bool_t       _dbus_user_database_get_groupname (DBusUserDatabase     *db,
00054                                                      const DBusString     *groupname,
00055                                                      const DBusGroupInfo **info,
00056                                                      DBusError            *error);
00057 
00058 
00059 
00060 DBusUserDatabase* _dbus_user_database_get_system    (void);
00061 void              _dbus_user_database_lock_system   (void);
00062 void              _dbus_user_database_unlock_system (void);
00063 
00064 dbus_bool_t _dbus_username_from_current_process (const DBusString **username);
00065 dbus_bool_t _dbus_homedir_from_current_process  (const DBusString **homedir);
00066 dbus_bool_t _dbus_homedir_from_username         (const DBusString  *username,
00067                                                  DBusString        *homedir);
00068 dbus_bool_t _dbus_get_user_id                   (const DBusString  *username,
00069                                                  dbus_uid_t        *uid);
00070 dbus_bool_t _dbus_get_group_id                  (const DBusString  *group_name,
00071                                                  dbus_gid_t        *gid);
00072 dbus_bool_t _dbus_uid_from_string               (const DBusString  *uid_str,
00073                                                  dbus_uid_t        *uid);
00074 dbus_bool_t _dbus_credentials_from_username     (const DBusString  *username,
00075                                                  DBusCredentials   *credentials);
00076 dbus_bool_t _dbus_credentials_from_uid          (dbus_uid_t         user_id,
00077                                                  DBusCredentials   *credentials);
00078 
00079 
00080 DBUS_END_DECLS;
00081 
00082 #endif /* DBUS_USERDB_H */

Generated on Sun Mar 21 03:52:06 2004 for D-BUS by doxygen 1.3.6-20040222