summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-24 09:57:35 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-24 11:03:52 -0300
commita199218a51da23a4abbbd8e63b4f13aae7ff08c8 (patch)
tree2f91e9b9ee5c6dadac05d18a6787257e405bff0a /giscanner
parent4e91e6bd19c0389237c0be68e44afef70d1ccd22 (diff)
downloadgobject-introspection-a199218a51da23a4abbbd8e63b4f13aae7ff08c8.tar.gz
[annotation] Add constants for out options
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/annotationparser.py4
-rw-r--r--giscanner/maintransformer.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 0e8fca5d..c8a01b84 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -80,6 +80,10 @@ OPT_ARRAY_FIXED_SIZE = 'fixed-size'
OPT_ARRAY_LENGTH = 'length'
OPT_ARRAY_ZERO_TERMINATED = 'zero-terminated'
+# Out options
+OPT_OUT_CALLER_ALLOCATES = 'caller-allocates'
+OPT_OUT_CALLEE_ALLOCATES = 'callee-allocates'
+
# Scope options
OPT_SCOPE_ASYNC = 'async'
OPT_SCOPE_CALL = 'call'
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 03649867..34030335 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -28,6 +28,7 @@ from .annotationparser import (TAG_VFUNC, TAG_SINCE, TAG_DEPRECATED, TAG_RETURNS
from .annotationparser import (OPT_ALLOW_NONE, OPT_ARRAY, OPT_ATTRIBUTE,
OPT_ELEMENT_TYPE, OPT_IN, OPT_INOUT,
OPT_INOUT_ALT, OPT_OUT, OPT_SCOPE,
+ OPT_OUT_CALLER_ALLOCATES, OPT_OUT_CALLEE_ALLOCATES,
OPT_TYPE, OPT_CLOSURE, OPT_DESTROY, OPT_TRANSFER, OPT_SKIP,
OPT_FOREIGN, OPT_ARRAY_FIXED_SIZE,
OPT_ARRAY_LENGTH, OPT_ARRAY_ZERO_TERMINATED)
@@ -479,9 +480,9 @@ usage is void (*_gtk_reserved1)(void);"""
caller_allocates = '**' not in node.type.ctype
else:
caller_allocates = False
- elif subtype == 'caller-allocates':
+ elif subtype == OPT_OUT_CALLER_ALLOCATES:
caller_allocates = True
- elif subtype == 'callee-allocates':
+ elif subtype == OPT_OUT_CALLEE_ALLOCATES:
caller_allocates = False
elif OPT_IN in options:
annotated_direction = ast.PARAM_DIRECTION_IN