#ident "@(#)stdio.h 1.39 95/12/04 SMI" #ident "@(#)feature_tests.h 1.7 94/12/06 SMI" #ident "@(#)va_list.h 1.6 96/01/26 SMI" typedef void *__va_list; typedef unsigned int size_t; typedef long fpos_t; typedef struct { int _cnt; unsigned char *_ptr; unsigned char *_base; unsigned char _flag; unsigned char _file; } FILE; extern FILE __iob[ 20 ]; extern FILE *_lastbuf; extern unsigned char *_bufendtab[]; extern unsigned char _sibuf[], _sobuf[]; extern int remove(const char *); extern int rename(const char *, const char *); extern FILE *tmpfile(void); extern char *tmpnam(char *); extern int fclose(FILE *); extern int fflush(FILE *); extern FILE *fopen(const char *, const char *); extern FILE *freopen(const char *, const char *, FILE *); extern void setbuf(FILE *, char *); extern int setvbuf(FILE *, char *, int, size_t); extern int fprintf(FILE *, const char *, ...); extern int fscanf(FILE *, const char *, ...); extern int printf(const char *, ...); extern int scanf(const char *, ...); extern int sprintf(char *, const char *, ...); extern int sscanf(const char *, const char *, ...); extern int vfprintf(FILE *, const char *, __va_list); extern int vprintf(const char *, __va_list); extern int vsprintf(char *, const char *, __va_list); extern int fgetc(FILE *); extern char *fgets(char *, int, FILE *); extern int fputc(int, FILE *); extern int fputs(const char *, FILE *); extern int getc(FILE *); extern int getchar(void); extern char *gets(char *); extern int putc(int, FILE *); extern int putchar(int); extern int puts(const char *); extern int ungetc(int, FILE *); extern size_t fread(void *, size_t, size_t, FILE *); extern size_t fwrite(const void *, size_t, size_t, FILE *); extern int fgetpos(FILE *, fpos_t *); extern int fseek(FILE *, long, int); extern int fsetpos(FILE *, const fpos_t *); extern long ftell(FILE *); extern void rewind(FILE *); extern void clearerr(FILE *); extern int feof(FILE *); extern int ferror(FILE *); extern void perror(const char *); extern int __filbuf(FILE *); extern int __flsbuf(int, FILE *); extern FILE *fdopen(int, const char *); extern char *ctermid(char *); extern int fileno(FILE *); extern FILE *popen(const char *, const char *); extern char *cuserid(char *); extern char *tempnam(const char *, const char *); extern int getopt(int, char *const *, const char *); extern int getsubopt(char **, char *const *, char **); extern char *optarg; extern int optind, opterr, optopt; extern int getw(FILE *); extern int putw(int, FILE *); extern int pclose(FILE *); static float xmin=0.,xmax=12.0,ymin=0.,ymax=8.55,mx0=100,my0=100; static float ax=2450.,ay=3300.; static float ax0=2450.,ay0=3300.; static float a00=1.0; static int ic = -1,jf=0; static int lport=0; static char name[80],*tempfilename=".temp.plot.file.0987654321..." ; static FILE *filename; static FILE *filestdout; static FILE *fileerrout; static int ipage; static int new_org=0; static int anycolor=0; static float ps=1.0; static int force_line=0; static float w=0.; static int iflush=0; lloutc_( x0,x2,y0,y2) float *x0,*x2,*y0,*y2; { xmin = *x0; xmax = *x2; ymin = *y0; ymax = *y2; } static int points=0; static int mxo, myo, ipeno=1; static float wmult=1.6; static int last_m=1; static int last_s=0; llout_( itype, x, y, npen) int *itype,*npen; float *x, *y; { int mx,my,ipen; if ( *npen == 999) { exx(); } if ( *itype == 2 ) { if ( anycolor == 0 ) fprintf(filename," %d setpen\n",*npen); else fprintf(filename," %d setpen\n", 0); if ( iflush ) fflush( filename ); ipeno = *npen; } if ( *itype == 3 ) { lport = *npen; return(0); } if ( *itype == 4) { ipage++; fprintf(filename,"\n S\n"); fprintf(filename,"\n showpage \n"); fprintf(filename,"\n%%%%Page:%d %d \n restore \n save \n", ipage,ipage); if ( iflush ) fflush( filename ); if ( *npen == 0) { fclose(filename); } else if ( *npen == 1) { exx(); } else if ( *npen == 2) { fclose(filename); } return(0); } if ( *itype == 5) { ipage++; new_org = 0; fprintf(filename,"\n S\n"); if ( iflush ) fflush( filename ); fprintf(filename,"\n%% NEW_ORG \n"); if ( iflush ) fflush( filename ); fprintf(filename,"\n showpage \n"); if ( iflush ) fflush( filename ); fprintf(filename,"\n%%%%Page:%d %d \n restore \n save \n", ipage,ipage); if ( iflush ) fflush( filename ); return(0); } if ( *itype == 6) { new_org = 0; fprintf(filename,"\n%% NEW_ORG \n"); return(0); } if ( ic == -1) { ic = 0; ax = ax0 - 2*mx0; ay = ay0 - 2*my0; } if (*itype == 2 ) { return(0); } if (( *x < xmin) || ( *x > xmax)) return(1); if (( *y < ymin) || ( *y > ymax)) return(1); if ( lport == 1) { mx = ax*( *x - xmin)/(xmax - xmin) + mx0; my = ay*( *y - ymin)/(ymax - ymin) + my0; } else { my = ay*( *x - xmin)/(xmax - xmin) + my0; mx = ax*(a00 - ( *y - ymin)/(ymax - ymin)) + mx0; } ipen = ( *npen > 0) ? *npen : -*npen; ipen %= 10; if ( new_org == 0 ) { new_org++; fprintf(filename,"\n%% new_org \n"); fprintf(filename," S %d %d M\n",mx,my); if ( iflush ) fflush( filename ); last_m = 1; } if ( ipen == 3 ) { last_m++; if ( last_s == 1 ) { last_s = 0; fprintf(filename," %5.1f W\n", w); fprintf(filename," %d %d M\n",mxo,myo); fprintf(filename," %d %d L\n",mxo,myo); if ( iflush ) fflush( filename ); points++; } } else { last_s = 0; if ( mx == mxo && my == myo && force_line == 0 ) { if ( points == 0 && last_m > 0 ) { points++; last_s = 1; w = ipeno*wmult*ps; } } else { if ( points > 0 ) { points = 0; w = ipeno*wmult; fprintf(filename," %5.1f W\n", w); if ( iflush ) fflush( filename ); last_s = 2; } } if ( last_m > 0 || last_s > 0 ) { fprintf(filename," S %d %d M\n",mxo,myo); } fprintf(filename," %d %d L\n",mx,my); if ( iflush ) fflush( filename ); last_m=0; } mxo = mx; myo = my; } llchpn_( ipen) int *ipen; { if ( *ipen == -100 ) anycolor ^= 1; } static char st_parm[]=" -h "; static char *pt_st_parm[2]={ " -h ", " "}; static int i_st_parm=1; void set_exx_( ii) int *ii; { i_st_parm = *ii; } set_ps_( ps0) float *ps0; { ps = *ps0; } void startline_() { force_line = 1; } void endline_() { force_line = 0; } static exx() { int ii; char cmd[80]; fprintf(filename,"\n stroke\n"); fclose(filename); sprintf(cmd,"/usr/ucb/lpr %s %s\n", pt_st_parm[ i_st_parm], tempfilename); if ((ii = system( cmd )) != 0 ) fprintf( ( & __iob [ 2 ] ), " system returned error %d \n", ii); ic = -1; } void getplotname_() { fprintf( ( & __iob [ 2 ] ), "\nWhat name do you wish the plot be called ( - don't save)?"); (void) gets(name); if ( *name && rename(tempfilename,name)) { fprintf( ( & __iob [ 2 ] ),"\n problems in saving the plot file.quitting\n"); exit(1); } } static char GH[]="GHOSTVIEW"; static char *ghost; static char writetype[]="w"; extern char *getenv(); void opentempplotfile_() { ghost = getenv( GH); if ( ghost != 0 ) { iflush = 1; if (( filename = popen( ghost , writetype)) == 0 ) { fprintf ( ( & __iob [ 2 ] )," could not open ghostview\n"); exit(3); } } else if ((filename = fopen(tempfilename,"w")) == 0 ) { fprintf( ( & __iob [ 2 ] ),"\n problems in opening temporary file.quitting.\n"); exit(1); } filestdout = ( & __iob [ 1 ] ); fileerrout = ( & __iob [ 2 ] ); fprintf( filename,"%%!\n\ %%%%Page: 1 1\n\ /setpen {\n\ %f mul setlinewidth\n\ } def\n\ /L {lineto } def\n /M { moveto } def\n /S { stroke } def\n /W { stroke setlinewidth } def\n 0.25 0.25 scale\n 1 setlinecap\n", wmult*ipeno); if ( lport == 0 ) fprintf( filename,"0 -50 translate\n"); fprintf( filename," save \n"); ipage = 1; new_org = 0; } void closetempplotfile() { fclose(filename); } #ident "acomp: SC4.0 18 Oct 1995 C 4.0"