mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
![Zbigniew Chyla](/assets/img/avatar_default.png)
2006-02-26 Zbigniew Chyla <mail@zbigniew.chyla.pl> Get users' and groups' names via a cache to avoid calling getpwuid/getgrgid too often (i.e. many times during single redraw). * libnautilus-private/Makefile.am: (libnautilus_private_la_SOURCES): Added nautilus-users-groups-cache.[ch] * libnautilus-private/nautilus-users-groups-cache.[ch]: New, implementation of cache for getpwuid/getgrgid results. * libnautilus-private/nautilus-file.c: (get_user_name_from_id): removed (get_real_name): accept "name + gecos" pair instead of "struct passwd". (get_user_and_real_name_from_id): get user name and gecos using nautilus_users_cache_* functions instead of using getpwuid directly. (nautilus_get_user_names): adjusted to changed signature of get_real_name. (nautilus_file_get_group_name): get group name using nautilus_groups_cache_get_name instead of using getgrgid directly. (nautilus_file_get_owner_as_string): get user name using nautilus_users_cache_get_name.
35 lines
1.2 KiB
C
35 lines
1.2 KiB
C
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
|
|
|
nautilus-users-groups-cache.h: cache of users' and groups' names.
|
|
|
|
Copyright (C) 2006 Zbigniew Chyla
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License as
|
|
published by the Free Software Foundation; either version 2 of the
|
|
License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public
|
|
License along with this program; if not, write to the
|
|
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
Author: Zbigniew Chyla <mail@zbigniew.chyla.pl>
|
|
*/
|
|
|
|
#ifndef NAUTILUS_USERS_GROUPS_CACHE_H
|
|
#define NAUTILUS_USERS_GROUPS_CACHE_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
char *nautilus_users_cache_get_name (uid_t uid);
|
|
char *nautilus_users_cache_get_gecos (uid_t uid);
|
|
char *nautilus_groups_cache_get_name (gid_t gid);
|
|
|
|
#endif /* NAUTILUS_USERS_GROUPS_CACHE_H */
|