1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #ifndef _PLIST_PVT_H
35 #define _PLIST_PVT_H
36
37
38
39
40
41
42
43
44
45
46 #include "../public/nsapi.h"
47 #include "pool.h"
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53
54 typedef struct PLValueStruct_s
PLValueStruct_t;
55 typedef struct PLSymbol_s
PLSymbol_t;
56 typedef struct PLSymbolTable_s
PLSymbolTable_t;
57 typedef struct PListStruct_s
PListStruct_t;
58
59
60
61
62
63
64
65
66
67
68
69
70
71 #ifndef PBLOCK_H
72 #include "pblock.h"
73 #endif
74
75 struct PLValueStruct_s {
76 pb_entry pv_pbentry;
77 pb_param pv_pbparam;
78 const pb_key *pv_pbkey;
79 PLValueStruct_t *pv_next;
80 PListStruct_t *pv_type;
81 int pv_pi;
82 pool_handle_t *pv_mempool;
83 };
84
85 #define pv_name pv_pbparam.name
86 #define pv_value pv_pbparam.value
87
88
89 #define PVPBOFFSET ((
char *)&((
PLValueStruct_t *)
0)->pv_pbparam)
90
91
92 #define PATOPV(p) ((
PLValueStruct_t *)((
char *)(p) -
PVPBOFFSET))
93
94
95
96
97
98
99
100
101
102
103
104 #define PLSTSIZES {
7,
19,
31,
67,
123,
257,
513}
105 #define PLMAXSIZENDX (
sizeof(plistHashSizes)/
sizeof(plistHashSizes[
0]) -
1)
106
107 struct PLSymbolTable_s {
108 int pt_sizendx;
109 int pt_nsyms;
110 PLValueStruct_t *pt_hash[
1];
111 };
112
113
114
115
116
117
118
119
120
121
122
123
124
125 #define PLIST_DEFSIZE 8
126 #define PLIST_DEFGROW 16
127
128 struct PListStruct_s {
129 pblock pl_pb;
130 PLSymbolTable_t *pl_symtab;
131 pool_handle_t *pl_mempool;
132 int pl_maxprop;
133 int pl_resvpi;
134 int pl_lastpi;
135 int pl_cursize;
136 };
137
138 #define pl_initpi pl_pb.hsize
139 #define pl_ppval pl_pb.ht
140
141
142 #define PBTOPL(p) ((
PListStruct_t *)(p))
143
144 #define PLSIZENDX(i) (plistHashSizes[i])
145 #define PLHASHSIZE(i) (
sizeof(
PLSymbolTable_t) + \
146 (
PLSIZENDX(i) -
1)*
sizeof(
PLValueStruct_t *))
147
148 extern int plistHashSizes[
7];
149
150 unsigned int PListHash(
const char *string);
151
152 int PListHashName(
PLSymbolTable_t *symtab,
const char *pname);
153
154 int PListGetFreeIndex(
PListStruct_t *pl);
155
156 PLSymbolTable_t *PListSymbolTable(
PListStruct_t *pl);
157
158 #ifdef __cplusplus
159 }
160 #endif
161
162 #endif
163