summaryrefslogtreecommitdiff
path: root/cffi/api.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-03-30 17:22:06 +0200
committerArmin Rigo <arigo@tunes.org>2016-03-30 17:22:06 +0200
commit2b6fbe97af4e1250cf7f56b43621ce9d13ade8af (patch)
tree6603cec060f08492499f91d35cf0119bf9a0f423 /cffi/api.py
parent92c8178b564346cba7c11331b8d9b6ba254b90eb (diff)
downloadcffi-2b6fbe97af4e1250cf7f56b43621ce9d13ade8af.tar.gz
Change the API of ffi.list_types()
Diffstat (limited to 'cffi/api.py')
-rw-r--r--cffi/api.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/cffi/api.py b/cffi/api.py
index 51dc218..07b5c9c 100644
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -722,10 +722,9 @@ class FFI(object):
"objects")
def list_types(self):
- """Build and return a list of all user type names known in this FFI
- instance. Contains typedef names (sorted in alphabetical order),
- followed by the 'struct xxx' (sorted) and finally the 'union xxx'
- (sorted as well).
+ """Returns the user type names known to this FFI instance.
+ This returns a tuple containing three lists of names:
+ (typedef_names, names_of_structs, names_of_unions)
"""
typedefs = []
structs = []
@@ -734,13 +733,13 @@ class FFI(object):
if key.startswith('typedef '):
typedefs.append(key[8:])
elif key.startswith('struct '):
- structs.append(key)
+ structs.append(key[7:])
elif key.startswith('union '):
- unions.append(key)
+ unions.append(key[6:])
typedefs.sort()
structs.sort()
unions.sort()
- return typedefs + structs + unions
+ return (typedefs, structs, unions)
def _load_backend_lib(backend, name, flags):