22 lines
323 B
C
22 lines
323 B
C
#include <stdlib.h>
|
|
|
|
#include "exception_t.h"
|
|
|
|
exception_t*
|
|
exception_init() {
|
|
exception_t *e = (exception_t*) malloc(sizeof(exception_t));
|
|
e->type = NO_ERROR;
|
|
e->msg = NULL;
|
|
return e;
|
|
}
|
|
|
|
void
|
|
exception_free(exception_t *e) {
|
|
free(e);
|
|
}
|
|
|
|
int
|
|
exception_null(const exception_t *e) {
|
|
return e->type == NO_ERROR;
|
|
}
|