version 1.5, 2004/12/02 13:48:43 |
version 1.8, 2005/01/17 07:43:24 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.4 2004/07/13 07:59:54 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.7 2004/12/18 16:50:10 saito Exp $ */ |
|
|
#define PRINTHAT (fortran_output?PUTS("**"):PUTS("^")) |
#define PRINTHAT (fortran_output?PUTS("**"):PUTS("^")) |
|
|
|
|
void PRINTLIST(); |
void PRINTLIST(); |
void PRINTVECT(); |
void PRINTVECT(); |
void PRINTMAT(); |
void PRINTMAT(); |
|
void PRINTIMAT(); /* IMAT */ |
void PRINTSTR(); |
void PRINTSTR(); |
void PRINTCOMP(); |
void PRINTCOMP(); |
void PRINTDP(); |
void PRINTDP(); |
Line 44 void PRINTEXPR(vl,p) |
|
Line 45 void PRINTEXPR(vl,p) |
|
VL vl; |
VL vl; |
Obj p; |
Obj p; |
{ |
{ |
#if defined(FPRINT) |
|
if ( asir_texmacs && !user_print_function ) printf("\2verbatim:"); |
|
#endif |
|
if ( !p ) { |
if ( !p ) { |
PRINTR(vl,(R)p); |
PRINTR(vl,(R)p); |
} else |
} else |
|
|
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 */ |
|
case O_IMAT: |
|
PRINTIMAT(vl,(IMAT)p); break; |
|
/* IMAT */ |
case O_STR: |
case O_STR: |
PRINTSTR((STRING)p); break; |
PRINTSTR((STRING)p); break; |
case O_COMP: |
case O_COMP: |
|
|
default: |
default: |
break; |
break; |
} |
} |
#if defined(FPRINT) |
|
if ( asir_texmacs && !user_print_function ) |
|
{ putchar('\5'); fflush(stdout); } |
|
#endif |
|
} |
} |
|
|
#if defined(FPRINT) |
#if defined(FPRINT) |
|
|
break; |
break; |
} |
} |
} |
} |
|
|
|
/* IMAT */ |
|
#if !defined(CPRINT) |
|
void PRINTIMAT(vl,xmat) |
|
VL vl; |
|
IMAT xmat; |
|
{ |
|
int i,j,c; |
|
int row, col, cr; |
|
IMATC Im; |
|
IENT ent; |
|
|
|
row = xmat->row; |
|
col = xmat->col; |
|
Im = (pointer)xmat->root; |
|
if ( xmat->clen == 0 ) { |
|
for(j = 0; j< row; j++) { |
|
PUTS("( "); |
|
for(i = 0; i < col; i++) PUTS("0 "); |
|
PUTS(")"); |
|
if ( j < row - 1 ) PUTS("\n"); |
|
} |
|
return; |
|
} |
|
c = -1; |
|
GetNextIent(&Im, &ent, &c); |
|
for(j = 0; j < row; j++) { |
|
PUTS("( "); |
|
for(i = 0; i < col; i++) { |
|
cr = j * col + i; |
|
if( ent.cr == cr ) { |
|
PRINTEXPR(vl, (pointer)ent.body); PUTS(" "); |
|
GetNextIent(&Im, &ent, &c); |
|
} else { |
|
PUTS("0 "); |
|
} |
|
} |
|
PUTS(")"); |
|
if ( j < row - 1 ) PUTS("\n"); |
|
} |
|
} |
|
#endif |
|
/* IMAT */ |
|
|
void PRINTLIST(vl,list) |
void PRINTLIST(vl,list) |
VL vl; |
VL vl; |