#ifndef ka_error_h
#define ka_error_h

#include <stdarg.h>
#include "kernel.h"

#define ka_error_t _kernel_oserror
#define ka_error_nomem "error8"

char* report_vstring(char* str, int len, const char *format, va_list arg);
#ifdef __CC_NORCROFT
#pragma -v1 // hint to the compiler to check f/s/printf format
#endif
ka_error_t* ka_error_fill(ka_error_t* error_block, const char* format, ...);
void report_error(int fatal, const char* format, ...);
char* report_string(char* str, int len, const char* format, ...);
#ifdef __CC_NORCROFT
#pragma -v0 // return to default
#endif

void report_error_block(const ka_error_t* error);
void report_lasterror(void);

int rm_version(const char* name);
int rm_ensure(ka_error_t* error_block, const char* name, int vers, const char* path);

#endif
