eolian gen2: initial stubs for source writing
This commit is contained in:
parent
f8ede73bf9
commit
34c2bf66ce
|
@ -78,6 +78,8 @@ bin_eolian2_eolian_gen2_SOURCES = \
|
|||
bin/eolian2/types.h \
|
||||
bin/eolian2/headers.c \
|
||||
bin/eolian2/headers.h \
|
||||
bin/eolian2/sources.c \
|
||||
bin/eolian2/sources.h \
|
||||
bin/eolian2/docs.c \
|
||||
bin/eolian2/docs.h
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "main.h"
|
||||
#include "types.h"
|
||||
#include "headers.h"
|
||||
#include "sources.h"
|
||||
|
||||
int _eolian_gen_log_dom = -1;
|
||||
|
||||
|
@ -262,6 +263,7 @@ _write_header(const char *ofname, const char *ifname, Eina_Bool legacy)
|
|||
}
|
||||
}
|
||||
|
||||
eina_strbuf_free(buf);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
@ -292,14 +294,21 @@ static Eina_Bool
|
|||
_write_source(const char *ofname, const char *ifname)
|
||||
{
|
||||
INF("generating source: %s", ofname);
|
||||
Eina_Strbuf *ebuf = eina_strbuf_new(),
|
||||
*lbuf = eina_strbuf_new();
|
||||
Eina_Strbuf *buf = eina_strbuf_new();
|
||||
|
||||
Eina_Bool ret = _write_file(ofname, ebuf, EINA_FALSE) &&
|
||||
_write_file(ofname, lbuf, EINA_TRUE);
|
||||
eina_strbuf_free(ebuf);
|
||||
eina_strbuf_free(lbuf);
|
||||
return ret;
|
||||
const Eolian_Class *cl = eolian_class_get_by_file(ifname);
|
||||
eo_gen_source_gen(cl, buf);
|
||||
if (cl)
|
||||
{
|
||||
if (_write_file(ofname, buf, EINA_FALSE))
|
||||
{
|
||||
eina_strbuf_free(buf);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
eina_strbuf_free(buf);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#include "main.h"
|
||||
#include "docs.h"
|
||||
|
||||
void
|
||||
eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
|
||||
{
|
||||
if (!cl)
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef EOLIAN_GEN_SOURCES_H
|
||||
#define EOLIAN_GEN_SOURCES_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue