summaryrefslogtreecommitdiff
path: root/giscanner/sourcescanner.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/sourcescanner.py')
-rw-r--r--giscanner/sourcescanner.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index bd84a605..a1103a10 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -32,6 +32,10 @@ with LibtoolImporter(None, None):
else:
from giscanner._giscanner import SourceScanner as CSourceScanner
+HEADER_EXTS = ['.h', '.hpp', '.hxx']
+SOURCE_EXTS = ['.c', '.cpp', '.cc', '.cxx']
+ALL_EXTS = SOURCE_EXTS + HEADER_EXTS
+
(CSYMBOL_TYPE_INVALID,
CSYMBOL_TYPE_ELLIPSIS,
CSYMBOL_TYPE_CONST,
@@ -241,8 +245,7 @@ class SourceScanner(object):
headers = []
for filename in filenames:
- if (filename.endswith('.c') or filename.endswith('.cpp') or
- filename.endswith('.cc') or filename.endswith('.cxx')):
+ if os.path.splitext(filename)[1] in SOURCE_EXTS:
filename = os.path.abspath(filename)
self._scanner.lex_filename(filename)
else: