CattleConfiguration: Cattle Reference Manual

## CattleConfiguration CattleConfiguration — Configuration for an interpreter |

## Functions

CattleConfiguration * | cattle_configuration_new ()
void | cattle_configuration_set_end_of_input_action ()
CattleEndOfInputAction | cattle_configuration_get_end_of_input_action ()
void | cattle_configuration_set_debug_is_enabled ()
gboolean | cattle_configuration_get_debug_is_enabled ()

## Properties

gboolean | debug-is-enabled | Read / Write
CattleEndOfInputAction | end-of-input-action | Read / Write

## Types and Values

enum | CattleEndOfInputAction
struct | CattleConfiguration

## Object Hierarchy

        GEnum
        ╰── CattleEndOfInputAction
        GObject
        ╰── CattleConfiguration

## Includes

    #include <cattle/cattle.h>

## Description

A CattleConfiguration contains the configuration for a CattleInterpreter.

## Functions

### cattle_configuration_new ()

    CattleConfiguration *
    cattle_configuration_new (void);

Create and initialize a new configuration.

A single configuration object can be shared between multiple interpreters, but modifying it while an interpreter is running can lead to unexpected and unpredictable results.

#### Returns

a new CattleConfiguration.

[transfer full]

### cattle_configuration_set_end_of_input_action ()

    void
    cattle_configuration_set_end_of_input_action
                                   (CattleConfiguration *configuration,
                                    CattleEndOfInputAction action);

Set the action to be performed when the end of input is reached.

Accepted values are from the CattleEndOfInputAction enumeration.

#### Parameters

configuration | a CattleConfiguration |
action | the action to be performed |

### cattle_configuration_get_end_of_input_action ()

    CattleEndOfInputAction
    cattle_configuration_get_end_of_input_action
                                   (CattleConfiguration *configuration);

Get the action to be performed when the end of input is reached. See `cattle_configuration_set_end_of_input_action()`.

#### Parameters

configuration | a CattleConfiguration |

#### Returns

the current action

### cattle_configuration_set_debug_is_enabled ()

    void
    cattle_configuration_set_debug_is_enabled
                                   (CattleConfiguration *configuration,
                                    gboolean enabled);

Set the status of the debugging support. It is disabled by default.

If debugging is disabled, instructions whose value is `CATTLE_INSTRUCTION_DEBUG` will be ignored by the interpreter.

#### Parameters

configuration | a CattleConfiguration |
enabled | `TRUE` to enable debug, `FALSE` otherwise |

### cattle_configuration_get_debug_is_enabled ()

    gboolean
    cattle_configuration_get_debug_is_enabled
                                   (CattleConfiguration *configuration);

Get the current status of the debugging support. See `cattle_configuration_set_debug_is_enabled()`.

#### Parameters

configuration | a CattleConfiguration |

#### Returns

`TRUE` if debugging is enabled, `FALSE` otherwise

## Types and Values

### enum CattleEndOfInputAction

Possible actions to be performed by a CattleInterpreter when the end of input is reached.

#### Members

CATTLE_END_OF_INPUT_ACTION_STORE_ZERO | Store a zero in the current cell. This is the default behaviour |
CATTLE_END_OF_INPUT_ACTION_STORE_EOF | Store `CATTLE_EOF` in the current cell |
CATTLE_END_OF_INPUT_ACTION_DO_NOTHING | Do nothing. |

### struct CattleConfiguration

    struct CattleConfiguration;

Opaque data structure representing a configuration. It should never be accessed directly.

## Property Details

### The `“debug-is-enabled”` property

      “debug-is-enabled”         gboolean

If `FALSE`, instructions whose value is `CATTLE_INSTRUCTION_DEBUG` are not executed by the interpreter.

Changes to this property are not notified.

Owner: CattleConfiguration

Flags: Read / Write

Default value: FALSE

### The `“end-of-input-action”` property

      “end-of-input-action”      CattleEndOfInputAction

Action to be performed when the end of input is reached.

Changes to this property are not notified.

Owner: CattleConfiguration

Flags: Read / Write

Default value: CATTLE_END_OF_INPUT_ACTION_STORE_ZERO