#include <string.h>#include "machine.h"#include "MALLOC.h"#include "../../../string/includes/men_Sutils.h"#include "libinter.h"#include "cerro.h"Include dependency graph for libinter.c:

Go to the source code of this file.
Functions | |
| int | C2F (cvstr) |
| void C2F() | ccharf (int *n, char **ip, int *op) |
| void C2F() | cdouble (int *n, ip, double *op) |
| void C2F() | cdoublef (int *n, ip, double *op) |
| void C2F() | cint (int *n, ip, double *op) |
| void C2F() | cintf (int *n, ip, double *op) |
| void C2F() | cfloat (int *n, ip, double *op) |
| void C2F() | cfloatf (int *n, ip, double *op) |
| void C2F() | cbool (int *n, ip, int *op) |
| void C2F() | cboolf (int *n, ip, int *op) |
| void | cerro (char *str) |
| void | Cout (char *str) |
| void C2F() | cstringf (char ***ip, int *sciptr, int *m, int *n, int *max, int *ierr) |
| int C2F() | stringc (int *sciptr, char ***cptr, int *ierr) |
| void C2F() | dbl2cdbl (int *n, ip, double *op) |
| void C2F() | freeptr (ip) |
| void C2F() | int2cint (int *n, ip, integer *op) |
| SciSparse * | NewSparse (int *it, int *m, int *n, int *nel) |
| void | FreeSparse (SciSparse *x) |
| int C2F() | csparsef (SciSparse **x, int *mnel, int *icol, double *R, double *I) |
| void | FreeRhsSVar (char **ptrStr) |
| int C2F | ( | cvstr | ) |
Definition at line 11 of file libinter.c.
References cvstr(), F2C(), and i.
00018 : copy char ** to Scilab string code 00019 * converts ip -> op 00020 * char ** -> int * 00021 *--------------------------------------------------------------*/ 00022 00023 void C2F(cchar)(int *n, char **ip,int *op) 00024 { 00025 int i = 0; 00026 F2C(cvstr)(n,op,*ip,&i,*n); 00027 }
Here is the call graph for this function:

Definition at line 51 of file libinter.c.
Referenced by createcvarfromptr(), createlistcvarfromptr(), and createlistvarfromptr().
Here is the caller graph for this function:

| void cerro | ( | char * | str | ) |
Definition at line 110 of file libinter.c.
Referenced by createlistcvarfromptr(), and createlistvarfromptr().
Here is the caller graph for this function:

Definition at line 80 of file libinter.c.
Referenced by createcvarfromptr(), createlistcvarfromptr(), and createlistvarfromptr().
Here is the caller graph for this function:

| void Cout | ( | char * | str | ) |
Definition at line 375 of file libinter.c.
References FreeSparse(), I, i, icol, mnel, R, and x.
00376 { 00377 int i; 00378 for ( i=0 ; i < (*x)->m ; i++) 00379 mnel[i] = (*x)->mnel[i]; 00380 for ( i=0 ; i < (*x)->nel ; i++) 00381 { 00382 icol[i] = (*x)->icol[i]; 00383 R[i] = (*x)->R[i]; 00384 if ( (*x)->it == 1 )I[i] = (*x)->I[i]; 00385 } 00386 FreeSparse(*x); 00387 return 0; 00388 }
Here is the call graph for this function:

Definition at line 192 of file libinter.c.
References cvstr(), F2C(), FREE, i, ie, ierr, ip, j, job, l, m, max, n, and sciptr.
Referenced by crestringmatfromc(), and lcrestringmatfromc().
00196 { 00197 int i,j,l,ie; 00198 int job=0; 00199 int *chars; 00200 *ierr=0; 00201 if (5 + *m * *n > *max) { 00202 *ierr = 1; 00203 return; 00204 } 00205 sciptr[0]=10; 00206 sciptr[1]=*m; 00207 sciptr[2]=*n; 00208 sciptr[3]=0; 00209 sciptr[4]=1; 00210 chars=&(sciptr[5 + *m * *n]); 00211 ie=0; 00212 for (j = 0; j < *n; j++) { 00213 for (i = 0; i < *m; i++) { 00214 l=(int)strlen((*ip)[ie]); 00215 sciptr[ie+5]=sciptr[ie+4]+l; 00216 if (5 + *m * *n + sciptr[ie+5] > *max) { 00217 *ierr = 1; 00218 return; 00219 } 00220 F2C(cvstr)(&l,&(chars[sciptr[ie+4]-1]),(*ip)[ie],&job,l); 00221 FREE((*ip)[ie]); 00222 ie++; 00223 } 00224 } 00225 FREE((char *)*ip); 00226 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void C2F() freeptr | ( | ip | ) |
| void FreeRhsSVar | ( | char ** | ptrStr | ) |
| void FreeSparse | ( | SciSparse * | x | ) |
FreeSparse : free memory associated to a sparse
| x |
Definition at line 362 of file libinter.c.
References FREE, scisparse::I, scisparse::icol, scisparse::it, scisparse::mnel, and scisparse::R.
Referenced by csparsef().
00363 { 00364 if ( x->it == 1 ) FREE(x->I); 00365 FREE(x->R); 00366 FREE(x->icol); 00367 FREE(x->mnel); 00368 FREE(x); 00369 }
Here is the caller graph for this function:

New Sparse matrix
| it | ||
| m | ||
| n | ||
| nel |
Definition at line 309 of file libinter.c.
References FREE, scisparse::I, scisparse::icol, scisparse::it, scisparse::m, MALLOC, scisparse::mnel, scisparse::n, scisparse::nel, and scisparse::R.
Referenced by ext14ce().
00310 { 00311 SciSparse *loc; 00312 loc = (SciSparse *) MALLOC((unsigned) sizeof(SciSparse)); 00313 if ( loc == (SciSparse *) 0) 00314 { 00315 return((SciSparse *) 0); 00316 } 00317 loc->m = *m; 00318 loc->n = *n; 00319 loc->it = *it; 00320 loc->nel = *nel; 00321 loc->mnel = (int*) MALLOC((unsigned) (*m)*sizeof(int)); 00322 if ( loc->mnel == (int *) 0) 00323 { 00324 FREE(loc); 00325 return((SciSparse *) 0); 00326 } 00327 loc->icol = (int*) MALLOC((unsigned) (*nel)*sizeof(int)); 00328 if ( loc->icol == (int *) 0) 00329 { 00330 FREE(loc->mnel); 00331 FREE(loc); 00332 return((SciSparse *) 0); 00333 } 00334 loc->R = (double*) MALLOC((unsigned) (*nel)*sizeof(double)); 00335 if ( loc->R == (double *) 0) 00336 { 00337 FREE(loc->icol); 00338 FREE(loc->mnel); 00339 FREE(loc); 00340 return((SciSparse *) 0); 00341 } 00342 00343 if ( *it == 1) 00344 { 00345 loc->I = (double*) MALLOC((unsigned) (*nel)*sizeof(double)); 00346 if ( loc->I == (double *) 0) 00347 { 00348 FREE(loc->R); 00349 FREE(loc->icol); 00350 FREE(loc->mnel); 00351 FREE(loc); 00352 return((SciSparse *) 0); 00353 } 00354 } 00355 return(loc); 00356 }
Here is the caller graph for this function:

Definition at line 235 of file libinter.c.
References cptr, i, ierr, MALLOC, nstring, p, ptrstrings, ScilabStr2C(), and sciptr.
Referenced by crestringv().
00239 { 00240 char **strings,*p; 00241 int li,ni,*SciS,i,nstring,*ptrstrings; 00242 00243 *ierr=0; 00244 nstring=sciptr[1]*sciptr[2]; 00245 strings=(char **) MALLOC((unsigned) (nstring * sizeof(char *))); 00246 if (strings==0) { 00247 *ierr=1; return 0; 00248 } 00249 li=1; 00250 ptrstrings=&(sciptr[4]); 00251 SciS=&(sciptr[5+nstring]); 00252 for ( i=1 ; i<nstring+1 ; i++) 00253 { 00254 ni=ptrstrings[i]-li; 00255 li=ptrstrings[i]; 00256 ScilabStr2C(&ni,SciS,&p,ierr); 00257 strings[i-1]=p; 00258 if ( *ierr == 1) return 0; 00259 SciS += ni; 00260 } 00261 *cptr=strings; 00262 return 0; 00263 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.5.1