3#ifndef PRINTLINES_ALLOWED
4#define PRINTLINES_ALLOWED 0
7static const char *FNAME =
"kest_sequence.c";
16 sequence->
name = NULL;
24 sequence->view_page = NULL;
27 sequence->
fname[0] = 0;
34 #ifdef KEST_ENABLE_REPRESENTATIONS
35 sequence->file_rep.representee = sequence;
36 sequence->file_rep.representer = NULL;
38 sequence->representations = NULL;
39 kest_representation_pll_safe_append(&sequence->representations, &sequence->file_rep);
47 if (!sequence || !profile)
55 new_node->
data = profile;
56 new_node->
next = NULL;
57 new_node->
prev = NULL;
71 current = current->
next;
74 current->
next = new_node;
75 new_node->
prev = current;
77 profile->sequence = sequence;
85 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
87 if (!sequence || !profile)
91 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
98 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
99 new_node->
data = profile;
100 new_node->
next = NULL;
101 new_node->
prev = NULL;
104 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
111 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
116 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
121 current = current->
next;
125 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
126 current->
next = new_node;
127 new_node->
prev = current;
130 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
133 KEST_PRINTF(
"sequence_append_profile_rp, line %d\n", __LINE__);
143 if (pos < 0 || new_pos < 0)
149 for (
int i = 0; i < pos; i++)
154 target = target->
next;
175 for (
int i = 0; i < new_pos; i++)
179 current = current->
next;
206 if (current->
data == profile)
209 current = current->
next;
253 #ifdef KEST_ENABLE_UI
254 if (!sequence || !listing)
257 kest_menu_item_pll *nl = kest_menu_item_pll_append(sequence->
listings, listing);
295 if (!sequence || !profile)
310 while (current && !found)
312 if (current->
data == profile)
315 current = current->
next;
352 KEST_PRINTF(
"Can't regress sequence; sequence at start already\n");
368 KEST_PRINTF(
"advancing sequence. sequence = %p\n", sequence);
388 KEST_PRINTF(
"Can't regress sequence; sequence at end already\n");
396 KEST_PRINTF(
"New sequence->position: %p. sequence->position->data: %p\n",
445 if (current->
data && current->
data == profile)
454 current = current->
next;
463 #ifdef KEST_ENABLE_UI
467 kest_representation_pll *nl = kest_representation_pll_append(sequence->representations, rep);
470 sequence->representations = nl;
482 #ifdef KEST_ENABLE_REPRESENTATIONS
486 kest_representation_pll *current = sequence->representations;
490 KEST_PRINTF(
"Sequence %p has no representations.\n", sequence);
499 KEST_PRINTF(
"Seq %p rep %d: {.representer = %p, representee = %p, update = %p}\n",
500 sequence, i, current->data->representer, current->data->representee, current->data->update);
503 current = current->next;
508 if (sequence->representations)
void kest_free(void *ptr)
void * kest_alloc(size_t size)
int set_active_profile_from_sequence(kest_profile *profile)
#define ERR_FEATURE_DISABLED
int save_sequence(kest_sequence *sequence)
#define IMPLEMENT_LINKED_PTR_LIST(X)
void kest_free_profile(kest_profile *profile)
int queue_representation_list_update(kest_representation_pll *reps)
int kest_sequence_regress(kest_sequence *sequence)
int kest_sequence_activate_at(kest_sequence *sequence, kest_profile *profile)
int kest_sequence_stop(kest_sequence *sequence)
int init_m_sequence(kest_sequence *sequence)
int kest_sequence_stop_from_profile(kest_sequence *sequence)
int kest_sequence_remove_profile(kest_sequence *sequence, kest_profile *profile)
int kest_sequence_add_representation(kest_sequence *sequence, kest_representation *rep)
void free_sequence(kest_sequence *sequence)
int kest_sequence_begin_at(kest_sequence *sequence, kest_profile *profile)
int kest_sequence_advance(kest_sequence *sequence)
int kest_sequence_delete_profile(kest_sequence *sequence, kest_profile *profile)
int kest_sequence_move_profile(kest_sequence *sequence, int pos, int new_pos)
void kest_sequence_file_rep_update(void *representer, void *representee)
int kest_sequence_update_representations(kest_sequence *sequence)
int sequence_append_profile(kest_sequence *sequence, kest_profile *profile)
int kest_sequence_add_menu_listing(kest_sequence *sequence, kest_menu_item *listing)
seq_profile_ll * sequence_append_profile_rp(kest_sequence *sequence, kest_profile *profile)
int kest_sequence_begin(kest_sequence *sequence)
seq_profile_ll * position
char fname[KEST_FILENAME_LEN]
struct kest_menu_item_pll * listings
seq_profile_ll * profiles
struct seq_profile_ll * next
struct seq_profile_ll * prev