github.com/matrixorigin/matrixone@v1.2.0/cgo/mo.c (about)

     1  /* 
     2   * Copyright 2021 Matrix Origin
     3   *
     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   */
    16  
    17  #include "mo_impl.h"
    18  
    19  void Bitmap_Add(uint64_t *p, uint64_t pos) {
    20      bitmap_set(p, pos);
    21  }
    22  void Bitmap_Remove(uint64_t *p, uint64_t pos) {
    23      bitmap_clear(p, pos);
    24  }
    25  bool Bitmap_Contains(uint64_t *p, uint64_t pos) {
    26      if (p != NULL) {
    27          return bitmap_test(p, pos);
    28      }
    29      return false;
    30  }
    31  
    32  bool Bitmap_IsEmpty(uint64_t *p, uint64_t nbits) {
    33      return bitmap_empty(p, nbits);
    34  }
    35  uint64_t Bitmap_Count(uint64_t *p, uint64_t nbits) {
    36      return bitmap_count(p, nbits);
    37  }
    38  
    39  void Bitmap_And(uint64_t *dst, uint64_t *a, uint64_t *b, uint64_t nbits) {
    40      bitmap_and(dst, a, b, nbits);
    41  }
    42  void Bitmap_Or(uint64_t *dst, uint64_t *a, uint64_t *b, uint64_t nbits) {
    43      bitmap_or(dst, a, b, nbits);
    44  }
    45  void Bitmap_Not(uint64_t *dst, uint64_t *a, uint64_t nbits) {
    46      bitmap_not(dst, a, nbits);
    47  }