version 1.13, 2006/08/27 22:17:28 |
version 1.21, 2018/03/29 01:32:53 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.12 2006/04/16 00:51:14 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.20 2017/08/31 02:36:21 noro Exp $ */ |
|
|
#define PRINTHAT (fortran_output?PUTS("**"):PUTS("^")) |
#define PRINTHAT (fortran_output?PUTS("**"):PUTS("^")) |
|
|
Line 15 void PRINTIMAT(); /* IMAT */ |
|
Line 15 void PRINTIMAT(); /* IMAT */ |
|
void PRINTSTR(); |
void PRINTSTR(); |
void PRINTCOMP(); |
void PRINTCOMP(); |
void PRINTDP(); |
void PRINTDP(); |
|
void PRINTDPM(); |
void PRINTUI(); |
void PRINTUI(); |
void PRINTGF2MAT(); |
void PRINTGF2MAT(); |
void PRINTGFMMAT(); |
void PRINTGFMMAT(); |
Line 46 void PRINTEXPR(vl,p) |
|
Line 47 void PRINTEXPR(vl,p) |
|
VL vl; |
VL vl; |
Obj p; |
Obj p; |
{ |
{ |
if ( !p ) { |
if ( !p ) { |
PRINTR(vl,(R)p); |
PRINTR(vl,(R)p); |
} else |
} else |
switch ( OID(p) ) { |
switch ( OID(p) ) { |
case O_N: |
case O_N: |
PRINTNUM((Num)p); break; |
PRINTNUM((Num)p); break; |
case O_P: |
case O_P: |
PRINTP(vl,(P)p); break; |
PRINTP(vl,(P)p); break; |
case O_R: |
case O_R: |
PRINTR(vl,(R)p); break; |
PRINTR(vl,(R)p); break; |
case O_LIST: |
case O_LIST: |
PRINTLIST(vl,(LIST)p); break; |
PRINTLIST(vl,(LIST)p); break; |
case O_VECT: |
case O_VECT: |
PRINTVECT(vl,(VECT)p); break; |
PRINTVECT(vl,(VECT)p); break; |
case O_MAT: |
case O_MAT: |
PRINTMAT(vl,(MAT)p); break; |
PRINTMAT(vl,(MAT)p); break; |
/* IMAT */ |
/* IMAT */ |
case O_IMAT: |
case O_IMAT: |
PRINTIMAT(vl,(IMAT)p); break; |
PRINTIMAT(vl,(IMAT)p); break; |
/* IMAT */ |
/* IMAT */ |
case O_STR: |
case O_STR: |
PRINTSTR((STRING)p); break; |
PRINTSTR((STRING)p); break; |
case O_COMP: |
case O_COMP: |
PRINTCOMP(vl,(COMP)p); break; |
PRINTCOMP(vl,(COMP)p); break; |
case O_DP: |
case O_DP: |
PRINTDP(vl,(DP)p); break; |
PRINTDP(vl,(DP)p); break; |
case O_USINT: |
case O_DPM: |
PRINTUI(vl,(USINT)p); break; |
PRINTDPM(vl,(DPM)p); break; |
case O_GF2MAT: |
case O_USINT: |
PRINTGF2MAT(vl,(GF2MAT)p); break; |
PRINTUI(vl,(USINT)p); break; |
case O_ERR: |
case O_GF2MAT: |
PRINTERR(vl,(ERR)p); break; |
PRINTGF2MAT(vl,(GF2MAT)p); break; |
case O_MATHCAP: |
case O_ERR: |
PRINTLIST(vl,((MATHCAP)p)->body); break; |
PRINTERR(vl,(ERR)p); break; |
case O_F: |
case O_MATHCAP: |
PRINTLF(vl,(F)p); break; |
PRINTLIST(vl,((MATHCAP)p)->body); break; |
case O_GFMMAT: |
case O_F: |
PRINTGFMMAT(vl,(GFMMAT)p); break; |
PRINTLF(vl,(F)p); break; |
case O_BYTEARRAY: |
case O_GFMMAT: |
PRINTBYTEARRAY(vl,(BYTEARRAY)p); break; |
PRINTGFMMAT(vl,(GFMMAT)p); break; |
case O_QUOTE: |
case O_BYTEARRAY: |
PRINTQUOTE(vl,(QUOTE)p); break; |
PRINTBYTEARRAY(vl,(BYTEARRAY)p); break; |
case O_QUOTEARG: |
case O_QUOTE: |
PRINTQUOTEARG(vl,(QUOTEARG)p); break; |
PRINTQUOTE(vl,(QUOTE)p); break; |
case O_NBP: |
case O_QUOTEARG: |
PRINTNBP(vl,(NBP)p); break; |
PRINTQUOTEARG(vl,(QUOTEARG)p); break; |
case O_SYMBOL: |
case O_NBP: |
PRINTSYMBOL((SYMBOL)p); break; |
PRINTNBP(vl,(NBP)p); break; |
case O_RANGE: |
case O_SYMBOL: |
PRINTRANGE(vl,(RANGE)p); break; |
PRINTSYMBOL((SYMBOL)p); break; |
case O_TB: |
case O_RANGE: |
PRINTTB(vl,(TB)p); break; |
PRINTRANGE(vl,(RANGE)p); break; |
case O_DPV: |
case O_TB: |
PRINTDPV(vl,(DPV)p); break; |
PRINTTB(vl,(TB)p); break; |
default: |
case O_DPV: |
break; |
PRINTDPV(vl,(DPV)p); break; |
} |
default: |
|
break; |
|
} |
} |
} |
|
|
#if defined(FPRINT) |
#if defined(FPRINT) |
#if defined(ITVDEBUG) |
#if defined(ITVDEBUG) |
void printbin(double z) |
void printbin(double z) |
{ |
{ |
int i, j, mask; |
int i, j, mask; |
union { |
union { |
double x; |
double x; |
char c[8]; |
char c[8]; |
} a; |
} a; |
|
|
a.x = z; |
a.x = z; |
for(i=7;i>=0;i--) { |
for(i=7;i>=0;i--) { |
mask = 0x80; |
mask = 0x80; |
for(j=0;j<8;j++) { |
for(j=0;j<8;j++) { |
if (a.c[i] & mask) fprintf(stderr,"1"); |
if (a.c[i] & mask) fprintf(stderr,"1"); |
else fprintf(stderr,"0"); |
else fprintf(stderr,"0"); |
mask >>= 1; |
mask >>= 1; |
} |
} |
} |
} |
fprintf(stderr,"\n"); |
fprintf(stderr,"\n"); |
} |
} |
#endif |
#endif |
#endif |
#endif |
Line 132 void printbin(double z) |
|
Line 135 void printbin(double z) |
|
void PRINTCPLX(a) |
void PRINTCPLX(a) |
C a; |
C a; |
{ |
{ |
PUTS("("); |
PUTS("("); |
if ( a->r ) |
if ( a->r ) |
PRINTNUM(a->r); |
PRINTNUM(a->r); |
if ( a->i ) { |
if ( a->i ) { |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
if ( a->r && ((compnum(0,a->i,0) > 0) |
if ( a->r && ((compnum(0,a->i,0) > 0) |
|| NID(a->i) == N_IP || NID(a->i) == N_IntervalDouble |
|| NID(a->i) == N_IP || NID(a->i) == N_IntervalDouble |
|| NID(a->i) == N_IntervalQuad || NID(a->i) == N_IntervalBigFloat) ) |
|| NID(a->i) == N_IntervalQuad || NID(a->i) == N_IntervalBigFloat) ) |
#else |
#else |
if ( a->r && (compnum(0,a->i,0) > 0) ) |
if ( a->r && (compnum(0,a->i,0) > 0) ) |
#endif |
#endif |
PUTS("+"); |
PUTS("+"); |
PRINTNUM(a->i); PUTS("*@i"); |
PRINTNUM(a->i); PUTS("*@i"); |
} |
} |
PUTS(")"); |
PUTS(")"); |
} |
} |
|
|
void PRINTP(vl,p) |
void PRINTP(vl,p) |
VL vl; |
VL vl; |
P p; |
P p; |
{ |
{ |
V v; |
V v; |
DCP dc; |
DCP dc; |
|
|
if ( !p ) |
if ( !p ) |
PUTS("0"); |
PUTS("0"); |
else if ( NUM(p) ) |
else if ( NUM(p) ) |
PRINTNUM((Num)p); |
PRINTNUM((Num)p); |
else |
else |
for ( dc = DC(p), v = VR(p); dc; dc = NEXT(dc) ) { |
for ( dc = DC(p), v = VR(p); dc; dc = NEXT(dc) ) { |
if ( !DEG(dc) ) |
if ( !DEG(dc) ) |
PRINTP(vl,COEF(dc)); |
PRINTP(vl,COEF(dc)); |
else { |
else { |
if ( NUM(COEF(dc)) && UNIQ((Q)COEF(dc)) ) { |
if ( NUM(COEF(dc)) && UNIQ((Q)COEF(dc)) ) { |
; |
; |
} else if ( NUM(COEF(dc)) && MUNIQ((Q)COEF(dc)) ) |
} else if ( NUM(COEF(dc)) && MUNIQ((Q)COEF(dc)) ) |
PUTS("-"); |
PUTS("-"); |
else if ( NUM(COEF(dc)) || !NEXT(DC(COEF(dc)))) { |
else if ( NUM(COEF(dc)) || !NEXT(DC(COEF(dc)))) { |
PRINTP(vl,COEF(dc)); PUTS("*"); |
PRINTP(vl,COEF(dc)); PUTS("*"); |
} else { |
} else { |
PUTS("("); PRINTP(vl,COEF(dc)); PUTS(")*"); |
PUTS("("); PRINTP(vl,COEF(dc)); PUTS(")*"); |
} |
} |
PRINTV(vl,v); |
PRINTV(vl,v); |
if ( cmpq(DEG(dc),ONE) ) { |
if ( cmpq(DEG(dc),ONE) ) { |
PRINTHAT; |
PRINTHAT; |
if ( INT(DEG(dc)) && SGN(DEG(dc))>0 ) |
if ( INT(DEG(dc)) && SGN(DEG(dc))>0 ) |
PRINTNUM((Num)DEG(dc)); |
PRINTNUM((Num)DEG(dc)); |
else { |
else { |
PUTS("("); PRINTNUM((Num)DEG(dc)); PUTS(")"); |
PUTS("("); PRINTNUM((Num)DEG(dc)); PUTS(")"); |
} |
} |
} |
} |
} |
} |
if ( NEXT(dc) ) { |
if ( NEXT(dc) ) { |
P t; |
P t; |
|
|
t = COEF(NEXT(dc)); |
t = COEF(NEXT(dc)); |
if (!DEG(NEXT(dc))) { |
if (!DEG(NEXT(dc))) { |
if ( NUM(t) ) { |
if ( NUM(t) ) { |
if ( !mmono(t) ) |
if ( !mmono(t) ) |
PUTS("+"); |
PUTS("+"); |
} else { |
} else { |
if (!mmono(COEF(DC(t)))) |
if (!mmono(COEF(DC(t)))) |
PUTS("+"); |
PUTS("+"); |
} |
} |
} else { |
} else { |
if ( !mmono(t) ) |
if ( !mmono(t) ) |
PUTS("+"); |
PUTS("+"); |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
void PRINTR(vl,a) |
void PRINTR(vl,a) |
VL vl; |
VL vl; |
R a; |
R a; |
{ |
{ |
if ( !a ) |
if ( !a ) |
PUTS("0"); |
PUTS("0"); |
else |
else |
switch (OID(a)) { |
switch (OID(a)) { |
case O_N: case O_P: |
case O_N: case O_P: |
PRINTP(vl,(P)a); break; |
PRINTP(vl,(P)a); break; |
default: |
default: |
PUTS("("); PRINTP(vl,NM((R)a)); PUTS(")/("); PRINTP(vl,DN((R)a)); PUTS(")"); |
PUTS("("); PRINTP(vl,NM((R)a)); PUTS(")/("); PRINTP(vl,DN((R)a)); PUTS(")"); |
break; |
break; |
} |
} |
} |
} |
|
|
void PRINTVECT(vl,vect) |
void PRINTVECT(vl,vect) |
VL vl; |
VL vl; |
VECT vect; |
VECT vect; |
{ |
{ |
int i; |
int i; |
pointer *ptr; |
pointer *ptr; |
|
|
switch ( outputstyle ) { |
switch ( outputstyle ) { |
case 1: |
case 1: |
PUTS("vect("); |
PUTS("vect("); |
for ( i = 0, ptr = BDY(vect); i < vect->len; i++ ) { |
for ( i = 0, ptr = BDY(vect); i < vect->len; i++ ) { |
if ( i != 0 ) PUTS(","); |
if ( i != 0 ) PUTS(","); |
PRINTEXPR(vl,ptr[i]); |
PRINTEXPR(vl,ptr[i]); |
} |
} |
PUTS(")"); |
PUTS(")"); |
break; |
break; |
case 0: |
case 0: |
default: |
default: |
PUTS("[ "); |
PUTS("[ "); |
for ( i = 0, ptr = BDY(vect); i < vect->len; i++ ) { |
for ( i = 0, ptr = BDY(vect); i < vect->len; i++ ) { |
PRINTEXPR(vl,ptr[i]); PUTS(" "); |
PRINTEXPR(vl,ptr[i]); PUTS(" "); |
} |
} |
PUTS("]"); |
PUTS("]"); |
break; |
break; |
} |
} |
} |
} |
|
|
void PRINTDPV(vl,d) |
void PRINTDPV(vl,d) |
VL vl; |
VL vl; |
DPV d; |
DPV d; |
{ |
{ |
int i; |
int i; |
DP *ptr; |
DP *ptr; |
|
|
PUTS("modvect("); |
PUTS("modvect("); |
for ( i = 0, ptr = BDY(d); i < d->len; i++ ) { |
for ( i = 0, ptr = BDY(d); i < d->len; i++ ) { |
if ( i != 0 ) PUTS(","); |
if ( i != 0 ) PUTS(","); |
PRINTEXPR(vl,(Obj)ptr[i]); |
PRINTEXPR(vl,(Obj)ptr[i]); |
} |
} |
PUTS(")"); |
PUTS(")"); |
} |
} |
|
|
void PRINTMAT(vl,mat) |
void PRINTMAT(vl,mat) |
VL vl; |
VL vl; |
MAT mat; |
MAT mat; |
{ |
{ |
int i,j,r,c; |
int i,j,r,c; |
pointer *ptr; |
pointer *ptr; |
|
|
switch ( outputstyle ) { |
switch ( outputstyle ) { |
case 1: |
case 1: |
PUTS("mat(\n"); |
PUTS("mat(\n"); |
for ( i = 0, r = mat->row, c = mat->col; i < r; i++ ) { |
for ( i = 0, r = mat->row, c = mat->col; i < r; i++ ) { |
if ( i != 0 ) PUTS(",\n"); |
if ( i != 0 ) PUTS(",\n"); |
PUTS("[ "); |
PUTS("[ "); |
for ( j = 0, ptr = BDY(mat)[i]; j < c; j++ ) { |
for ( j = 0, ptr = BDY(mat)[i]; j < c; j++ ) { |
if ( j != 0 ) PUTS(","); |
if ( j != 0 ) PUTS(","); |
PRINTEXPR(vl,ptr[j]); |
PRINTEXPR(vl,ptr[j]); |
} |
} |
PUTS(" ]"); |
PUTS(" ]"); |
} |
} |
PUTS(")"); |
PUTS(")"); |
break; |
break; |
case 0: |
case 0: |
default: |
default: |
for ( i = 0, r = mat->row, c = mat->col; i < r; i++ ) { |
for ( i = 0, r = mat->row, c = mat->col; i < r; i++ ) { |
PUTS("[ "); |
PUTS("[ "); |
for ( j = 0, ptr = BDY(mat)[i]; j < c; j++ ) { |
for ( j = 0, ptr = BDY(mat)[i]; j < c; j++ ) { |
PRINTEXPR(vl,ptr[j]); PUTS(" "); |
PRINTEXPR(vl,ptr[j]); PUTS(" "); |
} |
} |
PUTS("]"); |
PUTS("]"); |
if ( i < r - 1 ) |
if ( i < r - 1 ) |
PUTS("\n"); |
PUTS("\n"); |
} |
} |
break; |
break; |
} |
} |
} |
} |
|
|
/* IMAT */ |
/* IMAT */ |
Line 304 void PRINTIMAT(vl,xmat) |
|
Line 307 void PRINTIMAT(vl,xmat) |
|
VL vl; |
VL vl; |
IMAT xmat; |
IMAT xmat; |
{ |
{ |
int i,j,c; |
int i,j,c; |
int row, col, cr; |
int row, col, cr; |
IMATC Im; |
IMATC Im; |
IENT ent; |
IENT ent; |
|
|
row = xmat->row; |
row = xmat->row; |
col = xmat->col; |
col = xmat->col; |
Im = (pointer)xmat->root; |
Im = (pointer)xmat->root; |
if ( xmat->clen == 0 ) { |
if ( xmat->clen == 0 ) { |
for(j = 0; j< row; j++) { |
for(j = 0; j< row; j++) { |
PUTS("( "); |
PUTS("( "); |
for(i = 0; i < col; i++) PUTS("0 "); |
for(i = 0; i < col; i++) PUTS("0 "); |
PUTS(")"); |
PUTS(")"); |
if ( j < row - 1 ) PUTS("\n"); |
if ( j < row - 1 ) PUTS("\n"); |
} |
} |
return; |
return; |
} |
} |
c = -1; |
c = -1; |
GetNextIent(&Im, &ent, &c); |
GetNextIent(&Im, &ent, &c); |
for(j = 0; j < row; j++) { |
for(j = 0; j < row; j++) { |
PUTS("( "); |
PUTS("( "); |
for(i = 0; i < col; i++) { |
for(i = 0; i < col; i++) { |
cr = j * col + i; |
cr = j * col + i; |
if( ent.cr == cr ) { |
if( ent.cr == cr ) { |
PRINTEXPR(vl, (pointer)ent.body); PUTS(" "); |
PRINTEXPR(vl, (pointer)ent.body); PUTS(" "); |
GetNextIent(&Im, &ent, &c); |
GetNextIent(&Im, &ent, &c); |
} else { |
} else { |
PUTS("0 "); |
PUTS("0 "); |
} |
} |
} |
} |
PUTS(")"); |
PUTS(")"); |
if ( j < row - 1 ) PUTS("\n"); |
if ( j < row - 1 ) PUTS("\n"); |
} |
} |
} |
} |
#endif |
#endif |
/* IMAT */ |
/* IMAT */ |
Line 345 void PRINTLIST(vl,list) |
|
Line 348 void PRINTLIST(vl,list) |
|
VL vl; |
VL vl; |
LIST list; |
LIST list; |
{ |
{ |
NODE tnode; |
NODE tnode; |
|
|
PUTS("["); |
PUTS("["); |
for ( tnode = (NODE)list->body; tnode; tnode = NEXT(tnode) ) { |
for ( tnode = (NODE)list->body; tnode; tnode = NEXT(tnode) ) { |
PRINTEXPR(vl,tnode->body); |
PRINTEXPR(vl,tnode->body); |
if ( NEXT(tnode) ) |
if ( NEXT(tnode) ) |
PUTS(","); |
PUTS(","); |
} |
} |
PUTS("]"); |
PUTS("]"); |
} |
} |
|
|
void PRINTCOMP(vl,c) |
void PRINTCOMP(vl,c) |
VL vl; |
VL vl; |
COMP c; |
COMP c; |
{ |
{ |
int n,i; |
int n,i; |
|
|
n = getcompsize((int)c->type); |
n = getcompsize((int)c->type); |
PUTS("{"); |
PUTS("{"); |
for ( i = 0; i < n; i++ ) { |
for ( i = 0; i < n; i++ ) { |
PRINTEXPR(vl,(pointer)c->member[i]); |
PRINTEXPR(vl,(pointer)c->member[i]); |
if ( i < n-1 ) |
if ( i < n-1 ) |
PUTS(","); |
PUTS(","); |
} |
} |
PUTS("}"); |
PUTS("}"); |
} |
} |
|
|
void PRINTGF2MAT(vl,mat) |
void PRINTGF2MAT(vl,mat) |
VL vl; |
VL vl; |
GF2MAT mat; |
GF2MAT mat; |
{ |
{ |
int row,col,w,i,j,k,m; |
int row,col,w,i,j,k,m; |
unsigned int t; |
unsigned int t; |
unsigned int **b; |
unsigned int **b; |
|
|
row = mat->row; |
row = mat->row; |
col = mat->col; |
col = mat->col; |
w = (col+BSH-1)/BSH; |
w = (col+BSH-1)/BSH; |
b = mat->body; |
b = mat->body; |
for ( i = 0; i < row; i++ ) { |
for ( i = 0; i < row; i++ ) { |
for ( j = 0, m = 0; j < w; j++ ) { |
for ( j = 0, m = 0; j < w; j++ ) { |
t = b[i][j]; |
t = b[i][j]; |
for ( k = 0; m < col && k < BSH; k++, m++ ) |
for ( k = 0; m < col && k < BSH; k++, m++ ) |
if ( t & (1<<k) ) |
if ( t & (1<<k) ) |
PUTS("1"); |
PUTS("1"); |
else |
else |
PUTS("0"); |
PUTS("0"); |
} |
} |
PUTS("\n"); |
PUTS("\n"); |
} |
} |
} |
} |
void PRINTERR(vl,e) |
void PRINTERR(vl,e) |
VL vl; |
VL vl; |
ERR e; |
ERR e; |
{ |
{ |
PUTS("error("); PRINTEXPR(vl,e->body); PUTS(")"); |
PUTS("error("); PRINTEXPR(vl,e->body); PUTS(")"); |
} |
} |
|
|
void PRINTLF(vl,f) |
void PRINTLF(vl,f) |
VL vl; |
VL vl; |
F f; |
F f; |
{ |
{ |
switch ( FOP(f) ) { |
switch ( FOP(f) ) { |
case AL_TRUE: |
case AL_TRUE: |
PUTS("@true"); |
PUTS("@true"); |
break; |
break; |
case AL_FALSE: |
case AL_FALSE: |
PUTS("@false"); |
PUTS("@false"); |
break; |
break; |
|
|
case AL_OR: case AL_AND: |
case AL_OR: case AL_AND: |
PRINTFOP(vl,f); break; |
PRINTFOP(vl,f); break; |
case AL_NOT: case AL_IMPL: case AL_REPL: case AL_EQUIV: |
case AL_NOT: case AL_IMPL: case AL_REPL: case AL_EQUIV: |
PRINTEOP(vl,f); break; |
PRINTEOP(vl,f); break; |
|
|
case AL_EQUAL: case AL_NEQ: case AL_LESSP: |
case AL_EQUAL: case AL_NEQ: case AL_LESSP: |
case AL_GREATERP: case AL_LEQ: case AL_GEQ: |
case AL_GREATERP: case AL_LEQ: case AL_GEQ: |
PRINTLOP(vl,f); break; |
PRINTLOP(vl,f); break; |
|
|
case AL_EX: case AL_ALL: |
case AL_EX: case AL_ALL: |
PRINTQOP(vl,f); break; |
PRINTQOP(vl,f); break; |
default: |
default: |
break; |
break; |
} |
} |
} |
} |
|
|
void PRINTFOP(vl,f) |
void PRINTFOP(vl,f) |
VL vl; |
VL vl; |
F f; |
F f; |
{ |
{ |
char *op; |
char *op; |
NODE n; |
NODE n; |
|
|
op = FOP(f)==AL_OR?" @|| ":" @&& "; |
op = FOP(f)==AL_OR?" @|| ":" @&& "; |
n = FJARG(f); |
n = FJARG(f); |
PUTS("("); PRINTEXPR(vl,BDY(n)); PUTS(")"); |
PUTS("("); PRINTEXPR(vl,BDY(n)); PUTS(")"); |
for ( n = NEXT(n); n; n = NEXT(n) ) { |
for ( n = NEXT(n); n; n = NEXT(n) ) { |
PUTS(op); PUTS("("); PRINTEXPR(vl,BDY(n)); PUTS(")"); |
PUTS(op); PUTS("("); PRINTEXPR(vl,BDY(n)); PUTS(")"); |
} |
} |
} |
} |
|
|
void PRINTEOP(vl,f) |
void PRINTEOP(vl,f) |
VL vl; |
VL vl; |
F f; |
F f; |
{ |
{ |
oFOP op; |
oFOP op; |
char *sop; |
char *sop; |
|
|
if ( (op = FOP(f)) == AL_NOT ) { |
if ( (op = FOP(f)) == AL_NOT ) { |
PUTS("(@! "); PRINTEXPR(vl,(Obj)FARG(f)); PUTS(")"); return; |
PUTS("(@! "); PRINTEXPR(vl,(Obj)FARG(f)); PUTS(")"); return; |
} |
} |
switch ( op ) { |
switch ( op ) { |
case AL_IMPL: |
case AL_IMPL: |
sop = " @impl "; break; |
sop = " @impl "; break; |
case AL_REPL: |
case AL_REPL: |
sop = " @repl "; break; |
sop = " @repl "; break; |
case AL_EQUIV: |
case AL_EQUIV: |
sop = " @equiv "; break; |
sop = " @equiv "; break; |
default: |
default: |
break; |
break; |
} |
} |
PUTS("("); |
PUTS("("); |
PRINTEXPR(vl,(Obj)FLHS(f)); |
PRINTEXPR(vl,(Obj)FLHS(f)); |
PUTS(sop); |
PUTS(sop); |
PRINTEXPR(vl,(Obj)FRHS(f)); |
PRINTEXPR(vl,(Obj)FRHS(f)); |
PUTS(")"); |
PUTS(")"); |
} |
} |
|
|
void PRINTLOP(vl,f) |
void PRINTLOP(vl,f) |
VL vl; |
VL vl; |
F f; |
F f; |
{ |
{ |
char *op; |
char *op; |
|
|
switch ( FOP(f) ) { |
switch ( FOP(f) ) { |
case AL_EQUAL: |
case AL_EQUAL: |
op = " @== "; break; |
op = " @== "; break; |
case AL_NEQ: |
case AL_NEQ: |
op = " @!= "; break; |
op = " @!= "; break; |
case AL_LESSP: |
case AL_LESSP: |
op = " @< "; break; |
op = " @< "; break; |
case AL_GREATERP: |
case AL_GREATERP: |
op = " @> "; break; |
op = " @> "; break; |
case AL_LEQ: |
case AL_LEQ: |
op = " @<= "; break; |
op = " @<= "; break; |
case AL_GEQ: |
case AL_GEQ: |
op = " @>= "; break; |
op = " @>= "; break; |
default: |
default: |
error("PRINTLOP : invalid operator"); |
error("PRINTLOP : invalid operator"); |
break; |
break; |
} |
} |
PRINTEXPR(vl,(Obj)FPL(f)); PUTS(op); PUTS("0"); |
PRINTEXPR(vl,(Obj)FPL(f)); PUTS(op); PUTS("0"); |
} |
} |
|
|
void PRINTRANGE(VL vl,RANGE p) |
void PRINTRANGE(VL vl,RANGE p) |
{ |
{ |
PUTS("range("); |
PUTS("range("); |
PRINTEXPR(vl,p->start); |
PRINTEXPR(vl,p->start); |
PUTS(","); |
PUTS(","); |
PRINTEXPR(vl,p->end); |
PRINTEXPR(vl,p->end); |
PUTS(")"); |
PUTS(")"); |
} |
} |
|
|
void PRINTFNODENODE(NODE n) |
void PRINTFNODENODE(NODE n) |
{ |
{ |
for ( ; n; n = NEXT(n) ) { |
for ( ; n; n = NEXT(n) ) { |
PRINTFNODE((FNODE)BDY(n),0); |
PRINTFNODE((FNODE)BDY(n),0); |
if ( NEXT(n) ) PUTS(","); |
if ( NEXT(n) ) PUTS(","); |
} |
} |
} |
} |
|
|
void PRINTFARGS(FNODE f) |
void PRINTFARGS(FNODE f) |
{ |
{ |
NODE n; |
NODE n; |
|
|
if ( f->id == I_LIST ) { |
if ( f->id == I_LIST ) { |
n = (NODE)FA0(f); |
n = (NODE)FA0(f); |
PRINTFNODENODE(n); |
PRINTFNODENODE(n); |
} else |
} else |
PRINTFNODE(f,0); |
PRINTFNODE(f,0); |
} |
} |
|
|
void PRINTFNODE(FNODE f,int paren) |
void PRINTFNODE(FNODE f,int paren) |
{ |
{ |
NODE n,t,t0; |
NODE n,t,t0; |
char vname[BUFSIZ],prefix[BUFSIZ]; |
char vname[BUFSIZ],prefix[BUFSIZ]; |
char *opname,*vname_conv,*prefix_conv; |
char *opname,*vname_conv,*prefix_conv; |
Obj obj; |
Obj obj; |
int i,len,allzero,elen,elen2; |
int i,len,allzero,elen,elen2; |
C cplx; |
C cplx; |
char *r; |
char *r; |
FNODE fi,f2; |
FNODE fi,f2; |
|
|
if ( !f ) { |
if ( !f ) { |
PUTS("(0)"); |
PUTS("(0)"); |
return; |
return; |
} |
} |
if ( paren ) PUTS("("); |
if ( paren ) PUTS("("); |
switch ( f->id ) { |
switch ( f->id ) { |
/* unary operators */ |
/* unary operators */ |
case I_NOT: PUTS("!"); PRINTFNODE((FNODE)FA0(f),1); break; |
case I_NOT: PUTS("!"); PRINTFNODE((FNODE)FA0(f),1); break; |
case I_PAREN: PRINTFNODE((FNODE)FA0(f),0); break; |
case I_PAREN: PRINTFNODE((FNODE)FA0(f),0); break; |
case I_MINUS: PUTS("-"); PRINTFNODE((FNODE)FA0(f),1); break; |
case I_MINUS: PUTS("-"); PRINTFNODE((FNODE)FA0(f),1); break; |
/* binary operators */ |
/* binary operators */ |
/* arg list */ |
/* arg list */ |
/* I_AND, I_OR => FA0(f), FA1(f) */ |
/* I_AND, I_OR => FA0(f), FA1(f) */ |
/* otherwise => FA1(f), FA2(f) */ |
/* otherwise => FA1(f), FA2(f) */ |
case I_BOP: |
case I_BOP: |
PRINTFNODE((FNODE)FA1(f),1); |
PRINTFNODE((FNODE)FA1(f),1); |
PUTS(((ARF)FA0(f))->name); |
PUTS(((ARF)FA0(f))->name); |
PRINTFNODE((FNODE)FA2(f),1); |
PRINTFNODE((FNODE)FA2(f),1); |
break; |
break; |
case I_NARYOP: |
case I_NARYOP: |
t = (NODE)FA1(f); |
t = (NODE)FA1(f); |
PRINTFNODE((FNODE)BDY(t),1); |
PRINTFNODE((FNODE)BDY(t),1); |
for ( t = NEXT(t); t; t = NEXT(t) ) { |
for ( t = NEXT(t); t; t = NEXT(t) ) { |
PUTS(((ARF)FA0(f))->name); |
PUTS(((ARF)FA0(f))->name); |
PRINTFNODE((FNODE)BDY(t),1); |
PRINTFNODE((FNODE)BDY(t),1); |
} |
} |
break; |
break; |
case I_COP: |
case I_COP: |
switch( (cid)FA0(f) ) { |
switch( (cid)FA0(f) ) { |
case C_EQ: opname = ("=="); break; |
case C_EQ: opname = ("=="); break; |
case C_NE: opname = ("!="); break; |
case C_NE: opname = ("!="); break; |
case C_GT: opname = (">"); break; |
case C_GT: opname = (">"); break; |
case C_LT: opname = ("<"); break; |
case C_LT: opname = ("<"); break; |
case C_GE: opname = (">="); break; |
case C_GE: opname = (">="); break; |
case C_LE: opname = ("<="); break; |
case C_LE: opname = ("<="); break; |
} |
} |
PRINTFNODE((FNODE)FA1(f),1); |
PRINTFNODE((FNODE)FA1(f),1); |
PUTS(opname); |
PUTS(opname); |
PRINTFNODE((FNODE)FA2(f),1); |
PRINTFNODE((FNODE)FA2(f),1); |
break; |
break; |
case I_LOP: |
case I_LOP: |
switch( (lid)FA0(f) ) { |
switch( (lid)FA0(f) ) { |
case L_EQ: opname = ("@=="); break; |
case L_EQ: opname = ("@=="); break; |
case L_NE: opname = ("@!="); break; |
case L_NE: opname = ("@!="); break; |
case L_GT: opname = ("@>"); break; |
case L_GT: opname = ("@>"); break; |
case L_LT: opname = ("@<"); break; |
case L_LT: opname = ("@<"); break; |
case L_GE: opname = ("@>="); break; |
case L_GE: opname = ("@>="); break; |
case L_LE: opname = ("@<="); break; |
case L_LE: opname = ("@<="); break; |
case L_AND: opname = ("@&&"); break; |
case L_AND: opname = ("@&&"); break; |
case L_OR: opname = ("@||"); break; |
case L_OR: opname = ("@||"); break; |
case L_NOT: opname = ("@!"); break; |
case L_NOT: opname = ("@!"); break; |
} |
} |
if ( (lid)FA0(f)==L_NOT ) { |
if ( (lid)FA0(f)==L_NOT ) { |
PUTS(opname); PRINTFNODE((FNODE)FA1(f),1); |
PUTS(opname); PRINTFNODE((FNODE)FA1(f),1); |
} else { |
} else { |
PRINTFNODE((FNODE)FA1(f),1); |
PRINTFNODE((FNODE)FA1(f),1); |
PUTS(opname); |
PUTS(opname); |
PRINTFNODE((FNODE)FA2(f),1); |
PRINTFNODE((FNODE)FA2(f),1); |
} |
} |
break; |
break; |
case I_AND: |
case I_AND: |
PRINTFNODE((FNODE)FA0(f),1); |
PRINTFNODE((FNODE)FA0(f),1); |
PUTS("&&"); |
PUTS("&&"); |
PRINTFNODE((FNODE)FA1(f),1); |
PRINTFNODE((FNODE)FA1(f),1); |
break; |
break; |
case I_OR: |
case I_OR: |
PRINTFNODE((FNODE)FA0(f),1); |
PRINTFNODE((FNODE)FA0(f),1); |
PUTS("!!"); |
PUTS("!!"); |
PRINTFNODE((FNODE)FA1(f),1); |
PRINTFNODE((FNODE)FA1(f),1); |
break; |
break; |
/* ternary operators */ |
/* ternary operators */ |
case I_CE: |
case I_CE: |
PRINTFNODE((FNODE)FA0(f),1); PUTS("?"); PRINTFNODE((FNODE)FA1(f),1); |
PRINTFNODE((FNODE)FA0(f),1); PUTS("?"); PRINTFNODE((FNODE)FA1(f),1); |
PUTS(":"); PRINTFNODE((FNODE)FA2(f),1); |
PUTS(":"); PRINTFNODE((FNODE)FA2(f),1); |
break; |
break; |
/* lists */ |
/* lists */ |
case I_LIST: PUTS("["); PRINTFNODENODE((NODE)FA0(f)); PUTS("]"); break; |
case I_LIST: PUTS("["); PRINTFNODENODE((NODE)FA0(f)); PUTS("]"); break; |
/* function */ |
/* function */ |
case I_FUNC: case I_FUNC_QARG: |
case I_FUNC: case I_FUNC_QARG: |
if ( !strcmp(((FUNC)FA0(f))->name,"@pi") ) PUTS("@pi"); |
if ( !strcmp(((FUNC)FA0(f))->name,"@pi") ) PUTS("@pi"); |
else if ( !strcmp(((FUNC)FA0(f))->name,"@e") ) PUTS("@e"); |
else if ( !strcmp(((FUNC)FA0(f))->name,"@e") ) PUTS("@e"); |
else { |
else { |
PUTS(((FUNC)FA0(f))->name); |
PUTS(((FUNC)FA0(f))->name); |
PUTS("("); PRINTFARGS(FA1(f)); PUTS(")"); |
PUTS("("); PRINTFARGS(FA1(f)); PUTS(")"); |
} |
} |
break; |
break; |
/* XXX */ |
/* XXX */ |
case I_CAR: PUTS("car("); PRINTFNODE(FA0(f),0); PUTS(")"); break; |
case I_CAR: PUTS("car("); PRINTFNODE(FA0(f),0); PUTS(")"); break; |
case I_CDR: PUTS("cdr("); PRINTFNODE(FA0(f),0); PUTS(")"); break; |
case I_CDR: PUTS("cdr("); PRINTFNODE(FA0(f),0); PUTS(")"); break; |
/* exponent vector */ |
/* exponent vector */ |
case I_EV: PUTS("<<"); PRINTFNODENODE((NODE)FA0(f)); PUTS(">>"); break; |
case I_EV: PUTS("<<"); PRINTFNODENODE((NODE)FA0(f)); PUTS(">>"); break; |
/* string */ |
/* string */ |
case I_STR: PUTS((char *)FA0(f)); break; |
case I_STR: PUTS((char *)FA0(f)); break; |
/* internal object */ |
/* internal object */ |
case I_FORMULA: obj = (Obj)FA0(f); PRINTEXPR(CO,obj); break; |
case I_FORMULA: obj = (Obj)FA0(f); PRINTEXPR(CO,obj); break; |
/* program variable */ |
/* program variable */ |
case I_PVAR: |
case I_PVAR: |
if ( FA1(f) ) |
if ( FA1(f) ) |
error("printfnode : not implemented yet"); |
error("printfnode : not implemented yet"); |
GETPVNAME(FA0(f),opname); |
GETPVNAME(FA0(f),opname); |
PUTS(opname); |
PUTS(opname); |
break; |
break; |
default: error("printfnode : not implemented yet"); |
default: error("printfnode : not implemented yet"); |
} |
} |
if ( paren ) PUTS(")"); |
if ( paren ) PUTS(")"); |
} |
} |
|
|
/* functions not used in cpexpr.c */ |
/* functions not used in cpexpr.c */ |
Line 652 void PRINTFNODE(FNODE f,int paren) |
|
Line 655 void PRINTFNODE(FNODE f,int paren) |
|
void PRINTNUM(q) |
void PRINTNUM(q) |
Num q; |
Num q; |
{ |
{ |
char real_format[20]; |
char real_format[20]; |
DAlg d; |
DAlg d; |
DP nm; |
DP nm; |
Q dn; |
Q dn; |
|
|
if ( !q ) { |
if ( !q ) { |
PUTS("0"); |
PUTS("0"); |
return; |
return; |
} |
} |
switch ( NID(q) ) { |
switch ( NID(q) ) { |
case N_Q: |
case N_Q: |
if ( SGN((Q)q) == -1 ) |
if ( SGN((Q)q) == -1 ) |
PUTS("-"); |
PUTS("-"); |
PRINTN(NM((Q)q)); |
PRINTN(NM((Q)q)); |
if ( !INT((Q)q) ) { |
if ( !INT((Q)q) ) { |
PUTS("/"); PRINTN(DN((Q)q)); |
PUTS("/"); PRINTN(DN((Q)q)); |
} |
} |
break; |
break; |
case N_R: |
case N_R: |
switch (printmode) { |
switch (printmode) { |
case PRINTF_E: |
case PRINTF_E: |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
case MID_PRINTF_E: |
case MID_PRINTF_E: |
#endif |
#endif |
TAIL PRINTF(OUT,"%.16e",BDY((Real)q)); |
TAIL PRINTF(OUT,"%.16e",BDY((Real)q)); |
break; |
break; |
case PRINTF_G: |
case PRINTF_G: |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
case MID_PRINTF_G: |
case MID_PRINTF_G: |
#endif |
#endif |
default: |
default: |
if ( real_binary ) { |
if ( real_binary ) { |
unsigned int *m; |
unsigned int *m; |
unsigned int u,l,mask; |
unsigned int u,l,mask; |
int i,expo; |
int i,expo; |
|
|
m = (unsigned int *)&BDY((Real)q); |
m = (unsigned int *)&BDY((Real)q); |
#if defined(__i386__) || defined(MIPSEL) || defined(VISUAL) || defined(__alpha) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__x86_64) |
#if defined(__i386__) || defined(MIPSEL) || defined(VISUAL) || defined(__MINGW32__) || defined(__alpha) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__x86_64) || defined(__ARM_ARCH) || defined(ANDROID) |
u = m[1]; l = m[0]; |
u = m[1]; l = m[0]; |
#else |
#else |
u = m[0]; l = m[1]; |
u = m[0]; l = m[1]; |
#endif |
#endif |
if (u&0x80000000) { |
if (u&0x80000000) { |
TAIL PRINTF(OUT,"-"); |
TAIL PRINTF(OUT,"-"); |
} |
} |
u &= 0x7fffffff; |
u &= 0x7fffffff; |
expo = ((int)(u>>20)); |
expo = ((int)(u>>20)); |
u &= 0xfffff; |
u &= 0xfffff; |
if ( expo == 2047 ) { |
if ( expo == 2047 ) { |
if ( u || l ) { |
if ( u || l ) { |
TAIL PRINTF(OUT,"NaN"); |
TAIL PRINTF(OUT,"NaN"); |
} else { |
} else { |
TAIL PRINTF(OUT,"Inf"); |
TAIL PRINTF(OUT,"Inf"); |
} |
} |
} else if ( expo == 0 ) { |
} else if ( expo == 0 ) { |
if ( u || l ) { |
if ( u || l ) { |
TAIL PRINTF(OUT,"0b0."); |
TAIL PRINTF(OUT,"0b0."); |
for ( i = 0, mask = 0x80000; i < 20; |
for ( i = 0, mask = 0x80000; i < 20; |
i++, mask >>= 1) { |
i++, mask >>= 1) { |
TAIL |
TAIL |
if ( u&mask ) |
if ( u&mask ) |
PRINTF(OUT,"1"); |
PRINTF(OUT,"1"); |
else |
else |
PRINTF(OUT,"0"); |
PRINTF(OUT,"0"); |
} |
} |
for ( i = 0, mask = 0x80000000; i < 32; |
for ( i = 0, mask = 0x80000000; i < 32; |
i++, mask >>= 1) { |
i++, mask >>= 1) { |
TAIL |
TAIL |
if ( l&mask ) |
if ( l&mask ) |
PRINTF(OUT,"1"); |
PRINTF(OUT,"1"); |
else |
else |
PRINTF(OUT,"0"); |
PRINTF(OUT,"0"); |
} |
} |
TAIL PRINTF(OUT,"*2^%d",-1022); |
TAIL PRINTF(OUT,"*2^%d",-1022); |
} else { |
} else { |
TAIL PRINTF(OUT,"0"); |
TAIL PRINTF(OUT,"0"); |
} |
} |
} else { |
} else { |
expo -= 1023; |
expo -= 1023; |
TAIL PRINTF(OUT,"0b1."); |
TAIL PRINTF(OUT,"0b1."); |
for ( i = 0, mask = 0x80000; i < 20; |
for ( i = 0, mask = 0x80000; i < 20; |
i++, mask >>= 1) { |
i++, mask >>= 1) { |
TAIL |
TAIL |
if ( u&mask ) |
if ( u&mask ) |
PRINTF(OUT,"1"); |
PRINTF(OUT,"1"); |
else |
else |
PRINTF(OUT,"0"); |
PRINTF(OUT,"0"); |
} |
} |
for ( i = 0, mask = 0x80000000; i < 32; |
for ( i = 0, mask = 0x80000000; i < 32; |
i++, mask >>= 1) { |
i++, mask >>= 1) { |
TAIL |
TAIL |
if ( l&mask ) |
if ( l&mask ) |
PRINTF(OUT,"1"); |
PRINTF(OUT,"1"); |
else |
else |
PRINTF(OUT,"0"); |
PRINTF(OUT,"0"); |
} |
} |
if ( expo ) { |
if ( expo ) { |
TAIL PRINTF(OUT,"*2^%d",expo); |
TAIL PRINTF(OUT,"*2^%d",expo); |
} |
} |
} |
} |
} else if ( real_digit ) { |
} else if ( real_digit ) { |
sprintf(real_format, |
sprintf(real_format, |
double_output?"%%.%df":"%%.%dg",real_digit); |
double_output?"%%.%df":"%%.%dg",real_digit); |
TAIL PRINTF(OUT,real_format,BDY((Real)q)); |
TAIL PRINTF(OUT,real_format,BDY((Real)q)); |
} else { |
} else { |
TAIL PRINTF(OUT,double_output?"%f":"%g",BDY((Real)q)); |
TAIL PRINTF(OUT,double_output?"%f":"%g",BDY((Real)q)); |
} |
} |
break; |
break; |
} |
} |
break; |
break; |
case N_A: |
case N_A: |
PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); |
PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); |
break; |
break; |
#if defined(PARI) |
case N_B: |
case N_B: |
PRINTBF((BF)q); break; |
PRINTBF((BF)q); break; |
|
#endif |
|
#if defined(INTERVAL) |
#if defined(INTERVAL) |
case N_IP: |
case N_IP: |
case N_IntervalBigFloat: |
case N_IntervalBigFloat: |
switch ( outputstyle ) { |
switch ( outputstyle ) { |
case 1: |
case 1: |
PUTS("intval("); |
PUTS("intval("); |
PRINTNUM(INF((Itv)q)); |
PRINTNUM(INF((Itv)q)); |
PUTS(","); |
PUTS(","); |
PRINTNUM(SUP((Itv)q)); |
PRINTNUM(SUP((Itv)q)); |
PUTS(")"); |
PUTS(")"); |
break; |
break; |
case 0: |
case 0: |
default: |
default: |
PUTS("["); |
PUTS("["); |
PRINTNUM(INF((Itv)q)); |
PRINTNUM(INF((Itv)q)); |
PUTS(","); |
PUTS(","); |
PRINTNUM(SUP((Itv)q)); |
PRINTNUM(SUP((Itv)q)); |
PUTS("]"); |
PUTS("]"); |
break; |
break; |
} |
} |
break; |
break; |
case N_IntervalDouble: |
case N_IntervalDouble: |
switch (printmode) { |
switch (printmode) { |
case PRINTF_E: |
case PRINTF_E: |
switch ( outputstyle ) { |
switch ( outputstyle ) { |
case 1: |
case 1: |
TAIL PRINTF(OUT, "intval(%.16e,%.16e)", |
TAIL PRINTF(OUT, "intval(%.16e,%.16e)", |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
break; |
break; |
case 0: |
case 0: |
default: |
default: |
TAIL PRINTF(OUT, "[%.16e,%.16e]", |
TAIL PRINTF(OUT, "[%.16e,%.16e]", |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
break; |
break; |
} |
} |
#if defined(ITVDEBUG) |
#if defined(ITVDEBUG) |
printbin(INF((IntervalDouble)q)); |
printbin(INF((IntervalDouble)q)); |
printbin(SUP((IntervalDouble)q)); |
printbin(SUP((IntervalDouble)q)); |
#endif |
#endif |
break; |
break; |
case MID_PRINTF_G: |
case MID_PRINTF_G: |
switch ( outputstyle ) { |
switch ( outputstyle ) { |
case 1: |
case 1: |
TAIL PRINTF(OUT, "intvalm(%g,%g)", |
TAIL PRINTF(OUT, "intvalm(%g,%g)", |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
break; |
break; |
case 0: |
case 0: |
default: |
default: |
TAIL PRINTF(OUT, "<%g,%g>", |
TAIL PRINTF(OUT, "<%g,%g>", |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
break; |
break; |
} |
} |
break; |
break; |
case MID_PRINTF_E: |
case MID_PRINTF_E: |
switch ( outputstyle ) { |
switch ( outputstyle ) { |
case 1: |
case 1: |
TAIL PRINTF(OUT, "intvalm(%.16e,%.16e)", |
TAIL PRINTF(OUT, "intvalm(%.16e,%.16e)", |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
break; |
break; |
case 0: |
case 0: |
default: |
default: |
TAIL PRINTF(OUT, "<%.16e,%.16e>", |
TAIL PRINTF(OUT, "<%.16e,%.16e>", |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)+INF((IntervalDouble)q))*0.5, |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
(SUP((IntervalDouble)q)-INF((IntervalDouble)q))*0.5); |
break; |
break; |
} |
} |
break; |
break; |
case PRINTF_G: |
case PRINTF_G: |
default: |
default: |
switch ( outputstyle ) { |
switch ( outputstyle ) { |
case 1: |
case 1: |
TAIL PRINTF(OUT, "intval(%g,%g)", |
TAIL PRINTF(OUT, "intval(%g,%g)", |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
break; |
break; |
case 0: |
case 0: |
default: |
default: |
TAIL PRINTF(OUT, "[%g,%g]", |
TAIL PRINTF(OUT, "[%g,%g]", |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
INF((IntervalDouble)q),SUP((IntervalDouble)q)); |
break; |
break; |
} |
} |
break; |
break; |
} |
} |
break; |
break; |
#endif |
#endif |
case N_C: |
case N_C: |
PRINTCPLX((C)q); break; |
PRINTCPLX((C)q); break; |
case N_M: |
case N_M: |
TAIL PRINTF(OUT,"%d",CONT((MQ)q)); break; |
TAIL PRINTF(OUT,"%d",CONT((MQ)q)); break; |
case N_LM: |
case N_LM: |
PRINTN(((LM)q)->body); break; |
PRINTN(((LM)q)->body); break; |
case N_GF2N: |
case N_GF2N: |
if ( hex_output ) |
if ( hex_output ) |
PRINTN((N)(((GF2N)q)->body)); |
PRINTN((N)(((GF2N)q)->body)); |
else |
else |
PRINTUP2(((GF2N)q)->body); |
PRINTUP2(((GF2N)q)->body); |
break; |
break; |
case N_GFPN: |
case N_GFPN: |
PRINTUP((UP)(((GFPN)q)->body)); |
PRINTUP((UP)(((GFPN)q)->body)); |
break; |
break; |
case N_GFS: |
case N_GFS: |
TAIL PRINTF(OUT,"@_%d",CONT((GFS)q)); |
TAIL PRINTF(OUT,"@_%d",CONT((GFS)q)); |
break; |
break; |
case N_GFSN: |
case N_GFSN: |
PRINTUM(BDY((GFSN)q)); |
PRINTUM(BDY((GFSN)q)); |
break; |
break; |
case N_DA: |
case N_DA: |
d = (DAlg)q; |
d = (DAlg)q; |
nm = d->nm; |
nm = d->nm; |
dn = d->dn; |
dn = d->dn; |
if ( SGN((Q)dn) == -1 ) PUTS("-"); |
if ( SGN((Q)dn) == -1 ) PUTS("-"); |
PUTS("("); |
PUTS("("); |
PRINTDP(CO,((DAlg)q)->nm); |
PRINTDP(CO,((DAlg)q)->nm); |
PUTS(")"); |
PUTS(")"); |
if ( !UNIN(NM(dn)) ) { |
if ( !UNIN(NM(dn)) ) { |
PUTS("/"); |
PUTS("/"); |
PRINTN(NM(dn)); |
PRINTN(NM(dn)); |
} |
} |
break; |
break; |
} |
case N_GZ: |
|
mpz_out_str(OUT,10,BDY((GZ)q)); |
|
break; |
|
case N_GQ: |
|
mpq_out_str(OUT,10,BDY((GQ)q)); |
|
break; |
|
} |
} |
} |
|
|
void PRINTN(n) |
void PRINTN(n) |
N n; |
N n; |
{ |
{ |
register int i,*ptr; |
register int i,*ptr; |
N tn; |
N tn; |
|
|
if ( !n ) { |
if ( !n ) { |
PUTS("0"); |
PUTS("0"); |
return; |
return; |
} |
} |
if ( hex_output ) { |
if ( hex_output ) { |
ptr = BD(n); |
ptr = BD(n); |
TAIL PRINTF(OUT,"0x%x",ptr[PL(n)-1]); |
TAIL PRINTF(OUT,"0x%x",ptr[PL(n)-1]); |
if ( hex_output < 0 ) |
if ( hex_output < 0 ) |
for ( i = PL(n) - 2; i >= 0; i-- ) { |
for ( i = PL(n) - 2; i >= 0; i-- ) { |
TAIL PRINTF(OUT,"|%08x",ptr[i]); |
TAIL PRINTF(OUT,"|%08x",ptr[i]); |
} |
} |
else |
else |
for ( i = PL(n) - 2; i >= 0; i-- ) { |
for ( i = PL(n) - 2; i >= 0; i-- ) { |
TAIL PRINTF(OUT,"%08x",ptr[i]); |
TAIL PRINTF(OUT,"%08x",ptr[i]); |
} |
} |
} else { |
} else { |
ntobn(DBASE,n,&tn); |
ntobn(DBASE,n,&tn); |
ptr = BD(tn); |
ptr = BD(tn); |
TAIL PRINTF(OUT,"%d",ptr[PL(tn) - 1]); |
TAIL PRINTF(OUT,"%d",ptr[PL(tn) - 1]); |
for ( i = PL(tn) - 2; i >= 0; i-- ) { |
for ( i = PL(tn) - 2; i >= 0; i-- ) { |
TAIL PRINTF(OUT,DFORMAT,ptr[i]); |
TAIL PRINTF(OUT,DFORMAT,ptr[i]); |
} |
} |
} |
} |
} |
} |
|
|
void PRINTV(vl,v) |
void PRINTV(vl,v) |
VL vl; |
VL vl; |
V v; |
V v; |
{ |
{ |
PF pf; |
PF pf; |
PFAD ad; |
PFAD ad; |
int i; |
int i; |
|
|
if ( NAME(v) ) |
if ( NAME(v) ) |
PUTS(NAME(v)); |
PUTS(NAME(v)); |
else if ( (vid)v->attr == V_PF ) { |
else if ( (vid)v->attr == V_PF ) { |
pf = ((PFINS)v->priv)->pf; ad = ((PFINS)v->priv)->ad; |
pf = ((PFINS)v->priv)->pf; ad = ((PFINS)v->priv)->ad; |
if ( !strcmp(NAME(pf),"pow") ) { |
if ( !strcmp(NAME(pf),"pow") ) { |
PUTS("(("); PRINTR(vl,(R)ad[0].arg); PUTS(")"); PRINTHAT; PUTS("("); |
PUTS("(("); PRINTR(vl,(R)ad[0].arg); PUTS(")"); PRINTHAT; PUTS("("); |
PRINTR(vl,(R)ad[1].arg); PUTS("))"); |
PRINTR(vl,(R)ad[1].arg); PUTS("))"); |
} else if ( !pf->argc ) { |
} else if ( !pf->argc ) { |
TAIL PRINTF(OUT,"%s",NAME(pf)); |
TAIL PRINTF(OUT,"%s",NAME(pf)); |
} else { |
} else { |
if ( hideargs ) { |
if ( hideargs ) { |
for ( i = 0; i < pf->argc; i++ ) |
for ( i = 0; i < pf->argc; i++ ) |
if ( ad[i].d ) |
if ( ad[i].d ) |
break; |
break; |
if ( i < pf->argc ) { |
if ( i < pf->argc ) { |
TAIL PRINTF(OUT,"%s{%d",NAME(pf),ad[0].d); |
TAIL PRINTF(OUT,"%s{%d",NAME(pf),ad[0].d); |
for ( i = 1; i < pf->argc; i++ ) { |
for ( i = 1; i < pf->argc; i++ ) { |
TAIL PRINTF(OUT,",%d",ad[i].d); |
TAIL PRINTF(OUT,",%d",ad[i].d); |
} |
} |
PUTS("}"); |
PUTS("}"); |
} else { |
} else { |
TAIL PRINTF(OUT,"%s",NAME(pf)); |
TAIL PRINTF(OUT,"%s",NAME(pf)); |
} |
} |
} else { |
} else { |
for ( i = 0; i < pf->argc; i++ ) |
for ( i = 0; i < pf->argc; i++ ) |
if ( ad[i].d ) |
if ( ad[i].d ) |
break; |
break; |
if ( i < pf->argc ) { |
if ( i < pf->argc ) { |
TAIL PRINTF(OUT,"%s{%d",NAME(pf),ad[0].d); |
TAIL PRINTF(OUT,"%s{%d",NAME(pf),ad[0].d); |
for ( i = 1; i < pf->argc; i++ ) { |
for ( i = 1; i < pf->argc; i++ ) { |
TAIL PRINTF(OUT,",%d",ad[i].d); |
TAIL PRINTF(OUT,",%d",ad[i].d); |
} |
} |
PUTS("}("); |
PUTS("}("); |
} else { |
} else { |
TAIL PRINTF(OUT,"%s(",NAME(pf)); |
TAIL PRINTF(OUT,"%s(",NAME(pf)); |
} |
} |
PRINTR(vl,(R)ad[0].arg); |
PRINTR(vl,(R)ad[0].arg); |
for ( i = 1; i < pf->argc; i++ ) { |
for ( i = 1; i < pf->argc; i++ ) { |
PUTS(","); PRINTR(vl,(R)ad[i].arg); |
PUTS(","); PRINTR(vl,(R)ad[i].arg); |
} |
} |
PUTS(")"); |
PUTS(")"); |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
void PRINTSTR(str) |
void PRINTSTR(str) |
STRING str; |
STRING str; |
{ |
{ |
char *p; |
char *p; |
|
|
for ( p = BDY(str); *p; p++ ) |
for ( p = BDY(str); *p; p++ ) |
if ( *p == '"' ) |
if ( *p == '"' ) |
PUTS("\""); |
PUTS("\""); |
else { |
else { |
TAIL PRINTF(OUT,"%c",*p); |
TAIL PRINTF(OUT,"%c",*p); |
} |
} |
} |
} |
|
|
void PRINTDP(vl,d) |
void PRINTDP(vl,d) |
VL vl; |
VL vl; |
DP d; |
DP d; |
{ |
{ |
int n,i; |
int n,i; |
MP m; |
MP m; |
DL dl; |
DL dl; |
|
|
for ( n = d->nv, m = BDY(d); m; m = NEXT(m) ) { |
for ( n = d->nv, m = BDY(d); m; m = NEXT(m) ) { |
PUTS("("); PRINTEXPR(vl,(pointer)m->c); PUTS(")*<<"); |
PUTS("("); PRINTEXPR(vl,(pointer)m->c); PUTS(")*<<"); |
for ( i = 0, dl = m->dl; i < n-1; i++ ) { |
for ( i = 0, dl = m->dl; i < n-1; i++ ) { |
TAIL PRINTF(OUT,"%d,",dl->d[i]); |
TAIL PRINTF(OUT,"%d,",dl->d[i]); |
} |
} |
TAIL PRINTF(OUT,"%d",dl->d[i]); |
TAIL PRINTF(OUT,"%d",dl->d[i]); |
PUTS(">>"); |
PUTS(">>"); |
if ( NEXT(m) ) |
if ( NEXT(m) ) |
PUTS("+"); |
PUTS("+"); |
} |
} |
} |
} |
|
|
|
void PRINTDPM(vl,d) |
|
VL vl; |
|
DPM d; |
|
{ |
|
int n,i; |
|
DMM m; |
|
DL dl; |
|
|
|
for ( n = d->nv, m = BDY(d); m; m = NEXT(m) ) { |
|
PUTS("("); PRINTEXPR(vl,(pointer)m->c); PUTS(")*<<"); |
|
for ( i = 0, dl = m->dl; i < n-1; i++ ) { |
|
TAIL PRINTF(OUT,"%d,",dl->d[i]); |
|
} |
|
TAIL PRINTF(OUT,"%d:%d",dl->d[i],m->pos); |
|
PUTS(">>"); |
|
if ( NEXT(m) ) |
|
PUTS("+"); |
|
} |
|
} |
|
|
void PRINTUI(vl,u) |
void PRINTUI(vl,u) |
VL vl; |
VL vl; |
USINT u; |
USINT u; |
{ |
{ |
TAIL PRINTF(OUT,"%u",BDY(u)); |
TAIL PRINTF(OUT,"%u",BDY(u)); |
} |
} |
|
|
void PRINTGFMMAT(vl,mat) |
void PRINTGFMMAT(vl,mat) |
VL vl; |
VL vl; |
GFMMAT mat; |
GFMMAT mat; |
{ |
{ |
int row,col,i,j; |
int row,col,i,j; |
unsigned int **b; |
unsigned int **b; |
|
|
row = mat->row; |
row = mat->row; |
col = mat->col; |
col = mat->col; |
b = mat->body; |
b = mat->body; |
for ( i = 0; i < row; i++ ) { |
for ( i = 0; i < row; i++ ) { |
PUTS("["); |
PUTS("["); |
for ( j = 0; j < col; j++ ) { |
for ( j = 0; j < col; j++ ) { |
TAIL PRINTF(OUT,"%8d",b[i][j]); |
TAIL PRINTF(OUT,"%8d",b[i][j]); |
} |
} |
PUTS("]\n"); |
PUTS("]\n"); |
} |
} |
} |
} |
|
|
void PRINTBYTEARRAY(vl,array) |
void PRINTBYTEARRAY(vl,array) |
VL vl; |
VL vl; |
BYTEARRAY array; |
BYTEARRAY array; |
{ |
{ |
int len,i; |
int len,i; |
unsigned char *b; |
unsigned char *b; |
|
|
len = array->len; |
len = array->len; |
b = array->body; |
b = array->body; |
PUTS("|"); |
PUTS("|"); |
for ( i = 0; i < len-1; i++ ) { |
for ( i = 0; i < len-1; i++ ) { |
TAIL PRINTF(OUT,"%02x ",(unsigned int)b[i]); |
TAIL PRINTF(OUT,"%02x ",(unsigned int)b[i]); |
} |
} |
TAIL PRINTF(OUT,"%02x",(unsigned int)b[i]); |
TAIL PRINTF(OUT,"%02x",(unsigned int)b[i]); |
PUTS("|"); |
PUTS("|"); |
} |
} |
|
|
void PRINTQUOTE(vl,quote) |
void PRINTQUOTE(vl,quote) |
VL vl; |
VL vl; |
QUOTE quote; |
QUOTE quote; |
{ |
{ |
LIST list; |
LIST list; |
|
|
if ( print_quote == 1 ) { |
if ( print_quote == 1 ) { |
fnodetotree(BDY(quote),&list); |
fnodetotree(BDY(quote),&list); |
PRINTEXPR(vl,(Obj)list); |
PRINTEXPR(vl,(Obj)list); |
} else if ( print_quote == 2 ) { |
} else if ( print_quote == 2 ) { |
PRINTFNODE(BDY(quote),0); |
PRINTFNODE(BDY(quote),0); |
} else { |
} else { |
PUTS("<...quoted...>"); |
PUTS("<...quoted...>"); |
} |
} |
} |
} |
|
|
void PRINTQUOTEARG(vl,quote) |
void PRINTQUOTEARG(vl,quote) |
VL vl; |
VL vl; |
QUOTEARG quote; |
QUOTEARG quote; |
{ |
{ |
PUTS("<...quoted...>"); |
PUTS("<...quoted...>"); |
} |
} |
|
|
void PRINTNBP(VL vl,NBP p) |
void PRINTNBP(VL vl,NBP p) |
{ |
{ |
NODE t; |
NODE t; |
NBM m; |
NBM m; |
int d,i; |
int d,i; |
unsigned int *b; |
unsigned int *b; |
if ( !p ) PUTS("0"); |
if ( !p ) PUTS("0"); |
else { |
else { |
for ( t = BDY(p); t; t = NEXT(t) ) { |
for ( t = BDY(p); t; t = NEXT(t) ) { |
m = (NBM)BDY(t); |
m = (NBM)BDY(t); |
PUTS("("); |
PUTS("("); |
PRINTEXPR(vl,(Obj)m->c); |
PRINTEXPR(vl,(Obj)m->c); |
PUTS(")*"); |
PUTS(")*"); |
d = m->d; |
d = m->d; |
b = m->b; |
b = m->b; |
if ( d ) |
if ( d ) |
for ( i = 0; i < d; i++ ) { |
for ( i = 0; i < d; i++ ) { |
if ( NBM_GET(b,i) ) PUTS("x"); |
if ( NBM_GET(b,i) ) PUTS("x"); |
else PUTS("y"); |
else PUTS("y"); |
} |
} |
else PUTS("1"); |
else PUTS("1"); |
if ( NEXT(t) ) PUTS("+"); |
if ( NEXT(t) ) PUTS("+"); |
} |
} |
} |
} |
} |
} |
|
|
void PRINTTB(VL vl,TB p) |
void PRINTTB(VL vl,TB p) |
{ |
{ |
int i; |
int i; |
#if defined(SPRINT) |
#if defined(SPRINT) |
char *ptr,*e; |
char *ptr,*e; |
|
|
for ( i = 0, ptr = buf+strlen(OUT); i < p->next; i++ ) |
for ( i = 0, ptr = buf+strlen(OUT); i < p->next; i++ ) |
for ( e = p->body[i]; *e; *ptr++ = *e++ ); |
for ( e = p->body[i]; *e; *ptr++ = *e++ ); |
*ptr = 0; |
*ptr = 0; |
#else |
#else |
for ( i = 0; i < p->next; i++ ) { |
for ( i = 0; i < p->next; i++ ) { |
PUTS(p->body[i]); |
PUTS(p->body[i]); |
} |
} |
#endif |
#endif |
} |
} |
|
|
void PRINTUP2(p) |
void PRINTUP2(p) |
UP2 p; |
UP2 p; |
{ |
{ |
int d,i; |
int d,i; |
|
|
if ( !p ) { |
if ( !p ) { |
TAIL PRINTF(OUT,"0"); |
TAIL PRINTF(OUT,"0"); |
} else { |
} else { |
d = degup2(p); |
d = degup2(p); |
TAIL PRINTF(OUT,"("); |
TAIL PRINTF(OUT,"("); |
if ( !d ) { |
if ( !d ) { |
TAIL PRINTF(OUT,"1"); |
TAIL PRINTF(OUT,"1"); |
} else if ( d == 1 ) { |
} else if ( d == 1 ) { |
TAIL PRINTF(OUT,"@"); |
TAIL PRINTF(OUT,"@"); |
} else { |
} else { |
PUTS("@"); PRINTHAT; TAIL PRINTF(OUT,"%d",d); |
PUTS("@"); PRINTHAT; TAIL PRINTF(OUT,"%d",d); |
} |
} |
for ( i = d-1; i >= 0; i-- ) { |
for ( i = d-1; i >= 0; i-- ) { |
if ( p->b[i/BSH] & (1<<(i%BSH)) ) |
if ( p->b[i/BSH] & (1<<(i%BSH)) ) |
if ( !i ) { |
if ( !i ) { |
TAIL PRINTF(OUT,"+1"); |
TAIL PRINTF(OUT,"+1"); |
} else if ( i == 1 ) { |
} else if ( i == 1 ) { |
TAIL PRINTF(OUT,"+@"); |
TAIL PRINTF(OUT,"+@"); |
} else { |
} else { |
PUTS("+@"); PRINTHAT; TAIL PRINTF(OUT,"%d",i); |
PUTS("+@"); PRINTHAT; TAIL PRINTF(OUT,"%d",i); |
} |
} |
} |
} |
TAIL PRINTF(OUT,")"); |
TAIL PRINTF(OUT,")"); |
} |
} |
} |
} |
|
|
void PRINTQOP(vl,f) |
void PRINTQOP(vl,f) |
VL vl; |
VL vl; |
F f; |
F f; |
{ |
{ |
char *op; |
char *op; |
|
|
op = FOP(f)==AL_EX?"ex":"all"; |
op = FOP(f)==AL_EX?"ex":"all"; |
TAIL PRINTF(OUT,"%s(%s,",op,NAME(FQVR(f))); |
TAIL PRINTF(OUT,"%s(%s,",op,NAME(FQVR(f))); |
PRINTEXPR(vl,(Obj)FQMAT(f)); PUTS(")"); |
PRINTEXPR(vl,(Obj)FQMAT(f)); PUTS(")"); |
} |
} |
|
|
void PRINTUP(n) |
void PRINTUP(n) |
UP n; |
UP n; |
{ |
{ |
int i,d; |
int i,d; |
|
|
if ( !n ) |
if ( !n ) |
PUTS("0"); |
PUTS("0"); |
else if ( !n->d ) |
else if ( !n->d ) |
PRINTNUM(n->c[0]); |
PRINTNUM(n->c[0]); |
else { |
else { |
d = n->d; |
d = n->d; |
PUTS("("); |
PUTS("("); |
if ( !d ) { |
if ( !d ) { |
PRINTNUM(n->c[d]); |
PRINTNUM(n->c[d]); |
} else if ( d == 1 ) { |
} else if ( d == 1 ) { |
PRINTNUM(n->c[d]); |
PRINTNUM(n->c[d]); |
PUTS("*@p"); |
PUTS("*@p"); |
} else { |
} else { |
PRINTNUM(n->c[d]); |
PRINTNUM(n->c[d]); |
PUTS("*@p"); PRINTHAT; TAIL PRINTF(OUT,"%d",d); |
PUTS("*@p"); PRINTHAT; TAIL PRINTF(OUT,"%d",d); |
} |
} |
for ( i = d-1; i >= 0; i-- ) { |
for ( i = d-1; i >= 0; i-- ) { |
if ( n->c[i] ) { |
if ( n->c[i] ) { |
PUTS("+("); PRINTNUM(n->c[i]); PUTS(")"); |
PUTS("+("); PRINTNUM(n->c[i]); PUTS(")"); |
if ( i >= 2 ) { |
if ( i >= 2 ) { |
PUTS("*@p"); PRINTHAT; TAIL PRINTF(OUT,"%d",i); |
PUTS("*@p"); PRINTHAT; TAIL PRINTF(OUT,"%d",i); |
} else if ( i == 1 ) |
} else if ( i == 1 ) |
PUTS("*@p"); |
PUTS("*@p"); |
} |
} |
} |
} |
PUTS(")"); |
PUTS(")"); |
} |
} |
} |
} |
|
|
void PRINTUM(n) |
void PRINTUM(n) |
UM n; |
UM n; |
{ |
{ |
int i,d; |
int i,d; |
|
|
if ( !n ) |
if ( !n ) |
PUTS("0"); |
PUTS("0"); |
else if ( !n->d ) |
else if ( !n->d ) |
PRINTSF(n->c[0]); |
PRINTSF(n->c[0]); |
else { |
else { |
d = n->d; |
d = n->d; |
PUTS("("); |
PUTS("("); |
if ( !d ) { |
if ( !d ) { |
PRINTSF(n->c[d]); |
PRINTSF(n->c[d]); |
} else if ( d == 1 ) { |
} else if ( d == 1 ) { |
PRINTSF(n->c[d]); |
PRINTSF(n->c[d]); |
PUTS("*@s"); |
PUTS("*@s"); |
} else { |
} else { |
PRINTSF(n->c[d]); |
PRINTSF(n->c[d]); |
PUTS("*@s"); PRINTHAT; TAIL PRINTF(OUT,"%d",d); |
PUTS("*@s"); PRINTHAT; TAIL PRINTF(OUT,"%d",d); |
} |
} |
for ( i = d-1; i >= 0; i-- ) { |
for ( i = d-1; i >= 0; i-- ) { |
if ( n->c[i] ) { |
if ( n->c[i] ) { |
PUTS("+("); PRINTSF(n->c[i]); PUTS(")"); |
PUTS("+("); PRINTSF(n->c[i]); PUTS(")"); |
if ( i >= 2 ) { |
if ( i >= 2 ) { |
PUTS("*@s"); PRINTHAT; TAIL PRINTF(OUT,"%d",i); |
PUTS("*@s"); PRINTHAT; TAIL PRINTF(OUT,"%d",i); |
} else if ( i == 1 ) |
} else if ( i == 1 ) |
PUTS("*@s"); |
PUTS("*@s"); |
} |
} |
} |
} |
PUTS(")"); |
PUTS(")"); |
} |
} |
} |
} |
|
|
void PRINTSF(i) |
void PRINTSF(i) |
unsigned int i; |
unsigned int i; |
{ |
{ |
if ( !i ) { |
if ( !i ) { |
PUTS("0"); |
PUTS("0"); |
} else { |
} else { |
TAIL PRINTF(OUT,"@_%d",IFTOF(i)); |
TAIL PRINTF(OUT,"@_%d",IFTOF(i)); |
} |
} |
} |
} |
|
|
void PRINTSYMBOL(SYMBOL sym) |
void PRINTSYMBOL(SYMBOL sym) |
{ |
{ |
PUTS(sym->name); |
PUTS(sym->name); |
} |
} |
|
|
#endif /* CPRINT */ |
#endif /* CPRINT */ |