-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathal_c.h
103 lines (82 loc) · 1.34 KB
/
al_c.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
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
#ifndef __AL_C_H__
#define __AL_C_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <inttypes.h>
#include "al_obj.h"
#include "al_time.h"
#include "al_env.h"
typedef al_obj (*al_c_fnptr)(al_env env, al_obj obj, al_obj context);
typedef struct _al_c_int8
{
uint32_t error;
int8_t val;
} al_c_int8;
typedef struct _al_c_uint8
{
uint32_t error;
uint8_t val;
} al_c_uint8;
typedef struct _al_c_int16
{
uint32_t error;
int16_t val;
} al_c_int16;
typedef struct _al_c_uint16
{
uint32_t error;
uint16_t val;
} al_c_uint16;
typedef struct _al_c_int32
{
uint32_t error;
int32_t val;
} al_c_int32;
typedef struct _al_c_uint32
{
uint32_t error;
uint32_t val;
} al_c_uint32;
typedef struct _al_c_int64
{
uint32_t error;
int64_t val;
} al_c_int64;
typedef struct _al_c_uint64
{
uint32_t error;
uint64_t val;
} al_c_uint64;
typedef struct _al_c_float
{
uint32_t error;
float val;
} al_c_float;
typedef struct _al_c_double
{
uint32_t error;
double val;
} al_c_double;
typedef struct _al_c_ptr
{
uint32_t error;
char *val;
} al_c_ptr;
typedef struct _al_c_time
{
uint32_t error;
al_time val;
} al_c_time;
typedef struct _al_c_fn
{
uint32_t error;
al_c_fnptr val;
} al_c_fn;
#define al_c_create(type, val, error) (al_c_##type){error, val}
#define al_c_error(v) (v.error)
#define al_c_value(v) (v.val)
#ifdef __cplusplus
}
#endif
#endif