Changeset e4f8c77 in mainline for uspace/lib/posix/pwd.h
- Timestamp:
- 2011-07-13T22:39:18Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e6910c8
- Parents:
- 5974661 (diff), 8ecef91 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/pwd.h
r5974661 re4f8c77 1 1 /* 2 * Copyright (c) 2011 Petr Koupy2 * Copyright (c) 2011 Jiri Zarevucky 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef POSIX_ GETOPT_H_36 #define POSIX_ GETOPT_H_35 #ifndef POSIX_PWD_H_ 36 #define POSIX_PWD_H_ 37 37 38 #undef no_argument 39 #undef required_argument 40 #undef optional_argument 41 #define no_argument 0 42 #define required_argument 1 43 #define optional_argument 2 38 #include "sys/types.h" 44 39 45 struct posix_option { 46 const char *name; /* name of the option */ 47 int has_arg; /* no_argument / required_argument / optional_argument */ 48 int *flag; /* TODO */ 49 int val; /* TODO */ 40 struct posix_passwd { 41 char *pw_name; 42 posix_uid_t pw_uid; 43 posix_gid_t pw_gid; 44 char *pw_dir; 45 char *pw_shell; 50 46 }; 51 47 52 extern int posix_getopt_long(int argc, char * const argv[], 53 const char *optstring, const struct posix_option *longopts, int *longindex); 48 extern struct posix_passwd *posix_getpwent(void); 49 extern void posix_setpwent(void); 50 extern void posix_endpwent(void); 54 51 55 extern int posix_getopt_long_only(int argc, char * const argv[], 56 const char *optstring, const struct posix_option *longopts, int *longindex); 52 extern struct posix_passwd *posix_getpwnam(const char *name); 53 extern int posix_getpwnam_r(const char *name, struct posix_passwd *pwd, 54 char *buffer, size_t bufsize, struct posix_passwd **result); 55 56 extern struct posix_passwd *posix_getpwuid(posix_uid_t uid); 57 extern int posix_getpwuid_r(posix_uid_t uid, struct posix_passwd *pwd, 58 char *buffer, size_t bufsize, struct posix_passwd **result); 57 59 58 60 #ifndef LIBPOSIX_INTERNAL 59 #define option posix_option 60 #define posix_getopt_long posix_getopt_long 61 #define getopt_long_only posix_getopt_long_only 61 #define passwd posix_passwd 62 63 #define getpwent posix_getpwent 64 #define setpwent posix_setpwent 65 #define endpwent posix_endpwent 66 67 #define getpwnam posix_getpwnam 68 #define getpwnam_r posix_getpwnam_r 69 70 #define getpwuid posix_getpwuid 71 #define getpwuid_r posix_getpwuid_r 62 72 #endif 63 73 64 #endif /* POSIX_ GETOPT_H_ */74 #endif /* POSIX_PWD_H_ */ 65 75 66 76 /** @} 67 77 */ 78
Note:
See TracChangeset
for help on using the changeset viewer.