Remove types, while their implementation is not thought out.

This commit is contained in:
2018-04-01 00:18:53 -07:00
parent e6801255fa
commit 60d22c2511
3 changed files with 1 additions and 69 deletions

View File

@@ -1,28 +0,0 @@
#include "type.h"
#include "util.h"
#include <stdlib.h>
void _libab_type_free(void* type) {
free(((libab_type*) type)->name);
}
libab_result libab_type_create(libab_ref* ref, const char* name) {
libab_type* type;
libab_result result = LIBAB_SUCCESS;
if((type = malloc(sizeof(*type)))) {
result = libab_copy_string(&type->name, name);
} else {
result = LIBAB_MALLOC;
}
if(result == LIBAB_SUCCESS) {
result = libab_ref_new(ref, type, _libab_type_free);
if(result != LIBAB_SUCCESS) free(type->name);
}
if(result != LIBAB_SUCCESS) {
free(type);
}
return result;
}