mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Return the previous sys print callbacks
This allows for temporary overrides.
This commit is contained in:
parent
52d54f98bf
commit
f8b1a3a89f
2 changed files with 8 additions and 4 deletions
|
@ -65,8 +65,8 @@ int Sys_mkdir (const char *path);
|
|||
typedef void (*sys_printf_t) (const char *fmt, va_list args) __attribute__((format(printf, 1, 0)));
|
||||
typedef void (*sys_error_t) (void *data);
|
||||
|
||||
void Sys_SetStdPrintf (sys_printf_t func);
|
||||
void Sys_SetErrPrintf (sys_printf_t func);
|
||||
sys_printf_t Sys_SetStdPrintf (sys_printf_t func);
|
||||
sys_printf_t Sys_SetErrPrintf (sys_printf_t func);
|
||||
|
||||
void Sys_PushErrorHandler (sys_error_t func, void *data);
|
||||
void Sys_PopErrorHandler (void);
|
||||
|
|
|
@ -240,16 +240,20 @@ Sys_FileExists (const char *path)
|
|||
for want of a better name, but it sets the function pointer for the
|
||||
actual implementation of Sys_Printf.
|
||||
*/
|
||||
VISIBLE void
|
||||
VISIBLE sys_printf_t
|
||||
Sys_SetStdPrintf (sys_printf_t func)
|
||||
{
|
||||
sys_printf_t prev = sys_std_printf_function;
|
||||
sys_std_printf_function = func;
|
||||
return prev;
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
VISIBLE sys_printf_t
|
||||
Sys_SetErrPrintf (sys_printf_t func)
|
||||
{
|
||||
sys_printf_t prev = sys_err_printf_function;
|
||||
sys_err_printf_function = func;
|
||||
return prev;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue