infinite_state_machine 1.0.0
Infinite State Machine Library
Loading...
Searching...
No Matches
infinite_state_machine.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025, Roy Ratcliffe, Northumberland, United Kingdom
3 * SPDX-License-Identifier: MIT
4 */
16#ifndef INFINITE_STATE_MACHINE_H
17#define INFINITE_STATE_MACHINE_H
18
19#include "infinite_state.h"
20
30#ifndef INFINITE_STATE_MACHINE_MAX_DEPTH
31#define INFINITE_STATE_MACHINE_MAX_DEPTH 7
32#endif
33
52
60
75void infinite_state_machine_goto(struct infinite_state_machine *machine, struct infinite_state *state);
76
89void infinite_state_machine_jump(struct infinite_state_machine *machine, struct infinite_state *state);
90
97int infinite_state_machine_in(struct infinite_state_machine *machine, struct infinite_state *state);
98
105
106#endif /* INFINITE_STATE_MACHINE_H */
Core definitions for the infinite (unbounded topology and depth albeit limited by memory resources) h...
void infinite_state_machine_jump(struct infinite_state_machine *machine, struct infinite_state *state)
Jumps to a state in the infinite state machine.
#define INFINITE_STATE_MACHINE_MAX_DEPTH
Maximum depth of any infinite state machine. Defaults to 7 unless already defined before the inclusio...
void infinite_state_machine_init(struct infinite_state_machine *machine)
Initialises the infinite state machine. The machine is reset to its initial state....
int infinite_state_machine_in(struct infinite_state_machine *machine, struct infinite_state *state)
Checks if a state is currently active in the infinite state machine.
void infinite_state_machine_goto(struct infinite_state_machine *machine, struct infinite_state *state)
Goes to a state in the infinite state machine.
struct infinite_state * infinite_state_machine_top(const struct infinite_state_machine *machine)
Gets the top state of the infinite state machine.
Represents an infinite state machine. This structure holds the current state hierarchy and allows for...
int depth
The current depth of the infinite state machine.
struct infinite_state * states[INFINITE_STATE_MACHINE_MAX_DEPTH]
The states in the infinite state machine.
The state structure for the infinite state. This structure represents a state in the infinite state m...