|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T o
Length: 3406 (0xd4e) Types: TextFile Names: »open.c«
└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89 └─⟦148e64aa4⟧ »./plot2ps.tar.Z« └─⟦ff7617d1d⟧ └─⟦this⟧ »open.c«
/* plot2ps, a utility for converting Unix plot files into postscript. Copyright (C) 1989 Free Software Foundation, Inc. Plot2ps is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the GNU General Public License for full details. Everyone is granted permission to copy, modify and redistribute plot2ps, but only under the conditions described in the GNU General Public License. A copy of this license is supposed to have been given to you along with plot2ps so you can know your rights and responsibilities. It should be in a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. */ /* This file is the openpl routine, which is a standard part of the plot library. It normally opens the device. We just print out the postscript prologue */ #include <math.h> #include <stdio.h> #ifdef sequent #include <strings.h> #else #include <string.h> #endif #include "plot3.h" extern int perror(); extern int exit(); extern int printf(); extern int fprintf(); extern int fclose(); extern int fread(); extern int fwrite(); #ifndef mips extern char *sprintf(); #endif extern int fputs(), fputc(); #ifndef hpux extern void *malloc(); extern void *realloc(); #endif extern char *header[6]; /* USER_HAS_PROLOGUE is a flag. If it is non-zero then the open routine should output the user specified prologue contained in the file specified in the string USERS_PROLOGUE */ int user_has_prologue = 0; /* USERS_PROLOGUE is a string containing the file name for any user specified postscript prologue. This file is a substitute for the prologue contained in the file header.c. */ char *users_prologue = ""; int openpl () { int i; line_type_setdash_length = 1024; line_type_setdash = (char *) malloc (line_type_setdash_length); if (line_type_setdash <= (char *) 0) { perror ("malloc failed:"); exit (-1); } fputs ("\ %!PS-Adobe-2.0 EPSF-1.2\n\ %%\n\ %%\n\ %% TYPE `plot2ps -help' FOR MORE INFORMATION.\n\ %%\n\ %%\n\ %%DocumentFonts: Times-Bold\n\ %%BoundingBox: \ ", stdout); printf ("%d %d %d %d", (int) x_output_min, (int) y_output_min, (int) x_output_max, (int) y_output_max); if (user_has_prologue) { FILE *prologuep; char buff[1024]; int bytes_read; prologuep = fopen (users_prologue, "r"); if (prologuep == NULL) { fprintf (stderr, "Unable to open prologue file `%s' for reading. Using builtin prologue.\n", users_prologue); for (i=0; header[i][0]>0; i++) fputs (header[i], stdout); } else { while ( (bytes_read = fread(buff, 1, sizeof(buff), prologuep)) > 0 ) { fwrite (buff, 1, bytes_read, stdout); } fclose (prologuep); } } else { for (i=0; header[i][0]>0; i++) fputs (header[i], stdout); } fputs ("\n\ %I Idraw 4\n\ \n\ Begin\n\ %I b u\n\ %I cfg u\n\ %I cbg u\n\ %I f u\n\ %I p u\n\ %I t\n[ ", stdout); printf ("%f 0 0 %f", .8, .8); fputs (" 0 0 ] concat\n\ /originalCTM matrix currentmatrix def\n\ %\n\ %\n\ %\n\ % TYPE `plot2ps -help' FOR MORE INFORMATION.\n\ %\n\ %\n\ \n", stdout); return 0; }