Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1445)

Unified Diff: nacl_bindings_generator/interface_dsl.py

Issue 1086743002: Support pointers in the NaCl bindings generator. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Tweaks Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nacl_bindings_generator/interface.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nacl_bindings_generator/interface_dsl.py
diff --git a/nacl_bindings_generator/interface_dsl.py b/nacl_bindings_generator/interface_dsl.py
index c6b10bb821471dab0a8b4efd49795bbd5cbbaa2d..88607ff461c435eb0b6d6b8e2ec79d66bff53557 100644
--- a/nacl_bindings_generator/interface_dsl.py
+++ b/nacl_bindings_generator/interface_dsl.py
@@ -24,6 +24,7 @@ class Function(object):
self.params = []
self.param_by_name = {}
self.result_param = None
+ self.broken_in_nacl = False
def Param(self, name, param_type=None):
p = Param(self, len(self.params), name, param_type)
@@ -40,6 +41,9 @@ class Function(object):
else:
return 'void'
+ def IsBrokenInNaCl(self):
+ self.broken_in_nacl = True
+
def Finalize(self):
self.result_param = Param(self, len(self.params), 'result')
self.result_param.Out(self.return_type).AlwaysWritten()
@@ -59,6 +63,7 @@ class Param(object):
self.is_extensible = False
self.is_optional = False
self.is_always_written = False
+ self.is_pointer = False
def GetSizeParam(self):
assert self.size
@@ -68,6 +73,7 @@ class Param(object):
self.base_type = ty
self.param_type = ty
self.is_input = True
+ self.is_pointer = ty.endswith('*')
return self
def InArray(self, ty, size):
@@ -95,12 +101,14 @@ class Param(object):
self.param_type = ty + '*'
self.is_input = True
self.is_output = True
+ self.is_pointer = ty.endswith('*')
return self
def Out(self, ty):
self.base_type = ty
self.param_type = ty + '*'
self.is_output = True
+ self.is_pointer = ty.endswith('*')
return self
def OutArray(self, ty, size):
« no previous file with comments | « nacl_bindings_generator/interface.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698