blob: ef27bc1455ceae8df74deea153ed9260a4d0502b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
void
libautomata_destroy_automaton(struct libautomata_automaton *automaton)
{
size_t i;
if (automaton->nodes)
for (i = 0; i < automaton->nnodes; i++)
if (automaton->nodes[i] && automaton->nodes[i].destory)
(*automaton->nodes[i].destory)(&automaton->nodes[i]);
automaton->start = NULL;
automaton->current = NULL;
automaton->nodes = NULL;
automaton->nnodes = 0;
}
|