[gtk-doc] scan: enable having '_' as a public api in glib



commit 53295ae10e2e3160480b6d0e52cc0602b4ca4e7a
Author: Stefan Sauer <ensonic users sf net>
Date:   Tue Jul 16 20:51:53 2019 -0700

    scan: enable having '_' as a public api in glib
    
    This is essentially a revert of 070acc5.
    
    Fixes #92

 gtkdoc/scan.py                      | 12 +++++++-----
 tests/bugs/docs/tester-sections.txt |  1 +
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index 2a7214d..7da060f 100644
--- a/gtkdoc/scan.py
+++ b/gtkdoc/scan.py
@@ -522,15 +522,17 @@ def ScanHeaderContent(input_lines, decl_list, get_types, options):
             if cm[0]:
                 symbol = cm[0].group(1)
                 decl = line
-                # We assume all macros which start with '_' are private.
+                # We assume all macros which start with '_' are private, but
+                # we accept '_' itself which is the standard gettext macro.
                 # We also try to skip the first macro if it looks like the
                 # standard #ifndef HEADER_FILE #define HEADER_FILE etc.
                 # And we only want TRUE & FALSE defined in GLib.
                 if not symbol.startswith('_') \
-                    and (not re.search(r'#ifndef\s+' + symbol, previous_line)
-                         or first_macro == 0) \
-                    and ((symbol != 'TRUE' and symbol != 'FALSE')
-                         or options.module == 'glib'):
+                        and (not re.search(r'#ifndef\s+' + symbol, previous_line)
+                             or first_macro == 0) \
+                        and ((symbol != 'TRUE' and symbol != 'FALSE')
+                             or options.module == 'glib') \
+                        or symbol == '_':
                     in_declaration = 'macro'
                     logging.info('Macro: "%s"', symbol)
                 else:
diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt
index ab22e35..9e6a5ff 100644
--- a/tests/bugs/docs/tester-sections.txt
+++ b/tests/bugs/docs/tester-sections.txt
@@ -58,6 +58,7 @@ bug_732689
 bug_783420
 gst_play_marshal_BUFFER__BOXED
 BUG_791928
+_
 <SUBSECTION Standard>
 <SUBSECTION Private>
 GTKDOC_GNUC_CONST


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]