obiblob.h 1.57 KB
Newer Older
1
/****************************************************************************
2
 * Obiblob header file	                                                    *
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
 ****************************************************************************/

/**
 * @file obiblob.h
 * @author Celine Mercier
 * @date November 18th 2015
 * @brief Header file for handling Obi_blob structures.
 */


#ifndef OBIBLOB_H_
#define OBIBLOB_H_


#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>

#include "obitypes.h"


#define ELEMENT_SIZE_STR (8)								/**< The size of an element from a value of type character string.
                              	  	 	 	 	 	 	 	 */
#define ELEMENT_SIZE_SEQ_2 (2)								/**< The size of an element from a value of type DNA sequence encoded on 2 bits.
                              	  	 	 	 	 	 	 	 */
#define ELEMENT_SIZE_SEQ_4 (4)								/**< The size of an element from a value of type DNA sequence encoded on 4 bits.
                              	  	 	 	 	 	 	 	 */


/**
 * @brief Blob structure.
 *  TODO
 */
typedef struct Obi_blob {
	uint8_t  element_size;		 	/**< Size in bits of one element from the value.
	 	 	 	 	 	 	 	 	 */
	int32_t  length_encoded_value;	/**< Length in bytes of the encoded value.
	 	 	 	 	 	 	 	 	 */
	int32_t  length_decoded_value;	/**< Length in bytes of the decoded value.
	 	 	 	 	 	 	 	 	 */
	byte_t   value[];				/**< Encoded value.
	 	 	 	 	 	 	 	 	 */
} Obi_blob_t, *Obi_blob_p;


Celine Mercier's avatar
Celine Mercier committed
48 49 50 51 52

// TODO doc
Obi_blob_p obi_blob(byte_t* encoded_value, uint8_t element_size, int32_t length_encoded_value, int32_t length_decoded_value);


53 54
#endif /* OBIBLOB_H_ */