| 1 |
<HTML> |
| 2 |
|
| 3 |
<HEAD> |
| 4 |
<TITLE> ACEDB source code documentation: the asubs package </TITLE> |
| 5 |
|
| 6 |
<LINK rel=stylesheet type="text/css" |
| 7 |
href="./wdoc.css" |
| 8 |
title="Style sheet for wdoc developer documents"> |
| 9 |
|
| 10 |
</HEAD> |
| 11 |
|
| 12 |
<BODY> |
| 13 |
|
| 14 |
<H1>Application programmers' guide to asubs package</H1> |
| 15 |
|
| 16 |
<PRE> |
| 17 |
|
| 18 |
This package manages permanent Arrays and Stacks. See the array.doc |
| 19 |
for information on the Array/Stack package. ACEDB classes can be |
| 20 |
declared as A (array) classes, in place of B (tree) classes. In that |
| 21 |
case the keys are associated with arrays or stacks stored in the |
| 22 |
database. The calls in this case are: |
| 23 |
|
| 24 |
void arrayStore (KEY key, Array a, char *format) |
| 25 |
Array arrayGet (KEY key, TYPE, char *format) |
| 26 |
|
| 27 |
arrayStore() saves the array a with key, which must already have been |
| 28 |
created using lexaddkey(). If there was something there already it is |
| 29 |
overwritten (you can test with iskey() first if you want - see lexsubs). |
| 30 |
The format defines what is to be stored. An example is "kkfi" which |
| 31 |
means "two keys, float, integer". Allowed format characters are: |
| 32 |
c single char |
| 33 |
k key |
| 34 |
i integer |
| 35 |
f float |
| 36 |
v pointer (void*) |
| 37 |
Note that the pointers are not recoverable, but it is useful to cast |
| 38 |
things to (void*)! |
| 39 |
|
| 40 |
arrayGet() gets the array stored with key. You get a copy of the |
| 41 |
array. You can edit it however you want, and it is your |
| 42 |
responsibility to destroy it when you are finished. |
| 43 |
|
| 44 |
void stackStore (KEY key, Stack s) |
| 45 |
Stack stackGet (KEY key) |
| 46 |
|
| 47 |
are corresponding routines to store/get stacks. In fact they are |
| 48 |
stored as arrays of chars, and can be recovered as such, though it |
| 49 |
makes sense to store/get consistently. |
| 50 |
|
| 51 |
void arrayKill (KEY key) |
| 52 |
|
| 53 |
kills any array or stack attached to key. |
| 54 |
|
| 55 |
NB there are potential problems with word alignment on a machine with |
| 56 |
bizarre alignment rules. |
| 57 |
|
| 58 |
</PRE> |
| 59 |
|
| 60 |
</BODY> |
| 61 |
</HTML> |