[vlc-commits] python: fix typedef regexp

Olivier Aubert git at videolan.org
Sat Oct 6 22:55:14 CEST 2018


vlc/python | branch: master | Olivier Aubert <contact at olivieraubert.net> | Sat Oct  6 20:15:58 2018 +0200| [08554bb2ac51a47f27a2108d6abc217de7ec1c16] | committer: Olivier Aubert

python: fix typedef regexp

To correctly handle both
typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes)
and
typedef void* (*libvlc_gl_getProcAddress_cb)(void* opaque, const char* fct_name)

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=08554bb2ac51a47f27a2108d6abc217de7ec1c16
---

 generator/generate.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/generator/generate.py b/generator/generate.py
index 595c595..3c11d5b 100755
--- a/generator/generate.py
+++ b/generator/generate.py
@@ -145,7 +145,7 @@ def_re       = re.compile('^\s+def\s+(\w+)', re.MULTILINE)
 enum_type_re = re.compile('^(?:typedef\s+)?enum')
 enum_re      = re.compile('(?:typedef\s+)?(enum)\s*(\S+)\s*\{\s*(.+)\s*\}\s*(?:\S+)?;')
 enum_pair_re = re.compile('\s*=\s*')
-callback_type_re = re.compile('^typedef\s+\w+(\s+\*)?\s*\(\s*\*')
+callback_type_re = re.compile('^typedef\s+\w+(\s*\*)?\s*\(\s*\*')
 callback_re  = re.compile('typedef\s+\*?(\w+\s*\*?)\s*\(\s*\*\s*(\w+)\s*\)\s*\((.+)\);')
 struct_type_re = re.compile('^typedef\s+struct\s*(\S+)\s*$')
 struct_re    = re.compile('typedef\s+(struct)\s*(\S+)?\s*\{\s*(.+)\s*\}\s*(?:\S+)?\s*;')
@@ -926,6 +926,7 @@ class PythonGenerator(_Generator):
         'va_list':   'ctypes.c_void_p',
         'char*':     'ctypes.c_char_p',
         'bool':      'ctypes.c_bool',
+        'bool*':      'ctypes.POINTER(ctypes.c_bool)',
         'char**':    'ListPOINTER(ctypes.c_char_p)',
         'float':     'ctypes.c_float',
         'int':       'ctypes.c_int',



More information about the vlc-commits mailing list