Papageno
An Advanced Pattern Matching Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
ppg_global.h
Go to the documentation of this file.
1 /* Copyright 2017 noseglasses <shinynoseglasses@gmail.com>
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef PPG_GLOBAL_H
18 #define PPG_GLOBAL_H
19 
22 #include "ppg_input.h"
23 #include "ppg_time.h"
24 #include "ppg_event.h"
25 #include "ppg_layer.h"
26 #include "ppg_signal_callback.h"
27 
28 #include <stdbool.h>
29 #include <inttypes.h>
30 
42 
48 
52 
62 PPG_Time ppg_global_set_timeout(PPG_Time timeout);
63 
68 PPG_Time ppg_global_get_timeout(void);
69 
80 
88 bool ppg_global_set_enabled(bool state);
89 
92 void ppg_global_init(void);
93 
96 void ppg_global_compile(void);
97 
103 void ppg_global_finalize(void);
104 
110 void ppg_global_reset(void);
111 
119 bool ppg_timeout_check(void);
120 
127 bool ppg_global_set_timeout_enabled(bool state);
128 
134 
139 PPG_Layer ppg_global_set_layer(PPG_Layer layer);
140 
145 PPG_Layer ppg_global_get_layer(void);
146 
153 
159 
160 #if PPG_HAVE_DEBUGGING
161 
166 bool ppg_global_check_consistency(void);
167 
168 #endif
169 
170 #endif
PPG_Time ppg_global_get_timeout(void)
Returns the current timeout value.
void(* PPG_Event_Processor_Fun)(PPG_Event *event, void *user_data)
A callback function that is used during processing of stored input events.
Definition: ppg_event.h:58
PPG_Input_Id ppg_global_set_abort_trigger(PPG_Input_Id input)
Defines an input that aborts current pattern processing.
PPG_Layer ppg_global_set_layer(PPG_Layer layer)
Set the current layer.
bool ppg_global_get_timeout_enabled(void)
Determines if global timeout is enabled.
bool ppg_global_set_timeout_enabled(bool state)
Toggles global timeout.
bool ppg_global_set_enabled(bool state)
Use this function to temporarily disable/enable pattern processing.
uint8_t PPG_Input_Id
The type used as input identifier.
Definition: ppg_input.h:29
void ppg_global_abort_pattern_matching(void)
Aborts processing of the current pattern.
The PPG_Signal_Callback_Fun struct groups use callback information in an object oriented fashion (fun...
Definition: ppg_signal_callback.h:34
PPG_Signal_Callback ppg_global_get_signal_callback(void)
Get the current signal callback.
PPG_Layer ppg_global_get_layer(void)
Retreives the currently active layer.
void ppg_global_compile(void)
Compiles the Papageno pattern tree.
void ppg_global_init(void)
Initialize Papageno.
void ppg_global_reset(void)
Resets papageno to initial state.
void ppg_global_finalize(void)
Finalizes Papageno, i.e. clears all patterns and frees all allocated memory.
PPG_Event_Processor_Fun ppg_global_set_default_event_processor(PPG_Event_Processor_Fun event_processor)
Defines the default input processor callback.
PPG_Time ppg_global_set_timeout(PPG_Time timeout)
Set the current timeout for pattern processing.
PPG_Input_Id ppg_global_get_abort_trigger(void)
Retreives the current abort input.
bool ppg_timeout_check(void)
The timeout check function.
PPG_Signal_Callback ppg_global_set_signal_callback(PPG_Signal_Callback callback)
Set a callback that is used to signal specific events.