-
Notifications
You must be signed in to change notification settings - Fork 1
/
Sys.h
40 lines (29 loc) · 802 Bytes
/
Sys.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// MT, 2015oct26
#ifndef MT_SYS
#define MT_SYS
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
bool Sys_is_big_endian();
uint64_t Sys_get_posix_clock_time_ms();
/** Return "time" string.
*
* - Caller takes ownership of return value.
*/
char* Sys_create_time_str(bool const inDate, bool const inSeconds);
/** Return what is entered into stdin up to ENTER keypress.
*
* - Caller takes ownership of return value.
*/
char* Sys_get_stdin();
/** Print given (maybe formatted) string to stdout with leading time (and data and/or seconds, if wanted).
*
* - Automatically add '\n' ("line"..).
*/
void Sys_log_line(bool const inDate, bool const inSeconds, char const * const inStr, ...);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif //MT_SYS