phantasmal_dgd_v1/
phantasmal_dgd_v1/bin/
phantasmal_dgd_v1/doc/
phantasmal_dgd_v1/mud/doc/
phantasmal_dgd_v1/mud/doc/api/
phantasmal_dgd_v1/mud/doc/kernel/
phantasmal_dgd_v1/mud/doc/kernel/hook/
phantasmal_dgd_v1/mud/doc/kernel/lfun/
phantasmal_dgd_v1/mud/include/
phantasmal_dgd_v1/mud/include/kernel/
phantasmal_dgd_v1/mud/kernel/lib/
phantasmal_dgd_v1/mud/kernel/lib/api/
phantasmal_dgd_v1/mud/kernel/obj/
phantasmal_dgd_v1/mud/kernel/sys/
phantasmal_dgd_v1/mud/tmp/
phantasmal_dgd_v1/mud/usr/System/
phantasmal_dgd_v1/mud/usr/System/keys/
phantasmal_dgd_v1/mud/usr/System/obj/
phantasmal_dgd_v1/mud/usr/System/open/lib/
phantasmal_dgd_v1/mud/usr/common/data/
phantasmal_dgd_v1/mud/usr/common/lib/parsed/
phantasmal_dgd_v1/mud/usr/common/obj/telopt/
phantasmal_dgd_v1/mud/usr/common/obj/ustate/
phantasmal_dgd_v1/mud/usr/game/
phantasmal_dgd_v1/mud/usr/game/include/
phantasmal_dgd_v1/mud/usr/game/obj/
phantasmal_dgd_v1/mud/usr/game/object/
phantasmal_dgd_v1/mud/usr/game/object/stuff/
phantasmal_dgd_v1/mud/usr/game/sys/
phantasmal_dgd_v1/mud/usr/game/text/
phantasmal_dgd_v1/mud/usr/game/users/
phantasmal_dgd_v1/src/host/
phantasmal_dgd_v1/src/host/beos/
phantasmal_dgd_v1/src/host/mac/
phantasmal_dgd_v1/src/host/unix/
phantasmal_dgd_v1/src/host/win32/res/
phantasmal_dgd_v1/src/kfun/
phantasmal_dgd_v1/src/lpc/
phantasmal_dgd_v1/src/parser/
typedef struct {
    char *name;			/* name of object */
    unsigned short funcoffset;	/* function call offset */
    unsigned short varoffset;	/* variable offset */
} pcinherit;

typedef void (*pcfunc) P((frame*));

typedef struct {
    uindex oindex;		/* precompiled object */

    short ninherits;		/* # of inherits */
    pcinherit *inherits;	/* inherits */

    Uint compiled;		/* compile time */

    unsigned short progsize;	/* program size */
    char *program;		/* program */

    unsigned short nstrings;	/* # of strings */
    dstrconst* sstrings;	/* string constants */
    char *stext;		/* string text */
    Uint stringsz;		/* string size */

    unsigned short nfunctions;	/* # functions */
    pcfunc *functions;		/* functions */

    short nfuncdefs;		/* # function definitions */
    dfuncdef *funcdefs;		/* function definitions */

    short nvardefs;		/* # variable definitions */
    short nclassvars;		/* # class variable definitions */
    dvardef *vardefs;		/* variable definitions */
    char *classvars;		/* variable classes */

    uindex nfuncalls;		/* # function calls */
    char *funcalls;		/* function calls */

    uindex nsymbols;		/* # symbols */
    dsymbol *symbols;		/* symbols */

    unsigned short nvariables;	/* # variables */
    unsigned short nifdefs;	/* # int/float definitions */
    unsigned short nvinit;	/* # variables requiring initialization */
} precomp;

extern precomp	*precompiled[];	/* table of precompiled objects */
extern pcfunc	*pcfunctions;	/* table of precompiled functions */


bool   pc_preload	P((char*, char*));
array *pc_list		P((dataspace*));
void   pc_control	P((control*, object*));
bool   pc_dump		P((int));
void   pc_restore	P((int));


# define PUSH_NUMBER		(--f->sp)->type = T_INT, f->sp->u.number =
# define push_lvalue(v, t)	((--f->sp)->type = T_LVALUE, \
				 f->sp->oindex = (t), f->sp->u.lval = (v))
# define push_lvclass(l)	(f->lip->type = T_INT, \
				 (f->lip++)->u.number = (l))
# define store()		(i_store(f), f->sp[1] = f->sp[0], f->sp++)
# define store_int()		(i_store(f), f->sp += 2, f->sp[-2].u.number)
# define i_foffset(n)		(&f->ctrl->funcalls[2L * (f->foffset + (n))])

/*
 * prototypes for kfuns that might be called directly from precompiled code
 */
int kf_add P((frame*)), kf_add1 P((frame*)), kf_and P((frame*)),
    kf_div P((frame*)), kf_eq P((frame*)), kf_ge P((frame*)), kf_gt P((frame*)),
    kf_le P((frame*)), kf_lshift P((frame*)), kf_lt P((frame*)),
    kf_mod P((frame*)), kf_mult P((frame*)), kf_ne P((frame*)),
    kf_neg P((frame*)), kf_not P((frame*)), kf_or P((frame*)),
    kf_rangeft P((frame*)), kf_rangef P((frame*)), kf_ranget P((frame*)),
    kf_range P((frame*)), kf_rshift P((frame*)), kf_sub P((frame*)),
    kf_sub1 P((frame*)), kf_tofloat P((frame*)), kf_toint P((frame*)),
    kf_tst P((frame*)), kf_umin P((frame*)), kf_xor P((frame*)),
    kf_tostring P((frame*)), kf_ckrangeft P((frame*)), kf_ckrangef P((frame*)),
    kf_ckranget P((frame*)), kf_sum P((frame*, int));

int kf_this_object P((frame*)), kf_call_trace P((frame*)),
    kf_this_user P((frame*)), kf_users P((frame*)), kf_time P((frame*)),
    kf_swapout P((frame*)), kf_dump_state P((frame*)), kf_shutdown P((frame*));

void call_kfun		P((frame*, int));
void call_kfun_arg	P((frame*, int, int));
Int  xdiv		P((Int, Int));
Int  xmod		P((Int, Int));
Int  xlshift		P((Int, Int));
Int  xrshift		P((Int, Int));
bool poptruthval	P((frame*));
void new_rlimits	P((frame*));
int  switch_range	P((Int, Int*, int));
int  switch_str		P((value*, control*, char*, int));