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

Side by Side Diff: tools/srpcgen.py

Issue 5622003: Restructure the structs/unions involved in SRPC argument passing. This will... (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/unittests/shared/srpc/types_srpc_test.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2010, Google Inc. 2 # Copyright 2010, Google Inc.
3 # All rights reserved. 3 # All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #ifndef UNREFERENCED_PARAMETER 79 #ifndef UNREFERENCED_PARAMETER
80 #define UNREFERENCED_PARAMETER(P) do { (void) P; } while (0) 80 #define UNREFERENCED_PARAMETER(P) do { (void) P; } while (0)
81 #endif // UNREFERENCED_PARAMETER 81 #endif // UNREFERENCED_PARAMETER
82 #else 82 #else
83 #include "native_client/src/include/portability.h" 83 #include "native_client/src/include/portability.h"
84 #include "native_client/src/shared/srpc/nacl_srpc.h" 84 #include "native_client/src/shared/srpc/nacl_srpc.h"
85 #endif // __native_client__ 85 #endif // __native_client__
86 """ 86 """
87 87
88 types = {'bool': ['b', 'bool', 'u.bval', ''], 88 types = {'bool': ['b', 'bool', 'u.bval', ''],
89 'char[]': ['C', 'char*', 'u.caval.carr', 'u.caval.count'], 89 'char[]': ['C', 'char*', 'arrays.carr', 'u.count'],
90 'double': ['d', 'double', 'u.dval', ''], 90 'double': ['d', 'double', 'u.dval', ''],
91 'double[]': ['D', 'double*', 'u.daval.darr', 'u.daval.count'], 91 'double[]': ['D', 'double*', 'arrays.darr', 'u.count'],
92 'handle': ['h', 'NaClSrpcImcDescType', 'u.hval', ''], 92 'handle': ['h', 'NaClSrpcImcDescType', 'u.hval', ''],
93 'int32_t': ['i', 'int32_t', 'u.ival', ''], 93 'int32_t': ['i', 'int32_t', 'u.ival', ''],
94 'int32_t[]': ['I', 'int32_t*', 'u.iaval.iarr', 'u.iaval.count'], 94 'int32_t[]': ['I', 'int32_t*', 'arrays.iarr', 'u.count'],
95 'int64_t': ['l', 'int64_t', 'u.lval', ''], 95 'int64_t': ['l', 'int64_t', 'u.lval', ''],
96 'int64_t[]': ['L', 'int64_t', 'u.laval.larr', 'u.laval.count'], 96 'int64_t[]': ['L', 'int64_t', 'arrays.larr', 'u.count'],
97 'string': ['s', 'char*', 'u.sval.str', ''], 97 'string': ['s', 'char*', 'arrays.str', ''],
98 } 98 }
99 99
100 100
101 def CountName(name): 101 def CountName(name):
102 """Returns the name of the auxiliary count member used for array typed.""" 102 """Returns the name of the auxiliary count member used for array typed."""
103 return '%s_bytes' % name 103 return '%s_bytes' % name
104 104
105 105
106 def FormatRpcPrototype(is_server, class_name, indent, rpc): 106 def FormatRpcPrototype(is_server, class_name, indent, rpc):
107 """Returns a string for the prototype of an individual RPC.""" 107 """Returns a string for the prototype of an individual RPC."""
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 PrintClientFile(cc_file, h_file_name, specs) 380 PrintClientFile(cc_file, h_file_name, specs)
381 elif mode == 'server': 381 elif mode == 'server':
382 PrintHeaderFile(h_file, True, include_guard_name, interface_name, specs) 382 PrintHeaderFile(h_file, True, include_guard_name, interface_name, specs)
383 PrintServerFile(cc_file, h_file_name, interface_name, specs) 383 PrintServerFile(cc_file, h_file_name, interface_name, specs)
384 384
385 return 0 385 return 0
386 386
387 387
388 if __name__ == '__main__': 388 if __name__ == '__main__':
389 sys.exit(main(sys.argv)) 389 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « tests/unittests/shared/srpc/types_srpc_test.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698