Back to index

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

Go to the source code of this file.


#define homepage   ""
#define quitstring   "\nquit\n"
#define stringprinter   "\"%s\"\n"
#define progname   "yacas"


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


int fsizelim = 131072
int precision = 20
char * inprompt = "\nIn>"
char * outprompt = "Out>"
char * nameofcmd = "yacas -p"
struct {
char * wname
char * defaultval
char * yacasset
setups []
char * illegal []
char * illpart []

Define Documentation

#define homepage   ""

Definition at line 23 of file yacas.c.

#define progname   "yacas"

Definition at line 59 of file yacas.c.

#define quitstring   "\nquit\n"

Definition at line 25 of file yacas.c.

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

Definition at line 27 of file yacas.c.

Function Documentation

void about ( void  )

Definition at line 135 of file yacas.c.

    cmdparm="-v"; prepabout("",outputfname,NULL);
      printf("<A HREF=\"%s\">Yacas %s</A>",homepage,aboutbuf);

Here is the call graph for this function:

Here is the caller graph for this function:

void check_parm ( char *  pm)

Definition at line 64 of file yacas.c.

    char *p, *pp, *p2, buf[16];
    int i;
    for(p=pm;*p!=0;p++) {
       if(*p!='\\') continue;
       if(*(p+1)=='\n') *p=*(p+1)=' ';
       if(*(p+1)==0) *p=' ';
    for(p=pm; *p!=0; p++) {
       if(!isalpha(*p)) continue;
       for(p2=p+1; isalpha(*p2); p2++);
       if(p2-p>10) {p=p2-1; continue;}
       memmove(buf,p,p2-p); buf[p2-p]=0; pp=p; p=p2-1;
       for(p2=buf; islower(*p2); p2++);
       if(*p2) continue;
       if(i>=0) *pp=toupper(*pp);

Here is the call graph for this function:

Here is the caller graph for this function:

char* dynsetup ( char *  ptr,
char *  end 

Definition at line 142 of file yacas.c.

    int i; char *p, *pp;
    for(i=0;i<SETUP_NO;i++) {
       if(p!=NULL) for(pp=p;*pp;pp++) if(!isspace(*pp) && !isalnum(*pp)) p="";
       if(p==NULL || *p==0) p=setups[i].defaultval;
       if(precision<0) precision=-precision;
    return ptr;

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 

Definition at line 157 of file yacas.c.

    return 0;    

Here is the call graph for this function:

void output ( char *  p)

Definition at line 89 of file yacas.c.

    int i,n;
    char *pp, *pe, *p1, *pt;
    char outbuf[MAX_LINELEN+1];
    pp=strstr(p,inprompt); if(pp==NULL) return;
    while(pp!=NULL && *pp!=0) {
       pp+=strlen(inprompt); p1=find_word_start(pp);
       if(pe==NULL || (pt!=NULL && pt<pe)) { /* error */
           if(pt==NULL) pp=pp+strlen(pp); else pp=pt;
           n=pp-p1; if(n>MAX_LINELEN) n=MAX_LINELEN; if(n<0) n=0;
           memmove(outbuf,p1,n); outbuf[n]=0;
           puts(""); continue;
       else {
           *pe=0; pe=find_word_start(pe+strlen(outprompt));
       if(pp==NULL) pp=pe+strlen(pe);
       if(*p1==0) {
           if(pp>=pe+sizeof(outbuf)) break;
           n=pp-pe; if(n>MAX_LINELEN) n=MAX_LINELEN; if(n<0) n=0;
           memmove(outbuf,pe,n); outbuf[n]=0;
       else {
              /* make every output one-line */
       for(i=0;i<n;i++) {
           if(outbuf[i]=='\n') outbuf[i]=' ';
         /* strip leading and trailing spaces */
       for(i=n-1;i>=0 && isspace(outbuf[i]); i--) outbuf[i]=0;
       if(outbuf[i]==';') outbuf[i]=0;
       for(pe=outbuf; *pe; pe++) if(isupper(*pe)) *pe=tolower(*pe);
       for(pe=outbuf; isspace(*pe); pe++);
       /* strip_zeros(pe); */

Here is the call graph for this function:

Variable Documentation

int fsizelim = 131072

Definition at line 29 of file yacas.c.

char* illegal[]
Initial value:
    "SystemCall", "Use", "Vi", "GetYacasPID", "ShowPS",

Definition at line 47 of file yacas.c.

char* illpart[]
Initial value:
    "File", "Load", "Plot"

Definition at line 53 of file yacas.c.

char* inprompt = "\nIn>"

Definition at line 32 of file yacas.c.

char* nameofcmd = "yacas -p"

Definition at line 35 of file yacas.c.

char* outprompt = "Out>"

Definition at line 33 of file yacas.c.

int precision = 20

Definition at line 30 of file yacas.c.

struct { ... } setups[]