src/fsm_common.h
author Volker Birk <vb@pep.foundation>
Wed, 29 Aug 2018 17:10:23 +0200
branchsync
changeset 2899 63b619aef131
parent 2831 be6623599adb
child 3089 95d63a8d69bf
permissions -rw-r--r--
somewhat bigger
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 // generate state machine code
     5 
     6 // Copyleft (c) 2017, p≡p foundation
     7 
     8 // Written by Volker Birk
     9 
    10 
    11 #pragma once
    12 
    13 #ifdef __cplusplus
    14 extern "C" {
    15 #endif
    16 
    17 // error values
    18 
    19 typedef enum _fsm_error {
    20     // these error values are corresponding to
    21     // PEP_SYNC_STATEMACHINE_ERROR - value
    22     invalid_state = -2,
    23     invalid_event = -3,
    24     invalid_condition = -4,
    25     invalid_action = -5,
    26 
    27     // out of memory condition
    28     invalid_out_of_memory = -128,
    29 } fsm_error;
    30 
    31 // common
    32 
    33 enum {
    34     End = -1,
    35     None = 0,
    36     Init = 1,
    37     Extra = 128 // messages will be below this ID
    38 };
    39 
    40 #ifdef __cplusplus
    41 }
    42 #endif
    43