OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package templates | 5 package templates |
6 | 6 |
7 const GenerateSourceFile = ` | 7 const GenerateSourceFile = ` |
8 {{- define "GenerateSourceFile" -}} | 8 {{- define "GenerateSourceFile" -}} |
9 // This file was auto-generated by the C bindings generator. | 9 // This file was auto-generated by the C bindings generator. |
10 | 10 |
11 #include "{{.HeaderFile}}" | 11 #include "{{.HeaderFile}}" |
12 | 12 |
13 #include <stdbool.h> | 13 #include <stdbool.h> |
14 | 14 |
15 #include "mojo/public/c/bindings/lib/type_table.h" | 15 #include "mojo/public/c/bindings/lib/type_descriptor.h" |
16 #include "mojo/public/c/system/handle.h" | 16 #include "mojo/public/c/system/handle.h" |
17 | 17 |
18 // Imports. | 18 // Imports. |
19 {{range $import := .Imports -}} | 19 {{range $import := .Imports -}} |
20 #include "{{$import}}" | 20 #include "{{$import}}" |
21 {{end}} | 21 {{end}} |
22 | 22 |
23 // Type tables definitions for structs, arrays and unions. | 23 // Type tables definitions for structs, arrays and unions. |
24 {{template "GenerateTypeTableDefinitions" .TypeTable}} | 24 {{template "GenerateTypeTableDefinitions" .TypeTable}} |
25 | 25 |
(...skipping 12 matching lines...) Expand all Loading... |
38 | 38 |
39 // Interface level constants: | 39 // Interface level constants: |
40 {{range $interface := .Interfaces -}} | 40 {{range $interface := .Interfaces -}} |
41 {{range $const := $interface.Constants -}} | 41 {{range $const := $interface.Constants -}} |
42 const {{$const.Type}} {{$const.Name}} = {{$const.Value}}; | 42 const {{$const.Type}} {{$const.Name}} = {{$const.Value}}; |
43 {{end -}} | 43 {{end -}} |
44 {{end -}} | 44 {{end -}} |
45 | 45 |
46 {{end}} | 46 {{end}} |
47 ` | 47 ` |
OLD | NEW |