src/server/plist.h

changeset 1
3c066d52342d
equal deleted inserted replaced
0:4c89c7683fb6 1:3c066d52342d
1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5 *
6 * THE BSD LICENSE
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * Redistributions of source code must retain the above copyright notice, this
12 * list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 * Neither the name of the nor the names of its contributors may be
18 * used to endorse or promote products derived from this software without
19 * specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #ifndef _PLIST_H
35 #define _PLIST_H
36
37 #ifndef NOINTNSACL
38 #define INTNSACL
39 #endif /* !NOINTNSACL */
40
41 /*
42 * TYPE: PList_t
43 *
44 * DESCRIPTION:
45 *
46 * This type defines a handle for a property list.
47 */
48
49 #include "pool.h"
50 #include "mps/nspr.h"
51 #include "nsapi.h"
52 #include "plist_pvt.h"
53
54 #ifndef PUBLIC_NSACL_PLISTDEF_H
55 #include "plistdef.h"
56 #endif /* !PUBLIC_NSACL_PLISTDEF_H */
57
58 #ifdef INTNSACL
59
60 /* Functions in plist.c */
61 NSPR_BEGIN_EXTERN_C
62
63 NSAPI_PUBLIC extern int PListAssignValue(PList_t plist, const char *pname,
64 const void *pvalue, PList_t ptype);
65 NSAPI_PUBLIC extern PList_t PListCreate(pool_handle_t *mempool,
66 int resvprop, int maxprop, int flags);
67 NSAPI_PUBLIC extern int PListDefProp(PList_t plist, int pindex,
68 const char *pname, const int flags);
69 NSAPI_PUBLIC extern const void * PListDeleteProp(PList_t plist, int pindex, const char *pname);
70 NSAPI_PUBLIC extern int PListFindValue(PList_t plist,
71 const char *pname, void **pvalue, PList_t *type);
72 NSAPI_PUBLIC extern int PListInitProp(PList_t plist, int pindex, const char *pname,
73 const void *pvalue, PList_t ptype);
74 NSAPI_PUBLIC extern PList_t PListNew(pool_handle_t *mempool);
75 NSAPI_PUBLIC extern void PListDestroy(PList_t plist);
76 NSAPI_PUBLIC extern int PListGetValue(PList_t plist,
77 int pindex, void **pvalue, PList_t *type);
78 NSAPI_PUBLIC extern int PListNameProp(PList_t plist, int pindex, const char *pname);
79 NSAPI_PUBLIC extern int PListSetType(PList_t plist, int pindex, PList_t type);
80 NSAPI_PUBLIC extern int PListSetValue(PList_t plist,
81 int pindex, const void *pvalue, PList_t type);
82 NSAPI_PUBLIC extern void PListEnumerate(PList_t plist, PListFunc_t *user_func,
83 void *user_data);
84 NSAPI_PUBLIC extern PList_t
85 PListDuplicate(PList_t plist, pool_handle_t *new_mempool, int flags);
86 NSAPI_PUBLIC extern pool_handle_t *PListGetPool(PList_t plist);
87 NSAPI_PUBLIC extern int PListDefKey(PList_t plist, pb_key *key, const char *pname, const int flags);
88 NSAPI_PUBLIC extern int PListInitKey(PList_t plist, pb_key *key, const void *pvalue, PList_t ptype);
89
90 NSPR_END_EXTERN_C
91
92 #endif /* INTNSACL */
93
94 #endif /* _PLIST_H */

mercurial