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

Side by Side Diff: mojom/generators/c/templates/header.tmpl.go

Issue 2072903002: C bindings pt3: Type table definitions and barebones files to get generated code to compile. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: elem_table -> elem_descriptor Created 4 years, 6 months 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
OLDNEW
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 <stdbool.h> 18 #include <stdbool.h>
19 #include <stdint.h> 19 #include <stdint.h>
20 20
21 #include "mojo/public/c/bindings/array.h" 21 #include "mojo/public/c/bindings/array.h"
22 #include "mojo/public/c/bindings/buffer.h" 22 #include "mojo/public/c/bindings/buffer.h"
23 #include "mojo/public/c/bindings/interface.h" 23 #include "mojo/public/c/bindings/interface.h"
24 #include "mojo/public/c/bindings/lib/type_table.h" 24 #include "mojo/public/c/bindings/lib/type_descriptor.h"
25 #include "mojo/public/c/bindings/map.h" 25 #include "mojo/public/c/bindings/map.h"
26 #include "mojo/public/c/bindings/string.h" 26 #include "mojo/public/c/bindings/string.h"
27 #include "mojo/public/c/bindings/validation.h" 27 #include "mojo/public/c/bindings/validation.h"
28 #include "mojo/public/c/system/handle.h" 28 #include "mojo/public/c/system/handle.h"
29 29
30 // Imports. 30 // Imports.
31 {{range $import := .Imports -}} 31 {{range $import := .Imports -}}
32 #include "{{$import}}" 32 #include "{{$import}}"
33 {{end}} 33 {{end}}
34 34
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 {{range $interface := .Interfaces -}} 80 {{range $interface := .Interfaces -}}
81 {{template "GenerateInterface" $interface}} 81 {{template "GenerateInterface" $interface}}
82 {{end}} 82 {{end}}
83 83
84 // Type tables declarations for structs and unions. 84 // Type tables declarations for structs and unions.
85 {{template "GenerateTypeTableDeclarations" .TypeTable}} 85 {{template "GenerateTypeTableDeclarations" .TypeTable}}
86 86
87 #endif // {{.HeaderGuard}} 87 #endif // {{.HeaderGuard}}
88 {{- end }} 88 {{- end }}
89 ` 89 `
OLDNEW
« no previous file with comments | « mojom/generators/c/cgen/type_translation.go ('k') | mojom/generators/c/templates/source.tmpl.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698