diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-19 21:24:17 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-19 21:24:17 +0000 |
| commit | 2405ad659e2596b17c88e7b950c086159d06cc6e (patch) | |
| tree | 35b7039cf3d4fab57d1e4c69cc0bea5bc847a832 /include | |
| parent | 9af7c9d6b62ceb07a9ba24cee0cf4a08c689235e (diff) | |
| download | busybox-w32-2405ad659e2596b17c88e7b950c086159d06cc6e.tar.gz busybox-w32-2405ad659e2596b17c88e7b950c086159d06cc6e.tar.bz2 busybox-w32-2405ad659e2596b17c88e7b950c086159d06cc6e.zip | |
ls: use get_cached_username/groupname
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/libbb.h b/include/libbb.h index 7721cbf82..30d3006ad 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -223,7 +223,6 @@ struct sysinfo { | |||
| 223 | extern int sysinfo(struct sysinfo* info); | 223 | extern int sysinfo(struct sysinfo* info); |
| 224 | 224 | ||
| 225 | 225 | ||
| 226 | |||
| 227 | extern void chomp(char *s); | 226 | extern void chomp(char *s); |
| 228 | extern void trim(char *s); | 227 | extern void trim(char *s); |
| 229 | extern char *skip_whitespace(const char *); | 228 | extern char *skip_whitespace(const char *); |
| @@ -410,20 +409,26 @@ uint16_t xatou16(const char *numstr); | |||
| 410 | /* These parse entries in /etc/passwd and /etc/group. This is desirable | 409 | /* These parse entries in /etc/passwd and /etc/group. This is desirable |
| 411 | * for BusyBox since we want to avoid using the glibc NSS stuff, which | 410 | * for BusyBox since we want to avoid using the glibc NSS stuff, which |
| 412 | * increases target size and is often not needed on embedded systems. */ | 411 | * increases target size and is often not needed on embedded systems. */ |
| 413 | extern long xuname2uid(const char *name); | 412 | long xuname2uid(const char *name); |
| 414 | extern long xgroup2gid(const char *name); | 413 | long xgroup2gid(const char *name); |
| 415 | /* wrapper: allows string to contain numeric uid or gid */ | 414 | /* wrapper: allows string to contain numeric uid or gid */ |
| 416 | extern unsigned long get_ug_id(const char *s, long (*xname2id)(const char *)); | 415 | unsigned long get_ug_id(const char *s, long (*xname2id)(const char *)); |
| 417 | /* from chpst. Does not die, returns 0 on failure */ | 416 | /* from chpst. Does not die, returns 0 on failure */ |
| 418 | struct bb_uidgid_t { | 417 | struct bb_uidgid_t { |
| 419 | uid_t uid; | 418 | uid_t uid; |
| 420 | gid_t gid; | 419 | gid_t gid; |
| 421 | }; | 420 | }; |
| 422 | extern int get_uidgid(struct bb_uidgid_t*, const char*, int numeric_ok); | 421 | int get_uidgid(struct bb_uidgid_t*, const char*, int numeric_ok); |
| 423 | /* what is this? */ | 422 | /* what is this? */ |
| 424 | /*extern char *bb_getug(char *buffer, char *idname, long id, int bufsize, char prefix);*/ | 423 | /*extern char *bb_getug(char *buffer, char *idname, long id, int bufsize, char prefix);*/ |
| 425 | extern char *bb_getpwuid(char *name, long uid, int bufsize); | 424 | char *bb_getpwuid(char *name, long uid, int bufsize); |
| 426 | extern char *bb_getgrgid(char *group, long gid, int bufsize); | 425 | char *bb_getgrgid(char *group, long gid, int bufsize); |
| 426 | /* versions which cache results (useful for ps, ls etc) */ | ||
| 427 | const char* get_cached_username(uid_t uid); | ||
| 428 | const char* get_cached_groupname(gid_t gid); | ||
| 429 | void clear_username_cache(void); | ||
| 430 | /* internally usernames are saved in fixed-sized char[] buffers */ | ||
| 431 | enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; | ||
| 427 | 432 | ||
| 428 | 433 | ||
| 429 | enum { BB_GETOPT_ERROR = 0x80000000 }; | 434 | enum { BB_GETOPT_ERROR = 0x80000000 }; |
| @@ -626,9 +631,6 @@ void free_procps_scan(procps_status_t* sp); | |||
| 626 | procps_status_t* procps_scan(procps_status_t* sp, int flags); | 631 | procps_status_t* procps_scan(procps_status_t* sp, int flags); |
| 627 | pid_t *find_pid_by_name(const char* procName); | 632 | pid_t *find_pid_by_name(const char* procName); |
| 628 | pid_t *pidlist_reverse(pid_t *pidList); | 633 | pid_t *pidlist_reverse(pid_t *pidList); |
| 629 | void clear_username_cache(void); | ||
| 630 | const char* get_cached_username(uid_t uid); | ||
| 631 | const char* get_cached_groupname(gid_t gid); | ||
| 632 | 634 | ||
| 633 | 635 | ||
| 634 | extern const char bb_uuenc_tbl_base64[]; | 636 | extern const char bb_uuenc_tbl_base64[]; |
