/*
+ * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
+ * Copyright (c) 2002-2007, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
- * Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe
- * Copyright (c) 2005, Herv� Drolon, FreeImage Team
- * Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
+ * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
+ * Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* POSSIBILITY OF SUCH DAMAGE.
*/
-
#ifndef __BIO_H
#define __BIO_H
/**
Individual bit input-output stream (BIO)
*/
typedef struct opj_bio {
- /** pointer to the start of the buffer */
- unsigned char *start;
- /** pointer to the end of the buffer */
- unsigned char *end;
- /** pointer to the present position in the buffer */
- unsigned char *bp;
- /** temporary place where each byte is read or written */
- unsigned int buf;
- /** coder : number of bits free to write. decoder : number of bits read */
- int ct;
+ /** pointer to the start of the buffer */
+ unsigned char *start;
+ /** pointer to the end of the buffer */
+ unsigned char *end;
+ /** pointer to the present position in the buffer */
+ unsigned char *bp;
+ /** temporary place where each byte is read or written */
+ unsigned int buf;
+ /** coder : number of bits free to write. decoder : number of bits read */
+ int ct;
} opj_bio_t;
-/** @name Local static functions */
-/*@{*/
-/* ----------------------------------------------------------------------- */
-/**
-Write a bit
-@param bio BIO handle
-@param b Bit to write (0 or 1)
-*/
-static void bio_putbit(opj_bio_t *bio, int b);
-/**
-Read a bit
-@param bio BIO handle
-@return Returns the read bit
-*/
-static int bio_getbit(opj_bio_t *bio);
-/**
-Write a byte
-@param bio BIO handle
-@return Returns 0 if successful, returns 1 otherwise
-*/
-static int bio_byteout(opj_bio_t *bio);
-/**
-Read a byte
-@param bio BIO handle
-@return Returns 0 if successful, returns 1 otherwise
-*/
-static int bio_bytein(opj_bio_t *bio);
-/* ----------------------------------------------------------------------- */
-/*@}*/
-
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
Create a new BIO handle
@return Returns a new BIO handle if successful, returns NULL otherwise
*/
-opj_bio_t* bio_create();
+opj_bio_t* bio_create(void);
/**
Destroy a previously created BIO handle
@param bio BIO handle to destroy