nicer
authorVolker Birk <vb@pep-project.org>
Sun, 10 Jul 2016 19:44:46 +0200
changeset 8247e83e5846e4a
parent 823 8f3cb6e834f9
child 825 c5b5500a978d
nicer
sync/gen_actions_skeleton.ysl2
     1.1 --- a/sync/gen_actions_skeleton.ysl2	Sun Jul 10 12:40:40 2016 +0200
     1.2 +++ b/sync/gen_actions_skeleton.ysl2	Sun Jul 10 19:44:46 2016 +0200
     1.3 @@ -12,21 +12,26 @@
     1.4      template "/protocol/fsm" document "../src/{@filename}_actions.c.skeleton", "text" {
     1.5          const "name", "@name";
     1.6          const "filename", "@filename";
     1.7 -    ||
     1.8 -    // Actions for «@name» state machine
     1.9 +        ||
    1.10 +        // Actions for «@name» state machine
    1.11  
    1.12 -    #include <assert.h>
    1.13 -    #include "pEp_internal.h"
    1.14 -    #include "keymanagement.h"
    1.15 -    #include "message.h"
    1.16 -    #include "«@filename»_fsm.h"
    1.17 -    #include "baseprotocol.h"
    1.18 -    #include "map_asn1.h"
    1.19 -    `` for "func:distinctName(//action)" if "substring(@name, 1, 4) = 'send'" | #include "../asn.1/«substring(@name, 5, 255)».h"
    1.20 -
    1.21 -    `` for "func:distinctName(//action)" call "action" with "action", ".", with "fsm", "$name", with "filename", "$filename";
    1.22 -
    1.23 -    ||
    1.24 +        #include <assert.h>
    1.25 +        #include "pEp_internal.h"
    1.26 +        #include "keymanagement.h"
    1.27 +        #include "message.h"
    1.28 +        #include "«@filename»_fsm.h"
    1.29 +        #include "baseprotocol.h"
    1.30 +        #include "map_asn1.h"
    1.31 +        ||
    1.32 +        for "func:distinctName(//action)"
    1.33 +            if "substring(@name, 1, 4) = 'send'"
    1.34 +                | #include "../asn.1/«substring(@name, 5, 255)».h"
    1.35 +        |
    1.36 +        for "func:distinctName(//action)"
    1.37 +            call "action"
    1.38 +                with "action", ".",
    1.39 +                with "fsm", "$name",
    1.40 +                with "filename", "$filename";
    1.41      }
    1.42  
    1.43      function "action" {
    1.44 @@ -163,15 +168,15 @@
    1.45                  goto error;
    1.46              if (Identity_from_Struct(me, &msg->me) == NULL)
    1.47                  goto enomem;
    1.48 -         `` if "parm or $name='OwnKeys'" |
    1.49 -         `` if "parm/partner"   |> if (Identity_from_Struct(partner, &msg->partner) == NULL)
    1.50 -         `` if "parm/partner"   |>> goto enomem;
    1.51 -         `` if "$name='OwnKeys'"|> stringlist_t *sl;
    1.52 -         `` if "$name='OwnKeys'"|> status = own_key_retrieve(session, &sl);
    1.53 -         `` if "$name='OwnKeys'"|> if (status != PEP_STATUS_OK)
    1.54 -         `` if "$name='OwnKeys'"|>> goto error;
    1.55 -         `` if "$name='OwnKeys'"|> if (KeyList_from_stringlist(sl, &msg->keylist) == NULL)
    1.56 -         `` if "$name='OwnKeys'"|>> goto enomem;
    1.57 +            if "parm or $name='OwnKeys'" |
    1.58 +            if "parm/partner"   |> if (Identity_from_Struct(partner, &msg->partner) == NULL)
    1.59 +            if "parm/partner"   |>> goto enomem;
    1.60 +            if "$name='OwnKeys'"|> stringlist_t *sl;
    1.61 +            if "$name='OwnKeys'"|> status = own_key_retrieve(session, &sl);
    1.62 +            if "$name='OwnKeys'"|> if (status != PEP_STATUS_OK)
    1.63 +            if "$name='OwnKeys'"|>> goto error;
    1.64 +            if "$name='OwnKeys'"|> if (KeyList_from_stringlist(sl, &msg->keylist) == NULL)
    1.65 +            if "$name='OwnKeys'"|>> goto enomem;
    1.66  
    1.67              if (asn_check_constraints(&asn_DEF_«$name», msg, NULL, NULL)) {
    1.68                  status = PEP_CONTRAINTS_VIOLATED;