tesseract  3.03
/usr/local/google/home/jbreiden/tesseract-ocr-read-only/cutil/bitvec.cpp File Reference
#include "bitvec.h"
#include <stdio.h>
#include "emalloc.h"
#include "freelist.h"
#include "tprintf.h"

Go to the source code of this file.

Functions

BIT_VECTOR ExpandBitVector (BIT_VECTOR Vector, int NewNumBits)
void FreeBitVector (BIT_VECTOR BitVector)
BIT_VECTOR NewBitVector (int NumBits)

Function Documentation

BIT_VECTOR ExpandBitVector ( BIT_VECTOR  Vector,
int  NewNumBits 
)

This routine uses realloc to increase the size of the specified bit vector.

Globals:

  • none
Parameters:
Vectorbit vector to be expanded
NewNumBitsnew size of bit vector
Returns:
New expanded bit vector.
Note:
Exceptions: none
History: Fri Nov 16 10:11:16 1990, DSJ, Created.

Definition at line 48 of file bitvec.cpp.

                                                              {
  return ((BIT_VECTOR) Erealloc(Vector,
    sizeof(Vector[0]) * WordsInVectorOfSize(NewNumBits)));
}                                /* ExpandBitVector */
void FreeBitVector ( BIT_VECTOR  BitVector)

This routine frees a bit vector. It also decrements the global counter that keeps track of the number of bit vectors allocated. If BitVector is NULL, then the count is printed to stderr.

Globals:

  • BitVectorCount count of number of bit vectors allocated
Parameters:
BitVectorbit vector to be freed
Note:
Exceptions: none
History: Tue Oct 23 16:46:09 1990, DSJ, Created.

Definition at line 55 of file bitvec.cpp.

                                         {
  if (BitVector) {
    Efree(BitVector);
  }
}                                /* FreeBitVector */
BIT_VECTOR NewBitVector ( int  NumBits)

Allocate and return a new bit vector large enough to hold the specified number of bits.

Globals:

  • BitVectorCount number of bit vectors allocated
Parameters:
NumBitsnumber of bits in new bit vector
Returns:
New bit vector.
Note:
Exceptions: none
History: Tue Oct 23 16:51:27 1990, DSJ, Created.

Definition at line 90 of file bitvec.cpp.

                                     {
  return ((BIT_VECTOR) Emalloc(sizeof(uinT32) *
    WordsInVectorOfSize(NumBits)));
}                                /* NewBitVector */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines