Back to index

wims  3.65+svn20090927
Defines | Functions | Variables
scilab.c File Reference
#include "common.h"
#include "common.c"

Go to the source code of this file.

Defines

#define fsizelim   131072
#define quitstring   "\nquit\n"
#define stringprinter   "\"%s\"\n"
#define homepage   "http://scilabsoft.inria.fr/"
#define progname   "scilab"

Functions

void check_parm (char *p)
void output (char *p)
void about (void)
char * dynsetup (char *ptr, char *end)
int main (int argc, char *argv[])

Variables

char ans_str [] = "\n-->"
char * nameofcmd = "scilab -nw -ns"
int precision = 9
char header []
struct {
char * wname
char * defaultval
char * setname
setups []
char * illegal []
char * illpart []

Define Documentation

#define fsizelim   131072

Definition at line 23 of file scilab.c.

#define homepage   "http://scilabsoft.inria.fr/"

Definition at line 29 of file scilab.c.

#define progname   "scilab"

Definition at line 54 of file scilab.c.

#define quitstring   "\nquit\n"

Definition at line 25 of file scilab.c.

#define stringprinter   "\"%s\"\n"

Definition at line 27 of file scilab.c.


Function Documentation

void about ( void  )

Definition at line 101 of file scilab.c.

{
    char *p;

    prepabout(quitstring,outputfname,NULL);
    if(readabout()>0) {
       p=strchr(aboutbuf,'\n'); if(p!=NULL) *p=0;
       p=strchr(aboutbuf,'('); if(p!=NULL) *p=0;
       strip_trailing_spaces(aboutbuf);
       printf("<A HREF=\"%s\">%s</A>",homepage,aboutbuf);
    }
}

Here is the call graph for this function:

void check_parm ( char *  p)

Definition at line 59 of file scilab.c.

{
    char *pp, *s;
    
         /* Underscore replacement */
    for(pp=strchr(p,'_'); pp!=NULL; pp=strchr(pp+1,'_')) {
       if(pp==p || !isalnum(*(pp-1))) *pp='K';
    }
    for(s=p;*s;s++) *s=tolower(*s);
    find_illegal(p);
}

Here is the call graph for this function:

char* dynsetup ( char *  ptr,
char *  end 
)

Definition at line 114 of file scilab.c.

{
    int i;
    char *p, *pp;
    for(i=0;i<SETUP_NO;i++) {
       p=getenv(setups[i].wname);
       if(p!=NULL) for(pp=p;*pp;pp++) if(!isspace(*pp) && !isalnum(*pp)) p="";
       if(p==NULL || *p==0) p=setups[i].defaultval;
       snprintf(ptr,end-ptr,"%s=%s\n",setups[i].setname,p);
       ptr+=strlen(ptr);
       if(strstr(setups[i].wname,"scilab_precision")!=NULL)
         precision=atoi(p);
       if(precision<0) precision=-precision;
    }
    return ptr;
}
int main ( int  argc,
char *  argv[] 
)

Definition at line 131 of file scilab.c.

{
    setenv("chroot","must",1);
    setenv("sysmask","must",1);
    must_chroot=1;
    prepare1();
    run();
    return 0;    
}

Here is the call graph for this function:

void output ( char *  p)

Definition at line 72 of file scilab.c.

{
    int i,n;
    char *pp, *pe, *pt;

    for(pp=strstr(p,ans_str); pp; pp=pe) {
       pp+=strlen(ans_str); pe=strstr(pp,ans_str);
       if(pe) *pe=0;
       pp=find_word_start(pp); if(memcmp(pp,"ans  =",strlen("ans  ="))==0) {
           pp+=strlen("ans  ="); pp=find_word_start(pp);
       }
       if(pe!=NULL && pp>=pe) {
           emptyline:
           puts(""); continue;
       }
       n=strlen(pp); if(n==0) goto emptyline;
         /* strip leading and trailing spaces */
       while(isspace(*pp) && pp<pe) pp++;
       pt=pp+strlen(pp)-1;
       while(isspace(*pt) && pt>pp) *pt--=0;
              /* make every output one-line */
       for(i=0;i<n;i++) {
           if(*(pp+i)=='\n') *(pp+i)=';';
       }
/*     strip_zeros(pp); */
       puts(pp);
    }
}

Here is the call graph for this function:


Variable Documentation

char ans_str[] = "\n-->"

Definition at line 31 of file scilab.c.

char header[]
Initial value:
"\
"

Definition at line 35 of file scilab.c.

char* illegal[]
Initial value:
{
}

Definition at line 45 of file scilab.c.

char* illpart[]
Initial value:
{
}

Definition at line 49 of file scilab.c.

char* nameofcmd = "scilab -nw -ns"

Definition at line 33 of file scilab.c.

int precision = 9

Definition at line 34 of file scilab.c.

struct { ... } setups[]