Major update: New column type to store sequence qualities. Closes #41

This commit is contained in:
Celine Mercier
2016-05-20 16:45:22 +02:00
parent ffff91e76c
commit 3b59043ea8
33 changed files with 962 additions and 267 deletions

View File

@ -14,6 +14,7 @@
#include <stdio.h>
#include <math.h>
#include "char_str_indexer.h"
#include "obiblob.h"
#include "obiblob_indexer.h"
#include "obidebug.h"
@ -25,24 +26,16 @@
Obi_blob_p obi_str_to_blob(const char* value)
{
Obi_blob_p value_b;
int32_t length;
int32_t length;
// Compute the number of bytes on which the value will be encoded
length = strlen(value) + 1; // +1 to store \0 at the end (makes retrieving faster)
value_b = obi_blob((byte_t*)value, ELEMENT_SIZE_STR, length, length);
if (value_b == NULL)
{
obidebug(1, "\nError encoding a character string in a blob");
return NULL;
}
return value_b;
return obi_blob((byte_t*)value, ELEMENT_SIZE_STR, length, length);
}
char* obi_blob_to_str(Obi_blob_p value_b)
const char* obi_blob_to_str(Obi_blob_p value_b)
{
return value_b->value;
}
@ -67,7 +60,7 @@ 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)
const char* obi_retrieve_char_str(Obi_indexer_p indexer, index_t idx)
{
Obi_blob_p value_b;