src/mirbooking-sequence.c
/**
 * mirbooking_sequence_set_raw_sequence:
 * @self: A #MirbookingSequence
 * @sequence: A sequence of nucleotides
 *
 * Note that the passed sequence is not copied internally and thus, it must
 * live for as long as this object does.
 */
@self: A #MirbookingSequence
@sequence: A sequence of nucleotides

Note that the passed sequence is not copied internally and thus, it must
live for as long as this object does.
@self : A #MirbookingSequence @sequence : A sequence of nucleotides Note that the passed sequence is not copied internally and thus it must live for as long as this object does .
void
mirbooking_sequence_set_raw_sequence (MirbookingSequence *self, GBytes *sequence)
{
    MirbookingSequencePrivate *priv = mirbooking_sequence_get_instance_private (self);
    if (sequence != priv->sequence)
    {
        if (priv->sequence)
            g_bytes_unref (priv->sequence);
        priv->sequence = g_bytes_ref (sequence);
        if (priv->sequence_skips)
        {
            g_ptr_array_unref (priv->sequence_skips);
        }
        gsize sequence_len;
        const guint8* seq = g_bytes_get_data (sequence, &sequence_len);
        priv->sequence_skips = g_ptr_array_sized_new (sequence_len / 80); 
        const guint8* ptr = seq;
        while ((ptr = memchr (ptr, '\n', sequence_len - (ptr - seq))))
        {
            g_ptr_array_add (priv->sequence_skips, (gpointer) ptr);
            ptr++; 
        }
        g_object_notify (G_OBJECT (self), "sequence");
    }
}
void mirbooking_sequence_set_raw_sequence ( MirbookingSequence * self , GBytes * sequence ) { MirbookingSequencePrivate * priv = mirbooking_sequence_get_instance_private ( self ) ; if ( sequence != priv -> sequence ) { if ( priv -> sequence ) g_bytes_unref ( priv -> sequence ) ; priv -> sequence = g_bytes_ref ( sequence ) ; if ( priv -> sequence_skips ) { g_ptr_array_unref ( priv -> sequence_skips ) ; } gsize sequence_len ; const guint8 * seq = g_bytes_get_data ( sequence , & sequence_len ) ; priv -> sequence_skips = g_ptr_array_sized_new ( sequence_len / 80 ) ; const guint8 * ptr = seq ; while ( ( ptr = memchr ( ptr , ' \n ' , sequence_len - ( ptr - seq ) ) ) ) { g_ptr_array_add ( priv -> sequence_skips , ( gpointer ) ptr ) ; ptr ++ ; } g_object_notify ( G_OBJECT ( self ) , " " ) ; } }
mirbooking_sequence_set_raw_sequence:
 @self: A #MirbookingSequence
 @sequence: A sequence of nucleotides
mirbooking_sequence_set_raw_sequence : @self : A #MirbookingSequence @sequence : A sequence of nucleotides
// line feed every 80 characters // jump right after the line feed