Commit 97e1393d authored by Maxime Perrotin's avatar Maxime Perrotin

Sync with subversion

parent 82de8cbd
Pipeline #350 skipped
......@@ -42,6 +42,7 @@ endif
# strip $(exec)
install:
$(MAKE)
cp buildsupport `ocarina-config --prefix`/bin/
cp misc/driveGnuPlotsStreams.pl `ocarina-config --prefix`/bin/
......
......@@ -580,7 +580,8 @@ procedure BuildSupport is
if Is_In (Param_I) then
Imported_Routines.C_Add_In_Param
(Get_Name_String
(Name (Identifier (Param_I))),
(Display_Name
(Identifier (Param_I))),
Len_Name,
Get_Name_String
(Get_Type_Source_Name (Asntype)),
......@@ -595,7 +596,8 @@ procedure BuildSupport is
else
Imported_Routines.C_Add_Out_Param
(Get_Name_String
(Name (Identifier (Param_I))),
(Display_Name
(Identifier (Param_I))),
Len_Name,
Get_Name_String
(Get_Type_Source_Name (Asntype)),
......@@ -1172,111 +1174,120 @@ procedure BuildSupport is
end if;
if Get_Category_Of_Component (Tmp_CI) = CC_Process then
declare
Node_Coverage : Boolean := False;
begin
if Is_Defined_Property (Tmp_CI,
"taste_dv_properties::coverageenabled")
then
Node_Coverage := Get_Boolean_Property
(Tmp_CI,
Get_String_Name ("taste_dv_properties::coverageenabled"));
if Node_Coverage then
Put_Line ("Needs Coverage");
else
Put_Line ("Needs No coverage");
end if;
end if;
CPU := Get_Bound_Processor (Tmp_CI);
Set_Str_To_Name_Buffer ("");
CPU_Name := Name
(Identifier
(Parent_Subcomponent (CPU)));
CPU_Platform := Get_Execution_Platform (CPU);
if ATN.Namespace
(Corresponding_Declaration
(CPU)) /= No_Node
then
Set_Str_To_Name_Buffer ("");
Get_Name_String
(ATN.Name
(ATN.Identifier
(ATN.Namespace
(Corresponding_Declaration (CPU)))));
Pkg_Name := Name_Find;
Imported_Routines.C_Add_Package
(Get_Name_String (Pkg_Name),
Get_Name_String (Pkg_Name)'Length);
CPU := Get_Bound_Processor (Tmp_CI);
Set_Str_To_Name_Buffer ("");
Get_Name_String (Pkg_Name);
Add_Str_To_Name_Buffer ("::");
Get_Name_String_And_Append (Name (Identifier (CPU)));
CPU_Classifier := Name_Find;
else
CPU_Classifier := Name (Identifier (CPU));
end if;
CPU_Name := Name
(Identifier
(Parent_Subcomponent (CPU)));
Imported_Routines.C_New_Processor
(Get_Name_String (CPU_Name),
Get_Name_String (CPU_Name)'Length,
Get_Name_String (CPU_Classifier),
Get_Name_String (CPU_Classifier)'Length,
Supported_Execution_Platform'Image (CPU_Platform),
Supported_Execution_Platform'Image (CPU_Platform)'Length);
CPU_Platform := Get_Execution_Platform (CPU);
Imported_Routines.C_New_Process
(Get_Name_String
(ATN.Name
(ATN.Component_Type_Identifier
(Corresponding_Declaration (Tmp_CI)))),
Get_Name_String
(ATN.Name
(ATN.Component_Type_Identifier
(Corresponding_Declaration (Tmp_CI))))'Length,
Get_Name_String (Name (Identifier (Processes))),
Get_Name_String (Name (Identifier (Processes)))'Length,
NodeName, NodeName'Length);
if ATN.Namespace
(Corresponding_Declaration
(CPU)) /= No_Node
then
Processes2 := First_Node (Subcomponents (My_System));
Set_Str_To_Name_Buffer ("");
Get_Name_String
(ATN.Name
(ATN.Identifier
(ATN.Namespace
(Corresponding_Declaration (CPU)))));
Pkg_Name := Name_Find;
Imported_Routines.C_Add_Package
(Get_Name_String (Pkg_Name),
Get_Name_String (Pkg_Name)'Length);
Set_Str_To_Name_Buffer ("");
Get_Name_String (Pkg_Name);
Add_Str_To_Name_Buffer ("::");
Get_Name_String_And_Append (Name (Identifier (CPU)));
CPU_Classifier := Name_Find;
else
CPU_Classifier := Name (Identifier (CPU));
end if;
while Present (Processes2) loop
Tmp_CI2 := Corresponding_Instance (Processes2);
Imported_Routines.C_New_Processor
(Get_Name_String (CPU_Name),
Get_Name_String (CPU_Name)'Length,
Get_Name_String (CPU_Classifier),
Get_Name_String (CPU_Classifier)'Length,
Supported_Execution_Platform'Image (CPU_Platform),
Supported_Execution_Platform'Image (CPU_Platform)'Length);
Imported_Routines.C_New_Process
(Get_Name_String
(ATN.Name
(ATN.Component_Type_Identifier
(Corresponding_Declaration (Tmp_CI)))),
Get_Name_String
(ATN.Name
(ATN.Component_Type_Identifier
(Corresponding_Declaration (Tmp_CI))))'Length,
Get_Name_String (Name (Identifier (Processes))),
Get_Name_String (Name (Identifier (Processes)))'Length,
NodeName, NodeName'Length,
Boolean'Pos (Node_Coverage));
Processes2 := First_Node (Subcomponents (My_System));
while Present (Processes2) loop
Tmp_CI2 := Corresponding_Instance (Processes2);
if Get_Category_Of_Component (Tmp_CI2) = CC_System
and then
Is_Defined_Property
(Tmp_CI2, "taste::aplc_binding")
then
Ref := Get_Reference_Property
(Tmp_CI2, Get_String_Name ("taste::aplc_binding"));
if Get_Category_Of_Component (Tmp_CI2) = CC_System
and then
Is_Defined_Property
(Tmp_CI2, "taste::aplc_binding")
then
Ref := Get_Reference_Property
(Tmp_CI2, Get_String_Name ("taste::aplc_binding"));
if Ref = Tmp_CI then
declare
Bound_APLC_Name : Unbounded_String;
-- constant String :=
-- Get_Name_String
-- (ATN.Name
-- (ATN.Component_Type_Identifier
-- (Corresponding_Declaration (Tmp_CI2))));
-- (Name
-- (Identifier (Processes2)));
-- (Identifier (Tmp_CI2)));
begin
if Ref = Tmp_CI then
declare
Bound_APLC_Name : Unbounded_String;
begin
Bound_APLC_Name := To_Unbounded_String
(Get_Name_String
(ATN.Name
(ATN.Component_Type_Identifier
(Corresponding_Declaration (Tmp_CI2)))));
exception
when System.Assertions.Assert_Failure =>
Put_Line
("Detected DV from TASTE version 1.2");
begin
Bound_APLC_Name := To_Unbounded_String
(Get_Name_String
(Name (Identifier (Processes2))));
end;
(ATN.Name
(ATN.Component_Type_Identifier
(Corresponding_Declaration (Tmp_CI2)))));
exception
when System.Assertions.Assert_Failure =>
Put_Line
("Detected DV from TASTE version 1.2");
Bound_APLC_Name := To_Unbounded_String
(Get_Name_String
(Name (Identifier (Processes2))));
end;
Imported_Routines.C_Add_Binding
(To_String (Bound_APLC_Name),
To_String (Bound_APLC_Name)'Length);
end;
Imported_Routines.C_Add_Binding
(To_String (Bound_APLC_Name),
To_String (Bound_APLC_Name)'Length);
end;
end if;
end if;
end if;
Processes2 := Next_Node (Processes2);
end loop;
Processes2 := Next_Node (Processes2);
end loop;
Imported_Routines.C_End_Process;
Imported_Routines.C_End_Process;
end;
end if;
Processes := Next_Node (Processes);
......
......@@ -34,7 +34,8 @@ package Imported_Routines is
Id : String;
LenId : Integer;
Node_Name : String;
Len_Node : Integer);
Len_Node : Integer;
Coverage : Integer);
procedure C_New_Processor (Name : String;
Name_Len : Integer;
......
......@@ -9,15 +9,15 @@
used as implementation language
updated 20/04/2009 to disable in case "-onlycv" flag is set
major updated 20/07/2009 to support protected objects
*/
#define ID "$Id: wrappers_backend.c 447 2010-03-02 12:54:54Z maxime1008 $"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <sys/stat.h>
#include <assert.h>
......@@ -26,9 +26,7 @@
#include "c_ast_construction.h"
extern void Add_Protected_Interfaces(FV * fv, FILE * ads, FILE * adb);
extern void Add_Unprotected_Interfaces(FV * fv, FILE * ads,
FILE * adb);
extern void Add_Unprotected_Interfaces(FV * fv, FILE * ads, FILE * adb);
static FILE *ads = NULL, *adb = NULL, *async_ads = NULL, *async_adb = NULL;
......@@ -38,28 +36,20 @@ static int contains_sync_interface = 0;
void CheckForParams(Interface * i, int *result)
{
if (asynch == i->synchronism && (NULL != i->in || NULL != i->out)) {
*result = 1;
*result = 1;
}
}
/* Return 1 if the FV has at least one Async RI */
void Check_If_A_Calling_Thread_Has_No_Async_RI(FV * fv, int *result)
{
FOREACH (i, Interface, fv->interfaces, {
IsThereAtLeastOneAsyncRI (i, result);
})
}
/* For a given passive function, add "with CallingThread_wrappers;"statement */
void Add_With_AsyncRI(FV * fv, FILE ** file)
{
int result = 0;
bool result = false;
FOREACH (i, Interface, fv->interfaces, {
IsThereAtLeastOneAsyncRI (i, &result);
if (RI == i->direction && asynch == i->synchronism) result = true;
})
if (result)
fprintf(*file, "with %s_async_ri_wrappers;\n", fv->name);
fprintf(*file, "with %s_async_ri_wrappers;\n", fv->name);
}
......@@ -70,31 +60,31 @@ void ada_wrappers_preamble(FV * fv)
int mix = 0;
if (NULL == ads || NULL == adb)
return;
return;
/* wrappers.ads top header */
fprintf(ads,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(ads, "pragma Style_Checks (Off);\npragma Warnings (Off);\n\n");
/* wrappers.adb top header */
fprintf(adb,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(adb,
"pragma Style_Checks (Off);\npragma Warnings (Off);\n\nwith PolyORB_HI_Generated.Activity;\nuse PolyORB_HI_Generated.Activity;\n\n");
"pragma Style_Checks (Off);\npragma Warnings (Off);\n\nwith PolyORB_HI_Generated.Activity;\nuse PolyORB_HI_Generated.Activity;\n\n");
fprintf(ads, "with Interfaces.C;\n");
/* Generates "with PolyORB_HI.Generated.Types IF at least one async IF has a param */
FOREACH(i, Interface, fv->interfaces, {
CheckForParams(i, &hasparam);
CheckForParams(i, &hasparam);
})
if (hasparam) {
fprintf(ads, "with PolyORB_HI_Generated.Types;\n");
fprintf(ads, "with PolyORB_HI_Generated.Types;\n");
}
// In case of Ada, make an include to the user code package to execute the elaboration part (optional user-initialization code)
if (ada == fv->language || qgenada == fv->language) {
fprintf(ads, "with %s;\n", fv->name);
fprintf(ads, "with %s;\n", fv->name);
}
fprintf(ads, "with PolyORB_HI_Generated.Deployment;\n");
......@@ -113,11 +103,11 @@ void ada_wrappers_preamble(FV * fv)
}
})
FOREACH(sync_callee, String, sync_list, {
fprintf(adb, "with %s_wrappers;\n", sync_callee);
fprintf(adb, "with %s_wrappers;\n", sync_callee);
});
if (NULL != async_ads)
fprintf(ads, "with %s_async_ri_wrappers;\n", fv->name);
fprintf(ads, "with %s_async_ri_wrappers;\n", fv->name);
/* Include with and use clauses for QGenAda code if it is used */
FOREACH(i, Interface, fv->interfaces, {
......@@ -143,9 +133,9 @@ void ada_wrappers_preamble(FV * fv)
})
}
if (passive_runtime == fv->runtime_nature || mix) {
FOREACH(ct, FV, fv->calling_threads, {
Add_With_AsyncRI(ct, &ads);
});
FOREACH(ct, FV, fv->calling_threads, {
Add_With_AsyncRI(ct, &ads);
});
}
fprintf(ads, "\npackage %s_wrappers is\n\n", fv->name);
......@@ -160,12 +150,12 @@ void ada_wrappers_preamble(FV * fv)
//if (!file_exists(path, "_hook")) {
if (!fv->artificial) {
fprintf(ads, "\tprocedure C_Init_%s;\n\n", fv->name);
fprintf(adb, "\tprocedure C_Init_%s is\n", fv->name);
fprintf(adb, "\t\tprocedure Init_%s;\n", fv->name);
fprintf(adb, "\t\tpragma Import (C, Init_%s, \"init_%s\");\n\n",
fv->name, fv->name);
fprintf(adb, "\tbegin\n\t\tInit_%s;\n\tend C_Init_%s;\n\n",
fv->name, fv->name);
fprintf(adb, "\tprocedure C_Init_%s is\n", fv->name);
fprintf(adb, "\t\tprocedure Init_%s;\n", fv->name);
fprintf(adb, "\t\tpragma Import (C, Init_%s, \"init_%s\");\n\n",
fv->name, fv->name);
fprintf(adb, "\tbegin\n\t\tInit_%s;\n\tend C_Init_%s;\n\n",
fv->name, fv->name);
}
/* Include call to QGenAda init code if it is present */
......@@ -176,33 +166,33 @@ void ada_wrappers_preamble(FV * fv)
fprintf(ads, "\tpragma Export (C, QGen_Init_%s, \"vm_QGen_Init_%s\");\n\n", i->distant_name, i->distant_name);
fprintf(adb, "\tprocedure QGen_Init_%s is\n", i->distant_name);
fprintf(adb, "\tbegin\n\t\t%s.init;\n\tend QGen_Init_%s;\n\n",
i->distant_name, i->distant_name);
i->distant_name, i->distant_name);
})}
if (NULL != async_ads && NULL != async_adb) {
fprintf(async_ads,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(async_ads,
"pragma Style_Checks (Off);\npragma Warnings (Off);\n\n");
fprintf(async_ads, "with Interfaces.C;\n");
fprintf(async_ads,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(async_ads,
"pragma Style_Checks (Off);\npragma Warnings (Off);\n\n");
fprintf(async_ads, "with Interfaces.C;\n");
if (hasparam)
fprintf(async_ads, "with PolyORB_HI_Generated.Types;\n");
if (hasparam)
fprintf(async_ads, "with PolyORB_HI_Generated.Types;\n");
fprintf(async_ads, "with PolyORB_HI_Generated.Deployment;\n");
fprintf(async_ads, "use PolyORB_HI_Generated.Deployment;\n\n");
fprintf(async_ads, "with PolyORB_HI_Generated.Deployment;\n");
fprintf(async_ads, "use PolyORB_HI_Generated.Deployment;\n\n");
fprintf(async_ads, "\npackage %s_async_ri_wrappers is\n\n",
fv->name);
fprintf(async_ads, "\npackage %s_async_ri_wrappers is\n\n",
fv->name);
fprintf(async_adb,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(async_adb,
"pragma Style_Checks (Off);\npragma Warnings (Off);\n\nwith PolyORB_HI_Generated.Activity;\nuse PolyORB_HI_Generated.Activity;\n");
fprintf(async_adb, "with PolyORB_HI.Errors;\n\n");
fprintf(async_adb, "package body %s_async_ri_wrappers is\n\n",
fv->name);
fprintf(async_adb,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(async_adb,
"pragma Style_Checks (Off);\npragma Warnings (Off);\n\nwith PolyORB_HI_Generated.Activity;\nuse PolyORB_HI_Generated.Activity;\n");
fprintf(async_adb, "with PolyORB_HI.Errors;\n\n");
fprintf(async_adb, "package body %s_async_ri_wrappers is\n\n",
fv->name);
}
}
......@@ -210,15 +200,15 @@ void ada_wrappers_preamble(FV * fv)
/* Creates fv_wrappers.ads, fv_wrappers.adb, and potentially RI async wrappers */
int Init_Ada_Wrappers_Backend(FV * fv)
{
char *filename = NULL; // to store the wrappers filename (fv_name_wrappers.ad*)
size_t len = 0; // length of the filename
char *filename = NULL; // to store the wrappers filename (fv_name_wrappers.ad*)
size_t len = 0; // length of the filename
char *path = NULL;
contains_sync_interface = 0;
if (NULL != fv->system_ast->context->output)
build_string(&path, fv->system_ast->context->output,
strlen(fv->system_ast->context->output));
build_string(&path, fv->system_ast->context->output,
strlen(fv->system_ast->context->output));
build_string(&path, fv->name, strlen(fv->name));
// Elaborate the Wrapper file name:
......@@ -237,34 +227,34 @@ int Init_Ada_Wrappers_Backend(FV * fv)
if (thread_runtime == fv->runtime_nature) {
int async_ri = 0;
FOREACH(i, Interface, fv->interfaces, {
IsThereAtLeastOneAsyncRI(i, &async_ri);
})
bool async_ri = 0;
FOREACH(i, Interface, fv->interfaces, {
if (RI == i->direction && asynch == i->synchronism) async_ri = true;
})
if (async_ri) {
if (async_ri) {
len = strlen(fv->name) + strlen("_async_ri_wrappers.ads");
filename = (char *) malloc(len + 1);
len = strlen(fv->name) + strlen("_async_ri_wrappers.ads");
filename = (char *) malloc(len + 1);
// create .ads file
sprintf(filename, "%s_async_ri_wrappers.ads", fv->name);
create_file(path, filename, &async_ads);
// create .ads file
sprintf(filename, "%s_async_ri_wrappers.ads", fv->name);
create_file(path, filename, &async_ads);
// create .adb file
sprintf(filename, "%s_async_ri_wrappers.adb", fv->name);
create_file(path, filename, &async_adb);
// create .adb file
sprintf(filename, "%s_async_ri_wrappers.adb", fv->name);
create_file(path, filename, &async_adb);
free(filename);
free(filename);
assert(async_ads != NULL && async_adb != NULL);
}
assert(async_ads != NULL && async_adb != NULL);
}
}
free(path);
if (NULL == ads || NULL == adb)
return -1;
return -1;
ada_wrappers_preamble(fv);
......@@ -283,48 +273,48 @@ void close_ada_wrappers()
void add_PI_to_ada_wrappers(Interface * i)
{
if (NULL == ads || NULL == adb)
return;
return;
// a. Case of Sync PI: don't do anything but recording that a sync interface exists for this function
// this information will be used to generate the package elaboration part once all other PI have
// been processed.
if (synch == i->synchronism) {
contains_sync_interface = 1;
return;
contains_sync_interface = 1;
return;
}
// b. wrappers.ads : declare the function
fprintf(ads,
"\t------------------------------------------------------\n");
"\t------------------------------------------------------\n");
fprintf(ads, "\t-- Provided Interface \"%s\"\n", i->name);
fprintf(ads,
"\t------------------------------------------------------\n");
"\t------------------------------------------------------\n");
fprintf(ads, "\tprocedure %s (Entity : PolyORB_HI_Generated.Deployment.Entity_Type", i->name);
if (NULL != i->in) {
fprintf(ads,";\n\t\t ");
fprintf(ads,";\n\t\t ");
fprintf(ads,
"%sBuffer:PolyORB_HI_Generated.Types.%s_Buffer_Impl",
i->in->value->name,
i->in->value->type);
"%sBuffer:PolyORB_HI_Generated.Types.%s_Buffer_Impl",
i->in->value->name,
i->in->value->type);
}
fprintf(ads,");\n\n");
// c. wrappers.adb : define the function
fprintf(adb,
"\t------------------------------------------------------\n");
"\t------------------------------------------------------\n");
fprintf(adb, "\t-- Asynchronous Provided Interface \"%s\"\n",
i->name);
i->name);
fprintf(adb,
"\t------------------------------------------------------\n");
"\t------------------------------------------------------\n");
fprintf(adb, "\tprocedure %s (Entity : PolyORB_HI_Generated.Deployment.Entity_Type", i->name);
if (NULL != i->in) {
fprintf(adb,";\n\t\t ");
fprintf(adb,
"%sBuffer:PolyORB_HI_Generated.Types.%s_Buffer_Impl",
i->in->value->name,
i->in->value->type);
fprintf(adb,";\n\t\t ");
fprintf(adb,
"%sBuffer:PolyORB_HI_Generated.Types.%s_Buffer_Impl",
i->in->value->name,
i->in->value->type);
}
fprintf(adb, ")\n\t");
......@@ -332,14 +322,14 @@ void add_PI_to_ada_wrappers(Interface * i)
fprintf(adb, "is\n");
// Make an Ada buffer for each input:
if (NULL != i->in) {
fprintf(adb,
"\t\t%s_AdaBuffer: Interfaces.C.Char_Array(1..Interfaces.C.size_t (%sBuffer.Length));\n",
i->in->value->name, i->in->value->name);
fprintf(adb, "\t\tpragma Import (Ada, %s_AdaBuffer);\n",
i->in->value->name);
fprintf(adb,
"\t\tfor %s_AdaBuffer'Address use %sBuffer.Buffer'Address;\n\n",
i->in->value->name, i->in->value->name);
fprintf(adb,
"\t\t%s_AdaBuffer: Interfaces.C.Char_Array(1..Interfaces.C.size_t (%sBuffer.Length));\n",
i->in->value->name, i->in->value->name);
fprintf(adb, "\t\tpragma Import (Ada, %s_AdaBuffer);\n",
i->in->value->name);
fprintf(adb,
"\t\tfor %s_AdaBuffer'Address use %sBuffer.Buffer'Address;\n\n",
i->in->value->name, i->in->value->name);
}
/* Update 26-10-2010 : if we are in a thread created by the VT
......@@ -350,7 +340,7 @@ void add_PI_to_ada_wrappers(Interface * i)
if (i->parent_fv->artificial) {
//if (file_exists(path, "_hook")) {
char *distant_fv = NULL;
RCM rcm = protected;
RCM rcm = protected;
FOREACH (interface, Interface, i->parent_fv->interfaces, {
if (RI == interface->direction
&& !strcmp (interface->distant_name, i->distant_name) &&
......@@ -360,7 +350,7 @@ void add_PI_to_ada_wrappers(Interface * i)
}
});
/* Call sync (protected) function: */
/* Call sync (protected) function: */
fprintf(adb, "\tbegin\n");
fprintf(adb, "\t\t%s_wrappers%s%s.%s(%d%s",
distant_fv,
......@@ -379,29 +369,29 @@ void add_PI_to_ada_wrappers(Interface * i)
}
else { /* User-defined function: call function in vm_if.c */
fprintf(adb, "\t\tprocedure C_%s_%s", i->parent_fv->name, i->name);
if (NULL != i->in) {
fprintf(adb, "\n\t\t\t(");
fprintf(adb,
"C_%sBuffer:Interfaces.C.char_array;\n\t\t\tC_%sMaxSize:Integer",
i->in->value->name,
i->in->value->name);
fprintf(adb, ")");
}
fprintf(adb, ";\n");
fprintf(adb, "\t\tpragma Import (C, C_%s_%s, \"%s_%s\");\n\n",
i->parent_fv->name, i->name, i->parent_fv->name, i->name);
// Body of the procedure: make the call to the C function
fprintf(adb, "\tbegin\n\t\tC_%s_%s", i->parent_fv->name, i->name);
if (NULL != i->in) {
fprintf(adb, " (");
fprintf(adb, "%s_AdaBuffer, %s_AdaBuffer'Length",
i->in->value->name,
i->in->value->name);
fprintf(adb, ")");
}
fprintf(adb, ";\n");
fprintf(adb, "\t\tprocedure C_%s_%s", i->parent_fv->name, i->name);
if (NULL != i->in) {
fprintf(adb, "\n\t\t\t(");
fprintf(adb,
"C_%sBuffer:Interfaces.C.char_array;\n\t\t\tC_%sMaxSize:Integer",
i->in->value->name,
i->in->value->name);
fprintf(adb, ")");
}
fprintf(adb, ";\n");
fprintf(adb, "\t\tpragma Import (C, C_%s_%s, \"%s_%s\");\n\n",
i->parent_fv->name, i->name, i->parent_fv->name, i->name);
// Body of the procedure: make the call to the C function
fprintf(adb, "\tbegin\n\t\tC_%s_%s", i->parent_fv->name, i->name);
if (NULL != i->in) {
fprintf(adb, " (");
fprintf(adb, "%s_AdaBuffer, %s_AdaBuffer'Length",