src/fsm_common.h
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Thu, 04 Jun 2020 11:18:45 +0200
changeset 4729 3df9a2a67597
parent 4053 a1b219054c9b
child 4792 7056435ab9e7
child 5246 67016f508d40
permissions -rw-r--r--
forgot test files
vb@2831
     1
// This file is under GNU General Public License 3.0
vb@2831
     2
// see LICENSE.txt
vb@2831
     3
vb@2831
     4
// generate state machine code
vb@2831
     5
vb@3089
     6
// Copyleft (c) 2017-2018, pEp foundation
vb@2831
     7
vb@2831
     8
// Written by Volker Birk
vb@2831
     9
vb@2831
    10
vb@2831
    11
#pragma once
vb@2831
    12
vb@2831
    13
#ifdef __cplusplus
vb@2831
    14
extern "C" {
vb@2831
    15
#endif
vb@2831
    16
vb@2831
    17
// error values
vb@2831
    18
vb@2831
    19
typedef enum _fsm_error {
vb@2831
    20
    // these error values are corresponding to
vb@2831
    21
    // PEP_SYNC_STATEMACHINE_ERROR - value
vb@2831
    22
    invalid_state = -2,
vb@2831
    23
    invalid_event = -3,
vb@2831
    24
    invalid_condition = -4,
vb@2831
    25
    invalid_action = -5,
vb@3089
    26
    inhibited_event = -6,
vb@3089
    27
    cannot_send = -7,
vb@2831
    28
vb@2831
    29
    // out of memory condition
vb@3089
    30
    out_of_memory = -128,
vb@2831
    31
} fsm_error;
vb@2831
    32
vb@2831
    33
// common
vb@2831
    34
vb@2831
    35
enum {
vb@2831
    36
    End = -1,
vb@2831
    37
    None = 0,
vb@2831
    38
    Init = 1,
vb@2831
    39
    Extra = 128 // messages will be below this ID
vb@2831
    40
};
vb@2831
    41
vb@4053
    42
enum {
vb@4053
    43
    SHUTDOWN = 0
vb@4053
    44
};
vb@4053
    45
vb@2831
    46
#ifdef __cplusplus
vb@2831
    47
}
vb@2831
    48
#endif
vb@2831
    49