Leptonica 1.54
|
Input: ba newdata (byte array to be appended) size (size of data array) Return: 0 if OK, 1 on error
Input: ba str (null-terminated string to be appended) Return: 0 if OK, 1 on error
Input: bas (source lba) copyflag (L_COPY, L_CLONE) Return: clone or copy of bas, or null on error
Notes: (1) If cloning, up the refcount and return a ptr to .
Input: ba &size (<returned> size of data in lba) Return: copy of data in use in the data array, or null on error.
Notes: (1) The returned data is owned by the caller. The input still owns the original data array.
L_BYTEA* l_byteaCreate | ( | size_t | nbytes | ) |
Input: n (determines initial size of data array) Return: l_bytea, or null on error
Notes: (1) The allocated array is n + 1 bytes. This allows room for null termination.
void l_byteaDestroy | ( | L_BYTEA ** | pba | ) |
Input: &ba (<will be="" set="" to="" null="" before="" returning>="">) Return: void
Notes: (1) Decrements the ref count and, if 0, destroys the lba. (2) Always nulls the input ptr. (3) If the data has been previously removed, the lba will have been nulled, so this will do nothing.
Input: ba size (new size of lba data array) Return: 0 if OK; 1 on error
Input: ba sequence (subarray of bytes to find in data) seqlen (length of sequence, in bytes) &na (<return> byte positions of each occurrence of ) Return: 0 if OK, 1 on error
Input: ba &size (<returned> size of data in lba) Return: ptr to existing data array, or NULL on error
Notes: (1) The returned ptr is owned by . Do not free it!
size_t l_byteaGetSize | ( | L_BYTEA * | ba | ) |
Input: ba Return: size of stored byte array, or 0 on error
L_BYTEA* l_byteaInitFromFile | ( | const char * | fname | ) |
Input: fname Return: l_bytea, or null on error
Input: data (to be copied to the array) size (amount of data) Return: l_bytea, or null on error
L_BYTEA* l_byteaInitFromStream | ( | FILE * | fp | ) |
Input: stream Return: l_bytea, or null on error
Input: ba1 &ba2 (data array is added to the one in ba1, and then ba2 is destroyed) Return: 0 if OK, 1 on error
Notes: (1) It is a no-op, not an error, for to be null.
Input: ba1 (lba to split; array bytes nulled beyond the split loc) splitloc (location in ba1 to split; ba2 begins there) &ba2 (<return> with data starting at splitloc) Return: 0 if OK, 1 on error
Input: fname (output file) ba startloc (first byte to output) endloc (last byte to output; use 0 to write to the end of the data array) Return: 0 if OK, 1 on error
Input: stream (opened for binary write) ba startloc (first byte to output) endloc (last byte to output; use 0 to write to the end of the data array) Return: 0 if OK, 1 on error
const l_int32 INITIAL_ARRAYSIZE = 200 [static] |