nsuser.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. #ifndef __nsuser_h
  7. #define __nsuser_h
  8. /*
  9. * Description (nsuser.h)
  10. *
  11. * This file describes the interface to user information stored in
  12. * a Netscape user database. Information about a user is provided
  13. * to the caller in the form of a user object (UserObj_t), defined
  14. * in nsauth.h. This interface provides only read access to user
  15. * information. The interface for managing the user database is
  16. * described in nsumgmt.h.
  17. */
  18. #include "nserror.h" /* error frame list support */
  19. #include "nsautherr.h" /* authentication error codes */
  20. #include "nsauth.h" /* authentication types */
  21. /* Begin private definitions */
  22. #ifdef __PRIVATE_NSUSER
  23. #include "nsdb.h"
  24. /*
  25. * Define structure used to communicate between userEnumerate() and
  26. * userEnumHelp().
  27. */
  28. typedef struct UserEnumArgs_s UserEnumArgs_t;
  29. struct UserEnumArgs_s {
  30. void * userdb; /* user database handle */
  31. int flags; /* userEnumerate() flags */
  32. int (*func)(NSErr_t * ferrp, void * parg,
  33. UserObj_t * uoptr); /* user function pointer */
  34. void * user; /* user's argp pointer */
  35. };
  36. /* Define attribute tags for user DB records */
  37. #define UAT_PASSWORD 0x40 /* password (NTS) */
  38. #define UAT_UID 0x41 /* user id (USI) */
  39. #define UAT_ACCFLAGS 0x42 /* account flags (USI) */
  40. #define UAT_REALNAME 0x43 /* real name (NTS) */
  41. #define UAT_GROUPS 0x44 /* list of groups (USI...) */
  42. #endif /* __PRIVATE_NSUSER */
  43. /* Begin public definitions */
  44. /* Define flags for userEnumerate() */
  45. #define UOF_ENUMKEEP 0x1 /* don't free user objects */
  46. NSPR_BEGIN_EXTERN_C
  47. /* User information retrieval operations in nsuser.c */
  48. extern UserObj_t * userDecode(NTS_t name, int ureclen, ATR_t urecptr);
  49. extern int userEnumerate(NSErr_t * errp, void * userdb, int flags, void * argp,
  50. int (*func)(NSErr_t * ferrp,
  51. void * parg, UserObj_t * uoptr));
  52. extern UserObj_t * userFindByName(NSErr_t * errp, void * userdb, NTS_t name);
  53. extern UserObj_t * userFindByUid(NSErr_t * errp, void * userdb, USI_t uid);
  54. NSAPI_PUBLIC extern void userFree(UserObj_t * uoptr);
  55. NSPR_END_EXTERN_C
  56. #endif /* __nsuser_h */