Corentin Wallez | 9649682 | 2019-10-15 11:44:38 +0000 | [diff] [blame] | 1 | //* Copyright 2019 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 | |
fujunwei | 3a46476 | 2021-12-05 05:29:44 +0000 | [diff] [blame] | 15 | {% set Prefix = metadata.proc_table_prefix %} |
| 16 | #ifndef DAWN_{{Prefix.upper()}}_PROC_TABLE_H_ |
| 17 | #define DAWN_{{Prefix.upper()}}_PROC_TABLE_H_ |
Corentin Wallez | 9649682 | 2019-10-15 11:44:38 +0000 | [diff] [blame] | 18 | |
fujunwei | 3a46476 | 2021-12-05 05:29:44 +0000 | [diff] [blame] | 19 | #include "dawn/{{metadata.api.lower()}}.h" |
Corentin Wallez | 9649682 | 2019-10-15 11:44:38 +0000 | [diff] [blame] | 20 | |
Austin Eng | 16e01af | 2020-10-06 16:13:42 +0000 | [diff] [blame] | 21 | // Note: Often allocated as a static global. Do not add a complex constructor. |
fujunwei | 3a46476 | 2021-12-05 05:29:44 +0000 | [diff] [blame] | 22 | typedef struct {{Prefix}}ProcTable { |
| 23 | {% for function in by_category["function"] %} |
| 24 | {{as_cProc(None, function.name)}} {{as_varName(function.name)}}; |
| 25 | {% endfor %} |
Corentin Wallez | c57b180 | 2019-10-15 12:08:48 +0000 | [diff] [blame] | 26 | |
Corentin Wallez | 9649682 | 2019-10-15 11:44:38 +0000 | [diff] [blame] | 27 | {% for type in by_category["object"] %} |
Corentin Wallez | aca8c4a | 2019-11-22 14:02:52 +0000 | [diff] [blame] | 28 | {% for method in c_methods(type) %} |
Corentin Wallez | 9649682 | 2019-10-15 11:44:38 +0000 | [diff] [blame] | 29 | {{as_cProc(type.name, method.name)}} {{as_varName(type.name, method.name)}}; |
| 30 | {% endfor %} |
| 31 | |
| 32 | {% endfor %} |
fujunwei | 3a46476 | 2021-12-05 05:29:44 +0000 | [diff] [blame] | 33 | } {{Prefix}}ProcTable; |
Corentin Wallez | 9649682 | 2019-10-15 11:44:38 +0000 | [diff] [blame] | 34 | |
fujunwei | 3a46476 | 2021-12-05 05:29:44 +0000 | [diff] [blame] | 35 | #endif // DAWN_{{Prefix.upper()}}_PROC_TABLE_H_ |