File utils.c


Included Files

  • #include "conf.h"
  • #include "sysdep.h"
  • #include <stdio.h>
  • #include <ctype.h>
  • #include <stdlib.h>
  • #include <string.h>
  • #include <sys/types.h>
  • #include <unistd.h>
  • #include <limits.h>
  • #include <sys/time.h>
  • #include <assert.h>
  • #include "structs.h"
  • #include "utils.h"
  • #include "comm.h"
  • #include "screen.h"
  • #include "spells.h"
  • #include "handler.h"

  • External Variables

    time_info
    extern struct time_data time_info
    Defined in:
  • db.c
  • world
    extern struct room_data* world

    Defined in:
  • db.c
  • descriptor_list
    extern struct descriptor_data* descriptor_list

    Defined in:
  • comm.c

  • Global Function MAX()

    int MAX ( int a, int b )
    Prototyped in:
  • utils.h
  • Called by:
  • Crash_calculate_rent() : objsave.c
  • Crash_cryosave() : objsave.c
  • Crash_load() : objsave.c
  • Crash_report_rent() : objsave.c
  • advance_level() : class.c
  • affect_total() : handler.c
  • build_player_index() : db.c
  • close_socket() : comm.c
  • damage() : fight.c
  • do_ban() : ban.c
  • do_cast() : spell_parser.c
  • do_force() : act.wizard.c
  • do_quit() : act.other.c
  • do_unban() : ban.c
  • do_wiznet() : act.wizard.c
  • do_wizutil() : act.wizard.c
  • do_zreset() : act.wizard.c
  • dump() : spec_procs.c
  • gain_condition() : limits.c
  • gain_exp() : limits.c
  • gen_receptionist() : objsave.c
  • group_gain() : fight.c
  • guild() : spec_procs.c
  • hcontrol_pay_house() : house.c
  • hit() : fight.c
  • interpret_espec() : db.c
  • isbanned() : ban.c
  • mag_creations() : magic.c
  • mag_manacost() : spell_parser.c
  • mag_savingthrow() : magic.c
  • nanny() : interpreter.c
  • perform_drop() : act.item.c
  • perform_dupe_check() : interpreter.c
  • perform_group_gain() : fight.c
  • perform_set() : act.wizard.c
  • show_string() : modify.c
  • spell_create_water() : spells.c
  • weather_change() : weather.c

  • Global Function MIN()

    int MIN ( int a, int b )
    Prototyped in:
  • utils.h
  • Called by:
  • advance_level() : class.c
  • affect_total() : handler.c
  • damage() : fight.c
  • do_cast() : spell_parser.c
  • do_drink() : act.item.c
  • do_steal() : act.other.c
  • dump() : spec_procs.c
  • gain_condition() : limits.c
  • gain_exp() : limits.c
  • get_max_players() : comm.c
  • guild() : spec_procs.c
  • interpret_espec() : db.c
  • mag_creations() : magic.c
  • mag_points() : magic.c
  • perform_drop() : act.item.c
  • perform_group_gain() : fight.c
  • perform_set() : act.wizard.c
  • point_update() : limits.c
  • roll_real_abils() : class.c
  • shopping_sell() : shop.c
  • show_string() : modify.c
  • spell_create_water() : spells.c
  • spell_summon() : spells.c
  • weather_change() : weather.c

  • Global Function add_follower()

    void add_follower ( struct char_data* ch, struct char_data* leader )
    Calls:
  • act() : comm.c
  • __eprintf(), __gnu_calloc(), abort(), perror()
  • Called by:
  • mag_summons() : magic.c
  • pet_shops() : spec_procs.c
  • spell_charm() : spells.c
  • References Variables:
  • weather_info : db.c
  • world : db.c

  • Global Function age()

    struct time_info_data age ( struct char_data* ch )
    Prototyped in:
  • utils.h
  • Calls:
  • mud_time_passed() : utils.c
  • time()
  • Called by:
  • do_score() : act.informative.c
  • do_stat_character() : act.wizard.c
  • hit_gain() : limits.c
  • mana_gain() : limits.c
  • move_gain() : limits.c

  • Global Function basic_mud_log()

    void basic_mud_log ( char* str )
    Prototyped in:
  • utils.h
  • Calls:
  • asctime(), fprintf(), localtime(), strlen(), time()
  • Called by:
  • ASSIGNMOB() : spec_assign.c
  • ASSIGNOBJ() : spec_assign.c
  • ASSIGNROOM() : spec_assign.c
  • Board_display_msg() : boards.c
  • Board_load_board() : boards.c
  • Board_remove_msg() : boards.c
  • Board_show_board() : boards.c
  • Board_write_message() : boards.c
  • Crash_clean_file() : objsave.c
  • House_boot() : house.c
  • act() : comm.c
  • affect_modify() : handler.c
  • boot_db() : db.c
  • boot_social_messages() : act.social.c
  • boot_world() : db.c
  • build_player_index() : db.c
  • cast_spell() : spell_parser.c
  • char_from_room() : handler.c
  • char_to_room() : handler.c
  • char_to_store() : db.c
  • check_start_rooms() : db.c
  • checkpointing() : comm.c
  • create_money() : handler.c
  • damage() : fight.c
  • do_advance() : act.wizard.c
  • do_dc() : act.wizard.c
  • do_gen_tog() : act.other.c
  • do_shutdown() : act.wizard.c
  • do_use() : act.other.c
  • do_wizutil() : act.wizard.c
  • end_read_list() : shop.c
  • equip_char() : handler.c
  • evaluate_expression() : shop.c
  • extract_char() : handler.c
  • extract_obj() : handler.c
  • file_to_string() : db.c
  • find_char_in_index() : mail.c
  • find_first_step() : graph.c
  • fread_string() : db.c
  • free_char() : db.c
  • game_loop() : comm.c
  • gen_board() : boards.c
  • get_max_players() : comm.c
  • get_one_line() : db.c
  • get_selling_obj() : shop.c
  • hcontrol_destroy_house() : house.c
  • hupsig() : comm.c
  • index_boot() : db.c
  • index_mail() : mail.c
  • init_boards() : boards.c
  • init_game() : comm.c
  • level_exp() : class.c
  • mag_creations() : magic.c
  • mag_objectmagic() : spell_parser.c
  • mag_unaffects() : magic.c
  • main() : comm.c
  • mobile_activity() : mobact.c
  • money_desc() : handler.c
  • nanny() : interpreter.c
  • obj_from_char() : handler.c
  • obj_from_obj() : handler.c
  • obj_from_room() : handler.c
  • obj_to_char() : handler.c
  • obj_to_obj() : handler.c
  • obj_to_room() : handler.c
  • olc_interpreter() : olc.c
  • perform_act() : comm.c
  • perform_drop() : act.item.c
  • perform_remove() : act.item.c
  • pop() : shop.c
  • process_input() : comm.c
  • read_delete() : mail.c
  • read_from_file() : mail.c
  • read_mobile() : db.c
  • read_object() : db.c
  • record_usage() : comm.c
  • reset_time() : db.c
  • scan_file() : mail.c
  • spell_level() : spell_parser.c
  • store_mail() : mail.c
  • unequip_char() : handler.c
  • weight_change_object() : act.item.c
  • write_to_descriptor() : comm.c
  • write_to_file() : mail.c

  • Global Function circle_follow()

    bool circle_follow ( struct char_data* ch, struct char_data* victim )
    Prototyped in:
  • utils.h
  • Called by:
  • do_follow() : act.movement.c
  • spell_charm() : spells.c

  • Global Function dice()

    int dice ( int number, int size )
    Prototyped in:
  • utils.h
  • Calls:
  • random() : random.c
  • Called by:
  • hit() : fight.c
  • mag_damage() : magic.c
  • mag_points() : magic.c
  • read_mobile() : db.c
  • reset_time() : db.c
  • skill_message() : fight.c
  • weather_change() : weather.c

  • Global Function die_follower()

    void die_follower ( struct char_data* ch )
    Calls:
  • stop_follower() : utils.c

  • Global Function get_filename()

    int get_filename ( char* orig_name, char* filename, int mode )
    Prototyped in:
  • utils.h
  • Calls:
  • sprintf(), strcpy()
  • Called by:
  • Crash_clean_file() : objsave.c
  • Crash_crashsave() : objsave.c
  • Crash_cryosave() : objsave.c
  • Crash_delete_crashfile() : objsave.c
  • Crash_delete_file() : objsave.c
  • Crash_idlesave() : objsave.c
  • Crash_listrent() : objsave.c
  • Crash_load() : objsave.c
  • Crash_rentsave() : objsave.c

  • Global Function get_line()

    int get_line ( FILE* fl, char* buf )
    Prototyped in:
  • utils.h
  • Calls:
  • feof(), fgets(), strcpy(), strlen()
  • Called by:
  • discrete_load() : db.c
  • load_zones() : db.c
  • parse_enhanced_mob() : db.c
  • parse_mobile() : db.c
  • parse_object() : db.c
  • parse_room() : db.c
  • parse_simple_mob() : db.c
  • read_line() : shop.c
  • setup_dir() : db.c

  • Global Function log_death_trap()

    void log_death_trap ( struct char_data* ch )
    Prototyped in:
  • utils.h
  • Calls:
  • mudlog() : utils.c
  • sprintf()
  • Called by:
  • do_simple_move() : act.movement.c
  • References Variables:
  • world : db.c

  • Global Function mud_time_passed()

    struct time_info_data mud_time_passed ( time_t t2, time_t t1 )
    Called by:
  • age() : utils.c

  • Global Function mudlog()

    void mudlog ( char* str, char type, int level, byte file )
    Prototyped in:
  • utils.h
  • Calls:
  • send_to_char() : comm.c
  • asctime(), fprintf(), localtime(), sprintf(), time()
  • Called by:
  • Crash_load() : objsave.c
  • advance_level() : class.c
  • check_autowiz() : limits.c
  • check_idling() : limits.c
  • check_killer() : fight.c
  • close_socket() : comm.c
  • damage() : fight.c
  • do_ban() : ban.c
  • do_force() : act.wizard.c
  • do_gen_write() : act.other.c
  • do_purge() : act.wizard.c
  • do_quit() : act.other.c
  • do_skillset() : modify.c
  • do_unban() : ban.c
  • do_wizutil() : act.wizard.c
  • do_zreset() : act.wizard.c
  • gen_receptionist() : objsave.c
  • hcontrol_pay_house() : house.c
  • log_death_trap() : utils.c
  • log_zone_error() : db.c
  • nanny() : interpreter.c
  • new_descriptor() : comm.c
  • perform_dupe_check() : interpreter.c
  • reread_wizlists() : comm.c
  • spell_summon() : spells.c
  • unrestrict_game() : comm.c
  • zone_update() : db.c
  • References Variables:
  • descriptor_list : comm.c

  • Global Function num_pc_in_room()

    int num_pc_in_room ( struct room_data* room )
    Prototyped in:
  • utils.h
  • Called by:
  • do_simple_move() : act.movement.c

  • Global Function number()

    int number ( int from, int to )
    Prototyped in:
  • utils.h
  • Calls:
  • random() : random.c
  • Called by:
  • advance_level() : class.c
  • create_money() : handler.c
  • damage() : fight.c
  • do_backstab() : act.offensive.c
  • do_bash() : act.offensive.c
  • do_cast() : spell_parser.c
  • do_drink() : act.item.c
  • do_drop() : act.item.c
  • do_flee() : act.offensive.c
  • do_hide() : act.other.c
  • do_insult() : act.social.c
  • do_kick() : act.offensive.c
  • do_rescue() : act.offensive.c
  • do_sneak() : act.other.c
  • do_steal() : act.other.c
  • do_track() : graph.c
  • fry_victim() : castle.c
  • gen_receptionist() : objsave.c
  • get_victim() : castle.c
  • hit() : fight.c
  • init_char() : db.c
  • jerry() : castle.c
  • look_at_char() : act.informative.c
  • mag_materials() : magic.c
  • mag_savingthrow() : magic.c
  • mag_summons() : magic.c
  • magic_user() : spec_procs.c
  • mobile_activity() : mobact.c
  • npc_steal() : spec_procs.c
  • ok_pick() : act.movement.c
  • peter() : castle.c
  • puff() : spec_procs.c
  • read_mobile() : db.c
  • roll_real_abils() : class.c
  • snake() : spec_procs.c
  • spell_teleport() : spells.c
  • thief() : spec_procs.c
  • training_master() : castle.c

  • Global Function real_time_passed()

    struct time_info_data real_time_passed ( time_t t2, time_t t1 )

    Global Function sprintbit()

    void sprintbit ( long bitvector, char* names[], char* result )
    Prototyped in:
  • utils.h
  • Calls:
  • strcat(), strcpy()
  • Called by:
  • do_stat_character() : act.wizard.c
  • do_stat_object() : act.wizard.c
  • do_stat_room() : act.wizard.c
  • list_detailed_shop() : shop.c
  • look_at_room() : act.informative.c
  • olc_bitvector() : olc.c
  • spell_identify() : spells.c

  • Global Function sprinttype()

    void sprinttype ( int type, char* names[], char* result )
    Prototyped in:
  • utils.h
  • Calls:
  • strcpy()
  • Called by:
  • do_stat_character() : act.wizard.c
  • do_stat_object() : act.wizard.c
  • do_stat_room() : act.wizard.c
  • look_in_obj() : act.informative.c
  • spell_identify() : spells.c

  • Global Function stop_follower()

    void stop_follower ( struct char_data* ch )
    Prototyped in:
  • handler.h
  • Calls:
  • act() : comm.c
  • affect_from_char() : handler.c
  • affected_by_spell() : handler.c
  • __eprintf(), free()
  • Called by:
  • damage() : fight.c
  • die_follower() : utils.c
  • spell_charm() : spells.c

  • Global Function str_cmp()

    int str_cmp ( char* arg1, char* arg2 )
    Prototyped in:
  • utils.h
  • Called by:
  • do_alias() : interpreter.c
  • do_ban() : ban.c
  • do_cast() : spell_parser.c
  • do_display() : act.other.c
  • do_drop() : act.item.c
  • do_enter() : act.movement.c
  • do_force() : act.wizard.c
  • do_give() : act.item.c
  • do_group() : act.other.c
  • do_page() : act.comm.c
  • do_pour() : act.item.c
  • do_reboot() : db.c
  • do_set() : act.wizard.c
  • do_shutdown() : act.wizard.c
  • do_steal() : act.other.c
  • do_trans() : act.wizard.c
  • do_unban() : ban.c
  • do_users() : act.informative.c
  • do_who() : act.informative.c
  • evaluate_expression() : shop.c
  • find_name() : interpreter.c
  • get_char_room_vis() : handler.c
  • get_player_vis() : handler.c
  • hsort() : db.c
  • interpret_espec() : db.c
  • nanny() : interpreter.c
  • parse_mobile() : db.c
  • parse_object() : db.c
  • perform_set() : act.wizard.c
  • show_shops() : shop.c

  • Global Function str_dup()

    char* str_dup ( const char* source )
    Prototyped in:
  • utils.h
  • Calls:
  • __gnu_calloc(), abort(), perror(), strcpy(), strlen()
  • Called by:
  • create_money() : handler.c
  • do_alias() : interpreter.c
  • do_poofset() : act.wizard.c
  • file_to_string_alloc() : db.c
  • load_help() : db.c
  • load_zones() : db.c
  • make_corpse() : fight.c
  • name_from_drinkcon() : act.item.c
  • olc_string() : olc.c
  • page_string() : modify.c
  • pet_shops() : spec_procs.c
  • postmaster_receive_mail() : mail.c
  • read_type_list() : shop.c
  • set_title() : limits.c
  • store_to_char() : db.c

  • Global Function strn_cmp()

    int strn_cmp ( char* arg1, char* arg2, int n )
    Prototyped in:
  • utils.h
  • Called by:
  • do_help() : act.informative.c
  • read_type_list() : shop.c

  • Global Function touch()

    int touch ( char* path )
    Prototyped in:
  • utils.h
  • Calls:
  • fclose(), fopen(), perror()
  • Called by:
  • build_player_index() : db.c
  • do_shutdown() : act.wizard.c