Crossfire Server, Branches 1.12
R18729
|
#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 | BUNZIP "/usr/bin/bunzip2" |
#define | BZIP "/usr/bin/bzip2" |
#define | COMPRESS "/usr/bin/compress" |
#define | CONFDIR "share" |
#define | CS_LOGSTATS |
#define | DATADIR "share" |
#define | F_OK 6 |
#define | getpid() _getpid() |
#define | GETTIMEOFDAY_TWO_ARGS |
#define | GUNZIP "/bin/gunzip" |
#define | GZIP "/bin/gzip" |
#define | HAVE_FCNTL_H |
#define | HAVE_SNPRINTF 1 |
#define | HAVE_SRAND |
#define | HAVE_STDDEF_H |
#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 | UNCOMPRESS "/usr/bin/uncompress" |
#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 |
Functions | |
int | closedir (DIR *) |
int | gettimeofday (struct timeval *time_Info, struct timezone *timezone_Info) |
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 F_OK 6 |
Definition at line 76 of file win32.h.
Referenced by tempnam_local().
#define getpid | ( | ) | _getpid() |
Definition at line 69 of file win32.h.
Referenced by become_daemon(), and tempnam_local().
#define LIBDIR "share" |
Definition at line 110 of file win32.h.
Referenced by command_loadplugin(), initPlugins(), and main().
#define mkdir | ( | __a, | |
__b | |||
) | mkdir(__a) |
Definition at line 68 of file win32.h.
Referenced by make_path_to_file().
#define pclose | ( | __a | ) | _pclose(__a) |
Definition at line 71 of file win32.h.
Referenced by close_and_delete(), and save_map().
#define PLUGIN_SUFFIX ".dll" |
Definition at line 124 of file win32.h.
Referenced by initPlugins().
#define popen | ( | __a, | |
__b | |||
) | _popen(__a, __b) |
Definition at line 70 of file win32.h.
Referenced by open_and_uncompress_file(), and save_map().
#define R_OK 6 /* for __access() */ |
Definition at line 75 of file win32.h.
Referenced by load_unique_objects().
#define S_IRGRP 0000040 |
Definition at line 99 of file win32.h.
Referenced by check_path().
#define S_IROTH 0000400 |
Definition at line 96 of file win32.h.
Referenced by check_path().
#define S_IRUSR 0000004 |
Definition at line 102 of file win32.h.
Referenced by check_path(), and tempnam_secure().
#define S_ISDIR | ( | x | ) | (((x)&S_IFMT) == S_IFDIR) |
Definition at line 80 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 81 of file win32.h.
Referenced by check_path(), command_help(), and open_and_uncompress_file().
#define S_IWGRP 0000020 |
Definition at line 90 of file win32.h.
Referenced by check_path().
#define S_IWOTH 0000200 |
Definition at line 87 of file win32.h.
Referenced by check_path().
#define S_IWUSR 0000002 |
Definition at line 93 of file win32.h.
Referenced by check_path(), and tempnam_secure().
#define sleep | ( | x | ) | Sleep(x*1000) |
Definition at line 167 of file win32.h.
Referenced by main(), and metaserver2_thread().
#define socklen_t int /* Doesn't exist, just a plain int */ |
Definition at line 148 of file win32.h.
Referenced by do_server(), and init_connection().
#define strtok_r | ( | x, | |
y, | |||
z | |||
) | strtok(x, y) |
Definition at line 73 of file win32.h.
Referenced by matches(), and parse_dialog_information().
#define unlink | ( | __a | ) | _unlink(__a) |
Definition at line 67 of file win32.h.
Referenced by clean_tmp_map(), command_overlay_reset(), main(), map_remove_unique_files(), open_and_uncompress_file(), remove_directory(), resurrect_player(), save_map(), and save_player().
#define VERSION "1.9.1 (trunk) snapshot 20061229" |
Definition at line 16 of file win32.h.
Referenced by start_info().
#define vsnprintf _vsnprintf |
Definition at line 72 of file win32.h.
Referenced by draw_ext_info_format(), LOG(), set_exception(), SockList_AddPrintf(), and stringbuffer_append_printf().
#define WEXITSTATUS | ( | x | ) | x |
Definition at line 106 of file win32.h.
Referenced by open_and_uncompress_file().
#define WIFEXITED | ( | x | ) | 1 |
Definition at line 105 of file win32.h.
Referenced by open_and_uncompress_file().
int closedir | ( | DIR * | dp | ) |
Dispose of a directory handle.
dp | handle to free. Will become invalid. |
Definition at line 149 of file win32.c.
References DIR::dir, and DIR::handle.
Referenced by command_players(), find_maps(), help_topics(), initPlugins(), load_dir(), and remove_directory().
int gettimeofday | ( | struct timeval * | time_Info, |
struct timezone * | timezone_Info | ||
) |
Gets the time of the day.
[out] | time_Info | will receive the time of the day. |
[out] | timezone_Info | will receive the timezone info. |
Definition at line 54 of file win32.c.
References timezone::tz_dsttime, and timezone::tz_minuteswest.
Referenced by generate_random_map(), and ready_map_name().
DIR* opendir | ( | const char * | dir | ) |
Opens a directory for reading. The handle should be disposed through closedir().
dir | directory path. |
Definition at line 78 of file win32.c.
References DIR::dir, DIR::fileinfo, DIR::finished, DIR::handle, and DIR::offset.
Referenced by command_players(), find_maps(), help_topics(), 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 116 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(), 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 167 of file win32.c.
References DIR::dir, DIR::fileinfo, DIR::finished, DIR::handle, and DIR::offset.
void service_handle | ( | ) |
Service entry point.
Definition at line 384 of file win32.c.
References SERVICE_NAME, and ServiceMain().
void service_register | ( | ) |
Registers the server to the service manager.
Definition at line 221 of file win32.c.
References SERVICE_DESCRIPTION, SERVICE_DISPLAY, and SERVICE_NAME.
void service_unregister | ( | ) |
Removes the Crossfire service from the service manager.
Definition at line 266 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 434 of file porting.c.
References tolower.
Referenced by cast_create_missile(), command_kill_pets(), compare_map_info(), dump_monster_treasure(), find_ingred_cost(), find_treasure_by_name(), get_god_for_race(), get_region_from_string(), item_matched_string(), load_settings(), metaserver2_init(), name_cmp(), 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 402 of file porting.c.
References tolower.
Referenced by basic_emote(), examine(), find_player_partial_name(), find_skill_by_name(), init_experience(), item_matched_string(), learn_skill(), strcasestr_local(), 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 202 of file win32.c.
Referenced by server_main(), ServiceCtrlHandler(), and ServiceMain().