1
//========================================================================
5
// Copyright 1996 Derek B. Noonburg
7
//========================================================================
18
//------------------------------------------------------------------------
20
//------------------------------------------------------------------------
36
// Reference counting.
37
int incRef() { return ++ref; }
38
int decRef() { return --ref; }
40
// Get number of entries.
41
int getLength() { return length; }
43
// Add an entry. NB: does not copy key.
44
void add(char *key, Object *val);
46
// Check if dictionary is of specified type.
49
// Look up an entry and return the value. Returns a null object
50
// if <key> is not in the dictionary.
51
Object *lookup(char *key, Object *obj);
52
Object *lookupNF(char *key, Object *obj);
54
// Iterative accessors.
56
Object *getVal(int i, Object *obj);
57
Object *getValNF(int i, Object *obj);
61
DictEntry *entries; // array of entries
62
int size; // size of <entries> array
63
int length; // number of entries in dictionary
64
int ref; // reference count
66
DictEntry *find(char *key);