]> git.ipfire.org Git - thirdparty/util-linux.git/blame - include/idcache.h
Merge branch 'ci/cache-openwrt-sdk' of https://github.com/t-8ch/util-linux
[thirdparty/util-linux.git] / include / idcache.h
CommitLineData
faeb1b64
KZ
1/*
2 * No copyright is claimed. This code is in the public domain; do with
3 * it what you wish.
4 */
04a5cb58
KZ
5#ifndef UTIL_LINUX_IDCACHE_H
6#define UTIL_LINUX_IDCACHE_H
7
8#include <sys/types.h>
9#include <pwd.h>
10
11#define IDCACHE_FLAGS_NAMELEN (1 << 1)
12
13struct identry {
14 unsigned long int id;
15 char *name;
16 struct identry *next;
17};
18
19struct idcache {
20 struct identry *ent; /* first entry */
21 int width; /* name width */
22};
23
24
25extern struct idcache *new_idcache(void);
26extern void add_gid(struct idcache *cache, unsigned long int id);
27extern void add_uid(struct idcache *cache, unsigned long int id);
28
29extern void free_idcache(struct idcache *ic);
30extern struct identry *get_id(struct idcache *ic, unsigned long int id);
31
32#endif /* UTIL_LINUX_IDCACHE_H */