Branch: refs/heads/master
Author: Thomas Martitz <kugel(a)rockbox.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Wed, 09 Mar 2016 21:49:51 UTC
Commit: d868130d784f3a4b615dd0f10b3bd9071c24bc21
https://github.com/geany/geany/commit/d868130d784f3a4b615dd0f10b3bd9071c24b…
Log Message:
-----------
tagmanager: make doxygen comments and typedefs gtkdoc generation friendly
Because of the missing "typedef struct TMFoo" it was missing from the gtkdoc
header (the struct listings are always without typedef). This is also
consistent with the rest of geany.
@gironly for TMParserType so it's picked up as well.
Modified Paths:
--------------
doc/Doxyfile.in
scripts/gen-api-gtkdoc.py
tagmanager/src/tm_parser.h
tagmanager/src/tm_source_file.h
tagmanager/src/tm_workspace.h
Modified: doc/Doxyfile.in
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -793,7 +793,8 @@ INPUT = @top_srcdir@/src/ \
@top_srcdir@/tagmanager/src/tm_source_file.c \
@top_srcdir@/tagmanager/src/tm_source_file.h \
@top_srcdir@/tagmanager/src/tm_workspace.c \
- @top_srcdir@/tagmanager/src/tm_workspace.h
+ @top_srcdir@/tagmanager/src/tm_workspace.h \
+ @top_srcdir@/tagmanager/src/tm_parser.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Modified: scripts/gen-api-gtkdoc.py
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -402,8 +402,6 @@ def main(args):
outfile.write("#include \"gtkcompat.h\"\n")
outfile.write("#include \"Scintilla.h\"\n")
outfile.write("#include \"ScintillaWidget.h\"\n")
- outfile.write("typedef struct TMSourceFile TMSourceFile;\n")
- outfile.write("typedef struct TMWorkspace TMWorkspace;\n")
# write enums first, so typedefs to them are valid (as forward enum declaration
# is invalid). It's fine as an enum can't contain reference to other types.
Modified: tagmanager/src/tm_parser.h
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -10,6 +10,9 @@
#ifndef TM_PARSER_H
#define TM_PARSER_H
+/** @gironly
+ * A integral type which can hold known parser type IDs
+ **/
typedef gint TMParserType;
Modified: tagmanager/src/tm_source_file.h
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -33,9 +33,9 @@ extern "C"
/**
- The TMSourceFile structure represents the source file and its tags in the tag manager.
-*/
-typedef struct
+ * The TMSourceFile structure represents the source file and its tags in the tag manager.
+ **/
+typedef struct TMSourceFile
{
TMParserType lang; /* Programming language used */
char *file_name; /**< Full file name (inc. path) */
Modified: tagmanager/src/tm_workspace.h
10 lines changed, 5 insertions(+), 5 deletions(-)
===================================================================
@@ -22,11 +22,11 @@ extern "C"
/** The Tag Manager Workspace. This is a singleton object containing a list
- of individual source files. There is also a global tag list
- which can be loaded or created. This contains global tags gleaned from
- /usr/include, etc. and should be used for autocompletion, calltips, etc.
-*/
-typedef struct
+ * of individual source files. There is also a global tag list
+ * which can be loaded or created. This contains global tags gleaned from
+ * /usr/include, etc. and should be used for autocompletion, calltips, etc.
+ **/
+typedef struct TMWorkspace
{
GPtrArray *global_tags; /**< Global tags loaded at startup */
GPtrArray *source_files; /**< An array of TMSourceFile pointers */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Wed, 09 Mar 2016 21:41:48 UTC
Commit: ed700a9dc6f046a63d14c25ebb7e2877bfb1b5a6
https://github.com/geany/geany/commit/ed700a9dc6f046a63d14c25ebb7e2877bfb1b…
Log Message:
-----------
Fix forward reference to enumeration types in GtkDoc header
It's invalid to forward-declare enumerations, yet they might be
referenced by typedefs.
Fix this by outputting enumerations first so typedefs can references
them. As enumerations can't reference other types, it's safe to place
them before anything else.
Closes #952.
Closes #955.
Modified Paths:
--------------
scripts/gen-api-gtkdoc.py
Modified: scripts/gen-api-gtkdoc.py
14 lines changed, 12 insertions(+), 2 deletions(-)
===================================================================
@@ -362,6 +362,7 @@ def main(args):
root = transform(doc)
other = []
+ enums = []
typedefs = []
c_files = root.xpath(".//compounddef[@kind='file']/compoundname[substring(.,string-length(.)-1)='.c']/..")
@@ -376,7 +377,7 @@ def main(args):
for n0 in f.xpath(".//*/memberdef[@kind='enum' and @prot='public']"):
e = DoxyEnum.from_memberdef(n0)
- other.append(e)
+ enums.append(e)
for n0 in root.xpath(".//compounddef[@kind='struct' and @prot='public']"):
e = DoxyStruct.from_compounddef(n0)
@@ -404,12 +405,21 @@ def main(args):
outfile.write("typedef struct TMSourceFile TMSourceFile;\n")
outfile.write("typedef struct TMWorkspace TMWorkspace;\n")
- # write typedefs first, they are possibly undocumented but still required (even
+ # write enums first, so typedefs to them are valid (as forward enum declaration
+ # is invalid). It's fine as an enum can't contain reference to other types.
+ for e in filter(lambda x: x.is_documented(), enums):
+ outfile.write("\n\n")
+ outfile.write(e.to_gtkdoc())
+ outfile.write(e.definition)
+ outfile.write("\n\n")
+
+ # write typedefs second, they are possibly undocumented but still required (even
# if they are documented, they must be written out without gtkdoc)
for e in typedefs:
outfile.write(e.definition)
outfile.write("\n\n")
+ # write the rest (structures, functions, ...)
for e in filter(lambda x: x.is_documented(), other):
outfile.write("\n\n")
outfile.write(e.to_gtkdoc())
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).