~kvik/lu9-lua

ref: 2978db7bc91bfc4a2b402d408fa59499e3ee35be lu9-lua/shim/shim.h -rw-r--r-- 2.3 KiB
2978db7bkvik shim: correct the size of status message buffer 1 year, 2 months ago
                                                                                
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef _SHIM_H_
#define _SHIM_H_

/** PLAN 9 **/
#ifndef nil
#include <u.h>
#include <libc.h>
#include <tos.h>
#endif

/** assert.h **/

/** ctype.h **/

/** errno.h **/
typedef int errno_t;
extern errno_t *priv_errno;
#define errno (*priv_errno)

/** float.h **/
#define FLT_ROUNDS	1
#define FLT_RADIX	2

#define FLT_DIG		6
#define FLT_EPSILON	1.19209290e-07
#define FLT_MANT_DIG	24
#define FLT_MAX		3.40282347e+38
#define FLT_MAX_10_EXP	38
#define FLT_MAX_EXP	128
#define FLT_MIN		1.17549435e-38
#define FLT_MIN_10_EXP	-37
#define FLT_MIN_EXP	-125

#define DBL_DIG		15
#define DBL_EPSILON	2.2204460492503131e-16
#define DBL_MANT_DIG	53
#define DBL_MAX		1.797693134862315708145e+308
#define DBL_MAX_10_EXP	308
#define DBL_MAX_EXP	1024
#define DBL_MIN		2.225073858507201383090233e-308
#define DBL_MIN_10_EXP	-307
#define DBL_MIN_EXP	-1021
#define LDBL_MANT_DIG	DBL_MANT_DIG
#define LDBL_EPSILON	DBL_EPSILON
#define LDBL_DIG	DBL_DIG
#define LDBL_MIN_EXP	DBL_MIN_EXP
#define LDBL_MIN	DBL_MIN
#define LDBL_MIN_10_EXP	DBL_MIN_10_EXP
#define LDBL_MAX_EXP	DBL_MAX_EXP
#define LDBL_MAX	DBL_MAX
#define LDBL_MAX_10_EXP	DBL_MAX_10_EXP

/** limits.h **/
#define CHAR_BIT	8
#define MB_LEN_MAX	4

#define UCHAR_MAX	0xff
#define USHRT_MAX	0xffff
#define UINT_MAX	0xffffffffU
#define ULONG_MAX	0xffffffffUL
#define ULLONG_MAX	0xffffffffffffffffULL

#define CHAR_MAX	SCHAR_MAX
#define SCHAR_MAX	0x7f
#define SHRT_MAX	0x7fff
#define INT_MAX		0x7fffffff
#define LONG_MAX	0x7fffffffL
#define LLONG_MAX	0x7fffffffffffffffLL

#define CHAR_MIN	SCHAR_MIN
#define SCHAR_MIN	(-SCHAR_MAX-1)
#define SHRT_MIN	(-SHRT_MAX-1)
#define INT_MIN		(-INT_MAX-1)
#define LONG_MIN	(-LONG_MAX-1)
#define LLONG_MIN	(-LLONG_MAX-1)

/** locale.h **/

/** math.h **/
#define HUGE_VAL Inf(1)

/** regex.h **/

/** setjmp.h **/

/** signal.h **/
typedef int sig_atomic_t;

/** stdarg.h **/

/** stdbool.h **/

/** stddef.h **/
#define NULL ((void*)0)

typedef long long ptrdiff_t;
typedef unsigned long long size_t;

/** stdio.h **/
#include "/sys/include/stdio.h"
FILE *popen(char*, char*);
int pclose(FILE*);

/** stdlib.h **/
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
void exit(int);

/** string.h **/
char *strerror(int);

#define strcoll strcmp

/** time.h **/
#define CLOCKS_PER_SEC 1000

typedef long clock_t;
typedef long time_t;

clock_t clock(void);
#define clock() (clock_t)(-1);

#endif /* _SHIM_H_ */