| 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/mojom/buffer.h" | 15 #include "mojo/public/c/bindings/lib/type_table.h" |
| 16 #include "mojo/public/c/bindings/mojom/array.h" | |
| 17 #include "mojo/public/c/bindings/mojom/map.h" | |
| 18 #include "mojo/public/c/bindings/mojom/string.h" | |
| 19 #include "mojo/public/c/bindings/mojom/table.h" | |
| 20 #include "mojo/public/c/bindings/mojom/types.h" | |
| 21 #include "mojo/public/c/system/handle.h" | 16 #include "mojo/public/c/system/handle.h" |
| 22 | 17 |
| 23 // Imports. | 18 // Imports. |
| 24 {{range $import := .Imports -}} | 19 {{range $import := .Imports -}} |
| 25 #include "{{$import}}" | 20 #include "{{$import}}" |
| 26 {{end}} | 21 {{end}} |
| 27 | 22 |
| 28 // Type tables definitions for structs, arrays and unions. | 23 // Type tables definitions for structs, arrays and unions. |
| 29 {{template "GenerateTypeTableDefinitions" .TypeTable}} | 24 {{template "GenerateTypeTableDefinitions" .TypeTable}} |
| 30 | 25 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 43 | 38 |
| 44 // Interface level constants: | 39 // Interface level constants: |
| 45 {{range $interface := .Interfaces -}} | 40 {{range $interface := .Interfaces -}} |
| 46 {{range $const := $interface.Constants -}} | 41 {{range $const := $interface.Constants -}} |
| 47 const {{$const.Type}} {{$const.Name}} = {{$const.Value}}; | 42 const {{$const.Type}} {{$const.Name}} = {{$const.Value}}; |
| 48 {{end -}} | 43 {{end -}} |
| 49 {{end -}} | 44 {{end -}} |
| 50 | 45 |
| 51 {{end}} | 46 {{end}} |
| 52 ` | 47 ` |
| OLD | NEW |