UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
system.h
Go to the documentation of this file.
1 
6 /*
7 All original material Copyright (C) 2002-2020 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 #include "../shared/cxx.h"
29 #include "../common/list.h"
30 #include <stdio.h>
31 
32 /*
33 ==============================================================
34 NON-PORTABLE SYSTEM SERVICES
35 ==============================================================
36 */
37 
38 struct qFILE_s;
39 
40 void Sys_Init(void);
41 void Sys_NormPath(char* path);
42 void Sys_Sleep(int milliseconds);
43 const char* Sys_GetCurrentUser(void);
44 int Sys_Setenv(const char* name, const char* value);
45 void Sys_InitSignals(void);
46 const char* Sys_SetLocale(const char* localeID);
47 const char* Sys_GetLocale(void);
48 
49 const char* Sys_ConsoleInput(void);
50 void Sys_ConsoleOutput(const char* string);
51 void Sys_Error(const char* error, ...) __attribute__((noreturn, format(__printf__, 1, 2)));
52 void Sys_Quit(void);
53 char* Sys_GetHomeDirectory(void);
54 
55 void Sys_ConsoleShutdown(void);
56 void Sys_ConsoleInit(void);
57 void Sys_ShowConsole(bool show);
58 
59 /* pass in an attribute mask of things you wish to REJECT */
60 char* Sys_FindFirst(const char* path, unsigned musthave, unsigned canthave);
61 char* Sys_FindNext(unsigned musthave, unsigned canthave);
62 void Sys_FindClose(void);
63 void Sys_ListFilteredFiles(const char* basedir, const char* subdirs, const char* filter, linkedList_t** list);
64 void Sys_Mkdir(const char* path);
65 void Sys_Mkfifo(const char* ospath, struct qFILE_s* f);
66 char* Sys_Cwd(void);
68 int Sys_Milliseconds(void);
69 void Sys_Backtrace(void);
70 void Sys_Breakpoint(void);
71 void Sys_OpenURL(const char* url);
72 FILE* Sys_Fopen(const char* filename, const char* mode);
73 int Sys_Remove (const char* filename);
74 int Sys_Rename (const char* oldname, const char* newname);
75 int Sys_Access (const char* filename, int mode);
char * Sys_GetHomeDirectory(void)
Returns the home environment variable (which hold the path of the user's homedir) ...
Definition: unix_files.cpp:45
void Sys_Backtrace(void)
On platforms supporting it, print a backtrace.
void Sys_Mkdir(const char *path)
Definition: unix_files.cpp:208
void Sys_ConsoleOutput(const char *string)
void Sys_SetAffinityAndPriority(void)
int Sys_Setenv(const char *name, const char *value)
set/unset environment variables (empty value removes it)
Definition: unix_shared.cpp:60
void Sys_ConsoleShutdown(void)
Shutdown the console.
const char * filename
Definition: ioapi.h:41
int Sys_Rename(const char *oldname, const char *newname)
Definition: unix_files.cpp:250
const char * Sys_SetLocale(const char *localeID)
Definition: win_shared.cpp:147
#define FILE
Definition: test_webapi.cpp:30
#define __attribute__(x)
Definition: cxx.h:37
void Sys_InitSignals(void)
const char * Sys_GetCurrentUser(void)
Get current user.
char * Sys_FindFirst(const char *path, unsigned musthave, unsigned canthave)
Opens the directory and returns the first file that matches our searchrules.
Definition: unix_files.cpp:87
void Sys_Sleep(int milliseconds)
Calls the win32 sleep function.
Definition: unix_shared.cpp:68
const char * Sys_ConsoleInput(void)
Handles input for the console window.
void Sys_Init(void)
int Sys_Remove(const char *filename)
Definition: unix_files.cpp:245
void Sys_FindClose(void)
Closes the find handle.
Definition: unix_files.cpp:142
void Sys_ShowConsole(bool show)
void format(__printf__, 1, 2)))
const char * Sys_GetLocale(void)
Definition: win_shared.cpp:156
QGL_EXTERN GLfloat f
Definition: r_gl.h:114
void Sys_Mkfifo(const char *ospath, struct qFILE_s *f)
Definition: unix_files.cpp:217
void Sys_OpenURL(const char *url)
char * Sys_FindNext(unsigned musthave, unsigned canthave)
Returns the next file of the already opened directory (Sys_FindFirst) that matches our search mask...
Definition: unix_files.cpp:125
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
const char int mode
Definition: ioapi.h:41
FILE * Sys_Fopen(const char *filename, const char *mode)
Definition: unix_files.cpp:240
int Sys_Access(const char *filename, int mode)
Definition: unix_files.cpp:255
void Sys_ConsoleInit(void)
Initialize the console input (tty mode if possible)
char * Sys_Cwd(void)
Get current working dir.
Definition: unix_files.cpp:197
void Sys_NormPath(char *path)
Normalize path (remove all \ )
Definition: unix_files.cpp:50
void Sys_ListFilteredFiles(const char *basedir, const char *subdirs, const char *filter, linkedList_t **list)
Definition: unix_files.cpp:151
void Sys_Error(const char *error,...) __attribute__((noreturn
void Sys_Breakpoint(void)
Definition: unix_shared.cpp:84
int Sys_Milliseconds(void)
Definition: unix_shared.cpp:41
void Sys_Quit(void)