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. More... | |
char * | Sys_FindNext (unsigned musthave, unsigned canthave) |
Returns the next file of the already opened directory (Sys_FindFirst) that matches our search mask. More... | |
void | Sys_FindClose (void) |
Closes the find handle. More... | |
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. More... | |
char * | Sys_Cwd (void) |
Get current working dir. More... | |
void | Sys_NormPath (char *path) |
Normalize path (remove all \ ) More... | |
char * | Sys_GetHomeDirectory (void) |
Get the home directory in Application Data. More... | |
void | Sys_Sleep (int milliseconds) |
Calls the win32 sleep function. More... | |
int | Sys_Setenv (const char *name, const char *value) |
set/unset environment variables (empty value removes it) More... | |
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().
Definition at line 71 of file win_shared.cpp.
Referenced by Com_BreakIntoDebugger().
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().
Closes the find handle.
Definition at line 263 of file win_shared.cpp.
Referenced by 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_sprintf(), CompareAttributes(), findpath, lengthof, Q_streq, Sys_Error(), Sys_Utf16ToUtf8(), and Sys_Utf8ToUtf16().
Referenced by 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_sprintf(), CompareAttributes(), findpath, Q_streq, and Sys_Utf16ToUtf8().
Referenced by FS_ListFiles().
FILE* Sys_Fopen | ( | const char * | filename, |
const char * | mode | ||
) |
Definition at line 521 of file win_shared.cpp.
References lengthof, MAX_OSPATH, MAX_VAR, and Sys_Utf8ToUtf16().
Referenced by CL_CheckAndQueueDownload(), CL_StartHTTPDownload(), fopen_file_func(), FS_CopyFile(), FS_OpenFile(), main(), SV_InitGameProgs(), and Sys_Backtrace().
const char* Sys_GetCurrentUser | ( | void | ) |
Get current user.
Definition at line 387 of file win_shared.cpp.
References lengthof, Q_strncpyz(), Sys_Utf16ToUtf8(), and user.
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 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(), lengthof, LIST_AddString(), MAX_OSPATH, Q_strcasecmp, Sys_Utf16ToUtf8(), and Sys_Utf8ToUtf16().
Referenced by FS_BuildFileList().
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(), 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 lengthof, MAX_OSPATH, and Sys_Utf8ToUtf16().
Referenced by FS_CreatePath().
Definition at line 512 of file win_shared.cpp.
Referenced by FS_CreateOpenPipeFile().
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.
Referenced by CL_OpenURL_f().
Definition at line 310 of file win_shared.cpp.
References CL_Shutdown(), Mem_Shutdown(), Qcommon_Shutdown(), and Sys_ConsoleShutdown().
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(), and FS_WriteFile().
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().
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.
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.
Referenced by M_MusicStreamCallback(), NET_Wait(), R_RenderFrame(), R_RunThread(), and Sys_Error().
|
static |
Definition at line 47 of file win_shared.cpp.
References len.
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.
References len.
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.
|
static |
Definition at line 167 of file win_shared.cpp.
|
static |
Definition at line 166 of file win_shared.cpp.
Referenced by Sys_FindFirst(), and Sys_FindNext().
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.