|
UFO: Alien Invasion
|
Windows shared functions. More...
#include "../../common/common.h"#include "win_local.h"#include <fcntl.h>#include <direct.h>#include <io.h>#include <conio.h>#include <mmsystem.h>#include <shellapi.h>
Go to the source code of this file.
Macros | |
| #define | MAX_FOUND_FILES 0x1000 |
Functions | |
| static void | Sys_Utf8ToUtf16 (const char *source, LPWSTR dest, size_t destlen) |
| static void | Sys_Utf16ToUtf8 (const LPWSTR source, char *dest, size_t destsize) |
| int | Sys_Milliseconds (void) |
| void | Sys_Mkdir (const char *path) |
| void | Sys_Breakpoint (void) |
| const char * | Sys_SetLocale (const char *localeID) |
| const char * | Sys_GetLocale (void) |
| static bool | CompareAttributes (unsigned found, unsigned musthave, unsigned canthave) |
| char * | Sys_FindFirst (const char *path, unsigned musthave, unsigned canthave) |
| Opens the directory and returns the first file that matches our searchrules. | |
| char * | Sys_FindNext (unsigned musthave, unsigned canthave) |
| Returns the next file of the already opened directory (Sys_FindFirst) that matches our search mask. | |
| void | Sys_FindClose (void) |
| Closes the find handle. | |
| void | Sys_ListFilteredFiles (const char *basedir, const char *subdirs, const char *filter, linkedList_t **list) |
| void | Sys_Quit (void) |
| const char * | Sys_GetCurrentUser (void) |
| Get current user. | |
| char * | Sys_Cwd (void) |
| Get current working dir. | |
| void | Sys_NormPath (char *path) |
| Normalize path (remove all \ ). | |
| char * | Sys_GetHomeDirectory (void) |
| Get the home directory in Application Data. | |
| void | Sys_Sleep (int milliseconds) |
| Calls the win32 sleep function. | |
| int | Sys_Setenv (const char *name, const char *value) |
| set/unset environment variables (empty value removes it) | |
| void | Sys_InitSignals (void) |
| void | Sys_Mkfifo (const char *ospath, qFILE *f) |
| void | Sys_OpenURL (const char *url) |
| FILE * | Sys_Fopen (const char *filename, const char *mode) |
| int | Sys_Remove (const char *filename) |
| int | Sys_Rename (const char *oldname, const char *newname) |
| int | Sys_Access (const char *filename, int mode) |
Variables | |
| HINSTANCE | global_hInstance |
| static char | findbase [MAX_OSPATH] |
| static char | findpath [MAX_OSPATH] |
| static char | findname [MAX_OSPATH] |
| static WCHAR | wfindpath [MAX_OSPATH] |
| static intptr_t | findhandle |
Windows shared functions.
Definition in file win_shared.cpp.
| #define MAX_FOUND_FILES 0x1000 |
Definition at line 270 of file win_shared.cpp.
|
static |
Definition at line 171 of file win_shared.cpp.
References SFF_ARCH, SFF_HIDDEN, SFF_RDONLY, SFF_SUBDIR, and SFF_SYSTEM.
Referenced by Sys_FindFirst(), and Sys_FindNext().
Definition at line 546 of file win_shared.cpp.
References lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().
Referenced by FS_FileExists(), and Sys_SetAffinityAndPriority().
Definition at line 71 of file win_shared.cpp.
Referenced by Com_BreakIntoDebugger(), and Sys_SetAffinityAndPriority().
| char * Sys_Cwd | ( | void | ) |
Get current working dir.
Definition at line 404 of file win_shared.cpp.
References lengthof, MAX_OSPATH, and Sys_Utf16ToUtf8().
Referenced by FS_GetCwd(), and Sys_Mkfifo().
Closes the find handle.
Definition at line 263 of file win_shared.cpp.
References fdir, and findhandle.
Referenced by format(), and FS_ListFiles().
| char * Sys_FindFirst | ( | const char * | path, |
| unsigned | musthave, | ||
| unsigned | canthave ) |
Opens the directory and returns the first file that matches our searchrules.
Definition at line 202 of file win_shared.cpp.
References Com_FilePath(), Com_Filter(), Com_sprintf(), CompareAttributes(), CompareAttributes(), fdir, findbase, findhandle, findname, findpath, findpattern, lengthof, Q_streq, Q_strncpyz(), Sys_Error(), Sys_Utf16ToUtf8(), Sys_Utf8ToUtf16(), and wfindpath.
Referenced by format(), and FS_ListFiles().
| char * Sys_FindNext | ( | unsigned | musthave, |
| unsigned | canthave ) |
Returns the next file of the already opened directory (Sys_FindFirst) that matches our search mask.
Definition at line 236 of file win_shared.cpp.
References Com_Filter(), Com_sprintf(), CompareAttributes(), CompareAttributes(), fdir, findbase, findhandle, findname, findpath, findpattern, Q_streq, and Sys_Utf16ToUtf8().
Referenced by format(), and FS_ListFiles().
| FILE * Sys_Fopen | ( | const char * | filename, |
| const char * | mode ) |
Definition at line 521 of file win_shared.cpp.
References FILE, lengthof, MAX_OSPATH, MAX_VAR, and Sys_Utf8ToUtf16().
Referenced by CL_CheckAndQueueDownload(), CL_StartHTTPDownload(), fopen_file_func(), FS_CopyFile(), FS_OpenFile(), main(), SV_InitGameProgs(), Sys_Backtrace(), and Sys_SetAffinityAndPriority().
| const char * Sys_GetCurrentUser | ( | void | ) |
Get current user.
Definition at line 387 of file win_shared.cpp.
References lengthof, Q_strncpyz(), and Sys_Utf16ToUtf8().
| char * Sys_GetHomeDirectory | ( | void | ) |
Get the home directory in Application Data.
Returns the home environment variable (which hold the path of the user's homedir).
Definition at line 439 of file win_shared.cpp.
References Com_Printf(), Q_strcat(), Sys_Utf16ToUtf8(), and Sys_Utf8ToUtf16().
Referenced by format(), and FS_GetHomeDirectory().
| const char * Sys_GetLocale | ( | void | ) |
Definition at line 156 of file win_shared.cpp.
Referenced by CL_LanguageInit().
Definition at line 508 of file win_shared.cpp.
Referenced by main(), and Qcommon_Init().
| void Sys_ListFilteredFiles | ( | const char * | basedir, |
| const char * | subdirs, | ||
| const char * | filter, | ||
| linkedList_t ** | list ) |
Definition at line 272 of file win_shared.cpp.
References Com_Filter(), Com_sprintf(), findhandle, findname, lengthof, LIST_AddString(), MAX_OSPATH, Q_strcasecmp, Sys_ListFilteredFiles(), Sys_Utf16ToUtf8(), Sys_Utf8ToUtf16(), and wfindpath.
Referenced by format(), FS_BuildFileList(), and Sys_ListFilteredFiles().
Definition at line 53 of file win_shared.cpp.
Referenced by CL_Frame(), CL_InitLocal(), Qcommon_Frame(), Schedule_Timer(), SCR_TimeRefresh_f(), CampaignTest::SetUpTestCase(), SV_InitGameProgs(), SVC_BucketForAddress(), SVC_RateLimit(), Sys_SetAffinityAndPriority(), TEST_F(), TEST_F(), RandomMapAssemblyTest::testAssembly(), GameTest::testCountSpawnpointsForMapInMultiplayerMode(), GameTest::testCountSpawnpointsForMapInSingleplayerMode(), and tick_timer().
| void Sys_Mkdir | ( | const char * | path | ) |
Definition at line 64 of file win_shared.cpp.
References Com_Printf(), lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().
Referenced by format(), and FS_CreatePath().
Definition at line 512 of file win_shared.cpp.
References f.
| void Sys_NormPath | ( | char * | path | ) |
Normalize path (remove all \ ).
Definition at line 420 of file win_shared.cpp.
Referenced by FS_NormPath().
| void Sys_OpenURL | ( | const char * | url | ) |
Definition at line 516 of file win_shared.cpp.
References Com_sprintf().
Referenced by CL_OpenURL_f(), and Sys_SetAffinityAndPriority().
Definition at line 310 of file win_shared.cpp.
References CL_Shutdown(), Mem_Shutdown(), and Qcommon_Shutdown().
| int Sys_Remove | ( | const char * | filename | ) |
Definition at line 530 of file win_shared.cpp.
References lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().
Referenced by CL_HTTP_Cleanup(), FS_RemoveFile(), FS_WriteFile(), and Sys_SetAffinityAndPriority().
| int Sys_Rename | ( | const char * | oldname, |
| const char * | newname ) |
Definition at line 537 of file win_shared.cpp.
References lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().
Referenced by FS_RenameFile(), and Sys_SetAffinityAndPriority().
| int Sys_Setenv | ( | const char * | name, |
| const char * | value ) |
set/unset environment variables (empty value removes it)
Definition at line 496 of file win_shared.cpp.
References name.
Referenced by CL_Env_f(), CL_LanguageTest(), Rimp_Init(), and Sys_SetLocale().
| const char * Sys_SetLocale | ( | const char * | localeID | ) |
Definition at line 147 of file win_shared.cpp.
References Sys_Setenv().
Referenced by CL_LanguageTryToSet().
Calls the win32 sleep function.
Definition at line 484 of file win_shared.cpp.
References long().
Referenced by M_MusicStreamCallback(), NET_Wait(), R_RenderFrame(), R_RunThread(), and Sys_Error().
|
static |
Definition at line 47 of file win_shared.cpp.
Referenced by Sys_Cwd(), Sys_FindFirst(), Sys_FindNext(), Sys_GetCurrentUser(), Sys_GetHomeDirectory(), and Sys_ListFilteredFiles().
|
static |
Definition at line 41 of file win_shared.cpp.
Referenced by Sys_Access(), Sys_FindFirst(), Sys_Fopen(), Sys_GetHomeDirectory(), Sys_ListFilteredFiles(), Sys_Mkdir(), Sys_Remove(), and Sys_Rename().
|
static |
Definition at line 165 of file win_shared.cpp.
|
static |
Definition at line 169 of file win_shared.cpp.
Referenced by Sys_FindClose(), Sys_FindFirst(), Sys_FindNext(), and Sys_ListFilteredFiles().
|
static |
Definition at line 167 of file win_shared.cpp.
Referenced by FS_BuildFileList(), FS_CheckFile(), FS_GetMaps(), FS_ListFiles(), Sys_FindFirst(), Sys_FindNext(), and Sys_ListFilteredFiles().
|
static |
Definition at line 166 of file win_shared.cpp.
| HINSTANCE global_hInstance |
Definition at line 39 of file win_shared.cpp.
Referenced by Sys_ConsoleInit(), Sys_ConsoleShutdown(), and WinMain().
|
static |
Definition at line 168 of file win_shared.cpp.
Referenced by Sys_FindFirst(), and Sys_ListFilteredFiles().