Utility functions for efficient bit operations. More...
#include "libts.h"
Go to the source code of this file.
Functions | |
static int | ink_ffs (int n) |
Find First (bit) Set. | |
static int | bitops_first_set (unsigned char *start, unsigned char *end, unsigned char **p) |
Returns the index of the first bit (least significant bit), set "1" for each char in the range (start end). | |
static int | bitops_first_unset (unsigned char *start, unsigned char *end, unsigned char **p) |
Returns the index of the first bit (least significant bit), unset "0" for each char in the range (start end). | |
static int | bitops_next_set (unsigned char *start, unsigned char *end, int offset) |
Returns the index of the first bit (least significant bit), set "1" for each char in the range (start end). | |
static int | bitops_next_unset (unsigned char *start, unsigned char *end, int offset) |
static int | bitops_count (unsigned char *start, unsigned char *end) |
static void | bitops_union (unsigned char *s1, unsigned char *s2, int len) |
static unsigned char | bitops_set (unsigned char val, int bit) |
static void | bitops_set (unsigned char *val, int bit) |
static unsigned char | bitops_unset (unsigned char val, int bit) |
static void | bitops_unset (unsigned char *val, int bit) |
static int | bitops_isset (unsigned char val, int bit) |
static int | bitops_isset (unsigned char *val, int bit) |
Utility functions for efficient bit operations.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file Bitops.h.
static int bitops_count | ( | unsigned char * | start, | |
unsigned char * | end | |||
) | [inline, static] |
Definition at line 204 of file Bitops.h.
References bit_count_table.
static int bitops_first_set | ( | unsigned char * | start, | |
unsigned char * | end, | |||
unsigned char ** | p | |||
) | [inline, static] |
Returns the index of the first bit (least significant bit), set "1" for each char in the range (start end).
start | pointer to the first character. | |
end | pointer to the location after the last character. | |
p | (if not null) returns the location of the first char that has a bit set. |
Definition at line 53 of file Bitops.h.
References bit_table.
static int bitops_first_unset | ( | unsigned char * | start, | |
unsigned char * | end, | |||
unsigned char ** | p | |||
) | [inline, static] |
Returns the index of the first bit (least significant bit), unset "0" for each char in the range (start end).
start | pointer to the first character. | |
end | pointer to the location after the last character. | |
p | (if not null) returns the location of the first char that has a bit unset. |
Definition at line 88 of file Bitops.h.
References bit_table.
static int bitops_isset | ( | unsigned char | val, | |
int | bit | |||
) | [inline, static] |
static int bitops_isset | ( | unsigned char * | val, | |
int | bit | |||
) | [inline, static] |
static int bitops_next_set | ( | unsigned char * | start, | |
unsigned char * | end, | |||
int | offset | |||
) | [inline, static] |
Returns the index of the first bit (least significant bit), set "1" for each char in the range (start end).
start | pointer to the first character. | |
end | pointer to the location after the last character. | |
offset |
Definition at line 122 of file Bitops.h.
References bit_table.
static int bitops_next_unset | ( | unsigned char * | start, | |
unsigned char * | end, | |||
int | offset | |||
) | [inline, static] |
static unsigned char bitops_set | ( | unsigned char | val, | |
int | bit | |||
) | [inline, static] |
static void bitops_set | ( | unsigned char * | val, | |
int | bit | |||
) | [inline, static] |
static void bitops_union | ( | unsigned char * | s1, | |
unsigned char * | s2, | |||
int | len | |||
) | [inline, static] |
static void bitops_unset | ( | unsigned char * | val, | |
int | bit | |||
) | [inline, static] |
static unsigned char bitops_unset | ( | unsigned char | val, | |
int | bit | |||
) | [inline, static] |