/ocr/ocrservice/jni/hydrogen/include/leptonica/bbuffer.h
http://eyes-free.googlecode.com/ · C++ Header · 46 lines · 11 code · 5 blank · 30 comment · 0 complexity · 55646e641e18bbf75690ed41cf262337 MD5 · raw 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 */