static void select_current_item() { // state screen if (current_item <= 0) { if(state == 2) { // if connected then go to options settings_start(); } else { // start connection process connect_start(); } } else queue_item(current_item - 1); }
// Works identically to queue_item, but accepts a non-TORALinkedList item // and wraps it silently before adding it to the target queue void queue_raw_item(TORALinkedList **queue, char *name, void *item) { assert(item); TORALinkedList *link_item = tora_malloc(sizeof(TORALinkedList)); if(!link_item) { TORA_RUNTIME_EXCEPTION("Failed to malloc linked list item for queue insertion"); } link_item->instance_type = TORAInstanceTypeLinkedList; link_item->ref_count = 0; link_item->name = name ? tora_retain(new_string_expression(name)) : NULL; link_item->value = tora_retain(item); link_item->next = NULL; queue_item(queue, link_item); }