sync/gen_statemachine.ysl2
branchkeysync
changeset 1043 f786ee22e281
parent 985 087d5d60c082
child 1046 73be5d9af815
     1.1 --- a/sync/gen_statemachine.ysl2	Tue Aug 16 19:20:20 2016 +0200
     1.2 +++ b/sync/gen_statemachine.ysl2	Sat Aug 20 14:45:19 2016 +0200
     1.3 @@ -62,6 +62,13 @@
     1.4          // states
     1.5  
     1.6          typedef enum _«@name»_state {
     1.7 +            // error values also in this namespace
     1.8 +            «@name»_state_invalid_state = (int) invalid_state,
     1.9 +            «@name»_state_invalid_event = (int) invalid_event,
    1.10 +            «@name»_state_invalid_condition = (int) invalid_condition,
    1.11 +            «@name»_state_invalid_action = (int) invalid_action,
    1.12 +            «@name»_state_invalid_out_of_memory = (int) invalid_out_of_memory,
    1.13 +
    1.14              «@name»_state_NONE = 0,
    1.15          `` for "func:distinctName(state)" |> «@name»`if "position()!=last()" > , `
    1.16          } «@name»_state;
    1.17 @@ -135,7 +142,7 @@
    1.18  
    1.19              «@name»_state state = fsm_«@name»(session,
    1.20                      session->«@filename»_state, event, partner, extra);
    1.21 -            if (state == invalid_out_of_memory)
    1.22 +            if (state == «@name»_state_invalid_out_of_memory)
    1.23                  return PEP_OUT_OF_MEMORY;
    1.24              if (state < 0)
    1.25                  return PEP_SYNC_STATEMACHINE_ERROR - state;
    1.26 @@ -202,9 +209,9 @@
    1.27          }
    1.28          > , NULL);\n
    1.29          | if (status == PEP_OUT_OF_MEMORY)
    1.30 -        |> return invalid_out_of_memory;
    1.31 +        |> return (int) invalid_out_of_memory;
    1.32          | if (status != PEP_STATUS_OK)
    1.33 -        |> return invalid_action;
    1.34 +        |> return (int) invalid_action;
    1.35      }
    1.36  
    1.37      template "condition" {