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

Side by Side Diff: mojom/generators/c/templates/source.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 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
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 `
OLDNEW
« no previous file with comments | « mojom/generators/c/templates/header.tmpl.go ('k') | mojom/generators/c/templates/type_table.tmpl.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698