• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
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
16#ifndef PANDA_RUNTIME_INCLUDE_ENTRYPOINTS_GEN_H_
17#define PANDA_RUNTIME_INCLUDE_ENTRYPOINTS_GEN_H_
18
19// Autogenerated file -- DO NOT EDIT!
20
21#include "macros.h"
22#include <cstdint>
23
24namespace panda {
25
26class Method;
27class Class;
28class ObjectHeader;
29
30namespace coretypes {
31class Array;
32class String;
33}  // namespace coretypes
34
35using FileEntityId = uint32_t;
36
37}  // namespace panda
38
39% require 'set'
40% entrypoints_map = Set.new
41% Compiler::entrypoints.each do |entrypoint|
42%   next if entrypoint.external?
43%   if !entrypoints_map.include? entrypoint.bridge_name
44// NOLINTNEXTLINE(readability-named-parameter)
45extern "C" <%= entrypoint.signature[0] %> <%= entrypoint.bridge_name %>(<%= entrypoint.signature[1..-1].join(', ') %>);
46%     entrypoints_map.add(entrypoint.bridge_name)
47%   end
48%   if !entrypoints_map.include? entrypoint.entrypoint_name
49// NOLINTNEXTLINE(readability-named-parameter)
50extern "C" <%= entrypoint.signature[0] %> <%= entrypoint.entrypoint_name %>(<%= entrypoint.signature[1.. - 1].join(', ') %>);
51%     entrypoints_map.add(entrypoint.entrypoint_name)
52%   end
53% end
54
55namespace panda {
56
57static constexpr uint32_t ENTRYPOINTS_CRC32 = <%= Compiler::entrypoints_crc32 %>;
58
59enum class EntrypointId : uint8_t {
60% Compiler::entrypoints.each_with_index do |entrypoint, index|
61    <%= entrypoint.enum_name %> = <%= index %>,
62% end
63    COUNT
64};
65
66struct EntrypointsTable {
67% Compiler::entrypoints.each do |entrypoint|
68%   initialize_value = entrypoint.external? ? 'nullptr' : entrypoint.bridge_name
69    // <%= entrypoint.enum_name %>
70    <%= entrypoint.signature[0] %> (*p<%= entrypoint.name %>)(<%= entrypoint.signature[1..-1].join(', ') %>){<%= initialize_value %>};
71% end
72};
73
74}  // namespace panda
75
76#endif  // PANDA_RUNTIME_INCLUDE_ENTRYPOINTS_GEN_H_
77