Archeus 0.0.0
A C library and game engine that focuses on documentation
Loading...
Searching...
No Matches
errno.h
Go to the documentation of this file.
1#ifndef ARC_STD_ERRNO_H_
2#define ARC_STD_ERRNO_H_
3
4#include <stdint.h>
5
6#define ARC_ERRNO_NULL -0x01
7#define ARC_ERRNO_DATA -0x02
8#define ARC_ERRNO_COPY -0x03
9#define ARC_ERRNO_EXISTS -0x04
10#define ARC_ERRNO_OVERFLOW -0x05
11#define ARC_ERRNO_INIT -0x06
12#define ARC_ERRNO_CONNECTION -0x07
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18extern int32_t arc_errno;
19
20#ifdef ARC_DEBUG
21 #include <stdio.h>
22 //this is handy to override for if they user is doing terminal output and wants to change where logs are sent
23 extern FILE *arc_errno_log_file;
24
25 #ifndef ARC_DEBUG_LOG_STREAM_OVERRIDE
26 //this functin will be called on start, handy to set the log file to stdout if it is not overrided
27 void __attribute__ ((constructor)) ARC_Errno_SetDefaultStream(void);
28 #endif // !ARC_DEBUG_LOG_STREAM_OVERRIDE
29#endif // !ARC_DEBUG
30
31#ifdef __cplusplus
32}
33#endif
34
35#ifdef ARC_DEBUG
36 #define ARC_DEBUG_LOG_ERROR(STR) fprintf(arc_errno_log_file, "[ERROR %d] " STR "\n", arc_errno)
37 #define ARC_DEBUG_LOG_ERROR_WITH_VARIABLES(STR, ...) fprintf(arc_errno_log_file, "[ERROR %d] " STR "\n", arc_errno, __VA_ARGS__)
38#else
39 #define ARC_DEBUG_LOG_ERROR(STR)
40 #define ARC_DEBUG_LOG_ERROR_WITH_VARIABLES(STR, ...)
41#endif // !ARC_DEBUG
42
43#endif // !ARC_STD_ERRNO_H_
int32_t arc_errno