Beispiel #1
0
gtf_row_t* gtf_row_alloc()
{
    gtf_row_t* row = malloc_or_die(sizeof(gtf_row_t));

    row->seqname = str_alloc();
    row->source  = str_alloc();
    row->feature = str_alloc();
    row->start      = -1;
    row->end        = -1;
    row->score      = 0.0;
    row->strand     = strand_na;
    row->frame      = -1;
    row->attributes = str_map_create();

    return row;
}
Beispiel #2
0
void setup()
{
    fprintf(stderr, "generating %zu keys ... ", n);
    xs = malloc(n * sizeof(char*));
    size_t i;
    size_t m;
    for (i = 0; i < n; ++i) {
        m = m_low + rand() % (m_high - m_low);
        xs[i] = malloc(m + 1);
        randstr(xs[i], m);
    }

    T = ahtable_create();
    M = str_map_create();
    fprintf(stderr, "done.\n");
}