Exemplo n.º 1
0
// Write a list of terms to 'output' corresponding to the list of state outputs at this
// position in the branch. Useful for populating a list of inputs for pack_state.
static void get_list_of_state_outputs(Branch* branch, int position, TermList* output)
{
    output->clear();

    if (branch->stateType == NULL)
        return;

    for (int i=0; i < compound_type_get_field_count(branch->stateType); i++) {

        const char* fieldName = compound_type_get_field_name(branch->stateType, i);
        Term* result = find_output_term_for_state_field(branch, fieldName, position);
        output->append(result);
    }
}
Exemplo n.º 2
0
static void list_inputs_to_pack_state(Block* block, int position, TermList* output)
{
    output->clear();

    if (block->stateType == NULL)
        return;

    for (int i=0; i < compound_type_get_field_count(block->stateType); i++) {

        const char* fieldName = compound_type_get_field_name(block->stateType, i);
        Term* result = find_output_term_for_state_field(block, fieldName, position);
        output->append(result);
    }
}