diff OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py @ 4305:8992faf451fc

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Nov 2020 17:02:42 +0100
parents 50b0c69b653a
children 2ae905070221
line wrap: on
line diff
--- a/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py	Fri Nov 06 16:33:52 2020 +0100
+++ b/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py	Fri Nov 06 17:02:42 2020 +0100
@@ -68,7 +68,8 @@
 
 for root, dirs, files in os.walk(os.path.join(ROOT, '..', 'Sources')):
     for name in files:
-        if os.path.splitext(name)[1] == '.h':
+        if (os.path.splitext(name)[1] == '.h' and
+            name != 'Enumerations_TransferSyntaxes.impl.h'):
             SOURCES.append(os.path.join(root, name))
 
 AMALGAMATION = '/tmp/CheckOrthancFrameworkSymbols.cpp'
@@ -82,7 +83,6 @@
 tu = index.parse(AMALGAMATION, [
     '-DORTHANC_BUILDING_FRAMEWORK_LIBRARY=1',
     '-DORTHANC_BUILD_UNIT_TESTS=0',
-    '-DORTHANC_SANDBOXED=0',
     '-DORTHANC_ENABLE_BASE64=1',
     '-DORTHANC_ENABLE_CIVETWEB=1',
     '-DORTHANC_ENABLE_CURL=1',
@@ -92,15 +92,16 @@
     '-DORTHANC_ENABLE_DCMTK_TRANSCODING=1',
     '-DORTHANC_ENABLE_JPEG=1',
     '-DORTHANC_ENABLE_LOCALE=1',
+    '-DORTHANC_ENABLE_LOGGING=1',
+    '-DORTHANC_ENABLE_LOGGING_STDIO=0',
     '-DORTHANC_ENABLE_LUA=1',
-    '-DORTHANC_ENABLE_LOGGING=1',
     '-DORTHANC_ENABLE_MD5=1',
     '-DORTHANC_ENABLE_PKCS11=1',
     '-DORTHANC_ENABLE_PNG=1',
     '-DORTHANC_ENABLE_PUGIXML=1',
     '-DORTHANC_ENABLE_SSL=1',
+    '-DORTHANC_SANDBOXED=0',
     '-DORTHANC_SQLITE_STANDALONE=0',
-    '-DORTHANC_ENABLE_LOGGING_STDIO=0',
 ])
 
 
@@ -258,6 +259,19 @@
               child.kind == clang.cindex.CursorKind.STRUCT_DECL):
             ExploreClass(child, fqn)
 
+        elif child.kind == clang.cindex.CursorKind.FUNCTION_DECL:
+            visible = False
+            hasImplementation = False
+            for i in child.get_children():
+                if (i.kind == clang.cindex.CursorKind.VISIBILITY_ATTR and
+                    i.spelling == 'default'):
+                    visible = True
+                elif i.kind == clang.cindex.CursorKind.COMPOUND_STMT:
+                    hasImplementation = True
+
+            if visible and hasImplementation:
+                ReportProblem('Exported public function with an implementation', fqn, i)
+
 
 
 print('')