=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/pexpr.c,v retrieving revision 1.3 retrieving revision 1.7 diff -u -p -r1.3 -r1.7 --- OpenXM_contrib2/asir2000/io/pexpr.c 2000/08/21 08:31:38 1.3 +++ OpenXM_contrib2/asir2000/io/pexpr.c 2000/12/15 05:30:08 1.7 @@ -23,7 +23,7 @@ * shall be made on your publication or presentation in any form of the * results obtained by use of the SOFTWARE. * (4) In the event that you modify the SOFTWARE, you shall notify FLL by - * e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification + * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification * for such modification or the source code of the modified part of the * SOFTWARE. * @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.2 2000/02/07 03:14:39 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/pexpr.c,v 1.6 2000/12/13 10:54:09 noro Exp $ */ #include "ca.h" #include "al.h" @@ -64,6 +64,7 @@ FILE *asir_out; char DFORMAT[BUFSIZ]; int hex_output; int fortran_output; +int double_output; #define TAIL #define PUTS(s) fputs(s,OUT) @@ -87,6 +88,7 @@ int fortran_output; #define PRINTUI printui #define PRINTGF2MAT printgf2mat #define PRINTGFMMAT printgfmmat +#define PRINTBYTEARRAY printbytearray #define PRINTERR printerr #define PRINTLF printlf #define PRINTLOP printlop @@ -125,6 +127,7 @@ extern int fortran_output; #define PRINTUI sprintui #define PRINTGF2MAT sprintgf2mat #define PRINTGFMMAT sprintgfmmat +#define PRINTBYTEARRAY sprintbytearray #define PRINTERR sprinterr #define PRINTLF sprintlf #define PRINTLOP sprintlop @@ -149,6 +152,7 @@ void PRINTDP(); void PRINTUI(); void PRINTGF2MAT(); void PRINTGFMMAT(); +void PRINTBYTEARRAY(); void PRINTERR(); void PRINTCPLX(); void PRINTLM(); @@ -179,7 +183,7 @@ P p; void printbf(a) BF a; { - sor(a->body,'g',-1,0); + sor(a->body,double_output? 'f' : 'g',-1,0); } #endif #endif @@ -245,6 +249,8 @@ Obj p; PRINTLF(vl,(F)p); break; case O_GFMMAT: PRINTGFMMAT(vl,(GFMMAT)p); break; + case O_BYTEARRAY: + PRINTBYTEARRAY(vl,(BYTEARRAY)p); break; default: break; } @@ -298,7 +304,7 @@ Num q; } break; case N_R: - TAIL PRINTF(OUT,"%g",BDY((Real)q)); + TAIL PRINTF(OUT,double_output?"%f":"%g",BDY((Real)q)); break; case N_A: PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); @@ -612,6 +618,24 @@ GFMMAT mat; } PUTS("]\n"); } +} + +void PRINTBYTEARRAY(vl,array) +VL vl; +BYTEARRAY array; +{ + int len,i; + unsigned int t; + unsigned char *b; + + len = array->len; + b = array->body; + PUTS("|"); + for ( i = 0; i < len-1; i++ ) { + TAIL PRINTF(OUT,"%02x ",(unsigned int)b[i]); + } + TAIL PRINTF(OUT,"%02x",(unsigned int)b[i]); + PUTS("|"); } void PRINTERR(vl,e)