1 /* 2 * Copyright (c) 2023 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 extern const char _binary_webview_export_js_start[]; 17 extern const char _binary_webview_export_js_end[]; 18 extern const char _binary_webview_export_abc_start[]; 19 extern const char _binary_webview_export_abc_end[]; 20 NAPI_web_webview_GetJSCode(const char ** buf,int * bufLen)21extern "C" __attribute__((visibility("default"))) void NAPI_web_webview_GetJSCode(const char **buf, int *bufLen) 22 { 23 if (buf != nullptr) { 24 *buf = _binary_webview_export_js_start; 25 } 26 27 if (bufLen != nullptr) { 28 *bufLen = _binary_webview_export_js_end - _binary_webview_export_js_start; 29 } 30 } 31 NAPI_web_webview_GetABCCode(const char ** buf,int * buflen)32extern "C" __attribute__((visibility("default"))) void NAPI_web_webview_GetABCCode(const char** buf, int* buflen) 33 { 34 if (buf != nullptr) { 35 *buf = _binary_webview_export_abc_start; 36 } 37 if (buflen != nullptr) { 38 *buflen = _binary_webview_export_abc_end - _binary_webview_export_abc_start; 39 } 40 } 41