check.c File Reference

#include <stdlib.h>
#include "intersci-n.h"
#include "check.h"

Include dependency graph for check.c:

Go to the source code of this file.

Functions

void CheckMATRIX (FILE *f, var, int flag)
void CheckCom (FILE *f, var, int flag)
void CheckSTRING (FILE *f, var, int flag)
void CheckBMATRIX (FILE *f, var, int flag)
void CheckIMATRIX (FILE *f, var, int flag)
void CheckSPARSE (FILE *f, var, int flag)
void CheckSTRINGMAT (FILE *f, var, int flag)
void CheckROW (FILE *f, var, int flag)
void CheckCOLUMN (FILE *f, var, int flag)
void CheckVECTOR (FILE *f, var, int flag)
void CheckPOLYNOM (FILE *f, var, int flag)
void CheckSCALAR (FILE *f, var, int flag)
void CheckPOINTER (FILE *f, var, int flag)
void CheckANY (FILE *f, var, int flag)
void CheckLIST (FILE *f, var, int flag)
void CheckTLIST (FILE *f, var, int flag)
void CheckSEQUENCE (FILE *f, var, int flag)
void CheckEMPTY (FILE *f, var, int flag)
void CheckWORK (FILE *f, var, int flag)
void CheckDIMFOREXT (FILE *f, var, int flag)
void CheckOptDim (FILE *f, VARPTR var, int nel)
void CheckOptSquare (FILE *f, VARPTR var, char *str1_)

Variables

CheckRhsTab CHECKTAB []
int indent
int pass
static char str1 [MAXNAM]
static char str2 [MAXNAM]


Function Documentation

void CheckANY ( FILE *  f,
var  ,
int  flag 
)

Definition at line 293 of file check.c.

00293                                                           {
00294   fprintf(stderr,"Wrong type in Check function \n");
00295   exit(1);
00296 }

void CheckBMATRIX ( FILE *  f,
var  ,
int  flag 
)

Definition at line 102 of file check.c.

References BOOLEAN, CheckCom(), CheckOptDim(), CheckOptSquare(), INT, SGetForType(), SGetSciType(), str1, and var.

00104 {
00105   if (var->for_type != INT && var->for_type != BOOLEAN)
00106     {
00107       printf("incompatibility between the type %s and FORTRAN type %s for variable \"%s\"\n",
00108              SGetSciType(var->type),SGetForType(var->for_type),var->name);
00109       exit(1);
00110     }
00111   var->for_type = BOOLEAN;
00112   CheckCom(f,var,flag);
00114   CheckOptSquare(f,var,str1); 
00115   CheckOptDim(f,var,0);
00116   CheckOptDim(f,var,1);
00117 }

Here is the call graph for this function:

void CheckCOLUMN ( FILE *  f,
var  ,
int  flag 
)

Definition at line 209 of file check.c.

References AddDeclare1(), CheckCom(), CheckOptDim(), DEC_INT, Fprintf(), i1, indent, and var.

00210 {
00211   int i1= var->stack_position;
00212   CheckCom(f,var,flag);
00213   CheckOptDim(f,var,0);
00214   Fprintf(f,indent,"CheckColumn(%d,m%d,n%d);\n",i1,i1,i1);
00215   Fprintf(f,indent,"mn%d=m%d*n%d;\n",i1,i1,i1);
00216   AddDeclare1(DEC_INT,"mn%d",i1);
00217 }

Here is the call graph for this function:

void CheckCom ( FILE *  f,
var  ,
int  flag 
)

common function for different data types

A scilab matrix argument

Definition at line 58 of file check.c.

References i1, str1, str2, and var.

Referenced by CheckBMATRIX(), CheckCOLUMN(), CheckMATRIX(), CheckROW(), CheckSCALAR(), CheckSTRING(), and CheckVECTOR().

00060 {
00061   int i1 = var->stack_position - basfun->NewMaxOpt +1 ;
00062   if ( flag == 1 ) 
00063     sprintf(str2,"k");
00064   else
00065     sprintf(str2,"%d",i1);
00066   if (var->list_el ==0 )
00067     {
00069       sprintf(str1,"%d",i1);
00070     }
00071   else
00072     {
00073       sprintf(str1,"%de%d",i1,var->list_el);
00074     }
00075 }

Here is the caller graph for this function:

void CheckDIMFOREXT ( FILE *  f,
var  ,
int  flag 
)

Definition at line 327 of file check.c.

00328 {  
00329   fprintf(stderr,"Wrong type in Check function \n");
00330   exit(1);
00331 }

void CheckEMPTY ( FILE *  f,
var  ,
int  flag 
)

Definition at line 314 of file check.c.

00315 {  
00316   fprintf(stderr,"Wrong type in Check function \n");
00317   exit(1);
00318 }

void CheckIMATRIX ( FILE *  f,
var  ,
int  flag 
)

Definition at line 123 of file check.c.

References CheckOptDim(), CheckOptSquare(), i1, str1, str2, and var.

00125 {
00126   int i1= var->stack_position;
00127   if ( flag == 1 ) 
00128     sprintf(str2,"k");
00129   else
00130     sprintf(str2,"%d",i1);
00131   if (var->list_el ==0 )
00132     sprintf(str1,"%d",i1);
00133   else
00134     sprintf(str1,"%de%d",i1,var->list_el);
00136   CheckOptSquare(f,var,str1); 
00137   CheckOptDim(f,var,0);
00138   CheckOptDim(f,var,1);
00139 }

Here is the call graph for this function:

void CheckLIST ( FILE *  f,
var  ,
int  flag 
)

Definition at line 298 of file check.c.

00298                                                            {
00299   fprintf(stderr,"Wrong type in Check function \n");
00300   exit(1);
00301 }

void CheckMATRIX ( FILE *  f,
var  ,
int  flag 
)

Definition at line 46 of file check.c.

References CheckCom(), CheckOptDim(), CheckOptSquare(), str1, and var.

00048 {
00049   CheckCom(f,var,flag);
00051   CheckOptSquare(f,var,str1); 
00052   CheckOptDim(f,var,0);
00053   CheckOptDim(f,var,1);
00054 }

Here is the call graph for this function:

void CheckOptDim ( FILE *  f,
VARPTR  var,
int  nel 
)

Definition at line 334 of file check.c.

References var::for_name, Fprintf(), indent, var::name, var::nfor_name, var, and variables.

Referenced by CheckBMATRIX(), CheckCOLUMN(), CheckIMATRIX(), CheckMATRIX(), CheckPOLYNOM(), CheckROW(), CheckSCALAR(), CheckSPARSE(), CheckSTRING(), CheckSTRINGMAT(), and CheckVECTOR().

00338 {
00339   if (var->el[nel]-1>=0) {
00340   VARPTR var1 = variables[var->el[nel]-1];
00341   if ( var1->nfor_name == 0) 
00342     {
00343       fprintf(stderr,"Pb with element number %d [%s] of variable %s\n",
00344               nel+1, var1->name, var->name);
00345       return;
00346     }
00347   if (isdigit(var1->name[0]) != 0) 
00348     {
00349       /* the dimension of the variable is a constant integer */
00350       if ( strcmp(var1->for_name[0],var1->name) != 0) 
00351         {
00352           Fprintf(f,indent,"CheckOneDim(opts[%d].position,%d,%s,%s);\n",
00353                   var->stack_position - basfun->NewMaxOpt +1 ,
00354                   nel+1,
00355                   var1->for_name[0],var1->name);
00356         }
00357     }
00358   }
00359 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CheckOptSquare ( FILE *  f,
VARPTR  var,
char *  str1_ 
)

Definition at line 363 of file check.c.

References Fprintf(), indent, and var.

Referenced by CheckBMATRIX(), CheckIMATRIX(), CheckMATRIX(), CheckSPARSE(), and CheckSTRINGMAT().

00364 {
00365   /* XXXXX cas liste ? */
00366   if (var->el[0] == var->el[1]) 
00367     {
00368       Fprintf(f,indent,"CheckSquare(opts[%d].position,opts[%s].m,opts[%s].n);\n",
00369               var->stack_position - basfun->NewMaxOpt +1 ,
00370               str1_,str1_);
00371     }
00372 }

Here is the call graph for this function:

Here is the caller graph for this function:

void CheckPOINTER ( FILE *  f,
var  ,
int  flag 
)

Definition at line 271 of file check.c.

References AddDeclare1(), DEC_INT, i1, str1, str2, and var.

00273 {
00274   int i1= var->stack_position;
00275   if ( flag == 1 ) 
00276     sprintf(str2,"k");
00277   else
00278     sprintf(str2,"%d",i1);
00279   sprintf(str1,"%d",i1);
00280   if (var->list_el ==0 )
00281     {
00282       sprintf(str1,"%d",i1);
00283     }
00284   else
00285     {
00286       fprintf(stderr,"Wrong type opointer inside a list \n");
00287       exit(1);
00288     }
00289   AddDeclare1(DEC_INT,"lr%s",str1);
00290 }

Here is the call graph for this function:

void CheckPOLYNOM ( FILE *  f,
var  ,
int  flag 
)

Definition at line 237 of file check.c.

References CheckOptDim(), i1, str1, str2, and var.

00238 {
00239   int i1= var->stack_position;
00240   if ( flag == 1 ) 
00241     sprintf(str2,"k");
00242   else
00243     sprintf(str2,"%d",i1);
00244   if (var->list_el ==0 )
00245     {
00246       sprintf(str1,"%d",i1);
00247     }
00248   else
00249     {
00250       sprintf(str1,"%de%d",i1,var->list_el);
00251     }
00252   CheckOptDim(f,var,0);
00253 }

Here is the call graph for this function:

void CheckROW ( FILE *  f,
var  ,
int  flag 
)

Definition at line 194 of file check.c.

References AddDeclare1(), CheckCom(), CheckOptDim(), DEC_INT, Fprintf(), i1, indent, and var.

00195 {
00196   int i1= var->stack_position;
00197   CheckCom(f,var,flag);
00198   CheckOptDim(f,var,0);
00199   Fprintf(f,indent,"CheckRow(%d,m%d,n%d);\n",i1,i1,i1);
00200   Fprintf(f,indent,"mn%d=m%d*n%d;\n",i1,i1,i1);
00201   AddDeclare1(DEC_INT,"mn%d",i1);
00202 }

Here is the call graph for this function:

void CheckSCALAR ( FILE *  f,
var  ,
int  flag 
)

Definition at line 259 of file check.c.

References CheckCom(), CheckOptDim(), Fprintf(), i1, indent, and var.

00260 {
00261   int i1= var->stack_position;
00262   CheckCom(f,var,flag);
00263   CheckOptDim(f,var,0);
00264   Fprintf(f,indent,"CheckScalar(%d,m%d,n%d);\n",i1,i1,i1);
00265 }

Here is the call graph for this function:

void CheckSEQUENCE ( FILE *  f,
var  ,
int  flag 
)

Definition at line 308 of file check.c.

00309 {  
00310   fprintf(stderr,"Wrong type in Check function \n");
00311   exit(1);
00312 }

void CheckSPARSE ( FILE *  f,
var  ,
int  flag 
)

Definition at line 146 of file check.c.

References CheckOptDim(), CheckOptSquare(), i1, str1, str2, and var.

00148 {
00149   int i1= var->stack_position;
00150   if ( flag == 1 ) 
00151     sprintf(str2,"k");
00152   else
00153     sprintf(str2,"%d",i1);
00154   if (var->list_el ==0 )
00155     {
00156       sprintf(str1,"%d",i1);
00157     }
00158   else
00159     {
00160       sprintf(str1,"%de%d",i1,var->list_el);
00161     }
00163   CheckOptSquare(f,var,str1); 
00164   CheckOptDim(f,var,0);
00165   CheckOptDim(f,var,1);
00166 }

Here is the call graph for this function:

void CheckSTRING ( FILE *  f,
var  ,
int  flag 
)

Definition at line 84 of file check.c.

References CHAR, CheckCom(), CheckOptDim(), SGetForType(), SGetSciType(), STRING, and var.

00085 {
00086   if (var->for_type != CHAR) 
00087     {
00088       printf("incompatibility between the type %s and FORTRAN type %s for variable \"%s\"\n",
00089              SGetSciType(STRING),SGetForType(var->for_type),var->name);
00090       exit(1);
00091     }
00092 
00093   CheckCom(f,var,flag);
00094   CheckOptDim(f,var,0);
00095 }

Here is the call graph for this function:

void CheckSTRINGMAT ( FILE *  f,
var  ,
int  flag 
)

Definition at line 173 of file check.c.

References CheckOptDim(), CheckOptSquare(), i1, str1, and var.

00174 {
00175   int i1= var->stack_position;
00176   if (var->list_el ==0 )
00177     {
00178       sprintf(str1,"%d",i1);
00179     }
00180   else
00181     {
00182       sprintf(str1,"%de%d",i1,var->list_el);
00183     }
00184   /* square matrix */
00185   CheckOptSquare(f,var,str1); 
00186   CheckOptDim(f,var,0);
00187   CheckOptDim(f,var,1);
00188 }

Here is the call graph for this function:

void CheckTLIST ( FILE *  f,
var  ,
int  flag 
)

Definition at line 303 of file check.c.

00303                                                             {
00304   fprintf(stderr,"Wrong type in Check function \n");
00305   exit(1);
00306 }

void CheckVECTOR ( FILE *  f,
var  ,
int  flag 
)

Definition at line 223 of file check.c.

References AddDeclare1(), CheckCom(), CheckOptDim(), DEC_INT, Fprintf(), i1, indent, and var.

00224 {
00225   int i1= var->stack_position;
00226   CheckCom(f,var,flag);
00227   CheckOptDim(f,var,0);
00228   Fprintf(f,indent,"CheckVector(%d,m%d,n%d);\n",i1,i1,i1);
00229   Fprintf(f,indent,"mn%d=m%d*n%d;\n",i1,i1,i1);
00230   AddDeclare1(DEC_INT,"mn%d",i1);
00231 }

Here is the call graph for this function:

void CheckWORK ( FILE *  f,
var  ,
int  flag 
)

Definition at line 320 of file check.c.

00321 {  
00322   fprintf(stderr,"Wrong type in Check function \n");
00323   exit(1);
00324 }


Variable Documentation

CheckRhsTab CHECKTAB[]

Initial value:

Definition at line 8 of file check.c.

Referenced by OptMATRIX().

int indent

Definition at line 36 of file niceprintf.c.

int pass

Definition at line 17 of file intersci-n.c.

Referenced by AddForName1(), Generate(), ISCIReadFile(), ReadImage(), and WriteFunctionCode().

char str1[MAXNAM] [static]

Definition at line 37 of file check.c.

Referenced by Check(), CheckBMATRIX(), CheckCom(), CheckIMATRIX(), CheckMATRIX(), CheckPOINTER(), CheckPOLYNOM(), CheckSPARSE(), CheckSTRINGMAT(), createblklist(), CreCOLUMN(), CreCommon(), CreIMATRIX(), CreMATRIX(), CreSCALAR(), CreSPARSE(), CreSTRING(), CreVECTOR(), DispStringAngleold(), ForVECTOR(), GetBMATRIX(), GetCOLUMN(), GetCom(), GetIMATRIX(), GetMATRIX(), GetPOINTER(), GetPOLYNOM(), GetROW(), GetSCALAR(), GetSPARSE(), getString(), GetSTRINGMAT(), GetVECTOR(), int_objsprintf(), matDialogOk(), mDialogOk(), OutBMATRIX(), OutCOLUMN(), OutCommon(), OutExtBMATRIX(), OutExtBMATRIX1(), OutExtCOLUMN(), OutExtCommon(), OutExtIMATRIX(), OutExtMATRIX(), OutExtPOLYNOM(), OutExtROW(), OutExtSCALAR(), OutExtSPARSE(), OutExtSTRING(), OutExtSTRINGMAT(), OutExtVECTOR(), OutIMATRIX(), OutLISTarg(), OutMATRIX(), OutPOLYNOM(), OutROW(), OutSCALAR(), OutSPARSE(), OutSTRING(), OutSTRINGMAT(), OutVECTOR(), StringConvert(), StringConvrt(), WriteArgCheck(), WriteCallConvertion(), WriteCallRest(), WriteExternalVariableOutput(), WriteFortranCall(), WriteFunctionCode(), WriteListAnalysis(), WriteVariableOutput(), xgetg(), XRotCreateTextItem(), XRotDrawHorizontalString(), XRotTextExtents(), and xsetg().

char str2[MAXNAM] [static]

Definition at line 38 of file check.c.

Referenced by Check(), CheckCom(), CheckIMATRIX(), CheckPOINTER(), CheckPOLYNOM(), CheckSPARSE(), CreCOLUMN(), CreCommon(), CreIMATRIX(), CreMATRIX(), CreSCALAR(), CreSPARSE(), CreSTRING(), CreVECTOR(), DispStringAngleold(), GetBMATRIX(), GetCom(), GetIMATRIX(), GetMATRIX(), GetPOINTER(), GetSPARSE(), GetSTRINGMAT(), OutBMATRIX(), OutCOLUMN(), OutCommon(), OutExtBMATRIX(), OutExtBMATRIX1(), OutExtCOLUMN(), OutExtCommon(), OutExtIMATRIX(), OutExtMATRIX(), OutExtPOLYNOM(), OutExtROW(), OutExtSCALAR(), OutExtSPARSE(), OutExtSTRING(), OutExtSTRINGMAT(), OutExtVECTOR(), OutIMATRIX(), OutLISTarg(), OutMATRIX(), OutROW(), OutSCALAR(), OutSPARSE(), OutSTRING(), OutSTRINGMAT(), OutVECTOR(), WriteCallRest(), WriteExternalVariableOutput(), WriteFortranCall(), WriteFunctionCode(), WriteVariableOutput(), XRotCreateTextItem(), XRotDrawHorizontalString(), and XRotTextExtents().


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