Crossfire Server, Trunk
R22010
|
Go to the source code of this file.
Macros | |
#define | CALLOC(x, y) calloc(x, y) |
#define | FALSE false |
#define | FMT64 PRId64 |
#define | FMT64U PRIu64 |
#define | MAX(x, y) ((x) > (y) ? (x) : (y)) |
#define | MIN(x, y) ((x) < (y) ? (x) : (y)) |
#define | object_decrease_nrof_by_one(xyz) object_decrease_nrof(xyz, 1) |
#define | safe_strncpy strlcpy |
#define | strcasestr_local strcasestr |
#define | strdup_local strdup |
#define | TRUE true |
Functions | |
void | safe_strcat (char *dest, const char *orig, size_t *curlen, size_t maxlen) |
size_t | strlcpy (char *dst, const char *src, size_t size) |
Compatibility implementations of useful nonstandard types and functions.
Definition in file compat.h.
#define CALLOC | ( | x, | |
y | |||
) | calloc(x, y) |
Definition at line 27 of file compat.h.
Referenced by cast_raise_dead_spell(), expand_objects(), get_archetype_struct(), include_map_in_map(), and parse_shop_string().
#define FALSE false |
Definition at line 11 of file compat.h.
Referenced by cctk_init_std_archetypes(), command_abil(), command_addexp(), command_create(), command_patch(), command_search_items(), command_title(), compare_ob_value_lists_one(), convert_item(), did_make_save_item(), generate_monster_arch(), generate_monster_inv(), init_library(), load_settings(), map_info(), metaserver2_init(), new_exp(), object_set_value(), object_set_value_s(), parse_dialog_information(), pay_for_item(), pick_up_object(), set_object_face_main(), set_object_face_other(), spell_failure(), and wildcard_match().
#define FMT64 PRId64 |
Definition at line 12 of file compat.h.
Referenced by command_statistics(), command_stats(), describe_item(), draw_one_high_score(), dump_abilities(), dump_experience(), get_ob_diff(), get_score(), god_enchants_weapon(), hiscore_check(), init_experience(), print_monsters(), put_score(), random_roll64(), resurrect_player(), ring_desc(), and show_skills().
#define FMT64U PRIu64 |
Definition at line 13 of file compat.h.
Referenced by main(), pay_for_amount(), pay_for_item(), save_map(), and START_TEST().
#define MAX | ( | x, | |
y | |||
) | ((x) > (y) ? (x) : (y)) |
Definition at line 20 of file compat.h.
Referenced by add_monster(), animate_weapon(), apply_auto(), apply_death_exp_penalty(), attempt_recipe(), calc_skill_exp(), cast_spell(), chance_fn(), check_pick(), command_create(), common_trap_type_process(), confuse_living(), die_roll(), do_exit_map(), draw_magic_map(), esrv_draw_look(), esrv_send_inventory(), expand_lighted_sight(), fix_object(), hit_with_one_attacktype(), kill_player_not_permadeath(), min_casting_level(), monster_can_detect_enemy(), monster_check_pickup(), monster_check_wakeup(), monster_use_range(), move_symptom(), new_exp(), object_merge_spell(), object_split(), path_to_player(), peacemaker_type_process(), pets_summon_golem(), poison_living(), pray_at_altar(), random_roll(), random_roll64(), recipe_chance(), rod_adjust(), roguelike_link_rooms(), scroll_type_apply(), SP_level_spellpoint_cost(), spellbook_type_apply(), spring_trap(), trap_disarm(), trap_see(), and write_scroll().
#define MIN | ( | x, | |
y | |||
) | ((x) < (y) ? (x) : (y)) |
Definition at line 17 of file compat.h.
Referenced by add_monster(), apply_death_exp_penalty(), cast_bless(), chance_fn(), check_exp_adjust(), die_roll(), do_exit_map(), do_throw(), dragon_eat_flesh(), draw_magic_map(), esrv_draw_look(), esrv_send_inventory(), expand_lighted_sight(), get_index(), hit_with_one_attacktype(), kill_object(), knowledge_process_incremental(), lookup_god_by_name(), monster_check_pickup(), monster_do_living(), mood_change(), new_exp(), pets_summon_golem(), pick_up_object(), play_sound_player_only(), potion_type_apply(), power_crystal_type_apply(), random_roll(), random_roll64(), recipe_chance(), reportSummon(), roguelike_link_rooms(), save_player(), singing(), time_info(), trap_disarm(), trap_see(), use_skill(), and value_limit().
#define object_decrease_nrof_by_one | ( | xyz | ) | object_decrease_nrof(xyz, 1) |
Definition at line 28 of file compat.h.
Referenced by apply_map_builder(), check_inv(), command_use(), deep_swamp_type_process(), food_type_apply(), improve_armour(), improve_weapon(), improve_weapon_stat(), player_attack_door(), poison_type_apply(), potion_type_apply(), prepare_weapon(), scroll_type_apply(), skillscroll_type_apply(), spellbook_type_apply(), treasure_type_apply(), write_note(), and write_scroll().
#define safe_strncpy strlcpy |
Definition at line 23 of file compat.h.
Referenced by add_object_to_socklist(), apply_savebed(), cast_raise_dead_spell(), cfapi_object_set_property(), choose_cult_monster(), command_cast_spell(), command_create(), command_reply(), command_statistics(), content_recipe_value(), create_player_cmd(), cursed_food_effects(), do_dynamic(), enter_map(), enter_player_savebed(), enter_random_map(), enter_random_template_map(), generate_random_map(), kill_player_permadeath(), knowledge_alchemy_attempt(), lighter_type_apply(), load_settings(), make_path_to_file(), map_info(), mapfile_load(), object_matches_string(), player_changer_type_process(), read_map_log(), receive_player_password(), recipe_find_ingredient_cost(), and send_news().
#define strcasestr_local strcasestr |
Definition at line 24 of file compat.h.
Referenced by hiscore_display(), write_mark(), and write_note().
#define strdup_local strdup |
Definition at line 25 of file compat.h.
Referenced by account_block_create(), account_change_password(), account_link(), account_login_cmd(), account_new(), account_new_cmd(), accounts_load(), add_shop_item(), build_stringlist(), cast_spell(), cfapi_system_strdup_local(), check_login(), Facesets::create(), fire_bow(), include_map_in_map(), init_attackmess(), init_connection(), init_emergency_mappath(), knowledge_god_add(), knowledge_god_detail(), knowledge_god_summary(), knowledge_god_validate(), knowledge_monster_add(), load_dir(), load_map_header(), load_settings(), main(), metaserver2_init(), of_open(), parse_regions(), parse_shop_string(), party_form(), PngLoader::processData(), FacesetLoader::processFile(), push(), read_map_log(), send_arch_info(), and spell_consume_items().
#define TRUE true |
Definition at line 10 of file compat.h.
Referenced by attack_ob_simple(), cast_spell(), check_login(), check_pick(), command_nowiz(), compare_ob_value_lists_one(), did_make_save_item(), fix_object(), flush_old_maps(), generate_monster_arch(), generate_monster_inv(), god_enchants_weapon(), god_gives_present(), key_confirm_quit(), kill_player(), kill_player_permadeath(), load_settings(), LOG(), map_info(), metaserver2_init(), object_set_value(), object_set_value_s(), parse_dialog_information(), process_events(), process_players1(), rangetostring(), receive_player_password(), save_player(), scroll_failure(), scroll_type_apply(), server_main(), set_object_face_main(), set_object_face_other(), SP_level_spellpoint_cost(), spellbook_type_apply(), START_TEST(), swap_map(), and wildcard_match().
void safe_strcat | ( | char * | dest, |
const char * | orig, | ||
size_t * | curlen, | ||
size_t | maxlen | ||
) |
Simple function we use below to keep adding to the same string but also make sure we don't overwrite that string.
dest | string to append to. | |
orig | string to append. | |
[out] | curlen | current length of dest. Will be updated by this function. |
maxlen | maximum length of dest buffer. |
Definition at line 350 of file porting.c.
Referenced by display_motd(), query_base_name(), query_name(), query_short_name(), send_new_char_info(), send_news(), send_rules(), and spellbook_type_describe().
size_t strlcpy | ( | char * | dst, |
const char * | src, | ||
size_t | size | ||
) |
Portable implementation of strlcpy(3).
Definition at line 370 of file porting.c.
Referenced by apply_race_and_class(), cfapi_map_set_map_property(), cfapi_object_get_property(), check_login(), check_path(), clean_path(), command_reset(), command_use(), compute_face_name(), do_dynamic(), do_tell(), dump_alchemy(), dump_alchemy_costs(), enter_fixed_template_map(), enter_random_map(), enter_random_template_map(), enter_unique_map(), esrv_update_item(), find_style(), get_who_escape_code_value(), key_change_class(), knowledge_player_knows(), make_map_walls(), nstrtok(), party_form(), party_set_password(), path_combine(), player_get_title(), player_set_own_title(), query_base_name(), query_short_name(), replace(), save_map(), strtoktolin(), and unclean_path().