1 //* Copyright 2017 The Dawn Authors 2 //* 3 //* Licensed under the Apache License, Version 2.0 (the "License"); 4 //* you may not use this file except in compliance with the License. 5 //* You may obtain a copy of the License at 6 //* 7 //* http://www.apache.org/licenses/LICENSE-2.0 8 //* 9 //* Unless required by applicable law or agreed to in writing, software 10 //* distributed under the License is distributed on an "AS IS" BASIS, 11 //* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 //* See the License for the specific language governing permissions and 13 //* limitations under the License. 14 15 #include "dawn/dawn.h" 16 17 static DawnProcTable procs; 18 19 static DawnProcTable nullProcs; 20 dawnSetProcs(const DawnProcTable * procs_)21void dawnSetProcs(const DawnProcTable* procs_) { 22 if (procs_) { 23 procs = *procs_; 24 } else { 25 procs = nullProcs; 26 } 27 } 28 29 {% for type in by_category["object"] %} 30 {% for method in native_methods(type) %} 31 {{as_cType(method.return_type.name)}} {{as_cMethod(type.name, method.name)}}( 32 {{-as_cType(type.name)}} {{as_varName(type.name)}} 33 {%- for arg in method.arguments -%} 34 , {{as_annotated_cType(arg)}} 35 {%- endfor -%} 36 ) { 37 {% if method.return_type.name.canonical_case() != "void" %}return {% endif %} 38 procs.{{as_varName(type.name, method.name)}}({{as_varName(type.name)}} 39 {%- for arg in method.arguments -%} 40 , {{as_varName(arg.name)}} 41 {%- endfor -%} 42 ); 43 } 44 {% endfor %} 45 46 {% endfor %} 47