tesseract/include/bbuffer.h
theraysmith 530fa19672 Changes to include for 3.00
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@295 d0cd1f9f-072b-0410-8dd7-cf729c803f20
2009-07-11 02:24:22 +00:00

47 lines
2.0 KiB
C
Executable File

/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
- This software is distributed in the hope that it will be
- useful, but with NO WARRANTY OF ANY KIND.
- No author or distributor accepts responsibility to anyone for the
- consequences of using this software, or for whether it serves any
- particular purpose or works at all, unless he or she says so in
- writing. Everyone is granted permission to copy, modify and
- redistribute this source code, for commercial or non-commercial
- purposes, with the following restrictions: (1) the origin of this
- source code must not be misrepresented; (2) modified versions must
- be plainly marked as such; and (3) this notice may not be removed
- or altered from any source or modified source distribution.
*====================================================================*/
#ifndef LEPTONICA_BBUFFER_H
#define LEPTONICA_BBUFFER_H
/*
* bbuffer.h
*
* Expandable byte buffer for reading data in from memory and
* writing data out to other memory.
*
* This implements a queue of bytes, so data read in is put
* on the "back" of the queue (i.e., the end of the byte array)
* and data written out is taken from the "front" of the queue
* (i.e., from an index marker "nwritten" that is initially set at
* the beginning of the array.) As usual with expandable
* arrays, we keep the size of the allocated array and the
* number of bytes that have been read into the array.
*
* For implementation details, see bbuffer.c.
*/
struct ByteBuffer
{
l_int32 nalloc; /* size of allocated byte array */
l_int32 n; /* number of bytes read into to the array */
l_int32 nwritten; /* number of bytes written from the array */
l_uint8 *array; /* byte array */
};
typedef struct ByteBuffer BBUFFER;
#endif /* LEPTONICA_BBUFFER_H */