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

Unified Diff: tools/srpcgen.py

Issue 5974006: Convert srpc definitions from using int64 to using PP_Instance, PP_Module, an... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years 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 | « tests/ppapi_proxy/event_example.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/srpcgen.py
===================================================================
--- tools/srpcgen.py (revision 4040)
+++ tools/srpcgen.py (working copy)
@@ -95,10 +95,22 @@
'int32_t[]': ['I', 'int32_t*', 'arrays.iarr', 'u.count'],
'int64_t': ['l', 'int64_t', 'u.lval', ''],
'int64_t[]': ['L', 'int64_t', 'arrays.larr', 'u.count'],
+ 'PP_Instance': ['l', 'PP_Instance', 'u.lval', ''],
+ 'PP_Module': ['l', 'PP_Module', 'u.lval', ''],
+ 'PP_Resource': ['l', 'PP_Resource', 'u.lval', ''],
'string': ['s', 'char*', 'arrays.str', ''],
}
+def AddHeader(name):
+ """Adds a header to both the .cc and .h files."""
+ global HEADER_START
+ global SOURCE_FILE_INCLUDES
+
+ HEADER_START += "#include \"%s\"\n" % name
+ SOURCE_FILE_INCLUDES += "#include \"%s\"\n" % name
+
+
def CountName(name):
"""Returns the name of the auxiliary count member used for array typed."""
return '%s_bytes' % name
@@ -324,12 +336,13 @@
def main(argv):
- usage = 'Usage: srpcgen.py <-c | -s> [--include=<name>] <iname> <gname>'
- usage = usage + ' <.h> <.cc> <specs>'
+ usage = 'Usage: srpcgen.py <-c | -s> [--include=<name>] [--ppapi]'
+ usage = usage + ' <iname> <gname> <.h> <.cc> <specs>'
mode = None
+ ppapi = False
try:
- long_opts = ['include=']
+ long_opts = ['include=', 'ppapi']
opts, pargs = getopt.getopt(argv[1:], 'cs', long_opts)
except getopt.error, e:
print >>sys.stderr, 'Illegal option:', str(e)
@@ -359,7 +372,14 @@
mode = 'server'
elif opt == '--include':
h_file_name = val
+ elif opt == '--ppapi':
+ ppapi = True
+ if ppapi:
+ AddHeader("ppapi/c/pp_instance.h")
+ AddHeader("ppapi/c/pp_module.h")
+ AddHeader("ppapi/c/pp_resource.h")
+
# Convert to forward slash paths if needed
h_file_name = "/".join(h_file_name.split("\\"))
« no previous file with comments | « tests/ppapi_proxy/event_example.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698