outext.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void OutExtCommon __PARAMS ((FILE *f, VARPTR var, int insidelist, int nel))
void OutExtCOLUMN (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtROW (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtVECTOR (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtMATRIX (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtSCALAR (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtSTRING (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtSPARSE (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtIMATRIX (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtBMATRIX (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtBMATRIX1 (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtPOLYNOM (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtPOINTER (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtSTRINGMAT (FILE *f, VARPTR var, int insidelist, int nel)
void OutExtANY (FILE *f, VARPTR var, int insidelist, int nel)


Function Documentation

void OutExtCommon __PARAMS ( (FILE *f, VARPTR var, int insidelist, int nel  ) 

void OutExtANY ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 412 of file outext.c.

References var.

00413 {
00414   printf("output variable \"%s\" cannot have type\n",
00415          var->name);
00416   printf("  \"WORK\", \"LIST\", \"TLIST\", \"SEQUENCE\" or \"ANY\"\n");
00417   exit(1);
00418 }

void OutExtBMATRIX ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 332 of file outext.c.

References Forname2Int(), OutExtCommon(), str1, str2, var, and variables.

00333 {
00334   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00335   strcpy(str2,Forname2Int(variables[var->el[1]-1],0));
00336   OutExtCommon(f,var,insidelist,nel);
00337 }

Here is the call graph for this function:

void OutExtBMATRIX1 ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 340 of file outext.c.

References AddDeclare(), DEC_LOGICAL, Forname2Int(), Fprintf(), indent, str, str1, str2, var, and variables.

00341 {
00342   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00343   strcpy(str2,Forname2Int(variables[var->el[1]-1],0));
00344   if ( insidelist != 0)
00345     {
00346       AddDeclare(DEC_LOGICAL,"listcrebmat");
00347       Fprintf(f,indent,"if(.not.listcrebmat(fname,top,%d,lw,%s,%s,lrs)) return\n",
00348               nel,str1,str2);
00349     }
00350   else 
00351     {
00352       AddDeclare(DEC_LOGICAL,"crebmat");
00353       Fprintf(f,indent,"if(.not.crebmat(fname,top,%s,%s,lrs)) return\n",str1,str2);
00354     }
00355   sprintf(str,"lr%d",var->stack_position);
00356   Fprintf(f,indent,"call %s(%s*%s,istk(%s),istk(lrs))\n",var->fexternal,str1,str2,str);
00357 }

Here is the call graph for this function:

void OutExtCOLUMN ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 21 of file outext.c.

References Forname2Int(), OutExtCommon(), str1, str2, var, and variables.

00022 {
00023   strcpy(str2,"1");
00024   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));  
00025   OutExtCommon(f,var,insidelist,nel);
00026 }

Here is the call graph for this function:

void OutExtIMATRIX ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 292 of file outext.c.

References AddDeclare(), DEC_INT, Forname2Int(), Fprintf(), GetExistOutVar(), icre, indent, SGetExtForTypeAbrev(), SGetExtForTypeStack(), var::stack_position, str1, str2, str3, var, and variables.

00293 {
00294   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00295   strcpy(str2,Forname2Int(variables[var->el[1]-1],0));
00296   strcpy(str3,Forname2Int(variables[var->el[2]-1],0));
00297   if ( insidelist != 0)
00298     {
00299       int iout = GetExistOutVar();
00300       VARPTR vout = variables[iout -1];
00301       AddDeclare(DEC_INT,"lrs");
00302       AddDeclare(DEC_INT,"lcs");
00304       AddDeclare(DEC_INT,"m_u=-1");
00305       Fprintf(f,indent,"CreateListCVar(%d,%d,\"%s\",%s,%s,%s,&lrs,&lcs,m_u,m_u);\n",
00306               vout->stack_position,nel,
00307               SGetExtForTypeAbrev(var),
00308               str3,str1,str2);
00309     }
00310   else 
00311     {
00313       Fprintf(f,indent,"CreateCVar(%d,\"%s\",%s,%s,%s,&lrs,&lcs);\n",icre,
00314               SGetExtForTypeAbrev(var),
00315               str3,str1,str2);
00316       Fprintf(f,indent,"LhsVar(%d)=%d;\n",var->out_position,icre);
00317       icre++;
00318     }
00319   AddDeclare(DEC_INT,"lrs");
00320   AddDeclare(DEC_INT,"lcrs");
00321   AddDeclare(DEC_INT,"mnit");
00322   Fprintf(f,indent,"mnit=%s*%s;\n",str1+1,str2+1);
00323   Fprintf(f,indent,"C2F(%s)(&mnit,&ler%d,%s(lrs));\n",var->fexternal,
00324           var->stack_position,SGetExtForTypeStack(var));
00325   Fprintf(f,indent++,"if ( %s > 0 ) {\n",str3+1);
00326   Fprintf(f,indent,"C2F(%s)(&mnit,&lec%d,%s(lrs));\n",var->fexternal,
00327           var->stack_position,SGetExtForTypeStack(var));
00328   Fprintf(f,--indent,"}\n");
00329 }

Here is the call graph for this function:

void OutExtMATRIX ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 42 of file outext.c.

References Forname2Int(), OutExtCommon(), str1, str2, var, and variables.

00043 {
00044   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00045   strcpy(str2,Forname2Int(variables[var->el[1]-1],0));
00046   OutExtCommon(f,var,insidelist,nel);
00047 }

Here is the call graph for this function:

void OutExtPOINTER ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 384 of file outext.c.

References SGetSciType(), and var.

00385 {
00386   if ( insidelist != 0)
00387     {
00388       printf(" %s in output list : not implemented ;",SGetSciType(var->type));
00389     }
00390   else 
00391     {
00392     }
00393 }

Here is the call graph for this function:

void OutExtPOLYNOM ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 359 of file outext.c.

References Forname2Int(), Fprintf(), indent, var::name, str, str1, str2, var, and variables.

00360 {
00361   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00362   strcpy(str2,variables[var->el[1]-1]->name);
00363   Fprintf(f,indent,"err=sadr(ilw+10)+%s-lstk(bot)\n",str1);
00364   Fprintf(f,indent,"if(err .gt. 0) then\n");
00365   Fprintf(f,indent,"call error(17)\n");
00366   Fprintf(f,indent,"return\n");
00367   Fprintf(f,indent,"endif\n");
00368   Fprintf(f,indent,"istk(ilw)=1\n");
00369   Fprintf(f,indent,"istk(ilw+1)=1\n");              
00370   Fprintf(f,indent,"istk(ilw+2)=1\n");
00371   Fprintf(f,indent,"istk(ilw+3)=0\n");
00372   Fprintf(f,indent,"call cvstr(4,'%s    ',istk(ilw+4),0)\n",str2);
00373   /* str2 comes from SCILAB input ??? */
00374   Fprintf(f,indent,"istk(ilw+8)=1\n");
00375   Fprintf(f,indent,"istk(ilw+9)=1+%s\n",str1);
00376   sprintf(str,"lr%d",var->stack_position);
00377   Fprintf(f,indent,"lw=sadr(ilw+10)\n");
00378   Fprintf(f,indent,"call %s(%s,stk(%s),stk(lw))\n",
00379           var->fexternal,str1,str);
00380   Fprintf(f,indent,"lw=lw+%s\n",str1);
00381 }

Here is the call graph for this function:

void OutExtROW ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 28 of file outext.c.

References Forname2Int(), OutExtCommon(), str1, str2, var, and variables.

00029 {
00030   strcpy(str1,"1");
00031   strcpy(str2,Forname2Int(variables[var->el[0]-1],0));
00032   OutExtCommon(f,var,insidelist,nel);
00033 }

Here is the call graph for this function:

void OutExtSCALAR ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 49 of file outext.c.

References OutExtCommon(), str1, str2, and var.

00050 {
00051   strcpy(str1,"1");
00052   strcpy(str2,"1");
00053   OutExtCommon(f,var,insidelist,nel);
00054 }

Here is the call graph for this function:

void OutExtSPARSE ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 264 of file outext.c.

References Forname2Int(), Fprintf(), GetExistOutVar(), icre, indent, var::stack_position, str1, str2, str3, var, and variables.

00265 {
00266   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00267   strcpy(str2,Forname2Int(variables[var->el[1]-1],0));
00268   sprintf(str3,"%d",var->stack_position);
00269   if ( insidelist != 0)
00270     {
00271       int iout = GetExistOutVar();
00272       VARPTR vout = variables[iout -1];
00273       Fprintf(f,indent,"CreateListVarFromPtr(%d,\"s\",&(S%s->m),&(S%s->n),S%s);\n",
00274               vout->stack_position,nel,str3,str3,str3);
00275     }
00276   else 
00277     {
00278       Fprintf(f,indent,"LhsVar(%d)=%d;\n",var->out_position,icre);
00279       Fprintf(f,indent,"CreateVarFromPtr(%d,\"s\",&(S%s->m),&(S%s->n),S%s);\n",
00280               icre,str3,str3,str3);
00281       icre++;
00282     }
00283   if ( strcmp(var->fexternal,"csparsef")==0)
00284     {
00285       Fprintf(f,indent,"FreeSparse(S%s);\n",str3);
00286       /* Fprintf(f,indent,"/ *call %s()* /\n",var->fexternal,str); */
00287     }
00288 }

Here is the call graph for this function:

void OutExtSTRING ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 204 of file outext.c.

References AddDeclare(), DEC_INT, Forname2Int(), Fprintf(), GetExistOutVar(), icre, indent, var::stack_position, str1, str2, var, and variables.

00205 {
00206   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00207   strcpy(str2,"1");
00208   if ( strcmp(var->fexternal,"ccharf")== 0 || strcmp(var->fexternal,"cchar")== 0 ) 
00209     {
00210       if ( insidelist != 0)
00211         {
00212           int iout = GetExistOutVar();
00213           VARPTR vout = variables[iout -1];
00214           AddDeclare(DEC_INT,"un=1");
00215           strcpy(str2,"&un");
00216           Fprintf(f,indent,"CreateListVarFromPtr(%d,%d,\"c\",%s,%s,&le%d);\n",
00217               vout->stack_position,nel,str1,str2,var->stack_position);
00218         }
00219       else 
00220         {
00221           AddDeclare(DEC_INT,"un=1");
00222           strcpy(str2,"&un");
00223           Fprintf(f,indent,"CreateVarFromPtr(%d,\"c\",%s,%s,&le%d);\n",icre,
00224                   str1,str2,var->stack_position);
00225           Fprintf(f,indent,"LhsVar(%d)=%d;\n",var->out_position,icre);
00226           icre++;
00227         } 
00228       if ( strcmp(var->fexternal,"ccharf")== 0 )
00229         Fprintf(f,indent,"FreePtr(&le%d);\n",var->stack_position);
00230     }
00231   else
00232     {
00233       if ( insidelist != 0)
00234         {
00235           int iout = GetExistOutVar();
00236           VARPTR vout = variables[iout -1];
00237           AddDeclare(DEC_INT,"lrs");
00239           AddDeclare(DEC_INT,"m_u=-1");
00240           AddDeclare(DEC_INT,"un=1");
00241           strcpy(str2,"&un");
00242           Fprintf(f,indent,"CreateListVar(%d,%d,\"c\",%s,%s,&lrs,m_u);\n",
00243                   vout->stack_position,nel,str1,str2);
00244         }
00245       else 
00246         {
00248           AddDeclare(DEC_INT,"un=1");
00249           strcpy(str2,"&un");
00250           Fprintf(f,indent,"CreateVar(%d,\"c\",%s,%s,&lrs);\n",icre,
00251                   str1,str2);
00252           Fprintf(f,indent,"LhsVar(%d)=%d;\n",var->out_position,icre);
00253           icre++;
00254         } 
00255       AddDeclare(DEC_INT,"lrs");
00256       AddDeclare(DEC_INT,"mn");
00257       Fprintf(f,indent,"mn=%s*%s;\n",str1+1,str2+1);
00258       Fprintf(f,indent,"C2F(%s)(&mn,&le%d,cstk(lrs));\n",var->fexternal,
00259               var->stack_position);
00260     }
00261 }

Here is the call graph for this function:

void OutExtSTRINGMAT ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 395 of file outext.c.

References Forname2Int(), Fprintf(), indent, str, str1, str2, var, and variables.

00396 {
00397   strcpy(str1,Forname2Int(variables[var->el[0]-1],0));
00398   strcpy(str2,Forname2Int(variables[var->el[1]-1],0));
00399   sprintf(str,"lr%d",var->stack_position);
00400   Fprintf(f,indent,"call %s(stk(%s),istk(ilw),%s,%s,lstk(bot)-sadr(ilw),ierr)\n",
00401           var->fexternal,str,str1,str2);
00402   Fprintf(f,indent,"if(ierr .gt. 0) then\n");
00403   Fprintf(f,indent,"buf='not enough memory'\n");
00404   Fprintf(f,indent,"call error(1000)\n");
00405   Fprintf(f,indent,"return\n");
00406   Fprintf(f,indent,"endif\n");
00407   sprintf(str,"istk(ilw+4+%s*%s)-1",str1,str2);
00408   Fprintf(f,indent,"lw=sadr(ilw+5+%s*%s+%s)\n",str1,str2,str);
00409 }

Here is the call graph for this function:

void OutExtVECTOR ( FILE *  f,
VARPTR  var,
int  insidelist,
int  nel 
)

Definition at line 35 of file outext.c.

References Forname2Int(), OutExtCommon(), str1, str2, var, and variables.

00036 {
00037   strcpy(str1,"1");
00038   strcpy(str2,Forname2Int(variables[var->el[0]-1],0));
00039   OutExtCommon(f,var,insidelist,nel);
00040 }

Here is the call graph for this function:


Generated on Sun Mar 4 16:08:50 2007 for Scilab [trunk] by  doxygen 1.5.1