Differences From
Artifact [4d5847ec2c]:
1 1 #ifndef KIcore
2 2 #define KIcore
3 +
3 4 #include <k/type.h>
4 -#include <k/io.h>
5 -#include <k/str.h>
6 -#include <k/internal.egroup.h>
7 5
8 -#ifdef __cplusplus
9 -extern "C" {
10 -#endif
11 -
12 -typedef struct kvar {
13 - ksraw name;
14 - ksraw val;
15 - char* platform;
16 -} kvar;
17 -
18 -typedef struct kenv {
19 - kiochan std;
20 - kiochan err;
21 - sz argc; const char** args;
22 - sz varc; kvar* vars;
23 -} kenv;
6 +typedef u16 kcond;
7 +/* this will probably not need to be altered,
8 + * as libk sports a modest number of modules,
9 + * and there are few enough error conditions
10 + * in each that 16-bit address space should
11 + * be more than enough for the foreseeable
12 + * future. however if that changes, altering
13 + * the definition here will effect all the
14 + * necessary changes throughout the library */
24 15
25 16 /* i'm really sorry okay */
26 17 typedef
27 18 #if (__STDC_VERSION__ >= 199901L)
28 19 _Bool bool;
29 20 #endif
30 21 enum
................................................................................
36 27 false = 0, no = 0,
37 28 true = 1, yes = 1
38 29 }
39 30 #if !(__STDC_VERSION__ >= 199901L)
40 31 bool /* } bool ; */
41 32 #endif
42 33 ;
34 +
35 +bool kokay(kcond);
43 36
44 37 #ifndef KFclean
45 38 # include <k/internal.egroup.h>
46 39 # define Kokay(cond) (((cond) % kglobal_module_offset) == 0)
47 40 # if (__STDC_VERSION__ >= 199901L) ||\
48 41 (__cplusplus >= 201103L)
49 42 # define KVvm_args __VA_ARGS__
................................................................................
146 139 [[noreturn]] void kstop(stat_long code);
147 140 #elif __STDC_VERSION__ >= 201103L
148 141 _Noreturn void kstop(stat_long code);
149 142 #else
150 143 void kstop(stat_long code);
151 144 #endif
152 145
153 -typedef u16 kcond;
154 -/* this will probably not need to be altered,
155 - * as libk sports a modest number of modules,
156 - * and there are few enough error conditions
157 - * in each that 16-bit address space should
158 - * be more than enough for the foreseeable
159 - * future. however if that changes, altering
160 - * the definition here will effect all the
161 - * necessary changes throughout the library */
162 -bool kokay(kcond);
163 -
164 146 typedef struct kerror {
165 147 const char* module_name,
166 148 * module_desc,
167 149 * error_string;
168 150 kcond cond;
169 151 } kerror;
152 +
153 +#include <k/io.h>
154 +#include <k/str.h>
155 +#include <k/internal.egroup.h>
156 +
157 +#ifdef __cplusplus
158 +extern "C" {
159 +#endif
160 +
161 +typedef struct kvar {
162 + ksraw name;
163 + ksraw val;
164 + char* platform;
165 +} kvar;
166 +
167 +typedef struct kenv {
168 + kiochan std;
169 + kiochan err;
170 + sz argc; const char** args;
171 + sz varc; kvar* vars;
172 +} kenv;
170 173
171 174 kerror kexplain(kcond);
172 175
173 176 #ifdef __cplusplus
174 177 }
175 178 #endif
176 179
177 180 #endif