| >Will this restriction be solved feature release? If you will not, could you
>show me the reason?
From the technical point of view, it is not so difficult to distinguish the
composable or non-composable task.
I'll attach the sample code to make module definition (.DEF) file for VB.
Hiroaki
void do_mcl_vb_def ( cfe_t_symbol *grpp ) /* Task Group Symtab */
{
cfe_t_symbol *funp, *argp ;
int argnum ;
wchar_t taskgrpname[255], utaskgrpname[255], taskname[MCL_TASKNAME_MAX + 1] ;
cbe_t_emit_handle *deffile ;
/* Check generate_type */
if ( (cdr_g_options->generate_type != CDR_VB_EXPLICIT &&
cdr_g_options->generate_type != CDR_VB_IMPLICIT) ) return ; /* Nothing to do. Return!! */
/* Generate Module Definition File for upper stub for Visual Basic */
if ( grpp->symbol_type == SYMTAB_TASKGROUP )
{
/* Trancate task group name less than FILENAM_MAX */
towupps(utaskgrpname, grpp->code_gen_name);
towlows(taskgrpname, grpp->code_gen_name);
if (wcslen(taskgrpname) >= FILENAM_MAX)
*(taskgrpname + FILENAM_MAX) = '\0';
if (wcslen(utaskgrpname) >= FILENAM_MAX)
*(utaskgrpname + FILENAM_MAX) = '\0';
sprintf(outfilepath,"%S.def", taskgrpname);
/*+
* Create Module Definition File
-*/
deffile = cbe_emit_open(outfilepath, TPSTUB_FILE, NULL);
/* 'LIBRARY' Section */
sprintf ( defbuf, "LIBRARY %S", utaskgrpname);
cbe_emit ( deffile, CBE_NL, defbuf, 0, (char *)NULL ) ;
/* 'DESCRIPTION' Section " */
if (cdr_g_options->generate_type == CDR_VB_EXPLICIT)
sprintf ( defbuf, "DESCRIPTION '.DEF Template for Upper Stub of %S (EXPLICIT Binding)'", taskgrpname);
else
sprintf ( defbuf, "DESCRIPTION '.DEF Template for Upper Stub of %S (IMPLICIT Binding)'", taskgrpname);
cbe_emit ( deffile, CBE_NL, defbuf, 0, (char *)NULL ) ;
/* 'CODE' Section */
cbe_emit ( deffile, CBE_NL, "CODE PRELOAD MOVEABLE DISCARDABLE", 0, (char *)NULL);
/* 'DATA' Section */
cbe_emit ( deffile, CBE_NL, "DATA PRELOAD MOVEABLE SINGLE", 0, (char *)NULL);
/* 'HEAPSIZE' Section */
cbe_emit ( deffile, CBE_NL, "HEAPSIZE 32767", 0, (char *)NULL);
/* 'EXPORTS' Section */
cbe_emit ( deffile, CBE_NL, "EXPORTS", 0, (char *)NULL);
/* Main loop for current task group */
for ( funp = grpp->child ; funp != NULL ; funp = funp->sibling ) {
if ( funp->u.t_int.composable == FALSE ) {
/* Count up number of arguments */
argnum = 0 ;
for ( argp = funp->child ; argp != NULL ; argp = argp->sibling )
argnum ++ ;
if (cdr_g_options->generate_type == CDR_VB_EXPLICIT)
argnum += 2; /* Add BindStr and EINFO */
else
argnum += 1; /* Add EINFO */
/*+
* Create contents of EXPORTS section.
-*/
towlows ( taskname, funp->code_gen_name ) ;
sprintf ( defbuf, " %S = _%S@%d", taskname, taskname, argnum * sizeof(void *) ) ;
cbe_emit ( deffile, CBE_NL, defbuf, 0, (char *)NULL ) ;
} /* End of if */
} /* End of for */
/*+
* Close Module Definition File
-*/
cbe_emit_close ( deffile ) ;
} /* End of if */
}
|