Changeset e4f8c77 in mainline for uspace/lib/posix/pwd.h


Ignore:
Timestamp:
2011-07-13T22:39:18Z (14 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
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.
Message:

Merge libposix.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/pwd.h

    r5974661 re4f8c77  
    11/*
    2  * Copyright (c) 2011 Petr Koupy
     2 * Copyright (c) 2011 Jiri Zarevucky
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef POSIX_GETOPT_H_
    36 #define POSIX_GETOPT_H_
     35#ifndef POSIX_PWD_H_
     36#define POSIX_PWD_H_
    3737
    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"
    4439
    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 */
     40struct 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;
    5046};
    5147
    52 extern int posix_getopt_long(int argc, char * const argv[],
    53     const char *optstring, const struct posix_option *longopts, int *longindex);
     48extern struct posix_passwd *posix_getpwent(void);
     49extern void posix_setpwent(void);
     50extern void posix_endpwent(void);
    5451
    55 extern int posix_getopt_long_only(int argc, char * const argv[],
    56     const char *optstring, const struct posix_option *longopts, int *longindex);
     52extern struct posix_passwd *posix_getpwnam(const char *name);
     53extern int posix_getpwnam_r(const char *name, struct posix_passwd *pwd,
     54    char *buffer, size_t bufsize, struct posix_passwd **result);
     55
     56extern struct posix_passwd *posix_getpwuid(posix_uid_t uid);
     57extern int posix_getpwuid_r(posix_uid_t uid, struct posix_passwd *pwd,
     58    char *buffer, size_t bufsize, struct posix_passwd **result);
    5759
    5860#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
    6272#endif
    6373
    64 #endif /* POSIX_GETOPT_H_ */
     74#endif /* POSIX_PWD_H_ */
    6575
    6676/** @}
    6777 */
     78
Note: See TracChangeset for help on using the changeset viewer.