summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-09-22 15:58:06 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-10-07 11:54:23 +0200
commit34c2bf66ce0c08def79f905841376a5ab0c8e957 (patch)
treebb3dc77e817165d94f7de75bca82d087f7514033
parentf8ede73bf970dfda8273e65da75d9cba1a8a6450 (diff)
eolian gen2: initial stubs for source writing
-rw-r--r--src/Makefile_Eolian.am2
-rw-r--r--src/bin/eolian2/main.c23
-rw-r--r--src/bin/eolian2/sources.c9
-rw-r--r--src/bin/eolian2/sources.h8
4 files changed, 35 insertions, 7 deletions
diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am
index 472fa35bb1..e5b3fa4f38 100644
--- a/src/Makefile_Eolian.am
+++ b/src/Makefile_Eolian.am
@@ -78,6 +78,8 @@ bin_eolian2_eolian_gen2_SOURCES = \
78 bin/eolian2/types.h \ 78 bin/eolian2/types.h \
79 bin/eolian2/headers.c \ 79 bin/eolian2/headers.c \
80 bin/eolian2/headers.h \ 80 bin/eolian2/headers.h \
81 bin/eolian2/sources.c \
82 bin/eolian2/sources.h \
81 bin/eolian2/docs.c \ 83 bin/eolian2/docs.c \
82 bin/eolian2/docs.h 84 bin/eolian2/docs.h
83 85
diff --git a/src/bin/eolian2/main.c b/src/bin/eolian2/main.c
index 8a8a4a42bf..a2e0e34e1e 100644
--- a/src/bin/eolian2/main.c
+++ b/src/bin/eolian2/main.c
@@ -4,6 +4,7 @@
4#include "main.h" 4#include "main.h"
5#include "types.h" 5#include "types.h"
6#include "headers.h" 6#include "headers.h"
7#include "sources.h"
7 8
8int _eolian_gen_log_dom = -1; 9int _eolian_gen_log_dom = -1;
9 10
@@ -262,6 +263,7 @@ _write_header(const char *ofname, const char *ifname, Eina_Bool legacy)
262 } 263 }
263 } 264 }
264 265
266 eina_strbuf_free(buf);
265 return EINA_FALSE; 267 return EINA_FALSE;
266} 268}
267 269
@@ -292,14 +294,21 @@ static Eina_Bool
292_write_source(const char *ofname, const char *ifname) 294_write_source(const char *ofname, const char *ifname)
293{ 295{
294 INF("generating source: %s", ofname); 296 INF("generating source: %s", ofname);
295 Eina_Strbuf *ebuf = eina_strbuf_new(), 297 Eina_Strbuf *buf = eina_strbuf_new();
296 *lbuf = eina_strbuf_new();
297 298
298 Eina_Bool ret = _write_file(ofname, ebuf, EINA_FALSE) && 299 const Eolian_Class *cl = eolian_class_get_by_file(ifname);
299 _write_file(ofname, lbuf, EINA_TRUE); 300 eo_gen_source_gen(cl, buf);
300 eina_strbuf_free(ebuf); 301 if (cl)
301 eina_strbuf_free(lbuf); 302 {
302 return ret; 303 if (_write_file(ofname, buf, EINA_FALSE))
304 {
305 eina_strbuf_free(buf);
306 return EINA_TRUE;
307 }
308 }
309
310 eina_strbuf_free(buf);
311 return EINA_FALSE;
303} 312}
304 313
305static Eina_Bool 314static Eina_Bool
diff --git a/src/bin/eolian2/sources.c b/src/bin/eolian2/sources.c
new file mode 100644
index 0000000000..f50db7b927
--- /dev/null
+++ b/src/bin/eolian2/sources.c
@@ -0,0 +1,9 @@
1#include "main.h"
2#include "docs.h"
3
4void
5eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
6{
7 if (!cl)
8 return;
9}
diff --git a/src/bin/eolian2/sources.h b/src/bin/eolian2/sources.h
new file mode 100644
index 0000000000..3a002210d7
--- /dev/null
+++ b/src/bin/eolian2/sources.h
@@ -0,0 +1,8 @@
1#ifndef EOLIAN_GEN_SOURCES_H
2#define EOLIAN_GEN_SOURCES_H
3
4#include "main.h"
5
6void eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf);
7
8#endif