aboutsummaryrefslogtreecommitdiff
path: root/python_bindings_example.py
diff options
context:
space:
mode:
Diffstat (limited to 'python_bindings_example.py')
-rwxr-xr-xpython_bindings_example.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python_bindings_example.py b/python_bindings_example.py
index a690874..31cf285 100755
--- a/python_bindings_example.py
+++ b/python_bindings_example.py
@@ -12,9 +12,12 @@ def get_library():
with open(fp, 'r') as f:
declarations = f.readlines()
- for declaration in declarations:
- if 'extern' in declaration and not '"C"' in declaration:
+ a = iter(declarations)
+ for declaration in a:
+ if declaration.startswith('extern') and not '"C"' in declaration:
declaration = declaration.replace('extern', '').strip()
+ while not ';' in declaration:
+ declaration += (next(a)).strip()
# print(declaration)
ffi.cdef(declaration)