sync/gen_codec.ysl2
changeset 615 52c1a857e73e
parent 613 d59da438b2cb
child 618 32fe7c8bee51
     1.1 --- a/sync/gen_codec.ysl2	Thu May 12 18:26:34 2016 +0200
     1.2 +++ b/sync/gen_codec.ysl2	Thu May 12 19:18:14 2016 +0200
     1.3 @@ -10,21 +10,29 @@
     1.4      variable "UniqueActions", "/protocol/fsm/state/event//action[generate-id()=generate-id(key('ActionByNames',@name)[1])]";
     1.5      variable "UniqueSendActions", "$UniqueActions[starts-with(@name,'send')]";
     1.6  
     1.7 -    template "/protocol"
     1.8 -    ||
     1.9 -    // encoders and decoders state for «@name» protocol
    1.10 +    template "/protocol" {
    1.11 +        ||
    1.12 +        // encoders and decoders state for «@name» protocol
    1.13  
    1.14 -    #include "pEpEngine.h"
    1.15 +        #include "pEpEngine.h"
    1.16  
    1.17 -    // decoders
    1.18 +        // decoders
    1.19  
    1.20 -    `` apply "$UniqueSendActions",0 mode="proto" with "pfx", "'decode'"
    1.21 +        ||
    1.22 +        apply "$UniqueSendActions",0 mode="proto" {
    1.23 +            with "pfx", "'read'";
    1.24 +            with "baseParms" > const char *buf, size_t size
    1.25 +        }
    1.26 +        ||
    1.27  
    1.28 -    // encoders 
    1.29 +        // encoders 
    1.30  
    1.31 -    `` apply "$UniqueSendActions",0 mode="proto" with "pfx", "'encode'"
    1.32 -
    1.33 -    ||
    1.34 +        ||
    1.35 +        apply "$UniqueSendActions",0 mode="proto" {
    1.36 +            with "pfx", "'create'";
    1.37 +            with "baseParms" > const char **bufp, size_t *sizep
    1.38 +        }
    1.39 +    }
    1.40  
    1.41      def "xsl:typeOfActionParam" {
    1.42          param "n", "name(.)";
    1.43 @@ -52,16 +60,21 @@
    1.44  
    1.45      template "action", mode="func_header" {
    1.46          param "pfx";
    1.47 +        param "baseParms";
    1.48          variable "ifaceName", "substring-after(@name, 'send')";
    1.49  
    1.50 -        > void «$pfx»«$ifaceName»(const char **bufp, size_t *sizep
    1.51 +        > void «$pfx»«$ifaceName»(«$baseParms»
    1.52          call("interfaces_params") with "ifaceName", "$ifaceName";
    1.53          > )
    1.54      }
    1.55  
    1.56      template "action", mode="proto" {
    1.57          param "pfx";
    1.58 -        apply ".",0 mode="func_header" with "pfx", "$pfx" ;
    1.59 +        param "baseParms";
    1.60 +        apply ".",0 mode="func_header" {
    1.61 +            with "pfx", "$pfx" ;
    1.62 +            with "baseParms", "$baseParms" ;
    1.63 +        }
    1.64          | ;
    1.65      }
    1.66  }