taniwha, please have a look at this to make sure I'm doing it the "right"

way..  Sys_Printf is now Sys_StdPrintf for now.  Sys_Printf is a function
pointer and will end up replacing Con_Printf as well.  Names will change
to something intelligent when I'm done.  Win32 is not yet touched, but I
haven't forgotten it.

The reason for this is the assumption that Con_Printf and Sys_Printf do
not overlap.  The new server console WILL change that, requiring that we
change how we handle both functions.  The plan:  Default to using stubs
and swap them for full-featured functions on Console init which do all
the things we expect.  Will also do a stderr version later.
This commit is contained in:
Joseph Carter 2001-07-02 18:11:34 +00:00
parent 8bff65bbd2
commit eb71edb5d4
6 changed files with 17 additions and 20 deletions

View file

@ -36,7 +36,9 @@ extern struct cvar_s *sys_nostdout;
int Sys_FileTime (const char *path);
void Sys_mkdir (const char *path);
void Sys_Printf (const char *fmt, ...) __attribute__((format(printf,1,2)));
//void Sys_Printf (const char *fmt, ...) __attribute__((format(printf,1,2)));
extern void (*Sys_Printf) (const char *fmt, ...);
void Sys_StdPrintf (const char *fmt, ...) __attribute__((format(printf,1,2)));
void Sys_Error (const char *error, ...) __attribute__((format(printf,1,2)));
void Sys_Quit (void);
double Sys_DoubleTime (void);

View file

@ -139,10 +139,10 @@ Sys_FileTime (const char *path)
}
/*
Sys_Printf
Sys_StdPrintf
*/
void
Sys_Printf (const char *fmt, ...)
Sys_StdPrintf (const char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];

View file

@ -170,6 +170,8 @@ Sys_LowFPPrecision (void)
#endif
void (*Sys_Printf) (const char *fmt, ...);
int
main (int c, char *v[])
{
@ -182,6 +184,8 @@ main (int c, char *v[])
signal (SIGFPE, SIG_IGN);
Sys_Printf = Sys_StdPrintf;
memset (&parms, 0, sizeof (parms));
COM_InitArgv (c, v);

View file

@ -301,23 +301,8 @@ Sys_Error (const char *error, ...)
exit (1);
}
/*FIXME?
void
Sys_Printf (const char *fmt, ...)
{
va_list argptr;
char text[1024];
DWORD dummy;
if (isDedicated) {
va_start (argptr, fmt);
vsnprintf (text, sizeof (text), fmt, argptr);
va_end (argptr);
WriteFile (houtput, text, strlen (text), &dummy, NULL);
}
}
*/
void
Sys_Quit (void)
{

View file

@ -180,12 +180,12 @@ Sys_LowFPPrecision (void)
}
#endif
void (*Sys_Printf) (const char *fmt, ...);
int skipframes;
int
main (int c, char **v)
main (int c, char *v[])
{
double time, oldtime, newtime;
int j;
@ -195,6 +195,8 @@ main (int c, char **v)
// signal(SIGFPE, floating_point_exception_handler);
signal (SIGFPE, SIG_IGN);
Sys_Printf = Sys_StdPrintf;
memset (&host_parms, 0, sizeof (host_parms));
COM_InitArgv (c, v);

View file

@ -155,6 +155,8 @@ Sys_Init (void)
#endif
}
void (*Sys_Printf) (const char *fmt, ...);
/*
main
*/
@ -166,6 +168,8 @@ main (int argc, char *argv[])
extern int net_socket;
int j;
Sys_Printf = Sys_StdPrintf;
memset (&host_parms, 0, sizeof (host_parms));
COM_InitArgv (argc, argv);