version 1.2, 2015/04/20 18:10:09
|
version 1.3, 2015/04/20 18:19:49
|
|
|
#include "conf.h" | #include "conf.h" |
#include <stdlib.h> | #include <stdlib.h> |
#include <ctype.h> | #include <ctype.h> |
#include "io.h" |
#include <pal/format.h> |
|
#include <pal/file.h> |
| |
struct _Conf | struct _Conf |
{ | { |
|
|
Conf* self; | Conf* self; |
| |
/* Open file */ | /* Open file */ |
is = Fopen(path, "rb"); |
is = File_Open(path, "rb"); |
if (!is) | if (!is) |
return NULL; | return NULL; |
| |
/* Allocate self object */ | /* Allocate self object */ |
self = (Conf*)calloc(1, sizeof(Conf)); |
self = (Conf*)PAL_Calloc(1, sizeof(Conf)); |
if (!self) | if (!self) |
{ | { |
fclose(is); | fclose(is); |
|
|
if (self && self->is) | if (self && self->is) |
{ | { |
fclose(self->is); | fclose(self->is); |
free(self); |
PAL_Free(self); |
} | } |
} | } |