UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
linux_main.cpp
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 1997-2001 Id Software, Inc.
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 #include <fcntl.h>
27 #include <unistd.h>
28 
29 #include "../../common/common.h"
30 #include "../system.h"
31 
32 /* ======================================================================= */
33 /* General routines */
34 /* ======================================================================= */
35 
36 void Sys_Init (void)
37 {
38  sys_os = Cvar_Get("sys_os", "linux", CVAR_SERVERINFO);
39  sys_affinity = Cvar_Get("sys_affinity", "0", CVAR_ARCHIVE);
40  sys_priority = Cvar_Get("sys_priority", "0", CVAR_ARCHIVE, "Process nice level");
41 }
42 
47 int main (int argc, char** argv)
48 {
50  Qcommon_Init(argc, argv);
51 
52  fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL, 0) | FNDELAY);
53 
54  while (1)
55  Qcommon_Frame();
56 
57  return 0;
58 }
void Qcommon_Frame(void)
This is the function that is called directly from main()
Definition: common.cpp:1493
void Qcommon_Init(int argc, char **argv)
Init function.
Definition: common.cpp:1078
cvar_t * sys_affinity
Definition: common.cpp:60
void Sys_ConsoleInit(void)
Initialize the console input (tty mode if possible)
int main(int argc, char **argv)
The entry point for linux server and client. Initializes the program and calls Qcommon_Frame in an in...
Definition: linux_main.cpp:47
#define CVAR_ARCHIVE
Definition: cvar.h:40
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags, const char *desc)
Init or return a cvar.
Definition: cvar.cpp:342
void Sys_Init(void)
Definition: linux_main.cpp:36
cvar_t * sys_os
Definition: common.cpp:61
cvar_t * sys_priority
Definition: common.cpp:59
#define CVAR_SERVERINFO
Definition: cvar.h:42