]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/h/dyn.h
upstream tag
[1ts-debian.git] / zephyr / h / dyn.h
1 /*
2  * This file is part of libdyn.a, the C Dynamic Object library.  It
3  * contains the public header file.
4  *
5  * There are no restrictions on this code; however, if you make any
6  * changes, I request that you document them so that I do not get
7  * credit or blame for your modifications.
8  *
9  * Written by Barr3y Jaspan, Student Information Processing Board (SIPB)
10  * and MIT-Project Athena, 1989.
11  */
12
13
14 /*
15  * dyn.h -- header file to be included by programs linking against
16  * libdyn.a.
17  */
18
19 #ifndef _Dyn_h
20 #define _Dyn_h
21
22 /* Reliance on <sysdep.h> for __P() below makes this unsuitable for use
23  * outside of the Zephyr source tree. */
24 #include <sysdep.h>
25
26 typedef char *DynPtr;
27 typedef struct _DynObject *DynObject;
28
29 /* Function macros */
30 #define DynHigh(obj)    (DynSize(obj) - 1)
31 #define DynLow(obj)     (0)
32
33 #ifdef SUNOS
34 #define memmove(a, b, c) bcopy(b, a, c)
35 #endif
36
37 /* Return status codes */
38 #define DYN_OK          -1000
39 #define DYN_NOMEM       -1001
40 #define DYN_BADINDEX    -1002
41 #define DYN_BADVALUE    -1003
42      
43 /* Function declarations */
44 int             DynAppend __P((DynObject obj, DynPtr els, int num));
45 int             DynAdd __P((DynObject obj, DynPtr el));
46 DynObject       DynCreate __P((int el_size, int inc));
47 int             DynDebug __P((DynObject obj, int state));
48 int             DynDelete __P((DynObject obj, int idx));
49 int             DynDestroy __P((DynObject obj));
50 DynPtr          DynGet __P((DynObject obj, int num));
51 int             DynInsert __P((DynObject obj, int idx, DynPtr els, int num));
52 int             DynParanoid __P((DynObject obj, int state));
53 int             DynSize __P((DynObject obj));
54
55 #endif /* _Dyn_h */
56 /* DO NOT ADD ANYTHING AFTER THIS #endif */