• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"use strict";
2/*
3 * Copyright (c) 2022-2025 Huawei Device Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16Object.defineProperty(exports, "__esModule", { value: true });
17exports.bitsToPtr = exports.ptrToBits = exports.isSamePtr = exports.ptrToString = exports.isNullPtr = exports.nullptr = void 0;
18exports.nullptr = 0;
19function isNullPtr(value) {
20    return (value == exports.nullptr);
21}
22exports.isNullPtr = isNullPtr;
23function ptrToString(ptr) {
24    if (ptr === 0)
25        return "0x0";
26    const hex = ptr.toString(16).padStart(8, "0");
27    return `0x${hex}`;
28}
29exports.ptrToString = ptrToString;
30function isSamePtr(a, b) {
31    return a === b;
32}
33exports.isSamePtr = isSamePtr;
34function ptrToBits(ptr) {
35    let result = new Uint32Array(2);
36    result[0] = ptr;
37    return result;
38}
39exports.ptrToBits = ptrToBits;
40function bitsToPtr(array, offset) {
41    return array[offset];
42}
43exports.bitsToPtr = bitsToPtr;
44//# sourceMappingURL=Wrapper.js.map