summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-09-21 15:29:28 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-10-07 11:54:23 +0200
commitb105feebb327a44a4a3e6283bd52cd63e9a26aec (patch)
tree648a4e023da6ed3a1cc0205577fb847260d14f5a
parent2e067517036a59d97c45fe76cf3692238192742d (diff)
eolian gen2: add code to handle doxygen generation
-rw-r--r--src/Makefile_Eolian.am4
-rw-r--r--src/bin/eolian2/docs.c662
-rw-r--r--src/bin/eolian2/docs.h44
-rw-r--r--src/bin/eolian2/main.c4
-rw-r--r--src/bin/eolian2/main.h4
5 files changed, 713 insertions, 5 deletions
diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am
index af99b08447..472fa35bb1 100644
--- a/src/Makefile_Eolian.am
+++ b/src/Makefile_Eolian.am
@@ -77,7 +77,9 @@ bin_eolian2_eolian_gen2_SOURCES = \
77 bin/eolian2/types.c \ 77 bin/eolian2/types.c \
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/docs.c \
82 bin/eolian2/docs.h
81 83
82bin_eolian2_eolian_gen2_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EOLIAN_CFLAGS@ 84bin_eolian2_eolian_gen2_CPPFLAGS = -I$(top_builddir)/src/lib/efl @EOLIAN_CFLAGS@
83bin_eolian2_eolian_gen2_LDADD = @USE_EOLIAN_LIBS@ 85bin_eolian2_eolian_gen2_LDADD = @USE_EOLIAN_LIBS@
diff --git a/src/bin/eolian2/docs.c b/src/bin/eolian2/docs.c
new file mode 100644
index 0000000000..61f1d34fbb
--- /dev/null
+++ b/src/bin/eolian2/docs.c
@@ -0,0 +1,662 @@
1#include <ctype.h>
2
3#include "docs.h"
4
5static int
6_indent_line(Eina_Strbuf *buf, int ind)
7{
8 int i;
9 for (i = 0; i < ind; ++i)
10 eina_strbuf_append_char(buf, ' ');
11 return ind;
12}
13
14#define DOC_LINE_LIMIT 79
15#define DOC_LINE_TEST 59
16#define DOC_LINE_OVER 39
17
18#define DOC_LIMIT(ind) ((ind > DOC_LINE_TEST) ? (ind + DOC_LINE_OVER) \
19 : DOC_LINE_LIMIT)
20
21static void
22_generate_ref(const char *refn, Eina_Strbuf *wbuf, Eina_Bool use_legacy)
23{
24 const Eolian_Declaration *decl = eolian_declaration_get_by_name(refn);
25 if (decl)
26 {
27 char *n = strdup(eolian_declaration_name_get(decl));
28 char *p = n;
29 while ((p = strchr(p, '.'))) *p = '_';
30 eina_strbuf_append(wbuf, n);
31 free(n);
32 return;
33 }
34
35 /* not a plain declaration, so it must be struct/enum field or func */
36 const char *sfx = strrchr(refn, '.');
37 if (!sfx) goto noref;
38
39 Eina_Stringshare *bname = eina_stringshare_add_length(refn, sfx - refn);
40
41 const Eolian_Typedecl *tp = eolian_typedecl_struct_get_by_name(bname);
42 if (tp)
43 {
44 if (!eolian_typedecl_struct_field_get(tp, sfx + 1))
45 {
46 eina_stringshare_del(bname);
47 goto noref;
48 }
49 _generate_ref(bname, wbuf, use_legacy);
50 eina_strbuf_append(wbuf, sfx);
51 eina_stringshare_del(bname);
52 return;
53 }
54
55 tp = eolian_typedecl_enum_get_by_name(bname);
56 if (tp)
57 {
58 const Eolian_Enum_Type_Field *efl = eolian_typedecl_enum_field_get(tp, sfx + 1);
59 if (!efl)
60 {
61 eina_stringshare_del(bname);
62 goto noref;
63 }
64 _generate_ref(bname, wbuf, use_legacy);
65 Eina_Stringshare *str = eolian_typedecl_enum_field_c_name_get(efl);
66 eina_strbuf_append_char(wbuf, '.');
67 eina_strbuf_append(wbuf, str);
68 eina_stringshare_del(str);
69 eina_stringshare_del(bname);
70 return;
71 }
72
73 const Eolian_Class *cl = eolian_class_get_by_name(bname);
74 const Eolian_Function *fn = NULL;
75 Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
76 if (!cl)
77 {
78 const char *mname;
79 if (!strcmp(sfx, ".get")) ftype = EOLIAN_PROP_GET;
80 else if (!strcmp(sfx, ".set")) ftype = EOLIAN_PROP_SET;
81 if (ftype != EOLIAN_UNRESOLVED)
82 {
83 eina_stringshare_del(bname);
84 mname = sfx - 1;
85 while ((mname != refn) && (*mname != '.')) --mname;
86 if (mname == refn) goto noref;
87 bname = eina_stringshare_add_length(refn, mname - refn);
88 cl = eolian_class_get_by_name(bname);
89 eina_stringshare_del(bname);
90 }
91 if (cl)
92 {
93 char *meth = strndup(mname + 1, sfx - mname - 1);
94 fn = eolian_class_function_get_by_name(cl, meth, ftype);
95 if (ftype == EOLIAN_UNRESOLVED)
96 ftype = eolian_function_type_get(fn);
97 free(meth);
98 }
99 }
100 else
101 {
102 fn = eolian_class_function_get_by_name(cl, sfx + 1, ftype);
103 ftype = eolian_function_type_get(fn);
104 }
105
106 if (!fn) goto noref;
107
108 Eina_Stringshare *fcn = eolian_function_full_c_name_get(fn, ftype, use_legacy);
109 if (!fcn) goto noref;
110 eina_strbuf_append(wbuf, fcn);
111 eina_stringshare_del(fcn);
112 return;
113noref:
114 eina_strbuf_append(wbuf, refn);
115}
116
117static int
118_append_section(const char *desc, int ind, int curl, Eina_Strbuf *buf,
119 Eina_Strbuf *wbuf, Eina_Bool use_legacy)
120{
121 Eina_Bool try_note = EINA_TRUE;
122 while (*desc)
123 {
124 eina_strbuf_reset(wbuf);
125 while (*desc && isspace(*desc) && (*desc != '\n'))
126 eina_strbuf_append_char(wbuf, *desc++);
127 if (try_note)
128 {
129#define CHECK_NOTE(str) !strncmp(desc, str ": ", sizeof(str ":"))
130 if (CHECK_NOTE("Note"))
131 {
132 eina_strbuf_append(wbuf, "@note ");
133 desc += sizeof("Note:");
134 }
135 else if (CHECK_NOTE("Warning"))
136 {
137 eina_strbuf_append(wbuf, "@warning ");
138 desc += sizeof("Warning:");
139 }
140 else if (CHECK_NOTE("Remark"))
141 {
142 eina_strbuf_append(wbuf, "@remark ");
143 desc += sizeof("Remark:");
144 }
145 else if (CHECK_NOTE("TODO"))
146 {
147 eina_strbuf_append(wbuf, "@todo ");
148 desc += sizeof("TODO:");
149 }
150#undef CHECK_NOTE
151 try_note = EINA_FALSE;
152 }
153 if (*desc == '\\')
154 {
155 desc++;
156 if ((*desc != '@') && (*desc != '$'))
157 eina_strbuf_append_char(wbuf, '\\');
158 eina_strbuf_append_char(wbuf, *desc++);
159 }
160 else if (*desc == '@')
161 {
162 const char *ref = ++desc;
163 if (isalpha(*desc) || (*desc == '_'))
164 {
165 eina_strbuf_append(wbuf, "@ref ");
166 while (isalnum(*desc) || (*desc == '.') || (*desc == '_'))
167 ++desc;
168 if (*(desc - 1) == '.') --desc;
169 Eina_Stringshare *refn = eina_stringshare_add_length(ref, desc - ref);
170 _generate_ref(refn, wbuf, use_legacy);
171 eina_stringshare_del(refn);
172 }
173 else
174 eina_strbuf_append_char(wbuf, '@');
175 }
176 else if (*desc == '$')
177 {
178 desc++;
179 if (isalpha(*desc))
180 eina_strbuf_append(wbuf, "@c ");
181 else
182 eina_strbuf_append_char(wbuf, '$');
183 }
184 while (*desc && !isspace(*desc))
185 eina_strbuf_append_char(wbuf, *desc++);
186 int limit = DOC_LIMIT(ind);
187 int wlen = eina_strbuf_length_get(wbuf);
188 if ((int)(curl + wlen) > limit)
189 {
190 curl = 3;
191 eina_strbuf_append_char(buf, '\n');
192 curl += _indent_line(buf, ind);
193 eina_strbuf_append(buf, " * ");
194 if (*eina_strbuf_string_get(wbuf) == ' ')
195 eina_strbuf_remove(wbuf, 0, 1);
196 }
197 curl += eina_strbuf_length_get(wbuf);
198 eina_strbuf_append(buf, eina_strbuf_string_get(wbuf));
199 if (*desc == '\n')
200 {
201 desc++;
202 eina_strbuf_append_char(buf, '\n');
203 while (*desc == '\n')
204 {
205 _indent_line(buf, ind);
206 eina_strbuf_append(buf, " *\n");
207 desc++;
208 try_note = EINA_TRUE;
209 }
210 curl = _indent_line(buf, ind) + 3;
211 eina_strbuf_append(buf, " * ");
212 }
213 }
214 return curl;
215}
216
217static int
218_append_since(const char *since, int indent, int curl, Eina_Strbuf *buf)
219{
220 if (since)
221 {
222 eina_strbuf_append_char(buf, '\n');
223 _indent_line(buf, indent);
224 eina_strbuf_append(buf, " *\n");
225 curl = _indent_line(buf, indent);
226 eina_strbuf_append(buf, " * @since ");
227 eina_strbuf_append(buf, since);
228 curl += strlen(since) + sizeof(" * @since ") - 1;
229 }
230 return curl;
231}
232
233static int
234_append_extra(const char *el, int indent, int curl, Eina_Bool nl, Eina_Strbuf *buf)
235{
236 if (el)
237 {
238 eina_strbuf_append_char(buf, '\n');
239 if (nl)
240 {
241 _indent_line(buf, indent);
242 eina_strbuf_append(buf, " *\n");
243 }
244 curl = _indent_line(buf, indent);
245 eina_strbuf_append(buf, " * ");
246 eina_strbuf_append(buf, el);
247 curl += strlen(el) + sizeof(" * ") - 1;
248 }
249 return curl;
250}
251
252static char *
253_sanitize_group(const char *group)
254{
255 if (!group) return NULL;
256 char *ret = strdup(group);
257 char *p;
258 while ((p = strchr(ret, '.'))) *p = '_';
259 return ret;
260}
261
262static void
263_append_group(Eina_Strbuf *buf, char *sgrp, int indent)
264{
265 if (!sgrp) return;
266 eina_strbuf_append(buf, " * @ingroup ");
267 eina_strbuf_append(buf, sgrp);
268 eina_strbuf_append_char(buf, '\n');
269 _indent_line(buf, indent);
270 free(sgrp);
271}
272
273static void
274_gen_doc_brief(const char *summary, const char *since, const char *group,
275 const char *el, int indent, Eina_Strbuf *buf,
276 Eina_Bool use_legacy)
277{
278 int curl = 4 + indent;
279 Eina_Strbuf *wbuf = eina_strbuf_new();
280 if (indent)
281 eina_strbuf_append(buf, "/**< ");
282 else
283 eina_strbuf_append(buf, "/** ");
284 curl = _append_section(summary, indent, curl, buf, wbuf, use_legacy);
285 eina_strbuf_free(wbuf);
286 curl = _append_extra(el, indent, curl, EINA_FALSE, buf);
287 curl = _append_since(since, indent, curl, buf);
288 char *sgrp = _sanitize_group(group);
289 if (((curl + 3) > DOC_LIMIT(indent)) || sgrp)
290 {
291 eina_strbuf_append_char(buf, '\n');
292 _indent_line(buf, indent);
293 if (sgrp) eina_strbuf_append(buf, " *");
294 }
295 if (sgrp)
296 {
297 eina_strbuf_append_char(buf, '\n');
298 _indent_line(buf, indent);
299 }
300 _append_group(buf, sgrp, indent);
301 eina_strbuf_append(buf, " */");
302}
303
304static void
305_gen_doc_full(const char *summary, const char *description, const char *since,
306 const char *group, const char *el, int indent, Eina_Strbuf *buf,
307 Eina_Bool use_legacy)
308{
309 int curl = 0;
310 Eina_Strbuf *wbuf = eina_strbuf_new();
311 if (indent)
312 eina_strbuf_append(buf, "/**<\n");
313 else
314 eina_strbuf_append(buf, "/**\n");
315 curl += _indent_line(buf, indent);
316 eina_strbuf_append(buf, " * @brief ");
317 curl += sizeof(" * @brief ") - 1;
318 _append_section(summary, indent, curl, buf, wbuf, use_legacy);
319 eina_strbuf_append_char(buf, '\n');
320 _indent_line(buf, indent);
321 eina_strbuf_append(buf, " *\n");
322 curl = _indent_line(buf, indent);
323 eina_strbuf_append(buf, " * ");
324 _append_section(description, indent, curl + 3, buf, wbuf, use_legacy);
325 curl = _append_extra(el, indent, curl, EINA_TRUE, buf);
326 curl = _append_since(since, indent, curl, buf);
327 eina_strbuf_append_char(buf, '\n');
328 _indent_line(buf, indent);
329 char *sgrp = _sanitize_group(group);
330 if (sgrp)
331 {
332 eina_strbuf_append(buf, " *\n");
333 _indent_line(buf, indent);
334 }
335 _append_group(buf, sgrp, indent);
336 eina_strbuf_append(buf, " */");
337 eina_strbuf_free(wbuf);
338}
339
340static Eina_Strbuf *
341_gen_doc_buf(const Eolian_Documentation *doc, const char *group,
342 const char *el, int indent, Eina_Bool use_legacy)
343{
344 if (!doc) return NULL;
345
346 const char *sum = eolian_documentation_summary_get(doc);
347 const char *desc = eolian_documentation_description_get(doc);
348 const char *since = eolian_documentation_since_get(doc);
349
350 Eina_Strbuf *buf = eina_strbuf_new();
351 if (!desc)
352 _gen_doc_brief(sum, since, group, el, indent, buf, use_legacy);
353 else
354 _gen_doc_full(sum, desc, since, group, el, indent, buf, use_legacy);
355 return buf;
356}
357
358Eina_Strbuf *
359eo_gen_docs_full_gen(const Eolian_Documentation *doc, const char *group,
360 int indent, Eina_Bool use_legacy)
361{
362 return _gen_doc_buf(doc, group, NULL, indent, use_legacy);
363}
364
365Eina_Strbuf *
366eo_gen_docs_event_gen(const Eolian_Event *ev, const char *group)
367{
368 if (!ev) return NULL;
369
370 const Eolian_Documentation *doc = eolian_event_documentation_get(ev);
371
372 char buf[1024];
373 const Eolian_Type *rt = eolian_event_type_get(ev);
374 const char *p = NULL;
375 if (rt)
376 {
377 p = buf;
378 Eina_Stringshare *rts = eolian_type_c_type_get(rt);
379 snprintf(buf, sizeof(buf), "@return %s", rts);
380 eina_stringshare_del(rts);
381 }
382
383 if (!doc)
384 {
385 Eina_Strbuf *bufs = eina_strbuf_new();
386 eina_strbuf_append(bufs, "/**\n * No description\n");
387 if (p)
388 {
389 eina_strbuf_append(bufs, " * ");
390 eina_strbuf_append(bufs, p);
391 eina_strbuf_append_char(bufs, '\n');
392 }
393 eina_strbuf_append(bufs, " */");
394 return bufs;
395 }
396
397 return _gen_doc_buf(doc, group, p, 0, EINA_FALSE);
398}
399
400Eina_Strbuf *
401eo_gen_docs_func_gen(const Eolian_Function *fid, Eolian_Function_Type ftype,
402 int indent, Eina_Bool use_legacy)
403{
404 const Eolian_Function_Parameter *par = NULL;
405 const Eolian_Function_Parameter *vpar = NULL;
406
407 const Eolian_Documentation *doc, *pdoc, *rdoc;
408
409 Eina_Iterator *itr = NULL;
410 Eina_Iterator *vitr = NULL;
411 Eina_Bool force_out = EINA_FALSE;
412
413 Eina_Strbuf *buf = eina_strbuf_new();
414 Eina_Strbuf *wbuf = NULL;
415
416 const char *sum = NULL, *desc = NULL, *since = NULL;
417
418 int curl = 0;
419
420 const char *group = eolian_class_full_name_get(eolian_function_class_get(fid));
421
422 if (ftype == EOLIAN_UNRESOLVED)
423 ftype = EOLIAN_METHOD;
424
425 if (ftype == EOLIAN_METHOD)
426 {
427 doc = eolian_function_documentation_get(fid, EOLIAN_METHOD);
428 pdoc = NULL;
429 }
430 else
431 {
432 doc = eolian_function_documentation_get(fid, EOLIAN_PROPERTY);
433 pdoc = eolian_function_documentation_get(fid, ftype);
434 if (!doc && pdoc) doc = pdoc;
435 if (pdoc == doc) pdoc = NULL;
436 }
437
438 rdoc = eolian_function_return_documentation_get(fid, ftype);
439
440 if (doc)
441 {
442 sum = eolian_documentation_summary_get(doc);
443 desc = eolian_documentation_description_get(doc);
444 since = eolian_documentation_since_get(doc);
445 if (pdoc && eolian_documentation_since_get(pdoc))
446 since = eolian_documentation_since_get(pdoc);
447 }
448
449 if (ftype == EOLIAN_METHOD)
450 {
451 itr = eolian_function_parameters_get(fid);
452 }
453 else
454 {
455 itr = eolian_property_keys_get(fid, ftype);
456 vitr = eolian_property_values_get(fid, ftype);
457 if (!vitr || !eina_iterator_next(vitr, (void**)&vpar))
458 {
459 eina_iterator_free(vitr);
460 vitr = NULL;
461 }
462 }
463
464 if (!itr || !eina_iterator_next(itr, (void**)&par))
465 {
466 eina_iterator_free(itr);
467 itr = NULL;
468 }
469
470 /* when return is not set on getter, value becomes return instead of param */
471 if (ftype == EOLIAN_PROP_GET && !eolian_function_return_type_get(fid, ftype))
472 {
473 const Eolian_Function_Parameter *rvpar = vpar;
474 if (!eina_iterator_next(vitr, (void**)&vpar))
475 {
476 /* one value - not out param */
477 eina_iterator_free(vitr);
478 rdoc = rvpar ? eolian_parameter_documentation_get(rvpar) : NULL;
479 vitr = NULL;
480 vpar = NULL;
481 }
482 else
483 {
484 /* multiple values - always out params */
485 eina_iterator_free(vitr);
486 vitr = eolian_property_values_get(fid, ftype);
487 if (!vitr)
488 vpar = NULL;
489 else if (!eina_iterator_next(vitr, (void**)&vpar))
490 {
491 eina_iterator_free(vitr);
492 vitr = NULL;
493 vpar = NULL;
494 }
495 }
496 }
497
498 if (!par)
499 {
500 /* no keys, try values */
501 itr = vitr;
502 par = vpar;
503 vitr = NULL;
504 vpar = NULL;
505 if (ftype == EOLIAN_PROP_GET)
506 force_out = EINA_TRUE;
507 }
508
509 /* only summary, nothing else; generate standard brief doc */
510 if (!desc && !par && !vpar && !rdoc && (ftype == EOLIAN_METHOD || !pdoc))
511 {
512 _gen_doc_brief(sum ? sum : "No description supplied.", since, group,
513 NULL, indent, buf, use_legacy);
514 return buf;
515 }
516
517 wbuf = eina_strbuf_new();
518
519 eina_strbuf_append(buf, "/**\n");
520 curl += _indent_line(buf, indent);
521 eina_strbuf_append(buf, " * @brief ");
522 curl += sizeof(" * @brief ") - 1;
523 _append_section(sum ? sum : "No description supplied.",
524 indent, curl, buf, wbuf, use_legacy);
525
526 eina_strbuf_append_char(buf, '\n');
527 if (desc || since || par || rdoc || pdoc)
528 {
529 _indent_line(buf, indent);
530 eina_strbuf_append(buf, " *\n");
531 }
532
533 if (desc)
534 {
535 curl = _indent_line(buf, indent);
536 eina_strbuf_append(buf, " * ");
537 _append_section(desc, indent, curl + 3, buf, wbuf, use_legacy);
538 eina_strbuf_append_char(buf, '\n');
539 if (par || rdoc || pdoc || since)
540 {
541 _indent_line(buf, indent);
542 eina_strbuf_append(buf, " *\n");
543 }
544 }
545
546 if (pdoc)
547 {
548 const char *pdesc = eolian_documentation_description_get(pdoc);
549 curl = _indent_line(buf, indent);
550 eina_strbuf_append(buf, " * ");
551 _append_section(eolian_documentation_summary_get(pdoc), indent,
552 curl + 3, buf, wbuf, use_legacy);
553 eina_strbuf_append_char(buf, '\n');
554 if (pdesc)
555 {
556 _indent_line(buf, indent);
557 eina_strbuf_append(buf, " *\n");
558 curl = _indent_line(buf, indent);
559 eina_strbuf_append(buf, " * ");
560 _append_section(pdesc, indent, curl + 3, buf, wbuf, use_legacy);
561 eina_strbuf_append_char(buf, '\n');
562 }
563 if (par || rdoc || since)
564 {
565 _indent_line(buf, indent);
566 eina_strbuf_append(buf, " *\n");
567 }
568 }
569
570 while (par)
571 {
572 const Eolian_Documentation *adoc = eolian_parameter_documentation_get(par);
573 curl = _indent_line(buf, indent);
574
575 Eolian_Parameter_Dir dir = EOLIAN_OUT_PARAM;
576 if (!force_out)
577 dir = eolian_parameter_direction_get(par);
578
579 switch (dir)
580 {
581 case EOLIAN_IN_PARAM:
582 eina_strbuf_append(buf, " * @param[in] ");
583 curl += sizeof(" * @param[in] ") - 1;
584 break;
585 case EOLIAN_OUT_PARAM:
586 eina_strbuf_append(buf, " * @param[out] ");
587 curl += sizeof(" * @param[out] ") - 1;
588 break;
589 case EOLIAN_INOUT_PARAM:
590 eina_strbuf_append(buf, " * @param[in,out] ");
591 curl += sizeof(" * @param[in,out] ") - 1;
592 break;
593 }
594
595 const char *nm = eolian_parameter_name_get(par);
596 eina_strbuf_append(buf, nm);
597 curl += strlen(nm);
598
599 if (adoc)
600 {
601 eina_strbuf_append_char(buf, ' ');
602 curl += 1;
603 _append_section(eolian_documentation_summary_get(adoc),
604 indent, curl, buf, wbuf, use_legacy);
605 }
606
607 eina_strbuf_append_char(buf, '\n');
608 if (!eina_iterator_next(itr, (void**)&par))
609 {
610 par = NULL;
611 if (vpar)
612 {
613 eina_iterator_free(itr);
614 itr = vitr;
615 par = vpar;
616 vitr = NULL;
617 vpar = NULL;
618 if (ftype == EOLIAN_PROP_GET)
619 force_out = EINA_TRUE;
620 }
621 }
622
623 if (!par && (rdoc || since))
624 {
625 _indent_line(buf, indent);
626 eina_strbuf_append(buf, " *\n");
627 }
628 }
629 eina_iterator_free(itr);
630
631 if (rdoc)
632 {
633 curl = _indent_line(buf, indent);
634 eina_strbuf_append(buf, " * @return ");
635 curl += sizeof(" * @return ") - 1;
636 _append_section(eolian_documentation_summary_get(rdoc), indent, curl,
637 buf, wbuf, use_legacy);
638 eina_strbuf_append_char(buf, '\n');
639 if (since)
640 {
641 _indent_line(buf, indent);
642 eina_strbuf_append(buf, " *\n");
643 }
644 }
645
646 if (since)
647 {
648 curl = _indent_line(buf, indent);
649 eina_strbuf_append(buf, " * @since ");
650 eina_strbuf_append(buf, since);
651 eina_strbuf_append_char(buf, '\n');
652 }
653
654 _indent_line(buf, indent);
655 eina_strbuf_append(buf, " *\n");
656
657 _indent_line(buf, indent);
658 _append_group(buf, _sanitize_group(group), indent);
659 eina_strbuf_append(buf, " */");
660 eina_strbuf_free(wbuf);
661 return buf;
662}
diff --git a/src/bin/eolian2/docs.h b/src/bin/eolian2/docs.h
new file mode 100644
index 0000000000..eaaa118b1f
--- /dev/null
+++ b/src/bin/eolian2/docs.h
@@ -0,0 +1,44 @@
1#ifndef EOLIAN_GEN_DOCS_H
2#define EOLIAN_GEN_DOCS_H
3
4#include "main.h"
5
6/*
7 * @brief Generate standard documentation
8 *
9 * @param[in] doc the documentation
10 * @param[in] group the group to use (can be NULL)
11 * @param[in] indent by how many spaces to indent the comment from second line
12 * @param[in] use_legacy whether to use legacy names
13 *
14 * @return A documentation comment
15 *
16 */
17Eina_Strbuf *eo_gen_docs_full_gen(const Eolian_Documentation *doc, const char *group, int indent, Eina_Bool use_legacy);
18
19/*
20 * @brief Generate function documentation
21 *
22 * @param[in] fid te function
23 * @param[in] type the function type (either METHOD, PROP_GET, PROP_SET)
24 * @param[in] indent by how many spaces to indent the comment from second line
25 * @param[in] use_legacy whether to use legacy names
26 *
27 * @return A documentation comment
28 *
29 */
30Eina_Strbuf *eo_gen_docs_func_gen(const Eolian_Function *fid, Eolian_Function_Type ftype, int indent, Eina_Bool use_legacy);
31
32/*
33 * @brief Generate event documentation
34 *
35 * @param[in] ev the event
36 * @param[in] group the group to use (can be NULL);
37 *
38 * @return A documentation comment
39 *
40 */
41Eina_Strbuf *eo_gen_docs_event_gen(const Eolian_Event *ev, const char *group);
42
43#endif
44
diff --git a/src/bin/eolian2/main.c b/src/bin/eolian2/main.c
index 321775e2a1..8a8a4a42bf 100644
--- a/src/bin/eolian2/main.c
+++ b/src/bin/eolian2/main.c
@@ -1,7 +1,3 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <unistd.h> 1#include <unistd.h>
6#include <libgen.h> 2#include <libgen.h>
7 3
diff --git a/src/bin/eolian2/main.h b/src/bin/eolian2/main.h
index b88ca6bcee..9ac6312cef 100644
--- a/src/bin/eolian2/main.h
+++ b/src/bin/eolian2/main.h
@@ -1,6 +1,10 @@
1#ifndef EOLIAN_GEN_MAIN_H 1#ifndef EOLIAN_GEN_MAIN_H
2#define EOLIAN_GEN_MAIN_H 2#define EOLIAN_GEN_MAIN_H
3 3
4#ifdef HAVE_CONFIG_H
5# include "config.h"
6#endif
7
4#include <Eina.h> 8#include <Eina.h>
5#include <Eolian.h> 9#include <Eolian.h>
6 10