crap-libs/exceptions/stdex.h

69 lines
2.5 KiB
C
Raw Normal View History

#ifndef STDEX_H
#define STDEX_H
2017-03-10 17:43:56 +00:00
#include "../oop.h"
2017-03-10 17:43:56 +00:00
2017-04-14 22:12:54 +00:00
//#define Exception construct(Exception)
2017-03-11 15:38:17 +00:00
extern class(Exception, Object_class, NO_INTERFACES, true) {
extends(Object_t);
2017-03-10 17:43:56 +00:00
const char* msg;
void (*destruct)(defclass Exception*);
} Exception_t;
2017-03-10 17:43:56 +00:00
void method(Exception, populate)(Exception_t*, class_t);
Exception_t* method(Exception, construct)(const char*);
2017-03-10 17:43:56 +00:00
2017-04-14 22:12:54 +00:00
//#define NullPointerException construct(NullPointerException)
2017-03-11 15:38:17 +00:00
extern class(NullPointerException, Exception_class, NO_INTERFACES, true) {
extends(Exception_t);
void (*destruct)(defclass NullPointerException*);
} NullPointerException_t;
void method(NullPointerException, populate)(NullPointerException_t*, class_t);
NullPointerException_t* method(NullPointerException, construct)(void);
2017-04-14 22:12:54 +00:00
//#define OutOfMemoryException construct(OutOfMemoryException)
2017-03-11 15:38:17 +00:00
extern class(OutOfMemoryException, Exception_class, NO_INTERFACES, true) {
extends(Exception_t);
void (*destruct)(defclass OutOfMemoryException*);
} OutOfMemoryException_t;
void method(OutOfMemoryException, populate)(OutOfMemoryException_t*, class_t);
OutOfMemoryException_t* method(OutOfMemoryException, construct)(void);
2017-04-14 22:12:54 +00:00
//#define IndexOutOfBoundsException construct(IndexOutOfBoundsException)
2017-03-12 00:18:08 +00:00
extern class(IndexOutOfBoundsException, Exception_class, NO_INTERFACES, true) {
extends(Exception_t);
void (*destruct)(defclass IndexOutOfBoundsException*);
} IndexOutOfBoundsException_t;
void method(IndexOutOfBoundsException, populate)(IndexOutOfBoundsException_t*, class_t);
IndexOutOfBoundsException_t* method(IndexOutOfBoundsException, construct)(size_t, size_t);
2017-04-14 22:12:54 +00:00
//#define IllegalArgumentException construct(IllegalArgumentException)
extern class(IllegalArgumentException, Exception_class, NO_INTERFACES, true) {
extends(Exception_t);
void (*destruct)(defclass IllegalArgumentException*);
} IllegalArgumentException_t;
void method(IllegalArgumentException, populate)(IllegalArgumentException_t*, class_t);
IllegalArgumentException_t* method(IllegalArgumentException, construct)(const char*);
2017-04-14 22:12:54 +00:00
//#define ClassNotInstanceableException construct(ClassNotInstanceableException)
extern class(ClassNotInstanceableException, Exception_class, NO_INTERFACES, true) {
extends(Exception_t);
void (*destruct)(defclass ClassNotInstanceableException*);
} ClassNotInstanceableException_t;
void method(ClassNotInstanceableException, populate)(ClassNotInstanceableException_t*, class_t);
ClassNotInstanceableException_t* method(ClassNotInstanceableException, construct)(const char*);
2017-03-10 17:43:56 +00:00
#endif