dbm/
misc/
old-docs/
/* teeny.h */

/*
 * This file contains many to-be-edited-with-caution defines, along with some
 * function declarations. "config.h" should be included before this file at
 * all times.
 */

/* Change this if you make source code modifications */
static char     version[] = "TeenyMUSK 0.60alpha";

/*
 * Object element codes, for use when accessing the DB with get_int_elt() et.
 * al.
 * 
 */

/* These gadgets are all integers */

#define FLAGS           0
#define NAME            1
#define QUOTA           2
#define PENNIES		2
#define SCORE		2
#define LOC             3

/* Home, dropto, and destination are the same */

#define HOME            4
#define DROPTO          4
#define DESTINATION     4
#define OWNER           5
#define CONTENTS        6
#define EXITS           7
#define ROOMS		8
#define NEXT            9
#define TIMESTAMP       10

/* This is a bizzare array of ints. */

#define LOCK            11
#define ELOCK		12
#define DESTINATIONS	13

/* The obvious strings */

#define SUC             14
#define OSUC            15
#define FAIL            16
#define OFAIL           17
#define DESC            18
/* #define GENDER          19 *//* obselete with v. 0.54 */
#define DROP            20
#define ODROP           21
#define ENTER		22
#define OENTER		23
#define LEAVE		24
#define OLEAVE		25
#define IDESC		26
#define ODESC		27
#define SITE		28
#define KILL		29
#define OKILL		30
#define PASSWORD	31
#define OTELEPORT	32
#define OXTELEPORT	33
#define OXENTER		34
#define	OXLEAVE		35
#define EFAIL		36
#define OEFAIL		37

/*
 * Various defines for the fields of the flags.
 */

/* Leave the type field in the low order bits or DIE. */

#define TYPE_MASK       0x00000007
#define TYP_PLAYER      0
#define TYP_THING       1
#define TYP_ROOM        2
#define TYP_EXIT        3

/* External flags */

#define WIZARD          0x00000008
#define GOD		0x00000010
#define LINK_OK         0x00000020
#define DARK            0x00000040
#define HAVEN           0x00000080
#define JUMP_OK         0x00000100
#define ABODE           0x00000200
#define BUILDER         0x00000400
#define ENTER_OK	0x00000800
#define EXTERNAL	0x00000800	/* for exits */
#define STICKY		0x00001000
#define ROBOT		0x00002000
#define ACTION          0x00002000	/* for exits */
#define GUEST		0x00004000	/* for players */

#define GENDER_MALE	0x01000000	/* for players */
#define GENDER_FEMALE	0x02000000	/* for players */
#define GENDER_NEUTER	0x04000000	/* for players */

/*
 * Flags used internally by the DB gear. You are resonsible for NOT fucking
 * with these
 */

#define FREE_CHUNK      0x10000000
#define IN_MEMORY       0x20000000
#define DIRTY		0x40000000

/* A mask for the internal use flags */

#define INTERNAL_FLAGS  0xF0000000

#define TRUE    1
#define FALSE   0
#define BUFFSIZ 512
#define LARGEBUFFSIZ 1024 * 16
#define PREFIX_CODE 1
#define SUFFIX_CODE 2
#define EXITS_LIST 0
#define CONTENTS_LIST 1
#define ROOMS_LIST 2

#define LOCK_REGISTER	1
#define LOCK_DISCONNECT	2

#define CRYPT_KEY	"TW"

/*
 * Possible MUD statuses
 */

#define RUNNING 0
#define DUMPING 1
#define STOPPED 2

/* For stupid compilers... */
#ifdef NO_VOID_POINTERS
/* these used to be typedef's, but the VAX compiler decided to choke on 'em. */
#define voidfunc      int
#else
#define voidfunc      void
#endif				/* NO_VOID_POINTERS */
typedef long    dbref;

/* Macros for checking internal and external flags */

#define isgod(x)	((x == PLAYER_GOD) || is_flag_set(x,GOD))
#define iswiz(x)        (isgod(x) || is_flag_set(x,WIZARD))
#define isrobot(x)      (is_flag_set(x,ROBOT) && isplayer(x))
#define isaction(x)	(is_flag_set(x,ACTION) && isexit(x))
#define issticky(x)     (is_flag_set(x,STICKY))
#define islinkok(x)     (is_flag_set(x,LINK_OK))
#define isdark(x)       (is_flag_set(x,DARK))
#define ishaven(x)      (is_flag_set(x,HAVEN))
#define isjumpok(x)     (is_flag_set(x,JUMP_OK))
#define isabode(x)      (is_flag_set(x,ABODE) && !isexit(x))
#define isobvious(x)	(is_flag_set(x,ABODE) && isexit(x))
#define isbuilder(x)    (is_flag_set(x,BUILDER))
#define isbuildok(x)	(is_flag_set(x,BUILDER) && isroom(x))
#define isenterok(x)	(is_flag_set(x,ENTER_OK) && !isexit(x))
#define isexternal(x)	(is_flag_set(x,EXTERNAL) && isexit(x))
#define isguest(x)	(is_flag_set(x,GUEST) && !iswiz(x))

#define ismale(x)	(is_flag_set(x,GENDER_MALE) && isplayer(x))
#define isfemale(x)	(is_flag_set(x,GENDER_FEMALE) && isplayer(x))
#define isneuter(x)	(is_flag_set(x,GENDER_NEUTER) && isplayer(x))

/*
 * Forward function declarations. None of that ANSI shit here.
 */

extern char    *stuff_name();
extern void     destroy_obj();
extern void     animate();
extern char    *ty_malloc();
extern long     get_chunk();
extern struct obj_data *disk_thaw();
extern void     unlock_cache();
extern struct dsc *get_descriptor();
extern char    *ty_itoa();
extern int     *bool_parse();
extern int      match_player();
extern int      match_who();
extern void     iobdisconnect();
extern void     iobdrop();
/* extern int      iobflush(); */
extern void     iobflush();
extern void     notify_player();
extern void     notify_wall();
extern void     iosync();
extern void     iobput();
extern void     iowrap();
extern void     del_free_chunk();
extern void     free_descriptor();
extern voidfunc do_look();
extern voidfunc do_score();
extern void     list_drop();
extern void     act_object();
extern void     flush_room();
extern void     list_add();
extern void     greet();
extern char    *pronoun_sub();
extern void     newwho();
extern void     dropwho();
extern void     do_wholist();
extern void     log_connect();
extern void     log_disconnect();
extern void     ty_free();
extern char    *getname();
extern char    *crypt();
extern void     initialize_db();
extern void     grow_index();
extern void     free_obj();