#ifndef _PLIST_PVT_H
#define _PLIST_PVT_H
#include "../public/nsapi.h"
#include "pool.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct PLValueStruct_s
PLValueStruct_t;
typedef struct PLSymbol_s
PLSymbol_t;
typedef struct PLSymbolTable_s
PLSymbolTable_t;
typedef struct PListStruct_s
PListStruct_t;
#ifndef PBLOCK_H
#include "pblock.h"
#endif
struct PLValueStruct_s {
pb_entry pv_pbentry;
pb_param pv_pbparam;
const pb_key *pv_pbkey;
PLValueStruct_t *pv_next;
PListStruct_t *pv_type;
int pv_pi;
pool_handle_t *pv_mempool;
};
#define pv_name pv_pbparam.name
#define pv_value pv_pbparam.value
#define PVPBOFFSET ((
char *)&((
PLValueStruct_t *)
0)->pv_pbparam)
#define PATOPV(p) ((
PLValueStruct_t *)((
char *)(p) -
PVPBOFFSET))
#define PLSTSIZES {
7,
19,
31,
67,
123,
257,
513}
#define PLMAXSIZENDX (
sizeof(plistHashSizes)/
sizeof(plistHashSizes[
0]) -
1)
struct PLSymbolTable_s {
int pt_sizendx;
int pt_nsyms;
PLValueStruct_t *pt_hash[
1];
};
#define PLIST_DEFSIZE 8
#define PLIST_DEFGROW 16
struct PListStruct_s {
pblock pl_pb;
PLSymbolTable_t *pl_symtab;
pool_handle_t *pl_mempool;
int pl_maxprop;
int pl_resvpi;
int pl_lastpi;
int pl_cursize;
};
#define pl_initpi pl_pb.hsize
#define pl_ppval pl_pb.ht
#define PBTOPL(p) ((
PListStruct_t *)(p))
#define PLSIZENDX(i) (plistHashSizes[i])
#define PLHASHSIZE(i) (
sizeof(
PLSymbolTable_t) + \
(
PLSIZENDX(i) -
1)*
sizeof(
PLValueStruct_t *))
extern int plistHashSizes[
7];
unsigned int PListHash(
const char *string);
int PListHashName(
PLSymbolTable_t *symtab,
const char *pname);
int PListGetFreeIndex(
PListStruct_t *pl);
PLSymbolTable_t *PListSymbolTable(
PListStruct_t *pl);
#ifdef __cplusplus
}
#endif
#endif