commit | author | age
|
d7639a
|
1 |
#include<stdio.h> |
SP |
2 |
#include<stdlib.h> |
|
3 |
#include "general.h" |
|
4 |
#include<stdarg.h> |
|
5 |
|
a10dd5
|
6 |
ts_uint ts_fprintf(FILE *fd, char *fmt, ...){ |
d7639a
|
7 |
if(quiet) return TS_SUCCESS; |
a10dd5
|
8 |
va_list ap; |
SP |
9 |
va_start(ap,fmt); |
|
10 |
vfprintf(fd, fmt, ap); /* Call vfprintf */ |
d7639a
|
11 |
va_end(ap); /* Cleanup the va_list */ |
SP |
12 |
return TS_SUCCESS; |
|
13 |
} |
|
14 |
|
|
15 |
void err(char *text){ |
|
16 |
ts_fprintf(stderr,"Err: %s\n", text); |
|
17 |
} |
|
18 |
|
|
19 |
void fatal(char *text, ts_int errcode){ |
|
20 |
ts_fprintf(stderr,"Fatal: %s. TERMINATED!\n", text); |
|
21 |
exit(errcode); |
|
22 |
} |
|
23 |
|
|
24 |
|