]>
Commit | Line | Data |
---|---|---|
04a5cb58 KZ |
1 | #ifndef UTIL_LINUX_IDCACHE_H |
2 | #define UTIL_LINUX_IDCACHE_H | |
3 | ||
4 | #include <sys/types.h> | |
5 | #include <pwd.h> | |
6 | ||
7 | #define IDCACHE_FLAGS_NAMELEN (1 << 1) | |
8 | ||
9 | struct identry { | |
10 | unsigned long int id; | |
11 | char *name; | |
12 | struct identry *next; | |
13 | }; | |
14 | ||
15 | struct idcache { | |
16 | struct identry *ent; /* first entry */ | |
17 | int width; /* name width */ | |
18 | }; | |
19 | ||
20 | ||
21 | extern struct idcache *new_idcache(void); | |
22 | extern void add_gid(struct idcache *cache, unsigned long int id); | |
23 | extern void add_uid(struct idcache *cache, unsigned long int id); | |
24 | ||
25 | extern void free_idcache(struct idcache *ic); | |
26 | extern struct identry *get_id(struct idcache *ic, unsigned long int id); | |
27 | ||
28 | #endif /* UTIL_LINUX_IDCACHE_H */ |