1c8a96e64Sopenharmony_ci/* 2c8a96e64Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 3c8a96e64Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c8a96e64Sopenharmony_ci * you may not use this file except in compliance with the License. 5c8a96e64Sopenharmony_ci * You may obtain a copy of the License at 6c8a96e64Sopenharmony_ci * 7c8a96e64Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c8a96e64Sopenharmony_ci * 9c8a96e64Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c8a96e64Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c8a96e64Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c8a96e64Sopenharmony_ci * See the License for the specific language governing permissions and 13c8a96e64Sopenharmony_ci * limitations under the License. 14c8a96e64Sopenharmony_ci */ 15c8a96e64Sopenharmony_ci 16c8a96e64Sopenharmony_ci#include "napi/native_node_api.h" 17c8a96e64Sopenharmony_ci 18c8a96e64Sopenharmony_ciextern const char _binary_atomicservicetabs_abc_start[]; 19c8a96e64Sopenharmony_ciextern const char _binary_atomicservicetabs_abc_end[]; 20c8a96e64Sopenharmony_ci 21c8a96e64Sopenharmony_ci// Napi get abc code function 22c8a96e64Sopenharmony_ciextern "C" __attribute__((visibility("default"))) 23c8a96e64Sopenharmony_civoid NAPI_atomicservice_AtomicServiceTabs_GetABCCode(const char **buf, int *buflen) 24c8a96e64Sopenharmony_ci{ 25c8a96e64Sopenharmony_ci if (buf != nullptr) { 26c8a96e64Sopenharmony_ci *buf = _binary_atomicservicetabs_abc_start; 27c8a96e64Sopenharmony_ci } 28c8a96e64Sopenharmony_ci if (buflen != nullptr) { 29c8a96e64Sopenharmony_ci *buflen = _binary_atomicservicetabs_abc_end - _binary_atomicservicetabs_abc_start; 30c8a96e64Sopenharmony_ci } 31c8a96e64Sopenharmony_ci} 32c8a96e64Sopenharmony_ci 33c8a96e64Sopenharmony_ci/* 34c8a96e64Sopenharmony_ci * Module define 35c8a96e64Sopenharmony_ci */ 36c8a96e64Sopenharmony_cistatic napi_module AtomicServiceTabsModule = { 37c8a96e64Sopenharmony_ci .nm_version = 1, 38c8a96e64Sopenharmony_ci .nm_flags = 0, 39c8a96e64Sopenharmony_ci .nm_filename = nullptr, 40c8a96e64Sopenharmony_ci .nm_modname = "atomicservice.AtomicServiceTabs", 41c8a96e64Sopenharmony_ci .nm_priv = ((void*)0), 42c8a96e64Sopenharmony_ci .reserved = { 0 }, 43c8a96e64Sopenharmony_ci}; 44c8a96e64Sopenharmony_ci 45c8a96e64Sopenharmony_ci/* 46c8a96e64Sopenharmony_ci * Module registerfunction 47c8a96e64Sopenharmony_ci */ 48c8a96e64Sopenharmony_ciextern "C" __attribute__((constructor)) void AtomicServiceTabsRegisterModule(void) 49c8a96e64Sopenharmony_ci{ 50c8a96e64Sopenharmony_ci napi_module_register(&AtomicServiceTabsModule); 51c8a96e64Sopenharmony_ci}