1stMUD4.0/bin/
1stMUD4.0/doc/MPDocs/
1stMUD4.0/player/
1stMUD4.0/win32/
1stMUD4.0/win32/rom/
/**************************************************************************
*  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
*  Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.   *
*                                                                         *
*  Merc Diku Mud improvements copyright (C) 1992, 1993 by Michael         *
*  Chastain, Michael Quan, and Mitchell Tse.                              *
*                                                                         *
*  In order to use any part of this Merc Diku Mud, you must comply with   *
*  both the original Diku license in 'license.doc' as well the Merc       *
*  license in 'license.txt'.  In particular, you may not remove either of *
*  these copyright notices.                                               *
*                                                                         *
*  Much time and thought has gone into this software and you are          *
*  benefiting.  We hope that you share your changes too.  What goes       *
*  around, comes around.                                                  *
***************************************************************************
*       ROM 2.4 is copyright 1993-1998 Russ Taylor                        *
*       ROM has been brought to you by the ROM consortium                 *
*           Russ Taylor (rtaylor@hypercube.org)                           *
*           Gabrielle Taylor (gtaylor@hypercube.org)                      *
*           Brian Moore (zump@rom.org)                                    *
*       By using this code, you have agreed to follow the terms of the    *
*       ROM license, in the file Rom24/doc/rom.license                    *
***************************************************************************
*       1stMUD ROM Derivative (c) 2001-2003 by Ryan Jennings              *
*            http://1stmud.dlmud.com/  <r-jenn@shaw.ca>                   *
***************************************************************************/
#if !defined(GLOBALS_H)
#define GLOBALS_H

#if defined(IN_DB_C)
#define    GLOBAL(str) str
#define    GLOBAL_DEF(str, def) str = def
#define    GLOBAL_LIST(data, str) data *str##_first = NULL, *str##_last = NULL
#else
#define    GLOBAL(str) EXTERN str
#define GLOBAL_DEF(str, def) EXTERN str
#define GLOBAL_LIST(data, str) EXTERN data *str##_first, *str##_last
#endif

GLOBAL_DEF(CLASS_DATA * class_table, NULL);
GLOBAL_LIST(RACE_DATA, race);

GLOBAL_DEF(SKILL_DATA * skill_table, NULL);
GLOBAL_DEF(GROUP_DATA * group_table, NULL);

GLOBAL_LIST(SOCIAL_DATA, social);

GLOBAL_DEF(int maxSocial, 0);

GLOBAL_LIST(HELP_DATA, help);
GLOBAL_LIST(SHOP_DATA, shop);
GLOBAL_LIST(CHAR_DATA, char);
GLOBAL_LIST(DESCRIPTOR_DATA, descriptor);
GLOBAL_LIST(OBJ_DATA, object);
GLOBAL_LIST(CHAR_DATA, player);
GLOBAL_LIST(PROG_CODE, mprog);
GLOBAL_LIST(PROG_CODE, oprog);
GLOBAL_LIST(PROG_CODE, rprog);
GLOBAL_LIST(AUCTION_DATA, auction);
GLOBAL_LIST(STAT_DATA, stat);
GLOBAL_LIST(BAN_DATA, ban);

GLOBAL(char bug_buf[MSL]);
GLOBAL_DEF(time_t current_time, 0);
GLOBAL_DEF(FILE * fpReserve, NULL);
GLOBAL(KILL_DATA kill_table[MAX_LEVEL]);
GLOBAL(char log_buf[MSL]);
GLOBAL(TIME_INFO_DATA time_info);
GLOBAL_DEF(bool MOBtrigger, TRUE);
GLOBAL_LIST(DISABLED_DATA, disabled);
GLOBAL(GQUEST gquest_info);
GLOBAL(WAR war_info);
GLOBAL_DEF(int maxClan, 0);
GLOBAL_DEF(int maxCommands, 0);
GLOBAL_DEF(int maxSkill, 0);
GLOBAL_DEF(int maxGroup, 0);
GLOBAL_DEF(int maxRace, 0);
GLOBAL_DEF(int maxClass, 0);
GLOBAL_DEF(int newmobs, 0);
GLOBAL_DEF(int newobjs, 0);
GLOBAL_DEF(int nAllocString, 0);
GLOBAL_DEF(size_t sAllocString, 0);
GLOBAL_DEF(CHAR_DATA * char_free, NULL);
GLOBAL_DEF(PC_DATA * pcdata_free, NULL);
GLOBAL_DEF(DESCRIPTOR_DATA * descriptor_free, NULL);
GLOBAL_DEF(OBJ_DATA * obj_free, NULL);
GLOBAL_DEF(AFFECT_DATA * affect_free, NULL);
GLOBAL_DEF(MBR_DATA * mbr_free, NULL);
GLOBAL_DEF(int maxDeity, 0);
GLOBAL_LIST(DEITY_DATA, deity);
GLOBAL_LIST(WPWD_DATA, wpwd);
GLOBAL_LIST(MBR_DATA, mbr);
GLOBAL_LIST(CLAN_DATA, clan);
GLOBAL_LIST(CMD_DATA, cmd);

GLOBAL(CMD_DATA * command_hash[126]);
GLOBAL(SOCIAL_DATA * social_hash[27]);

GLOBAL_DEF(CMD_DATA * cmd_first_sorted, NULL);

GLOBAL_DEF(int port, 0);
GLOBAL(char HOSTNAME[1024]);
GLOBAL_DEF(RACE_DATA * default_race, NULL);
GLOBAL_DEF(CHANNEL_DATA * channel_table, NULL);
GLOBAL_DEF(int maxChannel, 0);

GLOBAL(CRS crs_info);
GLOBAL(MUD mud_info);

GLOBAL_DEF(SONG_DATA * song_table, NULL);
GLOBAL_DEF(int maxSongs, 0);
GLOBAL(char EXE_FILE[1024]);
GLOBAL(char UNAME[1024]);
GLOBAL(char CWDIR[1024]);
GLOBAL_DEF(time_t boot_time, 0);

GLOBAL_LIST(CORPSE_DATA, corpse);
GLOBAL_LIST(AREA_DATA, area);

EXTERN char *const temp_settings[];	/* FB */
EXTERN char *const precip_settings[];
EXTERN char *const wind_settings[];
EXTERN char *const preciptemp_msg[6][6];
EXTERN char *const windtemp_msg[6][6];
EXTERN char *const precip_msg[];
EXTERN char *const wind_msg[];

/*
 * Global Constants
 */
EXTERN char *const dir_name[];
EXTERN const int rev_dir[];		/* int - ROM OLC */

/*
 * Global variables
 */
GLOBAL_DEF(int top_affect, 0);
GLOBAL_DEF(int top_area, 0);
GLOBAL_DEF(int top_ed, 0);
GLOBAL_DEF(int top_exit, 0);
GLOBAL_DEF(int top_help, 0);
GLOBAL_DEF(int top_mob_index, 0);
GLOBAL_DEF(int top_obj_index, 0);
GLOBAL_DEF(int top_reset, 0);
GLOBAL_DEF(int top_room, 0);
GLOBAL_DEF(int top_explored, 0);
GLOBAL_DEF(int top_shop, 0);

GLOBAL_DEF(vnum_t top_vnum_mob, 0);
GLOBAL_DEF(vnum_t top_vnum_obj, 0);
GLOBAL_DEF(vnum_t top_vnum_room, 0);
GLOBAL_DEF(int mobile_count, 0);

EXTERN MOB_INDEX_DATA *mob_index_hash[MAX_KEY_HASH];
EXTERN OBJ_INDEX_DATA *obj_index_hash[MAX_KEY_HASH];
EXTERN ROOM_INDEX_DATA *room_index_hash[MAX_KEY_HASH];

#if !defined(NO_WEB)
GLOBAL_DEF(bool WebUP, FALSE);
GLOBAL(const char *www_history[20]);
GLOBAL_DEF(int www_index, 0);
#endif

/*
 * Global constants.
 */
EXTERN const struct str_app_type str_app[26];
EXTERN const struct int_app_type int_app[26];
EXTERN const struct wis_app_type wis_app[26];
EXTERN const struct dex_app_type dex_app[26];
EXTERN const struct con_app_type con_app[26];

EXTERN const struct weapon_type weapon_table[];
EXTERN const struct item_type item_table[];
EXTERN const struct wiznet_type wiznet_table[];
EXTERN const struct attack_type attack_table[];
EXTERN const struct spec_type spec_table[];
EXTERN const struct liq_type liq_table[];

GLOBAL_DEF(int control, 0);
GLOBAL_DEF(const char *help_greeting, "Welcome to " MUD_NAME);
GLOBAL(runlevel_t run_level);
GLOBAL_DEF(int top_mprog_index, 0);
GLOBAL_DEF(int top_oprog_index, 0);
GLOBAL_DEF(int top_rprog_index, 0);

GLOBAL_DEF(int telopt_lskip, 0);

#endif