| 1 |
/* Copyright (c) 1986 Regents of the University of California */
|
| 2 |
|
| 3 |
/* SCCSid "$SunId$ LBL" */
|
| 4 |
|
| 5 |
/*
|
| 6 |
* object.h - header file for routines using objects and object sets.
|
| 7 |
*
|
| 8 |
* 7/28/85
|
| 9 |
*/
|
| 10 |
|
| 11 |
/*
|
| 12 |
* Object definitions require general specifications
|
| 13 |
* which may include a number of different argument types.
|
| 14 |
* The following structure aids in the storage of such
|
| 15 |
* argument lists.
|
| 16 |
*/
|
| 17 |
|
| 18 |
typedef struct {
|
| 19 |
short nsargs; /* # of string arguments */
|
| 20 |
short nfargs; /* # of real arguments */
|
| 21 |
char **sarg; /* string arguments */
|
| 22 |
FLOAT *farg; /* real arguments */
|
| 23 |
#ifdef IARGS
|
| 24 |
short niargs; /* # of integer arguments */
|
| 25 |
long *iarg; /* integer arguments */
|
| 26 |
#endif
|
| 27 |
} FUNARGS;
|
| 28 |
|
| 29 |
#define MAXSTR 128 /* maximum string length */
|
| 30 |
|
| 31 |
/*
|
| 32 |
* An object is defined as an index into an array of
|
| 33 |
* structures containing the object type and specification
|
| 34 |
* and the modifier index.
|
| 35 |
*/
|
| 36 |
|
| 37 |
#ifndef OBJECT
|
| 38 |
#ifdef BIGMEM
|
| 39 |
#define OBJECT int4 /* index to object array */
|
| 40 |
#else
|
| 41 |
#define OBJECT int2 /* index to object array */
|
| 42 |
#endif
|
| 43 |
#endif
|
| 44 |
|
| 45 |
typedef struct {
|
| 46 |
OBJECT omod; /* modifier number */
|
| 47 |
short otype; /* object type number */
|
| 48 |
char *oname; /* object name */
|
| 49 |
FUNARGS oargs; /* object specification */
|
| 50 |
char *os; /* object structure */
|
| 51 |
} OBJREC;
|
| 52 |
|
| 53 |
#ifndef MAXOBJBLK
|
| 54 |
#ifdef BIGMEM
|
| 55 |
#define MAXOBJBLK 65535 /* maximum number of object blocks */
|
| 56 |
#else
|
| 57 |
#define MAXOBJBLK 31 /* maximum number of object blocks */
|
| 58 |
#endif
|
| 59 |
#endif
|
| 60 |
|
| 61 |
extern OBJREC *objblock[MAXOBJBLK]; /* the object blocks */
|
| 62 |
extern OBJECT nobjects; /* # of objects */
|
| 63 |
|
| 64 |
#define OBJBLKSHFT 9
|
| 65 |
#define OBJBLKSIZ (1<<OBJBLKSHFT) /* object block size */
|
| 66 |
#define objptr(obj) (objblock[(obj)>>OBJBLKSHFT]+((obj)&(OBJBLKSIZ-1)))
|
| 67 |
|
| 68 |
#define OVOID (-1) /* void object */
|
| 69 |
#define VOIDID "void" /* void identifier */
|
| 70 |
|
| 71 |
/*
|
| 72 |
* Object sets begin with the number of objects and proceed with
|
| 73 |
* the objects in ascending order.
|
| 74 |
*/
|
| 75 |
|
| 76 |
#define MAXSET 127 /* maximum object set size */
|
| 77 |
|
| 78 |
OBJECT *setsave();
|
| 79 |
|
| 80 |
#define setfree(os) free((char *)(os))
|