Mercurial > molko
comparison src/libmlk-core/core/action-stack.h @ 369:1e06f871dc63
core: split action and action_stack
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 24 Oct 2021 17:33:12 +0200 |
parents | |
children | 460c78706989 |
comparison
equal
deleted
inserted
replaced
368:15bdac29ba4b | 369:1e06f871dc63 |
---|---|
1 /* | |
2 * action-stack.h -- convenient stack of actions | |
3 * | |
4 * Copyright (c) 2020-2021 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #ifndef MLK_CORE_ACTION_STACK_H | |
20 #define MLK_CORE_ACTION_STACK_H | |
21 | |
22 #include "core.h" | |
23 | |
24 #define ACTION_STACK_MAX (128) | |
25 | |
26 union event; | |
27 | |
28 struct action_stack { | |
29 struct action *actions[ACTION_STACK_MAX]; | |
30 }; | |
31 | |
32 CORE_BEGIN_DECLS | |
33 | |
34 void | |
35 action_stack_init(struct action_stack *); | |
36 | |
37 int | |
38 action_stack_add(struct action_stack *, struct action *); | |
39 | |
40 void | |
41 action_stack_handle(struct action_stack *, const union event *); | |
42 | |
43 int | |
44 action_stack_update(struct action_stack *, unsigned int); | |
45 | |
46 void | |
47 action_stack_draw(const struct action_stack *); | |
48 | |
49 int | |
50 action_stack_completed(const struct action_stack *); | |
51 | |
52 void | |
53 action_stack_finish(struct action_stack *); | |
54 | |
55 CORE_END_DECLS | |
56 | |
57 #endif /* !MLK_CORE_ACTION_STACK_H */ |