10 qboolean sys_nostdout = false;
12 static char sys_timestring[128];
13 char *Sys_TimeString(const char *timeformat)
15 time_t mytime = time(NULL);
16 strftime(sys_timestring, sizeof(sys_timestring), timeformat, localtime(&mytime));
17 return sys_timestring;
21 extern qboolean host_shuttingdown;
24 host_shuttingdown = true;
29 char engineversion[128];
31 void Sys_Shared_EarlyInit(void)
40 #if defined(__linux__)
44 #elif defined(__FreeBSD__)
46 #elif defined(__NetBSD__)
48 #elif defined(__OpenBSD__)
53 snprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
55 // COMMANDLINEOPTION: Console: -nostdout disables text output to the terminal the game was launched from
56 if (COM_CheckParm("-nostdout"))
59 Con_Printf("%s\n", engineversion);
62 void Sys_Shared_LateInit(void)
67 ===============================================================================
71 ===============================================================================
74 qboolean Sys_LoadLibrary (const char* dllname, dllhandle_t* handle, const dllfunction_t *fcts)
76 const dllfunction_t *func;
77 dllhandle_t dllhandle;
83 for (func = fcts; func && func->name != NULL; func++)
84 *func->funcvariable = NULL;
88 dllhandle = LoadLibrary (dllname);
90 dllhandle = dlopen (dllname, RTLD_LAZY);
94 Con_Printf ("Can't load \"%s\".\n", dllname);
98 // Get the function adresses
99 for (func = fcts; func && func->name != NULL; func++)
100 if (!(*func->funcvariable = (void *) Sys_GetProcAddress (dllhandle, func->name)))
102 Con_Printf ("Missing function \"%s\" - broken library!\n", func->name);
103 Sys_UnloadLibrary (&dllhandle);
108 Con_Printf("\"%s\" loaded.\n", dllname);
112 void Sys_UnloadLibrary (dllhandle_t* handle)
114 if (handle == NULL || *handle == NULL)
118 FreeLibrary (*handle);
126 void* Sys_GetProcAddress (dllhandle_t handle, const char* name)
129 return (void *)GetProcAddress (handle, name);
131 return (void *)dlsym (handle, name);