Renamed "Obi_byte_arrays" to "Obiblobs" and moved Obiblob functions to

separate obiblob.c and obiblob.h files
This commit is contained in:
Celine Mercier
2016-04-12 11:21:14 +02:00
parent c225cfd8b6
commit 375bfcce8a
8 changed files with 304 additions and 249 deletions

View File

@ -6,7 +6,7 @@
* @file obiavl.h
* @author Celine Mercier
* @date December 3rd 2015
* @brief Header file for handling AVL trees for storing and retrieving byte arrays (i.e. coding for character strings).
* @brief Header file for handling AVL trees for storing and retrieving blobs (i.e. coding for character strings).
*/
@ -23,6 +23,7 @@
#include <stdbool.h>
#include "obidms.h"
#include "obiblob.h"
#include "obitypes.h"
#include "bloom.h"
#include "utils.h"
@ -314,28 +315,28 @@ int obi_close_avl_group(OBIDMS_avl_group_p avl_group);
/**
* @brief Recovers a value (byte array) in an AVL tree.
* @brief Recovers a value (blob) in an AVL tree.
*
* @warning The byte array recovered must be decoded to get the original value.
* @warning The blob recovered must be decoded to get the original value.
*
* @param avl A pointer to the AVL tree.
* @param index The index of the value in the data array.
*
* @returns A pointer to the byte array recovered.
* @returns A pointer to the blob recovered.
*
* @since December 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obi_byte_array_p obi_avl_get(OBIDMS_avl_p avl, index_t index);
Obi_blob_p obi_avl_get(OBIDMS_avl_p avl, index_t index);
/**
* @brief Adds a value (byte array) in an AVL tree NOT checking first if it is already in it. // TODO to discuss
* @brief Adds a value (blob) in an AVL tree NOT checking first if it is already in it. // TODO to discuss
*
* @warning The value given must be already be encoded into a byte array structure (Obi_byte_array_t).
* @warning The value given must be already be encoded into a blob structure (Obi_blob_t).
*
* @param avl A pointer to the AVL tree.
* @param value The byte array to add in the AVL tree.
* @param value The blob to add in the AVL tree.
*
* @returns The index of the value newly added in the AVL tree.
* @retval -1 if an error occurred.
@ -343,16 +344,16 @@ Obi_byte_array_p obi_avl_get(OBIDMS_avl_p avl, index_t index);
* @since December 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
index_t obi_avl_add(OBIDMS_avl_p avl, Obi_byte_array_p value);
index_t obi_avl_add(OBIDMS_avl_p avl, Obi_blob_p value);
/**
* @brief Finds a value (byte array) in an AVL tree.
* @brief Finds a value (blob) in an AVL tree.
*
* @warning The value given must be already be encoded into a byte array structure (Obi_byte_array_t).
* @warning The value given must be already be encoded into a blob structure (Obi_blob_t).
*
* @param avl A pointer to the AVL tree.
* @param value The byte array to add in the AVL tree.
* @param value The blob to add in the AVL tree.
*
* @returns The data index of the value.
* @retval -1 if the value is not in the tree.
@ -360,32 +361,32 @@ index_t obi_avl_add(OBIDMS_avl_p avl, Obi_byte_array_p value);
* @since December 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
index_t obi_avl_find(OBIDMS_avl_p avl, Obi_byte_array_p value);
index_t obi_avl_find(OBIDMS_avl_p avl, Obi_blob_p value);
/**
* @brief Recovers a value (byte array) in an AVL tree.
* @brief Recovers a value (blob) in an AVL tree.
*
* @warning The byte array recovered must be decoded to get the original value.
* @warning The blob recovered must be decoded to get the original value.
*
* @param avl_group A pointer to the AVL tree.
* @param index The index of the value in the data array.
*
* @returns A pointer to the byte array recovered.
* @returns A pointer to the blob recovered.
*
* @since April 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
Obi_byte_array_p obi_avl_group_get(OBIDMS_avl_group_p avl_group, index_t idx);
Obi_blob_p obi_avl_group_get(OBIDMS_avl_group_p avl_group, index_t idx);
/**
* @brief Adds a value (byte array) in an AVL tree group, checking if it is already in it.
* @brief Adds a value (blob) in an AVL tree group, checking if it is already in it.
*
* @warning The value given must be already be encoded into a byte array structure (Obi_byte_array_t).
* @warning The value given must be already be encoded into a blob structure (Obi_blob_t).
*
* @param avl_group A pointer to the AVL tree group.
* @param value The byte array to add in the AVL tree group.
* @param value The blob to add in the AVL tree group.
*
* @returns The index of the value newly added in the AVL tree group.
* @retval -1 if an error occurred.
@ -393,7 +394,7 @@ Obi_byte_array_p obi_avl_group_get(OBIDMS_avl_group_p avl_group, index_t idx);
* @since April 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
index_t obi_avl_group_add(OBIDMS_avl_group_p avl_group, Obi_byte_array_p value);
index_t obi_avl_group_add(OBIDMS_avl_group_p avl_group, Obi_blob_p value);
#endif /* OBIAVL_H_ */