src/fsm_common.h
author Volker Birk <vb@pep.foundation>
Sun, 21 Oct 2018 17:54:01 +0200
branchsync
changeset 3089 95d63a8d69bf
parent 2831 be6623599adb
child 4053 a1b219054c9b
permissions -rw-r--r--
more error handling
     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-2018, pEp 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     inhibited_event = -6,
    27     cannot_send = -7,
    28 
    29     // out of memory condition
    30     out_of_memory = -128,
    31 } fsm_error;
    32 
    33 // common
    34 
    35 enum {
    36     End = -1,
    37     None = 0,
    38     Init = 1,
    39     Extra = 128 // messages will be below this ID
    40 };
    41 
    42 #ifdef __cplusplus
    43 }
    44 #endif
    45