summaryrefslogtreecommitdiff
path: root/src/loader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/loader.c')
-rw-r--r--src/loader.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/loader.c b/src/loader.c
index de28df9..d3cce84 100644
--- a/src/loader.c
+++ b/src/loader.c
@@ -1,11 +1,16 @@
+#include "loader.h"
+
#include "SDL/SDL_stdinc.h"
#include "SDL/SDL_image.h"
-#include "loader.h"
+
+#include "parser.h"
#include "graphic.h"
#include "utils.h"
#define PATH_STYLE "../styles"
+extern FILE *yyin;
+
int loadRessources(gameIni_t *gIni, gameRess_t *gRess) {
int i, filenamelen;
char *filepath;
@@ -69,3 +74,16 @@ int loadRessources(gameIni_t *gIni, gameRess_t *gRess) {
free(filepath);
return 0;
}
+
+int loadIni(gameIni_t *gIni, char *filepath) {
+ int res;
+
+ yyin=fopen(filepath, "r");
+ if (yyin == NULL ) {
+ fprintf(stderr, "load_ini(), Could not open '%s'\n", filepath);
+ return 1;
+ }
+ res=parse(gIni);
+ fclose(yyin);
+ return res;
+}