stack3.c File Reference

#include <string.h>
#include "stack3.h"
#include "stack-c.h"

Include dependency graph for stack3.c:

Go to the source code of this file.

Functions

int C2F (dmcopy)
int C2F() creadmat (char *namex, integer *m, integer *n, double *scimat, unsigned long name_len)
int C2F() creadcmat (char *namex, integer *m, integer *n, double *scimat, unsigned long name_len)
int C2F() cwritemat (char *namex, integer *m, integer *n, double *mat, unsigned long name_len)
int C2F() cwritecmat (char *namex, integer *m, integer *n, double *mat, unsigned long name_len)
int C2F() putvar (int *number, char *namex, unsigned long name_len)
int C2F() readchain (char *namex, integer *itslen, char *chai, unsigned long name_len, unsigned long chai_len)
int C2F() creadchain (char *namex, integer *itslen, char *chai, unsigned long name_len, unsigned long chai_len)
int C2F() creadchains (char *namex, integer *ir, integer *ic, integer *itslen, char *chai, unsigned long name_len, unsigned long chai_len)
int C2F() cwritechain (char *namex, integer *m, char *chai, unsigned long name_len, unsigned long chai_len)
int C2F() matptr (char *namex, integer *m, integer *n, integer *lp, unsigned long name_len)
int C2F() cmatptr (char *namex, integer *m, integer *n, integer *lp, unsigned long name_len)
int C2F() cmatcptr (char *namex, integer *m, integer *n, integer *lp, unsigned long name_len)
int C2F() cmatsptr (char *namex, integer *m, integer *n, integer *ix, integer *j, integer *lp, integer *nlr, unsigned long name_len)
void * Name2ptr (char *namex)
int Name2where (char *namex)
int C2F() str2name (char *namex, integer *id, unsigned long name_len)
int C2F() objptr (char *namex, integer *lp, integer *fin, unsigned long name_len)
int C2F() creadbmat (char *namex, integer *m, integer *n, int *scimat, unsigned long name_len)
int C2F() cwritebmat (char *namex, integer *m, integer *n, int *mat, unsigned long name_len)
int C2F() cmatbptr (char *namex, integer *m, integer *n, integer *lp, unsigned long name_len)
int getlengthchain (char *namex)


Function Documentation

int C2F ( dmcopy   ) 

Definition at line 15 of file stack3.c.

References C2F, creadmat(), and j.

00033 {
00034     int j;
00035     j = C2F(creadmat)(namex, m, n, scimat, name_len);
00036     return 0;
00037 }

Here is the call graph for this function:

int C2F() cmatbptr ( char *  namex,
integer m,
integer n,
integer lp,
unsigned long  name_len 
)

get pointer on a named boolean matrix

Definition at line 693 of file stack3.c.

References C2F, FALSE_, Fin, get_fname(), getbmat(), iadr, id, Infstk, istk, L, lp, Lstk, m, n, name_len, namex, nsiz, stackg(), str2name(), and TRUE_.

Referenced by Java_javasci_SciBooleanArray_Get(), and Java_javasci_SciBooleanArray_GetElement().

00694 {
00695         integer id[nsiz];
00696         C2F(str2name)(namex, id, name_len);
00697         /* get the position in fin */
00698         Fin = -1;
00699         C2F(stackg)(id);
00700         if (Fin == 0) 
00701         {
00702                 Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00703                 *m = -1;
00704                 *n = -1;
00705                 return FALSE_;
00706         }
00707         /* get data */
00708         if (*Infstk(Fin ) == 2) 
00709         {
00710                 Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00711         }
00712 
00713         if (! C2F(getbmat)("creadbmat", &Fin, &Fin, m, n, lp , 9L))     return FALSE_;
00714         
00715         return TRUE_ ;
00716 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cmatcptr ( char *  namex,
integer m,
integer n,
integer lp,
unsigned long  name_len 
)

Definition at line 464 of file stack3.c.

References C2F, FALSE_, Fin, get_fname(), getcmat(), iadr, id, Infstk, istk, L, lp, Lstk, m, n, name_len, namex, nsiz, stackg(), str2name(), and TRUE_.

Referenced by Java_javasci_SciComplexArray_Get(), Java_javasci_SciComplexArray_GetImaginaryPartElement(), and Java_javasci_SciComplexArray_GetRealPartElement().

00465 {
00466     integer id[nsiz];
00467     C2F(str2name)(namex, id, name_len);
00468     /* get the position in fin */
00469     Fin = -1;
00470     C2F(stackg)(id);
00471     if (Fin == 0) {
00472       Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00473       *m = -1;
00474       *n = -1;
00475       return FALSE_;
00476     }
00477     /* get data */
00478     if (*Infstk(Fin ) == 2) {
00479         Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00480     }
00481     if (! C2F(getcmat)("creadmat", &Fin, &Fin, m, n, lp, 8L)) {
00482         return FALSE_;
00483     }
00484     return TRUE_ ;
00485 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cmatptr ( char *  namex,
integer m,
integer n,
integer lp,
unsigned long  name_len 
)

Definition at line 412 of file stack3.c.

References C2F, FALSE_, Fin, get_fname(), getrmat(), iadr, id, Infstk, istk, L, lp, Lstk, m, n, name_len, namex, nsiz, stackg(), str2name(), and TRUE_.

Referenced by CMatrix::CMatrix(), CMatrix::inv(), Java_javasci_SciDoubleArray_Get(), Java_javasci_SciDoubleArray_GetElement(), matptr(), CMatrix::plus(), and SendScilabJob().

00413 {
00414     integer id[nsiz];
00415     C2F(str2name)(namex, id, name_len);
00416     /* get the position in fin */
00417     Fin = -1;
00418     C2F(stackg)(id);
00419     if (Fin == 0) {
00420       Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00421       *m = -1;
00422       *n = -1;
00423       return FALSE_;
00424     }
00425     /* get data */
00426     if (*Infstk(Fin ) == 2) {
00427         Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00428     }
00429     if (! C2F(getrmat)("creadmat", &Fin, &Fin, m, n, lp, 8L)) {
00430         return FALSE_;
00431     }
00432     return TRUE_ ;
00433 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cmatsptr ( char *  namex,
integer m,
integer n,
integer ix,
integer j,
integer lp,
integer nlr,
unsigned long  name_len 
)

Definition at line 510 of file stack3.c.

References C2F, FALSE_, Fin, get_fname(), getsmat(), iadr, id, Infstk, istk, ix, j, L, lp, Lstk, m, n, name_len, namex, nlr, nsiz, stackg(), str2name(), and TRUE_.

00511 {
00512     integer id[nsiz];
00513     C2F(str2name)(namex, id, name_len);
00514     /* get the position in fin */
00515     Fin = -1;
00516     C2F(stackg)(id);
00517     if (Fin == 0) {
00518       Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00519       *m = -1;
00520       *n = -1;
00521       return FALSE_;
00522     }
00523     /* get data */
00524     if (*Infstk(Fin ) == 2) {
00525         Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00526     }
00527     if (! C2F(getsmat)("creadmat", &Fin, &Fin, m, n, ix, j, lp, nlr, 8L)) {
00528         return FALSE_;
00529     }
00530     return TRUE_ ;
00531 }

Here is the call graph for this function:

int C2F() creadbmat ( char *  namex,
integer m,
integer n,
int scimat,
unsigned long  name_len 
)

read a boolean matrix in scilab stack

Definition at line 643 of file stack3.c.

References C2F, Err, FALSE_, Fin, get_fname(), getbmat(), iadr, icopy(), Infstk, istk, L, l, Lstk, m, n, N, name_len, namex, nsiz, scimat, stackg(), str2name(), and TRUE_.

Referenced by Java_javasci_SciBooleanArray_Get(), and Java_javasci_SciBooleanArray_GetElement().

00644 {
00645         integer l = 0;
00646         integer id[nsiz];
00647         int c_x = 1;
00648         int N = 0;
00649 
00650         C2F(str2name)(namex, id, name_len);
00651         /* read   : from scilab stack -> fortran variable */
00652         Fin = -1;
00653         C2F(stackg)(id);
00654         if (Err > 0) return FALSE_ ; 
00655         if (Fin == 0) {
00656                 Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00657                 return FALSE_;
00658         }
00659         if ( *Infstk(Fin ) == 2)  Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00660 
00661         /* get matrix data pointer */
00662         if (! C2F(getbmat)("creadbmat", &Fin, &Fin, m, n, &l , 9L))     return FALSE_;
00663 
00664         N = *n * *m;
00665         C2F(icopy)(&N,istk(l),&c_x,scimat,&c_x);
00666 
00667         return TRUE_;
00668 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() creadchain ( char *  namex,
integer itslen,
char *  chai,
unsigned long  name_len,
unsigned long  chai_len 
)

Definition at line 248 of file stack3.c.

References C2F, chai, chai_len, cvstr(), cx1, Err, FALSE_, Fin, get_fname(), getsmat(), iadr, Infstk, istk, itslen, L, lr1, Lstk, m1, Min, n1, name_len, namex, nsiz, stackg(), str2name(), and TRUE_.

Referenced by readchain().

00249 {
00250     integer ix1;
00251     integer m1, n1;
00252     integer id[nsiz];
00253     integer lr1;
00254     integer nlr1;
00255 
00256     Err = 0;
00257     C2F(str2name)(namex, id, name_len);
00258     Fin = -1;
00259     C2F(stackg)(id);
00260     if (Err > 0) return FALSE_ ;
00261     if (Fin == 0) {
00262       Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00263       return FALSE_ ;
00264     }
00265     if (*Infstk(Fin ) == 2) {
00266         Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00267     }
00268     if (! C2F(getsmat)("creadchain", &Fin, &Fin, &m1, &n1, &cx1, &cx1, &lr1, &nlr1, 10L)) {
00269         return FALSE_;
00270     }
00271     if (m1 * n1 != 1) {
00272       Scierror(999,"creadchain: argument must be a string\r\n");
00273       return FALSE_ ;
00274     }
00275 
00276     ix1 = *itslen - 1;
00277     *itslen = Min(ix1,nlr1);
00278     C2F(cvstr)(itslen, istk(lr1 ), chai, &cx1, chai_len);
00279     chai[*itslen] = '\0';
00280     return TRUE_ ;
00281 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() creadchains ( char *  namex,
integer ir,
integer ic,
integer itslen,
char *  chai,
unsigned long  name_len,
unsigned long  chai_len 
)

Definition at line 304 of file stack3.c.

References C2F, chai, chai_len, cvstr(), cx1, Err, FALSE_, Fin, get_fname(), getsmat(), iadr, ic, Infstk, ir, istk, itslen, L, lr1, Lstk, m1, Min, n1, name_len, namex, nsiz, stackg(), str2name(), and TRUE_.

Referenced by Java_javasci_Scilab_receiveStringMatrix(), and Java_javasci_SciStringArray_GetElement().

00305 {
00306     integer ix1;
00307     integer m1, n1;
00308     integer id[nsiz];
00309     integer lr1;
00310     integer nlr1;
00311 
00312     Err = 0;
00313     C2F(str2name)(namex, id, name_len);
00314     Fin = -1;
00315     C2F(stackg)(id);
00316     if (Err > 0) return FALSE_ ;
00317 
00318     if (Fin == 0) {
00319       Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00320       return FALSE_ ;
00321     }
00322 
00323     if (*Infstk(Fin ) == 2) {
00324         Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00325     }
00326     if (*ir == -1 && *ic == -1) {
00327         if (! C2F(getsmat)("creadchain", &Fin, &Fin, ir, ic, &cx1, &cx1, &lr1, &nlr1, 10L)) 
00328           return FALSE_;
00329         else 
00330           return TRUE_ ; 
00331     } else {
00332         if (! C2F(getsmat)("creadchain", &Fin, &Fin, &m1, &n1, ir, ic, &lr1, &nlr1, 10L)) {
00333           return FALSE_;
00334         }
00335     }
00336     ix1 = *itslen - 1;
00337     *itslen = Min(ix1,nlr1);
00338     C2F(cvstr)(itslen, istk(lr1 ), chai, &cx1, chai_len);
00339     chai[*itslen]='\0';
00340     return TRUE_;
00341 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() creadcmat ( char *  namex,
integer m,
integer n,
double *  scimat,
unsigned long  name_len 
)

Definition at line 110 of file stack3.c.

References C2F, Err, FALSE_, Fin, get_fname(), getcmat(), iadr, Infstk, istk, L, l, Lstk, m, n, name_len, namex, nsiz, scimat, stackg(), stk, str2name(), and TRUE_.

Referenced by Java_javasci_SciComplexArray_Get(), Java_javasci_SciComplexArray_GetImaginaryPartElement(), and Java_javasci_SciComplexArray_GetRealPartElement().

00111 {
00112     integer l, ix1;
00113     integer id[nsiz];
00114 
00115     C2F(str2name)(namex, id, name_len);
00116     /* read   : from scilab stack -> fortran variable */
00117     Fin = -1;
00118     C2F(stackg)(id);
00119     if (Err > 0) return FALSE_ ; 
00120     if (Fin == 0) {
00121       Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00122       return FALSE_;
00123     }
00124     if ( *Infstk(Fin ) == 2)  Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00125     /* get matrix data pointer */
00126     if (! C2F(getcmat)("creadcmat", &Fin, &Fin, m, n, &l, 8L))  return FALSE_;
00127     ix1 = *m * *n;
00128     C2F(dmcopy)(stk(l ), m, scimat, m, m, n);
00129     C2F(dmcopy)(stk(l+ix1 ), m, scimat+ix1, m, m, n);
00130 
00131     return TRUE_;
00132 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() creadmat ( char *  namex,
integer m,
integer n,
double *  scimat,
unsigned long  name_len 
)

Definition at line 61 of file stack3.c.

References C2F, Err, FALSE_, Fin, get_fname(), getrmat(), iadr, Infstk, istk, L, l, Lstk, m, n, name_len, namex, nsiz, scimat, stackg(), stk, str2name(), and TRUE_.

Referenced by C2F(), Java_javasci_SciDoubleArray_Get(), Java_javasci_SciDoubleArray_GetElement(), and Java_javasci_Scilab_receiveDoubleMatrix().

00062 {
00063     integer l;
00064     integer id[nsiz];
00065 
00066     C2F(str2name)(namex, id, name_len);
00067     /* read   : from scilab stack -> fortran variable */
00068     Fin = -1;
00069     C2F(stackg)(id);
00070     if (Err > 0) return FALSE_ ; 
00071     if (Fin == 0) {
00072       Scierror(4,"Undefined variable %s\r\n",get_fname(namex,name_len));
00073       return FALSE_;
00074     }
00075     if ( *Infstk(Fin ) == 2)  Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00076     /* get matrix data pointer */
00077     if (! C2F(getrmat)("creadmat", &Fin, &Fin, m, n, &l, 8L))   return FALSE_;
00078 
00079     C2F(dmcopy)(stk(l ), m, scimat, m, m, n);
00080 
00081     return TRUE_;
00082 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cwritebmat ( char *  namex,
integer m,
integer n,
int mat,
unsigned long  name_len 
)

write a boolean matrix in scilab stack

Definition at line 670 of file stack3.c.

References C2F, crebmat(), cx0, cx1, Err, FALSE_, icopy(), istk, L, lr, m, mat, n, name_len, namex, Nbvars, nsiz, Rhs, stackp(), str2name(), Top, and TRUE_.

Referenced by Java_javasci_SciBooleanArray_Send().

00671 {
00672         integer   ix1 = *m * *n;
00673         integer Rhs_k = Rhs , Top_k = Top ;
00674         integer l4, id[nsiz], lr;
00675 
00676         C2F(str2name)(namex, id, name_len);
00677         Top = Top + Nbvars + 1; 
00678         if (! C2F(crebmat)("cwritebmat", &Top, m, n, &lr, 10L)) return  FALSE_;
00679 
00680         C2F(icopy)(&ix1, mat, &cx1, istk(lr ), &cx1);
00681         Rhs = 0;
00682         l4 = C2F(iop).lct[3];
00683         C2F(iop).lct[3] = -1;
00684         C2F(stackp)(id, &cx0);
00685         C2F(iop).lct[3] = l4;
00686         Top = Top_k;
00687         Rhs = Rhs_k;
00688         if (Err > 0)  return FALSE_;
00689         return TRUE_;
00690 
00691 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cwritechain ( char *  namex,
integer m,
char *  chai,
unsigned long  name_len,
unsigned long  chai_len 
)

Definition at line 352 of file stack3.c.

References C2F, chai, chai_len, cresmat2(), cvstr(), cx0, Err, FALSE_, istk, L, lr, m, name_len, namex, Nbvars, nsiz, Rhs, stackp(), str2name(), Top, and TRUE_.

Referenced by Java_javasci_SciStringArray_SendString(), and SendScilabJob().

00353 {
00354     integer Rhs_k, Top_k;
00355     integer l4;
00356     integer id[nsiz], lr;
00357     C2F(str2name)(namex, id, name_len);
00358     Top_k = Top;
00359     /* jpc april 2002 */ 
00360     /* ++Top; */
00361     Top = Top + Nbvars + 1; 
00362     if (! C2F(cresmat2)("cwritechain", &Top, m, &lr, 11L)) {
00363         return FALSE_;
00364     }
00365     C2F(cvstr)(m, istk(lr ), chai, &cx0, chai_len);
00366     Rhs_k = Rhs;
00367     Rhs = 0;
00368     l4 = C2F(iop).lct[3];
00369     C2F(iop).lct[3] = -1;
00370     C2F(stackp)(id, &cx0);
00371     C2F(iop).lct[3] = l4;
00372     Top = Top_k ;
00373     Rhs = Rhs_k ;
00374     if (Err > 0)  return FALSE_;
00375     return TRUE_ ;
00376 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cwritecmat ( char *  namex,
integer m,
integer n,
double *  mat,
unsigned long  name_len 
)

cwritecmat writes vector/matrix in scilab's internal stack name: character string; name of the scilab variable ( null terMinated) m: number of rows n: number of columns mat: matrix entries stored columnwise in Scilab object for complex number

Definition at line 177 of file stack3.c.

References C2F, cremat(), cx0, cx1, dcopy(), Err, FALSE_, L, lc, lr, m, mat, n, name_len, namex, Nbvars, nsiz, Rhs, stackp(), stk, str2name(), Top, and TRUE_.

Referenced by Java_javasci_SciComplexArray_Send().

00178 {
00179         integer   ix1 = *m * *n *2; /* real part + imaginary part */
00180         integer Rhs_k = Rhs , Top_k = Top ;
00181         integer l4, id[nsiz], lc, lr;
00182         int IT=1; /* Type Complex */
00183 
00184         C2F(str2name)(namex, id, name_len);
00185         
00186         Top = Top + Nbvars + 1; 
00187         if (! C2F(cremat)("cwritecmat", &Top, &IT, m, n, &lr, &lc, 10L)) return  FALSE_;
00188         C2F(dcopy)(&ix1, mat, &cx1, stk(lr ), &cx1);
00189         Rhs = 0;
00190         l4 = C2F(iop).lct[3];
00191         C2F(iop).lct[3] = -1;
00192         C2F(stackp)(id, &cx0);
00193         C2F(iop).lct[3] = l4;
00194         Top = Top_k;
00195         Rhs = Rhs_k;
00196         if (Err > 0)  return FALSE_;
00197         return TRUE_;
00198 } 

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() cwritemat ( char *  namex,
integer m,
integer n,
double *  mat,
unsigned long  name_len 
)

Definition at line 143 of file stack3.c.

References C2F, cremat(), cx0, cx1, dcopy(), Err, FALSE_, L, lc, lr, m, mat, n, name_len, namex, Nbvars, nsiz, Rhs, stackp(), stk, str2name(), Top, and TRUE_.

Referenced by Java_javasci_SciDoubleArray_Send(), and Java_javasci_Scilab_sendDoubleMatrix().

00144 {
00145   integer   ix1 = *m * *n;
00146   integer Rhs_k = Rhs , Top_k = Top ;
00147   integer l4, id[nsiz], lc, lr;
00148   
00149   C2F(str2name)(namex, id, name_len);
00150   /* jpc april 2002 */ 
00151   /* ++Top; */
00152   Top = Top + Nbvars + 1; 
00153   if (! C2F(cremat)("cwritemat", &Top, &cx0, m, n, &lr, &lc, 9L)) return  FALSE_;
00154   C2F(dcopy)(&ix1, mat, &cx1, stk(lr ), &cx1);
00155   Rhs = 0;
00156   l4 = C2F(iop).lct[3];
00157   C2F(iop).lct[3] = -1;
00158   C2F(stackp)(id, &cx0);
00159   C2F(iop).lct[3] = l4;
00160   Top = Top_k;
00161   Rhs = Rhs_k;
00162   if (Err > 0)  return FALSE_;
00163   return TRUE_;
00164 } 

Here is the call graph for this function:

Here is the caller graph for this function:

int getlengthchain ( char *  namex  ) 

returns length of a "chain variable" in scilab example : in scilab --> str = "abcdefghijklmnopqrstuvwxyz"; in C getlengthchain("str") returns 26 error returns -1

Definition at line 726 of file stack3.c.

References C2F, cx1, Err, Fin, getsmat(), iadr, Infstk, istk, L, lr1, Lstk, m1, n1, name_len, nsiz, stackg(), and str2name().

00727 {
00728         int retLength = -1;
00729 
00730         integer m1, n1;
00731         integer id[nsiz];
00732         integer lr1;
00733         integer nlr1;
00734         unsigned long name_len= strlen(namex);
00735 
00736         Err = 0;
00737         C2F(str2name)(namex, id, name_len);
00738         Fin = -1;
00739         C2F(stackg)(id);
00740         if (Err > 0)  return -1;
00741         if (Fin == 0) return -1;
00742 
00743 
00744         if (*Infstk(Fin ) == 2) 
00745         {
00746                 Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00747         }
00748 
00749         if (! C2F(getsmat)("getlengthchain", &Fin, &Fin, &m1, &n1, &cx1, &cx1, &lr1, &nlr1, 14L)) return -1;
00750 
00751         if (m1 * n1 != 1)  return -1;
00752         retLength = nlr1;
00753 
00754         return retLength;
00755 
00756 }

Here is the call graph for this function:

int C2F() matptr ( char *  namex,
integer m,
integer n,
integer lp,
unsigned long  name_len 
)

Definition at line 382 of file stack3.c.

References C2F, cmatptr(), ix, lp, m, n, name_len, and namex.

00383 {
00384     int ix;
00385     ix = C2F(cmatptr)(namex, m, n, lp, name_len);
00386     return 0;
00387 } 

Here is the call graph for this function:

void* Name2ptr ( char *  namex  ) 

Definition at line 539 of file stack3.c.

References C2F, Fin, get_fname(), iadr, Infstk, istk, Lstk, nsiz, stackg(), stk, and str2name().

00540 {
00541   int l1; int *loci;
00542   integer id[nsiz];
00543   C2F(str2name)(namex, id, strlen(namex));
00544   /* get the position in fin */
00545   Fin = -1;
00546   C2F(stackg)(id);
00547   if (Fin == 0) {
00548     Scierror(4,"Undefined variable %s\r\n",get_fname(namex,strlen(namex)));
00549     return 0;
00550   }
00551   /* get data */
00552   if (*Infstk(Fin ) == 2) {
00553     Fin = *istk(iadr(*Lstk(Fin )) + 1 +1);
00554   }
00555   loci = (int *) stk(*Lstk(Fin));
00556   if (loci[0] < 0) 
00557     {
00558       l1 = loci[1];
00559       loci = (int *) stk(l1);
00560     }
00561   return loci;
00562 }

Here is the call graph for this function:

int Name2where ( char *  namex  ) 

Definition at line 576 of file stack3.c.

References C2F, Fin, get_fname(), Lstk, nsiz, stackg(), and str2name().

00577 {
00578   int loci;
00579   integer id[nsiz];
00580   C2F(str2name)(namex, id, strlen(namex));
00581   /* get the position in fin */
00582   Fin = -1;
00583   C2F(stackg)(id);
00584   if (Fin == 0) {
00585     Scierror(4,"Undefined variable %s\r\n",get_fname(namex,strlen(namex)));
00586     return 0;
00587   }
00588   loci = *Lstk(Fin);
00589   return loci;
00590 }

Here is the call graph for this function:

int C2F() objptr ( char *  namex,
integer lp,
integer fin,
unsigned long  name_len 
)

Definition at line 618 of file stack3.c.

References C2F, FALSE_, fin, Fin, iadr, id, Infstk, istk, lp, Lstk, name_len, namex, nsiz, putid(), stackg(), str2name(), and TRUE_.

Referenced by createreffromname(), GetDataFromName(), Java_javasci_SciBooleanArray_getColFromScilab(), Java_javasci_SciBooleanArray_getRowFromScilab(), Java_javasci_SciComplexArray_getColFromScilab(), Java_javasci_SciComplexArray_getRowFromScilab(), Java_javasci_SciDoubleArray_getColFromScilab(), Java_javasci_SciDoubleArray_getRowFromScilab(), Java_javasci_Scilab_ExistVar(), Java_javasci_Scilab_TypeVar(), Java_javasci_SciStringArray_getColFromScilab(), Java_javasci_SciStringArray_getRowFromScilab(), mexGetArray(), mexGetVariable(), and mexGetVariablePtr().

00619 {
00620     integer id[nsiz];
00621     *lp = 0;
00622     /*     ---- get the id */
00623     C2F(str2name)(namex, id, name_len);
00624     /*     ---- get the position in fin */
00625     Fin = -1;
00626     C2F(stackg)(id);
00627     if (Fin == 0) {
00628       C2F(putid)(&C2F(recu).ids[(C2F(recu).pt + 1) * nsiz - nsiz], id);
00629       /*         we juste return false and lp is set to zero */
00630       /*         call error(4) */
00631       return FALSE_;
00632     }
00633     *fin = Fin;
00634     *lp = *Lstk(Fin );
00635     if (*Infstk(Fin ) == 2) {
00636         *lp = *Lstk(*istk(iadr(*lp) + 1 +1) );
00637     }
00638     return  TRUE_;
00639 }

Here is the call graph for this function:

Here is the caller graph for this function:

int C2F() putvar ( int number,
char *  namex,
unsigned long  name_len 
)

Definition at line 201 of file stack3.c.

References C2F, Err, FALSE_, name_len, namex, nsiz, number, Rhs, stackp(), str2name(), Top, and TRUE_.

00202 {
00203   integer Rhs_k = Rhs , Top_k = Top ;
00204   integer l4, id[nsiz],/* lc, lr,*/ cx0_2=1;
00205   
00206   C2F(str2name)(namex, id, name_len);
00207   Top = *number + Top -Rhs;
00208   Rhs = 0;
00209   l4 = C2F(iop).lct[3];
00210   C2F(iop).lct[3] = -1;
00211   C2F(stackp)(id, &cx0_2);
00212   C2F(iop).lct[3] = l4;
00213   Top = Top_k;
00214   Rhs = Rhs_k;
00215   if (Err > 0)  return FALSE_;
00216   return TRUE_;
00217 } 

Here is the call graph for this function:

int C2F() readchain ( char *  namex,
integer itslen,
char *  chai,
unsigned long  name_len,
unsigned long  chai_len 
)

Definition at line 223 of file stack3.c.

References C2F, chai, chai_len, creadchain(), itslen, j, name_len, and namex.

00224 {
00225     int j;
00226     j = C2F(creadchain)(namex, itslen, chai, name_len, chai_len);
00227     return 0;
00228 } 

Here is the call graph for this function:

int C2F() str2name ( char *  namex,
integer id,
unsigned long  name_len 
)

Definition at line 600 of file stack3.c.

References C2F, cvname(), cx0, id, ix, name_len, and namex.

Referenced by cmatbptr(), cmatcptr(), cmatptr(), cmatsptr(), creadbmat(), creadchain(), creadchains(), creadcmat(), creadmat(), cwritebmat(), cwritechain(), cwritecmat(), cwritemat(), getlengthchain(), Name2ptr(), Name2where(), objptr(), and putvar().

00601 {
00602     integer ix;
00603     integer lon;
00604     lon = 0;
00605     for (ix = 0 ; ix < (integer) name_len ; ix++ ) {
00606       if ( namex[ix] == '\0') break;
00607       ++lon;
00608     }
00609     C2F(cvname)(id, namex, &cx0, lon);
00610     return 0;
00611 } 

Here is the call graph for this function:

Here is the caller graph for this function:


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