github.com/razvanm/vanadium-go-1.3@v0.0.0-20160721203343-4a65068e5915/src/runtime/ppapi/cdecl_nacl.got (about) 1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package ppapi 6 7 // Type definitions. 8 {% for ty in types.values() -%} 9 {% if ty.builtin -%} 10 // type {{ty.name}} {{ty.kind}} 11 {% elif ty.kind == 'struct' -%} 12 type {{ty.name}} [{{ty.size}}]byte 13 {% elif ty.kind == 'void' -%} 14 // type {{ty.name}} void 15 {% elif ty.kind == '*' -%} 16 type {{ty.name}} uintptr 17 {% else -%} 18 type {{ty.name}} {{ty.kind}} 19 {% endif -%} 20 {% endfor %} 21 22 type TimeTicks pp_TimeTicks 23 24 // Enumerations. 25 const ( 26 PP_OK Error = 0 27 28 {% for c, ty, v in consts -%} 29 {{c}} {{ty}} = {{v}} 30 {% endfor %} 31 32 PP_IMAGEDATAFORMAT_BGRA_PREMUL ImageDataFormat = 0 33 PP_IMAGEDATAFORMAT_RGBA_PREMUL ImageDataFormat = 1 34 ) 35 36 // Function declarations. 37 {% for func in functions -%} 38 func {{func.name}}({%- for arg in func.args -%} 39 {% if not loop.first %}, {% endif -%} 40 {{arg.name}} {{arg.type.name}} 41 {%- endfor -%}){% if func.goresult != 'void' %} {{func.goresult}}{% endif %} 42 {% endfor -%} 43 44 // gostring returns a string object containing the contents of the 45 // null-terminated UTF-8 C string. 46 func gostring(buf *byte) string 47 48 // gostringn returns a string object containing the contents of the 49 // UTF-8 C string with a specified length. 50 func gostringn(s *byte, i int) string 51 52 // free releases a value allocated by malloc. 53 func free(p *byte) 54 55 // init_array_output initializes the pp_ArrayOutput allocator. 56 func init_array_output(*pp_ArrayOutput, *arrayOutputBuffer) 57 58 // ppapi_start starts the main loop. 59 func ppapi_start()