char_str_indexer.h 1.41 KB
Newer Older
Celine Mercier's avatar
Celine Mercier committed
1 2 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 48 49 50 51 52 53 54 55 56 57 58 59 60 61
/****************************************************************************
 * DNA sequence indexer header file	                                        *
 ****************************************************************************/

/**
 * @file dna_seq_indexer.h
 * @author Celine Mercier
 * @date April 12th 2016
 * @brief Header file for the functions handling the indexing of DNA sequences.
 */


#ifndef CHAR_STR_INDEXER_H_
#define CHAR_STR_INDEXER_H_


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

#include "obitypes.h"
#include "obiblob.h"
#include "obiblob_indexer.h"


/**
 * @brief Converts a character string to a blob.
 *
 * @warning The blob must be freed by the caller.
 *
 * @param value The character string to convert.
 *
 * @returns A pointer to the blob created.
 * @retval NULL if an error occurred.
 *
 * @since October 2015
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
Obi_blob_p obi_str_to_blob(char* value);


/**
 * @brief Converts a blob to a character string.
 *
 * @param value_b The blob to convert.
 *
 * @returns A pointer to the character string contained in the blob.
 *
 * @since October 2015
 * @author Celine Mercier (celine.mercier@metabarcoding.org)
 */
const char* obi_blob_to_str(Obi_blob_p value_b);


// TODO doc
index_t obi_index_char_str(Obi_indexer_p indexer, const char* value);

char* obi_retrieve_char_str(Obi_indexer_p indexer, index_t idx);


#endif /* CHAR_STR_INDEXER_H_ */