summaryrefslogtreecommitdiff
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-07 10:51:36 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-10-09 16:18:30 +0200
commit86191b02c78348608652fcbd3c834060815107a3 (patch)
tree0fdc21b28988c6e4db0011c5053b173a75fb7967 /src/bin/eolian
parentcbe3c944df8f51df45734900a15e86cd45f50178 (diff)
eolian: Leave default text for libeolian users
Summary: Instead of setting the default text at the library level, keep the summary empty if nothing is provided. The libeolian users them are free to check if the summary was actually empty or a placeholder text was added. ref T8309 Test Plan: Run attached tests Reviewers: q66, segfaultxavi Subscribers: cedric, brunobelo, #reviewers, felipealmeida, #committers Tags: #efl Maniphest Tasks: T8309 Differential Revision: https://phab.enlightenment.org/D10285
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/docs.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bin/eolian/docs.c b/src/bin/eolian/docs.c
index 31a80a2..c01508d 100644
--- a/src/bin/eolian/docs.c
+++ b/src/bin/eolian/docs.c
@@ -18,6 +18,8 @@ _indent_line(Eina_Strbuf *buf, int ind)
18#define DOC_LIMIT(ind) ((ind > DOC_LINE_TEST) ? (ind + DOC_LINE_OVER) \ 18#define DOC_LIMIT(ind) ((ind > DOC_LINE_TEST) ? (ind + DOC_LINE_OVER) \
19 : DOC_LINE_LIMIT) 19 : DOC_LINE_LIMIT)
20 20
21#define SUMMARY_OR_DEFAULT(sum) (sum ? sum : "No description supplied.")
22
21static void 23static void
22_generate_ref(const Eolian_State *state, const char *refn, Eina_Strbuf *wbuf) 24_generate_ref(const Eolian_State *state, const char *refn, Eina_Strbuf *wbuf)
23{ 25{
@@ -385,6 +387,7 @@ _gen_doc_buf(const Eolian_State *state, const Eolian_Documentation *doc,
385 if (!doc) return NULL; 387 if (!doc) return NULL;
386 388
387 const char *sum = eolian_documentation_summary_get(doc); 389 const char *sum = eolian_documentation_summary_get(doc);
390 sum = SUMMARY_OR_DEFAULT(sum);
388 const char *desc = eolian_documentation_description_get(doc); 391 const char *desc = eolian_documentation_description_get(doc);
389 const char *since = eolian_documentation_since_get(doc); 392 const char *since = eolian_documentation_since_get(doc);
390 393
@@ -549,7 +552,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid,
549 /* only summary, nothing else; generate standard brief doc */ 552 /* only summary, nothing else; generate standard brief doc */
550 if (!desc && !par && !vpar && !rdoc && (ftype == EOLIAN_METHOD || !pdoc)) 553 if (!desc && !par && !vpar && !rdoc && (ftype == EOLIAN_METHOD || !pdoc))
551 { 554 {
552 _gen_doc_brief(state, sum ? sum : "No description supplied.", since, group, 555 _gen_doc_brief(state, SUMMARY_OR_DEFAULT(sum), since, group,
553 NULL, indent, buf); 556 NULL, indent, buf);
554 return buf; 557 return buf;
555 } 558 }
@@ -560,7 +563,7 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid,
560 curl += _indent_line(buf, indent); 563 curl += _indent_line(buf, indent);
561 eina_strbuf_append(buf, " * @brief "); 564 eina_strbuf_append(buf, " * @brief ");
562 curl += sizeof(" * @brief ") - 1; 565 curl += sizeof(" * @brief ") - 1;
563 _append_section(state, sum ? sum : "No description supplied.", 566 _append_section(state, SUMMARY_OR_DEFAULT(sum),
564 indent, curl, buf, wbuf); 567 indent, curl, buf, wbuf);
565 568
566 eina_strbuf_append_char(buf, '\n'); 569 eina_strbuf_append_char(buf, '\n');
@@ -588,7 +591,8 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid,
588 const char *pdesc = eolian_documentation_description_get(pdoc); 591 const char *pdesc = eolian_documentation_description_get(pdoc);
589 curl = _indent_line(buf, indent); 592 curl = _indent_line(buf, indent);
590 eina_strbuf_append(buf, " * "); 593 eina_strbuf_append(buf, " * ");
591 _append_section(state, eolian_documentation_summary_get(pdoc), indent, 594 const char *psum = eolian_documentation_summary_get(pdoc);
595 _append_section(state, SUMMARY_OR_DEFAULT(psum), indent,
592 curl + 3, buf, wbuf); 596 curl + 3, buf, wbuf);
593 eina_strbuf_append_char(buf, '\n'); 597 eina_strbuf_append_char(buf, '\n');
594 if (pdesc) 598 if (pdesc)
@@ -651,7 +655,8 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid,
651 { 655 {
652 eina_strbuf_append_char(buf, ' '); 656 eina_strbuf_append_char(buf, ' ');
653 curl += 1; 657 curl += 1;
654 _append_section(state, eolian_documentation_summary_get(adoc), 658 const char *asum = eolian_documentation_summary_get(adoc);
659 _append_section(state, SUMMARY_OR_DEFAULT(asum),
655 indent, curl, buf, wbuf); 660 indent, curl, buf, wbuf);
656 } 661 }
657 662
@@ -684,7 +689,8 @@ eo_gen_docs_func_gen(const Eolian_State *state, const Eolian_Function *fid,
684 curl = _indent_line(buf, indent); 689 curl = _indent_line(buf, indent);
685 eina_strbuf_append(buf, " * @return "); 690 eina_strbuf_append(buf, " * @return ");
686 curl += sizeof(" * @return ") - 1; 691 curl += sizeof(" * @return ") - 1;
687 _append_section(state, eolian_documentation_summary_get(rdoc), indent, 692 const char *rsum = eolian_documentation_summary_get(rdoc);
693 _append_section(state, SUMMARY_OR_DEFAULT(rsum), indent,
688 curl, buf, wbuf); 694 curl, buf, wbuf);
689 eina_strbuf_append_char(buf, '\n'); 695 eina_strbuf_append_char(buf, '\n');
690 if (since) 696 if (since)