Add exception_init and exception_free
This commit is contained in:
parent
ea37ce1732
commit
208cb375e1
@ -1 +1,16 @@
|
||||
#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);
|
||||
}
|
||||
|
@ -15,6 +15,12 @@ typedef struct exception_t {
|
||||
char *msg;
|
||||
} exception_t;
|
||||
|
||||
exception_t*
|
||||
exception_init();
|
||||
|
||||
void
|
||||
exception_free(exception_t *e);
|
||||
|
||||
char*
|
||||
exception_str(exception_t *e);
|
||||
|
||||
|
Reference in New Issue
Block a user