tesseract
3.05.02
bitvec.cpp
Go to the documentation of this file.
1
/******************************************************************************
2
** Filename: bitvec.c
3
** Purpose: Routines for manipulating bit vectors
4
** Author: Dan Johnson
5
** History: Thu Mar 15 10:37:27 1990, DSJ, Created.
6
**
7
** (c) Copyright Hewlett-Packard Company, 1988.
8
** Licensed under the Apache License, Version 2.0 (the "License");
9
** you may not use this file except in compliance with the License.
10
** You may obtain a copy of the License at
11
** http://www.apache.org/licenses/LICENSE-2.0
12
** Unless required by applicable law or agreed to in writing, software
13
** distributed under the License is distributed on an "AS IS" BASIS,
14
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
** See the License for the specific language governing permissions and
16
** limitations under the License.
17
******************************************************************************/
18
19
/*-----------------------------------------------------------------------------
20
Include Files and Type Defines
21
-----------------------------------------------------------------------------*/
22
#include "
bitvec.h
"
23
24
#include <stdio.h>
25
26
#include "
emalloc.h
"
27
#include "
tprintf.h
"
28
29
/*-----------------------------------------------------------------------------
30
Public Code
31
-----------------------------------------------------------------------------*/
32
/*---------------------------------------------------------------------------*/
47
BIT_VECTOR
ExpandBitVector
(
BIT_VECTOR
Vector,
int
NewNumBits) {
48
return
((
BIT_VECTOR
)
Erealloc
(Vector,
49
sizeof
(Vector[0]) *
WordsInVectorOfSize
(NewNumBits)));
50
}
/* ExpandBitVector */
51
52
53
/*---------------------------------------------------------------------------*/
54
void
FreeBitVector
(
BIT_VECTOR
BitVector) {
69
if
(BitVector) {
70
Efree
(BitVector);
71
}
72
}
/* FreeBitVector */
73
74
75
/*---------------------------------------------------------------------------*/
89
BIT_VECTOR
NewBitVector
(
int
NumBits) {
90
return
((
BIT_VECTOR
)
Emalloc
(
sizeof
(
uinT32
) *
91
WordsInVectorOfSize
(NumBits)));
92
}
/* NewBitVector */
BIT_VECTOR
uinT32 * BIT_VECTOR
Definition:
bitvec.h:28
Efree
void Efree(void *ptr)
Definition:
emalloc.cpp:79
NewBitVector
BIT_VECTOR NewBitVector(int NumBits)
Definition:
bitvec.cpp:89
WordsInVectorOfSize
#define WordsInVectorOfSize(NumBits)
Definition:
bitvec.h:63
bitvec.h
FreeBitVector
void FreeBitVector(BIT_VECTOR BitVector)
Definition:
bitvec.cpp:54
emalloc.h
Erealloc
void * Erealloc(void *ptr, int size)
Definition:
emalloc.cpp:64
tprintf.h
uinT32
unsigned int uinT32
Definition:
host.h:36
Emalloc
void * Emalloc(int Size)
Definition:
emalloc.cpp:47
ExpandBitVector
BIT_VECTOR ExpandBitVector(BIT_VECTOR Vector, int NewNumBits)
Definition:
bitvec.cpp:47
cutil
bitvec.cpp
Generated on Mon Oct 29 2018 11:27:49 for tesseract by
1.8.14