sync/gen_statemachine.ysl2
changeset 623 533a7fcc423b
parent 617 0caa732cf9a4
child 626 64a89bd12469
     1.1 --- a/sync/gen_statemachine.ysl2	Sat May 14 12:01:50 2016 +0200
     1.2 +++ b/sync/gen_statemachine.ysl2	Sun May 15 15:18:53 2016 +0200
     1.3 @@ -7,6 +7,7 @@
     1.4  include yslt.yml2
     1.5  
     1.6  tstylesheet {
     1.7 +    include ./functions.ysl2
     1.8  
     1.9      template "/protocol/fsm" {
    1.10          document "../src/sync_fsm.h", "text"
    1.11 @@ -20,7 +21,6 @@
    1.12          // types
    1.13  
    1.14          typedef pEp_identity * Identity;
    1.15 -        typedef stringlist_t * Stringlist;
    1.16          typedef union _param { const Identity partner; const stringlist_t *keylist; } param_t;
    1.17  
    1.18          // error values
    1.19 @@ -33,22 +33,22 @@
    1.20          // states
    1.21  
    1.22          typedef enum _«@name»_state {
    1.23 -        `` for "set:distinct(state/@name)" |> «.»`if "position()!=last()" > , `
    1.24 +        `` for "func:distinctName(state)" |> «@name»`if "position()!=last()" > , `
    1.25          } «@name»_state;
    1.26  
    1.27          // events
    1.28  
    1.29          typedef enum _«@name»_event {
    1.30 -        `` for "set:distinct(state/event/@name)" |> «.»`if "position()!=last()" > , `
    1.31 +        `` for "func:distinctName(state/event)" |> «@name»`if "position()!=last()" > , `
    1.32          } «@name»_event;
    1.33  
    1.34          // actions
    1.35  
    1.36 -        `` for "set:distinct(state/event//action/@name)" | void «.»(const Identity partner);
    1.37 +        `` for "func:distinctName(//action)" | PEP_STATUS «@name»(const Identity partner);
    1.38  
    1.39          // driver
    1.40  
    1.41 -        void fsm_«@name»_inject(PEP_SESSION session, «@name»_event event);
    1.42 +        PEP_STATUS fsm_«@name»_inject(PEP_SESSION session, «@name»_event event);
    1.43  
    1.44          ||
    1.45          ||