Commit 2a73e83d authored by Maxime Perrotin's avatar Maxime Perrotin

Add to templates for the glue code

parent e10db0bd
......@@ -24,7 +24,6 @@
@@-- @_Instance_Of_@ : Optional name of component type
/* Body file for function @_Name_@
* Generated by TASTE on @_NOW_@
* You can edit this file, it will not be overwritten
* Provided interfaces : @_List_Of_PIs_@
* Required interfaces : @_List_Of_RIs_@
* User-defined properties for this function:
......@@ -36,6 +35,7 @@
#include <stdbool.h>
#include "@_LOWER:Name_@_vm_if.h"
#include "C_ASN1_Types.h"
void init_@_LOWER:Name_@()
{
......
......@@ -22,6 +22,34 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
{
@@TABLE@@ @@-- decode input parameters into static variables
static asn1Scc@_REPLACE_ALL(-/_):Param_Types_@ IN_@_UPPER:Param_Names_@;
#ifdef __unix__
asn1Scc@_REPLACE_ALL(-/_):Param_Types_@_Initialize(&IN_@_UPPER:Param_Names_@);
#endif
if (0 != Decode_@_Param_Encodings_@_@_REPLACE_ALL(-/_):Param_Types_@ (&IN_@_UPPER:Param_Names_@, @_LOWER:Param_Names_@_len)) {
#ifdef __unix__
puts("Error decoding @_Param_Types_@ in function @_LOWER:Parent_Function_@_@_LOWER:Name_@");
#endif
return;
}
@@END_TABLE@@
// Call user code
@_LOWER:Parent_Function_@_PI_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);\n)@@
@@TABLE@@
@@IF@@ @_Param_Directions_@ = "PARAM_IN"
&IN_@_UPPER:Param_Names_@
@@ELSE@@
&OUT_@_UPPER:Param_Names_@
@@END_IF@@
@@END_TABLE@@
@@END_INLINE@@
}
@@ELSE@@ @@-- parameterless functions
void @_LOWER:Parent_Function_@_@_LOWER:Name_@()
{
// Directly call user code, no parameters to pass
// This could be done directly from the concurrency glue...
......
......@@ -22,6 +22,12 @@ dataviews:
@@END_TABLE@@
; do cat $$f; echo; done > dataview/dataview-uniq.asn
@@END_INLINE@@
@@-- Generate DataView.aadl in AADLV1 as this is needed by aadl2glueC
PROJECT_CACHE=dataview/.cache asn2aadlPlus dataview/dataview-uniq.asn dataview/dataview_aadlv1.aadl
@@-- For each function generate the glue code from DMT based on the dataview
@@TABLE@@
aadl2glueC -o @_LOWER:Function_Names_@/@_Language_@/wrappers dataview/dataview_aadlv1.aadl @_LOWER:Function_Names_@/@_Language_@/wrappers/@_LOWER:Function_Names_@_mini_cv.aadl
@@END_TABLE@@
@@-- Then generate Dataviews once per target language
@@TABLE@@
@@IF@@ @_Unique_Languages_@ = "Ada" or @_Unique_Languages_@ = "SDL"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment