plist.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #ifndef _PLIST_H
  13. #define _PLIST_H
  14. #ifndef NOINTNSACL
  15. #define INTNSACL
  16. #endif /* !NOINTNSACL */
  17. /*
  18. * TYPE: PList_t
  19. *
  20. * DESCRIPTION:
  21. *
  22. * This type defines a handle for a property list.
  23. */
  24. #include "base/pool.h"
  25. #ifndef PUBLIC_NSACL_PLISTDEF_H
  26. #include "../public/nsacl/plistdef.h"
  27. #endif /* !PUBLIC_NSACL_PLISTDEF_H */
  28. #ifdef INTNSACL
  29. /* Functions in plist.c */
  30. NSPR_BEGIN_EXTERN_C
  31. NSAPI_PUBLIC extern int PListAssignValue(PList_t plist, const char *pname,
  32. const void *pvalue, PList_t ptype);
  33. NSAPI_PUBLIC extern PList_t PListCreate(pool_handle_t *mempool,
  34. int resvprop, int maxprop, int flags);
  35. NSAPI_PUBLIC extern int PListDefProp(PList_t plist, int pindex,
  36. const char *pname, const int flags);
  37. NSAPI_PUBLIC extern const void * PListDeleteProp(PList_t plist, int pindex, const char *pname);
  38. NSAPI_PUBLIC extern int PListFindValue(PList_t plist,
  39. const char *pname, void **pvalue, PList_t *type);
  40. NSAPI_PUBLIC extern int PListInitProp(PList_t plist, int pindex, const char *pname,
  41. const void *pvalue, PList_t ptype);
  42. NSAPI_PUBLIC extern PList_t PListNew(pool_handle_t *mempool);
  43. NSAPI_PUBLIC extern void PListDestroy(PList_t plist);
  44. NSAPI_PUBLIC extern int PListGetValue(PList_t plist,
  45. int pindex, void **pvalue, PList_t *type);
  46. NSAPI_PUBLIC extern int PListNameProp(PList_t plist, int pindex, const char *pname);
  47. NSAPI_PUBLIC extern int PListSetType(PList_t plist, int pindex, PList_t type);
  48. NSAPI_PUBLIC extern int PListSetValue(PList_t plist,
  49. int pindex, const void *pvalue, PList_t type);
  50. NSAPI_PUBLIC extern void PListEnumerate(PList_t plist, PListFunc_t *user_func,
  51. void *user_data);
  52. NSAPI_PUBLIC extern PList_t
  53. PListDuplicate(PList_t plist, pool_handle_t *new_mempool, int flags);
  54. NSAPI_PUBLIC extern pool_handle_t *PListGetPool(PList_t plist);
  55. NSPR_END_EXTERN_C
  56. #endif /* INTNSACL */
  57. #endif /* _PLIST_H */