@@ -1,27 +1,18 @@ #ifndef KIcore #define KIcore + #include -#include -#include -#include -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct kvar { - ksraw name; - ksraw val; - char* platform; -} kvar; - -typedef struct kenv { - kiochan std; - kiochan err; - sz argc; const char** args; - sz varc; kvar* vars; -} kenv; +typedef u16 kcond; +/* this will probably not need to be altered, + * as libk sports a modest number of modules, + * and there are few enough error conditions + * in each that 16-bit address space should + * be more than enough for the foreseeable + * future. however if that changes, altering + * the definition here will effect all the + * necessary changes throughout the library */ /* i'm really sorry okay */ typedef #if (__STDC_VERSION__ >= 199901L) @@ -39,8 +30,10 @@ #if !(__STDC_VERSION__ >= 199901L) bool /* } bool ; */ #endif ; + +bool kokay(kcond); #ifndef KFclean # include # define Kokay(cond) (((cond) % kglobal_module_offset) == 0) @@ -149,25 +142,35 @@ #else void kstop(stat_long code); #endif -typedef u16 kcond; -/* this will probably not need to be altered, - * as libk sports a modest number of modules, - * and there are few enough error conditions - * in each that 16-bit address space should - * be more than enough for the foreseeable - * future. however if that changes, altering - * the definition here will effect all the - * necessary changes throughout the library */ -bool kokay(kcond); - typedef struct kerror { const char* module_name, * module_desc, * error_string; kcond cond; } kerror; + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct kvar { + ksraw name; + ksraw val; + char* platform; +} kvar; + +typedef struct kenv { + kiochan std; + kiochan err; + sz argc; const char** args; + sz varc; kvar* vars; +} kenv; kerror kexplain(kcond); #ifdef __cplusplus