Crossfire Server, Trunk
R21670
|
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h>
#include <winsock2.h>
#include <time.h>
#include <direct.h>
#include <math.h>
#include <sys/stat.h>
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <process.h>
Go to the source code of this file.
Data Structures | |
struct | DIR |
struct | dirent |
Macros | |
#define | __STDC__ 1 /* something odd, CF want this, but don'T include it */ |
#define | AFX_STDAFX_H__31666CA1_2474_11D5_AE6C_F07569C10000__INCLUDED_ |
#define | atoll _atoi64 |
#define | CONFDIR "share" |
#define | CS_LOGSTATS |
#define | DATADIR "share" |
#define | F_OK 6 |
#define | FMT64 "I64d" |
#define | FMT64U "I64u" |
#define | getpid() _getpid() |
#define | HAVE_LIBCURL |
#define | HAVE_STRERROR |
#define | HAVE_STRTOL |
#define | inline __inline |
#define | LIBDIR "share" |
#define | LOCALDIR "var" |
#define | MAXPATHLEN 256 |
#define | mkdir(__a, __b) mkdir(__a) |
#define | NAMLEN(dirent) strlen((dirent)->d_name) |
#define | pclose(__a) _pclose(__a) |
#define | PLUGIN_SUFFIX ".dll" |
#define | popen(__a, __b) _popen(__a, __b) |
#define | PREFIXDIR "" |
#define | R_OK 6 /* for __access() */ |
#define | S_IRGRP 0000040 |
#define | S_IROTH 0000400 |
#define | S_IRUSR 0000004 |
#define | S_ISDIR(x) (((x)&S_IFMT) == S_IFDIR) |
#define | S_ISGID 0002000 |
#define | S_ISREG(x) (((x)&S_IFMT) == S_IFREG) |
#define | S_IWGRP 0000020 |
#define | S_IWOTH 0000200 |
#define | S_IWUSR 0000002 |
#define | sleep(x) Sleep(x*1000) |
#define | snprintf _snprintf |
#define | socklen_t int /* Doesn't exist, just a plain int */ |
#define | strtok_r(x, y, z) strtok(x, y) |
#define | unlink(__a) _unlink(__a) |
#define | VERSION "1.9.1 (trunk) snapshot 20061229" |
#define | vsnprintf _vsnprintf |
#define | WEXITSTATUS(x) x |
#define | WIFEXITED(x) 1 |
#define | WIN32_LEAN_AND_MEAN |
Typedefs | |
typedef struct dirent | dirent |
typedef signed short | int16_t |
typedef signed int | int32_t |
typedef signed __int64 | int64_t |
typedef signed char | int8_t |
typedef unsigned short | uint16_t |
typedef unsigned int | uint32_t |
typedef unsigned __int64 | uint64_t |
typedef unsigned char | uint8_t |
Functions | |
int | closedir (DIR *) |
DIR * | opendir (const char *) |
struct dirent * | readdir (DIR *) |
void | rewinddir (DIR *) |
void | service_handle () |
void | service_register () |
void | service_unregister () |
int | strcasecmp (const char *s1, const char *s2) |
int | strncasecmp (const char *s1, const char *s2, int n) |
Variables | |
int | bRunning |
Structures and types used to implement opendir/readdir/closedir on Windows 95/NT and set the loe level defines.
Also some Windows-specific includes and tweaks.
Definition in file win32.h.
#define __STDC__ 1 /* something odd, CF want this, but don'T include it */ |
#define AFX_STDAFX_H__31666CA1_2474_11D5_AE6C_F07569C10000__INCLUDED_ |
#define atoll _atoi64 |
Definition at line 170 of file win32.h.
Referenced by init_experience(), and load_settings().
#define LIBDIR "share" |
Definition at line 99 of file win32.h.
Referenced by command_loadplugin(), and initPlugins().
#define mkdir | ( | __a, | |
__b | |||
) | mkdir(__a) |
Definition at line 57 of file win32.h.
Referenced by make_path_to_file(), and START_TEST().
#define PLUGIN_SUFFIX ".dll" |
Definition at line 106 of file win32.h.
Referenced by initPlugins().
#define R_OK 6 /* for __access() */ |
Definition at line 64 of file win32.h.
Referenced by load_unique_objects().
#define S_IRGRP 0000040 |
Definition at line 88 of file win32.h.
Referenced by check_path().
#define S_IROTH 0000400 |
Definition at line 85 of file win32.h.
Referenced by check_path().
#define S_IRUSR 0000004 |
Definition at line 91 of file win32.h.
Referenced by check_path(), and tempnam_secure().
#define S_ISDIR | ( | x | ) | (((x)&S_IFMT) == S_IFDIR) |
Definition at line 69 of file win32.h.
Referenced by command_players(), find_maps(), find_style(), load_dir(), make_path_to_file(), and remove_directory().
#define S_ISREG | ( | x | ) | (((x)&S_IFMT) == S_IFREG) |
Definition at line 70 of file win32.h.
Referenced by check_path(), and find_help_file().
#define S_IWGRP 0000020 |
Definition at line 79 of file win32.h.
Referenced by check_path().
#define S_IWOTH 0000200 |
Definition at line 76 of file win32.h.
Referenced by check_path().
#define S_IWUSR 0000002 |
Definition at line 82 of file win32.h.
Referenced by check_path(), and tempnam_secure().
#define sleep | ( | x | ) | Sleep(x*1000) |
Definition at line 150 of file win32.h.
Referenced by metaserver2_thread().
#define snprintf _snprintf |
Definition at line 46 of file win32.h.
Referenced by account_char_load(), account_char_save(), accounts_load(), accounts_save(), add_abilities(), add_author(), add_exit_to_item(), add_region_link(), add_required_parameter(), addConstants(), addSimpleConstants(), adjust_sign_msg(), animate_weapon(), apply_anim_suffix(), apply_builder_floor(), apply_builder_wall(), apply_changes_to_player(), apply_check_race_restrictions(), apply_race_and_class(), attack_message(), attempt_steal(), basic_emote(), CREMapInformationManager::browseMaps(), can_pay(), cast_consecrate(), cast_create_town_portal(), cctk_setdatadir(), cfpython_globalEventListener(), cfpython_runPluginCommand(), change_book(), check_login(), check_pick(), check_probe(), check_split_string(), checkbanned(), checkdm(), command_banish(), command_cointoss(), command_help(), command_loadplugin(), command_loadtest(), command_me(), command_party(), command_players(), command_rename_item(), command_title(), compute_face_name(), content_recipe_value(), convert_newline(), copy_message(), create_items_path(), create_overlay_pathname(), create_pathname(), create_singularity(), create_template_pathname(), Crossfire_Object_Say(), dead_player(), deep_swamp_type_process(), delete_character(), describe_god(), display_motd(), display_who_entry(), do_map_index(), do_parameters(), do_region_kills(), do_tell(), do_tiled_map_picture(), dragon_ability_gain(), dragon_eat_flesh(), draw_one_high_score(), dump_alchemy(), dump_alchemy_costs(), dump_gods(), dump_unused_maps(), eat_common(), enter_fixed_template_map(), enter_random_map(), enter_random_template_map(), enter_unique_map(), esrv_draw_look(), esrv_send_inventory(), esrv_update_item(), eventListener(), examine(), find_help_file(), find_ingred_cost(), find_maps(), find_style(), fix_flesh_item(), fix_tiled_map(), food_type_apply(), forbid_play(), format_time(), generate_monster(), get_exit_seed(), get_ob_diff(), get_who_escape_code_value(), getPluginProperty(), give_artifact_abilities(), god_enchants_weapon(), god_examines_item(), god_info_msg(), gravestone_text(), help_topics(), hiscore_init(), i18n_init(), infect_object(), init_anim(), init_artifacts(), init_attackmess(), init_book_archive(), init_clocks(), init_emergency_mappath(), init_experience(), init_formulae(), init_listening_socket(), init_msgfile(), init_races(), init_regions(), init_server(), init_startup(), init_stats(), initPlugins(), is_defined_recipe(), key_change_class(), key_confirm_quit(), keyplace(), kill_object(), kill_player(), kill_player_not_permadeath(), kill_player_permadeath(), knowledge_alchemy_attempt(), knowledge_alchemy_detail(), knowledge_god_face(), knowledge_item_can_be_used_alchemy(), knowledge_read_player_data(), knowledge_write_player_data(), load_archetypes(), load_dir(), load_map_header(), load_materials(), load_quests_from_file(), load_settings(), load_treasures(), load_unique_objects(), QuestManager::loadQuestFile(), lock_and_hide_doors(), magic_wall(), main(), make_formula_book(), map_remove_unique_files(), mapfile_load(), metaserver2_init(), metaserver2_writer(), monster_communicate(), move_symptom(), msgfile_msg(), new_connection(), npcSay(), object_split(), old_describe_monster(), party_join(), party_leave(), perceive_self(), pets_summon_golem(), pick_up_object(), place_chest(), place_exits(), player_get_title(), player_lvl_adj(), player_set_dragon_title(), plugins_find_plugin(), poison_type_apply(), postInitPlugin(), potion_type_apply(), pray(), prepare_weapon(), print_los(), print_shop_string(), process_map(), put_doors(), put_score(), query_base_name(), query_short_name(), query_weight(), quest_read_player_data(), quest_write_player_data(), rangetostring(), read_bmap_names(), read_client_images(), read_face_data(), read_map_log(), read_smooth(), ready_map_name(), remove_directory(), replace(), reply_cmd(), resurrect_player(), ring_navar(), ring_scorn(), save_map(), save_player(), send_arch_info(), send_file(), send_new_char_info(), send_news(), send_rules(), set_title(), shop_describe(), show_matching_spells(), show_skills(), spell_consume_items(), spellbook_type_describe(), ss_dump_statistics(), ss_dump_table(), START_TEST(), store_spell_expiry(), store_time(), strtoktolin(), tailor_god_spell(), teardown(), tempnam(), tiled_map_need_pic(), time_format_time(), verify_player(), write_attribute_file(), write_attribute_index(), write_book_archive(), write_equipment_index(), write_map_log(), write_map_page(), write_maps_by_level(), write_note(), write_npc_list(), write_quests_page(), write_race_index(), write_readable_list(), write_region_index(), write_regions_link(), write_rune(), write_slaying_info(), write_todclock(), write_type_file(), write_type_index(), write_world_info(), and write_world_map().
#define socklen_t int /* Doesn't exist, just a plain int */ |
Definition at line 130 of file win32.h.
Referenced by new_connection(), and set_output_sock_buf().
#define strtok_r | ( | x, | |
y, | |||
z | |||
) | strtok(x, y) |
Definition at line 62 of file win32.h.
Referenced by find_skill_by_name(), handle_client(), matches(), parse_dialog_information(), send_arch_info(), and version_cmd().
#define unlink | ( | __a | ) | _unlink(__a) |
Definition at line 56 of file win32.h.
Referenced by account_char_save(), clean_test_account_data(), clean_tmp_map(), command_overlay_reset(), map_remove_unique_files(), remove_directory(), resurrect_player(), save_map(), and save_player().
#define vsnprintf _vsnprintf |
Definition at line 61 of file win32.h.
Referenced by draw_ext_info_format(), LOG(), set_exception(), SockList_AddPrintf(), and stringbuffer_append_printf().
typedef signed char int8_t |
int closedir | ( | DIR * | dp | ) |
Dispose of a directory handle.
dp | handle to free. Will become invalid. |
Definition at line 108 of file win32.c.
References DIR::dir, and DIR::handle.
Referenced by command_players(), find_maps(), help_topics(), i18n_init(), initPlugins(), load_dir(), and remove_directory().
DIR* opendir | ( | const char * | dir | ) |
Opens a directory for reading. The handle should be disposed through closedir().
dir | directory path. |
Definition at line 37 of file win32.c.
References DIR::dir, DIR::fileinfo, DIR::finished, DIR::handle, DIR::offset, and strdup().
Referenced by command_players(), find_maps(), help_topics(), i18n_init(), initPlugins(), load_dir(), and remove_directory().
Returns the next file/directory for specified directory handle, obtained through a call to opendir().
dp | handle. |
Definition at line 75 of file win32.c.
References dirent::d_ino, dirent::d_name, dirent::d_off, dirent::d_reclen, DIR::dent, DIR::fileinfo, DIR::finished, DIR::handle, and DIR::offset.
Referenced by command_players(), find_maps(), help_topics(), i18n_init(), initPlugins(), load_dir(), and remove_directory().
void rewinddir | ( | DIR * | dir_Info | ) |
Restart a directory listing from the beginning.
dir_Info | handle to rewing. |
Definition at line 124 of file win32.c.
References DIR::dir, DIR::fileinfo, DIR::finished, DIR::handle, and DIR::offset.
void service_handle | ( | void | ) |
Service entry point.
Definition at line 343 of file win32.c.
References SERVICE_NAME, and ServiceMain().
void service_register | ( | void | ) |
Registers the server to the service manager.
Definition at line 180 of file win32.c.
References SERVICE_DESCRIPTION, SERVICE_DISPLAY, and SERVICE_NAME.
void service_unregister | ( | void | ) |
Removes the Crossfire service from the service manager.
Definition at line 225 of file win32.c.
References SERVICE_NAME.
int strcasecmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Case-insensitive comparaison of strings.
This seems to be lacking on some system.
s1 | |
s2 | strings to compare. |
Definition at line 256 of file porting.c.
References tolower.
Referenced by account_change_password(), account_exists(), account_get_logged_in_init_socket(), account_get_logged_in_player(), account_get_players_for_account(), account_link(), account_login(), account_remove_player(), cast_create_missile(), command_kill_pets(), compare_map_info(), create_player_cmd(), dump_monster_treasure(), find_ingred_cost(), find_treasure_by_name(), get_god_for_race(), get_region_from_string(), load_settings(), metaserver2_init(), name_cmp(), object_matches_string(), shop_sort(), sort_archetypes(), sort_equipment(), sort_mapname(), sort_race(), sort_slaying(), sort_struct_map_in_quest(), and sortbyname().
int strncasecmp | ( | const char * | s1, |
const char * | s2, | ||
int | n | ||
) |
Case-insensitive comparaison of strings.
This seems to be lacking on some system.
s1 | |
s2 | strings to compare. |
n | maximum number of chars to compare. |
Definition at line 224 of file porting.c.
References tolower.
Referenced by examine(), find_player_options(), find_skill_by_name(), init_experience(), init_stats(), learn_skill(), object_matches_string(), strcasestr(), and use_skill().
int bRunning |
Will be set to FALSE when the server should stop running because the service is turned off.
Definition at line 159 of file win32.c.
Referenced by server_main(), ServiceCtrlHandler(), and ServiceMain().