deps/kb_meme/meme-5.0.1/src/seq-reader-from-fasta.c
/****************************************************************************
 * Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder
 * and copy them in to the raw sequence in the SEQ_T object starting at the
 * given buffer offset. 
 ****************************************************************************/
Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder
and copy them in to the raw sequence in the SEQ_T object starting at the
given buffer offset.
Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder and copy them in to the raw sequence in the SEQ_T object starting at the given buffer offset .
void read_one_fasta_segment_from_reader(
   DATA_BLOCK_READER_T *fasta_reader,
   size_t max_size,
   size_t offset,
   SEQ_T *sequence
) {
  assert(sequence != NULL);
  assert(offset < max_size);
  char *raw_sequence = get_raw_sequence(sequence);
  if (raw_sequence == NULL) {
    raw_sequence = mm_malloc(sizeof(char) * max_size + 1);
    raw_sequence[0] = 0;
  }
  bool is_complete = read_raw_sequence_from_reader(
    fasta_reader,
    max_size - offset,
    raw_sequence + offset
  );
  set_raw_sequence(raw_sequence, is_complete, sequence);
}
void read_one_fasta_segment_from_reader ( DATA_BLOCK_READER_T * fasta_reader , size_t max_size , size_t offset , SEQ_T * sequence ) { assert ( sequence != NULL ) ; assert ( offset < max_size ) ; char * raw_sequence = get_raw_sequence ( sequence ) ; if ( raw_sequence == NULL ) { raw_sequence = mm_malloc ( sizeof ( char ) * max_size + 1 ) ; raw_sequence [ 0 ] = 0 ; } bool is_complete = read_raw_sequence_from_reader ( fasta_reader , max_size - offset , raw_sequence + offset ) ; set_raw_sequence ( raw_sequence , is_complete , sequence ) ; }
Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder
 and copy them in to the raw sequence in the SEQ_T object starting at the
 given buffer offset.
Read up to max_chars letters of one sequence from a DATA_BLOCK_T readder and copy them in to the raw sequence in the SEQ_T object starting at the given buffer offset .
// Get the raw sequence buffer from the SEQ_T // Allocate space for raw sequence if not done yet. // Read a block of sequence charaters into the // raw sequence buffer for the SEQ_T, starting at offset.