Commit 05eff342 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

More vdm support

parent 2590d82c
Pipeline #1175 skipped
...@@ -93,12 +93,18 @@ void add_pi_to_vdm_gw(Interface * i) ...@@ -93,12 +93,18 @@ void add_pi_to_vdm_gw(Interface * i)
char *sep = " * "; char *sep = " * ";
bool comma = false; bool comma = false;
char *params = " (";
char *sep2 = ", ";
FOREACH (p, Parameter, i->in, { FOREACH (p, Parameter, i->in, {
char *sort = make_string("%s%s`%s", char *sort = make_string("%s%s`%s",
comma? sep: "", comma? sep: "",
p->asn1_module, p->asn1_module,
p->type); p->type);
params = make_string("%s%s%s",
params,
comma? sep2: "",
p->name);
fprintf(interface, "%s", sort); fprintf(interface, "%s", sort);
if(NULL != user_code) { if(NULL != user_code) {
fprintf(user_code, "%s",sort); fprintf(user_code, "%s",sort);
...@@ -107,6 +113,8 @@ void add_pi_to_vdm_gw(Interface * i) ...@@ -107,6 +113,8 @@ void add_pi_to_vdm_gw(Interface * i)
comma = true; comma = true;
}); });
params = make_string("%s)", params);
if (NULL != i->out) { if (NULL != i->out) {
char *out = make_string(" ==> %s`%s", char *out = make_string(" ==> %s`%s",
i->out->value->asn1_module, i->out->value->asn1_module,
...@@ -125,12 +133,16 @@ void add_pi_to_vdm_gw(Interface * i) ...@@ -125,12 +133,16 @@ void add_pi_to_vdm_gw(Interface * i)
NULL != i->in? " (-)" : ""); NULL != i->in? " (-)" : "");
if (NULL != user_code) if (NULL != user_code)
fprintf(user_code, fprintf(user_code,
"\n" "\n"
"%s == -- Write your code here\n\n", "%s%s == -- Write your code here\n\n",
NULL != i->in? params: "",
i->name); i->name);
free(signature); free(signature);
free(sep2);
free(params);
free(sep); free(sep);
} }
......
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