Back to index

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

Go to the source code of this file.


#define fsizelim   131072
#define quitstring   "\nquit\n"
#define stringprinter   "\"%s\"\n"
#define homepage   ""
#define progname   "octave"


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


char ans_str [] = "ans ="
char * nameofcmd = "octave -Hf --no-line-editing"
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 26 of file octave.c.

#define homepage   ""

Definition at line 32 of file octave.c.

#define progname   "octave"

Definition at line 87 of file octave.c.

#define quitstring   "\nquit\n"

Definition at line 28 of file octave.c.

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

Definition at line 30 of file octave.c.

Function Documentation

void about ( void  )

Definition at line 130 of file octave.c.

    char *p;

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

Here is the call graph for this function:

void check_parm ( char *  p)

Definition at line 92 of file octave.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);

Here is the call graph for this function:

char* dynsetup ( char *  ptr,
char *  end 

Definition at line 143 of file octave.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;
int main ( int  argc,
char *  argv[] 

Definition at line 160 of file octave.c.

    return 0;    

Here is the call graph for this function:

void output ( char *  p)

Definition at line 105 of file octave.c.

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

    for(pp++; *pp; pp=pe) {
       pe=strchr(pp,'\n'); if(pe) *pe++=0; else pe=pp+strlen(pp);
       if(memcmp(pp,ans_str,strlen(ans_str))==0) pp+=strlen(ans_str);
       n=strlen(pp); if(n==0) {
           puts(""); continue;
              /* make every output one-line */
       for(i=0;i<n;i++) {
           if(*(pp+i)=='\n' || *(pp+i)=='\%') *(pp+i)=' ';
         /* strip leading and trailing spaces */
       while(isspace(*pp) && pp<pe) pp++;
       while(isspace(*pt) && pt>pp) *pt--=0;

Here is the call graph for this function:

Variable Documentation

char ans_str[] = "ans ="

Definition at line 34 of file octave.c.

char header[]
Initial value:
function y=sh(x) y=sinh(x); endfunction\n\
function y=ch(x) y=cosh(x); endfunction\n\
function y=th(x) y=tanh(x); endfunction\n\
function y=ln(x) y=log(x); endfunction\n\
function y=lg(x) y=log10(x); endfunction\n\
function y=sgn(x) y=sign(x); endfunction\n\
function y=tg(x) y=tan(x); endfunction\n\
function y=cotan(x) y=cot(x); endfunction\n\
function y=ctg(x) y=cot(x); endfunction\n\
function y=arcsin(x) y=asin(x); endfunction\n\
function y=arccos(x) y=acos(x); endfunction\n\
function y=arctan(x) y=atan(x); endfunction\n\
function y=arctg(x) y=atan(x); endfunction\n\
function y=argsh(x) y=asinh(x); endfunction\n\
function y=argch(x) y=acosh(x); endfunction\n\
function y=argth(x) y=atanh(x); endfunction\n\
function y=Argsh(x) y=asinh(x); endfunction\n\
function y=Argch(x) y=acosh(x); endfunction\n\
function y=Argth(x) y=atanh(x); endfunction\n\
function y=rint(x) y=round(x); endfunction\n\

Definition at line 38 of file octave.c.

char* illegal[]
Initial value:

Definition at line 71 of file octave.c.

char* illpart[]
Initial value:
    "file", "debug", "plot"

Definition at line 81 of file octave.c.

char* nameofcmd = "octave -Hf --no-line-editing"

Definition at line 36 of file octave.c.

int precision = 9

Definition at line 37 of file octave.c.

struct { ... } setups[]