| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ Generator for C style prototypes and definitions """ | 7 """ Generator for C style prototypes and definitions """ |
| 8 | 8 |
| 9 import glob | 9 import glob |
| 10 import os | 10 import os |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 'store': '%s', | 96 'store': '%s', |
| 97 'return': '%s' | 97 'return': '%s' |
| 98 }, | 98 }, |
| 99 'Struct': { | 99 'Struct': { |
| 100 'in': 'const %s*', | 100 'in': 'const %s*', |
| 101 'inout': '%s*', | 101 'inout': '%s*', |
| 102 'out': '%s*', | 102 'out': '%s*', |
| 103 'return': ' %s*', | 103 'return': ' %s*', |
| 104 'store': '%s' | 104 'store': '%s' |
| 105 }, | 105 }, |
| 106 'blob_t': { |
| 107 'in': 'const %s', |
| 108 'inout': '%s', |
| 109 'out': '%s', |
| 110 'return': '%s', |
| 111 'store': '%s' |
| 112 }, |
| 106 'mem_t': { | 113 'mem_t': { |
| 107 'in': 'const %s', | 114 'in': 'const %s', |
| 108 'inout': '%s', | 115 'inout': '%s', |
| 109 'out': '%s', | 116 'out': '%s', |
| 110 'return': '%s', | 117 'return': '%s', |
| 111 'store': '%s' | 118 'store': '%s' |
| 112 }, | 119 }, |
| 113 'str_t': { | 120 'str_t': { |
| 114 'in': 'const %s', | 121 'in': 'const %s', |
| 115 'inout': '%s', | 122 'inout': '%s', |
| (...skipping 11 matching lines...) Expand all Loading... |
| 127 } | 134 } |
| 128 | 135 |
| 129 | 136 |
| 130 # | 137 # |
| 131 # RemapName | 138 # RemapName |
| 132 # | 139 # |
| 133 # A diction array of PPAPI types that are converted to language specific | 140 # A diction array of PPAPI types that are converted to language specific |
| 134 # types before being returned by by the C generator | 141 # types before being returned by by the C generator |
| 135 # | 142 # |
| 136 RemapName = { | 143 RemapName = { |
| 144 'blob_t': 'void**', |
| 137 'float_t': 'float', | 145 'float_t': 'float', |
| 138 'double_t': 'double', | 146 'double_t': 'double', |
| 139 'handle_t': 'int', | 147 'handle_t': 'int', |
| 140 'mem_t': 'void*', | 148 'mem_t': 'void*', |
| 141 'str_t': 'char*', | 149 'str_t': 'char*', |
| 142 'interface_t' : 'const void*' | 150 'interface_t' : 'const void*' |
| 143 } | 151 } |
| 144 | 152 |
| 145 def __init__(self): | 153 def __init__(self): |
| 146 self.dbg_depth = 0 | 154 self.dbg_depth = 0 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 if f.GetProperty('ERRORS') > 0: | 568 if f.GetProperty('ERRORS') > 0: |
| 561 print 'Skipping %s' % f.GetName() | 569 print 'Skipping %s' % f.GetName() |
| 562 continue | 570 continue |
| 563 print DefineDepends(node) | 571 print DefineDepends(node) |
| 564 for node in f.GetChildren()[2:]: | 572 for node in f.GetChildren()[2:]: |
| 565 print Define(node, comment=True, prefix='tst_') | 573 print Define(node, comment=True, prefix='tst_') |
| 566 | 574 |
| 567 | 575 |
| 568 if __name__ == '__main__': | 576 if __name__ == '__main__': |
| 569 sys.exit(Main(sys.argv[1:])) | 577 sys.exit(Main(sys.argv[1:])) |
| 570 | |
| OLD | NEW |