| 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 // TODO(vardhan): Include only the necessary headers for a particular | 7 // TODO(vardhan): Include only the necessary headers for a particular |
| 8 // mojom. | 8 // mojom. |
| 9 const GenerateHeaderFile = ` | 9 const GenerateHeaderFile = ` |
| 10 {{- define "GenerateHeaderFile" -}} | 10 {{- define "GenerateHeaderFile" -}} |
| 11 // This file was auto-generated by the C bindings generator. | 11 // This file was auto-generated by the C bindings generator. |
| 12 | 12 |
| 13 #ifndef {{.HeaderGuard}} | 13 #ifndef {{.HeaderGuard}} |
| 14 #define {{.HeaderGuard}} | 14 #define {{.HeaderGuard}} |
| 15 | 15 |
| 16 #include <assert.h> | 16 #include <assert.h> |
| 17 #include <math.h> | 17 #include <math.h> |
| 18 #include <mojo/bindings/array.h> |
| 19 #include <mojo/bindings/buffer.h> |
| 20 #include <mojo/bindings/interface.h> |
| 21 #include <mojo/bindings/internal/type_descriptor.h> |
| 22 #include <mojo/bindings/map.h> |
| 23 #include <mojo/bindings/string.h> |
| 24 #include <mojo/bindings/validation.h> |
| 18 #include <mojo/macros.h> | 25 #include <mojo/macros.h> |
| 19 #include <mojo/system/handle.h> | 26 #include <mojo/system/handle.h> |
| 20 #include <stdbool.h> | 27 #include <stdbool.h> |
| 21 #include <stdint.h> | 28 #include <stdint.h> |
| 22 | 29 |
| 23 #include "mojo/public/c/bindings/array.h" | |
| 24 #include "mojo/public/c/bindings/buffer.h" | |
| 25 #include "mojo/public/c/bindings/interface.h" | |
| 26 #include "mojo/public/c/bindings/lib/type_descriptor.h" | |
| 27 #include "mojo/public/c/bindings/map.h" | |
| 28 #include "mojo/public/c/bindings/string.h" | |
| 29 #include "mojo/public/c/bindings/validation.h" | |
| 30 | |
| 31 // Imports. | 30 // Imports. |
| 32 {{range $import := .Imports -}} | 31 {{range $import := .Imports -}} |
| 33 #include "{{$import}}" | 32 #include "{{$import}}" |
| 34 {{end}} | 33 {{end}} |
| 35 | 34 |
| 36 MOJO_BEGIN_EXTERN_C | 35 MOJO_BEGIN_EXTERN_C |
| 37 | 36 |
| 38 // Forward declarations for structs. | 37 // Forward declarations for structs. |
| 39 {{range $struct := .Structs -}} | 38 {{range $struct := .Structs -}} |
| 40 struct {{$struct.Name}}; | 39 struct {{$struct.Name}}; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 {{end}} | 84 {{end}} |
| 86 | 85 |
| 87 // Type tables declarations for structs and unions. | 86 // Type tables declarations for structs and unions. |
| 88 {{template "GenerateTypeTableDeclarations" .TypeTable}} | 87 {{template "GenerateTypeTableDeclarations" .TypeTable}} |
| 89 | 88 |
| 90 MOJO_END_EXTERN_C | 89 MOJO_END_EXTERN_C |
| 91 | 90 |
| 92 #endif // {{.HeaderGuard}} | 91 #endif // {{.HeaderGuard}} |
| 93 {{- end }} | 92 {{- end }} |
| 94 ` | 93 ` |
| OLD | NEW |