plotutils-2.6/0000777000175000017500000000000011257257512010434 500000000000000plotutils-2.6/README0000644000175000017500000004574111257257500011240 00000000000000This is release 2.6 of the GNU plotutils (plotting utilities) package, including release 4.4 of GNU libplot: a thread-safe function library for exporting two-dimensional vector graphics files, and for displaying animated vector graphics under the X Window System. The Web page for the package is http://www.gnu.org/software/plotutils/plotutils.html . In the top-level source directory, the file INSTALL contains generic instructions for installing a GNU package, and the file INSTALL.pkg contains package-specific instructions. Please read them _in full_, as well as this file, before attempting to install the package. Also in the top-level source directory, the file COMPAT contains release notes, and comments on compatibility with previous versions. The file PROBLEMS is worth looking at too. Please send bug reports to , and suggestions for longer-range improvements to both and the principal author and current maintainer, Robert Maier . NOTE: Neither the `pic2plot' program nor the `libplotter' C++ class library is built by default, since they require a working C++ compiler. But it is easy to request that they be built. For details, see INSTALL.pkg. Also, a standalone version of the `libxmi' scan-conversion library isn't built by default, since `libxmi' is distributed as a separate package. ---------------------------------------------------------------------- The contents of the plotutils package are: 1. libplot. This is the function library for device-independent two-dimensional vector graphics that the sample command-line programs `graph', `plot', `pic2plot', `tek2plot', and `plotfont' (see below) are based on. On platforms that support shared libraries, it is installed as a shared library. If you are a programmer, you may use this library yourself, to export vector graphics in many different file formats. You may also use it to create vector graphics animations under the X Window System. There are two versions of libplot: a conventional library of C functions, which is also referred to as libplot, and its C++ counterpart `libplotter', which is a class library. The latter is more convenient to use if you are programming in C++. You must request at installation time that `libplotter' be built and installed, since it is not done automatically. (See ./INSTALL.pkg.) When we refer to `libplot', by default we mean both the C and the C++ versions. libplot includes functions to draw objects of many types: lines and polylines, circles and ellipses, circular and elliptic arcs, quadratic and cubic Bezier curves, and marker symbols. Postscript-style `paths', made up of many segments, may be drawn. There is support for color (both pen color and fill color for objects). Output formats include X11, PNG, PNM (i.e. PBM/PGM/PPM), pseudo-GIF, SVG, Adobe Illustrator, Postscript and Encapsulated Postscript (editable with the idraw drawing editor), CGM (by default, binary version-3 CGM output that complies with the WebCGM profile for Web-based vector graphics), Fig (editable with the xfig drawing editor), PCL 5, HP-GL and HP-GL/2, Regis, Tektronix, and GNU metafile format. GNU metafile format may be translated into any of the other formats with the `plot' utility (see below). NOTE: pseudo-GIF format is not the same as GIF format, since it does not use the LZW coding scheme. So it does not transgress the well known Unisys LZW patent. However, applications that can read GIF files should be able to read pseudo-GIF files. libplot can also create animated pseudo-GIFs. libplot includes extensive support for accurate sizing and positioning of text. This includes the placement of subscripts and superscripts. Its X11, SVG, Illustrator, Postscript, CGM, and Fig drivers all support the 35 standard Postscript fonts, and its PCL 5 and HP-GL/2 drivers support the 45 standard LaserJet fonts. In addition, all of these, together with the other (bitmap) drivers, support a set of 22 Hershey vector fonts. The Hershey fonts include HersheyCyrillic and HersheyEUC (for Japanese). Note that the Hershey fonts are not anti-aliased, so they will look much better in vector output, than in bitmap output. All supported fonts may be arbitrarily rotated and scaled. All fonts, except for symbol and dingbat fonts, and the Hershey Cyrillic and Japanese fonts, use the ISO-Latin-1 encoding (a superset of ASCII; the ISO-Latin-1 support in the 20 non-Cyrillic, non-Japanese Hershey fonts is extensive but not quite complete). (Clones of the 35 standard Postscript fonts, in Type 1 format, have been contributed by URW GmbH for distribution under the GNU General Public License. They may well be available on your system, already. If not, you may use the versions distributed with this package. Installation instructions are in the file ./INSTALL.fonts. Instructions for obtaining and installing Type 1 versions of the 45 standard LaserJet fonts are included as well.) Similarly to Postscript, libplot has the nice feature that user coordinates (in terms of which you express the location of graphical objects) may be transformed to device coordinates by an arbitrary affine transformation. A stack of drawing states (i.e., graphics contexts) is supported too. 2. libxmi. This is a function library for drawing X11-style vector graphics (lines, polylines, polygons, circular and elliptic arcs) on an in-memory bitmap. It is small, but powerful: it contains a modernized version of the scan conversion code contained in most X11 servers, which was written in the mid-to-late 1980's by programmers associated with the X Consortium. It is built and installed only if you specify the `--enable-libxmi' option to ./configure. The public header file for libxmi, xmi.h, will also be installed, as will the documentation (in texinfo format). The reason `libxmi' isn't built by default is that it's also distributed as a separate package. Actually, what isn't built by default is a standalone version of libxmi. libplot/libplotter always contains an internal libxmi module, which helps it produce output in bitmap formats. 3. Sample command-line programs based on libplot, including the following. graph. A full-featured scientific plotting program for plotting XY (i.e. 2-dimensional) data. It plots a stream of datapoints, in real time if possible. There is a well-chosen set of command-line options for adjusting the visual appearance of the plot, labelling axes (with expressions that may include subscripts and superscripts, and mathematical symbols), choosing marker symbols from various fonts, etc. Multiplotting is supported (a plot may include sub-plots, side-by-side or inset). Filled regions are also supported. Unlike the well-known plotting program `gnuplot', `graph' is device-independent in the sense that its options do not depend on the display device the plot is destined for. To the maximum degree feasible, the output of `graph' will appear the same on all display devices. Which display device is driven, or output format is produced, is specified by the `-T' option. There are effectively many different variants of `graph', distinguished by the intended display device. graph -T X A variant that pops up an X window on an X display, and draws the plot in it. It is most useful on modern (X11R6) displays, which can rotate and scale text arbitrarily. It uses the 35 standard Postscript fonts. graph -T png A variant that produces output in PNG (Portable Network Graphics) format. Output in this format can be viewed with the free image display application `xv'. graph -T pnm A variant that produces output in `Portable Anymap' format (PBM/PGM/PPM, whichever is appropriate). Output in this format can be viewed with `xv', or translated to other formats with the `netpbm' package. graph -T gif A variant that produces output in a pseudo-GIF format that can be displayed by many applications that understand GIF format. The pseudo-GIF format uses run-length encoding, so it does not transgress the well known Unisys LZW patent. graph -T svg A variant that produces output in SVG (scalable vector graphics) format. SVG is the XML-based graphics format that has been endorsed by the W3 Consortium for Web use. See http://www.w3.org/Graphics . For comments on compatibility with other software that can edit or display SVG files, see the file ./COMPAT. graph -T ai A variant that produces output in a format that can be viewed or edited with Adobe Illustrator. graph -T ps A variant that produces EPS (encapsulated Postscript) output, which can be printed, displayed, or encapsulated in other documents. Any standard page size is supported (letter, legal, ANSI sizes, ISO sizes such as a4 and a3, etc.) The EPS output includes annotations that permit it to be edited with the freeware `idraw' drawing editor, or its successor `drawtool'. See http://www.vectaport.com . graph -T cgm A variant that produces CGM vector graphics files (Computer Graphics Metafiles, as defined by ISO 8632:1992). By default, its output files are binary version-3 CGM files that conform to the WebCGM profile for Web-based vector graphics (for WebCGM info, see http://www.cgmopen.org/ ). graph -T fig A variant that produces a plot that the freeware `xfig' drawing editor can edit. xfig can export the plot in numerous formats, such as GIF, X11 bitmap, and EPS. See http://duke.usask.ca/~macphed/soft/fig . graph -T pcl A variant that produces a plot in PCL 5 format, which is a sophisticated version of Hewlett-Packard's Printer Control Language. You may send the plot to a non-Postscript LaserJet or a high-end inkjet. (Most inkjets do not support PCL 5.) This variant supports the 45 standard PCL 5 fonts that are built into many non-Postscript printers, such as LaserJets. graph -T hpgl A variant that produces HP-GL (or by default, HP-GL/2) output. HP-GL is the Hewlett-Packard Graphics Language, and may be printed out or plotted on a Hewlett-Packard LaserJet printer or plotter. Also many applications, e.g. CAD applications, can import HP-GL or HP-GL/2 figures. This variant supports the 45 standard PCL 5 fonts that are built into many non-Postscript printers, such as LaserJets. graph -T regis A variant that produces ReGIS graphics output, suitable for viewing on a DECwindows dxterm or a DEC graphics terminal, such as a VT340, VT330, VT241, or VT240. (This variant lacks the Postscript fonts of the other variants though, like them, it has a complete set of vector Hershey fonts.) graph -T tek A variant that produces Tektronix output, suitable for viewing, e.g., on an X Windows xterm or an MS-DOS kermit doing Tektronix emulation. (This variant lacks the Postscript fonts of the other variants though, like them, it has a complete set of vector Hershey fonts. Also, it does not support filling of regions.) graph The `raw' variant, which produces output in GNU graphics metafile format. This is an enhanced version of the traditional plot(5) format found on some operating systems. The `plot' program (see below) must be used to convert this to another format, or to drive a display device. Of these variants, `graph -T X', `graph -T tek', and raw `graph' are real-time. That means that under some circumstances, they act as filters: they read data points from standard input, and plot them as they are read. For this to happen, the abscissa and ordinate ranges of the plot must be specified on the command line. (E.g., the user would do program | graph -T X -x xmin xmax -y ymin ymax where `program' generates a stream of data points.) All variants of `graph' will accept ASCII input (the default), or unformatted binary input (i.e., a stream of floating point numbers or integers), or input in the `table' format produced by the program `gnuplot' (which you may select by specifying the `-I g' option). Gnuplot will produce table-format output if you do `set terminal table'; you can pipe gnuplot's output to any of the variants of graph by using the gnuplot `set output' command. If you are piping to `graph -T X', by repeatedly using the gnuplot `set output' command you may easily produce an arbitrarily large number of plots in different X windows, each in a different style. plot. This is a so-called plot filter, which takes a stream in GNU graphics metafile format, and either translates it to another format or uses it to drive a display device. Since this distribution includes `graph -T X', `graph -T png', `graph -T pnm', `graph -T gif', `graph -T svg', `graph -T ai', `graph -T ps', `graph -T cgm', `graph -T fig', `graph -T pcl', `graph -T hpgl', `graph -T regis', and `graph -T tek', all of which can drive display devices directly, `plot' is only occasionally useful. It may be used, though, to produce graphical output in more than one format at once. To do this, you would pipe the output of a datapoint-generating program to the raw variant of `graph', and then use the `tee' command to direct the output of raw `graph', which is in metafile format, to two separate invocations of `plot'. `plot' may also be useful as a post-processor for older programs that produce output in the traditional plot(5) graphics format. GNU metafile format is an enhanced version of plot(5) format. pic2plot. This is a utility program that takes a file in the pic language, and either translates it to another format or displays it on an X display. The pic language, which was developed at Bell Laboratories, is used for creating box-and-arrow diagrams of the kind frequently found in technical papers and textbooks. It was originally introduced as a feature of the Bell Labs `troff' text-processing software. You must request at installation time that pic2plot be built and installed, since it is not done automatically. (See ./INSTALL.pkg.) pic2plot is largely compatible with `gpic', the GNU implementation of the pic-to-troff translator. However, since it is built on top of libplot, it supports some new features. It supports all the output formats that libplot supports: X11, PNG, PNM, GIF, SVG, AI, PS, WebCGM, Fig, PCL, HP-GL, Tek, and Metafile. tek2plot. This is a utility program that emulates a Tektronix 4014 terminal in the sense that it reads a stream of Tektronix commands, and either produces an output file in another format or displays the corresponding graphics on an X display. An output file in any of the graphics file formats that libplot support can be produced. tek2plot is useful if you have a legacy program that was designed to drive a Tektronix terminal or emulator, or if you have files in Tektronix format that need to be translated to a modern format, or edited. The directory ./tek2plot/teksamples includes a few files in Tektronix format that you may experiment with. You may also experiment by piping the output of `gnuplot', if you have configured it to produce Tektronix-format plots, to these filters (the gnuplot terminal types `kc_tek40xx', `km_tek40xx', `tek40xx', and `vttek' all work). tek2plot does an excellent job of emulating the non-interactive features of a Tektronix 4014, and although it does not support all the features supported by the Tektronix emulator in the MS-DOS version of kermit, it can certainly parse the output of the gnuplot Tektronix terminal drivers. plotfont. This is a simple utility that prints out a character chart for any font available to the above four utilities (graph, plot, pic2plot, tek2plot) and the underlying libplot library. All output formats are supported. Which fonts are available depends on the `-T' option that is specified, i.e., on the output format. hersheydemo. This is a demo program for the Hershey vector fonts, as implemented in the libplot library. It outputs a demo page, designed by Dr. Hershey himself. The page is taken from his 1972 article "A computer system for scientific typography", published in Computer Graphics and Image Processing (vol. 1, no. 4, pp. 373-385). Note that the Hershey vector fonts look much better in vector output formats, than they do in bitmap formats. That is because libplot does not currently do anti-aliasing of fonts (or more accurately the libxmi rasterization library, which it relies on, does not). You would do `hersheydemo -T ps > demo.ps' to produce PS output, `hersheydemo -T svg > demo.svg' to produce SVG output, etc. 4. Command-line mathematical programs not based on libplot, including the following. spline. This program does spline interpolation of input data, which may be of arbitrary dimensionality. That is, it takes a file of datapoints, and interpolates between them to produce an interpolated segment of the input data. It acts as a filter, though usually not as a real-time one (in the most common mode of operation, the entire input must be read before any data points are output). The output spline is normally a cubic spline, but if a `tension' parameter is set to a nonzero value, the output spline will be a so-called spline under tension. There is also support for doing cubic Bessel interpolation. If this option is selected, `spline' acts as a true real-time filter, since cubic Bessel interpolation is local rather than global. ode. This interactive program supplements the computation engine of `gnuplot', which will compute and plot functions, by providing the ability to integrate systems of ordinary differential equations (ODE's). ode will solve the initial value problem for one or more first-order ODE's, when provided with an explicit expression for each equation. ode parses the set of equations and the set of initial conditions, which may be typed in manually or read from a file, and then produces a stream of data points that may be piped to any of the variants of `graph'. If a real-time variant of `graph' (e.g. `graph -T X' or `graph -T tek') is used, the numerical solution will be displayed in real time, as it is generated. One application (certainly not the only one!) of ode is to graph the indefinite integrals of the sorts of function that gnuplot can graph. All the primitive real-valued functions that are built into gnuplot are built into ode. A directory of sample ode input files is installed (usually as /usr/local/share/ode or /usr/share/ode) as part of the package. double. This is a filter for converting, scaling and cutting unformatted (binary) or ASCII data streams. It is still under development and is not yet documented. plotutils-2.6/configure.ac0000644000175000017500000003661411234210001012621 00000000000000# Configure template for the GNU plotutils package. # Copyright (C) 1989-2009 Free Software Foundation, Inc. # Process this file with autoconf to produce a configure script. AC_INIT([GNU plotutils],[2.6],[bug-plotutils@gnu.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR(graph/graph.c) AM_INIT_AUTOMAKE([plotutils],[2.6]) AM_CONFIG_HEADER(config.h:config.hin) # The following will be defined in config.h, if appropriate. # Miscellaneous. AH_TEMPLATE([HAVE_NULL_FLUSH], [Define to 1 if in your libc, fflush(NULL) flushes all outstreams.]) AH_TEMPLATE([_HPUX_SOURCE], [Define to 1 under HP/UX to get matherr-related things from math.h.]) # Threading-related. AH_TEMPLATE([PTHREAD_SUPPORT], [Define to 1 if your libc includes support for pthreads.]) # X11-related. AH_TEMPLATE([USE_MOTIF], [Define to request that Motif should be used, if X11 is used.]) AH_TEMPLATE([X_THREAD_SUPPORT], [Define to signal support in libXt/libX11 for multithreading.]) AH_TEMPLATE([HAVE_DBE_SUPPORT], [Define if -lXext has support for the DBE X11 protocol extension.]) AH_TEMPLATE([HAVE_MBX_SUPPORT], [Define if -lXext has support for the MBX X11 protocol extension.]) # PNG-related. AH_TEMPLATE([HAVE_LIBPNG], [Define if libpng is available.]) AH_TEMPLATE([INCLUDE_PNG_SUPPORT], [Define to request PNG support (requires HAVE_LIBPNG, HAVE_PNG_H).]) # Fonts supported by Plotters of various types. AH_TEMPLATE([USE_LJ_FONTS_IN_X], [Define to enable support for the 45 LaserJet fonts in X output.]) AH_TEMPLATE([USE_LJ_FONTS_IN_PS], [Define to enable support for the 45 LaserJet fonts in PS output.]) AH_TEMPLATE([USE_PS_FONTS_IN_PCL], [Define to enable support for the 35 PS fonts in PCL output.]) # Did installer set the CFLAGS and CXXFLAGS environ variables before # running configure? Our default CFLAGS and CXXFLAGS differ from # autoconf's, but we won't override installer-specified values. if test "x$CFLAGS" = "x"; then CFLAGS_NOT_SET_BY_INSTALLER="yes" else CFLAGS_NOT_SET_BY_INSTALLER="no" fi if test "x$CXXFLAGS" = "x"; then CXXFLAGS_NOT_SET_BY_INSTALLER="yes" else CXXFLAGS_NOT_SET_BY_INSTALLER="no" fi # We now use libtool to make and installed a shared library. This should # invoke the tests AC_PROG_CC, AC_OBJEXT, AC_PROG_INSTALL, and # AC_PROG_MAKE_SET, or equivalents, so we don't perform them explicitly. # Note: this can apparently alter CFLAGS, on a few platforms, e.g., on # SCO OpenServer 5 (i.e. *-*-sco3.2v5*), "-belf" is added. AC_PROG_LIBTOOL # Determine extension (e.g. ".exe") on executables, if any. AC_EXEEXT # Compiler characteristics and typedefs. AC_C_CONST AC_TYPE_SIZE_T AC_TYPE_PID_T AC_TYPE_SIGNAL # Check whether fflush(NULL) works AC_MSG_CHECKING(whether flushing a null FILE pointer works) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { FILE *fpw, *fpr; char test_array[7]; if ((fpw = fopen ("conftest0", "w")) == (FILE *)0 || fwrite ("FOOBAR", 1, 7, fpw) != 7 || fflush ((FILE *)0) < 0 || (fpr = fopen ("conftest0", "r")) == (FILE *)0 || fread (test_array, 1, 7, fpr) != 7) exit (1); else exit(0); }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_NULL_FLUSH)],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)]) # Checks for header files: ANSI C, POSIX, and nonstandard Unix headers. AC_HEADER_STDC AC_CHECK_HEADERS(string.h limits.h float.h) AC_CHECK_HEADERS(malloc.h pthread.h strings.h unistd.h values.h sys/select.h sys/stdtypes.h sys/time.h sys/types.h sys/wait.h) AC_HEADER_TIME # HP/UX needs a cpp definition for math.h to define matherr-related things AC_EGREP_HEADER(_HPUX_SOURCE, math.h, [AC_EGREP_HEADER(matherr, math.h, [AC_DEFINE(_HPUX_SOURCE)])]) # Sui generis. AC_FUNC_ALLOCA # Checks for programs. Automake needs AM_PROG_LEX, not AC_PROG_LEX; # ignore the bogus warning about AC_PROG_LEX being invoked twice. AC_PROG_YACC AM_PROG_LEX # Should libplot/libplotter support multithreading via pthread mutexes? # Check to see whether libc includes dummy ("weak") pthread functions, so # that executables may be linked with a library that uses mutexes without # also linking with -lpthread. (This is the case with glibc under # Linux.) AC_CHECK_LIB(c, pthread_mutex_init, [AC_DEFINE(PTHREAD_SUPPORT)]) # Do we have the thread-safe library functions ctime_r(), localtime_r()? AC_CHECK_FUNCS(ctime_r localtime_r) # Do we have the POSIX waitpid() function? AC_CHECK_FUNCS(waitpid) # Other non-X library functions and auxiliary libraries. # # SGI's have matherr in libmx.a, not libm.a AC_CHECK_LIB(mx, matherr, LIBS="$LIBS -lmx", LIBS="$LIBS -lm") AC_CHECK_FUNCS(memcpy memmove strchr strcasecmp strerror matherr j0 erf) # lgamma() and gamma() both compute the log of the gamma function. There # are old systems out there which do not have lgamma (the name was # introduced after BSD 4.2), but which do have gamma. Also some systems, # new and old, have lgamma but not gamma. AC_CHECK_FUNCS(lgamma gamma) # Prepare to support X. If the user gave the command-line option # --without-x, AC_PATH_XTRA will set no_x to "yes". Otherwise, it will # add appropriate preprocessor flags to X_CFLAGS, and appropriate linker # flags to X_LIBS. It also checks for system-specific X libraries, and # adds them to X_PRE_LIBS or X_EXTRA_LIBS, as appropriate. (The former # is where "-lSM -lICE" goes, in X11R6.) We define the X_TOOLKIT_LIBS # and X_BASIC_LIBS argument vectors ourselves, and if X is to be # supported, we'll concatenate the whole lot of these into a command line # for libtool. See, e.g., the libplot_la_LIBADD line in # libplot/Makefile.am. AC_PATH_XTRA AC_SUBST(X_CFLAGS) # Following five are concatenated together into a linker specification. AC_SUBST(X_LIBS) AC_SUBST(X_TOOLKIT_LIBS) AC_SUBST(X_PRE_LIBS) AC_SUBST(X_BASIC_LIBS) AC_SUBST(X_EXTRA_LIBS) X_TOOLKIT_LIBS="-lXt" X_BASIC_LIBS="-lXext -lX11" # Check whether libXt has thread support. Some platforms may have # pthread support in libc, but no thread support in libXt/libX11. our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" AC_CHECK_LIB(Xt, XtToolkitThreadInitialize, [AC_DEFINE(X_THREAD_SUPPORT)],[],$X_PRE_LIBS $X_BASIC_LIBS $X_EXTRA_LIBS) LDFLAGS="$our_saved_LDFLAGS" # Check in -lXext for double buffering extensions to X11, and check # also whether appropriate header files are present. (Some systems have one # but not the other.) our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE(HAVE_DBE_SUPPORT)], [], -lX11 "$X_EXTRA_LIBS") AC_CHECK_LIB(Xext, XmbufQueryExtension, [AC_DEFINE(HAVE_MBX_SUPPORT)], [], -lX11 "$X_EXTRA_LIBS") LDFLAGS="$our_saved_LDFLAGS" our_saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" AC_CHECK_HEADERS([X11/Xlib.h]) AC_CHECK_HEADERS([X11/extensions/Xdbe.h], [], [], [#if HAVE_X11_XLIB_H # include # endif ]) AC_CHECK_HEADERS([X11/extensions/multibuf.h], [], [], [#if HAVE_X11_XLIB_H # include # endif ]) CPPFLAGS="$our_saved_CPPFLAGS" # Allow installer to specify location of Athena widgets (i.e. location of # libraries lib/libXaw.so and lib/libXmu.so, and header files). If the # argument of --with-athena is a directory DIR, we'll add an `-L DIR/lib' # option to the head of X_LIBS and an `-I DIR/include' option to the head # of X_CFLAGS. AC_ARG_WITH(athena, [ --with-athena[=DIR] use Athena widgets: includes and libraries in DIR]) # If --with-motif is specified, then `-lXm' will be added to the head of # X_TOOLKIT_LIBS, instead of `-lXaw -lXmu', and --with-athena will be # ignored. We allow the installer to specify DIR, the location of Motif. # If the argument of --with-motif is a directory, an `-L DIR/lib' option # will be added to the head of X_LIBS and an `-I DIR/include' option to # the head of C_FLAGS. AC_ARG_WITH(motif, [ --with-motif[=DIR] use Motif widgets: includes and libraries in DIR]) # If --with-motif is specified, we always check for the Xpm image # library, and if we find it, then we place it at the beginning of # X_BASIC_LIBS, since Motif 2.x requires it (it may be included in -lXm # already, though). We also allow the installer to specify a location # for Xpm. If DIR is specified as an argument to --with-xpm, DIR/include # should contain xpm.h, and DIR/lib should contain the library libxpm. AC_ARG_WITH(xpm, [ --with-xpm[=DIR] use Xpm with Motif: include and library in DIR]) # NOTE: Motif 2.x also seems to require the extension library -lXp for # printing, so if --with-motif is specified we always check for libXp. # If we find it, we'll place `-lXp' before `-lXext -lX11' in # X_BASIC_LIBS. Also, Motif on Sys-V derived systems requires `-lPW'. # If we find libPW, we'll add `-lPW' to LIBS, but precede it by -lc # because some of its definitions may conflict with the standard library. # Similarly we always check for libgen, which some versions of Motif on # Solaris need. # NOTE: For each `with' option, there are four possible values for the # associated shell variable, all of which we must handle: # # 1. "" (if neither `--with-foo' nor `--without-foo' was specified) # 2. "no" (obtained if `--without-foo' was specified) # 3. "yes" (obtained if `--with-foo' was specified, without an argument) # 4. DIR (obtained if `--with-foo DIR' was specified) case "x$with_motif" in xno|x) case "x$with_athena" in xyes|x) X_TOOLKIT_LIBS="-lXaw -lXmu $X_TOOLKIT_LIBS" ;; xno) ;; *) X_TOOLKIT_LIBS="-lXaw -lXmu $X_TOOLKIT_LIBS" X_CFLAGS="$X_CFLAGS -I$with_athena/include" X_LIBS="$X_LIBS -L$with_athena/lib" ;; esac ;; *) if test "x$with_motif" != "xyes"; then X_CFLAGS="$X_CFLAGS -I$with_motif/include" X_LIBS="$X_LIBS -L$with_motif/lib" fi X_TOOLKIT_LIBS="-lXm $X_TOOLKIT_LIBS" our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" case "x$with_xpm" in xno|x) AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, X_BASIC_LIBS="-lXpm $X_BASIC_LIBS", , -lXext -lX11) ;; xyes) AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, X_BASIC_LIBS="-lXpm $X_BASIC_LIBS", , -lXext -lX11) ;; *) LDFLAGS="$LDFLAGS -L$with_xpm/lib" AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, X_CFLAGS="$X_CFLAGS -I$with_xpm/include"; X_LIBS="$X_LIBS -L$with_xpm/lib"; X_BASIC_LIBS="-lXpm $X_BASIC_LIBS", , -lXext -lX11) ;; esac LDFLAGS="$our_saved_LDFLAGS" our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" AC_CHECK_LIB(Xp, XpQueryExtension, X_BASIC_LIBS="-lXp $X_BASIC_LIBS", , -lXext -lX11) AC_CHECK_LIB(gen, regex, LIBS="$LIBS -lc -lgen", LIBS="$LIBS") AC_CHECK_LIB(PW, regex, LIBS="$LIBS -lc -lPW", LIBS="$LIBS") LDFLAGS="$our_saved_LDFLAGS" AC_DEFINE(USE_MOTIF) ;; esac # The libplot/libplotter Makefile.am files test the automake variable # NO_X to determine whether X should be supported. AM_CONDITIONAL(NO_X, test "x$no_x" = "xyes") # Check for libpng and png.h, and if both are available, define the # config.h variable INCLUDE_PNG_SUPPORT; otherwise define the automake # variable NO_PNG. The latter is used in libplot/Makefile.am and # libplotter/Makefile.am. # NOTE: the test for libpng checks for the function png_set_tRNS(), # because it was added to libpng in version 0.95, which is the minimum # version that we can use. # ALSO NOTE: the test for libpng automatically checks for zlib, since it # supplies the `-lz' argument to the linker. AC_CHECK_HEADERS(png.h, png_support="yes", png_support="no") AC_CHECK_LIB(png, png_set_tRNS, [AC_DEFINE(HAVE_LIBPNG)], png_support="no", -lz -lm) AC_ARG_WITH(libpng, [ --without-libpng omit PNG support even if libpng and zlib are present], if test "x${with_libpng}" = "xno"; then png_support="no"; fi) if test "x${png_support}" = "xyes"; then AC_DEFINE(INCLUDE_PNG_SUPPORT) fi AM_CONDITIONAL(NO_PNG, test "x${png_support}" = "xno") # Font options. The ps_fonts_in_pcl variable is used by test/plot2hpgl.test. AC_ARG_ENABLE(ps-fonts-in-pcl, [ --enable-ps-fonts-in-pcl enable use of PS fonts in PCL and HP-GL/2 output], [if test "x$enableval" = "xyes"; then echo enabling support for the 35 PS fonts in PCL 5 and HP-GL/2 output ps_fonts_in_pcl=1 AC_DEFINE(USE_PS_FONTS_IN_PCL) else ps_fonts_in_pcl=0 fi], ps_fonts_in_pcl=0) AC_SUBST(ps_fonts_in_pcl) AC_ARG_ENABLE(lj-fonts-in-ps, [ --enable-lj-fonts-in-ps enable use of LaserJet fonts in PS output], [if test "x$enableval" = "xyes"; then echo enabling support for the 45 LaserJet fonts in PS output AC_DEFINE(USE_LJ_FONTS_IN_PS) fi]) AC_ARG_ENABLE(lj-fonts-in-x, [ --enable-lj-fonts-in-x enable use of LaserJet fonts on X displays], [if test "x$enableval" = "xyes"; then echo enabling support for the 45 LaserJet fonts on X displays AC_DEFINE(USE_LJ_FONTS_IN_X) fi]) # Do we build libplotter, the C++ library, and other C++ software? AC_ARG_ENABLE(libplotter, [ --enable-libplotter build the C++ Plotter class library and C++ software], echo enabling construction of the C++ class library; no_libplotter="no", no_libplotter="yes"; extralib="") AM_CONDITIONAL(NO_LIBPLOTTER, test "x$no_libplotter" = "xyes") # Do we build and install a standalone version of the libxmi # scan-conversion library? (Not done by default because it's separately # distributed.) AC_ARG_ENABLE(libxmi, [ --enable-libxmi build the libxmi scan-conversion library], echo enabling construction of the libxmi scan-conversion library; no_libxmi="no", no_libxmi="yes") AM_CONDITIONAL(NO_LIBXMI, test "x$no_libxmi" = "xyes") # Override default autoconf value "-g -O2" or "-g" for CFLAGS and # CXXFLAGS, set by AC_PROG_CC and AC_PROG_CXX. Provided, that is, # installer didn't set CFLAGS via an environment variable before running # configure. We don't use "-g" when compiling libplot or libplotter, # since debugging versions of those libraries would be huge. Perhaps we # should use it when compiling the executables, though? # Note: on a very few platforms where libtool adds a command-line option # to CFLAGS (see above; this includes SCO OpenServer 5, where "-belf" is # added), this way of doing things will not work, i.e., the installer # will need to add by hand the option that libtool would have added. # E.g., on SCO OpenServer5 the installer may need to set the environment # variable CFLAGS to "-O -belf" or "-O2 -belf". if test "x$CFLAGS_NOT_SET_BY_INSTALLER" = "xyes"; then if test "x$GCC" = "xyes"; then CFLAGS="-O2" else CFLAGS="-O" fi fi if test "x$CXXFLAGS_NOT_SET_BY_INSTALLER" = "xyes"; then if test "x$GXX" = "xyes"; then CXXFLAGS="-O2" else CXXFLAGS="-O" fi fi # Check for gcc strength-reduce bug (taken from WINE config). Could do # the same for g++, but we'll assume anyone doing any C++ compiling has # installed a modern compiler. if test "x${GCC}" = "xyes"; then AC_CACHE_CHECK(for gcc strength-reduce bug, ac_cv_c_gcc_strength_bug, AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main() { static int Array[[3]]; unsigned int B = 3; int i; for (i=0; i < B; i++) Array[[i]] = i - 3; exit (Array[[1]] != -2); }]])], [ac_cv_c_gcc_strength_bug="no"],[ac_cv_c_gcc_strength_bug="yes"],[ac_cv_c_gcc_strength_bug="yes"]) ) if test "$ac_cv_c_gcc_strength_bug" = "yes" then CFLAGS="$CFLAGS -fno-strength-reduce" fi fi AC_CONFIG_FILES([Makefile double/Makefile graph/Makefile hersheydemo/Makefile pic2plot/Makefile pic2plot/doc/Makefile pic2plot/libgroff/Makefile pic2plot/include/Makefile info/Makefile lib/Makefile libplot/Makefile libplotter/Makefile libxmi/Makefile libxmi/info/Makefile plot/Makefile tek2plot/Makefile tek2plot/teksamples/Makefile plotfont/Makefile spline/Makefile ode/Makefile ode-examples/Makefile include/Makefile doc/Makefile fonts/Makefile fonts/bdf/Makefile fonts/pcf/Makefile fonts/pfb/Makefile test/Makefile]) AC_OUTPUT plotutils-2.6/aclocal.m40000644000175000017500000100021411234210063012167 00000000000000# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_if(m4_PACKAGE_VERSION, [2.61],, [m4_fatal([this file was generated for autoconf 2.61. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) _LT_AC_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi _LT_AC_TAGVAR(link_all_deplibs, $1)=no else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR plotutils-2.6/Makefile.am0000644000175000017500000000343411234207771012405 00000000000000## Makefile.am for plotutils. ## Process this file with automake to produce Makefile.in in all directories. # plot, tek2plot, plotfont, graph, and hersheydemo are linked with libplot. # spline, double, and ode are not, however. All use the routines in lib. # # pic2plot is written in C++ but is currently linked with libplot, not # libplotter. (It could easily be modified to use libplotter rather than # libplot.) We build it only if --enable-libplotter is specified, though; # which is a bit contradictory. # Since the libxmi 2D rasterization library is distributed as a separate # package, by default we don't build and install it as a standalone # library. (It's always compiled into libplot and libplotter, though.) if NO_LIBPLOTTER ADD_LIBPLOTTER = else ADD_LIBPLOTTER = pic2plot libplotter endif if NO_LIBXMI ADD_LIBXMI = else ADD_LIBXMI = libxmi endif SUBDIRS = lib spline double ode ode-examples libplot $(ADD_LIBXMI) plot tek2plot plotfont graph hersheydemo $(ADD_LIBPLOTTER) include info doc fonts test # files with nonstandard names in this directory EXTRA_DIST = COMPAT INSTALL.pkg INSTALL.fonts KNOWN_BUGS ONEWS PROBLEMS # remove files that are symlinks, and shouldn't be part of the # distribution dist-hook: for i in mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c mi_plypnt.c mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c mi_version.c; do rm -f $(distdir)/libplot/$$i; done for i in xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h; do rm -f $(distdir)/libplot/$$i; done rm -f $(distdir)/libplotter/*.cc rm -f $(distdir)/libplotter/*.h for i in graph plot tek2plot plotfont pic2plot; do rm -f $(distdir)/$$i/fontlist.c; done plotutils-2.6/Makefile.in0000644000175000017500000005215511234210076012412 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # plot, tek2plot, plotfont, graph, and hersheydemo are linked with libplot. # spline, double, and ode are not, however. All use the routines in lib. # # pic2plot is written in C++ but is currently linked with libplot, not # libplotter. (It could easily be modified to use libplotter rather than # libplot.) We build it only if --enable-libplotter is specified, though; # which is a bit contradictory. # Since the libxmi 2D rasterization library is distributed as a separate # package, by default we don't build and install it as a standalone # library. (It's always compiled into libplot and libplotter, though.) VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.hin \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ THANKS TODO compile config.guess config.sub depcomp install-sh \ ltmain.sh missing mkinstalldirs ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = lib spline double ode ode-examples libplot libxmi plot \ tek2plot plotfont graph hersheydemo pic2plot libplotter \ include info doc fonts test DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @NO_LIBPLOTTER_FALSE@ADD_LIBPLOTTER = pic2plot libplotter @NO_LIBPLOTTER_TRUE@ADD_LIBPLOTTER = @NO_LIBXMI_FALSE@ADD_LIBXMI = libxmi @NO_LIBXMI_TRUE@ADD_LIBXMI = SUBDIRS = lib spline double ode ode-examples libplot $(ADD_LIBXMI) plot tek2plot plotfont graph hersheydemo $(ADD_LIBPLOTTER) include info doc fonts test # files with nonstandard names in this directory EXTRA_DIST = COMPAT INSTALL.pkg INSTALL.fonts KNOWN_BUGS ONEWS PROBLEMS all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.hin: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am # remove files that are symlinks, and shouldn't be part of the # distribution dist-hook: for i in mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c mi_plypnt.c mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c mi_version.c; do rm -f $(distdir)/libplot/$$i; done for i in xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h; do rm -f $(distdir)/libplot/$$i; done rm -f $(distdir)/libplotter/*.cc rm -f $(distdir)/libplotter/*.h for i in graph plot tek2plot plotfont pic2plot; do rm -f $(distdir)/$$i/fontlist.c; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: plotutils-2.6/config.hin0000644000175000017500000001362711234210137012311 00000000000000/* config.hin. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `ctime_r' function. */ #undef HAVE_CTIME_R /* Define if -lXext has support for the DBE X11 protocol extension. */ #undef HAVE_DBE_SUPPORT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `erf' function. */ #undef HAVE_ERF /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `gamma' function. */ #undef HAVE_GAMMA /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `j0' function. */ #undef HAVE_J0 /* Define to 1 if you have the `lgamma' function. */ #undef HAVE_LGAMMA /* Define if libpng is available. */ #undef HAVE_LIBPNG /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `matherr' function. */ #undef HAVE_MATHERR /* Define if -lXext has support for the MBX X11 protocol extension. */ #undef HAVE_MBX_SUPPORT /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if in your libc, fflush(NULL) flushes all outstreams. */ #undef HAVE_NULL_FLUSH /* Define to 1 if you have the header file. */ #undef HAVE_PNG_H /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STDTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VALUES_H /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_MULTIBUF_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XDBE_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XLIB_H /* Define to request PNG support (requires HAVE_LIBPNG, HAVE_PNG_H). */ #undef INCLUDE_PNG_SUPPORT /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if your libc includes support for pthreads. */ #undef PTHREAD_SUPPORT /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to enable support for the 45 LaserJet fonts in PS output. */ #undef USE_LJ_FONTS_IN_PS /* Define to enable support for the 45 LaserJet fonts in X output. */ #undef USE_LJ_FONTS_IN_X /* Define to request that Motif should be used, if X11 is used. */ #undef USE_MOTIF /* Define to enable support for the 35 PS fonts in PCL output. */ #undef USE_PS_FONTS_IN_PCL /* Version number of package */ #undef VERSION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to signal support in libXt/libX11 for multithreading. */ #undef X_THREAD_SUPPORT /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to 1 under HP/UX to get matherr-related things from math.h. */ #undef _HPUX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t plotutils-2.6/configure0000755000175000017500000307115111234210070012246 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for GNU plotutils 2.6. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='GNU plotutils' PACKAGE_TARNAME='plotutils' PACKAGE_VERSION='2.6' PACKAGE_STRING='GNU plotutils 2.6' PACKAGE_BUGREPORT='bug-plotutils@gnu.org' ac_unique_file="graph/graph.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE GREP EGREP LN_S ECHO AR RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ALLOCA YACC YFLAGS LEX LEX_OUTPUT_ROOT LEXLIB XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS X_TOOLKIT_LIBS X_BASIC_LIBS NO_X_TRUE NO_X_FALSE NO_PNG_TRUE NO_PNG_FALSE ps_fonts_in_pcl NO_LIBPLOTTER_TRUE NO_LIBPLOTTER_FALSE NO_LIBXMI_TRUE NO_LIBXMI_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS YACC YFLAGS XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures GNU plotutils 2.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/plotutils] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of GNU plotutils 2.6:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-ps-fonts-in-pcl enable use of PS fonts in PCL and HP-GL/2 output --enable-lj-fonts-in-ps enable use of LaserJet fonts in PS output --enable-lj-fonts-in-x enable use of LaserJet fonts on X displays --enable-libplotter build the C++ Plotter class library and C++ software --enable-libxmi build the libxmi scan-conversion library Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-x use the X Window System --with-athena=DIR use Athena widgets: includes and libraries in DIR --with-motif=DIR use Motif widgets: includes and libraries in DIR --with-xpm=DIR use Xpm with Motif: include and library in DIR --without-libpng omit PNG support even if libpng and zlib are present Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GNU plotutils configure 2.6 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU plotutils $as_me 2.6, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=plotutils VERSION=2.6 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h:config.hin" # The following will be defined in config.h, if appropriate. # Miscellaneous. # Threading-related. # X11-related. # PNG-related. # Fonts supported by Plotters of various types. # Did installer set the CFLAGS and CXXFLAGS environ variables before # running configure? Our default CFLAGS and CXXFLAGS differ from # autoconf's, but we won't override installer-specified values. if test "x$CFLAGS" = "x"; then CFLAGS_NOT_SET_BY_INSTALLER="yes" else CFLAGS_NOT_SET_BY_INSTALLER="no" fi if test "x$CXXFLAGS" = "x"; then CXXFLAGS_NOT_SET_BY_INSTALLER="yes" else CXXFLAGS_NOT_SET_BY_INSTALLER="no" fi # We now use libtool to make and installed a shared library. This should # invoke the tests AC_PROG_CC, AC_OBJEXT, AC_PROG_INSTALL, and # AC_PROG_MAKE_SET, or equivalents, so we don't perform them explicitly. # Note: this can apparently alter CFLAGS, on a few platforms, e.g., on # SCO OpenServer 5 (i.e. *-*-sco3.2v5*), "-belf" is added. # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4405 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-plotutils@gnu.org ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6; } else { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7136: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7140: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7404: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7408: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7508: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:7512: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix3*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs=no else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix3*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix3*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; solaris*) case $cc_basename in CC*) # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. postdeps_CXX='-lCstd -lCrun' ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12241: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:12245: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:12345: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:12349: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13906: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13910: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14010: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14014: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix3*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_F77=no else ld_shlibs_F77=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16197: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16201: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16465: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16469: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16569: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16573: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix3*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_GCJ=no else ld_shlibs_GCJ=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion # Determine extension (e.g. ".exe") on executables, if any. # Compiler characteristics and typedefs. { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF # Check whether fflush(NULL) works { echo "$as_me:$LINENO: checking whether flushing a null FILE pointer works" >&5 echo $ECHO_N "checking whether flushing a null FILE pointer works... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main() { FILE *fpw, *fpr; char test_array[7]; if ((fpw = fopen ("conftest0", "w")) == (FILE *)0 || fwrite ("FOOBAR", 1, 7, fpw) != 7 || fflush ((FILE *)0) < 0 || (fpr = fopen ("conftest0", "r")) == (FILE *)0 || fread (test_array, 1, 7, fpr) != 7) exit (1); else exit(0); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; }; cat >>confdefs.h <<\_ACEOF #define HAVE_NULL_FLUSH 1 _ACEOF else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi # Checks for header files: ANSI C, POSIX, and nonstandard Unix headers. { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in string.h limits.h float.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-plotutils@gnu.org ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in malloc.h pthread.h strings.h unistd.h values.h sys/select.h sys/stdtypes.h sys/time.h sys/types.h sys/wait.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-plotutils@gnu.org ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi # HP/UX needs a cpp definition for math.h to define matherr-related things cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "_HPUX_SOURCE" >/dev/null 2>&1; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "matherr" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define _HPUX_SOURCE 1 _ACEOF fi rm -f conftest* fi rm -f conftest* # Sui generis. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi # Checks for programs. Automake needs AM_PROG_LEX, not AC_PROG_LEX; # ignore the bogus warning about AC_PROG_LEX being invoked twice. for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { yyless (input () != 0); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { (ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { echo "$as_me:$LINENO: checking lex library" >&5 echo $ECHO_N "checking lex library... $ECHO_C" >&6; } if test "${ac_cv_lib_lex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_lex=$ac_lib else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5 echo "${ECHO_T}$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi # Should libplot/libplotter support multithreading via pthread mutexes? # Check to see whether libc includes dummy ("weak") pthread functions, so # that executables may be linked with a library that uses mutexes without # also linking with -lpthread. (This is the case with glibc under # Linux.) { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6; } if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6; } if test $ac_cv_lib_c_pthread_mutex_init = yes; then cat >>confdefs.h <<\_ACEOF #define PTHREAD_SUPPORT 1 _ACEOF fi # Do we have the thread-safe library functions ctime_r(), localtime_r()? for ac_func in ctime_r localtime_r do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Do we have the POSIX waitpid() function? for ac_func in waitpid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Other non-X library functions and auxiliary libraries. # # SGI's have matherr in libmx.a, not libm.a { echo "$as_me:$LINENO: checking for matherr in -lmx" >&5 echo $ECHO_N "checking for matherr in -lmx... $ECHO_C" >&6; } if test "${ac_cv_lib_mx_matherr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmx $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char matherr (); int main () { return matherr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_mx_matherr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mx_matherr=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_mx_matherr" >&5 echo "${ECHO_T}$ac_cv_lib_mx_matherr" >&6; } if test $ac_cv_lib_mx_matherr = yes; then LIBS="$LIBS -lmx" else LIBS="$LIBS -lm" fi for ac_func in memcpy memmove strchr strcasecmp strerror matherr j0 erf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # lgamma() and gamma() both compute the log of the gamma function. There # are old systems out there which do not have lgamma (the name was # introduced after BSD 4.2), but which do have gamma. Also some systems, # new and old, have lgamma but not gamma. for ac_func in lgamma gamma do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Prepare to support X. If the user gave the command-line option # --without-x, AC_PATH_XTRA will set no_x to "yes". Otherwise, it will # add appropriate preprocessor flags to X_CFLAGS, and appropriate linker # flags to X_LIBS. It also checks for system-specific X libraries, and # adds them to X_PRE_LIBS or X_EXTRA_LIBS, as appropriate. (The former # is where "-lSM -lICE" goes, in X11R6.) We define the X_TOOLKIT_LIBS # and X_BASIC_LIBS argument vectors ourselves, and if X is to be # supported, we'll concatenate the whole lot of these into a command line # for libtool. See, e.g., the libplot_la_LIBADD line in # libplot/Makefile.am. { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi # Following five are concatenated together into a linker specification. X_TOOLKIT_LIBS="-lXt" X_BASIC_LIBS="-lXext -lX11" # Check whether libXt has thread support. Some platforms may have # pthread support in libc, but no thread support in libXt/libX11. our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" { echo "$as_me:$LINENO: checking for XtToolkitThreadInitialize in -lXt" >&5 echo $ECHO_N "checking for XtToolkitThreadInitialize in -lXt... $ECHO_C" >&6; } if test "${ac_cv_lib_Xt_XtToolkitThreadInitialize+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXt $X_PRE_LIBS $X_BASIC_LIBS $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XtToolkitThreadInitialize (); int main () { return XtToolkitThreadInitialize (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xt_XtToolkitThreadInitialize=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xt_XtToolkitThreadInitialize=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xt_XtToolkitThreadInitialize" >&5 echo "${ECHO_T}$ac_cv_lib_Xt_XtToolkitThreadInitialize" >&6; } if test $ac_cv_lib_Xt_XtToolkitThreadInitialize = yes; then cat >>confdefs.h <<\_ACEOF #define X_THREAD_SUPPORT 1 _ACEOF fi LDFLAGS="$our_saved_LDFLAGS" # Check in -lXext for double buffering extensions to X11, and check # also whether appropriate header files are present. (Some systems have one # but not the other.) our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$X_LIBS $LDFLAGS" { echo "$as_me:$LINENO: checking for XdbeQueryExtension in -lXext" >&5 echo $ECHO_N "checking for XdbeQueryExtension in -lXext... $ECHO_C" >&6; } if test "${ac_cv_lib_Xext_XdbeQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext -lX11 "$X_EXTRA_LIBS" $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XdbeQueryExtension (); int main () { return XdbeQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xext_XdbeQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XdbeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XdbeQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XdbeQueryExtension" >&6; } if test $ac_cv_lib_Xext_XdbeQueryExtension = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DBE_SUPPORT 1 _ACEOF fi { echo "$as_me:$LINENO: checking for XmbufQueryExtension in -lXext" >&5 echo $ECHO_N "checking for XmbufQueryExtension in -lXext... $ECHO_C" >&6; } if test "${ac_cv_lib_Xext_XmbufQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext -lX11 "$X_EXTRA_LIBS" $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XmbufQueryExtension (); int main () { return XmbufQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xext_XmbufQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XmbufQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XmbufQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XmbufQueryExtension" >&6; } if test $ac_cv_lib_Xext_XmbufQueryExtension = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBX_SUPPORT 1 _ACEOF fi LDFLAGS="$our_saved_LDFLAGS" our_saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$X_CFLAGS $CPPFLAGS" for ac_header in X11/Xlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-plotutils@gnu.org ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in X11/extensions/Xdbe.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_X11_XLIB_H # include # endif #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in X11/extensions/multibuf.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if HAVE_X11_XLIB_H # include # endif #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="$our_saved_CPPFLAGS" # Allow installer to specify location of Athena widgets (i.e. location of # libraries lib/libXaw.so and lib/libXmu.so, and header files). If the # argument of --with-athena is a directory DIR, we'll add an `-L DIR/lib' # option to the head of X_LIBS and an `-I DIR/include' option to the head # of X_CFLAGS. # Check whether --with-athena was given. if test "${with_athena+set}" = set; then withval=$with_athena; fi # If --with-motif is specified, then `-lXm' will be added to the head of # X_TOOLKIT_LIBS, instead of `-lXaw -lXmu', and --with-athena will be # ignored. We allow the installer to specify DIR, the location of Motif. # If the argument of --with-motif is a directory, an `-L DIR/lib' option # will be added to the head of X_LIBS and an `-I DIR/include' option to # the head of C_FLAGS. # Check whether --with-motif was given. if test "${with_motif+set}" = set; then withval=$with_motif; fi # If --with-motif is specified, we always check for the Xpm image # library, and if we find it, then we place it at the beginning of # X_BASIC_LIBS, since Motif 2.x requires it (it may be included in -lXm # already, though). We also allow the installer to specify a location # for Xpm. If DIR is specified as an argument to --with-xpm, DIR/include # should contain xpm.h, and DIR/lib should contain the library libxpm. # Check whether --with-xpm was given. if test "${with_xpm+set}" = set; then withval=$with_xpm; fi # NOTE: Motif 2.x also seems to require the extension library -lXp for # printing, so if --with-motif is specified we always check for libXp. # If we find it, we'll place `-lXp' before `-lXext -lX11' in # X_BASIC_LIBS. Also, Motif on Sys-V derived systems requires `-lPW'. # If we find libPW, we'll add `-lPW' to LIBS, but precede it by -lc # because some of its definitions may conflict with the standard library. # Similarly we always check for libgen, which some versions of Motif on # Solaris need. # NOTE: For each `with' option, there are four possible values for the # associated shell variable, all of which we must handle: # # 1. "" (if neither `--with-foo' nor `--without-foo' was specified) # 2. "no" (obtained if `--without-foo' was specified) # 3. "yes" (obtained if `--with-foo' was specified, without an argument) # 4. DIR (obtained if `--with-foo DIR' was specified) case "x$with_motif" in xno|x) case "x$with_athena" in xyes|x) X_TOOLKIT_LIBS="-lXaw -lXmu $X_TOOLKIT_LIBS" ;; xno) ;; *) X_TOOLKIT_LIBS="-lXaw -lXmu $X_TOOLKIT_LIBS" X_CFLAGS="$X_CFLAGS -I$with_athena/include" X_LIBS="$X_LIBS -L$with_athena/lib" ;; esac ;; *) if test "x$with_motif" != "xyes"; then X_CFLAGS="$X_CFLAGS -I$with_motif/include" X_LIBS="$X_LIBS -L$with_motif/lib" fi X_TOOLKIT_LIBS="-lXm $X_TOOLKIT_LIBS" our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" case "x$with_xpm" in xno|x) { echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6; } if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm -lXext -lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmReadFileToPixmap (); int main () { return XpmReadFileToPixmap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xpm_XpmReadFileToPixmap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xpm_XpmReadFileToPixmap=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then X_BASIC_LIBS="-lXpm $X_BASIC_LIBS" fi ;; xyes) { echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6; } if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm -lXext -lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmReadFileToPixmap (); int main () { return XpmReadFileToPixmap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xpm_XpmReadFileToPixmap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xpm_XpmReadFileToPixmap=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then X_BASIC_LIBS="-lXpm $X_BASIC_LIBS" fi ;; *) LDFLAGS="$LDFLAGS -L$with_xpm/lib" { echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5 echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6; } if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm -lXext -lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmReadFileToPixmap (); int main () { return XpmReadFileToPixmap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xpm_XpmReadFileToPixmap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xpm_XpmReadFileToPixmap=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then X_CFLAGS="$X_CFLAGS -I$with_xpm/include"; X_LIBS="$X_LIBS -L$with_xpm/lib"; X_BASIC_LIBS="-lXpm $X_BASIC_LIBS" fi ;; esac LDFLAGS="$our_saved_LDFLAGS" our_saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" { echo "$as_me:$LINENO: checking for XpQueryExtension in -lXp" >&5 echo $ECHO_N "checking for XpQueryExtension in -lXp... $ECHO_C" >&6; } if test "${ac_cv_lib_Xp_XpQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXp -lXext -lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpQueryExtension (); int main () { return XpQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xp_XpQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xp_XpQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xp_XpQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xp_XpQueryExtension" >&6; } if test $ac_cv_lib_Xp_XpQueryExtension = yes; then X_BASIC_LIBS="-lXp $X_BASIC_LIBS" fi { echo "$as_me:$LINENO: checking for regex in -lgen" >&5 echo $ECHO_N "checking for regex in -lgen... $ECHO_C" >&6; } if test "${ac_cv_lib_gen_regex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char regex (); int main () { return regex (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_gen_regex=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gen_regex=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_gen_regex" >&5 echo "${ECHO_T}$ac_cv_lib_gen_regex" >&6; } if test $ac_cv_lib_gen_regex = yes; then LIBS="$LIBS -lc -lgen" else LIBS="$LIBS" fi { echo "$as_me:$LINENO: checking for regex in -lPW" >&5 echo $ECHO_N "checking for regex in -lPW... $ECHO_C" >&6; } if test "${ac_cv_lib_PW_regex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lPW $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char regex (); int main () { return regex (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_PW_regex=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_PW_regex=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_PW_regex" >&5 echo "${ECHO_T}$ac_cv_lib_PW_regex" >&6; } if test $ac_cv_lib_PW_regex = yes; then LIBS="$LIBS -lc -lPW" else LIBS="$LIBS" fi LDFLAGS="$our_saved_LDFLAGS" cat >>confdefs.h <<\_ACEOF #define USE_MOTIF 1 _ACEOF ;; esac # The libplot/libplotter Makefile.am files test the automake variable # NO_X to determine whether X should be supported. if test "x$no_x" = "xyes"; then NO_X_TRUE= NO_X_FALSE='#' else NO_X_TRUE='#' NO_X_FALSE= fi # Check for libpng and png.h, and if both are available, define the # config.h variable INCLUDE_PNG_SUPPORT; otherwise define the automake # variable NO_PNG. The latter is used in libplot/Makefile.am and # libplotter/Makefile.am. # NOTE: the test for libpng checks for the function png_set_tRNS(), # because it was added to libpng in version 0.95, which is the minimum # version that we can use. # ALSO NOTE: the test for libpng automatically checks for zlib, since it # supplies the `-lz' argument to the linker. for ac_header in png.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-plotutils@gnu.org ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF png_support="yes" else png_support="no" fi done { echo "$as_me:$LINENO: checking for png_set_tRNS in -lpng" >&5 echo $ECHO_N "checking for png_set_tRNS in -lpng... $ECHO_C" >&6; } if test "${ac_cv_lib_png_png_set_tRNS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng -lz -lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_set_tRNS (); int main () { return png_set_tRNS (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_png_png_set_tRNS=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_png_png_set_tRNS=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_set_tRNS" >&5 echo "${ECHO_T}$ac_cv_lib_png_png_set_tRNS" >&6; } if test $ac_cv_lib_png_png_set_tRNS = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPNG 1 _ACEOF else png_support="no" fi # Check whether --with-libpng was given. if test "${with_libpng+set}" = set; then withval=$with_libpng; if test "x${with_libpng}" = "xno"; then png_support="no"; fi fi if test "x${png_support}" = "xyes"; then cat >>confdefs.h <<\_ACEOF #define INCLUDE_PNG_SUPPORT 1 _ACEOF fi if test "x${png_support}" = "xno"; then NO_PNG_TRUE= NO_PNG_FALSE='#' else NO_PNG_TRUE='#' NO_PNG_FALSE= fi # Font options. The ps_fonts_in_pcl variable is used by test/plot2hpgl.test. # Check whether --enable-ps-fonts-in-pcl was given. if test "${enable_ps_fonts_in_pcl+set}" = set; then enableval=$enable_ps_fonts_in_pcl; if test "x$enableval" = "xyes"; then echo enabling support for the 35 PS fonts in PCL 5 and HP-GL/2 output ps_fonts_in_pcl=1 cat >>confdefs.h <<\_ACEOF #define USE_PS_FONTS_IN_PCL 1 _ACEOF else ps_fonts_in_pcl=0 fi else ps_fonts_in_pcl=0 fi # Check whether --enable-lj-fonts-in-ps was given. if test "${enable_lj_fonts_in_ps+set}" = set; then enableval=$enable_lj_fonts_in_ps; if test "x$enableval" = "xyes"; then echo enabling support for the 45 LaserJet fonts in PS output cat >>confdefs.h <<\_ACEOF #define USE_LJ_FONTS_IN_PS 1 _ACEOF fi fi # Check whether --enable-lj-fonts-in-x was given. if test "${enable_lj_fonts_in_x+set}" = set; then enableval=$enable_lj_fonts_in_x; if test "x$enableval" = "xyes"; then echo enabling support for the 45 LaserJet fonts on X displays cat >>confdefs.h <<\_ACEOF #define USE_LJ_FONTS_IN_X 1 _ACEOF fi fi # Do we build libplotter, the C++ library, and other C++ software? # Check whether --enable-libplotter was given. if test "${enable_libplotter+set}" = set; then enableval=$enable_libplotter; echo enabling construction of the C++ class library; no_libplotter="no" else no_libplotter="yes"; extralib="" fi if test "x$no_libplotter" = "xyes"; then NO_LIBPLOTTER_TRUE= NO_LIBPLOTTER_FALSE='#' else NO_LIBPLOTTER_TRUE='#' NO_LIBPLOTTER_FALSE= fi # Do we build and install a standalone version of the libxmi # scan-conversion library? (Not done by default because it's separately # distributed.) # Check whether --enable-libxmi was given. if test "${enable_libxmi+set}" = set; then enableval=$enable_libxmi; echo enabling construction of the libxmi scan-conversion library; no_libxmi="no" else no_libxmi="yes" fi if test "x$no_libxmi" = "xyes"; then NO_LIBXMI_TRUE= NO_LIBXMI_FALSE='#' else NO_LIBXMI_TRUE='#' NO_LIBXMI_FALSE= fi # Override default autoconf value "-g -O2" or "-g" for CFLAGS and # CXXFLAGS, set by AC_PROG_CC and AC_PROG_CXX. Provided, that is, # installer didn't set CFLAGS via an environment variable before running # configure. We don't use "-g" when compiling libplot or libplotter, # since debugging versions of those libraries would be huge. Perhaps we # should use it when compiling the executables, though? # Note: on a very few platforms where libtool adds a command-line option # to CFLAGS (see above; this includes SCO OpenServer 5, where "-belf" is # added), this way of doing things will not work, i.e., the installer # will need to add by hand the option that libtool would have added. # E.g., on SCO OpenServer5 the installer may need to set the environment # variable CFLAGS to "-O -belf" or "-O2 -belf". if test "x$CFLAGS_NOT_SET_BY_INSTALLER" = "xyes"; then if test "x$GCC" = "xyes"; then CFLAGS="-O2" else CFLAGS="-O" fi fi if test "x$CXXFLAGS_NOT_SET_BY_INSTALLER" = "xyes"; then if test "x$GXX" = "xyes"; then CXXFLAGS="-O2" else CXXFLAGS="-O" fi fi # Check for gcc strength-reduce bug (taken from WINE config). Could do # the same for g++, but we'll assume anyone doing any C++ compiling has # installed a modern compiler. if test "x${GCC}" = "xyes"; then { echo "$as_me:$LINENO: checking for gcc strength-reduce bug" >&5 echo $ECHO_N "checking for gcc strength-reduce bug... $ECHO_C" >&6; } if test "${ac_cv_c_gcc_strength_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_gcc_strength_bug="yes" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main() { static int Array[3]; unsigned int B = 3; int i; for (i=0; i < B; i++) Array[i] = i - 3; exit (Array[1] != -2); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_gcc_strength_bug="no" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_gcc_strength_bug="yes" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_gcc_strength_bug" >&5 echo "${ECHO_T}$ac_cv_c_gcc_strength_bug" >&6; } if test "$ac_cv_c_gcc_strength_bug" = "yes" then CFLAGS="$CFLAGS -fno-strength-reduce" fi fi ac_config_files="$ac_config_files Makefile double/Makefile graph/Makefile hersheydemo/Makefile pic2plot/Makefile pic2plot/doc/Makefile pic2plot/libgroff/Makefile pic2plot/include/Makefile info/Makefile lib/Makefile libplot/Makefile libplotter/Makefile libxmi/Makefile libxmi/info/Makefile plot/Makefile tek2plot/Makefile tek2plot/teksamples/Makefile plotfont/Makefile spline/Makefile ode/Makefile ode-examples/Makefile include/Makefile doc/Makefile fonts/Makefile fonts/bdf/Makefile fonts/pcf/Makefile fonts/pfb/Makefile test/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NO_X_TRUE}" && test -z "${NO_X_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NO_X\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NO_X\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NO_PNG_TRUE}" && test -z "${NO_PNG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NO_PNG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NO_PNG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NO_LIBPLOTTER_TRUE}" && test -z "${NO_LIBPLOTTER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NO_LIBPLOTTER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NO_LIBPLOTTER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${NO_LIBXMI_TRUE}" && test -z "${NO_LIBXMI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"NO_LIBXMI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"NO_LIBXMI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by GNU plotutils $as_me 2.6, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GNU plotutils config.status 2.6 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "double/Makefile") CONFIG_FILES="$CONFIG_FILES double/Makefile" ;; "graph/Makefile") CONFIG_FILES="$CONFIG_FILES graph/Makefile" ;; "hersheydemo/Makefile") CONFIG_FILES="$CONFIG_FILES hersheydemo/Makefile" ;; "pic2plot/Makefile") CONFIG_FILES="$CONFIG_FILES pic2plot/Makefile" ;; "pic2plot/doc/Makefile") CONFIG_FILES="$CONFIG_FILES pic2plot/doc/Makefile" ;; "pic2plot/libgroff/Makefile") CONFIG_FILES="$CONFIG_FILES pic2plot/libgroff/Makefile" ;; "pic2plot/include/Makefile") CONFIG_FILES="$CONFIG_FILES pic2plot/include/Makefile" ;; "info/Makefile") CONFIG_FILES="$CONFIG_FILES info/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "libplot/Makefile") CONFIG_FILES="$CONFIG_FILES libplot/Makefile" ;; "libplotter/Makefile") CONFIG_FILES="$CONFIG_FILES libplotter/Makefile" ;; "libxmi/Makefile") CONFIG_FILES="$CONFIG_FILES libxmi/Makefile" ;; "libxmi/info/Makefile") CONFIG_FILES="$CONFIG_FILES libxmi/info/Makefile" ;; "plot/Makefile") CONFIG_FILES="$CONFIG_FILES plot/Makefile" ;; "tek2plot/Makefile") CONFIG_FILES="$CONFIG_FILES tek2plot/Makefile" ;; "tek2plot/teksamples/Makefile") CONFIG_FILES="$CONFIG_FILES tek2plot/teksamples/Makefile" ;; "plotfont/Makefile") CONFIG_FILES="$CONFIG_FILES plotfont/Makefile" ;; "spline/Makefile") CONFIG_FILES="$CONFIG_FILES spline/Makefile" ;; "ode/Makefile") CONFIG_FILES="$CONFIG_FILES ode/Makefile" ;; "ode-examples/Makefile") CONFIG_FILES="$CONFIG_FILES ode-examples/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "fonts/Makefile") CONFIG_FILES="$CONFIG_FILES fonts/Makefile" ;; "fonts/bdf/Makefile") CONFIG_FILES="$CONFIG_FILES fonts/bdf/Makefile" ;; "fonts/pcf/Makefile") CONFIG_FILES="$CONFIG_FILES fonts/pcf/Makefile" ;; "fonts/pfb/Makefile") CONFIG_FILES="$CONFIG_FILES fonts/pfb/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LN_S!$LN_S$ac_delim ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim CXXCPP!$CXXCPP$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim ALLOCA!$ALLOCA$ac_delim YACC!$YACC$ac_delim YFLAGS!$YFLAGS$ac_delim LEX!$LEX$ac_delim LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim LEXLIB!$LEXLIB$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim X_TOOLKIT_LIBS!$X_TOOLKIT_LIBS$ac_delim X_BASIC_LIBS!$X_BASIC_LIBS$ac_delim NO_X_TRUE!$NO_X_TRUE$ac_delim NO_X_FALSE!$NO_X_FALSE$ac_delim NO_PNG_TRUE!$NO_PNG_TRUE$ac_delim NO_PNG_FALSE!$NO_PNG_FALSE$ac_delim ps_fonts_in_pcl!$ps_fonts_in_pcl$ac_delim NO_LIBPLOTTER_TRUE!$NO_LIBPLOTTER_TRUE$ac_delim NO_LIBPLOTTER_FALSE!$NO_LIBPLOTTER_FALSE$ac_delim NO_LIBXMI_TRUE!$NO_LIBXMI_TRUE$ac_delim NO_LIBXMI_FALSE!$NO_LIBXMI_FALSE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi plotutils-2.6/AUTHORS0000644000175000017500000000413611257243240011415 00000000000000Rob Maier wrote the libplot/libplotter library and the graphics programs graph, plot, tek2plot, plotfont, and hersheydemo, beginning in 1995. The old `GNU graphics' package (written by Rich Murphey in 1989-1991) served as a starting point, but the plotutils package is over an order of magnitude larger. Probably none of the code from the earlier package remains in libplot/libplotter or the graphics programs. spline and double were originally written by Rich. They have been extended by Rob, but some of Rich's code is still present. tek2plot was based by Rob on the Tektronix parser written in the mid-1980's by Edward Moy (then of Berkeley, later at Xerox, and as of last report at Apple). This is the parser used by the standard terminal emulator `xterm', when it is in Tektronix mode. The idea of tek2plot originated with Rich, though. (The old `GNU graphics' package contained a tek2plot.) ode was written by Nick Tufillaro in 1978-1994, and was somewhat modified and extended by Rob so as to merge it into the package. The file ode/specfun.c, which provide gnuplot-style special function support to ode, was written by Rob in 2009, replacing a file (distributed in earlier releases) that had copyright problems. Most of the code in pic2plot (the scanner and parser code, in particular) is taken from gpic, i.e. GNU pic. gpic was written in 1989-1992 by James J. Clark as part of groff, i.e. GNU troff. A libplot driver was added by Rob, to turn it into pic2plot. Rob wrote the texinfo manual, but the chapter on ode draws heavily on Nick's original ode documentation, dating in part to the late 1970s. The libxmi scan-conversion library was extracted by Rob from source files in the X11 distribution, with modifications. The source files were written in the mid-to-late 1980's by Brian Kelleher, Joel McCormack, Todd Newman, Keith Packard, Bob Scheifler and Ken Whaley, who worked for Digital Equipment Corp., MIT, and/or the X Consortium. Their contributions are copyright 1985-89 by the X Consortium. See ./libxmi/README-X for X Consortium permission notices. plotutils-2.6/COPYING0000644000175000017500000010437411037262561011410 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . plotutils-2.6/ChangeLog0000644000175000017500000000000006452062315012104 00000000000000plotutils-2.6/INSTALL0000644000175000017500000003623111240561117011375 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute path. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/path/to/alternate' will choose an alternate location, as well as influencing all other directory configuration variables that were expressed in terms of `${prefix}' (or, put another way, all directories specified during `configure' but not in terms of the common prefix must each be overridden at install time for the entire installation to be relocated). The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/path/to/alternate' will prepend `/path/to/alternate' before all installation paths. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. For packages which support `DESTDIR', the variable should remain undefined during `configure' and `make all', and only be specified during `make install'. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. plotutils-2.6/NEWS0000644000175000017500000021254511257257033011056 00000000000000Version 2.6 released, 9/2009. [Includes libplot 4.4, interface age=2.] ode: File ode/specfun.c now heavily rewritten to remove all non-GNU copyrights. For details, see the file ./COMPAT. libplot: Several bugfixes to the SVG and PS drivers. (Thanks to Diomidis Spinellis, James Anderson, and others, for pointing out that several apps that import SVG or PS were choking on libplot's output. Some still choke on its SVG output, but that's no longer libplot's fault; see ./COMPAT.) libplot: The SVG driver now no longer assumes that the application that imports or displays SVG can do _any_ justification of text strings (not even horizontal justification, e.g., position a string in a right-justified way, with its right edge at a given point). Many SVG viewers still get this wrong. libplot: Fig plotters now slightly increase the width of drawn lines, in .fig output, to agree with the interpretation of `line width' in recent releases of xfig. (Thanks to Wolfgang Glunz and Bart De Schutter for pointing out the need for this.) This affects executables built with libplot, such as `graph -Tfig'. graph,plot,tek2plot,plotfont,pic2plot,hersheydemo: The output of the `--help' option now cautions that if a `-T' or `--output-format' command-line option is not included, the output will by default be in the `metafile' format, which is probably not what the user expects or wants (by default, it is in binary). hersheydemo: New executable, generating a single demo page that serves as an advertisement for the Hershey vector fonts. (It replaces the file doc/h-demo.c.) Invoke it by doing, e.g., `hersheydemo -Tsvg > demo.svg' , or `hersheydemo -Tps | lpr' . It supports the usual libplot options such as --bg-color, --pen-color, and --page-size. Also --bitmap-size, if a bitmap output format is requested; but note that the Hershey fonts, not being anti-aliased, do not look their best in low-resolution (i.e., small-size) bitmap output. Version 2.5.1 released, 7/2008. [Includes libplot 4.3, interface age=2.] package: license for the package (and for libplot) upgraded to GNU GPL v3. libplot: SVG output format slightly tweaked, to ensure compatability with SVG 1.1 syntax, as tested for by validator.w3.org. Note: a few SVG editing tools, such as inkscape, currently fail to agree with libplot's SVG semantics, in positioning text. That appears to be their fault (they do not comply with the handling of reflected text, as specified in the SVG 1.1 standard). libplot: Fixed a bug in bounding box computatations when triangular line-joins are used. executables: Changed nearly all warning and error messages to complete sentences, to smooth the upcoming transition to gettext. Version 2.5 released, 12/2005. [Includes libplot 4.2, interface age=2.] package: bug reporting address has changed to bug-plotutils@gnu.org. libplot: support for rotated and sheared (i.e., "anamorphically transformed") X Window System fonts has been completely rewritten. Core X fonts are still used, but it is no longer assumed that the X display has the ability to rasterize rotated and sheared glyphs. (Recent releases of XFree86 are broken in this regard.) Instead, unrotated glyphs are retrieved from the server, and rotated or transformed within libplot. See new module libplot/x_afftext.c. graph: plotting of rotated y-axis labels by the `-Y' option, when `-T X' is specified (so that output is to an X Window System display) should now work, even when recent broken releases of XFree86 are used. This is due to the above change to libplot. libplot: URW versions of the standard 35 Adobe fonts (Helvetica, Times-Roman etc.) are now checked for under their own names on any X Window System display, as well as under the Adobe names. This fixes a problem with recent SuSE GNU/Linux distributions, of `graph -T X' being unable to use even the default Helvetica font. libplot: SVG output is now conformant SVG 1.1, and should not be rejected by the Firefox browser. libplot: vertical positioning of text strings by the SVG driver is improved; libplot now does vertical positioning itself, since many SVG renderers, e.g. Firefox 1.5, can't do it properly. libplot: the ROTATION parameter, which is the angle in degrees at which the viewport in the output (device) frame should be rotated, can now take values other than 0, 90, 180, and 270. graph,plot,tek2plot,plotfont,pic2plot: the --rotation option no longer requires that the specified angle be 0, 90, 180, or 270 degrees. Some quite postmodern effects can now be obtained. libplot: modifiers such as "xsize=6in", "yoffset=8cm" appended to the PAGESIZE parameter by the user, to do fine positioning of the viewport on the output page, are no longer sometimes ignored. graph,plot,tek2plot,plotfont,pic2plot: modifiers such as "xsize=6in", "yoffset=8cm" appended to the argument of the --page-size option, by the user, to do fine positioning of the viewport on the output page, are no longer sometimes ignored. libplotter,pic2plot: problems with compilation by recent C++ compilers now fixed: unsigned char* is cast to char* as needed, deprecated C++ headers have had their names modernized, etc. Support for `bool' in the C++ compiler is now assumed (this could be trivially backed out of, if needed). installation: entire package can now be compiled by a C++ compiler if desired; request this by doing e.g. `CC=g++ ./configure'. installation: support for pre-ANSI C compilers, such the SunOS 4.1.3 one, now largely dropped. Non-working `const' is still checked for, but compiler support for prototypes and void is now assumed. Removal of preprocessor macros that supported pre-ANSI C, from many source files, considerably improved maintainability. installation: updated GNU autotools now used (autoconf-2.59, libtool-1.5.6, and the older automake-1.4-p6 for safety's sake). Also, recent flex/bison have been used to prepare the scanner and parser supplied with the ode source (flex-2.5.31 and bison-1.875d). graph: new short `-Q' option, which is equivalent to the long option `--toggle-rotate-y-axis-label'. graph,plot,tek2plot,plotfont,pic2plot: `--display-type' long option, the name of which confused some users, has been changed to `--output-format'. The old option is still supported but is now deprecated. The short option `-T' continues to work. libplot: problems with PS output triggering an error in some versions of ghostscript (and hence ghostview, gv), due to changes in the way ghostscript handles FontBBox, now fixed. Thanks, Brian Gough (and also Alex Cherepanov, who found the fix to idraw's PS prologue). libplot: most external symbols not meant to be publicly accessible now have names beginning with the prefix "_pl_", to reduce the possibility of namespace collisions. This will be completed in a later release. executables: output of "--help" has been altered to agree with current GNU coding standards. package: copyright and license notices added to nearly all source files. Version 2.4.1 released, 7/2000. [Includes libplot 4.1, interface age=2.] graph,plot,tek2plot,plotfont,pic2plot: `--page-size' option and PAGESIZE environment variable now allow precise specification of viewport size and location on the printed page. For example, `--page-size=letter,xsize=5in,ysize=3in,xorigin=1in,yorigin=2in' is now a possible command-line option. The traditional `xoffset' and `yoffset' fields are still supported. libplot: PAGESIZE parameter extended, to allow precise specification of viewport size and location on the printed page (see item above). libplot: bug dealing with filling of paths formed from segments of multiple types now fixed. It affected CGM and possibly other output formats. (CGM version number was affected: it could be too high.) pic2plot: pic parser extended to support a new command, srand(), which sets the seed for the random number generator that rand() invokes. This is for compatibility for GNU pic, which (as distributed in the recently released groff-1.16) now supports srand(). libplot: a bug in xfig is now worked around. When producing Fig output, any text string consisting of a single space, which is rotated at a nonzero angle, is no longer written to the output file. As of xfig-3.2.2, xfig crashes when it sees such strings. installation: `configure' now supports `--with-athena=DIR' and `--with-motif=DIR' options, to allow specification of location of Athena and Motif files. Also, `--with-xpm=DIR' is now supported, since some versions of Motif require linking with libXpm, and the libXpm may be located in an odd place. (Thanks, Albert Chin.) pic2plot: distributed `gram.c' file is now prepared with bison-1.28, so it should compile under Solaris 2.7. (Thanks, Albert Chin.) Version 2.4 released, 6/2000. [Includes libplot 4.0, interface age=2.] libplot: libxmi rendering module (used by GIF/PNM/PNG drivers) has been upgraded from version 1.1.1 to 1.2. This fixed an obscure bug that appeared when regions of one color were completely covered by regions of another color. The bug caused both memory allocation failures and segfaulting. libplot: library now contains a version string, `pl_libplot_ver'. The plot.h and plotter.h header files now contain both the version string and a numeric variant of it, as macros. Cf. libpng. libplot: rendering of color on truecolor X displays has been speeded up. Pixel value computations are now performed in libplot, not in the X display. Useful Plotter parameter XDRAWABLE_VISUAL added. graph,plot,tek2plot,plotfont,pic2plot: `-T svg --bg-color none' and `-T cgm --bg-color none' now supported (see below). libplot: SVG and CGM Plotters now support a background color of "none", to turn off the background. This is useful when generated graphics files that will be placed in Web pages, especially. graph,plot,tek2plot,plotfont,pic2plot: `-T svg' now allowed. libplot: SVG driver added, which outputs the new XML-based SVG (scalable vector graphics) format. graph,plot,tek2plot,plotfont,pic2plot: all color names, when supplied as command-line arguments, may now be specified as 24-bit RGB strings, e.g., '#ffffff'. libplot: pencolorname(), fillcolorname(), and bgcolorname() now allow colors to be specified as 24-bit RGB strings, e.g., '#ffffff'. libplot: space() operation, or equivalent, no longer needs to be invoked at the beginning of each page of graphics to set the user coordinate system. Default coordinate system assigns coordinates (0,0), (1,0), (1,1), (0,1) to the corners of the graphics display. libplot: fontsize() operation now accepts an argument of zero, though the meaning of `font size 0' is Plotter-dependent. Few Plotters can draw strings with zero font size; in non-Hershey fonts, anyway. libplot: Tektronix driver now analyses the environment variable TERM more carefully. Any string beginning with "xterm", "nxterm", or "kterm" is treated as as equivalent to "xterm", for example. documentation: man page for plotfont added. libplot: completely new metafile export driver, written from scratch. libplot: filled marker symbols were sometimes drawn incorrectly. Fixed. ode: distributed `gram.c' file is now prepared with bison-1.28, so it should now compile under Solaris 2.7. (Thanks, Albert Chin.) libplot: alabel() function now accepts a `C' positioning option, which aligns a label's cap line with the current vertical position. libplot: escape sequences "\r^" and "\l^" in labels, which shift right and left by 1/12 em, respectively, weren't working if the current font was a Hershey font. Fixed. libplot: new function, fsetmatrix(), added to the API. It sets the transformation matrix from user coordinates to normalized device coordinates. In NDC coordinates, the graphics display, i.e. viewport, has corners (0,0), (1,0), (1,1), (0,1). libplot: bug in drawing of rectangles by X driver, when ROTATION parameter is set, now fixed. (It affected `graph -TX --rotation=90'.) graph,plot,tek2plot,plotfont,pic2plot: `-T regis' now allowed. libplot: ReGIS driver added, which outputs ReGIS (DEC's remote graphics instruction set, understood by DEC's VT340 and earlier terminals, and also emulators like DEC's decterm). No support yet for filling paths that extend beyond the boundaries of a ReGIS display, due to a need for clipping code. libplot: flattening of Beziers into polylines, in output formats that don't provide native support for Beziers, now much improved. An adaptive scheme now handles unusually `bent' sections of a Bezier. libplot: when producing PCL 5 output, ellipses and elliptic arcs are now approximated by cubic Beziers. When producing Illustrator output, circular arcs are now approximated by them, too. libplot: bugs in rendering of elliptic arcs, ellipses, and circles, in Illustrator output format, now fixed. The bugs were due to an incorrect approximation of these primitives by cubic Beziers. libplot: in GIF, PNM, and PNG output, arcs (circular and elliptic), circles and ellipses are now drawn using libxmi scan-conversion, rather than being polygonalized, and drawn by libxmi as polylines. libplot: PCL5 driver now uses the HP-GL/2 `SV' and `CF' instructions to do a better job of matching user-specified pen colors. It can now employ shaded (desaturated) versions of the defined pen colors, as well as the defined colors themselves. Of course, only PCL5 printers that support dynamic pen color assignment (which you must request via the `PCL_ASSIGN_COLORS' option) do a perfect job of matching user-specified pen colors. Many monochrome PCL5 printers map all 7 standard PCL5 (i.e. HP-GL/2) pen colors to `black'. graph,plot,tek2plot,plotfont,pic2plot: `-T png' now allowed if libplot contains a PNG driver. libplot: PNG driver added, which outputs PNG (portable network graphics) format. Included only if libpng (version number >= 0.95) and libz are found at package installation time. `configure' now supports a `--without-libpng' option to disable PNG support. pic2plot: if the `-d' option is used to request precision dotting or dashing, filled rounded boxes with a dotted or dashed boundary are no longer displayed with an unwanted solid edge. libplot: marker symbols are now always drawn with pentype `1', fixing a bug that appeared when pentype was manually set to `0'. graph,plot,tek2plot,plotfont,pic2plot: `--emulate-color yes' option now supported, to replace each color in the output by a grayscale approximation. Particularly useful when preparing PCL 5 output with `-T pcl', to be printed on a monochrome PCL 5 printer. Most such printers map HP-GL/2's seven standard pen colors (even yellow!) to black. libplot: EMULATE_COLOR Plotter parameter added. If "yes", grayscale emulation of colors results, in accord with the CIE luminance computation standardized by Rec. 790. libplot: PS driver now maps the output of each call to box() to idraw's `Rect' primitive, rather than to idraw's `Poly' primitive. libplot: some obscure bugs involving the edging of rectangles with user-defined dashing patterns have been corrected. If the rectangle is generated by calling box(), the dash pattern now starts at the first-specified vertex, in all output formats. libplot: zero-length dash arrays [specified with linedash()] were causing a segfault in HPGL Plotters when HPGL_VERSION="1.5" or "1". Fixed. libplot and applications: when producing HP-GL/2 output, e.g., via the default `-T hpgl' option, the kerning of non-fixed width device resident fonts such as "Arc" has been much improved. Also, such half-Japanese fonts as "StickANK" and "ArcANK" can now be used. libplot and applications: when producing generic HP-GL output, via the option `-T hpgl' with HPGL_VERSION=1, basic device-resident vector fonts such as "Stick" and "Arc" can now be used, if present. libplot: when HPGL_VERSION is 1.5 or 1, the filling of regions has been improved. Solid filling with a single pen was used, but this has been changed to cross-hatching, to match better the filling color. The algorithm for choosing the inter-line distance in the cross-hatch is from the HP7550B (HP's first HP-GL/2 pen plotter). libplot: HP-GL and PCL Plotters, in their output files, now round the miter limit to the nearest integer, downwards. That's because there's at least one HP-GL/2 interpreter (the firmware in the HP7550B pen plotter) that insists that it be an integer. In early documentation, HP itself seems to have been unclear on that point. libplot: due to renaming of external symbols, it is now possible to link both libplot/libplotter and libxmi simultaneously with an application, if desired. libplot: as previously promised in libplot documentation, calling the API function pentype() with a value argument of `0' now turns off the drawing of markers and `points' (i.e., pixels), besides turning off the edging of paths, which is all that it formerly did. libplot: bug in drawing of rectangles by X and XDrawable Plotters, when user coordinate system has been rotated relative to the default coordinate system, now fixed. libplot: invoking closepl() on an XPlotter or XDrawablePlotter when the stack of drawing states is nonempty, without first calling restorestate() repeatedly to pop the stack, formerly yielded erratic behavior. Now fixed. libplot: X driver, very rarely, would sometimes block, waiting for user input such as mouse motion. This was due to blocking behavior of select(), invoked by XtAppPending() in our hand-crafted event loop. Now fixed; previously, the bug had almost (but not completely!) been fixed in plotutils-2.2. Thanks to Massimo Santini for providing a system call trace, as a useful diagnostic. libplot: X driver now checks the coordinates of each polyline, before drawing it, to determine whether they can be represented as 2-byte integers in accordance with the X11 wire protocol. If not, polyline is truncated and a warning message is emitted. libplot: PCL driver, when generating PCL 5 output containing Postscript fonts, was specifying the wrong font number for Bookman. Fixed. (This bug was significant only if `--enable-ps-fonts-in-pcl' was specified at installation time.) libplot: the point() operation, when invoked on a CGM Plotter, was not updating the graphics cursor position. Fixed. libplot: font descriptions included in WebCGM output files, to facilitate font substitution, incorrectly identified italic Postscript fonts as `oblique' rather than italic, and contained incorrect classifications for AvantGarde and NewCenturySchlbk. This affected `-T cgm' output from all graphics utilities. Fixed. libplot: `offset' parameter of linedash() function, if nonzero, did not produce correct effect in WebCGM output. Fixed. libplot: when producing WebCGM output, libplot's `triangular' line cap style is now mapped to CGM's round line cap style, rather than CGM's triangular line cap style, since the latter disagrees with libplot's convention (taken from HP-GL/2) that the cap should be a stubby triangle, not an equilateral one. libplot: when a FigPlotter runs out of user-defined colors (511 appears to be the maximum), it now quantizes to the nearest standard or user-defined color. Previously, exceeding the maximum number of user-defined colors triggered a bug. installation: CFLAGS and CXXFLAGS may now be set at build time, i.e., if set, will not be ignored. Version 2.3 released, 10/1999. [Includes libplot 3.0, interface age=1.] graph,plot,tek2plot,plotfont,pic2plot: `-T cgm' option now allowed. The CGM version number and encoding scheme may be selected by setting the CGM_MAX_VERSION, CGM_ENCODING environment variables. libplot: CGM support added. By default, a CGM Plotter produces binary-encoded version-3 CGM format, which conforms to the WebCGM profile. Parameters CGM_MAX_VERSION, CGM_ENCODING are supported. libplot: X Plotters now support an X_AUTO_FLUSH parameter, with default value "yes". Set it to "no" to turn off the invocation of XFlush() after each drawing operation, which slows down some applications that use libplot's X Plotter support. libplot: when producing X11 output, box() and fbox() were drawing rectangles clockwise, beginning at the upper left corner, disagreeing with libplot's convention of drawing rectangles counterclockwise, beginning at the first-specified vertex. Fixed. libplot: new function pentype() added to the API. If its argument is 0, stroking of paths (as opposed to filling) is turned off. So, e.g., `edgeless polygons' can now be drawn. libplot: fixed the `zombie children' problem with the X driver. With each invocation of closepl(), a child process is forked off to manage a popped-up X window. Previously, if `q' was typed in a previously popped-up window, that window would close, but its process would turn into a zombie (still appearing in the process table). libplot: flinedash() was not acting correctly on Metafile Plotters unless the META_PORTABLE parameter was set to "yes". Fixed. libplot: width tables for the AlbertusMedium font, available when producing PCL5 and HP-GL/2 output, contained errors, giving incorrect positioning of text strings, e.g., by `graph -T pcl'. Now fixed. libplot: label() and alabel() operations, when applied to a MetaPlotter, now check that the argument string contains only characters in the printable ISO-Latin range. Other Plotters already did this. libplot: fixed problem with Illustrator Plotters sometimes changing line styles and other drawing attributes when erase() was invoked. graph,plot: `--max-line-length' option was incorrectly ignored; now fixed. libplot: MAX_LINE_LENGTH Plotter parameter variable was usually ignored; this has been fixed. tests: regression tests performed by `make check' now include tests on PCL5 output. graph: new `-H' option added. `graph -H' will draw a copy of the graph frame (including grid lines) on top of the data, as well as beneath it. This is useful if the plotted dataset(s) project slightly beyond the frame, due to large symbols or a large line thickness being used. libplot: for X, X Drawable, PNM, GIF, and PCL/HP-GL Plotters, introduced a convention for how to draw polylines all of whose vertices are mapped to the same pixel in integer device coordinates. Now drawn as a filled circle of diameter equal to line width, provided that either (1) the points in user space weren't all the same, or (2) they were all the same, but the cap mode is "round". (Line width 0 is treated as line width 1 here.) If neither (1) nor (2) holds, draw nothing. Tektronix Plotters now follow a similar policy on whether or not to display such polylines visibly. libplot: PCL and HP-GL Plotters no longer segfault (due to a stack blowout) when trying to render very small line segments or marker symbols. libplot: PNM and GIF Plotters were incorrectly displaying paths with line mode "disconnected" as a sequence of single pixels, rather than a sequence of filled circles of diameter equal to linewidth. Fixed. libplot: incorrect PCL font names Univers-Italic and Univers-BoldItalic changed to Univers-Oblique and Univers-BoldOblique. Similarly, UniversCondensed-{Italic,BoldItalic} renamed. libplot: new ROTATION parameter added, to provide support at the libplot level for the `--rotation' option of the command-line utilities. It rotates the viewport on the display device, without changing its position. The rotation maps vertices to vertices. libplot: default font when producing PCL5 output is now Univers rather than HersheySerif. libplot: on their output pages, PCL, Fig, PS, and HP-GL Plotters will now shift their viewports as specified in the PAGESIZE parameter/environment variable. E.g., its value could be "letter,xoffset=1in,yoffset=-2cm" or "a4,yoffset=+12mm", as well as just "letter" or "a4". Default viewport locations documented. libplot: PCL Plotters and Fig Plotters now position their viewports (i.e. "graphics displays") in the center of their pages, like PS Plotters. So support for the PCL_XOFFSET and PCL_YOFFSET parameters has been dropped. Support for HPGL_XOFFSET and HPGL_YOFFSET also removed for consistency, even though the default HP-GL viewport position has not changed. libplot: PS fonts Courier-Oblique, Courier-BoldOblique can now be requested under the names Courier-Italic, Courier-BoldItalic. Also, PCL fonts Courier-Italic, Courier-BoldItalic can now be requested under the names Courier-Oblique, Courier-BoldOblique. libplotter: fixed a very bad bug in the MetaPlotter output routine that was garbling output in non-portable mode. libplotter: fixed a very bad bug in warning-message and error-message handlers. Messages were being written to output stream, not error stream. libplot and graph: substantial changes to the code that plots marker symbols. The marker symbols that `graph' produces when `-TX', `-Tgif', or `-Tpnm' is specified are now much better-looking. graph: data files in the `table' format produced by recent versions of gnuplot can now be read, if the `-I g' option is specified. libplot: support for "triangular" join mode added to PNM and GIF Plotters. Partial support for triangular cap mode too (for single arcs, but not for polylines or arbitrary paths). Triangular joins and caps have the same meaning as in HP-GL/2. libplot and installation: libpthread, and support for pthreads (Posix threads) in libc, are now checked for at build time. If they're found, special support for multithreading is added to libplot. libplot: new thread-safe C++ API added (via PlotterParams object, passed to Plotter ctors). Old non-thread-safe C++ API still supported. libplot: new thread-safe C API added, with function names like pl_newpl_r() and pl_openpl_r(). Much hacking of libplot source code to make it thread-safe, but the old C API (non-thread-safe) is still supported. graph: improved the computation of the x and y ranges, if only partially specified by user. Now expanded to show, in full, truncated line segments between data points (if any). spline: some numerical instability problems fixed (tension parameter may now be taken extremely large without ill effects). libxmi: new low-level scan conversion library, containing the X11 rasterization code used by PNM and GIF Plotters. Installed as a standalone library, along with header file xmi.h, if `./configure --enable-libxmi' is done. Separate texinfo documentation installed too. libxmi will be distributed as a separate GNU package, also. installation: if gcc is employed, optimization option "-O2" is now used. Well-known strength-reduction bug in "gcc -O2" is checked for. tek2plot: each `point' in a Tektronix-type input file is now mapped to libplot marker symbol #1 (a dot). This improves visibility. libplot: marker symbol #1 (a dot) is now drawn in many output formats as a small filled circle, of diameter equal to one-fifth of the diameter of marker symbol #4 (an open circle). This improves visibility for the output of `graph -m 0 -S 1' (previously, in many output formats marker symbol #1 was too small to see). If this is too large, specify a second argument to the `-S' option. installation: --enable-lj-fonts-in-ps option now works (no more compilation problems). graph,plot,tek2plot,plotfont,pic2plot: fixed the output of `-T hpgl --list-fonts', which unlike `-T hpgl --help-fonts', was listing the names of some Stick fonts (i.e. HP vector fonts) that are inaccessible unless HPGL_VERSION is "1.5". installation: bizarre installation problem on powerpc-apple-machten4 systems (involving presence of .xcoff files) now worked around. (Configure script now ignores *.xcoff files.) Version 2.2 released, 3/1999. [Includes libplot 2.0, interface age=0.] libplotter: added support for iostreams. libplot: X Drawable Plotters can now use double buffering (a fatal error was identified and fixed, thanks to Georgy Salnikov). graph: increased number of orders of magnitude that a logarithmic axis may span, before ticks not at powers of ten are omitted. Was 4.0; now 5.0. Suggested by Martin Ward. graph: -R option sometimes caused crashing on logarithmic axes, since it could change the lower endpoint of the axis to zero. Fixed. libplot: values "yes" and "fast" for USE_DOUBLE_BUFFERING are now equivalent. If double buffering, X driver now automatically uses the DBE protocol extension (or the MBX extension) if available. libplot: X driver, very rarely, would sometimes block, waiting for user input such as mouse motion. Traced to blocking behavior of select(), invoked by XEventsQueued(), invoked by XtAppPending(). Problem now fixed (thanks, Nathan Salwen). libplot: Tektronix driver, when driving a kermit Tektronix emulator, can now set the background to any ansi.sys color. So commands like "TERM=kermit graph -Ttek --bg-color=green" now work. libplot: outfile() operation declared obsolescent. Now undocumented, and will eventually be dropped. libplot: fixed a bug in PCL and HP-GL Plotters that sometimes resulted in an infinite loop when drawing very short paths, or rendering text in very small font sizes. Thanks, Stefan Wagner. libplot: PCL and HP-GL Plotters now support "triangular" caps and joins, in addition to the three standard cap types and join types. pic2plot: new utility, which can translate the pic language to any supported graphics format, including X11. Based on James Clark's gpic. libplot: functions linedash()/flinedash() added to API, supporting arbitrary PS-style dashing styles. Most Plotter types support them. (Old, unused, Unix libplot `d' opcode now represents linedash.) libplot: fixed bug that was occasionally causing paths to be broken after circular arc segments, in some output formats. libplot: Appearance of HersheyEUC font improved by shrinking the stroke width. Also, row 1, character 1 of the font is now a full-width space, of the same width as any other Japanese character. plotfont: title of any character map for the HersheyEUC font now refers to `row' of font, not `page', and character numbering changed too. --jis-row option added, and --jis-page option declared obsolescent. libplot: non-solid line types ("dotted", "dotdashed", etc.) redesigned, and are now as device-independent as possible. libplot: new "dotdotdashed" line style added, supported by all Plotters except Tektronix Plotters. "dotdotdotdashed" added too. graph: font size, tick size, and symbol size are now specified as fraction of size of plotting box, where size means minimum dimension (width or height). Documentation clarified. graph: no more bogus error messages when `-N x' or `-N y' is specified. graph: --toggle-switch-axis-end option renamed --toggle-axis-end, and `-E' is made an alias for it. Also, conventions reversed: `-E x' and `-E y' now do what `-E y' and `-E x' would have done. graph: any of the three arguments to each of the -x and -y options (the min, max, and spacing values for an axis) may now be supplied as "-" (a single hyphen), to indicate that it should be computed from the dataset. E.g. "echo 0 0 1 1 2 0 | graph -x - 3 -" will work. libplot: paths may now contain segments that are quadratic and cubic Bezier curves. bezier2(), bezier3() etc. operations now included in API. Illustrator Plotters now draw each ellipse, elliptic arc, and circular arc using cubic Beziers, like Illustrator itself. libplot: fixed bugs dealing with multi-page HP-GL or PCL output files (e.g., pages were incorrectly merged into a single page). plot: parsing of portable metafile format is now more flexible. Arbitrary white space can be included in file. libplot: fixed bug in x_endpath.c that would occasionally cause X errors related to a bad drawable in an X_DrawPoints request. libplot: support for Adobe Illustrator version 3 format now obsolescent. Format still supported, but no longer mentioned in documentation. libplot,graph: fixed bug in drawing marker symbols 14,21,28 (fancy squares), and decreased sizes of symbols 30,31 (octagons). graph,plot: arguments of --font-size and --title-font-size arguments no longer allowed to be >=1.0. (By passing bogus values, lusers or nefarious users could crash X servers). libplot: fixed bug dealing with retrieval of X fonts rotated 180 degrees. graph,tek2plot,plotfont: new --rotation option (can rotate plots counterclockwise within the graphics display by 90, 180, or 270 degrees). libplot: new fillmod() operation. For self-intersecting paths, can now specify nonzero-winding-rule filling rather than even-odd filling. libplotter: new C++ library. Provides base Plotter class, subclasses for the different sorts of Plotter. Massive restructuring of code. libplot: if line width is zero, the X driver now draws each line in a polyline immediately (it doesn't wait until endpath() is invoked). So if you do `graph -TX -W 0', and type in the coordinates of a series of points manually, you'll now see the polyline drawn in real time, as long as you also use the `-x' and `-y' options. libplot: text string format now supports "\fP" macro for switching to previous font (cf. troff; "\fR", "\fI", "\fB" supported too). libplot: fmiterlimit() operation added to API. documentation: man pages for ode, spline, plot, tek2plot added. graph,plot,tek2plot,plotfont: `-T pnm' and `-T gif' now allowed. libplot: PNM driver added, which outputs PBM/PGM/PPM format. libplot: pseudo-GIF driver added, using miGIF run-length encoding routines (thanks, Maus and ivo). Incorporates X11 polygon filling and wide line code, as a more or less independent module. libplot: selectpl() now returns the handle of the previously selected Plotter. libplot: X Drawable and X Plotters now fill `rotated' ellipses (those whose axes are not aligned with the coordinate axes) more speedily, using the special X rendering algorithm for filling convex polygons. This speeds up the the `drifting eye' example in the manual. libplot: fixed bugs in handling of "disconnected" line type. Our convention: no Plotter should draw anything when circle() or ellipse() is invoked, if the current line type is "disconnected". Version 2.1.6 released, 10/1998. [Includes libplot 1.6, interface age=1.] plot: new `-s' option, which merges together all displayed pages. This is to assist people who are accustomed to concatenating Unix plot files together (GNU metafiles can also be concatenated together, but the resulting metafile does not merge pages). libplot: PS driver now correctly updates list of used PS fonts when erase() is invoked. This was causing ISO-Latin-1 fonts in multipage documents not to be reencoded correctly. libplot: Fig driver now places each drawn object at its own depth level. This is because fig2dev seems not to use xfig's own conventions for layering objects within a single depth level. libplot: Japanese page size "B5" now supported. So the `--page-size' option to graph,plot,tek2plot,plotfont now supports "B5" too. libplot: Fig driver now properly supports "dotdashed" line type, since it is supported in Fig 3.2 format. So `graph -m 3 -T fig' now works as it should. libplot: Fig driver now produces Fig 3.2 format, so xfig 3.2 is required to view and edit it. This affects output obtained with `-T fig'. plot.h: marker symbols and metafile op codes are now defined as enum's, rather than via #define's. graph,plot,tek2plot,plotfont: `-T ai' option added, for Illustrator output. libplot: Adobe Illustrator driver added, outputting either Illustrator file format version 3 or version 5 (latter is default). plot.h: old workarounds for change in 2.1 from `endpoly' to `endpath' and from `fill' to `filltype' finally removed (they were conflicting with a Debian package). libplot: in each Hershey font, stroke width increased by about 20%, to remove white (i.e. unfilled) space in some characters. libplot: when space() is invoked, X Plotters no longer attempt immediately to retrieve a font from the X server (they wait until fontname/fontsize/textangle is next invoked, or failing that, until alabel/labelwidth is). This reduces the chance of failing to retrieve a too-small or too-large X font. libplot: in metafiles, separate op codes for frotate, fscale, ftranslate operations now obsolete (they are mapped into fconcat, internally). libplot: fixed bug in Metafile Plotter support for convenience operations frotate, fscale, franslate. libplot: fixed inelegance in Metafile Plotter portable output (a couple of op codes needed only for binary-format were being emitted). libplot: HP-GL and PCL Plotters now emit more compact code for any path that contains more than a single circular arc (the HP-GL `AA' instruction, rather than a polygonal approximation, is now used). libplot: new internal `path' structure now used (a linked list of elements). libplot: invocations of space() on a Plotter, after the first mandatory invocation for each page, no longer affect the line width or font size in terms of user coordinates. This is for consistency with fconcat() and for consistency with Postscript. Postscript does not change user-frame line widths or user-frame font sizes when the affine map from user coordinates to device coordinates is updated. libplot: No more bogus warnings issued by Metafile Plotters if they're asked to render a label in a non-builtin font, e.g. a non-PS X font. (This removes some bogus warning messages from raw `graph'.) graph/plot/tek2plot/plotfont and libplot: in code, exit(1) replaced by exit(EXIT_FAILURE) to improve portability beyond Unix. Version 2.1.5 released, 8/1998. [Includes libplot 1.5, interface age=1.] texinfo documentation: full explanation given of the 18 supported Hewlett-Packard vector fonts, also known as `stick fonts'. libplot: escape sequences added for the 12 signs of the zodiac; they are recognized in labels whenever the current font is a Hershey font. libplot: new escape sequences "\r^" and "\l^" added, for use in labels; they shift right and left by 1/12 em, respectively. (Cf. troff.) libplot: 3 missing Japanese Katakana added to the HersheyEUC font (they are the 3 that have no Hiragana counterpart). graph,plot,tek2plot,plotfont: `-T pcl' option added, for PCL 5 output. libplot: PCL 5 driver added; it essentially outputs HP-GL/2, with a preceding control sequence to switch the printer or plotter from PCL 5 mode to HP-GL/2 mode, and a following control sequence to switch back. plot: parsing bug fixed; files may now be listed on command line. configure: options now include `--enable-ps-fonts-in-pcl', `--enable-lj-fonts-in-ps', and `enable-lj-fonts-in-x'. Previous option `--enable-lj-fonts' was split into final two. libplot: HP-GL/2 driver now supports the 35 PS fonts. So e.g. in principle `plotfont -Thpgl Helvetica > map.plt' will work, allowing a PS character map to be displayed on a PCL device. But PS fonts are available only on high-end PCL devices, e.g., 4000-series LaserJets. libplot: when drawing labels in any of the 43 ISO-Latin-1 PCL fonts, HP-GL/2 driver previously displayed five characters (-, `, ', ^, ~) incorrectly. Final four of these were displayed as accents. Problem was traced to HP's idiosyncratic definition of ISO-Latin-1 ("ECMA-96 Latin-1"). Now fixed. Version 2.1.4 released, 7/1998. [Includes libplot 1.4, interface age=1.] libplot: HP-GL driver now supports 8 Stick fonts (device-resident vector fonts) when producing HP-GL/2 output, and 18 Stick fonts when producing output for an HP7550A plotter (HPGL_VERSION="1.5"). Not yet documented because kerning is being worked on, but they show up when `--help-fonts' or `--list-fonts' is used. libplot: HP-GL driver, if HPGL_VERSION is "1.5", will no longer attempt to use pen #0 as a white pen, when filling polygons that are meant to be filled with white. graph, plot, tek2plot, plotfont: no more segmentation faults when using the `--help-fonts' or `--list-fonts' options. Version 2.1.3 released, 7/1998. [Includes libplot 1.3, interface age=1.] plotfont: new `--numbering-font-name' option. libplot: color was not being updated (if necessary) before rendering labels in HP-GL[/2] output. Now fixed. libplot: default value for HPGL_PENS parameter/environment variable is now "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan" when HPGL_VERSION is "1.5", as well as when it is "2". tests: validation tests may now be run even if the build directory is different from the source directory (thanks Thomas Walter). tests: bug in test for HP-GL/2 output fixed (thanks Thomas Walter). Version 2.1.2 released, 7/1998. [Includes libplot 1.2, interface age=1.] libplot: any polyline with "disconnected" line type is now drawn as a set of filled circles, one centered on each defining point. Circle diameter is chosen to be the nominal line width. libplot: PS driver previously did not quite close large filled circles and ellipses, leading to an `inverse pie-wedge' effect. Now fixed. libplot: previously the HP-GL driver required that HPGL_VERSION be "1" to produce paths, arcs, etc. that would be positioned correctly on generic HP-GL (as opposed to HP-GL/2) devices. No longer absolutely necessary: HP-GL/2 line graphics produced by the driver should be positioned correctly even when erroneously sent to an HP-GL device. Fonts do not work, however. libplot: HP-GL driver now visibly displays zero-length line segments, if cap mode is `round' or `projecting'. libplot: dot/dash spacing in the "dotted", "dotdashed", "shortdashed" and "longdashed" line types, as produced by the PS, Fig, HP-GL/2, and X11 drivers, now scales with line width. This affects the lines produced by the `-m' option to `graph', when used with `-W'. spline, double: now permit comment lines in ascii input files, like `graph'. double: default is now to print all fields, i.e., `-f' option is not needed in order for the program to function. Instructions on using `double' added to double.c, but not yet to texinfo documentation. libplot: when producing HP-GL/2 output, can now use 8 builtin HP-GL/2 vector typefaces (Arc as well as Stick; usual 4 variants for each). libplot and utilities based on it: installation-time option "--enable-lj-fonts" allows use of PCL fonts when using `-T X' or `-T ps' options. For this to be meaningful, installer must obtain the 45 PCL (i.e. LaserJet) fonts from Hewlett-Packard and install them. They are available for free via the net (see instructions in ./INSTALL.fonts). libplot: small errors in positioning text strings, when producing PS output, now fixed. The bug only appeared when rendering non-Courier text strings with nonzero angle of inclination. libplot: X Windows names of several of the 35 supported PS fonts to agree with current conventions. (Old names continue to work.) "avantgarde-medium-r-normal" is now "itc avant garde gothic-book-r-normal", "zapfchancery-medium-i-normal" is now "itc zapf chancery-medium-i-normal", etc. libplot: In HP-GL/2 driver code, fixed slight errors in positioning text strings, when rendered in the PCL and Stick fonts. Errors were due to an unusual HP-GL/2 `leftward shift' label positioning convention dating back to pen plotter days. texinfo documentation: Fixed incorrect statement that for `plot' and `tek2plot', the relative order of filenames and command-line options matters. graph,plot,tek2plot,plotfont: --rotate option dropped, and ROTATE environment variable renamed to HPGL_ROTATE. `Rotation' only occurs if `-T hpgl' is specified, and HP-GL[/2] output is produced. So by our coding standards, it doesn't deserve a command-line option. libplot: ROTATE Plotter parameter, which affected only HPGL Plotters, renamed to HPGL_ROTATE. (It doesn't provide a pure rotation; in HP-GL, `rotation' includes a coordinate shift as well.) plotfont: new utility, displays either half of any recognized font. Which fonts are recognized depends on the output device (set with -T option). `plotfont -T X' will also display any X font specified by [truncated] XLFD name, e.g. "utopia-medium-r-normal". By doing e.g. `--bitmap-size 300x450' you can scale fonts anisotropically. libplot: HP-GL driver had two characters out of place in the upper half of the Stick font. Fixed. libplot: all substitutions of fonts (due to lack of availability) and colors (due to color names not being recognized) now yield a warning message. However, only the first font warning message and the first color warning message of each sort (pen color, fill color, background color) is actually emitted. graph,plot,tek2plot: new --list-fonts option. libplot: On X11R6 displays, X driver now rasterizes and retrieves only the characters in any scalable font that will actually be used in drawing a text string. This _enormously_ speeds up the drawing of text strings and the animation of text. libplot: default value of Plotter parameter HPGL_OPAQUE_MODE is now "yes" rather than "no", for consistency with libplot's imaging model. Some rather old HP-GL/2 devices (large pen plotters?) are reported to malfunction if asked to switch from transparent mode to opaque mode. Set the parameter to "no" for such devices. configuration: now checks for -lXp if --with-motif is used (for Motif 2.x). libplot: X driver now treats absurdly small numbers passed back from some X11R6 servers when requesting fonts rotated by 0 or 90 degrees (e.g., 4e-311) as zero. Such numbers are too small to be manipulated arithmetically on DEC Alphas, and caused floating point exceptions in `graph -T X' when the `-Y' option was used. all utilities: output of --help option now includes an email address for reporting bugs. package: several small changes made to ensure it will compile under DOS with DJGPP (thanks Michel de Ruiter). libplot: X Plotters now support hardware (i.e. server-supported) double buffering, if available. Set USE_DOUBLE_BUFFERING to "fast" to obtain it. Both DBE and MBX, of the standard X11 double buffering extensions, are tried. libplot: output of PS driver now fully conforms to the PS DSC (Document Structuring Conventions). If output is only a single page of graphics, it is in EPS format. libplot: Plotters that do not do output in real time (i.e. Fig, HP-GL, and PS Plotters) must now, in general, be deleted in order for an output file to be written. That is, _in general_ each page is not emitted when closepl() is called. In practice, pages are still emitted when closepl() is seen, for Fig and HP-GL Plotters. But PS Plotters now do not emit anything until deletepl() is called. libplot: fixed bugs dealing with Greek and mathematical symbol escapes in text strings, when the current font is a user-specified X Windows font (e.g. "utopia-medium-r-normal" or "vtsingle"). When the user-specified font is an ISO-Latin-1 font, the usual ISO-Latin-1 escape sequences (e.g. "\sc" for the section symbol) now work also. This fixed problems with `graph' labels. libplot: Fig Plotters now produce only a single page of output, irrespective of how many times openpl..closepl are invoked. Only the first page of graphics is written to the file, since Fig format currently supports only a single page of graphics. libplot: Tektronix driver now visibly displays zero-length line segments, if cap mode is `round' or `projecting'. libplot: HersheyGothic-German font renamed HersheyGothicGerman, etc. (Former font names continue to work.) Similarly, HersheySerif-Symbol and HersheySans-Symbol fonts renamed HersheySerifSymbol and HersheySansSymbol. Oblique, Bold, BoldOblique variants added to former; Oblique variant added to latter. Similarly, HersheyCyrillic-Oblique added. HersheySerifSymbol-Bold is based on Allen Hershey's Triplex Greek alphabet. There are now 22 Hershey fonts in all. libplot: Hershey glyph database updated. Now incorporates Allen Hershey's final revisions, and his Triplex Greek alphabet. That alphabet does not appear in most releases of the Hershey glyphs, since it was developed c. 1990. See ./doc/h-fonts.doc, ./doc/h-glyphs.doc. Version 2.1.1 released, 5/1998. [Includes libplot 1.1, interface age=1.] libplot: to permit smooth animations, double buffering is now implemented for X and X Drawable Plotters. Double buffering is turned on if a new device parameter, USE_DOUBLE_BUFFERING, is set to "yes" at Plotter creation time. Successive frames of graphics are separated by invocations of erase(). libplot: X and X Drawable Plotters now maintain a local cache of X color cells, and no longer automatically allocate new one(s) for each plotted object. This speeds up rendering, and avoids a memory leak in the X server. If color cells in the standard colormap are exhausted, an X Plotter (but not an X Drawable Plotter) will switch to a private colormap. libplot: new device driver parameters, BG_COLOR and XDRAWABLE_COLORMAP. Former allows background color of an X or X Drawable Plotter to be specified at creation time; latter adds support for non-default colormaps. libplot: setting unrecognized parameters with parampl() no longer yields a warning message. libplot: bug in point() that affected X Drawable Plotters now fixed. libplot: erase() now acts correctly on X and X Drawable Plotters: any path under construction is flushed out before erasure. libplot: nearly all internal read-only tables now defined as `const', so that on most systems the linker will place them in a sharable read-only data section. libplot: X driver now visibly displays zero-length line segments, if cap mode is `round' or `projecting'. This fixes a problem with `tek2plot -TX', since Tektronix files use zero-length lines as points. tek2plot: now uses rounded cap mode for line segments obtained from vectors, to improve visibility of zero-length lines. Rounded join mode now used too, to smooth out curves. texinfo documentation: now processed correctly by texi2html. Version 2.1 released, 4/1998. [Includes libplot 1.0, interface age=1.] graph: may access the new Euro currency symbol by using the '\eu' escape sequence. This may be used when labelling the axes of graphs, etc. Accessible whenever the current font is a Postscript or PCL font. Be sure to install the Postscript fonts accompanying the plotutils distribution on your X server, if you want to see it. Whether or not you see the new symbol when you send a plot to a Postscript or a PCL printer, depends on whether or the printer has up-to-date firmware. (E.g. HP LaserJet 5's don't.) libplot: may access the new Euro symbol, when drawing text strings in a Postscript or PCL font, by using the '\eu' escape sequence. fonts: included Type1 Symbol font, from URW++, now includes the Euro glyph (the new European currency symbol). libplot: a bug in handling of an empty plot, i.e. openpl() immediately followed by closepl(), now fixed. (This situation caused garbage output from several drivers.) libplot: X driver no longer prints a warning message when substituting a Hershey font for an unavailable PS font. (Substitution often occurs when the X server doesn't support anamorphically transformed fonts, e.g. if it's a pre-X11R6 server.) Warning message was confusing `graph' end-users. libplot: fixed a bug in X driver that was selecting fonts based on point size rather than pixel size, leading to different-sized labels on X displays of different resolution. This affected graph,plot,tek2plot. libplot: fixed a sign error in x_erase.c that prevented erase() from working on Sun's OpenWindows 3.0 X server, and other early X11 displays; this affected graph,plot,tek2plot. graph,plot,tek2plot: --bitmap-size option added, affecting output on X displays only. libplot: added BITMAPSIZE device driver parameter, which currently affects only X Plotters (sets size of popped-up window). plot: new --page-number option, cf. tek2plot. graph,plot,tek2plot: on X11R6 systems, now linked with -lSM -lICE in the correct way (-lSM -lICE -lXext -lX11 follows -lXt on command line). This previously caused problems on cygwin32 systems. libplot: X Drawable Plotters now use parameters XDRAWABLE_DISPLAY etc., in accordance with documentation, rather than X_DRAWABLE_DISPLAY etc. tek2plot: when parsing multipage Tektronix files, now calls openpl()..closepl() on each page. So `tek2plot -TX' now yields multiple X windows, unless the --page-number option is used. libplot: PS driver hacked so that output, when openpl..closepl is invoked more than once, is closer to conforming to the PS DSC (document structuring conventions). You may modify the PS file so that it is fully conformant (remove extraneous %%EOF's, i.e., all but the final one, and correct the pagecount on the %%Pages line). When openpl..closepl is invoked only once, it is fully conformant. graph,plot,tek2plot: --bg-color option added, for use on X displays only. libplot: new bgcolor() and bgcolorname() functions added to API. They affect only X and X Drawable Plotters. Libplot API version bumped to 1:0:1 (i.e. version 1.0, supporting 0.x interface also). graph: new --pen-colors option, allowing the specification of the color of each of the five pens used for drawing colored plots. The default choice is the usual "1=red:2=green:3=blue:4=magenta:5=cyan". spline: some numerical instability problems fixed (tension parameter may now be taken arbitrarily close to zero without ill effects). spline: support for multidimensional splines added (-d, -s, -A options) spline: now tests for monotonicity of abscissa variable in each dataset graph,spline,double: now test for NaN's (not-a-number's) when reading floating point numbers from an input file. plot already did this. plot: When reading input files in plot(5) format, negative integers (i.e. negative integer coordinates) now parsed correctly. plot: Multiple '\n' separator characters now ignored in portable GNU metafiles, and in input files in `-A' format too. plot: -A option (replacing -I, which disappeared with 1.x) added and documented. It enables metafiles in the ascii version of plot(5) format (e.g., obtained with Unix plottoa(1)) to be plotted; also it will handle portable GNU metafiles generated by plotutils-1.x. Version 2.0 released, 1/1998. [Includes libplot 0.0, interface age=0.] Installation process now installs (by default in subdirectories of /usr/local/share) documentation files for ode, tek2plot, and libplot. libplot: a new type of Plotter added. An `X Drawable Plotter' will draw graphics to one or two drawables (e.g. a window and a pixmap). spline, tek2plot: "-" on command line now means standard input. libplot: function declarations in plot.h header file now use `const char *' as appropriate. parampl() now takes a void * as value argument. libplot: semantics of "disconnected" linetype clarified. For ellipses, circles, and boxes it's the same as "solid". For paths, it means the defining points are plotted, and nothing else (it's irrelevant whether they were joined by line segments or arcs). libplot: invoking deletepl() on an XPlotter now sends a SIGKILL to the forked-off processes maintaining each of the X windows generated by a openpl()..closepl() pair, causing said X windows to vanish. libplot: metafile driver now has access to metrics for Hershey, PS, and PCL fonts. So it can compute string widths with the labelwidth() method. libplot and plot: graphics metafile format now supports `open device' and `close device' directives, as in Plan 9. spline: -x option (--x-limits) replaced by -t (--t-limits), in preparation for a move to multidimensional splining. --tension option moved accordingly from -t to -T. Yes, this smacks of overloading. libplot: box() now moves graphics cursor to midpoint of the box, not the second-specified vertex. graph, spline, double: support for two additional binary input/output formats, namely single-precision floating point and integer. libplot: new user-settable error handlers added as global variables (libplot_error and libplot_warning; former is fatal). plotutils: package converted to use automake and libtool. libplot: falabel() dropped from the API, and alabel() no longer returns a value related to the width of the label. This is in preparation for a more object-oriented version of the library. If you need to get the width of a label, use flabelwidth() or labelwidth(). libplot: undocumented dot() function dropped from the API. Seems last to have been used in Unix libplot on a Bell Labs PDP-11 in the mid-'70s, driving a Tektronix 611 ("Versitek") storage scope. (Thanks Lorinda Cherry for background info!) graph,plot,tek2plot: --ascii-output option renamed --portable-output. libplot: all 45 fonts resident in PCL 5 devices such as recent HP LaserJets are now supported by the HP-GL/2 driver. Traditional Stick and Stick-Bold fonts supported too. libplot: font size can now be set to zero without unexpected consequences. libplot: improper affine transformations from user to device coordinates, i.e., those that involve a reflection, now fully supported. Many bugs dealing with them, in all device drivers, were fixed. libplot: fallback font for nonexistent or inaccessible X fonts is now a Hershey font. (No more problems with old X servers not being able to retrieve rotated or sheared fonts!) Similarly, retrieving an anamorphically transformed PS font from the xfig driver will now yield a Hershey font, since xfig does not support anamorphic transformations (only rotations). graph,plot,tek2plot: display device type now specified with `-T' option. libplot: support now added for multiple display devices. The libplot family of libraries is merged into a single library. The C binding supports multiple display devices through new functions newpl(), selectpl(), and deletepl(). libplot: code completely reconfigured, internally, in preparation for a C++ binding. Now quite object-oriented, including a form of dynamic binding. `Plotter objects' introduced, each with private data and public methods. libplot: all external variables now begin with an underscore, to avoid namespace collisions. libplot, all versions: new havecap() function, which checks a version of libplot for capabilities (0/1/2=yes/no/maybe). Replaces the undocumented external capability variables. raw libplot: binary metafile format now uses ints rather than short ints to represent integers. Plot filters changed to compensate. Plot filters should still parse traditional plot(5) input format, however; if there are any problems, be sure to use the -h or -l option, whichever is appropriate for your architecture. plot: undocumented --guess-byte-order option dropped as obsolete. graph: line width used in drawing marker symbols is now properly device-independent, and a fixed fraction of the marker size. graph: --help-fonts option now yields nicely formatted 2-column lists of fonts. libplotps: BoundingBox computations now take line widths into account, cap styles and join styles too. libplotps and graph-ps: line widths are no longer quantized, as seen by a Postscript interpreter (they continue to be quantized when the output file is edited with idraw, since idraw supports only line widths that are integer multiples of 1 point). libplotX: setting join mode for polylines no longer core dumps. libplot, all versions: "mitre" is now a synonym for "miter" (i.e. as an argument to the joinmod() function). libplotX (and graph-X etc.): previously, xplot.geometry resource needed to be set, to adjust window size. Now, Xplot.geometry suffices, in agreement with documentation. tek2plot: new -p option, to select frame in Tek file by number. tek2plot: Tek parser completely rewritten (now uses essentially the same parse tables as the Tek emulator in xterm(1), developed by Edward Moy at Berkeley in the mid-'80s). tek2plot documented. graph: bug in plots with a user-specified reversed (min > max) axis fixed (axis range on other axis no longer incorrectly set). ode/specfun.c: gamma support now always works (no more compilation problems). New libplot function, parampl(), for setting device-specific driver parameters. Can also set them via environment variables (parampl() wins). All user-writable external variables removed from libplot (they were undocumented, in fact anything undocumented is subject to change). libplottek: `graphics display' (a square) is now central 3/4 of Tek display rather than left 3/4. This affects graph-tek and plot2tek. tek2plot command-line parsing improved. --pen-color initialization and --help-fonts command-line options added. graph: Partial workaround of problem with xfig 3.1: text strings containing a printable 8-bit (non-ascii) char, followed by a digit, are incorrectly displayed by xfig. Fixed in xfig 3.2. Output from libplotps now uses idraw `Circ' primitive instead of `Elli' to draw circles. Plot filter options --{high|low}-byte-order renamed to --{high|low}-byte-order-input. Also, -I option dropped as unnecessary (due to magic string). Continues to exist, but is now undocumented and flagged for deletion. Each graphics metafile produced by raw libplot (or raw graph, or plot2plot) now begins with a magic string, currently "#PLOT" followed by the metafile format number. libplotps: capmod() and joinmod() now take effect (non-default cap style and join style are not recognized by idraw, however). graph: --{high|low}-byte-order options now dropped as obsolete. Plot filter parser overhauled. plot filters should no longer crash on garbage input (keep fingers crossed here). If input file named on command line is nonexistent, plot filter no longer opens stdin instead. Improved parsing of graph command-line options. Bad syntax now recognized immediately, without data files or stdin being read. libplothpgl: new libplot library, by default emitting HP-GL/2. plot2hpgl and graph-hpgl are linked with it. Many options specified via environment variables (HP-GL and HP7550A format also supported). In raw libplot, space2() produced wrong plot(5) op code. Now fixed. Bad problems with fill color in libplotps now fixed (quantization for idraw was interfering with fill color as seen by a PS interpreter). New convention on quantization of pen colors in versions of libplot which quantize them (libplothpgl unless HPGL_HAVE_LOGICAL_PENS is set and HPGL_VERSION is 2, libplotps when producing colors for idraw, libplottek when producing kermit output). Non-white pen colors are no longer quantized to white, to avoid confusion. In several versions of libplot, calling endpoly() on polylines with linemode "disconnected" was incorrectly moving the graphics cursor. Now fixed. libplot: New `plotter-like' semantics for arc() and ellarc(). After drawing, position of graphics cursor now moves to endpoint of arc. libplot: arc() now draws an arc with sweep angle no greater than 180 degrees, which may be clockwise as well as counterclockwise. Also, ellarc() now always draws a quarter-ellipse, never a three-quarter ellipse. Remaining positioning problems in graph-fig and libplotfig fixed: later-plotted objects now never placed `behind' previously plotted ones. libplotps and graph-ps: PS_ANY_LINE_WIDTH environment variable now supported. If set to "yes", no quantization of line widths; arbitrarily thin lines may be drawn, but support for editing the PS output with idraw is lost. libplotps,libplotfig,libplothpgl: PAGESIZE environment variable now supported, can be any ISO or ANSI size such as "a4", "a3", "a2", "a1", "a0", "letter" (i.e. "usletter" or "a" ), "legal" (i.e. "uslegal"), "ledger" (i.e. "usledger"), "tabloid" (i.e. "b"), "c", "d", or "e". libplot: calling closepl() to end a plot, when there is one or more drawing states on the stack, no longer generates a warning message. libplottek: exiting from kermit Tektronix emulation mode no longer incorrectly affects text color. libplotX: in Motif, drag-and-drop via middle mouse button should now work. Version 1.3 released, 9/1997. Major improvements to process of configuration and building (thanks to Nelson Beebe , many new configs now work). Validation test of plot2fig no longer fails on some systems due to innocuous causes (sign differences). This does not include NeXT's, which format floating point numbers in a genuinely nonstandard way. Output of libplotfig and graph-fig now indicates (via comment lines) which ellipse objects are circles. Bugs in support for MS-DOS kermit's Tektronix emulation fixed: initial drawing color now is white, background black. TERM="kermit", "kterm" now recognized. Linemodes 3, 4 no longer incorrectly swapped. Library linking (if Athena widgets used) is now -lXmu -lXt, not the reverse. ode: improvements to arithemetic exception handling (error or warning message now always printed). ode/specfun.c: `signgam' variable declared and used properly. Problems with pointers to signed vs. unsigned chars, which gave problems on overly strict ANSI or pseudo-ANSI compilers, fixed. Version 1.2 released, 9/1997. Problems with 8-bit characters (`8-bit uncleanliness') fixed in libplot. In `graph', they affected the drawing of axis labels containing 8-bit characters. graph: buggy --reposition option fixed. --with-motif configuration option added, for systems (e.g. HP/UX) with Motif widgets but not Athena widgets. libplotps (and e.g. graph-ps) output is now conformant EPS, version 3.0. No more spare dictionary left on the PS stack, which interfered with inclusion as an EPS file and importing into xfig. Escape sequences which allow access to Greek characters and mathematical symbols (e.g. "\*a", which means `alpha') now work in graph-X and in general in libplotX even if the current font is a non-builtin (user-specified) X font. libplotX: switching among builtin PS fonts in a single label was causing slightly incorrect estimates for the label width, with not-so-good horizontal justification as a result (visible e.g. in graph-X labels). Fixed. raw libplot: functions that take a string argument no longer try to write into the string. graph: when labelling ticks along an axis with large or small numbers (printed in exponent form, i.e. FOOx10^BAR), zero is now printed just as `0', not as 0.0x10^0. graph: FOOx10^BAR form for tick labels now works even when current font is a symbol font. graph: identical upper and lower limits on an axis no longer cause an error message and an abort. Instead each limit is displaced by 1 unit, with a warning message. graph: -s option (--save-screen) now works. (Meaningful only for graph-tek and raw graph.) libplotfig: later-drawn objects, of whatever kind, now appear in front of (rather than behind) earlier-drawn objects. This has implications for graph-fig (it fixes a bug previously mentioned in the PROBLEMS file). graph: new --frame-color option (sets name of color of frame, and plotted curves too if -C option is not used) New libplot functions: pencolorname(), fillcolorname(), colorname(), which search a database of color names (orig. from X11R6 rgb.txt). New libplot function: pencolor(). color() now just calls it and fillcolor(). plot filters: bug in parsing of fmarkerrel() op code fixed. plot filters (plot2X etc.) now abort instead of just printing a warning, if an unrecognized directive is seen in the input stream. This is to avoid confusing ascii-format input streams with binary-format input streams (which can cause X servers to crash). Regression tests in ./test reworked; different options now used on `graph', in the tests. Output is more visually pleasing. ode-examples directory reworked; examples are documented and some are renamed. ode arithmetic exception handling improved. Separate ascii-format doc on ode (originally nroff) merged into texinfo doc, heavily edited. In ./ode, gram.c, gram.tab.h and lex.c are no longer removed during a `make distclean'. This is for the benefit of people who may not have bison or yacc. If you want to re-make them, you should do a `make realclean'. The info/plotutils.info documentation file and test/*.xout are similarly not removed except in a `make realclean'. No more annoying flicker in graph-X after plot is drawn (libplotX no longer clears window before redrawing, when closepl() is called). alloca.c now supplied in ./ode directory for machines that don't have alloca. Repeated calls to openpl..closepl in libplotps were producing incorrect %%DocumentFonts lines in the PS output; now fixed. Closed polylines (final vertex = initial vertex) drawn with libplotps now close correctly, as seen by a PS interpreter. Widths of lines drawn with libplotps, as displayed by idraw, now agree with the widths seen by a PS interpreter such as Ghostscript. If lines now look too thick, use the zero-linewidth (`-W 0') option. Octagonal markers added (markers #30 and #31), as in UGS marker set. Bug in special function code (used by ode), for machines that don't have them, now fixed (compilation of ode/specfun.c no longer bombs). Hershey fonts now include Russian HersheyCyrillic, and HersheyEUC (for Japanese support; Hiragana, Katakana, and 603 Kanji are supported). HersheyScript is now located in its own typeface; HersheySans-Oblique and HersheySans-BoldOblique created. Ligature support added to certain Hershey fonts. ISO-Latin-1 characters in Hershey fonts now include most accented characters. Characters missing from Hershey fonts now print as an `undefined character' symbol (seven horizontal strokes). Hershey astronomical and misc. symbols added. Many miscellaneous cleanups to Hershey fonts (inverted questionmark and exclamation point now supported, for example; `asteriskmath' vertical height fixed, etc.). plot.h now works with C++ as well as C Version 1.1 released, 7/1997. See ONEWS for earlier changes. plotutils-2.6/THANKS0000644000175000017500000000337011257235762011271 00000000000000Thanks go to each of the following people, who were kind enough to spend time installing and testing the plotutils package, and report bugs and obscurities. The package would not be what it is today without the aid of volunteers. Aaron King Albert Chin Bart De Schutter Bernhard Reiter Brian Gough Charles Karney Daisuke Tominaga Dave Bodenstab Diomidis Spinellis Eric Backus Frederick W. Wheeler Georgy Salnikov James Anderson John Lapeyre Jonathan Woithe Juergen Pfeifer Keir E. Novik Keith M. Briggs Klamer Schutte Larry Schwimmer Magnus Weis Maohai Huang Mark Dalphin Martin Ramsch Martin Ward Massimo Santini Michel de Ruiter Nathan Salwen Nelson H. F. Beebe Peter Whiting Piotr Klaban Rob Browning Robert D. Keys Roberto Abraham Stefan Wagner Takafumi Hayashi Thomas Walter William M. Mullins Wolfgang Glunz plotutils-2.6/TODO0000644000175000017500000003562111234147135011041 00000000000000Greater priority ---------------- libplot: take account of the fact that many versions of the Symbol font (in PS output, at least) now have the Euro symbol in position #160 of the ISO-Latin-1 encoding, rather than having a (nonbreakable) space. libplot: enhance the SVG driver to keep track of whether the output is consistent with the `Full' or `Tiny' SVG profile. The only relevant differences appear to be that in SVGT, "all numbers must be limited in range between -32,767.9999 to +32,767.9999 or the scientific notation equivalent", and that when drawing paths, the elliptical arc commands `A' (absolute ell. arc) and `a' (relative ell. arc) are not available. libplot: enhance the SVG driver to use SVG's .. construct for styling and positioning substrings. Our present scheme for changing fonts, adding subscripts, etc., in the middle of a label, works fine if the font(s) are available on the SVG viewer and have the metrics we believe they do. But either of those two assumptions may fail. So the .. construct should always be used. Nested tspans will be needed. Note: SVGT does not support tspans. libplot: enhance the SVG driver to adjust the width of text strings to be what it should be, according to our internal font database. This is important if a requested font is unavailable. libplot: decide whether to provide a workaround for a font problem in recent releases of XFree86: the Type 1 versions of the Symbol and ZapfDingbats font use an erroneous coding scheme (character codes are offset by 0x20 = 32). libplot: improve the handling of compound paths to support non-nested subpaths, i.e. multiple simple paths that may intersect each other, as well as themselves. For this, use Raph Levien's libart? SVG Plotters already support non-nested subpaths, though it isn't documented. libplot: add support for a user-level `closepath' operation. Internally, drawing of Hershey fonts should use it. libplot: to CGM Plotters, add support for the version-4 WebCGM features, i.e., hyperlinks based on CGM `application structures'. Maybe set up a standard way of defining hyperlinks, which could be used by SVG and Illustrator Plotters too? libplot: add the display list concept, i.e. retained 2-D graphical objects (will also facilitate adding support for compound objects and redrawing). libplot must become more widget-like; cf. guppi. libplot: support copying graphics from one Plotter to another (e.g., via display list; cf. OpenGL). libplot: support object-level clipping, via computation of a bounding box; maybe precise rectangle-level clipping too? Will require addition of clipping support to libxmi. Maybe PS-style clipping by arbitrary paths? If so, a new PS-like drawing model, with a new interpretation of savestate/restorestate, will be needed. libplot: add support for gradient fill. Which output formats provide native support for it? WebCGM, SVG and Illustrator certainly do. graph: continue librarifying the plotting routines, and incorporate them in libsciplot? Maybe a GUILE interface? graph: need better clipping for filled regions (present gnuplot-style clipping scheme is right for unfilled regions but wrong for filled ones) libplot: add support for compound objects (supported by Fig, idraw, AI). Support should be compatible with support for SVG's `containers'. libplot: add support for rectangular raster objects ("device independent rasters"). Supported in SVG and CGM format, etc. libplot: add support for tiling of paths (with device-dependent rasters). libxmi already supports this. libplot: compare its functionality with other graphics libraries, e.g. Allegro's shading and texture-mapping features, and gd. Intermediate Priority --------------------- libplot: extend parsing of BITMAPSIZE parameter to include options xsize,ysize,xorigin,yorigin,xoffset,yoffset, just like PAGESIZE. This would affect the graphing utilities (--bitmap-size option, when producing bitmap output, would be invoked similarly to to --page-size). libsciplot: new graphing library. Incorporate all functionality of VOGLE, PGPLOT, and PLPLOT libraries; check into GLE, PLOTPLUS, XYPLOT, DISLIN (not open-source; see http://www.linmpi.mpg.de/dislin/). Think about Guile, and Tcl/Tk, and Python. libsciplot will support contouring, but not 3d surface plots yet. libsciplot: when plotting a curve containing data points, symbols should be plotted _last_, after endpath() is called. libplot: In Illustrator format, colors may be specified by CMYK values or (in recent Illustrator versions) by RGB values. Illustrator's mapping between them is not documented, and does not seem to be the usual one. When generating Illustrator format we use CMYK, but maybe we should use RGB instead? libplot: distinguish between PSPlotter and IdrawPlotter (latter will use current PSPlotter code for emitting `stateless PS', former has yet to be written). libplot bitmap Plotter support: add sub-parameters to the BITMAPSIZE parameter, for specifying offset of viewport within bitmap? Clipping too? pic2plot: extend parser to support the Bell Labs `picasso' constructions (extensions of the pic grammar). libplot: use freeware rasterizer for type 1 fonts [t1lib, by Rainer Menzner; see ftp://ftp.neuroinformatik.ruhr-uni-bochum.de/pub/software/t1lib ]. Or, if patent worries can be overcome, FreeType or FreeType2. libplot: PNG driver should optionally use indexed rather than true color. Also, should include a user-specifiable gAMA chunk? libplot: add alpha support to color specification. Maybe via new operations penalpha(), fillalpha(). (WebCGM format already includes alpha support, via a registered escape element.) libplot: if the pen level has been set to `0' by invoking pentype(), thereby turning off the edging of paths, and the drawing of marker symbols and points, then the drawing of text should be turned off too? In the texinfo documentation we've promised to do this. libplot: when path edges are not drawn (i.e. when `pentype' is called with an argument of 0), the scheme used by the PS driver for quantizing fill colors for idraw is suboptimal. Could be much improved (would need to optimize over choices of idraw's fg color, bg color, and shading level, i.e. a 3D search). ode: extend parser to plot functions as well as solve differential equations. libplot: redo X driver, to support window reuse (`persistence') by any X Plotter. Will require forking off an outboard process. graph: allow all command-line options in input data files, on comment lines; maybe write alternative parser for interactive version (gnuplot replacement). libplot: add interactivity (e.g. getloc()), during openpl()...closepl(). Need to translate back to user coordinates. [For libsciplot, even further?] For Tektronix driver, implement GIN mode (need stty twiddling?). Also need char input (cf. starbase). Break out spline() as subroutine(s), cf. fitpack? Cf. IMSL interface. Similarly with plot frame / axis drawing. For this, check into NCAR Graphics package, `autograph' routines. ode: should support popen() for output; cf. gnuplot. graph: add `boxes', `steps', `impulses', `bars' plot types (as in gnuplot). Boxes, bars should properly support --fill-fraction option. graph: add support for polar/spherical plots, 3-D (surface) plotting. Low-priority (and idle thoughts) -------------------------------- libplot: PNG driver, when outputing a grayscale image, should use the optimal bit depth. PNG grayscale (without alpha channel) supports bit depths of 1, 2, 4, 8, 16. Right now, we use bit depth 1 for bitonal images, as we should, but for grayscale images that aren't bitonal, we always use bitdepth 8. We should use 2 or 4 instead, if reasonable. libplot: Fig output format now supports specifying a `transparent color', for use when xfig exports GIF files. It would be good to support this. libplot: add a warning about color exhaustion to the GIF driver (cf. the warnings issued by the Fig and X drivers). libplot: internally, text string handling oscillates wildly back and forth between (char *) and (unsigned char *). Fix this. libplot: _flush_plotter_outstreams() method, a non-public member function of the Plotter class, should really be static. libplot: there should be a way for the "none" background color to take effect on Metafile Plotters; currently, it does not. libplot: add support for a `rounded rectangle' primitive (pic2plot will use it). SVG and Fig formats support rounded rectangles, though xfig insists that the rounded corners be quarter circles, not just quarter ellipses. libplot: finish adding support for the filling of paths to the ReGIS driver (i.e. handle the case when the paths to be filled extend beyond the edge of the ReGIS display, requiring clipping). Also make the driver do real-time display of unfilled paths, segment by segment, like the Tektronix driver. libplot: Tektronix driver used to have a feature of waiting for 1 second after performing a screen erasure, if -DGENUINE_TEKTRONIX was defined during compilation (Tektronix storage tubes took that long to clear). Restore it? plot: the --line-width and --font-size options, which are useful only when plotting old files in Unix plot(5) format, are implemented poorly. The computation, from the command-line arguments (fractional line width and font size), of the line width and font size in user coordinates, is currently correct only for graphics displays that are square. libplot: pl_parampl_r should support taking a NULL pointer (to a plPlotterParams struct), as its final argument. libplot: if HP-GL/2 driver draws with a restricted palette of pens (the default), it follows a policy of never quantizing a nonwhite color to white, i.e. to pen #0. Is this the right thing to do? (Note: this policy applies only to the pen color, not the fill color.) libplot: Ponder the comment taken from an earlier version of the source code: "We don't allow openpl() to reset the frame number to zero (in XDrawable Plotters that is, unlike XPlotters). Incrementing the frame number monotonically facilitates color cell management, since we've only got one connection to the X display (see x_erase.c)." plot: should document that `plot -TX' will use double buffering if environment variable USE_DOUBLE_BUFFERING is "yes". Maybe make that user-settable via an option? Similarly, effect of setting X_AUTO_FLUSH on graphics utilities needs to be documented. libplot: should document that a user of X Drawable Plotters or X Plotters, if desiring true thread-safety, must manually invoke XInitThreads() and possibly XtToolkitThreadInitialize(). Also, in libplot code (e.g. libplot/p_defplot.c) must add appropriate #define's so that ctime_r() and localtime_r() are defined and used. Haven't figured out how to do that yet; on some systems, defining _REENTRANT and _POSIX_SOURCE is not enough. libplot: subclass the GIF Plotter class from the generic Bitmap Plotter class. Will facilitate importing a bitmap file to serve as a background for drawing. libplot: need a queryable PRECISE_DASHING capability, indicating whether or not a Plotter supports linedash(). spline: add support for smoothing splines as well as interpolatory splines? graph: add legend support (need new --legend :string1:string2: option), i.e. gnuplot-style `key'. Maybe arbitrarily positioned arrows, text strings also. See how NCAR Graphics does it. internationalization: think about removing strcasecmp (what if user called setlocale i.e. set LOCALE env var)? Similarly worry about . vs , everywhere, e.g. in PS files. libplot: improve appearance of octagonal marker symbols (symbol #30 and #31), i.e., make the octagon regular. Present non-regular shape dates back to Bob Beach's mid-1970s Unified Graphics System, from which many marker symbols were taken. libplotter: add overloaded (floating point) versions of integer operations? graph: tweak positioning of top labels, especially at large sizes. ode: add atan2() function. documentation: write more man pages. double: document it in plotutils.texi. libplot: after doing XCreatePixmap(), should check for success. See John Cwikla's article on the Motif Zone site (no graceful thread-safe way?). libplot: CQVXuv<>" are the remaining metafile op codes (printable ASCII characters other than space). Of these, CQVX are flagged as recently obsolete and should not soon be reused. What to do when op codes run out? libplot: should X driver use a non-default visual if the default visual isn't read-only? Do we wish other applications to be able to modify our color cells? Is this a genuine concern? Also, should we use a non-default visual if user specifies double buffering and the default visual doesn't support it via the X11 extension? (E.g. Xsgi.) libplot: check that Corel Draw can import generated HP-GL and HP-GL/2 files, and CGM files too. As of Corel Draw 8, a single font seems to be used for all text (by default TrueType Courier New). Check also Adobe Photoshop, Illustrator. HP-GL/2 Java viewer available at http://www.vanguard.at/products/partshpgl/english/index.htm . Should check whether it can parse our HP-GL/2 output. libplot: could spline the Hershey fonts, and use Bezier primitives to draw them? libplot: kern the HP vector fonts (Stick and Arc) that are available when producing PCL5 and HP-GL/2 output. Kerning was apparently dropped by HP in the transition from HP-GL to HP-GL/2, but we have the kerning tables. Marker symbol #1 should really be drawn as a pendown-penup motion in both HP-GL and pre-HP-GL/2, in the same way that a `point' is drawn. Very old HP-GL pen plotters can't handle full range of coordinates in many of our page types. [See our viewport sizes in libplot/g_pagetype.h; the sizes we use, taken from AutoCAD, may not be appropriate for very old pen plotters?] libplot: improve error reporting: change libplot error handler to allow use of name of executable. libplot: to the API, add a comment() method, taking printable string as argument (no control chars). For some drivers, it would appear in the output file. Could also add a title() or description() method, since some output formats support a document-level title or description string. ode: need to avoid any possibility, no matter how theoretical, of a stack blowout. Hershey fonts: add euro and cedilla. graph, plot, tek2plot, plotfont, etc.: add --display and --geometry options, for use with `-T X'? tests: check into test/plot2ai.test, test/plot2gif.test, test/plot2tek.test (not currently run, seem to give system-dependent behavior, possibly depending on rounding of floating-point numbers?) libplot: in text string format, \mk..\rt etc. could be stack machine; should also include overline, underline, radical, display fractions etc. Cf. eqn and Allen Hershey's typesetting. libplot: support hatch-filling of paths, as well as solid filling? HP-GL and CGM support hatching natively. For other formats, will need to wait until clipping is added. Other needed math software: fitting capability contour plotting via level curves; also compute enclosed area surface plotting (cf. IDL for plotting and contouring) EBCDIC. Need I say more? plotutils-2.6/compile0000755000175000017500000000717311061012366011723 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: plotutils-2.6/config.guess0000644000175000017500000013105411233744015012662 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: plotutils-2.6/config.sub0000644000175000017500000010242511233744034012326 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. timestamp='2009-06-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: plotutils-2.6/depcomp0000755000175000017500000004271311061012404011712 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2007-03-29.01 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: plotutils-2.6/install-sh0000755000175000017500000003246411061012552012347 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: plotutils-2.6/ltmain.sh0000644000175000017500000060015710404615640012172 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION="1.5.22 Debian 1.5.22-4" TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built fi build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -pg pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ -t[45]*|-txscale*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` else compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` fi ;; * ) compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: plotutils-2.6/missing0000755000175000017500000002623311204007347011744 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: plotutils-2.6/mkinstalldirs0000755000175000017500000000672211177243313013160 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: plotutils-2.6/ylwrap0000755000175000017500000001404311204007347011605 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007, 2009 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: plotutils-2.6/COMPAT0000644000175000017500000004706311257256363011273 00000000000000These are some release notes that deal with new features and backward compatibility of the plotutils package, on both user and programmer levels. Release 2.6, dated 9/2009 ------------------------- This release fixes a problem lurking in ode/specfun.c for a long time: copyrighted code, dating to the days when that file was a modified version of the file specfun.c in the gnuplot distribution. The gnuplot folks have since rewritten their specfun.c to remove most of the copyright notices. (At the cost of introducing new ones, dealing with the Cephes library... but I digress.) The plotutils ode/specfun.c has been totally rewritten: it is based on published algorithms, cited in the code, and contains no non-GNU copyrights. The SVG compatibility problems mentioned below seem to be going away. In the past, outline fonts in libplot's SVG output have not been rendered correctly by many SVG viewers, mostly because they are drawn by libplot in an intricate way, involving a coordinate reflection. But firefox and svgdisplay (part of KDE) now render reflected fonts correctly. The GIMP SVG plugin may not yet, but then it has problems with fonts in general. inkscape may be improving as well (slowly). Rewriting libplot's SVG export code to work around such problems no longer seems necessary. (Horizontal and especially vertical justification of text strings are not yet widely supported, but when exporting SVG, libplot now does its own justification.) Release 2.5.1, dated 7/2008 --------------------------- This release fixes a few bugs. However, there are persistent problems with text-strings in the SVG output format. Many applications that can view or edit SVG files (in particular, inkscape) do not correctly implement the SVG 1.1 specification. So, they may position text strings incorrectly, and even position incorrectly individual characters within a text string. If you encounter this problem, the fix is to specify a stroked ("Hershey") font, such as HersheySerif or HersheySerif-Bold. A list of available fonts, in SVG output, is obtained by doing `graph -Tsvg --help-fonts'. Each character in any Hershey font is made up of stroked line segments, and most SVG viewers can display line segments correctly. This problem may be worked around in future releases of the SVG output driver. Release 2.5, dated 12/2005 -------------------------- This is primarily a bug fix release, but the number of bug fixes is large. The biggest change is to the X11 driver. The font support in X11 (the X Window System) is in a state of overturn, and previous releases of the plotutils package do not produce good-looking output (of rotated text strings, especially) on many current X11 displays. This is for the following reason. The traditional `core' X fonts stored on any X11 display, each of which has a long name (a so-called XLFD name), are going away. The new model is for fonts to be stored on the client side, and to be rasterized by the FreeType rasterizer via the Xft library. Even in advance of this change, X servers such as XFree86 are starting to drop support for the more sophisticated features of the core X font subsystem, such as its ability to supply rotated or sheared glyphs. So the libplot library now produces its own rotated and sheared glyphs. It still uses the core X fonts, but it no longer requests rotation or shearing when retrieving rasterized characters (glyphs) from those fonts. Instead, it rotates or shears them itself. The result looks fairly good. For example, the output from the `rotating A' sample program in the plotutils manual looks as good as it always did, and takes no longer to generate. The command-line graphics utilities (e.g., `graph') support a `--rotation' option, to rotate graphics within their `viewport' or `plotting box'. (For X11 output, requested by `-T X', this viewport is simply the popped-up X window.) The argument of this option can now be an arbitrary number, interpreted as a counterclockwise rotation in degrees. (It used to be required to be 0,90,180, or 270.) You can now do this sort of thing: echo 0 0 1 1 2 0 | graph -T X -C -L 'A Postmodern Plot' -W 0.01 --rotation 45 The same thing can be done in any other output format (e.g., as requested by `-T ps' or `-T svg'.) This enhancement is independent of the rewriting of the X11 driver, but was suggested by it. A bad bug in the output of the PS driver, which prevented its being displayed by some versions of ghostscript/ghostview/gv, has been fixed. The output of the SVG driver has been improved, to be more compatible with the SVG parsers in Firefox and the ImageMagick package. Unfortunately, font handling in both of them is somewhat broken. If you have trouble using the standard builtin `Postscript' fonts (meaning, Adobe's standard set of 35 fonts such as Helvetica, Times-Roman, Courier, etc.), you should use the builtin Hershey fonts instead. Each character in any Hershey font is `stroked': it is made up of line segments. The Hershey fonts look quite good in Firefox, for example, due to its anti-aliasing. To check the drawing of SVG text strings, first do echo 0 0 1 1 2 0 | graph -T svg -C -L 'A Postmodern Plot' -W 0.01 --rotation 45 > plot.svg to obtain an SVG plot. To display it using Firefox and the ImageMagick package respectively, do firefox file:${PWD}/plot.svg display plot.svg If there are problems with your copy of Firefox or the `display' application, some of the axis labels may be missing or displaced. If so, add the option `-F HersheySerif' to the `graph' command, to request the HersheySerif font rather than the default font (Helvetica). Release 2.4.1, dated 7/2000 --------------------------- The `--page-size' option supported by the command-line graphics utilities has been extended, to allow precise specification of viewport size and location in the output, e.g., on a printed page. For example, `--page-size=letter,xsize=5in,ysize=3in,xorigin=1in,yorigin=2in' is now a possible command-line option. Previously, only `xoffset' and `yoffset' fields were supported. You can get some interesting visual effects by setting xsize or ysize to a negative value. For example, echo 0 0 1 1 2 0 | graph -Tps --page-size letter,xsize=-8in,ysize=8in will write to standard output a Postscript graph for a letter-size page. The graph will be drawn into a viewport that has the same size as usual (8in x 8in), but it will be reflected from left to right. The ability to specify a custom viewport size should be useful when producing SVG or WebCGM graphics for Web pages. When producing SVG or WebCGM output, only the xsize,ysize fields are meaningful; xorigin, yorigin, xoffset, and yoffset are ignored. The syntax of the libplot Plotter parameter `PAGESIZE' has been similarly extended. Libplot version number is now 4.1. Release 2.4, dated 6/2000 ------------------------- SVG output is now supported. SVG is a new XML-based vector graphics format being developed by the W3 Consortium. The command-line plotting utilities now support `-T svg --bg-color none' and `-T cgm --bg-color none' options, to turn off the background (which by default is white) in SVG and WebCGM output. This is useful when generating graphics files for use in Web pages. Similarly, in libplot, SVG and CGM Plotters now allow the parameter `BG_COLOR' to equal "none". PNG output is now supported. A PNG driver will be installed in libplot, and made available to the command-line plotting utilities, if libpng and libz are found at installation time. The version number of libpng must be 0.95 or larger (libpng 0.95 was released in March 1997). If the PNG driver is included, you must now include the additional options `-lpng -lz' when compiling and linking a program with libplot or libplotter. `configure' now supports a `--without-libpng' option to disable PNG support. ReGIS output is now supported, for display on older graphics terminals like the VT340 (color), the VT330 (monochrome), and emulators. The ReGIS driver contains a blemish: paths that extend beyond the boundary of a ReGIS display are never filled, even if filling is requested, because they need to be clipped against the boundary, and the required clipping code hasn't yet been written. Colors may now be specified, both on the command line and when using the libplot API, by their 24-bit RGB representation, expressed as six hexadecimal digits. For example, "#ffffff" is equivalent to "white". The command-line plotting utilities now support an `--emulate-color yes' option, and all Plotters now support a corresponding parameter, "EMULATE_COLOR". If emulation is performed, all colors in the output will be replaced by grayscale approximations. This is particularly useful when producing PCL 5 output to be printed on a monochrome PCL 5 device, such as a monochrome LaserJet. Many monochrome PCL 5 devices, on their own, do a poor job of emulating color (they print every nonwhite solid color as black). libplot now supports compound paths, i.e. paths that are made up of multiple simple paths, so long as the simple paths do not intersect each other (they are allowed to intersect themselves). You draw each simple path of a compound path in the usual way, but you end each one by calling endsubpath(). The compound path is terminated and drawn by calling endpath(). Just as when traditional non-compound paths are drawn, the call to endpath() can usually be omitted. So the libplot API has been expanded to include endsubpath(), and orientation() too. orientation() specifies the direction in which circles/ellipses/boxes are traversed. (Specifying this, for any circle/ellipse/box that is a subpath of a compound path, affects the filling of the compound path by determining which points are `inside' or `outside'.) Handling of device-resident HP vector fonts ("stick fonts"), when drawing text strings in HP-GL/2 output, has been improved. Previously, no account was taken of device-resident font kerning. That's appropriate when producing PCL 5 output for a LaserJet with an HP-GL/2 emulation module, since LaserJets don't do sophisticated kerning of stick fonts, even when they support them. But any full-featured HP-GL/2 plotter can do kerning of variable-width stick fonts. So when producing HP-GL/2 output, we now take that into account when computing the width of text strings. This affects the positioning of text strings on an output page. The StickANK and ArcANK HP vector fonts, which provide JIS ASCII and half-width Katakana, are now available when producing HP-GL/2 output. The miter limit (for line joins) which is placed in any HP-GL/2 or PCL 5 output file is now always rounded to the closest integer, downward. That's because at least one HP-GL/2 pen plotter (the HP 7550B, which was HP's first) had buggy firmware that couldn't parse a non-integer miter limit. When HPGL_VERSION is set to 1 or 1.5, the filling of solid regions now uses cross-hatching, instead of the filling with a single pen color that used to be used. This occurs whenever the fill color is not one of the defined pen colors. The algorithm employed, for emulating shading by cross-hatching, is the one used by HP's HP-GL/2 pen plotters. A new function, fsetmatrix(), has been added to the libplot/libplotter API, as an alternative to space(). It sets the transformation matrix from user coordinates to NDC (normalized device coordinates). In NDC space, the graphics display, i.e. viewport, has corners (0,0), (1,0), (1,1), (0,1). space() and/or fsetmatrix() no longer need to be called at the beginning of each page of graphics. The alabel() function in the libplot/libplotter API now accepts a new vertical positioning option, `C', to request alignment of a text string's cap line with the present vertical position. Color drawing on X displays has been speeded up. If the X display uses a truecolor `visual', pixel value computations are performed in libplot itself, rather than in the X server. This removes the need to call XAllocColor() whenever a new pen color or fill color is selected (which used to require a round-trip to the server, slowing things down). Also, a Plotter parameter `XDRAWABLE_VISUAL' has been added. It should be set by the programmer if a non-default colormap is used. libplot can determine from it whether or not the visual is of the truecolor class. Libplot version number is now 4.0. Release 2.3, dated 10/1999 -------------------------- CGM output is now supported. By default, a CGM Plotter emits binary-encoded version-3 CGM format, conforming to the WebCGM profile. (For information on WebCGM, see http://www.cgmopen.org .) The CGM format version number may be reduced by setting the libplot parameter (or environment variable) CGM_MAX_VERSION. Irrespective of version, a human-readable CGM file, i.e., one encoded as clear text, may be produced by setting CGM_ENCODING to "clear_text". Clear text CGM files are valid CGM files, though technically they don't conform to the WebCGM profile (a WebCGM file is meant to be binary). The package is now based on libplot version 3.0, which has new thread-safe C and C++ APIs, i.e. APIs which (1) maintain no global state, and (2) are pthread-aware. The names of all new thread-safe libplot functions end in "_r", for `reentrant' or `revised'. Each of them takes a pointer to an opaque plPlotter object as its first argument. There are new functions in both libplot and libplotter for creating and manipulating PlotterParams objects, which store Plotter parameters. Parameters are copied from such an object when the Plotter class is instantiated. The old C and C++ API's are still supported, though deprecated. So you can still use pl_newpl() and pl_openpl(), etc., instead of pl_newpl_r() and pl_openpl_r(), etc. A new API function, pl_pentype_r(), has been added. If its argument is 0, stroking of paths, as opposed to filling, will be turned off. So `edgeless polygons' can now be drawn. Fig and PCL Plotters now position their viewports (i.e. "graphics displays") in the center of their pages, like PS Plotters. So the PCL_XOFFSET and PCL_YOFFSET parameters have been removed, and PCL_ROTATE too. Similarly, HPGL_XOFFSET and HPGL_YOFFSET parameters have been removed, even though tbe viewport position for HP-GL Plotters has not changed. Shifting of the viewport on the page, for PCL, HP-GL, Fig, and PS Plotters, is now accomplished through the PAGESIZE parameter. E.g., its value could be "letter,xoffset=1in,yoffset=-2cm" or "a4,yoffset=12mm". A new parameter, ROTATION, has been introduced; it applies to PCL, HP-GL, Fig, and PS Plotters. It defines rotation of the viewport on the page, which is not the same as what the HPGL_ROTATE parameter, previously introduced for HPGL Plotters, defines. Values of ROTATION can be "no", "yes", "0", "90", "180", "270". A new scan-conversion library, called libxmi, is optionally built and installed, together with documentation. It contains the scan-conversion code that is used by libplot's GIF and PNM drivers, which is based on the X11 sample server code. libxmi is also distributed independently. The libxmi version number is 1.1. Release 2.2, dated 3/1999 ------------------------- Massive expansion of the C API, with new drivers, and introduction of libplotter (C++ class library). Backward compatibility of the C API maintained, except that all functions now begin with "pl_". Header file "plotcompat.h", if needed, will redefine old function names as new function names. Libplot version number is now 2.0. outfile() function, always more or less deprecated, now declared obsolescent. No longer documented. Release 2.1.6 ------------- AI driver added, but libplot API unchanged. Libplot version number is now 1.6. Support in plot.h header file for old names for endpath() and filltype(), which began in plotutils-2.0 (see below), finally dropped. Release 2.1.5 ------------- PCL 5 driver added. Kerning of device-resident `HP stick fonts' accessible to the HP-GL driver, when HPGL_VERSION=1.5, also added. Libplot API unchanged, but libplot version number is now 1.5. Release 2.1.2, 2.1.3, 2.1.4 --------------------------- No additions to libplot API, but the semantics of closepl() vs. deletepl() have finally changed (programmers were warned about this in the texinfo documentation). The libplot version number is now 1.2 (upped to 1.3 for release 2.1.3 and 1.4 for 2.1.4). Plotter output, for non-realtime plotting, is now guaranteed to be emitted only when deletepl() is called. I.e., graphic output is not necessarily written to the output stream after each page is closed. In practice, this affects only Postscript output. Emitting PS only after the final page of a multi-page graphics file is closed enables the PS to conform to the DSC (Postscript Document Structuring Conventions). Support for many new stick fonts added (mostly available only if using `-T hpgl', with HPGL_VERSION=1.5. `Stick fonts' are HP's device-resident vector fonts. If using `-T hpgl' with HPGL_VERSION=1, circles and rectangles aligned with the coordinate axes can now be filled. Names of many Hershey fonts changed, but old names continue to work. Release 2.1.1 ------------- No additions to libplot API, though libplot was improved in various ways. The libplot version number is now 1.1. Release 2.1 ----------- No incompatibilities with plotutils release 2.0. But many new command-line options added to user-level utilities, and the libplot API was expanded by the addition of bgcolor() and bgcolorname(). The libplot version number is now 1.0. Release 2.0 ----------- In release 2.0 the idea of separate variants of the `graph', `plot', and `tek2plot' programs for each display device was finally done away with. There is now only a single instance of each program. The display device is specified by the `-T' option. The merging of the device-specific variants was made possible by the merging of the device-specific variants of the libplot library on which they were based. There is now only a single library, which is structured in an object-oriented way. There are new functions, newpl(), selectpl(), openpl(), which allow the creation of an arbitrarily large number of `Plotter' objects simultaneously. Each Plotter produces output for one display device. On startup of libplot, a single default Plotter is created and selected, namely one that produces GNU metafile format. This is for backward compatibility: it allows programs written for earlier versions of GNU libplot, and even Unix libplot, to link with it and run as expected. If you prefer a different default Plotter type, you should select it at installation time. For example, including -DDEFAULT_PLOTTER_TYPE=\"ps\" in your CFLAGS option will cause the default Plotter to produce Postscript output instead. The libplot API changed in release 2.0 in a few other ways. 1. falabel() was dropped from the API, and alabel() no longer returns a value related to the width of the text string that it renders. If you need to get the width of a text string, use flabelwidth() or labelwidth(). 2. The semantics of the arc() primitive have changed. It now draws an arc that may be clockwise as well as counterclockwise, but is restricted to have opening angle no more than 180 degrees. Also, it moves the graphics cursor position to the endpoint of the arc. 3. The box() primitive now moves the graphics cursor to the midpoint of the box, rather than to the second-specified vertex. 4. endpoly() has been renamed endpath(), and fill() has been renamed filltype(). These last changes are temporarily supported by the plot.h include file. As of release 2.0 of the package, libplot has its own, independent, versioning system. The version of libplot distributed with release 2.0 is numbered 0.0. Beginning with version 0.0, libplot is installed both as a static library and as a shared library (a DLL), on machines that support shared libraries. plotutils-2.6/INSTALL.pkg0000644000175000017500000003111411257241176012160 00000000000000This file explains how to install the GNU plotutils (plotting utilities) package. The file README summarizes the contents of the package. Please send bug reports to , and suggestions for longer-range improvements to both and the principal author and current maintainer, Robert S. Maier . These are package-specific installation instructions: PLEASE READ THEM. Before reading them, you should glance through the generic installation instructions in the file INSTALL. The instructions in that file may be summed up as follows. You build a GNU package by typing `./configure' and then `make'. After building, you may run validation tests on the package by typing `make check'. To install the package, you type `make install'. A documentation file, in `info' format, is installed as part of this process. You may produce a copy of the documentation for the package, in dvi format, by typing `make dvi'. This assumes that you have the TeX document formatter installed. The most important points not mentioned in the file INSTALL are these. ********************************************************************** If you have a working C++ compiler and would like to build the `libplotter' class library and the pic2plot utility, both of which are written in C++, you should add the `--enable-libplotter' option to the `./configure' command. ********************************************************************** ********************************************************************** By default, if the `libpng' library and its header file are found at installation time, then support for PNG graphics will be included in libplot and all command-line utilities. If for any reason you wish to omit PNG support despite libpng being present, you should add the `--without-libpng' option to the `./configure' command. ********************************************************************** ********************************************************************** It is not unknown for one or more of the validation tests that are run by doing `make check' to fail for harmless reasons. See B.6, below. ********************************************************************** ********************************************************************** If you would like to build and a standalone version of the `libxmi' 2D rasterization library, and install the library and its documentation, you should add the `--enable-libxmi' option to the `./configure' command. This is not done by default because libxmi is also distributed as a separate package. ********************************************************************** The rest of this file discusses possible installation problems. There are some additional options that you can add to the `./configure' command. They are mentioned too, in passing. ---------------------------------------------------------------------- Possible problems not mentioned in the INSTALL file are summarized in the following three sections. They cover: (A) Problems related to building the GNU libplot graphics library. (B) Miscellaneous problems. (C) Problems related to support for the X Window System. ---------------------------------------------------------------------- A. This section covers problems related to building both the unshared version and the shared version of the GNU libplot graphics library. Except on older systems, GNU libplot will normally be built as both an unshared library and a shared library. A script called `libtool' is used for this. By default, the application programs `graph', `plot', `tek2plot', and `plotfont' will be configured to use the shared library. If for any reason you wish to disable support for the shared version of libplot, you may begin by doing `./configure --disable-shared' instead of `./configure'. ---------------------------------------------------------------------- B. This section covers miscellaneous installation problems. B.1. On some systems, there are potential minor problems having to do with installing (rather than building) the shared version of libplot. By default, it is installed in `/usr/local/lib'. On some systems you may need to run a command (such as `ldconfig'), or even reboot, to let your system know that a new shared library has been installed. On some systems you may need to add `/usr/local/lib' to your LD_LIBRARY_PATH environment variable in order to use the `graph', `plot', `tek2plot', `plotfont', and `pic2plot' programs after they have been installed. You will be cautioned about problems of this sort, if any, at installation time. B.2. If you have a recent laser printer that can use the 35 standard Postscript fonts even when in PCL 5 or HP-GL/2 mode, such as a 2100-series, 4000-series, or 8000-series HP LaserJet, you may wish to add the `--enable-ps-fonts-in-pcl' option to `./configure'. No additional actions on your part, such as installing fonts, are required, since the Postscript fonts, if present, are internal to the printer. *** It is recommended that you add this option, since it is innocuous. *** B.3. By default, the standard 45 `HP LaserJet' fonts, such as Arial, Univers, etc., which are built into recent HP LaserJets, are available to the plotting utilities when you produce PCL 5 or HP-GL/2 output, e.g., when you do `graph -T pcl' or `graph -T hpgl'. But there are many Postscript viewers that can display these fonts; and also, in modern LaserJets, which understand both Postscript and PCL, the fonts are available on the Postscript side as well as the PCL side. Hence, you may wish to have these 45 fonts available when you produce Postscript output. To arrange this, you would add the `--enable-lj-fonts-in-ps' option to `./configure'. *** It is recommended that you add this option, since it is innocuous. *** Of course you may well need to acquire the 45 fonts and install them, so that your Postscript previewer will be able to use them. This is fairly easy. Instructions are in the file INSTALL.fonts. You may also wish to add these 45 fonts to your X Window System display, so that, e.g., when you use `graph -T X', you will be able to use them. This is possible (instructions are in the file INSTALL.fonts). To make these fonts available when producing X output, e.g., by `graph -T X', you would add the `--enable-lj-fonts-in-x' option to `./configure'. *** It is recommended that you add this option, since it is innocuous. *** B.4. As part of the installation process, the header file ./include/plot.h will be installed in a place on your system where the gcc C compiler will find it. If you wish to use cc as well as (or instead of) gcc, you should copy plot.h manually to the directory `/usr/include', where cc will find it. plot.h is not installed in `/usr/include' by default, since many administrators prefer not to add files to that directory. B.5. If you are installing this package with DJGPP under MS-DOS, the very first thing you should do is rename the file `install-sh' in this directory to `install.sh'. That is on account of filename length limitations in MS-DOS. If `./configure' reports that it is unable to find certain executable programs that it should in fact find, you may also need to replace many of the occurrences of `test -f' in `./configure' and `./ltmain' by `test -x' (to compensate for the ".exe" extension that MS-DOS uses). These potential problems are reported by Michel de Ruiter . Please contact him for additional information on MS-DOS installations. B.6. It is not at all unusual for one or more of the validation tests performed by doing `make check' to fail on account of innocuous differences in formatting floating-point numbers, or differences in the rounding of floating-point numbers. In particular, the `plot2fig' validation test may fail if you are installing with DJGPP under MS-DOS, or if you are installing the package on an old NeXT machine. To emphasize: the failure of two or three of the validation tests, in particular the `plot2fig' test, is almost certainly quite harmless. But if a large number of the validation tests should fail, please report it to . For some additional remarks on the validation tests, see the file ./test/README. ---------------------------------------------------------------------- C. This section covers installation problems related to the X Window System. If for any reason you wish to omit the X Window System support, you may begin by doing `./configure --without-x' instead of `./configure'. C.1. To make maximum use of the X support in this package, you will need to have the 35 standard Postscript fonts installed on your X server. For instructions on installing Type 1 versions of these fonts, clones of which are included in the package, see the file ./INSTALL.fonts. C.2. There is a possible installation problem having to do with X widget sets. By default, this package uses the free Athena widgets, which are provided on most but not all machines. Some machines provide Motif widgets instead of Athena widgets. On such machines (e.g. Hewlett-Packard systems running HP/UX, and some IBM systems) you should normally begin by doing `./configure --with-motif' instead of just `./configure', to ensure that the software is configured correctly. The only advantage of using Motif widgets, which are not free, is that you may be able to use Motif's drag-and-drop facility to drag graphics out of popped-up X Windows, e.g., the window popped up by `graph -T X'. C.3 On a few machines, the auto-configuration process may not be able to find the library files containing the X widgets (whether Athena or Motif), or the corresponding header files. If this problem occurs, you can specify their location manually at configure time, as follows. C.3a. If you have the Athena widgets and wish to use them, even though the auto-configuration process does not find them, you may specify their location by doing `./configure --with-athena=DIR' instead of just `./configure'. Here DIR should be a directory whose subdirectory `lib' contains the Athena widget library files libXaw and libXmu, and whose subdirectory `include' contains the Athena header files, such as X11/Xaw/Label.h. An example would be old Hewlett-Packard systems running HP/UX 10.xx. If you are installing the package on such a system, you should check whether the directories /usr/contrib/X11R6/{lib,include} exist. If so, you can use the Athena widgets. To use them, you would do ./configure --with-athena=/usr/contrib/X11R6 instead of just `./configure'. If these directories do not exist on your system, you do not have the Athena widgets: you must use `--with-motif' instead. Extremely old HP/UX 10.xx systems may have X11R5 instead of X11R6, in which case you should modify the directory name appropriately. C.3.b. It is also possible that you have only Motif widgets, but the autoconfigure process is unable to find the Motif files. In such a situation, you may specify the location of the Motif files by doing `./configure --with-motif=DIR' instead of just `./configure'. Here DIR should be a directory whose subdirectory `lib' contains the Motif widget library file libXm, and whose subdirectory `include' contains the Motif header files, such as X11/Xm/Label.h. C.3.c. There are a very few systems where the widget files must be specified manually by an even more complicated procedure. An example would be truly ancient Hewlett-Packard systems that are running HP/UX 9.xx or earlier. They have Motif widgets, but the Motif files are stored in unusual places. If you have an HP/UX 9.xx system that X11R6 was installed on, besides doing `./configure' (or possibly `./configure --with-motif'), you may need to do make CFLAGS="-O -I/usr/include/Motif1.2 -L/usr/lib/Motif1.2" rather than just `make'. You should note, however, that for HP/UX 9.xx systems, X11R6, presumably including the Athena widgets and not the Motif widgets, was available as a patch. If you have an HP/UX 9.xx system that the X11R6 patch was installed on, you can probably do `./configure --with-athena=/usr/contrib/X11R6'. C.4. Some version of Motif require that executables that are linked with Motif be linked, also, with the `libXpm' library. `configure' knows about this. But if for some reason it is unable to find libXpm and the corresponding header file, you can specify their location manually at configuration time, by doing not just `./configure --with-motif', but rather `./configure --with-motif --with-libxpm=DIR'. Here DIR should be a directory whose subdirectory `lib' contains libXpm, and whose subdirectory `include' contains the corresponding header file, X11/xpm.h. plotutils-2.6/INSTALL.fonts0000644000175000017500000003650411234470260012531 00000000000000This file explains how to install the fonts that come with the GNU plotutils package, and other useful fonts. Before reading this, you may find it useful to read the file INSTALL for generic remarks on installing GNU packages, and the file INSTALL.pkg for package-specific installation instructions. The fonts this file discusses are: (1) the 35 standard `Postscript fonts', clones of which come with the package, (2) the 4 standard `Tektronix fonts', which do also, and (3) the 45 standard `HP LaserJet fonts', which do not come with the package, but which you can get for free from Hewlett-Packard via the Internet. 1. The 35 standard Postscript fonts ----------------------------------- These `Postscript fonts' are the 35 scalable fonts from Adobe that are built into nearly all Postscript printers. They include Times-Roman, Helvetica, Courier, New Century Schoolbook, Palatino, Bookman, AvantGarde, ZapfChancery, and ZapfDingbats. You will get the greatest value out of the plotutils package, when running under X Windows, if these fonts are available on your X display. (In some cases, versions at fixed font sizes are available, but the scalable font that gives rise to them is not.) For example, the default font which the `graph' program uses is `Helvetica'. If it is unavailable, a scalable stroked font (one made up of line segments) named `HersheySerif' will automatically be substituted for it. But it would be good to use the default Helvetica font. Many X servers (for example, many releases of XFree86 for GNU/Linux) do not supply all 35 standard Postscript fonts. In many cases, they can be added by installing a freely available package, such as an .rpm file or Debian package. For instance, the 35 standard Postscript fonts can be added to a Debian system by installing the `gsfonts-x11' package from Debian. Actually, what will be added are clones of the 35 Adobe fonts, since the original fonts from Adobe are non-free. If you cannot locate an add-on package that contains clones of the 35 Adobe fonts, you may install the cloned versions that are supplied in the subdirectory ./fonts/pfb, in Type 1 format. These were designed by URW GmBH of Germany and contributed for distribution under the GNU License. Manually adding fonts to an X server is not difficult, though you should note that most X servers now support two font systems: the original `core' X font system, and a new one based on Xft and the FreeType rasterizer. For backward compatibility, the plotutils package uses only core X fonts. Core fonts (scalable ones, anyway) are usually supplied in Adobe's Type 1 format. The files in .fonts/pfb are in this format. You can manually add Type 1 fonts to the core X font subsystem by using the basic command-line `mkfontdir', as root. The following instructions assume that you have a generic X Window System installation. If you have anything more fancy, consult your local documentation to determine how to add fonts in Type-1 format to it. To install the 35 Postscript fonts to a generic X Window System installation, first locate the directory on your system in which Type 1 fonts are stored. (It will be /usr/share/fonts/X11/Type1, /usr/lib/X11/fonts/Type1, or something similar.) Copy the 35 font files in ./fonts/pfb to that directory. There will presumably be a file named `fonts.scale' in that directory, which lists scalable fonts the X server can use. To let the X server know about your new font files, copy the lines in the file ./fonts/fonts.append to the end of the fonts.scale file, and correct the first line of the fonts.scale file (a count of the number of scalable fonts) by adding 35 to it. Then, while in that directory, run the `mkfontdir' program. The `mkfontdir' program creates a file called `fonts.dir', which is what the X server will read (it does not actually read fonts.scale). If the X server is currently running, you should also do `xset fp rehash' to make the server re-scan the directory; or simply log out and log back in again. NOTE #1: On Solaris machines, the preceding installation instructions may or may not work. Some versions of Solaris contain a Sun demo program called `fontadmin' that can install Type1 fonts. If it is available, it is located in `/usr/openwin/demos'. NOTE #2: On a few systems (e.g., SGI's), following the preceding instructions may cause problems, because vendor-supplied versions of (some of) the fonts may already appear in the fonts.scale file. It would be a good idea on _any_ system to check whether any of the fonts listed in ./fonts/fonts.append already appear in fonts.scale. If so, the corresponding lines do not need to be added. 2. The 4 standard Tektronix fonts --------------------------------- If you plan to use the `tek2plot' utility, you may wish to install the four standard Tektronix fonts on your X server, so that you can view Tektronix images containing text with the original fonts. Bitmap versions of the four fonts come with the package. `tek2plot -T X' will use them if you specify the `--use-tek-fonts' option. To install the 4 Tektronix fonts, first locate the directory on your system in which miscellaneous bitmap fonts are stored (it will be /usr/share/fonts/X11/misc, /usr/lib/X11/fonts/misc, or something similar). Copy the 4 font files in ./fonts/pcf to that directory. Then, while in that directory, run the `mkfontdir' program. The `mkfontdir' program creates a file called `fonts.dir', which is what the X server will read. If the X server is currently running, you should also do `xset fp rehash' to make the server re-scan the directory; or simply log out, and log back in. 3. The 45 standard LaserJet fonts --------------------------------- These fonts are the 45 scalable "LaserJet" fonts that are built into all modern HP LaserJets. (Since the LaserJet 6, 5, and 4 at least; the ancient LaserJet III, which was the first one to support scalable fonts, included only 8 of the 45.) They include Times New Roman, Arial, Univers, Garamond, CGTimes, CGOmega, Courier, Letter Gothic, Symbol, and Wingdings. To understand the following instructions, note that all modern high-end LaserJets can understand both Postscript and PCL 5 (or these days, its extensions PCL 6 or PCL 6e). PCL 5 incorporates the traditional pen-plotter command language for high-end HP pen plotters, HP-GL/2. PCL 5 was the original command language understood by high-end LaserJets (Postscript from Adobe being added later), and originally it came with its own set of 45 scalable fonts. Eventually, the 45 PCL fonts became accessible from the `Postscript side' as well. The plotting utilities can produce PCL 5 or HP-GL/2 output, which is meant to be sent to a LaserJet or similar printer or plotter. For example, `graph -T pcl' and `graph -T hpgl' can do this. When producing PCL 5 and HP-GL/2 output, they can use any of the 45 LaserJet fonts. You may also wish to use them when producing output for an X Window System display, or when producing Postscript output. Here is how you can do this (the first is much easier than the second). A. When you configure and install the plotting utilities package, be sure to do `./configure --enable-lj-fonts-in-x' instead of just `./configure'. B. Obtain and install the 45 LaserJet fonts. Hewlett-Packard has made Type 1 versions of these fonts available via the Internet, at ftp://ftp.hp.com/pub/printers/software/mp135mu.exe . This is a zipped file, which you can unzip with the `unzip' utility. You will get 45 font files, in .pfb ("Postscript Font, Binary") format. The following instructions assume that you have a generic X Window System installation. If you have something more fancy, consult your local documentation to determine how to intall new fonts. To install the 45 LaserJet fonts so that your X server will be able to use them, first locate the directory on your system in which Type 1 fonts for the X Window System are stored. (It will be /usr/share/lib/X11/fonts/Type1, /usr/lib/X11/fonts/Type1, or something similar.) Copy the 45 .pfb files to that directory. There will probably be a file named `fonts.scale' in that directory, which lists scalable fonts the X server can use. To let the X server know about the new font files, copy the lines in the file ./fonts/fonts3.append to the end of the fonts.scale file, and correct the first line of the fonts.scale file (a count of the number of scalable fonts) by adding 45 to it. Then, while in that directory, run the `mkfontdir' program. The `mkfontdir' program creates a file called `fonts.dir', which is what the X server will read. If the X server is currently running, you should also do `xset fp rehash' to make the server re-scan the directory. NOTE: On Solaris machines, the preceding installation instructions may or may not work. Some versions of Solaris contain a Sun demo program called `fontadmin' that can install Type1 fonts. If it is available, it is located in `/usr/openwin/demos'. C. After steps (A) and (B) are followed, the plotting utilities will be able to use the 45 LaserJet fonts when producing X output. For example, you will be able to do echo 0 0 1 1 2 0 | graph -T X -F Arial-Bold to pop up a simple plot on your screen, labelled in Arial-Bold. If you do `graph -T X --help-fonts' or `plotfont -T X --help-fonts', the list of fonts you are shown will include the 45. D. You may wish to use the 45 new fonts in Postscript output as well. This is harder, and to some extent, you are on your own on this. What follows is a (long!) explanation of what you can do. If you want to produce, view, and print Postscript files that contain the 45 LaserJet fonts, you should first add the `--enable-lj-fonts-in-ps' option to `./configure'. In principle, this is enough: it will let you produce Postscript output that uses the 45 LaserJet fonts. The problem is that your Postscript interpreter, printer, or printer driver may not know about these new fonts. It is easiest to add support for the new fonts to the Ghostscript engine, and to such previewers as Ghostview (`gv') that are built on top of it. To do this, (i) add the 45 .pfb files to the directory in which Ghostscript looks for Type 1 fonts, such as /usr/share/fonts/type1/gsfonts, and (ii) add 45 new entries to the Ghostscript `Fontmap' file, one per font. The Fontmap file is usually somewhere under /usr/share/ghostscript, /usr/share/gs, /usr/share/gs-gpl, or some such directory. It may be named `Fontmap.GS' rather than `Fontmap'. The format of this file should be self-explanatory: it lists the name of each font and the name of the .pfb file (presumably, kept in a standard directory such as /usr/share/fonts/type1/gsfonts) that contains it. The 45 .pfb files from Hewlett-Packard have obscure names, but by looking at their contents with GNU Emacs or another editor, one can figure out which file contains which font. For example, the file `0037____.pfb' contains the Arial-Roman font. (It uses the name `Arial-Roman', not `Arial'.) The fontname <-> filename correspondence is documented in the file readme.hp. In consequence, you should add, at the end of the Fontmap.GS file, the following 45 lines: \AlbertusMedium (0001____.pfb) ; \AlbertusExtraBold (0002____.pfb) ; \AntiqueOlive (0003____.pfb) ; \AntiqueOlive-Italic (0004____.pfb) ; \AntiqueOlive-Bold (0005____.pfb) ; \ClarendonCondensed (0006____.pfb) ; \Coronet (0007____.pfb) ; \Courier (0008____.pfb) ; \Courier-Italic (0009____.pfb) ; \Courier-Bold (0010____.pfb) ; \Courier-BoldItalic (0011____.pfb) ; \Garamond (0012____.pfb) ; \Garamond-Italic (0013____.pfb) ; \Garamond-Bold (0014____.pfb) ; \Garamond-BoldItalic (0015____.pfb) ; \LetterGothic (0016____.pfb) ; \LetterGothic-Italic (0017____.pfb) ; \LetterGothic-Bold (0018____.pfb) ; \Marigold (0020____.pfb) ; \CGOmega (0021____.pfb) ; \CGOmega-Italic (0022____.pfb) ; \CGOmega-Bold (0023____.pfb) ; \CGOmega-BoldItalic (0024____.pfb) ; \CGTimes (0025____.pfb) ; \CGTimes-Italic (0026____.pfb) ; \CGTimes-Bold (0027____.pfb) ; \CGTimes-BoldItalic (0028____.pfb) ; \Univers (0029____.pfb) ; \Univers-Italic (0030____.pfb) ; \Univers-Bold (0031____.pfb) ; \Univers-BoldItalic (0032____.pfb) ; \UniversCondensed (0033____.pfb) ; \UniversCondensed-Italic (0034____.pfb) ; \UniversCondensed-Bold (0035____.pfb) ; \UniversCondensed-BoldItalic (0036____.pfb) ; \Arial-Roman (0037____.pfb) ; \Arial-Italic (0038____.pfb) ; \Arial-Bold (0039____.pfb) ; \Arial-BoldItalic (0040____.pfb) ; \TimesNewRoman (0041____.pfb) ; \TimesNewRoman-Italic (0042____.pfb) ; \TimesNewRoman-Bold (0043____.pfb) ; \TimesNewRoman-BoldItalic (0044____.pfb) ; \Symbol (symbol____.pfb) ; \Tidbits (tidbits____.pfb) ; after copying the 45 .pfb files into that directory. This will be enough to make the 45 new fonts accessible to Ghostscript/Ghostview, so that a command such as echo 0 0 1 1 2 0 | spline | graph -Tps -F Univers -C -q 0.5 | gv - will work. In some operating systems, such as Debian GNU/Linux, it is possible to make these 45 new fonts available to other applications than Ghostscript/Ghostview, without even copying them to other directories. For instance, Debian has the `defoma' font manager, which can be configured to do this. The details of this are not discussed here. In general, it would be desirable to use the 45 LaserJet fonts not just for use by Ghostview (or other screen-using applications), but for printing on a printer (Postscript or otherwise). This can be painful, since appropriate font(s) will need to be downloaded to the printer, either separately or as part of the document (e.g., plot) that you wish to print. (This assumes that your printer driver is not intelligent enough to include the font(s), by itself.) The current release of the plotting utilities unfortunately does not support automatically including the fonts in Postscript output files. But if you have a sophisticated printer driver or document manager that automatically includes fonts in documents, then it should be easy for you to add support for the 45 LaserJet fonts. (The PS output of such utilities as `graph' will indicate to the driver or manager which fonts should be included.) On this, you are on your own, though. As an alternative, you may manually download the 45 new fonts, or whichever ones of them you are using, to your Postscript printer. This works quite well, though whenever you turn the printer off, the fonts go away. To do this, you should first convert the relevant .pfb file(s), which are in binary, to .pfa file(s), which are in human readable ["Postscript Font, Ascii"] format. There is a standard program, `t1ascii', which can do this. It is part of the `t1utils' package, which is available for many versions of GNU/Linux, and in standard archives. After converting the .pfb files to .pfa files, you would send each of the needed .pfa files to your printer, as if it were a Postscript document to be printed. Be sure to precede each .pfa file by the magic lines %!PS-Adobe-3.0 ExitServer %%BeginExitServer: 0 serverdict begin 0 exitserver %%EndExitServer which will ensure the font stays resident in the printer, at least until it is turned off. For example, the file `0037____.pfb' from Hewlett-Packard contains the Arial-Roman font. If you convert it to `0037____.pfa' with `t1ascii' and download it to your printer, you will be able to print an Arial-Roman plot by doing, e.g., echo 0 0 1 1 2 0 | graph -T ps -F Arial-Roman | lpr This procedure is awkward, and may be improved in future releases. One final comment. The LaserJet font in the file `tidbits_.pfb' from Hewlett-Packard is actually Wingdings, despite its name. plotutils-2.6/KNOWN_BUGS0000644000175000017500000000061206565720356012015 00000000000000graph ----- Filling of regions (i.e., the polygonal regions whose vertices are the data points), when requested by the -q option, works as long as the regions are entirely within the plotting box. Filling does not work properly if the regions extend outside the box, since the clipping algorithm which is used is appropriate for unfilled regions only. This will be fixed in a later release. plotutils-2.6/ONEWS0000644000175000017500000000745106601344741011173 00000000000000Here is a summary of the early history of the GNU plotting utilities. Several of the GNU plotting utilities were inspired by Unix plotting utilities. A `graph' utility and various plot filters were present in the first releases of Unix from Bell Laboratories, going at least as far back as the Version 4 distribution (1973). Most of the work on tying them together and breaking out device-dependent versions of `libplot' was performed by Lorinda Cherry . By the time of Version 7 Unix (1979) and the subsequent Berkeley releases, the package consisting of `graph', `plot', `spline', and several device-dependent versions of `libplot' was a standard Unix feature. The first display device supported by the package was a Tektronix 611 storage scope. By the early 1980's, supported devices included additional Tektronix storage scopes, 200 dpi electrostatic printer/plotters from Versatec and Varian, pen plotters from Hewlett-Packard, and early graphics terminals. In 1989, Rich Murphey wrote the first GNU versions of graph, plot, tek2plot, spline, double, and the documentation. Richard Stallman further directed development of the programs and provided editorial support for the documentation. John Interrante generously provided the Postscript prologue now included in `libplot', and helpful comments. The distribution, as it stood in 1991, was distributed under the name `GNU graphics'. In 1995 Robert Maier took over development of the package, and expanded it by about an order of magnitude by writing the current, maximally device-independent, standalone version of `libplot'. Robert also rewrote `graph' from scratch, turning it into a real-time filter that would use the new libraries. The idea of including scalable font support in `libplot' came from `axis', a much-hacked version of the Unix `graph' program which is popular in the physics community. `axis' uses the character set of the Unified Graphics System [UGS], a system that was developed in the SLAC Computation Research Group by Robert C. Beach. (See Computer Graphics, Fall 1974, pp. 22-23.) The UGS character set (see ftp://ftp.slac.stanford.edu/software/ugs77/ ) includes many scalable Hershey glyphs and marker symbols, so Robert added first the UGS marker symbols to `libplot', and then the entire library of Hershey glyphs. The Hershey glyphs (designed c. 1967 by Allen Hershey, who deserves a vote of thanks!) were assembled mostly from Pete Holzmann's distribution to Usenet (in vol. 4 of mod.sources). Additional `extended Hershey' vector glyphs were taken from the freeware distribution of Thomas Wolff , which is incorporated in Ghostscript, and a set of 13 Hershey fonts was constructed. After the Hershey fonts were added to `libplot', support for the 35 standard Postscript fonts was added as well. Work on this had begun with Rich Murphey's work on `libps' (the remote ancestor of the Postscript driver contained in `libplot'). At that point, the support for drawing text strings became completely device-independent. Robert also rewrote `spline', adding support for periodicity and tension, and added support for being a real-time filter (using cubic Bessel interpolation). ode was originally developed by Nick Tufillaro on a sequence of platforms that extended back to a PDP-11 running Version 4 Unix. In 1997 Robert modified Nick's 1994 version to agree with GNU conventions on coding and command-line parsing, and extended it to support the full set of special functions supported by gnuplot. Nick kindly agreed to the inclusion of the modified version in the package. After all the above work, version 1.1 of the plotutils package was released in 7/97. For later changes to the package, see the file NEWS. plotutils-2.6/PROBLEMS0000644000175000017500000005155711037720031011516 00000000000000These release notes list minor problems with the GNU libplot graphics library, and with the sample command-line utilities `graph', `plot', `tek2plot', `plotfont', and `pic2plot', which are built on it. We classify them as problems rather than bugs. Most of them are due to idiosyncrasies of (or bugs in) the display devices and application software that libplot must produce output for. See also the file ./COMPAT, for some changes in this release that are relevant to the below problems. ====================================================================== The libplot SVG driver and `graph -T svg' ----------------------------------------- The SVG specification is to some extent a moving target; consult the W3 Consortium's Web pages on SVG ( http://www.w3.org/Graphics/SVG ) for more information. In this release, the SVG produced by libplot's SVG driver complies with the SVG 1.1 specification. However, as of this writing, some SVG viewers fail to implement crucial parts of the specification (especially, those dealing with text). So, the following sorts of problem may be encountered when viewing SVG output. 1. The font used for a text string may not be the one you have selected. libplot's SVG driver attempts to give the SVG viewer enough information to select an appropriate font. For example, `graph -T svg' by default uses a Helvetica font. Its SVG output contains the font specification font-family:'Helvetica',sans-serif; Similarly, if a Times-Bold font is to be used, the SVG output contains the font specification font-family:Times-Bold,'Times Roman',serif; font-weight:bold In all cases, both the font's family name and its Postscript name, if different, will be supplied in the SVG output. In nearly all cases, a `generic name' such as `serif' will be supplied too. However, some SVG viewers have been observed to fail to retrieve a matching font, or any font at all (!), even when they are helped out in this way. One workaround for this problem is to use a builtin Hershey (stroked) font, such as HersheySerif or HersheySans. (For more information on this, see the file ./COMPAT.) Type `graph -Tsvg --help-fonts' to get a complete list of fonts available to you, when producing SVG output. 2. If you switch fonts in the middle of a text string, the substrings may not line up properly. If this occurs, it is because your SVG viewer is using fonts whose metrics are different from what libplot's SVG driver expects. SVG supports the creation of compound (multi-font) text strings, via .. constructs. However, libplot's SVG driver does not currently use these constructs. Support for them may be added to later releases of the driver. Again, the fix is to use one of the builtin Hershey fonts, such as HersheySerif. ---------------------------------------------------------------------- The libplot X driver and `graph -T X' ------------------------------------- 1. The Symbol and ZapfDingbats fonts distributed with some X Window System displays, such as recent releases of XFree86, are incorrectly encoded. In consequence, text strings that contain Greek characters or mathematical symbols may not be displayed correctly. To check the encoding of the Symbol font, do both plotfont -T X Symbol plotfont -T ps Symbol | gv - to display respectively the layout of the Symbol font in your X display, and the standard Postscript symbol font build into the `gv' application. (To see the latter, you could alternatively send the output of `plotfont -T ps Symbol' to a Postscript printer.) If the two character tables look different, complain to the people who supplied your X Window System software. ---------------------------------------------------------------------- The libplot PS driver and `graph -T ps' --------------------------------------- 1. There are a lot of buggy Postscript interpreters out there. If you switch fonts in the middle of drawing a label with `graph -T ps', or when drawing a multi-font string with libplot's PS driver, and the sub-strings don't match up properly when you view the result, it may very well be the fault of your interpreter. Even for the 35 standard Postscript fonts, some vendors don't agree with Adobe as to the width of the printable `8-bit' (non-ASCII) characters. Sun SparcPrinters in particular have been observed to space such characters incorrectly. 2. It has been reported that the freeware `bbfig' program, which is sometimes used for computing the bounding boxes of Postscript files, does not necessarily compute the correct bounding box when it is applied to the output of libplot's PS driver; for example, to a graph produced by `graph -T ps'. The bug here is in bbfig, not in libplot. You should never need to run `bbfig' on Postscript files produced by this package, since they already contain accurate bounding boxes. 3. As seen by the idraw drawing editor, a Postscript file produced by `graph -T ps' or libplot's PS driver will have its colors quantized. Both pen color and fill color will be quantized. These quantizations are due to limitations of idraw. Line widths will be quantized too, since the width of a line in idraw must be an integer number of printer's points. No such quantizations will take place if the Postscript file is viewed with a Postscript interpreter such as Ghostscript, sent directly to a printer, or included in another document. 4. If you use the Postscript Plotter support in libplot/libplotter to draw a self-intersecting filled path, and you specify that the `nonzero winding number rule' should be employed to determine which regions are inside and which are outside the path, the resulting Postscript file will look all right when previewed or printed. But if you use `idraw' to view it or edit it, the other rule (the `odd winding number rule') will be used. The problem is due to `idraw', which does not currently understand the nonzero winding number rule. 5. [Relevant only if configuration used the --enable-lj-fonts option.] If you use `idraw' to edit a Postscript file prepared with `graph -T ps' or libplot's PS driver that contains text in the Wingdings font, some of the Wingdings characters will be incorrectly interchanged. This problem is due to idraw, which does not know that Wingdings is not an ISO-Latin-1 font. The fix is to use a text editor to remove the line /Tidbits reencodeISO def from the edited Postscript file. (The plotting utilities refer to Wingdings internally as `Tidbits'.) ---------------------------------------------------------------------- The libplot CGM driver and `graph -T cgm' ---------------------------------------- 1. There are many older CGM viewers and interpreters, such as the free but unsupported(?) RALCGM and GPLOT viewers, and the CGM import filter used by Microsoft Office, that can only handle version 1 CGM files. To produce output for such CGM viewers and interpreters, you should set the environment variable (i.e., libplot parameter) CGM_MAX_VERSION to "1". The default is to use version 3. (Versions are more or less upward compatible, so any version-1 CGM file is effectively also a version-3 file, but not vice versa.) However, no free (open-source) version-3 CGM viewer is currently available. A high-quality browser plug-in for version-3 CGM files, without source, is available from http://www.sysdev.com . You should be aware that version 1 was much less powerful than later versions, such as version 3. In particular, font handling was not good. Any text string in a CGM file produced by libplot is accompanied by an `extent box' which the string is automatically adjusted to fit, by any CGM viewer or interpreter. That is the case for all versions of the CGM format, including version 1. Unfortunately, in version 1, what it meant for the string to `fit' was not properly specified. Another problem with version 1 format was that there was no way of specifying font properties, such as oblique-vs.-upright, boldface-vs.-regular, etc. So when a font is unavailable, the substituted font is often inappropriate. When producing a version-1 CGM file with the plotting utilities or libplot, Hershey fonts may be the best fonts to use. Any text string in a Hershey font is drawn into a CGM output file not as a CGM text string, but as a collection of polygonal lines, which should be rendered acceptably. To use a Hershey font, you could specify the `-F HersheySerif' option, for example, when you run `graph -T cgm'. 2. If a binary-encoded CGM output file produced by libplot's CGM driver contains any single text string that is longer than about 2000 characters, the RALCGM viewer will not be able to parse the CGM file correctly. In fact, RALCGM may crash. The problem is in RALCGM, not in libplot. This bug is not a major problem, since such extraordinarily long text strings almost never occur. 3. If a CGM output file produced by libplot's CGM driver contains any text string for which the font size is effectively zero, the RALCGM viewer will not be able to display the CGM file correctly. In fact, RALCGM may crash. You can verify this by doing echo 0 0 1 1 2 0 | \ CGM_MAX_VERSION=1 graph -T cgm --font-size 0.000000001 | ralcgm -dx When you attempt to view the output file, you will probably get a segmentation fault. But the bug is in RALCGM, not in libplot. 4. There are some commercial viewers and interpreters which are advertised as able to handle version-3 CGM files, but which in fact cannot do so. The CGM import filter used by Adobe Illustrator (as of version 7.0, at least) is in this category. It does not recognize the so-called custom line styles (i.e., dashing patterns) that version-3 CGM files may include. In fact, if it sees a definition of a custom line style in a CGM file that it is importing, it may stop functioning or crash! Fortunately, CGM files produced by `graph -T cgm' use only CGM's default line styles; not custom ones. `pic2plot -T cgm' and the libplot functions `linedash()' and `flinedash()' do generate custom line styles. Actually, even if CGM_MAX_VERSION is set equal to "1", so that custom CGM line styles are not used, there is still a problem with importing CGM files into Illustrator. When it imports a CGM file, of whatever version, Illustrator-7.0 maps all default CGM line styles to "solid". That is, dotted lines, dashed lines, etc., all appear as solid lines. So the output of `graph -T cgm -m 0', `graph -T cgm -m 1', `graph -T cgm -m 2', etc., will look alike. There seems to be no way around this. Since Illustrator's CGM import filter is so buggy, it is recommended that when generating a graphics file for import into Illustrator, rather than generating a CGM file, you use the `-T ai' option to generate Illustrator's native format. Whether this is necessary for the most recent versions of Illustrator (8.0 and 9.0) has not been checked. 5. As noted, some CGM viewers provide only partial support for the modern version-3 CGM file format. When dealing with such a viewer, it may be useful for you to know which CGM primitives are output by libplot's CGM driver. A list appears in the file libplot/README-cgm. If you have full documentation on the CGM primitives supported by your viewer, the list should help you decide whether it is necessary to reduce the CGM version number from 3 to 2, or to 1. ---------------------------------------------------------------------- The libplot xfig driver and `graph -T fig' ---------------------------------------- 1. At least in some versions of xfig release 3.2, the `fig2dev' program that `xfig' uses to export figures in Postscript format has a bug. It incorrectly transforms minus signs to hyphens, and hyphens to en-dashes. For example, if you do `plotfont -Tfig --box Helvetica' and `plotfont -Tfig --box -2 Helvetica' to produce character maps of the two halves of the Helvetica font, and then use xfig 3.2 to export the two character maps in Postscript format, you will notice that in the exported character maps, the minus sign and hyphen do not fit properly within their boxes. That is because they have been replaced by a hyphen and an en-dash, respectively. This is a problem with `fig2dev', not libplot. If you encounter this problem, a possible workaround is to change, with a text editor, the string "8#255 /endash" in the exported PS file to "8#255 /hyphen 8#055 /minus". The problem has been reported to the xfig maintainer, and may now have been fixed. 2. xfig supports rotation and uniform scaling of the 35 standard Postscript fonts, but not non-uniform scaling or shearing. So libplot's xfig driver automatically replaces anisotropically transformed Postscript fonts by a default Hershey font (HersheySerif). Hershey fonts may always be anisotropically transformed. This affects `graph -T fig', `plotfont -T fig', etc., and in general the output of libplot's xfig driver, if you specify a rectangular (rather than square) viewport. For example, if you do echo 0 0 1 1 2 0 | graph -T fig --page-size letter,xsize=8in,ysize=4in then in the .fig file which is written to standard output, the usual Helvetica font for graph labels will be replaced by HersheySerif. You will get a warning message about that. ---------------------------------------------------------------------- libplot's PCL 5 and HP-GL/2 drivers, and `graph -T pcl' and `graph -T hpgl' ----------------------------------------------------------------------- The following remarks apply when producing either PCL 5 or HP-GL/2 output. That's because PCL 5 output produced by libplot and the plotting utilities is really HP-GL/2 output, preceded by an escape sequence that switches the printer into HP-GL/2 mode. (It's followed by an escape sequence that switches the printer back to PCL 5 mode.) 1. The default treatment of colors in PCL 5 and HP-GL/2 output is not optimal, because the basic HP-GL/2 drawing model is not very powerful. HP-GL/2 supports a set of seven `logical pens', whose colors are black, red, green, yellow, blue, magenta, and cyan. Any line or curve can be drawn by any of the pens, and any region bounded by a curve can be filled, to any specified intensity (quantized in units of 10% or so) by any pen color. And that's just about it: in the basic drawing model, those are the only pen colors and fill colors that can be produced. The situation is even worse than it sounds, because when PCL 5 or HP-GL/2 output is directed to a monochrome display device such as an HP LaserJet, every pen (even the yellow pen) is drawn as black! Fortunately, color PCL 5 and HP-GL/2 devices, such as color LaserJets and DesignJet plotters, support an enhanced drawing model. They can assign arbitrary colors to the logical pens. When producing PCL 5 or HP-GL/2 output for such devices, you should set the environment variable PCL_ASSIGN_COLORS (or HPGL_ASSIGN_COLORS, as the case may be) to "yes". That will significantly improve the rendering of colored plots. 2. Internally, the LaserJet 4L and 5L use a number for the Wingdings font that is different from the number used by other LaserJets. (That's because they use an Intellifont version of the font, rather than a TrueType version.) So if any PCL 5 output that uses the Wingdings font is sent to a 4L or a 5L from `graph -T pcl' or any other of the plotting utilities, it won't print correctly. If you need to work around this problem, you can search for the number `31402' in the file libplot/g_fontd2.c, change it to `6826', and recompile. PCL 5 output will then use the typeface ID that is appropriate for the 4L and 5L. A less drastic remedy is to do a search-and-replace on the PCL 5 output with a text editor, replacing each occurrence of the string "31402" by "6826". The above advice probably applies to the LaserJet 6L as well as the 4L and 5L, but that hasn't been checked. 3. There are some small errors in the positioning of text strings when producing PCL 5 or HP-GL/2 output that uses the Symbol font. For example, if you do `plotfont -Tpcl --box Symbol > symbol.pcl' to get a PCL 5 file that is a character map of the Symbol font, you will notice that in the character map, some of the characters do not quite line up with their boxes. This problem is due to problems in HP's documentation. HP has released useful information on its 45 LaserJet fonts. (This includes font metrics, etc.; see ./INSTALL.fonts.) However, their information on the Symbol font appears to be incorrect. As a consequence, horizontal positioning of text strings in the Symbol font is slightly in error. This problem does not affect the 44 other LaserJet fonts. ---------------------------------------------------------------------- libplot's ReGIS driver and `graph -T regis' ------------------------------------------- `graph -T regis' (along with libplot's ReGIS driver, which it uses) currently contains incomplete support for the filling of regions. If the region to be filled extends beyond the edge of the ReGIS display, ideally it should be clipped, then filled. At present, filling is not performed at all (since the clipping code has not yet been written). In normal operation, this problem should not affect the output of `graph -T regis' at all. But it is really a bug, not just a problem. `graph -T regis' also does not support the 35 standard Postscript fonts; the Hershey fonts must be used instead. (The default font is HersheySerif rather than Helvetica.) The fact that the ZapfDingbats font is not supported means that `graph -T regis' does not support marker symbols greater than or equal to 32, or more accurately it does not select them from the font (ZapfDingbats) that one would expect. ---------------------------------------------------------------------- libplot's Tektronix driver and `graph -T tek' --------------------------------------------- `graph -T tek' (along with libplot's Tektronix driver, which it uses) does not support the filling of regions, so the -q option does not work; also, multiplotting, which normally `blanks out' regions by filling them with white, may result in messy-looking plots. `graph -T tek' also does not support the 35 standard Postscript fonts; the Hershey fonts must be used instead. (The default font is HersheySerif rather than Helvetica.) The fact that the ZapfDingbats font is not supported means that `graph -T tek' does not support marker symbols greater than or equal to 32, or more accurately it does not select them from the font (ZapfDingbats) that one would expect. Filling of regions is not supported because Tektronix storage tubes did not support filling, for obvious reasons. The Tektronix emulator in the MS-DOS version of kermit apparently supports a restricted sort of region filling, but there are currently no plans to extend libplot's Tektronix driver to use it. The 35 Postscript fonts could in principle be supported by libplot's Tektronix driver, if Type 1 or TrueType rasterizer code were added to libplot. There are plans for doing this. But most people are interested in using such a driver to produce bitmaps for the Web, not in using it to draw Type 1 or TrueType fonts on Tek displays. (The phrase "bolting a V-8 onto a Model T" comes to mind.) In `graph -T tek' the `--line-width' and `--frame-line-width' options also do not work, since the Tektronix driver does not support lines with other than a default width (it also does not support the setting of `cap mode' and `join mode' for polylines). A final comment. The Tektronix emulator in xterm(1) has a curious feature (bug?) that no one seems to have commented on. When any line of type other than "solid" (i.e. "dotted", "dotdashed", "shortdashed", "longdashed") is drawn, the pattern of illuminated and non-illuminated pixels along the line is the opposite of what one would expect. So "dotted" lines (obtained e.g. with the "-m 2" option to graph) look more like dashed lines. This bug, if that's what it is, is easily fixed by changing the xterm source code. ====================================================================== Problems with thick lines drawn with libplot -------------------------------------------- A `line segment' is conceptually a rectangle (usually rather thin). But if the affine transformation from user coordinates to device coordinates is not a uniform expansion or contraction, most such rectangles should ideally be sheared into parallelograms in the device frame. However, most display devices cannot display sheared line segments: their `lines', no matter how thick, are always drawn as rectangles. X Windows does not support sheared thick lines. Nor do the xfig or idraw drawing editors, or the HP-GL and HP-GL/2 languages. However, the Postscript and SVG file formats do support them. As a consequence, libplot's PS and SVG drivers are currently the only ones that display sheared thick lines correctly. The problem is evident only for unusually thick lines, of course. A related problem is that a constant-width polyline (polygonal line) drawn in the user frame should, ideally, be drawn in the device frame in an unusual way: the thickness of each line segment should depend on direction. I.e., some segments of a device-frame polyline should be thicker than others. This too is supported only by libplot's PS and SVG drivers. plotutils-2.6/lib/0000777000175000017500000000000011257257507011206 500000000000000plotutils-2.6/lib/README0000644000175000017500000000166210346342330011772 00000000000000This directory contains libcommon, a library of miscellaneous support functions, independent of libplot, which is statically linked with several of the package executables. It also contains the file fontlist.c, which is symlinked at build time into the home directory of any executable that needs to get font information, such as lists of supported font names, from libplot. The reason fontlist.c is not in a library of its own (as it used to be) is that it accesses internal, undocumented data structures of libplot. On AIX systems, it seems libtool can't link the executables with both a `libfontlist' and libplot, due to some AIX foolishness about libraries not being allowed to contain undefined symbols. The functions in libcommon are declared in ../include/libcommon.h, with the exception of those in getopt.c and getopt1.c, which are declared in ../include/getopt.h. The functions in fontlist.c are declared in ../include/fontlist.h. plotutils-2.6/lib/Makefile.am0000644000175000017500000000043510341763455013155 00000000000000## Makefile.am for plotutils/lib. noinst_LIBRARIES = libcommon.a INCLUDES = -I$(srcdir)/../include libcommon_a_SOURCES = compat.c display.c getopt.c getopt1.c xmalloc.c xstrdup.c libcommon_a_LIBADD = @ALLOCA@ libcommon_a_DEPENDENCIES = $(libcommon_a_LIBADD) EXTRA_DIST = fontlist.c plotutils-2.6/lib/Makefile.in0000644000175000017500000003301411234210073013146 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ alloca.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libcommon_a_AR = $(AR) $(ARFLAGS) am_libcommon_a_OBJECTS = compat.$(OBJEXT) display.$(OBJEXT) \ getopt.$(OBJEXT) getopt1.$(OBJEXT) xmalloc.$(OBJEXT) \ xstrdup.$(OBJEXT) libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libcommon_a_SOURCES) DIST_SOURCES = $(libcommon_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libcommon.a INCLUDES = -I$(srcdir)/../include libcommon_a_SOURCES = compat.c display.c getopt.c getopt1.c xmalloc.c xstrdup.c libcommon_a_LIBADD = @ALLOCA@ libcommon_a_DEPENDENCIES = $(libcommon_a_LIBADD) EXTRA_DIST = fontlist.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libcommon.a: $(libcommon_a_OBJECTS) $(libcommon_a_DEPENDENCIES) -rm -f libcommon.a $(libcommon_a_AR) libcommon.a $(libcommon_a_OBJECTS) $(libcommon_a_LIBADD) $(RANLIB) libcommon.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrdup.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: plotutils-2.6/lib/alloca.c0000644000175000017500000003150610346327147012522 00000000000000/* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #include "sys-defines.h" /* If compiling with GCC, this file's not needed. */ #ifndef alloca #ifdef emacs #ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ #ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time #endif /* STACK_DIRECTION undefined */ #endif /* static */ #endif /* emacs */ #ifdef emacs #define free xfree #endif /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ #ifdef CRAY long i00afunc (); #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) #else #define ADDRESS_FUNCTION(arg) &(arg) #endif /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #ifndef STACK_DIRECTION #define STACK_DIRECTION 0 /* Direction unknown. */ #endif #if STACK_DIRECTION != 0 #define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ #else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ #define STACK_DIR stack_dir static void _x_retrieve_font (void) { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } #endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ #ifndef ALIGN_SIZE #define ALIGN_SIZE sizeof(double) #endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ void * alloca (unsigned size) { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); #if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); #endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free ((void *) hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { register void * newptr = malloc (sizeof (header) + size); /* Address of header. */ ((header *) newptr)->h.next = last_alloca_header; ((header *) newptr)->h.deep = depth; last_alloca_header = (header *) newptr; /* User storage begins just after header. */ return (void *) ((char *) newptr + sizeof (header)); } } #ifdef CRAY #ifdef DEBUG_I00AFUNC #include #endif #ifndef CRAY_STACK #define CRAY_STACK #ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; #else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; #endif /* CRAY2 */ #endif /* not CRAY_STACK */ #ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } #else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); #endif if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o\n", pseg, size); #endif stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } #endif /* not CRAY2 */ #endif /* CRAY */ #endif /* no alloca */ plotutils-2.6/lib/compat.c0000644000175000017500000000234411037240361012536 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Replacement for system strerror() if it doesn't exist. */ #include "libcommon.h" #ifndef HAVE_STRERROR /* external */ extern char *sys_errlist[]; extern int sys_nerr; char * strerror (int errnum) { if (errnum < 0 || errnum >= sys_nerr) return "unknown error"; return sys_errlist[errnum]; } #endif /* not HAVE_STRERROR */ plotutils-2.6/lib/display.c0000644000175000017500000001270011234341730012716 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the display_usage routine, which is used in user-level programs in the plotutils package. It prints program options and long options in a reasonably nice format. This file also contains the display_version routine. */ #include "libcommon.h" #include "getopt.h" /* global array of long options, in program we're to be linked with */ extern struct option long_options[]; #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 /* forward references */ bool elementp (int item, const int *list); void display_usage (const char *progname, const int *omit_vals, const char *appendage, int info); void display_version (const char *progname, const char *written, const char *copyright); /* ARGS: list = null-terminated list of integers */ bool elementp (int item, const int *list) { int list_item; while ((list_item = *list++) != 0) { if (item == list_item) return true; } return false; } /* final arg of display_usage below is 0/1/2, meaning: 0. Print no info on output formats, because it is not relevant. (This is used by `spline' and `ode'.) 1. Print info on output formats, specified by a `-T format' option, but not on the existence of a `--help-fonts' option, which returns info specific to the choice of an output format. (This is used by `hersheydemo', which has a -T option but no user-specified fonts.) 2. Print info on output formats, specified by a `-T format' option, and also on the existence of a `--help-fonts' option, which returns info on fonts that is specific to the choice of an output format. (This is used by `graph', `plot', 'tek2plot', `plotfont'.) */ void display_usage (const char *progname, const int *omit_vals, const char *appendage, int info) { int i; int col = 0; fprintf (stdout, "Usage: %s", progname); col += (strlen (progname) + 7); for (i = 0; long_options[i].name; i++) { int option_len; if (elementp (long_options[i].val, omit_vals)) continue; option_len = strlen (long_options[i].name); if (col >= 80 - (option_len + 16)) { fputs ("\n\t", stdout); col = 8; } fprintf (stdout, " [--%s", long_options[i].name); col += (option_len + 4); if ((unsigned int)(long_options[i].val) < 256) { fprintf (stdout, " | -%c", long_options[i].val); col += 5; } if (long_options[i].has_arg == ARG_REQUIRED) { fputs (" arg]", stdout); col += 5; } else if (long_options[i].has_arg == ARG_OPTIONAL) { fputs (" [arg(s)]]", stdout); col += 10; } else { fputs ("]", stdout); col++; } } if (appendage != NULL) fputs (appendage, stdout); else fputs ("\n", stdout); if (info == 1) { fprintf (stdout, "\n\ To specify an output format, type `%s -T \"format\"',\n\ where \"format\" is one of:\n", progname); } else if (info == 2) { fprintf (stdout, "\n\ To list available fonts, type `%s -T \"format\" --help-fonts',\n\ where \"format\" is the output format, and is one of:\n", progname); } if (info == 1 || info == 2) { #ifdef INCLUDE_PNG_SUPPORT #ifndef X_DISPLAY_MISSING fprintf (stdout, "\ X, png, pnm, or gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, or tek (vector formats).\n"); #else /* X_DISPLAY_MISSING */ fprintf (stdout, "\ png, pnm, or gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, or tek (vector formats).\n"); #endif /* X_DISPLAY_MISSING */ #else /* not INCLUDE_PNG_SUPPORT */ #ifndef X_DISPLAY_MISSING fprintf (stdout, "\ X, pnm, or gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, or tek (vector formats).\n"); #else /* X_DISPLAY_MISSING */ fprintf (stdout, "\ pnm or gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, or tek (vector formats).\n"); #endif /* X_DISPLAY_MISSING */ #endif fprintf (stdout, "\ The default format is \"meta\", which is probably not what you want.\n"); } if ((appendage != NULL) || info == 1 || info == 2) fputs ("\n", stdout); fprintf (stdout, "\ Report bugs to %s.\n", PACKAGE_BUGREPORT); } void display_version (const char *progname, const char *written, const char *copyright) { fprintf (stdout, "%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); fprintf (stdout, "%s\n", copyright); fprintf (stdout, "%s", "This is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); fprintf (stdout, "%s\n", written); } plotutils-2.6/lib/getopt.c0000644000175000017500000004126311037267175012574 00000000000000/* Getopt for GNU. Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. */ #include "sys-defines.h" extern char *progname; /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* XXX 1003.2 says this must be 1 before any call. */ int optind = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return EOF with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv) { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ static const char * _getopt_initialize (const char *optstring) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind = 1; nextchar = NULL; /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (getenv ("POSIXLY_CORRECT") != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns `EOF'. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only) { optarg = NULL; if (optind == 0) optstring = _getopt_initialize (optstring); if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && (argv[optind][0] != '-' || argv[optind][1] == '\0')) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return EOF; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if ((argv[optind][0] != '-' || argv[optind][1] == '\0')) { if (ordering == REQUIRE_ORDER) return EOF; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !strchr (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if (nameend == (nextchar + strlen (p->name))) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, "%s: the option `%s' is ambiguous\n", progname, argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, "%s: the option `--%s' doesn't allow an argument\n", progname, pfound->name); else /* +option or -option */ fprintf (stderr, "%s: the option `%c%s' doesn't allow an argument\n", progname, argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, "%s: the option `%s' requires an argument\n", progname, argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || strchr (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, "%s: the option `--%s' is unrecognized\n", progname, nextchar); else /* +option or -option */ fprintf (stderr, "%s: the option `%c%s' is unrecognized\n", progname, argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, "%s: illegal option -- %c\n", progname, c); } optopt = c; return '?'; } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, "%s: option requires an argument -- %c\n", progname, c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int gnu_getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } plotutils-2.6/lib/getopt1.c0000644000175000017500000000141610341671613012642 00000000000000/* getopt_long and getopt_long_only entry points for GNU getopt. */ #include #include "sys-defines.h" #include "getopt.h" int getopt_long (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (int argc, char *const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } plotutils-2.6/lib/xmalloc.c0000644000175000017500000000277311037240416012721 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "libcommon.h" void * xmalloc (size_t length) { void * p; p = (void *) malloc (length); if (p == (void *) NULL) { perror ("out of memory"); exit (EXIT_FAILURE); } return p; } void * xrealloc (void * p, size_t length) { p = (void *) realloc (p, length); if (p == (void *) NULL) { perror ("out of memory"); exit (EXIT_FAILURE); } return p; } void * xcalloc (size_t nmemb, size_t size) { void * p; p = (void *) calloc (nmemb, size); if (p == (void *) NULL) { perror ("out of memory"); exit (EXIT_FAILURE); } return p; } plotutils-2.6/lib/xstrdup.c0000644000175000017500000000203211037240423012755 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "libcommon.h" char * xstrdup (const char *s) { char *t = (char *)xmalloc (strlen (s) + 1); strcpy (t, s); return t; } plotutils-2.6/lib/fontlist.c0000644000175000017500000004162411234341663013127 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the display_fonts and list_fonts routines, which are used in user-level executables that are linked with libplot. (Their output is device-specific.) These functions are declared in fontlist.h. Currently, they get information about font names by invoking undocumented members of the libplot API, which return pointers to internal library data structures. These undocumented functions are _pl_get_hershey_font_info, _pl_get_ps_font_info, _pl_get_pcl_font_info, and _pl_get_stick_font_info. */ #include "sys-defines.h" #include "libcommon.h" #include "plot.h" #include "fontlist.h" /* for use in printing font names in two columns; assumption is that all font name strings have lengths in range 0..MAX_FONTNAME_LEN inclusive (not counting final null) */ #define MAX_FONTNAME_LEN 36 static char spaces[MAX_FONTNAME_LEN+1] = " "; /* The definitions of these structures are taken from ../libplot/extern.h. IF THOSE STRUCTURES CHANGE, THESE SHOULD TOO. Font information is stored in ../libplot/g_fontdb.c, and we'll retrieve pointers to it by using the undocumented libplot functions. */ struct plHersheyFontInfoStruct { const char *name; /* font name */ const char *othername; /* an alias (for backward compatibility) */ const char *orig_name; /* Allen Hershey's original name for it */ short chars[256]; /* array of vector glyphs */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ bool obliquing; /* whether to apply obliquing */ bool iso8859_1; /* whether font encoding is iso8859-1 */ bool visible; /* whether font is visible, i.e. not internal */ }; struct plPSFontInfoStruct { const char *ps_name; /* the postscript font name */ const char *ps_name_alt; /* alternative PS font name, if non-NULL */ const char *ps_name_alt2; /* 2nd alternative PS font name, if non-NULL */ const char *x_name; /* the X Windows font name */ const char *x_name_alt; /* alternative X Windows font name */ const char *x_name_alt2; /* 2nd alternative X Windows font name */ const char *x_name_alt3; /* 3rd alternative X Windows font name */ const char *css_family; /* CSS font family */ const char *css_generic_family; /* CSS generic font family */ const char *css_style; /* CSS font style */ const char *css_weight; /* CSS font weight */ const char *css_stretch; /* CSS font stretch */ const char *css_panose; /* CSS font Panose */ int pcl_typeface; /* the PCL typeface number */ int hpgl_spacing; /* 0=fixed width, 1=variable */ int hpgl_posture; /* 0=upright, 1=italic, etc. */ int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1, etc. */ int font_ascent; /* the font's ascent (from bounding box) */ int font_descent; /* the font's descent (from bounding box) */ int font_cap_height; /* the font's cap height */ int font_x_height; /* the font's x height */ short width[256]; /* per-character width information */ short offset[256]; /* per-character left edge information */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ int fig_id; /* Fig's font id */ bool iso8859_1; /* whether font encoding is iso8859-1 */ }; struct plPCLFontInfoStruct { const char *ps_name; /* the postscript font name */ const char *ps_name_alt; /* alternative PS font name, if non-NULL */ const char *substitute_ps_name; /* replacement name (for use in a PS file) */ const char *x_name; /* the X Windows font name */ const char *css_family; /* CSS font family */ const char *css_generic_family; /* CSS generic font family */ const char *css_style; /* CSS font style */ const char *css_weight; /* CSS font weight */ const char *css_stretch; /* CSS font stretch */ const char *css_panose; /* CSS font Panose */ int pcl_typeface; /* the PCL typeface number */ int hpgl_spacing; /* 0=fixed width, 1=variable */ int hpgl_posture; /* 0=upright, 1=italic, etc. */ int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1, etc. */ int font_ascent; /* the font's ascent (from bounding box) */ int font_descent; /* the font's descent (from bounding box) */ int font_cap_height; /* the font's cap height */ int font_x_height; /* the font's x height */ short width[256]; /* per-character width information */ short offset[256]; /* per-character left edge information */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ bool iso8859_1; /* whether font encoding is iso8859-1 */ }; struct plStickFontInfoStruct { const char *ps_name; /* the postscript font name */ bool basic; /* basic stick font (supp. on all devices)? */ int pcl_typeface; /* the PCL typeface number */ int hpgl_spacing; /* 0=fixed width, 1=variable */ int hpgl_posture; /* 0=upright, 1=italic, etc. */ int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1 */ int font_ascent; /* the font's ascent (from bounding box) */ int font_descent; /* the font's descent (from bounding box) */ int raster_width_lower; /* width of abstract raster (lower half) */ int raster_height_lower; /* height of abstract raster (lower half) */ int raster_width_upper; /* width of abstract raster (upper half) */ int raster_height_upper; /* height of abstract raster (upper half) */ int hpgl_charset_lower; /* old HP character set number (lower half) */ int hpgl_charset_upper; /* old HP character set number (upper half) */ int kerning_table_lower; /* number of a kerning table (lower half) */ int kerning_table_upper; /* number of a kerning table (upper half) */ char width[256]; /* per-character width information */ int offset; /* left edge (applies to all chars) */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ bool obliquing; /* whether to apply obliquing */ bool iso8859_1; /* encoding is iso8859-1? (after reencoding) */ }; /* List of Plotter types we support getting font information from, NULL-terminated. This list also appears in the program text below. */ #ifdef INCLUDE_PNG_SUPPORT #ifndef X_DISPLAY_MISSING static const char *_known_devices[] = { "X", "png", "pnm", "gif", "svg", "ai", "ps", "cgm", "fig", "pcl", "hpgl", "regis", "tek", "meta", NULL }; #else static const char *_known_devices[] = { "png", "pnm", "gif", "svg", "ai", "ps", "cgm", "fig", "pcl", "hpgl", "regis", "tek", "meta", NULL }; #endif #else /* not INCLUDE_PNG_SUPPORT */ #ifndef X_DISPLAY_MISSING static const char *_known_devices[] = { "X", "pnm", "gif", "svg", "ai", "ps", "cgm", "fig", "pcl", "hpgl", "regis", "tek", "meta", NULL }; #else static const char *_known_devices[] = { "pnm", "gif", "svg", "ai", "ps", "cgm", "fig", "pcl", "hpgl", "regis", "tek", "meta", NULL }; #endif #endif /* not INCLUDE_PNG_SUPPORT */ int display_fonts (const char *output_format, const char *progname) { plPlotter *plotter; plPlotterParams *plotter_params; int numfonts, numpairs, i, j, k; bool found = false, odd; const char **device_ptr = _known_devices; while (*device_ptr) if (strcmp (output_format, *device_ptr++) == 0) { found = true; break; } if (found == false || strcmp (output_format, "meta") == 0) { #ifdef INCLUDE_PNG_SUPPORT #ifndef X_DISPLAY_MISSING fprintf (stderr, "\ To list available fonts, type `%s -T \"format\" --help-fonts',\n\ where \"format\" is the output format, and is one of:\n\ X, png, pnm, gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, tek (vector formats).\n", progname); #else /* X_DISPLAY_MISSING */ fprintf (stderr, "\ To list available fonts, type `%s -T \"format\" --help-fonts',\n\ where \"format\" is the output format, and is one of:\n\ png, pnm, gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, tek (vector formats).\n", progname); #endif /* X_DISPLAY_MISSING */ #else /* not INCLUDE_PNG_SUPPORT */ #ifndef X_DISPLAY_MISSING fprintf (stderr, "\ To list available fonts, type `%s -T \"format\" --help-fonts',\n\ where \"format\" is the output format, and is one of:\n\ X, pnm, or gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, tek (vector formats).\n", progname); #else /* X_DISPLAY_MISSING */ fprintf (stderr, "\ To list available fonts, type `%s -T \"format\" --help-fonts',\n\ where \"format\" is the output format, and is one of:\n\ pnm or gif (bitmap formats), or\n\ svg, ps, ai, cgm, fig, pcl, hpgl, regis, tek (vector formats).\n", progname); #endif /* X_DISPLAY_MISSING */ #endif /* not INCLUDE_PNG_SUPPORT */ return 0; } plotter_params = pl_newplparams (); if ((plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params)) == NULL) { fprintf (stderr, "%s: no font information on display device \"%s\" is available\n", progname, output_format); return 0; } if (pl_havecap_r (plotter, "HERSHEY_FONTS")) { const struct plHersheyFontInfoStruct *hershey_font_info = (const struct plHersheyFontInfoStruct *)_pl_get_hershey_font_info (plotter); int visible_num; numfonts = 0; for (i=0; hershey_font_info[i].name; i++) if (hershey_font_info[i].visible) numfonts++; odd = (numfonts % 2 == 1 ? true : false); numpairs = numfonts / 2; /* compute j and k: j=0, k=numpairs + (odd ? 1 : 0) in terms of visibles */ j = 0; k = 0; visible_num = -1; for (i=0; hershey_font_info[i].name; i++) if (hershey_font_info[i].visible) { visible_num++; /* visible_num is index into array of visibles */ if (visible_num == 0) j = i; else if (visible_num == numpairs + (odd ? 1 : 0)) k = i; } fprintf (stdout, "Names of supported Hershey vector fonts (case-insensitive):\n"); for (i=0; i < numpairs; i++) { int len; len = strlen (hershey_font_info[j].name); fprintf (stdout, "\t%s", hershey_font_info[j].name); spaces[MAX_FONTNAME_LEN - len] = '\0'; fputs (spaces, stdout); spaces[MAX_FONTNAME_LEN - len] = ' '; fprintf (stdout, "%s\n", hershey_font_info[k].name); /* bump both j and k */ do j++; while (hershey_font_info[j].visible == false); if (i < numpairs - 1) { do k++; while (hershey_font_info[k].visible == false); } } if (odd) fprintf (stdout, "\t%s\n", hershey_font_info[j].name); } if (pl_havecap_r (plotter, "STICK_FONTS")) { const struct plStickFontInfoStruct *stick_font_info = (const struct plStickFontInfoStruct *)_pl_get_stick_font_info (plotter); int extra_fonts, *goodfonts; numfonts = 0; for (i=0; stick_font_info[i].ps_name; i++) numfonts++; /* if this Plotter doesn't support extras, skip them */ extra_fonts = pl_havecap_r (plotter, "EXTRA_STICK_FONTS"); goodfonts = (int *)xmalloc (numfonts * sizeof(int)); for (i=0, j=0; stick_font_info[i].ps_name; i++) { if (!extra_fonts && stick_font_info[i].basic == false) continue; goodfonts[j++] = i; } numfonts = j; odd = (numfonts % 2 == 1 ? true : false); numpairs = numfonts / 2; fprintf (stdout, "Names of supported HP vector fonts (case-insensitive):\n"); for (i=0, j=0, k=numpairs + (odd ? 1 : 0); i < numpairs; i++) { int len; len = strlen (stick_font_info[goodfonts[j]].ps_name); fprintf (stdout, "\t%s", stick_font_info[goodfonts[j++]].ps_name); spaces[MAX_FONTNAME_LEN - len] = '\0'; fputs (spaces, stdout); spaces[MAX_FONTNAME_LEN - len] = ' '; fprintf (stdout, "%s\n", stick_font_info[goodfonts[k++]].ps_name); } if (odd) fprintf (stdout, "\t%s\n", stick_font_info[goodfonts[j]].ps_name); free (goodfonts); } if (pl_havecap_r (plotter, "PCL_FONTS")) { const struct plPCLFontInfoStruct *pcl_font_info = (const struct plPCLFontInfoStruct *)_pl_get_pcl_font_info (plotter); numfonts = 0; for (i=0; pcl_font_info[i].ps_name; i++) numfonts++; odd = (numfonts % 2 == 1 ? true : false); numpairs = numfonts / 2; fprintf (stdout, "Names of supported PCL fonts (case-insensitive):\n"); for (i=0, j=0, k=numpairs + (odd ? 1 : 0); i < numpairs; i++) { int len; len = strlen (pcl_font_info[j].ps_name); fprintf (stdout, "\t%s", pcl_font_info[j++].ps_name); spaces[MAX_FONTNAME_LEN - len] = '\0'; fputs (spaces, stdout); spaces[MAX_FONTNAME_LEN - len] = ' '; fprintf (stdout, "%s\n", pcl_font_info[k++].ps_name); } if (odd) fprintf (stdout, "\t%s\n", pcl_font_info[j].ps_name); } if (pl_havecap_r (plotter, "PS_FONTS")) { const struct plPSFontInfoStruct *ps_font_info = (const struct plPSFontInfoStruct *)_pl_get_ps_font_info (plotter); numfonts = 0; for (i=0; ps_font_info[i].ps_name; i++) numfonts++; odd = (numfonts % 2 == 1 ? true : false); numpairs = numfonts / 2; fprintf (stdout, "Names of supported Postscript fonts (case-insensitive):\n"); for (i=0, j=0, k=numpairs + (odd ? 1 : 0); i < numpairs; i++) { int len; len = strlen (ps_font_info[j].ps_name); fprintf (stdout, "\t%s", ps_font_info[j++].ps_name); spaces[MAX_FONTNAME_LEN - len] = '\0'; fputs (spaces, stdout); spaces[MAX_FONTNAME_LEN - len] = ' '; fprintf (stdout, "%s\n", ps_font_info[k++].ps_name); } if (odd) fprintf (stdout, "\t%s\n", ps_font_info[j].ps_name); } if (strcmp (output_format, "X") == 0) { fprintf (stdout, "Most core X Window System fonts, such as charter-medium-r-normal,\n"); fprintf (stdout, "can also be used.\n"); } return 1; } /* Write font names to standard output, in a line-by-line rather than a tabular form. */ int list_fonts (const char *output_format, const char *progname) { plPlotter *plotter; plPlotterParams *plotter_params; bool found = false; int i; const char **device_ptr = _known_devices; while (*device_ptr) if (strcmp (output_format, *device_ptr++) == 0) { found = true; break; } if (found == false) { fprintf (stderr, "%s: no font information on display device \"%s\" is available\n", progname, output_format); return 0; } plotter_params = pl_newplparams (); if ((plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params)) == NULL) { fprintf (stderr, "%s: no font information on display device \"%s\" is available\n", progname, output_format); return 0; } if (pl_havecap_r (plotter, "HERSHEY_FONTS")) { const struct plHersheyFontInfoStruct *hershey_font_info = (const struct plHersheyFontInfoStruct *)_pl_get_hershey_font_info (plotter); for (i=0; hershey_font_info[i].name; i++) if (hershey_font_info[i].visible) fprintf (stdout, "%s\n", hershey_font_info[i].name); } if (pl_havecap_r (plotter, "STICK_FONTS")) { const struct plStickFontInfoStruct *stick_font_info = (const struct plStickFontInfoStruct *)_pl_get_stick_font_info (plotter); int extra_fonts = pl_havecap_r (plotter, "EXTRA_STICK_FONTS"); for (i=0; stick_font_info[i].ps_name; i++) { if (!extra_fonts && stick_font_info[i].basic == false) continue; fprintf (stdout, "%s\n", stick_font_info[i].ps_name); } } if (pl_havecap_r (plotter, "PCL_FONTS")) { const struct plPCLFontInfoStruct *pcl_font_info = (const struct plPCLFontInfoStruct *)_pl_get_pcl_font_info (plotter); for (i=0; pcl_font_info[i].ps_name; i++) fprintf (stdout, "%s\n", pcl_font_info[i].ps_name); } if (pl_havecap_r (plotter, "PS_FONTS")) { const struct plPSFontInfoStruct *ps_font_info = (const struct plPSFontInfoStruct *)_pl_get_ps_font_info (plotter); for (i=0; ps_font_info[i].ps_name; i++) fprintf (stdout, "%s\n", ps_font_info[i].ps_name); } return 1; } plotutils-2.6/spline/0000777000175000017500000000000011257257507011732 500000000000000plotutils-2.6/spline/Makefile.am0000644000175000017500000000026110341763455013676 00000000000000## Process this file with automake to produce Makefile.in bin_PROGRAMS = spline spline_SOURCES = spline.c INCLUDES = -I$(srcdir)/../include spline_LDADD = ../lib/libcommon.a plotutils-2.6/spline/Makefile.in0000644000175000017500000003367011234210076013705 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = spline$(EXEEXT) subdir = spline DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_spline_OBJECTS = spline.$(OBJEXT) spline_OBJECTS = $(am_spline_OBJECTS) spline_DEPENDENCIES = ../lib/libcommon.a DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(spline_SOURCES) DIST_SOURCES = $(spline_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ spline_SOURCES = spline.c INCLUDES = -I$(srcdir)/../include spline_LDADD = ../lib/libcommon.a all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu spline/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu spline/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done spline$(EXEEXT): $(spline_OBJECTS) $(spline_DEPENDENCIES) @rm -f spline$(EXEEXT) $(LINK) $(spline_OBJECTS) $(spline_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spline.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: plotutils-2.6/spline/spline.c0000644000175000017500000016440011234220611013266 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This program, spline, interpolates scalar or vector-valued input data using splines with tension, including piecewise cubic (zero-tension) splines. When acting as a real-time filter, it uses cubic Bessel interpolation instead. Written by Robert S. Maier , based on earlier work by Rich Murphey. References: D. Kincaid and [E.] W. Cheney, Numerical Analysis, Brooks/Cole, 2nd. ed., 1996, Section 6.4. C. de Boor, A Practical Guide to Splines, Springer-Verlag, 1978, Chapter 4. A. K. Cline, "Scalar and Planar-Valued Curve Fitting Using Splines under Tension", Communications of the ACM 17 (1974), 218-223. The tension in a spline is set with the -T (i.e., --tension) option. By definition, a one-dimensional spline with tension satisfies the differential equation y''''=sgn(tension)*(tension**2)y''. The default value for the tension is zero. If tension=0 then a spline with tension reduces to a conventional piecewise cubic spline. In the limits tension->+infinity and tension->-infinity, a spline with tension reduces to a piecewise linear (`broken line') interpolation. To oversimplify a bit, 1.0/tension is the maximum abscissa range over which the spline likes to curve, at least when tension>0. So increasing the tension far above zero tends to make the spline contain short curved sections, separated by sections that are almost straight. The curved sections will be centered on the user-specified data points. The behavior of the spline when tension<0 is altogether different: it will tend to oscillate, though as tension->-infinity the oscillations are damped out. Tension is a `dimensionful' quantity. If tension=0 (the cubic spline case), then the computation of the spline is scale-invariant. But if the tension is nonzero, then when the abscissa values are multiplied by some common positive factor, the tension should be divided by the same factor to obtain a scaled version of the original spline. The algorithms of Kincaid and Cheney have been extended to include support for periodicity. To obtain a periodic spline, with or without tension, the user uses the -p (i.e., --periodic) option and supplies input data satisfying y[n]=y[0]. Also, in the non-periodic case the algorithms have been extended to include support for a parameter k, which appears in the two boundary conditions y''[0]=ky''[1] and y''[n]=ky''[n-1]. The default value of k is 1.0. The parameter k, which is specified with the -k (i.e. --boundary-condition) option, is ignored for periodic splines (using the -k option with the -p option will elicit a warning). If the -f option is specified, then an altogether different (real-time) algorithm for generating interpolating points will be used, so that this program can be used as a real-time filter. If -f is specified then the -t option, otherwise optional, must also be used. (I.e., the minimum and maximum abscissa values for the interpolating points must be specified, and optionally the spacing between them as well. If the spacing is not specified on the command line, then the interval [tmin,tmax] will be subdivided into a default number of intervals [100], unless the default number of intervals is overridden with the -n option. The real-time algorithm that is used when the -f option is specified is cubic Bessel interpolation. (The -T, -p, and -k options are ignored when -f is specified; using them will elicit a warning.) Interpolation in this case is piecewise cubic, and the slopes at either end of each sub-interval are found by fitting a parabola through each successive triple of points. That is, the slope at t=t_n is found by fitting a parabola through the points at t_(n-1), t_n, and t_(n+1). This interpolation scheme yields a spline that is only once, rather than twice, continuously differentiable. However, it has the feature that all computations are local rather than global, so it is suitable for real-time work. Since the above was written, the -d option has been added, to permit the splining of multidimensional data. All components of a d-dimensional data set (a d-dimensional vector y is specified at each t) are splined in the same way, as if they were one-dimensional functions of t. All options that apply to 1-dimensional datasets, such as -T, -p, -k, -f, etc., apply to d-dimensional ones also. */ #include "sys-defines.h" #include "libcommon.h" #include "getopt.h" /* states for cubic Bessel DFA; occupancy of data point queue */ enum { STATE_ZERO, STATE_ONE, STATE_TWO, STATE_THREE }; /* types of auto-abscissa */ enum { AUTO_NONE, AUTO_INCREMENT, AUTO_BY_DISTANCE }; #define FUZZ 0.0000001 /* potential roundoff error */ /* Minimum value for magnitude of x, for such functions as x-sinh(x), x-tanh(x), x-sin(x), and x-tan(x) to have acceptable accuracy. If the magnitude of x is smaller than this value, these functions of x will be computed via power series to accuracy O(x**6). */ #define TRIG_ARG_MIN 0.001 /* Maximum value for magnitude of x, beyond which we approximate x/sinh(x) and x/tanh(x) by |x|exp(-|x|). */ #define TRIG_ARG_MAX 50.0 /* options */ #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 const char *optstring = "fpsAd:I:O:P:k:n:t:x:T:a::"; struct option long_options[] = { {"no-of-intervals", ARG_REQUIRED, NULL, 'n'}, {"periodic", ARG_NONE, NULL, 'p'}, {"y-dimension", ARG_REQUIRED, NULL, 'd'}, {"t-limits", ARG_REQUIRED, NULL, 't'}, /* 1 or 2 or 3 */ {"t-limits", ARG_REQUIRED, NULL, 'x'}, /* obsolescent; hidden */ {"tension", ARG_REQUIRED, NULL, 'T'}, {"boundary-condition",ARG_REQUIRED, NULL, 'k'}, {"auto-abscissa", ARG_OPTIONAL, NULL, 'a'}, /* 0 or 1 or 2 */ {"auto-dist-abscissa",ARG_NONE, NULL, 'A'}, {"filter", ARG_NONE, NULL, 'f'}, {"precision", ARG_REQUIRED, NULL, 'P'}, {"suppress-abscissa", ARG_NONE, NULL, 's'}, /* ascii or double */ {"input-type", ARG_REQUIRED, NULL, 'I'}, {"output-type", ARG_REQUIRED, NULL, 'O'}, /* Long options with no equivalent short option alias */ {"version", ARG_NONE, NULL, 'V' << 8}, {"help", ARG_NONE, NULL, 'h' << 8}, {NULL, 0, 0, 0} }; /* null-terminated list of options that we don't show to the user */ const int hidden_options[] = { (int)'x', 0 }; /* type of data in input and output streams */ typedef enum { T_ASCII, T_SINGLE, T_DOUBLE, T_INTEGER } data_type; data_type input_type = T_ASCII; data_type output_type = T_ASCII; const char *progname = "spline"; /* name of this program */ const char *written = "Written by Robert S. Maier and Rich Murphey."; const char *copyright = "Copyright (C) 2009 Free Software Foundation, Inc."; const char *usage_appendage = " [FILE]...\n\ With no FILE, or when FILE is -, read standard input.\n"; /* forward references */ bool do_bessel (FILE *input, int ydimension, int auto_abscissa, double auto_t, double auto_delta, double first_t, double last_t, double spacing_t, int precision, bool suppress_abscissa); bool is_monotonic (int n, double *t); bool read_data (FILE *input, int *len, int *used, int auto_abscissa, double auto_t, double auto_delta, double **t, int ydimension, double **y, double **z); bool read_float (FILE *input, double *dptr); bool skip_whitespace (FILE *stream); bool write_point (double t, double *y, int ydimension, int precision, bool suppress_abscissa); double interpolate (int n, double *t, double *y, double *z, double x, double tension, bool periodic); double quotient_sin_func (double x, double y); double quotient_sinh_func (double x, double y); double sin_func (double x); double sinh_func (double x); double tan_func (double x); double tanh_func (double x); int read_point (FILE *input, double *t, double *y, int ydimension, bool *first_point, int auto_abscissa, double *auto_t, double auto_delta, double *stored); void do_bessel_range (double abscissa0, double abscissa1, double *value0, double *value1, double *slope0, double *slope1, double first_t, double last_t, double spacing_t, int ydimension, int precision, bool endit, bool suppress_abscissa); void do_spline (int used, int len, double **t, int ydimension, double **y, double **z, double tension, bool periodic, bool spec_boundary_condition, double boundary_condition, int precision, double first_t, double last_t, double spacing_t, int no_of_intervals, bool spec_first_t, bool spec_last_t, bool spec_spacing_t, bool spec_no_of_intervals, bool suppress_abscissa); void fit (int n, double *t, double *y, double *z, double k, double tension, bool periodic); void maybe_emit_oob_warning (void); void non_monotonic_error (void); void output_dataset_separator (void); void set_format_type (char *s, data_type *typep); int main (int argc, char *argv[]) { int option; int opt_index; int errcnt = 0; /* errors encountered */ bool show_version = false; /* remember to show version message */ bool show_usage = false; /* remember to output usage message */ bool dataset_follows; /* parameters controlled by command line options: */ bool filter = false; /* act as a filter (cubic Bessel)? */ bool periodic = false; /* spline should be periodic? */ bool spec_boundary_condition = false; /* user-specified boundary cond'n? */ bool spec_first_t = false, spec_last_t = false, spec_spacing_t = false; bool spec_no_of_intervals = false; /* user-specified number of intervals? */ bool suppress_abscissa = false; /* for each point, print ordinate only? */ double boundary_condition = 1.0; /* force y''_1 = k * y''_0, etc. */ double delta_t = 1.0; /* increment of auto abscissa */ double first_t = 0.0, last_t = 0.0, spacing_t = 0.0; /* values of limits */ double tension = 0.0; /* `tension' parameter */ double t_start = 0.0; /* start of auto abscissa */ int auto_abscissa = AUTO_NONE; /* automatic generation of abscissa? */ int no_of_intervals = 100; /* no. of intervals to divide abs. range */ int precision = 6; /* default no. of significant digits printed */ int ydimension = 1; /* dimension of each point's ordinate */ /* used in argument parsing */ double local_first_t, local_last_t, local_spacing_t; double local_t_start, local_delta_t; int local_precision; for ( ; ; ) { option = getopt_long (argc, argv, optstring, long_options, &opt_index); if (option == 0) option = long_options[opt_index].val; switch (option) { /* ----------- options with no argument --------------*/ case 'p': /* construct periodic, i.e., closed spline */ periodic = true; break; case 'f': /* act as filter */ filter = true; break; case 's': /* don't output t values */ suppress_abscissa = true; break; case 'A': /* delta t = inter-y distance */ auto_abscissa = AUTO_BY_DISTANCE; t_start = 0.0; break; case 'V' << 8: /* Version */ show_version = true; break; case 'h' << 8: /* Help */ show_usage = true; break; /*--------------options with a single argument--------*/ case 'I': set_format_type (optarg, &input_type); break; case 'O': set_format_type (optarg, &output_type); break; case 'd': /* dimensionality of ordinate variable */ if (sscanf (optarg, "%d", &ydimension) <= 0 || ydimension < 1) { fprintf (stderr, "%s: error: the ordinate dimension `%s' is bad (it should be a positive integer)\n", progname, optarg); errcnt++; } break; case 'k': if (sscanf (optarg, "%lf", &boundary_condition) <= 0) { fprintf (stderr, "%s: error: the boundary condition argument `%s' is bad\n", progname, optarg); errcnt++; } else spec_boundary_condition = true; break; case 'T': if (sscanf (optarg, "%lf", &tension) <= 0) { fprintf (stderr, "%s: error: the tension argument `%s' is bad\n", progname, optarg); errcnt++; } break; case 'n': /* number of intervals */ if (sscanf (optarg, "%d", &no_of_intervals) <= 0) { fprintf (stderr, "%s: error: the requested number of intervals `%s' is bad\n", progname, optarg); errcnt++; } else spec_no_of_intervals = true; break; case 'P': /* precision */ if (sscanf (optarg, "%d", &local_precision) <= 0) { fprintf (stderr, "%s: error: the requested precision `%s' is bad (it should be a positive integer)\n", progname, optarg); errcnt++; } else { if (local_precision <= 0) fprintf (stderr, "%s: the precision value `%s' is disregarded (it should be a positive integer)\n", progname, optarg); else precision = local_precision; } break; /*------------options with 0 or more args ----------*/ case 'a': /* Auto-abscissa, ARG OPTIONAL [0,1,2] */ auto_abscissa = AUTO_INCREMENT; if (optind >= argc) break; if (sscanf (argv[optind], "%lf", &local_delta_t) <= 0) break; delta_t = local_delta_t; optind++; /* tell getopt we recognized delta_t */ if (optind >= argc) break; if (sscanf (argv [optind], "%lf", &local_t_start) <= 0) break; t_start = local_t_start; optind++; /* tell getopt we recognized t_start */ break; /*--------------options with 1 or more arguments------*/ case 't': /* t axis limits, ARG REQUIRED [1,2,3] */ case 'x': /* obsolescent variant */ if (sscanf (optarg, "%lf", &local_first_t) <= 0) break; first_t = local_first_t; spec_first_t = true; if (optind >= argc) break; if (sscanf (argv [optind], "%lf", &local_last_t) <= 0) break; last_t = local_last_t; spec_last_t = true; optind++; /* tell getopt we recognized last_t */ if (optind >= argc) break; if (sscanf (argv [optind], "%lf", &local_spacing_t) <= 0) break; spacing_t = local_spacing_t; spec_spacing_t = true; optind++; /* tell getopt we recognized spacing_t */ break; /*---------------- End of options ----------------*/ default: /* Default, unknown option */ errcnt++; break; } /* endswitch */ if ((option == EOF)) { errcnt--; break; /* break out of option processing */ } } /* endwhile */ if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, 0); return EXIT_SUCCESS; } /* Some sanity checks on user-supplied options. */ if (no_of_intervals < 1) { fprintf (stderr, "%s: error: the abscissa range cannot be subdivided into %d intervals\n", progname, no_of_intervals); return EXIT_FAILURE; } if (periodic) { if (spec_boundary_condition) fprintf (stderr, "%s: the setting of a boundary condition is not supported for a periodic spline\n", progname); boundary_condition = 0.0; } if (filter) /* acting as a filter, so use cubic Bessel interpolation */ { if (!spec_first_t || !spec_last_t) { fprintf (stderr, "%s: error: acting as a filter, so the abscissa range should be specified with the -t option\n", progname); return EXIT_FAILURE; } if (!spec_spacing_t) spacing_t = (last_t - first_t) / no_of_intervals; else /* user specified spacing */ { if (spec_no_of_intervals) fprintf (stderr, "%s: the requested number of intervals is disregarded\n", progname); if ((last_t - first_t) * spacing_t < 0.0) { fprintf (stderr, "%s: the requested spacing was of the wrong sign, so it has been corrected\n", progname); spacing_t = -spacing_t; } /* N.B. if spacing specified, should optionally contract first_t and last_t to make them integer multiples of spacing; cf. graph */ } if (spec_boundary_condition) fprintf (stderr, "%s: acting as a filter, so the setting of a boundary condition is not supported\n", progname); if (tension != 0.0) fprintf (stderr, "%s: acting as a filter, so nonzero tension is not supported\n", progname); if (periodic) fprintf (stderr, "%s: acting as a filter, so periodicity is not supported\n", progname); if (optind < argc) { /* call do_bessel() on each file specified on the command line, generating a spline from each dataset in the file */ for (; optind < argc; optind++) { FILE *data_file; /* open file, treating "-" as stdin */ if (strcmp (argv[optind], "-") == 0) data_file = stdin; else { data_file = fopen (argv[optind], "r"); if (data_file == NULL) { fprintf (stderr, "%s: %s: %s\n", progname, argv[optind], strerror(errno)); return EXIT_FAILURE; } } /* loop through datasets in file (may be more than one) */ do { dataset_follows = do_bessel (data_file, ydimension, auto_abscissa, t_start, delta_t, first_t, last_t, spacing_t, precision, suppress_abscissa); /* output a separator between successive datasets */ if (dataset_follows || (optind + 1 != argc)) output_dataset_separator(); } while (dataset_follows); /* close file */ if (data_file != stdin) /* don't close stdin */ { if (fclose (data_file) < 0) { fprintf (stderr, "%s: error: the input file `%s' could not be closed\n", progname, argv[optind]); return EXIT_FAILURE; } } } } else /* no files spec'd, read stdin instead */ /* loop through datasets read from stdin (may be more than one) */ do { dataset_follows = do_bessel (stdin, ydimension, auto_abscissa, t_start, delta_t, first_t, last_t, spacing_t, precision, suppress_abscissa); /* output a separator between successive datasets */ if (dataset_follows) output_dataset_separator(); } while (dataset_follows); /* keep going if no EOF yet */ } else /* not acting as filter, so use spline interpolation (w/ tension) */ { double *t, **y, **z; /* ordinate, abscissa, 2nd derivative arrays */ int i, len, used; if (optind < argc) /* files spec'd on command line */ { /* call do_spline() on each file specified on the command line, generating a spline from each dataset contained in the file */ for (; optind < argc; optind++) { FILE *data_file; /* open file, treat "-" as meaning stdin */ if (strcmp (argv[optind], "-") == 0) data_file = stdin; else { data_file = fopen (argv[optind], "r"); if (data_file == NULL) { fprintf (stderr, "%s: error: the file `%s' could not be opened\n", progname, argv[optind]); return EXIT_FAILURE; } } /* loop through datasets in file (may be more than one) */ do { len = 16; /* initial value of storage length */ used = -1; /* initial value of array size, minus 1 */ t = (double *)xmalloc (sizeof(double) * len); y = (double **)xmalloc (sizeof(double *) * ydimension); z = (double **)xmalloc (sizeof(double *) * ydimension); for (i = 0; i < ydimension; i++) { y[i] = (double *)xmalloc (sizeof(double) * len); z[i] = (double *)xmalloc (sizeof(double) * len); } dataset_follows = read_data (data_file, &len, &used, auto_abscissa, t_start, delta_t, &t, ydimension, y, z); /* read_data() may reallocate t,y[*],z[*], and update len, used; on exit, used + 1 is number of data points */ /* spline the dataset and output interpolating points */ do_spline (used, len, &t, ydimension, y, z, tension, periodic, spec_boundary_condition, boundary_condition, precision, first_t, last_t, spacing_t, no_of_intervals, spec_first_t, spec_last_t, spec_spacing_t, spec_no_of_intervals, suppress_abscissa); /* output a separator between successive datasets */ if (dataset_follows || (optind + 1 != argc)) output_dataset_separator(); free (z); free (y); free (t); } while (dataset_follows); /* keep going if no EOF yet */ /* close file */ if (data_file != stdin) /* don't close stdin */ { if (fclose (data_file) < 0) { fprintf (stderr, "%s: error: the input file `%s' could not be closed\n", progname, argv[optind]); return EXIT_FAILURE; } } } } else /* no files spec'd, read stdin instead */ /* loop through datasets read from stdin (may be more than one) */ do { len = 16; /* initial value for array size */ used = -1; /* initial number of stored points, minus 1 */ t = (double *)xmalloc (sizeof(double) * len); y = (double **)xmalloc (sizeof(double *) * ydimension); z = (double **)xmalloc (sizeof(double *) * ydimension); for (i = 0; i < ydimension; i++) { y[i] = (double *)xmalloc (sizeof(double) * len); z[i] = (double *)xmalloc (sizeof(double) * len); } dataset_follows = read_data (stdin, &len, &used, auto_abscissa, t_start, delta_t, &t, ydimension, y, z); /* read_data() may reallocate t,y[*],z[*], and update len, used; on exit, used + 1 is number of data points */ /* spline the dataset and output interpolating points */ do_spline (used, len, &t, ydimension, y, z, tension, periodic, spec_boundary_condition, boundary_condition, precision, first_t, last_t, spacing_t, no_of_intervals, spec_first_t, spec_last_t, spec_spacing_t, spec_no_of_intervals, suppress_abscissa); /* output a separator between successive datasets */ if (dataset_follows) output_dataset_separator(); for (i = 0; i < ydimension; i++) { free (z[i]); free (y[i]); } free (z); free (y); free (t); } while (dataset_follows); /* keep going if no EOF yet */ } return EXIT_SUCCESS; } void set_format_type (char *s, data_type *typep) { switch (s[0]) { case 'a': case 'A': *typep = T_ASCII; break; case 'f': case 'F': *typep = T_SINGLE; break; case 'd': case 'D': *typep = T_DOUBLE; break; case 'i': case 'I': *typep = T_INTEGER; break; default: { fprintf (stderr, "%s: error: the data format type `%s' is invalid\n", progname, s); exit (EXIT_FAILURE); } break; } } /* fit() computes the array z[] of second derivatives at the knots, i.e., internal data points. The abscissa array t[] and the ordinate array y[] are specified. On entry, have n+1 >= 2 points in the t, y, z arrays, numbered 0..n. The knots are numbered 1..n-1 as in Kincaid and Cheney. In the periodic case, the final knot, i.e., (t[n-1],y[n-1]), has the property that y[n-1]=y[0]; moreover, y[n]=y[1]. The number of points supplied by the user was n+1 in the non-periodic case, and n in the periodic case. When this function is called, n>=1 in the non-periodic case, and n>=2 in the periodic case. */ /* Algorithm: the n-1 by n-1 tridiagonal matrix equation for the vector of 2nd derivatives at the knots is reduced to upper diagonal form. At that point the diagonal entries (pivots) of the upper diagonal matrix are in the vector u[], and the vector on the right-hand side is v[]. That is, the equation is of the form Ay'' = v, where a_(ii) = u[i], and a_(i,i+1) = alpha[i]. Here i=1..n-1 indexes the set of knots. The matrix equation is solved by back-substitution for y''[], i.e., for z[]. */ /* ARGS: k = coeff in bdy condition y''_1 = k y''_0, etc. */ void fit (int n, double *t, double *y, double *z, double k, double tension, bool periodic) { double *h, *b, *u, *v, *alpha, *beta; double *uu = NULL, *vv = NULL, *s = NULL; int i; if (n == 1) /* exactly 2 points, use straight line */ { z[0] = z[1] = 0.0; return; } h = (double *)xmalloc (sizeof(double) * n); b = (double *)xmalloc (sizeof(double) * n); u = (double *)xmalloc (sizeof(double) * n); v = (double *)xmalloc (sizeof(double) * n); alpha = (double *)xmalloc (sizeof(double) * n); beta = (double *)xmalloc (sizeof(double) * n); if (periodic) { s = (double *)xmalloc (sizeof(double) * n); uu = (double *)xmalloc (sizeof(double) * n); vv = (double *)xmalloc (sizeof(double) * n); } for (i = 0; i <= n - 1 ; ++i) { h[i] = t[i + 1] - t[i]; b[i] = 6.0 * (y[i + 1] - y[i]) / h[i]; /* for computing RHS */ } if (tension < 0.0) /* must rule out sin(tension * h[i]) = 0 */ { for (i = 0; i <= n - 1 ; ++i) if (sin (tension * h[i]) == 0.0) { fprintf (stderr, "%s: error: the specified negative tension value is singular\n", progname); exit (EXIT_FAILURE); } } if (tension == 0.0) { for (i = 0; i <= n - 1 ; ++i) { alpha[i] = h[i]; /* off-diagonal = alpha[i] to right */ beta[i] = 2.0 * h[i]; /* diagonal = beta[i-1] + beta[i] */ } } else if (tension > 0.0) /* `positive' (really real) tension, use hyperbolic trig funcs */ { for (i = 0; i <= n - 1 ; ++i) { double x = tension * h[i]; double xabs = (x < 0.0 ? -x : x); if (xabs < TRIG_ARG_MIN) /* hand-compute (6/x^2)(1-x/sinh(x)) and (3/x^2)(x/tanh(x)-1) to improve accuracy; here `x' is tension * h[i] */ { alpha[i] = h[i] * sinh_func(x); beta[i] = 2.0 * h[i] * tanh_func(x); } else if (xabs > TRIG_ARG_MAX) /* in (6/x^2)(1-x/sinh(x)) and (3/x^2)(x/tanh(x)-1), approximate x/sinh(x) and x/tanh(x) by 2|x|exp(-|x|) and |x|, respectively */ { int sign = (x < 0.0 ? -1 : 1); alpha[i] = ((6.0 / (tension * tension)) * ((1.0 / h[i]) - tension * 2 * sign * exp(-xabs))); beta[i] = ((6.0 / (tension * tension)) * (tension - (1.0 / h[i]))); } else { alpha[i] = ((6.0 / (tension * tension)) * ((1.0 / h[i]) - tension / sinh(x))); beta[i] = ((6.0 / (tension * tension)) * (tension / tanh(x) - (1.0 / h[i]))); } } } else /* tension < 0 */ /* `negative' (really imaginary) tension, use circular trig funcs */ { for (i = 0; i <= n - 1 ; ++i) { double x = tension * h[i]; double xabs = (x < 0.0 ? -x : x); if (xabs < TRIG_ARG_MIN) /* hand-compute (6/x^2)(1-x/sin(x)) and (3/x^2)(x/tan(x)-1) to improve accuracy; here `x' is tension * h[i] */ { alpha[i] = h[i] * sin_func(x); beta[i] = 2.0 * h[i] * tan_func(x); } else { alpha[i] = ((6.0 / (tension * tension)) * ((1.0 / h[i]) - tension / sin(x))); beta[i] = ((6.0 / (tension * tension)) * (tension / tan(x) - (1.0 / h[i]))); } } } if (!periodic && n == 2) u[1] = beta[0] + beta[1] + 2 * k * alpha[0]; else u[1] = beta[0] + beta[1] + k * alpha[0]; v[1] = b[1] - b[0]; if (u[1] == 0.0) { fprintf (stderr, "%s: error: as posed, the problem of computing a spline is singular\n", progname); exit (EXIT_FAILURE); } if (periodic) { s[1] = alpha[0]; uu[1] = 0.0; vv[1] = 0.0; } for (i = 2; i <= n - 1 ; ++i) { u[i] = (beta[i] + beta[i - 1] - alpha[i - 1] * alpha[i - 1] / u[i - 1] + (i == n - 1 ? k * alpha[n - 1] : 0.0)); if (u[i] == 0.0) { fprintf (stderr, "%s: error: as posed, the problem of computing a spline is singular\n", progname); exit (EXIT_FAILURE); } v[i] = b[i] - b[i - 1] - alpha[i - 1] * v[i - 1] / u[i - 1]; if (periodic) { s[i] = - s[i-1] * alpha[i-1] / u[i-1]; uu[i] = uu[i-1] - s[i-1] * s[i-1] / u[i-1]; vv[i] = vv[i-1] - v[i-1] * s[i-1] / u[i-1]; } } if (!periodic) { /* fill in 2nd derivative array */ z[n] = 0.0; for (i = n - 1; i >= 1; --i) z[i] = (v[i] - alpha[i] * z[i + 1]) / u[i]; z[0] = 0.0; /* modify to include boundary condition */ z[0] = k * z[1]; z[n] = k * z[n - 1]; } else /* periodic */ { z[n-1] = (v[n-1] + vv[n-1]) / (u[n-1] + uu[n-1] + 2 * s[n-1]); for (i = n - 2; i >= 1; --i) z[i] = ((v[i] - alpha[i] * z[i + 1]) - s[i] * z[n-1]) / u[i]; z[0] = z[n-1]; z[n] = z[1]; } if (periodic) { free (vv); free (uu); free (s); } free (beta); free (alpha); free (v); free (u); free (b); free (h); } /* interpolate() computes an approximate ordinate value for a given abscissa value, given an array of data points (stored in t[] and y[], containing abscissa and ordinate values respectively), and z[], the array of 2nd derivatives at the knots (i.e. internal data points). On entry, have n+1 >= 2 points in the t, y, z arrays, numbered 0..n. The number of knots (i.e. internal data points) is n-1; they are numbered 1..n-1 as in Kincaid and Cheney. In the periodic case, the final knot, i.e., (t[n-1],y[n-1]), has the property that y[n-1]=y[0]; also, y[n]=y[1]. The number of data points supplied by the user was n+1 in the non-periodic case, and n in the periodic case. When this function is called, n>=1 in the non-periodic case, and n>=2 in the periodic case. */ double interpolate (int n, double *t, double *y, double *z, double x, double tension, bool periodic) { double diff, updiff, reldiff, relupdiff, h; double value; int is_ascending = (t[n-1] < t[n]); int i = 0, k; /* in periodic case, map x to t[0] <= x < t[n] */ if (periodic && (x - t[0]) * (x - t[n]) > 0.0) x -= ((int)(floor( (x - t[0]) / (t[n] - t[0]) )) * (t[n] - t[0])); /* do binary search to find interval */ for (k = n - i; k > 1;) { if (is_ascending ? x >= t[i + (k>>1)] : x <= t[i + (k>>1)]) { i = i + (k>>1); k = k - (k>>1); } else k = k>>1; } /* at this point, x is between t[i] and t[i+1] */ h = t[i + 1] - t[i]; diff = x - t[i]; updiff = t[i+1] - x; reldiff = diff / h; relupdiff = updiff / h; if (tension == 0.0) /* evaluate cubic polynomial in nested form */ value = y[i] + diff * ((y[i + 1] - y[i]) / h - h * (z[i + 1] + z[i] * 2.0) / 6.0 + diff * (0.5 * z[i] + diff * (z[i + 1] - z[i]) / (6.0 * h))); else if (tension > 0.0) /* `positive' (really real) tension, use sinh's */ { if (fabs(tension * h) < TRIG_ARG_MIN) /* hand-compute (6/y^2)(sinh(xy)/sinh(y) - x) to improve accuracy; here `x' means reldiff or relupdiff and `y' means tension*h */ value = (y[i] * relupdiff + y[i+1] * reldiff + ((z[i] * h * h / 6.0) * quotient_sinh_func (relupdiff, tension * h)) + ((z[i+1] * h * h / 6.0) * quotient_sinh_func (reldiff, tension * h))); else if (fabs(tension * h) > TRIG_ARG_MAX) /* approximate 1/sinh(y) by 2 sgn(y) exp(-|y|) */ { int sign = (h < 0.0 ? -1 : 1); value = (((z[i] * (exp (tension * updiff - sign * tension * h) + exp (-tension * updiff - sign * tension * h)) + z[i + 1] * (exp (tension * diff - sign * tension * h) + exp (-tension * diff - sign * tension*h))) * (sign / (tension * tension))) + (y[i] - z[i] / (tension * tension)) * (updiff / h) + (y[i + 1] - z[i + 1] / (tension * tension)) * (diff / h)); } else value = (((z[i] * sinh (tension * updiff) + z[i + 1] * sinh (tension * diff)) / (tension * tension * sinh (tension * h))) + (y[i] - z[i] / (tension * tension)) * (updiff / h) + (y[i + 1] - z[i + 1] / (tension * tension)) * (diff / h)); } else /* `negative' (really imaginary) tension, use sin's */ { if (fabs(tension * h) < TRIG_ARG_MIN) /* hand-compute (6/y^2)(sin(xy)/sin(y) - x) to improve accuracy; here `x' means reldiff or relupdiff and `y' means tension*h */ value = (y[i] * relupdiff + y[i+1] * reldiff + ((z[i] * h * h / 6.0) * quotient_sin_func (relupdiff, tension * h)) + ((z[i+1] * h * h / 6.0) * quotient_sin_func (reldiff, tension * h))); else value = (((z[i] * sin (tension * updiff) + z[i + 1] * sin (tension * diff)) / (tension * tension * sin (tension * h))) + (y[i] - z[i] / (tension * tension)) * (updiff / h) + (y[i + 1] - z[i + 1] / (tension * tension)) * (diff / h)); } return value; } /* is_monotonic() check whether an array of data points, read in by read_data(), has monotonic abscissa values. */ bool is_monotonic (int n, double *t) { bool is_ascending; if (t[n-1] < t[n]) is_ascending = true; else if (t[n-1] > t[n]) is_ascending = false; else /* equality */ return false; while (n>0) { n--; if (is_ascending == true ? t[n] >= t[n+1] : t[n] <= t[n+1]) return false; }; return true; } /* read_float reads a single floating point quantity from an input file (in either ascii or double format). Return value indicates whether it was read successfully. */ bool read_float (FILE *input, double *dptr) { int num_read; double dval; float fval; int ival; switch (input_type) { case T_ASCII: default: num_read = fscanf (input, "%lf", &dval); break; case T_SINGLE: num_read = fread ((void *) &fval, sizeof (fval), 1, input); dval = fval; break; case T_DOUBLE: num_read = fread ((void *) &dval, sizeof (dval), 1, input); break; case T_INTEGER: num_read = fread ((void *) &ival, sizeof (ival), 1, input); dval = ival; break; } if (num_read <= 0) return false; if (dval != dval) { fprintf (stderr, "%s: a NaN (not-a-number) was encountered in a binary input file (it is treated as EOF)\n", progname); return false; /* effectively eof */ } else { *dptr = dval; return true; } } /* Emit a pair of doubles, in specified output representation. Inform user if any of the emitted values was out-of-bounds for single-precision or integer format. */ bool write_point (double t, double *y, int ydimension, int precision, bool suppress_abscissa) { int i, num_written = 0; float ft, fy; int it, iy; switch (output_type) { case T_ASCII: default: if (suppress_abscissa == false) num_written += printf ("%.*g ", precision, t); for (i = 0; i < ydimension - 1; i++) num_written += printf ("%.*g ", precision, y[i]); num_written += printf ("%.*g\n", precision, y[ydimension - 1]); break; case T_SINGLE: if (suppress_abscissa == false) { ft = FROUND(t); if (ft == FLT_MAX || ft == -(FLT_MAX)) { maybe_emit_oob_warning(); if (ft == FLT_MAX) ft *= 0.99999; /* kludge */ } num_written += fwrite ((void *) &ft, sizeof (ft), 1, stdout); } for (i = 0; i < ydimension; i++) { fy = y[i]; if (fy == FLT_MAX || fy == -(FLT_MAX)) { maybe_emit_oob_warning(); if (fy == FLT_MAX) fy *= 0.99999; /* kludge */ } num_written += fwrite ((void *) &fy, sizeof (fy), 1, stdout); } break; case T_DOUBLE: if (suppress_abscissa == false) num_written += fwrite ((void *) &t, sizeof (t), 1, stdout); for (i = 0; i < ydimension; i++) num_written += fwrite ((void *) &(y[i]), sizeof (double), 1, stdout); break; case T_INTEGER: if (suppress_abscissa == false) { it = IROUND(t); if (it == INT_MAX || it == -(INT_MAX)) { maybe_emit_oob_warning(); if (it == INT_MAX) it--; } num_written += fwrite ((void *) &it, sizeof (it), 1, stdout); } for (i = 0; i < ydimension; i++) { iy = IROUND(y[i]); if (iy == INT_MAX || iy == -(INT_MAX)) { maybe_emit_oob_warning(); if (iy == INT_MAX) iy--; } num_written += fwrite ((void *) &iy, sizeof (iy), 1, stdout); } break; } return (num_written > 0 ? true : false); /* i.e. return successp */ } /* read_point() attempts to read a data point from an input file (auto-abscissa is supported, as are both ascii and double formats). Return value is 0 if a data point was read, 1 if no data point could be read (i.e. EOF or garbage in file). A return value of 2 is special: it indicates that an explicit end-of-dataset indicator was seen in the input stream. For an ascii stream this is two newlines in succession; for a double stream this is a DBL_MAX, etc. */ int read_point (FILE *input, double *t, double *y, int ydimension, bool *first_point, int auto_abscissa, double *auto_t, double auto_delta, double *stored) { bool success; int i, items_read, lookahead; head: if (input_type == T_ASCII) { bool two_newlines; /* skip whitespace, up to but not including 2nd newline */ two_newlines = skip_whitespace (input); if (two_newlines) /* end-of-dataset indicator */ return 2; } if (feof (input)) return 1; if (input_type == T_ASCII) { lookahead = getc (input); ungetc (lookahead, input); if (lookahead == (int)'#') /* comment line */ { char c; do { items_read = fread (&c, sizeof (c), 1, input); if (items_read <= 0) return 1; /* EOF */ } while (c != '\n'); ungetc ((int)'\n', input); /* push back \n at the end of # line */ goto head; } } if (auto_abscissa != AUTO_NONE) /* i.e. AUTO_INCREMENT or AUTO_BY_DISTANCE */ { /* read 1st component of y */ success = read_float (input, &(y[0])); if (!success) /* e.g., EOF */ return 1; if ((input_type == T_DOUBLE && y[0] == DBL_MAX) || (input_type == T_SINGLE && y[0] == (double)FLT_MAX) || (input_type == T_INTEGER && y[0] == (double)INT_MAX)) /* end-of-dataset indicator */ return 2; /* read other components of y */ for (i = 1; i < ydimension; i++) { success = read_float (input, &(y[i])); if (!success) /* effectively EOF (could be garbage) */ { fprintf (stderr, "%s: an input file terminated prematurely\n", progname); return 1; } } /* t is kept track of, not read from file; two different methods */ if (auto_abscissa == AUTO_INCREMENT) { *t = *auto_t; *auto_t += auto_delta; /* update */ } else /* AUTO_BY_DISTANCE */ { if (*first_point == true) { *t = *auto_t; *first_point = false; } else /* compute distance to previous point */ { double distsq = 0.0; for (i = 0; i < ydimension; i++) distsq += (y[i] - stored[i])*(y[i] - stored[i]); *auto_t += sqrt (distsq); *t = *auto_t; } for (i = 0; i < ydimension; i++) stored[i] = y[i]; /* store current point */ } /* successfully read all components of y */ return 0; } else { /* read t */ success = read_float (input, t); if (!success) /* e.g., EOF */ return 1; if ((input_type == T_DOUBLE && *t == DBL_MAX) || (input_type == T_SINGLE && *t == (double)FLT_MAX) || (input_type == T_INTEGER && *t == (double)INT_MAX)) /* end-of-dataset indicator */ return 2; /* read components of y */ for (i = 0; i < ydimension; i++) { success = read_float (input, &(y[i])); if (!success) /* effectively EOF (could be garbage) */ { fprintf (stderr, "%s: an input file terminated prematurely\n", progname); return 1; } } /* successfully read both t and all components of y */ return 0; } } /* read_data() reads a single dataset from an input file, and stores it. If the stream is in ascii format, end-of-dataset is signalled by two newlines in succession. If the stream is in double format, end-of-dataset is signalled by the occurrence of a DBL_MAX, etc. Return value is true if the dataset is ended by an explicit end-of-dataset, and false if the dataset is terminated by EOF. That is, return value indicates whether another dataset is expected to follow. */ bool read_data (FILE *input, int *len, int *used, int auto_abscissa, double auto_t, double auto_delta, double **t, int ydimension, double **y, double **z) { bool first = true; int i, success; double tt, *yy, *stored; yy = (double *)xmalloc (sizeof(double) * ydimension); stored = (double *)xmalloc (sizeof(double) * ydimension); for ( ; ; ) { if ((++ *used) >= *len) { *len *= 2; *t = (double *)xrealloc (*t, sizeof(double) * *len); for (i = 0; i < ydimension; i++) { y[i] = (double *)xrealloc (y[i], sizeof(double) * *len); z[i] = (double *)xrealloc (z[i], sizeof(double) * *len); } } success = read_point (input, &tt, yy, ydimension, &first, auto_abscissa, &auto_t, auto_delta, stored); switch (success) { case 0: /* good data point */ (*t)[*used] = tt; for (i = 0; i < ydimension; i++) y[i][*used] = yy[i]; break; case 1: /* end of dataset, EOF seen */ (*used)--; free (stored); free (yy); return false; case 2: /* end of dataset, but input continues */ (*used)--; free (stored); free (yy); return true; } } } /* do_spline() is the main routine for piecewise cubic spline interpolation, supporting both periodicity and a user-specified boundary condition parameter. Nonzero tension may be specified, in which case the interpolate() routine, which this calls, will use not cubic polynomials but rather expressions involving hyperbolic sines. t[] and y[] are the arrays in which the abscissa and ordinate values of the user-specified data points are stored, and z[] is the array in which the 2nd derivatives at the knots (data points in the interior of the interval) will be stored. used+1 is the effective size of each of these arrays. The number of points supplied by the user was used+1 in the non-periodic case. It was used+0 in the periodic case. The reason that the number of elements is greater by one in the periodic case is that the first user-supplied data point occurs also at the end. In fact, in the periodic case this function will increment the size of the array once more, since the periodic interpolation algorithm requires the first two data points, not just the first, to appear at the end. */ /* ARGS: used = indicator that used+1 elements stored in (*t)[] etc. len = length of each array y,z are ptrs-to-ptrs because we may need to realloc k = coeff in bdy condition y''_1 = k y''_0, etc. */ void do_spline (int used, int len, double **t, int ydimension, double **y, double **z, double tension, bool periodic, bool spec_boundary_condition, double k, int precision, double first_t, double last_t, double spacing_t, int no_of_intervals, bool spec_first_t, bool spec_last_t, bool spec_spacing_t, bool spec_no_of_intervals, bool suppress_abscissa) { int range_count = 0; /* number of req'd datapoints out of range */ int lastval = 0; /* last req'd point = 1st/last data point? */ int i; if (used + 1 == 0) /* zero data points in array */ /* don't output anything (i.e. effectively output a null dataset) */ return; if (used+1 == 1) /* a single data point in array */ { fprintf (stderr, "%s: a spline cannot be constructed from a single data point\n", progname); /* don't output anything (i.e. effectively output a null dataset) */ return; } if (!periodic && used+1 <= 2) { if (spec_boundary_condition) fprintf (stderr, "%s: the specified boundary condition is ignored, as there are only 2 data points\n", progname); k = 0.0; } if (!is_monotonic (used, *t)) non_monotonic_error(); /* self-explanatory */ if (periodic) { bool print_warning = false; for (i = 0; i < ydimension; i++) { if (y[i][used] != y[i][0]) print_warning = true; y[i][used] = y[i][0]; } if (print_warning == true) fprintf (stderr, "%s: the final y value is set equal to the initial value, to ensure periodicity\n", progname); /* add pseudo-point at end (to accord with periodicity) */ if (used + 1 >= len) { len++; *t = (double *)xrealloc (*t, sizeof(double) * len); for (i = 0; i < ydimension; i++) { y[i] = (double *)xrealloc (y[i], sizeof(double) * len); z[i] = (double *)xrealloc (z[i], sizeof(double) * len); } } (*t)[used + 1] = (*t)[used] + ((*t)[1] - (*t)[0]); for (i = 0; i < ydimension; i++) y[i][used + 1] = y[i][1]; } /* compute z[], array of 2nd derivatives at each knot */ for (i = 0; i < ydimension; i++) fit (used + (periodic ? 1 : 0), /* include pseudo-point if any */ *t, y[i], z[i], k, tension, periodic); if (!spec_first_t) first_t = (*t)[0]; if (!spec_last_t) last_t = (*t)[used]; /* used+1 data points in all */ if (!spec_spacing_t) { if (no_of_intervals > 0) spacing_t = (last_t - first_t) / no_of_intervals; else spacing_t = 0; /* won't happen */ } else /* user specified spacing */ { if ((last_t - first_t) * spacing_t < 0.0) { fprintf (stderr, "%s: the requested spacing is of the wrong sign, so it has been corrected\n", progname); spacing_t = -spacing_t; } if (spec_no_of_intervals) fprintf (stderr, "%s: the requested number of intervals is disregarded\n", progname); no_of_intervals = (int)(fabs((last_t - first_t) / spacing_t) + FUZZ); } if (last_t == (*t)[0]) lastval = 1; else if (last_t == (*t)[used]) lastval = 2; for (i = 0; i <= no_of_intervals; ++i) { double x; x = first_t + spacing_t * i; if (i == no_of_intervals) { /* avoid numerical fuzz */ if (lastval == 1) /* left end of input */ x = (*t)[0]; else if (lastval == 2) /* right end of input */ x = (*t)[used]; } if (periodic || (x - (*t)[0]) * (x - (*t)[used]) <= 0) { int j; double *yy; yy = (double *)xmalloc (sizeof(double) * ydimension); for (j = 0; j < ydimension; j++) yy[j] = interpolate (used, *t, y[j], z[j], x, tension, periodic); write_point (x, yy, ydimension, precision, suppress_abscissa); free (yy); } else range_count++; } switch (range_count) { case 0: break; case 1: fprintf (stderr, "%s: one requested point could not be computed (as it was out of the data range)\n", progname); break; default: fprintf (stderr, "%s: %d requested points could not be computed (as they were out of the data range)\n", progname, range_count); break; } } /* do_bessel() is the main routine for doing real-time cubic Bessel interpolation of a dataset. If the input stream is in ascii format, end-of-dataset is signalled by two newlines in succession. If the stream is in double format, end-of-dataset is signalled by the occurrence of a DBL_MAX, etc. Return value is true if the dataset is ended by an explicit end-of-dataset, and false if the dataset is terminated by EOF. That is, return value indicates whether another dataset is expected to follow. */ bool do_bessel (FILE *input, int ydimension, int auto_abscissa, double auto_t, double auto_delta, double first_t, double last_t, double spacing_t, int precision, bool suppress_abscissa) { bool first = true; double t, *y, *s0, *s1, *s2, *stored; double tt[4], **yy; int direction = (last_t > first_t ? 1 : -1); int state = STATE_ZERO; int i, success; y = (double *)xmalloc (sizeof(double) * ydimension); s0 = (double *)xmalloc (sizeof(double) * ydimension); s1 = (double *)xmalloc (sizeof(double) * ydimension); s2 = (double *)xmalloc (sizeof(double) * ydimension); yy = (double **)xmalloc (4 * sizeof(double *)); stored = (double *)xmalloc (sizeof(double) * ydimension); for (i = 0; i < 4; i++) yy[i] = (double *)xmalloc (ydimension * sizeof(double)); for ( ; ; ) { success = read_point (input, &t, y, ydimension, &first, auto_abscissa, &auto_t, auto_delta, stored); if (success == 0) /* got a new data point */ { /* use our DFA to process the new data point */ switch (state) { case STATE_ZERO: /* just store point */ tt[0] = t; for (i = 0; i < ydimension; i++) yy[0][i] = y[i]; state = STATE_ONE; break; case STATE_ONE: /* just store point */ tt[1] = t; if (direction * (tt[1] - tt[0]) <= 0) non_monotonic_error(); for (i = 0; i < ydimension; i++) yy[1][i] = y[i]; state = STATE_TWO; break; case STATE_TWO: /* store point, and process */ tt[2] = t; if (direction * (tt[2] - tt[1]) <= 0) non_monotonic_error(); for (i = 0; i < ydimension; i++) { yy[2][i] = y[i]; /* fit parabola through 0,1,2 to compute slopes at 0,1*/ s0[i] = (((tt[1]-tt[0]) * ((yy[0][i]-yy[2][i]) / (tt[0]-tt[2])) + (tt[0]-tt[2]) * ((yy[1][i]-yy[0][i]) / (tt[1]-tt[0]))) / (tt[1]-tt[2])); s1[i] = (((tt[2]-tt[1]) * ((yy[1][i]-yy[0][i]) / (tt[1]-tt[0])) + (tt[1]-tt[0]) * ((yy[2][i]-yy[1][i]) / (tt[2]-tt[1]))) / (tt[2]-tt[0])); } /* output spline points in range between points 0, 1 */ do_bessel_range (tt[0], tt[1], yy[0], yy[1], s0, s1, first_t, last_t, spacing_t, ydimension, precision, false, suppress_abscissa); state = STATE_THREE; break; case STATE_THREE: /* store point, and process */ tt[3] = t; if (direction * (tt[3] - tt[2]) <= 0) non_monotonic_error(); for (i = 0; i < ydimension; i++) { yy[3][i] = y[i]; /* fit parabola through points 1,2,3 to compute slope at 2 */ s2[i] = (((tt[3]-tt[2]) * ((yy[2][i]-yy[1][i]) / (tt[2]-tt[1])) + (tt[2]-tt[1]) * ((yy[3][i]-yy[2][i]) / (tt[3]-tt[2]))) / (tt[3]-tt[1])); } /* output spline points in range between points 1, 2 */ do_bessel_range (tt[1], tt[2], yy[1], yy[2], s1, s2, first_t, last_t, spacing_t, ydimension, precision, false, suppress_abscissa); /* shift points down */ tt[0] = tt[1]; tt[1] = tt[2]; tt[2] = tt[3]; for (i = 0; i < ydimension; i++) { yy[0][i] = yy[1][i]; yy[1][i] = yy[2][i]; yy[2][i] = yy[3][i]; /* shift down the only knot slope worth keeping */ s1[i] = s2[i]; } break; } } else /* didn't get a point, so wind things up */ { switch (state) { case STATE_ZERO: /* silently output a null dataset (i.e., don't output anything) */ break; case STATE_ONE: fprintf (stderr, "%s: a spline cannot be constructed from a single data point\n", progname); /* output a null dataset (i.e., don't output anything) */ break; case STATE_TWO: /* have two points: do linear interp between points 0, 1 */ for (i = 0; i < ydimension; i++) s0[i] = s1[i] = (yy[1][i] - yy[0][i])/(tt[1]-tt[0]); do_bessel_range (tt[0], tt[1], yy[0], yy[1], s0, s1, first_t, last_t, spacing_t, ydimension, precision, true, suppress_abscissa); break; case STATE_THREE: /* already did 1st of 2 intervals, so do 2nd one too */ /* fit parabola through points 0,1,2 to compute slope at 2 */ for (i = 0; i < ydimension; i++) s2[i] = (((tt[0]-tt[2]) * ((yy[2][i]-yy[1][i]) / (tt[2]-tt[1])) + (tt[2]-tt[1]) * ((yy[0][i]-yy[2][i]) / (tt[0]-tt[2]))) / (tt[0]-tt[1])); /* output spline points in range between points 1, 2 */ do_bessel_range (tt[1], tt[2], yy[1], yy[2], s1, s2, first_t, last_t, spacing_t, ydimension, precision, true, suppress_abscissa); break; } /* free storage before return */ for (i = 0; i < 4; i++) free (yy[i]); free (stored); free (yy); free (s2); free (s1); free (s0); free (y); /* return indication of whether end-of-dataset was seen in stream */ return (success == 2 ? true : false); } } } void non_monotonic_error (void) { fprintf (stderr, "%s: error: the abscissa values are not monotonic\n", progname); exit (EXIT_FAILURE); } /* do_bessel_range() computes spline points separated by spacing_t, within the abscissa interval abscissa0 <= t < abscissa1, that happen to lie in the desired range first_t <= t <= last_t. It writes them to standard output. The ordinate values value0 and value1, and endpoint slopes slope0 and slope1, are specified. If `endit' is set, then the intervals stretch slightly farther than abscissa1 and last_t, to compensate for roundoff error. */ /* ARGS: endit = last interval to be treated? */ void do_bessel_range (double abscissa0, double abscissa1, double *value0, double *value1, double *slope0, double *slope1, double first_t, double last_t, double spacing_t, int ydimension, int precision, bool endit, bool suppress_abscissa) { int direction = ((last_t > first_t) ? 1 : -1); /* sign of spacing_t */ int i, j; int imin1 = (int)((abscissa0 - first_t) / spacing_t - 1); int imax1 = (int)((abscissa1 - first_t) / spacing_t + 1); int imin2 = 0; int imax2 = (int)((last_t - first_t) / spacing_t + 1); int imin, imax; /* compute maximum interval over which i must range */ imin = IMAX (imin1, imin2); imax = IMIN (imax1, imax2); for (i = imin; i <= imax; i++) { double t; t = first_t + i * spacing_t; if ((direction * t >= direction * abscissa0) && (direction * t >= direction * first_t) /* stretch slightly if `endit' is set */ && ((direction * t < (direction * (abscissa1 + (endit ? FUZZ * (abscissa1 - abscissa0) : 0.))))) && (direction * t <= (direction * (last_t + (endit ? FUZZ * (last_t - first_t) : 0.))))) { double diff = t - abscissa0; double updiff = abscissa1 - t; double h = abscissa1 - abscissa0; double *y; bool success; y = (double *)xmalloc (sizeof(double) * ydimension); for (j = 0; j < ydimension; j++) { /* should use a nested form */ y[j] = (value1[j] * (-2.0 * diff * diff * diff / (h * h * h) + 3.0 * diff * diff / (h * h)) + value0[j] * (-2.0 * updiff * updiff * updiff / (h * h * h) + 3.0 * updiff * updiff / (h * h))) + ((slope1[j] * (diff * diff * diff / (h * h) - diff * diff / h) - (slope0[j] * (updiff * updiff * updiff / (h * h) - updiff * updiff / h)))); } success = write_point (t, y, ydimension, precision, suppress_abscissa); if (!success) { fprintf (stderr, "%s: error: standard output cannot be written to\n", progname); exit (EXIT_FAILURE); } free (y); } } } /* Output a separator between datasets. For ascii-format output streams this is an extra newline (after the one that the spline ended with, yielding two newlines in succession). For double-format output streams this is a DBL_MAX, etc. */ void output_dataset_separator (void) { double ddummy; float fdummy; int idummy; switch (output_type) { case T_ASCII: default: printf ("\n"); break; case T_DOUBLE: ddummy = DBL_MAX; fwrite ((void *) &ddummy, sizeof(ddummy), 1, stdout); break; case T_SINGLE: fdummy = FLT_MAX; fwrite ((void *) &fdummy, sizeof(fdummy), 1, stdout); break; case T_INTEGER: idummy = INT_MAX; fwrite ((void *) &idummy, sizeof(idummy), 1, stdout); break; } } /* skip_whitespace() skips whitespace in an ascii-format input file, up to but not including a second newline. Return value indicates whether or not two newlines were in fact seen. (For ascii-format input files, two newlines signals an end-of-dataset.) */ bool skip_whitespace (FILE *stream) { int lookahead; int nlcount = 0; do { lookahead = getc (stream); if (lookahead == (int)'\n') nlcount++; } while (lookahead != EOF && isspace((unsigned char)lookahead) && nlcount < 2); if (lookahead == EOF) return false; ungetc (lookahead, stream); return (nlcount == 2 ? true : false); } void maybe_emit_oob_warning (void) { static bool warning_written = false; if (!warning_written) { fprintf (stderr, "%s: one or more out-of-bounds output values are approximated\n", progname); warning_written = true; } } /* Following four functions compute (6/x^2)(1-x/sinh(x)), (3/x^2)(x/tanh(x)-1), (6/x^2)(1-x/sin(x)), and (3/x^2)(x/tan(x)-1) via the first three terms of the appropriate power series. They are used when |x|= argc) break; if (sscanf (argv[optind], "%d", &local_dataset_min) <= 0) break; dataset_min = local_dataset_min; optind++; /* tell getopt we recognized dataset_min */ if (optind >= argc) break; if (sscanf (argv [optind], "%d", &local_dataset_max) <= 0) break; dataset_max = local_dataset_max; optind++; /* tell getopt we recognized dataset_max */ if (optind >= argc) break; if (sscanf (argv [optind], "%d", &local_dataset_spacing) <= 0) break; dataset_spacing = local_dataset_spacing; optind++; /* tell getopt we recognized dataset_spacing */ break; case 'f': for ( ; ; ) { int field_index; if (optind >= argc) break; if (sscanf (argv[optind], "%d", &field_index) <= 0) break; if (field_index < 0) { fprintf (stderr, "%s: error: the field index `%d' is bad (it should be greater than or equal to 0)\n", progname, field_index); return EXIT_FAILURE; } if (field_array_len == 0) field_array = (int *)xmalloc ((++field_array_len) * sizeof(int)); else field_array = (int *)xrealloc (field_array, (++field_array_len) * sizeof(int)); field_array[field_array_len - 1] = field_index; optind++; /* tell getopt we recognized field index */ } break; /*---------------- End of options ----------------*/ default: /* Default, unknown option */ errcnt++; break; } /* endswitch */ if ((option == EOF)) { errcnt--; break; /* break out of option processing */ } } /* endwhile */ if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, 0); return EXIT_SUCCESS; } /* Sanity checks on user-supplied options */ if (dataset_spacing < 1) { fprintf (stderr, "%s: error: the dataset spacing `%d' is bad (it should be positive)\n", progname, dataset_spacing); return EXIT_FAILURE; } for (i = 0; i < field_array_len; i++) if (field_array[i] >= record_length) { fprintf (stderr, "%s: error: at least one field index is out of bounds\n", progname); return EXIT_FAILURE; } /* default if no `-R' option seen: extract all fields of each record */ if (field_array_len == 0) { field_array = (int *)xmalloc ((record_length) * sizeof(int)); field_array_len = record_length; for (i = 0; i < field_array_len; i++) field_array[i] = i; } /* open additive/multiplicative/join files. */ if (add_file) open_file (add_file, &add_fp); if (mult_file) open_file (mult_file, &mult_fp); if (pre_join_file) open_file (pre_join_file, &pre_join_fp); if (post_join_file) open_file (post_join_file, &post_join_fp); if (optind < argc) { /* call mung_dataset() on all datasets contained in each file specified on command line */ for (; optind < argc; optind++) { FILE *data_fp; /* open file, treat "-" as stdin */ if (strcmp (argv[optind], "-") == 0) data_fp = stdin; else open_file (argv[optind], &data_fp); /* loop through datasets in file (may be more than one) */ do { bool dataset_ok; dataset_ok = ((dataset_index >= dataset_min) && (dataset_index <= dataset_max) && ((dataset_index - dataset_min) % dataset_spacing == 0)) ? true : false; /* output a separator between successive datasets */ if (dataset_printed && dataset_ok) output_dataset_separator(); more_points = mung_dataset (data_fp, record_length, field_array, field_array_len, scale, baseline, add_fp, mult_fp, pre_join_fp, post_join_fp, precision, dataset_ok ? false : true); if (dataset_ok) dataset_printed = true; dataset_index++; } while (more_points); /* close file (but don't close stdin) */ if (data_fp != stdin && fclose (data_fp) < 0) { fprintf (stderr, "%s: error: the input file could not be closed\n", progname); return EXIT_FAILURE; } } } else /* no files spec'd, read stdin instead */ /* loop through datasets (may be more than one) */ do { bool dataset_ok; dataset_ok = ((dataset_index >= dataset_min) && (dataset_index <= dataset_max) && ((dataset_index - dataset_min) % dataset_spacing == 0)) ? true : false; /* output a separator between successive datasets */ if (dataset_printed && dataset_ok) output_dataset_separator(); more_points = mung_dataset (stdin, record_length, field_array, field_array_len, scale, baseline, add_fp, mult_fp, pre_join_fp, post_join_fp, precision, dataset_ok ? false : true); if (dataset_ok) dataset_printed = true; dataset_index++; } while (more_points); /* keep going if no EOF yet */ return EXIT_SUCCESS; } /* read_float reads a single floating point quantity from an input file (in either ascii or double format). Return value indicates whether it was read successfully. */ bool read_float (FILE *input, double *dptr) { int num_read; double dval; float fval; int ival; switch (input_type) { case T_ASCII: default: num_read = fscanf (input, "%lf", &dval); break; case T_SINGLE: num_read = fread ((void *) &fval, sizeof (fval), 1, input); dval = fval; break; case T_DOUBLE: num_read = fread ((void *) &dval, sizeof (dval), 1, input); break; case T_INTEGER: num_read = fread ((void *) &ival, sizeof (ival), 1, input); dval = ival; break; } if (num_read <= 0) return false; if (dval != dval) { fprintf (stderr, "%s: a NaN (not-a-number) was encountered in a binary-format input file\n", progname); return false; } else { *dptr = dval; return true; } } /* get_record() attempts to read a record (a sequence of record_length data, i.e., floating-point quantities) from an input file. Return value is 0 if a record was successfully read, 1 if no record could be read (i.e. EOF or garbage in stream). A return value of 2 is special: it indicates that an explicit end-of-dataset indicator was seen in the input file. For an ascii stream this is two newlines in succession; for a stream of doubles it is a DBL_MAX appearing at what would otherwise have been the beginning of the record, etc. */ int get_record (FILE *input, double *record, int record_length) { bool success; int i, items_read, lookahead; head: if (input_type == T_ASCII) { bool two_newlines; /* skip whitespace, up to but not including 2nd newline */ two_newlines = skip_whitespace (input); if (two_newlines) /* end-of-dataset indicator */ return 2; } if (feof (input)) return 1; /* EOF */ if (input_type == T_ASCII) { lookahead = getc (input); ungetc (lookahead, input); if (lookahead == (int)'#') /* comment line */ { char c; do { items_read = fread (&c, sizeof (c), 1, input); if (items_read <= 0) return 1; /* EOF */ } while (c != '\n'); ungetc ((int)'\n', input); /* push back \n at the end of # line */ goto head; } } for (i = 0; i < record_length; i++) { double val; success = read_float (input, &val); if (i == 0 && ((input_type == T_DOUBLE && val == DBL_MAX) || (input_type == T_SINGLE && val == (double)FLT_MAX) || (input_type == T_INTEGER && val == (double)INT_MAX))) /* end-of-dataset indicator */ return 2; if (!success) /* EOF or garbage */ { if (i > 0) fprintf (stderr, "%s: the input file terminated prematurely\n", progname); return 1; } record[i] = val; } return 0; } /* Emit a double, in specified output representation. Be sure to inform user if any of the emitted values were out-of-bounds for single-precision or integer format. */ bool write_float (double x, int precision) { int num_written = 0; float fx; int ix; switch (output_type) { case T_ASCII: default: num_written = printf ("%.*g ", precision, x); break; case T_SINGLE: fx = FROUND(x); if (fx == FLT_MAX || fx == -(FLT_MAX)) { maybe_emit_oob_warning(); if (fx == FLT_MAX) fx *= 0.99999; /* kludge */ } num_written = fwrite ((void *) &fx, sizeof (fx), 1, stdout); break; case T_DOUBLE: num_written = fwrite ((void *) &x, sizeof (x), 1, stdout); break; case T_INTEGER: ix = IROUND(x); if (ix == INT_MAX || ix == -(INT_MAX)) { maybe_emit_oob_warning(); if (ix == INT_MAX) ix--; } num_written = fwrite ((void *) &ix, sizeof (ix), 1, stdout); break; } if (num_written < 0) return false; else return true; } void open_file (char *name, FILE **fpp) { FILE *fp; fp = fopen (name, "r"); if (fp == NULL) { fprintf (stderr, "%s: %s: %s\n", progname, name, strerror(errno)); exit (EXIT_FAILURE); } *fpp = fp; } void set_format_type (char *s, data_type *typep) { switch (s[0]) { case 'a': case 'A': /* ASCII format: records and fields within records are separated by whitespace, and datasets are separated by a pair of newlines. */ *typep = T_ASCII; break; case 'f': case 'F': /* Binary single precision: records and fields within records are contiguous, and datasets are separated by a FLT_MAX. */ *typep = T_SINGLE; break; case 'd': case 'D': /* Binary double precision: records and fields within records are contiguous, and datasets are separated by a DBL_MAX. */ *typep = T_DOUBLE; break; case 'i': case 'I': /* Binary integer: records and fields within records are contiguous, and datasets are separated by an occurrence of INT_MAX. */ *typep = T_INTEGER; break; default: { fprintf (stderr, "%s: error: the data format type `%s' is invalid\n", progname, s); exit (EXIT_FAILURE); } break; } } /* mung_dataset() is the main routine for extracting fields from records in a dataset, and munging them. Its return value indicates whether the records in the input file ended with an explicit end-of-dataset indicator, i.e., whether another dataset is expected to follow. An end-of-dataset indicator is two newlines in succession for an ascii stream, and a DBL_MAX for a stream of doubles, etc. */ /* ARGS: record_length = number of fields per record in dataset field_array = array of fields we'll extract field_array_len = length of this array suppress = suppress output for this dataset? */ bool mung_dataset (FILE *input, int record_length, int *field_array, int field_array_len, double scale, double baseline, FILE *add_fp, FILE *mult_fp, FILE *pre_join_fp, FILE *post_join_fp, int precision, bool suppress) { double *record = (double *)xmalloc (record_length * sizeof(double)); bool in_trouble = suppress; /* once in trouble, we never get out */ if (!in_trouble) { /* rewind all fp's */ if (add_fp) fseek(add_fp, 0L, 0); if (mult_fp) fseek(mult_fp, 0L, 0); if (pre_join_fp) fseek(pre_join_fp, 0L, 0); if (post_join_fp) fseek(post_join_fp, 0L, 0); } for ( ; ; ) { int i; int success; double add_data, mult_data, pre_join_data, post_join_data; if (!in_trouble && add_fp && read_float (add_fp, &add_data) == false) in_trouble = true; if (!in_trouble && mult_fp && read_float (mult_fp, &mult_data) == false) in_trouble = true; if (!in_trouble && pre_join_fp && read_float (pre_join_fp, &pre_join_data) == false) in_trouble = true; if (!in_trouble && post_join_fp && read_float (post_join_fp, &post_join_data) == false) in_trouble = true; success = get_record (input, record, record_length); switch (success) { case 0: /* good record */ if (in_trouble) /* if in trouble, do nought till dataset end */ continue; if (pre_join_fp) write_float (pre_join_data, precision); for (i = 0; i < field_array_len; i++) { double datum; datum = record[field_array[i]]; if (mult_fp) datum *= mult_data; if (add_fp) datum += add_data; datum *= scale; datum += baseline; /* output the munged datum */ write_float (datum, precision); } if (post_join_fp) write_float (post_join_data, precision); if (output_type == T_ASCII) /* end each record with a newline */ printf ("\n"); break; case 1: /* no more records, EOF seen */ return false; case 2: /* end of dataset, but input continues */ return true; } } } /* skip_whitespace() skips whitespace in an ascii-format input file, up to but not including a second newline. Return value indicates whether or not two newlines were in fact seen. (For ascii-format input files, two newlines signals an end-of-dataset.) */ bool skip_whitespace (FILE *stream) { int lookahead; int nlcount = 0; do { lookahead = getc (stream); if (lookahead == (int)'\n') nlcount++; } while (lookahead != EOF && isspace((unsigned char)lookahead) && nlcount < 2); if (lookahead == EOF) return false; ungetc (lookahead, stream); return (nlcount == 2 ? true : false); } /* Output a separator between datasets. For ascii-format output streams this is an extra newline (after the one that the spline ended with, yielding two newlines in succession). For double-format output streams this is a DBL_MAX, etc. */ void output_dataset_separator(void) { double ddummy; float fdummy; int idummy; switch (output_type) { case T_ASCII: default: printf ("\n"); break; case T_DOUBLE: ddummy = DBL_MAX; fwrite ((void *) &ddummy, sizeof(ddummy), 1, stdout); break; case T_SINGLE: fdummy = FLT_MAX; fwrite ((void *) &fdummy, sizeof(fdummy), 1, stdout); break; case T_INTEGER: idummy = INT_MAX; fwrite ((void *) &idummy, sizeof(idummy), 1, stdout); break; } } void maybe_emit_oob_warning (void) { static bool warning_written = false; if (!warning_written) { fprintf (stderr, "%s: one or more out-of-bounds output values are approximated\n", progname); warning_written = true; } } plotutils-2.6/ode/0000777000175000017500000000000011257257507011207 500000000000000plotutils-2.6/ode/README0000644000175000017500000000300310346330424011763 00000000000000This directory contains the source code for GNU ode. Original version copyright (C) 1982-1994 Nicholas B. Tufillaro . GNU enhancements by Robert S. Maier , copyright (C) 1996, 1997, 1998, 1999, 2005 Free Software Foundation, Inc. ---------------------------------------------------------------------- ode - numerical solution of differential equations Source Files: Makefile.in Template for Makefile alloca.c alloca() for machines that don't have it am.c Adams-Moulton with fixed step size ama.c Same with adaptive step size eu.c Euler quick-and-dirty method expr.c Expression evaluator extern.h External function and variable declarations float.c FPP setup and trap handler global.c Global variable definitions gram.y Bison parser grammar lex.l Flex scanner rules main.c Mainline misc.c I/O, etc. num.h Constants for the numerical routines ode.h Miscellaneous declarations and constants prt.c Print queue management rk.c Runge-Kutta with fixed step size rka.c Same with adaptive step size stperr.c Error handling for adaptive step routines sym.c Symbol table manager xmalloc.c Memory management wrappers yywrap.c Wrapper for our scanner Other Files: In this directory: README This file INTERNALS A discussion of ode internals In ../ode-examples: README A discussion of the example input files example.x Numerous example ode input files plotutils-2.6/ode/extern.h0000644000175000017500000000710211037240562012566 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free * Software Foundation, Inc. */ /* * declarations of external variables and functions for ode */ /* * external variable declarations */ /* variables defined and initted in global.c */ extern const char *progname, *written, *copyright; extern int prec; extern long it; extern double hmin, hmax, ssmin, ssmax, abmin, abmax, acmax; extern struct sym *symtab, *fsp; extern struct sym *dqueue; extern struct prt *pqueue; extern struct expr exprzero, exprone; extern bool sawstep, sawprint, sawevery, sawfrom; extern bool tflag, pflag, sflag, eflag, rflag, hflag, conflag; extern integration_type algorithm; /* variables defined but not initted in global.c */ extern char *filename; extern jmp_buf mark; extern int fwd; extern int tevery; extern double tstart, tstop, tstep, tfrom; extern bool printnum, prerr; /* in parser */ extern FILE *yyin; /* in scanner */ extern int curline; /* * external function declarations */ bool check (void); bool hierror (void); bool intpr (double t); bool lowerror (void); double eval (const struct expr *ep); void am (void); void ama (void); void args (int ac, char **av); void defalt (void); void eu (void); void efree (struct expr *ep); void field (void); void maxerr (void); void panic (const char *s); void panicn (const char *fmt, int n); void pfree (struct prt *pp); void printq (void); void prval (double x); void maxerror (void); void resetflt (void); void rk (void); void rka (void); void rterror (const char *s); void rterrors (const char *fmt, const char *s); void rtsquawks (const char *fmt, const char *s); void setflt (void); void sfree (struct sym *sp); void solve (void); void startstep (void); void title (void); void trivial (void); struct expr * ealloc (void); struct prt * palloc (void); struct sym * lookup (const char *nam); struct sym * salloc (void); RETSIGTYPE fptrap (int sig); /* in scanner or parser */ int yyerror (const char *msg); int yylex (void); int yyparse (void); struct lex * lalloc (void); void concat (struct expr *e0, struct expr *e1); void lfree (struct lex *lp); void prexq (const struct expr *ep); /* math library exception handling */ #ifdef HAVE_MATHERR # ifdef __cplusplus int matherr (struct __exception *x); #else int matherr (struct exception *x); #endif #endif /* math functions in bessel.c and specfun.c */ #ifndef HAVE_J0 double j0 (double x); double j1 (double x); double y0 (double x); double y1 (double x); #endif #ifdef NO_SYSTEM_GAMMA double f_lgamma (double x); #else /* not NO_SYSTEM_GAMMA, we link in vendor code */ #ifdef HAVE_LGAMMA extern double lgamma (double x); /* declaration may be gratuitous */ #endif #ifdef HAVE_GAMMA extern double gamma (double x); /* declaration may be gratuitous */ #endif #endif double f_gamma (double x); #ifndef HAVE_ERF double erf (double x); double erfc (double x); #endif double ibeta (double a, double b, double x); double igamma (double a, double x); double inverf (double p); double invnorm (double p); double norm (double x); /* declare functions in libcommon */ #include "libcommon.h" /* support C++ */ #ifdef __BEGIN_DECLS #undef __BEGIN_DECLS #endif #ifdef __END_DECLS #undef __END_DECLS #endif #ifdef __cplusplus # define __BEGIN_DECLS extern "C" { # define __END_DECLS } #else # define __BEGIN_DECLS /* empty */ # define __END_DECLS /* empty */ #endif __BEGIN_DECLS int yywrap (void); __END_DECLS plotutils-2.6/ode/num.h0000644000175000017500000000370710346055342012071 00000000000000/* This file is part of the GNU plotutils package. */ /* Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997 Free Software Foundation, Inc. */ /* * Constants used in adaptive-step-size numerical routines. */ #define ECONST .07037037037037037037 /* 19/270 */ #define A0 .11574074074074074074 /* 25/216 */ #define A2 .54892787524366471734 /* 1408/2565 */ #define A3 .53533138401559454191 /* 2197/4104 */ #define A4 -.20000000000000000000 /* -1/5 */ #define B0 .11851851851851851851 /* 16/135 */ #define B2 .51898635477582846003 /* 6656/12825 */ #define B3 .50613149034201665780 /* 28561/56430 */ #define B4 -.18000000000000000000 /* -9/50 */ #define B5 .03636363636363636363 /* 2/55 */ #define C2t .25 /* 1/4 */ #define C20 .25 /* 1/4 */ #define C3t .37500000000000000000 /* 3/8 */ #define C30 .09375000000000000000 /* 3/32 */ #define C31 .28125000000000000000 /* 9/32 */ #define C4t .92307692307692307692 /* 12/13 */ #define C40 .87938097405553026854 /* 1932/2197 */ #define C41 -3.27719617660446062812 /* -7200/2197 */ #define C42 3.32089212562585343650 /* 7296/2197 */ #define C50 2.03240740740740740740 /* 439/216 */ #define C51 -8.0 /* -8 */ #define C52 7.17348927875243664717 /* 3680/513 */ #define C53 -.20589668615984405458 /* -845/4104 */ #define C6t 0.5 /* 1/2 */ #define C60 -.29629629629629629629 /* -8/27 */ #define C61 2.0 /* 2 */ #define C62 -1.38167641325536062378 /* -3544/2565 */ #define C63 .45297270955165692007 /* 1859/4104 */ #define C64 -.27500000000000000000 /* -11/40 */ plotutils-2.6/ode/ode.h0000644000175000017500000000550710346055342012041 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997 Free Software Foundation, Inc. */ /* * preprocessor macros and structure declarations for ode. */ #include #define NAMMAX 32 /* size of identifiers */ #define KMAX 7 /* size of k vector */ #define PASTMAX 7 /* size of history vector */ /* * symbol table entry */ struct sym { char sy_name[NAMMAX]; double sy_value; double sy_val[PASTMAX]; double sy_prime; double sy_pri[PASTMAX]; double sy_predi; /* predictor value */ double sy_sserr; /* relative single step error */ double sy_aberr; /* absolute single step error */ double sy_acerr; /* accumulated error */ double sy_k[KMAX]; int sy_flags; struct expr *sy_expr; struct sym *sy_link; }; /* * bits in the flags word * of a symbol table entry */ #define SF_INIT 1 /* set when the initial value is given */ #define SF_ISEQN 2 /* set when an ODE is given */ #define SF_DEPV (SF_INIT|SF_ISEQN) /* * enumeration of printable cells in * a symbol table entry */ typedef enum { P_VALUE, P_PRIME, P_SSERR, P_ACERR, P_ABERR } ent_cell; /* * the print queue is made * of these */ struct prt { ent_cell pr_which; /* which cell to print */ struct prt *pr_link; struct sym *pr_sym; }; /* * yylex returns a pointer to this. * The receiving yacc action must * free the space when it's done with it. */ struct lex { union { double lxu_value; char lxu_name[NAMMAX]; } lx_u; int lx_lino; }; /* * operation types */ typedef enum { O_NOOP, O_PLUS, O_MINUS, O_MULT, O_DIV, O_POWER, O_SQRT, O_EXP, O_LOG, O_LOG10, O_SIN, O_COS, O_TAN, O_ASIN, O_ACOS, O_ATAN, O_IDENT, O_CONST, O_NEG, O_ABS, O_SINH, O_COSH, O_TANH, O_ASINH, O_ACOSH, O_ATANH, O_SQAR, O_CUBE, O_INV, O_FLOOR, O_CEIL, O_J0, O_J1, O_Y0, O_Y1, O_ERF, O_ERFC, O_INVERF, O_LGAMMA, O_GAMMA, O_NORM, O_INVNORM, O_IGAMMA, O_IBETA } op_type; /* * an operation in an expression list */ struct expr { op_type ex_oper; double ex_value; struct sym *ex_sym; struct expr *ex_next; }; /* integration algorithm type */ typedef enum { A_EULER, A_ADAMS_MOULTON, A_RUNGE_KUTTA_FEHLBERG } integration_type; /* * misc. consts */ #define TWO (2.0) #define HALF (0.5) #define SCALE (1e-4) #define HMIN (1e-36) /* Minimum step size */ #define HMAX (0.5) /* Maximum step size */ #define LONGMAX (2147483647) /* 2^31-1 */ #define MESH (2) #define STOPR (tstep>0 ? \ t-0.0625*tstep>=tstop : t-0.0625*tstep<=tstop ) #define STOPA (tstep>0 ? \ t+0.9375*tstep>=tstop : t+0.9375*tstep<=tstop ) plotutils-2.6/ode/Makefile.am0000644000175000017500000000057411037241212013143 00000000000000## Process this file with automake to produce Makefile.in bin_PROGRAMS = ode ode_SOURCES = am.c ama.c bessel.c eu.c expr.c float.c global.c main.c misc.c prt.c rk.c rka.c specfun.c stperr.c sym.c yywrap.c gram.y lex.l noinst_HEADERS = extern.h num.h ode.h ode_LDADD = ../lib/libcommon.a @LEXLIB@ AM_YFLAGS = -d INCLUDES = -I$(srcdir)/../include EXTRA_DIST = INTERNALS gram.h plotutils-2.6/ode/Makefile.in0000644000175000017500000004035311234210075013155 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = ode$(EXEEXT) subdir = ode DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in gram.c gram.h lex.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_ode_OBJECTS = am.$(OBJEXT) ama.$(OBJEXT) bessel.$(OBJEXT) \ eu.$(OBJEXT) expr.$(OBJEXT) float.$(OBJEXT) global.$(OBJEXT) \ main.$(OBJEXT) misc.$(OBJEXT) prt.$(OBJEXT) rk.$(OBJEXT) \ rka.$(OBJEXT) specfun.$(OBJEXT) stperr.$(OBJEXT) sym.$(OBJEXT) \ yywrap.$(OBJEXT) gram.$(OBJEXT) lex.$(OBJEXT) ode_OBJECTS = $(am_ode_OBJECTS) ode_DEPENDENCIES = ../lib/libcommon.a DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) YLWRAP = $(top_srcdir)/ylwrap YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS) SOURCES = $(ode_SOURCES) DIST_SOURCES = $(ode_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ode_SOURCES = am.c ama.c bessel.c eu.c expr.c float.c global.c main.c misc.c prt.c rk.c rka.c specfun.c stperr.c sym.c yywrap.c gram.y lex.l noinst_HEADERS = extern.h num.h ode.h ode_LDADD = ../lib/libcommon.a @LEXLIB@ AM_YFLAGS = -d INCLUDES = -I$(srcdir)/../include EXTRA_DIST = INTERNALS gram.h all: all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ode/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ode/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done gram.h: gram.c @if test ! -f $@; then \ rm -f gram.c; \ $(MAKE) $(AM_MAKEFLAGS) gram.c; \ else :; fi ode$(EXEEXT): $(ode_OBJECTS) $(ode_DEPENDENCIES) @rm -f ode$(EXEEXT) $(LINK) $(ode_OBJECTS) $(ode_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/am.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ama.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bessel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gram.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rka.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/specfun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stperr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sym.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yywrap.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .l.c: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f gram.c -rm -f gram.h -rm -f lex.c clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: plotutils-2.6/ode/gram.c0000644000175000017500000030317611037251767012225 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUMBER = 258, IDENT = 259, SEP = 260, ABS = 261, SQRT = 262, EXP = 263, LOG = 264, LOG10 = 265, SIN = 266, COS = 267, TAN = 268, ASIN = 269, ACOS = 270, ATAN = 271, SINH = 272, COSH = 273, TANH = 274, ASINH = 275, ACOSH = 276, ATANH = 277, FLOOR = 278, CEIL = 279, J0 = 280, J1 = 281, Y0 = 282, Y1 = 283, LGAMMA = 284, GAMMA = 285, ERF = 286, ERFC = 287, INVERF = 288, NORM = 289, INVNORM = 290, IGAMMA = 291, IBETA = 292, EVERY = 293, FROM = 294, PRINT = 295, STEP = 296, EXAM = 297, UMINUS = 298 }; #endif /* Tokens. */ #define NUMBER 258 #define IDENT 259 #define SEP 260 #define ABS 261 #define SQRT 262 #define EXP 263 #define LOG 264 #define LOG10 265 #define SIN 266 #define COS 267 #define TAN 268 #define ASIN 269 #define ACOS 270 #define ATAN 271 #define SINH 272 #define COSH 273 #define TANH 274 #define ASINH 275 #define ACOSH 276 #define ATANH 277 #define FLOOR 278 #define CEIL 279 #define J0 280 #define J1 281 #define Y0 282 #define Y1 283 #define LGAMMA 284 #define GAMMA 285 #define ERF 286 #define ERFC 287 #define INVERF 288 #define NORM 289 #define INVNORM 290 #define IGAMMA 291 #define IBETA 292 #define EVERY 293 #define FROM 294 #define PRINT 295 #define STEP 296 #define EXAM 297 #define UMINUS 298 /* Copy the first part of user declarations. */ #line 1 "gram.y" /* Copyright Nicholas B. Tufillaro, 1982-1994. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1999, 2005, 2008, Free Software * Foundation, Inc. */ /* * Grammar for ode: * Most things are self-explanatory. * When you're done with a lexptr-type object * you should free it with lfree. They are * used for passing constants around while parsing * (computing the value of) a cexpr. The macros * for evaluating operators and functions are the * most important thing to be familiar with before * toying with the semantics. */ #include "sys-defines.h" #include "ode.h" #include "extern.h" /* * Value is true iff operands pass ONECON. */ #define TWOCON(x,y) (ONECON(x) && ONECON(y)) #define THREECON(x,y,z) (ONECON(x) && ONECON(y) && ONECON(z)) /* * Value must be a (struct expr *). Returns true if its arg, when * evaluated, would put a constant on the stack. */ #define ONECON(x) (x->ex_oper == O_CONST && x->ex_next == NULL) /* * Performs ordinary binary arithmetic, when there are two constants in an * expr (`op' is a C operator that includes an assignment, e.g., +=). */ #define COMBINE(x,y,r,op) {x->ex_value op y->ex_value; efree(y); r = x;} /* * Generates stack code for a binary operation, as for a dyadic operator in * an expression. E.g., op = O_PLUS. */ #define BINARY(x,y,r,op) {struct expr *ep=ealloc();\ ep->ex_oper = op;\ concat(y,ep);\ concat(r=x,y);} /* * Generates stack code for a ternary operation, as for a triadic operator in * an expression. E.g., op = O_IBETA. */ #define TERNARY(x,y,z,r,op) {struct expr *ep=ealloc();\ ep->ex_oper = op;\ concat(z,ep);\ concat(y,z);\ concat(r=x,y);} /* * Performs ordinary unary arithmetic, when there is a constant in an expr. * "-" seems to work as a monadic operator. */ #define CONFUNC(x,r,f) {x->ex_value = f(x->ex_value); r = x;} /* * Generates stack code for a unary operation, as for a monadic operator in * an expression. */ #define UNARY(oprnd,r,op) {struct expr *ep=ealloc();\ ep->ex_oper = op;\ concat(r=oprnd,ep);} /* * Performs binary arithmetic in a cexpr (`op' is a C operator that * includes an assignment, e.g. +=). */ #define CEXOP(x,y,r,op) {x->lx_u.lxu_value op y->lx_u.lxu_value;\ lfree(y);\ r = x;} /* * Performs unary arithmetic in a cexpr. */ #define CEXFUNC(x,r,f) {x->lx_u.lxu_value = f(x->lx_u.lxu_value); r=x;} /* * A hook for future upgrades in error reporting */ static char *errmess = NULL; bool erritem; /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 85 "gram.y" { struct lex *lexptr; struct expr *exprptr; struct prt *prtptr; int simple; } /* Line 187 of yacc.c. */ #line 274 "gram.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 216 of yacc.c. */ #line 287 "gram.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 52 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 876 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 57 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 10 /* YYNRULES -- Number of rules. */ #define YYNRULES 104 /* YYNRULES -- Number of states. */ #define YYNSTATES 346 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 298 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53, 2, 2, 2, 2, 2, 50, 55, 56, 46, 44, 51, 45, 2, 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 43, 2, 54, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 49 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 8, 10, 15, 18, 24, 30, 36, 44, 48, 50, 54, 57, 58, 60, 62, 64, 66, 67, 70, 71, 74, 78, 82, 86, 90, 94, 98, 103, 108, 113, 118, 123, 128, 133, 138, 143, 148, 153, 158, 163, 168, 173, 178, 183, 188, 193, 198, 203, 208, 213, 218, 223, 228, 233, 238, 243, 248, 255, 264, 267, 269, 273, 277, 281, 285, 289, 293, 298, 303, 308, 313, 318, 323, 328, 333, 338, 343, 348, 353, 358, 363, 368, 373, 378, 383, 388, 393, 398, 403, 408, 413, 418, 423, 428, 433, 438, 443, 450, 459, 462, 464 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 58, 0, -1, 59, -1, 58, 59, -1, 5, -1, 4, 43, 66, 5, -1, 1, 5, -1, 4, 50, 43, 66, 5, -1, 40, 60, 63, 64, 5, -1, 41, 65, 51, 65, 5, -1, 41, 65, 51, 65, 51, 65, 5, -1, 42, 4, 5, -1, 61, -1, 60, 51, 61, -1, 4, 62, -1, -1, 50, -1, 52, -1, 53, -1, 54, -1, -1, 38, 65, -1, -1, 39, 65, -1, 55, 65, 56, -1, 65, 44, 65, -1, 65, 45, 65, -1, 65, 46, 65, -1, 65, 47, 65, -1, 65, 48, 65, -1, 7, 55, 65, 56, -1, 6, 55, 65, 56, -1, 8, 55, 65, 56, -1, 9, 55, 65, 56, -1, 10, 55, 65, 56, -1, 11, 55, 65, 56, -1, 12, 55, 65, 56, -1, 13, 55, 65, 56, -1, 20, 55, 65, 56, -1, 21, 55, 65, 56, -1, 22, 55, 65, 56, -1, 14, 55, 65, 56, -1, 15, 55, 65, 56, -1, 16, 55, 65, 56, -1, 17, 55, 65, 56, -1, 18, 55, 65, 56, -1, 19, 55, 65, 56, -1, 23, 55, 65, 56, -1, 24, 55, 65, 56, -1, 25, 55, 65, 56, -1, 26, 55, 65, 56, -1, 27, 55, 65, 56, -1, 28, 55, 65, 56, -1, 32, 55, 65, 56, -1, 31, 55, 65, 56, -1, 33, 55, 65, 56, -1, 29, 55, 65, 56, -1, 30, 55, 65, 56, -1, 34, 55, 65, 56, -1, 35, 55, 65, 56, -1, 36, 55, 65, 51, 65, 56, -1, 37, 55, 65, 51, 65, 51, 65, 56, -1, 45, 65, -1, 3, -1, 55, 66, 56, -1, 66, 44, 66, -1, 66, 45, 66, -1, 66, 46, 66, -1, 66, 47, 66, -1, 66, 48, 66, -1, 7, 55, 66, 56, -1, 6, 55, 66, 56, -1, 8, 55, 66, 56, -1, 9, 55, 66, 56, -1, 10, 55, 66, 56, -1, 11, 55, 66, 56, -1, 12, 55, 66, 56, -1, 13, 55, 66, 56, -1, 20, 55, 66, 56, -1, 21, 55, 66, 56, -1, 22, 55, 66, 56, -1, 14, 55, 66, 56, -1, 15, 55, 66, 56, -1, 16, 55, 66, 56, -1, 17, 55, 66, 56, -1, 18, 55, 66, 56, -1, 19, 55, 66, 56, -1, 23, 55, 66, 56, -1, 24, 55, 66, 56, -1, 25, 55, 66, 56, -1, 26, 55, 66, 56, -1, 27, 55, 66, 56, -1, 28, 55, 66, 56, -1, 29, 55, 66, 56, -1, 30, 55, 66, 56, -1, 32, 55, 66, 56, -1, 31, 55, 66, 56, -1, 33, 55, 66, 56, -1, 34, 55, 66, 56, -1, 35, 55, 66, 56, -1, 36, 55, 66, 51, 66, 56, -1, 37, 55, 66, 51, 66, 51, 66, 56, -1, 45, 66, -1, 3, -1, 4, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 110, 110, 111, 114, 116, 127, 139, 168, 175, 187, 207, 247, 252, 262, 275, 276, 278, 283, 288, 296, 297, 306, 307, 315, 319, 323, 327, 331, 335, 342, 346, 352, 356, 360, 364, 368, 372, 376, 380, 384, 388, 392, 396, 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, 444, 448, 452, 456, 460, 464, 471, 479, 483, 487, 489, 496, 503, 510, 523, 610, 617, 628, 635, 642, 649, 656, 663, 670, 677, 684, 691, 698, 705, 712, 719, 726, 733, 740, 747, 754, 761, 768, 775, 782, 789, 796, 803, 810, 817, 824, 836, 849, 856, 863 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "NUMBER", "IDENT", "SEP", "ABS", "SQRT", "EXP", "LOG", "LOG10", "SIN", "COS", "TAN", "ASIN", "ACOS", "ATAN", "SINH", "COSH", "TANH", "ASINH", "ACOSH", "ATANH", "FLOOR", "CEIL", "J0", "J1", "Y0", "Y1", "LGAMMA", "GAMMA", "ERF", "ERFC", "INVERF", "NORM", "INVNORM", "IGAMMA", "IBETA", "EVERY", "FROM", "PRINT", "STEP", "EXAM", "'='", "'+'", "'-'", "'*'", "'/'", "'^'", "UMINUS", "'''", "','", "'~'", "'!'", "'?'", "'('", "')'", "$accept", "program", "stat", "prtlist", "prtitem", "prttag", "optevery", "optfrom", "cexpr", "expr", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 61, 43, 45, 42, 47, 94, 298, 39, 44, 126, 33, 63, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, 59, 60, 60, 61, 62, 62, 62, 62, 62, 63, 63, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 2, 1, 4, 2, 5, 5, 5, 7, 3, 1, 3, 2, 0, 1, 1, 1, 1, 0, 2, 0, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 8, 2, 1, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 8, 2, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 0, 4, 0, 0, 0, 0, 2, 6, 0, 0, 15, 20, 12, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 103, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 18, 19, 14, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 5, 0, 0, 0, 0, 0, 0, 21, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, 66, 67, 68, 69, 7, 23, 8, 31, 30, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 38, 39, 40, 47, 48, 49, 50, 51, 52, 56, 57, 54, 53, 55, 58, 59, 0, 0, 9, 0, 71, 70, 72, 73, 74, 75, 76, 77, 81, 82, 83, 84, 85, 86, 78, 79, 80, 87, 88, 89, 90, 91, 92, 93, 94, 96, 95, 97, 98, 99, 0, 0, 0, 0, 0, 0, 0, 60, 0, 10, 100, 0, 0, 0, 61, 101 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 7, 8, 13, 14, 96, 99, 185, 50, 90 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -50 static const yytype_int16 yypact[] = { 233, -2, -22, -50, 12, 181, 44, 228, -50, -50, 131, 8, -16, -36, -50, -50, 29, 30, 114, 115, 122, 123, 124, 126, 128, 130, 170, 172, 176, 180, 184, 190, 191, 192, 195, 203, 204, 206, 207, 216, 217, 234, 236, 238, 251, 254, 255, 256, 181, 181, 209, 177, -50, -50, -50, -50, 269, 272, 273, 274, 287, 290, 291, 292, 305, 308, 309, 310, 323, 326, 327, 328, 341, 344, 345, 346, 359, 362, 363, 364, 377, 380, 381, 382, 395, 398, 399, 400, 131, 131, 127, 131, -50, -50, -50, -50, -50, 181, 12, 94, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, -50, -39, 181, 181, 181, 181, 181, 181, -50, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, -50, -34, -50, 131, 131, 131, 131, 131, 175, 828, -50, 181, 225, -21, -15, 196, 232, 239, 252, 257, 270, 275, 288, 293, 306, 311, 324, 329, 342, 347, 360, 365, 378, 383, 396, 401, 414, 419, 432, 437, 450, 455, 468, 780, 788, -50, -28, -28, 246, 246, 246, -1, 473, 486, 491, 504, 509, 522, 527, 540, 545, 558, 563, 576, 581, 594, 599, 612, 617, 630, 635, 648, 653, 666, 671, 684, 689, 702, 707, 720, 725, 738, 796, 804, -50, 78, 78, 259, 259, 259, -50, 828, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, 181, 181, -50, 181, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, -50, 131, 131, 743, 812, 219, 756, 820, -50, 181, -50, -50, 131, 761, 774, -50, -50 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -50, -50, 318, -50, 214, -50, -50, -50, -48, -49 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint16 yytable[] = { 132, 133, 97, 9, 298, 134, 135, 136, 137, 138, 176, 177, 178, 179, 180, 98, 12, 218, 136, 137, 138, 10, 257, 134, 135, 136, 137, 138, 11, 134, 135, 136, 137, 138, 92, 266, 93, 94, 95, 173, 174, 267, 181, 134, 135, 136, 137, 138, 51, 182, 299, 91, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 100, 101, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 178, 179, 180, 258, 259, 260, 261, 262, 175, 184, 54, 55, 264, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 102, 103, 176, 177, 178, 179, 180, 88, 104, 105, 106, 263, 107, 140, 108, 15, 109, 89, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 176, 177, 178, 179, 180, 339, 110, 48, 111, 52, 1, 265, 112, 2, 3, 1, 113, 49, 2, 3, 114, 134, 135, 136, 137, 138, 115, 116, 117, 332, 333, 118, 334, 268, 134, 135, 136, 137, 138, 119, 120, 139, 121, 122, 134, 135, 136, 137, 138, 4, 5, 6, 123, 124, 4, 5, 6, 134, 135, 136, 137, 138, 335, 336, 134, 135, 136, 137, 138, 269, 125, 342, 126, 343, 127, 138, 270, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 128, 180, 271, 129, 130, 131, 183, 272, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 141, 53, 273, 142, 143, 144, 0, 274, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 145, 0, 275, 146, 147, 148, 0, 276, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 149, 0, 277, 150, 151, 152, 0, 278, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 153, 0, 279, 154, 155, 156, 0, 280, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 157, 0, 281, 158, 159, 160, 0, 282, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 161, 0, 283, 162, 163, 164, 0, 284, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 165, 0, 285, 166, 167, 168, 0, 286, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 169, 0, 287, 170, 171, 172, 0, 288, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 0, 0, 289, 0, 0, 0, 0, 290, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 0, 0, 291, 0, 0, 0, 0, 292, 134, 135, 136, 137, 138, 134, 135, 136, 137, 138, 0, 0, 293, 0, 0, 0, 0, 294, 134, 135, 136, 137, 138, 176, 177, 178, 179, 180, 0, 0, 295, 0, 0, 0, 0, 300, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 301, 0, 0, 0, 0, 302, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 303, 0, 0, 0, 0, 304, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 305, 0, 0, 0, 0, 306, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 307, 0, 0, 0, 0, 308, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 309, 0, 0, 0, 0, 310, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 311, 0, 0, 0, 0, 312, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 313, 0, 0, 0, 0, 314, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 315, 0, 0, 0, 0, 316, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 317, 0, 0, 0, 0, 318, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 319, 0, 0, 0, 0, 320, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 321, 0, 0, 0, 0, 322, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 323, 0, 0, 0, 0, 324, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 325, 0, 0, 0, 0, 326, 176, 177, 178, 179, 180, 176, 177, 178, 179, 180, 0, 0, 327, 0, 0, 0, 0, 328, 176, 177, 178, 179, 180, 134, 135, 136, 137, 138, 0, 0, 329, 0, 0, 0, 0, 337, 176, 177, 178, 179, 180, 134, 135, 136, 137, 138, 0, 0, 340, 0, 0, 0, 0, 344, 176, 177, 178, 179, 180, 0, 134, 135, 136, 137, 138, 0, 345, 296, 134, 135, 136, 137, 138, 0, 0, 297, 176, 177, 178, 179, 180, 0, 0, 330, 176, 177, 178, 179, 180, 0, 0, 331, 134, 135, 136, 137, 138, 0, 0, 338, 176, 177, 178, 179, 180, 0, 0, 341, 134, 135, 136, 137, 138 }; static const yytype_int16 yycheck[] = { 48, 49, 38, 5, 5, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 51, 4, 56, 46, 47, 48, 43, 56, 44, 45, 46, 47, 48, 50, 44, 45, 46, 47, 48, 50, 56, 52, 53, 54, 88, 89, 56, 91, 44, 45, 46, 47, 48, 4, 97, 51, 43, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 55, 55, 134, 135, 136, 137, 138, 139, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 46, 47, 48, 176, 177, 178, 179, 180, 5, 39, 3, 4, 184, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 55, 55, 44, 45, 46, 47, 48, 45, 55, 55, 55, 5, 55, 5, 55, 3, 55, 55, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 44, 45, 46, 47, 48, 5, 55, 45, 55, 0, 1, 5, 55, 4, 5, 1, 55, 55, 4, 5, 55, 44, 45, 46, 47, 48, 55, 55, 55, 296, 297, 55, 299, 56, 44, 45, 46, 47, 48, 55, 55, 51, 55, 55, 44, 45, 46, 47, 48, 40, 41, 42, 55, 55, 40, 41, 42, 44, 45, 46, 47, 48, 330, 331, 44, 45, 46, 47, 48, 56, 55, 338, 55, 341, 55, 48, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, 48, 56, 55, 55, 55, 98, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, 7, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, -1, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, -1, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, -1, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, -1, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, -1, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, -1, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, 55, -1, 56, 55, 55, 55, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, 44, 45, 46, 47, 48, -1, -1, 56, -1, -1, -1, -1, 56, 44, 45, 46, 47, 48, -1, 44, 45, 46, 47, 48, -1, 56, 51, 44, 45, 46, 47, 48, -1, -1, 51, 44, 45, 46, 47, 48, -1, -1, 51, 44, 45, 46, 47, 48, -1, -1, 51, 44, 45, 46, 47, 48, -1, -1, 51, 44, 45, 46, 47, 48, -1, -1, 51, 44, 45, 46, 47, 48 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 1, 4, 5, 40, 41, 42, 58, 59, 5, 43, 50, 4, 60, 61, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 45, 55, 65, 4, 0, 59, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 45, 55, 66, 43, 50, 52, 53, 54, 62, 38, 51, 63, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 65, 65, 44, 45, 46, 47, 48, 51, 5, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 66, 66, 5, 44, 45, 46, 47, 48, 66, 65, 61, 39, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 56, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 56, 66, 66, 66, 66, 66, 5, 65, 5, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 51, 51, 5, 51, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 51, 51, 65, 65, 65, 66, 66, 56, 51, 5, 56, 51, 65, 66, 56, 56 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: #line 115 "gram.y" { lfree((yyvsp[(1) - (1)].lexptr)); } break; case 5: #line 117 "gram.y" { struct sym *sp; sp = lookup((yyvsp[(1) - (4)].lexptr)->lx_u.lxu_name); sp->sy_value = eval((yyvsp[(3) - (4)].exprptr)); sp->sy_flags |= SF_INIT; lfree((yyvsp[(1) - (4)].lexptr)); efree((yyvsp[(3) - (4)].exprptr)); lfree((yyvsp[(4) - (4)].lexptr)); } break; case 6: #line 128 "gram.y" { if (errmess == NULL) errmess = "syntax error"; fprintf (stderr, "%s:%s:%d: %s\n", progname, filename, ((yyvsp[(2) - (2)].lexptr)->lx_lino), errmess); errmess = NULL; lfree((yyvsp[(2) - (2)].lexptr)); yyerrok; yyclearin; } break; case 7: #line 140 "gram.y" { struct sym *sp; struct prt *pp, *qp; sp = lookup((yyvsp[(1) - (5)].lexptr)->lx_u.lxu_name); efree(sp->sy_expr); sp->sy_expr = (yyvsp[(4) - (5)].exprptr); sp->sy_flags |= SF_ISEQN; if (!sawprint) { for (pp=pqueue; pp!=NULL; pp=pp->pr_link) if (pp->pr_sym == sp) goto found; pp = palloc(); pp->pr_sym = sp; if (pqueue == NULL) pqueue = pp; else { for (qp=pqueue; qp->pr_link!=NULL; ) qp = qp->pr_link; qp->pr_link = pp; } } found: lfree((yyvsp[(1) - (5)].lexptr)); lfree((yyvsp[(5) - (5)].lexptr)); } break; case 8: #line 169 "gram.y" { sawprint = true; prerr = erritem; erritem = false; lfree((yyvsp[(5) - (5)].lexptr)); } break; case 9: #line 176 "gram.y" { lfree((yyvsp[(5) - (5)].lexptr)); tstart = (yyvsp[(2) - (5)].lexptr)->lx_u.lxu_value; lfree((yyvsp[(2) - (5)].lexptr)); tstop = (yyvsp[(4) - (5)].lexptr)->lx_u.lxu_value; lfree((yyvsp[(4) - (5)].lexptr)); if (!conflag) startstep(); solve(); sawstep = true; } break; case 10: #line 188 "gram.y" { double savstep; bool savconflag; lfree((yyvsp[(7) - (7)].lexptr)); tstart = (yyvsp[(2) - (7)].lexptr)->lx_u.lxu_value; lfree((yyvsp[(2) - (7)].lexptr)); tstop = (yyvsp[(4) - (7)].lexptr)->lx_u.lxu_value; lfree((yyvsp[(4) - (7)].lexptr)); savstep = tstep; tstep = (yyvsp[(6) - (7)].lexptr)->lx_u.lxu_value; lfree((yyvsp[(6) - (7)].lexptr)); savconflag = conflag; conflag = true; solve(); tstep = savstep; conflag = savconflag; sawstep = true; } break; case 11: #line 208 "gram.y" { struct sym *sp; lfree((yyvsp[(3) - (3)].lexptr)); sp = lookup((yyvsp[(2) - (3)].lexptr)->lx_u.lxu_name); lfree((yyvsp[(2) - (3)].lexptr)); printf ("\"%.*s\" is ",NAMMAX,sp->sy_name); switch (sp->sy_flags & SF_DEPV) { case SF_DEPV: case SF_ISEQN: printf ("a dynamic variable\n"); break; case SF_INIT: printf ("an initialized constant\n"); break; case 0: printf ("an uninitialized constant\n"); break; default: panicn ("impossible (%d) in EXAM action", sp->sy_flags); } printf ("value:"); prval (sp->sy_value); printf ("\nprime:"); prval (sp->sy_prime); printf ("\nsserr:"); prval (sp->sy_sserr); printf ("\naberr:"); prval (sp->sy_aberr); printf ("\nacerr:"); prval (sp->sy_acerr); putchar ('\n'); prexq(sp->sy_expr); fflush(stdout); } break; case 12: #line 248 "gram.y" { pfree(pqueue); pqueue = (yyvsp[(1) - (1)].prtptr); } break; case 13: #line 253 "gram.y" { struct prt *pp; for (pp=pqueue; pp->pr_link!=NULL; pp=pp->pr_link) ; pp->pr_link = (yyvsp[(3) - (3)].prtptr); } break; case 14: #line 263 "gram.y" { struct prt *pp; pp = palloc(); pp->pr_sym = lookup((yyvsp[(1) - (2)].lexptr)->lx_u.lxu_name); pp->pr_which = (ent_cell)((yyvsp[(2) - (2)].simple)); lfree((yyvsp[(1) - (2)].lexptr)); (yyval.prtptr) = pp; } break; case 15: #line 275 "gram.y" { (yyval.simple) = P_VALUE; } break; case 16: #line 277 "gram.y" { (yyval.simple) = P_PRIME; } break; case 17: #line 279 "gram.y" { (yyval.simple) = P_ACERR; erritem = true; } break; case 18: #line 284 "gram.y" { (yyval.simple) = P_ABERR; erritem = true; } break; case 19: #line 289 "gram.y" { (yyval.simple) = P_SSERR; erritem = true; } break; case 20: #line 296 "gram.y" { sawevery = false; } break; case 21: #line 298 "gram.y" { sawevery = true; tevery = IROUND((yyvsp[(2) - (2)].lexptr)->lx_u.lxu_value); lfree((yyvsp[(2) - (2)].lexptr)); } break; case 22: #line 306 "gram.y" { sawfrom = false; } break; case 23: #line 308 "gram.y" { sawfrom = true; tfrom = (yyvsp[(2) - (2)].lexptr)->lx_u.lxu_value; lfree((yyvsp[(2) - (2)].lexptr)); } break; case 24: #line 316 "gram.y" { (yyval.lexptr) = (yyvsp[(2) - (3)].lexptr); } break; case 25: #line 320 "gram.y" { CEXOP((yyvsp[(1) - (3)].lexptr),(yyvsp[(3) - (3)].lexptr),(yyval.lexptr),+=) } break; case 26: #line 324 "gram.y" { CEXOP((yyvsp[(1) - (3)].lexptr),(yyvsp[(3) - (3)].lexptr),(yyval.lexptr),-=) } break; case 27: #line 328 "gram.y" { CEXOP((yyvsp[(1) - (3)].lexptr),(yyvsp[(3) - (3)].lexptr),(yyval.lexptr),*=) } break; case 28: #line 332 "gram.y" { CEXOP((yyvsp[(1) - (3)].lexptr),(yyvsp[(3) - (3)].lexptr),(yyval.lexptr),/=) } break; case 29: #line 336 "gram.y" { (yyvsp[(1) - (3)].lexptr)->lx_u.lxu_value = pow((yyvsp[(1) - (3)].lexptr)->lx_u.lxu_value,(yyvsp[(3) - (3)].lexptr)->lx_u.lxu_value); lfree((yyvsp[(3) - (3)].lexptr)); (yyval.lexptr) = (yyvsp[(1) - (3)].lexptr); } break; case 30: #line 343 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),sqrt) } break; case 31: #line 347 "gram.y" { if ((yyvsp[(3) - (4)].lexptr)->lx_u.lxu_value < 0) (yyvsp[(3) - (4)].lexptr)->lx_u.lxu_value = -((yyvsp[(3) - (4)].lexptr)->lx_u.lxu_value); (yyval.lexptr) = (yyvsp[(3) - (4)].lexptr); } break; case 32: #line 353 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),exp) } break; case 33: #line 357 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),log) } break; case 34: #line 361 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),log10) } break; case 35: #line 365 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),sin) } break; case 36: #line 369 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),cos) } break; case 37: #line 373 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),tan) } break; case 38: #line 377 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),asinh) } break; case 39: #line 381 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),acosh) } break; case 40: #line 385 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),atanh) } break; case 41: #line 389 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),asin) } break; case 42: #line 393 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),acos) } break; case 43: #line 397 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),atan) } break; case 44: #line 401 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),sinh) } break; case 45: #line 405 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),cosh) } break; case 46: #line 409 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),tanh) } break; case 47: #line 413 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),floor) } break; case 48: #line 417 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),ceil) } break; case 49: #line 421 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),j0) } break; case 50: #line 425 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),j1) } break; case 51: #line 429 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),y0) } break; case 52: #line 433 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),y1) } break; case 53: #line 437 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),erfc) } break; case 54: #line 441 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),erf) } break; case 55: #line 445 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),inverf) } break; case 56: #line 449 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),F_LGAMMA) } break; case 57: #line 453 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),f_gamma) } break; case 58: #line 457 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),norm) } break; case 59: #line 461 "gram.y" { CEXFUNC((yyvsp[(3) - (4)].lexptr),(yyval.lexptr),invnorm) } break; case 60: #line 465 "gram.y" { (yyvsp[(3) - (6)].lexptr)->lx_u.lxu_value = igamma((yyvsp[(3) - (6)].lexptr)->lx_u.lxu_value,(yyvsp[(5) - (6)].lexptr)->lx_u.lxu_value); lfree((yyvsp[(5) - (6)].lexptr)); (yyval.lexptr) = (yyvsp[(3) - (6)].lexptr); } break; case 61: #line 472 "gram.y" { (yyvsp[(3) - (8)].lexptr)->lx_u.lxu_value = ibeta((yyvsp[(3) - (8)].lexptr)->lx_u.lxu_value,(yyvsp[(5) - (8)].lexptr)->lx_u.lxu_value,(yyvsp[(7) - (8)].lexptr)->lx_u.lxu_value); lfree((yyvsp[(5) - (8)].lexptr)); lfree((yyvsp[(7) - (8)].lexptr)); (yyval.lexptr) = (yyvsp[(3) - (8)].lexptr); } break; case 62: #line 480 "gram.y" { CEXFUNC((yyvsp[(2) - (2)].lexptr),(yyval.lexptr),-) } break; case 63: #line 484 "gram.y" { (yyval.lexptr) = (yyvsp[(1) - (1)].lexptr); } break; case 64: #line 488 "gram.y" { (yyval.exprptr) = (yyvsp[(2) - (3)].exprptr); } break; case 65: #line 490 "gram.y" { if (TWOCON((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr))) COMBINE((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),+=) else BINARY((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),O_PLUS); } break; case 66: #line 497 "gram.y" { if (TWOCON((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr))) COMBINE((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),-=) else BINARY((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),O_MINUS); } break; case 67: #line 504 "gram.y" { if (TWOCON((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr))) COMBINE((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),*=) else BINARY((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),O_MULT); } break; case 68: #line 511 "gram.y" { if (TWOCON((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr))) COMBINE((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),/=) else if (ONECON((yyvsp[(3) - (3)].exprptr)) && (yyvsp[(3) - (3)].exprptr)->ex_value!=0.) { /* division by constant */ (yyvsp[(3) - (3)].exprptr)->ex_value = 1./(yyvsp[(3) - (3)].exprptr)->ex_value; BINARY((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),O_MULT); } else BINARY((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),O_DIV); } break; case 69: #line 524 "gram.y" { double f; bool invert = false; if (TWOCON((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr))) { /* case const ^ const */ (yyvsp[(1) - (3)].exprptr)->ex_value = pow((yyvsp[(1) - (3)].exprptr)->ex_value,(yyvsp[(3) - (3)].exprptr)->ex_value); efree((yyvsp[(3) - (3)].exprptr)); } else if (ONECON((yyvsp[(1) - (3)].exprptr))) { if ((yyvsp[(1) - (3)].exprptr)->ex_value == 1.) { /* case 1 ^ x */ efree((yyvsp[(3) - (3)].exprptr)); (yyval.exprptr) = (yyvsp[(1) - (3)].exprptr); } else goto other; } else if (!ONECON((yyvsp[(3) - (3)].exprptr))) goto other; else { f = (yyvsp[(3) - (3)].exprptr)->ex_value; if (f < 0.) { /* * negative exponent means * to append an invert cmd */ f = -f; invert = true; } if (f == 2.) { /* case x ^ 2 */ (yyvsp[(3) - (3)].exprptr)->ex_oper = O_SQAR; concat((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr)); (yyval.exprptr) = (yyvsp[(1) - (3)].exprptr); } else if (f == 3.) { /* case x ^ 3 */ (yyvsp[(3) - (3)].exprptr)->ex_oper = O_CUBE; concat((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr)); (yyval.exprptr) = (yyvsp[(1) - (3)].exprptr); } else if (f == 0.5) { /* case x ^ .5 */ (yyvsp[(3) - (3)].exprptr)->ex_oper = O_SQRT; concat((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr)); (yyval.exprptr) = (yyvsp[(1) - (3)].exprptr); } else if (f == 1.5) { /* case x ^ 1.5 */ (yyvsp[(3) - (3)].exprptr)->ex_oper = O_CUBE; BINARY((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),O_SQRT); } else if (f == 1.) { /* case x ^ 1 */ efree((yyvsp[(3) - (3)].exprptr)); (yyval.exprptr) = (yyvsp[(1) - (3)].exprptr); } else if (f == 0.) { /* case x ^ 0 */ efree((yyvsp[(1) - (3)].exprptr)); (yyvsp[(3) - (3)].exprptr)->ex_value = 1.; (yyval.exprptr) = (yyvsp[(3) - (3)].exprptr); } else { other: /* default */ invert = false; BINARY((yyvsp[(1) - (3)].exprptr),(yyvsp[(3) - (3)].exprptr),(yyval.exprptr),O_POWER); } if (invert) UNARY((yyval.exprptr),(yyval.exprptr),O_INV) } } break; case 70: #line 611 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),sqrt) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_SQRT); } break; case 71: #line 618 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) { if ((yyvsp[(3) - (4)].exprptr)->ex_value < 0) (yyvsp[(3) - (4)].exprptr)->ex_value = -((yyvsp[(3) - (4)].exprptr)->ex_value); (yyval.exprptr) = (yyvsp[(3) - (4)].exprptr); } else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ABS); } break; case 72: #line 629 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),exp) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_EXP); } break; case 73: #line 636 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),log) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_LOG); } break; case 74: #line 643 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),log10) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_LOG10); } break; case 75: #line 650 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),sin) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_SIN); } break; case 76: #line 657 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),cos) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_COS); } break; case 77: #line 664 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),tan) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_TAN); } break; case 78: #line 671 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),asinh) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ASINH); } break; case 79: #line 678 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),acosh) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ACOSH); } break; case 80: #line 685 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),atanh) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ATANH); } break; case 81: #line 692 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),asin) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ASIN); } break; case 82: #line 699 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),acos) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ACOS); } break; case 83: #line 706 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),atan) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ATAN); } break; case 84: #line 713 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),sinh) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_SINH); } break; case 85: #line 720 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),cosh) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_COSH); } break; case 86: #line 727 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),tanh) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_TANH); } break; case 87: #line 734 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),floor) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_FLOOR); } break; case 88: #line 741 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),ceil) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_CEIL); } break; case 89: #line 748 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),j0) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_J0); } break; case 90: #line 755 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),j1) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_J1); } break; case 91: #line 762 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),y0) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_Y0); } break; case 92: #line 769 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),y1) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_Y1); } break; case 93: #line 776 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),F_LGAMMA) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_LGAMMA); } break; case 94: #line 783 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),f_gamma) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_GAMMA); } break; case 95: #line 790 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),erfc) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ERFC); } break; case 96: #line 797 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),erf) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_ERF); } break; case 97: #line 804 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),inverf) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_INVERF); } break; case 98: #line 811 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),norm) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_NORM); } break; case 99: #line 818 "gram.y" { if (ONECON((yyvsp[(3) - (4)].exprptr))) CONFUNC((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),invnorm) else UNARY((yyvsp[(3) - (4)].exprptr),(yyval.exprptr),O_INVNORM); } break; case 100: #line 825 "gram.y" { if (TWOCON((yyvsp[(3) - (6)].exprptr),(yyvsp[(5) - (6)].exprptr))) { (yyvsp[(3) - (6)].exprptr)->ex_value = igamma((yyvsp[(3) - (6)].exprptr)->ex_value,(yyvsp[(5) - (6)].exprptr)->ex_value); efree((yyvsp[(5) - (6)].exprptr)); (yyval.exprptr) = (yyvsp[(3) - (6)].exprptr); } else BINARY((yyvsp[(3) - (6)].exprptr),(yyvsp[(5) - (6)].exprptr),(yyval.exprptr),O_IGAMMA); } break; case 101: #line 837 "gram.y" { if (THREECON((yyvsp[(3) - (8)].exprptr),(yyvsp[(5) - (8)].exprptr),(yyvsp[(7) - (8)].exprptr))) { (yyvsp[(3) - (8)].exprptr)->ex_value = ibeta((yyvsp[(3) - (8)].exprptr)->ex_value,(yyvsp[(5) - (8)].exprptr)->ex_value,(yyvsp[(7) - (8)].exprptr)->ex_value); efree((yyvsp[(5) - (8)].exprptr)); efree((yyvsp[(7) - (8)].exprptr)); (yyval.exprptr) = (yyvsp[(3) - (8)].exprptr); } else TERNARY((yyvsp[(3) - (8)].exprptr),(yyvsp[(5) - (8)].exprptr),(yyvsp[(7) - (8)].exprptr),(yyval.exprptr),O_IBETA); } break; case 102: #line 850 "gram.y" { if (ONECON((yyvsp[(2) - (2)].exprptr))) CONFUNC((yyvsp[(2) - (2)].exprptr),(yyval.exprptr),-) else UNARY((yyvsp[(2) - (2)].exprptr),(yyval.exprptr),O_NEG); } break; case 103: #line 857 "gram.y" { (yyval.exprptr) = ealloc(); (yyval.exprptr)->ex_oper = O_CONST; (yyval.exprptr)->ex_value = (yyvsp[(1) - (1)].lexptr)->lx_u.lxu_value; lfree((yyvsp[(1) - (1)].lexptr)); } break; case 104: #line 864 "gram.y" { (yyval.exprptr) = ealloc(); (yyval.exprptr)->ex_oper = O_IDENT; (yyval.exprptr)->ex_sym = lookup((yyvsp[(1) - (1)].lexptr)->lx_u.lxu_name); lfree((yyvsp[(1) - (1)].lexptr)); } break; /* Line 1267 of yacc.c. */ #line 2888 "gram.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } #line 871 "gram.y" int yyerror (const char *s) { return 0; } /* * tack two queues of stack code together * e1 is connected on the tail of e0 * There is no good way to test for circular * lists, hence the silly count. */ void concat (struct expr *e0, struct expr *e1) { int count; if (e0 == NULL || e1 == NULL) panic ("NULL expression queue"); for (count = 0; e0->ex_next != NULL; e0 = e0->ex_next) if (++count > 10000) panic ("circular expression queue"); e0->ex_next = e1; } /* * print an expression queue * called when EXAMINE is invoked on a variable (see above) */ void prexq (const struct expr *ep) { const char *s; printf (" code:"); if (ep == NULL) putchar ('\n'); for (; ep != NULL; ep = ep->ex_next) { switch (ep->ex_oper) { case O_PLUS: s = "add"; break; case O_MINUS: s = "subtract"; break; case O_MULT: s = "multiply"; break; case O_DIV: s = "divide"; break; case O_POWER: s = "power"; break; case O_SQRT: s = "sqrt"; break; case O_EXP: s = "exp"; break; case O_LOG: s = "log"; break; case O_LOG10: s = "log10"; break; case O_SIN: s = "sin"; break; case O_COS: s = "cos"; break; case O_TAN: s = "cos"; break; case O_ASIN: s = "sin"; break; case O_ACOS: s = "cos"; break; case O_ATAN: s = "cos"; break; case O_NEG: s = "negate"; break; case O_ABS: s = "abs"; break; case O_SINH: s = "sinh"; break; case O_COSH: s = "cosh"; break; case O_TANH: s = "tanh"; break; case O_ASINH: s = "asinh"; break; case O_ACOSH: s = "acosh"; break; case O_ATANH: s = "atanh"; break; case O_SQAR: s = "square"; break; case O_CUBE: s = "cube"; break; case O_INV: s = "invert"; break; case O_FLOOR: s = "floor"; break; case O_CEIL: s = "ceil"; break; case O_J0: s = "besj0"; break; case O_J1: s = "besj1"; break; case O_Y0: s = "besy0"; break; case O_Y1: s = "besy1"; break; case O_ERF: s = "erf"; break; case O_ERFC: s = "erfc"; break; case O_INVERF: s = "inverf"; break; case O_LGAMMA: s = "lgamma"; break; case O_GAMMA: s = "gamma"; break; case O_NORM: s = "norm"; break; case O_INVNORM: s = "invnorm"; break; case O_IGAMMA: s = "igamma"; break; case O_IBETA: s = "ibeta"; break; case O_CONST: printf ("\tpush "); prval (ep->ex_value); putchar ('\n'); s = NULL; break; case O_IDENT: printf ("\tpush \"%.*s\"\n", NAMMAX, ep->ex_sym->sy_name); s = NULL; break; default: s = "unknown!"; } if (s != NULL) printf ("\t%s\n",s); } } plotutils-2.6/ode/gram.h0000644000175000017500000000713111037251767012222 00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUMBER = 258, IDENT = 259, SEP = 260, ABS = 261, SQRT = 262, EXP = 263, LOG = 264, LOG10 = 265, SIN = 266, COS = 267, TAN = 268, ASIN = 269, ACOS = 270, ATAN = 271, SINH = 272, COSH = 273, TANH = 274, ASINH = 275, ACOSH = 276, ATANH = 277, FLOOR = 278, CEIL = 279, J0 = 280, J1 = 281, Y0 = 282, Y1 = 283, LGAMMA = 284, GAMMA = 285, ERF = 286, ERFC = 287, INVERF = 288, NORM = 289, INVNORM = 290, IGAMMA = 291, IBETA = 292, EVERY = 293, FROM = 294, PRINT = 295, STEP = 296, EXAM = 297, UMINUS = 298 }; #endif /* Tokens. */ #define NUMBER 258 #define IDENT 259 #define SEP 260 #define ABS 261 #define SQRT 262 #define EXP 263 #define LOG 264 #define LOG10 265 #define SIN 266 #define COS 267 #define TAN 268 #define ASIN 269 #define ACOS 270 #define ATAN 271 #define SINH 272 #define COSH 273 #define TANH 274 #define ASINH 275 #define ACOSH 276 #define ATANH 277 #define FLOOR 278 #define CEIL 279 #define J0 280 #define J1 281 #define Y0 282 #define Y1 283 #define LGAMMA 284 #define GAMMA 285 #define ERF 286 #define ERFC 287 #define INVERF 288 #define NORM 289 #define INVNORM 290 #define IGAMMA 291 #define IBETA 292 #define EVERY 293 #define FROM 294 #define PRINT 295 #define STEP 296 #define EXAM 297 #define UMINUS 298 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 85 "gram.y" { struct lex *lexptr; struct expr *exprptr; struct prt *prtptr; int simple; } /* Line 1489 of yacc.c. */ #line 142 "gram.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; plotutils-2.6/ode/lex.c0000644000175000017500000015427111037251770012061 00000000000000 #line 3 "lex.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 33 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef unsigned int yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 51 #define YY_END_OF_BUFFER 52 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_acclist[232] = { 0, 52, 50, 51, 3, 50, 51, 4, 51, 49, 50, 51, 50, 51, 50, 51, 46, 50, 51, 4, 50, 51, 45, 50, 51, 45, 50, 51, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 45, 50, 51, 50, 51, 1, 48, 47, 46, 45, 5, 45, 2, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 16, 45, 45, 45, 45, 45, 45, 45, 45, 6, 47, 48, 46, 12, 45, 45, 45, 45, 45, 45, 19, 45, 37, 45, 45, 45, 14, 45, 45, 45, 45, 45, 45, 45, 45, 17, 45, 45, 45, 18, 45, 45, 45, 20, 45, 48, 47, 46, 25, 45, 24, 45, 26, 45, 45, 45, 31, 45, 28, 45, 36, 45, 45, 45, 45, 8, 45, 45, 45, 45, 45, 45, 45, 45, 41, 45, 45, 27, 45, 13, 45, 10, 45, 29, 45, 48, 47, 48, 47, 46, 22, 45, 21, 45, 23, 45, 32, 45, 33, 45, 34, 45, 35, 45, 7, 45, 45, 30, 45, 40, 45, 43, 45, 45, 45, 45, 45, 15, 45, 9, 45, 48, 47, 48, 47, 45, 44, 45, 38, 45, 45, 39, 45, 47, 48, 11, 45, 42, 45 } ; static yyconst flex_int16_t yy_accept[160] = { 0, 1, 1, 1, 2, 4, 7, 9, 12, 14, 16, 19, 22, 25, 28, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 68, 68, 69, 70, 71, 72, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 103, 105, 105, 105, 106, 108, 109, 110, 111, 112, 113, 115, 117, 118, 119, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 132, 134, 135, 136, 138, 138, 139, 139, 139, 140, 141, 143, 145, 147, 148, 149, 151, 153, 155, 156, 157, 158, 160, 161, 162, 163, 164, 165, 166, 167, 169, 170, 172, 174, 176, 178, 179, 179, 181, 182, 183, 185, 187, 189, 191, 193, 195, 197, 199, 200, 202, 204, 206, 207, 208, 209, 210, 212, 214, 215, 217, 218, 219, 221, 223, 224, 226, 228, 230, 232, 232 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 1, 5, 1, 1, 1, 4, 4, 4, 4, 6, 4, 6, 7, 4, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 1, 11, 1, 4, 1, 4, 1, 12, 12, 12, 12, 13, 12, 12, 12, 14, 12, 12, 12, 12, 12, 12, 15, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 16, 1, 4, 12, 1, 17, 18, 19, 12, 20, 21, 22, 23, 24, 25, 12, 26, 27, 28, 29, 30, 31, 32, 33, 34, 12, 35, 12, 36, 37, 12, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[38] = { 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 } ; static yyconst flex_int16_t yy_base[161] = { 0, 0, 219, 225, 227, 227, 227, 227, 221, 30, 34, 227, 0, 209, 219, 27, 201, 28, 17, 24, 203, 37, 40, 190, 186, 39, 200, 68, 213, 227, 71, 77, 0, 86, 0, 0, 227, 182, 185, 189, 195, 178, 186, 176, 187, 187, 34, 177, 176, 177, 183, 185, 166, 183, 0, 177, 166, 173, 168, 163, 174, 165, 227, 92, 95, 101, 104, 108, 0, 159, 163, 162, 94, 163, 165, 168, 154, 158, 0, 155, 156, 155, 147, 153, 38, 152, 169, 150, 148, 152, 140, 143, 149, 112, 115, 120, 124, 127, 130, 148, 147, 146, 66, 74, 0, 0, 0, 131, 143, 134, 0, 148, 147, 136, 130, 132, 133, 151, 0, 124, 0, 0, 0, 0, 133, 136, 139, 142, 227, 0, 0, 0, 0, 0, 0, 0, 0, 99, 0, 0, 0, 89, 78, 61, 72, 0, 0, 227, 145, 227, 68, 0, 0, 45, 0, 227, 0, 0, 227, 155, 65 } ; static yyconst flex_int16_t yy_def[161] = { 0, 158, 1, 158, 158, 158, 158, 158, 159, 158, 158, 158, 160, 160, 158, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 158, 159, 158, 158, 158, 10, 158, 160, 160, 158, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 158, 158, 158, 158, 158, 158, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 158, 158, 158, 158, 158, 158, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 158, 158, 158, 158, 158, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 158, 158, 158, 160, 160, 160, 160, 160, 158, 160, 160, 0, 158, 158 } ; static yyconst flex_int16_t yy_nxt[265] = { 0, 4, 5, 6, 7, 8, 7, 9, 10, 10, 10, 11, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 21, 12, 22, 12, 23, 12, 24, 12, 12, 25, 26, 12, 12, 12, 30, 30, 30, 31, 32, 32, 32, 37, 38, 33, 42, 44, 47, 77, 45, 46, 33, 50, 48, 43, 114, 51, 39, 40, 53, 58, 78, 52, 115, 34, 54, 55, 59, 62, 157, 60, 132, 133, 30, 30, 30, 30, 30, 30, 134, 135, 63, 64, 64, 64, 156, 154, 65, 63, 66, 153, 67, 67, 67, 65, 93, 152, 94, 94, 94, 64, 64, 64, 151, 96, 95, 97, 97, 97, 67, 67, 67, 95, 98, 98, 98, 102, 94, 94, 94, 124, 124, 124, 125, 150, 126, 126, 126, 103, 97, 97, 97, 127, 127, 127, 128, 128, 128, 147, 147, 147, 126, 126, 126, 148, 148, 148, 149, 149, 149, 155, 155, 155, 28, 28, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 131, 130, 129, 123, 122, 121, 120, 119, 118, 117, 116, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 101, 100, 99, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 76, 75, 74, 73, 72, 71, 70, 69, 68, 29, 61, 57, 56, 49, 41, 36, 35, 29, 158, 27, 3, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158 } ; static yyconst flex_int16_t yy_chk[265] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 10, 10, 10, 10, 15, 15, 10, 17, 18, 19, 46, 18, 18, 10, 21, 19, 17, 84, 21, 15, 15, 22, 25, 46, 21, 84, 160, 22, 22, 25, 27, 153, 25, 102, 102, 27, 27, 27, 30, 30, 30, 103, 103, 30, 31, 31, 31, 150, 144, 31, 30, 33, 143, 33, 33, 33, 31, 63, 142, 63, 63, 63, 64, 64, 64, 141, 65, 64, 65, 65, 65, 66, 66, 66, 64, 67, 67, 67, 72, 93, 93, 93, 94, 94, 94, 95, 137, 95, 95, 95, 72, 96, 96, 96, 97, 97, 97, 98, 98, 98, 124, 124, 124, 125, 125, 125, 126, 126, 126, 127, 127, 127, 148, 148, 148, 159, 159, 119, 117, 116, 115, 114, 113, 112, 111, 109, 108, 107, 101, 100, 99, 92, 91, 90, 89, 88, 87, 86, 85, 83, 82, 81, 80, 79, 77, 76, 75, 74, 73, 71, 70, 69, 61, 60, 59, 58, 57, 56, 55, 53, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 40, 39, 38, 37, 28, 26, 24, 23, 20, 16, 14, 13, 8, 3, 2, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158 } ; extern int yy_flex_debug; int yy_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; #define REJECT \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ ++(yy_lp); \ goto find_rule; \ } #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lex.l" #line 3 "lex.l" /* * Copyright Nicholas B. Tufillaro, 1982-1994. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free * Software Foundation, Inc. */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #include "gram.h" int curline = 1; #line 607 "lex.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 18 "lex.l" #line 765 "lex.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 159 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 227 ); yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[(yy_lp)]; { (yy_full_match) = yy_cp; break; } } --yy_cp; yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 19 "lex.l" ; /* N.B.: comments can't be continued */ YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP #line 20 "lex.l" { curline++; } YY_BREAK case 3: YY_RULE_SETUP #line 23 "lex.l" ; YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP #line 24 "lex.l" { yylval.lexptr = lalloc(); yylval.lexptr->lx_lino = curline; if (*yytext == '\n') curline++; return SEP; } YY_BREAK case 5: YY_RULE_SETUP #line 31 "lex.l" { yylval.lexptr = lalloc(); yylval.lexptr->lx_u.lxu_value = M_PI; return NUMBER; } YY_BREAK case 6: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 36 "lex.l" { /* lonely . isn't EOF in a -f file */ if (yyin == stdin) return EOF; REJECT; } YY_BREAK case 7: YY_RULE_SETUP #line 42 "lex.l" { return EVERY; } YY_BREAK case 8: YY_RULE_SETUP #line 43 "lex.l" { return FROM; } YY_BREAK case 9: YY_RULE_SETUP #line 44 "lex.l" { return PRINT; } YY_BREAK case 10: YY_RULE_SETUP #line 45 "lex.l" { return STEP; } YY_BREAK case 11: YY_RULE_SETUP #line 46 "lex.l" { return EXAM; } YY_BREAK case 12: YY_RULE_SETUP #line 47 "lex.l" { return ABS; } YY_BREAK case 13: YY_RULE_SETUP #line 48 "lex.l" { return SQRT; } YY_BREAK case 14: YY_RULE_SETUP #line 49 "lex.l" { return EXP; } YY_BREAK case 15: YY_RULE_SETUP #line 50 "lex.l" { return LOG10; } YY_BREAK case 16: YY_RULE_SETUP #line 51 "lex.l" { return LOG; } YY_BREAK case 17: YY_RULE_SETUP #line 52 "lex.l" { return LOG; } YY_BREAK case 18: YY_RULE_SETUP #line 53 "lex.l" { return SIN; } YY_BREAK case 19: YY_RULE_SETUP #line 54 "lex.l" { return COS; } YY_BREAK case 20: YY_RULE_SETUP #line 55 "lex.l" { return TAN; } YY_BREAK case 21: YY_RULE_SETUP #line 56 "lex.l" { return ASINH; } YY_BREAK case 22: YY_RULE_SETUP #line 57 "lex.l" { return ACOSH; } YY_BREAK case 23: YY_RULE_SETUP #line 58 "lex.l" { return ATANH; } YY_BREAK case 24: YY_RULE_SETUP #line 59 "lex.l" { return ASIN; } YY_BREAK case 25: YY_RULE_SETUP #line 60 "lex.l" { return ACOS; } YY_BREAK case 26: YY_RULE_SETUP #line 61 "lex.l" { return ATAN; } YY_BREAK case 27: YY_RULE_SETUP #line 62 "lex.l" { return SINH; } YY_BREAK case 28: YY_RULE_SETUP #line 63 "lex.l" { return COSH; } YY_BREAK case 29: YY_RULE_SETUP #line 64 "lex.l" { return TANH; } YY_BREAK case 30: YY_RULE_SETUP #line 65 "lex.l" { return FLOOR; } YY_BREAK case 31: YY_RULE_SETUP #line 66 "lex.l" { return CEIL; } YY_BREAK case 32: YY_RULE_SETUP #line 67 "lex.l" { return J0; } YY_BREAK case 33: YY_RULE_SETUP #line 68 "lex.l" { return J1; } YY_BREAK case 34: YY_RULE_SETUP #line 69 "lex.l" { return Y0; } YY_BREAK case 35: YY_RULE_SETUP #line 70 "lex.l" { return Y1; } YY_BREAK case 36: YY_RULE_SETUP #line 71 "lex.l" { return ERFC; } YY_BREAK case 37: YY_RULE_SETUP #line 72 "lex.l" { return ERF; } YY_BREAK case 38: YY_RULE_SETUP #line 73 "lex.l" { return INVERF; } YY_BREAK case 39: YY_RULE_SETUP #line 74 "lex.l" { return LGAMMA; } YY_BREAK case 40: YY_RULE_SETUP #line 75 "lex.l" { return GAMMA; } YY_BREAK case 41: YY_RULE_SETUP #line 76 "lex.l" { return NORM; } YY_BREAK case 42: YY_RULE_SETUP #line 77 "lex.l" { return INVNORM; } YY_BREAK case 43: YY_RULE_SETUP #line 78 "lex.l" { return IBETA; } YY_BREAK case 44: YY_RULE_SETUP #line 79 "lex.l" { return IGAMMA; } YY_BREAK case 45: YY_RULE_SETUP #line 80 "lex.l" { yylval.lexptr = lalloc(); strncpy(yylval.lexptr->lx_u.lxu_name,yytext,NAMMAX); return IDENT; } YY_BREAK case 46: #line 86 "lex.l" case 47: #line 87 "lex.l" case 48: YY_RULE_SETUP #line 87 "lex.l" { /* * restrictions on numbers: * radix 10 only * a bare Expo isn't enough (matches IDENT) */ yylval.lexptr = lalloc(); yylval.lexptr->lx_u.lxu_value = atof(yytext); return NUMBER; } YY_BREAK case 49: YY_RULE_SETUP #line 97 "lex.l" { /* * accept as few as possible so the error * message can be a smart one */ return yytext[0]; } YY_BREAK case 50: YY_RULE_SETUP #line 104 "lex.l" { if (*yytext > '~' || *yytext < ' ') fprintf (stderr, "%s:%s:%d: bad char '\\%02o'\n", progname, filename, curline, *yytext&0377); else fprintf (stderr, "%s:%s:%d: bad char '%c'\n", progname, filename, curline, *yytext); return *yytext; } YY_BREAK case 51: YY_RULE_SETUP #line 117 "lex.l" ECHO; YY_BREAK #line 1161 "lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 159 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 159 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 158); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; yyfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 117 "lex.l" /* * space management for the lexer */ struct lex * lalloc (void) { struct lex *lp; lp = (struct lex *)xmalloc (sizeof(struct lex)); lp->lx_u.lxu_value = 0.0; lp->lx_lino = 0; return lp; } void lfree (struct lex *lp) { if (lp != NULL) free ((void *)lp); } plotutils-2.6/ode/am.c0000644000175000017500000000601411037240516011651 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 2005, 2008, Free Software * Foundation, Inc. */ /* * Adams-Moulton with constant step size */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #define PASTVAL (3) /* previous values, val[0] is current value */ void am (void) { double t; double halfstep = HALF * tstep; double sconst = tstep / 24.0; /* step constant */ double onesixth = 1.0 / 6.0; /* Runge-Kutta startup */ for (it = 0, t = tstart; it <= PASTVAL && !STOPR; t = tstart + (++it) * tstep) { symtab->sy_value = symtab->sy_val[0] = t; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { int j; for (j = it; j > 0; j--) { fsp->sy_val[j] = fsp->sy_val[j-1]; fsp->sy_pri[j] = fsp->sy_pri[j-1]; } fsp->sy_pri[0] = fsp->sy_prime; fsp->sy_val[0] = fsp->sy_value; } /* output */ printq(); if (it == PASTVAL) break; /* startup complete */ for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[0] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + HALF * fsp->sy_k[0]; } symtab->sy_value = t + halfstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[1] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + HALF * fsp->sy_k[1]; } symtab->sy_value = t + halfstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[2] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + fsp->sy_k[2]; } symtab->sy_value = t + tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_k[3] = tstep * fsp->sy_prime; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_value = fsp->sy_val[0] + onesixth * (fsp->sy_k[0] + TWO * fsp->sy_k[1] + TWO * fsp->sy_k[2] + fsp->sy_k[3]); } } /* predictor - corrector */ while (!STOPA) { /* Adams-Bashforth predictor */ for (fsp = dqueue; fsp != NULL ; fsp = fsp->sy_link) { fsp->sy_value = fsp->sy_val[0] + (sconst) * (55 * fsp->sy_pri[0] -59 * fsp->sy_pri[1] +37 * fsp->sy_pri[2] -9 * fsp->sy_pri[3]); } symtab->sy_val[0] = symtab->sy_value = t = tstart + (++it) * tstep; field(); /* Adams-Moulton corrector */ for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_value = fsp->sy_val[0] + (sconst) * (9 * fsp->sy_prime +19 * fsp->sy_pri[0] -5 * fsp->sy_pri[1] + fsp->sy_pri[2]); } field(); /* cycle indices */ for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { int j; for (j = PASTVAL; j > 0; j--) { fsp->sy_val[j] = fsp->sy_val[j-1]; fsp->sy_pri[j] = fsp->sy_pri[j-1]; } fsp->sy_val[0] = fsp->sy_value; fsp->sy_pri[0] = fsp->sy_prime; } /* output */ printq(); } } plotutils-2.6/ode/ama.c0000644000175000017500000001400711037240511012006 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 2005, 2008, Free Software * Foundation, Inc. */ /* * Adams-Moulton with adaptive step size */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #include "num.h" #define PASTVAL (3) /* past values, val[0] is current value */ #define T_LT_TSTOP (tstep>0 ? ttstop) #define NEARSTOP (tstep > 0 ? \ t+0.9375*tstep > tstop && t+0.0625*tstep < tstop : \ t+0.9375*tstep < tstop && t+0.0625*tstep > tstop) void ama (void) { bool gdval = true; /* good value to print ? */ int overtime = 1; long startit = 0; double prevstep = 0.0; double t = tstart; top: /* fifth-order Runge-Kutta startup */ it = startit; while (it <= startit + PASTVAL&&(T_LT_TSTOP || overtime--)) { symtab->sy_value = t; field(); if (gdval) { for (fsp = symtab; fsp != NULL; fsp = fsp->sy_link) { int j; for (j = it - startit; j > 0; j--) { fsp->sy_val[j] = fsp->sy_val[j-1]; fsp->sy_pri[j] = fsp->sy_pri[j-1]; } fsp->sy_val[0] = fsp->sy_value; fsp->sy_pri[0] = fsp->sy_prime; } printq(); /* output */ if (it == startit + PASTVAL) break; /* startup complete */ } if (tstep * (t+tstep-tstop) > 0) tstep = tstop - t; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[0] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + C20 * fsp->sy_k[0]; } symtab->sy_value = t + C2t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[1] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + C30 * fsp->sy_k[0] + C31 * fsp->sy_k[1]; } symtab->sy_value = t + C3t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[2] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + (C40 * fsp->sy_k[0] + C41 * fsp->sy_k[1] + C42 * fsp->sy_k[2]); } symtab->sy_value = t + C4t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[3] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + (C50 * fsp->sy_k[0] + C51 * fsp->sy_k[1] + C52 * fsp->sy_k[2] + C53 * fsp->sy_k[3]); } symtab->sy_value = t + tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[4] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + (C60 * fsp->sy_k[0] + C61 * fsp->sy_k[1] + C62 * fsp->sy_k[2] + C63 * fsp->sy_k[3] + C64 * fsp->sy_k[4]); } symtab->sy_value = t + C6t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_k[5] = tstep * fsp->sy_prime; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_predi = fsp->sy_val[0] + (A0 * fsp->sy_k[0] + A2 * fsp->sy_k[2] + A3 * fsp->sy_k[3] + A4 * fsp->sy_k[4]); fsp->sy_value = fsp->sy_val[0] + (B0 * fsp->sy_k[0] + B2 * fsp->sy_k[2] + B3 * fsp->sy_k[3] + B4 * fsp->sy_k[4] + B5 * fsp->sy_k[5]); if (fsp->sy_value != 0.0) fsp->sy_sserr = fabs(1.0 - fsp->sy_predi / fsp->sy_value); fsp->sy_aberr = fabs(fsp->sy_value - fsp->sy_predi); } if (!conflag && T_LT_TSTOP) { maxerr(); if (hierror()) { tstep *= HALF; for (fsp = symtab; fsp != NULL; fsp = fsp->sy_link) fsp->sy_value = fsp->sy_val[0]; gdval = false; continue; } else if (lowerror() && prevstep != tstep) { prevstep = tstep; /* prevent infinite loops */ tstep *= 2.0; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_value = fsp->sy_val[0]; gdval = false; continue; } } gdval = true; ++it; t += tstep; /* the roundoff error is gross */ } /* predictor - corrector */ while (T_LT_TSTOP ) { /* Adams-Bashforth predictor */ if (tstep*(t+tstep-tstop) > 0) { startit = it; goto top; } for (fsp = dqueue; fsp != NULL ; fsp = fsp->sy_link) { fsp->sy_predi = fsp->sy_value = fsp->sy_val[0] + tstep/24.0 * (55 * fsp->sy_pri[0] -59 * fsp->sy_pri[1] +37 * fsp->sy_pri[2] -9 * fsp->sy_pri[3]); } ++it; symtab->sy_value = t += tstep; /* the roundoff error is gross */ field(); /* Adams-Moulton corrector */ for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_value = fsp->sy_val[0] + tstep/24.0 * (9 * fsp->sy_prime +19 * fsp->sy_pri[0] -5 * fsp->sy_pri[1] + fsp->sy_pri[2]); if (fsp->sy_value != 0.0) fsp->sy_sserr = ECONST * fabs(1.0 - fsp->sy_predi / fsp->sy_value); fsp->sy_aberr = ECONST * fabs (fsp->sy_value - fsp->sy_predi); fsp->sy_value += ECONST * (fsp->sy_predi - fsp->sy_value); } if (!conflag) { maxerr(); if (hierror()) { tstep *= HALF; t = symtab->sy_val[0]; for (fsp = symtab; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_value = fsp->sy_val[0]; fsp->sy_prime = fsp->sy_pri[0]; } startit = --it; gdval = false; goto top; } else if (lowerror()) { tstep *= TWO; t = symtab->sy_val[0]; for (fsp = symtab; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_value = fsp->sy_val[0]; fsp->sy_prime = fsp->sy_pri[0]; } startit = --it; gdval = false; goto top; } } field(); /* cycle indices */ for (fsp = symtab; fsp != NULL; fsp = fsp->sy_link) { int j; for (j = PASTVAL; j > 0; j--) { fsp->sy_val[j] = fsp->sy_val[j-1]; fsp->sy_pri[j] = fsp->sy_pri[j-1]; } fsp->sy_val[0] = fsp->sy_value; fsp->sy_pri[0] = fsp->sy_prime; } /* output */ printq(); } } plotutils-2.6/ode/bessel.c0000644000175000017500000002671310346055342012544 00000000000000/* This file is part of the GNU plotutils package. */ /* Bessel function approximations, as given in the book "Computer * Approximations" by Hart, Cheney et al., Wiley, 1968. Taken in part from * the file standard.c in the gnuplot 3.5 distribution. */ #include "sys-defines.h" #include "ode.h" #include "extern.h" /* * Copyright (C) 1986 - 1993 Thomas Williams, Colin Kelley * * Permission to use, copy, and distribute this software and its * documentation for any purpose with or without fee is hereby granted, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. */ /* * AUTHORS * * Original Software: * Thomas Williams, Colin Kelley. * * Gnuplot 2.0 additions: * Russell Lang, Dave Kotz, John Campbell. * * Gnuplot 3.0 additions: * Gershon Elber and many others. * */ /* * There appears to be a mistake in Hart, Cheney et al. on page 149. * Where it lists Qn(x)/x ~ P(z*z)/Q(z*z), z = 8/x, it should read * Qn(x)/z ~ P(z*z)/Q(z*z), z = 8/x * In the functions below, Qn(x) is implemented using the later * equation. * These Bessel functions are accurate to about 1e-13. */ #ifndef HAVE_J0 #define PI_ON_FOUR 0.78539816339744830961566084581987572 #define PI_ON_TWO 1.57079632679489661923131269163975144 #define THREE_PI_ON_FOUR 2.35619449019234492884698253745962716 #define TWO_ON_PI 0.63661977236758134307553505349005744 static const double dzero = 0.0; /* jzero for x in [0,8] * Index 5849, 19.22 digits precision */ static const double pjzero[9] = { 0.4933787251794133561816813446e+21, -0.11791576291076105360384408e+21, 0.6382059341072356562289432465e+19, -0.1367620353088171386865416609e+18, 0.1434354939140346111664316553e+16, -0.8085222034853793871199468171e+13, 0.2507158285536881945555156435e+11, -0.4050412371833132706360663322e+8, 0.2685786856980014981415848441e+5 }; static const double qjzero[9] = { 0.4933787251794133562113278438e+21, 0.5428918384092285160200195092e+19, 0.3024635616709462698627330784e+17, 0.1127756739679798507056031594e+15, 0.3123043114941213172572469442e+12, 0.669998767298223967181402866e+9, 0.1114636098462985378182402543e+7, 0.1363063652328970604442810507e+4, 0.1e+1 }; /* pzero for x in [8,inf] * Index 6548, 18.16 digits precision */ static const double ppzero[6] = { 0.2277909019730468430227002627e+5, 0.4134538663958076579678016384e+5, 0.2117052338086494432193395727e+5, 0.348064864432492703474453111e+4, 0.15376201909008354295771715e+3, 0.889615484242104552360748e+0 }; static const double qpzero[6] = { 0.2277909019730468431768423768e+5, 0.4137041249551041663989198384e+5, 0.2121535056188011573042256764e+5, 0.350287351382356082073561423e+4, 0.15711159858080893649068482e+3, 0.1e+1 }; /* qzero for x in [8,inf] * Index 6948, 18.33 digits precision */ static const double pqzero[6] = { -0.8922660020080009409846916e+2, -0.18591953644342993800252169e+3, -0.11183429920482737611262123e+3, -0.2230026166621419847169915e+2, -0.124410267458356384591379e+1, -0.8803330304868075181663e-2, }; static const double qqzero[6] = { 0.571050241285120619052476459e+4, 0.1195113154343461364695265329e+5, 0.726427801692110188369134506e+4, 0.148872312322837565816134698e+4, 0.9059376959499312585881878e+2, 0.1e+1 }; /* yzero for x in [0,8] * Index 6245, 18.78 digits precision */ static const double pyzero[9] = { -0.2750286678629109583701933175e+20, 0.6587473275719554925999402049e+20, -0.5247065581112764941297350814e+19, 0.1375624316399344078571335453e+18, -0.1648605817185729473122082537e+16, 0.1025520859686394284509167421e+14, -0.3436371222979040378171030138e+11, 0.5915213465686889654273830069e+8, -0.4137035497933148554125235152e+5 }; static const double qyzero[9] = { 0.3726458838986165881989980739e+21, 0.4192417043410839973904769661e+19, 0.2392883043499781857439356652e+17, 0.9162038034075185262489147968e+14, 0.2613065755041081249568482092e+12, 0.5795122640700729537380087915e+9, 0.1001702641288906265666651753e+7, 0.1282452772478993804176329391e+4, 0.1e+1 }; /* jone for x in [0,8] * Index 6050, 20.98 digits precision */ static const double pjone[9] = { 0.581199354001606143928050809e+21, -0.6672106568924916298020941484e+20, 0.2316433580634002297931815435e+19, -0.3588817569910106050743641413e+17, 0.2908795263834775409737601689e+15, -0.1322983480332126453125473247e+13, 0.3413234182301700539091292655e+10, -0.4695753530642995859767162166e+7, 0.270112271089232341485679099e+4 }; static const double qjone[9] = { 0.11623987080032122878585294e+22, 0.1185770712190320999837113348e+20, 0.6092061398917521746105196863e+17, 0.2081661221307607351240184229e+15, 0.5243710262167649715406728642e+12, 0.1013863514358673989967045588e+10, 0.1501793594998585505921097578e+7, 0.1606931573481487801970916749e+4, 0.1e+1 }; /* pone for x in [8,inf] * Index 6749, 18.11 digits precision */ static const double ppone[6] = { 0.352246649133679798341724373e+5, 0.62758845247161281269005675e+5, 0.313539631109159574238669888e+5, 0.49854832060594338434500455e+4, 0.2111529182853962382105718e+3, 0.12571716929145341558495e+1 }; static const double qpone[6] = { 0.352246649133679798068390431e+5, 0.626943469593560511888833731e+5, 0.312404063819041039923015703e+5, 0.4930396490181088979386097e+4, 0.2030775189134759322293574e+3, 0.1e+1 }; /* qone for x in [8,inf] * Index 7149, 18.28 digits precision */ static const double pqone[6] = { 0.3511751914303552822533318e+3, 0.7210391804904475039280863e+3, 0.4259873011654442389886993e+3, 0.831898957673850827325226e+2, 0.45681716295512267064405e+1, 0.3532840052740123642735e-1 }; static const double qqone[6] = { 0.74917374171809127714519505e+4, 0.154141773392650970499848051e+5, 0.91522317015169922705904727e+4, 0.18111867005523513506724158e+4, 0.1038187585462133728776636e+3, 0.1e+1 }; /* yone for x in [0,8] * Index 6444, 18.24 digits precision */ static const double pyone[8] = { -0.2923821961532962543101048748e+20, 0.7748520682186839645088094202e+19, -0.3441048063084114446185461344e+18, 0.5915160760490070618496315281e+16, -0.4863316942567175074828129117e+14, 0.2049696673745662182619800495e+12, -0.4289471968855248801821819588e+9, 0.3556924009830526056691325215e+6 }; static const double qyone[9] = { 0.1491311511302920350174081355e+21, 0.1818662841706134986885065935e+19, 0.113163938269888452690508283e+17, 0.4755173588888137713092774006e+14, 0.1500221699156708987166369115e+12, 0.3716660798621930285596927703e+9, 0.726914730719888456980191315e+6, 0.10726961437789255233221267e+4, 0.1e+1 }; /* Bessel function approximations */ double jzero (double x) { double p, q, x2; int n; x2 = x * x; p = pjzero[8]; q = qjzero[8]; for (n=7; n>=0; n--) { p = p*x2 + pjzero[n]; q = q*x2 + qjzero[n]; } return (p/q); } static double pzero (double x) { double p, q, z, z2; int n; z = 8.0 / x; z2 = z * z; p = ppzero[5]; q = qpzero[5]; for (n=4; n>=0; n--) { p = p*z2 + ppzero[n]; q = q*z2 + qpzero[n]; } return (p/q); } static double qzero (double x) { double p, q, z, z2; int n; z = 8.0 / x; z2 = z * z; p = pqzero[5]; q = qqzero[5]; for (n=4; n>=0; n--) { p = p*z2 + pqzero[n]; q = q*z2 + qqzero[n]; } return (p/q); } static double yzero (double x) { double p, q, x2; int n; x2 = x * x; p = pyzero[8]; q = qyzero[8]; for (n=7; n>=0; n--) { p = p*x2 + pyzero[n]; q = q*x2 + qyzero[n]; } return p/q; } double j0 (double x) { if (x <= 0.0) x = -x; if (x < 8.0) return jzero(x); else return (sqrt(TWO_ON_PI/x) * (pzero(x) * cos (x - PI_ON_FOUR) - 8.0/x * qzero(x) * sin (x - PI_ON_FOUR))); } double y0 (double x) { if (x < 0.0) return (dzero/dzero); /* IEEE machines: invalid operation */ if (x < 8.0) return yzero(x) + TWO_ON_PI * j0(x) * log(x); else return (sqrt (TWO_ON_PI/x) * (pzero(x) * sin (x - PI_ON_FOUR) + (8.0/x) * qzero(x) * cos(x - PI_ON_FOUR))); } static double jone (double x) { double p, q, x2; int n; x2 = x * x; p = pjone[8]; q = qjone[8]; for (n=7; n>=0; n--) { p = p*x2 + pjone[n]; q = q*x2 + qjone[n]; } return (p/q); } static double pone (double x) { double p, q, z, z2; int n; z = 8.0 / x; z2 = z * z; p = ppone[5]; q = qpone[5]; for (n=4; n>=0; n--) { p = p*z2 + ppone[n]; q = q*z2 + qpone[n]; } return (p/q); } static double qone (double x) { double p, q, z, z2; int n; z = 8.0 / x; z2 = z * z; p = pqone[5]; q = qqone[5]; for (n=4; n>=0; n--) { p = p*z2 + pqone[n]; q = q*z2 + qqone[n]; } return p/q; } static double yone (double x) { double p, q, x2; int n; x2 = x * x; p = 0.0; q = qyone[8]; for (n=7; n>=0; n--) { p = p*x2 + pyone[n]; q = q*x2 + qyone[n]; } return p/q; } double j1 (double x) { double v,w; v = x; if (x < 0.0) x = -x; if (x < 8.0) return v * jone(x); else { w = (sqrt(TWO_ON_PI/x) * (pone(x) * cos(x - THREE_PI_ON_FOUR) - 8.0 / x * qone(x) * sin (x - THREE_PI_ON_FOUR))); if (v < 0.0) w = -w; return w; } } double y1 (double x) { if (x <= 0.0) return (dzero/dzero); /* IEEE machines: invalid operation */ if (x < 8.0) return x * yone(x) + TWO_ON_PI * (j1(x) * log(x) - 1.0/x); else return (sqrt(TWO_ON_PI/x) * (pone(x) * sin (x - THREE_PI_ON_FOUR) + (8.0/x) * qone(x) * cos(x - THREE_PI_ON_FOUR))); } /* Computation of jn(n,x), i.e., a Bessel function of arbitrary non-negative index, is as follows. For n=0, j0() is called. For n=1, j1() is called. For nx, a continued fraction approximation to jn(n,x)/jn(n-1,x) is evaluated, and then backward recursion is used starting from a supposed value for jn(n,x). The resulting value of jn(0,x) is compared with the actual value, to correct the supposed value of jn(n,x). Computation of yn(n,x) is similar in all respects, except that forward recursion is used for all positive values of n. */ double jn (int n, double x) { int i; if (n < 0) { n = -n; x = -x; } if (n == 0) return j0(x); if (n == 1) return j1(x); if (x == 0.0) return 0.0; if (n <= x) { double a = j0(x), b = j1(x), tmp; for (i = 1; i < n; i++) { tmp = b; b = (2.0*i / x) * b - a; a = tmp; } return b; } else /* n > x */ { double a, b, xsq, t, tmp; xsq = x*x; for (t=0, i=n+16; i > n; i--) t = xsq / (2.0*i - t); t = x / (2.0*n - t); a = t; b = 1.0; for (i = n - 1; i > 0; i--) { tmp = b; b = (2.0*i / x ) * b - a; a = tmp; } return t*j0(x)/b; } } double yn (int n, double x) { int i, sign; double a, b, tmp; if (x <= 0) return (dzero/dzero); /* IEEE machines: invalid operation */ sign = 1; if (n < 0) { n = -n; if (n%2 == 1) sign = -1; } if (n == 0) return y0(x); if (n == 1) return sign*y1(x); a = y0(x); b = y1(x); for (i = 1; isy_value = symtab->sy_val[0] = t; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_val[0] = fsp->sy_value; fsp->sy_pri[0] = fsp->sy_prime; } printq(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_value = fsp->sy_val[0] + tstep * fsp->sy_prime; } } /* * if tstart == tstop, i.e., step nowhere, then just print current values */ void trivial (void) { symtab->sy_value = symtab->sy_val[0] = tstart; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_val[0] = fsp->sy_value; fsp->sy_pri[0] = fsp->sy_prime; } printq(); } plotutils-2.6/ode/expr.c0000644000175000017500000000667211037240545012246 00000000000000/* This file is part of the GNU plotutils package. */ /* * * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free * Software Foundation, Inc. */ /* * expression tree evaluator and expression space management routines */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #define NSTACK 30 double stack[NSTACK]; double eval (const struct expr *ep) { double *sp; double tmp, tmp2; for (sp = &stack[NSTACK]; ep != NULL; ep = ep->ex_next) { #ifdef DEBUG if (sp > &stack[NSTACK]) panic ("expression stack underflow"); #endif if (sp <= stack) panic ("stack overflow -- bump NSTACK and recompile"); switch (ep->ex_oper) { case O_CONST: *--sp = ep->ex_value; break; case O_IDENT: *--sp = ep->ex_sym->sy_value; break; case O_PLUS: tmp = *sp++; *sp += tmp; break; case O_MINUS: tmp = *sp++; *sp -= tmp; break; case O_MULT: tmp = *sp++; *sp *= tmp; break; case O_DIV: tmp = *sp++; *sp /= tmp; break; case O_POWER: tmp = *sp++; if ((tmp != (int)tmp) && (*sp < 0)) rterror("negative number to non-integer power"); *sp = pow(*sp,tmp); break; case O_SQAR: *sp *= *sp; break; case O_CUBE: *sp *= *sp * *sp; break; case O_INV: *sp = 1. / *sp; break; case O_SQRT: if (*sp < 0) rterror("square root of a negative number"); *sp = sqrt(*sp); break; case O_SIN: *sp = sin(*sp); break; case O_COS: *sp = cos(*sp); break; case O_TAN: *sp = tan(*sp); break; case O_ASIN: *sp = asin(*sp); break; case O_ACOS: *sp = acos(*sp); break; case O_ATAN: *sp = atan(*sp); break; case O_ABS: if (*sp < 0) *sp = -*sp; break; case O_EXP: *sp = exp(*sp); break; case O_LOG: if (*sp <= 0) rterror("logarithm of non-positive number"); *sp = log(*sp); break; case O_LOG10: if (*sp <= 0) rterror("logarithm of non-positive number"); *sp = log10(*sp); break; case O_SINH: *sp = sinh(*sp); break; case O_COSH: *sp = cosh(*sp); break; case O_TANH: *sp = tanh(*sp); break; case O_ASINH: *sp = asinh(*sp); break; case O_ACOSH: *sp = acosh(*sp); break; case O_ATANH: *sp = atanh(*sp); break; case O_FLOOR: *sp = floor(*sp); break; case O_CEIL: *sp = ceil(*sp); break; case O_J0: *sp = j0(*sp); break; case O_J1: *sp = j1(*sp); break; case O_Y0: *sp = y0(*sp); break; case O_GAMMA: *sp = f_gamma(*sp); break; case O_LGAMMA: *sp = F_LGAMMA(*sp); break; case O_ERFC: *sp = erfc(*sp); break; case O_ERF: *sp = erf(*sp); break; case O_INVERF: *sp = inverf(*sp); break; case O_NORM: *sp = norm(*sp); break; case O_INVNORM: *sp = invnorm(*sp); break; case O_NEG: *sp = -*sp; break; case O_IGAMMA: tmp = *sp++; *sp = igamma(*sp, tmp); break; case O_IBETA: tmp2 = *sp++; tmp = *sp++; *sp = ibeta(*sp, tmp, tmp2); break; default: panicn ("bad op spec (%d) in eval()", (int)(ep->ex_oper)); } } return *sp; } struct expr * ealloc (void) { struct expr *ep; ep = (struct expr *)xmalloc (sizeof(struct expr)); ep->ex_next = NULL; ep->ex_sym = NULL; ep->ex_oper = O_NOOP; /* default */ return ep; } void efree (struct expr *ep) { if (ep == NULL || ep == &exprzero || ep == &exprone) return; efree (ep->ex_next); free ((void *)ep); } plotutils-2.6/ode/float.c0000644000175000017500000000121111037240570012353 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 2005, 2008, Free Software * Foundation, Inc. */ #include "sys-defines.h" #include #include "ode.h" #include "extern.h" /* * arithmetic exceptions (e.g., floating point errors) come here */ RETSIGTYPE fptrap (int sig) { rterror ("arithmetic exception"); } void setflt (void) { if (signal (SIGFPE, SIG_IGN) != SIG_IGN) signal (SIGFPE, fptrap); } void resetflt (void) { if (signal (SIGFPE, SIG_IGN) != SIG_IGN) signal (SIGFPE, SIG_DFL); } plotutils-2.6/ode/global.c0000644000175000017500000000267611233722063012526 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 2005, 2008, 2009, Free Software * Foundation, Inc. */ /* * definitions of global variables for ode. */ #include "sys-defines.h" #include "ode.h" #include "extern.h" /* defined and initialized */ const char *progname = "ode"; /* name of this program */ const char *written = "Written by Nicholas B. Tufillaro and Robert S. Maier."; const char *copyright = "Copyright (C) 1994 Nicholas B. Tufillaro,\nCopyright (C) 2009 Free Software Foundation, Inc."; int prec = -1; long it = 0; double hmin = HMIN; double hmax = HMAX; double ssmin = 1e-11; double ssmax = 1e-8; double abmin = 1e-36; double abmax = 1e36; double acmax = 1e36; struct sym *symtab = NULL; struct sym *fsp = NULL; struct sym *dqueue = NULL; struct prt *pqueue = NULL; struct expr exprzero = { O_CONST, 0., NULL, NULL, }; struct expr exprone = { O_CONST, 1., NULL, NULL, }; bool sawstep = false, sawprint = false; bool sawevery = false, sawfrom = false; bool tflag = false, pflag = false, sflag = false; bool eflag = false, rflag = false, hflag = false, conflag = false; integration_type algorithm = A_RUNGE_KUTTA_FEHLBERG; /* defined but not initialized */ char *filename; jmp_buf mark; int fwd; int tevery; double tstart, tstop, tstep, tfrom; bool printnum, prerr; plotutils-2.6/ode/main.c0000644000175000017500000001627611234220551012207 00000000000000/* This file is part of the GNU plotutils package. */ /* This file is part of the GNU plotutils package. Copyright (C) 1989, 1996, 1997, 1998, 1999, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* * main() routine for ode, including command-line parser. */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #include "getopt.h" #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 struct option long_options[] = { {"input-file", ARG_REQUIRED, NULL, 'f'}, {"precision", ARG_REQUIRED, NULL, 'p'}, /* integration algorithms */ {"adams-moulton", ARG_OPTIONAL, NULL, 'A'}, /* 0 or 1 */ {"euler", ARG_OPTIONAL, NULL, 'E'}, /* 0 or 1 */ {"runge-kutta", ARG_OPTIONAL, NULL, 'R'}, /* 0 or 1 */ /* error bounds */ {"absolute-error-bound", ARG_REQUIRED, NULL, 'e'}, /* 1 or 2 */ {"step-size-bound", ARG_REQUIRED, NULL, 'h'}, /* 1 or 2 */ {"relative-error-bound", ARG_REQUIRED, NULL, 'r'}, /* 1 or 2 */ {"suppress-error-bound", ARG_NONE, NULL, 's'}, {"title", ARG_NONE, NULL, 't'}, /* Long options with no equivalent short option alias */ {"version", ARG_NONE, NULL, 'V' << 8}, {"help", ARG_NONE, NULL, 'h' << 8}, {NULL, 0, 0, 0} }; /* null-terminated list of options that we don't show to the user */ int hidden_options[] = { 0 }; /* forward references */ static void fatal (const char *s); /* * fatal error message */ static void fatal (const char *s) { fprintf (stderr, "%s: %s\n", progname, s); exit (EXIT_FAILURE); } int main (int argc, char *argv[]) { int option; int opt_index; int errcnt = 0; /* errors encountered */ bool show_version = false; /* remember to show version message */ bool show_usage = false; /* remember whether to output usage message. */ double local_tstep, local_hmax; FILE *infile = NULL; for ( ; ; ) { option = getopt_long (argc, argv, "e:f:h:p:r:stA::E::R::V", long_options, &opt_index); if (option == 0) option = long_options[opt_index].val; switch (option) { /* ----------- options with no argument --------------*/ case 's': /* Suppress error bound, ARG NONE */ sflag = true; break; case 't': /* Title, ARG NONE */ tflag = true; if (!pflag) { prec = 6; fwd = 13; } break; case 'V' << 8: /* Version, ARG NONE */ show_version = true; break; case 'h' << 8: /* Help, ARG NONE */ show_usage = true; break; /*----------- options with a single argument --------------*/ case 'f': /* File name, ARG REQUIRED */ filename = xstrdup (optarg); break; case 'p': /* Precision, ARG REQUIRED */ pflag = true; if (sscanf (optarg, "%d", &prec) <= 0) fatal ("-p: bad argument"); prec--; if (prec <= 0 || prec > 18) fatal ("-p: argument must be in the range 2..19"); fwd = prec + 7; if (fwd < 9) fwd = 9; break; /*----------- options with 0 or 1 arguments --------------*/ case 'A': /* Adams-Moulton */ algorithm = A_ADAMS_MOULTON; if (optind >= argc) break; /* try to parse next arg as a float */ if (sscanf (argv[optind], "%lf", &local_tstep) <= 0) break; tstep = local_tstep; optind++; /* tell getopt we recognized timestep */ conflag = true; break; case 'E': /* Euler */ algorithm = A_EULER; conflag = true; tstep = 0.1; if (optind >= argc) break; /* try to parse next arg as a float */ if (sscanf (argv[optind], "%lf", &local_tstep) <= 0) break; tstep = local_tstep; optind++; /* tell getopt we recognized timestep */ break; case 'R': /* Runge-Kutta-Fehlberg */ algorithm = A_RUNGE_KUTTA_FEHLBERG; if (optind >= argc) break; /* try to parse next arg as a float */ if (sscanf (argv[optind], "%lf", &local_tstep) <= 0) break; tstep = local_tstep; optind++; /* tell getopt we recognized timestep */ conflag = true; break; /*----------- options with 1 or 2 arguments --------------*/ case 'h': /* Step Size Bound(s) */ if (sscanf (optarg, "%lf", &hmin) <= 0) fatal ("-h: bad argument"); if (hmin < HMIN) fatal ("-h: value too small"); if (optind >= argc) break; /* try to parse next arg as a float */ if (sscanf (argv [optind], "%lf", &local_hmax) <= 0) break; hmax = local_hmax; optind++; /* tell getopt we recognized hmax */ hflag = true; break; case 'r': /* Relative Error Bound(s) */ rflag = true; if (sscanf (optarg, "%lf", &ssmax) <= 0) fatal ("-r: bad argument"); if (ssmax < HMIN) fatal ("-r: max value too small"); if (optind >= argc) break; /* try to parse next arg as a float */ if (sscanf (argv [optind], "%lf", &ssmin) <= 0) { ssmin = ssmax * SCALE; break; } optind++; /* tell getopt we recognized ssmin */ break; case 'e': /* Absolute Error Bound(s) */ eflag = true; if (sscanf (optarg, "%lf", &abmax) <= 0) fatal ("-e: bad argument"); if (abmax < HMIN) fatal ("-e: max value too small"); if (optind >= argc) /* try to parse next arg as a float */ break; if (sscanf (argv [optind], "%lf", &abmin) <= 0) { abmin = abmax * SCALE; break; } optind++; /* tell getopt we recognized abmin */ break; /*---------------- End of options ----------------*/ default: /* Default, unknown option */ errcnt++; break; } /* endswitch */ if ((option == EOF)) { errcnt--; break; /* break out of option processing */ } } /* endwhile */ if (optind < argc) /* too many arguments */ { fprintf (stderr, "%s: there are too many arguments\n", progname); errcnt++; } if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (show_usage) { display_usage (progname, hidden_options, NULL, 0); return EXIT_SUCCESS; } /* Some sanity checks on user-supplied options. */ if (algorithm == A_EULER && (eflag || rflag)) fatal ("-E [Euler] illegal with -e or -r"); /* DO IT */ if (filename != NULL) { infile = fopen (filename, "r"); if (infile == NULL) { fprintf (stderr, "%s: %s: %s\n", progname, filename, strerror(errno)); return EXIT_FAILURE; } yyin = infile; /* will switch later to stdin, in yywrap() */ } else { yyin = stdin; filename = ""; } yyparse(); return EXIT_SUCCESS; } plotutils-2.6/ode/misc.c0000644000175000017500000002174411037240651012216 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free * Software Foundation, Inc. */ /* stuff that doesn't go anywhere else in particular */ #include "sys-defines.h" #include "ode.h" #include "extern.h" /* * check checks internal consistency prior to calling the * numerical routine. Tasks it performs include: * ensures one and only one independent variable * the symbol table is coherent * the print queue is coherent * the independent variable has a derivative == 1. * each dependent variable has an ODE and an initial value */ bool check (void) { struct sym *sp, *ivp, *prevp; struct prt *pp; /* * discard any previous entry for "(indep)" */ prevp = NULL; for (sp = symtab; sp != NULL; sp = sp->sy_link) { if (strncmp (sp->sy_name, "(indep)", NAMMAX) == 0) { if (prevp == NULL) symtab = sp->sy_link; else prevp->sy_link = sp->sy_link; sfree(sp); break; } prevp = sp; } /* * check for only one independent variable */ ivp = prevp = NULL; for (sp = symtab; sp != NULL; sp = sp->sy_link) { if (!(sp->sy_flags & SF_DEPV)) { if (ivp != NULL) { fprintf (stderr, "%s: both `%.*s' and `%.*s' are independent\n", progname, NAMMAX, sp->sy_name, NAMMAX, ivp->sy_name); return false; } ivp = sp; } if (ivp == NULL) prevp = sp; } /* * invent one if it's missing */ if (ivp == NULL) { ivp = salloc(); strncpy (ivp->sy_name, "(indep)", NAMMAX); } else if (prevp != NULL) { /* * link the independent var at the * head of the symtab queue */ prevp->sy_link = ivp->sy_link; ivp->sy_link = symtab; symtab = ivp; } /* * now ivp points to the ind. var. entry * make sure the independent var gets * printed when there's no print statement */ if (!sawprint) { for (pp = pqueue; pp != NULL; pp = pp->pr_link) if (pp->pr_sym == ivp) goto found; pp = palloc(); pp->pr_link = pqueue; pqueue = pp; pp->pr_sym = ivp; } found: /* * indep var has a derivative of 1.0 */ ivp->sy_expr = &exprone; /* * ensure an expr and value for each dep var */ for (sp = symtab; sp != NULL; sp = sp->sy_link) { switch (sp->sy_flags&SF_DEPV) { case SF_INIT: sp->sy_expr = &exprzero; sp->sy_flags |= SF_ISEQN; break; case SF_ISEQN: sp->sy_value = 0; sp->sy_flags |= SF_INIT; break; } } /* * dependent variables start here */ dqueue = symtab->sy_link; return true; } /* * set default values * determine step direction (forgive confused users) * initialize values for printq() and numerical routines */ void defalt (void) { if (!sawfrom) tfrom = tstart; if (!sawevery) tevery = 1; if (tstart>tstop && tstep>0) tstep = -tstep; else if (tstartsy_link; fsp!=NULL; fsp = fsp->sy_link) fsp->sy_prime = eval(fsp->sy_expr); } /* * internal error (fatal) */ void panic (const char *s) { fprintf (stderr, "%s panic: %s\n", progname, s); exit (EXIT_FAILURE); } void panicn (const char *fmt, int n) { fprintf (stderr, "%s panic: ", progname); fprintf (stderr, fmt, n); fprintf (stderr, "\n"); exit (EXIT_FAILURE); } #define LASTVAL (tstep>0 ? t>=tstop-0.0625*tstep : t<=tstop-0.0625*tstep) #define TFROM (tfrom - 0.0625*tstep) #define PRFROM (tstep>0 ? t >= TFROM : t<= TFROM) void printq (void) { double f = 0.0; double t; struct prt *pp; t = symtab->sy_value; if (!printnum && PRFROM) printnum = true; if (((it % tevery == 0) && printnum) || LASTVAL) { pp = pqueue; if (pp != NULL) for (;;) { switch (pp->pr_which) { case P_VALUE: f = pp->pr_sym->sy_value; break; case P_PRIME: f = pp->pr_sym->sy_prime; break; case P_ACERR: f = pp->pr_sym->sy_acerr; break; case P_ABERR: f = pp->pr_sym->sy_aberr; break; case P_SSERR: f = pp->pr_sym->sy_sserr; break; default: panicn ("bad cell spec (%d) in printq()", (int)(pp->pr_which)); break; } prval (f); pp = pp->pr_link; if (pp == NULL) break; putchar (' '); } putchar ('\n'); fflush (stdout); } if (it == LONGMAX) it = 0; } /* * print a value to current precision * kludge for Pascal compatibility */ void prval (double x) { if (prec < 0) { char outbuf[20]; if (x < 0) { putchar ('-'); x = -x; } sprintf (outbuf, "%.7g", x); if (*outbuf == '.') putchar ('0'); printf ("%s", outbuf); } else printf ("%*.*e", fwd, prec, x); } /* * handler for math library exceptions (`rterrors' may or may not return) */ #ifdef HAVE_MATHERR int # ifdef __cplusplus matherr (struct __exception *x) #else matherr (struct exception *x) #endif { switch (x->type) { case DOMAIN: rterrors ("domain error in %s", x->name); break; case SING: rterrors ("singularity error in %s", x->name); break; case OVERFLOW: rterrors ("range error (overflow) in %s", x->name); break; #ifdef TLOSS case TLOSS: rterrors ("range error (total loss of significance) in %s", x->name); break; #endif #ifdef PLOSS case PLOSS: rterrors ("range error (partial loss of significance) in %s", x->name); break; #endif case UNDERFLOW: /* treat as non-fatal */ rtsquawks ("range error (underflow) in %s", x->name); break; default: rterrors ("unknown error in %s", x->name); break; } return 1; /* suppress system error message */ } #endif /* * print a diagnostic for run-time errors. * uses fsp to decide which dependent variable was being worked */ void rterror (const char *s) { if (fsp == NULL) /* no computation, just print message */ fprintf (stderr, "%s: %s\n", progname, s); else { fprintf (stderr, "%s: %s while calculating %.*s'\n", progname, s, NAMMAX, fsp->sy_name); longjmp (mark, 1); /* interrupt computation */ } } void rterrors (const char *fmt, const char *s) { if (fsp != NULL) /* interrupt computation */ { fprintf (stderr, "%s: ", progname); fprintf (stderr, fmt, s); fprintf (stderr, " while calculating %.*s'\n", NAMMAX, fsp->sy_name); longjmp (mark, 1); } else /* just print error message */ { fprintf (stderr, "%s: ", progname); fprintf (stderr, fmt, s); fprintf (stderr, "\n"); } } /* * same, but doesn't do a longjmp. * computation continues */ void rtsquawks (const char *fmt, const char *s) { fprintf (stderr, "%s: ", progname); fprintf (stderr, fmt, s); if (fsp != NULL) fprintf (stderr, " while calculating %.*s'", NAMMAX, fsp->sy_name); fprintf (stderr, "\n"); return; } /* * Run the numerical stuff. * This gets called from the grammar * because we want to solve on each * 'step' statement. */ void solve (void) { struct sym *sp; bool adapt; if (check() == false) return; defalt (); if (tflag) title (); fflush (stderr); setflt (); if (!setjmp (mark)) { adapt = eflag|rflag|!conflag ? true : false; if (tstart == tstop) trivial(); else switch (algorithm) { case A_EULER: eu(); break; case A_ADAMS_MOULTON: if (adapt || prerr) ama(); else am(); break; case A_RUNGE_KUTTA_FEHLBERG: default: if (adapt || prerr) rka(); else rk(); break; } } resetflt(); /* add final newline (to aid realtime postprocessing of dataset by graph) */ putchar ('\n'); fflush (stdout); for (sp = symtab; sp != NULL; sp = sp->sy_link) { sp->sy_prime = sp->sy_pri[0]; sp->sy_value = sp->sy_val[0]; } } /* * choose step size at tstart */ void startstep (void) { if (!hflag) hmax = fabs ((tstop-tstart)/2); tstep = fabs ((tstop-tstart)/MESH); if (tstep > hmax) tstep = hmax; if (tstep < hmin) tstep = hmin; while (tstep >= HMAX) tstep *= HALF; while (tstart + tstep == tstart) tstep *= TWO; } /* * print a header * Try to center the headings over the columns */ void title (void) { struct prt *pp; char tag = '\0'; pp = pqueue; if (pp != NULL) for (;;) { switch (pp->pr_which) { case P_PRIME: tag = '\''; break; case P_VALUE: tag = ' '; break; case P_SSERR: tag = '?'; break; case P_ABERR: tag = '!'; break; case P_ACERR: tag = '~'; break; default: panicn ("bad cell spec (%d) in title()", (int)(pp->pr_which)); break; } printf (" %*.*s%c", fwd - 2, NAMMAX, pp->pr_sym->sy_name, tag); if ((pp=pp->pr_link) == NULL) break; putchar (' '); } putchar ('\n'); fflush (stdout); } plotutils-2.6/ode/prt.c0000644000175000017500000000121510346055342012062 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999 Free Software * Foundation, Inc. */ /* * print queue memory management * */ #include "sys-defines.h" #include "ode.h" #include "extern.h" struct prt * palloc (void) { struct prt *pp; pp = (struct prt *)xmalloc (sizeof(struct prt)); pp->pr_sym = NULL; pp->pr_link = NULL; pp->pr_which = P_VALUE; /* default */ return pp; } void pfree (struct prt *pp) { if (pp != NULL) { pfree (pp->pr_link); free ((void *)pp); } } plotutils-2.6/ode/rk.c0000644000175000017500000000320310346055342011670 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 2005, Free Software * Foundation, Inc. */ /* * Fourth-Order Runge-Kutta * */ #include "sys-defines.h" #include "ode.h" #include "extern.h" void rk (void) { double t; double halfstep = HALF * tstep; double onesixth = 1.0 / 6.0; for (it = 0, t = tstart; !STOPR; t = tstart + (++it) * tstep) { symtab->sy_val[0] = symtab->sy_value = t; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_val[0] = fsp->sy_value; fsp->sy_pri[0] = fsp->sy_prime; } /* output */ printq(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[0] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + HALF * fsp->sy_k[0]; } symtab->sy_value = t + halfstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[1] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + HALF * fsp->sy_k[1]; } symtab->sy_value = t + halfstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[2] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + fsp->sy_k[2]; } symtab->sy_value = t + tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_k[3] = tstep * fsp->sy_prime; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_value = fsp->sy_val[0] + onesixth * (fsp->sy_k[0] + TWO * fsp->sy_k[1] + TWO * fsp->sy_k[2] + fsp->sy_k[3]); } } plotutils-2.6/ode/rka.c0000644000175000017500000000700011037240710012021 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 2005, 2008, Free Software * Foundation, Inc. */ /* * Fifth-Order Runge-Kutta-Fehlberg with adaptive step size * */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #include "num.h" #define T_LT_TSTOP (tstep>0 ? ttstop) void rka (void) { bool gdval = true; /* good value to print ? */ int overtime = 1; double prevstep = 0.0; double t; for (it = 0, t = tstart; T_LT_TSTOP || overtime--; ) { symtab->sy_value = symtab->sy_val[0] = t; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_val[0] = fsp->sy_value; fsp->sy_pri[0] = fsp->sy_prime; } if (gdval) printq(); /* output */ if (tstep * (t+tstep-tstop) > 0) tstep = tstop - t; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[0] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + C20 * fsp->sy_k[0]; } symtab->sy_value = t + C2t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[1] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + (C30 * fsp->sy_k[0] + C31 * fsp->sy_k[1]); } symtab->sy_value = t + C3t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[2] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + (C40 * fsp->sy_k[0] + C41 * fsp->sy_k[1] + C42 * fsp->sy_k[2]); } symtab->sy_value = t + C4t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[3] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + (C50 * fsp->sy_k[0] + C51 * fsp->sy_k[1] + C52 * fsp->sy_k[2] + C53 * fsp->sy_k[3]); } symtab->sy_value = t + tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_k[4] = tstep * fsp->sy_prime; fsp->sy_value = fsp->sy_val[0] + (C60 * fsp->sy_k[0] + C61 * fsp->sy_k[1] + C62 * fsp->sy_k[2] + C63 * fsp->sy_k[3] + C64 * fsp->sy_k[4]); } symtab->sy_value = t + C6t * tstep; field(); for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_k[5] = tstep * fsp->sy_prime; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) { fsp->sy_predi = fsp->sy_val[0] + (A0 * fsp->sy_k[0] + A2 * fsp->sy_k[2] + A3 * fsp->sy_k[3] + A4 * fsp->sy_k[4]); fsp->sy_value = fsp->sy_val[0] + (B0 * fsp->sy_k[0] + B2 * fsp->sy_k[2] + B3 * fsp->sy_k[3] + B4 * fsp->sy_k[4] + B5 * fsp->sy_k[5]); if (fsp->sy_value != 0.0) fsp->sy_sserr = fabs(1.0 - fsp->sy_predi / fsp->sy_value); fsp->sy_aberr = fabs(fsp->sy_value - fsp->sy_predi); } if (!conflag && T_LT_TSTOP) { maxerr(); if (hierror()) { tstep *= HALF; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_value = fsp->sy_val[0]; gdval = false; continue; } else if (lowerror() && prevstep != tstep) { prevstep = tstep; /* prevent infinite loops */ tstep *= TWO; for (fsp = dqueue; fsp != NULL; fsp = fsp->sy_link) fsp->sy_value = fsp->sy_val[0]; gdval = false; continue; } } gdval = true; prevstep = 0.0; ++it; t += tstep; /* the roundoff error is gross */ } } plotutils-2.6/ode/specfun.c0000644000175000017500000004651311233725001012722 00000000000000/* This file is part of the GNU plotutils package. */ /* Copyright (C) 1997, 1998, 1998, 2005, 2008, 2009, Free Software Foundation, Inc. */ /* This file contains the five functions ibeta, igamma, norm, invnorm, inverf and versions of lgamma, erf, erfc for machines without them. */ /* The inspiration for this file was the file specfun.c that has long been a part of the gnuplot distribution. However, the current version of the present file has been rewritten, largely from scratch, on the basis of published algorithms. It is not dependent on the gnuplot specfun.c (which has included, and still includes, copyrighted code). */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #include #define ITERMAX 200 #ifdef FLT_EPSILON #define MACHEPS FLT_EPSILON /* 1.0E-08 */ #else #define MACHEPS 1.0E-08 #endif #ifdef FLT_MIN_EXP #define MINEXP FLT_MIN_EXP /* -88.0 */ #else #define MINEXP -88.0 #endif #ifdef FLT_MAX_EXP #define MAXEXP FLT_MAX_EXP /* +88.0 */ #else #define MAXEXP 88.0 #endif #ifdef FLT_MAX #define OFLOW FLT_MAX /* 1.0E+37 */ #else #define OFLOW 1.0E+37 #endif #ifdef FLT_MAX_10_EXP #define XBIG FLT_MAX_10_EXP /* 2.55E+305 */ #else #define XBIG 2.55E+305 #endif #ifndef HUGE_VAL #ifdef HUGE #define HUGE_VAL HUGE #else #ifdef INF #define HUGE_VAL INF #else #define HUGE_VAL OFLOW #endif #endif #endif /* * Mathematical constants */ #ifdef M_PI #undef M_PI #endif #define M_PI 3.14159265358979323846264338327950288 #ifdef M_SQRT2 #undef M_SQRT2 #endif #define M_SQRT2 1.41421356237309504880168872420969809 #define M_LNSQRT2PI 0.9189385332046727 /* Forward references */ /* The following gamma-related nonsense is necessary because (1) some vendors have lgamma(), some have gamma(), and some have neither [see include/sys-defines.h for further comments], (2) some vendors do not declare whichever function they have [e.g. Irix 5.3 requires an auxiliary preprocessing symbol to be defined for the declaration in math.h to be visible], and (3) some vendors supply broken versions which we can't use [e.g. AIX's libm.a gamma support is conspicuously broken], so we need to link in a replacement, but we can't use the same name for the external symbol `signgam'. What a mess! -- rsm */ #ifdef NO_SYSTEM_GAMMA #define SIGNGAM our_signgam static int SIGNGAM; double f_lgamma (double x); static double lgamma_neg (double x); static double lgamma_pos (double x); #else /* not NO_SYSTEM_GAMMA, we link in vendor code */ #define SIGNGAM signgam extern int SIGNGAM; #endif double f_gamma (double x); #ifndef HAVE_ERF double erf (double x); double erfc (double x); #endif double ibeta (double a, double b, double x); double igamma (double a, double x); double inverf (double x); double invnorm (double x); double norm (double x); static double ibeta_internal (double a, double b, double x); /*****************************************************************/ /************ Functions related to gamma function ****************/ /*****************************************************************/ /* Our gamma function. F_LGAMMA(), which this calls, computes the log of the gamma function, with the sign being returned in SIGNGAM. F_LGAMMA() is defined in include/sys-defines.h. It may be a vendor-supplied lgamma(), a vendor-supplied gamma(), or our own f_lgamma (see below). */ double f_gamma (double x) { #ifdef HAVE_MATHERR #ifdef __cplusplus struct __exception exc; #else struct exception exc; #endif #endif double y = F_LGAMMA(x); if (y > MAXEXP) { #ifdef HAVE_MATHERR exc.name = (char *)"gamma"; exc.arg1 = x; exc.retval = HUGE_VAL; exc.type = OVERFLOW; if (!matherr (&exc)) { fprintf (stderr, "gamma: OVERFLOW error\n"); errno = ERANGE; } return exc.retval; #else errno = ERANGE; return HUGE_VAL; #endif } else return SIGNGAM * exp (y); } #ifdef NO_SYSTEM_GAMMA /* Define our own lgamma(): compute log(Gamma(z)) for positive z as the sum of a suitably generated and truncated Lanczos series. Lanczos series resemble Stirling (i.e. DeMoivre) asymptotic approximations, but unlike them are not asymptotic series; rather, they are convergent in the entire right half plane, on which a uniform bound on the error can be obtained. See C. Lanczos, "A Precision Approximation of the Gamma Function", SIAM J. Numerical Analysis 1B (1964), 86--96. */ double f_lgamma (double z) { SIGNGAM = 1; /* will return sign of Gamma(z) in SIGNGAM */ if (z <= 0.0) return lgamma_neg (z); else return lgamma_pos (z); } /* Case I. z<=0 (if z < 0, reducible to z>0 case by reflection formula) */ static double lgamma_neg (double z) { double intpart, trigfac, retval; #ifdef HAVE_MATHERR #ifdef __cplusplus struct __exception exc; #else struct exception exc; #endif #endif if (modf (-z, &intpart) == 0.0) /* z is nonpositive integer, so SING error */ { #ifdef HAVE_MATHERR exc.name = "lgamma"; exc.arg1 = z; exc.retval = HUGE_VAL; exc.type = SING; if (!matherr (&exc)) { fprintf (stderr, "lgamma: SING error\n"); errno = EDOM; } return (exc.retval); #else errno = EDOM; return HUGE_VAL; #endif /* HAVE_MATHERR */ } /* use Euler's reflection formula, and call lgamma_pos() */ trigfac = sin (M_PI * z) / M_PI; if (trigfac < 0.0) { trigfac = - trigfac; SIGNGAM = -1; } retval = - lgamma_pos (1.0 - z) - log (trigfac); if (fabs (retval) == HUGE_VAL) { #ifdef HAVE_MATHERR exc.name = "lgamma"; exc.arg1 = z; exc.retval = HUGE_VAL; exc.type = OVERFLOW; if (!matherr(&exc)) errno = ERANGE; return (exc.retval); #else errno = ERANGE; return HUGE_VAL; #endif } return retval; } /* Case II. z>0, the primary case */ /* Lanczos parameter G (called lower-case gamma by him). "[A] large value of G is advocated if very high accuracy is demanded, but then the required number of terms will also be larger." */ #define LANCZOS_G 6 /* Values for coeffs of as many terms in the Lanczos expansion as are needed for this value of G, computed by Ray Toy . (In his 1964 paper, Lanczos only went up to G=5.) It is claimed (see gnuplot's specfun.c) that this value of G (i.e., 6) and number of terms will yield 14-digit accuracy everywhere except near z=1 and z=2. */ #define NUM_LANCZOS_TERMS 9 static const double lanczos[NUM_LANCZOS_TERMS] = { .99999999999980993227684700473478296744476168282198, 676.52036812188509856700919044401903816411251975244084, -1259.13921672240287047156078755282840836424300664868028, 771.32342877765307884865282588943070775227268469602500, -176.61502916214059906584551353999392943274507608117860, 12.50734327868690481445893685327104972970563021816420, -.13857109526572011689554706984971501358032683492780, .00000998436957801957085956266828104544089848531228, .00000015056327351493115583383579667028994545044040 }; static double lgamma_pos (double z) { double accum, retval; int i; #ifdef HAVE_MATHERR #ifdef __cplusplus struct __exception exc; #else struct exception exc; #endif #endif accum = lanczos[0]; for (i = 1; i < NUM_LANCZOS_TERMS; i++) accum += lanczos[i] / (z + i - 1); retval = (log (accum) + M_LNSQRT2PI - z - LANCZOS_G - 0.5 + (z - 0.5) * log (z + LANCZOS_G + 0.5)); if (retval == HUGE_VAL) { #ifdef HAVE_MATHERR exc.name = "lgamma"; exc.arg1 = z; exc.retval = HUGE_VAL; exc.type = OVERFLOW; if (!matherr (&exc)) { fprintf (stderr, "lgamma: OVERFLOW error\n"); errno = ERANGE; } return exc.retval; #else errno = ERANGE; return HUGE_VAL; #endif } return retval; } #endif /* NO_SYSTEM_GAMMA */ /*****************************************************************/ /************ Functions related to inverse beta function *********/ /*****************************************************************/ /* Our incomplete beta function, I_x(a,b). Here a,b>0 and x is in [0,1]. Returned value is in [0,1]. Note: this normalization convention is not universal. The formula given in Abramowitz & Stegun (Eq. 26.5.8) is used. It includes a continued fraction expansion. They say, "Best results are obtained when x < (a-1)/(a+b-2)." We use it when x <= a/(a+b). This calls F_LGAMMA (e.g., lgamma()) to compute the prefactor in the formula. */ double ibeta (double a, double b, double x) { double retval; #ifdef HAVE_MATHERR #ifdef __cplusplus struct __exception exc; #else struct exception exc; #endif #endif if (x < 0.0 || x > 1.0 || a <= 0.0 || b <= 0.0) /* DOMAIN error */ { #ifdef HAVE_MATHERR exc.name = (char *)"ibeta"; exc.arg1 = a; exc.arg2 = b; /* have no arg3, can't return x (!) */ exc.retval = HUGE_VAL; exc.type = DOMAIN; if (!matherr (&exc)) { fprintf (stderr, "ibeta: DOMAIN error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return HUGE_VAL; #endif } if (x == 0.0 || x == 1.0) return x; if (a < x * (a + b)) /* interchange */ retval = 1.0 - ibeta_internal (b, a, 1.0 - x); else retval = ibeta_internal (a, b, x); if (retval < 0.0) /* error: failure of convergence */ { #ifdef HAVE_MATHERR exc.name = (char *)"ibeta"; exc.arg1 = a; exc.arg2 = b; /* have no arg3, can't return x (!) */ exc.retval = HUGE_VAL; exc.type = TLOSS; if (!matherr (&exc)) { fprintf (stderr, "ibeta: TLOSS error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return HUGE_VAL; #endif } return retval; } /* Evaluate convergents of the continued fraction by Wallis's method; return value will be positive, except that -1.0 is returned if there is no convergence. */ static double ibeta_internal (double a, double b, double x) { double A0, B0; double A2 = 1.0; double B2 = 0.0; double A1 = 1.0; double B1 = 1.0; double prefactor; double f0 = 0.0, f1 = 1.0; /* f0 initted to quiet compiler */ int goodf0, goodf1 = 1; int j; prefactor = exp (a * log (x) + b * log (1.0 - x) + F_LGAMMA(a + b) - F_LGAMMA(a + 1.0) - F_LGAMMA(b)); for (j = 1; j <= ITERMAX; j++) { double aj; int m; if (j % 2) /* j odd, j = 2m + 1 */ { m = (j - 1)/2; aj = - (a + m) * (a + b + m) * x / ((a + 2 * m) * (a + 2 * m + 1)); } else /* j even, j = 2m */ { m = j/2; aj = m * (b - m) * x / ((a + 2 * m - 1) * (a + 2 * m)); } A0 = 1.0 * A1 + aj * A2; B0 = 1.0 * B1 + aj * B2; if (B0 != 0.0) { double ren; /* renormalize; don't really need to do this on each pass */ ren = 1.0 / B0; A0 *= ren; B0 = 1.0; A1 *= ren; B1 *= ren; f0 = A0; goodf0 = 1; /* test f0 = A0/B0 = A0 for exit */ if (goodf1 && fabs (f0 - f1) <= DMIN(MACHEPS, fabs (f0) * MACHEPS)) return (prefactor / f0); } else goodf0 = 0; /* shift down */ A2 = A1; B2 = B1; A1 = A0; B1 = B0; f1 = f0; goodf1 = goodf0; } /* if we reached here, convergence failed */ return -1.0; } /*****************************************************************/ /************ Functions related to incomplete gamma function *****/ /*****************************************************************/ /* Our incomplete gamma function, igamma(a,x) with a>0.0, x>=0.0. Return value is in [0,1]. The algorithm is AS 239, documented in B. L. Shea, "Chi-Squared and Incomplete Gamma Integral", Applied Statistics 37 (1988), 466-473. There have been claims that if 0<=x<=1, in which case Shea's algorithm uses Pearson's series rather than a continued fraction representation, an inaccurate value may result. This has not been verified. There have also been claims that the continued fraction representation is reliable only if x >= a+2, rather than x >= a (the latter being Shea's condition). For safety, we use it only if x >= a+2. */ double igamma (double a, double x) { double arg, prefactor; int i; #ifdef HAVE_MATHERR #ifdef __cplusplus struct __exception exc; #else struct exception exc; #endif #endif if (x < 0.0 || a <= 0.0) /* DOMAIN error */ { #ifdef HAVE_MATHERR exc.name = (char *)"igamma"; exc.arg1 = a; exc.arg2 = x; exc.retval = HUGE_VAL; exc.type = DOMAIN; if (!matherr (&exc)) { fprintf (stderr, "igamma: DOMAIN error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return HUGE_VAL; #endif } if (x > XBIG) /* TLOSS error */ { #ifdef HAVE_MATHERR exc.name = (char *)"igamma"; exc.arg1 = a; exc.arg2 = x; exc.retval = 1.0; exc.type = TLOSS; if (!matherr (&exc)) { fprintf (stderr, "igamma: TLOSS error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return 1.0; #endif } if (x == 0.0) return 0.0; /* check exponentiation in prefactor */ arg = a * log (x) - x - F_LGAMMA(a + 1.0); if (arg < MINEXP) { #ifdef HAVE_MATHERR exc.name = (char *)"igamma"; exc.arg1 = a; exc.arg2 = x; exc.retval = 0.0; exc.type = TLOSS; if (!matherr (&exc)) { fprintf (stderr, "ibeta: TLOSS error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return 0.0; #endif } prefactor = exp (arg); if ((x > 1.0) && (x >= a + 2.0)) /* use the continued fraction, not Pearson's series; generate its convergents by Wallis's method */ { double A0, B0, A1, B1, A2, B2; double f0 = 0.0, f1; /* f0 initted to quiet compiler */ double aa, bb; int goodf0, goodf1 = 1; aa = 1.0 - a; bb = aa + x + 1.0; A2 = 1.0; B2 = x; A1 = x + 1.0; B1 = x * bb; f1 = A1 / B1; for (i = 1; i <= ITERMAX; i++) { aa++; bb += 2.0; A0 = bb * A1 - i * aa * A2; B0 = bb * B1 - i * aa * B2; if (B0 != 0.0) { f0 = A0 / B0; if (goodf1 && fabs (f0 - f1) <= DMIN(MACHEPS, fabs (f0) * MACHEPS)) return (1.0 - prefactor * a * f0); goodf0 = 1; } else goodf0 = 0; /* shift down */ A2 = A1; B2 = B1; A1 = A0; B1 = B0; f1 = f0; goodf1 = goodf0; if (fabs(A0) >= OFLOW) /* renormalize */ { A2 /= OFLOW; B2 /= OFLOW; A1 /= OFLOW; B1 /= OFLOW; } } } else /* use Pearson's series, not the continued fraction */ { double aa, bb, cc; aa = a; bb = 1.0; cc = 1.0; for (i = 0; i <= ITERMAX; i++) { aa++; cc *= (x / aa); bb += cc; if (cc < bb * MACHEPS) return prefactor * bb; } } /* if we reached here, convergence failed */ #ifdef HAVE_MATHERR exc.name = (char *)"igamma"; exc.arg1 = a; exc.arg2 = x; exc.retval = HUGE_VAL; exc.type = TLOSS; if (!matherr (&exc)) { fprintf (stderr, "ibeta: TLOSS error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return HUGE_VAL; #endif } #ifndef HAVE_ERF double erf (double x) { return x < 0.0 ? -igamma (0.5, x * x) : igamma (0.5, x * x); } double erfc (double x) { return x < 0.0 ? 1.0 + igamma (0.5, x * x) : 1.0 - igamma (0.5, x * x); } #endif /* not HAVE_ERF */ double norm (double x) { return 0.5 * (1.0 + erf (0.5 * M_SQRT2 * x)); } /*****************************************************************/ /************ Functions related to inverse error function ********/ /*****************************************************************/ /* Our inverse error function, inverf(x) with -1.0= 1.0) /* DOMAIN error */ { #ifdef HAVE_MATHERR exc.name = (char *)"inverf"; exc.arg1 = x; exc.retval = (x < 0.0 ? -HUGE_VAL : HUGE_VAL); exc.type = DOMAIN; if (!matherr (&exc)) { fprintf (stderr, "inverf: DOMAIN error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return (x < 0.0 ? -HUGE_VAL : HUGE_VAL); #endif } /* exploit oddness in x */ xsign = (x >= 0.0 ? 1 : -1); x = (xsign > 0 ? x : -x); /* N.B. The numerator and denominator of each of these four rational approximants should really be written in nested polynomial form. */ if (x <= 0.85) /* 0.0 <= x <= 0.85; use f = x R0(x**2), where R0 is degree-3 rational */ { double y; y = x * x; num = n0[0] + n0[1]*y + n0[2]*y*y + n0[3]*y*y*y; den = d0[0] + d0[1]*y + d0[2]*y*y + d0[3]*y*y*y; retval = x * num / den; } else /* x > 0.85 */ { double w; w = sqrt (- log (1 - x * x)); /* w > 1.132 */ /* note that as x->1-, i.e., w->infinity, retval is asymptotic to w, to leading order */ if (w <= 2.5) /* 1.132 < w <= 2.5; use f = w R1(w), where R1 is degree-3 rational */ { num = n1[0] + n1[1]*w + n1[2]*w*w + n1[3]*w*w*w; den = d1[0] + d1[1]*w + d1[2]*w*w + d1[3]*w*w*w; retval = w * num / den; } else if (w <= 4.0) /* 2.5 < w <= 4.0; use f = w R2(w), where R2 is degree-3 rational */ { num = n2[0] + n2[1]*w + n2[2]*w*w + n2[3]*w*w*w; den = d2[0] + d2[1]*w + d2[2]*w*w + d2[3]*w*w*w; retval = w * num / den; } else /* w > 4.0; use f = w R3(1/w), where R3 is degree-3 rational with equal constant terms in numerator and denominator */ { double w1; w1 = 1.0 / w; num = n3[0] + n3[1]*w1 + n3[2]*w1*w1 + n3[3]*w1*w1*w1; den = d3[0] + d3[1]*w1 + d3[2]*w1*w1 + d3[3]*w1*w1*w1; retval = w * num / den; } } return (xsign > 0 ? retval : -retval); } /* Our inverse normal function (i.e., inverse Gaussian probability function), invnorm(x) with 0.0= 1.0) /* DOMAIN error */ { #ifdef HAVE_MATHERR exc.name = (char *)"invnorm"; exc.arg1 = x; exc.retval = HUGE_VAL; exc.type = DOMAIN; if (!matherr (&exc)) { fprintf (stderr, "invnorm: DOMAIN error\n"); errno = EDOM; } return exc.retval; #else errno = EDOM; return HUGE_VAL; #endif } return -M_SQRT2 * inverf (1.0 - 2 * x); } plotutils-2.6/ode/stperr.c0000644000175000017500000000502611037240725012577 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free * Software Foundation, Inc. */ /* * find maximum errors * */ #include "sys-defines.h" #include "ode.h" #include "extern.h" static double ssemax, abemax, acemax; static char *ssenam, *abenam, *acenam; void maxerr (void) { struct sym *sp, *dq; dq = symtab->sy_link; ssemax = abemax = acemax = 0.0; for (sp = dq; sp != NULL; sp = sp->sy_link) { if (ssemax < sp->sy_sserr) { ssemax = sp->sy_sserr; ssenam = sp->sy_name; } if (abemax < sp->sy_aberr) { abemax = sp->sy_aberr; abenam = sp->sy_name; } if (acmax < sp->sy_acerr) { acemax = sp->sy_acerr; acenam = sp->sy_name; } } } bool hierror (void) /* not enough accuracy */ { double t = symtab->sy_val[0]; if (t + tstep == t) { fprintf (stderr, "%s: %s\n", progname, "step size below lower limit"); longjmp (mark, 1); } if (ssemax <= ssmax && abemax <= abmax && acemax <= acmax) return false; if (fabs(tstep) >= fabs(hmin)) return true; if (sflag) return false; if (ssemax > ssmax) fprintf (stderr, "%s: relative error limit exceeded while calculating %.*s'\n", progname, NAMMAX, ssenam); else if (abemax > abmax) fprintf (stderr, "%s: absolute error limit exceeded while calculating %.*s'\n", progname, NAMMAX, abenam); else if (acemax > acmax) fprintf (stderr, "%s: accumulated error limit exceeded while calculating %.*s'\n", progname, NAMMAX, acenam); longjmp (mark, 1); /* doesn't return, but must keep unintelligent compilers happy */ return false; } bool lowerror (void) /* more than enough accuracy */ { if (ssemax < ssmin || abemax < abmin) if (fabs(tstep) <= fabs(hmax)) return true; return false; } /* * interpolate to tstop in Runge-Kutta routines */ #define PASTSTOP(stepvar) (t + 0.9375*stepvar > tstop && \ t + 0.0625*stepvar < tstop) #define BEFORESTOP(stepvar) (t + 0.9375*stepvar < tstop && \ t + 0.0625*stepvar > tstop) bool intpr (double t) { if (tstep > 0) if (!PASTSTOP(tstep)) return false; if (tstep < 0) if (!BEFORESTOP(tstep)) return false; if (tstep > 0) while (PASTSTOP(tstep)) tstep = HALF * tstep; if (tstep < 0) while (BEFORESTOP(tstep)) tstep = HALF * tstep; return true; } plotutils-2.6/ode/sym.c0000644000175000017500000000170611037240732012067 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1982-1994, Nicholas B. Tufillaro. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free * Software Foundation, Inc. */ /* * symbol table space management routines * */ #include "sys-defines.h" #include "ode.h" #include "extern.h" struct sym * lookup (const char *nam) { struct sym *sp; for (sp = symtab; sp != NULL; sp = sp->sy_link) if (strncmp (sp->sy_name, nam, NAMMAX) == 0) return sp; sp = salloc(); strncpy (sp->sy_name, nam, NAMMAX); return sp; } struct sym * salloc (void) { struct sym *sp; sp = (struct sym *)xmalloc(sizeof(struct sym)); sp->sy_link = symtab; symtab = sp; sp->sy_expr = NULL; sp->sy_value = sp->sy_prime = 0.0; sp->sy_sserr = sp->sy_aberr = sp->sy_acerr = 0.0; sp->sy_flags = 0; return sp; } void sfree (struct sym *sp) { if (sp != NULL) free ((void *)sp); } plotutils-2.6/ode/yywrap.c0000644000175000017500000000102411037240741012603 00000000000000/* This file is part of the GNU plotutils package. */ /* * Copyright (C) 1996, 1997, 2005, 2008, Free Software Foundation, Inc. */ /* * lex wrapper for ode. * */ #include "sys-defines.h" #include "ode.h" #include "extern.h" int yywrap (void) { if (yyin != stdin) /* we were reading from a file, */ { /* so switch to reading from stdin */ yyin = stdin; filename = ""; curline = 1; return 0; } else /* we were reading from stdin, */ return 1; /* so there's no more input */ } plotutils-2.6/ode/gram.y0000644000175000017500000006033611037240615012237 00000000000000%{ /* Copyright Nicholas B. Tufillaro, 1982-1994. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1999, 2005, 2008, Free Software * Foundation, Inc. */ /* * Grammar for ode: * Most things are self-explanatory. * When you're done with a lexptr-type object * you should free it with lfree. They are * used for passing constants around while parsing * (computing the value of) a cexpr. The macros * for evaluating operators and functions are the * most important thing to be familiar with before * toying with the semantics. */ #include "sys-defines.h" #include "ode.h" #include "extern.h" /* * Value is true iff operands pass ONECON. */ #define TWOCON(x,y) (ONECON(x) && ONECON(y)) #define THREECON(x,y,z) (ONECON(x) && ONECON(y) && ONECON(z)) /* * Value must be a (struct expr *). Returns true if its arg, when * evaluated, would put a constant on the stack. */ #define ONECON(x) (x->ex_oper == O_CONST && x->ex_next == NULL) /* * Performs ordinary binary arithmetic, when there are two constants in an * expr (`op' is a C operator that includes an assignment, e.g., +=). */ #define COMBINE(x,y,r,op) {x->ex_value op y->ex_value; efree(y); r = x;} /* * Generates stack code for a binary operation, as for a dyadic operator in * an expression. E.g., op = O_PLUS. */ #define BINARY(x,y,r,op) {struct expr *ep=ealloc();\ ep->ex_oper = op;\ concat(y,ep);\ concat(r=x,y);} /* * Generates stack code for a ternary operation, as for a triadic operator in * an expression. E.g., op = O_IBETA. */ #define TERNARY(x,y,z,r,op) {struct expr *ep=ealloc();\ ep->ex_oper = op;\ concat(z,ep);\ concat(y,z);\ concat(r=x,y);} /* * Performs ordinary unary arithmetic, when there is a constant in an expr. * "-" seems to work as a monadic operator. */ #define CONFUNC(x,r,f) {x->ex_value = f(x->ex_value); r = x;} /* * Generates stack code for a unary operation, as for a monadic operator in * an expression. */ #define UNARY(oprnd,r,op) {struct expr *ep=ealloc();\ ep->ex_oper = op;\ concat(r=oprnd,ep);} /* * Performs binary arithmetic in a cexpr (`op' is a C operator that * includes an assignment, e.g. +=). */ #define CEXOP(x,y,r,op) {x->lx_u.lxu_value op y->lx_u.lxu_value;\ lfree(y);\ r = x;} /* * Performs unary arithmetic in a cexpr. */ #define CEXFUNC(x,r,f) {x->lx_u.lxu_value = f(x->lx_u.lxu_value); r=x;} /* * A hook for future upgrades in error reporting */ static char *errmess = NULL; bool erritem; %} %union { struct lex *lexptr; struct expr *exprptr; struct prt *prtptr; int simple; } %token NUMBER IDENT SEP %token ABS SQRT EXP LOG LOG10 %token SIN COS TAN ASIN ACOS ATAN %token SINH COSH TANH ASINH ACOSH ATANH %token FLOOR CEIL J0 J1 Y0 Y1 %token LGAMMA GAMMA ERF ERFC INVERF NORM INVNORM %token IGAMMA IBETA %token EVERY FROM PRINT STEP EXAM %start program %type prttag %type cexpr %type expr %type prtitem %nonassoc '=' %left '+' '-' %left '*' '/' %right '^' %right UMINUS %% program : stat | program stat ; stat : SEP { lfree($1); } | IDENT '=' expr SEP { struct sym *sp; sp = lookup($1->lx_u.lxu_name); sp->sy_value = eval($3); sp->sy_flags |= SF_INIT; lfree($1); efree($3); lfree($4); } | error SEP { if (errmess == NULL) errmess = "syntax error"; fprintf (stderr, "%s:%s:%d: %s\n", progname, filename, ($2->lx_lino), errmess); errmess = NULL; lfree($2); yyerrok; yyclearin; } | IDENT '\'' '=' expr SEP { struct sym *sp; struct prt *pp, *qp; sp = lookup($1->lx_u.lxu_name); efree(sp->sy_expr); sp->sy_expr = $4; sp->sy_flags |= SF_ISEQN; if (!sawprint) { for (pp=pqueue; pp!=NULL; pp=pp->pr_link) if (pp->pr_sym == sp) goto found; pp = palloc(); pp->pr_sym = sp; if (pqueue == NULL) pqueue = pp; else { for (qp=pqueue; qp->pr_link!=NULL; ) qp = qp->pr_link; qp->pr_link = pp; } } found: lfree($1); lfree($5); } | PRINT prtlist optevery optfrom SEP { sawprint = true; prerr = erritem; erritem = false; lfree($5); } | STEP cexpr ',' cexpr SEP { lfree($5); tstart = $2->lx_u.lxu_value; lfree($2); tstop = $4->lx_u.lxu_value; lfree($4); if (!conflag) startstep(); solve(); sawstep = true; } | STEP cexpr ',' cexpr ',' cexpr SEP { double savstep; bool savconflag; lfree($7); tstart = $2->lx_u.lxu_value; lfree($2); tstop = $4->lx_u.lxu_value; lfree($4); savstep = tstep; tstep = $6->lx_u.lxu_value; lfree($6); savconflag = conflag; conflag = true; solve(); tstep = savstep; conflag = savconflag; sawstep = true; } | EXAM IDENT SEP { struct sym *sp; lfree($3); sp = lookup($2->lx_u.lxu_name); lfree($2); printf ("\"%.*s\" is ",NAMMAX,sp->sy_name); switch (sp->sy_flags & SF_DEPV) { case SF_DEPV: case SF_ISEQN: printf ("a dynamic variable\n"); break; case SF_INIT: printf ("an initialized constant\n"); break; case 0: printf ("an uninitialized constant\n"); break; default: panicn ("impossible (%d) in EXAM action", sp->sy_flags); } printf ("value:"); prval (sp->sy_value); printf ("\nprime:"); prval (sp->sy_prime); printf ("\nsserr:"); prval (sp->sy_sserr); printf ("\naberr:"); prval (sp->sy_aberr); printf ("\nacerr:"); prval (sp->sy_acerr); putchar ('\n'); prexq(sp->sy_expr); fflush(stdout); } ; prtlist : prtitem { pfree(pqueue); pqueue = $1; } | prtlist ',' prtitem { struct prt *pp; for (pp=pqueue; pp->pr_link!=NULL; pp=pp->pr_link) ; pp->pr_link = $3; } ; prtitem : IDENT prttag { struct prt *pp; pp = palloc(); pp->pr_sym = lookup($1->lx_u.lxu_name); pp->pr_which = (ent_cell)($2); lfree($1); $$ = pp; } ; prttag : /* empty */ { $$ = P_VALUE; } | '\'' { $$ = P_PRIME; } | '~' { $$ = P_ACERR; erritem = true; } | '!' { $$ = P_ABERR; erritem = true; } | '?' { $$ = P_SSERR; erritem = true; } ; optevery : /* empty */ { sawevery = false; } | EVERY cexpr { sawevery = true; tevery = IROUND($2->lx_u.lxu_value); lfree($2); } ; optfrom : /* empty */ { sawfrom = false; } | FROM cexpr { sawfrom = true; tfrom = $2->lx_u.lxu_value; lfree($2); } ; cexpr : '(' cexpr ')' { $$ = $2; } | cexpr '+' cexpr { CEXOP($1,$3,$$,+=) } | cexpr '-' cexpr { CEXOP($1,$3,$$,-=) } | cexpr '*' cexpr { CEXOP($1,$3,$$,*=) } | cexpr '/' cexpr { CEXOP($1,$3,$$,/=) } | cexpr '^' cexpr { $1->lx_u.lxu_value = pow($1->lx_u.lxu_value,$3->lx_u.lxu_value); lfree($3); $$ = $1; } | SQRT '(' cexpr ')' { CEXFUNC($3,$$,sqrt) } | ABS '(' cexpr ')' { if ($3->lx_u.lxu_value < 0) $3->lx_u.lxu_value = -($3->lx_u.lxu_value); $$ = $3; } | EXP '(' cexpr ')' { CEXFUNC($3,$$,exp) } | LOG '(' cexpr ')' { CEXFUNC($3,$$,log) } | LOG10 '(' cexpr ')' { CEXFUNC($3,$$,log10) } | SIN '(' cexpr ')' { CEXFUNC($3,$$,sin) } | COS '(' cexpr ')' { CEXFUNC($3,$$,cos) } | TAN '(' cexpr ')' { CEXFUNC($3,$$,tan) } | ASINH '(' cexpr ')' { CEXFUNC($3,$$,asinh) } | ACOSH '(' cexpr ')' { CEXFUNC($3,$$,acosh) } | ATANH '(' cexpr ')' { CEXFUNC($3,$$,atanh) } | ASIN '(' cexpr ')' { CEXFUNC($3,$$,asin) } | ACOS '(' cexpr ')' { CEXFUNC($3,$$,acos) } | ATAN '(' cexpr ')' { CEXFUNC($3,$$,atan) } | SINH '(' cexpr ')' { CEXFUNC($3,$$,sinh) } | COSH '(' cexpr ')' { CEXFUNC($3,$$,cosh) } | TANH '(' cexpr ')' { CEXFUNC($3,$$,tanh) } | FLOOR '(' cexpr ')' { CEXFUNC($3,$$,floor) } | CEIL '(' cexpr ')' { CEXFUNC($3,$$,ceil) } | J0 '(' cexpr ')' { CEXFUNC($3,$$,j0) } | J1 '(' cexpr ')' { CEXFUNC($3,$$,j1) } | Y0 '(' cexpr ')' { CEXFUNC($3,$$,y0) } | Y1 '(' cexpr ')' { CEXFUNC($3,$$,y1) } | ERFC '(' cexpr ')' { CEXFUNC($3,$$,erfc) } | ERF '(' cexpr ')' { CEXFUNC($3,$$,erf) } | INVERF '(' cexpr ')' { CEXFUNC($3,$$,inverf) } | LGAMMA '(' cexpr ')' { CEXFUNC($3,$$,F_LGAMMA) } | GAMMA '(' cexpr ')' { CEXFUNC($3,$$,f_gamma) } | NORM '(' cexpr ')' { CEXFUNC($3,$$,norm) } | INVNORM '(' cexpr ')' { CEXFUNC($3,$$,invnorm) } | IGAMMA '(' cexpr ',' cexpr ')' { $3->lx_u.lxu_value = igamma($3->lx_u.lxu_value,$5->lx_u.lxu_value); lfree($5); $$ = $3; } | IBETA '(' cexpr ',' cexpr ',' cexpr ')' { $3->lx_u.lxu_value = ibeta($3->lx_u.lxu_value,$5->lx_u.lxu_value,$7->lx_u.lxu_value); lfree($5); lfree($7); $$ = $3; } | '-' cexpr %prec UMINUS { CEXFUNC($2,$$,-) } | NUMBER { $$ = $1; } ; expr : '(' expr ')' { $$ = $2; } | expr '+' expr { if (TWOCON($1,$3)) COMBINE($1,$3,$$,+=) else BINARY($1,$3,$$,O_PLUS); } | expr '-' expr { if (TWOCON($1,$3)) COMBINE($1,$3,$$,-=) else BINARY($1,$3,$$,O_MINUS); } | expr '*' expr { if (TWOCON($1,$3)) COMBINE($1,$3,$$,*=) else BINARY($1,$3,$$,O_MULT); } | expr '/' expr { if (TWOCON($1,$3)) COMBINE($1,$3,$$,/=) else if (ONECON($3) && $3->ex_value!=0.) { /* division by constant */ $3->ex_value = 1./$3->ex_value; BINARY($1,$3,$$,O_MULT); } else BINARY($1,$3,$$,O_DIV); } | expr '^' expr { double f; bool invert = false; if (TWOCON($1,$3)) { /* case const ^ const */ $1->ex_value = pow($1->ex_value,$3->ex_value); efree($3); } else if (ONECON($1)) { if ($1->ex_value == 1.) { /* case 1 ^ x */ efree($3); $$ = $1; } else goto other; } else if (!ONECON($3)) goto other; else { f = $3->ex_value; if (f < 0.) { /* * negative exponent means * to append an invert cmd */ f = -f; invert = true; } if (f == 2.) { /* case x ^ 2 */ $3->ex_oper = O_SQAR; concat($1,$3); $$ = $1; } else if (f == 3.) { /* case x ^ 3 */ $3->ex_oper = O_CUBE; concat($1,$3); $$ = $1; } else if (f == 0.5) { /* case x ^ .5 */ $3->ex_oper = O_SQRT; concat($1,$3); $$ = $1; } else if (f == 1.5) { /* case x ^ 1.5 */ $3->ex_oper = O_CUBE; BINARY($1,$3,$$,O_SQRT); } else if (f == 1.) { /* case x ^ 1 */ efree($3); $$ = $1; } else if (f == 0.) { /* case x ^ 0 */ efree($1); $3->ex_value = 1.; $$ = $3; } else { other: /* default */ invert = false; BINARY($1,$3,$$,O_POWER); } if (invert) UNARY($$,$$,O_INV) } } | SQRT '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,sqrt) else UNARY($3,$$,O_SQRT); } | ABS '(' expr ')' { if (ONECON($3)) { if ($3->ex_value < 0) $3->ex_value = -($3->ex_value); $$ = $3; } else UNARY($3,$$,O_ABS); } | EXP '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,exp) else UNARY($3,$$,O_EXP); } | LOG '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,log) else UNARY($3,$$,O_LOG); } | LOG10 '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,log10) else UNARY($3,$$,O_LOG10); } | SIN '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,sin) else UNARY($3,$$,O_SIN); } | COS '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,cos) else UNARY($3,$$,O_COS); } | TAN '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,tan) else UNARY($3,$$,O_TAN); } | ASINH '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,asinh) else UNARY($3,$$,O_ASINH); } | ACOSH '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,acosh) else UNARY($3,$$,O_ACOSH); } | ATANH '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,atanh) else UNARY($3,$$,O_ATANH); } | ASIN '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,asin) else UNARY($3,$$,O_ASIN); } | ACOS '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,acos) else UNARY($3,$$,O_ACOS); } | ATAN '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,atan) else UNARY($3,$$,O_ATAN); } | SINH '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,sinh) else UNARY($3,$$,O_SINH); } | COSH '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,cosh) else UNARY($3,$$,O_COSH); } | TANH '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,tanh) else UNARY($3,$$,O_TANH); } | FLOOR '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,floor) else UNARY($3,$$,O_FLOOR); } | CEIL '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,ceil) else UNARY($3,$$,O_CEIL); } | J0 '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,j0) else UNARY($3,$$,O_J0); } | J1 '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,j1) else UNARY($3,$$,O_J1); } | Y0 '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,y0) else UNARY($3,$$,O_Y0); } | Y1 '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,y1) else UNARY($3,$$,O_Y1); } | LGAMMA '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,F_LGAMMA) else UNARY($3,$$,O_LGAMMA); } | GAMMA '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,f_gamma) else UNARY($3,$$,O_GAMMA); } | ERFC '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,erfc) else UNARY($3,$$,O_ERFC); } | ERF '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,erf) else UNARY($3,$$,O_ERF); } | INVERF '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,inverf) else UNARY($3,$$,O_INVERF); } | NORM '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,norm) else UNARY($3,$$,O_NORM); } | INVNORM '(' expr ')' { if (ONECON($3)) CONFUNC($3,$$,invnorm) else UNARY($3,$$,O_INVNORM); } | IGAMMA '(' expr ',' expr ')' { if (TWOCON($3,$5)) { $3->ex_value = igamma($3->ex_value,$5->ex_value); efree($5); $$ = $3; } else BINARY($3,$5,$$,O_IGAMMA); } | IBETA '(' expr ',' expr ',' expr ')' { if (THREECON($3,$5,$7)) { $3->ex_value = ibeta($3->ex_value,$5->ex_value,$7->ex_value); efree($5); efree($7); $$ = $3; } else TERNARY($3,$5,$7,$$,O_IBETA); } | '-' expr %prec UMINUS { if (ONECON($2)) CONFUNC($2,$$,-) else UNARY($2,$$,O_NEG); } | NUMBER { $$ = ealloc(); $$->ex_oper = O_CONST; $$->ex_value = $1->lx_u.lxu_value; lfree($1); } | IDENT { $$ = ealloc(); $$->ex_oper = O_IDENT; $$->ex_sym = lookup($1->lx_u.lxu_name); lfree($1); } ; %% int yyerror (const char *s) { return 0; } /* * tack two queues of stack code together * e1 is connected on the tail of e0 * There is no good way to test for circular * lists, hence the silly count. */ void concat (struct expr *e0, struct expr *e1) { int count; if (e0 == NULL || e1 == NULL) panic ("NULL expression queue"); for (count = 0; e0->ex_next != NULL; e0 = e0->ex_next) if (++count > 10000) panic ("circular expression queue"); e0->ex_next = e1; } /* * print an expression queue * called when EXAMINE is invoked on a variable (see above) */ void prexq (const struct expr *ep) { const char *s; printf (" code:"); if (ep == NULL) putchar ('\n'); for (; ep != NULL; ep = ep->ex_next) { switch (ep->ex_oper) { case O_PLUS: s = "add"; break; case O_MINUS: s = "subtract"; break; case O_MULT: s = "multiply"; break; case O_DIV: s = "divide"; break; case O_POWER: s = "power"; break; case O_SQRT: s = "sqrt"; break; case O_EXP: s = "exp"; break; case O_LOG: s = "log"; break; case O_LOG10: s = "log10"; break; case O_SIN: s = "sin"; break; case O_COS: s = "cos"; break; case O_TAN: s = "cos"; break; case O_ASIN: s = "sin"; break; case O_ACOS: s = "cos"; break; case O_ATAN: s = "cos"; break; case O_NEG: s = "negate"; break; case O_ABS: s = "abs"; break; case O_SINH: s = "sinh"; break; case O_COSH: s = "cosh"; break; case O_TANH: s = "tanh"; break; case O_ASINH: s = "asinh"; break; case O_ACOSH: s = "acosh"; break; case O_ATANH: s = "atanh"; break; case O_SQAR: s = "square"; break; case O_CUBE: s = "cube"; break; case O_INV: s = "invert"; break; case O_FLOOR: s = "floor"; break; case O_CEIL: s = "ceil"; break; case O_J0: s = "besj0"; break; case O_J1: s = "besj1"; break; case O_Y0: s = "besy0"; break; case O_Y1: s = "besy1"; break; case O_ERF: s = "erf"; break; case O_ERFC: s = "erfc"; break; case O_INVERF: s = "inverf"; break; case O_LGAMMA: s = "lgamma"; break; case O_GAMMA: s = "gamma"; break; case O_NORM: s = "norm"; break; case O_INVNORM: s = "invnorm"; break; case O_IGAMMA: s = "igamma"; break; case O_IBETA: s = "ibeta"; break; case O_CONST: printf ("\tpush "); prval (ep->ex_value); putchar ('\n'); s = NULL; break; case O_IDENT: printf ("\tpush \"%.*s\"\n", NAMMAX, ep->ex_sym->sy_name); s = NULL; break; default: s = "unknown!"; } if (s != NULL) printf ("\t%s\n",s); } } plotutils-2.6/ode/lex.l0000644000175000017500000000532211037240625012057 00000000000000%C %{ /* * Copyright Nicholas B. Tufillaro, 1982-1994. All rights reserved. * * GNU enhancements Copyright (C) 1996, 1997, 1998, 1999, 2005, 2008, Free * Software Foundation, Inc. */ #include "sys-defines.h" #include "ode.h" #include "extern.h" #include "gram.h" int curline = 1; %} Dig [0-9] Expo ([eE][-+]?{Dig}{Dig}?{Dig}?) %% \#.*$ ; /* N.B.: comments can't be continued */ \\\n { curline++; } [ \t] ; [;\n] { yylval.lexptr = lalloc(); yylval.lexptr->lx_lino = curline; if (*yytext == '\n') curline++; return SEP; } PI { yylval.lexptr = lalloc(); yylval.lexptr->lx_u.lxu_value = M_PI; return NUMBER; } ^\.$ { /* lonely . isn't EOF in a -f file */ if (yyin == stdin) return EOF; REJECT; } every { return EVERY; } from { return FROM; } print { return PRINT; } step { return STEP; } examine { return EXAM; } abs { return ABS; } sqrt { return SQRT; } exp { return EXP; } log10 { return LOG10; } ln { return LOG; } log { return LOG; } sin { return SIN; } cos { return COS; } tan { return TAN; } asinh { return ASINH; } acosh { return ACOSH; } atanh { return ATANH; } asin { return ASIN; } acos { return ACOS; } atan { return ATAN; } sinh { return SINH; } cosh { return COSH; } tanh { return TANH; } floor { return FLOOR; } ceil { return CEIL; } besj0 { return J0; } besj1 { return J1; } besy0 { return Y0; } besy1 { return Y1; } erfc { return ERFC; } erf { return ERF; } inverf { return INVERF; } lgamma { return LGAMMA; } gamma { return GAMMA; } norm { return NORM; } invnorm { return INVNORM; } ibeta { return IBETA; } igamma { return IGAMMA; } [_a-zA-Z][_a-zA-Z0-9]* { yylval.lexptr = lalloc(); strncpy(yylval.lexptr->lx_u.lxu_name,yytext,NAMMAX); return IDENT; } {Dig}+{Expo}? | {Dig}+"."{Dig}*{Expo}? | {Dig}*"."{Dig}+{Expo}? { /* * restrictions on numbers: * radix 10 only * a bare Expo isn't enough (matches IDENT) */ yylval.lexptr = lalloc(); yylval.lexptr->lx_u.lxu_value = atof(yytext); return NUMBER; } [-+*/^()',=?~!] { /* * accept as few as possible so the error * message can be a smart one */ return yytext[0]; } . { if (*yytext > '~' || *yytext < ' ') fprintf (stderr, "%s:%s:%d: bad char '\\%02o'\n", progname, filename, curline, *yytext&0377); else fprintf (stderr, "%s:%s:%d: bad char '%c'\n", progname, filename, curline, *yytext); return *yytext; } %% /* * space management for the lexer */ struct lex * lalloc (void) { struct lex *lp; lp = (struct lex *)xmalloc (sizeof(struct lex)); lp->lx_u.lxu_value = 0.0; lp->lx_lino = 0; return lp; } void lfree (struct lex *lp) { if (lp != NULL) free ((void *)lp); } plotutils-2.6/ode/INTERNALS0000644000175000017500000001341306402617746012410 000000000000001. Language Implementation Details The ode input language is implemented with a bison-generated parser and a flex-generated lexical analyzer. The benefits of this approach are great. The original version of the basic recognizer was completed in about two days. And adding comments to the language required that exactly one line of the lexical analyzer source code be changed. Differential equations are compiled into linked lists of stack operations, one list per dynamic variable. The function evaluator (eval) traverses one of these lists, applying the indicated operations to a small operand stack. At the completion of the traverse, the new derivative is on top of the stack. The routine pops and returns this result. Another routine (field) is called by the numerical routines whenever a re-evaluation of the gradient is required. It calls eval() for each dynamic variable in turn. Changes to the language involve modifications to the bison grammar, the flex rules, and/or the semantics stored with the grammar and rules. The steps required to add a new builtin function, for example, are (aside from writing the function itself) as follows. (1) Invent a new terminal symbol name for the reserved word. (2) Add the new reserved word to the flex rules. (3) Add the new productions to the right-hand side of "expr" in the grammar, together with whatever semantic action is required (using the included macros if possible). (4) Define a new value for exper and add the stack code to eval. 2. Numerical Schemes The numerical and language procedures were designed in accordance with the Jesuit maxim. The major elements manipulated by both are the symbol table, and the functions field() and printq(). Addition of a new numerical scheme requires that the numerical routine be written, and perhaps that some fields inside the symbol table entry be expanded or added. None of these changes affects the performance or compromise the integrity of the parser, although they may change the space-cost of a dynamic variable. Similarly, modifications to the lexical analyzer or the grammar only affect the parse tables and related data structures, and have no effect on the numerical routines. At each step the numerical scheme fills each symbol table entry with relevant values. Then a call to field() evaluates every differential equation and puts the result in the symbol table element syrime. The evaluator gets current values for the dynamics from the field syalue. Both syalue and syrime are in some sense temporary variables. All correct results eventually find their way into syal[0] and syri[0]; these are never touched by the language processor. Thus the real interface between the language and numerical procedures is merely syalue and syrime. It is important to maintain meaningful values in syalue and syrime, since a floating-point exception may disrupt the control flow at any moment. It is recommended that the pointer fsp be used in traversing the symbol table, so that arithmetic exceptions can be diagnosed as accurately as possible. Fourth and fifth order schemes were chosen as the best compromise between speed and accuracy. The adaptive stepsize has proved a boon in both areas. 3. Details of Error and Fault Recovery Command-line errors are diagnosed at initialization time and are generally fatal. Errors in the input stream are diagnosed during the lexical scan or at parse time. They elicit an appropriate message. The error recovery method used in the parser is the vanilla Yacc scheme. (see S. Johnson, "Yacc: Yet Another Compiler-Compiler", 1978, pp. 16-18). Run-time errors are detected by the function evaluator, the numerical routines, or the floating-point unit hardware. In each case a message is printed describing the error, and ode returns to a known state awaiting input. The current step is abandoned, but all variable values are left reflecting the state of the machine just prior to the fault. All of the numerical schemes scan the symbol table, computing values for each dynamic variable, using a common pointer known to the error recovery routines named fsp. This pointer provides a way of identifying the offending dynamic variable when a trap occurs. 4. Space Utilization The data space used in numerically solving a system of ODEs consists of both fixed and dynamic regions. The fixed space is used efficiently regardless of the complexity of the problem being solved. The dynamic space contains the symbol table, the expression lists, and several other data structures whose sizes vary. The space for these structures comes out of a common pool; they play against each other. Every identifier in an ODE description requires 254 bytes; this space can never be reclaimed. Each operator in an equation costs 14 bytes. For the sake of speed, some operators are expanded into a sequence of simpler operations, each of which requires 14 bytes. In particular, some common powers are reduced to sequences of square roots, squares, cubes, and inversions. The extent of these transformations can be seen with the help of the `examine' statement. The operator space for an equation is reclaimed whenever a new equation is defined for that particular dynamic variable. Each lexical token in the most complex statement costs 10 bytes, but this space is reclaimed during the scan. Thus, the most complex statement circumscribes this requirement. Each element in a `print' statement costs 6 bytes. Upon execution of the next `print' statement this space is reclaimed. In addition to these absolute space limitations, the maximum depth of the operand stack used for evaluating derivatives is 30 cells. This limit could conceivably be exceeded for a very complex differential equation. The solution is to simplify the equation if possible, and where not, to recompile ode with a larger operand stack. plotutils-2.6/ode-examples/0000777000175000017500000000000011257257507013023 500000000000000plotutils-2.6/ode-examples/README0000644000175000017500000000135411037240774013614 00000000000000This directory contains sample input files for `ode', originally written by Nicholas B. Tufillaro 1982-1994 . GNU enhancements by Robert S. Maier , copyright (C) 1996-2008 Free Software Foundation, Inc. Documentation, and instructions on how to run `ode' and display the resulting output, appears at the head of each file. The documentation in each of the files refers to `graph -T X', the command that will display a graph in a window on an X Window System display. You may substitute `graph -T ps' to obtain Postscript output, `graph -T tek' to draw the plot in a Tektronix emulator window, and so forth. The file lunar.sh is an executable shell script that calls `ode', rather than an `ode' input file. plotutils-2.6/ode-examples/Makefile.am0000644000175000017500000000064410341763455014774 00000000000000odedatadir = $(datadir)/ode odedata_DATA = README atwoods.ode bead.ode chem.ode coupled.ode ddho.ode \ dynamo.ode henon.ode limitcycle.ode lorenz.ode lunar.sh orbit.ode \ population.ode qcd.ode rumor.ode soliton.ode viscous.ode EXTRA_DIST = atwoods.ode bead.ode chem.ode coupled.ode ddho.ode \ dynamo.ode henon.ode limitcycle.ode lorenz.ode lunar.sh orbit.ode \ population.ode qcd.ode rumor.ode soliton.ode viscous.ode plotutils-2.6/ode-examples/Makefile.in0000644000175000017500000002436611234210075014777 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = ode-examples DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(odedatadir)" odedataDATA_INSTALL = $(INSTALL_DATA) DATA = $(odedata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ odedatadir = $(datadir)/ode odedata_DATA = README atwoods.ode bead.ode chem.ode coupled.ode ddho.ode \ dynamo.ode henon.ode limitcycle.ode lorenz.ode lunar.sh orbit.ode \ population.ode qcd.ode rumor.ode soliton.ode viscous.ode EXTRA_DIST = atwoods.ode bead.ode chem.ode coupled.ode ddho.ode \ dynamo.ode henon.ode limitcycle.ode lorenz.ode lunar.sh orbit.ode \ population.ode qcd.ode rumor.ode soliton.ode viscous.ode all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ode-examples/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ode-examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-odedataDATA: $(odedata_DATA) @$(NORMAL_INSTALL) test -z "$(odedatadir)" || $(MKDIR_P) "$(DESTDIR)$(odedatadir)" @list='$(odedata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(odedataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(odedatadir)/$$f'"; \ $(odedataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(odedatadir)/$$f"; \ done uninstall-odedataDATA: @$(NORMAL_UNINSTALL) @list='$(odedata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(odedatadir)/$$f'"; \ rm -f "$(DESTDIR)$(odedatadir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(odedatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-odedataDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-odedataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-odedataDATA \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-odedataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: plotutils-2.6/ode-examples/atwoods.ode0000644000175000017500000000336506540742517015116 00000000000000# This example simulates a `swinging Atwood's machine'. An Atwood's # machine consists of two masses joined by a taut length of cord. The cord # is suspended from a pulley. The heavier mass (M) would normally win # against the lighter mass (m), and pull it upward. A `swinging' Atwood's # machine is an Atwood's machine with an additional degree of freedom: it # allows the lighter mass to swing back and forth in a plane, at the same # time as it is being drawn upward. # Let `a' denote the angle by which the cord extending to the lighter mass # deviates from the vertical. Let `l' denote the distance along the cord # between the pulley and the lighter mass. Then the system of differential # equations below will describe the evolution of the system. # You may run this example, with output to an X window in real time, by doing # # ode < atwoods.ode | graph -T X -x 9 11 -y -1 1 -m 0 -S 1 # # The plot will trace out `l' and `ldot' (its time derivative). The `-m 0 # -S 1' option requests that successive datapoints not be joined by line # segments, but rather that marker symbol #1 (a point) be plotted at the # location of each datapoint. # You may have some difficulty believing the results of this simulation. # Allowing the lighter mass to swing, it turns out, may prevent the heavier # mass from winning against it. The system may oscillate, # non-periodically. m = 1 # lighter mass M = 1.0625 # heavier mass a = 0.5 # initial angle of cord from vertical, in radians adot = 0 l = 10 # initial distance along cord from pulley to mass m ldot = 0 g = 9.8 # acceleration due to gravity ldot' = ( m * l * adot * adot - M * g + m * g * cos(a) ) / (m + M) l' = ldot adot' = (-1/l) * (g * sin(a) + 2 * adot * ldot) a' = adot print l, ldot step 0, 400 plotutils-2.6/ode-examples/bead.ode0000644000175000017500000000102706540742560014320 00000000000000# This example simulates a bead sliding on a smooth circular wire. The # output displays the height of the bead as a function of time. # # You may run this example by doing: # # ode < bead.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < bead.ode | graph -T X -C -x 0 5 -y 0 2.5 # a = 1 # radius of circular wire g = 10 # acceleration due to gravity w = 10 # angular velocity of circular wire the' = vthe vthe' = (w^2)*sin(the)*cos(the) - (g/a)*sin(the) the = 0.1 vthe = 0 print t, the step 0,5 plotutils-2.6/ode-examples/chem.ode0000644000175000017500000000145206540742666014352 00000000000000# This example does a chemical kinetics simulation, for the reaction: # # A + 2B <==> C --> D # # The output displays the concentration of the species `C' # as a function of time. # # You may run this example by doing: # # ode < chem.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < chem.ode | graph -T X -C -x 0 10 -y 0 0.03 # # To improve the shape of the plotted curve, you may # wish to spline it, by doing e.g. # # ode < chem.ode | spline | graph -T X -C # # Alternatively, you could remove the `every 10' clause below. # The three rate constants are: # kf : A + 2B --> C # kb : C --> A + 2B # kd : C --> D a' = kb*c - kf*a*b^2 b' = kb*c - kf*a*b^2 c' = kf*a*b^2 - kb*c - kd*c d' = kd*c c = 0 d = 0 a = 0.1 b = 1 kf = 1 kb = 1 kd = 1 print t,c every 10 step 0,10 plotutils-2.6/ode-examples/coupled.ode0000644000175000017500000000154006540742744015064 00000000000000# This example simulates two similar pendulums, coupled with a horizontal # spring. The motion is taken to be undamped. # # The plot shows the displacement of one of the pendulums, as a function of # time. It illustrates how energy (e.g. maximum displacement) oscillates # back and forth between the two. # You may run this example by doing: # # ode < coupled.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < coupled.ode | graph -T X -C -x 0 50 -y -0.6 0.6 # The equations are: # m*x1'' = - m*g*x1/l + k(x2 - x1) # m*x2'' = - m*g*x2/l - k(x2 - x1) xone' = vxone xtwo' = vxtwo vxone' = -g*xone/lone + k/mone * ( xtwo - xone) vxtwo' = -g*xtwo/ltwo - k/ltwo * ( xtwo - xone) k = 1 g = 9.8 # acceleration due to gravity lone = 5 ltwo = 5 mone = 1 mtwo = 1 xone = 0.0 xtwo = 0.3 vxone = 0 vxtwo = 0 print t, xone step 0,50 plotutils-2.6/ode-examples/ddho.ode0000644000175000017500000000120406540743552014342 00000000000000# You may run this example by doing: # # ode < ddho.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < ddho.ode | graph -T X -C -x 0 25 -y -0.5 1 0.5 # # This example simulates a dam-driven harmonic oscillator (DDHO) with # damping, the equation for which is # # y'' = -k/m * y - R/m * y' + cos(w*t) # # If R^2 > 4km, motion is overdamped # If R^2 = 4km, motion is critically damped # If R^2 < 4km, motion is damped # # With the choice of parameters below, motion is damped but not # overdamped. y' = vy vy' = -k/m * y - R/m * vy + cos(w*t) y = 1 vy = 0 k = 1 m = 1 R = 0.5 w = 2*PI print t, y step 0,25 plotutils-2.6/ode-examples/dynamo.ode0000644000175000017500000000125206540743017014712 00000000000000# This is a disk dynamo simulation of the earth's magnetic field. # It attempts to simulate the dramatic switch in the polarity # of the field that takes place every eon or so. # # Source: Michael Steele, B.A. thesis, Reed College, 1981 (Physics) # You may run this example by doing: # # ode < dynamo.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < dynamo.ode | graph -T X -C -x 0 10 -y -10 10 # # The equations are: # # w' = Q -zy - Vw # y' = S( Az - y) # z' = wy - z # S = 5 # V = 1 # Q = 14.625 # A = 1 A = 1 V = 1 Q = 14.625 S = 5 w' = Q - z * y - V * w y' = S * ( A * z - y) z' = w * y - z w = 1 y = 1 z = 1 print t, z step 0, 10, .01 plotutils-2.6/ode-examples/henon.ode0000644000175000017500000000122606540743046014535 00000000000000# You may run this example by doing: # # ode < henon.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < henon.ode | graph -T X -C -x -0.6 0.6 -y -0.6 0.6 # # This example shows a simple center with complicated orbits: # the system investigated by Henon and Heiles. # The Poincare plot is a graph of p1(t) vs. q1(t). # Initial condations: # stable: p1 = 1/3, q1 = 1/4, p2 = 0.1293144, q2 = 1/5 # unstable: p1 = 0.1, q1 = 0.1, p2 = 0.467618, q2 = 0.1 qone' = pone qtwo' = ptwo pone' = -qone - 2*qone*qtwo ptwo' = -qtwo - qone*qone + qtwo*qtwo pone = 1/3 qone = 1/4 ptwo = 0.1293144 qtwo = 1/5 print pone, qone step 0,250 plotutils-2.6/ode-examples/limitcycle.ode0000644000175000017500000000132206540743304015556 00000000000000# This example shows a nonlinear system with a stable limit cycle. # You may run it by typing # ode -f limitcycle.ode | graph -T X -C -x -2 2 -y -2 2 # step 0,2 # step 2,4 # step 4,6 # step 6,8 # . # An orbit converging on the limit cycle will be traced out incrementally. # If you are using a color X Window System display, each segment of the # orbit will be a different color. This is a feature provided by `graph', # which normally changes the linemode after each dataset it reads. If you # do not like this feature, you may turn it off by using `graph -B' instead # of `graph'. yone' = yone + ytwo - yone*(yone*yone+ytwo*ytwo) ytwo' = -yone + ytwo - ytwo*(yone*yone+ytwo*ytwo) yone = 1 ytwo = 2 print yone, ytwo plotutils-2.6/ode-examples/lorenz.ode0000644000175000017500000000137506540743155014745 00000000000000# This example displays a beautiful strange attractor: the Lorenz # attractor. # You may run this example by doing: # # ode < lorenz.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < lorenz.ode | graph -T X -C -x -10 10 -y -10 10 # # You may also produce and print a Postscript version by doing # # ode < lorenz.ode | graph -T ps -C -x -10 10 -y -10 10 -W 0 | lpr # # The `-W 0' sets the line width for the Postscript plot to # be zero. That means that the thinnest line possible will be used. # The Lorenz model, a third order system. # Interesting cases are r = 26, 2.5&2 if read thrust; then :; else break; fi echo -n " duration (sec): " 1>&2 if read dur; then :; else break; fi echo "y=$height;v=$vel;thrust=$thrust;m=$fuel+1000 print y,v,m from $dur;step 0,$dur" done) | ode -r 1e-5 | while read height vel mass; do echo $mass echo "velocity=${vel}m/sec; mass=${mass}kg" echo $mass fuel=`echo "5k$mass 1000-pq"|dc` case $fuel in -*|0) echo out of fuel; exit 1 ;; *) echo fuel=${fuel}kg ;; esac case $height in -*|0) case $vel in -[0-9][0-9]*) echo too fast; exit 1 ;; *) echo good landing; exit 0 ;; esac ;; *) echo height=${height}m ;; esac done plotutils-2.6/ode-examples/orbit.ode0000644000175000017500000000201406540743564014546 00000000000000# This example does a planetary orbit simulation, with two suns situated at # (0,0) and (-5,0) and one planet starting out at (1,0). You may run it by # typing # ode -f orbit.ode | graph -T X -C -y -1 3 -x -6 2 # step 0,10 # step 10,20 # step 20,30 # step 30,40 # step 40,50 # step 50,60 # . # The planet's orbit will be traced out incrementally. If you are using a # color X Window System display, each segment of the orbit will be a # different color. This is a feature provided by `graph', which normally # changes the linemode after each dataset it reads. If you do not like this # feature, you may turn it off by using `graph -B' instead of `graph'. # x and y are positions # vx and vy are velocities vx' = -x/((x^2+y^2)^(3/2)) -(x+5)/(((x+5)^2+y^2)^(3/2)) vy' = -y/((x^2+y^2)^(3/2)) -y/(((x+5)^2+y^2)^(3/2)) y' = vy x' = vx x = 1 y = 0 print x,y every 5 # these values seem to give a nice orbit: # vx = 0 # vy = 1.142 # a more exciting result can be obtained from: vx = 0 vy = 1.165 #step 0,20 plotutils-2.6/ode-examples/population.ode0000644000175000017500000000114006540743336015615 00000000000000# This is an example from population biology (the predator-prey # equations of Lotka and Volterra). You may run it by doing: # # ode < population.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < population.ode | graph -T X -C -x 0 10 -y 0 3 # # The plot shows the population of the prey as a function of time. # The curve oscillates, because as the prey die out, the predators # starve. # The differential equations are: # x' = (A - By) x # y' = (Cx - D) y # A,B,C,D > 0 x' = (A - B*y) * x y' = (C*x - D) * y A = 1 B = 1 C = 1 D = 1 x = 3 y = 1 print t, x step 0, 10 plotutils-2.6/ode-examples/qcd.ode0000644000175000017500000000054506540743370014200 00000000000000# You may run this example by doing # # ode < qcd.ode | graph -T X -C # # This simulates a coupled system of ordinary differential equations that # arises in the mathematical theory of quantum chromodynamics (QCD). # # Source: Griffiths et al., J. Math. Phys. f' = fp fp' = -f*g*g g' = gp gp' = g*f*f f = 0 fp = -1 g = 1 gp = -1 print t, f step 0, 5 plotutils-2.6/ode-examples/rumor.ode0000644000175000017500000000241306540743421014566 00000000000000# This example simulates the spread of a rumor through a closed # population. The percentage of people who have not heard the # rumor, as a function of time, is plotted. # # You may run this example by doing: # # ode < rumor.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < rumor.ode | graph -T X -C -x 0 .25 -y 0 100 # The theoretical background for this model is as follows. # # Suppose a rumor spreads through a closed population of constant size # N+1. At time t the total population can be classified into three categories: # x persons who are ignorant of the rumor; # y persons who are actively spreading the rumor; # z persons who have heard the rumor but have stopped spreading it; # # Suppose that if two persons who are spreading the rumor meet then they stop # spreading it. # Suppose also that the contact rate between any two categories is constant, u. # # The equations # x' = -u * x * y, # y' = u * (x*y - y*(y - 1) - y*z) # give a deterministic model of the problem. # # When initially y = 1 and x = N, the number of people # who ultimately never hear the rumor is s, where s satisfies # 2N + 1 - 2s + N log(s/N) = 0. x' = -u * x * y y' = u * (x*y - y*(y-1) - y*( 100 + 1 - y - x)) x = 100 y = 1 u = 1 print t, x step 0, 0.25 plotutils-2.6/ode-examples/soliton.ode0000644000175000017500000000066006540743452015117 00000000000000# You may run this example by doing: # # ode < soliton.ode | graph -T X -C # # or alternatively, to create a real-time plot, # # ode < soliton.ode | graph -T X -C -x 5 15 5 -y -3 3 # This example numerically solves an initial value problem arising in # John Selker's soliton thesis: # # x'' = (2 / t) * x' + B * x # B = -1 # x(5) = 0 # x'(5) = 1 x' = vx vx' = 2 / t * vx + B * x B = -1 x = 0 vx = 1 print t, x step 5, 15 plotutils-2.6/ode-examples/viscous.ode0000644000175000017500000000126106540743507015122 00000000000000# This example simulates a bead sliding on a smooth circular wire. The # output displays the height of the bead as a function of time. There is # viscous damping, so the bead should settle toward the equilibrium point # (i.e. ordinate = 0). # You may run this example by doing: # # ode < viscous.ode | graph -T X -C # # or alternatively, to get a real-time plot, # # ode < viscous.ode | graph -T X -C -x 0 20 -y 0 2.5 a = 1 # radius of circular wire g = 10 # acceleration due to gravity w = 10 # angular velocity of circular wire b = 1 # damping coefficient the' = vthe vthe' = (w^2)*sin(the)*cos(the) - (g/a)*sin(the) - b * vthe the = 0.1 vthe = 0 print t, the step 0, 20 plotutils-2.6/libplot/0000777000175000017500000000000011257257513012102 500000000000000plotutils-2.6/libplot/README0000644000175000017500000002351310356645726012710 00000000000000This directory holds the source files for a C/C++ 2-D vector graphics library: GNU libplot/libplotter. It is distributed under the GNU GPL (see the file ../COPYING). The library provides a uniform interface to numerous display devices and output formats. The interface presents each output device as a opaque `Plotter' object: a virtual pen plotter. Each of libplot's output drivers is accessed at run time through an Plotter object of the appropriate type. Many types of Plotter are supported: Metafile, Tektronix, ReGIS, HP-GL/2, PCL 5, xfig, CGM (by default, WebCGM), idraw-editable Postscript, Adobe Illustrator, SVG, GIF, PNM (i.e. PBM/PGM/PPM), PNG, X Drawable, and X. All but the final two write graphic output to an output stream. The final two draw graphics by calling X routines. The X Drawable driver draws graphics in one or two `drawables' (windows or pixmaps), which must be passed to it via pointers, as Plotter parameters. The X driver pops up a window (actually, a Label widget) on an X display, and draws graphics in it. The names of the source files include as prefix a letter indicating which driver they include code for. For example, the file h_openpl.c is part of the HP-GL/2 driver, and contains low-level code which is called when the API function pl_openpl_r() is invoked on an HP-GL/2 or PCL 5 Plotter. Namely, it contains the _pl_h_begin_page() function. As prefixes, m=Metafile, t=Tektronix, r=ReGIS, h=HP-GL[/2] and PCL 5, f=Fig, c=CGM, p=Postscript, a=Adobe Illustrator, s=SVG, i=GIF, n=PNM, z=PNG, x=XDrawable, and y=X. (Actually, XPlotters use mostly XDrawablePlotter methods.) The many files whose names begin with `g' (e.g., g_relative.c) contain generic code, i.e. code used by the base Plotter class from which all other classes are derived. Similarly, `b' files contain code for a generic bitmap Plotter class, from which the PNM and PNG Plotter classes are derived. The library comes in two versions: libplot, which provides two C APIs (an old non-thread-safe API, and a new thread-safe API), and libplotter, which is a full-fledged C++ class library. They are compiled in separate directories (respectively, in this directory and in ../libplotter). However, the same source files are used in both libraries. That is a bit remarkable. It is arranged in the the two key header files ../include/plotter.h and ./extern.h. If LIBPLOTTER is defined and a C++ compiler is used, a C++ class library results. Otherwise, a conventional C function library results. There are a lot of conditionalizations in those two header files. In libplot, a Plotter is implemented as a C-style struct. Each such struct includes approximately 20 function pointers: one function pointer for each of the low-level functions that define the semantics of the Plotter. It is by dereferencing these function pointers that polymorphism is implemented in libplot. The initialization of the `function pointer part' of each Plotter is contained in the corresponding ?_defplot.c file. At present, the low-level functions include initialize terminate begin_page erase_page end_page push_state pop_state paint_path paint_paths path_is_flushable maybe_prepaint_segments paint_marker paint_point paint_text_string_with_escapes paint_text_string get_text_width retrieve_font flush_output warning error For an explanation of the functionality of each of the above, see the comments in ../include/plotter.h. Here are some more details on how polymorphism is implemented. In libplot, each API function or internal Plotter method takes a pointer to a Plotter struct as its first argument. In the code, this pointer argument is always written as `_plotter'. It's the function pointers in `_plotter' that are dereferenced, when performing any low-level operation. For example, in the libplot code you may see a function invocation like `_plotter->begin_page(...)'. This will (1) dereference the `_plotter' pointer to get a Plotter, and (2) dereference the function pointer in the Plotter to find the Plotter-specific implementation of the low-level operation `begin_page()'. This would be _pl_h_begin_page() if `_plotter' points to an HP-GL/2 or PCL Plotter, for example. The two special files apinewc.c and apioldc.c, which alone among the source files are included in libplot but not libplotter, define the libplot API. Each function in the new (thread-safe) API takes as first argument a pointer to a Plotter struct to which the Plotter operations should be applied. It is this pointer which is passed down to the low-level code as `_plotter'. Each function in the old (non-thread-safe) API acts on a Plotter which is globally selected by calling the function pl_selectpl(). Both old and new C APIs include functions like pl_newpl[_r]() and pl_deletepl[_r](), which create and destroy Plotters. The C++ binding, i.e. the libplotter C++ class library, is easier to understand. There is a generic Plotter class and derived classes that are declared in ../include/plotter.h. These classes include as public members the API functions, such as openpl(), and low-level device-specific functions, such as begin_page(), which are protected and virtual. All this is arranged by a *lot* of conditional #defines in ../include/extern.h. For example, if LIBPLOTTER is defined then the internal function _h_begin_page is redefined to be HPGLPlotter::begin_page, which overrides the generic begin_page method, which is a no-op. Also, if LIBPLOTTER is defined then the Plotter methods don't all have a special first argument called `_plotter'. By the magic of the C/C++ preprocessor, the first argument disappears. And in the code for each method, `_plotter' is redefined to be `this', i.e. a pointer to the Plotter whose operation is being invoked. Believe it or not, it works: the same source files can be used in the compilation of both libplot and libplotter. A further implementation note: in libplot, any Plotter contains a `tag field', identifying its type (X11, PS, PCL5, etc.). This tag field is used only in libplot, and only by a very few forwarding functions, so if -DLIBPLOTTER is used, it's #ifdef'd out. (See ../include/plotter.h.) Other than that, the data members are essentially the same in the libplot Plotter struct as they are in the libplotter Plotter class. Actually, it's a bit more complicated. In libplot, each Plotter struct, no matter what its type, contains essentially the same data members. But there are a lot of data members, some of them which are relevant to all Plotters (e.g., `line_type') and some of which are specific to individual types of Plotter (e.g., `hpgl_line_type', which keeps track of an HP-GL display device's internal state). That means there's a lot of redundancy (an XPlotter struct, for example, contains all the private data members that an HPGLPlotter uses, but never uses them). In libplotter, the design is cleaner: each of the many data members which in libplot are contained in every Plotter struct is moved to the appropriate derived class. So `hpgl_line_type' is a data member of the HPGLPlotter class, but not of the base (generic) Plotter class, or any of its other subclasses. That's arranged by extensive #ifdef's in ../include/plotter.h. It's a bit awkward though: each data member needs to be declared twice in that file. Adding support for a new type of display device or output file format, given the object-oriented way that libplot/libplotter is structured, is easy. A new type of Plotter, derived from the base Plotter class, would be declared in ../include/plotter.h. If it needs any private data members, which it probably will, they would be declared in two places in that file, as just mentioned. Also, conditional #defines for the methods used by the new Plotter (to distinguish libplot from libplotter) would be added at the end of ./extern.h. A `defplot' file for the new Plotter type would need to be written too. Besides low-level initialize() and terminate() routines for the new Plotter type, it would include, for the benefit of libplot, an initialization routine for the part of the Plotter struct that contains low-level device-specific functions. (See, for example, the initializing structure _pl_h_default_plotter in the file h_defplot.c, as well as the routines _pl_h_initialize and _pl_h_terminate.) The new Plotter initialization would need to be added to the _plotter_data[] table in apinewc.c, which is specific to libplot. No such initialization is required for libplotter, since the C++ compiler itself initializes any instance of a derived Plotter class. To see how easy it is to add or remove support for a Plotter type, search for the symbol X_DISPLAY_MISSING. If this is defined, support for X Drawable Plotters and X Plotters will be dropped at compile time. The only occurrences in the code of tests like `#ifdef X_DISPLAY_MISSING' are in the header files ../include/plotter.h and ./extern.h, in apinewc.c, and in g_defstate.c. And the only reason for the appearance of X_DISPLAY_MISSING in g_defstate.c is that the drawing state structure initialization located in that file contains some X-specific fields, which need to be omitted if X support is dropped. That's because they rely on symbols defined in X11 header files. Up to now we haven't mentioned drawing states, but every Plotter includes a pointer to a stack of them. Drawing states, which are structs in both libplot and libplotter, contain numerous fields that are specific to individual types of Plotter. The reason device-specific information is kept in the drawing state struct is that it's convenient. For example, when the user-frame line width is changed, the device-frame line width changes too. Rather than compute the device-frame line width each time a graphical object is drawn, it's easier to store it in the drawing state. There are many other such examples (see the declaration of the drawing state structure as the `plDrawstate' typedef in ../include/plotter.h). plotutils-2.6/libplot/extern.h0000644000175000017500000034466111234142426013501 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This is the chief include file for GNU libplot/libplotter. It supplements the include files ../include/sys-defines.h, ../include/plot.h and ../include/plotter.h. plot.h is libplot-specific, but plotter.h is included both in libplot and libplotter. plotter.h defines what a Plotter object is (a struct for libplot, but a class for libplotter). */ /* This file contains many #defines and declarations of data structures. More importantly, it contains declarations of all the Plotter methods. They are declared differently, depending on whether we are compiling libplot (signalled if NOT_LIBPLOTTER is #defined) or libplotter. In libplot, the plotter operations are implemented as global functions that are members of the Plotter struct. They are set up differently for the different types of Plotter; for example, the `openpl' slot in the struct contains the method _pl_g_openpl for generic [i.e. base] Plotters, the method _pl_m_openpl for MetaPlotters, etc. The files ?_defplot.c contain the initializations that are used for the different types of Plotter. In this file, if NOT_LIBPLOTTER is defined then each of these many methods is declared as a global function. In libplotter, the different types of Plotter are implemented as distinct classes, which are derived from the generic [i.e. base] Plotter class. This file contains a great many #defines that are appropriate to that situation. For example, _pl_m_openpl is #defined to be MetaPlotter::openpl if NOT_LIBPLOTTER is not defined. The MetaPlotter class, like all other Plotter classes, is defined in plotter.h. */ /*************************************************************************/ /* INCLUDE FILES */ /*************************************************************************/ /* 1. OUR OWN INCLUDE FILE */ /* Determine which of libplot/libplotter this is. */ #ifndef LIBPLOTTER #define NOT_LIBPLOTTER #endif /* Always include plotter.h. (If NOT_LIBPLOTTER is defined, it's a C-style header file, declaring the Plotter struct, rather than a declaration file for the Plotter class.) */ #include "plotter.h" /* 2. INCLUDE FILES FOR THE X WINDOW SYSTEM */ #ifndef X_DISPLAY_MISSING #include #include /* included also in plotter.h */ #include #include #include #ifdef HAVE_X11_EXTENSIONS_MULTIBUF_H #include #endif #ifdef HAVE_X11_EXTENSIONS_XDBE_H #include #endif #ifdef USE_MOTIF #include #else #include #endif #endif /* not X_DISPLAY_MISSING */ /*************************************************************************/ /* DEFINITIONS RELATED TO OUR FONT DATABASE (g_fontdb.c and g_fontd2.c) */ /*************************************************************************/ /* The types of font we support. The final type (`other') is a catchall, currently used for any user-specified font, with a name not contained in our font database, that can be retrieved from an X server. */ #define PL_F_HERSHEY 0 #define PL_F_POSTSCRIPT 1 #define PL_F_PCL 2 #define PL_F_STICK 3 #define PL_F_OTHER 4 /* PL_NUM_PS_FONTS and PL_NUM_PCL_FONTS should agree with the number of fonts of those two types found in g_fontdb.c/g_fontd2.c. These are also defined in plotter.h. */ #define PL_NUM_PS_FONTS 35 #define PL_NUM_PCL_FONTS 45 /* Default fonts, of each type. Any Plotter has a `default_font_type' field, and the appropriate values are copied into the Plotter drawing state when the Plotter is first opened (see g_savestate.c). The typeface and font indices index into the tables in g_fontdb.c/g_fontd2.c. PL_DEFAULT_HERSHEY_FONT is also used as a backup by some Plotters if no scalable (or anamorphically transformed, etc.) font can be retrieved; see e.g. f_retrieve.c and x_retrieve.c. */ #define PL_DEFAULT_HERSHEY_FONT "HersheySerif" #define PL_DEFAULT_HERSHEY_TYPEFACE_INDEX 0 #define PL_DEFAULT_HERSHEY_FONT_INDEX 1 #define PL_DEFAULT_POSTSCRIPT_FONT "Helvetica" #define PL_DEFAULT_POSTSCRIPT_TYPEFACE_INDEX 0 #define PL_DEFAULT_POSTSCRIPT_FONT_INDEX 1 #define PL_DEFAULT_PCL_FONT "Univers" #define PL_DEFAULT_PCL_TYPEFACE_INDEX 0 #define PL_DEFAULT_PCL_FONT_INDEX 1 #define PL_DEFAULT_STICK_FONT "Stick" #define PL_DEFAULT_STICK_TYPEFACE_INDEX 3 #define PL_DEFAULT_STICK_FONT_INDEX 1 /* HERSHEY FONTS */ /* our information about each of the 22 Hershey vector fonts in g_fontdb.c, and the typefaces they belong to */ struct plHersheyFontInfoStruct { const char *name; /* font name */ const char *othername; /* an alias (for backward compatibility) */ const char *orig_name; /* Allen Hershey's original name for it */ short chars[256]; /* array of vector glyphs */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ bool obliquing; /* whether to apply obliquing */ bool iso8859_1; /* whether font encoding is iso8859-1 */ bool visible; /* whether font is visible, i.e. not internal*/ }; extern const struct plHersheyFontInfoStruct _pl_g_hershey_font_info[]; /* This numbering should agree with the numbering of Hershey fonts in the _pl_g_hershey_font_info[] array in g_fontdb.c. */ #define PL_HERSHEY_SERIF 0 #define PL_HERSHEY_SERIF_ITALIC 1 #define PL_HERSHEY_SERIF_BOLD 2 #define PL_HERSHEY_CYRILLIC 4 #define PL_HERSHEY_HIRAGANA 6 /* hidden font */ #define PL_HERSHEY_KATAKANA 7 /* hidden font */ #define PL_HERSHEY_EUC 8 #define PL_HERSHEY_GOTHIC_GERMAN 16 #define PL_HERSHEY_SERIF_SYMBOL 18 /* accented character information (used in constructing Hershey ISO-Latin-1 accented characters, see table in g_fontdb.c) */ struct plHersheyAccentedCharInfoStruct { unsigned char composite, character, accent; }; extern const struct plHersheyAccentedCharInfoStruct _pl_g_hershey_accented_char_info[]; /* types of accent, for a composite character in a Hershey font */ #define ACC0 (16384 + 0) /* superimpose on character */ #define ACC1 (16384 + 1) /* elevate by 7 Hershey units */ #define ACC2 (16384 + 2) /* same, also shift right by 2 units */ /* a flag in a Hershey glyph number indicating a `small Kana' */ #define KS 8192 /* i.e. 0x200 */ /* HERSHEY VECTOR GLYPHS */ /* arrays of Hershey vector glyphs in g_her_glyph.c */ extern const char * const _pl_g_occidental_hershey_glyphs[]; extern const char * const _pl_g_oriental_hershey_glyphs[]; /* position of `undefined character' symbol (a bundle of horizontal lines) in the Hershey _pl_g_occidental_hershey_glyphs[] array */ #define UNDE 4023 /* POSTSCRIPT FONTS */ /* our information about each of the 35 standard PS fonts in g_fontdb.c, and the typefaces they belong to */ struct plPSFontInfoStruct { const char *ps_name; /* the postscript font name */ const char *ps_name_alt; /* alternative PS font name, if non-NULL */ const char *ps_name_alt2; /* 2nd alternative PS font name, if non-NULL */ const char *x_name; /* the X Windows font name */ const char *x_name_alt; /* alternative X Windows font name */ const char *x_name_alt2; /* 2nd alternative X Windows font name */ const char *x_name_alt3; /* 3rd alternative X Windows font name */ const char *css_family; /* CSS font family */ const char *css_generic_family; /* CSS generic font family */ const char *css_style; /* CSS font style */ const char *css_weight; /* CSS font weight */ const char *css_stretch; /* CSS font stretch */ const char *css_panose; /* CSS font Panose */ int pcl_typeface; /* the PCL typeface number */ int hpgl_spacing; /* 0=fixed width, 1=variable */ int hpgl_posture; /* 0=upright, 1=italic, etc. */ int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1, etc. */ int font_ascent; /* the font's ascent (from bounding box) */ int font_descent; /* the font's descent (from bounding box) */ int font_cap_height; /* the font's cap height */ int font_x_height; /* the font's x height */ short width[256]; /* per-character width information */ short offset[256]; /* per-character left edge information */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ int fig_id; /* Fig's font id */ bool iso8859_1; /* whether font encoding is iso8859-1 */ }; extern const struct plPSFontInfoStruct _pl_g_ps_font_info[]; /* PCL FONTS */ /* our information about each of the 45 PCL fonts in g_fontdb.c, and the typefaces they belong to. (The `substitute_ps_name' field is present only to support the Tidbits-is-Wingdings botch.) */ struct plPCLFontInfoStruct { const char *ps_name; /* the postscript font name */ const char *ps_name_alt; /* alternative PS font name, if non-NULL */ const char *substitute_ps_name; /* replacement name (for use in a PS file) */ const char *x_name; /* the X Windows font name */ const char *css_family; /* CSS font family */ const char *css_generic_family; /* CSS generic font family */ const char *css_style; /* CSS font style */ const char *css_weight; /* CSS font weight */ const char *css_stretch; /* CSS font stretch */ const char *css_panose; /* CSS font Panose */ int pcl_typeface; /* the PCL typeface number */ int hpgl_spacing; /* 0=fixed width, 1=variable */ int hpgl_posture; /* 0=upright, 1=italic, etc. */ int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1, etc. */ int font_ascent; /* the font's ascent (from bounding box) */ int font_descent; /* the font's descent (from bounding box) */ int font_cap_height; /* the font's cap height */ int font_x_height; /* the font's x height */ short width[256]; /* per-character width information */ short offset[256]; /* per-character left edge information */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ bool iso8859_1; /* whether font encoding is iso8859-1 */ }; extern const struct plPCLFontInfoStruct _pl_g_pcl_font_info[]; /* STICK FONTS */ /* our information about each of the Stick fonts (i.e., vector fonts resident in HP's devices) listed in g_fontdb.c, and the typefaces they belong to */ struct plStickFontInfoStruct { const char *ps_name; /* the postscript font name */ bool basic; /* basic stick font (supp. on all devices)? */ int pcl_typeface; /* the PCL typeface number */ int hpgl_spacing; /* 0=fixed width, 1=variable */ int hpgl_posture; /* 0=upright, 1=italic, etc. */ int hpgl_stroke_weight; /* 0=normal, 3=bold, 4=extra bold, etc. */ int hpgl_symbol_set; /* 0=Roman-8, 14=ISO-8859-1 */ int font_ascent; /* the font's ascent (from bounding box) */ int font_descent; /* the font's descent (from bounding box) */ int raster_width_lower; /* width of abstract raster (lower half) */ int raster_height_lower; /* height of abstract raster (lower half) */ int raster_width_upper; /* width of abstract raster (upper half) */ int raster_height_upper; /* height of abstract raster (upper half) */ int hpgl_charset_lower; /* old HP character set number (lower half) */ int hpgl_charset_upper; /* old HP character set number (upper half) */ int kerning_table_lower; /* number of a kerning table (lower half) */ int kerning_table_upper; /* number of a kerning table (upper half) */ char width[256]; /* per-character width information */ int offset; /* left edge (applies to all chars) */ int typeface_index; /* default typeface for the font */ int font_index; /* which font within typeface this is */ bool obliquing; /* whether to apply obliquing */ bool iso8859_1; /* encoding is iso8859-1? (after reencoding) */ }; extern const struct plStickFontInfoStruct _pl_g_stick_font_info[]; /* Device-resident kerning data (`spacing table' in HP documentation), indexed by `right edge character class' and `left edge character class', i.e., `row class' and `column class'. There are three such spacing tables, shared among old-style HP character sets of size 128, and hence among our Stick fonts. See the article by L. W. Hennessee et al. in the Nov. 1981 issue of the Hewlett-Packard Journal. */ struct plStickCharSpacingTableStruct { int rows, cols; const short *kerns; }; extern const struct plStickCharSpacingTableStruct _pl_g_stick_spacing_tables[]; /* Kerning tables for 128-character halves of our Stick fonts. A kerning table for the lower or upper half of one of our 256-character fonts specifies a spacing table (see above), and maps each character in the half-font to the appropriate row and column class. */ struct plStickFontSpacingTableStruct { int spacing_table; char row[128], col[128]; /* we use char's as very short int's */ }; extern const struct plStickFontSpacingTableStruct _pl_g_stick_kerning_tables[]; /* TYPEFACES */ /* typeface information, applicable to all four sorts of font in our font database (Hershey, PS, PCL, Stick) */ #define PL_MAX_FONTS_PER_TYPEFACE 10 struct plTypefaceInfoStruct { int numfonts; int fonts[PL_MAX_FONTS_PER_TYPEFACE]; }; extern const struct plTypefaceInfoStruct _pl_g_hershey_typeface_info[]; extern const struct plTypefaceInfoStruct _pl_g_ps_typeface_info[]; extern const struct plTypefaceInfoStruct _pl_g_pcl_typeface_info[]; extern const struct plTypefaceInfoStruct _pl_g_stick_typeface_info[]; /***********************************************************************/ /* GENERAL DEFINITIONS, TYPEDEFS, & EXTERNAL VARIABLES */ /***********************************************************************/ /* miscellaneous data types */ typedef plPoint plVector; typedef plIntPoint plIntVector; /* Initializations for default values of Plotter data members, performed when space() is first called. Latter doesn't apply to Plotters whose device models have type DISP_DEVICE_COORS_INTEGER_LIBXMI; the default for such Plotters is to use zero-width (i.e. Bresenham) lines. See g_space.c. */ #define PL_DEFAULT_FONT_SIZE_AS_FRACTION_OF_DISPLAY_SIZE (1.0/50.0) #define PL_DEFAULT_LINE_WIDTH_AS_FRACTION_OF_DISPLAY_SIZE (1.0/850.0) /* horizontal justification types for labels (our numbering) */ #define PL_NUM_HORIZ_JUST_TYPES 3 #define PL_JUST_LEFT 0 #define PL_JUST_CENTER 1 #define PL_JUST_RIGHT 2 /* vertical justification types for labels (our numbering) */ #define PL_NUM_VERT_JUST_TYPES 5 #define PL_JUST_TOP 0 #define PL_JUST_HALF 1 #define PL_JUST_BASE 2 #define PL_JUST_BOTTOM 3 #define PL_JUST_CAP 4 /* fill rules (our numbering) */ #define PL_NUM_FILL_RULES 2 #define PL_FILL_ODD_WINDING 0 /* i.e. `even-odd' fill */ #define PL_FILL_NONZERO_WINDING 1 /* canonical line types, or styles (our numbering, used to index the dash patterns in g_dash2.c) */ #define PL_NUM_LINE_TYPES 7 #define PL_L_SOLID 0 #define PL_L_DOTTED 1 #define PL_L_DOTDASHED 2 #define PL_L_SHORTDASHED 3 #define PL_L_LONGDASHED 4 #define PL_L_DOTDOTDASHED 5 #define PL_L_DOTDOTDOTDASHED 6 /* maximum length of dash array for our canonical line styles (see line style database in g_dash2.c; for example "dotted" corresponds to length-2 dash array [ 1 3 ] ) */ #define PL_MAX_DASH_ARRAY_LEN 8 typedef struct { const char *name; /* user-level name (e.g. "dotted") */ int type; /* internal number (e.g. PL_L_DOTTED) */ int dash_array_len; /* length of dash array for this style */ int dash_array[PL_MAX_DASH_ARRAY_LEN]; /* dash array for this style */ } plLineStyle; extern const plLineStyle _pl_g_line_styles[PL_NUM_LINE_TYPES]; /* when using a canonical line style, numbers appearing in the dash array, specifying dash/gap distances, mean multiples of the line width, except the following floor is put on the line width */ #define PL_MIN_DASH_UNIT_AS_FRACTION_OF_DISPLAY_SIZE (1.0/576.0) /* cap and join types (our internal numbering) */ #define PL_NUM_JOIN_TYPES 4 #define PL_JOIN_MITER 0 #define PL_JOIN_ROUND 1 #define PL_JOIN_BEVEL 2 #define PL_JOIN_TRIANGULAR 3 #define PL_NUM_CAP_TYPES 4 #define PL_CAP_BUTT 0 #define PL_CAP_ROUND 1 #define PL_CAP_PROJECT 2 #define PL_CAP_TRIANGULAR 3 /* A Plotter type is first classified according to its `display device model', i.e., according to whether the display device to which the user frame is mapped is physical or virtual. A `physical' display device is one for which the viewport is located on a page of known type and size (e.g. "letter", "a4"). I.e. the Plotter with a physical display device is one for which the PAGESIZE parameter is meaningful. A Plotter with a `virtual' display device is one for which it normally is not: the viewport size that the Plotter uses may be fixed (as is the case for a CGM Plotter), or set in a Plotter-dependent way (e.g. via the BITMAPSIZE parameter). */ enum { DISP_MODEL_PHYSICAL, DISP_MODEL_VIRTUAL }; /* Any Plotter is also classified according to the coordinate type it uses when writing output (i.e. when writing to its display device, if it has one). A Plotter may use real coordinates (e.g., a generic, Metafile, PS or AI Plotter). A Plotter may also use integer coordinates. There are two subtypes of the latter: one in which a bitmap is produced using libxmi or compatible scan-conversion routines (e.g., Bitmap, PNM, PNG, GIF, X, X Drawable Plotters), and one in which graphics with integer coordinates are drawn by other means (e.g., Fig, HPGL, PCL, ReGIS, and Tektronix Plotters). The only significant distinction is that in vector graphics drawn with libxmi, zero-width lines are visible: by convention, zero-width lines are interpreted as Bresenham lines. */ enum { DISP_DEVICE_COORS_REAL, DISP_DEVICE_COORS_INTEGER_LIBXMI, DISP_DEVICE_COORS_INTEGER_NON_LIBXMI }; /* The user->device coordinate transformation */ /* X, Y Device: transform user coordinates to device coordinates */ #define XD(x,y) XD_INTERNAL((x),(y),_plotter->drawstate->transform.m) #define YD(x,y) YD_INTERNAL((x),(y),_plotter->drawstate->transform.m) #ifdef __GNUC__ #define XD_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[4] + _x * _m[0] + _y * _m[2]; _retval; }) #define YD_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[5] + _x * _m[1] + _y * _m[3]; _retval; }) #else #define XD_INTERNAL(x,y,m) ((m)[4] + (x) * (m)[0] + (y) * (m)[2]) #define YD_INTERNAL(x,y,m) ((m)[5] + (x) * (m)[1] + (y) * (m)[3]) #endif /* X,Y Device Vector: transform user vector to device vector */ #define XDV(x,y) XDV_INTERNAL((x),(y),_plotter->drawstate->transform.m) #define YDV(x,y) YDV_INTERNAL((x),(y),_plotter->drawstate->transform.m) #ifdef __GNUC__ #define XDV_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[0] * _x + _m[2] * _y; _retval; }) #define YDV_INTERNAL(x,y,m) ({double _x = (x), _y = (y), *_m = (m); double _retval = _m[1] * _x + _m[3] * _y; _retval; }) #else #define XDV_INTERNAL(x,y,m) ((m)[0] * (x) + (m)[2] * (y)) #define YDV_INTERNAL(x,y,m) ((m)[1] * (x) + (m)[3] * (y)) #endif /* X, Y User Vector: transform device vector back to user vector (used by X11 driver only) */ #ifdef __GNUC__ #define XUV(x,y) ({double _x = (x), _y = (y), *m = _plotter->drawstate->transform.m; double _retval = (m[3] * _x - m[2] * _y) / (m[0] * m[3] - m[1] * m[2]); _retval; }) #define YUV(x,y) ({double _x = (x), _y = (y), *m = _plotter->drawstate->transform.m; double _retval = (- m[1] * _x + m[0] * _y) / (m[0] * m[3] - m[1] * m[2]); _retval; }) #else #define XUV(x,y) ((_plotter->drawstate->transform.m[3] * (x) - _plotter->drawstate->transform.m[2] * (y)) / (_plotter->drawstate->transform.m[0] * _plotter->drawstate->transform.m[3] - _plotter->drawstate->transform.m[1] * _plotter->drawstate->transform.m[2])) #define YUV(x,y) ((- _plotter->drawstate->transform.m[1] * (x) + _plotter->drawstate->transform.m[0] * (y)) / (_plotter->drawstate->transform.m[0] * _plotter->drawstate->transform.m[3] - _plotter->drawstate->transform.m[1] * _plotter->drawstate->transform.m[2])) #endif /*************************************************************************/ /* MISC. DEFS on POLYLINES and PATHS(relevant to all or most display devices)*/ /*************************************************************************/ /* Default value for libplot's miter limit (see comments in g_miter.c). This is the same as the value used by X11: it chops off all mitered line joins if the join angle is less than 11 degrees. */ #define PL_DEFAULT_MITER_LIMIT 10.4334305246 /* Default length an unfilled path (stored in the path buffer's segment list) is allowed to grow to, before it is flushed out by an automatic invocation of endpath(). (We don't flush filled paths, since they need to be preserved as discrete objects if filling is to be performed properly). */ #define PL_MAX_UNFILLED_PATH_LENGTH 500 #define PL_MAX_UNFILLED_PATH_LENGTH_STRING "500" /************************************************************************/ /* DEFINITIONS & EXTERNALS SPECIFIC TO INDIVIDUAL DEVICE DRIVERS */ /************************************************************************/ /************************************************************************/ /* Metafile device driver */ /************************************************************************/ /* string with which to begin each metafile, must begin with '#' to permit parsing by our plot filters */ #define PL_PLOT_MAGIC "#PLOT" /* bit fields for specifying, via a mask, which libplot attributes should be updated (see m_attribs.c) */ #define PL_ATTR_POSITION (1<<0) #define PL_ATTR_TRANSFORMATION_MATRIX (1<<1) #define PL_ATTR_PEN_COLOR (1<<2) #define PL_ATTR_FILL_COLOR (1<<3) #define PL_ATTR_BG_COLOR (1<<4) #define PL_ATTR_PEN_TYPE (1<<5) #define PL_ATTR_FILL_TYPE (1<<6) #define PL_ATTR_LINE_STYLE (1<<7) /* line mode and/or dash array */ #define PL_ATTR_LINE_WIDTH (1<<8) #define PL_ATTR_FILL_RULE (1<<9) #define PL_ATTR_JOIN_STYLE (1<<10) #define PL_ATTR_CAP_STYLE (1<<11) #define PL_ATTR_MITER_LIMIT (1<<12) #define PL_ATTR_ORIENTATION (1<<13) #define PL_ATTR_FONT_NAME (1<<14) #define PL_ATTR_FONT_SIZE (1<<15) #define PL_ATTR_TEXT_ANGLE (1<<16) /************************************************************************/ /* ReGIS (remote graphics instruction set) device driver */ /************************************************************************/ /* For a ReGIS device we clip to the rectangular physical display [0..767]x[0..479], not to the square libplot graphics display [144..623]x[0..479], which is specified in r_defplot.c. Note: ReGIS uses a flipped-y convention. */ #define REGIS_DEVICE_X_MIN 0 #define REGIS_DEVICE_X_MAX 767 #define REGIS_DEVICE_Y_MIN 0 #define REGIS_DEVICE_Y_MAX 479 #define REGIS_CLIP_FUZZ 0.0000001 #define REGIS_DEVICE_X_MIN_CLIP (REGIS_DEVICE_X_MIN - 0.5 + REGIS_CLIP_FUZZ) #define REGIS_DEVICE_X_MAX_CLIP (REGIS_DEVICE_X_MAX + 0.5 - REGIS_CLIP_FUZZ) #define REGIS_DEVICE_Y_MIN_CLIP (REGIS_DEVICE_Y_MIN - 0.5 + REGIS_CLIP_FUZZ) #define REGIS_DEVICE_Y_MAX_CLIP (REGIS_DEVICE_Y_MAX + 0.5 - REGIS_CLIP_FUZZ) /************************************************************************/ /* Tektronix device driver */ /************************************************************************/ /* For a Tektronix device we clip to the rectangular physical display [0..4095]x[0..3119], not to the square libplot graphics display [488..3607]x[0..3119], which is specified in t_defplot.c. Note: Tektronix displays do not use a flipped-y convention. */ #define TEK_DEVICE_X_MIN 0 #define TEK_DEVICE_X_MAX 4095 #define TEK_DEVICE_Y_MIN 0 #define TEK_DEVICE_Y_MAX 3119 #define TEK_CLIP_FUZZ 0.0000001 #define TEK_DEVICE_X_MIN_CLIP (TEK_DEVICE_X_MIN - 0.5 + TEK_CLIP_FUZZ) #define TEK_DEVICE_X_MAX_CLIP (TEK_DEVICE_X_MAX + 0.5 - TEK_CLIP_FUZZ) #define TEK_DEVICE_Y_MIN_CLIP (TEK_DEVICE_Y_MIN - 0.5 + TEK_CLIP_FUZZ) #define TEK_DEVICE_Y_MAX_CLIP (TEK_DEVICE_Y_MAX + 0.5 - TEK_CLIP_FUZZ) /* Tektronix modes (our private numbering, values are not important but order is, see t_tek_md.c) */ #define TEK_MODE_ALPHA 0 #define TEK_MODE_PLOT 1 #define TEK_MODE_POINT 2 #define TEK_MODE_INCREMENTAL 3 /* currently not used */ /* Tektronix display types (generic / Tek emulation in MS-DOS kermit / Tek emulation in `xterm -t') */ #define TEK_DPY_GENERIC 0 #define TEK_DPY_KERMIT 1 #define TEK_DPY_XTERM 2 /* colors supported by MS-DOS kermit Tek emulation, see t_color2.c */ #define TEK_NUM_ANSI_SYS_COLORS 16 extern const plColor _pl_t_kermit_stdcolors[TEK_NUM_ANSI_SYS_COLORS]; extern const char * const _pl_t_kermit_fgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS]; extern const char * const _pl_t_kermit_bgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS]; /* must agree with the ordering in t_color2.c */ #define TEK_ANSI_SYS_BLACK 0 #define TEK_ANSI_SYS_GRAY30 8 #define TEK_ANSI_SYS_GRAY55 7 #define TEK_ANSI_SYS_WHITE 15 /************************************************************************/ /* HP-GL device driver */ /************************************************************************/ /* An HPGLPlotter plots using virtual device coordinates: not the native device coordinates, but rather scaled coordinates in which the graphics display is [0,10000]x[0,10000]. To arrange this, in the initialization code in h_defplot.c we move the HP-GL `scaling points' to the lower left and upper right corners of our graphics display, and use the HP-GL `SC' instruction to set up a scaled set of coordinates. */ #define HPGL_SCALED_DEVICE_LEFT 0 #define HPGL_SCALED_DEVICE_RIGHT 10000 #define HPGL_SCALED_DEVICE_BOTTOM 0 #define HPGL_SCALED_DEVICE_TOP 10000 #define HPGL_UNITS_PER_INCH 1016 /* 1 HP-GL unit = 1/40 mm */ /* HP-GL line attribute types (HP-GL numbering; see h_attribs.c) */ #define HPGL_L_SOLID (-100) /* no numeric parameter at all */ #define HPGL_L_DOTTED 1 #define HPGL_L_DOTDASHED 5 #define HPGL_L_SHORTDASHED 2 #define HPGL_L_LONGDASHED 3 #define HPGL_L_DOTDOTDASHED 6 #define HPGL_L_DOTDOTDOTDASHED (-10) /* pseudo */ #define HPGL_JOIN_MITER 1 /* miter length is clamped by miter limit */ #define HPGL_JOIN_MITER_BEVEL 2 /* miter or bevel, based on miter limit */ #define HPGL_JOIN_TRIANGULAR 3 #define HPGL_JOIN_ROUND 4 #define HPGL_JOIN_BEVEL 5 #define HPGL_CAP_BUTT 1 #define HPGL_CAP_PROJECT 2 #define HPGL_CAP_TRIANGULAR 3 #define HPGL_CAP_ROUND 4 /* HP-GL/2 pen types, i.e. screening types: the type of area fill to be applied to wide pen strokes. (HP-GL/2 numbering, as used in the `SV' [screened vectors] instruction. Screened vectors are supported only on HP-GL/2 devices that are not pen plotters.) */ #define HPGL_PEN_SOLID 0 #define HPGL_PEN_SHADED 1 #define HPGL_PEN_PREDEFINED_CROSSHATCH 21 /* imported from PCL or RTL */ /* HP-GL and HP-GL/2 fill types. (Their numbering, as used in the `FT' instruction.) */ #define HPGL_FILL_SOLID_BI 1 #define HPGL_FILL_SOLID_UNI 2 #define HPGL_FILL_PARALLEL_LINES 3 #define HPGL_FILL_CROSSHATCHED_LINES 4 #define HPGL_FILL_SHADED 10 #define HPGL_FILL_PREDEFINED_CROSSHATCH 21 /* imported from PCL or RTL */ /* HP-GL/2 character rendering types, as used in the `CF' [character fill mode] instruction. By default the current pen is used for edging, and for filling too, if filling is requested. Some fill types [set with the `FT' command'] include color information, in which case the current pen is not used for filling. Types 0,1,2 allow specification of an edge pen which may be different from the present pen. (At least for type 0, specifying edge pen 0 seems to turn off edging. For types 1 and 3, edge pen 0 may request white edging [on color devices].) Note that there are three kinds of font: bitmap, stick, and outline, which are treated slightly differently: bitmap and stick chars are filled, not edged, so edging doesn't apply to them. */ /* Default rendering is type 0, with edge pen 0, which as just mentioned turns off edging. */ #define HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE 0 #define HPGL_CHAR_EDGE 1 /* bitmap, stick chars are filled instead */ #define HPGL_CHAR_FILL 2 /* i.e. with current fill type */ #define HPGL_CHAR_FILL_AND_EDGE 3 /* i.e. with current fill type */ /* HP-GL object types (our numbering), which we use when passing an argument to an HPGLPlotter's internal _h_set_pen_color() method, letting it know the type of object that will be drawn. Passing the libplot pen color down to the HP-GL/2 level, prior to drawing a label rather than a path, may involve changing the character rendition type. */ #define HPGL_OBJECT_PATH 0 #define HPGL_OBJECT_LABEL 1 /* Nominal pen width in native HP-GL units (so this is 0.3mm). Used by our HP7550B-style cross-hatching algorithm, which we employ when emulating shading (if HPGL_VERSION is 1 or 1.5, i.e. if there's no true shading). */ #define HPGL_NOMINAL_PEN_WIDTH 12 /* default values for HPGL_PENS environment variable, for HP-GL[/2]; this lists available pens and their positions in carousel */ #define HPGL_DEFAULT_PEN_STRING "1=black" #define HPGL2_DEFAULT_PEN_STRING "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan" /* PCL 5 font information: symbol set, i.e. encoding */ #define PCL_ISO_8859_1 14 #define PCL_ROMAN_8 277 /* PCL typeface number for default HP-GL/2 typeface */ #define PCL_STICK_TYPEFACE 48 /* Old (pre-HP-GL/2) 7-bit HP-GL character sets */ #define HPGL_CHARSET_ASCII 0 #define HPGL_CHARSET_ROMAN_EXTENSIONS 7 /* The nominal HP-GL/2 fontsize we use for drawing a label (for fixed-width and proportional fonts, respectively). We retrieve fonts in the size specified by whichever of the two following parameters is relevant, and then rescale it as needed before drawing the label. */ #define HPGL2_NOMINAL_CHARS_PER_INCH 8.0 #define HPGL2_NOMINAL_POINT_SIZE 18 /* Spacing characteristic of the PCL and Stick fonts, in HP-GL/2 */ #define HPGL2_FIXED_SPACING 0 #define HPGL2_PROPORTIONAL_SPACING 1 /************************************************************************/ /* xfig device driver */ /************************************************************************/ /* Standard Fig unit size in v. 3.0+ */ #define FIG_UNITS_PER_INCH 1200 /* device units <-> printer's points; number of points per inch == 72 */ #define FIG_UNITS_TO_POINTS(size) ((size)*72.0/FIG_UNITS_PER_INCH) #define POINTS_TO_FIG_UNITS(size) ((size)*((double)FIG_UNITS_PER_INCH)/72.0) /* xfig specifies line widths in `Fig display units' rather than `Fig units' (there are 80 of the former per inch). */ #define FIG_UNITS_TO_FIG_DISPLAY_UNITS(width) ((width)*80.0/FIG_UNITS_PER_INCH) /* For historical reasons, xfig scales the fonts down by a factor FONT_SCALING, i.e., (80.0)/(72.0). So we have to premultiply font sizes by the same factor. The current release of xfig unfortunately can't handle font sizes that aren't integers, so it rounds them. Ah well. */ #define FIG_FONT_SCALING ((80.0)/(72.0)) /* Fig supported line styles. DOTTED and DASHED line styles are specified by (respectively) the length of the gap between successive dots, and the length of each dash (equal to the length of the gap between successive dashes, except in the DASHDOTTED case). */ #define FIG_L_DEFAULT (-1) #define FIG_L_SOLID 0 #define FIG_L_DASHED 1 #define FIG_L_DOTTED 2 #define FIG_L_DASHDOTTED 3 #define FIG_L_DASHDOUBLEDOTTED 4 #define FIG_L_DASHTRIPLEDOTTED 5 /* Fig's line styles, indexed into by internal line type number (PL_L_SOLID/PL_L_DOTTED/ PL_L_DOTDASHED/PL_L_SHORTDASHED/PL_L_LONGDASHED. */ extern const int _pl_f_fig_line_style[PL_NUM_LINE_TYPES]; #define FIG_JOIN_MITER 0 #define FIG_JOIN_ROUND 1 #define FIG_JOIN_BEVEL 2 #define FIG_CAP_BUTT 0 #define FIG_CAP_ROUND 1 #define FIG_CAP_PROJECT 2 /* Fig join and cap styles, see f_path.c, indexed by our internal join and cap type numbers (miter/rd./bevel/triangular and butt/rd./project/triangular) */ extern const int _pl_f_fig_join_style[PL_NUM_JOIN_TYPES]; extern const int _pl_f_fig_cap_style[PL_NUM_CAP_TYPES]; /* these constants for Fig colors are hardcoded in xfig */ #define FIG_STD_COLOR_MIN 0 /* see f_color2.c for colors 0,...,31 */ #define FIG_C_BLACK 0 /* i.e. #0 in table in f_color2.c */ #define FIG_C_WHITE 7 /* i.e. #7 in table */ #define FIG_NUM_STD_COLORS 32 #define FIG_USER_COLOR_MIN 32 extern const plColor _pl_f_fig_stdcolors[FIG_NUM_STD_COLORS]; /* xfig's depth attribute ranges from 0 to FIG_MAXDEPTH. */ #define FIG_MAXDEPTH 999 /* depth of the first object we'll draw (we make it a bit less than FIG_MAXDEPTH, since the user may wish to edit the drawing with xfig to include deeper, i.e. obscured objects) */ #define FIG_INITIAL_DEPTH 989 /************************************************************************/ /* CGM device driver */ /************************************************************************/ /* CGM output file `profiles', which are increasingly general (our numbering). The most restrictive is the WebCGM profile. We increment the profile number appropriately whenever anything noncompliant is seen. */ #define CGM_PROFILE_WEB 0 #define CGM_PROFILE_MODEL 1 #define CGM_PROFILE_NONE 2 /* Possible encodings of the CGM output file (our numbering). Only the first (binary) is allowed by the WebCGM profile. */ #define CGM_ENCODING_BINARY 0 /* default */ #define CGM_ENCODING_CHARACTER 1 /* not supported by libplot */ #define CGM_ENCODING_CLEAR_TEXT 2 /* In the binary encoding, how many bytes we use to represent an integer parameter of a CGM command. This determines the range over which integers (e.g., point coordinates) can vary, and hence the granularity of our quantization to integer coordinates in the output file. This value should not be greater than the number of bytes used in the system representation for an integer (see comments in c_emit.c). Don't change this value unless you know what you're doing. Some old [buggy] CGM interpreters can't handle any value except 2, or possibly 4. The old RALCGM viewer/translator partially breaks on a value of 3 or 4. (It can display binary-encoded CGM files that use the value of `3', but when it translates such files to the clear text encoding, it produces a bogus [zero] value for the metric scaling factor.) */ #define CGM_BINARY_BYTES_PER_INTEGER 2 /* In the binary encoding, how many bytes we use to represent an RGB color component. In this is 1, then 24-bit color will be used; if 2, then 48-bit color will be used. Valid values are 1, 2, 3, 4, but our code in c_color.c assumes that the value is 1 or 2. */ #define CGM_BINARY_BYTES_PER_COLOR_COMPONENT 2 /* In the binary encoding, how many bytes we use to represent a string parameter of a CGM command. (See c_emit.c.) In the binary encoding, a string <= 254 bytes in length is represented literally, preceded by a 1-byte count. Any string > 254 bytes in length is partitioned: after the initial byte, there are one or more partitions. Each partition contains an initial byte, and then up to CGM_STRING_PARTITION_SIZE bytes of the string. According to the CGM spec, CGM_STRING_PARTITION_SIZE could be as large as 32767. However, since we don't wish to overrun our output buffer, we keep it fairly small (see comment in g_outbuf.c). */ #define CGM_STRING_PARTITION_SIZE 2000 #define CGM_BINARY_BYTES_PER_STRING(len) \ ((len) <= 254 ? (1 + (len)) : \ (1 + (len) + 2 * (1 + ((len) - 1) / CGM_STRING_PARTITION_SIZE))) /* CGM's element classes (CGM numbering) */ #define CGM_DELIMITER_ELEMENT 0 #define CGM_METAFILE_DESCRIPTOR_ELEMENT 1 #define CGM_PICTURE_DESCRIPTOR_ELEMENT 2 #define CGM_CONTROL_ELEMENT 3 #define CGM_GRAPHICAL_PRIMITIVE_ELEMENT 4 #define CGM_ATTRIBUTE_ELEMENT 5 #define CGM_ESCAPE_ELEMENT 6 /* not used by libplot */ #define CGM_EXTERNAL_ELEMENT 7 /* not used by libplot */ #define CGM_SEGMENT_ELEMENT 8 /* not used by libplot */ /* tags for CGM data types within a CGM SDR (structured data record) */ #define CGM_SDR_DATATYPE_SDR 1 #define CGM_SDR_DATATYPE_COLOR_INDEX 2 #define CGM_SDR_DATATYPE_COLOR_DIRECT 3 #define CGM_SDR_DATATYPE_ENUM 5 #define CGM_SDR_DATATYPE_INTEGER 6 #define CGM_SDR_DATATYPE_INDEX 11 #define CGM_SDR_DATATYPE_REAL 12 #define CGM_SDR_DATATYPE_STRING 13 #define CGM_SDR_DATATYPE_STRING_FIXED 14 #define CGM_SDR_DATATYPE_VDC 16 #define CGM_SDR_DATATYPE_UNSIGNED_INTEGER_8BIT 18 #define CGM_SDR_DATATYPE_COLOR_LIST 21 /* CGM font properties, from the CGM spec. (Value of each of these font props is an SDR, comprising a single datum of `index' type, except for the FAMILY prop, for which the datum is a string, and the DESIGN_GROUP prop, for which the SDR comprises three 8-bit unsigned integers.) */ #define CGM_FONT_PROP_INDEX 1 #define CGM_FONT_PROP_FAMILY 4 #define CGM_FONT_PROP_POSTURE 5 #define CGM_FONT_PROP_WEIGHT 6 #define CGM_FONT_PROP_WIDTH 7 #define CGM_FONT_PROP_DESIGN_GROUP 13 #define CGM_FONT_PROP_STRUCTURE 14 /* CGM line/edge types (CGM numbering; for custom dash arrays defined by linedash(), negative values are used) */ #define CGM_L_SOLID 1 #define CGM_L_DASHED 2 #define CGM_L_DOTTED 3 #define CGM_L_DOTDASHED 4 #define CGM_L_DOTDOTDASHED 5 /* CGM interior styles (CGM numbering) */ #define CGM_INT_STYLE_HOLLOW 0 #define CGM_INT_STYLE_SOLID 1 #define CGM_INT_STYLE_PATTERN 2 #define CGM_INT_STYLE_HATCH 3 #define CGM_INT_STYLE_EMPTY 4 #define CGM_INT_STYLE_GEOMETRIC_PATTERN 5 #define CGM_INT_STYLE_INTERPOLATED 6 /* CGM line/edge join styles (CGM numbering) */ #define CGM_JOIN_UNSPEC 1 #define CGM_JOIN_MITER 2 #define CGM_JOIN_ROUND 3 #define CGM_JOIN_BEVEL 4 /* CGM line/edge cap styles (CGM numbering) */ #define CGM_CAP_UNSPEC 1 #define CGM_CAP_BUTT 2 #define CGM_CAP_ROUND 3 #define CGM_CAP_PROJECTING 4 #define CGM_CAP_TRIANGULAR 5 /* CGM line/edge dash cap styles (CGM numbering) */ #define CGM_DASH_CAP_UNSPEC 1 #define CGM_DASH_CAP_BUTT 2 #define CGM_DASH_CAP_MATCH 3 /* CGM marker types (CGM numbering) */ #define CGM_M_DOT 1 #define CGM_M_PLUS 2 #define CGM_M_ASTERISK 3 #define CGM_M_CIRCLE 4 #define CGM_M_CROSS 5 /* CGM object types (our numbering) */ #define CGM_OBJECT_OPEN 0 #define CGM_OBJECT_CLOSED 1 #define CGM_OBJECT_MARKER 2 #define CGM_OBJECT_TEXT 3 #define CGM_OBJECT_OTHER 4 /* CGM horizontal justification types for labels (CGM numbering) */ #define CGM_ALIGN_NORMAL_HORIZONTAL 0 #define CGM_ALIGN_LEFT 1 #define CGM_ALIGN_CENTER 2 #define CGM_ALIGN_RIGHT 3 /* CGM vertical justification types for labels (CGM numbering) */ #define CGM_ALIGN_NORMAL_VERTICAL 0 #define CGM_ALIGN_TOP 1 #define CGM_ALIGN_CAP 2 #define CGM_ALIGN_HALF 3 #define CGM_ALIGN_BASE 4 #define CGM_ALIGN_BOTTOM 5 /* CGM `restricted text' types (CGM numbering) */ #define CGM_RESTRICTED_TEXT_TYPE_BASIC 1 #define CGM_RESTRICTED_TEXT_TYPE_BOXED_CAP 2 /* mappings from internal PS font number to CGM font id, as used in output file; see g_fontdb.c */ extern const int _pl_g_ps_font_to_cgm_font_id[PL_NUM_PS_FONTS]; extern const int _pl_g_cgm_font_id_to_ps_font[PL_NUM_PS_FONTS]; /* structure used to store the CGM properties for a font; see g_fontdb.c */ typedef struct { const char *family; const char *extra_style; const char *style; int posture; /* 1=upright, 2=oblique, 4=italic */ int weight; /* 4=semilight, 5=normal, 6=semibold, 7=bold */ int proportionate_width; /* 3=condensed, 5=medium */ int design_group[3]; int structure; /* 1=filled, 2=outline */ } plCGMFontProperties; extern const plCGMFontProperties _pl_g_cgm_font_properties[PL_NUM_PS_FONTS]; /* structure used to store a user-defined line type; see g_attribs.c */ typedef struct plCGMCustomLineTypeStruct { int *dashes; int dash_array_len; struct plCGMCustomLineTypeStruct *next; } plCGMCustomLineType; /* maximum number of line types a user can define, and the maximum dash array length a user can specify per line type, without violating the WebCGM or Model CGM profiles */ #define CGM_MAX_CUSTOM_LINE_TYPES 16 #define CGM_PL_MAX_DASH_ARRAY_LENGTH 8 /************************************************************************/ /* Postscript/idraw device driver */ /************************************************************************/ /* minimum desired resolution in device frame (i.e. in printer's points) */ #define PS_MIN_RESOLUTION 0.05 /* em size (in printer's points) for a font in which a `point' could appear as a symbol */ #define PS_SIZE_OF_POINT 0.5 /* PS line join and line cap styles */ #define PS_LINE_JOIN_MITER 0 #define PS_LINE_JOIN_ROUND 1 #define PS_LINE_JOIN_BEVEL 2 #define PS_LINE_CAP_BUTT 0 #define PS_LINE_CAP_ROUND 1 #define PS_LINE_CAP_PROJECT 2 /* information on colors known to idraw, see p_color2.c */ #define PS_NUM_IDRAW_STD_COLORS 12 extern const plColor _pl_p_idraw_stdcolors[PS_NUM_IDRAW_STD_COLORS]; extern const char * const _pl_p_idraw_stdcolornames[PS_NUM_IDRAW_STD_COLORS]; /* information on shadings known to idraw, see p_color2.c */ #define PS_NUM_IDRAW_STD_SHADINGS 5 extern const double _pl_p_idraw_stdshadings[PS_NUM_IDRAW_STD_SHADINGS]; /************************************************************************/ /* Adobe Illustrator device driver */ /************************************************************************/ /* types of Illustrator file format that an Illustrator Plotter can emit */ #define AI_VERSION_3 0 #define AI_VERSION_5 1 /* em size (in printer's points) for a font in which a `point' could appear as a symbol */ #define AI_SIZE_OF_POINT 0.5 /* AI line join and line cap styles (same as for PS) */ #define AI_LINE_JOIN_MITER 0 #define AI_LINE_JOIN_ROUND 1 #define AI_LINE_JOIN_BEVEL 2 #define AI_LINE_CAP_BUTT 0 #define AI_LINE_CAP_ROUND 1 #define AI_LINE_CAP_PROJECT 2 /* AI fill rule types (in AI version 5 and later) */ #define AI_FILL_NONZERO_WINDING 0 #define AI_FILL_ODD_WINDING 1 /************************************************************************/ /* XDrawable and X device drivers */ /************************************************************************/ #ifndef X_DISPLAY_MISSING /* X11 colormap types (XDrawable Plotters use only the first of these) */ #define X_CMAP_ORIG 0 #define X_CMAP_NEW 1 #define X_CMAP_BAD 2 /* colormap full, can't allocate new colors */ /* sixteen-bit restriction on X11 protocol parameters */ #define X_OOB_UNSIGNED(x) ((x) > (int)0xffff) #define X_OOB_INT(x) ((x) > (int)0x7fff || (x) < (int)(-0x8000)) /* double buffering types, used in XDrawablePlotter `x_double_buffering' data member */ #define X_DBL_BUF_NONE 0 #define X_DBL_BUF_BY_HAND 1 #define X_DBL_BUF_MBX 2 /* X11 MBX extension */ #define X_DBL_BUF_DBE 3 /* X11 DBE extension */ /* numbering of our X GC's (graphics contexts); this is the numbering we use when passing an argument to _x_set_attributes() indicating which GC should be altered */ #define X_GC_FOR_DRAWING 0 #define X_GC_FOR_FILLING 1 #define X_GC_FOR_ERASING 2 #endif /* not X_DISPLAY_MISSING */ /***********************************************************************/ /* DRAWING STATE */ /***********************************************************************/ /* Default drawing state, defined in g_defstate.c. This is used for initialization of the first state on the drawing state stack that every Plotter maintains; see g_savestate.c. */ extern const plDrawState _default_drawstate; /*************************************************************************/ /* PLOTTER OBJECTS (structs for libplot, class instances for libplotter) */ /*************************************************************************/ /* "_plotters" is a sparse array containing pointers to all Plotter instances, of size "_plotters_len". In libplot, they're globals, but in in libplotter, they're static data members of the base Plotter class. In both libraries, they're defined in g_defplot.c. Similarly, "_xplotters" is a sparse array containing pointers to all XPlotters instances, of size "_xplotters_len". In libplot, they're globals, but in libplotter, they're static data members of the XPlotter class. In both libraries, they're defined in y_defplot.c. */ #ifndef LIBPLOTTER extern Plotter **_plotters; extern int _plotters_len; #define XPlotter Plotter /* crock, needed by code in y_defplot.c */ extern XPlotter **_xplotters; extern int _xplotters_len; #else #define _plotters Plotter::_plotters #define _plotters_len Plotter::_plotters_len #define _xplotters XPlotter::_xplotters #define _xplotters_len XPlotter::_xplotters_len #endif #ifndef LIBPLOTTER /* In libplot, these are the initializations of the function-pointer parts of the different types of Plotter. They are copied to the Plotter at creation time (in apinewc.c, which is libplot-specific). */ extern const Plotter _pl_g_default_plotter, _pl_b_default_plotter, _pl_m_default_plotter, _pl_r_default_plotter, _pl_t_default_plotter, _pl_h_default_plotter, _pl_q_default_plotter, _pl_f_default_plotter, _pl_c_default_plotter, _pl_p_default_plotter, _pl_a_default_plotter, _pl_s_default_plotter, _pl_i_default_plotter, _pl_n_default_plotter, _pl_z_default_plotter, _pl_x_default_plotter, _pl_y_default_plotter; /* Similarly, in libplot this is the initialization of the function-pointer part of any PlotterParams object. */ extern const PlotterParams _default_plotter_params; #endif /* not LIBPLOTTER */ /* The array used for storing the names of recognized Plotter parameters, and their default values. (See g_params2.c.) */ struct plParamRecord { const char *parameter; /* parameter name */ void * default_value; /* default value (applies if string-valued) */ bool is_string; /* whether or not value must be a string */ }; extern const struct plParamRecord _known_params[NUM_PLOTTER_PARAMETERS]; /* A pointer to a distinguished (global) PlotterParams object, used by the old C and C++ bindings. The function parampl() sets parameters in this object. (This is one reason why the old bindings are non-thread-safe. The new bindings allow the programmer to instantiate and use more than a single PlotterParams object, so they are thread-safe.) In libplotter, this pointer is declared as a static member of the Plotter class. */ #ifndef LIBPLOTTER extern PlotterParams *_old_api_global_plotter_params; #else #define _old_api_global_plotter_params Plotter::_old_api_global_plotter_params #endif /**************************************************************************/ /* PROTOTYPES ETC. for libplot and libplotter */ /**************************************************************************/ /* Miscellaneous internal functions that aren't Plotter class methods, so they're declared the same for both libplot and libplotter. */ /* wrappers for malloc and friends */ extern void * _pl_xcalloc (size_t nmemb, size_t size); extern void * _pl_xmalloc (size_t size); extern void * _pl_xrealloc (void * p, size_t size); /* misc. utility functions, mostly geometry-related */ extern plPoint _truecenter (plPoint p0, plPoint p1, plPoint pc); extern plVector *_vscale (plVector *v, double newlen); extern double _angle_of_arc (plPoint p0, plPoint p1, plPoint pc); extern double _matrix_norm (const double m[6]); extern double _xatan2 (double y, double x); extern int _clip_line (double *x0_p, double *y0_p, double *x1_p, double *y1_p, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip); extern int _codestring_len (const unsigned short *codestring); extern int _grayscale_approx (int red, int green, int blue); extern void _matrix_product (const double m[6], const double n[6], double product[6]); extern void _matrix_inverse (const double m[6], double inverse[6]); extern void _matrix_sing_vals (const double m[6], double *min_sing_val, double *max_sing_val); extern void _set_common_mi_attributes (plDrawState *drawstate, void * ptr); extern void * _get_default_plot_param (const char *parameter); /* plPlotterData methods */ /* lowest-level output routines used by Plotters */ extern void _write_byte (const plPlotterData *data, unsigned char c); extern void _write_bytes (const plPlotterData *data, int n, const unsigned char *c); extern void _write_string (const plPlotterData *data, const char *s); /* other plPlotterData methods */ extern bool _compute_ndc_to_device_map (plPlotterData *data); extern void _set_page_type (plPlotterData *data); extern void * _get_plot_param (const plPlotterData *data, const char *parameter); /* plPath methods (see g_subpaths.c) */ extern plPath * _flatten_path (const plPath *path); extern plPath * _new_plPath (void); extern plPath ** _merge_paths (const plPath **paths, int num_paths); extern void _add_arc (plPath *path, plPoint pc, plPoint p1); extern void _add_arc_as_bezier3 (plPath *path, plPoint pc, plPoint p1); extern void _add_arc_as_lines (plPath *path, plPoint pc, plPoint p1); extern void _add_bezier2 (plPath *path, plPoint pc, plPoint p); extern void _add_bezier2_as_lines (plPath *path, plPoint pc, plPoint p); extern void _add_bezier3 (plPath *path, plPoint pc, plPoint pd, plPoint p); extern void _add_bezier3_as_lines (plPath *path, plPoint pc, plPoint pd, plPoint p); extern void _add_box (plPath *path, plPoint p0, plPoint p1, bool clockwise); extern void _add_box_as_lines (plPath *path, plPoint p0, plPoint p1, bool clockwise); extern void _add_circle (plPath *path, plPoint pc, double radius, bool clockwise); extern void _add_circle_as_bezier3s (plPath *path, plPoint pc, double radius, bool clockwise); extern void _add_circle_as_ellarcs (plPath *path, plPoint pc, double radius, bool clockwise); extern void _add_circle_as_lines (plPath *path, plPoint pc, double radius, bool clockwise); extern void _add_ellarc (plPath *path, plPoint pc, plPoint p1); extern void _add_ellarc_as_bezier3 (plPath *path, plPoint pc, plPoint p1); extern void _add_ellarc_as_lines (plPath *path, plPoint pc, plPoint p1); extern void _add_ellipse (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); extern void _add_ellipse_as_bezier3s (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); extern void _add_ellipse_as_ellarcs (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); extern void _add_ellipse_as_lines (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise); extern void _add_line (plPath *path, plPoint p); extern void _add_moveto (plPath *path, plPoint p); extern void _delete_plPath (plPath *path); extern void _reset_plPath (plPath *path); /* plOutbuf methods (see g_outbuf.c) */ extern plOutbuf * _new_outbuf (void); extern void _bbox_of_outbuf (plOutbuf *bufp, double *xmin, double *xmax, double *ymin, double *ymax); extern void _bbox_of_outbufs (plOutbuf *bufp, double *xmin, double *xmax, double *ymin, double *ymax); extern void _delete_outbuf (plOutbuf *outbuf); extern void _freeze_outbuf (plOutbuf *outbuf); extern void _reset_outbuf (plOutbuf *outbuf); extern void _update_bbox (plOutbuf *bufp, double x, double y); extern void _update_buffer (plOutbuf *outbuf); extern void _update_buffer_by_added_bytes (plOutbuf *outbuf, int additional); /* functions that update a device-frame bounding box for a page, as stored in a plOutbuf */ extern void _set_bezier2_bbox (plOutbuf *bufp, double x0, double y0, double x1, double y1, double x2, double y2, double device_line_width, double m[6]); extern void _set_bezier3_bbox (plOutbuf *bufp, double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double device_line_width, double m[6]); extern void _set_ellipse_bbox (plOutbuf *bufp, double x, double y, double rx, double ry, double costheta, double sintheta, double linewidth, double m[6]); extern void _set_line_end_bbox (plOutbuf *bufp, double x, double y, double xother, double yother, double linewidth, int capstyle, double m[6]); extern void _set_line_join_bbox (plOutbuf *bufp, double xleft, double yleft, double x, double y, double xright, double yright, double linewidth, int joinstyle, double miterlimit, double m[6]); /* CGMPlotter-related functions, which write a CGM command, or an argument of same, alternatively to a plOutbuf or to a string (see c_emit.c) */ extern void _cgm_emit_command_header (plOutbuf *outbuf, int cgm_encoding, int element_class, int id, int data_len, int *byte_count, const char *op_code); extern void _cgm_emit_color_component (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_enum (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count, const char *text_string); extern void _cgm_emit_index (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_integer (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int y, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_points (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, const int *x, const int *y, int npoints, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_real_fixed_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, double x, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_real_floating_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, double x, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_string (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, const char *s, int string_length, bool use_double_quotes, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_unsigned_integer (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_unsigned_integer_8bit (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count); extern void _cgm_emit_command_terminator (plOutbuf *outbuf, int cgm_encoding, int *byte_count); /* SVGPlotter-related functions */ extern const char * _libplot_color_to_svg_color (plColor color_48, char charbuf[8]); /* plColorNameCache methods */ extern bool _string_to_color (const char *name, plColor *color_p, plColorNameCache *color_name_cache); extern plColorNameCache * _create_color_name_cache (void); extern void _delete_color_name_cache (plColorNameCache *color_cache); /* Renaming of the global symbols in the libxmi scan conversion library, which we include in libplot/libplotter as a rendering module. We prepend each name with "_pl". Doing this keeps the user-level namespace clean, and allows an application to link with both libplot/libplotter and a separate version of libxmi. */ /* libxmi API functions */ #define miClearPaintedSet _pl_miClearPaintedSet #define miCopyCanvas _pl_miCopyCanvas #define miCopyGC _pl_miCopyGC #define miCopyPaintedSetToCanvas _pl_miCopyPaintedSetToCanvas #define miDeleteCanvas _pl_miDeleteCanvas #define miDeleteEllipseCache _pl_miDeleteEllipseCache #define miDeleteGC _pl_miDeleteGC #define miDeletePaintedSet _pl_miDeletePaintedSet #define miDrawArcs_r _pl_miDrawArcs_r #define miDrawLines _pl_miDrawLines #define miDrawPoints _pl_miDrawPoints #define miDrawRectangles _pl_miDrawRectangles #define miFillArcs _pl_miFillArcs #define miFillPolygon _pl_miFillPolygon #define miFillRectangles _pl_miFillRectangles #define miNewCanvas _pl_miNewCanvas #define miNewEllipseCache _pl_miNewEllipseCache #define miNewGC _pl_miNewGC #define miNewPaintedSet _pl_miNewPaintedSet #define miSetCanvasStipple _pl_miSetCanvasStipple #define miSetCanvasTexture _pl_miSetCanvasTexture #define miSetGCAttrib _pl_miSetGCAttrib #define miSetGCAttribs _pl_miSetGCAttribs #define miSetGCDashes _pl_miSetGCDashes #define miSetGCMiterLimit _pl_miSetGCMiterLimit #define miSetGCPixels _pl_miSetGCPixels #define miSetPixelMerge2 _pl_miSetPixelMerge2 #define miSetPixelMerge3 _pl_miSetPixelMerge3 /* an external libxmi symbol */ #define mi_libxmi_ver _pl_mi_libxmi_ver /* internal libxmi functions (which incidentally in libxmi are given an initial underscore, in much the same way) */ #define mi_xmalloc _pl_mi_xmalloc #define mi_xcalloc _pl_mi_xcalloc #define mi_xrealloc _pl_mi_xrealloc #define miAddSpansToPaintedSet _pl_miAddSpansToPaintedSet #define miDrawArcs_r_internal _pl_miDrawArcs_r_internal #define miDrawArcs_internal _pl_miDrawArcs_internal #define miDrawLines_internal _pl_miDrawLines_internal #define miDrawRectangles_internal _pl_miDrawRectangles_internal #define miPolyArc_r _pl_miPolyArc_r #define miPolyArc _pl_miPolyArc #define miFillArcs_internal _pl_miFillArcs_internal #define miFillRectangles_internal _pl_miFillRectangles_internal #define miFillSppPoly _pl_miFillSppPoly #define miFillPolygon_internal _pl_miFillPolygon_internal #define miFillConvexPoly _pl_miFillConvexPoly #define miFillGeneralPoly _pl_miFillGeneralPoly #define miDrawPoints_internal _pl_miDrawPoints_internal #define miCreateETandAET _pl_miCreateETandAET #define miloadAET _pl_miloadAET #define micomputeWAET _pl_micomputeWAET #define miInsertionSort _pl_miInsertionSort #define miFreeStorage _pl_miFreeStorage #define miQuickSortSpansY _pl_miQuickSortSpansY #define miUniquifyPaintedSet _pl_miUniquifyPaintedSet #define miWideDash _pl_miWideDash #define miStepDash _pl_miStepDash #define miWideLine _pl_miWideLine #define miZeroPolyArc_r _pl_miZeroPolyArc_r #define miZeroPolyArc _pl_miZeroPolyArc #define miZeroLine _pl_miZeroLine #define miZeroDash _pl_miZeroDash /* Don't include unneeded non-reentrant libxmi functions, such as the function miPolyArc(). We use the reentrant version miPolyArc_r() instead, to avoid static data. */ #define NO_NONREENTRANT_POLYARC_SUPPORT /* Internal functions that aren't Plotter class methods, but which need to be renamed in libplotter. */ #ifdef LIBPLOTTER #define pl_libplot_warning_handler pl_libplotter_warning_handler #define pl_libplot_error_handler pl_libplotter_error_handler #endif /* Declarations of forwarding functions used in libplot (not libplotter). */ /* These support the derivation of classes such as the PNMPlotter and the PNGPlotter classes from the BitmapPlotter class, the derivation of the PCLPlotter class from the HPGLPlotter class, and the derivation of the XPlotter class from the XDrawablePlotter class. */ #ifndef LIBPLOTTER extern int _maybe_output_image (Plotter *_plotter); extern void _maybe_switch_to_hpgl (Plotter *_plotter); extern void _maybe_switch_from_hpgl (Plotter *_plotter); #ifndef X_DISPLAY_MISSING extern void _maybe_get_new_colormap (Plotter *_plotter); extern void _maybe_handle_x_events (Plotter *_plotter); #endif /* not X_DISPLAY_MISSING */ #endif /* not LIBPLOTTER */ /* Declarations of the Plotter methods and the device-specific versions of same. The initial letter indicates the Plotter class specificity: g=generic (i.e. base Plotter class), b=bitmap, m=metafile, t=Tektronix, r=ReGIS, h=HP-GL/2 and PCL 5, f=xfig, c=CGM, p=PS, a=Adobe Illustrator, s=SVG, i=GIF, n=PNM (i.e. PBM/PGM/PPM), z=PNG, x=X11 Drawable, y=X11. In libplot, these are declarations of global functions. But in libplotter, we use #define and the double colon notation to make them function members of the appropriate Plotter classes. The declarations-for-libplot are encapsulated within ___BEGIN_DECLS...___END_DECLS pairs, which do nothing if a C compiler is used to compile libplot. If on the other hand libplot is compiled by a C++ compiler, which is easy to arrange by doing `CC=g++ ./configure', then this will require each libplot function to have C linkage rather than C++ linkage. Libplot functions should have C linkage, of course (cf. libplot's external header file plot.h). */ #ifndef LIBPLOTTER /* support C++ */ #ifdef ___BEGIN_DECLS #undef ___BEGIN_DECLS #endif #ifdef ___END_DECLS #undef ___END_DECLS #endif #ifdef __cplusplus # define ___BEGIN_DECLS extern "C" { # define ___END_DECLS } #else # define ___BEGIN_DECLS /* empty */ # define ___END_DECLS /* empty */ #endif #endif /* not LIBPLOTTER */ #ifndef LIBPLOTTER /* Plotter public methods, for libplot */ #define _API_alabel pl_alabel_r #define _API_arc pl_arc_r #define _API_arcrel pl_arcrel_r #define _API_bezier2 pl_bezier2_r #define _API_bezier2rel pl_bezier2rel_r #define _API_bezier3 pl_bezier3_r #define _API_bezier3rel pl_bezier3rel_r #define _API_bgcolor pl_bgcolor_r #define _API_bgcolorname pl_bgcolorname_r #define _API_box pl_box_r #define _API_boxrel pl_boxrel_r #define _API_capmod pl_capmod_r #define _API_circle pl_circle_r #define _API_circlerel pl_circlerel_r #define _API_closepath pl_closepath_r #define _API_closepl pl_closepl_r #define _API_color pl_color_r #define _API_colorname pl_colorname_r #define _API_cont pl_cont_r #define _API_contrel pl_contrel_r #define _API_ellarc pl_ellarc_r #define _API_ellarcrel pl_ellarcrel_r #define _API_ellipse pl_ellipse_r #define _API_ellipserel pl_ellipserel_r #define _API_endpath pl_endpath_r #define _API_endsubpath pl_endsubpath_r #define _API_erase pl_erase_r #define _API_farc pl_farc_r #define _API_farcrel pl_farcrel_r #define _API_fbezier2 pl_fbezier2_r #define _API_fbezier2rel pl_fbezier2rel_r #define _API_fbezier3 pl_fbezier3_r #define _API_fbezier3rel pl_fbezier3rel_r #define _API_fbox pl_fbox_r #define _API_fboxrel pl_fboxrel_r #define _API_fcircle pl_fcircle_r #define _API_fcirclerel pl_fcirclerel_r #define _API_fconcat pl_fconcat_r #define _API_fcont pl_fcont_r #define _API_fcontrel pl_fcontrel_r #define _API_fellarc pl_fellarc_r #define _API_fellarcrel pl_fellarcrel_r #define _API_fellipse pl_fellipse_r #define _API_fellipserel pl_fellipserel_r #define _API_ffontname pl_ffontname_r #define _API_ffontsize pl_ffontsize_r #define _API_fillcolor pl_fillcolor_r #define _API_fillcolorname pl_fillcolorname_r #define _API_fillmod pl_fillmod_r #define _API_filltype pl_filltype_r #define _API_flabelwidth pl_flabelwidth_r #define _API_fline pl_fline_r #define _API_flinedash pl_flinedash_r #define _API_flinerel pl_flinerel_r #define _API_flinewidth pl_flinewidth_r #define _API_flushpl pl_flushpl_r #define _API_fmarker pl_fmarker_r #define _API_fmarkerrel pl_fmarkerrel_r #define _API_fmiterlimit pl_fmiterlimit_r #define _API_fmove pl_fmove_r #define _API_fmoverel pl_fmoverel_r #define _API_fontname pl_fontname_r #define _API_fontsize pl_fontsize_r #define _API_fpoint pl_fpoint_r #define _API_fpointrel pl_fpointrel_r #define _API_frotate pl_frotate_r #define _API_fscale pl_fscale_r #define _API_fsetmatrix pl_fsetmatrix_r #define _API_fspace pl_fspace_r #define _API_fspace2 pl_fspace2_r #define _API_ftextangle pl_ftextangle_r #define _API_ftranslate pl_ftranslate_r #define _API_havecap pl_havecap_r #define _API_joinmod pl_joinmod_r #define _API_label pl_label_r #define _API_labelwidth pl_labelwidth_r #define _API_line pl_line_r #define _API_linedash pl_linedash_r #define _API_linemod pl_linemod_r #define _API_linerel pl_linerel_r #define _API_linewidth pl_linewidth_r #define _API_marker pl_marker_r #define _API_markerrel pl_markerrel_r #define _API_move pl_move_r #define _API_moverel pl_moverel_r #define _API_openpl pl_openpl_r #define _API_orientation pl_orientation_r #define _API_outfile pl_outfile_r /* OBSOLESCENT */ #define _API_pencolor pl_pencolor_r #define _API_pencolorname pl_pencolorname_r #define _API_pentype pl_pentype_r #define _API_point pl_point_r #define _API_pointrel pl_pointrel_r #define _API_restorestate pl_restorestate_r #define _API_savestate pl_savestate_r #define _API_space pl_space_r #define _API_space2 pl_space2_r #define _API_textangle pl_textangle_r ___BEGIN_DECLS extern FILE* _API_outfile (Plotter *_plotter, FILE* newstream);/* OBSOLESCENT */ extern double _API_ffontname (Plotter *_plotter, const char *s); extern double _API_ffontsize (Plotter *_plotter, double size); extern double _API_flabelwidth (Plotter *_plotter, const char *s); extern double _API_ftextangle (Plotter *_plotter, double angle); extern int _API_alabel (Plotter *_plotter, int x_justify, int y_justify, const char *s); extern int _API_arc (Plotter *_plotter, int xc, int yc, int x0, int y0, int x1, int y1); extern int _API_arcrel (Plotter *_plotter, int dxc, int dyc, int dx0, int dy0, int dx1, int dy1); extern int _API_bezier2 (Plotter *_plotter, int x0, int y0, int x1, int y1, int x2, int y2); extern int _API_bezier2rel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1, int dx2, int dy2); extern int _API_bezier3 (Plotter *_plotter, int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3); extern int _API_bezier3rel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3); extern int _API_bgcolor (Plotter *_plotter, int red, int green, int blue); extern int _API_bgcolorname (Plotter *_plotter, const char *name); extern int _API_box (Plotter *_plotter, int x0, int y0, int x1, int y1); extern int _API_boxrel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1); extern int _API_capmod (Plotter *_plotter, const char *s); extern int _API_circle (Plotter *_plotter, int x, int y, int r); extern int _API_circlerel (Plotter *_plotter, int dx, int dy, int r); extern int _API_closepath (Plotter *_plotter); extern int _API_closepl (Plotter *_plotter); extern int _API_color (Plotter *_plotter, int red, int green, int blue); extern int _API_colorname (Plotter *_plotter, const char *name); extern int _API_cont (Plotter *_plotter, int x, int y); extern int _API_contrel (Plotter *_plotter, int x, int y); extern int _API_ellarc (Plotter *_plotter, int xc, int yc, int x0, int y0, int x1, int y1); extern int _API_ellarcrel (Plotter *_plotter, int dxc, int dyc, int dx0, int dy0, int dx1, int dy1); extern int _API_ellipse (Plotter *_plotter, int x, int y, int rx, int ry, int angle); extern int _API_ellipserel (Plotter *_plotter, int dx, int dy, int rx, int ry, int angle); extern int _API_endpath (Plotter *_plotter); extern int _API_endsubpath (Plotter *_plotter); extern int _API_erase (Plotter *_plotter); extern int _API_farc (Plotter *_plotter, double xc, double yc, double x0, double y0, double x1, double y1); extern int _API_farcrel (Plotter *_plotter, double dxc, double dyc, double dx0, double dy0, double dx1, double dy1); extern int _API_fbezier2 (Plotter *_plotter, double x0, double y0, double x1, double y1, double x2, double y2); extern int _API_fbezier2rel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1, double dx2, double dy2); extern int _API_fbezier3 (Plotter *_plotter, double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3); extern int _API_fbezier3rel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3); extern int _API_fbox (Plotter *_plotter, double x0, double y0, double x1, double y1); extern int _API_fboxrel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1); extern int _API_fcircle (Plotter *_plotter, double x, double y, double r); extern int _API_fcirclerel (Plotter *_plotter, double dx, double dy, double r); extern int _API_fconcat (Plotter *_plotter, double m0, double m1, double m2, double m3, double m4, double m5); extern int _API_fcont (Plotter *_plotter, double x, double y); extern int _API_fcontrel (Plotter *_plotter, double x, double y); extern int _API_fellarc (Plotter *_plotter, double xc, double yc, double x0, double y0, double x1, double y1); extern int _API_fellarcrel (Plotter *_plotter, double dxc, double dyc, double dx0, double dy0, double dx1, double dy1); extern int _API_fellipse (Plotter *_plotter, double x, double y, double rx, double ry, double angle); extern int _API_fellipserel (Plotter *_plotter, double dx, double dy, double rx, double ry, double angle); extern int _API_fillcolor (Plotter *_plotter, int red, int green, int blue); extern int _API_fillcolorname (Plotter *_plotter, const char *name); extern int _API_fillmod (Plotter *_plotter, const char *s); extern int _API_filltype (Plotter *_plotter, int level); extern int _API_fline (Plotter *_plotter, double x0, double y0, double x1, double y1); extern int _API_flinedash (Plotter *_plotter, int n, const double *dashes, double offset); extern int _API_flinerel (Plotter *_plotter, double dx0, double dy0, double dx1, double dy1); extern int _API_flinewidth (Plotter *_plotter, double size); extern int _API_flushpl (Plotter *_plotter); extern int _API_fmarker (Plotter *_plotter, double x, double y, int type, double size); extern int _API_fmarkerrel (Plotter *_plotter, double dx, double dy, int type, double size); extern int _API_fmiterlimit (Plotter *_plotter, double limit); extern int _API_fmove (Plotter *_plotter, double x, double y); extern int _API_fmoverel (Plotter *_plotter, double x, double y); extern int _API_fontname (Plotter *_plotter, const char *s); extern int _API_fontsize (Plotter *_plotter, int size); extern int _API_fpoint (Plotter *_plotter, double x, double y); extern int _API_fpointrel (Plotter *_plotter, double dx, double dy); extern int _API_frotate (Plotter *_plotter, double theta); extern int _API_fscale (Plotter *_plotter, double x, double y); extern int _API_fsetmatrix (Plotter *_plotter, double m0, double m1, double m2, double m3, double m4, double m5); extern int _API_fspace (Plotter *_plotter, double x0, double y0, double x1, double y1); extern int _API_fspace2 (Plotter *_plotter, double x0, double y0, double x1, double y1, double x2, double y2); extern int _API_ftranslate (Plotter *_plotter, double x, double y); extern int _API_havecap (Plotter *_plotter, const char *s); extern int _API_joinmod (Plotter *_plotter, const char *s); extern int _API_label (Plotter *_plotter, const char *s); extern int _API_labelwidth (Plotter *_plotter, const char *s); extern int _API_line (Plotter *_plotter, int x0, int y0, int x1, int y1); extern int _API_linedash (Plotter *_plotter, int n, const int *dashes, int offset); extern int _API_linemod (Plotter *_plotter, const char *s); extern int _API_linerel (Plotter *_plotter, int dx0, int dy0, int dx1, int dy1); extern int _API_linewidth (Plotter *_plotter, int size); extern int _API_marker (Plotter *_plotter, int x, int y, int type, int size); extern int _API_markerrel (Plotter *_plotter, int dx, int dy, int type, int size); extern int _API_move (Plotter *_plotter, int x, int y); extern int _API_moverel (Plotter *_plotter, int x, int y); extern int _API_openpl (Plotter *_plotter); extern int _API_orientation (Plotter *_plotter, int direction); extern int _API_pencolor (Plotter *_plotter, int red, int green, int blue); extern int _API_pencolorname (Plotter *_plotter, const char *name); extern int _API_pentype (Plotter *_plotter, int level); extern int _API_point (Plotter *_plotter, int x, int y); extern int _API_pointrel (Plotter *_plotter, int dx, int dy); extern int _API_restorestate (Plotter *_plotter); extern int _API_savestate (Plotter *_plotter); extern int _API_space (Plotter *_plotter, int x0, int y0, int x1, int y1); extern int _API_space2 (Plotter *_plotter, int x0, int y0, int x1, int y1, int x2, int y2); extern int _API_textangle (Plotter *_plotter, int angle); /* Plotter protected methods, for libplot */ extern bool _pl_g_begin_page (Plotter *_plotter); extern bool _pl_g_end_page (Plotter *_plotter); extern bool _pl_g_erase_page (Plotter *_plotter); extern bool _pl_g_flush_output (Plotter *_plotter); extern bool _pl_g_paint_marker (Plotter *_plotter, int type, double size); extern bool _pl_g_paint_paths (Plotter *_plotter); extern bool _pl_g_path_is_flushable (Plotter *_plotter); extern bool _pl_g_retrieve_font (Plotter *_plotter); extern double _pl_g_get_text_width (Plotter *_plotter, const unsigned char *s); extern double _pl_g_paint_text_string (Plotter *_plotter, const unsigned char *s, int x_justify, int y_justify); extern void _pl_g_error (Plotter *_plotter, const char *msg); extern void _pl_g_initialize (Plotter *_plotter); extern void _pl_g_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); extern void _pl_g_paint_path (Plotter *_plotter); extern void _pl_g_paint_point (Plotter *_plotter); extern void _pl_g_paint_text_string_with_escapes (Plotter *_plotter, const unsigned char *s, int x_justify, int y_justify); extern void _pl_g_pop_state (Plotter *_plotter); extern void _pl_g_push_state (Plotter *_plotter); extern void _pl_g_terminate (Plotter *_plotter); extern void _pl_g_warning (Plotter *_plotter, const char *msg); /* undocumented public methods that provide access to the font tables within libplot/libplotter; for libplot */ extern void * _pl_get_hershey_font_info (Plotter *_plotter); extern void * _pl_get_ps_font_info (Plotter *_plotter); extern void * _pl_get_pcl_font_info (Plotter *_plotter); extern void * _pl_get_stick_font_info (Plotter *_plotter); /* private functions related to the drawing of text strings in Hershey fonts (defined in g_alab_her.c); for libplot */ extern double _pl_g_alabel_hershey (Plotter *_plotter, const unsigned char *s, int x_justify, int y_justify); extern double _pl_g_flabelwidth_hershey (Plotter *_plotter, const unsigned char *s); extern void _pl_g_draw_hershey_glyph (Plotter *_plotter, int num, double charsize, int type, bool oblique); extern void _pl_g_draw_hershey_penup_stroke (Plotter *_plotter, double dx, double dy, double charsize, bool oblique); extern void _pl_g_draw_hershey_string (Plotter *_plotter, const unsigned short *string); extern void _pl_g_draw_hershey_stroke (Plotter *_plotter, bool pendown, double deltax, double deltay); /* other private Plotter functions (a mixed bag), for libplot */ extern double _pl_g_render_non_hershey_string (Plotter *_plotter, const char *s, bool do_render, int x_justify, int y_justify); extern double _pl_g_render_simple_string (Plotter *_plotter, const unsigned char *s, bool do_render, int h_just, int v_just); extern unsigned short * _pl_g_controlify (Plotter *_plotter, const unsigned char *); extern void _pl_g_copy_params_to_plotter (Plotter *_plotter, const PlotterParams *params); extern void _pl_g_create_first_drawing_state (Plotter *_plotter); extern void _pl_g_delete_first_drawing_state (Plotter *_plotter); extern void _pl_g_free_params_in_plotter (Plotter *_plotter); extern void _pl_g_maybe_replace_arc (Plotter *_plotter); extern void _pl_g_set_font (Plotter *_plotter); /* other protected Plotter functions (a mixed bag), for libplot */ extern void _pl_g_flush_plotter_outstreams (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* static Plotter public method (libplotter only) */ #define parampl Plotter::parampl /* Plotter public methods, for libplotter */ #define _API_alabel Plotter::alabel #define _API_arc Plotter::arc #define _API_arcrel Plotter::arcrel #define _API_bezier2 Plotter::bezier2 #define _API_bezier2rel Plotter::bezier2rel #define _API_bezier3 Plotter::bezier3 #define _API_bezier3rel Plotter::bezier3rel #define _API_bgcolor Plotter::bgcolor #define _API_bgcolorname Plotter::bgcolorname #define _API_box Plotter::box #define _API_boxrel Plotter::boxrel #define _API_capmod Plotter::capmod #define _API_circle Plotter::circle #define _API_circlerel Plotter::circlerel #define _API_closepath Plotter::closepath #define _API_closepl Plotter::closepl #define _API_color Plotter::color #define _API_colorname Plotter::colorname #define _API_cont Plotter::cont #define _API_contrel Plotter::contrel #define _API_ellarc Plotter::ellarc #define _API_ellarcrel Plotter::ellarcrel #define _API_ellipse Plotter::ellipse #define _API_ellipserel Plotter::ellipserel #define _API_endpath Plotter::endpath #define _API_endsubpath Plotter::endsubpath #define _API_erase Plotter::erase #define _API_farc Plotter::farc #define _API_farcrel Plotter::farcrel #define _API_fbezier2 Plotter::fbezier2 #define _API_fbezier2rel Plotter::fbezier2rel #define _API_fbezier3 Plotter::fbezier3 #define _API_fbezier3rel Plotter::fbezier3rel #define _API_fbox Plotter::fbox #define _API_fboxrel Plotter::fboxrel #define _API_fcircle Plotter::fcircle #define _API_fcirclerel Plotter::fcirclerel #define _API_fconcat Plotter::fconcat #define _API_fcont Plotter::fcont #define _API_fcontrel Plotter::fcontrel #define _API_fellarc Plotter::fellarc #define _API_fellarcrel Plotter::fellarcrel #define _API_fellipse Plotter::fellipse #define _API_fellipserel Plotter::fellipserel #define _API_ffontname Plotter::ffontname #define _API_ffontsize Plotter::ffontsize #define _API_fillcolor Plotter::fillcolor #define _API_fillcolorname Plotter::fillcolorname #define _API_fillmod Plotter::fillmod #define _API_filltype Plotter::filltype #define _API_flabelwidth Plotter::flabelwidth #define _API_fline Plotter::fline #define _API_flinedash Plotter::flinedash #define _API_flinerel Plotter::flinerel #define _API_flinewidth Plotter::flinewidth #define _API_flushpl Plotter::flushpl #define _API_fmarker Plotter::fmarker #define _API_fmarkerrel Plotter::fmarkerrel #define _API_fmiterlimit Plotter::fmiterlimit #define _API_fmove Plotter::fmove #define _API_fmoverel Plotter::fmoverel #define _API_fontname Plotter::fontname #define _API_fontsize Plotter::fontsize #define _API_fpoint Plotter::fpoint #define _API_fpointrel Plotter::fpointrel #define _API_frotate Plotter::frotate #define _API_fscale Plotter::fscale #define _API_fsetmatrix Plotter::fsetmatrix #define _API_fspace Plotter::fspace #define _API_fspace2 Plotter::fspace2 #define _API_ftextangle Plotter::ftextangle #define _API_ftranslate Plotter::ftranslate #define _API_havecap Plotter::havecap #define _API_joinmod Plotter::joinmod #define _API_label Plotter::label #define _API_labelwidth Plotter::labelwidth #define _API_line Plotter::line #define _API_linedash Plotter::linedash #define _API_linemod Plotter::linemod #define _API_linerel Plotter::linerel #define _API_linewidth Plotter::linewidth #define _API_marker Plotter::marker #define _API_markerrel Plotter::markerrel #define _API_move Plotter::move #define _API_moverel Plotter::moverel #define _API_openpl Plotter::openpl #define _API_orientation Plotter::orientation #define _API_outfile Plotter::outfile /* OBSOLESCENT */ #define _API_pencolor Plotter::pencolor #define _API_pencolorname Plotter::pencolorname #define _API_pentype Plotter::pentype #define _API_point Plotter::point #define _API_pointrel Plotter::pointrel #define _API_restorestate Plotter::restorestate #define _API_savestate Plotter::savestate #define _API_space Plotter::space #define _API_space2 Plotter::space2 #define _API_textangle Plotter::textangle /* Plotter protected methods, for libplotter */ #define _pl_g_begin_page Plotter::begin_page #define _pl_g_end_page Plotter::end_page #define _pl_g_erase_page Plotter::erase_page #define _pl_g_error Plotter::error #define _pl_g_paint_text_string_with_escapes Plotter::paint_text_string_with_escapes #define _pl_g_paint_text_string Plotter::paint_text_string #define _pl_g_get_text_width Plotter::get_text_width #define _pl_g_flush_output Plotter::flush_output #define _pl_g_initialize Plotter::initialize #define _pl_g_path_is_flushable Plotter::path_is_flushable #define _pl_g_maybe_prepaint_segments Plotter::maybe_prepaint_segments #define _pl_g_paint_marker Plotter::paint_marker #define _pl_g_paint_path Plotter::paint_path #define _pl_g_paint_paths Plotter::paint_paths #define _pl_g_paint_point Plotter::paint_point #define _pl_g_pop_state Plotter::pop_state #define _pl_g_push_state Plotter::push_state #define _pl_g_retrieve_font Plotter::retrieve_font #define _pl_g_terminate Plotter::terminate #define _pl_g_warning Plotter::warning /* undocumented public methods that provide access to the font tables within libplot/libplotter; for libplotter */ #define _pl_get_hershey_font_info Plotter::_get_hershey_font_info #define _pl_get_ps_font_info Plotter::_get_ps_font_info #define _pl_get_pcl_font_info Plotter::_get_pcl_font_info #define _pl_get_stick_font_info Plotter::_get_stick_font_info /* private functions related to the drawing of text strings in Hershey fonts (defined in g_alab_her.c), for libplotter */ #define _pl_g_alabel_hershey Plotter::_g_alabel_hershey #define _pl_g_draw_hershey_glyph Plotter::_g_draw_hershey_glyph #define _pl_g_draw_hershey_penup_stroke Plotter::_g_draw_hershey_penup_stroke #define _pl_g_draw_hershey_string Plotter::_g_draw_hershey_string #define _pl_g_draw_hershey_stroke Plotter::_g_draw_hershey_stroke #define _pl_g_flabelwidth_hershey Plotter::_g_flabelwidth_hershey /* other private functions (a mixed bag), for libplotter */ #define _pl_g_controlify Plotter::_g_controlify #define _pl_g_copy_params_to_plotter Plotter::_g_copy_params_to_plotter #define _pl_g_create_first_drawing_state Plotter::_g_create_first_drawing_state #define _pl_g_delete_first_drawing_state Plotter::_g_delete_first_drawing_state #define _pl_g_free_params_in_plotter Plotter::_g_free_params_in_plotter #define _pl_g_maybe_replace_arc Plotter::_g_maybe_replace_arc #define _pl_g_render_non_hershey_string Plotter::_g_render_non_hershey_string #define _pl_g_render_simple_string Plotter::_g_render_simple_string #define _pl_g_set_font Plotter::_g_set_font /* other protected functions (a mixed bag), for libplotter */ #define _pl_g_flush_plotter_outstreams Plotter::_flush_plotter_outstreams #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* MetaPlotter protected methods, for libplot */ extern bool _pl_m_begin_page (Plotter *_plotter); extern bool _pl_m_end_page (Plotter *_plotter); extern bool _pl_m_erase_page (Plotter *_plotter); extern bool _pl_m_paint_marker (Plotter *_plotter, int type, double size); extern bool _pl_m_paint_paths (Plotter *_plotter); extern bool _pl_m_path_is_flushable (Plotter *_plotter); extern void _pl_m_initialize (Plotter *_plotter); extern void _pl_m_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); extern void _pl_m_paint_path (Plotter *_plotter); extern void _pl_m_paint_point (Plotter *_plotter); extern void _pl_m_paint_text_string_with_escapes (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern void _pl_m_terminate (Plotter *_plotter); /* MetaPlotter-specific internal functions, for libplot */ extern void _pl_m_emit_integer (Plotter *_plotter, int x); extern void _pl_m_emit_float (Plotter *_plotter, double x); extern void _pl_m_emit_op_code (Plotter *_plotter, int c); extern void _pl_m_emit_string (Plotter *_plotter, const char *s); extern void _pl_m_emit_terminator (Plotter *_plotter); extern void _pl_m_paint_path_internal (Plotter *_plotter, const plPath *path); extern void _pl_m_set_attributes (Plotter *_plotter, unsigned int mask); ___END_DECLS #else /* LIBPLOTTER */ /* MetaPlotter protected methods, for libplotter */ #define _pl_m_begin_page MetaPlotter::begin_page #define _pl_m_end_page MetaPlotter::end_page #define _pl_m_erase_page MetaPlotter::erase_page #define _pl_m_paint_text_string_with_escapes MetaPlotter::paint_text_string_with_escapes #define _pl_m_initialize MetaPlotter::initialize #define _pl_m_path_is_flushable MetaPlotter::path_is_flushable #define _pl_m_maybe_prepaint_segments MetaPlotter::maybe_prepaint_segments #define _pl_m_paint_marker MetaPlotter::paint_marker #define _pl_m_paint_path MetaPlotter::paint_path #define _pl_m_paint_paths MetaPlotter::paint_paths #define _pl_m_paint_point MetaPlotter::paint_point #define _pl_m_terminate MetaPlotter::terminate /* MetaPlotter-specific internal functions, for libplotter */ #define _pl_m_emit_integer MetaPlotter::_m_emit_integer #define _pl_m_emit_float MetaPlotter::_m_emit_float #define _pl_m_emit_op_code MetaPlotter::_m_emit_op_code #define _pl_m_emit_string MetaPlotter::_m_emit_string #define _pl_m_emit_terminator MetaPlotter::_m_emit_terminator #define _pl_m_paint_path_internal MetaPlotter::_m_paint_path_internal #define _pl_m_set_attributes MetaPlotter::_m_set_attributes #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* BitmapPlotter protected methods, for libplot */ extern bool _pl_b_begin_page (Plotter *_plotter); extern bool _pl_b_end_page (Plotter *_plotter); extern bool _pl_b_erase_page (Plotter *_plotter); extern bool _pl_b_paint_paths (Plotter *_plotter); extern void _pl_b_initialize (Plotter *_plotter); extern void _pl_b_paint_path (Plotter *_plotter); extern void _pl_b_paint_point (Plotter *_plotter); extern void _pl_b_terminate (Plotter *_plotter); /* BitmapPlotter internal functions, for libplot (overridden in subclasses) */ extern int _pl_b_maybe_output_image (Plotter *_plotter); /* other BitmapPlotter internal functions, for libplot */ extern void _pl_b_delete_image (Plotter *_plotter); extern void _pl_b_draw_elliptic_arc (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); extern void _pl_b_draw_elliptic_arc_2 (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); extern void _pl_b_draw_elliptic_arc_internal (Plotter *_plotter, int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange); extern void _pl_b_new_image (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* BitmapPlotter protected methods, for libplotter */ #define _pl_b_begin_page BitmapPlotter::begin_page #define _pl_b_end_page BitmapPlotter::end_page #define _pl_b_erase_page BitmapPlotter::erase_page #define _pl_b_initialize BitmapPlotter::initialize #define _pl_b_paint_path BitmapPlotter::paint_path #define _pl_b_paint_paths BitmapPlotter::paint_paths #define _pl_b_paint_point BitmapPlotter::paint_point #define _pl_b_terminate BitmapPlotter::terminate /* BitmapPlotter internal functions (overriden in subclasses) */ #define _pl_b_maybe_output_image BitmapPlotter::_maybe_output_image /* other BitmapPlotter internal functions, for libplotter */ #define _pl_b_delete_image BitmapPlotter::_b_delete_image #define _pl_b_draw_elliptic_arc BitmapPlotter::_b_draw_elliptic_arc #define _pl_b_draw_elliptic_arc_2 BitmapPlotter::_b_draw_elliptic_arc_2 #define _pl_b_draw_elliptic_arc_internal BitmapPlotter::_b_draw_elliptic_arc_internal #define _pl_b_new_image BitmapPlotter::_b_new_image #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* TekPlotter protected methods, for libplot */ extern bool _pl_t_begin_page (Plotter *_plotter); extern bool _pl_t_end_page (Plotter *_plotter); extern bool _pl_t_erase_page (Plotter *_plotter); extern bool _pl_t_path_is_flushable (Plotter *_plotter); extern void _pl_t_initialize (Plotter *_plotter); extern void _pl_t_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); extern void _pl_t_paint_point (Plotter *_plotter); extern void _pl_t_terminate (Plotter *_plotter); /* TekPlotter internal functions, for libplot */ extern void _pl_t_set_attributes (Plotter *_plotter); extern void _pl_t_set_bg_color (Plotter *_plotter); extern void _pl_t_set_pen_color (Plotter *_plotter); extern void _pl_t_tek_mode (Plotter *_plotter, int newmode); extern void _pl_t_tek_move (Plotter *_plotter, int xx, int yy); extern void _pl_t_tek_vector_compressed (Plotter *_plotter, int xx, int yy, int oldxx, int oldyy, bool force); extern void _pl_t_tek_vector (Plotter *_plotter, int xx, int yy); ___END_DECLS #else /* LIBPLOTTER */ /* TekPlotter protected methods, for libplotter */ #define _pl_t_begin_page TekPlotter::begin_page #define _pl_t_end_page TekPlotter::end_page #define _pl_t_erase_page TekPlotter::erase_page #define _pl_t_initialize TekPlotter::initialize #define _pl_t_path_is_flushable TekPlotter::path_is_flushable #define _pl_t_maybe_prepaint_segments TekPlotter::maybe_prepaint_segments #define _pl_t_paint_point TekPlotter::paint_point #define _pl_t_terminate TekPlotter::terminate /* TekPlotter internal functions, for libplotter */ #define _pl_t_set_attributes TekPlotter::_t_set_attributes #define _pl_t_set_bg_color TekPlotter::_t_set_bg_color #define _pl_t_set_pen_color TekPlotter::_t_set_pen_color #define _pl_t_tek_mode TekPlotter::_t_tek_mode #define _pl_t_tek_move TekPlotter::_t_tek_move #define _pl_t_tek_vector TekPlotter::_t_tek_vector #define _pl_t_tek_vector_compressed TekPlotter::_t_tek_vector_compressed #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* ReGISPlotter protected methods, for libplot */ extern bool _pl_r_begin_page (Plotter *_plotter); extern bool _pl_r_end_page (Plotter *_plotter); extern bool _pl_r_erase_page (Plotter *_plotter); extern bool _pl_r_paint_paths (Plotter *_plotter); extern bool _pl_r_path_is_flushable (Plotter *_plotter); extern void _pl_r_initialize (Plotter *_plotter); extern void _pl_r_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); extern void _pl_r_paint_path (Plotter *_plotter); extern void _pl_r_paint_point (Plotter *_plotter); extern void _pl_r_terminate (Plotter *_plotter); /* ReGISPlotter internal functions, for libplot */ extern void _pl_r_regis_move (Plotter *_plotter, int xx, int yy); extern void _pl_r_set_attributes (Plotter *_plotter); extern void _pl_r_set_bg_color (Plotter *_plotter); extern void _pl_r_set_fill_color (Plotter *_plotter); extern void _pl_r_set_pen_color (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* ReGISPlotter protected methods, for libplotter */ #define _pl_r_begin_page ReGISPlotter::begin_page #define _pl_r_end_page ReGISPlotter::end_page #define _pl_r_erase_page ReGISPlotter::erase_page #define _pl_r_initialize ReGISPlotter::initialize #define _pl_r_path_is_flushable ReGISPlotter::path_is_flushable #define _pl_r_maybe_prepaint_segments ReGISPlotter::maybe_prepaint_segments #define _pl_r_paint_path ReGISPlotter::paint_path #define _pl_r_paint_paths ReGISPlotter::paint_paths #define _pl_r_paint_point ReGISPlotter::paint_point #define _pl_r_terminate ReGISPlotter::terminate /* ReGISPlotter internal functions, for libplotter */ #define _pl_r_regis_move ReGISPlotter::_r_regis_move #define _pl_r_set_attributes ReGISPlotter::_r_set_attributes #define _pl_r_set_bg_color ReGISPlotter::_r_set_bg_color #define _pl_r_set_fill_color ReGISPlotter::_r_set_fill_color #define _pl_r_set_pen_color ReGISPlotter::_r_set_pen_color #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* HPGLPlotter/PCLPlotter protected methods, for libplot */ extern bool _pl_h_begin_page (Plotter *_plotter); extern bool _pl_h_end_page (Plotter *_plotter); extern bool _pl_h_erase_page (Plotter *_plotter); extern bool _pl_h_paint_paths (Plotter *_plotter); extern double _pl_h_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern void _pl_h_paint_point (Plotter *_plotter); extern void _pl_h_paint_path (Plotter *_plotter); /* HPGLPlotter protected methods, for libplot */ extern void _pl_h_initialize (Plotter *_plotter); extern void _pl_h_terminate (Plotter *_plotter); /* PCLPlotter protected methods, for libplot */ extern void _pl_q_initialize (Plotter *_plotter); extern void _pl_q_terminate (Plotter *_plotter); /* HPGLPlotter/PCLPlotter internal functions, for libplot */ extern bool _pl_h_hpgl2_maybe_update_font (Plotter *_plotter); extern bool _pl_h_hpgl_maybe_update_font (Plotter *_plotter); extern bool _pl_h_parse_pen_string (Plotter *_plotter, const char *pen_s); extern int _pl_h_hpgl_pseudocolor (Plotter *_plotter, int red, int green, int blue, bool restrict_white); extern void _pl_h_hpgl_shaded_pseudocolor (Plotter *_plotter, int red, int green, int blue, int *pen, double *shading); extern void _pl_h_set_attributes (Plotter *_plotter); extern void _pl_h_set_fill_color (Plotter *_plotter, bool force_pen_color); extern void _pl_h_set_font (Plotter *_plotter); extern void _pl_h_set_hpgl_fill_type (Plotter *_plotter, int fill_type, double option1, double option2); extern void _pl_h_set_hpgl_pen (Plotter *_plotter, int pen); extern void _pl_h_set_hpgl_pen_type (Plotter *_plotter, int pen_type, double option1, double option2); extern void _pl_h_set_pen_color (Plotter *_plotter, int hpgl_object_type); extern void _pl_h_set_position (Plotter *_plotter); /* HPGLPlotter functions (overridden in PCLPlotter class), for libplotter */ extern void _pl_h_maybe_switch_to_hpgl (Plotter *_plotter); extern void _pl_h_maybe_switch_from_hpgl (Plotter *_plotter); /* PCLPlotter functions (overriding the above), for libplotter */ extern void _pl_q_maybe_switch_to_hpgl (Plotter *_plotter); extern void _pl_q_maybe_switch_from_hpgl (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* HPGLPlotter/PCLPlotter protected methods, for libplotter */ #define _pl_h_begin_page HPGLPlotter::begin_page #define _pl_h_end_page HPGLPlotter::end_page #define _pl_h_erase_page HPGLPlotter::erase_page #define _pl_h_paint_text_string HPGLPlotter::paint_text_string #define _pl_h_paint_path HPGLPlotter::paint_path #define _pl_h_paint_paths HPGLPlotter::paint_paths #define _pl_h_paint_point HPGLPlotter::paint_point /* HPGLPlotter protected methods, for libplotter */ #define _pl_h_initialize HPGLPlotter::initialize #define _pl_h_terminate HPGLPlotter::terminate /* PCLPlotter protected methods, for libplotter */ #define _pl_q_initialize PCLPlotter::initialize #define _pl_q_terminate PCLPlotter::terminate /* HPGLPlotter/PCLPlotter internal functions, for libplotter */ #define _pl_h_hpgl2_maybe_update_font HPGLPlotter::_h_hpgl2_maybe_update_font #define _pl_h_hpgl_maybe_update_font HPGLPlotter::_h_hpgl_maybe_update_font #define _pl_h_hpgl_pseudocolor HPGLPlotter::_h_hpgl_pseudocolor #define _pl_h_hpgl_shaded_pseudocolor HPGLPlotter::_h_hpgl_shaded_pseudocolor #define _pl_h_parse_pen_string HPGLPlotter::_h_parse_pen_string #define _pl_h_set_attributes HPGLPlotter::_h_set_attributes #define _pl_h_set_fill_color HPGLPlotter::_h_set_fill_color #define _pl_h_set_font HPGLPlotter::_h_set_font #define _pl_h_set_hpgl_fill_type HPGLPlotter::_h_set_hpgl_fill_type #define _pl_h_set_hpgl_pen HPGLPlotter::_h_set_hpgl_pen #define _pl_h_set_hpgl_pen_type HPGLPlotter::_h_set_hpgl_pen_type #define _pl_h_set_pen_color HPGLPlotter::_h_set_pen_color #define _pl_h_set_position HPGLPlotter::_h_set_position /* HPGLPlotter functions (overridden in PCLPlotter class), for libplotter */ #define _pl_h_maybe_switch_to_hpgl HPGLPlotter::_maybe_switch_to_hpgl #define _pl_h_maybe_switch_from_hpgl HPGLPlotter::_maybe_switch_from_hpgl /* PCLPlotter functions (overriding the above), for libplotter */ #define _pl_q_maybe_switch_to_hpgl PCLPlotter::_maybe_switch_to_hpgl #define _pl_q_maybe_switch_from_hpgl PCLPlotter::_maybe_switch_from_hpgl #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* FigPlotter protected methods, for libplot */ extern bool _pl_f_begin_page (Plotter *_plotter); extern bool _pl_f_end_page (Plotter *_plotter); extern bool _pl_f_erase_page (Plotter *_plotter); extern bool _pl_f_paint_paths (Plotter *_plotter); extern bool _pl_f_retrieve_font (Plotter *_plotter); extern double _pl_f_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern void _pl_f_initialize (Plotter *_plotter); extern void _pl_f_paint_path (Plotter *_plotter); extern void _pl_f_paint_point (Plotter *_plotter); extern void _pl_f_terminate (Plotter *_plotter); /* FigPlotter internal functions, for libplot */ extern int _pl_f_fig_color (Plotter *_plotter, int red, int green, int blue); extern void _pl_f_compute_line_style (Plotter *_plotter, int *style, double *spacing); extern void _pl_f_draw_arc_internal (Plotter *_plotter, double xc, double yc, double x0, double y0, double x1, double y1); extern void _pl_f_draw_box_internal (Plotter *_plotter, plPoint p0, plPoint p1); extern void _pl_f_draw_ellipse_internal (Plotter *_plotter, double x, double y, double rx, double ry, double angle, int subtype); extern void _pl_f_set_fill_color (Plotter *_plotter); extern void _pl_f_set_pen_color (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* FigPlotter protected methods, for libplotter */ #define _pl_f_begin_page FigPlotter::begin_page #define _pl_f_end_page FigPlotter::end_page #define _pl_f_erase_page FigPlotter::erase_page #define _pl_f_paint_text_string FigPlotter::paint_text_string #define _pl_f_initialize FigPlotter::initialize #define _pl_f_paint_path FigPlotter::paint_path #define _pl_f_paint_paths FigPlotter::paint_paths #define _pl_f_paint_point FigPlotter::paint_point #define _pl_f_retrieve_font FigPlotter::retrieve_font #define _pl_f_terminate FigPlotter::terminate /* FigPlotter internal functions, for libplotter */ #define _pl_f_compute_line_style FigPlotter::_f_compute_line_style #define _pl_f_draw_arc_internal FigPlotter::_f_draw_arc_internal #define _pl_f_draw_box_internal FigPlotter::_f_draw_box_internal #define _pl_f_draw_ellipse_internal FigPlotter::_f_draw_ellipse_internal #define _pl_f_fig_color FigPlotter::_f_fig_color #define _pl_f_set_fill_color FigPlotter::_f_set_fill_color #define _pl_f_set_pen_color FigPlotter::_f_set_pen_color #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* CGMPlotter protected methods, for libplot */ extern bool _pl_c_begin_page (Plotter *_plotter); extern bool _pl_c_end_page (Plotter *_plotter); extern bool _pl_c_erase_page (Plotter *_plotter); extern bool _pl_c_paint_marker (Plotter *_plotter, int type, double size); extern bool _pl_c_paint_paths (Plotter *_plotter); extern double _pl_c_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern void _pl_c_initialize (Plotter *_plotter); extern void _pl_c_paint_path (Plotter *_plotter); extern void _pl_c_paint_point (Plotter *_plotter); extern void _pl_c_terminate (Plotter *_plotter); /* CGMPlotter internal functions, for libplot */ extern void _pl_c_set_attributes (Plotter *_plotter, int cgm_object_type); extern void _pl_c_set_bg_color (Plotter *_plotter); extern void _pl_c_set_fill_color (Plotter *_plotter, int cgm_object_type); extern void _pl_c_set_pen_color (Plotter *_plotter, int cgm_object_type); ___END_DECLS #else /* LIBPLOTTER */ /* CGMPlotter protected methods, for libplotter */ #define _pl_c_begin_page CGMPlotter::begin_page #define _pl_c_end_page CGMPlotter::end_page #define _pl_c_erase_page CGMPlotter::erase_page #define _pl_c_paint_text_string CGMPlotter::paint_text_string #define _pl_c_initialize CGMPlotter::initialize #define _pl_c_paint_marker CGMPlotter::paint_marker #define _pl_c_paint_path CGMPlotter::paint_path #define _pl_c_paint_paths CGMPlotter::paint_paths #define _pl_c_paint_point CGMPlotter::paint_point #define _pl_c_terminate CGMPlotter::terminate /* CGMPlotter internal functions, for libplotter */ #define _pl_c_set_attributes CGMPlotter::_c_set_attributes #define _pl_c_set_bg_color CGMPlotter::_c_set_bg_color #define _pl_c_set_fill_color CGMPlotter::_c_set_fill_color #define _pl_c_set_pen_color CGMPlotter::_c_set_pen_color #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* PSPlotter protected methods, for libplot */ extern bool _pl_p_begin_page (Plotter *_plotter); extern bool _pl_p_end_page (Plotter *_plotter); extern bool _pl_p_erase_page (Plotter *_plotter); extern bool _pl_p_paint_paths (Plotter *_plotter); extern double _pl_p_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern void _pl_p_initialize (Plotter *_plotter); extern void _pl_p_paint_path (Plotter *_plotter); extern void _pl_p_paint_point (Plotter *_plotter); extern void _pl_p_terminate (Plotter *_plotter); /* PSPlotter internal functions, for libplot */ extern double _pl_p_emit_common_attributes (Plotter *_plotter); extern void _pl_p_compute_idraw_bgcolor (Plotter *_plotter); extern void _pl_p_fellipse_internal (Plotter *_plotter, double x, double y, double rx, double ry, double angle, bool circlep); extern void _pl_p_set_fill_color (Plotter *_plotter); extern void _pl_p_set_pen_color (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* PSPlotter protected methods, for libplotter */ #define _pl_p_begin_page PSPlotter::begin_page #define _pl_p_end_page PSPlotter::end_page #define _pl_p_erase_page PSPlotter::erase_page #define _pl_p_paint_text_string PSPlotter::paint_text_string #define _pl_p_initialize PSPlotter::initialize #define _pl_p_paint_path PSPlotter::paint_path #define _pl_p_paint_paths PSPlotter::paint_paths #define _pl_p_paint_point PSPlotter::paint_point #define _pl_p_terminate PSPlotter::terminate /* PSPlotter internal functions, for libplotter */ #define _pl_p_compute_idraw_bgcolor PSPlotter::_p_compute_idraw_bgcolor #define _pl_p_emit_common_attributes PSPlotter::_p_emit_common_attributes #define _pl_p_fellipse_internal PSPlotter::_p_fellipse_internal #define _pl_p_set_fill_color PSPlotter::_p_set_fill_color #define _pl_p_set_pen_color PSPlotter::_p_set_pen_color #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* AIPlotter protected methods, for libplot */ extern bool _pl_a_begin_page (Plotter *_plotter); extern bool _pl_a_end_page (Plotter *_plotter); extern bool _pl_a_erase_page (Plotter *_plotter); extern bool _pl_a_paint_paths (Plotter *_plotter); extern double _pl_a_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern void _pl_a_initialize (Plotter *_plotter); extern void _pl_a_paint_path (Plotter *_plotter); extern void _pl_a_paint_point (Plotter *_plotter); extern void _pl_a_terminate (Plotter *_plotter); /* AIPlotter internal functions, for libplot */ extern void _pl_a_set_attributes (Plotter *_plotter); extern void _pl_a_set_fill_color (Plotter *_plotter, bool force_pen_color); extern void _pl_a_set_pen_color (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* AIPlotter protected methods, for libplotter */ #define _pl_a_begin_page AIPlotter::begin_page #define _pl_a_end_page AIPlotter::end_page #define _pl_a_erase_page AIPlotter::erase_page #define _pl_a_paint_text_string AIPlotter::paint_text_string #define _pl_a_initialize AIPlotter::initialize #define _pl_a_paint_path AIPlotter::paint_path #define _pl_a_paint_paths AIPlotter::paint_paths #define _pl_a_paint_point AIPlotter::paint_point #define _pl_a_terminate AIPlotter::terminate /* AIPlotter internal functions, for libplotter */ #define _pl_a_set_attributes AIPlotter::_a_set_attributes #define _pl_a_set_fill_color AIPlotter::_a_set_fill_color #define _pl_a_set_pen_color AIPlotter::_a_set_pen_color #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* SVGPlotter protected methods, for libplot */ extern bool _pl_s_begin_page (Plotter *_plotter); extern bool _pl_s_end_page (Plotter *_plotter); extern bool _pl_s_erase_page (Plotter *_plotter); extern bool _pl_s_paint_paths (Plotter *_plotter); extern double _pl_s_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern void _pl_s_initialize (Plotter *_plotter); extern void _pl_s_paint_path (Plotter *_plotter); extern void _pl_s_paint_point (Plotter *_plotter); extern void _pl_s_terminate (Plotter *_plotter); /* PSPlotter internal functions, for libplot */ extern void _pl_s_set_matrix (Plotter *_plotter, const double m_local[6]); ___END_DECLS #else /* LIBPLOTTER */ /* SVGPlotter protected methods, for libplotter */ #define _pl_s_begin_page SVGPlotter::begin_page #define _pl_s_end_page SVGPlotter::end_page #define _pl_s_erase_page SVGPlotter::erase_page #define _pl_s_paint_text_string SVGPlotter::paint_text_string #define _pl_s_initialize SVGPlotter::initialize #define _pl_s_paint_path SVGPlotter::paint_path #define _pl_s_paint_paths SVGPlotter::paint_paths #define _pl_s_paint_point SVGPlotter::paint_point #define _pl_s_terminate SVGPlotter::terminate /* SVGPlotter internal functions, for libplotter */ #define _pl_s_set_matrix SVGPlotter::_s_set_matrix #endif /* LIBPLOTTER */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* PNMPlotter protected methods, for libplot */ extern void _pl_n_initialize (Plotter *_plotter); extern void _pl_n_terminate (Plotter *_plotter); /* PNMPlotter internal functions (which override BitmapPlotter functions) */ extern int _pl_n_maybe_output_image (Plotter *_plotter); /* other PNMPlotter internal functions, for libplot */ extern void _pl_n_write_pnm (Plotter *_plotter); extern void _pl_n_write_pbm (Plotter *_plotter); extern void _pl_n_write_pgm (Plotter *_plotter); extern void _pl_n_write_ppm (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* PNMPlotter protected methods, for libplotter */ #define _pl_n_initialize PNMPlotter::initialize #define _pl_n_terminate PNMPlotter::terminate /* PNMPlotter internal methods (which override BitmapPlotter methods) */ #define _pl_n_maybe_output_image PNMPlotter::_maybe_output_image /* other PNMPlotter internal functions, for libplotter */ #define _pl_n_write_pnm PNMPlotter::_n_write_pnm #define _pl_n_write_pbm PNMPlotter::_n_write_pbm #define _pl_n_write_pgm PNMPlotter::_n_write_pgm #define _pl_n_write_ppm PNMPlotter::_n_write_ppm #endif /* LIBPLOTTER */ #ifdef INCLUDE_PNG_SUPPORT #ifndef LIBPLOTTER ___BEGIN_DECLS /* PNGPlotter protected methods, for libplot */ extern void _pl_z_initialize (Plotter *_plotter); extern void _pl_z_terminate (Plotter *_plotter); /* PNGPlotter internal functions (which override BitmapPlotter functions) */ extern int _pl_z_maybe_output_image (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* PNGPlotter protected methods, for libplotter */ #define _pl_z_initialize PNGPlotter::initialize #define _pl_z_terminate PNGPlotter::terminate /* PNGPlotter internal methods (which override BitmapPlotter methods) */ #define _pl_z_maybe_output_image PNGPlotter::_maybe_output_image #endif /* LIBPLOTTER */ #endif /* INCLUDE_PNG_SUPPORT */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* GIFPlotter protected methods, for libplot */ extern bool _pl_i_begin_page (Plotter *_plotter); extern bool _pl_i_end_page (Plotter *_plotter); extern bool _pl_i_erase_page (Plotter *_plotter); extern bool _pl_i_paint_paths (Plotter *_plotter); extern void _pl_i_initialize (Plotter *_plotter); extern void _pl_i_paint_path (Plotter *_plotter); extern void _pl_i_paint_point (Plotter *_plotter); extern void _pl_i_terminate (Plotter *_plotter); /* GIFPlotter internal functions, for libplot */ extern int _pl_i_scan_pixel (Plotter *_plotter); extern unsigned char _pl_i_new_color_index (Plotter *_plotter, int red, int green, int blue); extern void _pl_i_delete_image (Plotter *_plotter); extern void _pl_i_draw_elliptic_arc (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); extern void _pl_i_draw_elliptic_arc_2 (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); extern void _pl_i_draw_elliptic_arc_internal (Plotter *_plotter, int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange); extern void _pl_i_new_image (Plotter *_plotter); extern void _pl_i_set_bg_color (Plotter *_plotter); extern void _pl_i_set_fill_color (Plotter *_plotter); extern void _pl_i_set_pen_color (Plotter *_plotter); extern void _pl_i_start_scan (Plotter *_plotter); extern void _pl_i_write_gif_header (Plotter *_plotter); extern void _pl_i_write_gif_image (Plotter *_plotter); extern void _pl_i_write_gif_trailer (Plotter *_plotter); extern void _pl_i_write_short_int (Plotter *_plotter, unsigned int i); ___END_DECLS #else /* LIBPLOTTER */ /* GIFPlotter protected methods, for libplotter */ #define _pl_i_begin_page GIFPlotter::begin_page #define _pl_i_end_page GIFPlotter::end_page #define _pl_i_erase_page GIFPlotter::erase_page #define _pl_i_initialize GIFPlotter::initialize #define _pl_i_paint_path GIFPlotter::paint_path #define _pl_i_paint_paths GIFPlotter::paint_paths #define _pl_i_paint_point GIFPlotter::paint_point #define _pl_i_terminate GIFPlotter::terminate /* GIFPlotter internal functions, for libplotter */ #define _pl_i_scan_pixel GIFPlotter::_i_scan_pixel #define _pl_i_new_color_index GIFPlotter::_i_new_color_index #define _pl_i_delete_image GIFPlotter::_i_delete_image #define _pl_i_draw_elliptic_arc GIFPlotter::_i_draw_elliptic_arc #define _pl_i_draw_elliptic_arc_2 GIFPlotter::_i_draw_elliptic_arc_2 #define _pl_i_draw_elliptic_arc_internal GIFPlotter::_i_draw_elliptic_arc_internal #define _pl_i_new_image GIFPlotter::_i_new_image #define _pl_i_set_bg_color GIFPlotter::_i_set_bg_color #define _pl_i_set_fill_color GIFPlotter::_i_set_fill_color #define _pl_i_set_pen_color GIFPlotter::_i_set_pen_color #define _pl_i_start_scan GIFPlotter::_i_start_scan #define _pl_i_write_gif_header GIFPlotter::_i_write_gif_header #define _pl_i_write_gif_image GIFPlotter::_i_write_gif_image #define _pl_i_write_gif_trailer GIFPlotter::_i_write_gif_trailer #define _pl_i_write_short_int GIFPlotter::_i_write_short_int #endif /* LIBPLOTTER */ #ifndef X_DISPLAY_MISSING #ifndef LIBPLOTTER ___BEGIN_DECLS /* XDrawablePlotter/XPlotter protected methods, for libplot */ extern bool _pl_x_begin_page (Plotter *_plotter); extern bool _pl_x_end_page (Plotter *_plotter); extern bool _pl_x_erase_page (Plotter *_plotter); extern bool _pl_x_flush_output (Plotter *_plotter); extern bool _pl_x_paint_paths (Plotter *_plotter); extern bool _pl_x_path_is_flushable (Plotter *_plotter); extern bool _pl_x_retrieve_font (Plotter *_plotter); extern double _pl_x_paint_text_string (Plotter *_plotter, const unsigned char *s, int h_just, int v_just); extern double _pl_x_get_text_width (Plotter *_plotter, const unsigned char *s); extern void _pl_x_initialize (Plotter *_plotter); extern void _pl_x_maybe_prepaint_segments (Plotter *_plotter, int prev_num_segments); extern void _pl_x_paint_path (Plotter *_plotter); extern void _pl_x_paint_point (Plotter *_plotter); extern void _pl_x_pop_state (Plotter *_plotter); extern void _pl_x_push_state (Plotter *_plotter); extern void _pl_x_terminate (Plotter *_plotter); /* XDrawablePlotter/XPlotter internal functions, for libplot */ extern bool _pl_x_retrieve_color (Plotter *_plotter, XColor *rgb_ptr); extern bool _pl_x_select_font_carefully (Plotter *_plotter, const char *name, const unsigned char *s, bool subsetting); extern bool _pl_x_select_xlfd_font_carefully (Plotter *_plotter, const char *x_name, const char *x_name_alt, const char *x_name_alt2, const char *x_name_alt3); extern void _pl_x_add_gcs_to_first_drawing_state (Plotter *_plotter); extern void _pl_x_delete_gcs_from_first_drawing_state (Plotter *_plotter); extern void _pl_x_draw_elliptic_arc (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); extern void _pl_x_draw_elliptic_arc_2 (Plotter *_plotter, plPoint p0, plPoint p1, plPoint pc); extern void _pl_x_draw_elliptic_arc_internal (Plotter *_plotter, int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange); extern void _pl_x_set_attributes (Plotter *_plotter, int x_gc_type); extern void _pl_x_set_bg_color (Plotter *_plotter); extern void _pl_x_set_fill_color (Plotter *_plotter); extern void _pl_x_set_pen_color (Plotter *_plotter); /* XDrawablePlotter internal functions, for libplot */ extern void _pl_x_maybe_get_new_colormap (Plotter *_plotter); extern void _pl_x_maybe_handle_x_events (Plotter *_plotter); /* XPlotter protected methods, for libplot */ extern bool _pl_y_begin_page (Plotter *_plotter); extern bool _pl_y_end_page (Plotter *_plotter); extern bool _pl_y_erase_page (Plotter *_plotter); extern void _pl_y_initialize (Plotter *_plotter); extern void _pl_y_terminate (Plotter *_plotter); /* XPlotter internal functions, for libplot */ extern void _pl_y_flush_plotter_outstreams (Plotter *_plotter); extern void _pl_y_maybe_get_new_colormap (Plotter *_plotter); extern void _pl_y_maybe_handle_x_events (Plotter *_plotter); extern void _pl_y_set_data_for_quitting (Plotter *_plotter); ___END_DECLS #else /* LIBPLOTTER */ /* XDrawablePlotter/XPlotter protected methods, for libplotter */ #define _pl_x_begin_page XDrawablePlotter::begin_page #define _pl_x_end_page XDrawablePlotter::end_page #define _pl_x_erase_page XDrawablePlotter::erase_page #define _pl_x_paint_text_string XDrawablePlotter::paint_text_string #define _pl_x_get_text_width XDrawablePlotter::get_text_width #define _pl_x_flush_output XDrawablePlotter::flush_output #define _pl_x_path_is_flushable XDrawablePlotter::path_is_flushable #define _pl_x_maybe_prepaint_segments XDrawablePlotter::maybe_prepaint_segments #define _pl_x_paint_path XDrawablePlotter::paint_path #define _pl_x_paint_paths XDrawablePlotter::paint_paths #define _pl_x_paint_point XDrawablePlotter::paint_point #define _pl_x_pop_state XDrawablePlotter::pop_state #define _pl_x_push_state XDrawablePlotter::push_state #define _pl_x_retrieve_font XDrawablePlotter::retrieve_font /* XDrawablePlotter protected methods (overridden in XPlotter class) */ #define _pl_x_initialize XDrawablePlotter::initialize #define _pl_x_terminate XDrawablePlotter::terminate /* XPlotter protected methods (which override the preceding) */ #define _pl_y_begin_page XPlotter::begin_page #define _pl_y_end_page XPlotter::end_page #define _pl_y_erase_page XPlotter::erase_page #define _pl_y_initialize XPlotter::initialize #define _pl_y_terminate XPlotter::terminate /* XDrawablePlotter/XPlotter internal functions, for libplotter */ #define _pl_x_add_gcs_to_first_drawing_state XDrawablePlotter::_x_add_gcs_to_first_drawing_state #define _pl_x_delete_gcs_from_first_drawing_state XDrawablePlotter::_x_delete_gcs_from_first_drawing_state #define _pl_x_draw_elliptic_arc XDrawablePlotter::_x_draw_elliptic_arc #define _pl_x_draw_elliptic_arc_2 XDrawablePlotter::_x_draw_elliptic_arc_2 #define _pl_x_draw_elliptic_arc_internal XDrawablePlotter::_x_draw_elliptic_arc_internal #define _pl_x_retrieve_color XDrawablePlotter::_x_retrieve_color #define _pl_x_select_font XDrawablePlotter::_x_select_font #define _pl_x_select_font_carefully XDrawablePlotter::_x_select_font_carefully #define _pl_x_select_xlfd_font_carefully XDrawablePlotter::_x_select_xlfd_font_carefully #define _pl_x_set_attributes XDrawablePlotter::_x_set_attributes #define _pl_x_set_bg_color XDrawablePlotter::_x_set_bg_color #define _pl_x_set_fill_color XDrawablePlotter::_x_set_fill_color #define _pl_x_set_font_dimensions XDrawablePlotter::_x_set_font_dimensions #define _pl_x_set_pen_color XDrawablePlotter::_x_set_pen_color /* XDrawablePlotter internal functions (overridden in XPlotter class) */ #define _pl_x_maybe_get_new_colormap XDrawablePlotter::_maybe_get_new_colormap #define _pl_x_maybe_handle_x_events XDrawablePlotter::_maybe_handle_x_events /* XPlotter internal functions (which override the preceding) */ #define _pl_y_maybe_get_new_colormap XPlotter::_maybe_get_new_colormap #define _pl_y_maybe_handle_x_events XPlotter::_maybe_handle_x_events /* other XPlotter internal functions, for libplotter */ #define _pl_y_flush_plotter_outstreams XPlotter::_y_flush_plotter_outstreams #define _pl_y_set_data_for_quitting XPlotter::_y_set_data_for_quitting #endif /* LIBPLOTTER */ #endif /* not X_DISPLAY_MISSING */ /* Declarations of the PlotterParams methods. In libplot, these are declarations of global functions. But in libplotter, we use #define and the double colon notation to make them function members of the PlotterParams class. The ___BEGIN_DECLS...___END_DECLS is to support compilation of libplot by a C++ compiler; see the remarks above. */ #ifndef LIBPLOTTER ___BEGIN_DECLS /* PlotterParams public methods, for libplot */ extern int _setplparam (PlotterParams *_plotter_params, const char *parameter, void * value); extern int _pushplparams (PlotterParams *_plotter_params); extern int _popplparams (PlotterParams *_plotter_params); ___END_DECLS #else /* LIBPLOTTER */ /* PlotterParams public methods, for libplotter */ #define _setplparam PlotterParams::setplparam #define _pushplparams PlotterParams::pushplparams #define _popplparams PlotterParams::popplparams #endif /* LIBPLOTTER */ plotutils-2.6/libplot/g_arc.h0000644000175000017500000001156611037243262013243 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Lookup table listing relative chordal deviation, i.e. the factor (chordal deviation)/(chord length), for binary subdivisions of the arc sizes we support. The symbolic names for these arc sizes, e.g. QUARTER_ARC and THREE_QUARTER_ARC, are defined in extern.h. The constant MAX_ARC_SUBDIVISIONS, which can in principle be device dependent, is also defined there. It should be no greater than TABULATED_ARC_SUBDIVISIONS, the length of each entry in the lookup table. The formula relative_deviation = (1 - cos (theta/2)) / (2 * sin (theta/2)), where theta = subtended angle, was used to compute the numbers in the lookup tables. The formula is justified as follows. Let s = chordal deviation / radius (so that 0 <= s <= 2) h = half chord length / radius. Then by elementary trigonometry, s = 1 - cos(theta/2) and h = sin(theta/2), where theta = angle subtended by the chord. Since the relative chordal deviation is s/2h, this justifies the formula. Incidentally, h = sqrt(s * (2-s))), irrespective of theta. There is an alternative derivation of the numbers in these tables, tail-recursive and elegant, which uses only sqrt(). Let s' and h' be the values of s and h when the arc is bisected, i.e. theta is divided by two. Using half-angle formulae it is easy to check that s' = 1 - sqrt (1 - s / 2) h' = h / 2 (1 - s') (The first of these formulae is well-known; see the article of Ken Turkowski in Graphics Gems V, where he approximates the right-hand side by s/4.) So the pair (s',h') may be computed from the pair (s,h). By updating (s,h) with every bisection, one can generate a table of successive values of the quotient s/2h, i.e. the relative chordal deviation. */ /* Maximum number of times a circular or elliptic arc is recursively subdivided, when it is being approximated by an inscribed polyline. The polyline will contain no more than 2**MAX_ARC_SUBDIVISIONS line segments. MAX_ARC_SUBDIVISIONS must be no larger than TABULATED_ARC_SUBDIVISIONS below (the size of the tables in g_arc.h). */ #define MAX_ARC_SUBDIVISIONS 5 /* to avoid buffer overflow on HP7550[A|B] */ #define TABULATED_ARC_SUBDIVISIONS 15 /* length of each table entry */ /* Types of circular/elliptic arc. These index into the doubly indexed table of `relative chordal deviations' below. */ #define NUM_ARC_TYPES 3 #define QUARTER_ARC 0 #define HALF_ARC 1 #define THREE_QUARTER_ARC 2 #define USER_DEFINED_ARC -1 /* does not index into table */ static const double _chord_table[NUM_ARC_TYPES][TABULATED_ARC_SUBDIVISIONS] = { { /* Quarter Arc */ 0.20710678, /* for arc subtending 90 degrees */ 0.099456184, /* for arc subtending 45 degrees */ 0.049245702, /* for arc subtending 22.5 degrees */ 0.024563425, /* for arc subtending 11.25 degrees */ 0.012274311, /* etc. */ 0.0061362312, 0.0030680001, 0.0015339856, 0.000766991, 0.00038349527, 0.00019174761, 9.58738e-05, 4.79369e-05, 2.396845e-05, 1.1984225e-05 }, { /* Half Arc */ 0.5, /* for arc subtending 180 degrees */ 0.20710678, /* for arc subtending 90 degrees */ 0.099456184, /* for arc subtending 45 degrees */ 0.049245702, /* for arc subtending 22.5 degrees */ 0.024563425, /* for arc subtending 11.25 degrees */ 0.012274311, /* etc. */ 0.0061362312, 0.0030680001, 0.0015339856, 0.000766991, 0.00038349527, 0.00019174761, 9.58738e-05, 4.79369e-05, 2.396845e-05 }, { /* Three Quarter Arc */ 1.2071068, /* for arc subtending 270 degrees */ 0.33408932, /* for arc subtending 135 degrees */ 0.15167334, /* for arc subtending 67.5 degrees */ 0.074167994, /* for arc subtending 33.75 degrees */ 0.036882216, /* etc. */ 0.01841609, 0.0092049244, 0.0046020723, 0.0023009874, 0.0011504876, 0.00057524305, 0.00028762143, 0.0001438107, 7.190535e-05, 3.5952675e-05 } }; plotutils-2.6/libplot/g_colorname.h0000644000175000017500000006061711037243262014456 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the color names recognized by libplot, and their 24-bit interpretation (internally, we extend to 48 bits by doubling each byte). It is #included by g_colors.c. The table below is taken largely from the `rgb.txt' file distributed with X11R6 (version 10.41, dated 20 Feb 94). However, it was discovered that for a few color names containing the substring "gray", `rgb.txt' did not include the corresponding names containing the substring "grey", as it should. They have been added. */ #define NUM_COLORNAMES 665 /* could declare this array `extern', so that applications linked with libplot/libplotter can secretly access it, if they want to :-) */ static const plColorNameInfo _pl_g_colornames[NUM_COLORNAMES + 1] = { {"aliceblue", 0xf0, 0xf8, 0xff}, {"antiquewhite", 0xfa, 0xeb, 0xd7}, {"antiquewhite1", 0xff, 0xef, 0xdb}, {"antiquewhite2", 0xee, 0xdf, 0xcc}, {"antiquewhite3", 0xcd, 0xc0, 0xb0}, {"antiquewhite4", 0x8b, 0x83, 0x78}, {"aquamarine", 0x7f, 0xff, 0xd4}, {"aquamarine1", 0x7f, 0xff, 0xd4}, {"aquamarine2", 0x76, 0xee, 0xc6}, {"aquamarine3", 0x66, 0xcd, 0xaa}, {"aquamarine4", 0x45, 0x8b, 0x74}, {"azure", 0xf0, 0xff, 0xff}, {"azure1", 0xf0, 0xff, 0xff}, {"azure2", 0xe0, 0xee, 0xee}, {"azure3", 0xc1, 0xcd, 0xcd}, {"azure4", 0x83, 0x8b, 0x8b}, {"beige", 0xf5, 0xf5, 0xdc}, {"bisque", 0xff, 0xe4, 0xc4}, {"bisque1", 0xff, 0xe4, 0xc4}, {"bisque2", 0xee, 0xd5, 0xb7}, {"bisque3", 0xcd, 0xb7, 0x9e}, {"bisque4", 0x8b, 0x7d, 0x6b}, {"black", 0x00, 0x00, 0x00}, {"blanchedalmond", 0xff, 0xeb, 0xcd}, {"blue", 0x00, 0x00, 0xff}, {"blue1", 0x00, 0x00, 0xff}, {"blue2", 0x00, 0x00, 0xee}, {"blue3", 0x00, 0x00, 0xcd}, {"blue4", 0x00, 0x00, 0x8b}, {"blueviolet", 0x8a, 0x2b, 0xe2}, {"brown", 0xa5, 0x2a, 0x2a}, {"brown1", 0xff, 0x40, 0x40}, {"brown2", 0xee, 0x3b, 0x3b}, {"brown3", 0xcd, 0x33, 0x33}, {"brown4", 0x8b, 0x23, 0x23}, {"burlywood", 0xde, 0xb8, 0x87}, {"burlywood1", 0xff, 0xd3, 0x9b}, {"burlywood2", 0xee, 0xc5, 0x91}, {"burlywood3", 0xcd, 0xaa, 0x7d}, {"burlywood4", 0x8b, 0x73, 0x55}, {"cadetblue", 0x5f, 0x9e, 0xa0}, {"cadetblue1", 0x98, 0xf5, 0xff}, {"cadetblue2", 0x8e, 0xe5, 0xee}, {"cadetblue3", 0x7a, 0xc5, 0xcd}, {"cadetblue4", 0x53, 0x86, 0x8b}, {"chartreuse", 0x7f, 0xff, 0x00}, {"chartreuse1", 0x7f, 0xff, 0x00}, {"chartreuse2", 0x76, 0xee, 0x00}, {"chartreuse3", 0x66, 0xcd, 0x00}, {"chartreuse4", 0x45, 0x8b, 0x00}, {"chocolate", 0xd2, 0x69, 0x1e}, {"chocolate1", 0xff, 0x7f, 0x24}, {"chocolate2", 0xee, 0x76, 0x21}, {"chocolate3", 0xcd, 0x66, 0x1d}, {"chocolate4", 0x8b, 0x45, 0x13}, {"coral", 0xff, 0x7f, 0x50}, {"coral1", 0xff, 0x72, 0x56}, {"coral2", 0xee, 0x6a, 0x50}, {"coral3", 0xcd, 0x5b, 0x45}, {"coral4", 0x8b, 0x3e, 0x2f}, {"cornflowerblue", 0x64, 0x95, 0xed}, {"cornsilk", 0xff, 0xf8, 0xdc}, {"cornsilk1", 0xff, 0xf8, 0xdc}, {"cornsilk2", 0xee, 0xe8, 0xcd}, {"cornsilk3", 0xcd, 0xc8, 0xb1}, {"cornsilk4", 0x8b, 0x88, 0x78}, {"cyan", 0x00, 0xff, 0xff}, {"cyan1", 0x00, 0xff, 0xff}, {"cyan2", 0x00, 0xee, 0xee}, {"cyan3", 0x00, 0xcd, 0xcd}, {"cyan4", 0x00, 0x8b, 0x8b}, {"darkblue", 0x00, 0x00, 0x8b}, {"darkcyan", 0x00, 0x8b, 0x8b}, {"darkgoldenrod", 0xb8, 0x86, 0x0b}, {"darkgoldenrod1", 0xff, 0xb9, 0x0f}, {"darkgoldenrod2", 0xee, 0xad, 0x0e}, {"darkgoldenrod3", 0xcd, 0x95, 0x0c}, {"darkgoldenrod4", 0x8b, 0x65, 0x08}, {"darkgray", 0xa9, 0xa9, 0xa9}, {"darkgreen", 0x00, 0x64, 0x00}, {"darkgrey", 0xa9, 0xa9, 0xa9}, {"darkkhaki", 0xbd, 0xb7, 0x6b}, {"darkmagenta", 0x8b, 0x00, 0x8b}, {"darkolivegreen", 0x55, 0x6b, 0x2f}, {"darkolivegreen1", 0xca, 0xff, 0x70}, {"darkolivegreen2", 0xbc, 0xee, 0x68}, {"darkolivegreen3", 0xa2, 0xcd, 0x5a}, {"darkolivegreen4", 0x6e, 0x8b, 0x3d}, {"darkorange", 0xff, 0x8c, 0x00}, {"darkorange1", 0xff, 0x7f, 0x00}, {"darkorange2", 0xee, 0x76, 0x00}, {"darkorange3", 0xcd, 0x66, 0x00}, {"darkorange4", 0x8b, 0x45, 0x00}, {"darkorchid", 0x99, 0x32, 0xcc}, {"darkorchid1", 0xbf, 0x3e, 0xff}, {"darkorchid2", 0xb2, 0x3a, 0xee}, {"darkorchid3", 0x9a, 0x32, 0xcd}, {"darkorchid4", 0x68, 0x22, 0x8b}, {"darkred", 0x8b, 0x00, 0x00}, {"darksalmon", 0xe9, 0x96, 0x7a}, {"darkseagreen", 0x8f, 0xbc, 0x8f}, {"darkseagreen1", 0xc1, 0xff, 0xc1}, {"darkseagreen2", 0xb4, 0xee, 0xb4}, {"darkseagreen3", 0x9b, 0xcd, 0x9b}, {"darkseagreen4", 0x69, 0x8b, 0x69}, {"darkslateblue", 0x48, 0x3d, 0x8b}, {"darkslategray", 0x2f, 0x4f, 0x4f}, {"darkslategray1", 0x97, 0xff, 0xff}, {"darkslategray2", 0x8d, 0xee, 0xee}, {"darkslategray3", 0x79, 0xcd, 0xcd}, {"darkslategray4", 0x52, 0x8b, 0x8b}, {"darkslategrey", 0x2f, 0x4f, 0x4f}, {"darkslategrey1", 0x97, 0xff, 0xff}, {"darkslategrey2", 0x8d, 0xee, 0xee}, {"darkslategrey3", 0x79, 0xcd, 0xcd}, {"darkslategrey4", 0x52, 0x8b, 0x8b}, {"darkturquoise", 0x00, 0xce, 0xd1}, {"darkviolet", 0x94, 0x00, 0xd3}, {"deeppink", 0xff, 0x14, 0x93}, {"deeppink1", 0xff, 0x14, 0x93}, {"deeppink2", 0xee, 0x12, 0x89}, {"deeppink3", 0xcd, 0x10, 0x76}, {"deeppink4", 0x8b, 0x0a, 0x50}, {"deepskyblue", 0x00, 0xbf, 0xff}, {"deepskyblue1", 0x00, 0xbf, 0xff}, {"deepskyblue2", 0x00, 0xb2, 0xee}, {"deepskyblue3", 0x00, 0x9a, 0xcd}, {"deepskyblue4", 0x00, 0x68, 0x8b}, {"dimgray", 0x69, 0x69, 0x69}, {"dimgrey", 0x69, 0x69, 0x69}, {"dodgerblue", 0x1e, 0x90, 0xff}, {"dodgerblue1", 0x1e, 0x90, 0xff}, {"dodgerblue2", 0x1c, 0x86, 0xee}, {"dodgerblue3", 0x18, 0x74, 0xcd}, {"dodgerblue4", 0x10, 0x4e, 0x8b}, {"firebrick", 0xb2, 0x22, 0x22}, {"firebrick1", 0xff, 0x30, 0x30}, {"firebrick2", 0xee, 0x2c, 0x2c}, {"firebrick3", 0xcd, 0x26, 0x26}, {"firebrick4", 0x8b, 0x1a, 0x1a}, {"floralwhite", 0xff, 0xfa, 0xf0}, {"forestgreen", 0x22, 0x8b, 0x22}, {"gainsboro", 0xdc, 0xdc, 0xdc}, {"ghostwhite", 0xf8, 0xf8, 0xff}, {"gold", 0xff, 0xd7, 0x00}, {"gold1", 0xff, 0xd7, 0x00}, {"gold2", 0xee, 0xc9, 0x00}, {"gold3", 0xcd, 0xad, 0x00}, {"gold4", 0x8b, 0x75, 0x00}, {"goldenrod", 0xda, 0xa5, 0x20}, {"goldenrod1", 0xff, 0xc1, 0x25}, {"goldenrod2", 0xee, 0xb4, 0x22}, {"goldenrod3", 0xcd, 0x9b, 0x1d}, {"goldenrod4", 0x8b, 0x69, 0x14}, {"gray", 0xbe, 0xbe, 0xbe}, {"gray0", 0x00, 0x00, 0x00}, {"gray1", 0x03, 0x03, 0x03}, {"gray2", 0x05, 0x05, 0x05}, {"gray3", 0x08, 0x08, 0x08}, {"gray4", 0x0a, 0x0a, 0x0a}, {"gray5", 0x0d, 0x0d, 0x0d}, {"gray6", 0x0f, 0x0f, 0x0f}, {"gray7", 0x12, 0x12, 0x12}, {"gray8", 0x14, 0x14, 0x14}, {"gray9", 0x17, 0x17, 0x17}, {"gray10", 0x1a, 0x1a, 0x1a}, {"gray11", 0x1c, 0x1c, 0x1c}, {"gray12", 0x1f, 0x1f, 0x1f}, {"gray13", 0x21, 0x21, 0x21}, {"gray14", 0x24, 0x24, 0x24}, {"gray15", 0x26, 0x26, 0x26}, {"gray16", 0x29, 0x29, 0x29}, {"gray17", 0x2b, 0x2b, 0x2b}, {"gray18", 0x2e, 0x2e, 0x2e}, {"gray19", 0x30, 0x30, 0x30}, {"gray20", 0x33, 0x33, 0x33}, {"gray21", 0x36, 0x36, 0x36}, {"gray22", 0x38, 0x38, 0x38}, {"gray23", 0x3b, 0x3b, 0x3b}, {"gray24", 0x3d, 0x3d, 0x3d}, {"gray25", 0x40, 0x40, 0x40}, {"gray26", 0x42, 0x42, 0x42}, {"gray27", 0x45, 0x45, 0x45}, {"gray28", 0x47, 0x47, 0x47}, {"gray29", 0x4a, 0x4a, 0x4a}, {"gray30", 0x4d, 0x4d, 0x4d}, {"gray31", 0x4f, 0x4f, 0x4f}, {"gray32", 0x52, 0x52, 0x52}, {"gray33", 0x54, 0x54, 0x54}, {"gray34", 0x57, 0x57, 0x57}, {"gray35", 0x59, 0x59, 0x59}, {"gray36", 0x5c, 0x5c, 0x5c}, {"gray37", 0x5e, 0x5e, 0x5e}, {"gray38", 0x61, 0x61, 0x61}, {"gray39", 0x63, 0x63, 0x63}, {"gray40", 0x66, 0x66, 0x66}, {"gray41", 0x69, 0x69, 0x69}, {"gray42", 0x6b, 0x6b, 0x6b}, {"gray43", 0x6e, 0x6e, 0x6e}, {"gray44", 0x70, 0x70, 0x70}, {"gray45", 0x73, 0x73, 0x73}, {"gray46", 0x75, 0x75, 0x75}, {"gray47", 0x78, 0x78, 0x78}, {"gray48", 0x7a, 0x7a, 0x7a}, {"gray49", 0x7d, 0x7d, 0x7d}, {"gray50", 0x7f, 0x7f, 0x7f}, {"gray51", 0x82, 0x82, 0x82}, {"gray52", 0x85, 0x85, 0x85}, {"gray53", 0x87, 0x87, 0x87}, {"gray54", 0x8a, 0x8a, 0x8a}, {"gray55", 0x8c, 0x8c, 0x8c}, {"gray56", 0x8f, 0x8f, 0x8f}, {"gray57", 0x91, 0x91, 0x91}, {"gray58", 0x94, 0x94, 0x94}, {"gray59", 0x96, 0x96, 0x96}, {"gray60", 0x99, 0x99, 0x99}, {"gray61", 0x9c, 0x9c, 0x9c}, {"gray62", 0x9e, 0x9e, 0x9e}, {"gray63", 0xa1, 0xa1, 0xa1}, {"gray64", 0xa3, 0xa3, 0xa3}, {"gray65", 0xa6, 0xa6, 0xa6}, {"gray66", 0xa8, 0xa8, 0xa8}, {"gray67", 0xab, 0xab, 0xab}, {"gray68", 0xad, 0xad, 0xad}, {"gray69", 0xb0, 0xb0, 0xb0}, {"gray70", 0xb3, 0xb3, 0xb3}, {"gray71", 0xb5, 0xb5, 0xb5}, {"gray72", 0xb8, 0xb8, 0xb8}, {"gray73", 0xba, 0xba, 0xba}, {"gray74", 0xbd, 0xbd, 0xbd}, {"gray75", 0xbf, 0xbf, 0xbf}, {"gray76", 0xc2, 0xc2, 0xc2}, {"gray77", 0xc4, 0xc4, 0xc4}, {"gray78", 0xc7, 0xc7, 0xc7}, {"gray79", 0xc9, 0xc9, 0xc9}, {"gray80", 0xcc, 0xcc, 0xcc}, {"gray81", 0xcf, 0xcf, 0xcf}, {"gray82", 0xd1, 0xd1, 0xd1}, {"gray83", 0xd4, 0xd4, 0xd4}, {"gray84", 0xd6, 0xd6, 0xd6}, {"gray85", 0xd9, 0xd9, 0xd9}, {"gray86", 0xdb, 0xdb, 0xdb}, {"gray87", 0xde, 0xde, 0xde}, {"gray88", 0xe0, 0xe0, 0xe0}, {"gray89", 0xe3, 0xe3, 0xe3}, {"gray90", 0xe5, 0xe5, 0xe5}, {"gray91", 0xe8, 0xe8, 0xe8}, {"gray92", 0xeb, 0xeb, 0xeb}, {"gray93", 0xed, 0xed, 0xed}, {"gray94", 0xf0, 0xf0, 0xf0}, {"gray95", 0xf2, 0xf2, 0xf2}, {"gray96", 0xf5, 0xf5, 0xf5}, {"gray97", 0xf7, 0xf7, 0xf7}, {"gray98", 0xfa, 0xfa, 0xfa}, {"gray99", 0xfc, 0xfc, 0xfc}, {"gray100", 0xff, 0xff, 0xff}, {"green", 0x00, 0xff, 0x00}, {"green1", 0x00, 0xff, 0x00}, {"green2", 0x00, 0xee, 0x00}, {"green3", 0x00, 0xcd, 0x00}, {"green4", 0x00, 0x8b, 0x00}, {"greenyellow", 0xad, 0xff, 0x2f}, {"grey", 0xbe, 0xbe, 0xbe}, {"grey0", 0x00, 0x00, 0x00}, {"grey1", 0x03, 0x03, 0x03}, {"grey2", 0x05, 0x05, 0x05}, {"grey3", 0x08, 0x08, 0x08}, {"grey4", 0x0a, 0x0a, 0x0a}, {"grey5", 0x0d, 0x0d, 0x0d}, {"grey6", 0x0f, 0x0f, 0x0f}, {"grey7", 0x12, 0x12, 0x12}, {"grey8", 0x14, 0x14, 0x14}, {"grey9", 0x17, 0x17, 0x17}, {"grey10", 0x1a, 0x1a, 0x1a}, {"grey11", 0x1c, 0x1c, 0x1c}, {"grey12", 0x1f, 0x1f, 0x1f}, {"grey13", 0x21, 0x21, 0x21}, {"grey14", 0x24, 0x24, 0x24}, {"grey15", 0x26, 0x26, 0x26}, {"grey16", 0x29, 0x29, 0x29}, {"grey17", 0x2b, 0x2b, 0x2b}, {"grey18", 0x2e, 0x2e, 0x2e}, {"grey19", 0x30, 0x30, 0x30}, {"grey20", 0x33, 0x33, 0x33}, {"grey21", 0x36, 0x36, 0x36}, {"grey22", 0x38, 0x38, 0x38}, {"grey23", 0x3b, 0x3b, 0x3b}, {"grey24", 0x3d, 0x3d, 0x3d}, {"grey25", 0x40, 0x40, 0x40}, {"grey26", 0x42, 0x42, 0x42}, {"grey27", 0x45, 0x45, 0x45}, {"grey28", 0x47, 0x47, 0x47}, {"grey29", 0x4a, 0x4a, 0x4a}, {"grey30", 0x4d, 0x4d, 0x4d}, {"grey31", 0x4f, 0x4f, 0x4f}, {"grey32", 0x52, 0x52, 0x52}, {"grey33", 0x54, 0x54, 0x54}, {"grey34", 0x57, 0x57, 0x57}, {"grey35", 0x59, 0x59, 0x59}, {"grey36", 0x5c, 0x5c, 0x5c}, {"grey37", 0x5e, 0x5e, 0x5e}, {"grey38", 0x61, 0x61, 0x61}, {"grey39", 0x63, 0x63, 0x63}, {"grey40", 0x66, 0x66, 0x66}, {"grey41", 0x69, 0x69, 0x69}, {"grey42", 0x6b, 0x6b, 0x6b}, {"grey43", 0x6e, 0x6e, 0x6e}, {"grey44", 0x70, 0x70, 0x70}, {"grey45", 0x73, 0x73, 0x73}, {"grey46", 0x75, 0x75, 0x75}, {"grey47", 0x78, 0x78, 0x78}, {"grey48", 0x7a, 0x7a, 0x7a}, {"grey49", 0x7d, 0x7d, 0x7d}, {"grey50", 0x7f, 0x7f, 0x7f}, {"grey51", 0x82, 0x82, 0x82}, {"grey52", 0x85, 0x85, 0x85}, {"grey53", 0x87, 0x87, 0x87}, {"grey54", 0x8a, 0x8a, 0x8a}, {"grey55", 0x8c, 0x8c, 0x8c}, {"grey56", 0x8f, 0x8f, 0x8f}, {"grey57", 0x91, 0x91, 0x91}, {"grey58", 0x94, 0x94, 0x94}, {"grey59", 0x96, 0x96, 0x96}, {"grey60", 0x99, 0x99, 0x99}, {"grey61", 0x9c, 0x9c, 0x9c}, {"grey62", 0x9e, 0x9e, 0x9e}, {"grey63", 0xa1, 0xa1, 0xa1}, {"grey64", 0xa3, 0xa3, 0xa3}, {"grey65", 0xa6, 0xa6, 0xa6}, {"grey66", 0xa8, 0xa8, 0xa8}, {"grey67", 0xab, 0xab, 0xab}, {"grey68", 0xad, 0xad, 0xad}, {"grey69", 0xb0, 0xb0, 0xb0}, {"grey70", 0xb3, 0xb3, 0xb3}, {"grey71", 0xb5, 0xb5, 0xb5}, {"grey72", 0xb8, 0xb8, 0xb8}, {"grey73", 0xba, 0xba, 0xba}, {"grey74", 0xbd, 0xbd, 0xbd}, {"grey75", 0xbf, 0xbf, 0xbf}, {"grey76", 0xc2, 0xc2, 0xc2}, {"grey77", 0xc4, 0xc4, 0xc4}, {"grey78", 0xc7, 0xc7, 0xc7}, {"grey79", 0xc9, 0xc9, 0xc9}, {"grey80", 0xcc, 0xcc, 0xcc}, {"grey81", 0xcf, 0xcf, 0xcf}, {"grey82", 0xd1, 0xd1, 0xd1}, {"grey83", 0xd4, 0xd4, 0xd4}, {"grey84", 0xd6, 0xd6, 0xd6}, {"grey85", 0xd9, 0xd9, 0xd9}, {"grey86", 0xdb, 0xdb, 0xdb}, {"grey87", 0xde, 0xde, 0xde}, {"grey88", 0xe0, 0xe0, 0xe0}, {"grey89", 0xe3, 0xe3, 0xe3}, {"grey90", 0xe5, 0xe5, 0xe5}, {"grey91", 0xe8, 0xe8, 0xe8}, {"grey92", 0xeb, 0xeb, 0xeb}, {"grey93", 0xed, 0xed, 0xed}, {"grey94", 0xf0, 0xf0, 0xf0}, {"grey95", 0xf2, 0xf2, 0xf2}, {"grey96", 0xf5, 0xf5, 0xf5}, {"grey97", 0xf7, 0xf7, 0xf7}, {"grey98", 0xfa, 0xfa, 0xfa}, {"grey99", 0xfc, 0xfc, 0xfc}, {"grey100", 0xff, 0xff, 0xff}, {"honeydew", 0xf0, 0xff, 0xf0}, {"honeydew1", 0xf0, 0xff, 0xf0}, {"honeydew2", 0xe0, 0xee, 0xe0}, {"honeydew3", 0xc1, 0xcd, 0xc1}, {"honeydew4", 0x83, 0x8b, 0x83}, {"hotpink", 0xff, 0x69, 0xb4}, {"hotpink1", 0xff, 0x6e, 0xb4}, {"hotpink2", 0xee, 0x6a, 0xa7}, {"hotpink3", 0xcd, 0x60, 0x90}, {"hotpink4", 0x8b, 0x3a, 0x62}, {"indianred", 0xcd, 0x5c, 0x5c}, {"indianred1", 0xff, 0x6a, 0x6a}, {"indianred2", 0xee, 0x63, 0x63}, {"indianred3", 0xcd, 0x55, 0x55}, {"indianred4", 0x8b, 0x3a, 0x3a}, {"ivory", 0xff, 0xff, 0xf0}, {"ivory1", 0xff, 0xff, 0xf0}, {"ivory2", 0xee, 0xee, 0xe0}, {"ivory3", 0xcd, 0xcd, 0xc1}, {"ivory4", 0x8b, 0x8b, 0x83}, {"khaki", 0xf0, 0xe6, 0x8c}, {"khaki1", 0xff, 0xf6, 0x8f}, {"khaki2", 0xee, 0xe6, 0x85}, {"khaki3", 0xcd, 0xc6, 0x73}, {"khaki4", 0x8b, 0x86, 0x4e}, {"lavender", 0xe6, 0xe6, 0xfa}, {"lavenderblush", 0xff, 0xf0, 0xf5}, {"lavenderblush1", 0xff, 0xf0, 0xf5}, {"lavenderblush2", 0xee, 0xe0, 0xe5}, {"lavenderblush3", 0xcd, 0xc1, 0xc5}, {"lavenderblush4", 0x8b, 0x83, 0x86}, {"lawngreen", 0x7c, 0xfc, 0x00}, {"lemonchiffon", 0xff, 0xfa, 0xcd}, {"lemonchiffon1", 0xff, 0xfa, 0xcd}, {"lemonchiffon2", 0xee, 0xe9, 0xbf}, {"lemonchiffon3", 0xcd, 0xc9, 0xa5}, {"lemonchiffon4", 0x8b, 0x89, 0x70}, {"lightblue", 0xad, 0xd8, 0xe6}, {"lightblue1", 0xbf, 0xef, 0xff}, {"lightblue2", 0xb2, 0xdf, 0xee}, {"lightblue3", 0x9a, 0xc0, 0xcd}, {"lightblue4", 0x68, 0x83, 0x8b}, {"lightcoral", 0xf0, 0x80, 0x80}, {"lightcyan", 0xe0, 0xff, 0xff}, {"lightcyan1", 0xe0, 0xff, 0xff}, {"lightcyan2", 0xd1, 0xee, 0xee}, {"lightcyan3", 0xb4, 0xcd, 0xcd}, {"lightcyan4", 0x7a, 0x8b, 0x8b}, {"lightgoldenrod", 0xee, 0xdd, 0x82}, {"lightgoldenrod1", 0xff, 0xec, 0x8b}, {"lightgoldenrod2", 0xee, 0xdc, 0x82}, {"lightgoldenrod3", 0xcd, 0xbe, 0x70}, {"lightgoldenrod4", 0x8b, 0x81, 0x4c}, {"lightgoldenrodyellow",0xfa, 0xfa, 0xd2}, {"lightgray", 0xd3, 0xd3, 0xd3}, {"lightgreen", 0x90, 0xee, 0x90}, {"lightgrey", 0xd3, 0xd3, 0xd3}, {"lightpink", 0xff, 0xb6, 0xc1}, {"lightpink1", 0xff, 0xae, 0xb9}, {"lightpink2", 0xee, 0xa2, 0xad}, {"lightpink3", 0xcd, 0x8c, 0x95}, {"lightpink4", 0x8b, 0x5f, 0x65}, {"lightsalmon", 0xff, 0xa0, 0x7a}, {"lightsalmon1", 0xff, 0xa0, 0x7a}, {"lightsalmon2", 0xee, 0x95, 0x72}, {"lightsalmon3", 0xcd, 0x81, 0x62}, {"lightsalmon4", 0x8b, 0x57, 0x42}, {"lightseagreen", 0x20, 0xb2, 0xaa}, {"lightskyblue", 0x87, 0xce, 0xfa}, {"lightskyblue1", 0xb0, 0xe2, 0xff}, {"lightskyblue2", 0xa4, 0xd3, 0xee}, {"lightskyblue3", 0x8d, 0xb6, 0xcd}, {"lightskyblue4", 0x60, 0x7b, 0x8b}, {"lightslateblue", 0x84, 0x70, 0xff}, {"lightslategray", 0x77, 0x88, 0x99}, {"lightslategrey", 0x77, 0x88, 0x99}, {"lightsteelblue", 0xb0, 0xc4, 0xde}, {"lightsteelblue1", 0xca, 0xe1, 0xff}, {"lightsteelblue2", 0xbc, 0xd2, 0xee}, {"lightsteelblue3", 0xa2, 0xb5, 0xcd}, {"lightsteelblue4", 0x6e, 0x7b, 0x8b}, {"lightyellow", 0xff, 0xff, 0xe0}, {"lightyellow1", 0xff, 0xff, 0xe0}, {"lightyellow2", 0xee, 0xee, 0xd1}, {"lightyellow3", 0xcd, 0xcd, 0xb4}, {"lightyellow4", 0x8b, 0x8b, 0x7a}, {"limegreen", 0x32, 0xcd, 0x32}, {"linen", 0xfa, 0xf0, 0xe6}, {"magenta", 0xff, 0x00, 0xff}, {"magenta1", 0xff, 0x00, 0xff}, {"magenta2", 0xee, 0x00, 0xee}, {"magenta3", 0xcd, 0x00, 0xcd}, {"magenta4", 0x8b, 0x00, 0x8b}, {"maroon", 0xb0, 0x30, 0x60}, {"maroon1", 0xff, 0x34, 0xb3}, {"maroon2", 0xee, 0x30, 0xa7}, {"maroon3", 0xcd, 0x29, 0x90}, {"maroon4", 0x8b, 0x1c, 0x62}, {"mediumaquamarine", 0x66, 0xcd, 0xaa}, {"mediumblue", 0x00, 0x00, 0xcd}, {"mediumorchid", 0xba, 0x55, 0xd3}, {"mediumorchid1", 0xe0, 0x66, 0xff}, {"mediumorchid2", 0xd1, 0x5f, 0xee}, {"mediumorchid3", 0xb4, 0x52, 0xcd}, {"mediumorchid4", 0x7a, 0x37, 0x8b}, {"mediumpurple", 0x93, 0x70, 0xdb}, {"mediumpurple1", 0xab, 0x82, 0xff}, {"mediumpurple2", 0x9f, 0x79, 0xee}, {"mediumpurple3", 0x89, 0x68, 0xcd}, {"mediumpurple4", 0x5d, 0x47, 0x8b}, {"mediumseagreen", 0x3c, 0xb3, 0x71}, {"mediumslateblue", 0x7b, 0x68, 0xee}, {"mediumspringgreen", 0x00, 0xfa, 0x9a}, {"mediumturquoise", 0x48, 0xd1, 0xcc}, {"mediumvioletred", 0xc7, 0x15, 0x85}, {"midnightblue", 0x19, 0x19, 0x70}, {"mintcream", 0xf5, 0xff, 0xfa}, {"mistyrose", 0xff, 0xe4, 0xe1}, {"mistyrose1", 0xff, 0xe4, 0xe1}, {"mistyrose2", 0xee, 0xd5, 0xd2}, {"mistyrose3", 0xcd, 0xb7, 0xb5}, {"mistyrose4", 0x8b, 0x7d, 0x7b}, {"moccasin", 0xff, 0xe4, 0xb5}, {"navajowhite", 0xff, 0xde, 0xad}, {"navajowhite1", 0xff, 0xde, 0xad}, {"navajowhite2", 0xee, 0xcf, 0xa1}, {"navajowhite3", 0xcd, 0xb3, 0x8b}, {"navajowhite4", 0x8b, 0x79, 0x5e}, {"navy", 0x00, 0x00, 0x80}, {"navyblue", 0x00, 0x00, 0x80}, {"oldlace", 0xfd, 0xf5, 0xe6}, {"olivedrab", 0x6b, 0x8e, 0x23}, {"olivedrab1", 0xc0, 0xff, 0x3e}, {"olivedrab2", 0xb3, 0xee, 0x3a}, {"olivedrab3", 0x9a, 0xcd, 0x32}, {"olivedrab4", 0x69, 0x8b, 0x22}, {"orange", 0xff, 0xa5, 0x00}, {"orange1", 0xff, 0xa5, 0x00}, {"orange2", 0xee, 0x9a, 0x00}, {"orange3", 0xcd, 0x85, 0x00}, {"orange4", 0x8b, 0x5a, 0x00}, {"orangered", 0xff, 0x45, 0x00}, {"orangered1", 0xff, 0x45, 0x00}, {"orangered2", 0xee, 0x40, 0x00}, {"orangered3", 0xcd, 0x37, 0x00}, {"orangered4", 0x8b, 0x25, 0x00}, {"orchid", 0xda, 0x70, 0xd6}, {"orchid1", 0xff, 0x83, 0xfa}, {"orchid2", 0xee, 0x7a, 0xe9}, {"orchid3", 0xcd, 0x69, 0xc9}, {"orchid4", 0x8b, 0x47, 0x89}, {"palegoldenrod", 0xee, 0xe8, 0xaa}, {"palegreen", 0x98, 0xfb, 0x98}, {"palegreen1", 0x9a, 0xff, 0x9a}, {"palegreen2", 0x90, 0xee, 0x90}, {"palegreen3", 0x7c, 0xcd, 0x7c}, {"palegreen4", 0x54, 0x8b, 0x54}, {"paleturquoise", 0xaf, 0xee, 0xee}, {"paleturquoise1", 0xbb, 0xff, 0xff}, {"paleturquoise2", 0xae, 0xee, 0xee}, {"paleturquoise3", 0x96, 0xcd, 0xcd}, {"paleturquoise4", 0x66, 0x8b, 0x8b}, {"palevioletred", 0xdb, 0x70, 0x93}, {"palevioletred1", 0xff, 0x82, 0xab}, {"palevioletred2", 0xee, 0x79, 0x9f}, {"palevioletred3", 0xcd, 0x68, 0x89}, {"palevioletred4", 0x8b, 0x47, 0x5d}, {"papayawhip", 0xff, 0xef, 0xd5}, {"peachpuff", 0xff, 0xda, 0xb9}, {"peachpuff1", 0xff, 0xda, 0xb9}, {"peachpuff2", 0xee, 0xcb, 0xad}, {"peachpuff3", 0xcd, 0xaf, 0x95}, {"peachpuff4", 0x8b, 0x77, 0x65}, {"peru", 0xcd, 0x85, 0x3f}, {"pink", 0xff, 0xc0, 0xcb}, {"pink1", 0xff, 0xb5, 0xc5}, {"pink2", 0xee, 0xa9, 0xb8}, {"pink3", 0xcd, 0x91, 0x9e}, {"pink4", 0x8b, 0x63, 0x6c}, {"plum", 0xdd, 0xa0, 0xdd}, {"plum1", 0xff, 0xbb, 0xff}, {"plum2", 0xee, 0xae, 0xee}, {"plum3", 0xcd, 0x96, 0xcd}, {"plum4", 0x8b, 0x66, 0x8b}, {"powderblue", 0xb0, 0xe0, 0xe6}, {"purple", 0xa0, 0x20, 0xf0}, {"purple1", 0x9b, 0x30, 0xff}, {"purple2", 0x91, 0x2c, 0xee}, {"purple3", 0x7d, 0x26, 0xcd}, {"purple4", 0x55, 0x1a, 0x8b}, {"red", 0xff, 0x00, 0x00}, {"red1", 0xff, 0x00, 0x00}, {"red2", 0xee, 0x00, 0x00}, {"red3", 0xcd, 0x00, 0x00}, {"red4", 0x8b, 0x00, 0x00}, {"rosybrown", 0xbc, 0x8f, 0x8f}, {"rosybrown1", 0xff, 0xc1, 0xc1}, {"rosybrown2", 0xee, 0xb4, 0xb4}, {"rosybrown3", 0xcd, 0x9b, 0x9b}, {"rosybrown4", 0x8b, 0x69, 0x69}, {"royalblue", 0x41, 0x69, 0xe1}, {"royalblue1", 0x48, 0x76, 0xff}, {"royalblue2", 0x43, 0x6e, 0xee}, {"royalblue3", 0x3a, 0x5f, 0xcd}, {"royalblue4", 0x27, 0x40, 0x8b}, {"saddlebrown", 0x8b, 0x45, 0x13}, {"salmon", 0xfa, 0x80, 0x72}, {"salmon1", 0xff, 0x8c, 0x69}, {"salmon2", 0xee, 0x82, 0x62}, {"salmon3", 0xcd, 0x70, 0x54}, {"salmon4", 0x8b, 0x4c, 0x39}, {"sandybrown", 0xf4, 0xa4, 0x60}, {"seagreen", 0x2e, 0x8b, 0x57}, {"seagreen1", 0x54, 0xff, 0x9f}, {"seagreen2", 0x4e, 0xee, 0x94}, {"seagreen3", 0x43, 0xcd, 0x80}, {"seagreen4", 0x2e, 0x8b, 0x57}, {"seashell", 0xff, 0xf5, 0xee}, {"seashell1", 0xff, 0xf5, 0xee}, {"seashell2", 0xee, 0xe5, 0xde}, {"seashell3", 0xcd, 0xc5, 0xbf}, {"seashell4", 0x8b, 0x86, 0x82}, {"sienna", 0xa0, 0x52, 0x2d}, {"sienna1", 0xff, 0x82, 0x47}, {"sienna2", 0xee, 0x79, 0x42}, {"sienna3", 0xcd, 0x68, 0x39}, {"sienna4", 0x8b, 0x47, 0x26}, {"skyblue", 0x87, 0xce, 0xeb}, {"skyblue1", 0x87, 0xce, 0xff}, {"skyblue2", 0x7e, 0xc0, 0xee}, {"skyblue3", 0x6c, 0xa6, 0xcd}, {"skyblue4", 0x4a, 0x70, 0x8b}, {"slateblue", 0x6a, 0x5a, 0xcd}, {"slateblue1", 0x83, 0x6f, 0xff}, {"slateblue2", 0x7a, 0x67, 0xee}, {"slateblue3", 0x69, 0x59, 0xcd}, {"slateblue4", 0x47, 0x3c, 0x8b}, {"slategray", 0x70, 0x80, 0x90}, {"slategray1", 0xc6, 0xe2, 0xff}, {"slategray2", 0xb9, 0xd3, 0xee}, {"slategray3", 0x9f, 0xb6, 0xcd}, {"slategray4", 0x6c, 0x7b, 0x8b}, {"slategrey", 0x70, 0x80, 0x90}, {"slategrey1", 0xc6, 0xe2, 0xff}, {"slategrey2", 0xb9, 0xd3, 0xee}, {"slategrey3", 0x9f, 0xb6, 0xcd}, {"slategrey4", 0x6c, 0x7b, 0x8b}, {"snow", 0xff, 0xfa, 0xfa}, {"snow1", 0xff, 0xfa, 0xfa}, {"snow2", 0xee, 0xe9, 0xe9}, {"snow3", 0xcd, 0xc9, 0xc9}, {"snow4", 0x8b, 0x89, 0x89}, {"springgreen", 0x00, 0xff, 0x7f}, {"springgreen1", 0x00, 0xff, 0x7f}, {"springgreen2", 0x00, 0xee, 0x76}, {"springgreen3", 0x00, 0xcd, 0x66}, {"springgreen4", 0x00, 0x8b, 0x45}, {"steelblue", 0x46, 0x82, 0xb4}, {"steelblue1", 0x63, 0xb8, 0xff}, {"steelblue2", 0x5c, 0xac, 0xee}, {"steelblue3", 0x4f, 0x94, 0xcd}, {"steelblue4", 0x36, 0x64, 0x8b}, {"tan", 0xd2, 0xb4, 0x8c}, {"tan1", 0xff, 0xa5, 0x4f}, {"tan2", 0xee, 0x9a, 0x49}, {"tan3", 0xcd, 0x85, 0x3f}, {"tan4", 0x8b, 0x5a, 0x2b}, {"thistle", 0xd8, 0xbf, 0xd8}, {"thistle1", 0xff, 0xe1, 0xff}, {"thistle2", 0xee, 0xd2, 0xee}, {"thistle3", 0xcd, 0xb5, 0xcd}, {"thistle4", 0x8b, 0x7b, 0x8b}, {"tomato", 0xff, 0x63, 0x47}, {"tomato1", 0xff, 0x63, 0x47}, {"tomato2", 0xee, 0x5c, 0x42}, {"tomato3", 0xcd, 0x4f, 0x39}, {"tomato4", 0x8b, 0x36, 0x26}, {"turquoise", 0x40, 0xe0, 0xd0}, {"turquoise1", 0x00, 0xf5, 0xff}, {"turquoise2", 0x00, 0xe5, 0xee}, {"turquoise3", 0x00, 0xc5, 0xcd}, {"turquoise4", 0x00, 0x86, 0x8b}, {"violet", 0xee, 0x82, 0xee}, {"violetred", 0xd0, 0x20, 0x90}, {"violetred1", 0xff, 0x3e, 0x96}, {"violetred2", 0xee, 0x3a, 0x8c}, {"violetred3", 0xcd, 0x32, 0x78}, {"violetred4", 0x8b, 0x22, 0x52}, {"wheat", 0xf5, 0xde, 0xb3}, {"wheat1", 0xff, 0xe7, 0xba}, {"wheat2", 0xee, 0xd8, 0xae}, {"wheat3", 0xcd, 0xba, 0x96}, {"wheat4", 0x8b, 0x7e, 0x66}, {"white", 0xff, 0xff, 0xff}, {"whitesmoke", 0xf5, 0xf5, 0xf5}, {"yellow", 0xff, 0xff, 0x00}, {"yellow1", 0xff, 0xff, 0x00}, {"yellow2", 0xee, 0xee, 0x00}, {"yellow3", 0xcd, 0xcd, 0x00}, {"yellow4", 0x8b, 0x8b, 0x00}, {"yellowgreen", 0x9a, 0xcd, 0x32}, {NULL, 0, 0, 0} }; plotutils-2.6/libplot/g_control.h0000644000175000017500000000465711037243262014161 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Control codes (used internally when rendering a label, i.e. a user-specified text string). The header file is #include'd by g_cntrlify.c, and g_alabel_her.c (which renders labels in Hershey fonts), and by the generic renderer g_alabel.c. */ /* the order of these must agree with the order in g_cntrlify.h */ #define C_BEGIN_SUPERSCRIPT 0 #define C_END_SUPERSCRIPT 1 #define C_BEGIN_SUBSCRIPT 2 #define C_END_SUBSCRIPT 3 #define C_PUSH_LOCATION 4 #define C_POP_LOCATION 5 #define C_RIGHT_ONE_EM 6 #define C_RIGHT_HALF_EM 7 #define C_RIGHT_QUARTER_EM 8 #define C_RIGHT_SIXTH_EM 9 #define C_RIGHT_EIGHTH_EM 10 #define C_RIGHT_TWELFTH_EM 11 #define C_LEFT_ONE_EM 12 #define C_LEFT_HALF_EM 13 #define C_LEFT_QUARTER_EM 14 #define C_LEFT_SIXTH_EM 15 #define C_LEFT_EIGHTH_EM 16 #define C_LEFT_TWELFTH_EM 17 #define C_RIGHT_RADICAL_SHIFT 254 /* for \rn in PS and PCL fonts */ #define C_LEFT_RADICAL_SHIFT 255 #define PS_RADICAL_WIDTH 0.515 /* shifts to make radical, radicalex line up */ #define PCL_RADICAL_WIDTH 0.080 #define RADICALEX 96 /* flags in each unsigned short in a `controlified' text string (mutually exclusive) */ #define CONTROL_CODE 0x8000 #define RAW_HERSHEY_GLYPH 0x4000 #define RAW_ORIENTAL_HERSHEY_GLYPH 0x2000 /* masks for extracting, from an unsigned short in a controlified text string, (1) the font, if none of the above flags is set, or (2) the raw glyph number, if either of the latter two flags is set */ #define ONE_BYTE 0xff #define FONT_SHIFT 8 #define FONT_SPEC (ONE_BYTE << FONT_SHIFT) #define GLYPH_SPEC 0x1fff plotutils-2.6/libplot/g_cntrlify.h0000644000175000017500000004001211037243262014314 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file is #include'd by g_cntrlify.c. It is a database rather than a true header file: it includes arrays of escape sequences, ligatures, etc., which govern the interpretation of a user-specified text string, or `label'. This database is used in `controlification': the mapping of a label (a string of unsigned chars) to a string of unsigned shorts, for further processing. This mapping accomplishes two things: first, it maps certain escape sequences, beginning with a backslash, to non-ASCII ISO-Latin-1 characters (e.g., \mu is mapped to `times'), and second, it maps certain escape sequences to internal control codes (e.g. \sp is mapped to `start superscript'). */ /* Escape sequences that are mapped to internal control codes. The order in which these appear must agree with the order of internal control codes (e.g. C_BEGIN_SUBSCRIPT) appearing in g_control.h. */ #define NUM_CONTROLS 18 static const char * const _control_tbl[NUM_CONTROLS] = { /* \sp = start superscript */ "sp", /* \ep = end superscript */ "ep", /* \sb = start subscript */ "sb", /* \eb = end subscript */ "eb", /* \mk = mark location */ "mk", /* \rt = return */ "rt", /* \r1 = shift right by 1 em */ "r1", /* \r2 = shift right by em/2 */ "r2", /* \r4 = shift right by em/4 */ "r4", /* \r6 = shift right by em/6 */ "r6", /* \r8 = shift right by em/8 */ "r8", /* \r^ = shift right by em/12 */ "r^", /* \l1 = shift left by 1 em */ "l1", /* \l2 = shift left by em/2 */ "l2", /* \l4 = shift left by em/4 */ "l4", /* \l6 = shift left by em/6 */ "l6", /* \l8 = shift left by em/8 */ "l8", /* \l^ = shift left by em/12 */ "l^", }; typedef struct { unsigned char byte; const char * string; const char * ps_name; } Escape; /* The basic translation table, applying to all ISO-Latin-1 fonts. */ #define NUM_ISO_ESCAPES 95 static const Escape _iso_escape_tbl[NUM_ISO_ESCAPES] = { /* escape sequences, taken from groff */ {161, "r!", "exclamdown"}, {162, "ct", "cent"}, {163, "Po", "sterling"}, {164, "Cs", "currency"}, {165, "Ye", "yen"}, {166, "bb", "brokenbar"}, {167, "sc", "section"}, {168, "ad", "dieresis"}, {169, "co", "copyright"}, {170, "Of", "ordfeminine"}, {171, "Fo", "guillemotleft"}, {172, "no", "logicalnot"}, {173, "hy", "hyphen"}, {174, "rg", "registered"}, {175, "a-", "macron"}, {176, "de", "degree"}, {177, "+-", "plusminus"}, {178, "S2", "twosuperior"}, {179, "S3", "threesuperior"}, {180, "aa", "acute"}, {181, "*m", "mu"}, {182, "ps", "paragraph"}, {183, "md", "periodcentered"}, {184, "ac", "cedilla"}, {185, "S1", "onesuperior"}, {186, "Om", "ordmasculine"}, {187, "Fc", "guillemotright"}, {188, "14", "onequarter"}, {189, "12", "onehalf"}, {190, "34", "threequarters"}, {191, "r?", "questiondown"}, {192, "`A", "Agrave"}, {193, "'A", "Aacute"}, {194, "^A", "Acircumflex"}, {195, "~A", "Atilde"}, {196, ":A", "Adieresis"}, {197, "oA", "Aring"}, {198, "AE", "AE"}, {199, ",C", "Ccedilla"}, {200, "`E", "Egrave"}, {201, "'E", "Eacute"}, {202, "^E", "Ecircumflex"}, {203, ":E", "Edieresis"}, {204, "`I", "Igrave"}, {205, "'I", "Iacute"}, {206, "^I", "Icircumflex"}, {207, ":I", "Idieresis"}, {208, "-D", "Eth"}, {209, "~N", "Ntilde"}, {210, "`O", "Ograve"}, {211, "'O", "Oacute"}, {212, "^O", "Ocircumflex"}, {213, "~O", "Otilde"}, {214, ":O", "Odieresis"}, {215, "mu", "multiply"}, {216, "/O", "Oslash"}, {217, "`U", "Ugrave"}, {218, "'U", "Uacute"}, {219, "^U", "Ucircumflex"}, {220, ":U", "Udieresis"}, {221, "'Y", "Yacute"}, {222, "TP", "Thorn"}, {223, "ss", "germandbls"}, {224, "`a", "agrave"}, {225, "'a", "aacute"}, {226, "^a", "acircumflex"}, {227, "~a", "atilde"}, {228, ":a", "adieresis"}, {229, "oa", "aring"}, {230, "ae", "ae"}, {231, ",c", "ccedilla"}, {232, "`e", "egrave"}, {233, "'e", "eacute"}, {234, "^e", "ecircumflex"}, {235, ":e", "edieresis"}, {236, "`i", "igrave"}, {237, "'i", "iacute"}, {238, "^i", "icircumflex"}, {239, ":i", "idieresis"}, {240, "Sd", "eth"}, {241, "~n", "ntilde"}, {242, "`o", "ograve"}, {243, "'o", "oacute"}, {244, "^o", "ocircumflex"}, {245, "~o", "otilde"}, {246, ":o", "odieresis"}, {247, "di", "divide"}, {248, "/o", "oslash"}, {249, "`u", "ugrave"}, {250, "'u", "uacute"}, {251, "^u", "ucircumflex"}, {252, ":u", "udieresis"}, {253, "'y", "yacute"}, {254, "Tp", "thorn"}, {255, ":y", "ydieresis"}, }; /* For any standard PS font or Hershey font, the following additional translation table applies. It permits the use of symbols and Greek characters (taken from the Symbol font, for a PS font, or from the HersheySymbol font, for a Hershey font) without explicitly switching fonts. */ #define NUM_SYMBOL_ESCAPES 161 static const Escape _symbol_escape_tbl[NUM_SYMBOL_ESCAPES] = { /* escape sequences, taken from groff, except for (1) several characters for which the escape sequences were invented, because groff has no 2-letter escape sequence for them, and (2) three characters (flagged) that needed to have their escape sequences capitalized due to conflicts */ {042, "fa", "universal"}, {044, "te", "existential"}, {047, "st", "suchthat"}, {052, "**", "asteriskmath"}, {0100, "=~", "congruent"}, {0101, "*A", "Alpha"}, {0102, "*B", "Beta"}, {0103, "*X", "Chi"}, {0104, "*D", "Delta"}, {0105, "*E", "Epsilon"}, {0106, "*F", "Phi"}, {0107, "*G", "Gamma"}, {0110, "*Y", "Eta"}, {0111, "*I", "Iota"}, {0112, "+h", "theta1"}, {0113, "*K", "kappa"}, {0114, "*L", "Lambda"}, {0115, "*M", "Mu"}, {0116, "*N", "Nu"}, {0117, "*O", "Omicron"}, {0120, "*P", "Pi"}, {0121, "*H", "Theta"}, {0122, "*R", "Rho"}, {0123, "*S", "Sigma"}, {0124, "*T", "Tau"}, {0125, "*U", "Upsilon"}, {0126, "ts", "sigma1"}, {0127, "*W", "Omega"}, {0130, "*C", "Xi"}, {0131, "*Q", "Psi"}, {0132, "*Z", "Zeta"}, {0134, "tf", "therefore"}, {0136, "pp", "perpendicular"}, {0137, "ul", "underline"}, /* not the same as underscore */ {0140, "rx", "radicalex"}, {0141, "*a", "alpha"}, {0142, "*b", "beta"}, {0143, "*x", "chi"}, {0144, "*d", "delta"}, {0145, "*e", "epsilon"}, {0146, "*f", "phi"}, {0147, "*g", "gamma"}, {0150, "*y", "eta"}, {0151, "*i", "iota"}, {0152, "+f", "phi1"}, {0153, "*k", "kappa"}, {0154, "*l", "lambda"}, {0155, "*m", "mu"}, {0156, "*n", "nu"}, {0157, "*o", "omicron"}, {0160, "*p", "pi"}, {0161, "*h", "theta"}, {0162, "*r", "rho"}, {0163, "*s", "sigma"}, {0164, "*t", "tau"}, {0165, "*u", "upsilon"}, {0166, "+p", "omega1"}, {0167, "*w", "omega"}, {0170, "*c", "xi"}, {0171, "*q", "psi"}, {0172, "*z", "zeta"}, {0176, "ap", "similar"}, {0241, "+U", "Upsilon1"}, {0242, "fm", "minute"}, {0243, "<=", "lessequal"}, {0244, "f/", "fraction"}, {0245, "if", "infinity"}, {0246, "Fn", "florin"}, {0247, "CL", "club"}, {0250, "DI", "diamond"}, {0251, "HE", "heart"}, {0252, "SP", "spade"}, {0253, "<>", "arrowboth"}, {0254, "<-", "arrowleft"}, {0255, "ua", "arrowup"}, {0256, "->", "arrowright"}, {0257, "da", "arrowdown"}, {0260, "de", "degree"}, {0261, "+-", "plusminus"}, {0262, "sd", "second"}, {0263, ">=", "greaterequal"}, {0264, "mu", "multiply"}, {0265, "pt", "proportional"}, {0266, "pd", "partialdiff"}, {0267, "bu", "bullet"}, {0270, "di", "divide"}, {0271, "!=", "notequal"}, {0272, "==", "equivalence"}, {0273, "~~", "approxequal"}, {0274, "..", "ellipsis"}, {0275, "NO_ABBREV", "arrowvertex"}, {0276, "an", "arrowhorizex"}, {0277, "CR", "carriagereturn"}, {0300, "Ah", "aleph"}, {0301, "Im", "Ifraktur"}, {0302, "Re", "Rfraktur"}, {0303, "wp", "weierstrass"}, {0304, "c*", "circlemultiply"}, {0305, "c+", "circleplus"}, {0306, "es", "emptyset"}, {0307, "ca", "cap"}, {0310, "cu", "cup"}, {0311, "SS", "superset"}, /* groff: sp. Conflicts with \sp. */ {0312, "ip", "reflexsuperset"}, {0313, "n<", "notsubset"}, {0314, "SB", "subset"}, /* groff: sb. Conflicts with \sb. */ {0315, "ib", "reflexsubset"}, {0316, "mo", "element"}, {0317, "nm", "notelement"}, {0320, "/_", "angle"}, {0321, "gr", "nabla"}, {0322, "rg", "registerserif"}, {0323, "co", "copyrightserif"}, {0324, "tm", "trademarkserif"}, {0325, "PR", "product"}, {0326, "sr", "radical"}, {0327, "md", "dotmath"}, {0330, "no", "logicalnot"}, {0331, "AN", "logicaland"}, {0332, "OR", "logicalor"}, {0333, "hA", "arrowdblboth"}, {0334, "lA", "arrowdblleft"}, {0335, "uA", "arrowdblup"}, {0336, "rA", "arrowdblright"}, {0337, "dA", "arrowdbldown"}, {0340, "lz", "lozenge"}, {0341, "la", "angleleft"}, {0342, "RG", "registersans"}, {0343, "CO", "copyrightsans"}, {0344, "TM", "trademarksans"}, {0345, "SU", "summation"}, {0346, "NO_ABBREV", "parenlefttp"}, {0347, "NO_ABBREV", "parenleftex"}, {0350, "NO_ABBREV", "parenleftbt"}, {0351, "lc", "bracketlefttp"}, {0352, "NO_ABBREV", "bracketleftex"}, {0353, "lf", "bracketleftbt"}, {0354, "lt", "bracelefttp"}, {0355, "lk", "braceleftmid"}, {0356, "lb", "braceleftbt"}, {0357, "bv", "braceex"}, /* Euro symbol, added by Adobe 1997(?). ObHistorical note: Back in Apple LaserWriter days, the Apple logo was stored in this slot. */ {0360, "eu", "euro"}, {0361, "ra", "angleright"}, {0362, "is", "integral"}, {0363, "NO_ABBREV", "integraltp"}, {0364, "NO_ABBREV", "integralex"}, {0365, "NO_ABBREV", "integralbt"}, {0366, "NO_ABBREV", "parenrighttp"}, {0367, "NO_ABBREV", "parenrightex"}, {0370, "NO_ABBREV", "parenrightbt"}, {0371, "rc", "bracketrighttp"}, {0372, "NO_ABBREV", "bracketrightex"}, {0373, "rf", "bracketrightbt"}, {0374, "RT", "bracerighttp"}, /* groff: rt. Conflicts with \rt. */ {0375, "rk", "bracerightmid"}, {0376, "rb", "bracerightbt"}, /* traditional UGS aliases (undocumented and redundant; obsolete) */ {0100, "~=", "congruent"}, {0242, "pr", "minute"}, {0245, "in", "infinity"}, {0271, "n=", "notequal"}, {0321, "dl", "nabla"}, }; /* For any Hershey font, the following additional translation table applies. It allows access to special vector characters, from the Hershey repertory and from the SLAC UGS [Unified Graphics System] repertory, which we've placed in the nonprintable 0200..0237 region of each Hershey Symbol font. That region of each Symbol font, like the corresponding region of all other fonts, is normally inaccessible; it is accessible only through the following translations. (The Hershey zodiacal glyphs, which were a last-minute addition, are similarly stored in the other nonprintable range 000..037 of the Symbol fonts.) */ #define NUM_SPECIAL_ESCAPES 40 static const Escape _special_escape_tbl[NUM_SPECIAL_ESCAPES] = { /* zodiacal Hershey glyphs */ {01, "AR", "aries"}, {02, "TA", "taurus"}, {03, "GE", "gemini"}, {04, "CA", "cancer"}, {05, "LE", "leo"}, {06, "VI", "virgo"}, {07, "LI", "libra"}, {010, "SC", "scorpio"}, {011, "SG", "sagittarius"}, {012, "CP", "capricornus"}, {013, "AQ", "aquarius"}, {014, "PI", "pisces"}, /* some special UGS characters */ {0204, "~-", "modifiedcongruent"}, {0205, "hb", "hbar"}, {0206, "IB", "interbang"}, {0207, "Lb", "lambdabar"}, {0210, "UD", "undefined"}, /* astronomical Hershey glyphs */ {0211, "SO", "sun"}, {0212, "ME", "mercury"}, {0213, "VE", "venus"}, {0214, "EA", "earth"}, {0215, "MA", "mars"}, {0216, "JU", "jupiter"}, {0217, "SA", "saturn"}, {0220, "UR", "uranus"}, {0221, "NE", "neptune"}, {0222, "PL", "pluto"}, {0223, "LU", "moon"}, {0224, "CT", "comet"}, {0225, "ST", "star"}, {0226, "AS", "ascendingnode"}, {0227, "DE", "descendingnode"}, /* final `s', treated specially in g_cntrlify.c */ #define FINAL_LOWERCASE_S 0230 {0230, "s-", "s1"}, /* non-astronomical Hershey glyphs */ {0231, "dg", "dagger"}, {0232, "dd", "daggerdbl"}, {0233, "li", "line integral"}, {0234, "-+", "minusplus"}, {0235, "||", "parallel"}, /* overbar and underbar (which make sense for all fonts, but which are implemented for non-Hershey fonts in a different way) */ {0236, "rn", "overscore"}, #define VECTOR_SYMBOL_FONT_UNDERSCORE 0237 {0237, "ul", "underscore"}, }; /* The character-to-superscript mapping table, applying only to ISO-8859-1 Hershey fonts. Certain printable 8-bit characters are drawn as small raised ASCII characters, possibly underlined. */ typedef struct { unsigned char from, to; bool underscored; } Raiseinfo; #define NUM_RAISED_CHARS 5 static const Raiseinfo _raised_char_tbl[NUM_RAISED_CHARS] = { {170, 97, true}, /* ordfeminine mapped to 'a' */ {178, 50, false}, /* twosuperior mapped to '2' */ {179, 51, false}, /* threesuperior mapped to '3' */ {185, 49, false}, /* onesuperior mapped to '1' */ {186, 111, true}, /* ordmasculine mapped to 'o'*/ }; /* The single-character `deligature' table, applying to all ISO-8859-1 Hershey fonts (since they do not include these ligatures, except for germandbls [eszet] in Gothic-German). */ typedef struct { unsigned char from; const char * to; int except_font; } Deligature; #define NUM_DELIGATURED_CHARS 3 static const Deligature _deligature_char_tbl[NUM_DELIGATURED_CHARS] = { {198, "AE", 999}, {230, "ae", 999}, {223, "ss", PL_HERSHEY_GOTHIC_GERMAN}, /* no deligature of #223 in G.-German */ }; /* Same as preceding, for escape sequences rather than for 8-bit ISO-Latin-1 chars */ typedef struct { const char * from; const char * to; int except_font; } Deligature_escape; #define NUM_DELIGATURED_ESCAPES 3 static const Deligature_escape _deligature_escape_tbl[NUM_DELIGATURED_ESCAPES] = { {"AE", "AE", 999}, {"ae", "ae", 999}, {"ss", "ss", PL_HERSHEY_GOTHIC_GERMAN}, /* no deligature of \ss in Gothic-G.*/ }; /* A table of the ligatures present in the Hershey fonts. Ligaturization is automatic; see g_cntrlify.c. The eszet ligature, found only in HersheyGothic-German, is not listed here because it is not constructed automatically; the user must request it, with either "\ss" or 'ß'. The table has the longer ligatures first because it is scanned from first to last, with strcmp(). The Hershey fonts are indicated by their index in the internal table of fonts, in g_fontdb.c. */ typedef struct { int font; const char * from; unsigned char byte; } Ligature; #define NUM_LIGATURES 22 static const Ligature _ligature_tbl[NUM_LIGATURES] = { {PL_HERSHEY_SERIF, "ffi", 0203}, {PL_HERSHEY_SERIF, "ffl", 0204}, {PL_HERSHEY_SERIF, "ff", 0200}, {PL_HERSHEY_SERIF, "fi", 0201}, {PL_HERSHEY_SERIF, "fl", 0202}, {PL_HERSHEY_SERIF_ITALIC, "ffi", 0203}, {PL_HERSHEY_SERIF_ITALIC, "ffl", 0204}, {PL_HERSHEY_SERIF_ITALIC, "ff", 0200}, {PL_HERSHEY_SERIF_ITALIC, "fi", 0201}, {PL_HERSHEY_SERIF_ITALIC, "fl", 0202}, {PL_HERSHEY_GOTHIC_GERMAN, "ch", 0206}, {PL_HERSHEY_GOTHIC_GERMAN, "tz", 0207}, {PL_HERSHEY_CYRILLIC, "ffi", 0203}, {PL_HERSHEY_CYRILLIC, "ffl", 0204}, {PL_HERSHEY_CYRILLIC, "ff", 0200}, {PL_HERSHEY_CYRILLIC, "fi", 0201}, {PL_HERSHEY_CYRILLIC, "fl", 0202}, {PL_HERSHEY_EUC, "ffi", 0203}, {PL_HERSHEY_EUC, "ffl", 0204}, {PL_HERSHEY_EUC, "ff", 0200}, {PL_HERSHEY_EUC, "fi", 0201}, {PL_HERSHEY_EUC, "fl", 0202}, }; plotutils-2.6/libplot/g_her_metr.h0000644000175000017500000001634411037243262014302 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file gives the metrics for the vector fonts. */ /* Our choice for stroke width, in terms of virtual pixels. This number is magic: just slightly greater than sqrt(2), so that adjacent strokes that are inclined at a 45 degree angle will overlap as they should. (According to ``Calligraphy for Computers'', the Hershey fonts were designed to be drawn by an electron beam the intensity of which fell to 50% at a transverse displacement of one unit.) */ #define HERSHEY_STROKE_WIDTH 1.42 /* This value gives good results for the Japanese characters (Kana and Kanji). */ #define HERSHEY_ORIENTAL_STROKE_WIDTH 1.175 /* According to Allen Hershey, 1 em = 32 virtual pixels for his alphabets of principal size. But taking into account the width of the strokes (nominally 1 virtual pixel), if the characters are thought of as resting on a baseline, the baseline (and the capline, etc.) should be located at half-integer values of the vertical coordinate. That changes things slightly (an em should be 33 virtual pixels, not 32). Incidentally his recommended spacing between lines is 40 pixels (24 for indexical size), i.e., 1.2 em or so (1 em is the minimum possible spacing). */ /* Dimensions for characters in principal [large] size. The `centerline' is located at y=0, in the original coordinate system. The `topline' and `bottomline' are determined by the tallest characters, which are parentheses, brackets, and braces. */ #define HERSHEY_LARGE_BASELINE (-9.5) /* relative to centerline */ #define HERSHEY_LARGE_CAPLINE 12.5 /* relative to centerline */ #define HERSHEY_LARGE_TOPLINE 16.5 /* relative to centerline */ #define HERSHEY_LARGE_BOTTOMLINE -16.5 /* relative to centerline */ #define HERSHEY_LARGE_CAPHEIGHT 22 /* i.e. capline - baseline */ #define HERSHEY_LARGE_ASCENT 26 /* i.e. topline - baseline */ #define HERSHEY_LARGE_DESCENT 7 /* i.e. baseline - bottomline */ #define HERSHEY_LARGE_HEIGHT (HERSHEY_LARGE_ASCENT + HERSHEY_LARGE_DESCENT) #define HERSHEY_LARGE_EM 33 /* Dimensions for characters in indexical [medium] size. The `centerline' is located at y=0, in the original coordinate system. The `topline' and `bottomline' are determined by the tallest characters, which are parentheses, brackets, and braces. */ #define HERSHEY_MEDIUM_BASELINE (-6.5) /* relative to centerline */ #define HERSHEY_MEDIUM_CAPLINE 7.5 /* relative to centerline */ #define HERSHEY_MEDIUM_TOPLINE 10.5 /* relative to centerline */ #define HERSHEY_MEDIUM_BOTTOMLINE -10.5 /* relative to centerline */ #define HERSHEY_MEDIUM_CAPHEIGHT 14 /* i.e. capline - baseline */ #define HERSHEY_MEDIUM_ASCENT 17 /* i.e. topline - baseline */ #define HERSHEY_MEDIUM_DESCENT 4 /* i.e. baseline - bottomline */ #define HERSHEY_MEDIUM_HEIGHT (HERSHEY_MEDIUM_ASCENT + HERSHEY_MEDIUM_DESCENT) #define HERSHEY_MEDIUM_EM 21 /* Dimensions for characters in cartographic [small] size. The `centerline' is located at y=0, in the original coordinate system. The `topline' and `bottomline' are determined by the tallest characters, which are parentheses, brackets, and braces. In the cartographic size there are only parentheses, and unlike the other two sizes they are not symmetric about y=0 (since they will surround only upper-case letters; there are no lower-case letters in cartographic). */ #define HERSHEY_SMALL_BASELINE (-4.5) /* relative to centerline */ #define HERSHEY_SMALL_CAPLINE 5.5 /* relative to centerline */ #define HERSHEY_SMALL_TOPLINE 6.5 /* relative to centerline */ #define HERSHEY_SMALL_BOTTOMLINE -5.5 /* relative to centerline */ #define HERSHEY_SMALL_CAPHEIGHT 10 /* i.e. capline - baseline */ #define HERSHEY_SMALL_ASCENT 11 /* i.e. topline - baseline */ #define HERSHEY_SMALL_DESCENT 1 /* i.e. baseline - bottomline */ #define HERSHEY_SMALL_HEIGHT (HERSHEY_SMALL_ASCENT + HERSHEY_SMALL_DESCENT) #define HERSHEY_SMALL_EM 12 /* Vertical positionings (in alabel_str.c) are now based on the assumption that all characters we are dealing with are of principal [large] size. I see no graceful way to handle positionings relative to the baseline for the other two sizes. Of course, centered positioning will work perfectly, since the Hershey glyphs were designed for that. */ #define HERSHEY_BASELINE HERSHEY_LARGE_BASELINE #define HERSHEY_CAPHEIGHT HERSHEY_LARGE_CAPHEIGHT #define HERSHEY_ASCENT HERSHEY_LARGE_ASCENT #define HERSHEY_DESCENT HERSHEY_LARGE_DESCENT #define HERSHEY_HEIGHT HERSHEY_LARGE_HEIGHT #define HERSHEY_EM HERSHEY_LARGE_EM /* The scaling between distances in Hershey units and distances in user coordinates. Idea is that the font size (i.e. the nominal minimum inter-line spacing) corresponds to HERSHEY_LARGE_EM Hershey units. */ #define HERSHEY_UNITS_TO_USER_UNITS(size) \ ((size)*(_plotter->drawstate->true_font_size)/(HERSHEY_EM)) /************************************************************************/ /* Some miscellaneous information on typesetting mathematics, taken from Allen Hershey's 1969 TR (see g_her_glyph.c): Subscripts and superscripts, in math text, should be in indexical size. The centerline of subscripts/superscripts would be lowered/raised by 10 vertical units. [In principal size the centerline is 9.5 units above the baseline; in indexical size the centerline is 6.5 units above the baseline. So when going to subscripts, the baseline should be lowered by 7 units; when going to superscripts, the baseline should be raised by 13 units. This is not actually the scheme we use; see alabel_str.c. -- rsm] In math text the quantity being supplied with a sub/superscript is typically an italic character. The transitions principal->superscript and subscript->principal are accordingly accompanied by 2 add'l units of horizontal space. In math text, conjuctive/predicative signs should be given a extra spacing of 1/2 en (i.e. 1/4 em), i.e. 8 units in principal size, to either side. This is accomplished by glyph 2198 (or 1198, in indexical size). Case fractions (e.g. \frac34) are formed by raising/lowering indexical-size characters by 12 vertical units; in mathematical text, they should be given a small (4-unit) spacing to either side. Simple limits, for sum and integral signs, are in indexical size, and are raised/lowered by 24 units. */ /************************************************************************/ plotutils-2.6/libplot/g_jis.h0000644000175000017500000010311611037243262013254 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file is #include'd by g_cntrlify.c. It is a database rather than a true header file: it includes information on characters in the JIS X 0208 two-byte encoding (containing Kanji, Kana, Roman letters, Greek letters, Cyrillic letters, etc). */ /* Whether a JIS index (two bytes) defines a JIS character, irrespective of whether we have a glyph for it. (If it isn't a character, it ideally prints as a zero-width glyph; if it's a character but we don't have it, it ideally prints as an empty glyph or an `undefined' glyph.) */ #define GOOD_JIS_INDEX(row, col) \ ((row) > 0x20 && (row) < 0x7f && (col) > 0x20 && (col) < 0x7f) #define BEGINNING_OF_KANJI 0x3000 /* Kanji afterwards, non-Kanji before */ #ifndef RAW_HERSHEY_GLYPH #define RAW_HERSHEY_GLYPH 0x4000 #endif struct kanjipair { int jis, nelson; }; /* The 603 Kanji that we have glyphs for. 1st field is JIS index number; 2nd is Nelson index number, which we use internally (it indexes into the Hershey oriental glyph array in g_her_glyph.c). For info on correspondence, see kanji.doc. */ static const struct kanjipair _builtin_kanji_glyphs[] = { /* 596 Level 1 Kanji */ /* row 16 */ {0x3021, 43}, {0x3026, 2829}, {0x302d, 62}, {0x3035, 818}, {0x303f, 1802}, {0x3045, 2154}, {0x304c, 401}, {0x3057, 2107}, {0x3059, 138}, {0x305b, 3008}, {0x305e, 3579}, {0x3061, 4214}, {0x306c, 1}, {0x3070, 3294}, {0x3078, 1026}, {0x307a, 1562}, /* row 17 */ {0x3122, 5006}, {0x3126, 878}, {0x3127, 1280}, {0x3129, 3673}, {0x312b, 5042}, {0x3132, 2629}, {0x313b, 2973}, {0x313f, 4725}, {0x3140, 5046}, {0x314a, 130}, {0x3155, 2599}, {0x315f, 617}, {0x3173, 4733}, {0x3176, 1125}, {0x3177, 2083}, {0x317e, 1504}, /* row 18 */ {0x3221, 1885}, {0x3223, 2361}, {0x3226, 2922}, {0x322b, 5399}, {0x322f, 551}, {0x3235, 260}, {0x3239, 2634}, {0x323b, 5110}, {0x323c, 9}, {0x323d, 350}, {0x323f, 409}, {0x3241, 422}, {0x3243, 716}, {0x3244, 24}, {0x3246, 58}, {0x3248, 1311}, {0x324a, 3272}, {0x324c, 107}, {0x324f, 2530}, {0x3250, 2743}, {0x3256, 3909}, {0x3259, 3956}, {0x3261, 4723}, {0x3267, 2848}, {0x3268, 50}, {0x3272, 4306}, {0x3273, 1028}, /* row 19 */ {0x3323, 2264}, {0x3324, 2553}, {0x3326, 2998}, {0x3328, 3537}, {0x332b, 4950}, {0x332d, 4486}, {0x3330, 1168}, {0x3346, 1163}, {0x334b, 2254}, {0x3351, 4301}, {0x3353, 4623}, {0x3357, 5088}, {0x3358, 1271}, {0x335a, 2324}, {0x3364, 703}, /* row 20 */ {0x3424, 2977}, {0x3428, 1322}, {0x342c, 1466}, {0x3433, 1492}, {0x3434, 790}, {0x3436, 1731}, {0x3437, 1756}, {0x3445, 2988}, {0x3449, 3416}, {0x3454, 4750}, {0x3456, 4949}, {0x3458, 4958}, {0x346f, 994}, {0x3470, 1098}, {0x3476, 1496}, {0x347c, 3785}, /* row 21 */ {0x3521, 2379}, {0x3522, 1582}, {0x3524, 2480}, {0x3525, 2507}, {0x352d, 4318}, {0x3530, 4610}, {0x3534, 5276}, {0x3535, 5445}, {0x3546, 3981}, {0x3555, 4685}, {0x355a, 154}, {0x355b, 885}, {0x355d, 1560}, {0x3565, 2941}, {0x3566, 3314}, {0x3569, 3496}, {0x356d, 2852}, {0x356e, 1051}, {0x356f, 1387}, {0x3575, 4109}, {0x3577, 4548}, {0x357b, 5281}, {0x357e, 295}, /* row 22 */ {0x3621, 431}, {0x3626, 581}, {0x362d, 1135}, {0x362f, 1571}, {0x3635, 2052}, {0x3636, 2378}, {0x364a, 103}, {0x364b, 2305}, {0x364c, 2923}, {0x3651, 1065}, {0x3661, 4671}, {0x3662, 4815}, {0x3664, 4855}, {0x3665, 146}, {0x3671, 3128}, {0x3675, 3317}, {0x367e, 1386}, /* row 23 */ {0x3738, 449}, {0x3739, 534}, {0x373e, 2937}, {0x373f, 1077}, {0x3741, 1589}, {0x3742, 1602}, {0x374f, 195}, {0x3750, 3523}, {0x3757, 4312}, {0x375a, 4620}, {0x3767, 2412}, {0x3768, 2509}, {0x376a, 3313}, {0x376b, 3540}, {0x376c, 4205}, {0x376e, 2169}, {0x3777, 1045}, /* row 24 */ {0x3824, 2868}, {0x3826, 3180}, {0x3828, 3543}, {0x382b, 4284}, {0x3833, 5220}, {0x3835, 275}, {0x3836, 825}, {0x3839, 1568}, {0x383a, 2637}, {0x383b, 2656}, {0x383d, 2943}, {0x3840, 4309}, {0x3842, 4987}, {0x3845, 770}, {0x3847, 1036}, {0x384c, 1567}, {0x384d, 1817}, {0x384e, 2044}, {0x385d, 5415}, {0x385e, 15}, {0x3861, 162}, {0x3865, 1610}, {0x3866, 1628}, {0x386c, 4374}, {0x3872, 290}, {0x3877, 1358}, {0x3878, 579}, {0x387d, 868}, {0x387e, 101}, /* row 25 */ {0x3929, 1451}, {0x3931, 1683}, {0x393d, 2343}, {0x3943, 92}, {0x394d, 3684}, {0x3954, 4213}, {0x3955, 1641}, {0x395b, 4843}, {0x395d, 4883}, {0x395f, 4994}, {0x3960, 1459}, {0x3961, 5188}, {0x3962, 5248}, {0x3966, 882}, {0x3967, 383}, {0x3971, 1037}, {0x3975, 5403}, {0x397c, 5236}, {0x397e, 4660}, /* row 26 */ {0x3a21, 2430}, {0x3a23, 352}, {0x3a2c, 2261}, {0x3a38, 1455}, {0x3a39, 3662}, {0x3a42, 1515}, {0x3a46, 35}, {0x3a47, 2146}, {0x3a59, 3522}, {0x3a5f, 1055}, {0x3a6e, 407}, {0x3a72, 2119}, {0x3a79, 2256}, /* row 27 */ {0x3b2e, 3113}, {0x3b30, 8}, {0x3b33, 1407}, {0x3b36, 2056}, {0x3b3b, 3415}, {0x3b40, 4789}, {0x3b45, 362}, {0x3b4d, 1025}, {0x3b4e, 1160}, {0x3b4f, 1208}, {0x3b52, 1264}, {0x3b54, 284}, {0x3b57, 3001}, {0x3b58, 1904}, {0x3b59, 2039}, {0x3b5e, 2211}, {0x3b5f, 2429}, {0x3b60, 2439}, {0x3b61, 2478}, {0x3b64, 3265}, {0x3b65, 3492}, {0x3b66, 3510}, {0x3b6a, 3845}, {0x3b73, 2435}, {0x3b75, 5428}, {0x3b76, 272}, {0x3b7a, 1281}, {0x3b7d, 1903}, {0x3b7e, 2126}, /* row 28 */ {0x3c21, 638}, {0x3c27, 3209}, {0x3c28, 3228}, {0x3c2a, 3697}, {0x3c2b, 3841}, {0x3c2d, 3860}, {0x3c2f, 5375}, {0x3c30, 1556}, {0x3c34, 4619}, {0x3c37, 261}, {0x3c3c, 1300}, {0x3c3e, 2631}, {0x3c41, 4518}, {0x3c42, 1297}, {0x3c4d, 4603}, {0x3c50, 2074}, {0x3c54, 3685}, {0x3c56, 4608}, {0x3c5c, 1377}, {0x3c61, 4809}, {0x3c63, 3926}, {0x3c67, 285}, {0x3c68, 3699}, {0x3c6a, 1827}, {0x3c6f, 3295}, {0x3c72, 2573}, {0x3c73, 5186}, {0x3c7e, 622}, /* row 29 */ {0x3d29, 3273}, {0x3d2a, 3521}, {0x3d2e, 3863}, {0x3d39, 4798}, {0x3d3d, 768}, {0x3d3e, 1613}, {0x3d44, 3597}, {0x3d45, 224}, {0x3d50, 97}, {0x3d51, 1621}, {0x3d55, 2122}, {0x3d60, 791}, {0x3d63, 3509}, {0x3d68, 1162}, {0x3d6b, 2138}, {0x3d71, 3719}, {0x3d77, 1185}, {0x3d7c, 4993}, /* row 30 */ {0x3e26, 321}, {0x3e2e, 1355}, {0x3e2f, 166}, {0x3e3d, 2137}, {0x3e3e, 2212}, {0x3e46, 2772}, {0x3e4b, 3192}, {0x3e4e, 3280}, {0x3e57, 1638}, {0x3e5a, 4341}, {0x3e5d, 4472}, {0x3e65, 798}, {0x3e68, 223}, {0x3e6c, 1113}, {0x3e6f, 1364}, {0x3e75, 2839}, {0x3e78, 4002}, /* row 31 */ {0x3f22, 2303}, {0x3f27, 3889}, {0x3f29, 5154}, {0x3f2d, 403}, {0x3f34, 1645}, {0x3f36, 1920}, {0x3f37, 2080}, {0x3f39, 2301}, {0x3f3f, 783}, {0x3f43, 3837}, {0x3f48, 4601}, {0x3f49, 4646}, {0x3f4a, 4709}, {0x3f4c, 5055}, {0x3f4d, 339}, {0x3f5e, 1034}, {0x3f62, 211}, {0x3f65, 2482}, {0x3f69, 3676}, {0x3f74, 2057}, /* row 32 */ {0x402d, 1666}, {0x402e, 1799}, {0x4030, 2436}, {0x4031, 2121}, {0x4032, 2143}, {0x4035, 27}, {0x4038, 2991}, {0x403e, 4273}, {0x4044, 5076}, {0x4045, 5077}, {0x404e, 2108}, {0x404f, 2194}, {0x4050, 3176}, {0x4051, 3306}, {0x4056, 4534}, {0x405a, 667}, {0x405c, 1951}, {0x405e, 1855}, {0x4063, 5044}, {0x4064, 3539}, {0x4065, 3855}, {0x4068, 571}, {0x4069, 156}, {0x406e, 1447}, {0x4070, 1823}, {0x407e, 3580}, /* row 33 */ {0x4125, 3873}, {0x4130, 595}, {0x4133, 2770}, {0x4134, 384}, {0x4147, 3511}, {0x4148, 3520}, {0x4150, 859}, {0x4158, 1402}, {0x415b, 1728}, {0x4161, 2100}, {0x416a, 2241}, {0x416d, 3567}, {0x4170, 3939}, {0x4175, 4234}, {0x4176, 4539}, {0x417c, 540}, {0x417d, 1137}, /* row 34 */ {0x4224, 4701}, {0x4226, 509}, {0x422b, 196}, {0x422c, 2632}, {0x422d, 4546}, {0x422e, 4700}, {0x4233, 3544}, {0x4236, 590}, {0x4238, 1267}, {0x423e, 361}, {0x423f, 1169}, {0x4240, 1172}, {0x424a, 2313}, {0x424e, 405}, {0x4250, 2067}, {0x4256, 1743}, {0x4265, 364}, {0x4267, 1171}, {0x4268, 3385}, {0x426a, 2164}, {0x426c, 2655}, {0x4274, 2503}, /* row 35 */ {0x4323, 4721}, {0x432b, 4458}, {0x432f, 4384}, {0x4331, 139}, {0x433a, 1418}, {0x433b, 3172}, {0x4346, 1575}, {0x434b, 2996}, {0x434d, 488}, {0x434e, 3169}, {0x434f, 1056}, {0x4356, 3644}, {0x4359, 4722}, {0x435d, 3366}, {0x4362, 3325}, {0x4363, 3940}, {0x4365, 3665}, {0x4366, 81}, {0x4368, 1291}, {0x436b, 53}, {0x436c, 2236}, {0x436e, 4115}, /* row 36 */ {0x442b, 3788}, {0x442c, 2702}, {0x4436, 4543}, {0x4439, 4938}, {0x443b, 5340}, {0x443e, 775}, {0x444c, 4703}, {0x4463, 406}, {0x446a, 1296}, {0x446c, 1508}, {0x446d, 1514}, {0x4472, 1914}, {0x4478, 3285}, {0x4479, 3581}, /* row 37 */ {0x4526, 1987}, {0x452a, 3097}, {0x452f, 931}, {0x4534, 4844}, {0x4535, 588}, {0x4537, 16}, {0x453e, 4615}, {0x4540, 804}, {0x4544, 2994}, {0x4545, 5050}, {0x454c, 1614}, {0x4559, 1511}, {0x455a, 1050}, {0x455f, 1161}, {0x4561, 665}, {0x4563, 1109}, {0x4567, 230}, {0x456c, 213}, {0x4574, 2745}, {0x4576, 1359}, {0x4579, 3396}, /* row 38 */ {0x4626, 4465}, {0x4630, 730}, {0x4631, 619}, {0x4633, 1354}, {0x463b, 4724}, {0x463c, 4853}, {0x4643, 2860}, {0x4649, 4375}, {0x465e, 2160}, {0x4662, 82}, {0x466e, 778}, {0x4671, 5038}, {0x4673, 273}, {0x4679, 3724}, {0x467c, 2097}, {0x467e, 574}, /* row 39 */ {0x4721, 1189}, {0x472e, 2797}, {0x472f, 188}, {0x4733, 2808}, {0x4734, 3472}, {0x4748, 2529}, {0x474f, 5191}, {0x4769, 3275}, {0x4772, 3095}, {0x477e, 5385}, /* row 40 */ {0x4821, 49}, {0x482c, 577}, {0x482f, 3092}, {0x483e, 132}, {0x483f, 817}, {0x4841, 1469}, {0x484c, 3865}, {0x4856, 4811}, {0x4860, 1604}, {0x4866, 2470}, {0x4869, 3109}, {0x4873, 5080}, {0x4874, 5152}, {0x4878, 1383}, {0x4879, 1631}, {0x487e, 3658}, /* row 41 */ {0x4921, 5421}, {0x492e, 3397}, {0x4934, 33}, {0x4938, 2359}, {0x4939, 131}, {0x493d, 108}, {0x4942, 3042}, {0x4943, 3271}, {0x494a, 923}, {0x4954, 17}, {0x495b, 1468}, {0x4963, 2832}, {0x4969, 4488}, {0x4977, 5148}, {0x497d, 1484}, /* row 42 */ {0x4a23, 4255}, {0x4a26, 173}, {0x4a2a, 2857}, {0x4a2c, 578}, {0x4a38, 2064}, {0x4a39, 4959}, {0x4a3f, 26}, {0x4a42, 589}, {0x4a44, 4945}, {0x4a46, 3461}, {0x4a50, 511}, {0x4a51, 306}, {0x4a52, 2842}, {0x4a55, 4661}, {0x4a6c, 2466}, {0x4a7c, 2084}, {0x4a7d, 2082}, /* row 43 */ {0x4b21, 2535}, {0x4b26, 3749}, {0x4b4c, 751}, {0x4b4f, 5404}, {0x4b5c, 96}, {0x4b63, 5390}, {0x4b68, 2467}, {0x4b74, 855}, {0x4b7c, 7}, /* row 44 */ {0x4c23, 913}, {0x4c24, 179}, {0x4c29, 1316}, {0x4c35, 2773}, {0x4c37, 3164}, {0x4c3e, 1170}, {0x4c40, 2110}, {0x4c4c, 5087}, {0x4c53, 2473}, {0x4c5a, 2170}, {0x4c5c, 3127}, {0x4c64, 4944}, {0x4c67, 4940}, {0x4c6b, 298}, {0x4c70, 3168}, {0x4c72, 1598}, {0x4c74, 4074}, {0x4c78, 2233}, {0x4c7d, 2534}, /* row 45 */ {0x4d2d, 3727}, {0x4d30, 2565}, {0x4d3a, 5030}, {0x4d3c, 1167}, {0x4d3e, 408}, {0x4d4f, 2659}, {0x4d51, 2993}, {0x4d53, 3656}, {0x4d55, 4001}, {0x4d57, 4274}, {0x4d5b, 5012}, {0x4d63, 3680}, {0x4d68, 202}, {0x4d6b, 5049}, {0x4d70, 3856}, {0x4d71, 199}, {0x4d72, 1431}, {0x4d78, 3264}, {0x4d7d, 2942}, /* row 46 */ {0x4e24, 4813}, {0x4e25, 5040}, {0x4e26, 5005}, {0x4e28, 319}, {0x4e29, 3343}, {0x4e2e, 2576}, {0x4e32, 3191}, {0x4e33, 3471}, {0x4e35, 5440}, {0x4e3e, 34}, {0x4e41, 3468}, {0x4e49, 3885}, {0x4e4c, 2141}, {0x4e4f, 715}, {0x4e53, 2210}, {0x4e55, 2807}, {0x4e58, 4630}, {0x4e60, 5138}, {0x4e63, 428}, {0x4e64, 642}, {0x4e6d, 5048}, {0x4e6e, 5056}, {0x4e73, 2438}, /* row 47 */ {0x4f22, 4702}, {0x4f27, 2750}, {0x4f29, 4561}, {0x4f37, 3683}, {0x4f3b, 283}, {0x4f40, 4391}, {0x4f42, 3268}, {0x4f43, 4358}, {0x4f44, 54}, {0x4f47, 1710}, /* 7 additional Level 2 Kanji */ {0x534c, 973}, /* row 51 */ {0x5879, 1794}, /* row 56 */ {0x5960, 1942}, /* row 57 */ {0x626f, 3200}, /* row 66 */ {0x6446, 3458}, /* row 68 */ {0x6647, 5083}, /* row 70 */ {0x6d55, 4633}, /* row 77 */ {0, 0} }; /* Non-Kanji characters in the JIS character set. We map nearly all of these into characters (in the 0..255 range) in our existing fonts, which are laid out in g_fontdb.c. If RAW_HERSHEY_GLYPH bit is set, the font is ignored, since the character is to be mapped directly to a Hershey glyph (presumably one that appears in no font). */ struct jis_entry { int jis, font; unsigned short charnum; }; static const struct jis_entry _builtin_jis_chars[] = { /* Row 1 [misc.] */ {0x2121, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4399}, /* full-width space */ {0x2122, PL_HERSHEY_HIRAGANA, 0x79}, {0x2123, PL_HERSHEY_HIRAGANA, 0x7a}, {0x2124, PL_HERSHEY_SERIF, ','}, {0x2125, PL_HERSHEY_SERIF, '.'}, {0x2126, PL_HERSHEY_SERIF, 0xb7}, {0x2127, PL_HERSHEY_SERIF, ':'}, {0x2128, PL_HERSHEY_SERIF, ';'}, {0x2129, PL_HERSHEY_SERIF, '?'}, {0x212a, PL_HERSHEY_SERIF, '!'}, /* 0x212b..0x212c are Japanese diacritics, shifted left */ {0x212d, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4180}, {0x212e, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4181}, {0x212f, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4182}, {0x2130, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4184}, {0x2131, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4008}, {0x2132, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4012}, /* 0x2133..0x213a are Japanese characters */ {0x213b, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 903}, {0x213c, PL_HERSHEY_KATAKANA, 0x78}, {0x213d, PL_HERSHEY_SERIF, '-'}, {0x213e, PL_HERSHEY_SERIF, 0xad}, {0x213f, PL_HERSHEY_SERIF, '/'}, {0x2140, PL_HERSHEY_SERIF, '\\'}, {0x2141, PL_HERSHEY_SERIF, '~'}, {0x2142, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 2230}, {0x2143, PL_HERSHEY_SERIF, '|'}, {0x2144, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 276}, {0x2145, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 238}, {0x2146, PL_HERSHEY_SERIF, '`'}, {0x2147, PL_HERSHEY_SERIF, '\''}, {0x2148, PL_HERSHEY_SERIF, '`'}, /* should be double quotes, fixme */ {0x2149, PL_HERSHEY_SERIF, '\''}, /* same */ {0x214a, PL_HERSHEY_SERIF, '('}, {0x214b, PL_HERSHEY_SERIF, ')'}, {0x214c, PL_HERSHEY_SERIF, '['}, /* should be `bent' brackets, fixme */ {0x214d, PL_HERSHEY_SERIF, ']'}, /* same */ {0x214e, PL_HERSHEY_SERIF, '['}, {0x214f, PL_HERSHEY_SERIF, ']'}, {0x2150, PL_HERSHEY_SERIF, '{'}, {0x2151, PL_HERSHEY_SERIF, '}'}, {0x2152, PL_HERSHEY_SERIF_SYMBOL, 0xe1}, {0x2153, PL_HERSHEY_SERIF_SYMBOL, 0xf1}, /* 0x2154..0x2155 are double angle brackets */ {0x2156, PL_HERSHEY_SERIF_SYMBOL, 0xe9}, {0x2157, PL_HERSHEY_SERIF_SYMBOL, 0xfb}, {0x2158, PL_HERSHEY_SERIF_SYMBOL, 0xe9}, /* should be outlined \lc and \rf, fixme */ {0x2159, PL_HERSHEY_SERIF_SYMBOL, 0xfb}, /* same */ {0x215a, PL_HERSHEY_SERIF_BOLD, '['}, /* shouldn't be ordinary bold brackets, fixme */ {0x215b, PL_HERSHEY_SERIF_BOLD, ']'}, /* same */ {0x215c, PL_HERSHEY_SERIF, '+'}, {0x215d, PL_HERSHEY_SERIF, '-'}, {0x215e, PL_HERSHEY_SERIF_SYMBOL, 0xb1}, {0x215f, PL_HERSHEY_SERIF, 0xd7}, {0x2160, PL_HERSHEY_SERIF, 0xf7}, {0x2161, PL_HERSHEY_SERIF, '='}, {0x2162, PL_HERSHEY_SERIF_SYMBOL, 0xb9}, {0x2163, PL_HERSHEY_SERIF, '<'}, {0x2164, PL_HERSHEY_SERIF, '>'}, {0x2165, PL_HERSHEY_SERIF_SYMBOL, 0xa3}, {0x2166, PL_HERSHEY_SERIF_SYMBOL, 0xb3}, {0x2167, PL_HERSHEY_SERIF_SYMBOL, 0xa5}, {0x2168, PL_HERSHEY_SERIF_SYMBOL, 0x5c}, {0x2169, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 2285}, {0x216a, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 2283}, {0x216b, PL_HERSHEY_SERIF_SYMBOL, 0xb0}, {0x216c, PL_HERSHEY_SERIF_SYMBOL, 0xa2}, {0x216d, PL_HERSHEY_SERIF_SYMBOL, 0xb2}, /* 0x216e is degrees centigrade */ {0x216f, PL_HERSHEY_SERIF, 0xa5}, {0x2170, PL_HERSHEY_SERIF, '$'}, {0x2171, PL_HERSHEY_SERIF, 0xa2}, {0x2172, PL_HERSHEY_SERIF, 0xa3}, {0x2173, PL_HERSHEY_SERIF, '%'}, {0x2174, PL_HERSHEY_SERIF, '#'}, {0x2175, PL_HERSHEY_SERIF, '&'}, {0x2176, PL_HERSHEY_SERIF, '*'}, {0x2177, PL_HERSHEY_SERIF, '@'}, {0x2178, PL_HERSHEY_SERIF, 0xa7}, {0x2179, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 844}, {0x217a, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 856}, {0x217b, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 901}, {0x217c, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 850}, /* should be filled circle */ {0x217d, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4109}, {0x217e, PL_HERSHEY_SERIF_SYMBOL, 0xe0}, /* lozenge rather than square; OK? */ /* Row 2 [misc.] */ /* 0x2220..0x2229 are mostly squares, triangles */ {0x222a, PL_HERSHEY_SERIF_SYMBOL, 0xae}, {0x222b, PL_HERSHEY_SERIF_SYMBOL, 0xac}, {0x222c, PL_HERSHEY_SERIF_SYMBOL, 0xad}, {0x222d, PL_HERSHEY_SERIF_SYMBOL, 0xaf}, {0x222d, PL_HERSHEY_SERIF_BOLD, '='}, /* 0x222e is two bold horizontal strokes, NOT bold = */ {0x223a, PL_HERSHEY_SERIF_SYMBOL, 0xce}, {0x223b, PL_HERSHEY_SERIF_SYMBOL, RAW_HERSHEY_GLYPH + 282}, {0x223c, PL_HERSHEY_SERIF_SYMBOL, 0xcd}, {0x223d, PL_HERSHEY_SERIF_SYMBOL, 0xca}, {0x223e, PL_HERSHEY_SERIF_SYMBOL, 0xcc}, {0x223f, PL_HERSHEY_SERIF_SYMBOL, 0xc9}, {0x2240, PL_HERSHEY_SERIF_SYMBOL, 0xc8}, {0x2241, PL_HERSHEY_SERIF_SYMBOL, 0xc7}, {0x224a, PL_HERSHEY_SERIF_SYMBOL, 0xd9}, {0x224b, PL_HERSHEY_SERIF_SYMBOL, 0xda}, {0x224c, PL_HERSHEY_SERIF, 0xac}, {0x224d, PL_HERSHEY_SERIF_SYMBOL, 0xde}, {0x224e, PL_HERSHEY_SERIF_SYMBOL, 0xdb}, {0x224f, PL_HERSHEY_SERIF_SYMBOL, 0x22}, {0x2250, PL_HERSHEY_SERIF_SYMBOL, 0x24}, {0x225c, PL_HERSHEY_SERIF_SYMBOL, 0xb0}, {0x225d, PL_HERSHEY_SERIF_SYMBOL, 0x5e}, {0x225e, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4008}, {0x225f, PL_HERSHEY_SERIF_SYMBOL, 0xb6}, {0x2260, PL_HERSHEY_SERIF_SYMBOL, 0xd1}, {0x2261, PL_HERSHEY_SERIF_SYMBOL, 0xba}, {0x2262, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 276}, /* 0x2263..0x2264 are \ll and \gg */ {0x2265, PL_HERSHEY_SERIF_SYMBOL, 0xd6}, {0x2266, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4133}, {0x2267, PL_HERSHEY_SERIF_SYMBOL, 0xb5}, {0x2268, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 4132}, {0x2269, PL_HERSHEY_SERIF_SYMBOL, 0xf2}, /* 0x2270 is a double integral */ {0x2272, PL_HERSHEY_SERIF, 0xc5}, /* 0x2273 is perthousand */ {0x2274, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 2323}, {0x2275, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 2325}, /* 0x2276 is an eighth note */ {0x2277, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 2277}, {0x2278, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 2278}, {0x2279, PL_HERSHEY_SERIF, 0xb6}, {0x227e, PL_HERSHEY_SERIF, RAW_HERSHEY_GLYPH + 905}, /* Row 3 [Roman characters], taken from HersheySerif */ {0x2330, PL_HERSHEY_SERIF, '0'}, {0x2331, PL_HERSHEY_SERIF, '1'}, {0x2332, PL_HERSHEY_SERIF, '2'}, {0x2333, PL_HERSHEY_SERIF, '3'}, {0x2334, PL_HERSHEY_SERIF, '4'}, {0x2335, PL_HERSHEY_SERIF, '5'}, {0x2336, PL_HERSHEY_SERIF, '6'}, {0x2337, PL_HERSHEY_SERIF, '7'}, {0x2338, PL_HERSHEY_SERIF, '8'}, {0x2339, PL_HERSHEY_SERIF, '9'}, {0x2341, PL_HERSHEY_SERIF, 'A'}, {0x2342, PL_HERSHEY_SERIF, 'B'}, {0x2343, PL_HERSHEY_SERIF, 'C'}, {0x2344, PL_HERSHEY_SERIF, 'D'}, {0x2345, PL_HERSHEY_SERIF, 'E'}, {0x2346, PL_HERSHEY_SERIF, 'F'}, {0x2347, PL_HERSHEY_SERIF, 'G'}, {0x2348, PL_HERSHEY_SERIF, 'H'}, {0x2349, PL_HERSHEY_SERIF, 'I'}, {0x234a, PL_HERSHEY_SERIF, 'J'}, {0x234b, PL_HERSHEY_SERIF, 'K'}, {0x234c, PL_HERSHEY_SERIF, 'L'}, {0x234d, PL_HERSHEY_SERIF, 'M'}, {0x234e, PL_HERSHEY_SERIF, 'N'}, {0x234f, PL_HERSHEY_SERIF, 'O'}, {0x2350, PL_HERSHEY_SERIF, 'P'}, {0x2351, PL_HERSHEY_SERIF, 'Q'}, {0x2352, PL_HERSHEY_SERIF, 'R'}, {0x2353, PL_HERSHEY_SERIF, 'S'}, {0x2354, PL_HERSHEY_SERIF, 'T'}, {0x2355, PL_HERSHEY_SERIF, 'U'}, {0x2356, PL_HERSHEY_SERIF, 'V'}, {0x2357, PL_HERSHEY_SERIF, 'W'}, {0x2358, PL_HERSHEY_SERIF, 'X'}, {0x2359, PL_HERSHEY_SERIF, 'Y'}, {0x235a, PL_HERSHEY_SERIF, 'Z'}, {0x2361, PL_HERSHEY_SERIF, 'a'}, {0x2362, PL_HERSHEY_SERIF, 'b'}, {0x2363, PL_HERSHEY_SERIF, 'c'}, {0x2364, PL_HERSHEY_SERIF, 'd'}, {0x2365, PL_HERSHEY_SERIF, 'e'}, {0x2366, PL_HERSHEY_SERIF, 'f'}, {0x2367, PL_HERSHEY_SERIF, 'g'}, {0x2368, PL_HERSHEY_SERIF, 'h'}, {0x2369, PL_HERSHEY_SERIF, 'i'}, {0x236a, PL_HERSHEY_SERIF, 'j'}, {0x236b, PL_HERSHEY_SERIF, 'k'}, {0x236c, PL_HERSHEY_SERIF, 'l'}, {0x236d, PL_HERSHEY_SERIF, 'm'}, {0x236e, PL_HERSHEY_SERIF, 'n'}, {0x236f, PL_HERSHEY_SERIF, 'o'}, {0x2370, PL_HERSHEY_SERIF, 'p'}, {0x2371, PL_HERSHEY_SERIF, 'q'}, {0x2372, PL_HERSHEY_SERIF, 'r'}, {0x2373, PL_HERSHEY_SERIF, 's'}, {0x2374, PL_HERSHEY_SERIF, 't'}, {0x2375, PL_HERSHEY_SERIF, 'u'}, {0x2376, PL_HERSHEY_SERIF, 'v'}, {0x2377, PL_HERSHEY_SERIF, 'w'}, {0x2378, PL_HERSHEY_SERIF, 'x'}, {0x2379, PL_HERSHEY_SERIF, 'y'}, {0x237a, PL_HERSHEY_SERIF, 'z'}, /* Row 4 [Hiragana], taken from HersheyHiragana. */ {0x2421, PL_HERSHEY_HIRAGANA, 0x21}, {0x2422, PL_HERSHEY_HIRAGANA, 0x22}, {0x2423, PL_HERSHEY_HIRAGANA, 0x23}, {0x2424, PL_HERSHEY_HIRAGANA, 0x24}, {0x2425, PL_HERSHEY_HIRAGANA, 0x25}, {0x2426, PL_HERSHEY_HIRAGANA, 0x26}, {0x2427, PL_HERSHEY_HIRAGANA, 0x27}, {0x2428, PL_HERSHEY_HIRAGANA, 0x28}, {0x2429, PL_HERSHEY_HIRAGANA, 0x29}, {0x242a, PL_HERSHEY_HIRAGANA, 0x2a}, {0x242b, PL_HERSHEY_HIRAGANA, 0x2b}, {0x242c, PL_HERSHEY_HIRAGANA, 0x2c}, {0x242d, PL_HERSHEY_HIRAGANA, 0x2d}, {0x242e, PL_HERSHEY_HIRAGANA, 0x2e}, {0x242f, PL_HERSHEY_HIRAGANA, 0x2f}, {0x2430, PL_HERSHEY_HIRAGANA, 0x30}, {0x2431, PL_HERSHEY_HIRAGANA, 0x31}, {0x2432, PL_HERSHEY_HIRAGANA, 0x32}, {0x2433, PL_HERSHEY_HIRAGANA, 0x33}, {0x2434, PL_HERSHEY_HIRAGANA, 0x34}, {0x2435, PL_HERSHEY_HIRAGANA, 0x35}, {0x2436, PL_HERSHEY_HIRAGANA, 0x36}, {0x2437, PL_HERSHEY_HIRAGANA, 0x37}, {0x2438, PL_HERSHEY_HIRAGANA, 0x38}, {0x2439, PL_HERSHEY_HIRAGANA, 0x39}, {0x243a, PL_HERSHEY_HIRAGANA, 0x3a}, {0x243b, PL_HERSHEY_HIRAGANA, 0x3b}, {0x243c, PL_HERSHEY_HIRAGANA, 0x3c}, {0x243d, PL_HERSHEY_HIRAGANA, 0x3d}, {0x243e, PL_HERSHEY_HIRAGANA, 0x3e}, {0x243f, PL_HERSHEY_HIRAGANA, 0x3f}, {0x2440, PL_HERSHEY_HIRAGANA, 0x40}, {0x2441, PL_HERSHEY_HIRAGANA, 0x41}, {0x2442, PL_HERSHEY_HIRAGANA, 0x42}, {0x2443, PL_HERSHEY_HIRAGANA, 0x43}, {0x2444, PL_HERSHEY_HIRAGANA, 0x44}, {0x2445, PL_HERSHEY_HIRAGANA, 0x45}, {0x2446, PL_HERSHEY_HIRAGANA, 0x46}, {0x2447, PL_HERSHEY_HIRAGANA, 0x47}, {0x2448, PL_HERSHEY_HIRAGANA, 0x48}, {0x2449, PL_HERSHEY_HIRAGANA, 0x49}, {0x244a, PL_HERSHEY_HIRAGANA, 0x4a}, {0x244b, PL_HERSHEY_HIRAGANA, 0x4b}, {0x244c, PL_HERSHEY_HIRAGANA, 0x4c}, {0x244d, PL_HERSHEY_HIRAGANA, 0x4d}, {0x244e, PL_HERSHEY_HIRAGANA, 0x4e}, {0x244f, PL_HERSHEY_HIRAGANA, 0x4f}, {0x2450, PL_HERSHEY_HIRAGANA, 0x50}, {0x2451, PL_HERSHEY_HIRAGANA, 0x51}, {0x2452, PL_HERSHEY_HIRAGANA, 0x52}, {0x2453, PL_HERSHEY_HIRAGANA, 0x53}, {0x2454, PL_HERSHEY_HIRAGANA, 0x54}, {0x2455, PL_HERSHEY_HIRAGANA, 0x55}, {0x2456, PL_HERSHEY_HIRAGANA, 0x56}, {0x2457, PL_HERSHEY_HIRAGANA, 0x57}, {0x2458, PL_HERSHEY_HIRAGANA, 0x58}, {0x2459, PL_HERSHEY_HIRAGANA, 0x59}, {0x245a, PL_HERSHEY_HIRAGANA, 0x5a}, {0x245b, PL_HERSHEY_HIRAGANA, 0x5b}, {0x245c, PL_HERSHEY_HIRAGANA, 0x5c}, {0x245d, PL_HERSHEY_HIRAGANA, 0x5d}, {0x245e, PL_HERSHEY_HIRAGANA, 0x5e}, {0x245f, PL_HERSHEY_HIRAGANA, 0x5f}, {0x2460, PL_HERSHEY_HIRAGANA, 0x60}, {0x2461, PL_HERSHEY_HIRAGANA, 0x61}, {0x2462, PL_HERSHEY_HIRAGANA, 0x62}, {0x2463, PL_HERSHEY_HIRAGANA, 0x63}, {0x2464, PL_HERSHEY_HIRAGANA, 0x64}, {0x2465, PL_HERSHEY_HIRAGANA, 0x65}, {0x2466, PL_HERSHEY_HIRAGANA, 0x66}, {0x2467, PL_HERSHEY_HIRAGANA, 0x67}, {0x2468, PL_HERSHEY_HIRAGANA, 0x68}, {0x2469, PL_HERSHEY_HIRAGANA, 0x69}, {0x246a, PL_HERSHEY_HIRAGANA, 0x6a}, {0x246b, PL_HERSHEY_HIRAGANA, 0x6b}, {0x246c, PL_HERSHEY_HIRAGANA, 0x6c}, {0x246d, PL_HERSHEY_HIRAGANA, 0x6d}, {0x246e, PL_HERSHEY_HIRAGANA, 0x6e}, {0x246f, PL_HERSHEY_HIRAGANA, 0x6f}, {0x2470, PL_HERSHEY_HIRAGANA, 0x70}, {0x2471, PL_HERSHEY_HIRAGANA, 0x71}, {0x2472, PL_HERSHEY_HIRAGANA, 0x72}, {0x2473, PL_HERSHEY_HIRAGANA, 0x73}, /* Row 5 [Katakana], taken from HersheyKatakana. */ {0x2521, PL_HERSHEY_KATAKANA, 0x21}, {0x2522, PL_HERSHEY_KATAKANA, 0x22}, {0x2523, PL_HERSHEY_KATAKANA, 0x23}, {0x2524, PL_HERSHEY_KATAKANA, 0x24}, {0x2525, PL_HERSHEY_KATAKANA, 0x25}, {0x2526, PL_HERSHEY_KATAKANA, 0x26}, {0x2527, PL_HERSHEY_KATAKANA, 0x27}, {0x2528, PL_HERSHEY_KATAKANA, 0x28}, {0x2529, PL_HERSHEY_KATAKANA, 0x29}, {0x252a, PL_HERSHEY_KATAKANA, 0x2a}, {0x252b, PL_HERSHEY_KATAKANA, 0x2b}, {0x252c, PL_HERSHEY_KATAKANA, 0x2c}, {0x252d, PL_HERSHEY_KATAKANA, 0x2d}, {0x252e, PL_HERSHEY_KATAKANA, 0x2e}, {0x252f, PL_HERSHEY_KATAKANA, 0x2f}, {0x2530, PL_HERSHEY_KATAKANA, 0x30}, {0x2531, PL_HERSHEY_KATAKANA, 0x31}, {0x2532, PL_HERSHEY_KATAKANA, 0x32}, {0x2533, PL_HERSHEY_KATAKANA, 0x33}, {0x2534, PL_HERSHEY_KATAKANA, 0x34}, {0x2535, PL_HERSHEY_KATAKANA, 0x35}, {0x2536, PL_HERSHEY_KATAKANA, 0x36}, {0x2537, PL_HERSHEY_KATAKANA, 0x37}, {0x2538, PL_HERSHEY_KATAKANA, 0x38}, {0x2539, PL_HERSHEY_KATAKANA, 0x39}, {0x253a, PL_HERSHEY_KATAKANA, 0x3a}, {0x253b, PL_HERSHEY_KATAKANA, 0x3b}, {0x253c, PL_HERSHEY_KATAKANA, 0x3c}, {0x253d, PL_HERSHEY_KATAKANA, 0x3d}, {0x253e, PL_HERSHEY_KATAKANA, 0x3e}, {0x253f, PL_HERSHEY_KATAKANA, 0x3f}, {0x2540, PL_HERSHEY_KATAKANA, 0x40}, {0x2541, PL_HERSHEY_KATAKANA, 0x41}, {0x2542, PL_HERSHEY_KATAKANA, 0x42}, {0x2543, PL_HERSHEY_KATAKANA, 0x43}, {0x2544, PL_HERSHEY_KATAKANA, 0x44}, {0x2545, PL_HERSHEY_KATAKANA, 0x45}, {0x2546, PL_HERSHEY_KATAKANA, 0x46}, {0x2547, PL_HERSHEY_KATAKANA, 0x47}, {0x2548, PL_HERSHEY_KATAKANA, 0x48}, {0x2549, PL_HERSHEY_KATAKANA, 0x49}, {0x254a, PL_HERSHEY_KATAKANA, 0x4a}, {0x254b, PL_HERSHEY_KATAKANA, 0x4b}, {0x254c, PL_HERSHEY_KATAKANA, 0x4c}, {0x254d, PL_HERSHEY_KATAKANA, 0x4d}, {0x254e, PL_HERSHEY_KATAKANA, 0x4e}, {0x254f, PL_HERSHEY_KATAKANA, 0x4f}, {0x2550, PL_HERSHEY_KATAKANA, 0x50}, {0x2551, PL_HERSHEY_KATAKANA, 0x51}, {0x2552, PL_HERSHEY_KATAKANA, 0x52}, {0x2553, PL_HERSHEY_KATAKANA, 0x53}, {0x2554, PL_HERSHEY_KATAKANA, 0x54}, {0x2555, PL_HERSHEY_KATAKANA, 0x55}, {0x2556, PL_HERSHEY_KATAKANA, 0x56}, {0x2557, PL_HERSHEY_KATAKANA, 0x57}, {0x2558, PL_HERSHEY_KATAKANA, 0x58}, {0x2559, PL_HERSHEY_KATAKANA, 0x59}, {0x255a, PL_HERSHEY_KATAKANA, 0x5a}, {0x255b, PL_HERSHEY_KATAKANA, 0x5b}, {0x255c, PL_HERSHEY_KATAKANA, 0x5c}, {0x255d, PL_HERSHEY_KATAKANA, 0x5d}, {0x255e, PL_HERSHEY_KATAKANA, 0x5e}, {0x255f, PL_HERSHEY_KATAKANA, 0x5f}, {0x2560, PL_HERSHEY_KATAKANA, 0x60}, {0x2561, PL_HERSHEY_KATAKANA, 0x61}, {0x2562, PL_HERSHEY_KATAKANA, 0x62}, {0x2563, PL_HERSHEY_KATAKANA, 0x63}, {0x2564, PL_HERSHEY_KATAKANA, 0x64}, {0x2565, PL_HERSHEY_KATAKANA, 0x65}, {0x2566, PL_HERSHEY_KATAKANA, 0x66}, {0x2567, PL_HERSHEY_KATAKANA, 0x67}, {0x2568, PL_HERSHEY_KATAKANA, 0x68}, {0x2569, PL_HERSHEY_KATAKANA, 0x69}, {0x256a, PL_HERSHEY_KATAKANA, 0x6a}, {0x256b, PL_HERSHEY_KATAKANA, 0x6b}, {0x256c, PL_HERSHEY_KATAKANA, 0x6c}, {0x256d, PL_HERSHEY_KATAKANA, 0x6d}, {0x256e, PL_HERSHEY_KATAKANA, 0x6e}, {0x256f, PL_HERSHEY_KATAKANA, 0x6f}, {0x2570, PL_HERSHEY_KATAKANA, 0x70}, {0x2571, PL_HERSHEY_KATAKANA, 0x71}, {0x2572, PL_HERSHEY_KATAKANA, 0x72}, {0x2573, PL_HERSHEY_KATAKANA, 0x73}, {0x2574, PL_HERSHEY_KATAKANA, 0x74}, {0x2575, PL_HERSHEY_KATAKANA, 0x75}, {0x2576, PL_HERSHEY_KATAKANA, 0x76}, /* Row 6 [Greek characters], taken from HersheySerif-Symbol. */ {0x2621, PL_HERSHEY_SERIF_SYMBOL, 'A'}, {0x2622, PL_HERSHEY_SERIF_SYMBOL, 'B'}, {0x2623, PL_HERSHEY_SERIF_SYMBOL, 'G'}, {0x2624, PL_HERSHEY_SERIF_SYMBOL, 'D'}, {0x2625, PL_HERSHEY_SERIF_SYMBOL, 'E'}, {0x2626, PL_HERSHEY_SERIF_SYMBOL, 'Z'}, {0x2627, PL_HERSHEY_SERIF_SYMBOL, 'H'}, {0x2628, PL_HERSHEY_SERIF_SYMBOL, 'Q'}, {0x2629, PL_HERSHEY_SERIF_SYMBOL, 'I'}, {0x262a, PL_HERSHEY_SERIF_SYMBOL, 'K'}, {0x262b, PL_HERSHEY_SERIF_SYMBOL, 'L'}, {0x262c, PL_HERSHEY_SERIF_SYMBOL, 'M'}, {0x262d, PL_HERSHEY_SERIF_SYMBOL, 'N'}, {0x262e, PL_HERSHEY_SERIF_SYMBOL, 'X'}, {0x262f, PL_HERSHEY_SERIF_SYMBOL, 'O'}, {0x2630, PL_HERSHEY_SERIF_SYMBOL, 'P'}, {0x2631, PL_HERSHEY_SERIF_SYMBOL, 'R'}, {0x2632, PL_HERSHEY_SERIF_SYMBOL, 'S'}, {0x2633, PL_HERSHEY_SERIF_SYMBOL, 'T'}, {0x2634, PL_HERSHEY_SERIF_SYMBOL, 0x80 + '!'}, /* variant upsilon */ {0x2635, PL_HERSHEY_SERIF_SYMBOL, 'F'}, {0x2636, PL_HERSHEY_SERIF_SYMBOL, 'C'}, {0x2637, PL_HERSHEY_SERIF_SYMBOL, 'Y'}, {0x2638, PL_HERSHEY_SERIF_SYMBOL, 'W'}, {0x2641, PL_HERSHEY_SERIF_SYMBOL, 'a'}, {0x2642, PL_HERSHEY_SERIF_SYMBOL, 'b'}, {0x2643, PL_HERSHEY_SERIF_SYMBOL, 'g'}, {0x2644, PL_HERSHEY_SERIF_SYMBOL, 'd'}, {0x2645, PL_HERSHEY_SERIF_SYMBOL, 'e'}, {0x2646, PL_HERSHEY_SERIF_SYMBOL, 'z'}, {0x2647, PL_HERSHEY_SERIF_SYMBOL, 'h'}, {0x2648, PL_HERSHEY_SERIF_SYMBOL, 'q'}, {0x2649, PL_HERSHEY_SERIF_SYMBOL, 'i'}, {0x264a, PL_HERSHEY_SERIF_SYMBOL, 'k'}, {0x264b, PL_HERSHEY_SERIF_SYMBOL, 'l'}, {0x264c, PL_HERSHEY_SERIF_SYMBOL, 'm'}, {0x264d, PL_HERSHEY_SERIF_SYMBOL, 'n'}, {0x264e, PL_HERSHEY_SERIF_SYMBOL, 'x'}, {0x264f, PL_HERSHEY_SERIF_SYMBOL, 'o'}, {0x2650, PL_HERSHEY_SERIF_SYMBOL, 'p'}, {0x2651, PL_HERSHEY_SERIF_SYMBOL, 'r'}, {0x2652, PL_HERSHEY_SERIF_SYMBOL, 's'}, {0x2653, PL_HERSHEY_SERIF_SYMBOL, 't'}, {0x2654, PL_HERSHEY_SERIF_SYMBOL, 'u'}, {0x2655, PL_HERSHEY_SERIF_SYMBOL, 'f'}, {0x2656, PL_HERSHEY_SERIF_SYMBOL, 'c'}, {0x2657, PL_HERSHEY_SERIF_SYMBOL, 'y'}, {0x2658, PL_HERSHEY_SERIF_SYMBOL, 'w'}, /* Row 7 [Cyrillic characters], taken from HersheyCyrillic. The strange order is because we are mapping to the KOI8-R encoding. */ {0x2721, PL_HERSHEY_CYRILLIC, 0x80 + 'a'}, {0x2722, PL_HERSHEY_CYRILLIC, 0x80 + 'b'}, {0x2723, PL_HERSHEY_CYRILLIC, 0x80 + 'w'}, {0x2724, PL_HERSHEY_CYRILLIC, 0x80 + 'g'}, {0x2725, PL_HERSHEY_CYRILLIC, 0x80 + 'd'}, {0x2726, PL_HERSHEY_CYRILLIC, 0x80 + 'e'}, {0x2727, PL_HERSHEY_CYRILLIC, 0x80 + '3'}, {0x2728, PL_HERSHEY_CYRILLIC, 0x80 + 'v'}, {0x2729, PL_HERSHEY_CYRILLIC, 0x80 + 'z'}, {0x272a, PL_HERSHEY_CYRILLIC, 0x80 + 'i'}, {0x272b, PL_HERSHEY_CYRILLIC, 0x80 + 'j'}, {0x272c, PL_HERSHEY_CYRILLIC, 0x80 + 'k'}, {0x272d, PL_HERSHEY_CYRILLIC, 0x80 + 'l'}, {0x272e, PL_HERSHEY_CYRILLIC, 0x80 + 'm'}, {0x272f, PL_HERSHEY_CYRILLIC, 0x80 + 'n'}, {0x2730, PL_HERSHEY_CYRILLIC, 0x80 + 'o'}, {0x2731, PL_HERSHEY_CYRILLIC, 0x80 + 'p'}, {0x2732, PL_HERSHEY_CYRILLIC, 0x80 + 'r'}, {0x2733, PL_HERSHEY_CYRILLIC, 0x80 + 's'}, {0x2734, PL_HERSHEY_CYRILLIC, 0x80 + 't'}, {0x2735, PL_HERSHEY_CYRILLIC, 0x80 + 'u'}, {0x2736, PL_HERSHEY_CYRILLIC, 0x80 + 'f'}, {0x2737, PL_HERSHEY_CYRILLIC, 0x80 + 'h'}, {0x2738, PL_HERSHEY_CYRILLIC, 0x80 + 'c'}, {0x2739, PL_HERSHEY_CYRILLIC, 0x80 + '~'}, {0x273a, PL_HERSHEY_CYRILLIC, 0x80 + '{'}, {0x273b, PL_HERSHEY_CYRILLIC, 0x80 + '}'}, {0x273c, PL_HERSHEY_CYRILLIC, 0x80 + 0x7f}, {0x273d, PL_HERSHEY_CYRILLIC, 0x80 + 'y'}, {0x273e, PL_HERSHEY_CYRILLIC, 0x80 + 'x'}, {0x273f, PL_HERSHEY_CYRILLIC, 0x80 + '|'}, {0x2740, PL_HERSHEY_CYRILLIC, 0x80 + '`'}, {0x2741, PL_HERSHEY_CYRILLIC, 0x80 + 'q'}, {0x2751, PL_HERSHEY_CYRILLIC, 0x80 + 'A'}, {0x2752, PL_HERSHEY_CYRILLIC, 0x80 + 'B'}, {0x2753, PL_HERSHEY_CYRILLIC, 0x80 + 'W'}, {0x2754, PL_HERSHEY_CYRILLIC, 0x80 + 'G'}, {0x2755, PL_HERSHEY_CYRILLIC, 0x80 + 'D'}, {0x2756, PL_HERSHEY_CYRILLIC, 0x80 + 'E'}, {0x2757, PL_HERSHEY_CYRILLIC, 0x80 + '#'}, {0x2758, PL_HERSHEY_CYRILLIC, 0x80 + 'V'}, {0x2759, PL_HERSHEY_CYRILLIC, 0x80 + 'Z'}, {0x275a, PL_HERSHEY_CYRILLIC, 0x80 + 'I'}, {0x275b, PL_HERSHEY_CYRILLIC, 0x80 + 'J'}, {0x275c, PL_HERSHEY_CYRILLIC, 0x80 + 'K'}, {0x275d, PL_HERSHEY_CYRILLIC, 0x80 + 'L'}, {0x275e, PL_HERSHEY_CYRILLIC, 0x80 + 'M'}, {0x275f, PL_HERSHEY_CYRILLIC, 0x80 + 'N'}, {0x2760, PL_HERSHEY_CYRILLIC, 0x80 + 'O'}, {0x2761, PL_HERSHEY_CYRILLIC, 0x80 + 'P'}, {0x2762, PL_HERSHEY_CYRILLIC, 0x80 + 'R'}, {0x2763, PL_HERSHEY_CYRILLIC, 0x80 + 'S'}, {0x2764, PL_HERSHEY_CYRILLIC, 0x80 + 'T'}, {0x2765, PL_HERSHEY_CYRILLIC, 0x80 + 'U'}, {0x2766, PL_HERSHEY_CYRILLIC, 0x80 + 'F'}, {0x2767, PL_HERSHEY_CYRILLIC, 0x80 + 'H'}, {0x2768, PL_HERSHEY_CYRILLIC, 0x80 + 'C'}, {0x2769, PL_HERSHEY_CYRILLIC, 0x80 + '^'}, {0x276a, PL_HERSHEY_CYRILLIC, 0x80 + '['}, {0x276b, PL_HERSHEY_CYRILLIC, 0x80 + ']'}, {0x276c, PL_HERSHEY_CYRILLIC, 0x80 + '_'}, {0x276d, PL_HERSHEY_CYRILLIC, 0x80 + 'Y'}, {0x276e, PL_HERSHEY_CYRILLIC, 0x80 + 'X'}, {0x276f, PL_HERSHEY_CYRILLIC, 0x80 + '\\'}, {0x2770, PL_HERSHEY_CYRILLIC, 0x80 + '@'}, {0x2771, PL_HERSHEY_CYRILLIC, 0x80 + 'Q'}, {0, 0, 0} }; plotutils-2.6/libplot/g_pagetype.h0000644000175000017500000001561411037243262014312 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file is #include'd by g_pagetype.c. It is a database rather than a true header file: it lists known page sizes and dimensions. Fields are: (1) name, (2) alternative name, (3) name used by Fig, (4) whether metric, as opposed to imperial, units are associated with this page size. (5) width in inches, (6) height in inches, (7) the size of the viewport (a square) we place on the page. (The viewport is positioned at the center of the page except when producing HP-GL[/2] output. For HP-GL[/2], as opposed to HP-GL/2 embedded in PCL5, we have no definite information about the location of the origin of the device coordinate system [we don't even know whether the device is plotting in portrait or landscape mode, though it's probably landscape mode].) Our convention: both in the pure-HP-GL[/2] case and in all other cases, the viewport is chosen to have a fixed size that's no larger than the smaller dimension of the plotting area used, for the specified page type, by AutoCAD. AutoCAD presumably does a good job of selecting a plotting area (a rectangle) that will fit on a landscape-mode HP-GL[/2] page. In the HP-GL[/2] case we make no attempt at centering the viewport, though at least one of the two coordinates shouldn't be centered too badly. The user can manually adjust the location of the viewport. (8,9) the origin of the device coordinate system, when HP-GL/2 is embedded in PCL5; relative to the lower left corner of page. Source: the "PCL 5 Comparison Guide", from Hewlett-Packard. Note that when a PCL5 "dual context" portrait-mode device is switched to HP-GL/2 mode, the HP-GL/2 plotting is also in portrait mode. I.e., on a PCL5 device doing HP-GL/2 emulation it's possible to set the portrait/landscape mode programmatically, unlike a pure HP-GL/2 device. (10) the plot length (of importance mostly for roll plotters, when pure HP-GL/2, rather than HP-GL/2 embedded in PCL5, is output). I've come up with values that I hope are appropriate. Explanatory comments: In general, the origin for the HP-GL[/2] coordinate system is not a corner of the printed page. (This is an old convention, dating back to early pen plotter days.) It is the lower left corner of the `hard-clip region', a proper subrectangle of the printed page. The size and orientation of the hard-clip region differ from device to device. Fields #8, #9 below give the location of the origin in a PCL device supporting HP-GL/2. Fields #8, #9 could equally well be defined as the x margin and y margin between the HP-GL/2 hard-clip region and the boundary of the page. The HP-GL/2 hard-clip region is a proper subrectangle of the rectangular area of the page that is imageable from within PCL. In a pure HP-GL/2 device, there is no easy way to determine the origin. (In fact in early HP-GL plotters, unlike HP-GL/2 plotters, the lower left corner of the hard-clip region wasn't even the same as the default location of the so-called HP-GL `scaling point' P1.) */ #define PL_NUM_PAGESIZES 13 static const plPageData _pagedata[PL_NUM_PAGESIZES] = { /* ANSI A, 8.5in x 11.0in */ /* AutoCAD plotting area is 8.0x10.5; we choose viewport size 8.0in */ { "a", "letter", "Letter", false, 8.5, 11.0, 8.0, 75.0/300, 150.0/300, 10.5 }, /* ANSI B, 11.0in x 17.0in */ /* AutoCAD plotting area is 10.0x16.0; we choose viewport size 10.0in */ { "b", "tabloid", "B", false, 11.0, 17.0, 10.0, 75.0/300, 150.0/300, 16.0 }, /* ANSI C, 17.0in x 22.0in */ /* AutoCAD plotting area is 16.0x21.0; we choose viewport size 16.0in */ { "c", NULL, "C", false, 17.0, 22.0, 16.0, 75.0/300, 150.0/300, 21.0 }, /* ANSI D, 22.0in x 34.0in */ /* AutoCAD plotting area is 21.0x33.0; we choose viewport size 20.0in */ { "d", NULL, "D", false, 22.0, 34.0, 20.0, 75.0/300, 150.0/300, 33.0 }, /* ANSI E, 34.0in x 44.0in */ /* AutoCAD plotting area is 33.0x43.0; we choose viewport size 32.0in */ { "e", NULL, "E", false, 34.0, 44.0, 32.0, 75.0/300, 150.0/300, 43.0 }, /* legal, 8.5in x 14in; not an ANSI size */ /* AutoCAD plotting area unknown; we choose viewport size = 8.0in */ { "legal", NULL, "Legal", false, 8.5, 14.0, 8.0, 75.0/300, 150.0/300, 16.0 }, /* ledger, 17in x 11in (rotated ANSI B); not an ANSI size ? */ /* we use viewport size = 10.0in */ { "ledger", NULL, "Ledger", false, 17.0, 11.0, 10.0, 150.0/300, 75.0/300, 10.0 }, /* ISO A4, 21.0cm x 29.7 cm = 8.27 x 11.69 */ /* AutoCAD plotting area is 7.8x11.2; we choose viewport size 7.8in=19.81cm [N.B. 7.87in = 20cm] */ { "a4", NULL, "A4", true, 8.27, 11.69, 7.8, 71.0/300, 150.0/300, 11.2 }, /* ISO A3, 29.7cm x 42.0 cm = 11.69 x 16.54 */ /* AutoCAD plotting area is 10.7x15.6; we choose viewport size 10.7in=27.18cm [N.B. 10.62in = 27cm] */ { "a3", NULL, "A3", true, 11.69, 16.54, 10.7, 71.0/300, 150.0/300, 15.6 }, /* ISO A2, 42.0cm x 59.4 cm = 16.54 x 23.39 */ /* AutoCAD plotting area is 15.6x22.4; we choose viewport size 15.6in=39.62cm [N.B. 15.75in = 40cm] */ { "a2", NULL, "A2", true, 16.54, 23.39, 15.6, 71.0/300, 150.0/300, 22.4 }, /* ISO A1, 59.4cm x 84.1 cm = 23.39 x 33.11 */ /* AutoCAD plotting area is 22.4x32.2; we choose viewport size 22.4in=56.90cm [N.B. 21.26in = 54cm] */ { "a1", NULL, "A1", true, 23.39, 33.11, 22.4, 71.0/300, 150.0/300, 32.2 }, /* ISO A0, 84.1cm x 118.9 cm = 33.11 x 46.81 */ /* AutoCAD plotting area is 32.2x45.9; we choose viewport size 32.2in=81.79cm [N.B. 31.50in = 80cm] */ { "a0", NULL, "A0", true, 33.11, 46.81, 32.2, 71.0/300, 150.0/300, 45.9 }, /* JIS B5, 18.2cm x 25.7 cm = 7.17 x 10.12 */ /* AutoCAD plotting area is 6.67x9.62(?); we choose viewport size 6.67in=16.94cm [N.B. 6.30in = 16cm] */ { "b5", NULL, "B5", true, 7.17, 10.12, 6.67, 71.0/300, 150.0/300, 9.62 } }; plotutils-2.6/libplot/h_roman8.h0000644000175000017500000000455011037243262013676 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file specifies HP's Roman-8 encoding (used by HP's vector fonts [`stick fonts'], including both fixed-width stick fonts and variable-width arc fonts). In particular, it gives a mapping from the upper half of the ISO-Latin-1 character set to Roman-8. */ /* ISO-Latin-1 characters not included in Roman-8; we map each of them to 040, i.e., to the space character. */ #define COPYRIGHT 040 #define NEGATION 040 #define REGISTERED 040 #define RAISEDONE 040 #define RAISEDTWO 040 #define RAISEDTHREE 040 #define CEDILLA 040 #define MULTIPLY 040 #define DIVIDES 040 static const unsigned char iso_to_roman8 [128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* printable iso-latin-1 characters */ 040, 0270, 0277, 0257, 0272, 0274, (unsigned char)'|', 0275, 0253, COPYRIGHT, 0371, 0373, NEGATION, (unsigned char)'-', REGISTERED, 0260, 0263, 0376, RAISEDTWO, RAISEDTHREE, 0250, 0363, 0364, 0362, CEDILLA, RAISEDONE, 0372, 0375, 0367, 0370, 0365, 0271, 0241, 0340, 0242, 0341, 0330, 0320, 0323, 0264, 0243, 0334, 0244, 0245, 0346, 0345, 0246, 0247, 0343, 0266, 0350, 0347, 0337, 0351, 0332, MULTIPLY, 0322, 0255, 0355, 0256, 0333, 0261, 0360, 0336, 0310, 0304, 0300, 0342, 0314, 0324, 0327, 0265, 0311, 0305, 0301, 0315, 0331, 0325, 0321, 0335, 0344, 0267, 0312, 0306, 0302, 0352, 0316, DIVIDES, 0326, 0313, 0307, 0303, 0317, 0262, 0361, 0357, }; plotutils-2.6/libplot/i_rle.h0000644000175000017500000000457011037243262013257 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file (i_rle.h) defines the external interface to the module i_rle.c, which does run-length encoding on a sequence of integers ("pixel values"), and writes the resulting encoded sequence to an output stream. The encoded sequence should be GIF-compatible, even though the compression technique is not LZW. The module encapsulates the miGIF compression routines, originally written by der Mouse and ivo. Their copyright notice appears in i_rle.c. */ /* an `int' should be able to hold 2**GIFBITS distinct values, together with -1 */ #define GIFBITS 12 /* the RLE output structure */ typedef struct { int rl_pixel; int rl_basecode; int rl_count; int rl_table_pixel; int rl_table_max; bool just_cleared; int out_bits; int out_bits_init; int out_count; int out_bump; int out_bump_init; int out_clear; int out_clear_init; int max_ocodes; int code_clear; int code_eof; unsigned int obuf; int obits; FILE *ofile; #ifdef LIBPLOTTER ostream *outstream; #endif unsigned char oblock[256]; int oblen; } rle_out; /* create, initialize, and return a new RLE output structure */ #ifdef LIBPLOTTER extern rle_out *_rle_init (FILE *fp, ostream *out, int bit_depth); #else extern rle_out *_rle_init (FILE *fp, int bit_depth); #endif /* write a single integer (pixel) to the structure */ extern void _rle_do_pixel (rle_out *rle, int c); /* wind things up and deallocate the RLE output structure */ extern void _rle_terminate (rle_out *rle); plotutils-2.6/libplot/p_header.h0000644000175000017500000003137711037243262013741 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The following Postscript procset defines a set of macros and constants that libplot uses when rendering graphics. It is split into several shorter pieces, because some compilers have difficulty with strings that are too long. It is #included by p_defplot.c. The procset was largely written by John Interrante , formerly of the InterViews team. (Thanks to John for generously providing it, and for helpful comments.) For more information see the InterViews distribution at ftp://interviews.stanford.edu. The present procset, version 1.1, includes a minor modification. Originally, FontBBox was assumed always to be an executable array. Many fonts are designed this way, but it is not required. The assumption gave problems on some versions of ghostscript. Thanks to Alex Cherepanov for the bug fix. */ #define PS_PROCSET_NAME "GNU_libplot" #define PS_PROCSET_VERSION "1.1" static const char * const _ps_fontproc = "\ /ISOLatin1Encoding [\n\ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n\ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n\ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n\ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n\ /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright\n\ /parenleft/parenright/asterisk/plus/comma/minus/period/slash\n\ /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon\n\ /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N\n\ /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright\n\ /asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m\n\ /n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde\n\ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n\ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef\n\ /.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve\n\ /dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut\n\ /ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar\n\ /section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot\n\ /hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior\n\ /acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine\n\ /guillemotright/onequarter/onehalf/threequarters/questiondown\n\ /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla\n\ /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex\n\ /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis\n\ /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute\n\ /Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis\n\ /aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave\n\ /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex\n\ /otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis\n\ /yacute/thorn/ydieresis\n\ ] def\n\ /reencodeISO {\n\ dup dup findfont dup length dict begin\n\ { 1 index /FID ne { def }{ pop pop } ifelse } forall\n\ /Encoding ISOLatin1Encoding def\n\ currentdict end definefont\n\ } def\n"; /* The following is split into substrings, because some compilers (e.g., MS VC++) can't handle very long strings. */ static const char * const _ps_procset[] = {"\ /none null def\n\ /numGraphicParameters 17 def\n\ /stringLimit 65535 def\n\ /arrowHeight 8 def\n\ /eoFillRule true def\n\n\ /Begin { save numGraphicParameters dict begin } def\n\ /End { end restore } def\n\ \n\ /SetB {\n\ dup type /nulltype eq {\n\ pop\n\ false /brushRightArrow idef\n\ false /brushLeftArrow idef\n\ true /brushNone idef\n\ } {\n\ /brushDashOffset idef\n\ /brushDashArray idef\n\ 0 ne /brushRightArrow idef\n\ 0 ne /brushLeftArrow idef\n\ /brushWidth idef\n\ false /brushNone idef\n", "} ifelse\n\ } def\n\ \n\ /SetCFg {\n\ /fgblue idef\n\ /fggreen idef\n\ /fgred idef\n\ } def\n\ \n\ /SetCBg {\n\ /bgblue idef\n\ /bggreen idef\n\ /bgred idef\n\ } def\n\ \n\ /SetF {\n\ /printSize idef\n\ /printFont idef\n\ } def\n\ \n\ /SetP {\n\ dup type /nulltype eq {\n\ pop true /patternNone idef\n\ } {\n\ /patternGrayLevel idef\n\ patternGrayLevel -1 eq {\n\ /patternString idef\n\ } if\n\ false /patternNone idef\n\ } ifelse\n\ } def\n\ \n", "/BSpl {\n\ 0 begin\n\ storexyn\n\ newpath\n\ n 1 gt {\n\ 0 0 0 0 0 0 1 1 true subspline\n\ n 2 gt {\n\ 0 0 0 0 1 1 2 2 false subspline\n\ 1 1 n 3 sub {\n\ /i exch def\n\ i 1 sub dup i dup i 1 add dup i 2 add dup false subspline\n\ } for\n\ n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline\n\ } if\n\ n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline\n\ patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if\n\ brushNone not { istroke } if\n", "0 0 1 1 leftarrow\n\ n 2 sub dup 1 sub dup rightarrow\n\ } if\n\ end\n\ } dup 0 4 dict put def\n\ \n\ /Circ {\n\ newpath\n\ 0 360 arc\n\ closepath\n\ patternNone not { ifill } if\n\ brushNone not { istroke } if\n\ } def\n\ \n", "/CBSpl {\n\ 0 begin\n\ dup 2 gt {\n\ storexyn\n\ newpath\n\ n 1 sub dup 0 0 1 1 2 2 true subspline\n\ 1 1 n 3 sub {\n\ /i exch def\n\ i 1 sub dup i dup i 1 add dup i 2 add dup false subspline\n\ } for\n", "n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline\n\ n 2 sub dup n 1 sub dup 0 0 1 1 false subspline\n\ patternNone not { ifill } if\n\ brushNone not { istroke } if\n\ } {\n\ Poly\n\ } ifelse\n\ end\n\ } dup 0 4 dict put def\n\ \n\ /Elli {\n\ 0 begin\n\ newpath\n\ 4 2 roll\n\ translate\n\ scale\n\ 0 0 1 0 360 arc\n\ closepath\n\ patternNone not { ifill } if\n\ brushNone not { istroke } if\n\ end\n\ } dup 0 1 dict put def\n\ \n\ /Line {\n\ 0 begin\n\ 2 storexyn\n", "newpath\n\ x 0 get y 0 get moveto\n\ x 1 get y 1 get lineto\n\ brushNone not { istroke } if\n\ 0 0 1 1 leftarrow\n\ 0 0 1 1 rightarrow\n\ end\n\ } dup 0 4 dict put def\n\ \n\ /MLine {\n\ 0 begin\n\ storexyn\n\ newpath\n\ n 1 gt {\n\ x 0 get y 0 get moveto\n\ 1 1 n 1 sub {\n\ /i exch def\n\ x i get y i get lineto\n\ } for\n\ patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if\n\ brushNone not { istroke } if\n", "0 0 1 1 leftarrow\n\ n 2 sub dup n 1 sub dup rightarrow\n\ } if\n\ end\n\ } dup 0 4 dict put def\n\ \n\ /Poly {\n\ 3 1 roll\n\ newpath\n\ moveto\n\ -1 add\n\ { lineto } repeat\n\ closepath\n\ patternNone not { ifill } if\n\ brushNone not { istroke } if\n\ } def\n\ \n", "/Rect {\n\ 0 begin\n\ /t exch def\n\ /r exch def\n\ /b exch def\n\ /l exch def\n\ newpath\n\ l b moveto\n\ l t lineto\n\ r t lineto\n\ r b lineto\n\ closepath\n\ patternNone not { ifill } if\n\ brushNone not { istroke } if\n\ end\n\ } dup 0 4 dict put def\n\ \n\ /Text {\n\ ishow\n\ } def\n\ \n\ /idef {\n\ dup where { pop pop pop } { exch def } ifelse\n\ } def\n\ \n\ /ifill {\n\ 0 begin\n\ gsave\n", "patternGrayLevel -1 ne {\n\ fgred bgred fgred sub patternGrayLevel mul add\n\ fggreen bggreen fggreen sub patternGrayLevel mul add\n\ fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor\n\ eoFillRule { eofill } { fill } ifelse\n\ } {\n\ eoFillRule { eoclip } { clip } ifelse\n\ originalCTM setmatrix\n\ pathbbox /t exch def /r exch def /b exch def /l exch def\n\ /w r l sub ceiling cvi def\n\ /h t b sub ceiling cvi def\n\ /imageByteWidth w 8 div ceiling cvi def\n\ /imageHeight h def\n", "bgred bggreen bgblue setrgbcolor\n\ eoFillRule { eofill } { fill } ifelse\n\ fgred fggreen fgblue setrgbcolor\n\ w 0 gt h 0 gt and {\n\ l b translate w h scale\n\ w h true [w 0 0 h neg 0 h] { patternproc } imagemask\n\ } if\n\ } ifelse\n\ grestore\n\ end\n\ } dup 0 8 dict put def\n\ \n", "/istroke {\n\ gsave\n\ brushDashOffset -1 eq {\n\ [] 0 setdash\n\ 1 setgray\n\ } {\n\ brushDashArray brushDashOffset setdash\n\ fgred fggreen fgblue setrgbcolor\n\ } ifelse\n", "brushWidth setlinewidth\n\ originalCTM setmatrix\n\ stroke\n\ grestore\n\ } def\n\ \n\ /ishow {\n\ 0 begin\n\ gsave\n\ fgred fggreen fgblue setrgbcolor\n\ /fontDict printFont findfont printSize scalefont dup setfont def\n\ /descender fontDict begin 0 /FontBBox load 1 get FontMatrix end\n\ transform exch pop def\n\ /vertoffset 1 printSize sub descender sub def {\n\ 0 vertoffset moveto show\n\ /vertoffset vertoffset printSize sub def\n\ } forall\n\ grestore\n\ end\n\ } dup 0 3 dict put def\n\ \n", "/patternproc {\n\ 0 begin\n\ /patternByteLength patternString length def\n\ /patternHeight patternByteLength 8 mul sqrt cvi def\n\ /patternWidth patternHeight def\n\ /patternByteWidth patternWidth 8 idiv def\n\ /imageByteMaxLength imageByteWidth imageHeight mul\n\ stringLimit patternByteWidth sub min def\n\ /imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv\n\ patternHeight mul patternHeight max def\n", "/imageHeight imageHeight imageMaxHeight sub store\n\ /imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def\n\ 0 1 imageMaxHeight 1 sub {\n\ /y exch def\n\ /patternRow y patternByteWidth mul patternByteLength mod def\n\ /patternRowString patternString patternRow patternByteWidth getinterval def\n\ /imageRow y imageByteWidth mul def\n\ 0 patternByteWidth imageByteWidth 1 sub {\n\ /x exch def\n\ imageString imageRow x add patternRowString putinterval\n\ } for\n\ } for\n", "imageString\n\ end\n\ } dup 0 12 dict put def\n\ \n\ /min {\n\ dup 3 2 roll dup 4 3 roll lt { exch } if pop\n\ } def\n\ \n\ /max {\n\ dup 3 2 roll dup 4 3 roll gt { exch } if pop\n\ } def\n\ \n\ /midpoint {\n\ 0 begin\n\ /y1 exch def\n\ /x1 exch def\n\ /y0 exch def\n\ /x0 exch def\n\ x0 x1 add 2 div\n\ y0 y1 add 2 div\n\ end\n\ } dup 0 4 dict put def\n\ \n", "/thirdpoint {\n\ 0 begin\n\ /y1 exch def\n\ /x1 exch def\n\ /y0 exch def\n\ /x0 exch def\n", "x0 2 mul x1 add 3 div\n\ y0 2 mul y1 add 3 div\n\ end\n\ } dup 0 4 dict put def\n\ \n\ /subspline {\n\ 0 begin\n\ /movetoNeeded exch def\n\ y exch get /y3 exch def\n\ x exch get /x3 exch def\n\ y exch get /y2 exch def\n\ x exch get /x2 exch def\n\ y exch get /y1 exch def\n\ x exch get /x1 exch def\n\ y exch get /y0 exch def\n\ x exch get /x0 exch def\n\ x1 y1 x2 y2 thirdpoint\n\ /p1y exch def\n\ /p1x exch def\n\ x2 y2 x1 y1 thirdpoint\n\ /p2y exch def\n\ /p2x exch def\n", "x1 y1 x0 y0 thirdpoint\n\ p1x p1y midpoint\n\ /p0y exch def\n\ /p0x exch def\n\ x2 y2 x3 y3 thirdpoint\n\ p2x p2y midpoint\n\ /p3y exch def\n\ /p3x exch def\n\ movetoNeeded { p0x p0y moveto } if\n\ p1x p1y p2x p2y p3x p3y curveto\n\ end\n\ } dup 0 17 dict put def\n\ \n\ /storexyn {\n\ /n exch def\n\ /y n array def\n\ /x n array def\n\ n 1 sub -1 0 {\n\ /i exch def\n\ y i 3 2 roll put\n\ x i 3 2 roll put\n\ } for\n\ } def\n\ \n", "/arrowhead {\n\ 0 begin\n\ transform originalCTM itransform\n", "/taily exch def\n\ /tailx exch def\n\ transform originalCTM itransform\n\ /tipy exch def\n\ /tipx exch def\n\ /dy tipy taily sub def\n\ /dx tipx tailx sub def\n\ /angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def\n\ gsave\n\ originalCTM setmatrix\n\ tipx tipy translate\n\ angle rotate\n\ newpath\n\ arrowHeight neg arrowWidth 2 div moveto\n\ 0 0 lineto\n\ arrowHeight neg arrowWidth 2 div neg lineto\n\ patternNone not {\n\ originalCTM setmatrix\n", "/padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul\n\ arrowWidth div def\n\ /padtail brushWidth 2 div def\n\ tipx tipy translate\n\ angle rotate\n\ padtip 0 translate\n\ arrowHeight padtip add padtail add arrowHeight div dup scale\n\ arrowheadpath\n\ ifill\n\ } if\n\ brushNone not {\n\ originalCTM setmatrix\n\ tipx tipy translate\n\ angle rotate\n\ arrowheadpath\n\ istroke\n\ } if\n\ grestore\n\ end\n\ } dup 0 9 dict put def\n\ \n", "/arrowheadpath {\n\ newpath\n\ arrowHeight neg arrowWidth 2 div moveto\n\ 0 0 lineto\n\ arrowHeight neg arrowWidth 2 div neg lineto\n\ } def\n\ \n\ /leftarrow {\n\ 0 begin\n\ y exch get /taily exch def\n\ x exch get /tailx exch def\n\ y exch get /tipy exch def\n\ x exch get /tipx exch def\n\ brushLeftArrow { tipx tipy tailx taily arrowhead } if\n\ end\n\ } dup 0 4 dict put def\n\ \n", "/rightarrow {\n\ 0 begin\n\ y exch get /tipy exch def\n\ x exch get /tipx exch def\n\ y exch get /taily exch def\n\ x exch get /tailx exch def\n\ brushRightArrow { tipx tipy tailx taily arrowhead } if\n\ end\n\ } dup 0 4 dict put def\n", ""}; plotutils-2.6/libplot/x_afftext.h0000644000175000017500000000552711037243262014160 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This is a header file for the XAffText module, which was originally independent of libplot. The module is in x_afftext.c. It may be used independently of libplot. To use the module independently of libplot, simply do not specify "-DLIBPLOT" at compile time. The module supplies two external functions, which are generalizations of the core X11 function XDrawString: XAffDrawRotString and XAffDrawAffString. They draw, respectively, a rotated text string and (more generally) a matrix-transformed text string, using a specified core X font. The rotation angle and transformation matrix are specified by the user. The matrix is passed as a 4-element array, with the element ordering convention, and sign conventions, being those of the Matrix XLFD extension. `XAffText' is an abbreviation of `X11 affinely transformed text'. The module was inspired by Alan Richardson's xvertext module for displaying rotated text strings in X11, using the core X fonts. It works in a similar way. (It retrieves a bitmap from the X server into an XImage, transforms the XImage, monochrome pixel by pixel, and sends it back to a bitmap on the server, for use as a stipple.) But it supports arbitrary transformation matrices, and pays extra attention to pixel-level accuracy. It uses integer arithmetic when possible. */ #include #ifdef LIBPLOT /* Change the names of the two external functions of the module by prepending "_x_" to them, for consistency with other internal (but externally visible) X11-related functions in libplot. */ #define XAffDrawAffString _pl_XAffDrawAffString #define XAffDrawRotString _pl_XAffDrawRotString #endif extern int XAffDrawAffString (Display *dpy, Drawable drawable, GC gc, XFontStruct *font, int x, int y, double a[4], const char *text); extern int XAffDrawRotString (Display *dpy, Drawable drawable, GC gc, XFontStruct *font, int x, int y, double angle, const char *text); plotutils-2.6/libplot/Makefile.am0000644000175000017500000002466311233730342014053 00000000000000## Makefile.am for plotutils/libplot. lib_LTLIBRARIES = libplot.la EXTRA_DIST = DEDICATION HUMOR README-cgm README-gif README-hpgl README-tek VERSION libplot_la_LDFLAGS = -version-info 4:4:2 INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT MISRC = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c \ mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c mi_plypnt.c \ mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c mi_version.c GSRC = g_affine.c g_alabel.c g_alab_her.c g_arc.c g_attrib.c g_bez.c \ g_box.c g_circ.c g_clipper.c g_closepl.c g_colors.c g_cntrlify.c g_dash.c \ g_dash2.c g_defplot.c g_defstate.c g_ellipse.c g_endpath.c g_error.c \ g_erase.c g_flushpl.c g_font.c g_fontdb.c g_fontd2.c g_havecap.c \ g_her_glyph.c g_integer.c g_line.c g_linewidth.c g_mark.c g_matrix.c \ g_miscmi.c g_move.c g_openpl.c g_outbuf.c g_outfile.c g_pagetype.c \ g_param.c g_param2.c g_path.c g_pentype.c g_point.c g_relative.c g_range.c \ g_retrieve.c g_savestate.c g_space.c g_subpaths.c g_vector.c g_version.c \ g_write.c g_xmalloc.c g_xstring.c MSRC = m_attribs.c m_closepl.c m_defplot.c m_emit.c m_erase.c m_mark.c \ m_openpl.c m_path.c m_point.c m_text.c BSRC = b_closepl.c b_defplot.c b_erase.c b_openpl.c b_path.c b_point.c RSRC = r_attribs.c r_closepl.c r_color.c r_defplot.c r_erase.c r_openpl.c \ r_path.c r_point.c TSRC = t_attribs.c t_closepl.c t_color.c t_color2.c t_defplot.c t_erase.c \ t_openpl.c t_path.c t_point.c t_tek_md.c t_tek_mv.c t_tek_vec.c HSRC = h_attribs.c h_closepl.c h_color.c h_defplot.c h_erase.c h_font.c \ h_openpl.c h_path.c h_point.c h_text.c FSRC = f_closepl.c f_color.c f_color2.c f_defplot.c f_erase.c f_openpl.c \ f_path.c f_point.c f_retrieve.c f_text.c CSRC = c_attribs.c c_closepl.c c_color.c c_defplot.c c_emit.c c_erase.c \ c_mark.c c_openpl.c c_path.c c_point.c c_text.c PSRC = p_closepl.c p_color.c p_color2.c p_defplot.c p_erase.c p_openpl.c \ p_path.c p_point.c p_text.c ASRC = a_attribs.c a_color.c a_closepl.c a_defplot.c a_erase.c a_openpl.c \ a_path.c a_point.c a_text.c SSRC = s_closepl.c s_color.c s_defplot.c s_erase.c s_openpl.c s_path.c \ s_point.c s_text.c ISRC = i_closepl.c i_color.c i_defplot.c i_erase.c i_openpl.c i_path.c \ i_point.c i_rle.c NSRC = n_defplot.c n_write.c ZSRC = z_defplot.c z_write.c XSRC = x_afftext.c x_attribs.c x_closepl.c x_color.c x_defplot.c x_erase.c x_flushpl.c \ x_openpl.c x_path.c x_point.c x_retrieve.c x_savestate.c x_text.c YSRC = y_closepl.c y_defplot.c y_erase.c y_openpl.c if NO_PNG if NO_X ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ $(ASRC) $(SSRC) $(ISRC) $(NSRC) else ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ $(ASRC) $(SSRC) $(ISRC) $(NSRC) $(XSRC) $(YSRC) endif else if NO_X ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ $(ASRC) $(SSRC) $(ISRC) $(NSRC) $(ZSRC) else ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ $(ASRC) $(SSRC) $(ISRC) $(NSRC) $(ZSRC) $(XSRC) $(YSRC) endif endif EXTRA_libplot_la_SOURCES = x_afftext.c x_attribs.c x_closepl.c x_color.c x_defplot.c \ x_erase.c x_flushpl.c x_openpl.c x_path.c x_point.c x_retrieve.c \ x_savestate.c x_text.c y_closepl.c y_defplot.c y_erase.c y_openpl.c libplot_la_SOURCES = apinewc.c apioldc.c apioldcc.c $(ALLSRC) MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \ mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h noinst_HEADERS = extern.h g_arc.h g_colorname.h g_control.h g_cntrlify.h \ g_her_metr.h g_jis.h g_pagetype.h h_roman8.h i_rle.h p_header.h x_afftext.h \ $(MIHEADERS) CLEANFILES = $(MISRC) $(MIHEADERS) if NO_PNG if NO_X libplot_la_LIBADD = else libplot_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) $(X_PRE_LIBS) $(X_BASIC_LIBS) $(X_EXTRA_LIBS) endif else if NO_X libplot_la_LIBADD = -lpng -lz else libplot_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) $(X_PRE_LIBS) $(X_BASIC_LIBS) $(X_EXTRA_LIBS) -lpng -lz endif endif ## execute the following command in ../libxmi to produce the commands ## that follow ##(for i in mi_*.c; do echo "$i": "\$(top_srcdir)/libxmi/$i"; echo " rm -f $i"" ; if \$(LN_S) \$(top_srcdir)/libxmi/$i $i"" ; then true ; else cp -p \$(top_srcdir)/libxmi/$i $i"" ; fi"; echo; done) mi_alloc.c: $(top_srcdir)/libxmi/mi_alloc.c $(MIHEADERS) @rm -f mi_alloc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_alloc.c mi_alloc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_alloc.c mi_alloc.c ; fi mi_api.c: $(top_srcdir)/libxmi/mi_api.c $(MIHEADERS) @rm -f mi_api.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_api.c mi_api.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_api.c mi_api.c ; fi mi_arc.c: $(top_srcdir)/libxmi/mi_arc.c $(MIHEADERS) @rm -f mi_arc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_arc.c mi_arc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_arc.c mi_arc.c ; fi mi_canvas.c: $(top_srcdir)/libxmi/mi_canvas.c $(MIHEADERS) @rm -f mi_canvas.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_canvas.c mi_canvas.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_canvas.c mi_canvas.c ; fi mi_fllarc.c: $(top_srcdir)/libxmi/mi_fllarc.c $(MIHEADERS) @rm -f mi_fllarc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_fllarc.c mi_fllarc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fllarc.c mi_fllarc.c ; fi mi_fllrct.c: $(top_srcdir)/libxmi/mi_fllrct.c $(MIHEADERS) @rm -f mi_fllrct.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_fllrct.c mi_fllrct.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fllrct.c mi_fllrct.c ; fi mi_fplycon.c: $(top_srcdir)/libxmi/mi_fplycon.c $(MIHEADERS) @rm -f mi_fplycon.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_fplycon.c mi_fplycon.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fplycon.c mi_fplycon.c ; fi mi_gc.c: $(top_srcdir)/libxmi/mi_gc.c $(MIHEADERS) @rm -f mi_gc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_gc.c mi_gc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_gc.c mi_gc.c ; fi mi_ply.c: $(top_srcdir)/libxmi/mi_ply.c $(MIHEADERS) @rm -f mi_ply.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_ply.c mi_ply.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_ply.c mi_ply.c ; fi mi_plycon.c: $(top_srcdir)/libxmi/mi_plycon.c $(MIHEADERS) @rm -f mi_plycon.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plycon.c mi_plycon.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plycon.c mi_plycon.c ; fi mi_plygen.c: $(top_srcdir)/libxmi/mi_plygen.c $(MIHEADERS) @rm -f mi_plygen.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plygen.c mi_plygen.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plygen.c mi_plygen.c ; fi mi_plypnt.c: $(top_srcdir)/libxmi/mi_plypnt.c $(MIHEADERS) @rm -f mi_plypnt.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plypnt.c mi_plypnt.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plypnt.c mi_plypnt.c ; fi mi_plyutil.c: $(top_srcdir)/libxmi/mi_plyutil.c $(MIHEADERS) @rm -f mi_plyutil.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plyutil.c mi_plyutil.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plyutil.c mi_plyutil.c ; fi mi_spans.c: $(top_srcdir)/libxmi/mi_spans.c $(MIHEADERS) @rm -f mi_spans.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_spans.c mi_spans.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_spans.c mi_spans.c ; fi mi_widelin.c: $(top_srcdir)/libxmi/mi_widelin.c $(MIHEADERS) @rm -f mi_widelin.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_widelin.c mi_widelin.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_widelin.c mi_widelin.c ; fi mi_zerarc.c: $(top_srcdir)/libxmi/mi_zerarc.c $(MIHEADERS) @rm -f mi_zerarc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_zerarc.c mi_zerarc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_zerarc.c mi_zerarc.c ; fi mi_zerolin.c: $(top_srcdir)/libxmi/mi_zerolin.c $(MIHEADERS) @rm -f mi_zerolin.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_zerolin.c mi_zerolin.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_zerolin.c mi_zerolin.c ; fi mi_version.c: $(top_srcdir)/libxmi/mi_version.c $(MIHEADERS) @rm -f mi_version.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_version.c mi_version.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_version.c mi_version.c ; fi ## execute the following command in ../libxmi to produce the commands ## that follow ## (for i in mi_*.h; do echo "$i": "\$(top_srcdir)/libxmi/$i"; echo " @rm -f $i"" ; if \$(LN_S) \$(top_srcdir)/libxmi/$i $i"" ; then true ; else cp -p \$(top_srcdir)/libxmi/$i $i"" ; fi"; echo; done) xmi.h: $(top_srcdir)/libxmi/xmi.h @rm -f xmi.h ; if $(LN_S) $(top_srcdir)/libxmi/xmi.h xmi.h ; then true ; else cp -p $(top_srcdir)/libxmi/xmi.h xmi.h ; fi mi_api.h: $(top_srcdir)/libxmi/mi_api.h @rm -f mi_api.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_api.h mi_api.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_api.h mi_api.h ; fi mi_arc.h: $(top_srcdir)/libxmi/mi_arc.h @rm -f mi_arc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_arc.h mi_arc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_arc.h mi_arc.h ; fi mi_fllarc.h: $(top_srcdir)/libxmi/mi_fllarc.h @rm -f mi_fllarc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_fllarc.h mi_fllarc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fllarc.h mi_fllarc.h ; fi mi_fply.h: $(top_srcdir)/libxmi/mi_fply.h @rm -f mi_fply.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_fply.h mi_fply.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fply.h mi_fply.h ; fi mi_gc.h: $(top_srcdir)/libxmi/mi_gc.h @rm -f mi_gc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_gc.h mi_gc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_gc.h mi_gc.h ; fi mi_line.h: $(top_srcdir)/libxmi/mi_line.h @rm -f mi_line.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_line.h mi_line.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_line.h mi_line.h ; fi mi_ply.h: $(top_srcdir)/libxmi/mi_ply.h @rm -f mi_ply.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_ply.h mi_ply.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_ply.h mi_ply.h ; fi mi_scanfill.h: $(top_srcdir)/libxmi/mi_scanfill.h @rm -f mi_scanfill.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_scanfill.h mi_scanfill.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_scanfill.h mi_scanfill.h ; fi mi_spans.h: $(top_srcdir)/libxmi/mi_spans.h @rm -f mi_spans.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_spans.h mi_spans.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_spans.h mi_spans.h ; fi mi_widelin.h: $(top_srcdir)/libxmi/mi_widelin.h @rm -f mi_widelin.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_widelin.h mi_widelin.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_widelin.h mi_widelin.h ; fi mi_zerarc.h: $(top_srcdir)/libxmi/mi_zerarc.h @rm -f mi_zerarc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_zerarc.h mi_zerarc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_zerarc.h mi_zerarc.h ; fi ##EOF plotutils-2.6/libplot/Makefile.in0000644000175000017500000013346611234210074014062 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libplot DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = @NO_PNG_FALSE@@NO_X_FALSE@libplot_la_DEPENDENCIES = \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) @NO_PNG_TRUE@@NO_X_FALSE@libplot_la_DEPENDENCIES = \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__DEPENDENCIES_1) am__libplot_la_SOURCES_DIST = apinewc.c apioldc.c apioldcc.c \ mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c \ mi_fllrct.c mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c \ mi_plygen.c mi_plypnt.c mi_plyutil.c mi_spans.c mi_widelin.c \ mi_zerarc.c mi_zerolin.c mi_version.c g_affine.c g_alabel.c \ g_alab_her.c g_arc.c g_attrib.c g_bez.c g_box.c g_circ.c \ g_clipper.c g_closepl.c g_colors.c g_cntrlify.c g_dash.c \ g_dash2.c g_defplot.c g_defstate.c g_ellipse.c g_endpath.c \ g_error.c g_erase.c g_flushpl.c g_font.c g_fontdb.c g_fontd2.c \ g_havecap.c g_her_glyph.c g_integer.c g_line.c g_linewidth.c \ g_mark.c g_matrix.c g_miscmi.c g_move.c g_openpl.c g_outbuf.c \ g_outfile.c g_pagetype.c g_param.c g_param2.c g_path.c \ g_pentype.c g_point.c g_relative.c g_range.c g_retrieve.c \ g_savestate.c g_space.c g_subpaths.c g_vector.c g_version.c \ g_write.c g_xmalloc.c g_xstring.c b_closepl.c b_defplot.c \ b_erase.c b_openpl.c b_path.c b_point.c m_attribs.c \ m_closepl.c m_defplot.c m_emit.c m_erase.c m_mark.c m_openpl.c \ m_path.c m_point.c m_text.c t_attribs.c t_closepl.c t_color.c \ t_color2.c t_defplot.c t_erase.c t_openpl.c t_path.c t_point.c \ t_tek_md.c t_tek_mv.c t_tek_vec.c r_attribs.c r_closepl.c \ r_color.c r_defplot.c r_erase.c r_openpl.c r_path.c r_point.c \ h_attribs.c h_closepl.c h_color.c h_defplot.c h_erase.c \ h_font.c h_openpl.c h_path.c h_point.c h_text.c f_closepl.c \ f_color.c f_color2.c f_defplot.c f_erase.c f_openpl.c f_path.c \ f_point.c f_retrieve.c f_text.c c_attribs.c c_closepl.c \ c_color.c c_defplot.c c_emit.c c_erase.c c_mark.c c_openpl.c \ c_path.c c_point.c c_text.c p_closepl.c p_color.c p_color2.c \ p_defplot.c p_erase.c p_openpl.c p_path.c p_point.c p_text.c \ a_attribs.c a_color.c a_closepl.c a_defplot.c a_erase.c \ a_openpl.c a_path.c a_point.c a_text.c s_closepl.c s_color.c \ s_defplot.c s_erase.c s_openpl.c s_path.c s_point.c s_text.c \ i_closepl.c i_color.c i_defplot.c i_erase.c i_openpl.c \ i_path.c i_point.c i_rle.c n_defplot.c n_write.c z_defplot.c \ z_write.c x_afftext.c x_attribs.c x_closepl.c x_color.c \ x_defplot.c x_erase.c x_flushpl.c x_openpl.c x_path.c \ x_point.c x_retrieve.c x_savestate.c x_text.c y_closepl.c \ y_defplot.c y_erase.c y_openpl.c am__objects_1 = mi_alloc.lo mi_api.lo mi_arc.lo mi_canvas.lo \ mi_fllarc.lo mi_fllrct.lo mi_fplycon.lo mi_gc.lo mi_ply.lo \ mi_plycon.lo mi_plygen.lo mi_plypnt.lo mi_plyutil.lo \ mi_spans.lo mi_widelin.lo mi_zerarc.lo mi_zerolin.lo \ mi_version.lo am__objects_2 = g_affine.lo g_alabel.lo g_alab_her.lo g_arc.lo \ g_attrib.lo g_bez.lo g_box.lo g_circ.lo g_clipper.lo \ g_closepl.lo g_colors.lo g_cntrlify.lo g_dash.lo g_dash2.lo \ g_defplot.lo g_defstate.lo g_ellipse.lo g_endpath.lo \ g_error.lo g_erase.lo g_flushpl.lo g_font.lo g_fontdb.lo \ g_fontd2.lo g_havecap.lo g_her_glyph.lo g_integer.lo g_line.lo \ g_linewidth.lo g_mark.lo g_matrix.lo g_miscmi.lo g_move.lo \ g_openpl.lo g_outbuf.lo g_outfile.lo g_pagetype.lo g_param.lo \ g_param2.lo g_path.lo g_pentype.lo g_point.lo g_relative.lo \ g_range.lo g_retrieve.lo g_savestate.lo g_space.lo \ g_subpaths.lo g_vector.lo g_version.lo g_write.lo g_xmalloc.lo \ g_xstring.lo am__objects_3 = b_closepl.lo b_defplot.lo b_erase.lo b_openpl.lo \ b_path.lo b_point.lo am__objects_4 = m_attribs.lo m_closepl.lo m_defplot.lo m_emit.lo \ m_erase.lo m_mark.lo m_openpl.lo m_path.lo m_point.lo \ m_text.lo am__objects_5 = t_attribs.lo t_closepl.lo t_color.lo t_color2.lo \ t_defplot.lo t_erase.lo t_openpl.lo t_path.lo t_point.lo \ t_tek_md.lo t_tek_mv.lo t_tek_vec.lo am__objects_6 = r_attribs.lo r_closepl.lo r_color.lo r_defplot.lo \ r_erase.lo r_openpl.lo r_path.lo r_point.lo am__objects_7 = h_attribs.lo h_closepl.lo h_color.lo h_defplot.lo \ h_erase.lo h_font.lo h_openpl.lo h_path.lo h_point.lo \ h_text.lo am__objects_8 = f_closepl.lo f_color.lo f_color2.lo f_defplot.lo \ f_erase.lo f_openpl.lo f_path.lo f_point.lo f_retrieve.lo \ f_text.lo am__objects_9 = c_attribs.lo c_closepl.lo c_color.lo c_defplot.lo \ c_emit.lo c_erase.lo c_mark.lo c_openpl.lo c_path.lo \ c_point.lo c_text.lo am__objects_10 = p_closepl.lo p_color.lo p_color2.lo p_defplot.lo \ p_erase.lo p_openpl.lo p_path.lo p_point.lo p_text.lo am__objects_11 = a_attribs.lo a_color.lo a_closepl.lo a_defplot.lo \ a_erase.lo a_openpl.lo a_path.lo a_point.lo a_text.lo am__objects_12 = s_closepl.lo s_color.lo s_defplot.lo s_erase.lo \ s_openpl.lo s_path.lo s_point.lo s_text.lo am__objects_13 = i_closepl.lo i_color.lo i_defplot.lo i_erase.lo \ i_openpl.lo i_path.lo i_point.lo i_rle.lo am__objects_14 = n_defplot.lo n_write.lo am__objects_15 = z_defplot.lo z_write.lo am__objects_16 = x_afftext.lo x_attribs.lo x_closepl.lo x_color.lo \ x_defplot.lo x_erase.lo x_flushpl.lo x_openpl.lo x_path.lo \ x_point.lo x_retrieve.lo x_savestate.lo x_text.lo am__objects_17 = y_closepl.lo y_defplot.lo y_erase.lo y_openpl.lo @NO_PNG_FALSE@@NO_X_FALSE@am__objects_18 = $(am__objects_1) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_2) $(am__objects_3) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_4) $(am__objects_5) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_6) $(am__objects_7) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_8) $(am__objects_9) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_10) $(am__objects_11) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_12) $(am__objects_13) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_14) $(am__objects_15) \ @NO_PNG_FALSE@@NO_X_FALSE@ $(am__objects_16) $(am__objects_17) @NO_PNG_FALSE@@NO_X_TRUE@am__objects_18 = $(am__objects_1) \ @NO_PNG_FALSE@@NO_X_TRUE@ $(am__objects_2) $(am__objects_3) \ @NO_PNG_FALSE@@NO_X_TRUE@ $(am__objects_4) $(am__objects_5) \ @NO_PNG_FALSE@@NO_X_TRUE@ $(am__objects_6) $(am__objects_7) \ @NO_PNG_FALSE@@NO_X_TRUE@ $(am__objects_8) $(am__objects_9) \ @NO_PNG_FALSE@@NO_X_TRUE@ $(am__objects_10) $(am__objects_11) \ @NO_PNG_FALSE@@NO_X_TRUE@ $(am__objects_12) $(am__objects_13) \ @NO_PNG_FALSE@@NO_X_TRUE@ $(am__objects_14) $(am__objects_15) @NO_PNG_TRUE@@NO_X_FALSE@am__objects_18 = $(am__objects_1) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_2) $(am__objects_3) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_4) $(am__objects_5) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_6) $(am__objects_7) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_8) $(am__objects_9) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_10) $(am__objects_11) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_12) $(am__objects_13) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_14) $(am__objects_16) \ @NO_PNG_TRUE@@NO_X_FALSE@ $(am__objects_17) @NO_PNG_TRUE@@NO_X_TRUE@am__objects_18 = $(am__objects_1) \ @NO_PNG_TRUE@@NO_X_TRUE@ $(am__objects_2) $(am__objects_3) \ @NO_PNG_TRUE@@NO_X_TRUE@ $(am__objects_4) $(am__objects_5) \ @NO_PNG_TRUE@@NO_X_TRUE@ $(am__objects_6) $(am__objects_7) \ @NO_PNG_TRUE@@NO_X_TRUE@ $(am__objects_8) $(am__objects_9) \ @NO_PNG_TRUE@@NO_X_TRUE@ $(am__objects_10) $(am__objects_11) \ @NO_PNG_TRUE@@NO_X_TRUE@ $(am__objects_12) $(am__objects_13) \ @NO_PNG_TRUE@@NO_X_TRUE@ $(am__objects_14) am_libplot_la_OBJECTS = apinewc.lo apioldc.lo apioldcc.lo \ $(am__objects_18) libplot_la_OBJECTS = $(am_libplot_la_OBJECTS) libplot_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libplot_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libplot_la_SOURCES) $(EXTRA_libplot_la_SOURCES) DIST_SOURCES = $(am__libplot_la_SOURCES_DIST) \ $(EXTRA_libplot_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libplot.la EXTRA_DIST = DEDICATION HUMOR README-cgm README-gif README-hpgl README-tek VERSION libplot_la_LDFLAGS = -version-info 4:4:2 INCLUDES = $(X_CFLAGS) -I$(srcdir)/../include -DLIBPLOT MISRC = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c mi_fllrct.c \ mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c mi_plypnt.c \ mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c mi_version.c GSRC = g_affine.c g_alabel.c g_alab_her.c g_arc.c g_attrib.c g_bez.c \ g_box.c g_circ.c g_clipper.c g_closepl.c g_colors.c g_cntrlify.c g_dash.c \ g_dash2.c g_defplot.c g_defstate.c g_ellipse.c g_endpath.c g_error.c \ g_erase.c g_flushpl.c g_font.c g_fontdb.c g_fontd2.c g_havecap.c \ g_her_glyph.c g_integer.c g_line.c g_linewidth.c g_mark.c g_matrix.c \ g_miscmi.c g_move.c g_openpl.c g_outbuf.c g_outfile.c g_pagetype.c \ g_param.c g_param2.c g_path.c g_pentype.c g_point.c g_relative.c g_range.c \ g_retrieve.c g_savestate.c g_space.c g_subpaths.c g_vector.c g_version.c \ g_write.c g_xmalloc.c g_xstring.c MSRC = m_attribs.c m_closepl.c m_defplot.c m_emit.c m_erase.c m_mark.c \ m_openpl.c m_path.c m_point.c m_text.c BSRC = b_closepl.c b_defplot.c b_erase.c b_openpl.c b_path.c b_point.c RSRC = r_attribs.c r_closepl.c r_color.c r_defplot.c r_erase.c r_openpl.c \ r_path.c r_point.c TSRC = t_attribs.c t_closepl.c t_color.c t_color2.c t_defplot.c t_erase.c \ t_openpl.c t_path.c t_point.c t_tek_md.c t_tek_mv.c t_tek_vec.c HSRC = h_attribs.c h_closepl.c h_color.c h_defplot.c h_erase.c h_font.c \ h_openpl.c h_path.c h_point.c h_text.c FSRC = f_closepl.c f_color.c f_color2.c f_defplot.c f_erase.c f_openpl.c \ f_path.c f_point.c f_retrieve.c f_text.c CSRC = c_attribs.c c_closepl.c c_color.c c_defplot.c c_emit.c c_erase.c \ c_mark.c c_openpl.c c_path.c c_point.c c_text.c PSRC = p_closepl.c p_color.c p_color2.c p_defplot.c p_erase.c p_openpl.c \ p_path.c p_point.c p_text.c ASRC = a_attribs.c a_color.c a_closepl.c a_defplot.c a_erase.c a_openpl.c \ a_path.c a_point.c a_text.c SSRC = s_closepl.c s_color.c s_defplot.c s_erase.c s_openpl.c s_path.c \ s_point.c s_text.c ISRC = i_closepl.c i_color.c i_defplot.c i_erase.c i_openpl.c i_path.c \ i_point.c i_rle.c NSRC = n_defplot.c n_write.c ZSRC = z_defplot.c z_write.c XSRC = x_afftext.c x_attribs.c x_closepl.c x_color.c x_defplot.c x_erase.c x_flushpl.c \ x_openpl.c x_path.c x_point.c x_retrieve.c x_savestate.c x_text.c YSRC = y_closepl.c y_defplot.c y_erase.c y_openpl.c @NO_PNG_FALSE@@NO_X_FALSE@ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ @NO_PNG_FALSE@@NO_X_FALSE@$(ASRC) $(SSRC) $(ISRC) $(NSRC) $(ZSRC) $(XSRC) $(YSRC) @NO_PNG_FALSE@@NO_X_TRUE@ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ @NO_PNG_FALSE@@NO_X_TRUE@$(ASRC) $(SSRC) $(ISRC) $(NSRC) $(ZSRC) @NO_PNG_TRUE@@NO_X_FALSE@ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ @NO_PNG_TRUE@@NO_X_FALSE@$(ASRC) $(SSRC) $(ISRC) $(NSRC) $(XSRC) $(YSRC) @NO_PNG_TRUE@@NO_X_TRUE@ALLSRC = $(MISRC) $(GSRC) $(BSRC) $(MSRC) $(TSRC) $(RSRC) $(HSRC) $(FSRC) $(CSRC) $(PSRC) \ @NO_PNG_TRUE@@NO_X_TRUE@$(ASRC) $(SSRC) $(ISRC) $(NSRC) EXTRA_libplot_la_SOURCES = x_afftext.c x_attribs.c x_closepl.c x_color.c x_defplot.c \ x_erase.c x_flushpl.c x_openpl.c x_path.c x_point.c x_retrieve.c \ x_savestate.c x_text.c y_closepl.c y_defplot.c y_erase.c y_openpl.c libplot_la_SOURCES = apinewc.c apioldc.c apioldcc.c $(ALLSRC) MIHEADERS = xmi.h mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \ mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h noinst_HEADERS = extern.h g_arc.h g_colorname.h g_control.h g_cntrlify.h \ g_her_metr.h g_jis.h g_pagetype.h h_roman8.h i_rle.h p_header.h x_afftext.h \ $(MIHEADERS) CLEANFILES = $(MISRC) $(MIHEADERS) @NO_PNG_FALSE@@NO_X_FALSE@libplot_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) $(X_PRE_LIBS) $(X_BASIC_LIBS) $(X_EXTRA_LIBS) -lpng -lz @NO_PNG_FALSE@@NO_X_TRUE@libplot_la_LIBADD = -lpng -lz @NO_PNG_TRUE@@NO_X_FALSE@libplot_la_LIBADD = $(X_LIBS) $(X_TOOLKIT_LIBS) $(X_PRE_LIBS) $(X_BASIC_LIBS) $(X_EXTRA_LIBS) @NO_PNG_TRUE@@NO_X_TRUE@libplot_la_LIBADD = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libplot/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libplot/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libplot.la: $(libplot_la_OBJECTS) $(libplot_la_DEPENDENCIES) $(libplot_la_LINK) -rpath $(libdir) $(libplot_la_OBJECTS) $(libplot_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_attribs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/a_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apinewc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apioldc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apioldcc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/b_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_attribs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_emit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_mark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_color2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_retrieve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/f_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_affine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_alab_her.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_alabel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_arc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_attrib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_bez.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_box.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_circ.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_clipper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_cntrlify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_colors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_dash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_dash2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_defstate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_ellipse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_endpath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_flushpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_font.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_fontd2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_fontdb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_havecap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_her_glyph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_integer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_line.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_linewidth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_mark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_miscmi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_move.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_outbuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_outfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_pagetype.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_param.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_param2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_pentype.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_range.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_relative.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_retrieve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_savestate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_space.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_subpaths.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_vector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_xmalloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g_xstring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_attribs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_font.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i_rle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_attribs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_emit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_mark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_arc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_canvas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_fllarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_fllrct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_fplycon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_gc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_ply.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plycon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plygen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plypnt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plyutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_spans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_widelin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_zerarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_zerolin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/n_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/n_write.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_color2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_attribs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_attribs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_color2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_tek_md.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_tek_mv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_tek_vec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_afftext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_attribs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_color.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_flushpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_retrieve.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_savestate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x_text.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/y_closepl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/y_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/y_erase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/y_openpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/z_defplot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/z_write.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES mi_alloc.c: $(top_srcdir)/libxmi/mi_alloc.c $(MIHEADERS) @rm -f mi_alloc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_alloc.c mi_alloc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_alloc.c mi_alloc.c ; fi mi_api.c: $(top_srcdir)/libxmi/mi_api.c $(MIHEADERS) @rm -f mi_api.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_api.c mi_api.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_api.c mi_api.c ; fi mi_arc.c: $(top_srcdir)/libxmi/mi_arc.c $(MIHEADERS) @rm -f mi_arc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_arc.c mi_arc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_arc.c mi_arc.c ; fi mi_canvas.c: $(top_srcdir)/libxmi/mi_canvas.c $(MIHEADERS) @rm -f mi_canvas.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_canvas.c mi_canvas.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_canvas.c mi_canvas.c ; fi mi_fllarc.c: $(top_srcdir)/libxmi/mi_fllarc.c $(MIHEADERS) @rm -f mi_fllarc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_fllarc.c mi_fllarc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fllarc.c mi_fllarc.c ; fi mi_fllrct.c: $(top_srcdir)/libxmi/mi_fllrct.c $(MIHEADERS) @rm -f mi_fllrct.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_fllrct.c mi_fllrct.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fllrct.c mi_fllrct.c ; fi mi_fplycon.c: $(top_srcdir)/libxmi/mi_fplycon.c $(MIHEADERS) @rm -f mi_fplycon.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_fplycon.c mi_fplycon.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fplycon.c mi_fplycon.c ; fi mi_gc.c: $(top_srcdir)/libxmi/mi_gc.c $(MIHEADERS) @rm -f mi_gc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_gc.c mi_gc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_gc.c mi_gc.c ; fi mi_ply.c: $(top_srcdir)/libxmi/mi_ply.c $(MIHEADERS) @rm -f mi_ply.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_ply.c mi_ply.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_ply.c mi_ply.c ; fi mi_plycon.c: $(top_srcdir)/libxmi/mi_plycon.c $(MIHEADERS) @rm -f mi_plycon.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plycon.c mi_plycon.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plycon.c mi_plycon.c ; fi mi_plygen.c: $(top_srcdir)/libxmi/mi_plygen.c $(MIHEADERS) @rm -f mi_plygen.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plygen.c mi_plygen.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plygen.c mi_plygen.c ; fi mi_plypnt.c: $(top_srcdir)/libxmi/mi_plypnt.c $(MIHEADERS) @rm -f mi_plypnt.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plypnt.c mi_plypnt.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plypnt.c mi_plypnt.c ; fi mi_plyutil.c: $(top_srcdir)/libxmi/mi_plyutil.c $(MIHEADERS) @rm -f mi_plyutil.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_plyutil.c mi_plyutil.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_plyutil.c mi_plyutil.c ; fi mi_spans.c: $(top_srcdir)/libxmi/mi_spans.c $(MIHEADERS) @rm -f mi_spans.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_spans.c mi_spans.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_spans.c mi_spans.c ; fi mi_widelin.c: $(top_srcdir)/libxmi/mi_widelin.c $(MIHEADERS) @rm -f mi_widelin.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_widelin.c mi_widelin.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_widelin.c mi_widelin.c ; fi mi_zerarc.c: $(top_srcdir)/libxmi/mi_zerarc.c $(MIHEADERS) @rm -f mi_zerarc.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_zerarc.c mi_zerarc.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_zerarc.c mi_zerarc.c ; fi mi_zerolin.c: $(top_srcdir)/libxmi/mi_zerolin.c $(MIHEADERS) @rm -f mi_zerolin.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_zerolin.c mi_zerolin.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_zerolin.c mi_zerolin.c ; fi mi_version.c: $(top_srcdir)/libxmi/mi_version.c $(MIHEADERS) @rm -f mi_version.c ; if $(LN_S) $(top_srcdir)/libxmi/mi_version.c mi_version.c ; then true ; else cp -p $(top_srcdir)/libxmi/mi_version.c mi_version.c ; fi xmi.h: $(top_srcdir)/libxmi/xmi.h @rm -f xmi.h ; if $(LN_S) $(top_srcdir)/libxmi/xmi.h xmi.h ; then true ; else cp -p $(top_srcdir)/libxmi/xmi.h xmi.h ; fi mi_api.h: $(top_srcdir)/libxmi/mi_api.h @rm -f mi_api.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_api.h mi_api.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_api.h mi_api.h ; fi mi_arc.h: $(top_srcdir)/libxmi/mi_arc.h @rm -f mi_arc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_arc.h mi_arc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_arc.h mi_arc.h ; fi mi_fllarc.h: $(top_srcdir)/libxmi/mi_fllarc.h @rm -f mi_fllarc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_fllarc.h mi_fllarc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fllarc.h mi_fllarc.h ; fi mi_fply.h: $(top_srcdir)/libxmi/mi_fply.h @rm -f mi_fply.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_fply.h mi_fply.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_fply.h mi_fply.h ; fi mi_gc.h: $(top_srcdir)/libxmi/mi_gc.h @rm -f mi_gc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_gc.h mi_gc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_gc.h mi_gc.h ; fi mi_line.h: $(top_srcdir)/libxmi/mi_line.h @rm -f mi_line.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_line.h mi_line.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_line.h mi_line.h ; fi mi_ply.h: $(top_srcdir)/libxmi/mi_ply.h @rm -f mi_ply.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_ply.h mi_ply.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_ply.h mi_ply.h ; fi mi_scanfill.h: $(top_srcdir)/libxmi/mi_scanfill.h @rm -f mi_scanfill.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_scanfill.h mi_scanfill.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_scanfill.h mi_scanfill.h ; fi mi_spans.h: $(top_srcdir)/libxmi/mi_spans.h @rm -f mi_spans.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_spans.h mi_spans.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_spans.h mi_spans.h ; fi mi_widelin.h: $(top_srcdir)/libxmi/mi_widelin.h @rm -f mi_widelin.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_widelin.h mi_widelin.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_widelin.h mi_widelin.h ; fi mi_zerarc.h: $(top_srcdir)/libxmi/mi_zerarc.h @rm -f mi_zerarc.h ; if $(LN_S) $(top_srcdir)/libxmi/mi_zerarc.h mi_zerarc.h ; then true ; else cp -p $(top_srcdir)/libxmi/mi_zerarc.h mi_zerarc.h ; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: plotutils-2.6/libplot/COPYING0000644000175000017500000010437411037262561013055 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . plotutils-2.6/libplot/apinewc.c0000644000175000017500000002132111037243260013575 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file is specific to libplot, rather than libplotter. It defines the new (i.e., thread-safe) C API. The new C API contains wrappers around the operations that may be applied to any Plotter object, plus two additional functions (pl_newpl_r, pl_deletepl_r) that are specific to libplot. pl_newpl_r/pl_deletepl_r construct and destroy Plotter instances. Their names resemble the C++ operations `new' and `delete'. When a new Plotter of any type is constructed, the appropriate `default_init' structure, which contains function pointers, is copied into it. Then its `initialize' method is invoked. Before the Plotter is destroyed, its `terminate' method is invoked similarly. The C API also includes the functions pl_newplparams/pl_deleteplparams, which create/destroy PlotterParams instances, and wrappers around the methods that may be applied to any PlotterParams object. A pointer to a PlotterParams object is passed to pl_newpl_r(). It specifies the device-driver parameters of the Plotter that will be created. */ #include "sys-defines.h" #include "extern.h" #include "plot.h" /* header file for C API */ /* Known Plotter types, indexed into by a short mnemonic case-insensitive string: "generic"=generic (i.e. base Plotter class), "bitmap"=bitmap, "meta"=metafile, "tek"=Tektronix, "regis"=ReGIS, "hpgl"=HP-GL/2, "pcl"=PCL 5, "fig"=xfig, "cgm"=CGM, "ps"=PS, "ai"="AI", "svg"=SVG, "gif"=GIF, "pnm"=PNM (i.e. PBM/PGM/PPM), "z"=PNG, "X"=X11, "Xdrawable"=X11Drawable. */ typedef struct { const char *name; const Plotter *default_init; } Plotter_data; /* Initializations for the function-pointer part of each type of Plotter. Each of the initializing structures listed here is defined in the corresponding ?_defplot.c file. */ static const Plotter_data _plotter_data[] = { {"generic", &_pl_g_default_plotter}, {"bitmap", &_pl_b_default_plotter}, {"meta", &_pl_m_default_plotter}, {"tek", &_pl_t_default_plotter}, {"regis", &_pl_r_default_plotter}, {"hpgl", &_pl_h_default_plotter}, {"pcl", &_pl_q_default_plotter}, {"fig", &_pl_f_default_plotter}, {"cgm", &_pl_c_default_plotter}, {"ps", &_pl_p_default_plotter}, {"ai", &_pl_a_default_plotter}, {"svg", &_pl_s_default_plotter}, {"gif", &_pl_i_default_plotter}, {"pnm", &_pl_n_default_plotter}, #ifdef INCLUDE_PNG_SUPPORT {"png", &_pl_z_default_plotter}, #endif #ifndef X_DISPLAY_MISSING {"Xdrawable", &_pl_x_default_plotter}, {"X", &_pl_y_default_plotter}, #endif /* not X_DISPLAY_MISSING */ {(const char *)NULL, (const Plotter *)NULL} }; /* forward references */ static bool _string_to_plotter_data (const char *type, int *position); static void _api_warning (const char *msg); /* These are two user-callable functions that are specific to the new (i.e., thread-safe) C binding: pl_newpl_r, pl_deletepl_r. */ Plotter * pl_newpl_r (const char *type, FILE *infile, FILE *outfile, FILE *errfile, const PlotterParams *plotter_params) { bool found; int position; Plotter *_plotter; /* determine initialization for specified plotter type */ found = _string_to_plotter_data (type, &position); if (!found) { _api_warning ("ignoring request to create plotter of unknown type"); return NULL; } /* create Plotter, copy function pointers to it */ _plotter = (Plotter *)_pl_xmalloc (sizeof(Plotter)); memcpy (_plotter, _plotter_data[position].default_init, sizeof(Plotter)); /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); /* copy parameters to it */ _plotter->data->infp = infile; _plotter->data->outfp = outfile; _plotter->data->errfp = errfile; _pl_g_copy_params_to_plotter (_plotter, plotter_params); /* do any additional needed initializiations of the Plotter (e.g., initialize data members of the PlotterData structure in a device-dependent way); also add the Plotter to the _plotters[] array */ _plotter->initialize (_plotter); return _plotter; } /* utility function, used above; keys into table of Plotter types by a short mnemonic string */ static bool _string_to_plotter_data (const char *type, int *position) { const Plotter_data *p = _plotter_data; bool found = false; int i = 0; /* search table of known plotter type mnemonics */ while (p->name) { if (strcasecmp ((char *)type, (char *)p->name) == 0) { found = true; break; } p++; i++; } /* return pointer to plotter data through pointer */ if (found) *position = i; return found; } int pl_deletepl_r (Plotter *_plotter) { if (_plotter == NULL) { _api_warning ("ignoring request to delete a null Plotter"); return -1; } /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (_plotter); /* Invoke an internal Plotter method before deletion. At a minimum, this private `terminate' method, frees instance-specific copies of class parameters, and also removes the pointer to the Plotter instance from the _plotters[] array. Also, it writes any unwritten graphics to the Plotter's output stream. This is the case for PSPlotters in particular, which write graphics only when they are deleted. For a PSPlotter, the terminate method emits the Plotter's pages of graphics to its output stream and then deallocates associated storage. For an XPlotter, this method kills the forked-off processes that are maintaining its popped-up windows (if any), provided that the VANISH_ON_DELETE parameter is set. */ _plotter->terminate (_plotter); /* tear down the PlotterData structure */ free (_plotter->data); /* tear down the Plotter itself */ free (_plotter); return 0; } /* function used in this file to print warning messages */ static void _api_warning (const char *msg) { if (pl_libplot_warning_handler != NULL) (*pl_libplot_warning_handler)(msg); else fprintf (stderr, "libplot: %s\n", msg); } /* These are two user-callable functions that are specific to the new (i.e., thread-safe) C binding: pl_newplparams, pl_deleteplparams, pl_copyplparams. */ PlotterParams * pl_newplparams (void) { int i; PlotterParams *_plotter_params_p; /* create PlotterParams, copy function pointers to it */ _plotter_params_p = (PlotterParams *)_pl_xmalloc (sizeof(PlotterParams)); memcpy (_plotter_params_p, &_default_plotter_params, sizeof(PlotterParams)); /* null out all parameters */ for (i = 0; i < NUM_PLOTTER_PARAMETERS; i++) _plotter_params_p->plparams[i] = (void *)NULL; return _plotter_params_p; } int pl_deleteplparams (PlotterParams *_plotter_params_p) { int i; /* free all copied strings, and the structure itself */ for (i = 0; i < NUM_PLOTTER_PARAMETERS; i++) if (_known_params[i].is_string && _plotter_params_p->plparams[i] != NULL) free (_plotter_params_p->plparams[i]); free (_plotter_params_p); return 0; } PlotterParams * pl_copyplparams (const PlotterParams *_plotter_params_p) { int i; PlotterParams *new_plotter_params_p; /* create PlotterParams, copy function pointers to it */ new_plotter_params_p = (PlotterParams *)_pl_xmalloc (sizeof(PlotterParams)); memcpy (new_plotter_params_p, &_default_plotter_params, sizeof(PlotterParams)); /* copy all parameters */ for (i = 0; i < NUM_PLOTTER_PARAMETERS; i++) new_plotter_params_p->plparams[i] = _plotter_params_p->plparams[i]; return new_plotter_params_p; } /* The following are C wrappers around the public functions in the PlotterParams class. Together with the preceding functions, they are part of the new (i.e., thread-safe) C API. */ int pl_setplparam (PlotterParams *plotter_params, const char *parameter, void * value) { return plotter_params->setplparam (plotter_params, parameter, value); } /* END OF WRAPPERS AROUND PLOTTERPARAMS METHODS */ plotutils-2.6/libplot/apioldc.c0000644000175000017500000006417511037243260013600 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file is specific to libplot, rather than libplotter. It defines the `old' (i.e. non-thread-safe) C API. The old C API consists of wrappers around the methods that may be applied to any Plotter object. The old API also contains pl_newpl/pl_selectpl/pl_deletepl, which construct and destroy Plotter instances, and maintain the global variable `_old_api_plotter'. This is a pointer to a `currently selected' Plotter instance. It is positioned by calling pl_selectpl. Because of this global variable, the old C API is not thread-safe. In the new C API, which is thread-safe, each function in the API is passed a pointer to a Plotter as first argument. Even in the absence of multithreading, this is a cleaner approach. By convention, _old_api_plotter is initialized to point to a Plotter instance that sends output in metafile format to standard output. Initialization takes place when the first function in the old API is invoked. This convention is for compatibility with pre-GNU versions of libplot, which did not support pl_newpl/pl_select/pl_deletepl. The old C API also contains the pl_parampl function. This function is held in common with the old (non-thread-safe) C++ API, in which it is simply called parampl. It is defined in apioldcc.c. pl_parampl sets parameters in a global PlotterParams struct, a pointer to which is kept in the global variable `_old_api_global_plotter_params'. (See its definition and initialization in g_defplot.c.) This PlotterParams is used when any Plotter is created by pl_newpl. The presence of this global state is another reason why the old C API is not thread-safe. */ #include "sys-defines.h" #include "extern.h" #include "plot.h" /* header file for C API's */ /* Sparse array of pointers to the old API's Plotter instances, and the array size; also a distinguished Plotter pointer, through which the old API will act. */ static Plotter **_old_api_plotters = NULL; static int _old_api_plotters_len = 0; static Plotter *_old_api_plotter = NULL; /* initial size of _old_api_plotters[] */ #define INITIAL_PLOTTERS_LEN 4 /* default Plotter type (see list of supported types in the file devoted to the new C API) */ #ifndef DEFAULT_PLOTTER_TYPE #define DEFAULT_PLOTTER_TYPE "meta" #endif /* forward references */ static void _api_warning (const char *msg); static void _create_and_select_default_plotter (void); /* Expand the local array of Plotters to include a single Plotter, of default type; also, select that Plotter. When this is invoked, the array has zero size. */ static void _create_and_select_default_plotter (void) { int i; Plotter *default_plotter; /* create the default Plotter by invoking function in new API (make sure global PlotterParams struct, used by the old API, is set up first) */ if (_old_api_global_plotter_params == NULL) _old_api_global_plotter_params = pl_newplparams(); default_plotter = pl_newpl_r (DEFAULT_PLOTTER_TYPE, stdin, stdout, stderr, _old_api_global_plotter_params); /* initialize local array of Plotters */ _old_api_plotters = (Plotter **)_pl_xmalloc (INITIAL_PLOTTERS_LEN * sizeof(Plotter *)); for (i = 0; i < INITIAL_PLOTTERS_LEN; i++) _old_api_plotters[i] = (Plotter *)NULL; _old_api_plotters_len = INITIAL_PLOTTERS_LEN; /* place default Plotter in local array, and select it */ _old_api_plotters[0] = default_plotter; _old_api_plotter = default_plotter; } /* These are the 3 user-callable functions that are specific to the old C binding: newpl, selectpl, deletepl. */ /* user-callable */ int pl_newpl (const char *type, FILE *infile, FILE *outfile, FILE *errfile) { Plotter *new_plotter; bool open_slot; int i, j; if (_old_api_plotters_len == 0) /* initialize local array of Plotters, and install default Plotter as Plotter #0 */ _create_and_select_default_plotter (); /* create the default Plotter by invoking function in new API (make sure global PlotterParams struct, used by the old API, is set up first) */ if (_old_api_global_plotter_params == NULL) _old_api_global_plotter_params = pl_newplparams(); new_plotter = pl_newpl_r (type, infile, outfile, errfile, _old_api_global_plotter_params); /* ensure local array has an open slot (slot i) */ open_slot = false; for (i = 0; i < _old_api_plotters_len; i++) if (_old_api_plotters[i] == NULL) { open_slot = true; break; } if (!open_slot) /* expand array, clearing upper half */ { i = _old_api_plotters_len; _old_api_plotters = (Plotter **)_pl_xrealloc (_old_api_plotters, 2 * _old_api_plotters_len * sizeof (Plotter *)); for (j = _old_api_plotters_len; j < 2 * _old_api_plotters_len; j++) _old_api_plotters[j] = (Plotter *)NULL; _old_api_plotters_len *= 2; } /* place newly created Plotter in open slot */ _old_api_plotters[i] = new_plotter; /* return index of newly created Plotter */ return i; } /* user-callable, alters selected Plotter and returns index of the one that was previously selected */ int pl_selectpl (int handle) { int i; if (handle < 0 || handle >= _old_api_plotters_len || _old_api_plotters[handle] == NULL) { _api_warning ("ignoring request to select a nonexistent plotter"); return -1; } /* determine index of currently selected Plotter in _old_api_plotters[] */ for (i = 0; i < _old_api_plotters_len; i++) if (_old_api_plotters[i] == _old_api_plotter) break; /* select specified Plotter: alter value of the _old_api_plotter pointer */ _old_api_plotter = _old_api_plotters[handle]; /* return index of previously selected Plotter */ return i; } /* user-callable */ int pl_deletepl (int handle) { if (handle < 0 || handle >= _old_api_plotters_len || _old_api_plotters[handle] == NULL) { _api_warning ("ignoring request to delete a nonexistent plotter"); return -1; } if (_old_api_plotters[handle] == _old_api_plotter) { _api_warning ("ignoring request to delete currently selected plotter"); return -1; } /* delete Plotter by invoking function in new API */ pl_deletepl_r (_old_api_plotters[handle]); /* remove now-invalid pointer from local array */ _old_api_plotters[handle] = NULL; return 0; } /* function used in this file to print warning messages */ static void _api_warning (const char *msg) { if (pl_libplot_warning_handler != NULL) (*pl_libplot_warning_handler)(msg); else fprintf (stderr, "libplot: %s\n", msg); } /* The following are the C wrappers around the public functions in the Plotter class. Together with the three functions above (pl_newpl, pl_selectpl, pl_deletepl), and pl_parampl, they make up the old (non-thread-safe) libplot C API. Each binding tests whether _old_api_plotter is non-NULL, which determines whether the array of Plotter instances has been initialized. That is because it makes no sense to call these functions before the _old_api_plotter pointer points to a Plotter object. In fact, of the below functions, it really only makes sense to call openpl, havecap, or outfile [deprecated] before the Plotter array is initialized. Calling any other of the below functions before the Plotter array is initialized will generate an error message because even though the call to _create_and_select_default_plotter will initialize the Plotter array and select a default Plotter instance, the Plotter will not be open. No operation in the Plotter class, with the exception of the just-mentioned ones, may be invoked unless the Plotter that is being acted on is open. */ int pl_alabel (int x_justify, int y_justify, const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_alabel (_old_api_plotter, x_justify, y_justify, s); } int pl_arc (int xc, int yc, int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_arc (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_arcrel (int xc, int yc, int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_arcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_bezier2 (int xc, int yc, int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_bezier2 (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_bezier2rel (int xc, int yc, int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_bezier2rel (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_bezier3 (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_bezier3 (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3); } int pl_bezier3rel (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_bezier3rel (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3); } int pl_bgcolor (int red, int green, int blue) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_bgcolor (_old_api_plotter, red, green, blue); } int pl_bgcolorname (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_bgcolorname (_old_api_plotter, s); } int pl_box (int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_box (_old_api_plotter, x0, y0, x1, y1); } int pl_boxrel (int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_boxrel (_old_api_plotter, x0, y0, x1, y1); } int pl_capmod (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_capmod (_old_api_plotter, s); } int pl_circle (int x, int y, int r) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_circle (_old_api_plotter, x, y, r); } int pl_circlerel (int x, int y, int r) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_circlerel (_old_api_plotter, x, y, r); } int pl_closepath (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_closepath (_old_api_plotter); } int pl_closepl (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_closepl (_old_api_plotter); } int pl_color (int red, int green, int blue) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_color (_old_api_plotter, red, green, blue); } int pl_colorname (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_colorname (_old_api_plotter, s); } int pl_cont (int x, int y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_cont (_old_api_plotter, x, y); } int pl_contrel (int x, int y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_contrel (_old_api_plotter, x, y); } int pl_ellarc (int xc, int yc, int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ellarc (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_ellarcrel (int xc, int yc, int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ellarcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_ellipse (int x, int y, int rx, int ry, int angle) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ellipse (_old_api_plotter, x, y, rx, ry, angle); } int pl_ellipserel (int x, int y, int rx, int ry, int angle) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ellipserel (_old_api_plotter, x, y, rx, ry, angle); } int pl_endpath (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_endpath (_old_api_plotter); } int pl_endsubpath (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_endsubpath (_old_api_plotter); } int pl_erase (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_erase (_old_api_plotter); } int pl_farc (double xc, double yc, double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_farc (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_farcrel (double xc, double yc, double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_farcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_fbezier2 (double xc, double yc, double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fbezier2 (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_fbezier2rel (double xc, double yc, double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fbezier2rel (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_fbezier3 (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fbezier3 (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3); } int pl_fbezier3rel (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fbezier3rel (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3); } int pl_fbox (double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fbox (_old_api_plotter, x0, y0, x1, y1); } int pl_fboxrel (double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fboxrel (_old_api_plotter, x0, y0, x1, y1); } int pl_fcircle (double x, double y, double r) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fcircle (_old_api_plotter, x, y, r); } int pl_fcirclerel (double x, double y, double r) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fcirclerel (_old_api_plotter, x, y, r); } int pl_fconcat (double m0, double m1, double m2, double m3, double m4, double m5) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fconcat (_old_api_plotter, m0, m1, m2, m3, m4, m5); } int pl_fcont (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fcont (_old_api_plotter, x, y); } int pl_fcontrel (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fcontrel (_old_api_plotter, x, y); } int pl_fellarc (double xc, double yc, double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fellarc (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_fellarcrel (double xc, double yc, double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fellarcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1); } int pl_fellipse (double x, double y, double rx, double ry, double angle) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fellipse (_old_api_plotter, x, y, rx, ry, angle); } int pl_fellipserel (double x, double y, double rx, double ry, double angle) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fellipserel (_old_api_plotter, x, y, rx, ry, angle); } double pl_ffontname (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ffontname (_old_api_plotter, s); } double pl_ffontsize (double size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ffontsize (_old_api_plotter, size); } int pl_fillcolor (int red, int green, int blue) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fillcolor (_old_api_plotter, red, green, blue); } int pl_fillcolorname (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fillcolorname (_old_api_plotter, s); } int pl_fillmod (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fillmod (_old_api_plotter, s); } int pl_filltype (int level) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_filltype (_old_api_plotter, level); } double pl_flabelwidth (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_flabelwidth (_old_api_plotter, s); } int pl_fline (double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fline (_old_api_plotter, x0, y0, x1, y1); } int pl_flinedash (int n, const double *dashes, double offset) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_flinedash (_old_api_plotter, n, dashes, offset); } int pl_flinerel (double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_flinerel (_old_api_plotter, x0, y0, x1, y1); } int pl_flinewidth (double size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_flinewidth (_old_api_plotter, size); } int pl_flushpl (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_flushpl (_old_api_plotter); } int pl_fmarker (double x, double y, int type, double size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fmarker (_old_api_plotter, x, y, type, size); } int pl_fmarkerrel (double x, double y, int type, double size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fmarkerrel (_old_api_plotter, x, y, type, size); } int pl_fmiterlimit (double limit) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fmiterlimit (_old_api_plotter, limit); } int pl_fmove (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fmove (_old_api_plotter, x, y); } int pl_fmoverel (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fmoverel (_old_api_plotter, x, y); } int pl_fontname (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fontname (_old_api_plotter, s); } int pl_fontsize (int size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fontsize (_old_api_plotter, size); } int pl_fpoint (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fpoint (_old_api_plotter, x, y); } int pl_fpointrel (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fpointrel (_old_api_plotter, x, y); } int pl_frotate (double theta) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_frotate (_old_api_plotter, theta); } int pl_fscale (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fscale (_old_api_plotter, x, y); } int pl_fsetmatrix (double m0, double m1, double m2, double m3, double m4, double m5) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fsetmatrix (_old_api_plotter, m0, m1, m2, m3, m4, m5); } int pl_fspace (double x0, double y0, double x1, double y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fspace (_old_api_plotter, x0, y0, x1, y1); } int pl_fspace2 (double x0, double y0, double x1, double y1, double x2, double y2) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_fspace2 (_old_api_plotter, x0, y0, x1, y1, x2, y2); } double pl_ftextangle (double angle) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ftextangle (_old_api_plotter, angle); } int pl_ftranslate (double x, double y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_ftranslate (_old_api_plotter, x, y); } int pl_havecap (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_havecap (_old_api_plotter, s); } int pl_joinmod (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_joinmod (_old_api_plotter, s); } int pl_label (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_label (_old_api_plotter, s); } int pl_labelwidth (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_labelwidth (_old_api_plotter, s); } int pl_line (int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_line (_old_api_plotter, x0, y0, x1, y1); } int pl_linerel (int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_linerel (_old_api_plotter, x0, y0, x1, y1); } int pl_linewidth (int size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_linewidth (_old_api_plotter, size); } int pl_linedash (int n, const int *dashes, int offset) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_linedash (_old_api_plotter, n, dashes, offset); } int pl_linemod (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_linemod (_old_api_plotter, s); } int pl_marker (int x, int y, int type, int size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_marker (_old_api_plotter, x, y, type, size); } int pl_markerrel (int x, int y, int type, int size) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_markerrel (_old_api_plotter, x, y, type, size); } int pl_move (int x, int y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_move (_old_api_plotter, x, y); } int pl_moverel (int x, int y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_moverel (_old_api_plotter, x, y); } int pl_openpl (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_openpl (_old_api_plotter); } int pl_orientation (int direction) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_orientation (_old_api_plotter, direction); } FILE * pl_outfile (FILE *outfile) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_outfile (_old_api_plotter, outfile); } int pl_pencolor (int red, int green, int blue) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_pencolor (_old_api_plotter, red, green, blue); } int pl_pencolorname (const char *s) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_pencolorname (_old_api_plotter, s); } int pl_pentype (int level) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_pentype (_old_api_plotter, level); } int pl_point (int x, int y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_point (_old_api_plotter, x, y); } int pl_pointrel (int x, int y) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_pointrel (_old_api_plotter, x, y); } int pl_restorestate (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_restorestate (_old_api_plotter); } int pl_savestate (void) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_savestate (_old_api_plotter); } int pl_space (int x0, int y0, int x1, int y1) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_space (_old_api_plotter, x0, y0, x1, y1); } int pl_space2 (int x0, int y0, int x1, int y1, int x2, int y2) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_space2 (_old_api_plotter, x0, y0, x1, y1, x2, y2); } int pl_textangle (int angle) { if (_old_api_plotters_len == 0) _create_and_select_default_plotter (); return _API_textangle (_old_api_plotter, angle); } /* END OF WRAPPERS */ plotutils-2.6/libplot/apioldcc.c0000644000175000017500000000454211037243260013733 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file belongs to both libplot and libplotter. It contains a function that appears in both the old (non-thread-safe) C and C++ bindings. It is named pl_parampl() and parampl(), respectively. pl_parampl/parampl sets parameters in a global PlotterParams object, which is used as a source of parameters when any Plotter is created. The presence of this global state is one reason why the old API's are not thread-safe. In libplotter, parampl is a static function member of the Plotter class, as is the global PlotterParams. This is arranged by #ifdef's in extern.h. In both libplot and libplotter, the pointer to the global PlotterParams, which is called _old_api_global_plotter_params, is defined in g_defplot.c. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER #include "plot.h" /* header file for C API's */ #endif int #ifdef LIBPLOTTER parampl (const char *parameter, void *value) #else /* not LIBPLOTTER */ pl_parampl (const char *parameter, void *value) #endif { /* create global object if necessary (via different routes for libplotter and libplot; for latter, call a function in new C API) */ if (_old_api_global_plotter_params == NULL) #ifdef LIBPLOTTER _old_api_global_plotter_params = new PlotterParams; #else _old_api_global_plotter_params = pl_newplparams (); #endif return _old_api_global_plotter_params->setplparam (R___(_old_api_global_plotter_params) parameter, value); } plotutils-2.6/libplot/g_affine.c0000644000175000017500000000442711037243260013715 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the translate, rotate and scale methods, which are GNU extensions to libplot. They affect the affine transformation from user coordinates to device coordinates, as in Postscript. */ #include "sys-defines.h" #include "extern.h" int _API_ftranslate (R___(Plotter *_plotter) double x, double y) { double m0, m1, m2, m3, m4, m5; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "ftranslate: invalid operation"); return -1; } m0 = m3 = 1.0; m1 = m2 = 0.0; m4 = x; m5 = y; _API_fconcat (R___(_plotter) m0, m1, m2, m3, m4, m5); return 0; } int _API_frotate (R___(Plotter *_plotter) double theta) { double m0, m1, m2, m3, m4, m5; double radians = M_PI * theta / 180.0; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "frotate: invalid operation"); return -1; } m0 = m3 = cos (radians); m1 = sin (radians); m2 = - sin (radians); m4 = m5 = 0.0; _API_fconcat (R___(_plotter) m0, m1, m2, m3, m4, m5); return 0; } int _API_fscale (R___(Plotter *_plotter) double x, double y) { double m0, m1, m2, m3, m4, m5; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fscale: invalid operation"); return -1; } m0 = x; m3 = y; m1 = m2 = m4 = m5 = 0.0; _API_fconcat (R___(_plotter) m0, m1, m2, m3, m4, m5); return 0; } plotutils-2.6/libplot/g_alabel.c0000644000175000017500000013605711037243260013712 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the alabel method, which is a GNU extension to libplot. It draws a label, i.e. a text string, at the current location. Horizontal and vertical justification must be specified. ALABEL takes three arguments X_JUSTIFY, Y_JUSTIFY, and S, and places the label S according to the x and y axis adjustments specified in X_JUSTIFY and Y_JUSTIFY. X_JUSTIFY is equal to 'l', 'c', or 'r', signifying left-justified, centered, or right-justified, relative to the current position. Y_JUSTIFY is equal to 'b', 'x', 'c', or 't', signifying that the bottom, baseline, center, or top of the label should pass through the current position. */ /* This file contains the label method, which is a standard part of libplot (supplied for backward compatibility). It draws a label, i.e. a text string, at the current location of the graphics device cursor. It is obsoleted by the alabel method, which allows justification. */ /* This file also contains the labelwidth method, which is a GNU extension to libplot. It returns the width in user units of a label, i.e., a text string. */ #include "sys-defines.h" #include "extern.h" #include "g_control.h" #define SCRIPTSIZE 0.6 /* rel. size of subscripts/superscripts */ #define SUBSCRIPT_DX 0.0 #define SUBSCRIPT_DY (-0.2) #define SUPERSCRIPT_DX 0.0 #define SUPERSCRIPT_DY 0.375 /* font we use for symbol escapes if the current font is a user-specified one [for X Windows] that doesn't belong to any of our builtin typefaces */ #define SYMBOL_FONT "Symbol" /* Obsolete kludges to handle the zero-width marker symbols in our ArcMath and StickMath fonts; also zero-width overbar. N.B. `8' AND `17' ARE HARDCODED IN THE TABLE IN g_fontd2.c. */ #define ARCMATH 8 #define STICKMATH 17 #define IS_MATH_FONT(fontnum) ((fontnum) == ARCMATH || (fontnum) == STICKMATH) #define IS_CENTERED_SYMBOL(c) (((c) >= 'A' && (c) <= 'O') || (c) == 'e') /* forward references */ static unsigned char *esc_esc_string (const unsigned char *s); static bool simple_string (const unsigned short *codestring); static bool clean_iso_string (unsigned char *s); /* The flabelwidth() and falabel() methods. After checking for control characters in the input string (not allowed), we invoke either a Hershey-specific or a non-Hershey-specific method. */ int _API_alabel (R___(Plotter *_plotter) int x_justify, int y_justify, const char *s) { char *t; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "alabel: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ if (s == NULL) return 0; /* avoid core dumps */ /* copy because we may alter the string */ t = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (t, s); /* allow only character set in ISO encoding */ { bool was_clean; was_clean = clean_iso_string ((unsigned char *)t); if (!was_clean) _plotter->warning (R___(_plotter) "ignoring control character (e.g. CR or LF) in label"); } /* Be sure user-specified font has been retrieved. Font is changed by fontname/fontsize/textangle, all of which invoke _pl_g_set_font(), and by space/space2/concat, which may not. */ _pl_g_set_font (S___(_plotter)); if (_plotter->data->have_escaped_string_support) /* Plotter supports the display of labels natively, including the escape sequences that we use in labels for subscripts, superscripts, shifts among fonts, etc. Metafile Plotters are the only ones that are so powerful. Actually they just write the label, escape sequences and all, to the output stream. :-) */ _plotter->paint_text_string_with_escapes (R___(_plotter) (unsigned char *)t, x_justify, y_justify); else /* must parse escape sequences (if any) in label */ { if (_plotter->drawstate->font_type == PL_F_HERSHEY) /* call internal Hershey-specific routine to do the drawing, since any label in a Hershey font supports additional escape sequences */ _pl_g_alabel_hershey (R___(_plotter) (unsigned char *)t, x_justify, y_justify); else /* non-Hershey: use parsing routine below, which ultimately calls _plotter->paint_text_string to invoke Plotter-specific code */ _pl_g_render_non_hershey_string (R___(_plotter) t, true, x_justify, y_justify); } free (t); return 0; } int _API_label (R___(Plotter *_plotter) const char *s) { /* label should have baseline passing through current location, and should be left-justified */ return _API_alabel (R___(_plotter) 'l', 'x', s); } double _API_flabelwidth (R___(Plotter *_plotter) const char *s) { double width = 0.0; char *t; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "flabelwidth: invalid operation"); return -1; } if (s == NULL) return 0.0; /* avoid core dumps */ /* copy because we may alter the string */ t = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (t, s); /* allow only character set in ISO encoding */ { bool was_clean; was_clean = clean_iso_string ((unsigned char *)t); if (!was_clean) _plotter->warning (R___(_plotter) "ignoring control character (e.g. CR or LF) in label"); } /* Be sure user-specified font has been retrieved. Font is changed by fontname/fontsize/textangle, all of which invoke _pl_g_set_font(), and by space/space2/concat, which may not. */ _pl_g_set_font (S___(_plotter)); if (_plotter->drawstate->font_type == PL_F_HERSHEY) /* call Hershey-specific routine, since controlification acts slightly differently (a label in any Hershey font may contain more escape sequences than a label in a non-Hershey font) */ width = _pl_g_flabelwidth_hershey (R___(_plotter) (unsigned char *)t); else /* invoke routine below to compute width; final two args are ignored */ width = _pl_g_render_non_hershey_string (R___(_plotter) t, false, 'c', 'c'); free (t); return width; } /* The non-Hershey version of the falabel() and flabelwidth() methods (merged). They are distinguished by the do_render flag being true/false; the return values (the width of the string) are the same. The final two arguments, specifying justification, are relevant only if the do_render flag is `true'. If do_render is true, the string is rendered in accordance with the justification instructions, and the graphics cursor position is updated accordingly. */ /* We `controlify' the string, translating escape sequences to annotations, before passing it to a lower-level rendering routine. Note: for fonts of `OTHER' type [user-specified X Windows fonts], shifts between fonts within a single typeface are ignored, since we have no information on what the other fonts within the font's typeface are. The annotations simply indicate whether or not a symbol font should be switched to, for the purpose of symbol escapes. For fonts of `OTHER' type, font #1 means the user-specified font and font #0 means the symbol font. */ /* As noted, this version is invoked only if the current font is non-Hershey. But due to failure to retrieve an X font, it is possible that the font could switch to a Hershey font during rendering. So our lower-level rendering routine _pl_g_render_simple_string(), which this calls, may find itself invoked on a string to be rendered in a Hershey font. That's OK; it can handle it. */ /* This routine checks whether a Plotter can handle horizontal and vertical justification requests. If it can't, it does its own repositioning before invoking _pl_g_render_simple_string. */ /* ARGS: do_render = draw the string? */ double _pl_g_render_non_hershey_string (R___(Plotter *_plotter) const char *s, bool do_render, int x_justify, int y_justify) { int h_just = PL_JUST_LEFT; /* all devices can handle left justification */ int v_just = PL_JUST_BASE; unsigned short *codestring; unsigned short *cptr; double width = 0.0, added_width; double pushed_width = 0.0; /* pushed by user */ int current_font_index; /* initial values of these attributes (will be restored at end) */ double initial_font_size; const char *initial_font_name; int initial_font_type; /* initial and saved locations */ double initial_position_x = _plotter->drawstate->pos.x; double initial_position_y = _plotter->drawstate->pos.y; double pushed_position_x = _plotter->drawstate->pos.x; double pushed_position_y = _plotter->drawstate->pos.y; /* misc. */ char x_justify_c, y_justify_c; double x_offset, y_offset; double x_displacement = 1.0, x_displacement_internal = 1.0; double overall_width = 0.0; double cap_height, ascent, descent; double userdx, userdy, theta, sintheta = 0.0, costheta = 1.0; /* convert string to a codestring, including annotations */ codestring = _pl_g_controlify (R___(_plotter) (const unsigned char *)s); if (do_render) /* perform needed computations; reposition */ { /* compute label width in user units via a recursive call; final two args are ignored */ overall_width = _pl_g_render_non_hershey_string (R___(_plotter) s, false, 'c', 'c'); /* compute initial offsets that must be performed due to justification; also displacements that must be performed after rendering (see above)*/ x_justify_c = (char)x_justify; y_justify_c = (char)y_justify; switch (x_justify_c) { case 'l': /* left justified */ default: h_just = PL_JUST_LEFT; x_offset = 0.0; x_displacement = 1.0; x_displacement_internal = 1.0; /* range [0,1] */ break; case 'c': /* centered */ h_just = PL_JUST_CENTER; x_offset = -0.5; x_displacement = 0.0; x_displacement_internal = 0.0; /* range [-0.5,0.5] */ break; case 'r': /* right justified */ h_just = PL_JUST_RIGHT; x_offset = -1.0; x_displacement = -1.0; x_displacement_internal = -1.0; /* range [-1,0] */ break; } /* need these to compute offset for vertical justification */ cap_height = _plotter->drawstate->font_cap_height; ascent = _plotter->drawstate->font_ascent; descent = _plotter->drawstate->font_descent; switch (y_justify_c) /* placement of label with respect to y coordinate */ { case 'b': /* current point is at bottom */ v_just = PL_JUST_BOTTOM; y_offset = descent; break; case 'x': /* current point is on baseline */ default: v_just = PL_JUST_BASE; y_offset = 0.0; break; case 'c': /* current point midway between bottom, top */ v_just = PL_JUST_HALF; y_offset = 0.5 * (descent - ascent); break; case 'C': /* current point is on cap line */ v_just = PL_JUST_CAP; y_offset = - cap_height; break; case 't': /* current point is at top */ v_just = PL_JUST_TOP; y_offset = - ascent; break; } /* If codestring is a string in a single font, with no control codes, we'll render it using native device justification, rather than positioning a left-justified string by hand. So e.g., if right or centered justification was specified when alabel() was called by the user, the string as drawn on the device will have the same justification. This is particularly important for the Fig and AI drivers. Anything else would exasperate the user, even if the positioning is correct. */ if ((_plotter->drawstate->font_type == PL_F_HERSHEY || _plotter->data->have_horizontal_justification) && simple_string (codestring)) /* will use native justification, so don't perform initial offset */ x_offset = 0.0; else /* will use x_offset to position by hand */ { h_just = PL_JUST_LEFT; x_displacement_internal = 1.0; } /* Similarly, in simple cases use native vertical justification if it's available (very few types of Plotter support it). */ if ((_plotter->drawstate->font_type == PL_F_HERSHEY || _plotter->data->have_vertical_justification) && simple_string (codestring)) /* will use native justification, so don't perform initial offset */ y_offset = 0.0; else /* will use y_offset to position by hand */ v_just = PL_JUST_BASE; /* justification-related offsets we'll carry out */ userdx = x_offset * overall_width; userdy = y_offset; /* label rotation angle in radians */ theta = M_PI * _plotter->drawstate->text_rotation / 180.0; sintheta = sin (theta); costheta = cos (theta); /* perform both horizontal and vertical offsets; after this, current point will be on intended baseline of label */ _plotter->drawstate->pos.x += costheta * userdx - sintheta * userdy; _plotter->drawstate->pos.y += sintheta * userdx + costheta * userdy; } /* save font name (will be restored at end) */ { char *font_name; initial_font_name = _plotter->drawstate->font_name; font_name = (char *)_pl_xmalloc (1 + strlen (initial_font_name)); strcpy (font_name, initial_font_name); _plotter->drawstate->font_name = font_name; } /* save font size too */ initial_font_size = _plotter->drawstate->font_size; /* also save the font type, since for fonts of type PL_F_OTHER (e.g., user-specified X Windows fonts not in our tables), switching fonts between substrings, e.g. to use the X Windows symbol font, may inconveniently switch _plotter->drawstate->font_type on us */ initial_font_type = _plotter->drawstate->font_type; /* initialize current font index (font type presumably is not Hershey) */ switch (_plotter->drawstate->font_type) { case PL_F_HERSHEY: current_font_index = (_pl_g_hershey_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; break; case PL_F_POSTSCRIPT: current_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; break; case PL_F_PCL: current_font_index = (_pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; break; case PL_F_STICK: current_font_index = (_pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; break; case PL_F_OTHER: current_font_index = 1; /* `1' just means the font we start out with */ break; default: /* shouldn't happen */ return 0.0; } /* now loop through codestring, parsing each code in succession; when shifting to subscripts/superscripts we change the nominal font size, and retrieve a new font */ cptr = codestring; while (*cptr) /* end when (unsigned short)0 is seen */ { unsigned short c; c = *cptr; if (c & CONTROL_CODE) /* parse control code; many possibilities */ { switch (c & ~CONTROL_CODE) { case C_BEGIN_SUBSCRIPT: width += SUBSCRIPT_DX * _plotter->drawstate->true_font_size; if (do_render) { _plotter->drawstate->pos.x += (costheta * SUBSCRIPT_DX - sintheta * SUBSCRIPT_DY) * _plotter->drawstate->true_font_size; _plotter->drawstate->pos.y += (sintheta * SUBSCRIPT_DX + costheta * SUBSCRIPT_DY) * _plotter->drawstate->true_font_size; } _plotter->drawstate->font_size *= SCRIPTSIZE; _pl_g_set_font (S___(_plotter)); break; case C_BEGIN_SUPERSCRIPT : width += SUPERSCRIPT_DX * _plotter->drawstate->true_font_size; if (do_render) { _plotter->drawstate->pos.x += (costheta * SUPERSCRIPT_DX - sintheta * SUPERSCRIPT_DY) * _plotter->drawstate->true_font_size; _plotter->drawstate->pos.y += (sintheta * SUPERSCRIPT_DX + costheta * SUPERSCRIPT_DY) * _plotter->drawstate->true_font_size; } _plotter->drawstate->font_size *= SCRIPTSIZE; _pl_g_set_font (S___(_plotter)); break; case C_END_SUBSCRIPT: width -= SUBSCRIPT_DX * _plotter->drawstate->true_font_size; _plotter->drawstate->font_size /= SCRIPTSIZE; _pl_g_set_font (S___(_plotter)); if (do_render) { (_plotter->drawstate->pos).x -= (costheta * SUBSCRIPT_DX - sintheta * SUBSCRIPT_DY) * _plotter->drawstate->true_font_size; (_plotter->drawstate->pos).y -= (sintheta * SUBSCRIPT_DX + costheta * SUBSCRIPT_DY) * _plotter->drawstate->true_font_size; } break; case C_END_SUPERSCRIPT: width -= SUPERSCRIPT_DX * _plotter->drawstate->true_font_size; _plotter->drawstate->font_size /= SCRIPTSIZE; _pl_g_set_font (S___(_plotter)); if (do_render) { (_plotter->drawstate->pos).x -= (costheta * SUPERSCRIPT_DX - sintheta * SUPERSCRIPT_DY) * _plotter->drawstate->true_font_size; (_plotter->drawstate->pos).y -= (sintheta * SUPERSCRIPT_DX + costheta * SUPERSCRIPT_DY) * _plotter->drawstate->true_font_size; } break; case C_PUSH_LOCATION: pushed_position_x = _plotter->drawstate->pos.x; pushed_position_y = _plotter->drawstate->pos.y; pushed_width = width; break; case C_POP_LOCATION: if (do_render) { _plotter->drawstate->pos.x = pushed_position_x; _plotter->drawstate->pos.y = pushed_position_y; } width = pushed_width; break; case C_RIGHT_ONE_EM: if (do_render) { _plotter->drawstate->pos.x += costheta * _plotter->drawstate->true_font_size; _plotter->drawstate->pos.y += sintheta * _plotter->drawstate->true_font_size; } width += _plotter->drawstate->true_font_size; break; case C_RIGHT_HALF_EM: if (do_render) { (_plotter->drawstate->pos).x += costheta * _plotter->drawstate->true_font_size / 2.0; (_plotter->drawstate->pos).y += sintheta * _plotter->drawstate->true_font_size / 2.0; } width += _plotter->drawstate->true_font_size / 2.0; break; case C_RIGHT_QUARTER_EM: if (do_render) { (_plotter->drawstate->pos).x += costheta * _plotter->drawstate->true_font_size / 4.0; (_plotter->drawstate->pos).y += sintheta * _plotter->drawstate->true_font_size / 4.0; } width += _plotter->drawstate->true_font_size / 4.0; break; case C_RIGHT_SIXTH_EM: if (do_render) { (_plotter->drawstate->pos).x += costheta * _plotter->drawstate->true_font_size / 6.0; (_plotter->drawstate->pos).y += sintheta * _plotter->drawstate->true_font_size / 6.0; } width += _plotter->drawstate->true_font_size / 6.0; break; case C_RIGHT_EIGHTH_EM: if (do_render) { (_plotter->drawstate->pos).x += costheta * _plotter->drawstate->true_font_size / 8.0; (_plotter->drawstate->pos).y += sintheta * _plotter->drawstate->true_font_size / 8.0; } width += _plotter->drawstate->true_font_size / 8.0; break; case C_RIGHT_TWELFTH_EM: if (do_render) { (_plotter->drawstate->pos).x += costheta * _plotter->drawstate->true_font_size / 12.0; (_plotter->drawstate->pos).y += sintheta * _plotter->drawstate->true_font_size / 12.0; } width += _plotter->drawstate->true_font_size / 8.0; break; /* Kludge: used only for \rn macro, i.e. in square roots, if the current font is a PS or PCL font. See g_cntrlify.c. If the font is a Hershey font, \rn is implemented differently, and for Stick fonts it isn't implemented at all. Painfully, the amount of shift differs depending whether this is a PS or a PCL typeface, since the `radicalex' characters are quite different. See comment in g_cntrlify.c. */ case C_RIGHT_RADICAL_SHIFT: if (do_render) { if (_plotter->drawstate->font_type == PL_F_PCL) { (_plotter->drawstate->pos).x += costheta * _plotter->drawstate->true_font_size * PCL_RADICAL_WIDTH; (_plotter->drawstate->pos).y += sintheta * _plotter->drawstate->true_font_size * PCL_RADICAL_WIDTH; } else { (_plotter->drawstate->pos).x += costheta * _plotter->drawstate->true_font_size * PS_RADICAL_WIDTH; (_plotter->drawstate->pos).y += sintheta * _plotter->drawstate->true_font_size * PS_RADICAL_WIDTH; } /* I'm going to let this serve for the PCL case; it seems to work (i.e. yield more or less the correct width). We definitely don't want PCL_RADICAL_WIDTH here. */ } width += _plotter->drawstate->true_font_size * PS_RADICAL_WIDTH; break; case C_LEFT_ONE_EM: if (do_render) { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size; } width -= _plotter->drawstate->true_font_size; break; case C_LEFT_HALF_EM: if (do_render) { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size / 2.0; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size / 2.0; } width -= _plotter->drawstate->true_font_size / 2.0; break; case C_LEFT_QUARTER_EM: if (do_render) { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size / 4.0; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size / 4.0; } width -= _plotter->drawstate->true_font_size / 4.0; break; case C_LEFT_SIXTH_EM: if (do_render) { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size / 6.0; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size / 6.0; } width -= _plotter->drawstate->true_font_size / 6.0; break; case C_LEFT_EIGHTH_EM: if (do_render) { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size / 8.0; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size / 8.0; } width -= _plotter->drawstate->true_font_size / 8.0; break; case C_LEFT_TWELFTH_EM: if (do_render) { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size / 12.0; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size / 12.0; } width -= _plotter->drawstate->true_font_size / 8.0; break; /* Kludge: used only for \rn macro, i.e. in square roots. Painfully, the amount of shift differs depending whether this is a PS or a PCL typeface, since the `radicalex' characters are quite different. See comment above, and comment in g_cntrlify.c. */ case C_LEFT_RADICAL_SHIFT: if (do_render) { if (_plotter->drawstate->font_type == PL_F_PCL) { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size * PCL_RADICAL_WIDTH; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size * PCL_RADICAL_WIDTH; } else { (_plotter->drawstate->pos).x -= costheta * _plotter->drawstate->true_font_size * PS_RADICAL_WIDTH; (_plotter->drawstate->pos).y -= sintheta * _plotter->drawstate->true_font_size * PS_RADICAL_WIDTH; } } /* see comment in C_RIGHT_RADICAL_SHIFT case, above */ width -= _plotter->drawstate->true_font_size * PS_RADICAL_WIDTH; break; /* unrecognized control code */ default: break; } cptr++; /* on to next element of codestring */ } else /* an ordinary character, with font annotation */ { unsigned char *s, *sptr; int new_font_index = (c >> FONT_SHIFT) & ONE_BYTE; /* perform font switching if necessary */ if (new_font_index != current_font_index) { /* We check initial_font_type, not _drawstate->font_type, because the latter gets trashed if e.g. (1) we start out with a font of type PL_F_OTHER, e.g. a user-specified X Windows font not in our tables, and (2) we switch to the X Windows Symbol font in mid-string, since that font is of type PL_F_POSTSCRIPT. */ switch (initial_font_type) { case PL_F_HERSHEY: free ((char *)_plotter->drawstate->font_name); { char *font_name; font_name = (char *)_pl_xmalloc(1 + strlen (_pl_g_hershey_font_info[new_font_index].name)); strcpy (font_name, _pl_g_hershey_font_info[new_font_index].name); _plotter->drawstate->font_name = font_name; } break; case PL_F_POSTSCRIPT: free ((char *)_plotter->drawstate->font_name); { char *font_name; font_name = (char *)_pl_xmalloc(1 + strlen (_pl_g_ps_font_info[new_font_index].ps_name)); strcpy (font_name, _pl_g_ps_font_info[new_font_index].ps_name); _plotter->drawstate->font_name = font_name; } break; case PL_F_PCL: free ((char *)_plotter->drawstate->font_name); { char *font_name; font_name = (char *)_pl_xmalloc(1 + strlen (_pl_g_pcl_font_info[new_font_index].ps_name)); strcpy (font_name, _pl_g_pcl_font_info[new_font_index].ps_name); _plotter->drawstate->font_name = font_name; } break; case PL_F_STICK: free ((char *)_plotter->drawstate->font_name); { char *font_name; font_name = (char *)_pl_xmalloc(1 + strlen (_pl_g_stick_font_info[new_font_index].ps_name)); strcpy (font_name, _pl_g_stick_font_info[new_font_index].ps_name); _plotter->drawstate->font_name = font_name; } break; case PL_F_OTHER: free ((char *)_plotter->drawstate->font_name); { char *font_name; if (new_font_index == 0) /* symbol font */ { font_name = (char *)_pl_xmalloc(1 + strlen (SYMBOL_FONT)); strcpy (font_name, SYMBOL_FONT); } else /* Currently, only alternative to zero (symbol font) is 1, i.e. restore font we started out with. */ { font_name = (char *)_pl_xmalloc(1 + strlen (initial_font_name)); strcpy (font_name, initial_font_name); } _plotter->drawstate->font_name = font_name; } break; default: /* shouldn't happen */ break; } _pl_g_set_font (S___(_plotter)); current_font_index = new_font_index; } /* extract substring consisting of characters in the same font */ sptr = s = (unsigned char *)_pl_xmalloc ((4 * _codestring_len (cptr) + 1) * sizeof(char)); while (*cptr && (*cptr & CONTROL_CODE) == 0 && ((*cptr >> FONT_SHIFT) & ONE_BYTE) == current_font_index) *sptr++ = (*cptr++) & ONE_BYTE; *sptr = (unsigned char)'\0'; /* Compute width of single-font substring in user units, add it. Either render or not, as requested. */ added_width = _pl_g_render_simple_string (R___(_plotter) s, do_render, h_just, v_just); width += added_width; if (do_render) { /* resposition due to rendering of label */ _plotter->drawstate->pos.x += costheta * x_displacement_internal * added_width; _plotter->drawstate->pos.y += sintheta * x_displacement_internal * added_width; } free (s); } } /* free the codestring (no memory leaks please) */ free (codestring); /* restore initial font */ free ((char *)_plotter->drawstate->font_name); _plotter->drawstate->font_name = initial_font_name; _plotter->drawstate->font_size = initial_font_size; _pl_g_set_font (S___(_plotter)); if (do_render) { /* restore position to what it was before printing label */ _plotter->drawstate->pos.x = initial_position_x; _plotter->drawstate->pos.y = initial_position_y; /* shift due to printing of label */ _plotter->drawstate->pos.x += costheta * x_displacement * overall_width; _plotter->drawstate->pos.y += sintheta * x_displacement * overall_width; } return width; } /* Compute the width of an ordinary single-font string (no escape sequences to switch fonts or position subscripts and superscripts, etc.), and also render it, if requested. The rendering only takes place if the do_render flag is set. If it is not, the width is returned only (the h_just and v_just arguments being ignored). The font type here is arbitrary (either non-Hershey or non-Hershey). That makes this callable by _pl_g_render_non_hershey_string(), inside which the font can switch from non-Hershey to Hershey. See comments above. This is never called to do rendering unless the Plotter can handle the specified types of justification. */ /* ARGS: h_just,v_just are PL_JUST_{LEFT|CENTER|RIGHT}, PL_JUST_{TOP etc.} */ double _pl_g_render_simple_string (R___(Plotter *_plotter) const unsigned char *s, bool do_render, int h_just, int v_just) { double width; if (_plotter->drawstate->font_type == PL_F_HERSHEY) /* Use our internal Hershey width-computation or rendering routine. But they do more than is needed: they handle escape sequences too, via their own controlification. So we escape all backslashes. More importantly, we work around the fact that unlike the Plotter-specific `paint_text_string' rendering routines, _pl_g_alabel_hershey() shifts the current graphics cursor position, since it draws Hershey characters as polygonal paths. */ { unsigned char *t; t = esc_esc_string (s); width = _pl_g_flabelwidth_hershey (R___(_plotter) t); if (do_render) { plPoint initial_pos; initial_pos = _plotter->drawstate->pos; /* save */ _pl_g_alabel_hershey (R___(_plotter) t, h_just, v_just); _plotter->drawstate->pos = initial_pos; /* restore */ } free (t); } else /* not a Hershey font */ { if (do_render) width = _plotter->paint_text_string (R___(_plotter) s, h_just, v_just); else width = _plotter->get_text_width (R___(_plotter) s); } return width; } /* A generic internal method that computes the width (total delta x) of a character string to be rendered in the currently selected font, so long as it is non-Hershey. It accesses the font database in g_fontdb.c. The string is just a string (no control codes, font switchings, font annotations, etc.). This supports the 35 standard PS fonts, the 45 standard PCL fonts, and our Stick fonts (i.e. device-resident HP fonts). It does not support `other' fonts, which some Plotters support; for such fonts, it returns 0.0. So Plotters that support `other' fonts, such as XDrawable and X Plotters, will need to override this, in toto. */ double _pl_g_get_text_width (R___(Plotter *_plotter) const unsigned char *s) { int index; int width = 0; double swidth = 0.0; unsigned char current_char; int master_font_index; /* index into master table */ double retval; switch (_plotter->drawstate->font_type) { case PL_F_POSTSCRIPT: /* compute font index in master PS font table */ master_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; for (index=0; s[index]!='\0'; index++) { current_char = (unsigned int)s[index]; width += ((_pl_g_ps_font_info[master_font_index]).width)[current_char]; } retval = _plotter->drawstate->true_font_size * (double)width / 1000.0; break; case PL_F_PCL: /* compute font index in master PCL font table */ master_font_index = (_pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; for (index=0; s[index]!='\0'; index++) { current_char = (unsigned int)s[index]; width += ((_pl_g_pcl_font_info[master_font_index]).width)[current_char]; } retval = _plotter->drawstate->true_font_size * (double)width / 1000.0; break; case PL_F_STICK: /* compute font index in master table of device-resident HP fonts */ master_font_index = (_pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* The width tables for Stick fonts (in g_fontdb.c) give character widths in terms of abstract raster units (the grid on which the character was defined). Font size is twice the width of the abstract raster (by definition). So in principle, to compute the width of a character string, we just need to add the character widths together, and normalize using the font size. It's more complicated than that, in part because our width tables for Stick fonts, unlike those for PCL fonts, contain the bounding box widths rather than the character cell widths. Also, for agreement with the PS rendering convention, we need to add a bit of leading whitespace, and a bit of trailing whitespace. There is also the key issue of kerning: full-featured HP-GL and HP-GL/2 plotters normally kern text strings in any Stick font via in-device kerning tables, although PCL devices such as LaserJets, when doing HP-GL/2 emulation, apparently don't. So there are two cases. 1. The case of no device-resident kerning, which is the case for PCL devices such as LaserJets that do (lamebrained) HP-GL/2 emulation. Much as for a string rendered in a PCL font, the true width (character cell width) of a character equals offset + bounding box width + offset In fact, offset is independent of character; it depends only on the font. So the string width we compute for a string consisting of n characters is: offset + bb width #1 + offset + offset + bb width #2 + offset + ... + offset + bb width #n + offset The first and last offsets in this formula provide the leading and trailing bits of whitespace. 2. The case of device-resident kerning, according to HP's spacing tables (our copies of the device spacing tables are in g_fontd2.c). The string width we return is: offset + bb width #1 + spacing(1,2) + bb width #2 + spacing(2,3) + ... + spacing(n-1,n) + bb width #n + offset where spacing(1,2) is the spacing between characters 1 and 2, etc. The basic reference for HP's kerning scheme for Stick fonts is "Firmware Determines Plotter Personality", by L. W. Hennessee, A. K. Frankel, M. A. Overton, and R. B. Smith, Hewlett-Packard Journal, Nov. 1981, pp. 16-25. Every character belongs to a `row class' and a `column class', i.e., `right edge class' and `left edge class'. Any spacing table is indexed by row class and column class. [What HP later did in their LaserJets, which don't do kerning of Stick fonts, is apparently a degenerate case of this setup, with all the inter-character spacings changed to 2*offset.] A couple of additional comments on kerning: Comment A. The width of the space character (ASCII SP) is 3/2 times as large if kerning is used, as it is in in the absence of kerning (e.g., in a LaserJet). Without kerning, it's 0.5 times the font size, like any other character, but in devices with kerning, it's 0.75 times the font size. That sounds like a major difference, but the use of kerning more or less compensates for it. See comment in code below. Comment B. Our homebrewed ANK fonts consist of a lower half encoded according to JIS ASCII, and an upper half encoded according to the half-width Katakana encoding. These two halves are different HP 7-bit character sets and use different spacing tables, since their abstract raster widths differ (42 and 45, respectively). HP's convention is apparently that if, between character k and character k+1, there's a switch between spacing tables and spacing(k,k+1) can't be computed via lookup, then bb width #k + spacing(k,k+1) + bb width #(k+1) should be replaced by width_of_space_character + bb width #(k+1) That's the way we do it. */ if (_plotter->data->kern_stick_fonts) /* have device-resident kerning, so we compute inter-character spacing from spacing tables in g_fontd2.c, which we hope match the device-resident tables */ { const struct plStickFontSpacingTableStruct *ktable_lower, *ktable_upper; const struct plStickCharSpacingTableStruct *stable_lower, *stable_upper; const short *lower_spacing, *upper_spacing; /* spacing tables */ int lower_cols, upper_cols; /* table sizes */ const char *lower_char_to_row, *lower_char_to_col; /* char to pos */ const char *upper_char_to_row, *upper_char_to_col; /* char to pos */ bool halves_use_different_tables; /* upper/lower spacing tables differ?*/ /* kerning table and spacing table structs, for each font half */ ktable_lower = &(_pl_g_stick_kerning_tables[_pl_g_stick_font_info[master_font_index].kerning_table_lower]); ktable_upper = &(_pl_g_stick_kerning_tables[_pl_g_stick_font_info[master_font_index].kerning_table_upper]); stable_lower = &(_pl_g_stick_spacing_tables[ktable_lower->spacing_table]); stable_upper = &(_pl_g_stick_spacing_tables[ktable_upper->spacing_table]); /* do font halves use different spacing tables (e.g. ANK fonts)? */ halves_use_different_tables = (stable_lower != stable_upper ? true : false); /* numbers of columns in each of the two spacing tables (number of rows isn't used) */ lower_cols = stable_lower->cols; upper_cols = stable_upper->cols; /* arrays (size 128), mapping character to row/column of spacing table */ lower_char_to_row = ktable_lower->row; lower_char_to_col = ktable_lower->col; upper_char_to_row = ktable_upper->row; upper_char_to_col = ktable_upper->col; /* spacing tables for each half of the font */ lower_spacing = stable_lower->kerns; upper_spacing = stable_upper->kerns; /* add an initial bit of whitespace (an `offset'), to make the Stick font rendering agree with the PS font rendering convention */ swidth += (((double)(_pl_g_stick_font_info[master_font_index].offset)) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_lower)); /* loop through chars in label */ for (index=0; s[index]!='\0'; index++) { unsigned char c, d; c = (unsigned int)s[index]; if (c < 0x80) /* lower half */ { double spacefactor, char_width; /* Our width tables in g_fontd2.c are most appropriate for LaserJets doing HP-GL/2 emulation, rather than for true HP-GL/2. Major difference is that in true HP-GL/2, width of space character is 3/2 times larger, e.g. in the Arc font it is 42 abstract raster units rather than 28. (This difference is partly compensated for by true HP-GL/2 having kerning, unlike LaserJets' HP-GL/2 emulation.) */ if (c == ' ') spacefactor = 1.5; else spacefactor = 1.0; /* add width of char */ char_width = (((double)(_pl_g_stick_font_info[master_font_index].width[c])) * spacefactor /(2 * _pl_g_stick_font_info[master_font_index].raster_width_lower)); swidth += char_width; if ((d = (unsigned int)s[index+1]) != '\0') /* current char is not final char in string, so add spacing between it and the next char */ { int row, col; int spacing; /* compute row class for current character, i.e., its `right edge class' */ row = lower_char_to_row[c]; /* compute and add spacing; if we switch from lower to upper half here, and upper half uses a different spacing table, just replace width of c by width of ` ' (see explanation above) */ if (d < 0x80) { col = lower_char_to_col[d]; spacing = lower_spacing[row * lower_cols + col]; } else if (!halves_use_different_tables) { col = upper_char_to_col[d - 0x80]; spacing = lower_spacing[row * lower_cols + col]; } else if (c == ' ' || (d == ' ' + 0x80)) /* space characters have no kerning */ spacing = 0; else /* c -> ` ', see above. */ spacing = - IROUND(spacefactor * _pl_g_stick_font_info[master_font_index].width[c]) + IROUND(1.5 * _pl_g_stick_font_info[master_font_index].width[' ']); swidth += ((double)spacing) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_lower); } } else /* upper half */ { double spacefactor, char_width; if (c == ' ' + 0x80) /* i.e. `unbreakable SP' */ spacefactor = 1.5; else spacefactor = 1.0; /* add width of char */ char_width = (((double)(_pl_g_stick_font_info[master_font_index].width[c])) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_upper)); swidth += char_width; if ((d = (unsigned int)s[index+1]) != '\0') /* current char is not final char in string, so add spacing between it and the next char */ { int row, col; int spacing; /* compute row class for current character, i.e., its `right edge class' */ row = upper_char_to_row[c - 0x80]; /* compute and add spacing; if we switch from upper to lower half here, and lower half uses a different spacing table, just replace width of c by width of ` ' (see explanation above) */ if (d >= 0x80) { col = upper_char_to_col[d - 0x80]; spacing = upper_spacing[row * upper_cols + col]; } else if (!halves_use_different_tables) { col = lower_char_to_col[d]; spacing = upper_spacing[row * upper_cols + col]; } else if ((c == ' ' + 0x80) || d == ' ') /* space characters have no kerning */ spacing = 0; else /* c -> ` ', see above. */ spacing = - IROUND(spacefactor * _pl_g_stick_font_info[master_font_index].width[c]) + IROUND(1.5 * _pl_g_stick_font_info[master_font_index].width[' ']); swidth += ((double)spacing) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_upper); } } } /* add a trailing bit of whitespace (an `offset'), to make the Stick font rendering agree with the PS rendering convention */ swidth += (((double)(_pl_g_stick_font_info[master_font_index].offset)) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_lower)); } else /* No device-resident kerning; this is the case, e.g., for PCL5 devices doing their (lamebrained) HP-GL/2 emulation. We use a fixed offset between each pair of characters, which is the way HP LaserJets. We also use this offset as the width of the `bit of whitespace' that we add at beginning and end of label. */ { /* loop through chars in label */ for (index=0; s[index]!='\0'; index++) { unsigned char c; c = (unsigned int)s[index]; #if 0 /* COMMENTED OUT BECAUSE IT WAS IDIOTIC */ /* kludge around HP's convention for centered marker symbols (poor fellows ain't got no width a-tall) */ if (IS_MATH_FONT(master_font_index) && IS_CENTERED_SYMBOL(c)) continue; #endif if (c < 0x80) /* lower half */ { swidth += (((double)(_pl_g_stick_font_info[master_font_index].offset)) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_lower)); swidth += (((double)(_pl_g_stick_font_info[master_font_index].width[c])) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_lower)); swidth += (((double)(_pl_g_stick_font_info[master_font_index].offset)) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_lower)); } else /* upper half */ { swidth += (((double)(_pl_g_stick_font_info[master_font_index].offset)) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_upper)); swidth += (((double)(_pl_g_stick_font_info[master_font_index].width[c])) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_upper)); swidth += (((double)(_pl_g_stick_font_info[master_font_index].offset)) /(2 * _pl_g_stick_font_info[master_font_index].raster_width_upper)); } } } /* normalize: use font size to convert width to user units */ retval = _plotter->drawstate->true_font_size * (double)swidth; break; case PL_F_OTHER: retval = 0.0; break; default: /* shouldn't happen */ retval = 0.0; break; } return retval; } /* test whether a controlified string is simple in the sense that it consists of characters in a single font, and no control codes */ static bool simple_string (const unsigned short *codestring) { const unsigned short *cptr = codestring; unsigned short c, d; int font_index; if (*codestring == 0) return true; c = *codestring; if (c & CONTROL_CODE) return false; font_index = (c >> FONT_SHIFT) & ONE_BYTE; while ((d = *cptr++) != 0) { int local_font_index; if (d & CONTROL_CODE) return false; local_font_index = (d >> FONT_SHIFT) & ONE_BYTE; if (local_font_index != font_index) return false; } return true; } /* Removes all characters not in the ISO-8859-? character sets from a string. I.e. remove control characters (characters in the range 0x01 to 0x1F, including LF and CR, and also 0x7f, i.e. DEL). We take characters in the range 0x80 to 0x9F to be control characters too, since they are undefined in the ISO character sets. Actually, in PS fonts (with ISO encoding vector) they encode accents; and in the encoding used in Fig files, they encode a few special characters not found elsewhere. But the interpretation of the 0x80--0x9F range is device dependent, and our goal is device independence, so away the range goes. */ #define GOOD_ISO(c) (((c >= 0x20) && (c <= 0x7E)) || ((c >= 0xA0) && (c <= 0xFF))) static bool clean_iso_string (unsigned char *s) { bool was_clean = true; unsigned char *t; for (t = s; *s; s++) { if (GOOD_ISO(*s)) { *t = *s; t++; } else was_clean = false; } *t = (unsigned char)'\0'; return was_clean; } /* escape all backslashes in a string; the returned string is allocated on the heap and can be freed. */ static unsigned char * esc_esc_string (const unsigned char *s) { const unsigned char *sptr; unsigned char *t, *tptr; t = (unsigned char *)_pl_xmalloc (2 * strlen ((char *)s) + 1); sptr = s; tptr = t; while (*sptr) { *tptr++ = *sptr; if (*sptr == '\\') *tptr++ = *sptr; sptr++; } *tptr = '\0'; return t; } /* Versions of the falabel() method that do nothing; derived (non-generic) Plotters must override them if they wish to use them. */ void _pl_g_paint_text_string_with_escapes (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { return; } double _pl_g_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { return 0.0; } plotutils-2.6/libplot/g_alab_her.c0000644000175000017500000006541511037243260014226 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal method _pl_g_alabel_hershey(), which plots a label using Hershey fonts. Each character in a Hershey font is a sequence of pen motions, so this function calls _API_fmoverel() and _API_fcontrel() to `stroke' each character in the argument string. The width of the string in user units is returned. The internal method _pl_g_flabelwidth_hershey() is similar, but does not actually plot the label. */ #include "sys-defines.h" #include "extern.h" #include "g_control.h" #include "g_her_metr.h" /* Shearing factor for oblique fonts, new_x = x + SHEAR * y */ #define SHEAR (2.0/7.0) /* Relative size of subscripts/superscripts (i.e. `indexical' size) */ #define SCRIPTSIZE (0.6) /* Positioning of subscripts/superscripts */ #define SUBSCRIPT_DX 0.0 #define SUBSCRIPT_DY (-0.25) #define SUPERSCRIPT_DX 0.0 #define SUPERSCRIPT_DY 0.4 /* Positioning of accents (in Hershey units). UP_SHIFT is amount by which accents are raised when placed over upper-case letters. RIGHT_SHIFT is applied as well, if the upper-case letter is italic. */ #define ACCENT_UP_SHIFT 7.0 #define ACCENT_RIGHT_SHIFT 2.0 /* Relative size of small Japanese Kana */ #define SMALL_KANA_SIZE 0.725 /* Hershey glyph arrays */ #define OCCIDENTAL 0 #define ORIENTAL 1 /* Location of first Kana in the occidental glyph arrays. (Kana, unlike Kanji, are placed in the occidental array, at the very end.) */ #define BEGINNING_OF_KANA 4195 /* forward references */ static bool composite_char (unsigned char *composite, unsigned char *character, unsigned char *accent); static double label_width_hershey (const unsigned short *label); /* An version of the alabel() method that is specific to the case when the current Plotter font is a Hershey font. It handles escape sequences for subscripts, superscripts, shifts among Hershey fonts, etc. */ double _pl_g_alabel_hershey (R___(Plotter *_plotter) const unsigned char *s, int x_justify, int y_justify) { unsigned short *codestring; char x_justify_c, y_justify_c; double label_width, label_height; double x_offset, y_offset; double x_displacement; double postdx, dx, dy; double theta; /* convert string to a codestring, including annotations */ codestring = _pl_g_controlify (R___(_plotter) s); /* dimensions of the string in user units */ label_width = HERSHEY_UNITS_TO_USER_UNITS(label_width_hershey (codestring)); label_height = HERSHEY_UNITS_TO_USER_UNITS(HERSHEY_HEIGHT); x_justify_c = (char)x_justify; y_justify_c = (char)y_justify; switch (x_justify_c) { case 'l': /* left justified */ default: x_offset = 0.0; x_displacement = 1.0; break; case 'c': /* centered */ x_offset = -0.5; x_displacement = 0.0; break; case 'r': /* right justified */ x_offset = -1.0; x_displacement = -1.0; break; } switch (y_justify_c) { case 'b': /* current point is at bottom */ y_offset = (double)HERSHEY_DESCENT / (double)HERSHEY_HEIGHT; break; case 'x': /* current point is on baseline */ default: y_offset = 0.0; break; case 'c': /* current point midway between bottom, top */ y_offset = 0.5 * ((double)HERSHEY_DESCENT - (double)HERSHEY_ASCENT) / (double)HERSHEY_HEIGHT; break; case 'C': /* current point is on cap line */ y_offset = - (double)HERSHEY_CAPHEIGHT / (double)HERSHEY_HEIGHT; break; case 't': /* current point is at top */ y_offset = - (double)HERSHEY_ASCENT / (double)HERSHEY_HEIGHT; break; } /* save relevant drawing attributes, and restore them later */ { char *old_line_mode, *old_cap_mode, *old_join_mode; int old_fill_type; double oldposx, oldposy; bool old_dash_array_in_effect; old_line_mode = (char *)_pl_xmalloc (strlen (_plotter->drawstate->line_mode) + 1); old_cap_mode = (char *)_pl_xmalloc (strlen (_plotter->drawstate->cap_mode) + 1); old_join_mode = (char *)_pl_xmalloc (strlen (_plotter->drawstate->join_mode) + 1); oldposx = _plotter->drawstate->pos.x; oldposy = _plotter->drawstate->pos.y; strcpy (old_line_mode, _plotter->drawstate->line_mode); strcpy (old_cap_mode, _plotter->drawstate->cap_mode); strcpy (old_join_mode, _plotter->drawstate->join_mode); old_fill_type = _plotter->drawstate->fill_type; old_dash_array_in_effect = _plotter->drawstate->dash_array_in_effect; /* Our choices for rendering: solid lines, rounded capitals and joins, a line width equal to slightly more than 1 Hershey unit, and no filling. We don't set the pen type: we allow it to be 0, which will mean no stroking at all. */ _API_linemod (R___(_plotter) "solid"); _API_capmod (R___(_plotter) "round"); _API_joinmod (R___(_plotter) "round"); _API_filltype (R___(_plotter) 0); /* move to take horizontal and vertical justification into account */ { double theta, deltax, deltay, dx_just, dy_just; theta = M_PI * _plotter->drawstate->text_rotation / 180.0; deltax = x_offset * label_width; deltay = y_offset * label_height; dx_just = cos(theta) * deltax - sin(theta) * deltay; dy_just = sin(theta) * deltax + cos(theta) * deltay; _API_fmoverel (R___(_plotter) dx_just, dy_just); } /* call stroker on the sequence of strokes obtained from each char (the stroker may manipulate the line width) */ _pl_g_draw_hershey_string (R___(_plotter) codestring); /* Restore original values of relevant drawing attributes, free storage. endpath() will be invoked in here automatically, flushing the created polyline object comprising the stroked text. */ _API_linemod (R___(_plotter) old_line_mode); _API_capmod (R___(_plotter) old_cap_mode); _API_joinmod (R___(_plotter) old_join_mode); _API_filltype (R___(_plotter) old_fill_type); _plotter->drawstate->dash_array_in_effect = old_dash_array_in_effect; free (old_line_mode); free (old_cap_mode); free (old_join_mode); /* return to original position */ _API_fmove (R___(_plotter) oldposx, oldposy); } /* amount by which to shift after printing label (user units) */ postdx = x_displacement * label_width; theta = M_PI * _plotter->drawstate->text_rotation / 180.0; dx = cos (theta) * postdx; dy = sin (theta) * postdx; _API_fmoverel (R___(_plotter) dx, dy); free (codestring); return label_width; /* user units */ } /* A version of the flabelwidth() method that is specific to the case when the current Plotter font is a Hershey font. */ double _pl_g_flabelwidth_hershey (R___(Plotter *_plotter) const unsigned char *s) { double label_width; unsigned short *codestring; /* convert string to a codestring, including annotations */ codestring = _pl_g_controlify (R___(_plotter) s); label_width = HERSHEY_UNITS_TO_USER_UNITS(label_width_hershey (codestring)); free (codestring); return label_width; } /* _pl_g_draw_hershey_stroke() draws a stroke, taking into account the transformation from Hershey units to user units, and also the angle in user space at which the label should be plotted. */ void _pl_g_draw_hershey_stroke (R___(Plotter *_plotter) bool pendown, double deltax, double deltay) { double theta = M_PI * _plotter->drawstate->text_rotation / 180.0; double dx, dy; deltax = HERSHEY_UNITS_TO_USER_UNITS (deltax); deltay = HERSHEY_UNITS_TO_USER_UNITS (deltay); dx = cos(theta) * deltax - sin(theta) * deltay; dy = sin(theta) * deltax + cos(theta) * deltay; if (pendown) _API_fcontrel (R___(_plotter) dx, dy); else _API_fmoverel (R___(_plotter) dx, dy); } /* label_width_hershey() computes the width (total delta x) of a controlified character string to be rendered in a vector font, in Hershey units. Parsing must take into account the many control sequences which perform shifts, and initiate/terminate subscripts/superscripts. */ /* In addition to scaling the character sizes and the `width', we perform the following (dx, dy): enter subscript (dx, dy) = (-1/9, -1/2) * width exit subscript (dx, dy) = (+1/6, +1/2) * width enter superscript (dx, dy) = (-1/9, +1/2) * width exit superscript (dx, dy) = (+1/6, -1/2) * width For clarity here, `width' refers to the width _before_ it is multiplied by a factor 2/3. [N.B. In Bob Beach's original UGS character stroke generator, the +1/6's here were +2/9 instead. Better?] */ static double label_width_hershey (const unsigned short *label) { const unsigned short *ptr = label; unsigned short c; double charsize = 1.0; /* relative char size, 1.0 means full size */ double saved_charsize = 1.0; double width = 0.0; /* label width */ double saved_width = 0.0; /* loop through unsigned shorts in label */ while ((c = (*ptr)) != (unsigned short)'\0') { int glyphnum; /* glyph in Hershey array */ const unsigned char *glyph; if (c & RAW_HERSHEY_GLYPH) /* glyph was spec'd via an escape, not as a char in a font */ { glyphnum = c & GLYPH_SPEC; glyph = (const unsigned char *)(_pl_g_occidental_hershey_glyphs[glyphnum]); if (*glyph != '\0') /* nonempty glyph */ /* 1st two chars are bounds */ width += charsize * ((int)glyph[1] - (int)glyph[0]); } else if (c & RAW_ORIENTAL_HERSHEY_GLYPH) /* glyph was spec'd via an escape, not as a char in a font */ { glyphnum = c & GLYPH_SPEC; glyph = (const unsigned char *)_pl_g_oriental_hershey_glyphs[glyphnum]; if (*glyph != '\0') /* nonempty glyph */ /* 1st two chars are bounds */ width += charsize * ((int)glyph[1] - (int)glyph[0]); } else if (c & CONTROL_CODE) /* parse control code */ { switch (c & ~CONTROL_CODE) { case C_BEGIN_SUBSCRIPT: case C_BEGIN_SUPERSCRIPT : charsize *= SCRIPTSIZE; break; case C_END_SUBSCRIPT: case C_END_SUPERSCRIPT: charsize /= SCRIPTSIZE; break; case C_PUSH_LOCATION: saved_width = width; saved_charsize = charsize; break; case C_POP_LOCATION: width = saved_width; charsize = saved_charsize; break; case C_RIGHT_ONE_EM: width += charsize * HERSHEY_EM; break; case C_RIGHT_HALF_EM: width += charsize * HERSHEY_EM / 2.0; break; case C_RIGHT_QUARTER_EM: width += charsize * HERSHEY_EM / 4.0; break; case C_RIGHT_SIXTH_EM: width += charsize * HERSHEY_EM / 6.0; break; case C_RIGHT_EIGHTH_EM: width += charsize * HERSHEY_EM / 8.0; break; case C_RIGHT_TWELFTH_EM: width += charsize * HERSHEY_EM / 12.0; break; case C_LEFT_ONE_EM: width -= charsize * HERSHEY_EM; break; case C_LEFT_HALF_EM: width -= charsize * HERSHEY_EM / 2.0; break; case C_LEFT_QUARTER_EM: width -= charsize * HERSHEY_EM / 4.0; break; case C_LEFT_SIXTH_EM: width -= charsize * HERSHEY_EM / 6.0; break; case C_LEFT_EIGHTH_EM: width -= charsize * HERSHEY_EM / 8.0; break; case C_LEFT_TWELFTH_EM: width -= charsize * HERSHEY_EM / 12.0; break; /* unrecognized control code */ default: break; } } else /* yow, an actual character */ { int raw_fontnum; /* compute index of font, in table in g_fontdb.c */ raw_fontnum = (c >> FONT_SHIFT) & ONE_BYTE; c &= ~FONT_SPEC; /* extract character proper */ glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[c]; /* could be a pseudo glyph number, e.g. an indication that character is composite */ if (glyphnum == ACC0 || glyphnum == ACC1 || glyphnum == ACC2) { unsigned char composite, character, accent; /* if so, use 1st element of composite character */ composite = (unsigned char)c; if (composite_char (&composite, &character, &accent)) glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[character]; else glyphnum = UNDE; /* hope this won't happen */ } /* could also be a glyph number displaced by KS, to indicate that this is a small kana */ if (glyphnum & KS) glyphnum -= KS; glyph = (const unsigned char *)(_pl_g_occidental_hershey_glyphs[glyphnum]); if (*glyph != '\0') /* nonempty glyph */ /* 1st two chars are bounds */ width += charsize * ((int)glyph[1] - (int)glyph[0]); } ptr++; /* bump pointer in string */ } return width; } /* _pl_g_draw_hershey_penup_stroke() draws a penup stroke, along a vector specified in Hershey units. Size scaling and obliquing (true/false) are specified. This is used for repositioning during rendering of composite (accented) characters. */ void _pl_g_draw_hershey_penup_stroke(R___(Plotter *_plotter) double dx, double dy, double charsize, bool oblique) { double shear; shear = oblique ? (SHEAR) : 0.0; _pl_g_draw_hershey_stroke (R___(_plotter) false, /* pen up */ charsize * (dx + shear * dy), charsize * dy); } /* _pl_g_draw_hershey_glyph() invokes move() and cont() to draw a raw Hershey glyph, specified by index in the occidental or oriental glyph arrays. Size scaling and obliquing (true/false) are specified. */ void _pl_g_draw_hershey_glyph (R___(Plotter *_plotter) int glyphnum, double charsize, int type, bool oblique) { double xcurr, ycurr; double xfinal, yfinal; bool pendown = false; const unsigned char *glyph; double dx, dy; double shear; shear = oblique ? (SHEAR) : 0.0; switch (type) { case OCCIDENTAL: default: glyph = (const unsigned char *)(_pl_g_occidental_hershey_glyphs[glyphnum]); break; case ORIENTAL: glyph = (const unsigned char *)(_pl_g_oriental_hershey_glyphs[glyphnum]); break; } if (*glyph != '\0') /* nonempty glyph */ { xcurr = charsize * (double)glyph[0]; xfinal = charsize * (double)glyph[1]; ycurr = yfinal = 0.0; glyph += 2; while (*glyph) { int xnewint; xnewint = (int)glyph[0]; if (xnewint == (int)' ') pendown = false; else { double xnew, ynew; xnew = (double)charsize * xnewint; ynew = (double)charsize * ((int)'R' - ((int)glyph[1] + (double)HERSHEY_BASELINE)); dx = xnew - xcurr; dy = ynew - ycurr; _pl_g_draw_hershey_stroke (R___(_plotter) pendown, dx + shear * dy, dy); xcurr = xnew, ycurr = ynew; pendown = true; } glyph +=2; /* on to next pair */ } /* final penup stroke, to end where we should */ dx = xfinal - xcurr; dy = yfinal - ycurr; _pl_g_draw_hershey_stroke (R___(_plotter) false, dx + shear * dy, dy); } } /* _pl_g_draw_hershey_string() strokes a string beginning at present location, which is taken to be on the string's baseline. Besides invoking move() and cont(), it invokes linewidth(). */ void _pl_g_draw_hershey_string (R___(Plotter *_plotter) const unsigned short *string) { unsigned short c; const unsigned short *ptr = string; double charsize = 1.0; double saved_charsize = 1.0; double saved_position_x = _plotter->drawstate->pos.x; double saved_position_y = _plotter->drawstate->pos.y; double old_line_width; int line_width_type = 0; /* 0,1,2 = unset,occidental,oriental */ /* save line width (will restore at end) */ old_line_width = _plotter->drawstate->line_width; while ((c = (*ptr++)) != '\0') { /* Check for the four possibilities: (1) a Hershey glyph specified by glyph number, (2) an oriental Hershey glyph specified by glyph number, (3) a control code, and (4) an ordinary font character, which will be mapped to a Hershey glyph by one of the tables in g_fontdb.c. */ if (c & RAW_HERSHEY_GLYPH) { if (line_width_type != 1) { _API_flinewidth (R___(_plotter) HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_STROKE_WIDTH)); line_width_type = 1; } _pl_g_draw_hershey_glyph (R___(_plotter) c & GLYPH_SPEC, charsize, OCCIDENTAL, false); } else if (c & RAW_ORIENTAL_HERSHEY_GLYPH) { if (line_width_type != 2) { _API_flinewidth (R___(_plotter) HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_ORIENTAL_STROKE_WIDTH)); line_width_type = 2; } _pl_g_draw_hershey_glyph (R___(_plotter) c & GLYPH_SPEC, charsize, ORIENTAL, false); } else if (c & CONTROL_CODE) switch (c & ~CONTROL_CODE) /* parse control codes */ { case C_BEGIN_SUPERSCRIPT : _pl_g_draw_hershey_stroke (R___(_plotter) false, SUPERSCRIPT_DX * charsize * HERSHEY_EM, SUPERSCRIPT_DY * charsize * HERSHEY_EM); charsize *= SCRIPTSIZE; break; case C_END_SUPERSCRIPT: charsize /= SCRIPTSIZE; _pl_g_draw_hershey_stroke (R___(_plotter) false, - SUPERSCRIPT_DX * charsize * HERSHEY_EM, - SUPERSCRIPT_DY * charsize * HERSHEY_EM); break; case C_BEGIN_SUBSCRIPT: _pl_g_draw_hershey_stroke (R___(_plotter) false, SUBSCRIPT_DX * charsize * HERSHEY_EM, SUBSCRIPT_DY * charsize * HERSHEY_EM); charsize *= SCRIPTSIZE; break; case C_END_SUBSCRIPT: charsize /= SCRIPTSIZE; _pl_g_draw_hershey_stroke (R___(_plotter) false, - SUBSCRIPT_DX * charsize * HERSHEY_EM, - SUBSCRIPT_DY * charsize * HERSHEY_EM); break; case C_PUSH_LOCATION: saved_charsize = charsize; saved_position_x = _plotter->drawstate->pos.x; saved_position_y = _plotter->drawstate->pos.y; break; case C_POP_LOCATION: charsize = saved_charsize; _API_fmove (R___(_plotter) saved_position_x, saved_position_y); break; case C_RIGHT_ONE_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, charsize * HERSHEY_EM, 0.0); break; case C_RIGHT_HALF_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, charsize * HERSHEY_EM / 2.0, 0.0); break; case C_RIGHT_QUARTER_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, charsize * HERSHEY_EM / 4.0, 0.0); break; case C_RIGHT_SIXTH_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, charsize * HERSHEY_EM / 6.0, 0.0); break; case C_RIGHT_EIGHTH_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, charsize * HERSHEY_EM / 8.0, 0.0); break; case C_RIGHT_TWELFTH_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, charsize * HERSHEY_EM / 12.0, 0.0); break; case C_LEFT_ONE_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, - charsize * HERSHEY_EM, 0.0); break; case C_LEFT_HALF_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, - charsize * HERSHEY_EM / 2.0, 0.0); break; case C_LEFT_QUARTER_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, - charsize * HERSHEY_EM / 4.0, 0.0); break; case C_LEFT_SIXTH_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, - charsize * HERSHEY_EM / 6.0, 0.0); break; case C_LEFT_EIGHTH_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, - charsize * HERSHEY_EM / 8.0, 0.0); break; case C_LEFT_TWELFTH_EM: _pl_g_draw_hershey_stroke (R___(_plotter) false, - charsize * HERSHEY_EM / 12.0, 0.0); break; /* unrecognized control code, punt */ default: break; } else /* yow, an actual font character! Several possibilities: could be a composite (accented) character, could be a small Kana, or could be a garden-variety character. */ { int raw_fontnum; int glyphnum; /* glyph in Hershey array */ int char_glyphnum, accent_glyphnum; /* for composite chars */ int char_width, accent_width; /* for composite chars */ const unsigned char *char_glyph, *accent_glyph; unsigned char composite, character, accent; bool oblique, small_kana = false; /* compute index of font, in font table in g_fontdb.c */ raw_fontnum = (c >> FONT_SHIFT) & ONE_BYTE; /* shear font? (for HersheySans-Oblique, etc.) */ oblique = _pl_g_hershey_font_info[raw_fontnum].obliquing; c &= ~FONT_SPEC; /* extract character proper */ glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[c]; if (glyphnum & KS) /* a small kana? */ { glyphnum -= KS; small_kana = true; } switch (glyphnum) { /* special case: this is a composite (accented) character; search font table in g_fontdb.c for it */ case ACC0: case ACC1: case ACC2: composite = (unsigned char)c; if (composite_char (&composite, &character, &accent)) { char_glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[character]; accent_glyphnum = (_pl_g_hershey_font_info[raw_fontnum].chars)[accent]; } else { /* hope this won't happen */ char_glyphnum = UNDE; accent_glyphnum = 0; } char_glyph = (const unsigned char *)_pl_g_occidental_hershey_glyphs[char_glyphnum]; accent_glyph = (const unsigned char *)_pl_g_occidental_hershey_glyphs[accent_glyphnum]; if (*char_glyph != '\0') /* nonempty glyph */ /* 1st two chars are bounds, in Hershey units */ char_width = (int)char_glyph[1] - (int)char_glyph[0]; else char_width = 0; if (*accent_glyph != '\0') /* nonempty glyph */ /* 1st two chars are bounds, in Hershey units */ accent_width = (int)accent_glyph[1] - (int)accent_glyph[0]; else accent_width = 0; /* draw the character */ if (line_width_type != 1) { _API_flinewidth (R___(_plotter) HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_STROKE_WIDTH)); line_width_type = 1; } _pl_g_draw_hershey_glyph (R___(_plotter) char_glyphnum, charsize, OCCIDENTAL, oblique); /* back up to draw accent */ _pl_g_draw_hershey_penup_stroke (R___(_plotter) -0.5 * (double)char_width -0.5 * (double)accent_width, 0.0, charsize, oblique); /* repositioning for uppercase and uppercase italic */ if (glyphnum == ACC1) _pl_g_draw_hershey_penup_stroke (R___(_plotter) 0.0, (double)(ACCENT_UP_SHIFT), charsize, oblique); else if (glyphnum == ACC2) _pl_g_draw_hershey_penup_stroke (R___(_plotter) (double)(ACCENT_RIGHT_SHIFT), (double)(ACCENT_UP_SHIFT), charsize, oblique); /* draw the accent */ _pl_g_draw_hershey_glyph (R___(_plotter) accent_glyphnum, charsize, OCCIDENTAL, oblique); /* undo special repositioning if any */ if (glyphnum == ACC1) _pl_g_draw_hershey_penup_stroke (R___(_plotter) 0.0, -(double)(ACCENT_UP_SHIFT), charsize, oblique); else if (glyphnum == ACC2) _pl_g_draw_hershey_penup_stroke (R___(_plotter) -(double)(ACCENT_RIGHT_SHIFT), -(double)(ACCENT_UP_SHIFT), charsize, oblique); /* move forward, to end composite char where we should */ _pl_g_draw_hershey_penup_stroke (R___(_plotter) 0.5 * (double)char_width -0.5 * (double)accent_width, 0.0, charsize, oblique); break; /* not a composite (accented) character; just an ordinary glyph from occidental+Kana array (could be a Kana, in particular, could be a small Kana) */ default: if (small_kana) { int kana_width; const unsigned char *kana_glyph; double shift = 0.5 * (1.0 - (SMALL_KANA_SIZE)); kana_glyph = (const unsigned char *)_pl_g_occidental_hershey_glyphs[glyphnum]; kana_width = (int)kana_glyph[1] - (int)kana_glyph[0]; /* draw small Kana, preceded and followed by a penup stroke in order to traverse the full width of an ordinary Kana */ _pl_g_draw_hershey_penup_stroke (R___(_plotter) shift * (double)kana_width, 0.0, charsize, oblique); if (line_width_type != 2) { _API_flinewidth (R___(_plotter) HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_ORIENTAL_STROKE_WIDTH)); line_width_type = 2; } _pl_g_draw_hershey_glyph (R___(_plotter) glyphnum, (SMALL_KANA_SIZE) * charsize, OCCIDENTAL, oblique); _pl_g_draw_hershey_penup_stroke (R___(_plotter) shift * (double)kana_width, 0.0, charsize, oblique); } else /* whew! just an ordinary glyph from the occidental array (could be a Kana however, since they're confusingly placed in that array, at the end) */ { if (glyphnum >= BEGINNING_OF_KANA) { if (line_width_type != 2) { _API_flinewidth (R___(_plotter) HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_ORIENTAL_STROKE_WIDTH)); line_width_type = 2; } } else if (line_width_type != 1) { _API_flinewidth (R___(_plotter) HERSHEY_UNITS_TO_USER_UNITS (HERSHEY_STROKE_WIDTH)); line_width_type = 1; } _pl_g_draw_hershey_glyph (R___(_plotter) glyphnum, charsize, OCCIDENTAL, oblique); } break; } /* end of case statement that switches based on glyphnum */ } /* end of font character case */ } /* end of loop through unsigned shorts in the codestring */ if (line_width_type != 0) /* must restore old line width */ _API_flinewidth (R___(_plotter) old_line_width); return; } /* retrieve the two elements of a composite character from the table in g_fontdb.c */ static bool composite_char (unsigned char *composite, unsigned char *character, unsigned char *accent) { const struct plHersheyAccentedCharInfoStruct *compchar = _pl_g_hershey_accented_char_info; bool found = false; unsigned char given = *composite; while (compchar->composite) { if (compchar->composite == given) { found = true; /* return char and accent via pointers */ *character = compchar->character; *accent = compchar->accent; } compchar++; } return found; } plotutils-2.6/libplot/g_arc.c0000644000175000017500000002660111037243260013230 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the arc method, which is a standard part of libplot. It draws an object: a circular arc from x0,y0 to x1,y1, with center at xc,yc. If xc,yc does not lie on the perpendicular bisector between the other two points as it should, it is adjusted so that it does. This file also contains the ellarc method, which is a GNU extension to libplot. It draws an object: an arc of an ellipse, from p0=(x0,y0) to p1=(x1,y1). The center of the ellipse will be at pc=(xc,yc). These conditions do not uniquely determine the elliptic arc (or the ellipse of which it is an arc). We choose the elliptic arc so that it has control points p0, p1, and p0 + p1 - pc, where the third control point p0 + p1 - pc is simply the reflection of pc through the line determined by p0 and p1. This means that the arc passes through p0 and p1, is tangent at p0 to the line segment joining p0 to p0 + p1 - pc, and is tangent at p1 to the line segment joining p1 to p0 + p1 - pc. So it fits snugly into a triangle, the vertices of which are the three control points. This sort of elliptic arc is called a `quarter-ellipse', since it is an affinely transformed quarter-circle. Specifically, it is an affinely transformed version of the first quadrant of a unit circle, with the affine transformation mapping (0,0) to pc, (0,1) to p0, (1,0) to p1, and (1,1) to the control point p0 + p1 - pc. */ #include "sys-defines.h" #include "extern.h" #define COLLINEAR(p0, p1, p2) \ ((p0.x * p1.y - p0.y * p1.x - p0.x * p2.y + \ p0.y * p2.x + p1.x * p2.y - p1.y * p2.x) == 0.0) int _API_farc (R___(Plotter *_plotter) double xc, double yc, double x0, double y0, double x1, double y1) { int prev_num_segments; plPoint p0, p1, pc; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "farc: invalid operation"); return -1; } if (_plotter->drawstate->path != (plPath *)NULL && (_plotter->drawstate->path->type != PATH_SEGMENT_LIST || (_plotter->drawstate->path->type == PATH_SEGMENT_LIST && _plotter->drawstate->path->primitive))) /* There's a simple path under construction (so that endsubpath() must not have been invoked), and it contains a closed primitive (box/circle/ellipse). So flush out the whole compound path. (It may include other, previously drawn simple paths.) */ _API_endpath (S___(_plotter)); /* if new segment not contiguous, move to its starting point (first flushing out the compound path under construction, if any) */ if (x0 != _plotter->drawstate->pos.x || y0 != _plotter->drawstate->pos.y) { if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); _plotter->drawstate->pos.x = x0; _plotter->drawstate->pos.y = y0; } p0.x = x0; p0.y = y0; p1.x = x1; p1.y = y1; pc.x = xc; pc.y = yc; if (_plotter->drawstate->path == (plPath *)NULL) /* begin a new path, of segment list type */ { _plotter->drawstate->path = _new_plPath (); prev_num_segments = 0; _add_moveto (_plotter->drawstate->path, p0); } else prev_num_segments = _plotter->drawstate->path->num_segments; /* Trivial case: if linemode is "disconnected", just plot a line segment from (x0,y0) to (x1,y1). Only the endpoints will appear on the display. */ if (!_plotter->drawstate->points_are_connected) _add_line (_plotter->drawstate->path, p1); /* Another trivial case: treat a zero-length arc as a line segment */ else if (x0 == x1 && y0 == y1) _add_line (_plotter->drawstate->path, p1); else /* standard (non-trivial) case */ { /* if segment buffer is occupied by a single arc, replace arc by a polyline if that's called for (Plotter-dependent) */ if (_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 2) { _pl_g_maybe_replace_arc (S___(_plotter)); if (_plotter->drawstate->path->num_segments > 2) prev_num_segments = 0; } /* add new circular arc to the path buffer */ /* adjust location of pc if necessary, to place it on the bisector */ pc = _truecenter (p0, p1, pc); /* add new circular arc (either real or fake) to path buffer */ if (((_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 1) /* i.e. moveto */ || _plotter->data->have_mixed_paths == true) && (_plotter->data->allowed_arc_scaling == AS_ANY || (_plotter->data->allowed_arc_scaling == AS_UNIFORM && _plotter->drawstate->transform.uniform) || (_plotter->data->allowed_arc_scaling == AS_AXES_PRESERVED && _plotter->drawstate->transform.axes_preserved))) /* add circular arc as an arc element, since it's allowed */ _add_arc (_plotter->drawstate->path, pc, p1); else if (_plotter->data->allowed_cubic_scaling == AS_ANY) /* add a cubic Bezier that approximates the circular arc (allowed since this Plotter supports cubic Beziers) */ _add_arc_as_bezier3 (_plotter->drawstate->path, pc, p1); else /* add a polygonal approximation */ _add_arc_as_lines (_plotter->drawstate->path, pc, p1); } /* move to endpoint */ _plotter->drawstate->pos = p1; /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) prev_num_segments); /* If the path is getting too long (and it doesn't have to be filled), flush it out by invoking endpath(), and begin a new one. `Too long' is Plotter-dependent; some don't do this flushing at all. */ if ((_plotter->drawstate->path->num_segments >= _plotter->data->max_unfilled_path_length) && (_plotter->drawstate->fill_type == 0) && _plotter->path_is_flushable (S___(_plotter))) _API_endpath (S___(_plotter)); return 0; } int _API_fellarc (R___(Plotter *_plotter) double xc, double yc, double x0, double y0, double x1, double y1) { int prev_num_segments; plPoint pc, p0, p1; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fellarc: invalid operation"); return -1; } if (_plotter->drawstate->path != (plPath *)NULL && (_plotter->drawstate->path->type != PATH_SEGMENT_LIST || (_plotter->drawstate->path->type == PATH_SEGMENT_LIST && _plotter->drawstate->path->primitive))) /* There's a simple path under construction (so that endsubpath() must not have been invoked), and it contains a closed primitive (box/circle/ellipse). So flush out the whole compound path. (It may include other, previously drawn simple paths.) */ _API_endpath (S___(_plotter)); /* if new segment not contiguous, move to its starting point (first flushing out the compound path under construction, if any) */ if (x0 != _plotter->drawstate->pos.x || y0 != _plotter->drawstate->pos.y) { if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); _plotter->drawstate->pos.x = x0; _plotter->drawstate->pos.y = y0; } p0.x = x0; p0.y = y0; p1.x = x1; p1.y = y1; pc.x = xc; pc.y = yc; if (_plotter->drawstate->path == (plPath *)NULL) /* begin a new path, of segment list type */ { _plotter->drawstate->path = _new_plPath (); prev_num_segments = 0; _add_moveto (_plotter->drawstate->path, p0); } else prev_num_segments = _plotter->drawstate->path->num_segments; if (!_plotter->drawstate->points_are_connected) /* Trivial case: if linemode is "disconnected", just plot a line segment from (x0,y0) to (x1,y1). Only the endpoints will appear on the display. */ _add_line (_plotter->drawstate->path, p1); else if (x0 == x1 && y0 == y1) /* Another trivial case: treat a zero-length arc as a line segment */ _add_line (_plotter->drawstate->path, p1); else if (COLLINEAR (p0, p1, pc)) /* yet another trivial case, collinear points: draw line segment from p0 to p1 */ _add_line (_plotter->drawstate->path, p1); else /* standard (nontrivial) case */ { /* if segment buffer is occupied by a single arc, replace arc by a polyline if that's called for (Plotter-dependent) */ if (_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 2) { _pl_g_maybe_replace_arc (S___(_plotter)); if (_plotter->drawstate->path->num_segments > 2) prev_num_segments = 0; } /* add new elliptic arc (either real or fake) to path buffer */ if (((_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 1) /* i.e. moveto */ || _plotter->data->have_mixed_paths == true) && (_plotter->data->allowed_ellarc_scaling == AS_ANY || (_plotter->data->allowed_ellarc_scaling == AS_UNIFORM && _plotter->drawstate->transform.uniform) || (_plotter->data->allowed_ellarc_scaling == AS_AXES_PRESERVED && _plotter->drawstate->transform.axes_preserved && ((y0 == yc && x1 == xc) || (x0 == xc && y1 == yc))))) /* add elliptic arc to the path buffer as an arc element, since it's allowed (note that we interpret the AS_AXES_PRESERVED constraint to require also that the x and y coors for arc endpoints line up) */ _add_ellarc (_plotter->drawstate->path, pc, p1); else if (_plotter->data->allowed_cubic_scaling == AS_ANY) /* add a cubic Bezier that approximates the elliptic arc (allowed since this Plotter supports cubic Beziers) */ _add_ellarc_as_bezier3 (_plotter->drawstate->path, pc, p1); else /* add a polygonal approximation to the elliptic arc */ _add_ellarc_as_lines (_plotter->drawstate->path, pc, p1); } /* move to endpoint */ _plotter->drawstate->pos = p1; /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) prev_num_segments); /* If the path is getting too long (and it doesn't have to be filled), flush it out by invoking endpath(), and begin a new one. `Too long' is Plotter-dependent; some don't do this flushing at all. */ if ((_plotter->drawstate->path->num_segments >= _plotter->data->max_unfilled_path_length) && (_plotter->drawstate->fill_type == 0) && _plotter->path_is_flushable (S___(_plotter))) _API_endpath (S___(_plotter)); return 0; } plotutils-2.6/libplot/g_attrib.c0000644000175000017500000002603111037243260013745 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the linemod method, which is a standard part of libplot. It sets a drawing attribute: the line style used in subsequent drawing operations. This version searches for the specified line style in a table of known line styles (see g_dash2.c). */ /* This file also contains the capmod method, which is a GNU extension to libplot. It sets a drawing attribute: the cap mode used when subsequently drawing open paths. */ /* This file also contains the joinmod method, which is a GNU extension to libplot. It sets a drawing attribute: the join mode used when subsequently drawing paths consisting of more than a single segment. */ /* This file also contains the miterlimit method, which is a GNU extension to libplot. It sets a drawing attribute: the miter limit of polylines subsequently drawn on the display device. This attribute controls the treatment of corners when the join mode is set to "miter". */ /* This file contains the orientation method, which is a GNU extension to libplot. It sets a drawing attribute: whether or not closed paths of the three built-in types (rectangles, circles, ellipses) should be drawn counterclockwise or clockwise. The former is the default. */ /* This file contains the fillmod method, which is a GNU extension to libplot. It sets a drawing attribute: the fill rule used when subsequently drawing filled objects, i.e., the rule used to determine which points are `inside'. In principle, both the `odd winding number' rule and the `nonzero winding number' rule are supported. The former is the default. */ #include "sys-defines.h" #include "extern.h" int _API_linemod (R___(Plotter *_plotter) const char *s) { bool matched = false; char *line_mode; int i; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "linemod: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* null pointer resets to default */ if ((!s) || !strcmp(s, "(null)")) s = _default_drawstate.line_mode; free ((char *)_plotter->drawstate->line_mode); line_mode = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (line_mode, s); _plotter->drawstate->line_mode = line_mode; if (strcmp (s, "disconnected") == 0) /* we'll implement disconnected lines by drawing a filled circle at each path join point; see g_endpath.c */ { _plotter->drawstate->line_type = PL_L_SOLID; _plotter->drawstate->points_are_connected = false; matched = true; } else /* search table of libplot's builtin line types */ for (i = 0; i < PL_NUM_LINE_TYPES; i++) { if (strcmp (s, _pl_g_line_styles[i].name) == 0) { _plotter->drawstate->line_type = _pl_g_line_styles[i].type; _plotter->drawstate->points_are_connected = true; matched = true; break; } } if (matched == false) /* don't recognize, silently switch to default mode */ _API_linemod (R___(_plotter) _default_drawstate.line_mode); /* for future paths, use builtin line style rather than user-specified dash array */ _plotter->drawstate->dash_array_in_effect = false; return 0; } int _API_capmod (R___(Plotter *_plotter) const char *s) { char *cap_mode; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "capmod: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* null pointer resets to default */ if ((!s) || !strcmp(s, "(null)")) s = _default_drawstate.cap_mode; free ((char *)_plotter->drawstate->cap_mode); cap_mode = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (cap_mode, s); _plotter->drawstate->cap_mode = cap_mode; /* The following four cap types are now standard. */ if (strcmp( s, "butt") == 0) _plotter->drawstate->cap_type = PL_CAP_BUTT; else if (strcmp( s, "round") == 0) _plotter->drawstate->cap_type = PL_CAP_ROUND; else if (strcmp( s, "projecting") == 0) _plotter->drawstate->cap_type = PL_CAP_PROJECT; else if (strcmp( s, "triangular") == 0) _plotter->drawstate->cap_type = PL_CAP_TRIANGULAR; else /* don't recognize, silently switch to default mode */ return _API_capmod (R___(_plotter) _default_drawstate.cap_mode); return 0; } int _API_joinmod (R___(Plotter *_plotter) const char *s) { char *join_mode; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "joinmod: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* null pointer resets to default */ if ((!s) || !strcmp(s, "(null)")) s = _default_drawstate.join_mode; free ((char *)_plotter->drawstate->join_mode); join_mode = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (join_mode, s); _plotter->drawstate->join_mode = join_mode; /* The following four join types are now standard. */ if (strcmp( s, "miter") == 0) _plotter->drawstate->join_type = PL_JOIN_MITER; else if (strcmp( s, "mitre") == 0) _plotter->drawstate->join_type = PL_JOIN_MITER; else if (strcmp( s, "round") == 0) _plotter->drawstate->join_type = PL_JOIN_ROUND; else if (strcmp( s, "bevel") == 0) _plotter->drawstate->join_type = PL_JOIN_BEVEL; else if (strcmp( s, "triangular") == 0) _plotter->drawstate->join_type = PL_JOIN_TRIANGULAR; else /* unknown, so silently switch to default mode (via recursive call) */ return _API_joinmod (R___(_plotter) _default_drawstate.join_mode); return 0; } /* Below is the miterlimit method, which is a GNU extension to libplot. It sets a drawing attribute: the miter limit of polylines subsequently drawn on the display device. This attribute controls the treatment of corners when the join mode is set to "miter". At a join point of a wide polyline, the `miter length' is defined to be the distance between the inner corner and the outer corner. The miter limit is the maximum value that can be tolerated for the miter length divided by the line width. If this value is exceeded, the miter will be `cut off': the "bevel" join mode will be used instead. Examples of typical values for the miter limit are 10.43 (the unchangeable value used by the X Window System, which cuts off miters at join angles less than 11 degrees), 5.0 (the default value used by HP-GL/2 and PCL 5 devices, which cuts off miters at join angles less than 22.1 degrees), 2.0 (cuts off miters at join angles less than 60 degrees), 1.414 (cuts off miters at join angles less than 90 degrees), and 1.0 (cuts off all miters). In general, the miter limit is the cosecant of one-half of the minimum join angle for mitering, and values less than 1.0 are meaningless. For example, 10.43 is csc((11 degrees)/2) = 1 / sin((11 degrees)/2). Mitering is allowed to take place if 1 / sin(theta/2) <= MITERLIMIT, i.e. sin(theta/2) >= 1/MITERLIMIT, where theta > 0 is the join angle. */ int _API_fmiterlimit (R___(Plotter *_plotter) double new_miter_limit) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "flinewidth: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ if (new_miter_limit < 1.0) /* reset to default */ new_miter_limit = PL_DEFAULT_MITER_LIMIT; /* set the new miter limit in the drawing state */ _plotter->drawstate->miter_limit = new_miter_limit; return 0; } /* Below is the orientation method, which is a GNU extension to libplot. It sets a drawing attribute: whether or not closed paths of the three built-in types (rectangles, circles, ellipses) should be drawn counterclockwise or clockwise. The former is the default. */ /* This attribute-setting method, though path-related, doesn't invoke _API_endpath() to end the compound path under construction (if any). That's because it makes sense to invoke this method between the simple paths of a compound path. */ int _API_orientation (R___(Plotter *_plotter) int direction) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "orientation: invalid operation"); return -1; } if (direction != 1 && direction != -1) /* OOB switches to default */ direction = _default_drawstate.orientation; _plotter->drawstate->orientation = direction; return 0; } /* Below is the fillmod method, which is a GNU extension to libplot. It sets a drawing attribute: the fill rule used when subsequently drawing filled objects, i.e., the rule used to determine which points are `inside'. In principle, both the `odd winding number' rule and the `nonzero winding number' rule are supported. The former is the default. */ int _API_fillmod (R___(Plotter *_plotter) const char *s) { const char *default_s; char *fill_rule; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fillmod: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* determine default fill rule (can't just read from default drawing state, because not all Plotters support both standard rules) */ default_s = _default_drawstate.fill_rule; if (strcmp (default_s, "even-odd") == 0 && _plotter->data->have_odd_winding_fill == 0) default_s = "nonzero-winding"; else if (strcmp (default_s, "nonzero-winding") == 0 && _plotter->data->have_nonzero_winding_fill == 0) default_s = "even-odd"; /* null pointer resets to default */ if ((!s) || !strcmp(s, "(null)")) s = default_s; free ((char *)_plotter->drawstate->fill_rule); fill_rule = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (fill_rule, s); _plotter->drawstate->fill_rule = fill_rule; if ((strcmp (s, "even-odd") == 0 || strcmp (s, "alternate") == 0) && _plotter->data->have_odd_winding_fill) _plotter->drawstate->fill_rule_type = PL_FILL_ODD_WINDING; else if ((strcmp (s, "nonzero-winding") == 0 || strcmp (s, "winding") == 0) && _plotter->data->have_nonzero_winding_fill) _plotter->drawstate->fill_rule_type = PL_FILL_NONZERO_WINDING; else /* unknown, so silently switch to default fill rule (via recursive call) */ _API_fillmod (R___(_plotter) default_s); return 0; } plotutils-2.6/libplot/g_bez.c0000644000175000017500000002131211037243260013235 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the bezier2 and bezier3 methods, which are GNU extensions to libplot. Each of them draws an object: a quadratic and a cubic Bezier path segment, respectively. */ #include "sys-defines.h" #include "extern.h" int _API_fbezier2 (R___(Plotter *_plotter) double x0, double y0, double x1, double y1, double x2, double y2) { int prev_num_segments; plPoint p0, p1, p2; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fbezier2: invalid operation"); return -1; } if (_plotter->drawstate->path != (plPath *)NULL && (_plotter->drawstate->path->type != PATH_SEGMENT_LIST || (_plotter->drawstate->path->type == PATH_SEGMENT_LIST && _plotter->drawstate->path->primitive))) /* There's a simple path under construction (so that endsubpath() must not have been invoked), and it contains a closed primitive (box/circle/ellipse). So flush out the whole compound path. (It may include other, previously drawn simple paths.) */ _API_endpath (S___(_plotter)); /* if new segment not contiguous, move to its starting point (first flushing out the compound path under construction, if any) */ if (x0 != _plotter->drawstate->pos.x || y0 != _plotter->drawstate->pos.y) { if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); _plotter->drawstate->pos.x = x0; _plotter->drawstate->pos.y = y0; } p0.x = x0; p0.y = y0; p1.x = x1; p1.y = y1; p2.x = x2; p2.y = y2; if (_plotter->drawstate->path == (plPath *)NULL) /* begin a new path, of segment list type */ { _plotter->drawstate->path = _new_plPath (); prev_num_segments = 0; _add_moveto (_plotter->drawstate->path, p0); } else prev_num_segments = _plotter->drawstate->path->num_segments; /* Trivial case: if linemode is "disconnected", just plot a line segment from (x0,y0) to (x2,y2). Only the endpoints will appear on the display. */ if (!_plotter->drawstate->points_are_connected) _add_line (_plotter->drawstate->path, p2); /* Another trivial case: treat a zero-length arc as a line segment */ else if (x0 == x2 && y0 == y2) _add_line (_plotter->drawstate->path, p2); else /* standard (non-trivial) case */ { /* if segment buffer is occupied by a single arc, replace arc by a polyline if that's called for (Plotter-dependent) */ if (_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 2) { _pl_g_maybe_replace_arc (S___(_plotter)); if (_plotter->drawstate->path->num_segments > 2) prev_num_segments = 0; } /* add new quadratic Bezier segment to the path buffer */ if (_plotter->data->allowed_quad_scaling == AS_ANY) /* add as a primitive element, since it's allowed */ _add_bezier2 (_plotter->drawstate->path, p1, p2); else if (_plotter->data->allowed_cubic_scaling == AS_ANY) /* add quadratic Bezier as a cubic Bezier, since it's allowed */ { /* (control points need to be computed) */ plPoint p, pc, pd; p.x = x2; p.y = y2; pc.x = (2.0 * x1 + x0) / 3.0; pc.y = (2.0 * y1 + y0) / 3.0; pd.x = (2.0 * x1 + x2) / 3.0; pd.y = (2.0 * y1 + y2) / 3.0; _add_bezier3 (_plotter->drawstate->path, pc, pd, p); } else /* add quadratic Bezier segment as a polygonal approximation */ _add_bezier2_as_lines (_plotter->drawstate->path, p1, p2); } /* move to endpoint */ _plotter->drawstate->pos = p2; /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) prev_num_segments); /* If the path is getting too long (and it doesn't have to be filled), flush it out by invoking endpath(), and begin a new one. `Too long' is Plotter-dependent; some don't do this flushing at all. */ if ((_plotter->drawstate->path->num_segments >= _plotter->data->max_unfilled_path_length) && (_plotter->drawstate->fill_type == 0) && _plotter->path_is_flushable (S___(_plotter))) _API_endpath (S___(_plotter)); return 0; } int _API_fbezier3 (R___(Plotter *_plotter) double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3) { int prev_num_segments; plPoint p0, p1, p2, p3; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fbezier3: invalid operation"); return -1; } if (_plotter->drawstate->path != (plPath *)NULL && (_plotter->drawstate->path->type != PATH_SEGMENT_LIST || (_plotter->drawstate->path->type == PATH_SEGMENT_LIST && _plotter->drawstate->path->primitive))) /* There's a simple path under construction (so that endsubpath() must not have been invoked), and it contains a closed primitive (box/circle/ellipse). So flush out the whole compound path. (It may include other, previously drawn simple paths.) */ _API_endpath (S___(_plotter)); /* if new segment not contiguous, move to its starting point (first flushing out the compound path under construction, if any) */ if (x0 != _plotter->drawstate->pos.x || y0 != _plotter->drawstate->pos.y) { if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); _plotter->drawstate->pos.x = x0; _plotter->drawstate->pos.y = y0; } p0.x = x0; p0.y = y0; p1.x = x1; p1.y = y1; p2.x = x2; p2.y = y2; p3.x = x3; p3.y = y3; if (_plotter->drawstate->path == (plPath *)NULL) /* begin a new path, of segment list type */ { _plotter->drawstate->path = _new_plPath (); prev_num_segments = 0; _add_moveto (_plotter->drawstate->path, p0); } else prev_num_segments = _plotter->drawstate->path->num_segments; /* Trivial case: if linemode is "disconnected", just plot a line segment from (x0,y0) to (x2,y2). Only the endpoints will appear on the display. */ if (!_plotter->drawstate->points_are_connected) _add_line (_plotter->drawstate->path, p3); /* Another trivial case: treat a zero-length arc as a line segment */ else if (x0 == x3 && y0 == y3) _add_line (_plotter->drawstate->path, p3); else /* standard (non-trivial) case */ { /* if segment buffer is occupied by a single arc, replace arc by a polyline if that's called for (Plotter-dependent) */ if (_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 2) { _pl_g_maybe_replace_arc (S___(_plotter)); if (_plotter->drawstate->path->num_segments > 2) prev_num_segments = 0; } /* add new cubic Bezier segment to the segment buffer */ if (_plotter->data->allowed_cubic_scaling == AS_ANY) /* add as a primitive element, since it's allowed */ _add_bezier3 (_plotter->drawstate->path, p1, p2, p3); else /* add cubic Bezier segment as a polygonal approximation */ _add_bezier3_as_lines (_plotter->drawstate->path, p1, p2, p3); } /* move to endpoint */ _plotter->drawstate->pos = p3; /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) prev_num_segments); /* If the path is getting too long (and it doesn't have to be filled), flush it out by invoking endpath(), and begin a new one. `Too long' is Plotter-dependent; some don't do this flushing at all. */ if ((_plotter->drawstate->path->num_segments >= _plotter->data->max_unfilled_path_length) && (_plotter->drawstate->fill_type == 0) && _plotter->path_is_flushable (S___(_plotter))) _API_endpath (S___(_plotter)); return 0; } plotutils-2.6/libplot/g_box.c0000644000175000017500000001014611037243260013250 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the box method, which is a standard part of libplot. It draws an object: a box, or upright rectangle with diagonal corners x0,y0 and x1,y1. Boxes are one of the three types of primitive closed path that libplot supports, along with circles and ellipses. */ /* Most Plotters obviously require that the map from the user frame to the device frame preserve coordinate axes, in order to draw a box as a primitive (if it isn't, what results will be rotated or skewed). The constraints on the user frame -> device frame map (e.g., it must preserve axes) are specified by the internal `allowed_box_scaling' parameter, which this code checks. */ #include "sys-defines.h" #include "extern.h" int _API_fbox (R___(Plotter *_plotter) double x0, double y0, double x1, double y1) { double xnew, ynew; plPoint p0, p1; bool clockwise; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fbox: invalid operation"); return -1; } /* If a simple path is under construction (so that endsubpath() must not have been invoked), flush out the whole compound path. (It may include other, previously drawn simple paths.) */ if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); /* begin a new path */ _plotter->drawstate->path = _new_plPath (); p0.x = x0; p0.y = y0; p1.x = x1; p1.y = y1; clockwise = _plotter->drawstate->orientation < 0 ? true : false; if (!_plotter->drawstate->points_are_connected) /* line type is `disconnected': just plot a pseudo-box consisting of four line segments, which will ultimately be displayed (see g_endpath.c) as four filled circles (one at each vertex) */ _add_box_as_lines (_plotter->drawstate->path, p0, p1, clockwise); else /* general case */ { /* Add box to path buffer, as a primitive only if (1) this Plotter supports box primitives, and (2) it isn't to be edged, or if it's to be edged solid (not dashed). The latter restriction is to prevent confusion over the starting point, along the edge of box, for the dashing pattern. */ if ((_plotter->drawstate->pen_type == 0 /* not edged */ || (_plotter->drawstate->dash_array_in_effect == false && _plotter->drawstate->line_type == PL_L_SOLID)) /* solid edge */ && ((_plotter->data->allowed_box_scaling == AS_ANY) || (_plotter->data->allowed_box_scaling == AS_AXES_PRESERVED && _plotter->drawstate->transform.axes_preserved))) /* add box as a primitive */ _add_box (_plotter->drawstate->path, p0, p1, clockwise); else /* add box as a polyline */ _add_box_as_lines (_plotter->drawstate->path, p0, p1, clockwise); if (_plotter->drawstate->path->type == PATH_SEGMENT_LIST) /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) 0); } /* move to center (libplot convention) */ xnew = 0.5 * (x0 + x1); ynew = 0.5 * (y0 + y1); _plotter->drawstate->pos.x = xnew; _plotter->drawstate->pos.y = ynew; return 0; } plotutils-2.6/libplot/g_circ.c0000644000175000017500000001064311037243260013402 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the circle method, which is a standard part of libplot. It draws an object: a circle with center x,y and radius r. Circles are one of the three types of primitive closed path that libplot supports, along with boxes and ellipses. */ /* Most Plotters obviously require that the map from the user frame to the device frame be uniform, in order to draw a circle as a primitive (if it isn't, what results will be an ellipse). The constraints on the user frame -> device frame map (e.g., it must be uniform) are specified by the internal `allowed_circle_scaling' parameter, which this code checks. */ #include "sys-defines.h" #include "extern.h" int _API_fcircle (R___(Plotter *_plotter) double x, double y, double r) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fcircle: invalid operation"); return -1; } /* If a simple path is under construction (so that endsubpath() must not have been invoked), flush out the whole compound path. (It may include other, previously drawn simple paths.) */ if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); if (!_plotter->drawstate->points_are_connected) /* line type is `disconnected', so do nothing (libplot convention) */ { } else /* general case */ { plPoint pc; bool clockwise; /* begin a new path */ _plotter->drawstate->path = _new_plPath (); /* place circle in path buffer */ pc.x = x; pc.y = y; clockwise = _plotter->drawstate->orientation < 0 ? true : false; if ((_plotter->data->allowed_circle_scaling == AS_ANY) || (_plotter->data->allowed_circle_scaling == AS_UNIFORM && _plotter->drawstate->transform.uniform)) /* place circle as a primitive, since this Plotter supports drawing circles as primitives */ _add_circle (_plotter->drawstate->path, pc, r, clockwise); else if ((_plotter->data->allowed_ellipse_scaling == AS_ANY) || (_plotter->data->allowed_ellipse_scaling == AS_AXES_PRESERVED && _plotter->drawstate->transform.axes_preserved)) /* place circle as an ellipse, since this Plotter supports drawing ellipses as primitives */ _add_ellipse (_plotter->drawstate->path, pc, r, r, 0.0, clockwise); else if (_plotter->data->allowed_ellarc_scaling == AS_ANY || (_plotter->data->allowed_ellarc_scaling == AS_AXES_PRESERVED && _plotter->drawstate->transform.axes_preserved)) /* draw circle by placing four elliptical arcs into path buffer (allowed since this Plotter supports elliptical arcs) */ _add_circle_as_ellarcs (_plotter->drawstate->path, pc, r, clockwise); else if (_plotter->data->allowed_cubic_scaling == AS_ANY) /* draw circle by placing four cubic Beziers into path buffer (allowed since this Plotter supports cubic Beziers) */ _add_circle_as_bezier3s (_plotter->drawstate->path, pc, r, clockwise); else /* draw a polygonal approximation to the circle */ _add_circle_as_lines (_plotter->drawstate->path, pc, r, clockwise); if (_plotter->drawstate->path->type == PATH_SEGMENT_LIST) /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) 0); } /* move to center (libplot convention) */ _plotter->drawstate->pos.x = x; _plotter->drawstate->pos.y = y; return 0; } plotutils-2.6/libplot/g_clipper.c0000644000175000017500000000764711037243260014132 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* bit fields for return value from Cohen-Sutherland clipper */ enum { ACCEPTED = 0x1, CLIPPED_FIRST = 0x2, CLIPPED_SECOND = 0x4 }; /* for internal clipper use */ enum { TOP = 0x1, BOTTOM = 0x2, RIGHT = 0x4, LEFT = 0x8 }; /* forward references */ static int compute_outcode (double x, double y, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip); /* _clip_line() takes two points, the endpoints of a line segment in the * device frame (expressed in terms of floating-point device coordinates), * and destructively passes back two points: the endpoints of the line * segment clipped by Cohen-Sutherland to the rectangular clipping area. * The return value contains bitfields ACCEPTED, CLIPPED_FIRST, and * CLIPPED_SECOND. */ int _clip_line (double *x0_p, double *y0_p, double *x1_p, double *y1_p, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip) { double x0 = *x0_p; double y0 = *y0_p; double x1 = *x1_p; double y1 = *y1_p; int outcode0, outcode1; bool accepted; int clipval = 0; outcode0 = compute_outcode (x0, y0, x_min_clip, x_max_clip, y_min_clip, y_max_clip); outcode1 = compute_outcode (x1, y1, x_min_clip, x_max_clip, y_min_clip, y_max_clip); for ( ; ; ) { if (!(outcode0 | outcode1)) /* accept */ { accepted = true; break; } else if (outcode0 & outcode1) /* reject */ { accepted = false; break; } else { /* at least one endpoint is outside; choose one that is */ int outcode_out = (outcode0 ? outcode0 : outcode1); double x, y; /* intersection with clip edge */ if (outcode_out & RIGHT) { x = x_max_clip; y = y0 + (y1 - y0) * (x_max_clip - x0) / (x1 - x0); } else if (outcode_out & LEFT) { x = x_min_clip; y = y0 + (y1 - y0) * (x_min_clip - x0) / (x1 - x0); } else if (outcode_out & TOP) { x = x0 + (x1 - x0) * (y_max_clip - y0) / (y1 - y0); y = y_max_clip; } else { x = x0 + (x1 - x0) * (y_min_clip - y0) / (y1 - y0); y = y_min_clip; } if (outcode_out == outcode0) { x0 = x; y0 = y; outcode0 = compute_outcode (x0, y0, x_min_clip, x_max_clip, y_min_clip, y_max_clip); } else { x1 = x; y1 = y; outcode1 = compute_outcode (x1, y1, x_min_clip, x_max_clip, y_min_clip, y_max_clip); } } } if (accepted) { clipval |= ACCEPTED; if ((x0 != *x0_p) || (y0 != *y0_p)) clipval |= CLIPPED_FIRST; if ((x1 != *x1_p) || (y1 != *y1_p)) clipval |= CLIPPED_SECOND; *x0_p = x0; *y0_p = y0; *x1_p = x1; *y1_p = y1; } return clipval; } static int compute_outcode (double x, double y, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip) { int code = 0; if (x > x_max_clip) code |= RIGHT; else if (x < x_min_clip) code |= LEFT; if (y > y_max_clip) code |= TOP; else if (y < y_min_clip) code |= BOTTOM; return code; } plotutils-2.6/libplot/g_closepl.c0000644000175000017500000001373111037243260014124 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the closepl method, which is a standard part of libplot. It closes a Plotter object. */ /* This generic version does only basic mechanics, since GenericPlotters don't emit any graphics code. */ #include "sys-defines.h" #include "extern.h" int _API_closepl (S___(Plotter *_plotter)) { bool emit_not_just_the_first_page = true; bool retval1; int retval2 = 0; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "closepl: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* pop drawing states in progress, if any, off the stack */ if (_plotter->drawstate->previous != NULL) { while (_plotter->drawstate->previous) _API_restorestate (S___(_plotter)); } /* invoke Plotter-specific method to end the page; also do device-dependent teardown Plotter-specific drawing state variables, do reinitialization of Plotter-specific Plotter variables, and create page header and trailer if any */ retval1 = _plotter->end_page (S___(_plotter)); /* remove first drawing state too, so we can start afresh */ _pl_g_delete_first_drawing_state (S___(_plotter)); switch ((int)_plotter->data->output_model) { case (int)PL_OUTPUT_NONE: /* we don't do output, so just delete the page buffer (presumably it includes neither a header nor a trailer) */ if (_plotter->data->page) _delete_outbuf (_plotter->data->page); _plotter->data->page = (plOutbuf *)NULL; break; case (int)PL_OUTPUT_ONE_PAGE: emit_not_just_the_first_page = false; /* fall through */ case (int)PL_OUTPUT_ONE_PAGE_AT_A_TIME: if (_plotter->data->page && (emit_not_just_the_first_page || _plotter->data->page_number == 1)) { /* emit page header if any */ if (_plotter->data->page->header && _plotter->data->page->header->len > 0) _write_string (_plotter->data, _plotter->data->page->header->base); /* emit all the graphics on the page */ if (_plotter->data->page && _plotter->data->page->len > 0) _write_string (_plotter->data, _plotter->data->page->base); /* emit page trailer if any */ if (_plotter->data->page->trailer && _plotter->data->page->trailer->len > 0) _write_string (_plotter->data, _plotter->data->page->trailer->base); /* attempt to flush (will test whether stream is jammed) */ retval2 = _API_flushpl (S___(_plotter)); } /* delete page header if any */ if (_plotter->data->page->header) _delete_outbuf (_plotter->data->page->header); _plotter->data->page->header = (plOutbuf *)NULL; /* delete page trailer if any */ if (_plotter->data->page->trailer) _delete_outbuf (_plotter->data->page->trailer); _plotter->data->page->trailer = (plOutbuf *)NULL; /* delete page's plOutbuf */ if (_plotter->data->page) _delete_outbuf (_plotter->data->page); _plotter->data->page = (plOutbuf *)NULL; break; case (int)PL_OUTPUT_PAGES_ALL_AT_ONCE: /* Plotter will do its own output, in its terminate() routine. It will do so by writing out the contents of all its cached pages (a new one gets added to the list each time openpl() is invoked). So do nothing. */ break; case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES: case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME: /* Plotter does its own output, and doesn't use libplot's plOutbuf-based output system. So do nothing, except attempt to flush (will test whether stream is jammed) */ retval2 = _API_flushpl (S___(_plotter)); break; case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM: /* Plotter doesn't use libplot's plOutbuf-based output system, and in fact doesn't send output to a stream at all. So do nothing: don't attempt to flush output; the drawing state [including Plotter-specific data] has already been deleted, so there may not be enough information to perform a flush. This is an issue with X Plotters in particular. */ break; default: /* shouldn't happen */ break; } _plotter->data->open = false; /* flag device as closed */ if (retval1 == false || retval2 < 0) return -1; else return 0; } /* Plotter-specific teardowns and reinitializations that take place when closepl() is invoked. In a generic Plotter, this does nothing. */ bool _pl_g_end_page (S___(Plotter *_plotter)) { return true; } void _pl_g_delete_first_drawing_state (S___(Plotter *_plotter)) { /* elements of state that are strings or arrays are freed separately */ free ((char *)_plotter->drawstate->fill_rule); free ((char *)_plotter->drawstate->line_mode); free ((char *)_plotter->drawstate->join_mode); free ((char *)_plotter->drawstate->cap_mode); free ((char *)_plotter->drawstate->true_font_name); free ((char *)_plotter->drawstate->font_name); /* free dash array too, if nonempty */ if (_plotter->drawstate->dash_array_len > 0) free ((double *)_plotter->drawstate->dash_array); /* free the state itself */ free (_plotter->drawstate); _plotter->drawstate = NULL; } plotutils-2.6/libplot/g_colors.c0000644000175000017500000004105711037243260013766 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains color methods that are GNU extensions to libplot: pencolor, fillcolor, bgcolor, and the convenience function, color. It also contains _grayscale_approx(), which computes grayscale approximations to RGB colors. */ /* It also includes the pencolorname, fillcolorname, and bgcolorname methods, which are GNU extensions to libplot; also the convenience function colorname. They search a database of known names (stored in g_colorname.h) for a specified color name. If the name is found, its interpretation as a 48-bit RGB color is determined, and pencolor, fillcolor, or bgcolor is called to set the color. If the name is not found, a default color (black for pen and fill, white for bg) is substituted. */ #include "sys-defines.h" #include "extern.h" #include "g_colorname.h" /* forward references */ static bool string_to_precise_color (const char *name, plColor *color_p); /* The pencolor method, which is a GNU extension to libplot. It sets a drawing attribute: the pen color (``foreground color'') of objects created in the drawing operations that follow. The fill color may be set separately, by invoking fillcolor() and filltype(). We use the RGB color model. In principle we support 48-bit color (16 bits, i.e. 0x0000 through 0xffff, for each of red, green, and blue). */ int _API_pencolor (R___(Plotter *_plotter) int red, int green, int blue) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "pencolor: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ if ((red > 0xffff) || (green > 0xffff) || (blue > 0xffff)) /* OOB switches to default */ { red = _default_drawstate.fgcolor.red; green = _default_drawstate.fgcolor.green; blue = _default_drawstate.fgcolor.blue; } if (_plotter->data->emulate_color) /* replace by grayscale approximation */ red = green = blue = _grayscale_approx (red, green, blue); /* save our notion of foreground color */ _plotter->drawstate->fgcolor.red = red; _plotter->drawstate->fgcolor.green = green; _plotter->drawstate->fgcolor.blue = blue; return 0; } /* The fillcolor method, which is a GNU extension to libplot. It sets a drawing attribute: the fill color of objects created in the following drawing operations. Actually the true fill color (if filling is not disabled) will be a desaturated version of the user-specified fill color. The desaturation level is set by invoking filltype(). In principle we support 48-bit color (16 bits, i.e. 0x0000 through 0xffff, for each of red, green, and blue). */ int _API_fillcolor (R___(Plotter *_plotter) int red, int green, int blue) { double red_d, green_d, blue_d; double desaturate; plColor new_rgb; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fillcolor: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ if ((red > 0xffff) || (green > 0xffff) || (blue > 0xffff)) /* OOB switches to default */ { red = _default_drawstate.fillcolor.red; green = _default_drawstate.fillcolor.green; blue = _default_drawstate.fillcolor.blue; } if (_plotter->data->emulate_color) /* replace by grayscale approximation */ red = green = blue = _grayscale_approx (red, green, blue); /* save the basic fillcolor (i.e. the base fillcolor, unaffected by the fill type) */ _plotter->drawstate->fillcolor_base.red = red; _plotter->drawstate->fillcolor_base.green = green; _plotter->drawstate->fillcolor_base.blue = blue; if (_plotter->drawstate->fill_type == 0) /* won't be doing filling, so stop right here */ return 0; /* update fillcolor, taking fill type into account */ /* scale each RGB from a 16-bit quantity to range [0.0,1.0] */ red_d = ((double)red)/0xFFFF; green_d = ((double)green)/0xFFFF; blue_d = ((double)blue)/0xFFFF; /* fill_type, if nonzero, specifies the extent to which the nominal fill color should be desaturated. 1 means no desaturation, 0xffff means complete desaturation (white). */ desaturate = ((double)_plotter->drawstate->fill_type - 1.)/0xFFFE; red_d = red_d + desaturate * (1.0 - red_d); green_d = green_d + desaturate * (1.0 - green_d); blue_d = blue_d + desaturate * (1.0 - blue_d); /* restore each RGB to a 16-bit quantity (48 bits in all) */ new_rgb.red = IROUND(0xFFFF * red_d); new_rgb.green = IROUND(0xFFFF * green_d); new_rgb.blue = IROUND(0xFFFF * blue_d); /* store actual fill color in drawing state */ _plotter->drawstate->fillcolor = new_rgb; return 0; } /* convenience function */ int _API_color (R___(Plotter *_plotter) int red, int green, int blue) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "color: invalid operation"); return -1; } _API_pencolor (R___(_plotter) red, green, blue); _API_fillcolor (R___(_plotter) red, green, blue); return 0; } /* The bgcolor method, which is a GNU extension to libplot. It sets a drawing attribute: the background color. We use the RGB color model. In principle we support 48-bit color (16 bits, i.e. 0x0000 through 0xffff, for each of red, green, and blue). */ int _API_bgcolor (R___(Plotter *_plotter) int red, int green, int blue) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "bgcolor: invalid operation"); return -1; } if ((red > 0xffff) || (green > 0xffff) || (blue > 0xffff)) /* OOB switches to default */ { red = _default_drawstate.bgcolor.red; green = _default_drawstate.bgcolor.green; blue = _default_drawstate.bgcolor.blue; } if (_plotter->data->emulate_color) /* replace by grayscale approximation */ red = green = blue = _grayscale_approx (red, green, blue); /* save our notion of background color */ _plotter->drawstate->bgcolor.red = red; _plotter->drawstate->bgcolor.green = green; _plotter->drawstate->bgcolor.blue = blue; return 0; } /* compute a 16-bit grayscale approximation to a 48-bit RGB; optionally used by pencolorname, fillcolorname, bgcolorname methods */ int _grayscale_approx (int red, int green, int blue) { double gray; /* compute CIE luminance according to Rec. 709 */ gray = 0.212671 * red + 0.715160 * green + 0.072169 * blue; return IROUND(gray); } /* Below are the pencolorname, fillcolorname, and bgcolorname methods, which are GNU extensions to libplot. They search a database of known names (stored in g_colorname.h) for a specified color name. If the name is found, its interpretation as a 48-bit RGB color is determined, and pencolor, fillcolor, or bgcolor is called to set the color. If the name is not found, a default color (black for pen and fill, white for bg) is substituted. The lowest-level routine is _string_to_color(). */ int _API_pencolorname (R___(Plotter *_plotter) const char *name) { plColor color; int intred, intgreen, intblue; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "pencolorname: invalid operation"); return -1; } /* null pointer ignored */ if (!name) return 0; /* RGB values for default pen color */ intred = _default_drawstate.fgcolor.red; intgreen = _default_drawstate.fgcolor.green; intblue = _default_drawstate.fgcolor.blue; if (_string_to_color (name, &color, _plotter->data->color_name_cache)) { unsigned int red, green, blue; red = color.red; green = color.green; blue = color.blue; /* to convert from 24-bit to 48-bit color, double bytes */ intred = (red << 8) | red; intgreen = (green << 8) | green; intblue = (blue << 8) | blue; } else if (_plotter->data->pen_color_warning_issued == false) { char *buf; buf = (char *)_pl_xmalloc (strlen (name) + 100); sprintf (buf, "substituting \"black\" for undefined pen color \"%s\"", name); _plotter->warning (R___(_plotter) buf); free (buf); _plotter->data->pen_color_warning_issued = true; } _API_pencolor (R___(_plotter) intred, intgreen, intblue); return 0; } int _API_fillcolorname (R___(Plotter *_plotter) const char *name) { plColor color; int intred, intgreen, intblue; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fillcolorname: invalid operation"); return -1; } /* null pointer ignored */ if (!name) return 0; /* RGB values for default fill color */ intred = _default_drawstate.fillcolor.red; intgreen = _default_drawstate.fillcolor.green; intblue = _default_drawstate.fillcolor.blue; if (_string_to_color (name, &color, _plotter->data->color_name_cache)) { unsigned int red, green, blue; red = color.red; green = color.green; blue = color.blue; /* to convert from 24-bit to 48-bit color, double bytes */ intred = (red << 8) | red; intgreen = (green << 8) | green; intblue = (blue << 8) | blue; } else if (_plotter->data->fill_color_warning_issued == false) { char *buf; buf = (char *)_pl_xmalloc (strlen (name) + 100); sprintf (buf, "substituting \"black\" for undefined fill color \"%s\"", name); _plotter->warning (R___(_plotter) buf); free (buf); _plotter->data->fill_color_warning_issued = true; } _API_fillcolor (R___(_plotter) intred, intgreen, intblue); return 0; } /* convenience function */ int _API_colorname (R___(Plotter *_plotter) const char *name) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "colorname: invalid operation"); return -1; } _API_pencolorname (R___(_plotter) name); _API_fillcolorname (R___(_plotter) name); return 0; } int _API_bgcolorname (R___(Plotter *_plotter) const char *name) { plColor color; int intred, intgreen, intblue; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "bgcolorname: invalid operation"); return -1; } /* null pointer ignored */ if (!name) return 0; if (strcmp (name, "none") == 0) /* turn off background (some Plotters can implement this) */ { _plotter->drawstate->bgcolor_suppressed = true; /* treat as default, for benefit of Plotters that can't */ name = "white"; } else _plotter->drawstate->bgcolor_suppressed = false; /* RGB values for default color [white, presumably] */ intred = _default_drawstate.bgcolor.red; intgreen = _default_drawstate.bgcolor.green; intblue = _default_drawstate.bgcolor.blue; if (_string_to_color (name, &color, _plotter->data->color_name_cache)) { unsigned int red, green, blue; red = color.red; green = color.green; blue = color.blue; /* to convert from 24-bit to 48-bit color, double bytes */ intred = (red << 8) | red; intgreen = (green << 8) | green; intblue = (blue << 8) | blue; } else if (_plotter->data->bg_color_warning_issued == false) { char *buf; buf = (char *)_pl_xmalloc (strlen (name) + 100); sprintf (buf, "substituting \"white\" for undefined background color \"%s\"", name); _plotter->warning (R___(_plotter) buf); free (buf); _plotter->data->bg_color_warning_issued = true; } _API_bgcolor (R___(_plotter) intred, intgreen, intblue); return 0; } /* _string_to_color() searches a database of known color names, in g_colorname.h, for a specified string. Matches are case-insensitive and ignore spaces. The retrieved RGB components are returned via a pointer. We don't wish to search through the entire (long) color database. (It contains 600+ color name strings.) So any Plotter maintains a cache of previously found colors. */ bool _string_to_color (const char *name, plColor *color_p, plColorNameCache *color_name_cache) { plColor color; plCachedColorNameInfo **cached_colors_p; bool found = false; char *squeezed_name, *nptr; const plColorNameInfo *info, *found_info = NULL; const char *optr; plCachedColorNameInfo *cached_info; if (name == NULL) /* avoid core dumps */ return false; if (color_name_cache == NULL) /* avoid core dumps */ return false; /* first check whether string is of the form "#ffffff" */ if (string_to_precise_color (name, &color)) { *color_p = color; return true; } /* copy string, removing spaces */ squeezed_name = (char *)_pl_xmalloc (strlen (name) + 1); optr = name, nptr = squeezed_name; while (*optr) { if (*optr == '\0') break; if (*optr != ' ') *nptr++ = *optr; optr++; } *nptr = '\0'; /* Search our list of cached, previously used color names, doing string comparison. If this were only for use by the X11 driver, we'd use XrmPermStringToQuark to get a faster-compared representation. */ cached_colors_p = &color_name_cache->cached_colors; cached_info = *cached_colors_p; while (cached_info) { if (strcasecmp (cached_info->info->name, squeezed_name) == 0) { found = true; found_info = cached_info->info; break; } cached_info = cached_info->next; } if (!found) /* not previously used, so search master colorname table (this is slower) */ { info = _pl_g_colornames; /* start at head of list in g_colorname.h */ while (info->name) { if (strcasecmp (info->name, squeezed_name) == 0) { found = true; found_info = info; break; } info++; } if (found) /* copy to head of cached color list */ { plCachedColorNameInfo *old_cached_colors, *cached_colors; old_cached_colors = *cached_colors_p; cached_colors = (plCachedColorNameInfo *)_pl_xmalloc (sizeof (plCachedColorNameInfo)); cached_colors->next = old_cached_colors; cached_colors->info = found_info; *cached_colors_p = cached_colors; } } free (squeezed_name); if (found) { color_p->red = found_info->red; color_p->green = found_info->green; color_p->blue = found_info->blue; } return found; } /* Attempt to map a string to a 24-bit RGB; this will work if the string is of the form "#ffffff". */ static bool string_to_precise_color (const char *name, plColor *color_p) { const char *good_hex_digits = "0123456789abcdefABCDEF"; int i, num_assigned; if (name == (const char *)NULL || *name != '#') return false; for (i = 1; i <= 8 ; i++) { bool found; const char *cp; if (name[i] == '\0') break; cp = good_hex_digits; found = false; while (*cp) { if (name[i] == *cp) { found = true; break; } cp++; } if (found == false) return false; } if (i != 7) return false; /* okay, have something like "#ffffff"; can now safely use scanf() */ num_assigned = sscanf (name, "#%2x%2x%2x", &(color_p->red), &(color_p->green), &(color_p->blue)); return (num_assigned == 3 ? true : false); } /* The cache of color names is currently implemented as a linked list. */ plColorNameCache * _create_color_name_cache (void) { plColorNameCache *new_cache; new_cache = (plColorNameCache *)_pl_xmalloc(sizeof(plColorNameCache)); new_cache->cached_colors = NULL; return new_cache; } void _delete_color_name_cache (plColorNameCache *color_name_cache) { plCachedColorNameInfo *colorptr; if (color_name_cache == (plColorNameCache *)NULL) return; colorptr = color_name_cache->cached_colors; while (colorptr != NULL) /* free linked list */ { plCachedColorNameInfo *next_colorptr; next_colorptr = colorptr->next; free (colorptr); colorptr = next_colorptr; } free (color_name_cache); /* free structure itself */ } plotutils-2.6/libplot/g_cntrlify.c0000644000175000017500000006615511037243260014325 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* _pl_g_controlify() converts a "label" (i.e. a character string), which may contain troff-like escape sequences, into a string of unsigned shorts. The possible troff-like escape sequences are listed in g_cntrlify.h. This conversion is to facilitate rendering. _pl_g_controlify() is called by alabel(), and the converted label is rendered by _alabel_standard(), _alabel_stroke(), or _alabel_device(), depending on what sort of font is currently selected. See g_alabel.c (_pl_g_controlify() is called by labelwidth() too). If the currently selected font is a font with ISO-Latin-1 encoding, the valid escape sequences include escape sequences for the non-ASCII ISO-Latin-1 characters. Also allowed are such escape sequences as \f0, \f1, \f2, \f3, \f4, etc., which switch among the various fonts in the current typeface: \f1 Switch to font #1, basic \f2 Switch to font #2, italic \f3 Switch to font #3, bold \f4 Switch to font #4, bold italic \f0 Switch to font #0, symbol (including Greek characters) \fP switches to the previously used font (there is a depth-1 stack, i.e. only one previous font is remembered, as in troff). All typefaces include at least two fonts: fonts #0 and #1. Some may include more than the above five. Each unsigned short in the converted string is really an annotated character: the low byte is the character, and the high byte is the font number. Besides font annotations, the controlified string may include control codes (unsigned shorts with particular bit patterns in their high bytes), which are produced by the escape sequences: \sp start superscript \ep end superscript \sb start subscript \eb end subscript \mk mark location \rt return to mark [useful e.g. for underlining, and filling square roots] There are also control codes for horizontal shifts. \r1, \r2, \r4, \r6, \r8, \r^ will produce control codes that will shift right by 1 em, 1/2 em, 1/4 em, 1/6 em, 1/8 em, 1/12 em, respectively. \l1, \l2, \l4, \l6, \l8, \l^ are similar. The string of unsigned shorts, which is returned, is allocated with malloc and may be freed later. */ #include "sys-defines.h" #include "extern.h" #include "g_control.h" #include "g_cntrlify.h" #include "g_jis.h" /* these two array lengths must agree with values in file g_her_glyph.c */ #define NUM_OCCIDENTAL_HERSHEY_GLYPHS 4400 #define NUM_ORIENTAL_HERSHEY_GLYPHS 5500 unsigned short * _pl_g_controlify (R___(Plotter *_plotter) const unsigned char *src) { unsigned short *dest; unsigned char c, d; unsigned char esc[3]; int j = 0; /* index into destination string */ int raw_fontnum, raw_symbol_fontnum; int previous_raw_fontnum; /* implement depth-1 stack */ unsigned short fontword, symbol_fontword; /* note: string length can grow by a factor of 6, because a single printable character can be mapped to a sequence of unsigned shorts, of length up to 6 (see comment below) */ dest = (unsigned short *)_pl_xmalloc ((6 * strlen ((char *)src) + 1) * sizeof(unsigned short)); /* Determine initial number of font, as index into low-level table in g_fontdb.c, and the initial value for the shifted `font word' which we'll OR with each character; also same, for associated symbol font. May be updated by \f0, \f1, etc. */ switch (_plotter->drawstate->font_type) { case PL_F_POSTSCRIPT: default: raw_fontnum = _pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts[_plotter->drawstate->font_index]; raw_symbol_fontnum = _pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts[0]; break; case PL_F_PCL: raw_fontnum = _pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts[_plotter->drawstate->font_index]; raw_symbol_fontnum = _pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts[0]; break; case PL_F_STICK: raw_fontnum = _pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts[_plotter->drawstate->font_index]; raw_symbol_fontnum = _pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts[0]; break; case PL_F_HERSHEY: raw_fontnum = _pl_g_hershey_typeface_info[_plotter->drawstate->typeface_index].fonts[_plotter->drawstate->font_index]; raw_symbol_fontnum = _pl_g_hershey_typeface_info[_plotter->drawstate->typeface_index].fonts[0]; break; case PL_F_OTHER: /* no real font table in this case; by convention font #1 internally means the current device-specific font and #0 is an associated symbol font */ raw_fontnum = 1; raw_symbol_fontnum = 0; break; } /* Of the following two words, `fontword' is updated whenever an escape sequence like \f0, \f1, \f2 etc. is seen, since raw_fontnum is itself updated. But `symbol_fontword' is fixed */ fontword = ((unsigned short)raw_fontnum) << FONT_SHIFT; symbol_fontword = ((unsigned short)raw_symbol_fontnum) << FONT_SHIFT; /* Implement depth-1 stack of fonts, for use by \fP macro */ previous_raw_fontnum = raw_fontnum; while (*src != (unsigned char)'\0') { /* If EUC, check first for high bit and process two-byte characters separately. This approach is awkward (we duplicate a lot of code here, which appears elsewhere below). */ if ((raw_fontnum == PL_HERSHEY_EUC) && (*src & 0x80) && (*(src + 1) & 0x80)) { unsigned char jis_row = *src & ~(0x80); unsigned char jis_col = *(src + 1) & ~(0x80); if (GOOD_JIS_INDEX(jis_row, jis_col)) { int jis_glyphindex = 256 * jis_row + jis_col; if (jis_glyphindex >= BEGINNING_OF_KANJI) /* in Kanji range, so check if we have it */ { #ifndef NO_KANJI const struct kanjipair *kanji = _builtin_kanji_glyphs; bool matched = false; while (kanji->jis != 0) { if (jis_glyphindex == kanji->jis) { matched = true; break; } kanji++; } if (matched) { dest[j++] = RAW_ORIENTAL_HERSHEY_GLYPH | (kanji->nelson); src += 2; continue; /* back to top of while loop */ } else /* a Kanji we don't have */ { /* render as standard `undefined character' glyph */ dest[j++] = RAW_HERSHEY_GLYPH | UNDE; src += 2; continue; /* back to top of while loop */ } #endif /* not NO_KANJI */ } else /* not in Kanji range, so look for it in char table */ { const struct jis_entry *char_mapping = _builtin_jis_chars; bool matched = false; while (char_mapping->jis != 0) { if (jis_glyphindex == char_mapping->jis) { matched = true; break; } char_mapping++; } if (matched) /* the entry in the character table maps the JIS character to a character (in 0..255 range) in one of the fonts in the master table in g_fontdb.c */ { int fontnum = char_mapping->font; unsigned short charnum = char_mapping->charnum; if (charnum & RAW_HERSHEY_GLYPH) /* a raw Hershey glyph, not in any font */ dest[j++] = RAW_HERSHEY_GLYPH | charnum; else /* a character in one of the fonts in g_fontdb.c */ dest[j++] = (((unsigned short)fontnum) << FONT_SHIFT) | charnum; src += 2; continue; /* back to top of while loop */ } else /* a character we don't have */ { /* render as standard `undefined character' glyph */ dest[j++] = RAW_HERSHEY_GLYPH | UNDE; src += 2; continue; /* back to top of while loop */ } } } else /* JIS index is OOB */ { src += 2; continue; /* back to top of while loop */ } } /* if current font is Hershey, first try to match each ligature pattern (no ligatures supported in non-Hershey fonts) */ if (_plotter->drawstate->font_type == PL_F_HERSHEY) { int i; bool matched = false; for (i = 0; i < NUM_LIGATURES; i++) if ((_ligature_tbl[i].font == raw_fontnum) && (strncmp ((char *)src, _ligature_tbl[i].from, strlen (_ligature_tbl[i].from)) == 0)) { matched = true; break; } if (matched) { dest[j++] = fontword | (unsigned short)_ligature_tbl[i].byte; src += strlen (_ligature_tbl[i].from); continue; /* back to top of while loop */ } } c = *(src++); /* no ligature, so get single new char */ if (c != (unsigned char)'\\') /* ordinary char, may pass through */ { /* if current font is an ISO-Latin-1 Hershey font ... */ if (_plotter->drawstate->font_type == PL_F_HERSHEY && _pl_g_hershey_font_info[raw_fontnum].iso8859_1) { int i; bool matched = false; /* check if this is a `raised' ISO-Latin-1 character */ for (i = 0; i < NUM_RAISED_CHARS; i++) if (c == _raised_char_tbl[i].from) { matched = true; break; } if (matched) /* it's a raised character */ { /* map to string of unsigned shorts, length 3 or 6: `begin superscript' control code, [`mark' control code,] replacement char, [`return' control code, underline,] `end superscript' */ dest[j++] = (unsigned short) (CONTROL_CODE | C_BEGIN_SUPERSCRIPT); if (_raised_char_tbl[i].underscored) /* also underline */ { dest[j++] = (unsigned short) (CONTROL_CODE | C_PUSH_LOCATION); dest[j++] = fontword | (unsigned short)_raised_char_tbl[i].to; dest[j++] = (unsigned short) (CONTROL_CODE | C_POP_LOCATION); /* select appropriate HersheySymbol font */ dest[j++] = symbol_fontword | (unsigned short)VECTOR_SYMBOL_FONT_UNDERSCORE; } else /* just print raised char, no underline */ dest[j++] = fontword | (unsigned short)_raised_char_tbl[i].to; dest[j++] = (unsigned short) (CONTROL_CODE | C_END_SUPERSCRIPT); continue; /* back to top of while loop */ } /* since current font is an ISO-Latin-1 Hershey font, also check if this char should be deligatured */ for (i = 0; i < NUM_DELIGATURED_CHARS; i++) if (c == _deligature_char_tbl[i].from) { matched = true; break; } if (matched) { if (_deligature_char_tbl[i].except_font != raw_fontnum) { dest[j++] = fontword | (unsigned short)_deligature_char_tbl[i].to[0]; dest[j++] = fontword | (unsigned short)_deligature_char_tbl[i].to[1]; continue; /* back to top of while loop */ } } } /* didn't do anything special, so just pass the character thru */ dest[j++] = fontword | (unsigned short)c; continue; /* back to top of while loop */ } else /* character is a backslash */ { c = *(src++); /* grab next character */ if (c == (unsigned char)'\0') /* ASCII NUL ? */ { dest[j++] = fontword | (unsigned short)'\\'; break; /* string terminated with a backslash */ } if (c == (unsigned char)'\\') { dest[j++] = fontword | (unsigned short)'\\'; dest[j++] = fontword | (unsigned short)'\\'; continue; /* saw \\, leave as is */ } d = *(src++); if (d == (unsigned char)'\0') { dest[j++] = fontword | (unsigned short)'\\'; dest[j++] = fontword | (unsigned short)c; break; /* string terminated with \c */ } esc[0] = c; esc[1] = d; esc[2] = (unsigned char)'\0'; /* have an escape sequence */ /* is this an escape seq. (e.g. \#H0001) for a raw Hershey glyph? */ if (_plotter->drawstate->font_type == PL_F_HERSHEY && esc[0] == '#' && esc[1] == 'H' && src[0] >= '0' && src[0] <= '9' && src[1] >= '0' && src[1] <= '9' && src[2] >= '0' && src[2] <= '9' && src[3] >= '0' && src[3] <= '9') { int glyphindex; glyphindex = (src[3] - '0') + 10 * (src[2] - '0') + 100 * (src[1] - '0') + 1000 * (src[0] - '0'); if (glyphindex < NUM_OCCIDENTAL_HERSHEY_GLYPHS) { dest[j++] = RAW_HERSHEY_GLYPH | glyphindex; src += 4; continue; /* back to top of while loop */ } } #ifndef NO_KANJI /* is this an escape seq. (e.g. \#N0001) for a raw Japanese Hershey glyph (Kanji), as numbered in Nelson's dictionary? */ if (_plotter->drawstate->font_type == PL_F_HERSHEY && esc[0] == '#' && esc[1] == 'N' && src[0] >= '0' && src[0] <= '9' && src[1] >= '0' && src[1] <= '9' && src[2] >= '0' && src[2] <= '9' && src[3] >= '0' && src[3] <= '9') { int glyphindex; glyphindex = (src[3] - '0') + 10 * (src[2] - '0') + 100 * (src[1] - '0') + 1000 * (src[0] - '0'); if (glyphindex < NUM_ORIENTAL_HERSHEY_GLYPHS) { dest[j++] = RAW_ORIENTAL_HERSHEY_GLYPH | glyphindex; src += 4; continue; /* back to top of while loop */ } } #endif /* not NO_KANJI */ /* is this an escape seq. (e.g. \#J0001) for a raw Japanese Hershey glyph (JIS numbering, in hex)? */ if (_plotter->drawstate->font_type == PL_F_HERSHEY && esc[0] == '#' && esc[1] == 'J' && ((src[0] >= '0' && src[0] <= '9') || (src[0] >= 'a' && src[0] <= 'f') || (src[0] >= 'A' && src[0] <= 'F')) && ((src[1] >= '0' && src[1] <= '9') || (src[1] >= 'a' && src[1] <= 'f') || (src[1] >= 'A' && src[1] <= 'F')) && ((src[2] >= '0' && src[2] <= '9') || (src[2] >= 'a' && src[2] <= 'f') || (src[2] >= 'A' && src[2] <= 'F')) && ((src[3] >= '0' && src[3] <= '9') || (src[3] >= 'a' && src[3] <= 'f') || (src[3] >= 'A' && src[3] <= 'F'))) { int jis_glyphindex; int i, hexnum[4]; int jis_row, jis_col; for (i = 0; i < 4; i++) if (src[i] >= 'a' && src[i] <= 'f') hexnum[i] = 10 + src[i] - 'a'; else if (src[i] >= 'A' && src[i] <= 'F') hexnum[i] = 10 + src[i] - 'A'; else /* a decimal digit */ hexnum[i] = src[i] - '0'; jis_glyphindex = (hexnum[3] + 16 * hexnum[2] + 256 * hexnum[1] + 4096 * hexnum[0]); jis_row = hexnum[1] + 16 * hexnum[0]; jis_col = hexnum[3] + 16 * hexnum[2]; if (GOOD_JIS_INDEX(jis_row, jis_col)) { if (jis_glyphindex >= BEGINNING_OF_KANJI) /* in Kanji range, so check if we have it */ { #ifndef NO_KANJI const struct kanjipair *kanji = _builtin_kanji_glyphs; bool matched = false; while (kanji->jis != 0) { if (jis_glyphindex == kanji->jis) { matched = true; break; } kanji++; } if (matched) { dest[j++] = RAW_ORIENTAL_HERSHEY_GLYPH | (kanji->nelson); src += 4; continue; /* back to top of while loop */ } else /* a Kanji we don't have */ { /* render as standard `undefined character' glyph */ dest[j++] = RAW_HERSHEY_GLYPH | UNDE; src += 4; continue; /* back to top of while loop */ } #endif /* not NO_KANJI */ } else /* not in Kanji range, so look for it in char table */ { const struct jis_entry *char_mapping = _builtin_jis_chars; bool matched = false; while (char_mapping->jis != 0) { if (jis_glyphindex == char_mapping->jis) { matched = true; break; } char_mapping++; } if (matched) /* the entry in the character table maps the JIS character to a character (in 0..255 range) in one of the fonts in the master table in g_fontdb.c*/ { int fontnum = char_mapping->font; unsigned short charnum = char_mapping->charnum; if (charnum & RAW_HERSHEY_GLYPH) /* a raw Hershey glyph, not in any font */ dest[j++] = RAW_HERSHEY_GLYPH | charnum; else /* a character in one of the fonts in g_fontdb.c */ dest[j++] = (((unsigned short)fontnum) << FONT_SHIFT) | charnum; src += 4; continue; /* back to top of while loop */ } else /* a character we don't have */ { /* render as standard `undefined character' glyph */ dest[j++] = RAW_HERSHEY_GLYPH | UNDE; src += 4; continue; /* back to top of while loop */ } } } } { int i; bool matched = false; /* is this an escape seq. for a control code? */ for (i = 0; i < NUM_CONTROLS; i++) if (strcmp ((char *)esc, _control_tbl[i]) == 0) { matched = true; break; } if (matched) /* it's a control code */ { dest[j++] = CONTROL_CODE | i; continue; /* back to top of while loop */ } } /* if current font is an ISO-Latin-1 Hershey font, is this an escape sequence for an 8-bit (non-ASCII) char, which due to nonexistence should be deligatured? */ if (_plotter->drawstate->font_type == PL_F_HERSHEY && _pl_g_hershey_font_info[raw_fontnum].iso8859_1) { int i; bool matched = false; for (i = 0; i < NUM_DELIGATURED_ESCAPES; i++) if (strcmp ((char *)esc, _deligature_escape_tbl[i].from) == 0) { matched = true; break; } if (matched) { if (_deligature_escape_tbl[i].except_font != raw_fontnum) { dest[j++] = fontword | (unsigned short)_deligature_escape_tbl[i].to[0]; dest[j++] = fontword | (unsigned short)_deligature_escape_tbl[i].to[1]; continue; /* back to top of while loop */ } } } /* if the current font is an ISO-Latin-1 font (no matter whether font is a a Hershey font, a PS or PCL/Stick font, or a device-specific font for which we have no table entry), is this an escape seq. for an 8-bit (non-ASCII) ISO8859-1 char? */ if ((_plotter->drawstate->font_type == PL_F_POSTSCRIPT && _pl_g_ps_font_info[raw_fontnum].iso8859_1) || (_plotter->drawstate->font_type == PL_F_HERSHEY && _pl_g_hershey_font_info[raw_fontnum].iso8859_1) || (_plotter->drawstate->font_type == PL_F_PCL && _pl_g_pcl_font_info[raw_fontnum].iso8859_1) || (_plotter->drawstate->font_type == PL_F_STICK && _pl_g_stick_font_info[raw_fontnum].iso8859_1) || (_plotter->drawstate->font_type == PL_F_OTHER && _plotter->drawstate->font_is_iso8859_1 && raw_fontnum == 1)) { int i; bool matched = false; for (i = 0; i < NUM_ISO_ESCAPES; i++) if (strcmp ((char *)esc, _iso_escape_tbl[i].string) == 0) { matched = true; break; } if (matched) /* it's an 8-bit ISO8859-1 character */ { /* certain such characters are drawn in the Hershey fonts as superscripts */ if (_plotter->drawstate->font_type == PL_F_HERSHEY) { int k; bool matched2 = false; /* check if this is a `raised' ISO-Latin-1 character */ for (k = 0; k < NUM_RAISED_CHARS; k++) if (_iso_escape_tbl[i].byte == _raised_char_tbl[k].from) { matched2 = true; break; } if (matched2) /* it's a raised character */ { /* map to string of unsigned shorts, length 3 or 6: `begin superscript' control code, [`mark' control code,] replacement char, [`return' control code, underline,] `end superscript' */ dest[j++] = (unsigned short) (CONTROL_CODE | C_BEGIN_SUPERSCRIPT); if (_raised_char_tbl[k].underscored) /* also underline */ { dest[j++] = (unsigned short) (CONTROL_CODE | C_PUSH_LOCATION); dest[j++] = fontword | (unsigned short)_raised_char_tbl[k].to; dest[j++] = (unsigned short) (CONTROL_CODE | C_POP_LOCATION); /* select appropriate HersheySymbol font */ dest[j++] = symbol_fontword | (unsigned short)VECTOR_SYMBOL_FONT_UNDERSCORE; } else /* just print raised char, no underline */ { dest[j++] = fontword | (unsigned short)_raised_char_tbl[k].to; } dest[j++] = (unsigned short) (CONTROL_CODE | C_END_SUPERSCRIPT); continue; /* back to top of while loop */ } } /* won't draw this char as a superscript; just pass thru */ dest[j++] = fontword | (unsigned short)(_iso_escape_tbl[i].byte); continue; /* back to top of while loop */ } } /* is this an escape seq. for a `special' (non-ISO, non-Symbol) Hershey glyph? Such glyphs include astronomical signs, and `final s'. */ if (_plotter->drawstate->font_type == PL_F_HERSHEY) { int i; bool matched = false; for (i = 0; i < NUM_SPECIAL_ESCAPES; i++) if (strcmp ((char *)esc, _special_escape_tbl[i].string) == 0) { matched = true; break; } if (matched) /* it's a special character */ { /* "\s-" is special; yields character in current font */ if (_special_escape_tbl[i].byte == FINAL_LOWERCASE_S) dest[j++] = fontword | (unsigned short)(_special_escape_tbl[i].byte); else /* we select symbol font of typeface, in which we've stored all other special characters */ dest[j++] = symbol_fontword | (unsigned short)(_special_escape_tbl[i].byte); continue; /* back to top of while loop */ } } { int i; bool matched = false; /* Irrespective of font type, is this an escape seq. for a char in the font's corresponding symbol font? */ for (i = 0; i < NUM_SYMBOL_ESCAPES; i++) if (strcmp (_symbol_escape_tbl[i].string, "NO_ABBREV") != 0 && strcmp ((char *)esc, _symbol_escape_tbl[i].string) == 0) { matched = true; break; } if (matched) /* it's a character in the symbol font */ { /* select symbol font by OR'ing in the symbol fontword */ dest[j++] = symbol_fontword | (unsigned short)(_symbol_escape_tbl[i].byte); continue; /* back to top of while loop */ } } /* Gross kludge. In the non-Hershey fonts we handle the "\rn" control sequence in a painful way. For a PS font we map it into (1) a left shift, (2) the `radicalex' character in the PS Symbol font, and (3) a right shift. Shift distances are taken from the bbox of the radicalex char, and are slightly larger than 0.5 em. For a PCL font it's similar, but the shifts are much smaller. The reason it's different for PCL is that the PCL radicalex character is different from the PS radicalex character: the overbar is not displaced. Possibly someone at HP made a mistake while reimplementing the Adobe Symbol font for PCL 5? We don't implement \rn for Stick fonts, because they have no associated symbol font. */ if (strcmp ((char *)esc, "rn") == 0) { if (_plotter->drawstate->font_type == PL_F_POSTSCRIPT || _plotter->drawstate->font_type == PL_F_PCL) { dest[j++] = (unsigned short)(CONTROL_CODE | C_LEFT_RADICAL_SHIFT); /* take `radicalex' glyph from PS symbol font */ dest[j++] = symbol_fontword | (unsigned short)RADICALEX; dest[j++] = (unsigned short)(CONTROL_CODE | C_RIGHT_RADICAL_SHIFT); continue; /* back to top of while loop */ } } /* Attempt to parse as a font-change command, i.e. as one of the macros \f0, \f1, \f2, etc., or \fP. \fR, \fI, \fB are the same as \f1, \f2, \f3 for troff compatibility. */ if (esc[0] == 'f' && ((esc[1] >= '0' && esc[1] <= '9') || esc[1] == 'P' || esc[1] == 'R' || esc[1] == 'I' || esc[1] == 'B')) { /* If a user-specified, device-specific font [e.g. an X font, for which we have no internal table listing the other fonts in its family] is being used, we can't really do font switching, except via \f0, \f1. These switch to the X symbol font and the current user-specified font, respectively. (\fP is also supported.) */ if (_plotter->drawstate->font_type == PL_F_OTHER && ((esc[1] >= '2' && esc[1] <= '9') || esc[1] == 'I' || esc[1] == 'B')) esc[1] = '1'; /* treat as \f1 */ /* troff compatibility */ if (esc[1] == 'R') esc[1] = '1'; else if (esc[1] == 'I') esc[1] = '2'; else if (esc[1] == 'B') esc[1] = '3'; if (esc[1] == 'P') /* \fP seen, so go back to previous font */ raw_fontnum = previous_raw_fontnum; else /* font specified as index into typeface */ { int new_font_index = esc[1] - '0'; /* switch to specified font (OOB tests here now obsolete?) */ previous_raw_fontnum = raw_fontnum; switch (_plotter->drawstate->font_type) { case PL_F_HERSHEY: if ((new_font_index >= _pl_g_hershey_typeface_info[_plotter->drawstate->typeface_index].numfonts) || new_font_index < 0) new_font_index = 1; /* OOB -> use default font */ raw_fontnum = _pl_g_hershey_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index]; break; case PL_F_PCL: if ((new_font_index >= _pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].numfonts) || new_font_index < 0) new_font_index = 1; /* OOB -> use default font */ raw_fontnum = _pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index]; break; case PL_F_STICK: if ((new_font_index >= _pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].numfonts) || new_font_index < 0) new_font_index = 1; /* OOB -> use default font */ raw_fontnum = _pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index]; break; case PL_F_POSTSCRIPT: default: if ((new_font_index >= _pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].numfonts) || new_font_index < 0) new_font_index = 1; /* OOB -> use default font */ raw_fontnum = _pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts[new_font_index]; break; case PL_F_OTHER: if (new_font_index != 0 && new_font_index != 1) new_font_index = 1; /* OOB -> use default font */ raw_fontnum = new_font_index; break; } } fontword = ((unsigned short)raw_fontnum) << FONT_SHIFT; continue; /* back to top of while loop */ } /* couldn't match; unknown escape seq., so pass through unchanged */ dest[j++] = fontword | (unsigned short)'\\'; dest[j++] = fontword | (unsigned short)c; dest[j++] = fontword | (unsigned short)d; } } dest[j] = (unsigned short)'\0'; /* terminate string */ return dest; } int _codestring_len (const unsigned short *codestring) { int i = 0; while (*codestring) { i++; codestring++; } return i; } plotutils-2.6/libplot/g_dash.c0000644000175000017500000000416711037243260013405 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the linedash method, which is a GNU extension to libplot. It sets a drawing attribute: the dash array used for subsequent drawing of paths. */ #include "sys-defines.h" #include "extern.h" int _API_flinedash (R___(Plotter *_plotter) int n, const double *dashes, double offset) { double *dash_array; int i; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "flinedash: invalid operation"); return -1; } if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); /* flush path if any */ /* sanity checks */ if (n < 0 || (n > 0 && dashes == NULL)) return -1; for (i = 0; i < n; i++) if (dashes[i] < 0.0) return -1; if (_plotter->drawstate->dash_array_len > 0) free ((double *)_plotter->drawstate->dash_array); if (n > 0) dash_array = (double *)_pl_xmalloc (n * sizeof(double)); else dash_array = NULL; _plotter->drawstate->dash_array_len = n; for (i = 0; i < n; i++) dash_array[i] = dashes[i]; _plotter->drawstate->dash_array = dash_array; _plotter->drawstate->dash_offset = offset; /* for future paths, use dash array rather than line mode */ _plotter->drawstate->dash_array_in_effect = true; return 0; } plotutils-2.6/libplot/g_dash2.c0000644000175000017500000000725511037243260013470 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines GNU libplot's builtin line styles. A line style is specified by invoking the linemod() operation. The supported line styles are a superset of the line styles of traditional (Unix) libplot. Unix libplot originated at Bell Labs in the early 1970's, and the first supported display device was a Tektronix 611 storage scope. The libplot API did not originally include linemod(), as the Unix Version 5 manual makes clear. That is because the Tektronix 611 did not have any predefined set of line styles. linemod() was added to the API slightly later, when it was extended to support the Tektronix 4010/4014 storage scope. The 4010/4014 provided hardware support for the five line styles "solid" through "longdashed". GNU libplot supports the traditional five, and also two additional line styles, "dotdotdashed" and "dotdotdotdashed". Each non-solid style is defined as a dash pattern, with the length of each dash (drawn or not drawn) being an integer multiple of the line width. This `scaling by line width' applies for sufficiently wide lines, at least. GNU libplot also supports a special "disconnected" line style (if a path is disconnected, it's drawn as a sequence of filled circles, one at each of the path join points). */ #include "sys-defines.h" #include "extern.h" /* An array of dashes for each line type (dashes are cylically used, on/off/on/off...). Types must appear in a special order: it must agree with our internal numbering, i.e. must agree with the definitions of L_{SOLID,DOTTED,DOTDASHED,SHORTDASHED,LONGDASHED,DOTDOTDASHED etc.} in extern.h, which are 0,1,2,3,4,5 etc. respectively. */ const plLineStyle _pl_g_line_styles[PL_NUM_LINE_TYPES] = /* Dash arrays for "dotted" through "longdashed" below are those used by the Tektronix emulator in xterm(1), except that the emulator seems incorrectly to have on and off interchanged (!). */ { { "solid", PL_L_SOLID, 0, {0} }, /* dummy */ { "dotted", PL_L_DOTTED, 2, {1, 3} }, { "dotdashed", PL_L_DOTDASHED, 4, {4, 3, 1, 3} }, { "shortdashed", PL_L_SHORTDASHED, 2, {4, 4} }, { "longdashed", PL_L_LONGDASHED, 2, {7, 4} }, { "dotdotdashed", PL_L_DOTDOTDASHED, 6, {4, 3, 1, 3, 1, 3} }, { "dotdotdotdashed", PL_L_DOTDOTDOTDASHED, 8, {4, 3, 1, 3, 1, 3, 1, 3} } }; /* N.B. `ps4014', the Tektronix->PS translator in Adobe's Transcript package, uses { 1, 2 }, { 8, 2, 1, 2 }, { 2, 2 }, { 12, 2 } for "dotted" through "longdashed", instead. */ /* N.B. A genuine Tektronix 4014 (with Enhanced Graphics Module) uses { 1, 1 }, { 5, 1, 1, 1 }, { 3, 1 }, { 6, 2 } for "dotted" through "longdashed", instead. See the Tektronix 4014 Service Instruction Manual (dated Aug. 1974) for the diode array that produces these patterns. */ plotutils-2.6/libplot/g_defplot.c0000644000175000017500000004563611037243260014131 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any generic Plotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" /* additional include files for DJGPP */ #ifdef MSDOS #include /* for setmode() */ #include /* for O_BINARY */ #include /* for isatty() */ #endif /* global library variables (user-settable error handlers) */ #ifndef LIBPLOTTER int (*pl_libplot_warning_handler)(const char *) = NULL; int (*pl_libplot_error_handler)(const char *) = NULL; #else /* LIBPLOTTER */ int (*pl_libplotter_warning_handler)(const char *) = NULL; int (*pl_libplotter_error_handler)(const char *) = NULL; #endif /* LIBPLOTTER */ /* The following variables (_plotters, _plotters_len) are global variables in libplot, but static data members of the Plotter class in libplotter. That's arranged by #ifdefs's in extern.h. */ /* Sparse array of pointers to Plotter instances, and its size. Initialized to a NULL pointer, and 0, respectively. Accessed by _g_initialize() and _g_terminate() in this file, and by g_flush() in g_flushpl.c. */ Plotter **_plotters = NULL; int _plotters_len = 0; /* initial size for _plotters[], the sparse array of pointers to Plotter instances */ #define INITIAL_PLOTTERS_LEN 4 /* Mutex for locking _plotters[] and _plotters_len. A global variable in both libplot and libplotter. */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H pthread_mutex_t _plotters_mutex = PTHREAD_MUTEX_INITIALIZER; #endif #endif /* Pointer to distinguished (global) PlotterParams object, used by the old (non-thread-safe) bindings. In libplotter, this is a static data member of the Plotter class. That's arranged by an #ifdef in extern.h. */ PlotterParams *_old_api_global_plotter_params = NULL; #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a Plotter struct. */ const Plotter _pl_g_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_g_initialize, _pl_g_terminate, /* page manipulation */ _pl_g_begin_page, _pl_g_erase_page, _pl_g_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_g_paint_path, _pl_g_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_g_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, invoked when a Plotter is created. It does such things as initializing capability flags from the values of class variables, allocating storage, etc. In the C binding, when this is invoked _plotter points to the Plotter that has just been created. In the C++ binding, this is a function member of the Plotter class, and _plotter is an alias for `this'. */ void _pl_g_initialize (S___(Plotter *_plotter)) { bool open_slot = false; int i, j; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the global variables _plotters[] and _plotters_len */ pthread_mutex_lock (&_plotters_mutex); #endif #endif /* ensure plotter instance array is set up */ if (_plotters_len == 0) { _plotters = (Plotter **)_pl_xmalloc (INITIAL_PLOTTERS_LEN * sizeof(Plotter *)); for (i = 0; i < INITIAL_PLOTTERS_LEN; i++) _plotters[i] = (Plotter *)NULL; _plotters_len = INITIAL_PLOTTERS_LEN; } /* be sure there is an open slot (slot i) */ for (i = 0; i < _plotters_len; i++) if (_plotters[i] == NULL) { open_slot = true; break; } if (!open_slot) /* expand array, clearing upper half */ { i = _plotters_len; _plotters = (Plotter **)_pl_xrealloc (_plotters, 2 * _plotters_len * sizeof (Plotter *)); for (j = _plotters_len; j < 2 * _plotters_len; j++) _plotters[j] = (Plotter *)NULL; _plotters_len *= 2; } /* place just-created Plotter in open slot */ _plotters[i] = _plotter; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the global variables _plotters[] and _plotters_len */ pthread_mutex_unlock (&_plotters_mutex); #endif #endif /* Initialize all data members (except in/out/err streams and device driver parameters). */ #ifndef LIBPLOTTER /* tag field, will differ in derived classes */ _plotter->data->type = PL_GENERIC; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_NONE; /* I/O, will not differ in derived classes */ _plotter->data->page = (plOutbuf *)NULL; _plotter->data->first_page = (plOutbuf *)NULL; /* basic data members, will not differ in derived classes */ _plotter->data->open = false; _plotter->data->opened = false; _plotter->data->page_number = 0; _plotter->data->fontsize_invoked = false; _plotter->data->linewidth_invoked = false; _plotter->data->frame_number = 0; /* drawing state stack (initially empty; same in derived classes) */ _plotter->drawstate = (plDrawState *)NULL; /* warnings, will not differ in derived classes */ _plotter->data->font_warning_issued = false; _plotter->data->pen_color_warning_issued = false; _plotter->data->fill_color_warning_issued = false; _plotter->data->bg_color_warning_issued = false; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 1; _plotter->data->have_escaped_string_support = 1; _plotter->data->have_ps_fonts = 1; _plotter->data->have_pcl_fonts = 1; _plotter->data->have_stick_fonts = 1; _plotter->data->have_extra_stick_fonts = 0; /* specific to HP-GL version "1.5" */ _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user) */ _plotter->data->default_font_type = PL_F_HERSHEY; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->kern_stick_fonts = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal) */ _plotter->data->max_unfilled_path_length = PL_MAX_UNFILLED_PATH_LENGTH; _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_NONE; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_NONE; _plotter->data->allowed_circle_scaling = AS_NONE; _plotter->data->allowed_ellipse_scaling = AS_NONE; /* color-related parameters (also internal) */ _plotter->data->emulate_color = false; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_REAL; _plotter->data->flipped_y = false; _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 1.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 1.0; _plotter->data->page_data = (plPageData *)NULL; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* create, initialize cache of color name -> RGB correspondences */ _plotter->data->color_name_cache = _create_color_name_cache (); /* initialize certain data members from values of relevant device driver parameters */ /* emulate color by using grayscale? */ { const char *emulate_s; emulate_s = (const char *)_get_plot_param (_plotter->data, "EMULATE_COLOR"); if (strcmp (emulate_s, "yes") == 0) _plotter->data->emulate_color = true; else _plotter->data->emulate_color = false; } /* set maximum polyline length (relevant to most Plotters, esp. those that do not do real time output) */ { const char *length_s; int local_length; length_s = (const char *)_get_plot_param (_plotter->data, "MAX_LINE_LENGTH"); if (sscanf (length_s, "%d", &local_length) <= 0 || local_length <= 0) { length_s = (const char *)_get_default_plot_param ("MAX_LINE_LENGTH"); sscanf (length_s, "%d", &local_length); } _plotter->data->max_unfilled_path_length = local_length; } /* Ensure widths of labels rendered in the Stick fonts are correctly computed. This is a kludge (in pre-HP-GL/2, Stick fonts were kerned; see g_alabel.c.) */ { const char *version_s; version_s = (const char *)_get_plot_param (_plotter->data, "HPGL_VERSION"); if (strcmp (version_s, "2") == 0) /* modern HP-GL/2 (default) */ _plotter->data->kern_stick_fonts = false; else if (strcmp (version_s, "1.5") == 0) /* HP7550A */ _plotter->data->kern_stick_fonts = true; else if (strcmp (version_s, "1") == 0) /* generic HP-GL */ _plotter->data->kern_stick_fonts = true; /* meaningless (no stick fonts) */ } #ifdef MSDOS /* A DJGPP enhancement (thanks, Michel de Ruiter). If the output fp is standard output, and standard output has been redirected to a file, then set the output mode to binary. This turns off character mapping, which is a necessity when writing binary output formats such as GIF or Tektronix. If the output fp is a (FILE *) other than standard output, then whoever opened it is responsible for having opened it with mode "wb" instead of "wt" or "w". */ if (_plotter->data->outfp && (_plotter->data->outfp == stdout) && O_BINARY && !isatty (fileno (stdout))) { fflush (stdout); setmode (fileno (stdout), O_BINARY); } #endif } /* The private `terminate' method, which is invoked when a Plotter is deleted, provided that it is non-NULL. It may do such things as write to an output stream from internal storage, deallocate storage, etc. */ void _pl_g_terminate (S___(Plotter *_plotter)) { int i; /* if specified plotter is open, close it */ if (_plotter->data->open) _API_closepl (S___(_plotter)); /* free instance-specific copies of class parameters */ _pl_g_free_params_in_plotter (S___(_plotter)); /* free color name cache */ _delete_color_name_cache (_plotter->data->color_name_cache); /* remove Plotter from sparse Plotter array */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the global variables _plotters[] and _plotters_len */ pthread_mutex_lock (&_plotters_mutex); #endif #endif for (i = 0; i < _plotters_len; i++) if (_plotters[i] == _plotter) { _plotters[i] = (Plotter *)NULL; break; } #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the global variables _plotters[] and _plotters_len */ pthread_mutex_unlock (&_plotters_mutex); #endif #endif } #ifdef LIBPLOTTER /* OLD API; not thread-safe (these ctors take values for Plotter parameters from the global PlotterParams struct) */ Plotter::Plotter (FILE *infile, FILE *outfile, FILE *errfile) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = infile; _plotter->data->outfp = outfile; _plotter->data->errfp = errfile; _plotter->data->instream = NULL; _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the current values of device driver parameters */ if (_old_api_global_plotter_params == NULL) _old_api_global_plotter_params = new PlotterParams; _pl_g_copy_params_to_plotter (_old_api_global_plotter_params); _pl_g_initialize (); } Plotter::Plotter (FILE *outfile) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = outfile; _plotter->data->errfp = NULL; _plotter->data->instream = NULL; _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the current values of device driver parameters */ if (_old_api_global_plotter_params == NULL) _old_api_global_plotter_params = new PlotterParams; _pl_g_copy_params_to_plotter (_old_api_global_plotter_params); _pl_g_initialize (); } Plotter::Plotter (istream& in, ostream& out, ostream& err) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = NULL; _plotter->data->errfp = NULL; if (in.rdbuf()) _plotter->data->instream = ∈ else _plotter->data->instream = NULL; if (out.rdbuf()) _plotter->data->outstream = &out; else _plotter->data->outstream = NULL; if (err.rdbuf()) _plotter->data->errstream = &err; else _plotter->data->errstream = NULL; /* copy in the current values of device driver parameters */ if (_old_api_global_plotter_params == NULL) _old_api_global_plotter_params = new PlotterParams; _pl_g_copy_params_to_plotter (_old_api_global_plotter_params); _pl_g_initialize (); } Plotter::Plotter (ostream& out) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = NULL; _plotter->data->errfp = NULL; _plotter->data->instream = NULL; if (out.rdbuf()) _plotter->data->outstream = &out; else _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the current values of device driver parameters */ if (_old_api_global_plotter_params == NULL) _old_api_global_plotter_params = new PlotterParams; _pl_g_copy_params_to_plotter (_old_api_global_plotter_params); _pl_g_initialize (); } Plotter::Plotter () { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = NULL; _plotter->data->errfp = NULL; _plotter->data->instream = NULL; _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the current values of device driver parameters */ if (_old_api_global_plotter_params == NULL) _old_api_global_plotter_params = new PlotterParams; _pl_g_copy_params_to_plotter (_old_api_global_plotter_params); _pl_g_initialize (); } /* NEW API; thread-safe (since user can specify a local PlotterParams struct from which parameters should be taken) */ Plotter::Plotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams &plotter_params) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = infile; _plotter->data->outfp = outfile; _plotter->data->errfp = errfile; _plotter->data->instream = NULL; _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the specified values of device driver parameters */ _pl_g_copy_params_to_plotter (&plotter_params); _pl_g_initialize (); } Plotter::Plotter (FILE *outfile, PlotterParams &plotter_params) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = outfile; _plotter->data->errfp = NULL; _plotter->data->instream = NULL; _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the specified values of device driver parameters */ _pl_g_copy_params_to_plotter (&plotter_params); _pl_g_initialize (); } Plotter::Plotter (istream& in, ostream& out, ostream& err, PlotterParams &plotter_params) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = NULL; _plotter->data->errfp = NULL; if (in.rdbuf()) _plotter->data->instream = ∈ else _plotter->data->instream = NULL; if (out.rdbuf()) _plotter->data->outstream = &out; else _plotter->data->outstream = NULL; if (err.rdbuf()) _plotter->data->errstream = &err; else _plotter->data->errstream = NULL; /* copy in the specified values of device driver parameters */ _pl_g_copy_params_to_plotter (&plotter_params); _pl_g_initialize (); } Plotter::Plotter (ostream& out, PlotterParams &plotter_params) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = NULL; _plotter->data->errfp = NULL; _plotter->data->instream = NULL; if (out.rdbuf()) _plotter->data->outstream = &out; else _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the specified values of device driver parameters */ _pl_g_copy_params_to_plotter (&plotter_params); _pl_g_initialize (); } Plotter::Plotter (PlotterParams &plotter_params) { /* create PlotterData structure, install it in Plotter */ _plotter->data = (plPlotterData *)_pl_xmalloc (sizeof(plPlotterData)); _plotter->data->infp = NULL; _plotter->data->outfp = NULL; _plotter->data->errfp = NULL; _plotter->data->instream = NULL; _plotter->data->outstream = NULL; _plotter->data->errstream = NULL; /* copy in the specified values of device driver parameters */ _pl_g_copy_params_to_plotter (&plotter_params); _pl_g_initialize (); } Plotter::~Plotter () { _pl_g_terminate (); /* destroy PlotterData structure in Plotter */ free (_plotter->data); } #endif plotutils-2.6/libplot/g_defstate.c0000644000175000017500000002113411037243260014256 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Initialization for the first drawing state on the stack of drawing states maintained by any Plotter. Its components include drawing attributes, and the state of any uncompleted path object. (At initialization, there is none.) */ /* This is copied to the first state on the stack, in g_savestate.c. The four fields, `font_name', `font_type', `typeface_index', and `font_index' are special: they are filled in at that time, since they are Plotter-dependent. So the values for them below (respectively "HersheySerif", PL_F_HERSHEY, 0, and 1) are really dummies. */ /* Two other fields (font size and line width in user coordinates) play an important role at later times, e.g. a bad font size resets the font size to the default. For that reason, those variables are filled in when space() or fsetmatrix() is called (see g_concat.c). They are computed using the two quantities PL_DEFAULT_FONT_SIZE_AS_FRACTION_OF_DISPLAY_SIZE and PL_DEFAULT_LINE_WIDTH_AS_FRACTION_OF_DISPLAY_SIZE (defined in extern.h). */ #include "sys-defines.h" #include "extern.h" /* save keystrokes */ #define DFSAFODS PL_DEFAULT_FONT_SIZE_AS_FRACTION_OF_DISPLAY_SIZE #define DLWAFODS PL_DEFAULT_LINE_WIDTH_AS_FRACTION_OF_DISPLAY_SIZE const plDrawState _default_drawstate = { /***************** DEVICE-INDEPENDENT PART **************************/ /* graphics cursor position */ {0.0, 0.0}, /* cursor position, in user coordinates */ /* affine transformation from user coordinates to normalized device coordinates, and affine transformation to actual device coordinates (derived from it) */ { {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}, /* user->NDC transformation matrix */ {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}, /* user->device transformation [dummy] */ true, /* transf. scaling is uniform? [dummy] */ true, /* transf. preserves axis dirs? [dummy] */ true /* transf. doesn't reflect? [dummy] */ }, /* the compound path being drawn, if any */ (plPath *)NULL, /* simple path being drawn */ (plPath **)NULL, /* previously drawn simple paths */ 0, /* number of previously drawn simple paths */ {0.0, 0.0}, /* starting point (used by closepath()) */ /* modal drawing attributes */ /* 1. path-related attributes */ "even-odd", /* fill mode ["even-odd" / "nonzero-winding"]*/ PL_FILL_ODD_WINDING, /* fill type, one of PL_FILL_*, det'd by mode */ "solid", /* line mode [must be valid] */ PL_L_SOLID, /* line type, one of L_*, det'd by line mode */ true, /* if not set, paths are "disconnected" */ "butt", /* cap mode [must be valid] */ PL_CAP_BUTT, /* cap type, one of PL_CAP_*, det'd by cap mode */ "miter", /* join mode [must be valid] */ PL_JOIN_MITER, /* join type, one of PL_JOIN_*, det'd by mode */ PL_DEFAULT_MITER_LIMIT, /* miter limit for line joins */ DLWAFODS, /* line width in user coors [set by space()] */ true, /* line width is (Plotter-specific) default? */ 1.0, /* line width in device coordinates ["] */ 1, /* line width, quantized to integer ["] */ (double *)NULL, /* array of dash on/off lengths */ 0, /* length of same */ 0.0, /* offset distance into dash array (`phase') */ false, /* dash array should override line mode? */ 1, /* pen type (0 = none, 1 = present) */ 0, /* fill type (0 = none, 1 = present,...) */ 1, /* orientation of circles etc.(1=c'clockwise)*/ /* 2. text-related attributes */ "HersheySerif", /* font name [dummy, see g_openpl.c] */ DFSAFODS, /* font size in user coordinates [dummy] */ true, /* font size is (Plotter-specific) default? */ 0.0, /* degrees counterclockwise, for labels */ "HersheySerif", /* true font name [dummy] */ 0.0, /* true font size in user coordinates (") */ 0.0, /* font ascent in user coordinates (") */ 0.0, /* font descent in user coordinates (") */ 0.0, /* font capital height in user coors (") */ PL_F_HERSHEY, /* font type [dummy] */ 0, /* typeface index (in fontdb.h typeface table; this is Hershey Serif typeface) [dummy] */ 1, /* font index (within typeface; this is Roman variant of Hershey Serif typeface) [dummy] */ true, /* true means an ISO-Latin-1 font ["] */ /* 3. color attributes (fgcolor and fillcolor are path-related; fgcolor affects other primitives too) */ {0, 0, 0}, /* fg color, i.e., pen color (= black) */ {0, 0, 0}, /* base fill color (= black) */ {0, 0, 0}, /* true fill color (= black) */ {65535, 65535, 65535}, /* background color for display (= white) */ false, /* no actual background color? */ /* Default values for certain modal attributes, used when an out-of-range value is requested. (These two are special because unlike all others, they're set by the initial call to space() or fsetmatrix(), which also sets the line width and font size fields above. Incidentally, space() and setmatrix() also invoke linewidth().) */ 0.0, /* default line width in user coordinates */ 0.0, /* default font size in user coordinates */ /****************** DEVICE-DEPENDENT PART ***************************/ /* elements specific to the HP-GL drawing state [DUMMY] */ 0.001, /* pen width (frac of diag dist betw P1,P2) */ /* elements specific to the Fig drawing state [DUMMIES] */ 16, /* font size in fig's idea of points */ -1, /* fig's fill level (-1 = transparent) */ FIG_C_BLACK, /* fig's fg color (0=black) */ FIG_C_BLACK, /* fig's fill color */ /* elements specific to the PS drawing state [DUMMIES] */ 0.0, /* RGB for PS fg color (floats) */ 0.0, 0.0, 1.0, /* RGB for PS fill color (floats) */ 1.0, 1.0, 0, /* idraw fg color (0=black, 9=white) */ 9, /* idraw bg color (0=black, 9=white) */ 0, /* shading (0=fg, 4=bg), if not transparent */ /* elements specific to the GIF drawing state [all save last 3 are DUMMIES] */ {0, 0, 0}, /* 24-bit RGB of pixel for drawing (= black) */ {0, 0, 0}, /* 24-bit RGB of pixel for filling (= black) */ {255, 255, 255}, /* 24-bit RGB of pixel for erasing (= white) */ (unsigned char)0, /* drawing color index [dummy] */ (unsigned char)0, /* filling color index [dummy] */ (unsigned char)0, /* erasing color index [dummy] */ false, /* drawing color index is genuine? */ false, /* filling color index is genuine? */ false, /* erasing color index is genuine? */ #ifndef X_DISPLAY_MISSING /* elements spec. to X11, X11 Drawable drawingstates [nearly all: DUMMY] */ 14, /* font pixel size */ (XFontStruct *)NULL, /* font structure (used in x_alab_X.c) */ (const unsigned char *)NULL, /* label (hint to font retrieval routine) */ (GC)NULL, /* graphics context, for drawing */ (GC)NULL, /* graphics context, for filling */ (GC)NULL, /* graphics context, for erasing */ {0, 0, 0}, /* pen color stored in GC (= black) */ {0, 0, 0}, /* fill color stored in GC (= black) */ {65535, 65535, 65535}, /* bg color stored in GC (= white) */ (unsigned long)0, /* drawing pixel [dummy] */ (unsigned long)0, /* filling pixel [dummy] */ (unsigned long)0, /* erasing pixel [dummy] */ false, /* drawing pixel is genuine? */ false, /* filling pixel is genuine? */ false, /* erasing pixel is genuine? */ LineSolid, /* line style stored in drawing GC */ CapButt, /* cap style stored in drawing GC */ JoinMiter, /* join style stored in drawing GC */ 0, /* line width stored in drawing GC */ (char *)NULL, /* dash list stored in drawing GC */ 0, /* length of dash list stored in drawing GC */ 0, /* offset into dash sequence, in drawing GC */ EvenOddRule, /* fill rule stored in filling GC */ #endif /* X_DISPLAY_MISSING */ /* pointer to previous drawing state */ (plDrawState *)NULL /* pointer to previous state [must be null] */ }; plotutils-2.6/libplot/g_ellipse.c0000644000175000017500000001211011037243260014106 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file also contains the ellipse method, which is a GNU extension to libplot. It draws an object: an ellipse with center xc,yc and semi-axes of length rx and ry (the former at a specified angle with the x-axis). Ellipses are one of the three types of primitive closed path that libplot supports, along with boxes and circles. In this generic version, we usually draw the ellipse by drawing four elliptic arcs (quarter-ellipses) into the path buffer's segment list. Plotters that don't support elliptic arcs draw polygonal approximations instead. Plotters that are sufficiently powerful that they support ellipses as primitive drawing elements place an ellipse primitive in the path buffer, instead. Note that some Plotters support the drawing of any ellipse; some require that they be aligned with the coordinate axes. Some don't support the drawing of ellipses at all. The constraints on the user frame -> device frame map (e.g., it must preserve coordinate axes) are specified by the internal `allowed_ellipse_scaling' parameter, which this code checks. */ #include "sys-defines.h" #include "extern.h" int _API_fellipse (R___(Plotter *_plotter) double xc, double yc, double rx, double ry, double angle) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fellipse: invalid operation"); return -1; } /* If a simple path is under construction (so that endsubpath() must not have been invoked), flush out the whole compound path. (It may include other, previously drawn simple paths.) */ if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); if (!_plotter->drawstate->points_are_connected) /* line type is `disconnected', so do nothing (libplot convention) */ { } else /* general case */ { plPoint pc; bool clockwise; /* determine whether ellipse's axes are aligned with the coordinate axes in the user frame, so that (if the device->user frame map preserves axes) the same will be true in the device frame */ bool aligned_ellipse = false; int iangle = IROUND(angle); if (iangle < 0) iangle += (1 + (-iangle / 90)) * 90; if (iangle % 90 == 0 && angle == (double)iangle) aligned_ellipse = true; /* begin a new path */ _plotter->drawstate->path = _new_plPath (); /* place ellipse in path buffer */ pc.x = xc; pc.y = yc; clockwise = _plotter->drawstate->orientation < 0 ? true : false; if ((_plotter->data->allowed_ellipse_scaling == AS_ANY) || (_plotter->data->allowed_ellipse_scaling == AS_AXES_PRESERVED && _plotter->drawstate->transform.axes_preserved && aligned_ellipse)) /* place ellipse as a primitive, since this Plotter supports drawing ellipses as primitives */ _add_ellipse (_plotter->drawstate->path, pc, rx, ry, angle, clockwise); else if (_plotter->data->allowed_ellarc_scaling == AS_ANY || (_plotter->data->allowed_ellarc_scaling == AS_AXES_PRESERVED && _plotter->drawstate->transform.axes_preserved && aligned_ellipse)) /* draw ellipse by placing four elliptic arcs into path buffer (allowed since this Plotter supports elliptic arcs) */ _add_ellipse_as_ellarcs (_plotter->drawstate->path, pc, rx, ry, angle, clockwise); else if (_plotter->data->allowed_cubic_scaling == AS_ANY) /* draw ellipse by placing four cubic Beziers into path buffer (allowed since this Plotter supports cubic Beziers) */ _add_ellipse_as_bezier3s (_plotter->drawstate->path, pc, rx, ry, angle, clockwise); else /* draw a polygonal approximation to the ellipse */ _add_ellipse_as_lines (_plotter->drawstate->path, pc, rx, ry, angle, clockwise); if (_plotter->drawstate->path->type == PATH_SEGMENT_LIST) /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) 0); } /* move to center (libplot convention) */ _plotter->drawstate->pos.x = xc; _plotter->drawstate->pos.y = yc; return 0; } plotutils-2.6/libplot/g_endpath.c0000644000175000017500000002274611037243260014114 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the endpath() method, which is a GNU extension to libplot. A path object may be constructed incrementally, by repeated invocation of such operations as cont(), arc(), etc. The construction may be terminated, and the path object finalized, by an explict invocation of endpath(). If endpath() is invoked when no path is under construction, it has no effect. */ /* endpath() is a wrapper around the internal paint_path() method, which any Plotter can define as it chooses. Any path is stored as a plPath structure in the drawing state. This may contain a list of segments (line segments, curve segments etc.; which are allowed is Plotter-dependent) or simply a Plotter-specific drawing primitive such as a circle, ellipse, or rectangle. paint_path() should be able to handle anything that is appropriate for the given type of Plotter. */ /* This file also contains the endsubpath() and closepath() methods. */ #include "sys-defines.h" #include "extern.h" int _API_endpath (S___(Plotter *_plotter)) { int i; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "endpath: invalid operation"); return -1; } /* end simple path under construction (if any), and move it to the array of stored simple paths */ _API_endsubpath (S___(_plotter)); if (_plotter->drawstate->num_paths == 0) /* no stored simple paths; so nothing to do, and we're out of here */ return 0; /* at this point, compound path is available as an array of simple paths, of length at least 1, in _plotter->drawstate->paths[] */ /* Two cases: either the line mode is `disconnected', or it isn't (the normal case). */ if (!_plotter->drawstate->points_are_connected) /* Special case: "disconnected" linemode. If we have a pen, path will be drawn as a sequence of filled circles, one per juncture point. Path will not be filled (our convention). */ { if (_plotter->drawstate->pen_type != 0) /* have a pen, so we can draw something */ { plPath **saved_paths; int saved_num_paths; double radius = 0.5 * _plotter->drawstate->line_width; int i; /* Switch to a temporary paths buffer. Needed because the fcircle() method calls endpath(), which would otherwise mess up the real paths buffer. */ saved_paths = _plotter->drawstate->paths; saved_num_paths = _plotter->drawstate->num_paths; _plotter->drawstate->paths = (plPath **)NULL; _plotter->drawstate->num_paths = 0; /* save graphics state */ _API_savestate (S___(_plotter)); /* set attributes appropriate for drawing filled edgeless circles, in the current pen (rather than filling) color */ _API_filltype (R___(_plotter) 1); _API_fillcolor (R___(_plotter) _plotter->drawstate->fgcolor.red, _plotter->drawstate->fgcolor.green, _plotter->drawstate->fgcolor.blue); _API_pentype (R___(_plotter) 0); /* edgeless */ _API_linemod (R___(_plotter) "solid"); /* necessary; see below*/ /* loop over saved simple paths */ for (i = 0; i < saved_num_paths; i++) { plPath *path; bool closed; int j; path = saved_paths[i]; /* sanity check: if linemode is disconnected, we should never have created any simple path other than a segment list; also, should have at least two juncture points */ if (path->type != PATH_SEGMENT_LIST || path->num_segments < 2) continue; /* check for closure */ if ((path->num_segments >= 3) && (path->segments[path->num_segments - 1].p.x == path->segments[0].p.x) && (path->segments[path->num_segments - 1].p.y == path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ /* draw each point as a filled circle, diameter = line width */ for (j = 0; j < path->num_segments - (closed ? 1 : 0); j++) _API_fcircle (R___(_plotter) path->segments[j].p.x, path->segments[j].p.y, radius); if (closed) /* restore graphics cursor */ _plotter->drawstate->pos = path->segments[0].p; } /* Restore graphics state. This will first do a recursive endpath() and hence reset the newly populated paths buffer. That won't result in infinite recursion: since the line type was set to "solid" above, the `points_are_connected' element is now `false', and this code won't be invoked again. */ _API_restorestate (S___(_plotter)); /* switch back to original paths buffer */ _plotter->drawstate->paths = saved_paths; _plotter->drawstate->num_paths = saved_num_paths; } } else /* normal case: line mode isn't disconnected, so no contortions needed */ { if (_plotter->drawstate->num_paths == 1) /* compound path is just a single simple path, so paint it by calling the Plotter-specific paint_path() method (the painting may involve both filling and/or edging) */ { _plotter->drawstate->path = _plotter->drawstate->paths[0]; _plotter->paint_path (S___(_plotter)); _plotter->drawstate->path = (plPath *)NULL; } else /* compound path comprises more than one simple path */ { /* first, attempt to use Plotter-specific support for painting compound paths (not many Plotters have this) */ if (_plotter->paint_paths (S___(_plotter)) == false) /* Plotter either has no such support, or was unable to paint this particular compound path; so we paint it in a clever, device-independent way. For filling, we merge the simple paths into a single path, and invoke paint_path() on the result. For edging, we stroke each of the simple paths individually. */ { int fill_type, pen_type; fill_type = _plotter->drawstate->fill_type; pen_type = _plotter->drawstate->pen_type; if (fill_type && _plotter->data->have_solid_fill) /* fill the compound path, by merging its simple paths into a single simple path, and then invoking paint_path() on the result */ { plPath **merged_paths; _plotter->drawstate->fill_type = fill_type; _plotter->drawstate->pen_type = 0; /* unedged */ merged_paths = _merge_paths ((const plPath **)_plotter->drawstate->paths, _plotter->drawstate->num_paths); for (i = 0; i < _plotter->drawstate->num_paths; i++) { if (merged_paths[i] == (plPath *)NULL) continue; _plotter->drawstate->path = merged_paths[i]; _plotter->paint_path (S___(_plotter)); if (merged_paths[i] != _plotter->drawstate->paths[i]) _delete_plPath (merged_paths[i]); } _plotter->drawstate->path = (plPath *)NULL; } if (pen_type) /* edge the compound path, i.e., edge each of its simple paths */ { _plotter->drawstate->pen_type = pen_type; _plotter->drawstate->fill_type = 0; /* unfilled */ for (i = 0; i < _plotter->drawstate->num_paths; i++) { _plotter->drawstate->path = _plotter->drawstate->paths[i]; _plotter->paint_path (S___(_plotter)); } _plotter->drawstate->path = (plPath *)NULL; } /* restore filling/edging attributes */ _plotter->drawstate->fill_type = fill_type; _plotter->drawstate->pen_type = pen_type; } } } /* compound path is now painted, so remove it from paths buffer */ for (i = 0; i < _plotter->drawstate->num_paths; i++) _delete_plPath (_plotter->drawstate->paths[i]); free (_plotter->drawstate->paths); _plotter->drawstate->paths = (plPath **)NULL; _plotter->drawstate->num_paths = 0; return 0; } int _API_endsubpath (S___(Plotter *_plotter)) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "endsubpath: invalid operation"); return -1; } if (_plotter->drawstate->path) /* have a simple path under construction, so move it to list of stored simple paths */ { if (_plotter->drawstate->num_paths == 0) _plotter->drawstate->paths = (plPath **)_pl_xmalloc(sizeof (plPath *)); else _plotter->drawstate->paths = (plPath **)_pl_xrealloc(_plotter->drawstate->paths, (_plotter->drawstate->num_paths + 1) * sizeof (plPath *)); _plotter->drawstate->paths[_plotter->drawstate->num_paths++] = _plotter->drawstate->path; _plotter->drawstate->path = (plPath *)NULL; } return 0; } int _API_closepath (S___(Plotter *_plotter)) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "closepath: invalid operation"); return -1; } /* NOT YET IMPLEMENTED */ return 0; } plotutils-2.6/libplot/g_error.c0000644000175000017500000000604011037243260013607 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the generic warning and error methods. They simply write the specified message to the plotter error stream, if it has one. There is provision for user-specifiable warning/error message handlers (not yet documented). */ /* All libplot warnings and error messages go through these functions, with the exception of libpng error messages produced by PNG Plotters (see z_write.c; they're different because they need to be produced by callbacks). */ #include "sys-defines.h" #include "extern.h" /* mutex for locking the warning/error message subsystem */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H pthread_mutex_t _message_mutex = PTHREAD_MUTEX_INITIALIZER; #endif #endif /* user-settable handlers, defined in g_defplot.c to be NULL */ extern int (*pl_libplot_warning_handler) (const char *msg); extern int (*pl_libplot_error_handler) (const char *msg); void _pl_g_warning (R___(Plotter *_plotter) const char *msg) { #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the message subsystem */ pthread_mutex_lock (&_message_mutex); #endif #endif if (pl_libplot_warning_handler != NULL) (*pl_libplot_warning_handler)(msg); else if (_plotter->data->errfp) fprintf (_plotter->data->errfp, "libplot: %s\n", msg); #ifdef LIBPLOTTER else if (_plotter->data->errstream) (*(_plotter->data->errstream)) << "libplot: " << msg << '\n'; #endif #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the message subsystem */ pthread_mutex_unlock (&_message_mutex); #endif #endif } void _pl_g_error (R___(Plotter *_plotter) const char *msg) { #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the message subsystem */ pthread_mutex_lock (&_message_mutex); #endif #endif if (pl_libplot_error_handler != NULL) (*pl_libplot_error_handler)(msg); else if (_plotter->data->errfp) fprintf (_plotter->data->errfp, "libplot error: %s\n", msg); #ifdef LIBPLOTTER else if (_plotter->data->errstream) (*(_plotter->data->errstream)) << "libplot error: " << msg << '\n'; #endif #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the message subsystem */ pthread_mutex_unlock (&_message_mutex); #endif #endif } plotutils-2.6/libplot/g_erase.c0000644000175000017500000000657611037243260013573 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the erase method, which is a standard part of libplot. It erases all objects on the graphics device display. This generic version is designed mostly for Plotters that do not do real-time plotting, and have no internal state. It simply resets the output buffer for the current `page', discarding all objects written to it. */ #include "sys-defines.h" #include "extern.h" int _API_erase (S___(Plotter *_plotter)) { bool retval1; int retval2 = 0; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "erase: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ switch ((int)_plotter->data->output_model) { case (int)PL_OUTPUT_NONE: /* Plotter doesn't do output, so do nothing */ break; case (int)PL_OUTPUT_ONE_PAGE: case (int)PL_OUTPUT_ONE_PAGE_AT_A_TIME: case (int)PL_OUTPUT_PAGES_ALL_AT_ONCE: /* the builtin plOutbuf mechanism is being used for storing pages, so remove all stored graphics code from the buffer corresponding to the current page; reset page bounding box, etc. */ if (_plotter->data->page) /* paranoid */ _reset_outbuf (_plotter->data->page); break; case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES: case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME: case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM: /* Plotter does its own output, and doesn't use libplot's plOutbuf-based output system. So do nothing. */ break; default: /* shouldn't happen */ break; } /* Invoke Plotter-specific method to do device-dependent aspects of page erasure. For example, reset the elements of the Plotter that keep track of the output device's graphics state to their default values. */ retval1 = _plotter->erase_page (S___(_plotter)); /* if Plotter is using custom output routines, and is, or could be, drawing graphics in real time, flush out the erasure */ if (_plotter->data->output_model == PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME || _plotter->data->output_model == PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM) retval2 = _API_flushpl (S___(_plotter)); /* on to next frame */ _plotter->data->frame_number++; return (retval1 == true && retval2 == 0 ? 0 : -1); } /* Plotter-specific things that take place when erase() is invoked. In a generic Plotter, this does nothing. */ bool _pl_g_erase_page (S___(Plotter *_plotter)) { return true; } plotutils-2.6/libplot/g_flushpl.c0000644000175000017500000001271711037267447014160 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the flushpl method, which is a GNU extension to libplot. It flushes (i.e. pushes onward) all plot commands sent to the graphics device. */ /* This file also contains the internal _pl_g_flush_plotter_outstreams() method, which should be invoked by any Plotter that forks an auxiliary process. (E.g., an XPlotter forks off an auxiliary process when closepl() is invoked, to manage its `spun-off' window.) */ #include "sys-defines.h" #include "extern.h" #ifdef MSDOS #include /* for fsync() */ #endif /* Mutex for locking _plotters[] and _plotters_len. Defined in g_defplot.c. */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H extern pthread_mutex_t _plotters_mutex; #endif #endif int _API_flushpl (S___(Plotter *_plotter)) { int retval = 0; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "flushpl: invalid operation"); return -1; } switch ((int)_plotter->data->output_model) { case (int)PL_OUTPUT_NONE: /* Plotter doesn't do any output, so do nothing */ break; case (int)PL_OUTPUT_ONE_PAGE: case (int)PL_OUTPUT_ONE_PAGE_AT_A_TIME: case (int)PL_OUTPUT_PAGES_ALL_AT_ONCE: /* Plotter may have an output stream that can be flushed. Should really distinguish here between Plotters that write graphics in real time, and those that wait until the end of a page, or of all pages, before writing graphics. */ if (_plotter->data->outfp) { if (fflush(_plotter->data->outfp) < 0 #ifdef MSDOS /* data can be caught in DOS buffers, so do an fsync() too */ || fsync (_plotter->data->outfp) < 0 #endif ) retval = -1; } #ifdef LIBPLOTTER if (_plotter->data->outstream) { _plotter->data->outstream->flush (); if (!(*(_plotter->data->outstream))) retval = -1; } #endif break; case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES: case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME: case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM: /* Plotter does its own output, so invoke Plotter-specific flush method */ if (_plotter->flush_output (S___(_plotter)) == false) retval = -1; break; default: /* shouldn't happen */ break; } if (retval < 0) _plotter->error (R___(_plotter) "the output stream is jammed"); return retval; } /* An internal method that's called when any Plotter that does its own output to a non-stream is flushed. Actually, this generic version does nothing; it'll need to be overridden by any Plotter that wishes to make use of this feature. Return value indicates success. */ bool _pl_g_flush_output (S___(Plotter *_plotter)) { return true; } /* Flush output streams for all Plotters. Plotters that fork when the closepl() operation is invoked should call this before forking. This code is messy, because there are four cases to cover, and in the final three, the global variables _plotters[] and _plotters_len need to be locked and unlocked. */ void _pl_g_flush_plotter_outstreams (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER #ifdef HAVE_NULL_FLUSH fflush ((FILE *)NULL); #else /* not HAVE_NULL_FLUSH */ int i; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H pthread_mutex_lock (&_plotters_mutex); #endif #endif for (i = 0; i < _plotters_len; i++) if (_plotters[i]) { if (_plotters[i]->data->outfp) fflush (_plotters[i]->data->outfp); if (_plotters[i]->data->errfp) fflush (_plotters[i]->data->errfp); } #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H pthread_mutex_unlock (&_plotters_mutex); #endif #endif #endif /* not HAVE_NULL_FLUSH */ #else /* LIBPLOTTER */ int i; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H pthread_mutex_lock (&_plotters_mutex); #endif #endif #ifdef HAVE_NULL_FLUSH fflush ((FILE *)NULL); for (i = 0; i < _plotters_len; i++) if (_plotters[i]) { if (_plotters[i]->data->outstream) _plotters[i]->data->outstream->flush (); if (_plotters[i]->data->errstream) _plotters[i]->data->errstream->flush (); } #else /* not HAVE_NULL_FLUSH */ for (i = 0; i < _plotters_len; i++) if (_plotters[i]) { if (_plotters[i]->data->outfp) fflush (_plotters[i]->data->outfp); if (_plotters[i]->data->errfp) fflush (_plotters[i]->data->errfp); if (_plotters[i]->data->outstream) _plotters[i]->data->outstream->flush (); if (_plotters[i]->data->errstream) _plotters[i]->data->errstream->flush (); } #endif /* not HAVE_NULL_FLUSH */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H pthread_mutex_unlock (&_plotters_mutex); #endif #endif #endif /* LIBPLOTTER */ } plotutils-2.6/libplot/g_font.c0000644000175000017500000001230411037243260013424 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the fontname, fontsize, and textangle methods, which are a GNU extension to libplot. They set drawing attributes: the name of the font used for text subsequent drawn on the graphics device, the size, and the text angle. The fontname, fontsize, and textangle methods return the fontsize in user units, as an aid to vertical positioning by the user. (The fontsize is normally taken to be a minimum vertical spacing between adjacent lines of text.) The return value may depend on the mapping from user coordinates to graphics device coordinates, and hence, e.g., on the arguments given to the space() method. Note that the size of the font may change when the rotation angle is changed, since some fonts may not be available at all rotation angles, so that a default font must be switched to. Also, not all font sizes may be available (there may need to be some size quantization). So the return value should always be checked. */ #include "sys-defines.h" #include "extern.h" double _API_ffontname (R___(Plotter *_plotter) const char *s) { char *font_name; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "ffontname: invalid operation"); return -1; } /* Null pointer resets to default. (N.B. we don't look at the font_name field in _default_drawstate, because it's a dummy.) */ if ((s == NULL) || (*s == '\0') || !strcmp(s, "(null)")) switch (_plotter->data->default_font_type) { case PL_F_HERSHEY: default: s = PL_DEFAULT_HERSHEY_FONT; break; case PL_F_POSTSCRIPT: s = PL_DEFAULT_POSTSCRIPT_FONT; break; case PL_F_PCL: s = PL_DEFAULT_PCL_FONT; break; case PL_F_STICK: s = PL_DEFAULT_STICK_FONT; break; } /* save new font name */ free ((char *)_plotter->drawstate->font_name); font_name = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (font_name, s); _plotter->drawstate->font_name = font_name; /* retrieve font and metrics; compute `true' font size (may differ) */ _pl_g_set_font (S___(_plotter)); /* return value is size in user units */ return _plotter->drawstate->true_font_size; } double _API_ffontsize (R___(Plotter *_plotter) double size) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "ffontsize: invalid operation"); return -1; } if (size < 0.0) /* reset to default */ { size = _plotter->drawstate->default_font_size; _plotter->drawstate->font_size_is_default = true; } else _plotter->drawstate->font_size_is_default = false; /* set the new nominal size in the drawing state */ _plotter->drawstate->font_size = size; /* retrieve font and metrics; compute `true' font size (may differ) */ _pl_g_set_font (S___(_plotter)); /* flag fontsize as having been invoked (so that fsetmatrix will no longer automatically adjust the font size to a reasonable value) */ _plotter->data->fontsize_invoked = true; /* return quantized user-specified font size */ return _plotter->drawstate->true_font_size; } double _API_ftextangle (R___(Plotter *_plotter) double angle) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "ftextangle: invalid operation"); return -1; } /* save new rotation angle */ _plotter->drawstate->text_rotation = angle; /* retrieve font and metrics; compute `true' font size (may differ) */ _pl_g_set_font (S___(_plotter)); /* return quantized user-specified font size */ return _plotter->drawstate->true_font_size; } /* Below are four rather silly Plotter methods that are an undocumented part of the libplot/libplotter API. Each returns a pointer to the head of a font database in g_fontdb.c, so that an application program that is too nosy for its own good can pry out font information. These should be replaced by a properly crafted API for querying font names, font metrics, etc. */ void * _pl_get_hershey_font_info (S___(Plotter *_plotter)) { return (void *)_pl_g_hershey_font_info; } void * _pl_get_ps_font_info (S___(Plotter *_plotter)) { return (void *)_pl_g_ps_font_info; } void * _pl_get_pcl_font_info (S___(Plotter *_plotter)) { return (void *)_pl_g_pcl_font_info; } void * _pl_get_stick_font_info (S___(Plotter *_plotter)) { return (void *)_pl_g_stick_font_info; } plotutils-2.6/libplot/g_fontdb.c0000644000175000017500000052713711234146427013757 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* THIS FILE IS NOW SPLIT INTO TWO PIECES: g_fontdb.c and g_fontd2.c, TO FACILITATE COMPILING. This is the first half, containing PS fonts and Hershey vector fonts. */ /*----------------------------------------------------------------------*/ /* This file contains information about PS fonts, Hershey vector fonts, PCL fonts, and Stick fonts (i.e., device-resident vector fonts), and about the way in which they are divided into typefaces. For the non-Hershey fonts, the most important information is the width tables. For the Hershey fonts, it is the mapping from the character position in the font, to the position of the corresponding glyph in the glyph array in g_her_glyph.c. Accented characters are formed as composites. */ #include "sys-defines.h" #include "extern.h" /* The 35 standard PS fonts, with ISO8859-1 (ISO-Latin-1) encoding where that is appropriate. (Note that PL_NUM_PS_FONTS is defined to equal 35 in extern.h.) Each plPSFontInfoStruct includes these elements: (1) PS name, (1a) alternative PS name if any (may be NULL), (1c) 2nd alternative PS name if any (may be NULL), (2a) X name, (2b) alternative X name if any (may be NULL) (2c) 2nd alternative X name if any (may be NULL) (2d) 3rd alternative X name if any (may be NULL) (2.5abcdef) CSS font properties: family, generic family, style, weight, stretch, panose (3) PCL typeface number. (4) PCL info: fixedwidth(0) / proportional(1). (5) PCL info: upright(0) / italic(1) / condensed(4) / cond. italic(5) / compressed i.e. extra cond. (8) / expanded (24) / outline (32) / inline (64). (6) PCL info: normal weight(0) / bold(3) / extra bold(4), etc. (7) PCL info: "symbol set" i.e. native character set/encoding. (0 = Roman-8 i.e. default set; 14 = ISO8859-1 i.e. ECMA-94 Latin 1; 621 = PS Symbol; 18540 = Wingdings. In PCL as opposed to HP-GL/2, these numbers are encoded base 32, as a number and a letter. E.g., 621 is written as 19M since 19*32+13, and 'M' is letter #13.) (8) and (9) (normalized) font ascent and descent (from font bounding box), (10ab) the font cap height and x height (latter not yet implemented) (11a) the font width information (an array, size 256), (11b) the `left edge of glyph' information (an array, size 256), (12) a typeface id (an index into the _pl_g_ps_typeface_info[] array below) (13) a font index (which font within the typeface this is) (14) a Fig font id, for use by FigPlotter methods (15) an `iso8859-1' flag, for the PS driver, which must re-encode */ /* IMPORTANT: The fonts in this array may be referred to elsewhere in the libplot code by number. If you change the internal numbering of Postscript fonts, i.e., the order in which they appear in this array, be sure to update the definitions PL_DEFAULT_POSTSCRIPT_FONT_INDEX, etc. in extern.h. Also update the arrays _pl_g_ps_font_to_cgm_font_id[] and _pl_g_cgm_font_id_to_ps_font[], below. */ const struct plPSFontInfoStruct _pl_g_ps_font_info[] = { { "Helvetica", /* #0 */ NULL, NULL, "helvetica-medium-r-normal", /* Adobe */ "nimbus sans l-medium-r-normal", /* URW, for SuSE */ "nimbus sans l-regular-r-normal", /* URW, for Debian */ NULL, "Helvetica", "sans-serif", "normal", "normal", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 0, 0, 14, 931, 225, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 278, 355, 556, 556, 889, 667, 222, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 222, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 556, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 584, 611, 556, 556, 556, 556, 500, 556, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 70, 28, 32, 39, 44, 53, 68, 34, 39, 39, 87, 39, 87, -17, 37, 101, 26, 34, 25, 32, 38, 37, 38, 42, 87, 87, 48, 39, 48, 56, 147, 14, 74, 44, 81, 86, 86, 48, 77, 91, 17, 76, 76, 73, 76, 39, 86, 39, 88, 49, 14, 79, 20, 16, 19, 14, 23, 63, -17, 28, -14, 0, 65, 36, 58, 30, 35, 40, 14, 40, 65, 67, -16, 67, 67, 65, 65, 35, 58, 35, 77, 32, 14, 68, 8, 14, 11, 11, 31, 42, 94, 42, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118, 51, 33, 28, 3, 94, 43, 40, -14, 24, 97, 39, 44, -14, 10, 54, 39, 4, 5, 122, 68, 18, 77, 45, 43, 25, 97, 73, 43, 45, 91, 14, 14, 14, 14, 14, 14, 8, 44, 86, 86, 86, 86, -13, 91, -6, 13, 0, 76, 39, 39, 39, 39, 39, 39, 39, 79, 79, 79, 79, 14, 86, 67, 36, 36, 36, 36, 36, 36, 36, 30, 40, 40, 40, 40, -13, 95, -6, 13, 35, 65, 35, 35, 35, 35, 35, 39, 28, 68, 68, 68, 68, 11, 58, 11 }, 0, 1, 16, true}, { "Helvetica-Oblique", /* #1 */ NULL, NULL, "helvetica-medium-o-normal", "nimbus sans l-medium-o-normal", "nimbus sans l-regular-i-normal", NULL, "Helvetica", "sans-serif", "oblique", "normal", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 1, 0, 14, 931, 225, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 278, 355, 556, 556, 889, 667, 222, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 222, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 556, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 584, 611, 556, 556, 556, 556, 500, 556, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 168, 73, 69, 147, 77, 151, 108, -9, 165, 85, 56, 85, 87, -21, 93, 207, 26, 75, 61, 68, 91, 137, 74, 82, 87, 56, 94, 63, 50, 161, 215, 14, 74, 108, 81, 86, 86, 111, 77, 91, 47, 76, 76, 73, 76, 105, 86, 105, 88, 90, 148, 123, 173, 169, 19, 167, 23, 21, 140, -14, 42, -27, 165, 61, 58, 74, 84, 84, 86, 42, 65, 67, -60, 67, 67, 65, 65, 83, 14, 84, 77, 63, 102, 94, 119, 125, 11, 15, 31, 92, 90, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 95, 49, 60, 81, 90, 76, 168, 54, 100, 146, 106, 93, 54, 143, 169, 39, 64, 90, 248, 24, 126, 129, 2, 166, 100, 120, 150, 114, 130, 85, 14, 14, 14, 14, 14, 14, 8, 108, 86, 86, 86, 86, 91, 91, 91, 91, 69, 76, 105, 105, 105, 105, 105, 50, 43, 123, 123, 123, 123, 167, 86, 67, 61, 61, 61, 61, 61, 61, 61, 74, 84, 84, 84, 84, 95, 95, 95, 95, 81, 65, 83, 83, 83, 83, 83, 85, 29, 94, 94, 94, 94, 15, 14, 15 }, 0, 2, 17, true}, { "Helvetica-Bold", /* #2 */ NULL, NULL, "helvetica-bold-r-normal", "nimbus sans l-bold-r-normal", "nimbus sans l-bold-r-normal", NULL, "Helvetica", "sans-serif", "normal", "bold", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 0, 3, 14, 962, 228, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 474, 556, 556, 889, 722, 278, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 278, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 611, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 584, 611, 611, 611, 611, 611, 556, 611, 556 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 98, 18, 30, 28, 54, 69, 35, 19, 27, 40, 64, 40, 64, -33, 32, 69, 26, 27, 27, 27, 31, 25, 32, 30, 92, 92, 38, 40, 38, 60, 118, 20, 76, 44, 76, 76, 76, 44, 71, 64, 22, 87, 76, 69, 69, 44, 76, 44, 76, 39, 14, 72, 19, 16, 14, 15, 25, 63, -33, 24, 62, 0, 69, 29, 61, 34, 34, 23, 10, 40, 65, 69, 3, 69, 69, 64, 65, 34, 62, 34, 64, 30, 10, 66, 13, 10, 15, 10, 20, 48, 84, 24, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 34, 28, -3, -9, 84, 34, 6, -11, 22, 88, 40, 27, -11, -6, 57, 40, 9, 8, 108, 66, -8, 58, 6, 26, 6, 88, 26, 26, 16, 55, 20, 20, 20, 20, 20, 20, 5, 44, 76, 76, 76, 76, -50, 64, -37, -21, -5, 69, 44, 44, 44, 44, 44, 40, 33, 72, 72, 72, 72, 15, 76, 69, 29, 29, 29, 29, 29, 29, 29, 34, 23, 23, 23, 23, -50, 69, -37, -21, 34, 65, 34, 34, 34, 34, 34, 40, 22, 66, 66, 66, 66, 10, 62, 10 }, 0, 3, 18, true}, { "Helvetica-BoldOblique", /* #3 */ NULL, NULL, "helvetica-bold-o-normal", "nimbus sans l-bold-o-normal", "nimbus sans l-bold-i-normal", NULL, "Helvetica", "sans-serif", "oblique", "bold", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 1, 3, 14, 962, 228, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 474, 556, 556, 889, 722, 278, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 278, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 611, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 584, 611, 611, 611, 611, 611, 556, 611, 556 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 193, 60, 67, 136, 89, 167, 76, -25, 146, 82, 28, 82, 64, -37, 86, 173, 26, 65, 60, 64, 85, 125, 69, 78, 92, 56, 82, 58, 36, 165, 186, 20, 76, 107, 76, 76, 76, 108, 71, 64, 60, 87, 76, 69, 69, 107, 76, 107, 76, 81, 140, 116, 172, 169, 14, 168, 25, 21, 124, -18, 131, -27, 165, 55, 61, 79, 82, 70, 87, 38, 65, 69, -42, 69, 69, 64, 65, 82, 18, 80, 64, 63, 100, 98, 126, 123, 15, 42, 20, 94, 80, -18, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 79, 50, 27, 60, 80, 61, 137, 56, 92, 135, 105, 73, 55, 122, 175, 40, 69, 91, 236, 22, 98, 110, -37, 148, 92, 104, 132, 132, 99, 53, 20, 20, 20, 20, 20, 20, 5, 107, 76, 76, 76, 76, 64, 64, 64, 64, 62, 69, 107, 107, 107, 107, 107, 57, 35, 116, 116, 116, 116, 168, 76, 69, 55, 55, 55, 55, 55, 55, 56, 79, 70, 70, 70, 70, 69, 69, 69, 69, 82, 65, 82, 82, 82, 82, 82, 82, 22, 98, 98, 98, 98, 42, 18, 42 }, 0, 4, 19, true}, { "Helvetica-Narrow", /* #4 */ NULL, NULL, "helvetica-medium-r-narrow", "nimbus sans l-medium-r-condensed", "nimbus sans l-regular-r-condensed", NULL, "Helvetica", "sans-serif", "normal", "normal", "condensed", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 4, 0, 14, 931, 225, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 228, 291, 456, 456, 729, 547, 182, 273, 273, 319, 479, 228, 479, 228, 228, 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, 228, 228, 479, 479, 479, 456, 832, 547, 547, 592, 592, 547, 501, 638, 592, 228, 410, 547, 456, 683, 592, 638, 547, 638, 592, 547, 501, 592, 547, 774, 547, 547, 501, 228, 228, 228, 385, 456, 182, 456, 456, 410, 456, 456, 228, 456, 456, 182, 182, 410, 182, 683, 456, 456, 456, 456, 273, 410, 228, 456, 410, 592, 410, 410, 410, 274, 213, 274, 479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 273, 456, 456, 456, 456, 213, 456, 273, 604, 303, 456, 479, 273, 604, 273, 328, 479, 273, 273, 273, 456, 440, 228, 273, 273, 299, 456, 684, 684, 684, 501, 547, 547, 547, 547, 547, 547, 820, 592, 547, 547, 547, 547, 228, 228, 228, 228, 592, 592, 638, 638, 638, 638, 638, 479, 638, 592, 592, 592, 592, 547, 547, 501, 456, 456, 456, 456, 456, 456, 729, 410, 456, 456, 456, 456, 228, 228, 228, 228, 456, 456, 456, 456, 456, 456, 456, 479, 501, 456, 456, 456, 456, 410, 456, 410 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 57, 23, 26, 32, 36, 43, 56, 28, 32, 32, 71, 32, 71, -14, 30, 83, 21, 28, 20, 26, 31, 30, 31, 34, 71, 71, 39, 32, 39, 46, 121, 11, 61, 36, 66, 71, 71, 39, 63, 75, 14, 62, 62, 60, 62, 32, 71, 32, 72, 40, 11, 65, 16, 13, 16, 11, 19, 52, -14, 23, -11, 0, 53, 30, 48, 25, 29, 33, 11, 33, 53, 55, -13, 55, 55, 53, 53, 29, 48, 29, 63, 26, 11, 56, 7, 11, 9, 9, 25, 34, 77, 34, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 42, 27, 23, 2, 77, 35, 33, -11, 20, 80, 32, 36, -11, 8, 44, 32, 3, 4, 100, 56, 15, 63, 37, 35, 20, 80, 60, 35, 37, 75, 11, 11, 11, 11, 11, 11, 7, 36, 71, 71, 71, 71, -11, 75, -5, 11, 0, 62, 32, 32, 32, 32, 32, 32, 32, 65, 65, 65, 65, 11, 71, 55, 30, 30, 30, 30, 30, 30, 30, 25, 33, 33, 33, 33, -11, 78, -5, 11, 29, 53, 29, 29, 29, 29, 29, 32, 23, 56, 56, 56, 56, 9, 48, 9 }, 1, 1, 20, true}, { "Helvetica-Narrow-Oblique", /* #5 */ NULL, NULL, "helvetica-medium-o-narrow", "nimbus sans l-medium-o-condensed", "nimbus sans l-regular-i-condensed", NULL, "Helvetica", "sans-serif", "oblique", "normal", "condensed", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 5, 0, 14, 931, 225, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 228, 291, 456, 456, 729, 547, 182, 273, 273, 319, 479, 228, 479, 228, 228, 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, 228, 228, 479, 479, 479, 456, 832, 547, 547, 592, 592, 547, 501, 638, 592, 228, 410, 547, 456, 683, 592, 638, 547, 638, 592, 547, 501, 592, 547, 774, 547, 547, 501, 228, 228, 228, 385, 456, 182, 456, 456, 410, 456, 456, 228, 456, 456, 182, 182, 410, 182, 683, 456, 456, 456, 456, 273, 410, 228, 456, 410, 592, 410, 410, 410, 274, 213, 274, 479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 273, 456, 456, 456, 456, 213, 456, 273, 604, 303, 456, 479, 273, 604, 273, 328, 479, 273, 273, 273, 456, 440, 228, 273, 273, 299, 456, 684, 684, 684, 501, 547, 547, 547, 547, 547, 547, 820, 592, 547, 547, 547, 547, 228, 228, 228, 228, 592, 592, 638, 638, 638, 638, 638, 479, 638, 592, 592, 592, 592, 547, 547, 501, 456, 456, 456, 456, 456, 456, 729, 410, 456, 456, 456, 456, 228, 228, 228, 228, 456, 456, 456, 456, 456, 456, 456, 479, 501, 456, 456, 456, 456, 410, 456, 410 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 138, 60, 57, 120, 63, 124, 89, -7, 135, 70, 46, 70, 71, -17, 77, 170, 21, 61, 50, 55, 74, 112, 60, 67, 71, 46, 77, 52, 41, 132, 176, 11, 61, 88, 66, 71, 71, 91, 63, 75, 39, 62, 62, 60, 62, 86, 71, 86, 72, 74, 122, 101, 142, 138, 16, 137, 19, 17, 115, -11, 35, -22, 135, 50, 48, 61, 69, 69, 71, 34, 53, 55, -49, 55, 55, 53, 53, 68, 11, 69, 63, 52, 84, 77, 98, 103, 9, 12, 25, 75, 74, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 78, 40, 49, 67, 74, 63, 138, 44, 82, 120, 87, 77, 44, 117, 138, 32, 52, 74, 203, 20, 103, 106, 2, 136, 82, 98, 123, 93, 106, 70, 11, 11, 11, 11, 11, 11, 7, 88, 71, 71, 71, 71, 75, 75, 75, 75, 57, 62, 86, 86, 86, 86, 86, 41, 35, 101, 101, 101, 101, 137, 71, 55, 50, 50, 50, 50, 50, 50, 50, 61, 69, 69, 69, 69, 78, 78, 78, 78, 67, 53, 68, 68, 68, 68, 68, 70, 24, 77, 77, 77, 77, 12, 11, 12 }, 1, 2, 21, true}, { "Helvetica-Narrow-Bold", /* #6 */ NULL, NULL, "helvetica-bold-r-narrow", "nimbus sans l-bold-r-condensed", "nimbus sans l-bold-r-condensed", NULL, "Helvetica", "sans-serif", "normal", "bold", "condensed", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 4, 3, 14, 962, 228, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 273, 389, 456, 456, 729, 592, 228, 273, 273, 319, 479, 228, 479, 228, 228, 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, 273, 273, 479, 479, 479, 501, 800, 592, 592, 592, 592, 547, 501, 638, 592, 228, 456, 592, 501, 683, 592, 638, 547, 638, 592, 547, 501, 592, 547, 774, 547, 547, 501, 273, 228, 273, 479, 456, 228, 456, 501, 456, 501, 456, 273, 501, 501, 228, 228, 456, 228, 729, 501, 501, 501, 501, 319, 456, 273, 501, 456, 638, 456, 456, 410, 319, 230, 319, 479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 273, 456, 456, 456, 456, 230, 456, 273, 604, 303, 456, 479, 273, 604, 273, 328, 479, 273, 273, 273, 501, 456, 228, 273, 273, 299, 456, 684, 684, 684, 501, 592, 592, 592, 592, 592, 592, 820, 592, 547, 547, 547, 547, 228, 228, 228, 228, 592, 592, 638, 638, 638, 638, 638, 479, 638, 592, 592, 592, 592, 547, 547, 501, 456, 456, 456, 456, 456, 456, 729, 456, 456, 456, 456, 456, 228, 228, 228, 228, 501, 501, 501, 501, 501, 501, 501, 479, 501, 501, 501, 501, 501, 456, 501, 456 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 80, 15, 25, 23, 44, 57, 29, 16, 22, 33, 52, 33, 52, -27, 26, 57, 21, 22, 22, 22, 25, 20, 26, 25, 75, 75, 31, 33, 31, 49, 97, 16, 62, 36, 62, 62, 62, 36, 58, 52, 18, 71, 62, 57, 57, 36, 62, 36, 62, 32, 11, 59, 16, 13, 11, 12, 20, 52, -27, 20, 51, 0, 57, 24, 50, 28, 28, 19, 8, 33, 53, 57, 2, 57, 57, 52, 53, 28, 51, 28, 52, 25, 8, 54, 11, 8, 12, 8, 16, 39, 69, 20, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 28, 23, -2, -7, 69, 28, 5, -9, 18, 72, 33, 22, -9, -5, 47, 33, 7, 7, 89, 54, -7, 48, 5, 21, 5, 72, 21, 21, 13, 45, 16, 16, 16, 16, 16, 16, 4, 36, 62, 62, 62, 62, -41, 52, -30, -17, -4, 57, 36, 36, 36, 36, 36, 33, 27, 59, 59, 59, 59, 12, 62, 57, 24, 24, 24, 24, 24, 24, 24, 28, 19, 19, 19, 19, -41, 57, -30, -17, 28, 53, 28, 28, 28, 28, 28, 33, 18, 54, 54, 54, 54, 8, 51, 8 }, 1, 3, 22, true}, { "Helvetica-Narrow-BoldOblique", /* #7 */ NULL, NULL, "helvetica-bold-o-narrow", "nimbus sans l-bold-o-condensed", "nimbus sans l-bold-i-condensed", NULL, "Helvetica", "sans-serif", "oblique", "bold", "condensed", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Helv. family? */ 24580, 1, 5, 3, 14, 962, 228, 718, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 273, 389, 456, 456, 729, 592, 228, 273, 273, 319, 479, 228, 479, 228, 228, 456, 456, 456, 456, 456, 456, 456, 456, 456, 456, 273, 273, 479, 479, 479, 501, 800, 592, 592, 592, 592, 547, 501, 638, 592, 228, 456, 592, 501, 683, 592, 638, 547, 638, 592, 547, 501, 592, 547, 774, 547, 547, 501, 273, 228, 273, 479, 456, 228, 456, 501, 456, 501, 456, 273, 501, 501, 228, 228, 456, 228, 729, 501, 501, 501, 501, 319, 456, 273, 501, 456, 638, 456, 456, 410, 319, 230, 319, 479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 273, 456, 456, 456, 456, 230, 456, 273, 604, 303, 456, 479, 273, 604, 273, 328, 479, 273, 273, 273, 501, 456, 228, 273, 273, 299, 456, 684, 684, 684, 501, 592, 592, 592, 592, 592, 592, 820, 592, 547, 547, 547, 547, 228, 228, 228, 228, 592, 592, 638, 638, 638, 638, 638, 479, 638, 592, 592, 592, 592, 547, 547, 501, 456, 456, 456, 456, 456, 456, 729, 456, 456, 456, 456, 456, 228, 228, 228, 228, 501, 501, 501, 501, 501, 501, 501, 479, 501, 501, 501, 501, 501, 456, 501, 456 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 158, 49, 55, 112, 73, 137, 62, -21, 120, 67, 23, 67, 52, -30, 71, 142, 21, 54, 50, 53, 70, 102, 57, 64, 75, 46, 67, 48, 30, 135, 152, 16, 62, 88, 62, 62, 62, 89, 58, 52, 49, 71, 62, 57, 57, 88, 62, 88, 62, 66, 114, 96, 141, 138, 11, 137, 20, 17, 101, -14, 107, -22, 136, 45, 50, 65, 67, 58, 71, 31, 53, 57, -35, 57, 57, 52, 53, 67, 15, 66, 52, 52, 82, 80, 103, 101, 12, 34, 16, 77, 66, -14, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 65, 41, 22, 49, 66, 50, 112, 46, 75, 111, 86, 60, 45, 100, 143, 33, 57, 75, 194, 18, 80, 90, -30, 121, 75, 85, 108, 108, 82, 44, 16, 16, 16, 16, 16, 16, 4, 88, 62, 62, 62, 62, 52, 52, 52, 52, 51, 57, 88, 88, 88, 88, 88, 47, 29, 96, 96, 96, 96, 137, 62, 57, 45, 45, 45, 45, 45, 45, 46, 65, 58, 58, 58, 58, 57, 57, 57, 57, 67, 53, 67, 67, 67, 67, 67, 67, 18, 80, 80, 80, 80, 34, 15, 34 }, 1, 4, 23, true}, { "Times-Roman", /* #8 */ NULL, NULL, "times-medium-r-normal", /* Adobe */ "nimbus roman no9 l-regular-r-normal", /* URW, for Debian */ "nimbus roman no9 l-medium-r-normal", /* URW, for SuSE */ NULL, "Times", "serif", "normal", "normal", "normal", "2 2 6 3 4 5 5 2 3 4", /* Panose for entire Times family? */ 25093, 1, 0, 0, 14, 898, 218, 662, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 408, 500, 500, 833, 778, 333, 333, 333, 500, 564, 250, 564, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 564, 564, 564, 444, 921, 722, 667, 667, 722, 611, 556, 722, 722, 333, 389, 722, 611, 889, 722, 722, 556, 722, 667, 556, 611, 722, 722, 944, 722, 722, 611, 333, 278, 333, 469, 500, 333, 444, 500, 444, 500, 444, 333, 500, 500, 278, 278, 500, 278, 778, 500, 500, 500, 500, 333, 389, 278, 500, 500, 722, 500, 500, 444, 480, 200, 480, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 500, 200, 500, 333, 760, 276, 500, 564, 333, 760, 333, 400, 564, 300, 300, 333, 500, 453, 250, 333, 300, 310, 500, 750, 750, 750, 444, 722, 722, 722, 722, 722, 722, 889, 667, 611, 611, 611, 611, 333, 333, 333, 333, 722, 722, 722, 722, 722, 722, 722, 564, 722, 722, 722, 722, 722, 722, 556, 500, 444, 444, 444, 444, 444, 444, 667, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 500, 500, 500, 500, 500, 500, 564, 500, 500, 500, 500, 500, 500, 500, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 130, 77, 5, 44, 61, 42, 79, 48, 29, 69, 30, 56, 30, 70, -9, 24, 111, 30, 43, 12, 32, 34, 20, 56, 30, 81, 80, 28, 30, 28, 68, 116, 15, 17, 28, 16, 12, 12, 32, 19, 18, 10, 34, 12, 12, 12, 34, 16, 34, 17, 42, 17, 14, 16, 5, 10, 22, 9, 88, -9, 34, 24, 0, 115, 37, 3, 25, 27, 25, 20, 28, 9, 16, -70, 7, 19, 16, 16, 29, 5, 24, 5, 51, 13, 9, 19, 21, 17, 14, 27, 100, 67, 130, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 53, 12, -22, -53, 67, 70, 18, 38, 4, 42, 30, 39, 38, 11, 57, 30, 1, 15, 93, 36, -22, 70, 52, 57, 6, 44, 37, 31, 15, 30, 15, 15, 15, 15, 15, 15, 0, 28, 12, 12, 12, 12, 18, 18, 11, 18, 16, 12, 34, 34, 34, 34, 34, 38, 34, 14, 14, 14, 14, 22, 16, 12, 37, 37, 37, 37, 37, 37, 38, 25, 25, 25, 25, 25, -8, 16, -16, -9, 29, 16, 29, 29, 29, 29, 29, 30, 29, 9, 9, 9, 9, 14, 5, 14 }, 2, 1, 0, true}, { "Times-Italic", /* #9 */ NULL, NULL, "times-medium-i-normal", "nimbus roman no9 l-regular-i-normal", "nimbus roman no9 l-medium-i-normal", NULL, "Times", "serif", "italic", "normal", "normal", "2 2 6 3 4 5 5 2 3 4", /* Panose for entire Times family? */ 25093, 1, 1, 0, 14, 883, 217, 653, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 420, 500, 500, 833, 778, 333, 333, 333, 500, 675, 250, 675, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 675, 675, 675, 500, 920, 611, 611, 667, 722, 611, 611, 722, 722, 333, 444, 667, 556, 833, 667, 722, 611, 722, 611, 500, 556, 722, 611, 833, 611, 556, 556, 389, 278, 389, 422, 500, 333, 500, 500, 444, 500, 444, 278, 500, 500, 278, 278, 444, 278, 722, 500, 500, 500, 500, 389, 389, 278, 500, 444, 667, 444, 444, 389, 400, 275, 400, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 389, 500, 500, 500, 500, 275, 500, 333, 760, 276, 500, 675, 333, 760, 333, 400, 675, 300, 300, 333, 500, 523, 250, 333, 300, 310, 500, 750, 750, 750, 500, 611, 611, 611, 611, 611, 611, 889, 667, 611, 611, 611, 611, 333, 333, 333, 333, 722, 667, 722, 722, 722, 722, 722, 675, 722, 722, 722, 722, 722, 556, 611, 500, 500, 500, 500, 500, 500, 500, 667, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 500, 500, 500, 500, 500, 500, 675, 500, 500, 500, 500, 500, 444, 500, 444 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 144, 2, 31, 79, 76, 151, 42, 16, 128, 86, -4, 86, 27, -65, 32, 49, 12, 15, 1, 15, 30, 75, 30, 23, 50, 27, 84, 86, 84, 132, 118, -51, -8, 66, -8, -1, 8, 52, -8, -8, -6, 7, -8, -18, -20, 60, 0, 59, -13, 17, 59, 102, 76, 71, -29, 78, -6, 21, -41, 12, 0, 0, 171, 17, 23, 30, 15, 31, -147, 8, 19, 49, -124, 14, 41, 12, 14, 27, -75, 25, 45, 16, 37, 42, 21, 16, -27, -24, -2, 51, 105, -7, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 77, 10, -22, 27, 105, 53, 107, 41, 42, 53, 86, 49, 41, 99, 101, 86, 33, 43, 180, -30, 55, 70, -30, 43, 67, 55, 33, 34, 23, 28, -51, -51, -51, -51, -51, -51, -27, 66, -1, -1, -1, -1, -8, -8, -8, -8, -8, -20, 60, 60, 60, 60, 60, 93, 60, 102, 102, 102, 102, 78, 0, -168, 17, 17, 17, 17, 17, 17, 23, 26, 31, 31, 31, 31, 49, 49, 34, 49, 27, 14, 27, 27, 27, 27, 27, 86, 28, 42, 42, 42, 42, -24, -75, -24 }, 2, 2, 1, true}, { "Times-Bold", /* #10 */ NULL, NULL, "times-bold-r-normal", "nimbus roman no9 l-bold-r-normal", "nimbus roman no9 l-bold-r-normal", NULL, "Times", "serif", "normal", "bold", "normal", "2 2 6 3 4 5 5 2 3 4", /* Panose for entire Times family? */ 25093, 1, 0, 3, 14, 935, 218, 676, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 555, 500, 500, 1000, 833, 333, 333, 333, 500, 570, 250, 570, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570, 570, 500, 930, 722, 667, 722, 722, 667, 611, 778, 778, 389, 500, 778, 667, 944, 722, 778, 611, 778, 722, 556, 667, 722, 722, 1000, 722, 722, 667, 333, 278, 333, 581, 500, 333, 500, 556, 444, 556, 444, 333, 500, 556, 278, 333, 556, 278, 833, 556, 500, 556, 556, 444, 389, 333, 556, 500, 722, 500, 500, 444, 394, 220, 394, 520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 500, 220, 500, 333, 747, 300, 500, 570, 333, 747, 333, 400, 570, 300, 300, 333, 556, 540, 250, 333, 300, 330, 500, 750, 750, 750, 500, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 389, 389, 389, 389, 722, 722, 778, 778, 778, 778, 778, 570, 778, 722, 722, 722, 722, 722, 611, 556, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 500, 556, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 83, 4, 29, 124, 62, 79, 46, 27, 56, 33, 39, 33, 41, -24, 24, 65, 17, 16, 19, 22, 28, 17, 28, 26, 82, 82, 31, 33, 31, 57, 108, 9, 16, 49, 14, 16, 16, 37, 21, 20, 3, 30, 19, 14, 16, 35, 16, 35, 26, 35, 31, 16, 16, 19, 16, 15, 28, 67, -25, 32, 73, 0, 70, 25, 17, 25, 25, 25, 14, 28, 16, 16, -57, 22, 16, 16, 21, 25, 19, 34, 29, 25, 20, 16, 21, 23, 12, 16, 21, 22, 66, 54, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 53, 21, -26, -64, 66, 57, -2, 26, -1, 23, 33, 44, 26, 1, 57, 33, 0, 3, 86, 33, 0, 41, 68, 28, 18, 27, 28, -7, 23, 55, 9, 9, 9, 9, 9, 9, 4, 49, 16, 16, 16, 16, 20, 20, 20, 20, 6, 16, 35, 35, 35, 35, 35, 48, 35, 16, 16, 16, 16, 15, 16, 19, 25, 25, 25, 25, 25, 25, 33, 25, 25, 25, 25, 25, -26, 16, -36, -36, 25, 21, 25, 25, 25, 25, 25, 33, 25, 16, 16, 16, 16, 16, 19, 16 }, 2, 3, 2, true}, { "Times-BoldItalic", /* #11 */ NULL, NULL, "times-bold-i-normal", "nimbus roman no9 l-bold-i-normal", "nimbus roman no9 l-bold-i-normal", NULL, "Times", "serif", "italic", "bold", "normal", "2 2 6 3 4 5 5 2 3 4", /* Panose for entire Times family? */ 25093, 1, 1, 3, 14, 921, 218, 669, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 389, 555, 500, 500, 833, 778, 333, 333, 333, 500, 570, 250, 606, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570, 570, 500, 832, 667, 667, 667, 722, 667, 667, 722, 778, 389, 500, 667, 611, 889, 722, 722, 611, 722, 667, 556, 611, 722, 667, 889, 667, 611, 611, 333, 278, 333, 570, 500, 333, 500, 500, 444, 500, 444, 333, 500, 556, 278, 278, 500, 278, 778, 556, 500, 500, 500, 389, 389, 278, 556, 444, 667, 500, 444, 389, 348, 220, 348, 570, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 389, 500, 500, 500, 500, 220, 500, 333, 747, 266, 500, 606, 333, 747, 333, 400, 570, 300, 300, 333, 576, 500, 250, 333, 300, 300, 500, 750, 750, 750, 500, 667, 667, 667, 667, 667, 667, 944, 667, 667, 667, 667, 667, 389, 389, 389, 389, 722, 722, 722, 722, 722, 722, 722, 570, 722, 722, 722, 722, 722, 611, 611, 500, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 444, 500, 444 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 136, -33, -20, 39, 5, 98, 28, -44, 65, 33, -60, 51, -9, -64, 17, 5, -27, -15, -15, -11, 23, 52, 3, -12, 23, -25, 31, 33, 31, 79, 63, -67, -24, 32, -46, -27, -13, 21, -24, -32, -46, -21, -22, -29, -27, 27, -27, 27, -29, 2, 50, 67, 65, 65, -24, 73, -11, -37, -1, -56, 67, 0, 128, -21, -14, -5, -21, 5, -169, -52, -13, 2, -189, -23, 2, -14, -6, -3, -120, 1, -21, -19, -11, 15, 16, 16, -46, -94, -43, 5, 66, -129, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 42, -32, -26, 33, 66, 36, 55, 30, 16, 12, 51, 2, 30, 51, 83, 33, 2, 17, 139, -60, -57, 51, -80, 30, 56, 12, 7, -9, 7, 30, -67, -67, -67, -67, -67, -67, -64, 32, -27, -27, -27, -27, -32, -32, -32, -32, -31, -27, 27, 27, 27, 27, 27, 48, 27, 67, 67, 67, 67, 73, -27, -200, -21, -21, -21, -21, -21, -21, -5, -24, 5, 5, 5, 5, 2, 2, -2, 2, -3, -6, -3, -3, -3, -3, -3, 33, -3, 15, 15, 15, 15, -94, -120, -94 }, 2, 4, 3, true}, { "AvantGarde-Book", /* #12 */ NULL, NULL, "itc avant garde gothic-book-r-normal", /* Adobe, for SGI etc. */ "avantgarde-book-r-normal", /* Adobe, for SunOS etc. */ "urw gothic l-medium-r-normal", /* URW, for SuSE */ NULL, "Avant Garde", "sans-serif", "normal", "normal", "normal", "2 11 4 2 2 2 3 2 3 4", /* Panose for entire AvantGarde family? */ 24607, 1, 0, 0, 14, 955, 222, 740, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 295, 309, 554, 554, 775, 757, 351, 369, 369, 425, 606, 277, 606, 277, 437, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 277, 277, 606, 606, 606, 591, 867, 740, 574, 813, 744, 536, 485, 872, 683, 226, 482, 591, 462, 919, 740, 869, 592, 871, 607, 498, 426, 655, 702, 960, 609, 592, 480, 351, 605, 351, 606, 500, 351, 683, 682, 647, 685, 650, 314, 673, 610, 200, 203, 502, 200, 938, 610, 655, 682, 682, 301, 388, 339, 608, 554, 831, 480, 536, 425, 351, 672, 351, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 295, 554, 554, 554, 554, 672, 615, 369, 747, 369, 425, 606, 332, 747, 485, 400, 606, 332, 332, 375, 608, 564, 277, 324, 332, 369, 425, 831, 831, 831, 591, 740, 740, 740, 740, 740, 740, 992, 813, 536, 536, 536, 536, 226, 226, 226, 226, 790, 740, 869, 869, 869, 869, 869, 606, 868, 655, 655, 655, 655, 592, 592, 554, 683, 683, 683, 683, 683, 683, 1157, 647, 650, 650, 650, 650, 200, 200, 200, 200, 655, 610, 655, 655, 655, 655, 655, 606, 653, 608, 608, 608, 608, 536, 682, 536 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 36, 33, 70, 21, 56, 94, 47, 14, 58, 51, 14, 51, 102, 44, 29, 135, 40, 34, 14, 26, 24, 63, 41, 24, 102, 14, 46, 51, 52, 64, 65, 12, 74, 43, 74, 70, 70, 40, 76, 76, 6, 81, 82, 76, 75, 43, 75, 40, 70, 22, 6, 75, 8, 11, 8, 1, 12, 133, 118, 14, 53, 0, 95, 42, 68, 41, 39, 38, 19, 37, 62, 65, -44, 70, 65, 66, 65, 42, 64, 37, 65, 24, 14, 62, 7, 13, 12, 15, 10, 70, 299, 20, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 48, 4, 8, 4, 299, 85, 73, -9, -3, 40, 51, 30, -9, 73, 56, 51, 19, 18, 78, 80, 22, 102, 80, 63, 12, 39, 100, 81, 46, 65, 12, 12, 12, 12, 12, 12, -20, 43, 70, 70, 70, 70, -47, 44, -64, 2, 40, 75, 43, 43, 43, 43, 43, 74, 43, 75, 75, 75, 75, 1, 60, 61, 42, 42, 42, 42, 42, 42, 34, 41, 38, 38, 38, 38, -60, 31, -77, -11, 42, 65, 42, 42, 42, 42, 42, 51, 41, 62, 62, 62, 62, 15, 64, 15 }, 3, 1, 4, true}, { "AvantGarde-BookOblique", /* #13 */ NULL, NULL, "itc avant garde gothic-book-o-normal", "avantgarde-book-o-normal", "urw gothic l-medium-o-normal", NULL, "Avant Garde", "sans-serif", "oblique", "normal", "normal", "2 11 4 2 2 2 3 2 3 4", /* Panose for entire AvantGarde family? */ 24607, 1, 1, 0, 14, 955, 222, 740, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 295, 309, 554, 554, 775, 757, 351, 369, 369, 425, 606, 277, 606, 277, 437, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 277, 277, 606, 606, 606, 591, 867, 740, 574, 813, 744, 536, 485, 872, 683, 226, 482, 591, 462, 919, 740, 869, 592, 871, 607, 498, 426, 655, 702, 960, 609, 592, 480, 351, 605, 351, 606, 500, 351, 683, 682, 647, 685, 650, 314, 673, 610, 200, 203, 502, 200, 938, 610, 655, 682, 682, 301, 388, 339, 608, 554, 831, 480, 536, 425, 351, 672, 351, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 295, 554, 554, 554, 554, 672, 615, 369, 747, 369, 425, 606, 332, 747, 485, 400, 606, 332, 332, 375, 608, 564, 277, 324, 332, 369, 425, 831, 831, 831, 591, 740, 740, 740, 740, 740, 740, 992, 813, 536, 536, 536, 536, 226, 226, 226, 226, 790, 740, 869, 869, 869, 869, 869, 606, 868, 655, 655, 655, 655, 592, 592, 554, 683, 683, 683, 683, 683, 683, 1157, 647, 650, 650, 650, 650, 200, 200, 200, 200, 655, 610, 655, 655, 655, 655, 655, 606, 653, 608, 608, 608, 608, 536, 682, 536 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 130, 71, 107, 124, 92, 195, 89, -24, 170, 92, 2, 92, 102, 25, 71, 260, 40, 73, 39, 69, 65, 110, 77, 111, 102, 2, 87, 73, 51, 158, 126, 12, 74, 105, 74, 70, 70, 103, 76, 76, 37, 81, 82, 76, 75, 105, 75, 102, 70, 57, 131, 118, 145, 148, 8, 138, 12, 145, 255, -19, 110, -23, 232, 88, 68, 87, 85, 84, 104, 56, 62, 65, -80, 70, 65, 66, 65, 88, 28, 83, 65, 49, 104, 100, 108, 114, 12, 97, 10, 115, 280, -15, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 115, 29, 24, 75, 280, 118, 191, 53, 102, 92, 110, 76, 53, 197, 158, 47, 74, 98, 203, 46, 119, 137, 52, 190, 116, 60, 183, 164, 126, 64, 12, 12, 12, 12, 12, 12, -20, 105, 70, 70, 70, 70, 76, 76, 76, 76, 104, 75, 105, 105, 105, 105, 105, 87, 76, 118, 118, 118, 118, 138, 60, 61, 88, 88, 88, 88, 88, 88, 80, 87, 84, 84, 84, 84, 65, 65, 41, 65, 88, 65, 88, 88, 88, 88, 88, 92, 51, 100, 100, 100, 100, 97, 28, 97 }, 3, 2, 5, true}, { "AvantGarde-Demi", /* #14 */ NULL, NULL, "itc avant garde gothic-demi-r-normal", "avantgarde-demi-r-normal", "urw gothic l-semibold-r-normal", NULL, "Avant Garde", "sans-serif", "normal", "bold", "normal", "2 11 4 2 2 2 3 2 3 4", /* Panose for entire AvantGarde family? */ 24607, 1, 0, 2, 14, 1021, 251, 740, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, 280, 360, 560, 560, 860, 680, 280, 380, 380, 440, 600, 280, 600, 280, 460, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 280, 280, 600, 600, 600, 560, 740, 740, 580, 780, 700, 520, 480, 840, 680, 280, 480, 620, 440, 900, 740, 840, 560, 840, 580, 520, 420, 640, 700, 900, 680, 620, 500, 320, 640, 320, 600, 500, 280, 660, 660, 640, 660, 640, 280, 660, 600, 240, 260, 580, 240, 940, 600, 640, 660, 660, 320, 440, 300, 600, 560, 800, 560, 580, 460, 340, 600, 340, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, 280, 560, 560, 560, 560, 600, 560, 500, 740, 360, 460, 600, 420, 740, 420, 400, 600, 336, 336, 420, 576, 600, 280, 340, 336, 360, 460, 840, 840, 840, 560, 740, 740, 740, 740, 740, 740, 900, 780, 520, 520, 520, 520, 280, 280, 280, 280, 742, 740, 840, 840, 840, 840, 840, 600, 840, 640, 640, 640, 640, 620, 560, 600, 660, 660, 660, 660, 660, 660, 1080, 640, 640, 640, 640, 640, 240, 240, 240, 240, 640, 600, 640, 640, 640, 640, 640, 600, 660, 600, 600, 600, 600, 580, 660, 580 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 19, 29, 58, 36, 34, 72, 74, 37, 67, 48, 73, 48, 73, 6, 32, 137, 36, 28, 15, 25, 23, 62, 33, 24, 73, 73, 46, 48, 46, 38, 50, 7, 70, 34, 63, 61, 61, 27, 71, 72, 2, 89, 72, 63, 70, 33, 72, 32, 64, 12, 6, 55, 8, 7, 4, -2, 19, 66, 96, 36, 73, 0, 72, 27, 47, 37, 34, 31, 15, 32, 54, 53, 16, 80, 54, 54, 54, 25, 47, 31, 63, 19, 21, 50, 3, 11, 3, 8, 20, -3, 233, 23, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 43, -2, 27, -10, 233, 28, 78, -12, 19, 61, 48, 71, -12, 72, 57, 48, 13, 8, 91, 38, -7, 73, 98, 72, 23, 61, 92, 62, 18, 68, 7, 7, 7, 7, 7, 7, -5, 34, 61, 61, 61, 61, -45, 46, -59, -32, 25, 70, 33, 33, 33, 33, 33, 59, 33, 55, 55, 55, 55, -2, 72, 51, 27, 27, 27, 27, 27, 27, 29, 37, 31, 31, 31, 31, -65, 26, -79, -52, 27, 54, 25, 25, 25, 25, 25, 48, 35, 50, 50, 50, 50, 8, 47, 8 }, 3, 3, 6, true}, { "AvantGarde-DemiOblique", /* #15 */ NULL, NULL, "itc avant garde gothic-demi-o-normal", "avantgarde-demi-o-normal", "urw gothic l-semibold-o-normal", NULL, "Avant Garde", "sans-serif", "oblique", "bold", "normal", "2 11 4 2 2 2 3 2 3 4", /* Panose for entire AvantGarde family? */ 24607, 1, 1, 2, 14, 1021, 251, 740, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, 280, 360, 560, 560, 860, 680, 280, 380, 380, 440, 600, 280, 600, 280, 460, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 280, 280, 600, 600, 600, 560, 740, 740, 580, 780, 700, 520, 480, 840, 680, 280, 480, 620, 440, 900, 740, 840, 560, 840, 580, 520, 420, 640, 700, 900, 680, 620, 500, 320, 640, 320, 600, 500, 280, 660, 660, 640, 660, 640, 280, 660, 600, 240, 260, 580, 240, 940, 600, 640, 660, 660, 320, 440, 300, 600, 560, 800, 560, 580, 460, 340, 600, 340, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 280, 280, 560, 560, 560, 560, 600, 560, 500, 740, 360, 460, 600, 420, 740, 420, 400, 600, 336, 336, 420, 576, 600, 280, 340, 336, 360, 460, 840, 840, 840, 560, 740, 740, 740, 740, 740, 740, 900, 780, 520, 520, 520, 520, 280, 280, 280, 280, 742, 740, 840, 840, 840, 840, 840, 600, 840, 640, 640, 640, 640, 620, 560, 600, 660, 660, 660, 660, 660, 660, 1080, 640, 640, 640, 640, 640, 240, 240, 240, 240, 640, 600, 640, 640, 640, 640, 640, 600, 660, 600, 600, 600, 600, 580, 660, 580 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 127, 66, 99, 139, 71, 159, 120, 8, 174, 84, 48, 84, 73, -13, 70, 230, 44, 67, 36, 64, 64, 83, 71, 110, 73, 48, 84, 63, 45, 135, 109, 7, 70, 97, 63, 61, 61, 89, 71, 72, 34, 89, 72, 63, 70, 95, 72, 94, 64, 49, 119, 97, 145, 144, 4, 135, 19, 89, 233, 7, 142, -23, 158, 73, 47, 84, 80, 77, 62, 33, 54, 53, -18, 80, 54, 54, 54, 71, 13, 78, 63, 49, 86, 87, 106, 114, 3, 75, 20, 40, 214, -12, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 110, 38, 53, 83, 214, 65, 196, 50, 127, 105, 105, 114, 50, 192, 160, 37, 73, 87, 224, 3, 90, 108, 67, 182, 131, 81, 187, 157, 97, 69, 7, 7, 7, 7, 7, 7, -5, 97, 61, 61, 61, 61, 72, 72, 72, 72, 83, 70, 95, 95, 95, 95, 95, 76, 94, 97, 97, 97, 97, 135, 72, 51, 73, 73, 73, 73, 73, 73, 75, 83, 77, 77, 77, 77, 53, 53, 39, 53, 73, 54, 71, 71, 71, 71, 71, 84, 81, 87, 87, 87, 87, 75, 13, 75 }, 3, 4, 7, true}, { "Bookman-Light", /* #16 */ NULL, NULL, "itc bookman-light-r-normal", /* Adobe, for SGI etc. */ "bookman-light-r-normal", /* Adobe, for SunOS etc. */ "urw bookman l-medium-r-normal", /* URW, for SuSE */ NULL, "Bookman", "serif", "normal", "300", "normal", "2 5 6 4 5 5 5 2 2 4", /* Panose for entire Bookman family? */ 24623, 1, 0, -3, 14, 908, 251, 681, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, 300, 380, 620, 620, 900, 800, 220, 300, 300, 440, 600, 320, 600, 320, 600, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 320, 320, 600, 600, 600, 540, 820, 680, 740, 740, 800, 720, 640, 800, 800, 340, 600, 720, 600, 920, 740, 800, 620, 820, 720, 660, 620, 780, 700, 960, 720, 640, 640, 300, 600, 300, 600, 500, 220, 580, 620, 520, 620, 520, 320, 540, 660, 300, 300, 620, 300, 940, 660, 560, 620, 580, 440, 520, 380, 680, 520, 780, 560, 540, 480, 280, 600, 280, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, 300, 620, 620, 620, 620, 600, 520, 420, 740, 420, 360, 600, 400, 740, 440, 400, 600, 372, 372, 340, 680, 600, 320, 320, 372, 420, 360, 930, 930, 930, 540, 680, 680, 680, 680, 680, 680, 1260, 740, 720, 720, 720, 720, 340, 340, 340, 340, 800, 740, 800, 800, 800, 800, 800, 600, 800, 780, 780, 780, 780, 640, 620, 660, 580, 580, 580, 580, 580, 580, 860, 520, 520, 520, 520, 520, 300, 300, 300, 300, 560, 660, 560, 560, 560, 560, 560, 600, 560, 680, 680, 680, 680, 540, 620, 540 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 56, 65, 34, 22, 45, 46, 76, 17, 54, 51, 90, 51, 92, 74, 40, 160, 42, 40, 25, 60, 45, 60, 44, 37, 92, 90, 49, 51, 48, 27, 55, -37, 31, 44, 31, 31, 31, 44, 31, 31, -23, 31, 31, 26, 26, 44, 31, 44, 31, 28, -37, 25, -30, -30, -30, -30, 10, 92, 74, 41, 52, 0, 46, 35, -2, 37, 37, 37, 20, 17, 20, 20, -109, 20, 20, 17, 20, 37, 20, 37, 20, 40, 20, 20, -23, -19, -16, -23, 7, 21, 264, 21, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 116, 8, 58, -22, 264, 33, 68, 24, 49, 51, 51, 50, 23, 68, 50, 51, 20, 12, 68, 20, 14, 92, 68, 80, 56, 51, 80, 80, 52, 23, -37, -37, -37, -37, -37, -37, -36, 44, 31, 31, 31, 31, 31, 31, 28, 28, 31, 26, 44, 44, 44, 44, 44, 51, 44, 25, 25, 25, 25, -30, 31, -109, 35, 35, 35, 35, 35, 35, 35, 37, 37, 37, 37, 37, 20, 20, 8, 8, 37, 20, 37, 37, 37, 37, 37, 51, 37, 20, 20, 20, 20, -23, 20, -23 }, 4, 1, 8, true}, { "Bookman-LightItalic", /* #17 */ NULL, NULL, "itc bookman-light-i-normal", "bookman-light-i-normal", "urw bookman l-medium-i-normal", NULL, "Bookman", "serif", "italic", "300", "normal", "2 5 6 4 5 5 5 2 2 4", /* Panose for entire Bookman family? */ 24623, 1, 1, -3, 14, 883, 250, 681, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 320, 360, 620, 620, 800, 820, 280, 280, 280, 440, 600, 300, 600, 300, 600, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 300, 300, 600, 600, 600, 540, 780, 700, 720, 720, 740, 680, 620, 760, 800, 320, 560, 720, 580, 860, 720, 760, 600, 780, 700, 640, 600, 720, 680, 960, 700, 660, 580, 260, 600, 260, 600, 500, 280, 620, 600, 480, 640, 540, 340, 560, 620, 280, 280, 600, 280, 880, 620, 540, 600, 560, 400, 540, 340, 620, 540, 880, 540, 600, 520, 360, 600, 380, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300, 320, 620, 620, 620, 620, 600, 620, 420, 740, 440, 300, 600, 320, 740, 440, 400, 600, 372, 372, 320, 620, 620, 300, 320, 372, 400, 300, 930, 930, 930, 540, 700, 700, 700, 700, 700, 700, 1220, 720, 680, 680, 680, 680, 320, 320, 320, 320, 740, 720, 760, 760, 760, 760, 760, 600, 760, 720, 720, 720, 720, 660, 600, 620, 620, 620, 620, 620, 620, 620, 880, 480, 540, 540, 540, 540, 280, 280, 280, 280, 540, 620, 540, 540, 540, 540, 540, 600, 540, 620, 620, 620, 620, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 107, 107, 78, 56, 65, 148, 96, -8, 139, 91, 88, 91, 96, 104, 86, 154, 66, 55, 69, 70, 89, 143, 61, 77, 96, 88, 79, 91, 93, 114, 102, -25, 21, 88, 21, 21, 21, 88, 21, 21, -2, 21, 21, 18, 18, 88, 21, 61, 21, 61, 50, 118, 87, 87, -25, 87, 8, 56, 84, 15, 97, 0, 191, 71, 88, 65, 65, 65, -160, 4, 88, 88, -200, 88, 100, 88, 88, 65, -24, 65, 88, 65, 88, 88, 88, 88, 9, 60, 38, 122, 294, 13, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 148, 4, 100, 71, 294, 38, 185, 84, 130, 70, 91, 78, 84, 178, 120, 91, 68, 70, 178, 53, 112, 137, 45, 114, 139, 60, 91, 91, 99, 18, -25, -25, -25, -25, -25, -25, -45, 88, 21, 21, 21, 21, 21, 21, 21, 21, 21, 18, 88, 88, 88, 88, 88, 91, 88, 118, 118, 118, 118, 87, 21, -121, 71, 71, 71, 71, 71, 71, 71, 65, 65, 65, 65, 65, 88, 88, 76, 88, 65, 88, 65, 65, 65, 65, 65, 91, 65, 88, 88, 88, 88, 60, -24, 60 }, 4, 2, 9, true}, { "Bookman-Demi", /* #18 */ NULL, NULL, "itc bookman-demi-r-normal", "bookman-demi-r-normal", "urw bookman l-bold-r-normal", NULL, "Bookman", "serif", "normal", "bold", "normal", "2 5 6 4 5 5 5 2 2 4", /* Panose for entire Bookman family? */ 24623, 1, 0, 2, 14, 934, 250, 681, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 340, 360, 420, 660, 660, 940, 800, 320, 320, 320, 460, 600, 340, 600, 340, 600, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 340, 340, 600, 600, 600, 660, 820, 720, 720, 740, 780, 720, 680, 780, 820, 400, 640, 800, 640, 940, 740, 800, 660, 800, 780, 660, 700, 740, 720, 940, 780, 700, 640, 300, 600, 300, 600, 500, 320, 580, 600, 580, 640, 580, 380, 580, 680, 360, 340, 660, 340, 1000, 680, 620, 640, 620, 460, 520, 460, 660, 600, 800, 600, 620, 560, 320, 600, 320, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 340, 360, 660, 660, 660, 660, 600, 600, 500, 740, 400, 400, 600, 360, 740, 460, 400, 600, 396, 396, 400, 660, 800, 340, 360, 396, 400, 400, 990, 990, 990, 660, 720, 720, 720, 720, 720, 720, 1140, 740, 720, 720, 720, 720, 400, 400, 400, 400, 780, 740, 800, 800, 800, 800, 800, 600, 800, 740, 740, 740, 740, 700, 660, 660, 580, 580, 580, 580, 580, 580, 880, 580, 580, 580, 580, 580, 360, 360, 360, 360, 620, 680, 620, 620, 620, 620, 620, 600, 620, 660, 660, 660, 660, 620, 640, 620 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 11, 84, 48, 12, 21, 82, 48, 20, 62, 51, 78, 51, 76, 50, 30, 137, 41, 37, 19, 44, 34, 36, 36, 33, 76, 75, 49, 51, 48, 61, 60, -34, 20, 35, 20, 20, 20, 35, 20, 20, -12, 20, 20, 20, 20, 35, 20, 35, 20, 21, -4, 15, -20, -20, 1, -20, 6, 75, 50, 21, 52, 0, 82, 28, -20, 31, 31, 31, 22, 9, 22, 22, -94, 22, 9, 22, 22, 31, 22, 31, 22, 22, 22, 22, -6, -6, 8, 6, 22, 14, 243, 15, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 133, 10, 77, -28, 243, 36, 68, 23, 27, 34, 51, 20, 23, 68, 50, 51, 14, 5, 68, 22, 51, 76, 68, 65, 17, 34, 65, 65, 15, 62, -34, -34, -34, -34, -34, -34, -34, 35, 20, 20, 20, 20, 20, 20, 18, 18, 20, 20, 35, 35, 35, 35, 35, 48, 35, 15, 15, 15, 15, -20, 20, -61, 28, 28, 28, 28, 28, 28, 28, 31, 31, 31, 31, 31, 22, 22, -2, -2, 31, 22, 31, 31, 31, 31, 31, 51, 31, 22, 22, 22, 22, 6, 22, 6 }, 4, 3, 10, true}, { "Bookman-DemiItalic", /* #19 */ NULL, NULL, "itc bookman-demi-i-normal", "bookman-demi-i-normal", "urw bookman l-bold-i-normal", NULL, "Bookman", "serif", "italic", "bold", "normal", "2 5 6 4 5 5 5 2 2 4", /* Panose for entire Bookman family? */ 24623, 1, 1, 2, 14, 941, 250, 681, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 340, 320, 380, 680, 680, 880, 980, 320, 260, 260, 460, 600, 340, 600, 340, 360, 680, 680, 680, 680, 680, 680, 680, 680, 680, 680, 340, 340, 620, 600, 620, 620, 780, 720, 720, 700, 760, 720, 660, 760, 800, 380, 620, 780, 640, 860, 740, 760, 640, 760, 740, 700, 700, 740, 660, 1000, 740, 660, 680, 260, 580, 260, 620, 500, 320, 680, 600, 560, 680, 560, 420, 620, 700, 380, 320, 700, 380, 960, 680, 600, 660, 620, 500, 540, 440, 680, 540, 860, 620, 600, 560, 300, 620, 300, 620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 340, 320, 680, 680, 680, 680, 620, 620, 520, 780, 440, 380, 620, 280, 780, 480, 400, 600, 408, 408, 340, 680, 680, 340, 360, 408, 440, 380, 1020, 1020, 1020, 620, 720, 720, 720, 720, 720, 720, 1140, 700, 720, 720, 720, 720, 380, 380, 380, 380, 760, 740, 760, 760, 760, 760, 760, 600, 760, 740, 740, 740, 740, 660, 640, 660, 680, 680, 680, 680, 680, 680, 880, 560, 560, 560, 560, 560, 380, 380, 380, 380, 600, 680, 600, 600, 600, 600, 600, 600, 600, 680, 680, 680, 680, 600, 660, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 140, 157, 45, 106, 48, 171, 31, -35, 126, 91, 100, 91, 106, 9, 87, 123, 67, 72, 63, 78, 88, 123, 68, 71, 106, 100, 79, 91, 89, 145, 80, -27, 14, 78, 14, 14, 14, 77, 14, 14, 8, 14, 14, 14, 14, 78, -6, 37, 14, 59, 70, 112, 72, 72, -7, 72, 23, 9, 73, -18, 92, 0, 155, 84, 57, 58, 60, 59, -192, 21, 93, 83, -160, 97, 109, 83, 83, 59, -24, 60, 84, 32, 106, 83, 56, 56, 10, 25, 36, 49, 303, -8, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 161, 0, 148, 92, 303, 46, 180, 83, 118, 62, 81, 59, 83, 177, 130, 91, 91, 86, 176, 54, 137, 126, 68, 118, 127, 62, 118, 118, 86, 83, -27, -27, -27, -27, -27, -27, -27, 78, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 78, 78, 78, 78, 78, 91, 21, 112, 112, 112, 112, 72, -6, -231, 84, 84, 84, 84, 84, 84, 39, 58, 59, 59, 59, 59, 83, 83, 83, 83, 59, 83, 59, 59, 59, 59, 59, 91, 17, 83, 83, 83, 83, 25, -24, 25 }, 4, 4, 11, true}, { "Courier", /* #20 */ "CourierPS", NULL, "courier-medium-r-normal", /* Adobe */ "nimbus mono l-medium-r-normal", /* URW, for SuSE */ "nimbus mono l-regular-r-normal", /* URW, for Debian */ NULL, "Courier", "monospace", "normal", "normal", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 24579, 0, 0, 0, 14, 805, 250, 562, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 187, 93, 105, 81, 63, 213, 269, 160, 116, 80, 181, 80, 229, 125, 106, 96, 70, 75, 78, 92, 111, 82, 102, 96, 229, 181, 41, 80, 66, 129, 77, 3, 43, 41, 43, 53, 53, 31, 32, 96, 34, 38, 47, 4, 7, 43, 79, 43, 38, 72, 38, 17, -4, -3, 23, 24, 86, 269, 118, 158, 94, 0, 224, 53, 14, 66, 45, 66, 114, 45, 18, 95, 82, 43, 95, -5, 26, 62, 9, 45, 60, 80, 87, 21, 10, -4, 20, 7, 99, 182, 275, 163, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 96, 84, 73, 26, 275, 113, 148, 0, 156, 37, 87, 103, 0, 120, 123, 87, 177, 155, 242, 21, 50, 222, 224, 172, 157, 37, 0, 0, 8, 108, 3, 3, 3, 3, 3, 3, 3, 41, 53, 53, 53, 53, 96, 96, 96, 96, 30, 7, 43, 43, 43, 43, 43, 87, 43, 17, 17, 17, 17, 24, 79, 48, 53, 53, 53, 53, 53, 53, 19, 66, 66, 66, 66, 66, 95, 95, 94, 95, 62, 26, 62, 62, 62, 62, 62, 87, 62, 21, 21, 21, 21, 7, -6, 7 }, 5, 1, 12, true}, { "Courier-Oblique", /* #21 */ "CourierPS-Oblique", #ifndef USE_LJ_FONTS_IN_PS "Courier-Italic", /* treat name of similar PCL font as alias */ #else NULL, #endif "courier-medium-o-normal", "nimbus mono l-medium-o-normal", "nimbus mono l-regular-o-normal", NULL, "Courier", "monospace", "oblique", "normal", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 24579, 0, 1, 0, 14, 805, 250, 562, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, 273, 133, 108, 134, 87, 283, 313, 137, 212, 129, 157, 129, 238, 112, 154, 98, 70, 82, 108, 99, 155, 182, 132, 93, 238, 157, 96, 109, 85, 222, 127, 3, 43, 93, 43, 53, 53, 83, 32, 96, 52, 38, 47, 4, 7, 94, 79, 95, 38, 76, 108, 125, 105, 106, 23, 133, 86, 246, 249, 135, 175, -27, 343, 76, 29, 106, 85, 106, 114, 61, 33, 95, 52, 58, 95, -5, 26, 102, -24, 85, 60, 78, 167, 101, 90, 76, 20, -4, 99, 233, 222, 140, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 225, 151, 124, 94, 120, 238, 104, 262, 53, 209, 92, 155, 152, 53, 232, 214, 96, 230, 213, 348, 72, 100, 275, 197, 231, 210, 58, 65, 65, 73, 105, 3, 3, 3, 3, 3, 3, 3, 93, 53, 53, 53, 53, 96, 96, 96, 96, 43, 7, 94, 94, 94, 94, 94, 103, 94, 125, 125, 125, 125, 133, 79, 48, 76, 76, 76, 76, 76, 76, 41, 106, 106, 106, 106, 106, 95, 95, 95, 95, 102, 26, 102, 102, 102, 102, 102, 136, 102, 101, 101, 101, 101, -4, -24, -4 }, 5, 2, 13, true}, { "Courier-Bold", /* #22 */ "CourierPS-Bold", NULL, "courier-bold-r-normal", "nimbus mono l-bold-r-normal", "nimbus mono l-bold-r-normal", NULL, "Courier", "monospace", "normal", "bold", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 24579, 0, 0, 3, 14, 801, 250, 562, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 135, 56, 82, 5, 36, 171, 219, 139, 91, 71, 123, 71, 192, 98, 87, 81, 61, 63, 53, 70, 90, 55, 83, 79, 191, 123, 66, 71, 77, 98, 16, -9, 30, 22, 30, 25, 39, 22, 20, 77, 37, 21, 39, -2, 8, 22, 48, 32, 24, 47, 21, 4, -13, -18, 12, 12, 62, 245, 99, 125, 108, 0, 178, 35, 0, 40, 20, 40, 83, 30, 5, 77, 63, 20, 77, -22, 18, 30, -1, 20, 47, 68, 47, -1, -1, -18, 6, -4, 81, 160, 255, 136, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 202, 66, 72, 54, 10, 255, 83, 128, 0, 147, 8, 71, 100, 0, 88, 86, 71, 143, 138, 205, -1, 6, 196, 205, 153, 147, 47, -56, -47, -47, 99, -9, -9, -9, -9, -9, -9, -29, 22, 25, 25, 25, 25, 77, 77, 77, 77, 30, 8, 22, 22, 22, 22, 22, 81, 22, 4, 4, 4, 4, 12, 48, 22, 35, 35, 35, 35, 35, 35, -4, 40, 40, 40, 40, 40, 77, 77, 63, 77, 58, 18, 30, 30, 30, 30, 30, 71, 30, -1, -1, -1, -1, -4, -14, -4 }, 5, 3, 14, true}, { "Courier-BoldOblique", /* #23 */ "CourierPS-BoldOblique", #ifndef USE_LJ_FONTS_IN_PS "Courier-BoldItalic", /* treat name of similar PCL font as alias */ #else NULL, #endif "courier-bold-o-normal", "nimbus mono l-bold-o-normal", "nimbus mono l-bold-o-normal", NULL, "Courier", "monospace", "oblique", "bold", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 24579, 0, 1, 3, 14, 801, 250, 562, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 216, 212, 88, 87, 102, 62, 230, 266, 117, 179, 114, 99, 114, 207, 91, 136, 93, 61, 72, 82, 77, 136, 147, 115, 76, 206, 99, 121, 96, 97, 183, 66, -9, 30, 75, 30, 25, 39, 75, 20, 77, 59, 21, 39, -2, 8, 74, 48, 84, 24, 54, 86, 101, 84, 84, 12, 109, 62, 223, 223, 103, 171, -27, 297, 62, 13, 81, 61, 81, 83, 41, 18, 77, 37, 33, 77, -22, 18, 71, -31, 61, 47, 67, 118, 70, 70, 53, 6, -20, 81, 204, 202, 114, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, 121, 107, 77, 98, 218, 74, 244, 53, 189, 63, 135, 143, 53, 195, 173, 76, 192, 193, 313, 50, 61, 249, 169, 213, 189, 72, 14, 23, 8, 101, -9, -9, -9, -9, -9, -9, -29, 74, 25, 25, 25, 25, 77, 77, 77, 77, 30, 8, 74, 74, 74, 74, 74, 105, 48, 101, 101, 101, 101, 109, 48, 22, 62, 62, 62, 62, 62, 62, 21, 81, 81, 81, 81, 81, 77, 77, 77, 77, 93, 18, 71, 71, 71, 71, 71, 114, 55, 70, 70, 70, 70, -20, -31, -20 }, 5, 4, 15, true}, { "NewCenturySchlbk-Roman", /* #24 */ NULL, NULL, "new century schoolbook-medium-r-normal", /* Adobe */ "newcenturyschlbk-medium-r-normal", /* Adobe, for DEC etc. */ "century schoolbook l-medium-r-normal", /* URW, for SuSE and Debian */ NULL, "New Century Schoolbook", "serif", "normal", "normal", "normal", "2 4 6 4 5 5 5 2 3 4", /* Panose for entire NCS family? */ 24703, 1, 0, 0, 14, 965, 250, 722, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 296, 389, 556, 556, 833, 815, 204, 333, 333, 500, 606, 278, 606, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 606, 606, 606, 444, 737, 722, 722, 722, 778, 722, 667, 778, 833, 407, 556, 778, 667, 944, 815, 778, 667, 778, 722, 630, 667, 815, 722, 981, 704, 704, 611, 333, 606, 333, 606, 500, 204, 556, 556, 444, 574, 500, 333, 537, 611, 315, 296, 593, 315, 889, 611, 500, 574, 556, 444, 463, 389, 611, 537, 778, 537, 537, 481, 333, 606, 333, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 296, 556, 556, 556, 556, 606, 500, 333, 737, 334, 426, 606, 333, 737, 333, 400, 606, 333, 333, 333, 611, 606, 278, 333, 333, 300, 426, 834, 834, 834, 444, 722, 722, 722, 722, 722, 722, 1000, 722, 722, 722, 722, 722, 407, 407, 407, 407, 778, 815, 778, 778, 778, 778, 778, 606, 778, 815, 815, 815, 815, 704, 667, 574, 556, 556, 556, 556, 556, 556, 796, 444, 500, 500, 500, 500, 315, 315, 315, 315, 500, 611, 500, 500, 500, 500, 500, 606, 500, 611, 611, 611, 611, 537, 574, 537 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 61, 28, 45, 43, 51, 25, 40, 54, 57, 50, 62, 50, 77, -32, 42, 100, 35, 42, 28, 46, 41, 59, 42, 41, 77, 62, 50, 50, 50, 29, -8, -8, 29, 45, 29, 29, 29, 45, 29, 38, 5, 29, 29, 29, 24, 45, 29, 45, 29, 47, 19, 16, -8, 5, -8, -11, 24, 126, 132, 18, 89, 0, 25, 44, 10, 34, 34, 34, 18, 23, 7, 18, -86, 10, 18, 26, 22, 34, 22, 34, 18, 46, 18, 22, -6, 1, 8, 4, 42, 54, 267, 54, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 74, 18, 26, -1, 267, 55, 16, -8, -4, 39, 50, 42, -8, 10, 57, 50, 14, 18, 91, 22, 60, 71, 29, 39, 4, 39, 39, 39, 28, 29, -8, -8, -8, -8, -8, -8, 0, 45, 29, 29, 29, 29, 38, 38, 38, 38, 29, 24, 45, 45, 45, 45, 45, 74, 45, 16, 16, 16, 16, -11, 29, 30, 44, 44, 44, 44, 44, 44, 34, 34, 34, 34, 34, 34, 8, 18, 1, 7, 34, 22, 34, 34, 34, 34, 34, 50, 34, 22, 22, 22, 22, 4, 22, 4 }, 6, 1, 24, true}, { "NewCenturySchlbk-Italic", /* #25 */ NULL, NULL, "new century schoolbook-medium-i-normal", "newcenturyschlbk-medium-i-normal", "century schoolbook l-medium-i-normal", NULL, "New Century Schoolbook", "serif", "italic", "normal", "normal", "2 4 6 4 5 5 5 2 3 4", /* Panose for entire NCS family? */ 24703, 1, 1, 0, 14, 958, 250, 722, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 400, 556, 556, 833, 852, 204, 333, 333, 500, 606, 278, 606, 278, 606, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 606, 606, 606, 444, 747, 704, 722, 722, 778, 722, 667, 778, 833, 407, 611, 741, 667, 944, 815, 778, 667, 778, 741, 667, 685, 815, 704, 926, 704, 685, 667, 333, 606, 333, 606, 500, 204, 574, 556, 444, 611, 444, 333, 537, 611, 333, 315, 556, 333, 889, 611, 500, 574, 556, 444, 444, 352, 611, 519, 778, 500, 500, 463, 333, 606, 333, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 606, 500, 333, 747, 422, 426, 606, 333, 747, 333, 400, 606, 333, 333, 333, 611, 650, 278, 333, 333, 372, 426, 834, 834, 834, 444, 704, 704, 704, 704, 704, 704, 870, 722, 722, 722, 722, 722, 407, 407, 407, 407, 778, 815, 778, 778, 778, 778, 778, 606, 778, 815, 815, 815, 815, 685, 667, 556, 574, 574, 574, 574, 574, 574, 722, 444, 444, 444, 444, 444, 333, 333, 333, 333, 500, 611, 500, 500, 500, 500, 500, 606, 500, 611, 611, 611, 611, 500, 574, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 127, 28, 4, 43, 24, 39, 53, -93, 80, 50, -39, 50, 17, 132, 30, 50, -37, -2, -8, 4, 36, 69, 6, 8, 17, -39, 36, 50, 64, 102, -2, -87, -33, 40, -33, -33, -33, 40, -33, -33, -14, -33, -33, -33, -51, 40, -33, 40, -45, -6, 40, 93, 36, 53, -75, 31, -25, -55, 132, -77, 89, 0, 39, 2, 32, 2, 2, -6, -68, -79, 14, 29, -166, 0, 14, 14, 14, 2, -101, 2, 10, 2, 24, 44, 31, 31, -33, -83, -33, 38, 267, -87, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, 62, -13, 26, 40, 267, -10, 59, -2, 72, -15, 50, 32, -2, 52, 86, 50, 0, 22, 132, -60, 48, 71, 3, 34, 66, -15, 34, 34, 22, -3, -87, -87, -87, -87, -87, -87, -87, 40, -33, -33, -33, -33, -33, -33, -33, -33, -33, -51, 40, 40, 40, 40, 40, 74, 16, 93, 93, 93, 93, 31, -33, -76, 2, 2, 2, 2, 2, 2, -18, 2, -6, -6, -6, -6, 29, 29, 29, 29, 2, 14, 2, 2, 2, 2, 2, 50, 2, 44, 44, 44, 44, -83, -101, -83 }, 6, 2, 25, true}, { "NewCenturySchlbk-Bold", /* #26 */ NULL, NULL, "new century schoolbook-bold-r-normal", "newcenturyschlbk-bold-r-normal", "century schoolbook l-bold-r-normal", NULL, "New Century Schoolbook", "serif", "normal", "bold", "normal", "2 4 6 4 5 5 5 2 3 4", /* Panose for entire NCS family? */ 24703, 1, 0, 3, 14, 988, 250, 722, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 296, 333, 574, 574, 833, 852, 241, 389, 389, 500, 606, 278, 606, 278, 278, 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, 278, 278, 606, 606, 606, 500, 747, 759, 778, 778, 833, 759, 722, 833, 870, 444, 648, 815, 722, 981, 833, 833, 759, 833, 815, 667, 722, 833, 759, 981, 722, 722, 667, 389, 606, 389, 606, 500, 241, 611, 648, 556, 667, 574, 389, 611, 685, 370, 352, 667, 352, 963, 685, 611, 667, 648, 519, 500, 426, 685, 611, 889, 611, 611, 537, 389, 606, 389, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 296, 574, 574, 574, 574, 606, 500, 333, 747, 367, 500, 606, 333, 747, 333, 400, 606, 344, 344, 333, 685, 747, 278, 333, 344, 367, 500, 861, 861, 861, 500, 759, 759, 759, 759, 759, 759, 981, 778, 759, 759, 759, 759, 444, 444, 444, 444, 833, 833, 833, 833, 833, 833, 833, 606, 833, 833, 833, 833, 833, 722, 759, 611, 611, 611, 611, 611, 611, 611, 870, 556, 574, 574, 574, 574, 370, 370, 370, 370, 611, 685, 611, 611, 611, 611, 611, 606, 611, 685, 685, 685, 685, 611, 667, 611 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 36, 25, 14, 34, 22, 77, 44, 54, 50, 40, 50, 44, -42, 27, 83, 19, 23, 19, 32, 27, 45, 27, 27, 44, 40, 50, 50, 50, 23, -2, -19, 19, 39, 19, 19, 19, 39, 19, 29, 6, 19, 19, 10, 5, 39, 24, 39, 19, 51, 16, 14, -19, 7, -12, -12, 28, 84, 122, 50, 66, 0, 22, 40, 4, 32, 32, 32, 11, 30, 17, 26, -86, 17, 17, 17, 17, 32, 17, 32, 17, 48, 21, 17, 12, 16, 12, 12, 38, 36, 249, 76, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 32, 16, 27, -10, 249, 62, -12, -2, 1, 46, 50, 42, -2, -6, 57, 50, -3, -3, 84, 17, 96, 53, 17, 31, 1, 46, 31, 31, 15, 23, -19, -19, -19, -19, -19, -19, -29, 39, 19, 19, 19, 19, 29, 29, 29, 29, 19, 5, 39, 39, 39, 39, 39, 65, 39, 14, 14, 14, 14, -12, 24, -2, 40, 40, 40, 40, 40, 40, 32, 32, 32, 32, 32, 32, 21, 26, 9, 7, 32, 17, 32, 32, 32, 32, 32, 50, 32, 17, 17, 17, 17, 12, 17, 12 }, 6, 3, 26, true}, { "NewCenturySchlbk-BoldItalic", /* #27 */ NULL, NULL, "new century schoolbook-bold-i-normal", "newcenturyschlbk-bold-i-normal", "century schoolbook l-bold-i-normal", NULL, "New Century Schoolbook", "serif", "italic", "bold", "normal", "2 4 6 4 5 5 5 2 3 4", /* Panose for entire NCS family? */ 24703, 1, 1, 3, 14, 991, 250, 722, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 333, 400, 574, 574, 889, 889, 259, 407, 407, 500, 606, 287, 606, 287, 278, 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, 287, 287, 606, 606, 606, 481, 747, 741, 759, 759, 833, 741, 704, 815, 870, 444, 667, 778, 704, 944, 852, 833, 741, 833, 796, 685, 722, 833, 741, 944, 741, 704, 704, 407, 606, 407, 606, 500, 259, 667, 611, 537, 667, 519, 389, 611, 685, 389, 370, 648, 389, 944, 685, 574, 648, 630, 519, 481, 407, 685, 556, 833, 574, 519, 519, 407, 606, 407, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 333, 574, 574, 574, 574, 606, 500, 333, 747, 412, 481, 606, 333, 747, 333, 400, 606, 344, 344, 333, 685, 650, 287, 333, 344, 356, 481, 861, 861, 861, 481, 741, 741, 741, 741, 741, 741, 889, 759, 741, 741, 741, 741, 444, 444, 444, 444, 833, 852, 833, 833, 833, 833, 833, 606, 833, 833, 833, 833, 833, 704, 741, 574, 667, 667, 667, 667, 667, 667, 815, 537, 519, 519, 519, 519, 389, 389, 389, 389, 574, 685, 574, 574, 574, 574, 574, 606, 574, 685, 685, 685, 685, 519, 648, 519 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 30, 9, 54, 32, 48, 72, -70, 58, 50, -57, 50, -20, -41, 21, 25, -38, -7, -13, 0, 31, 64, 0, 0, -20, -57, 50, 50, 50, 79, -4, -75, -50, 37, -47, -41, -41, 37, -41, -41, -20, -41, -41, -44, -61, 37, -41, 37, -41, 1, 41, 88, 32, 40, -82, 13, -33, 1, 161, -101, 66, 0, 47, 6, 29, 0, 0, 0, -48, -63, 0, 32, -205, -11, 32, 0, 0, 0, -119, 0, 0, 0, 24, 30, 30, 30, -46, -66, -19, 52, 249, -25, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, 30, -18, 27, 17, 249, -30, 33, -2, 47, -35, 50, 2, -2, 47, 86, 50, -17, 3, 123, -89, 25, 57, -21, 19, 42, -31, 17, 17, 35, 0, -75, -75, -75, -75, -75, -75, -86, 37, -41, -41, -41, -41, -41, -41, -41, -41, -47, -61, 37, 37, 37, 37, 37, 65, 35, 88, 88, 88, 88, 13, -41, -91, 6, 6, 6, 6, 6, 6, -18, 0, 0, 0, 0, 0, 32, 32, 21, 31, 0, 0, 0, 0, 0, 0, 0, 50, 0, 30, 30, 30, 30, -66, -119, -66 }, 6, 4, 27, true}, { "Palatino-Roman", /* #28 */ NULL, NULL, "palatino-medium-r-normal", /* Adobe */ "urw palladio l-medium-r-normal", /* URW, for SuSE */ "urw palladio l-regular-r-normal", /* URW, for Debian */ NULL, "Palatino", "serif", "normal", "normal", "normal", "2 4 5 2 5 5 5 3 3 4", /* Panose for entire Palatino family? */ 24591, 1, 0, 0, 14, 927, 283, 692, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 278, 371, 500, 500, 840, 778, 278, 333, 333, 389, 606, 250, 606, 250, 606, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 250, 250, 606, 606, 606, 444, 747, 778, 611, 709, 774, 611, 556, 763, 832, 337, 333, 726, 611, 946, 831, 786, 604, 786, 668, 525, 613, 778, 722, 1000, 667, 667, 667, 333, 606, 333, 606, 500, 278, 500, 553, 444, 611, 479, 333, 556, 582, 291, 234, 556, 291, 883, 582, 546, 601, 560, 395, 424, 326, 603, 565, 834, 516, 556, 500, 333, 606, 333, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 278, 500, 500, 500, 500, 606, 500, 333, 747, 333, 500, 606, 333, 747, 333, 400, 606, 300, 300, 333, 603, 628, 250, 333, 300, 333, 500, 750, 750, 750, 444, 778, 778, 778, 778, 778, 778, 944, 709, 611, 611, 611, 611, 337, 337, 337, 337, 774, 831, 786, 786, 786, 786, 786, 606, 833, 778, 778, 778, 778, 667, 604, 556, 500, 500, 500, 500, 500, 500, 758, 444, 479, 479, 479, 479, 287, 287, 287, 287, 546, 582, 546, 546, 546, 546, 546, 606, 556, 603, 603, 603, 603, 556, 601, 556 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 52, 4, 30, 39, 43, 45, 60, 32, 32, 51, 16, 51, 67, 87, 29, 60, 16, 15, 2, 13, 32, 44, 30, 20, 66, 16, 57, 51, 48, 43, 24, 15, 26, 22, 22, 22, 22, 22, 22, 22, -15, 22, 22, 16, 17, 22, 22, 22, 22, 24, 18, 12, 8, 8, 14, 9, 15, 79, 81, 45, 51, 0, 45, 32, -15, 26, 35, 26, 23, 32, 6, 21, -40, 21, 21, 16, 6, 32, 8, 35, 21, 30, 22, 18, 6, 6, 20, 12, 16, 58, 275, 44, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 61, 12, 30, 5, 275, 26, 17, 11, 24, 50, 51, 17, 11, 11, 50, 51, 0, 1, 78, 18, 39, 67, 96, 31, 10, 50, 30, 15, 15, 43, 15, 15, 15, 15, 15, 15, -10, 22, 22, 22, 22, 22, 22, 22, 13, 19, 14, 17, 22, 22, 22, 22, 22, 83, 30, 12, 12, 12, 12, 9, 32, 23, 32, 32, 32, 32, 32, 32, 30, 26, 26, 26, 26, 26, 8, 21, -12, -6, 32, 6, 32, 32, 32, 32, 32, 51, 16, 18, 18, 18, 18, 12, -2, 12 }, 7, 1, 28, true}, { "Palatino-Italic", /* #29 */ NULL, NULL, "palatino-medium-i-normal", "urw palladio l-medium-i-normal", "urw palladio l-regular-i-normal", NULL, "Palatino", "serif", "italic", "normal", "normal", "2 4 5 2 5 5 5 3 3 4", /* Panose for entire Palatino family? */ 24591, 1, 1, 0, 14, 918, 276, 692, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 889, 778, 278, 333, 333, 389, 606, 250, 606, 250, 296, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 250, 250, 606, 606, 606, 500, 747, 722, 611, 667, 778, 611, 556, 722, 778, 333, 333, 667, 556, 944, 778, 778, 611, 778, 667, 556, 611, 778, 722, 944, 722, 667, 667, 333, 606, 333, 606, 500, 278, 444, 463, 407, 500, 389, 278, 500, 500, 278, 278, 444, 278, 778, 556, 444, 500, 463, 389, 389, 333, 556, 500, 722, 500, 500, 444, 333, 606, 333, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 500, 606, 500, 333, 747, 333, 500, 606, 333, 747, 333, 400, 606, 300, 300, 333, 556, 500, 250, 333, 300, 333, 500, 750, 750, 750, 500, 722, 722, 722, 722, 722, 722, 941, 667, 611, 611, 611, 611, 333, 333, 333, 333, 778, 778, 778, 778, 778, 778, 778, 606, 778, 778, 778, 778, 778, 667, 611, 500, 444, 444, 444, 444, 444, 444, 638, 407, 389, 389, 389, 389, 278, 278, 278, 278, 444, 556, 444, 444, 444, 444, 444, 606, 444, 556, 556, 556, 556, 500, 500, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 140, 4, 15, 74, 47, 78, 54, 2, 76, 51, 8, 51, 53, -40, 36, 54, 12, 22, 15, 14, 49, 53, 36, 32, 44, -9, 53, 51, 53, 114, 27, -19, 26, 45, 28, 30, 0, 50, -3, 7, -35, 13, 16, -19, 2, 53, 9, 53, 9, 42, 53, 88, 75, 71, 20, 52, 20, 18, 81, 7, 51, 0, 78, 4, 37, 25, 17, 15, -162, -37, 10, 34, -70, 8, 36, 24, 24, 17, -7, 24, 26, 9, 41, 32, 21, 21, 9, -8, -1, 15, 275, 14, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 56, 2, 14, 35, 275, 14, 78, 11, 60, 57, 51, 19, 11, 74, 90, 51, 13, 28, 122, 15, 33, 53, -9, 61, 66, 63, 31, 31, 35, 57, -19, -19, -19, -19, -19, -19, -4, 45, 30, 30, 30, 30, 7, 7, 7, 7, 19, 2, 53, 53, 53, 53, 53, 83, 32, 88, 88, 88, 88, 52, 9, -160, 4, 4, 4, 4, 4, 4, 1, 25, 15, 15, 15, 15, 34, 34, 29, 34, 17, 24, 17, 17, 17, 17, 17, 51, -18, 32, 32, 32, 32, -8, -39, -8 }, 7, 2, 29, true}, { "Palatino-Bold", /* #30 */ NULL, NULL, "palatino-bold-r-normal", "urw palladio l-bold-r-normal", "urw palladio l-bold-r-normal", NULL, "Palatino", "serif", "normal", "bold", "normal", "2 4 5 2 5 5 5 3 3 4", /* Panose for entire Palatino family? */ 24591, 1, 0, 3, 14, 924, 266, 681, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 278, 402, 500, 500, 889, 833, 278, 333, 333, 444, 606, 250, 606, 250, 296, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 250, 250, 606, 606, 606, 444, 747, 778, 667, 722, 833, 611, 556, 833, 833, 389, 389, 778, 611, 1000, 833, 833, 611, 833, 722, 611, 667, 778, 778, 1000, 667, 667, 667, 333, 606, 333, 606, 500, 278, 500, 611, 444, 611, 500, 389, 556, 611, 333, 333, 611, 333, 889, 611, 556, 611, 611, 389, 444, 333, 611, 556, 833, 500, 556, 500, 310, 606, 310, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 278, 500, 500, 500, 500, 606, 500, 333, 747, 438, 500, 606, 333, 747, 333, 400, 606, 300, 300, 333, 611, 641, 250, 333, 300, 488, 500, 750, 750, 750, 444, 778, 778, 778, 778, 778, 778, 1000, 722, 611, 611, 611, 611, 389, 389, 389, 389, 833, 833, 833, 833, 833, 833, 833, 606, 833, 778, 778, 778, 778, 667, 611, 611, 500, 500, 500, 500, 500, 500, 778, 444, 500, 500, 500, 500, 333, 333, 333, 333, 556, 611, 556, 556, 556, 556, 556, 606, 556, 611, 611, 611, 611, 556, 611, 556 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 22, 4, 28, 61, 52, 29, 65, 28, 44, 51, -6, 51, 47, -9, 33, 35, 25, 22, 12, 42, 37, 46, 34, 31, 47, -6, 49, 51, 49, 43, 42, 24, 39, 44, 35, 39, 28, 47, 36, 39, -11, 39, 39, 32, 35, 47, 39, 47, 39, 57, 17, 26, 20, 17, 17, 15, 24, 73, 72, 42, 52, 0, 29, 40, 10, 37, 42, 42, 34, 26, 24, 34, 3, 21, 24, 24, 24, 40, 29, 52, 30, 39, 22, 25, 11, 13, 20, 10, 16, 5, 260, 22, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 73, -2, 32, 17, 260, 30, -8, 26, 77, 36, 51, 16, 26, 1, 50, 51, 5, 9, 78, 25, 19, 47, 73, 14, 89, 37, 19, 9, 15, 33, 24, 24, 24, 24, 24, 24, 12, 44, 39, 39, 39, 39, 39, 39, 26, 20, 10, 35, 47, 47, 47, 47, 47, 72, 32, 26, 26, 26, 26, 15, 39, 30, 40, 40, 40, 40, 40, 40, 46, 37, 42, 42, 42, 42, 18, 34, -2, -8, 40, 24, 40, 40, 40, 40, 40, 51, 23, 25, 25, 25, 25, 10, 17, 10 }, 7, 3, 30, true}, { "Palatino-BoldItalic", /* #31 */ NULL, NULL, "palatino-bold-i-normal", "urw palladio l-bold-i-normal", "urw palladio l-bold-i-normal", NULL, "Palatino", "serif", "italic", "bold", "normal", "2 4 5 2 5 5 5 3 3 4", /* Panose for entire Palatino family? */ 24591, 1, 1, 3, 14, 926, 271, 681, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 889, 833, 278, 333, 333, 444, 606, 250, 606, 250, 315, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 250, 250, 606, 606, 606, 444, 833, 722, 667, 685, 778, 611, 556, 778, 778, 389, 389, 722, 611, 944, 778, 833, 667, 833, 722, 556, 611, 778, 667, 1000, 722, 611, 667, 333, 606, 333, 606, 500, 278, 556, 537, 444, 556, 444, 333, 500, 556, 333, 333, 556, 333, 833, 556, 556, 556, 537, 389, 444, 389, 556, 556, 833, 500, 556, 500, 333, 606, 333, 606, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 500, 606, 556, 333, 747, 333, 500, 606, 389, 747, 333, 400, 606, 300, 300, 333, 556, 556, 250, 333, 300, 333, 500, 750, 750, 750, 444, 722, 722, 722, 722, 722, 722, 944, 685, 611, 611, 611, 611, 389, 389, 389, 389, 778, 778, 833, 833, 833, 833, 833, 606, 833, 778, 778, 778, 778, 611, 667, 556, 556, 556, 556, 556, 556, 556, 738, 444, 444, 444, 444, 444, 333, 333, 333, 333, 556, 556, 556, 556, 556, 556, 556, 606, 556, 556, 556, 556, 556, 556, 556, 556 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 137, 4, 20, 56, 74, 76, 58, -12, 84, 50, -33, 51, 48, 1, 42, 41, 1, 8, 3, 14, 39, 69, 26, 27, 38, -33, 49, 51, 48, 91, 82, -35, 8, 69, 0, 11, -6, 72, -12, -1, -29, -10, 26, -23, -2, 76, 11, 76, 4, 50, 56, 83, 67, 67, -9, 54, 1, 45, 72, -21, 63, 0, 65, 44, 44, 32, 38, 28, -130, -50, 22, 26, -64, 34, 64, 19, 17, 48, -21, 32, 20, 25, 42, 22, 19, 27, -8, 13, 31, 18, 259, -1, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 52, 21, 32, 11, 259, 47, 90, 26, 47, 35, 51, 37, 26, 76, 50, 50, 26, 23, 153, -15, 14, 67, 12, 41, 51, 35, 18, 14, 18, -12, -35, -35, -35, -35, -35, -35, -29, 69, 11, 11, 11, 11, -1, -1, -1, -1, 0, -2, 76, 76, 76, 76, 76, 72, 57, 83, 83, 83, 83, 54, 11, -131, 44, 44, 44, 44, 44, 44, 44, 32, 28, 28, 28, 28, 26, 26, 26, 26, 48, 17, 48, 48, 48, 48, 48, 50, 14, 22, 22, 22, 22, 13, -21, 13 }, 7, 4, 31, true}, { "ZapfChancery-MediumItalic", /* #32 */ NULL, NULL, "itc zapf chancery-medium-i-normal", /* Adobe, for SGI etc. */ "zapf chancery-medium-i-normal", /* Adobe, for Open Group etc. */ "zapfchancery-medium-i-normal", /* Adobe, for SunOS etc.*/ "urw chancery l-medium-i-normal", /* URW, for SuSE */ "Zapf Chancery", "cursive", "italic", "normal", "normal", "0 0 0 0 0 0 0 0 0 0", /* no Panose known */ 45099, 1, 1, 0, 14, 831, 314, 708, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 280, 220, 440, 440, 680, 780, 240, 260, 220, 420, 520, 220, 520, 220, 340, 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, 260, 240, 520, 520, 520, 380, 700, 620, 600, 520, 700, 620, 580, 620, 680, 380, 400, 660, 580, 840, 700, 600, 540, 600, 600, 460, 500, 740, 640, 880, 560, 560, 620, 240, 480, 320, 520, 500, 240, 420, 420, 340, 440, 340, 320, 400, 440, 240, 220, 440, 240, 620, 460, 400, 440, 400, 300, 320, 320, 460, 440, 680, 420, 400, 440, 240, 520, 240, 520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 280, 440, 440, 440, 440, 520, 420, 360, 740, 260, 340, 520, 280, 740, 440, 400, 520, 264, 264, 300, 460, 500, 220, 300, 264, 260, 380, 660, 660, 660, 400, 620, 620, 620, 620, 620, 620, 740, 520, 620, 620, 620, 620, 380, 380, 380, 380, 700, 700, 600, 600, 600, 600, 600, 520, 660, 740, 740, 740, 740, 560, 540, 420, 420, 420, 420, 420, 420, 420, 540, 340, 340, 340, 340, 340, 240, 240, 240, 240, 400, 460, 400, 400, 400, 400, 400, 520, 440, 460, 460, 460, 460, 400, 440, 400 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 120, 83, 60, 132, 126, 168, 96, -13, 139, 117, 25, 117, 102, 74, 79, 41, 17, 1, 77, 60, 90, 157, 65, 32, 98, 29, 139, 117, 139, 150, 127, 13, 85, 93, 86, 91, 120, 148, 18, 99, -14, 53, 53, 58, 85, 94, 42, 84, 58, 45, 63, 126, 124, 94, -30, 41, 42, -13, 140, -27, 132, 0, 169, 92, 82, 87, 102, 87, -119, -108, 55, 100, -112, 87, 102, 86, 101, 87, -23, 87, 101, 46, 106, 102, 87, 87, 70, -24, 26, 55, 320, -10, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 122, -16, 50, -1, 320, 53, 243, 137, 111, 98, 117, 69, 137, 222, 171, 117, 72, 59, 265, 7, 105, 139, 12, 83, 128, 117, 56, 56, 39, 82, 13, 13, 13, 13, 13, 13, -21, 93, 91, 91, 91, 91, 99, 99, 99, 99, 86, 85, 94, 94, 94, 94, 94, 133, 83, 126, 126, 126, 126, 41, 52, -127, 92, 92, 92, 92, 92, 92, 67, 62, 87, 87, 87, 87, 100, 100, 100, 100, 87, 101, 87, 87, 87, 87, 87, 117, 46, 102, 102, 102, 102, -24, -38, -24 }, 8, 1, 33, true}, { "ZapfDingbats", /* #33 */ NULL, NULL, "itc zapf dingbats-medium-r-normal", /* Adobe */ "zapf dingbats-medium-r-normal", /* Adobe, for Open Group etc. */ "zapfdingbats-medium-r-normal", /* Adobe, for SunOS etc. */ "dingbats-medium-r-normal", /* URW, for SuSE */ "Zapf Dingbats", NULL, "normal", "normal", "normal", "0 4 0 0 0 0 0 0 0 0", /* no better Panose known */ 45101, 1, 0, 0, 460, 820, 143, 662, 0, /* cap height not in AFM file; this is Times-Roman value */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 974, 961, 974, 980, 719, 789, 790, 791, 690, 960, 939, 549, 855, 911, 933, 911, 945, 974, 755, 846, 762, 761, 571, 677, 763, 760, 759, 754, 494, 552, 537, 577, 692, 786, 788, 788, 790, 793, 794, 816, 823, 789, 841, 823, 833, 816, 831, 923, 744, 723, 749, 790, 792, 695, 776, 768, 792, 759, 707, 708, 682, 701, 826, 815, 789, 789, 707, 687, 696, 689, 786, 787, 713, 791, 785, 791, 873, 761, 762, 762, 759, 759, 892, 892, 788, 784, 438, 138, 277, 415, 392, 392, 668, 668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 732, 544, 544, 910, 667, 760, 760, 776, 595, 694, 626, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 894, 838, 1016, 458, 748, 924, 748, 918, 927, 928, 928, 834, 873, 828, 924, 924, 917, 930, 931, 463, 883, 836, 836, 867, 867, 696, 696, 874, 0, 874, 760, 946, 771, 865, 771, 888, 967, 888, 831, 873, 927, 970, 918, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 34, 35, 35, 35, 35, 35, 35, 29, 34, 35, 35, 35, 35, 35, 34, 36, 35, 35, -1, 36, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 34, 36, 35, 35, 34, 35, 35, 35, 36, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 56, 34, 35, 35, 35, 0, 35, 34, 35, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 0, 35, 35, 35, 34, 35, 34, 34, 35, 34, 35, 36, 35, 35, 34, 0 }, 9, 1, 34, false}, { "Symbol", /* #34 */ "SymbolPS", NULL, "symbol-medium-r-normal", /* Adobe */ "standard symbols l-medium-r-normal", /* URW, for SuSE */ "standard symbols l-regular-r-normal", /* URW, for Debian */ NULL, "Symbol", NULL, "normal", "normal", "normal", "5 5 1 2 1 7 6 2 5 7", /* Panose for Symbol font */ 45358, 1, 0, 0, 621, 1010, 293, 662, 0, /* cap height not in AFM file; this is Times-Roman value */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 713, 500, 549, 833, 778, 439, 333, 333, 500, 549, 250, 549, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 549, 549, 549, 444, 549, 696, 660, 710, 612, 652, 763, 603, 765, 351, 631, 724, 686, 918, 739, 750, 768, 741, 580, 592, 632, 690, 439, 768, 645, 795, 650, 333, 863, 333, 658, 500, 500, 631, 549, 549, 494, 439, 521, 411, 603, 329, 603, 549, 549, 576, 521, 549, 549, 521, 549, 603, 439, 576, 713, 686, 493, 686, 494, 480, 200, 480, 549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 620, 247, 549, 167, 713, 500, 753, 753, 753, 753, 1042, 987, 603, 987, 603, 400, 549, 411, 549, 549, 713, 494, 460, 549, 549, 549, 549, 1000, 603, 1000, 658, 823, 686, 795, 987, 768, 768, 823, 768, 768, 713, 713, 713, 713, 713, 713, 713, 768, 713, 790, 790, 890, 823, 549, 250, 713, 603, 603, 1042, 987, 603, 987, 603, 494, 329, 790, 790, 786, 713, 384, 384, 384, 384, 384, 384, 494, 494, 494, 494, 762, 329, 274, 686, 686, 686, 384, 384, 384, 384, 384, 384, 494, 494, 494, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 31, 20, 25, 63, 41, 48, 53, 30, 65, 10, 56, 11, 69, 0, 23, 117, 25, 39, 16, 29, 36, 24, 54, 31, 81, 83, 26, 11, 26, 70, 11, 4, 29, -9, 6, 32, 26, 24, 39, 32, 18, 35, 6, 28, 29, 41, 25, 41, 28, 5, 33, -8, 40, 34, 40, 15, 44, 86, 163, 33, 15, -2, 480, 41, 61, 12, 40, 22, 27, 5, 0, 0, 36, 33, 24, 33, -9, 35, 10, 43, 50, 30, 10, 7, 12, 42, 27, 12, 60, 58, 65, 79, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 27, 29, -180, 26, 2, 86, 142, 117, 113, 24, 32, 45, 49, 45, 50, 10, 20, 29, 17, 27, 26, 50, 10, 15, 14, 14, 111, 280, -60, 15, 175, 10, 26, 159, 43, 43, 39, 40, 40, 20, 20, 36, 37, 37, 45, 45, 26, 36, 50, 51, 18, 25, 10, 69, 15, 23, 30, 27, 30, 39, 45, 44, 18, 25, 50, 49, 5, 14, 40, 40, 40, 0, 0, 0, 201, 14, 201, 201, 53, 21, 2, 332, 332, 39, 54, 398, 54, 22, 305, 20, 17, 201, 17, 0 }, 2, 0, 32, false}, { NULL, /* DUMMY */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 0, 0, false} }; /* Each of the 35 PS fonts above (and also each of the 45 PCL fonts) includes a 10-digit PANOSE classification number, for use by the PANOSE Typeface Matching System. It consists of 10 digits, each in the range 0..15, with `0' meaning that no information is available. The PANOSE system is for classifying Latin fonts, and the digits, if given a nonzero value, are interpreted thus: Latin Text: 1. Family Kind (= 2 for Latin Text) 2. Serif Style 3. Weight 4. Proportion 5. Contrast 6. Stroke Variation 7. Arm Style 8. Letterform 9. Midline 10. X-height Latin Hand Written: 1. Family Kind (= 3 for Latin Hand Written) 2. Tool Kind 3. Weight 4. Spacing 5. Aspect Ratio 6. Contrast 7. Topology 8. Form 9. Finials 10. X-ascent Latin Decoratives: 1. Family Kind (= 4 for Latin Decorative) 2. Class 3. Weight 4. Aspect 5. Contrast 6. Serif Variant 7. Treatment 8. Lining 9. Topology 10. Range of Characters Latin Symbol: 1. Family Kind (= 5 for Latin Symbol) 2. Kind 3. Weight 4. Spacing 5. Aspect Ratio & Contrast 6. Aspect Ratio of Character 94 7. Aspect Ratio of Character 119 8. Aspect Ratio of Character 157 9. Aspect Ratio of Character 163 10. Aspect Ratio of Character 211 */ /* The array _pl_g_ps_font_to_cgm_font_id[] performs a map from internal PS font number, i.e. location in the preceding list of 35 fonts, to CGM font id, as used by CGM Plotters in WebCGM output. _pl_g_cgm_font_id_to_ps_font[] performs the inverse map. These maps are permutations of the interval 0..34, and are restricted only by the requirement that the original `Adobe 13' (the PS fonts built into the first Apple LaserWriters) be mapped to 0..12. We impose that requirement because in WebCGM format, the Adobe 13 are a bit special: they are assumed always to be available. If any of the other 23 is included, a `FONT PROPERTIES' command needs to be emitted for it. */ const int _pl_g_ps_font_to_cgm_font_id[PL_NUM_PS_FONTS] = { 0, 1, 2, 3, 13, 14, 15, 16, 4, 5, 6, 7, 17, 18, 19, 20, 21, 22, 23, 24, 8, 9, 10, 11, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 12 }; const int _pl_g_cgm_font_id_to_ps_font[PL_NUM_PS_FONTS] = { 0, 1, 2, 3, 8, 9, 10, 11, 20, 21, 22, 23, 34, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, 19, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 }; /* The following array contains the most important CGM properties of the 35 Postscript fonts, arranged according to the font id we use in CGM files, rather than our internal numbering. The font properties that may be specified in a CGM file are taken from the `Minimum Font Description Subset' of ISO/IEC 9541. For the 35 Postscript fonts, we currently take the values of the CGM properties from the file `r_ps.fnt' in the RALCGM distribution. The properties are: posture, weight, proportionate width, `design group', and structure (always 1, signifying a filled [non-outline] font). According to the "CGM Handbook", posture 1 means upright, posture 2 means oblique, and posture 4 means italic. In `r_ps.fnt' the italic fonts were specified as having oblique posture; I've corrected that. Design group is a hierarchical classification: class.subclass.specific_group See the 12/87 ISO/IEC 9541-5 standard for the assigned design groups, or alternatively Appendix A of "Font Technology", by Peter Karow (Springer, 1994). (If both are unavailable, see the file `f_dsn.fnt' in the RALCGM distribution, which dates to 1993 and is not quite complete.) Each component in a design group has a value in the range 0..255. These are the most relevant design groups: 1 Uncial 2 Inscriptional 3 Blackletter 4 Serif 4.1 Oldstyle 4.1.1 Venetian 4.1.2 Garalde [Garamond] 4.1.3 Dutch / English 4.2 Transitional 4.2.1 Direct Line 4.2.2 Modified I [Palatino] 4.2.3 Modified II 4.3 Modern 4.3.1 Continental 4.3.2 Fat Face 4.4 Contemporary 4.4.1 Eclectic 4.4.2 Fine Serif 4.4.3 Lettering 4.5 Legibility 4.5.1 Rounded (traditional) [Times] 4.5.2 Super-elliptical (square) [Bookman] 4.6 Square Serif 4.6.1 Monotone 4.6.2 Clarendon [New Century Schoolbook] 4.6.3 French Clarendon 4.6.4 Short (stub) 4.6.5 Typewriter [Courier] 4.6.6 Dot Matrix 4.7 Latin 4.7.1 Solid 4.7.2 Inline 4.8 Engraving 4.8.1 Barbed Serif 4.8.2 Straight serif (fine) 4.9 Free Form 4.9.1 Solid 4.9.2 Outline 4.10 Computer 4.10.1 OCR 4.10.2 Digital 4.11 Miscellaneous 4.12 Mincho 4.12.1 Old Style 4.12.2 New Style 4.12.3 Miscellaneous 5 Sans Serif 5.1 Gothic 5.1.1 Grotesque 5.1.2 Neo-grotesque [Helvetica, Univers] 5.1.3 Typewriter 5.2 Humanist 5.2.1 Classical [Optima] 5.2.2 Non-classical 5.2.3 Typewriter 5.3 Stress variation 5.3.1 Broad Pen 5.3.2 Casual 5.3.3 Typewriter 5.3.4 Broad Pen, Curved Base Line 5.3.5 Broad Pen, Bent Base Line 5.4 Art Deco 5.4.1 Standard 5.4.2 Modified 5.4.3 Thin Line 5.4.4 Serif 5.4.5 Black, Italic 5.4.6 Outline 5.4.7 Extra Distorted with Some Stress Variation 5.4.8 Miscellaneous 5.5 Geometric 5.5.1 Round, straight stem ends [AvantGarde] 5.5.2 Round, rounded stem ends 5.5.3 Super-elliptical 5.5.4 Stylized 5.5.5 Typewriter [Letter Gothic] 5.5.6 Black Monotone 5.5.7 Extra Black Monotone 5.5.8 Extra Black with Stress Variation 5.5.9 Extra Black with Extra Stress Variation 5.5.10 Black, Round, Pointed Stem Ends 5.5.11 Extra White, Square 5.5.12 Black, Straight Lines 5.5.13 Miscellaneous 5.6 Computer 5.6.1 OCR 5.6.2 Digital 5.6.3 Modified OCR 5.6.4 Modern OCR 5.7 Free Form 5.7.1 Solid 5.7.2 Outline 5.8 Miscellaneous 6 Scripts 6.1 Joined 6.1.1 Formal 6.1.2 Informal 6.1.3 Monotone 6.2 Unjoined 6.2.1 Formal 6.2.2 Informal 6.2.3 Monotone 6.2.4 Brush 6.2.5 Cursive 6.2.6 Calligraphic 6.2.7 Ronde 6.3 Soft Brush 6.3.1 Kaisho 6.3.2 Kyokasho 6.3.3 Gyosho 6.3.4 Sosho 6.3.5 Miscellaneous 6.4 Kana 6.4.1 Old Style 6.4.2 New Style 6.5 Soucho 7 Ornamentals 7.1 Inline 7.1.1 Sans Serif 7.1.2 Serif 7.2 Outline 7.2.1 Sans Serif 7.2.2 Serif 7.3 Decorative 7.3.1 Sans Serif 7.3.2 Serif 7.4 Three-dimensional 7.4.1 Sans Serif 7.4.2 Serif 7.5 Tuscan 7.5.2 Serif 7.6 Stencil 7.6.1 Sans Serif 7.6.2 Serif 7.7 Reversed 7.7.1 Sans Serif 7.7.2 Serif 7.8 Engraved 7.8.1 Sans Serif 7.8.2 Serif 7.9 Miscellaneous 7.9.1 Sans Serif 7.9.2 Serif 8 Symbols and Ornaments [Symbol,ZapfDingbats] If you are interested in font classification, the following additional information may be useful. The IBM Font Class/Subclass classification is similar to the ISO/IEC 9541 classification, but is less fine-grained. The IBM Class/Subclass for a TrueType or OpenType font are stored in the 2-byte `sFamilyClass' field of its so-called OS/2 table. The OS/2 table contains miscellaneous metrics, including the 10-byte Panose font classification. For Panose, see above. Apparently, it is IBM that assigns each font to an IBM Font Class/Subclass. The following table of registered values, giving correspondences, is taken from the Microsoft TrueType Website. See http://microsoft.com/typography and/or http://microsoft.com/truetype . 1 Oldstyle Serifs (ISO 4.1, 4.4, 4.5, part of 4.2) 1.0 No classification 1.1 IBM Rounded Legibility (ISO 4.5.1, e.g. IBM Sonoran Serif) 1.2 Garalde (ISO 4.1.2, e.g. ITC Garamond) 1.3 Venetian (ISO 4.1.1, e.g. Goudy) 1.4 Modified Venetian (ISO 4.2.2, e.g. Allied Linotype Palatino) 1.5 Dutch Modern (ISO 4.1.3, e.g. Monotype Times New Roman) 1.6 Dutch Traditional (ISO 4.5, e.g. IBM Press Roman) 1.7 Contemporary (ISO 4.4, e.g. University) 1.8 Calligraphic 1.9-14 Reserved 1.15 Misc. 2 Transitional Serifs (ISO 4.2) 2.0 No classification 2.1 Direct line (ISO 4.2.1, e.g. Monotype Baskerville) 2.2 Script (similar to ISO 4.2.1, e.g. IBM Nasseem [Arabic]) 2.3-14 Reserved 2.15 Misc. 3 Modern Serifs (ISO 4.3) 3.0 No classification 3.1 Italian (ISO 4.3.Italian, e.g. Monotype Bodoni) 3.2 Script (ISO 4.3.Italian, e.g. IBM Narkissim [Hebrew]) 3.3-14 Reserved 3.15 Misc. 4 Clarendon Serifs (ISO 4.6, in part) 4.0 No classification 4.1 Clarendon (ISO 4.6.2, e.g. Allied Linotype Clarendon) 4.2 Modern (ISO 4.6.2, e.g. Monotype Century Schoolbook) 4.3 Traditional (ISO 4.6.2, e.g. Monotype Century) 4.4 Newspaper (ISO 4.6.2, e.g. Allied Linotype Excelsior) 4.5 Stub Serif (ISO 4.6.4, e.g. Cheltenham) 4.6 Monotone (ISO 4.6.1, e.g. ITC Korinna) 4.7 Typewriter (ISO 4.6.5, e.g. Prestige Elite) 4.8-14 Reserved 4.15 Miscellaneous 5 Slab Serifs (ISO 4.6, except for Clarendons) 5.0 No classification 5.1 Monotone (ISO 4.6.1, e.g. ITC Lubalin) 5.2 Humanist (ISO 4.6.1, e.g. Candida) 5.3 Geometric (ISO 4.6.1, e.g. Monotype Rockwell) 5.4 Swiss (ISO 4.6.1, e.g. Allied Linotype Serifa) 5.5 Typewriter (ISO 4.6.5, e.g. IBM Courier) 5.6-14 Reserved 5.15 Misc. 6 Reserved 7 Freeform Serifs ("remaining ISO Serif Class subclasses"; "expresses a design freedom that does not generally fit within the other serif design classifications") 7.0 No classification 7.1 Modern (e.g. ITC Souvenir) 7.2-14 Reserved 7.15 Misc. 8 Sans Serif (ISO 5) 8.0 No classification 8.1 IBM Neo-grotesque Gothic (ISO 5.1.2, e.g. IBM Sonoran San Serif) 8.2 Humanist (ISO 5.2, e.g. Allied Linotype Optima) 8.3 Low-x Round Geometric (ISO 5.5.1 and 5.5.2, e.g. Fundicion Tipograficia Neufville Futura) 8.4 High-x Round Geometric (ISO 5.5.1 and 5.5.2, e.g. ITC Avant Garde Gothic) 8.5 Neo-grotesque Gothic (ISO 5.1.2, e.g. Allied Linotype Helvetica) 8.6 Modified Neo-grotesque Gothic (ISO 5.1.2, e.g. Allied Linotype Univers) 8.7-8 Reserved 8.9 Typewriter Gothic (ISO 5.5.5, e.g. IBM Letter Gothic) 8.10 Matrix (e.g. IBM Matrix Gothic) 8.11-14 Reserved 8.15 Misc. 9 Ornamentals (ISO 3 and ISO 7, mostly) 9.0 No classification 9.1 Engraver (ISO 7.1 and ISO 4.8, e.g. Copperplate) 9.2 Black Letter (ISO 3, e.g. Old English) 9.3 Decorative (ISO 7.3, e.g. Saphire) 9.4 Three Dimensional (ISO 7.4, e.g. Thorne Shaded) 9.5-14 Reserved 9.15 Misc. 10 Scripts (ISO 1 and ISO 6) 10.0 No classification 10.1 Uncial (ISO 1, e.g. Libra) 10.2 Brush Joined (ISO 6.1.2, e.g. Mistral) 10.3 Formal Joined (ISO 6.1.1, e.g. Coronet) 10.4 Monotone Joined (ISO 6.1.3, e.g. Kaufmann) 10.5 Calligraphic (ISO 6.2.6, e.g. Thompson Quillscript) 10.6 Brush Unjoined (ISO 6.2.4, e.g. Saltino) 10.7 Formal Unjoined (ISO 6.2.1, e.g. Virtuosa) 10.8 Monotone Unjoined (ISO 6.2.3, e.g. Gilles Gothic) 10.9-14 Reserved 10.15 Misc. 11 Reserved 12 Symbolic 12.0 No classification 12.1-2 Reserved 12.3 Mixed Serif (e.g. IBM Symbol) 12.4-5 Reserved 12.6 Oldstyle Serif (e.g. IBM Sonoran Pi Serif) 12.7 Neo-grotesque Sans Serif (IBM Sonoran Pi Sans Serif) 12.8-14 Reserved 12.15 Misc. 13 Reserved 14 Reserved */ const plCGMFontProperties _pl_g_cgm_font_properties[PL_NUM_PS_FONTS] = { /* family, extrastyle, style, posture, weight, width, design_group, struct */ { "Helvetica", "", "", 1, 5, 5, { 5, 1, 2 }, 1 }, { "Helvetica", "", "Oblique", 2, 5, 5, { 5, 1, 2 }, 1 }, { "Helvetica", "", "Bold", 1, 7, 5, { 5, 1, 2 }, 1 }, { "Helvetica", "", "BoldOblique", 2, 7, 5, { 5, 1, 2 }, 1 }, { "Times", "", "Roman", 1, 5, 5, { 4, 5, 1 }, 1 }, { "Times", "", "Italic", 4, 5, 5, { 4, 5, 1 }, 1 }, { "Times", "", "Bold", 1, 7, 5, { 4, 5, 1 }, 1 }, { "Times", "", "BoldItalic", 4, 7, 5, { 4, 5, 1 }, 1 }, { "Courier", "", "", 1, 5, 5, { 4, 6, 5 }, 1 }, { "Courier", "", "Oblique", 2, 5, 5, { 4, 6, 5 }, 1 }, { "Courier", "", "Bold", 1, 7, 5, { 4, 6, 5 }, 1 }, { "Courier", "", "BoldOblique", 2, 7, 5, { 4, 6, 5 }, 1 }, { "Symbol", "", "", 1, 5, 5, { 8, 2, 0 }, 1 }, { "Helvetica", "Narrow", "", 1, 5, 3, { 5, 1, 2 }, 1 }, { "Helvetica", "Narrow", "Oblique", 2, 5, 3, { 5, 1, 2 }, 1 }, { "Helvetica", "Narrow", "Bold", 1, 7, 3, { 5, 1, 2 }, 1 }, { "Helvetica", "Narrow", "BoldOblique", 2, 7, 3, { 5, 1, 2 }, 1 }, { "AvantGarde", "", "Book", 1, 5, 5, { 5, 5, 1 }, 1 }, { "AvantGarde", "", "BookOblique", 2, 5, 5, { 5, 5, 1 }, 1 }, { "AvantGarde", "", "Demi", 1, 6, 5, { 5, 5, 1 }, 1 }, { "AvantGarde", "", "DemiOblique", 2, 6, 5, { 5, 5, 1 }, 1 }, { "Bookman", "", "Light", 1, 4, 5, { 4, 5, 2 }, 1 }, { "Bookman", "", "LightItalic", 4, 4, 5, { 4, 5, 2 }, 1 }, { "Bookman", "", "Demi", 1, 6, 5, { 4, 5, 2 }, 1 }, { "Bookman", "", "DemiItalic", 4, 6, 5, { 4, 5, 2 }, 1 }, { "NewCenturySchlbk", "", "Roman", 1, 5, 5, { 4, 6, 2 }, 1 }, { "NewCenturySchlbk", "", "Italic", 4, 5, 5, { 4, 6, 2 }, 1 }, { "NewCenturySchlbk", "", "Bold", 1, 7, 5, { 4, 6, 2 }, 1 }, { "NewCenturySchlbk", "", "BoldItalic", 4, 7, 5, { 4, 6, 2 }, 1 }, { "Palatino", "", "Roman", 1, 5, 5, { 4, 2, 2 }, 1 }, { "Palatino", "", "Italic", 4, 5, 5, { 4, 2, 2 }, 1 }, { "Palatino", "", "Bold", 1, 7, 5, { 4, 2, 2 }, 1 }, { "Palatino", "", "BoldItalic", 4, 7, 5, { 4, 2, 2 }, 1 }, { "ZapfChancery", "", "MediumItalic", 4, 5, 5, { 6, 1, 1 }, 1 }, { "ZapfDingbats", "", "", 1, 5, 5, { 8, 0, 0 }, 1 } }; /* Known PS typefaces. Each plTypefaceInfoStruct contains the following information: (1) number of valid fonts [should be >= 2, since every typeface should include a symbol font (the zeroth font, the 1st listed)] (2) a list of fonts (each number is an index into the _pl_g_ps_font_info[] array above). The number of valid fonts should be <= PL_MAX_FONTS_PER_TYPEFACE; the initializers are filled out with dummy fonts to get arrays of length PL_MAX_FONTS_PER_TYPEFACE. */ const struct plTypefaceInfoStruct _pl_g_ps_typeface_info[] = { /* Helvetica, #0 */ { 5, { 34, 0, 1, 2, 3, 999, 999, 999, 999, 999 } }, /* Helvetica-Narrow, #1 */ { 5, { 34, 4, 5, 6, 7, 999, 999, 999, 999, 999 } }, /* Times, #2 */ { 5, { 34, 8, 9, 10, 11, 999, 999, 999, 999, 999 } }, /* AvantGarde, #3 */ { 5, { 34, 12, 13, 14, 15, 999, 999, 999, 999, 999 } }, /* Bookman, #4 */ { 5, { 34, 16, 17, 18, 19, 999, 999, 999, 999, 999 } }, /* Courier, #5 */ { 5, { 34, 20, 21, 22, 23, 999, 999, 999, 999, 999 } }, /* New Century Schoolbook, #6 */ { 5, { 34, 24, 25, 26, 27, 999, 999, 999, 999, 999 } }, /* Palatino, #7 */ { 5, { 34, 28, 29, 30, 31, 999, 999, 999, 999, 999 } }, /* Zapf Chancery, #8 */ { 2, { 34, 32, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Zapf Dingbats, #9 */ { 2, { 34, 33, 999, 999, 999, 999, 999, 999, 999, 999 } }, }; /* The Hershey vector fonts we support. Each character in a Hershey font is an index into the glyph array in g_her_glyphs.c. Each plHersheyFontInfoStruct includes these elements: (1) PS-style name for the font (2) an alias for the font (for backward compatibility) (3) Allen Hershey's original name for the font (4) the characters in the font (an array of glyph indices, size 256) (5) a typeface id (an index into the _pl_g_ps_typeface_info[] array below) (6) a font index (which font within the typeface this is) (7) an `obliquing requested' flag (set if glyphs should be sheared) (8) an `iso8859-1' flag (9) a `visible' flag (false for the two Kana fonts, which are only used internally) */ /* Each Hershey font below may contain up to 256 Hershey glyphs, each of which is specified by a number that indexes into the array in g_her_glyph.c. Only the ranges 0x20..0x7e and 0xa0..0xff are directly accessible to the user. There are several sorts of hole in the Hershey fonts, i.e., entries in the character arrays in these printable ranges which are not proper glyphs. They are: 0. undefined characters: thorn, eth, the guillemets, the mysterious `currency' symbol, and the European 'euro' currency symbol. These are written as UNDE, which is a glyph consisting of several horizontal lines. 1. the characters onesuperior, twosuperior, threesuperior, ordmasculine, ordfeminine. These are written as 0, which means an empty glyph. That is because they not implemented as conventional glyphs at all: the corresponding entries in this table are never accessed. In the file g_cntrlify.c these characters are mapped to sequences of control sequences, which implement them as superscripts. 2. the characters ae, AE, and germandbls (i.e. eszet), which (except in Gothic-German) are also written as 0. That is because they are `deligatured' in g_cntrlify.c, via a translation table in g_cntrlify.h. Deligaturization maps them to the two-characters sequences "ae", "AE", and "ss". The corresponding entries in this table are never accessed. 3. the accented ISO-Latin-1 characters. These are written as ACC0, ACC1, or ACC2, any of which signifies that they should be looked up in the following table of accented characters, yielding an accent and a character. They signify respectively that the accent should be superimposed on the character, that it should be raised by 7 Hershey units (for capitals), and that it should be raised by 7 units and also displaced rightward by 2 units (for italic capitals). 4. the small Katakana in the HersheyEUC font. These are written as KS (i.e. Katakana small) + true glyph number. This means that they should be isotropically compressed, with the baseline preserved. In many Hershey fonts, the `nonprintable' range 0x80..0x9f is nonprintable only in the sense that it is not directly accessible to the user; it may contain ligatures, macros, and variant characters. In fact the just-mentioned accents, used in the construction of accented ISO-Latin-1 characters, are stored there. Our convention for the 0x80..0x9f range, for ISO-Latin-1 Hershey fonts, is: 0200: ff 0201: fi 0202: fl 0203: ffi 0204: ffl 0205--0207: other ligatures (font-specific) 0210: acute accent 0211: grave accent 0212: dieresis 0213: circumflex accent 0214: circumflex accent for `i' 0215: tilde accent 0216: ring accent for `a' 0217: cedilla [NOT YET IMPLEMENTED] 0230: variant [final] form for `s' 0231: dotless i In the symbol fonts, we store miscellaneous symbols and astronomical symbols in this range. In fact, in the symbol fonts the astronomical symbols overflow to the other nonprintable range 0x00..0x1f (the twelve zodiacal signs are stored there). */ #define CEDILLA UNDE /* currently undefined, to be implemented someday */ /* IMPORTANT: The fonts in this array may be referred to elsewhere in the code by number. If you change the numbering of Hershey fonts, i.e., the order in which they appear in this array, be sure to update, e.g., the definitions PL_DEFAULT_HERSHEY_FONT_INDEX, PL_HERSHEY_SERIF, PL_HERSHEY_EUC etc. in extern.h. */ const struct plHersheyFontInfoStruct _pl_g_hershey_font_info[] = { { "HersheySerif", /* #0 */ NULL, "Complex Roman", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 2214, 2217, 2275, 2274, 2271, 2272, 2251, 2221, 2222, 2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238, 2242, 2215, 2273, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2223, 4002, 2224, 4110, 4013, 2252, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2225, 2229, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 2177, 2178, 2179, 2180, 2181, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2119, 2182, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 2199, 4113, 910, 272, UNDE, 4125, 4106, 2276, 4182, 274, 0, UNDE, 4080, 4104, 273, 4187, 2218, 2233, 0, 0, 4180, 2138, UNDE, 729, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4114, ACC1, ACC1, ACC1, ACC1, ACC1, 2078, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 2015, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 2115, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 0, 1, false, true, true }, { "HersheySerif-Italic", /* #1 */ NULL, "Complex Italic", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 2214, 2217, 2275, 2274, 2271, 2272, 2251, 2221, 2222, 2219, 2232, 2211, 2231, 2210, 2770, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2212, 2213, 2241, 2238, 2242, 2215, 2273, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2223, 4002, 2224, 4110, 4013, 2252, 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2225, 2229, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 2191, 2192, 2193, 2194, 2195, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2169, 2196, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 2199, 4113, 910, 272, UNDE, 4129, 4106, 2276, 4182, 274, 0, UNDE, 4080, 4104, 273, 4187, 2218, 2233, 0, 0, 4180, 2138, UNDE, 729, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4114, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, 0, ACC0, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, UNDE, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, 727, 2065, ACC2, ACC2, ACC2, ACC2, ACC2, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 2165, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 0, 2, false, true, true }, { "HersheySerif-Bold", /* #2 */ NULL, "Triplex Roman", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3249, 3214, 3228, 3232, 3219, 3233, 3218, 3217, 3221, 3222, 3223, 3225, 3211, 3224, 3210, 3220, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3212, 3213, 3230, 3226, 3231, 3215, 3234, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 2223, 4178, 2224, 4110, 4013, 3216, 3101, 3102, 3103, 3104, 3105, 3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115, 3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125, 3126, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3119, 4160, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 3249, 4119, 910, 272, UNDE, 4126, 4107, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 3229, 2233, 0, 0, 4180, 3138, UNDE, 4131, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4120, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 3015, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 3115, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 0, 3, false, true, true }, { "HersheySerif-BoldItalic", /* #3 */ NULL, "Triplex Italic", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3249, 3264, 3278, 3282, 3269, 3283, 3268, 3267, 3271, 3272, 3273, 3275, 3261, 3274, 3260, 3270, 3250, 3251, 3252, 3253, 3254, 3255, 3256, 3257, 3258, 3259, 3262, 3263, 3280, 3276, 3281, 3265, 3284, 3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 2223, 4178, 2224, 4110, 4013, 3266, 3151, 3152, 3153, 3154, 3155, 3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165, 3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175, 3176, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3169, 4161, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 3249, 4121, 910, 272, UNDE, 4130, 4107, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 3279, 2233, 0, 0, 4180, 3138, UNDE, 4131, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4122, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, 0, ACC0, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, UNDE, ACC2, ACC2, ACC2, ACC2, ACC2, ACC2, 727, 3065, ACC2, ACC2, ACC2, ACC2, ACC2, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 3165, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 0, 4, false, true, true }, { "HersheyCyrillic", /* #4 */ NULL, "Complex Cyrillic", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 2214, 2217, 2275, 2274, 2271, 2272, 2251, 2221, 2222, 2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238, 2242, 2215, 2273, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2223, 4002, 2224, 4110, 4013, 2252, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2225, 2229, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 2177, 2178, 2179, 2180, 2181, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2119, 0, 0, 0, 0, 0, 0, 0, /* begin bogus region */ 0, 0, 0, ACC0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ACC1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 274, /* end bogus region */ 2931, 2901, 2902, 2923, 2905, 2906, 2921, 2904, 2922, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 2932, 2917, 2918, 2919, 2920, 2907, 2903, 2929, 2928, 2908, 2925, 2930, 2926, 2924, 2927, 2831, 2801, 2802, 2823, 2805, 2806, 2821, 2804, 2822, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2832, 2817, 2818, 2819, 2820, 2807, 2803, 2829, 2828, 2808, 2825, 2830, 2826, 2824, 2827, }, 0, 5, false, false, true }, { "HersheyCyrillic-Oblique", /* #5 */ NULL, "Complex Cyrillic (obliqued)", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 2214, 2217, 2275, 2274, 2271, 2272, 2251, 2221, 2222, 2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238, 2242, 2215, 2273, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2223, 4002, 2224, 4110, 4013, 2252, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2225, 2229, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 2177, 2178, 2179, 2180, 2181, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2119, 0, 0, 0, 0, 0, 0, 0, /* begin bogus region */ 0, 0, 0, ACC0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ACC1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 274, /* end bogus region */ 2931, 2901, 2902, 2923, 2905, 2906, 2921, 2904, 2922, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 2932, 2917, 2918, 2919, 2920, 2907, 2903, 2929, 2928, 2908, 2925, 2930, 2926, 2924, 2927, 2831, 2801, 2802, 2823, 2805, 2806, 2821, 2804, 2822, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2832, 2817, 2818, 2819, 2820, 2807, 2803, 2829, 2828, 2808, 2825, 2830, 2826, 2824, 2827, }, 0, 6, true, false, true }, { "HersheyHiragana", /* #6 */ NULL, "Hiragana (from oriental glyph database)", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4399, 4200+KS, 4200, 4201+KS, 4201, 4202+KS, 4202, 4203+KS, 4203, 4204+KS, 4204, 4205, 4255, 4206, 4256, 4207, 4257, 4208, 4258, 4209, 4259, 4210, 4260, 4211, 4261, 4212, 4262, 4213, 4263, 4214, 4264, 4215, 4265, 4216, 4266, 4217+KS, 4217, 4267, 4218, 4268, 4219, 4269, 4220, 4221, 4222, 4223, 4224, 4225, 4270, 4275, 4226, 4271, 4276, 4227, 4272, 4277, 4228, 4273, 4278, 4229, 4274, 4279, 4230, 4231, 4232, 4233, 4234, 4235+KS, 4235, 4237+KS, 4237, 4239+KS, 4239, 4240, 4241, 4242, 4243, 4244, 4245+KS, 4245, 4246, 4248, 4249, 4250, 0, 0, 0, 0, 4197, 4196, 4195, 0, 0, 0, 0, 0, /********************/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 0, 6, false, false, false }, { "HersheyKatakana", /* #7 */ NULL, "Katakana (from oriental glyph database)", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4399, 4300+KS, 4300, 4301+KS, 4301, 4302+KS, 4302, 4303+KS, 4303, 4304+KS, 4304, 4305, 4355, 4306, 4356, 4307, 4357, 4308, 4358, 4309, 4359, 4310, 4360, 4311, 4361, 4312, 4362, 4313, 4363, 4314, 4364, 4315, 4365, 4316, 4366, 4317+KS, 4317, 4367, 4318, 4368, 4319, 4369, 4320, 4321, 4322, 4323, 4324, 4325, 4370, 4375, 4326, 4371, 4376, 4327, 4372, 4377, 4328, 4373, 4378, 4329, 4374, 4379, 4330, 4331, 4332, 4333, 4334, 4335+KS, 4335, 4337+KS, 4337, 4339+KS, 4339, 4340, 4341, 4342, 4343, 4344, 4345+KS, 4345, 4346, 4348, 4349, 4350, 4398, 4305+KS, 4308+KS, 0, 4197, 4196, 4195, 0, 0, 0, 0, 0, /********************/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 0, 7, false, false, false }, { "HersheyEUC", /* #8 */ NULL, "Composite Japanese (from oriental glyph database)", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 2214, 2217, 2275, 2274, 2271, 2272, 2251, 2221, 2222, 2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238, 2242, 2215, 2273, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2223, 4125, 2224, 4110, 4013, 2252, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2225, 2229, 2226, 4008, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 2177, 2178, 2179, 2180, 2181, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2119, 2182, 0, 0, 0, 0, 0, 0, /* printable single-byte 8-bit characters (none for this font) */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, 0, 7, false, false, true }, { "HersheySans", /* #9 */ NULL, "Simplex Roman", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 699, 714, 717, 733, 719, 697, 734, 731, 721, 722, 728, 725, 711, 724, 710, 720, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 712, 713, 691, 726, 692, 715, 690, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 693, 4002, 694, 4110, 4013, 730, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 695, 723, 696, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4188, 4189, 4182, 4190, 4191, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 619, 4162, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 699, 4111, 910, 272, UNDE, 4127, 4106, 2276, 4182, 274, 0, UNDE, 4080, 4104, 273, 4187, 718, 2233, 0, 0, 4188, 638, UNDE, 729, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4112, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 515, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 615, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 1, 1, false, true, true }, { "HersheySans-Oblique", /* #10 */ NULL, "Simplex Roman (obliqued)", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 699, 714, 717, 733, 719, 697, 734, 731, 721, 722, 728, 725, 711, 724, 710, 720, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 712, 713, 691, 726, 692, 715, 690, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 693, 4002, 694, 4110, 4013, 730, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 695, 723, 696, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4188, 4189, 4182, 4190, 4191, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 619, 4162, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 699, 4111, 910, 272, UNDE, 4127, 4106, 2276, 4182, 274, 0, UNDE, 4080, 4104, 273, 4187, 718, 2233, 0, 0, 4188, 638, UNDE, 729, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4112, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 515, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 615, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 1, 2, true, true, true }, { "HersheySans-Bold", /* #11 */ NULL, "Duplex Roman", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2699, 2714, 2728, 2732, 2719, 2733, 2718, 2717, 2721, 2722, 2723, 2725, 2711, 2724, 2710, 2720, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2712, 2713, 2730, 2726, 2731, 2715, 2734, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2223, 4178, 2224, 4110, 4013, 2716, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2619, 4163, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 2699, 4115, 910, 272, UNDE, 4128, 4107, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 2729, 2233, 0, 0, 4180, 3138, UNDE, 4131, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4116, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 2515, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 2615, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 1, 3, false, true, true }, { "HersheySans-BoldOblique", /* #12 */ NULL, "Duplex Roman (obliqued)", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2699, 2714, 2728, 2732, 2719, 2733, 2718, 2717, 2721, 2722, 2723, 2725, 2711, 2724, 2710, 2720, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2712, 2713, 2730, 2726, 2731, 2715, 2734, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2223, 4178, 2224, 4110, 4013, 2716, 2601, 2602, 2603, 2604, 2605, 2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2619, 4163, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 2699, 4115, 910, 272, UNDE, 4128, 4107, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 2729, 2233, 0, 0, 4180, 3138, UNDE, 4131, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4116, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 2515, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 2615, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 1, 4, true, true, true }, { "HersheyScript", /* #13 */ NULL, "Simplex Script", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 699, 714, 717, 733, 719, 697, 734, 731, 721, 722, 728, 725, 711, 724, 710, 720, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 712, 713, 691, 726, 692, 715, 690, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 693, 4002, 694, 4110, 4013, 730, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 695, 723, 696, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 669, 0, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 699, 4111, 910, 272, UNDE, 4127, 4106, 2276, 4182, 274, 0, UNDE, 4080, 4104, 273, 4187, 718, 2233, 0, 0, 4180, 638, UNDE, 729, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4112, 551, 551, 551, 551, 551, 551, UNDE, 553, 555, 555, 555, 555, 559, 559, 559, 559, UNDE, 564, 565, 565, 565, 565, 565, 727, 565, 571, 571, 571, 571, 575, UNDE, 0, 651, 651, 651, 651, 651, 651, 0, 653, 655, 655, 655, 655, 659, 659, 659, 659, UNDE, 664, 665, 665, 665, 665, 665, 2237, 665, 671, 671, 671, 671, 675, UNDE, 675 }, 2, 1, false, true, true }, { "HersheyScript-Bold", /* #14 */ NULL, "Complex Script", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2749, 2764, 2778, 2782, 2769, 2783, 2768, 2767, 2771, 2772, 2773, 2775, 2761, 2774, 2760, 2770, 2750, 2751, 2752, 2753, 2754, 2755, 2756, 2757, 2758, 2759, 2762, 2763, 2780, 2776, 2781, 2765, 2784, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2223, 4002, 2224, 4110, 4013, 2766, 2651, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2225, 2229, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2669, 0, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 2749, 4117, 910, 272, UNDE, 4128, 4106, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 2779, 2233, 0, 0, 4180, 638, UNDE, 729, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4118, 2551, 2551, 2551, 2551, 2551, 2551, 0, 2553, 2555, 2555, 2555, 2555, 2559, 2559, 2559, 2559, UNDE, 2554, 2555, 2555, 2555, 2555, 2555, 727, 2555, 2571, 2571, 2571, 2571, 2575, UNDE, 0, 2651, 2651, 2651, 2651, 2651, 2651, 0, 2653, 2655, 2655, 2655, 2655, 2659, 2659, 2659, 2659, UNDE, 2664, 2665, 2665, 2665, 2665, 2665, 2237, 2665, 2671, 2671, 2671, 2671, 2675, UNDE, 2675 }, 2, 3, false, true, true }, { "HersheyGothicEnglish", /* #15 */ "HersheyGothic-English", "Gothic English", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3699, 3714, 3728, 3732, 3719, 3733, 3718, 3717, 3721, 3722, 3723, 3725, 3711, 3724, 3710, 3720, 3700, 3701, 3702, 3703, 3704, 3705, 3706, 3707, 3708, 3709, 3712, 3713, 3730, 3726, 3731, 3715, 3734, 3501, 3502, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 3517, 3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 2223, 4178, 2224, 4110, 4013, 3716, 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625, 3626, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3619, 4165, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 3699, 4123, 910, 272, UNDE, 4126, 4107, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 3729, 2233, 0, 0, 4180, 3138, UNDE, 4131, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4124, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 3515, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 3615, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 3, 1, false, true, true }, { "HersheyGothicGerman", /* #16 */ "HersheyGothic-German", "Gothic German", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3249, 3214, 3228, 3232, 3219, 3233, 3218, 3217, 3221, 3222, 3223, 3225, 3211, 3224, 3210, 3220, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3212, 3213, 3230, 3226, 3231, 3215, 3234, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 2223, 4178, 2224, 4110, 4013, 3216, 3401, 3402, 3403, 3404, 3405, 3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415, 3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425, 3426, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 4179, 3429, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3427, 4164, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 3249, 4119, 910, 272, UNDE, 4126, 4107, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 3229, 2233, 0, 0, 4180, 3138, UNDE, 4131, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4120, ACC1, ACC1, ACC1, ACC1, 3330, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, 3331, 727, 3515, ACC1, ACC1, ACC1, 3332, ACC1, UNDE, 3428, ACC0, ACC0, ACC0, ACC0, 3430, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, 3431, 2237, 3615, ACC0, ACC0, ACC0, 3432, ACC0, UNDE, ACC0, }, 4, 1, false, true, true }, { "HersheyGothicItalian", /* #17 */ "HersheyGothic-Italian", "Gothic Italian", { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3249, 3214, 3228, 3232, 3219, 3233, 3218, 3217, 3221, 3222, 3223, 3225, 3211, 3224, 3210, 3220, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3212, 3213, 3230, 3226, 3231, 3215, 3234, 3801, 3802, 3803, 3804, 3805, 3806, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 3817, 3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 2223, 4178, 2224, 4110, 4013, 3216, 3901, 3902, 3903, 3904, 3905, 3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915, 3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925, 3926, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible to the user. We store ligatures, accents, and variant glyphs there. */ 0, 0, 0, 0, 0, 0, 0, 0, 4180, 4181, 4182, 4183, 4184, 4185, 4186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3919, 4166, 0, 0, 0, 0, 0, 0, /* ISO-Latin-1 encoding resumes */ 3249, 4119, 910, 272, UNDE, 4126, 4107, 2276, 4182, 274, 0, UNDE, 4080, 4105, 273, 4187, 3229, 2233, 0, 0, 4180, 3138, UNDE, 4131, CEDILLA, 0, 0, UNDE, 270, 261, 271, 4120, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 0, ACC0, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, ACC1, ACC1, ACC1, ACC1, ACC1, ACC1, 727, 3815, ACC1, ACC1, ACC1, ACC1, ACC1, UNDE, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, ACC0, ACC0, ACC0, ACC0, ACC0, 2237, 3915, ACC0, ACC0, ACC0, ACC0, ACC0, UNDE, ACC0, }, 5, 1, false, true, true }, { "HersheySerifSymbol", /* #18 */ "HersheySerif-Symbol", /* for backward compatibility */ "Complex Greek", { /* The range 00..037 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey zodiacal signs) in this range. */ 0, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 2214, 4014, 2275, 2279, 2271, 2272, 282, 2221, 2222, 2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238, 2242, 2215, 250, 2027, 2028, 2048, 2030, 2031, 2047, 2029, 2033, 2035, 2134, 2036, 2037, 2038, 2039, 2041, 2042, 2034, 2043, 2044, 2045, 2025, 2187, 2050, 2040, 2049, 2032, 2223, 740, 2224, 738, 4013, 4009, 2127, 2128, 2148, 2130, 2131, 2186, 2129, 2133, 2135, 2147, 2136, 2137, 2138, 2139, 2141, 2142, 2185, 2143, 2144, 2145, 2146, 4083, 2150, 2140, 2149, 2132, 2225, 2229, 2226, 2246, 0, /* The range 0200--0237 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey astronomical symbols) in this range. */ 0, 0, 0, 0, 4019, 4020, 4021, 4022, UNDE, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2187, 2277, 2278, 2269, 2234, 2230, 4008, 4012, /* symbol encoding resumes... */ 2199, 2046, 2216, 2243, 2220, 2270, 2156, 744, 743, 742, 741, 4045, 2263, 2262, 2261, 2264, 2218, 2233, 2217, 2244, 2235, 2245, 2265, 828, 2237, 2239, 2240, 248, 4070, 4044, 4051, 4065, 2077, 3309, 3318, 2190, 4003, 4004, 4071, 2259, 2257, 2258, 4011, 4082, 2256, 4010, 2260, 4007, 739, 2266, 273, 274, 4098, 2401, 2267, 2236, 4080, 4078, 4081, 4046, 4048, 4050, 4049, 4047, 743, 2227, 273, 274, 4097, 2402, UNDE, UNDE, UNDE, 4176, UNDE, 4174, UNDE, UNDE, UNDE, UNDE, UNDE, 2228, 2268, UNDE, UNDE, UNDE, UNDE, UNDE, UNDE, 4177, UNDE, 4175, UNDE, UNDE, UNDE, 0 }, 6, 1, false, false, true }, { "HersheySerifSymbol-Oblique", /* #19 */ NULL, "Complex Greek (obliqued)", { /* The range 00..037 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey zodiacal signs) in this range. */ 0, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 2214, 4014, 2275, 2279, 2271, 2272, 282, 2221, 2222, 2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238, 2242, 2215, 250, 2027, 2028, 2048, 2030, 2031, 2047, 2029, 2033, 2035, 2134, 2036, 2037, 2038, 2039, 2041, 2042, 2034, 2043, 2044, 2045, 2025, 2187, 2050, 2040, 2049, 2032, 2223, 740, 2224, 738, 4013, 4009, 2127, 2128, 2148, 2130, 2131, 2186, 2129, 2133, 2135, 2147, 2136, 2137, 2138, 2139, 2141, 2142, 2185, 2143, 2144, 2145, 2146, 4083, 2150, 2140, 2149, 2132, 2225, 2229, 2226, 2246, 0, /* The range 0200--0237 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey astronomical symbols) in this range. */ 0, 0, 0, 0, 4019, 4020, 4021, 4022, UNDE, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2187, 2277, 2278, 2269, 2234, 2230, 4008, 4012, /* symbol encoding resumes... */ 2199, 2046, 2216, 2243, 2220, 2270, 2156, 744, 743, 742, 741, 4045, 2263, 2262, 2261, 2264, 2218, 2233, 2217, 2244, 2235, 2245, 2265, 828, 2237, 2239, 2240, 248, 4070, 4044, 4051, 4065, 2077, 3309, 3318, 2190, 4003, 4004, 4071, 2259, 2257, 2258, 4011, 4082, 2256, 4010, 2260, 4007, 739, 2266, 273, 274, 4098, 2401, 2267, 2236, 4080, 4078, 4081, 4046, 4048, 4050, 4049, 4047, 743, 2227, 273, 274, 4097, 2402, UNDE, UNDE, UNDE, 4176, UNDE, 4174, UNDE, UNDE, UNDE, UNDE, UNDE, 2228, 2268, UNDE, UNDE, UNDE, UNDE, UNDE, UNDE, 4177, UNDE, 4175, UNDE, UNDE, UNDE, 0 }, 6, 2, true, false, true }, { "HersheySerifSymbol-Bold", /* #20 */ NULL, "Triplex Greek", { /* The range 00..037 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey zodiacal signs) in this range. */ 0, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 3214, 4014, 3232, 2279, 3233, 3219, 282, 3221, 3222, 3223, 3225, 3211, 3224, 3210, 3220, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3212, 3213, 3230, 3226, 3231, 3215, 250, 3027, 3028, 3048, 3030, 3031, 3047, 3029, 3033, 3035, 3134, 3036, 3037, 3038, 3039, 3041, 3042, 3034, 3043, 3044, 3045, 3025, 3187, 3050, 3040, 3049, 3032, 2223, 740, 2224, 738, 4013, 4009, 3127, 3128, 3148, 3130, 3131, 3186, 3129, 3133, 3135, 3147, 3136, 3137, 3138, 3139, 3141, 3142, 3185, 3143, 3144, 3145, 3146, 3150, 3150, 3140, 3149, 3132, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey astronomical symbols) in this range. */ 0, 0, 0, 0, 4019, 4020, 4021, 4022, UNDE, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 3187, 2277, 2278, 2269, 2234, 2230, 4008, 4012, /* symbol encoding resumes... */ 2199, 3046, 3227, 2243, 3220, 2270, 3156, 744, 743, 742, 741, 4045, 2263, 2262, 2261, 2264, 3218, 2233, 3228, 2244, 2235, 2245, 3183, 828, 2237, 2239, 2240, 248, 4070, 4044, 4051, 4065, 2077, 3309, 3318, 2190, 4003, 4004, 4071, 2259, 2257, 2258, 4011, 4082, 2256, 4010, 2260, 4007, 739, 3083, 273, 274, 4098, 2401, 2267, 2236, 4080, 4078, 4081, 4046, 4048, 4050, 4049, 4047, 743, 2227, 273, 274, 4097, 2402, UNDE, UNDE, UNDE, 4176, UNDE, 4174, UNDE, UNDE, UNDE, UNDE, UNDE, 2228, 2268, UNDE, UNDE, UNDE, UNDE, UNDE, UNDE, 4177, UNDE, 4175, UNDE, UNDE, UNDE, 0 }, 6, 3, false, false, true }, { "HersheySerifSymbol-BoldOblique", /* #21 */ NULL, "Triplex Greek (obliqued)", { /* The range 00..037 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey zodiacal signs) in this range. */ 0, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 3214, 4014, 3232, 2279, 3233, 3219, 282, 3221, 3222, 3223, 3225, 3211, 3224, 3210, 3220, 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3212, 3213, 3230, 3226, 3231, 3215, 250, 3027, 3028, 3048, 3030, 3031, 3047, 3029, 3033, 3035, 3134, 3036, 3037, 3038, 3039, 3041, 3042, 3034, 3043, 3044, 3045, 3025, 3187, 3050, 3040, 3049, 3032, 2223, 740, 2224, 738, 4013, 4009, 3127, 3128, 3148, 3130, 3131, 3186, 3129, 3133, 3135, 3147, 3136, 3137, 3138, 3139, 3141, 3142, 3185, 3143, 3144, 3145, 3146, 3150, 3150, 3140, 3149, 3132, 2225, 4108, 2226, 2246, 0, /* The range 0200--0237 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey astronomical symbols) in this range. */ 0, 0, 0, 0, 4019, 4020, 4021, 4022, UNDE, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 3187, 2277, 2278, 2269, 2234, 2230, 4008, 4012, /* symbol encoding resumes... */ 2199, 3046, 3227, 2243, 3220, 2270, 3156, 744, 743, 742, 741, 4045, 2263, 2262, 2261, 2264, 3218, 2233, 3228, 2244, 2235, 2245, 3183, 828, 2237, 2239, 2240, 248, 4070, 4044, 4051, 4065, 2077, 3309, 3318, 2190, 4003, 4004, 4071, 2259, 2257, 2258, 4011, 4082, 2256, 4010, 2260, 4007, 739, 3083, 273, 274, 4098, 2401, 2267, 2236, 4080, 4078, 4081, 4046, 4048, 4050, 4049, 4047, 743, 2227, 273, 274, 4097, 2402, UNDE, UNDE, UNDE, 4176, UNDE, 4174, UNDE, UNDE, UNDE, UNDE, UNDE, 2228, 2268, UNDE, UNDE, UNDE, UNDE, UNDE, UNDE, 4177, UNDE, 4175, UNDE, UNDE, UNDE, 0 }, 6, 4, true, false, true }, { "HersheySansSymbol", /* #22 */ "HersheySans-Symbol", /* for backward compatibility */ "Simplex Greek", { /* The range 00..037 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey zodiacal signs) in this range. */ 0, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 714, 4014, 733, 2279, 697, 734, 282, 721, 722, 728, 725, 711, 724, 710, 720, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 712, 713, 2241, 726, 2242, 715, 250, 527, 528, 548, 530, 531, 547, 529, 533, 535, 534, 536, 537, 538, 539, 541, 542, 534, 543, 544, 545, 525, 687, 550, 540, 549, 532, 693, 740, 694, 738, 4013, 4009, 627, 628, 648, 630, 631, 686, 629, 633, 635, 647, 636, 637, 638, 639, 641, 642, 685, 643, 644, 645, 646, 650, 650, 640, 649, 632, 695, 2229, 696, 2246, 0, /* The range 0200--0237 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey astronomical symbols) in this range. */ 0, 0, 0, 0, 4019, 4020, 4021, 4022, UNDE, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 687, 2277, 2278, 2269, 2234, 2230, 4008, 4012, /* symbol encoding resumes... */ 2199, 546, 716, 2243, 720, 736, 2156, 744, 743, 742, 741, 4045, 2263, 2262, 2261, 2264, 718, 2233, 717, 2244, 2235, 2245, 683, 828, 2237, 2239, 2240, 248, 4070, 4044, 4051, 4065, 2077, 3309, 3318, 2190, 4003, 4004, 4071, 2259, 2257, 2258, 4011, 4082, 2256, 4010, 2260, 4007, 739, 583, 273, 274, 4098, 2401, 2267, 2236, 4080, 4078, 4081, 4046, 4048, 4050, 4049, 4047, 743, 2227, 273, 274, 4097, 2402, UNDE, UNDE, UNDE, 4172, UNDE, 4170, UNDE, UNDE, UNDE, UNDE, UNDE, 2228, 2268, UNDE, UNDE, UNDE, UNDE, UNDE, UNDE, 4173, UNDE, 4171, UNDE, UNDE, UNDE, 0 }, 7, 1, false, false, true }, { "HersheySansSymbol-Oblique", /* #23 */ NULL, "Simplex Greek (obliqued)", { /* The range 00..037 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey zodiacal signs) in this range. */ 0, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2199, 714, 4014, 733, 2279, 697, 734, 282, 721, 722, 728, 725, 711, 724, 710, 720, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 712, 713, 2241, 726, 2242, 715, 250, 527, 528, 548, 530, 531, 547, 529, 533, 535, 534, 536, 537, 538, 539, 541, 542, 534, 543, 544, 545, 525, 687, 550, 540, 549, 532, 693, 740, 694, 738, 4013, 4009, 627, 628, 648, 630, 631, 686, 629, 633, 635, 647, 636, 637, 638, 639, 641, 642, 685, 643, 644, 645, 646, 650, 650, 640, 649, 632, 695, 2229, 696, 2246, 0, /* The range 0200--0237 isn't accessible except through macros, since in the standard symbol encoding, it's empty. We store misc. non-font characters (e.g., Hershey astronomical symbols) in this range. */ 0, 0, 0, 0, 4019, 4020, 4021, 4022, UNDE, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 687, 2277, 2278, 2269, 2234, 2230, 4008, 4012, /* symbol encoding resumes... */ 2199, 546, 716, 2243, 720, 736, 2156, 744, 743, 742, 741, 4045, 2263, 2262, 2261, 2264, 718, 2233, 717, 2244, 2235, 2245, 683, 828, 2237, 2239, 2240, 248, 4070, 4044, 4051, 4065, 2077, 3309, 3318, 2190, 4003, 4004, 4071, 2259, 2257, 2258, 4011, 4082, 2256, 4010, 2260, 4007, 739, 583, 273, 274, 4098, 2401, 2267, 2236, 4080, 4078, 4081, 4046, 4048, 4050, 4049, 4047, 743, 2227, 273, 274, 4097, 2402, UNDE, UNDE, UNDE, 4172, UNDE, 4170, UNDE, UNDE, UNDE, UNDE, UNDE, 2228, 2268, UNDE, UNDE, UNDE, UNDE, UNDE, UNDE, 4173, UNDE, 4171, UNDE, UNDE, UNDE, 0 }, 7, 2, true, false, true }, { NULL, /* DUMMY */ NULL, NULL, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 0, false, false, false } }; /* Accented character table, used (1) by ISO-Latin-1 Hershey fonts, and (2) by HersheyCyrillic and HersheyCyrillic-Oblique. (Really the union of three non-conflicting tables.) This table maps each accented character to a base character and an accent. The indices of the accent glyphs, in the glyph table in g_her_glyph.c, are stored in the inaccessible 0x80--0x9f region (i.e., \0200--\0237 region) of each font. */ const struct plHersheyAccentedCharInfoStruct _pl_g_hershey_accented_char_info[] = { /* for HersheyCyrillic[-Oblique] (KOI8-R encoding) accented characters */ {0243, 0305, 0212}, /* edieresis */ {0263, 0345, 0212}, /* Edieresis */ /* for ISO-Latin-1 accented characters */ {0300, 'A', 0211}, /* Agrave */ {0301, 'A', 0210}, /* Aacute */ {0302, 'A', 0213}, /* Acircumflex */ {0303, 'A', 0215}, /* Atilde */ {0304, 'A', 0212}, /* Adieresis */ {0305, 'A', 0216}, /* Aring */ {0307, 'C', 0217}, /* Ccedilla */ {0310, 'E', 0211}, /* Egrave */ {0311, 'E', 0210}, /* Eacute */ {0312, 'E', 0213}, /* Ecircumflex */ {0313, 'E', 0212}, /* Edieresis */ {0314, 'I', 0210}, /* Igrave */ {0315, 'I', 0211}, /* Iacute */ {0316, 'I', 0214}, /* Icircumflex (note narrow circ.) */ {0317, 'I', 0212}, /* Idieresis */ {0321, 'N', 0215}, /* Ntilde */ {0322, 'O', 0211}, /* Ograve */ {0323, 'O', 0210}, /* Oacute */ {0324, 'O', 0213}, /* Ocircumflex */ {0325, 'O', 0215}, /* Otilde */ {0326, 'O', 0212}, /* Odieresis */ {0331, 'U', 0211}, /* Ugrave */ {0332, 'U', 0210}, /* Uacute */ {0333, 'U', 0213}, /* Ucircumflex */ {0334, 'U', 0212}, /* Udieresis */ {0335, 'Y', 0210}, /* Yacute */ {0340, 'a', 0211}, /* agrave */ {0341, 'a', 0210}, /* aacute */ {0342, 'a', 0214}, /* acircumflex */ {0343, 'a', 0215}, /* atilde */ {0344, 'a', 0212}, /* adieresis */ {0345, 'a', 0216}, /* aring */ {0347, 'c', 0217}, /* ccedilla */ {0350, 'e', 0211}, /* egrave */ {0351, 'e', 0210}, /* eacute */ {0352, 'e', 0214}, /* ecircumflex */ {0353, 'e', 0212}, /* edieresis */ {0354, 0231, 0210}, /* igrave */ {0355, 0231, 0211}, /* iacute */ {0356, 0231, 0214}, /* icircumflex (note narrow circ.) */ {0357, 0231, 0212}, /* idieresis */ {0361, 'n', 0215}, /* ntilde */ {0362, 'o', 0211}, /* ograve */ {0363, 'o', 0210}, /* oacute */ {0364, 'o', 0214}, /* ocircumflex */ {0365, 'o', 0215}, /* otilde */ {0366, 'o', 0212}, /* odieresis */ {0371, 'u', 0211}, /* ugrave */ {0372, 'u', 0210}, /* uacute */ {0373, 'u', 0214}, /* ucircumflex */ {0374, 'u', 0212}, /* udieresis */ {0375, 'y', 0210}, /* yacute */ {0377, 'y', 0212}, /* ydieresis */ {0, 0, 0} }; /* known Hershey vector font typefaces. Each plTypefaceInfoStruct contains the following information: (1) number of valid fonts [should be >= 2, since every typeface should include a symbol font (the zeroth font, the 1st listed)] (2) a list of fonts (each number is an index into the _pl_g_hershey_font_info[] array above). The number of valid fonts should be <= PL_MAX_FONTS_PER_TYPEFACE; the initializers are filled out with dummy fonts to get arrays of length PL_MAX_FONTS_PER_TYPEFACE. */ const struct plTypefaceInfoStruct _pl_g_hershey_typeface_info[] = { /* Hershey Serif [including Cyrillic, Cyrillic-Obl., and EUC], typeface #0 */ { 8, { 18, 0, 1, 2, 3, 4, 5, 8, 999, 999 } }, /* Hershey Sans, typeface #1 */ { 5, { 22, 9, 10, 11, 12, 999, 999, 999, 999, 999 } }, /* Hershey Script [note duplicates], typeface #2 */ { 5, { 18, 13, 13, 14, 14, 999, 999, 999, 999, 999 } }, /* Hershey Gothic English, typeface #3 */ { 2, { 18, 15, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Hershey Gothic German, typeface #4 */ { 2, { 18, 16, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Hershey Gothic Italian, typeface #5 */ { 2, { 18, 17, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Hershey Serif Symbol, typeface #6 */ { 5, { 18, 18, 19, 20, 21, 999, 999, 999, 999, 999 } }, /* Hershey Sans Symbol, typeface #7 */ { 3, { 22, 22, 23, 999, 999, 999, 999, 999, 999, 999 } }, }; plotutils-2.6/libplot/g_fontd2.c0000644000175000017500000055452311234142415013667 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* THIS FILE IS NOW SPLIT INTO TWO PIECES: g_fontdb.c and g_fontd2.c, TO FACILITATE COMPILING. This is the second half, containing PCL fonts and Stick fonts (i.e., device-resident HP vector fonts). */ #include "sys-defines.h" #include "extern.h" /* The 45 standard HP LaserJet fonts, with ISO8859-1 (ISO-Latin-1) encoding where that is appropriate. (Note that PL_NUM_PCL_FONTS is defined to equal 45 in extern.h.) The tables of widths and `left edge' offsets are taken from the LaserJet 4 font distribution, as of this writing available at ftp://ftp.hp.com/pub/printers/software/mp135mu.exe . This is a zipped archive file which includes both .afm and .pfb files for the 45 fonts (apparently constructed by Fontographer from TrueType or Intellifont originals). Of these fonts, only the four Univers and four CGTimes fonts were available on the LaserJet III. The same 45 fonts are available on the LaserJet 5 and 6, and more recent LaserJets such as the 2100-series, the 4000-series, and the 8000-series. Each plPCLFontInfoStruct includes these elements: (1a) PS name, (1b) alternative PS name if any (may be NULL), (1c) Substitute PS name to be used when outputing to a PS file, if non-NULL. This feature is used only to support the Tidbits-is-Wingdings botch. (1c) X name. (1.5abcdef) CSS font properties: family, generic family, style, weight, stretch, panose (2) PCL typeface number. (3) PCL info: fixedwidth(0) / proportional(1). (4) PCL info: upright(0) / italic(1) / condensed(4) / cond. italic(5) / compressed i.e. extra cond. (8) / expanded (24) / outline (32) / inline (64). (5) PCL info: normal weight(0) / bold(3) / extra bold(4), etc. (6) PCL info: "symbol set" i.e. native character set/encoding. (277 = Roman-8 i.e. default set; 14 = ISO8859-1 i.e. ECMA-94 Latin 1; 621 = PS Symbol; 18540 = Wingdings. In PCL as opposed to HP-GL/2, these numbers are encoded base 32, as a number and a letter. E.g., 621 is written as 19M since 19*32+13, and 'M' is letter #13.) Note: even for ISO-Latin-1 fonts we do NOT specify `14'; we specify `277' instead, since we use HP's Roman-8 for the lower half of the font and HP's Latin 1 for the upper half. See comments in h_text.c. (7) and (8) normalized font ascent and descent (from font bounding box). (9ab) normalized cap height and x height (latter not yet implemented) (10) the character width information (array, size 256). (11) the character offset, or `left edge' information (array, size 256). [Our HP/GL-2, i.e. PCL 5 driver needs this, since HP-GL/2 and PCL 5 rendering begin at the left edge of the bounding box, unlike PS rendering. We shift rightward to compensate. See h_text.c.] (12) a typeface id (an index into the _pl_g_ps_typeface_info[] array below). (13) a font index (which font within the typeface this is). (14) an `iso8859-1' flag (refers to character set after re-encoding if any; true for all but Wingdings and Symbol). */ /* IMPORTANT: The fonts in this array may be referred to elsewhere in the code by number. If you change the numbering of PCL fonts, i.e., the order in which they appear in this array, be sure to update, e.g., the definitions PL_DEFAULT_PCL_FONT_INDEX, etc. in extern.h. */ const struct plPCLFontInfoStruct _pl_g_pcl_font_info[] = { { "Univers", /* #0 */ NULL, NULL, "univers-medium-r-normal", "Univers", "sans-serif", "normal", "normal", "normal", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 0, 0, 277, 987, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 498, 627, 627, 996, 756, 332, 332, 332, 627, 996, 332, 996, 332, 332, 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, 332, 332, 996, 996, 996, 517, 996, 738, 627, 701, 719, 572, 553, 738, 719, 276, 553, 664, 535, 904, 719, 756, 590, 774, 646, 646, 627, 719, 719, 996, 719, 682, 608, 332, 332, 332, 498, 498, 332, 535, 572, 535, 572, 535, 369, 572, 572, 240, 240, 535, 240, 867, 572, 572, 572, 572, 351, 498, 369, 572, 553, 867, 553, 553, 479, 443, 498, 443, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 627, 627, 627, 627, 498, 627, 627, 498, 406, 553, 996, 332, 498, 627, 627, 996, 387, 387, 627, 553, 627, 332, 627, 387, 406, 553, 996, 996, 996, 517, 738, 738, 738, 738, 738, 738, 977, 701, 572, 572, 572, 572, 276, 276, 276, 276, 719, 719, 756, 756, 756, 756, 756, 996, 756, 719, 719, 719, 719, 682, 590, 608, 535, 535, 535, 535, 535, 535, 848, 535, 535, 535, 535, 535, 240, 240, 240, 240, 572, 572, 572, 572, 572, 572, 572, 996, 572, 572, 572, 572, 572, 553, 572, 553 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 110, 71, 132, 124, 78, 79, 96, 61, 155, 232, 82, 231, 116, 44, 47, 151, 82, 70, 46, 87, 76, 80, 67, 76, 115, 79, 201, 232, 201, 102, 78, 33, 87, 69, 91, 90, 88, 64, 87, 92, 36, 101, 87, 84, 83, 71, 85, 73, 89, 66, 35, 86, 32, 28, 40, 26, 49, 96, 29, 57, 48, 0, 72, 56, 76, 52, 46, 49, 35, 49, 72, 71, -10, 88, 73, 72, 72, 52, 73, 51, 72, 47, 22, 68, 31, 50, 33, 32, 48, 97, 224, 71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 123, 113, 75, 0, 224, 166, 178, 147, 59, 81, 234, 45, 147, 149, 151, 234, 62, 48, 262, -61, 117, 116, 238, 89, 52, 81, 173, 177, 166, 107, 33, 33, 33, 33, 33, 33, 17, 69, 90, 90, 90, 90, 12, 63, -12, 4, 21, 83, 71, 71, 71, 71, 71, 264, 60, 86, 86, 86, 86, 26, 85, 73, 56, 56, 56, 56, 56, 56, 54, 52, 49, 49, 49, 49, -11, 41, -32, -17, 53, 72, 52, 52, 52, 52, 52, 231, 51, 68, 68, 68, 68, 32, 73, 32 }, 0, 1, true, }, { "Univers-Oblique", /* #1 */ NULL, NULL, "univers-medium-o-normal", "Univers", "sans-serif", "oblique", "normal", "normal", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 1, 0, 277, 989, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 498, 627, 627, 996, 756, 332, 332, 332, 627, 996, 332, 996, 332, 332, 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, 332, 332, 996, 996, 996, 517, 996, 738, 627, 701, 719, 572, 553, 738, 719, 276, 553, 664, 535, 904, 719, 756, 590, 774, 646, 646, 627, 719, 719, 996, 719, 682, 608, 332, 332, 332, 498, 498, 332, 535, 572, 535, 572, 535, 369, 572, 572, 240, 240, 535, 240, 867, 572, 572, 572, 572, 351, 498, 369, 572, 553, 867, 553, 553, 479, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 627, 627, 627, 627, 498, 627, 627, 498, 406, 553, 996, 332, 498, 627, 627, 996, 387, 387, 627, 553, 627, 332, 627, 387, 406, 553, 996, 996, 996, 517, 738, 738, 738, 738, 738, 738, 977, 701, 572, 572, 572, 572, 276, 276, 276, 276, 719, 719, 756, 756, 756, 756, 756, 996, 756, 719, 719, 719, 719, 682, 590, 608, 535, 535, 535, 535, 535, 535, 848, 535, 535, 535, 535, 535, 240, 240, 240, 240, 572, 572, 572, 572, 572, 572, 572, 996, 572, 572, 572, 572, 572, 553, 572, 553 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 210, 93, 140, 171, 86, 154, 104, -17, 208, 234, -19, 235, 42, -67, 59, 219, 47, 63, 27, 64, 86, 148, 57, 43, 44, -21, 201, 238, 201, 88, 115, -41, 24, 87, 19, 23, 23, 89, 18, 18, 3, 34, 24, 24, 21, 85, 23, 91, 22, 51, 142, 80, 161, 146, -11, 155, -16, 11, 146, -53, 48, 0, 137, 22, 9, 45, 44, 44, 51, -6, 5, 6, -124, 8, 7, 5, 5, 40, -49, 45, 11, 14, 83, 40, 91, 110, -17, 86, -2, 116, 224, -71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -25, 138, 39, 77, 91, 224, 166, 288, 147, 113, 83, 235, 44, 147, 240, 206, 231, 90, 93, 333, -61, 117, 131, 118, 178, 110, 29, 188, 167, 174, 15, -41, -41, -41, -41, -41, -41, -61, 87, 23, 23, 23, 23, 18, 18, 18, 18, 19, 21, 85, 85, 85, 85, 85, 281, 5, 80, 80, 80, 80, 155, 22, 14, 22, 22, 22, 22, 22, 22, 35, 45, 44, 44, 44, 44, 6, 6, 6, 6, 46, 5, 40, 40, 40, 40, 40, 233, -2, 40, 40, 40, 40, 86, -49, 86 }, 0, 2, true, }, { "Univers-Bold", /* #2 */ NULL, NULL, "univers-bold-r-normal", "Univers", "sans-serif", "normal", "bold", "normal", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 0, 3, 277, 976, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 517, 627, 627, 996, 756, 332, 332, 332, 627, 996, 332, 996, 332, 332, 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, 332, 332, 996, 996, 996, 517, 996, 738, 627, 701, 719, 572, 553, 738, 719, 276, 553, 664, 535, 904, 719, 756, 590, 774, 646, 646, 627, 719, 719, 996, 719, 682, 608, 332, 332, 332, 498, 498, 332, 535, 572, 535, 572, 535, 369, 572, 572, 240, 240, 535, 240, 867, 572, 572, 572, 572, 351, 498, 369, 572, 553, 867, 553, 553, 479, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 627, 627, 627, 627, 498, 627, 627, 498, 406, 553, 996, 332, 498, 627, 627, 996, 387, 387, 627, 590, 627, 332, 627, 387, 406, 553, 996, 996, 996, 517, 738, 738, 738, 738, 738, 738, 977, 701, 572, 572, 572, 572, 276, 276, 276, 276, 719, 719, 756, 756, 756, 756, 756, 996, 756, 719, 719, 719, 719, 682, 590, 608, 535, 535, 535, 535, 535, 535, 848, 535, 535, 535, 535, 535, 240, 240, 240, 240, 572, 572, 572, 572, 572, 572, 572, 996, 572, 572, 572, 572, 572, 553, 572, 553 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 100, 21, 99, 87, 64, 74, 74, 74, 119, 218, 79, 218, 117, 47, 47, 137, 76, 55, 32, 78, 62, 75, 49, 58, 117, 80, 201, 220, 201, 76, 43, 20, 74, 59, 74, 69, 72, 56, 76, 69, 15, 86, 74, 71, 66, 59, 73, 61, 73, 48, 33, 68, 22, 23, 24, 25, 48, 96, 32, 51, 48, 0, 84, 42, 63, 51, 43, 42, 29, 46, 60, 49, -40, 70, 55, 63, 60, 44, 60, 60, 61, 42, 22, 58, 26, 44, 27, 24, 44, 79, 224, 60, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 92, 76, 48, 0, 224, 138, 158, 147, 60, 67, 218, 63, 147, 174, 128, 219, 50, 46, 232, -61, 117, 120, 214, 91, 44, 59, 136, 136, 123, 86, 20, 20, 20, 20, 20, 20, 20, 59, 69, 69, 69, 69, 4, 32, -21, -24, 18, 66, 59, 59, 59, 59, 59, 241, 54, 68, 68, 68, 68, 25, 73, 64, 42, 42, 42, 42, 42, 42, 42, 51, 42, 42, 42, 42, -25, 19, -46, -41, 43, 60, 44, 44, 44, 44, 44, 219, 44, 58, 58, 58, 58, 24, 60, 24 }, 0, 3, true, }, { "Univers-BoldOblique", /* #3 */ NULL, NULL, "univers-bold-o-normal", "Univers", "sans-serif", "oblique", "bold", "normal", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 1, 3, 277, 976, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 535, 627, 627, 996, 756, 332, 332, 332, 627, 996, 332, 996, 332, 332, 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, 332, 332, 996, 996, 996, 517, 996, 738, 627, 701, 719, 572, 553, 738, 719, 276, 553, 664, 535, 904, 719, 756, 590, 774, 646, 646, 627, 719, 719, 996, 719, 682, 608, 332, 332, 332, 498, 498, 332, 535, 572, 535, 572, 535, 369, 572, 572, 240, 240, 535, 240, 867, 572, 572, 572, 572, 351, 498, 369, 572, 553, 867, 553, 553, 479, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 332, 627, 627, 627, 627, 498, 627, 627, 498, 406, 553, 996, 332, 498, 627, 627, 996, 387, 387, 627, 590, 627, 332, 627, 387, 406, 553, 996, 996, 996, 517, 738, 738, 738, 738, 738, 738, 977, 701, 572, 572, 572, 572, 276, 276, 276, 276, 719, 719, 756, 756, 756, 756, 756, 996, 756, 719, 719, 719, 719, 682, 590, 608, 535, 535, 535, 535, 535, 535, 848, 535, 535, 535, 535, 535, 240, 240, 240, 240, 572, 572, 572, 572, 572, 572, 572, 996, 572, 572, 572, 572, 572, 553, 572, 553 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 168, 53, 104, 128, 59, 148, 82, -33, 175, 229, -19, 229, 33, -63, 63, 193, 34, 36, 2, 51, 63, 105, 33, 36, 33, -22, 201, 243, 201, 86, 88, -27, 3, 74, 3, 4, 4, 80, 6, -8, -1, 29, 5, 1, -2, 77, 4, 77, 4, 45, 132, 64, 148, 145, -22, 149, -21, -25, 112, -69, 48, 0, 129, 13, -10, 34, 32, 27, 39, -27, -8, -21, -170, -2, -20, -9, -6, 32, -60, 32, -8, 11, 70, 25, 82, 100, -40, 70, -6, 101, 224, -78, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -36, 105, 50, 48, 51, 224, 138, 257, 147, 105, 42, 229, 40, 147, 275, 188, 228, 85, 86, 329, -61, 117, 128, 119, 159, 105, -6, 151, 169, 146, -3, -27, -27, -27, -27, -27, -27, -56, 74, 4, 4, 4, 4, -8, -8, -8, -8, 3, -2, 77, 77, 77, 77, 77, 276, 4, 64, 64, 64, 64, 149, 4, -8, 13, 13, 13, 13, 13, 13, 16, 34, 27, 27, 27, 27, -21, -21, -21, -21, 32, -6, 32, 32, 32, 32, 32, 231, -14, 25, 25, 25, 25, 70, -59, 70 }, 0, 4, true, }, { "UniversCondensed", /* #4 */ NULL, NULL, "univers-medium-r-condensed", "Univers", "sans-serif", "normal", "normal", "condensed", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 4, 0, 277, 932, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 369, 461, 461, 664, 608, 221, 221, 221, 461, 664, 221, 664, 221, 221, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 221, 221, 996, 664, 996, 424, 664, 517, 498, 498, 517, 424, 406, 517, 517, 221, 424, 498, 387, 682, 535, 517, 461, 517, 498, 479, 479, 517, 461, 682, 517, 461, 461, 221, 221, 221, 498, 498, 221, 406, 406, 387, 406, 387, 295, 406, 406, 185, 185, 406, 185, 608, 406, 406, 406, 406, 276, 369, 295, 406, 387, 646, 387, 406, 332, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 461, 461, 461, 461, 498, 461, 461, 498, 276, 442, 664, 221, 498, 461, 461, 664, 276, 276, 461, 553, 461, 221, 461, 276, 276, 442, 664, 664, 664, 424, 517, 517, 517, 517, 517, 517, 701, 498, 424, 424, 424, 424, 221, 221, 221, 221, 517, 535, 517, 517, 517, 517, 517, 664, 517, 517, 517, 517, 517, 461, 461, 442, 406, 406, 406, 406, 406, 406, 627, 387, 387, 387, 387, 387, 221, 221, 221, 221, 406, 406, 406, 406, 406, 406, 406, 664, 406, 406, 406, 406, 406, 406, 406, 406 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 62, 28, 86, 74, 56, 45, 50, 42, 85, 141, 28, 141, 62, 36, 52, 115, 57, 51, 21, 63, 59, 68, 50, 51, 62, 28, 201, 141, 201, 67, 60, 40, 68, 69, 67, 65, 66, 64, 65, 68, 23, 72, 65, 66, 63, 65, 66, 63, 65, 47, 36, 67, 26, 36, 34, 31, 46, 52, 36, 27, 48, 0, 40, 48, 49, 50, 48, 41, 36, 46, 53, 47, -4, 60, 51, 41, 50, 49, 53, 47, 53, 36, 33, 49, 32, 27, 29, 32, 36, 97, 224, 71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 90, 88, 77, 44, 224, 82, 105, 147, 26, 54, 141, 46, 147, 122, 84, 141, 35, 37, 177, -61, 117, 62, 141, 58, 24, 53, 101, 81, 82, 67, 40, 40, 40, 40, 40, 40, 35, 69, 65, 65, 65, 65, 17, 52, 7, -12, 13, 63, 65, 65, 65, 65, 65, 152, 68, 67, 67, 67, 67, 31, 68, 54, 48, 48, 48, 48, 48, 48, 46, 50, 41, 41, 41, 41, 4, 45, 2, -17, 49, 50, 49, 49, 49, 49, 49, 143, 49, 49, 49, 49, 49, 32, 53, 32 }, 1, 1, true, }, { "UniversCondensed-Oblique", /* #5 */ NULL, NULL, "univers-medium-o-condensed", "Univers", "sans-serif", "oblique", "normal", "condensed", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 5, 0, 277, 933, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 369, 461, 461, 664, 608, 221, 221, 221, 461, 664, 221, 664, 221, 221, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 221, 221, 996, 664, 996, 424, 664, 517, 498, 498, 517, 424, 406, 517, 517, 221, 424, 498, 387, 682, 535, 517, 461, 517, 498, 479, 479, 517, 461, 682, 517, 461, 461, 221, 295, 221, 498, 498, 221, 406, 406, 387, 406, 387, 295, 406, 406, 185, 185, 406, 185, 608, 406, 406, 406, 406, 276, 369, 295, 406, 387, 646, 387, 406, 332, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 461, 461, 461, 461, 498, 461, 461, 498, 295, 442, 664, 221, 498, 461, 461, 664, 276, 276, 461, 553, 461, 221, 461, 276, 295, 442, 664, 664, 664, 424, 517, 517, 517, 517, 517, 517, 701, 498, 424, 424, 424, 424, 221, 221, 221, 221, 517, 535, 517, 517, 517, 517, 517, 664, 517, 517, 517, 517, 517, 461, 461, 442, 406, 406, 406, 406, 406, 406, 627, 387, 387, 387, 387, 387, 221, 221, 221, 221, 406, 406, 406, 406, 406, 406, 406, 664, 406, 406, 406, 406, 406, 406, 406, 406 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 140, 49, 78, 76, 43, 106, 23, -71, 165, 129, -59, 129, -1, -82, 25, 129, -15, 22, 23, 45, 49, 44, 45, 31, -10, -59, 201, 130, 201, 73, 11, -39, -8, 30, -9, -9, -5, 37, -7, -10, -21, -1, -8, -11, -12, 33, -4, 31, -8, 12, 122, 36, 98, 96, -35, 105, -31, -52, 97, -95, 48, 0, 106, 3, -19, 19, 6, 9, 21, -48, -19, -22, -140, -5, -23, -19, -19, 18, -75, 11, -19, 0, 44, 11, 66, 63, -33, -23, -32, 116, 224, -71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, 88, 30, 77, 2, 224, 107, 190, 147, 95, 66, 129, 37, 147, 181, 163, 131, 61, 86, 266, -61, 117, 77, -21, 145, 95, 20, 61, 44, 87, -27, -39, -39, -39, -39, -39, -39, -38, 21, -9, -9, -9, -9, -10, -10, -10, -10, -9, -12, 33, 33, 33, 33, 33, 158, 29, 36, 36, 36, 36, 105, -3, -23, 3, 3, 3, 3, 3, 3, 13, -35, 9, 9, 9, 9, -4, -4, -4, -4, 15, -19, 18, 18, 18, 18, 18, 151, 14, 11, 11, 11, 11, -23, -75, -23 }, 1, 2, true, }, { "UniversCondensed-Bold", /* #6 */ NULL, NULL, "univers-bold-r-condensed", "Univers", "sans-serif", "normal", "bold", "condensed", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 4, 3, 277, 950, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 406, 479, 479, 664, 627, 221, 221, 221, 479, 664, 221, 664, 221, 221, 479, 479, 479, 479, 479, 479, 479, 479, 479, 479, 221, 221, 996, 664, 996, 442, 664, 553, 535, 517, 553, 461, 442, 553, 553, 258, 479, 535, 424, 738, 572, 553, 517, 572, 517, 535, 498, 553, 517, 774, 553, 517, 461, 221, 221, 221, 498, 498, 221, 442, 442, 406, 442, 424, 313, 442, 461, 240, 240, 442, 240, 664, 461, 442, 442, 442, 332, 406, 313, 461, 442, 701, 442, 442, 369, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 479, 479, 479, 479, 498, 479, 479, 498, 406, 442, 664, 221, 498, 479, 479, 664, 313, 313, 479, 590, 479, 221, 479, 313, 406, 442, 664, 664, 664, 442, 553, 553, 553, 553, 553, 553, 774, 517, 461, 461, 461, 461, 258, 258, 258, 258, 553, 572, 553, 553, 553, 553, 553, 664, 553, 553, 553, 553, 553, 517, 517, 498, 442, 442, 442, 442, 442, 442, 664, 406, 424, 424, 424, 424, 240, 240, 240, 240, 442, 461, 442, 442, 442, 442, 442, 664, 442, 461, 461, 461, 461, 442, 442, 442 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 46, -14, 73, 36, 42, 43, 45, 22, 85, 104, 35, 105, 50, 29, 52, 110, 61, 57, 32, 60, 57, 53, 55, 55, 50, 35, 201, 105, 201, 49, 31, 41, 65, 57, 69, 67, 66, 62, 70, 61, 32, 70, 70, 61, 69, 63, 63, 67, 60, 51, 31, 64, 27, 25, 34, 26, 33, 45, 31, 32, 48, 0, 36, 38, 46, 40, 46, 38, 24, 46, 57, 58, -4, 58, 59, 44, 56, 46, 46, 46, 58, 31, 21, 55, 29, 15, 25, 26, 34, 79, 224, 60, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 81, 61, 48, 19, 224, 75, 105, 147, 71, 34, 105, 40, 147, 86, 85, 104, 48, 50, 177, -61, 117, 50, 134, 70, 76, 34, 69, 57, 50, 63, 41, 41, 41, 41, 41, 41, 16, 57, 67, 67, 67, 67, 10, 55, 0, -10, 15, 69, 63, 63, 63, 63, 63, 127, 63, 64, 64, 64, 64, 26, 63, 57, 38, 38, 38, 38, 38, 38, 40, 40, 38, 38, 38, 38, -3, 42, -7, -14, 46, 56, 46, 46, 46, 46, 46, 104, 46, 55, 55, 55, 55, 26, 46, 26 }, 1, 3, true, }, { "UniversCondensed-BoldOblique", /* #7 */ NULL, NULL, "univers-bold-o-condensed", "Univers", "sans-serif", "oblique", "bold", "condensed", "2 11 6 3 2 2 2 3 2 4", /* Panose for entire Univers family? */ 4148, 1, 5, 3, 277, 950, 250, 688, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 406, 479, 479, 664, 627, 221, 221, 221, 479, 664, 221, 664, 221, 221, 479, 479, 479, 479, 479, 479, 479, 479, 479, 479, 221, 221, 996, 664, 996, 442, 664, 553, 535, 517, 553, 461, 442, 553, 553, 258, 479, 535, 424, 738, 572, 553, 517, 572, 517, 535, 498, 553, 517, 774, 553, 517, 461, 221, 313, 221, 498, 498, 221, 442, 442, 406, 442, 424, 313, 442, 461, 240, 240, 442, 240, 664, 461, 442, 442, 442, 332, 406, 313, 461, 442, 701, 442, 442, 369, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 479, 479, 479, 479, 498, 479, 479, 498, 406, 442, 664, 221, 498, 479, 479, 664, 313, 313, 479, 590, 479, 221, 479, 313, 406, 442, 664, 664, 664, 442, 553, 553, 553, 553, 553, 553, 774, 517, 461, 461, 461, 461, 258, 258, 258, 258, 553, 572, 553, 553, 553, 553, 553, 664, 553, 553, 553, 553, 553, 517, 517, 498, 442, 442, 442, 442, 442, 442, 664, 406, 424, 424, 424, 424, 240, 240, 240, 240, 442, 461, 442, 442, 442, 442, 442, 664, 442, 461, 461, 461, 461, 442, 442, 442 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 131, 24, 61, 41, 32, 103, 21, -77, 182, 104, -66, 105, -23, -79, 26, 137, -18, 23, 1, 30, 29, 38, 27, 19, -23, -64, 201, 105, 201, 78, 6, -43, -2, 36, -3, -5, -10, 45, -8, -12, 9, -2, -7, -9, -4, 42, -7, 42, -8, 31, 109, 47, 111, 76, -45, 117, -34, -49, 114, -68, 48, 0, 93, 5, -23, 12, 10, 11, 14, -45, -14, -16, -125, -11, -17, -20, -16, 14, -80, 8, -14, -2, 37, 18, 70, 56, -46, -25, -35, 101, 224, -78, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, 74, 2, 48, 18, 224, 108, 201, 147, 138, 38, 105, 27, 147, 223, 171, 104, 66, 89, 250, -61, 117, 57, 33, 148, 145, -20, 6, -5, 56, -36, -43, -43, -43, -43, -43, -43, -70, 36, -5, -5, -5, -5, -12, -12, -12, -12, -3, -4, 42, 42, 42, 42, 42, 143, 42, 47, 47, 47, 47, 117, -6, -15, 5, 5, 5, 5, 5, 5, 13, -21, 11, 11, 11, 11, -15, -15, -15, -15, 14, -16, 14, 14, 14, 14, 14, 104, 14, 18, 18, 18, 18, -25, -80, -25 }, 1, 4, true, }, { "CGTimes", /* #8 */ NULL, NULL, "cg times-medium-r-normal", "CG Times", "serif", "normal", "normal", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire CGTimes family? */ 4101, 1, 0, 0, 277, 910, 250, 679, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 332, 461, 498, 498, 885, 774, 332, 332, 332, 498, 885, 332, 885, 332, 332, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 332, 332, 996, 885, 996, 442, 885, 719, 627, 682, 738, 627, 590, 719, 738, 332, 387, 701, 627, 904, 738, 719, 572, 719, 664, 535, 627, 738, 719, 940, 719, 719, 646, 332, 332, 332, 498, 498, 332, 442, 498, 442, 498, 442, 332, 498, 498, 276, 276, 498, 276, 774, 498, 498, 498, 498, 369, 387, 276, 498, 498, 719, 498, 498, 442, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 332, 498, 498, 498, 498, 498, 498, 498, 498, 498, 406, 885, 332, 498, 498, 498, 885, 351, 351, 498, 553, 498, 332, 498, 351, 498, 406, 885, 885, 885, 442, 719, 719, 719, 719, 719, 719, 885, 682, 627, 627, 627, 627, 332, 332, 332, 332, 738, 738, 719, 719, 719, 719, 719, 885, 719, 738, 738, 738, 738, 719, 572, 498, 442, 442, 442, 442, 442, 442, 664, 442, 442, 442, 442, 442, 276, 276, 276, 276, 498, 498, 498, 498, 498, 498, 498, 885, 498, 498, 498, 498, 498, 498, 498, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 118, 9, 47, 146, 30, 98, 49, 19, 78, 158, 98, 165, 109, 32, 20, 118, 19, 39, 16, 29, 33, 20, 48, 33, 109, 98, 201, 159, 201, 40, 33, 17, 20, 38, 31, 27, 28, 36, 25, 26, 6, 18, 32, 26, 31, 34, 28, 36, 24, 41, 28, 28, 19, 9, 18, 26, 37, 87, 28, 19, 48, 0, 98, 30, 1, 26, 21, 25, 34, 25, 7, 37, -74, 16, 27, 15, 19, 28, -1, 32, 25, 51, 14, -4, 13, 20, 25, 8, 13, 82, 224, 69, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 66, 34, 13, 8, 224, 83, 116, 95, 113, 33, 166, 40, 95, 85, 121, 159, 45, 47, 176, 27, 65, 108, 125, 84, 99, 33, 158, 107, 122, 67, 17, 17, 17, 17, 17, 17, -1, 38, 27, 27, 27, 27, 26, 26, 26, 26, 31, 31, 34, 34, 34, 34, 34, 189, 6, 28, 28, 28, 28, 26, 28, 10, 30, 30, 30, 30, 30, 30, 55, 26, 25, 25, 25, 25, 31, 37, 28, 11, 27, 19, 28, 28, 28, 28, 28, 145, 0, -4, -4, -4, -4, 8, -1, 8 }, 2, 1, true, }, { "CGTimes-Italic", /* #9 */ NULL, NULL, "cg times-medium-i-normal", "CG Times", "serif", "italic", "normal", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire CGTimes family? */ 4101, 1, 1, 0, 277, 910, 250, 679, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 332, 479, 498, 498, 885, 774, 332, 332, 332, 498, 885, 332, 885, 332, 332, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 332, 332, 996, 885, 996, 498, 885, 608, 608, 664, 719, 608, 572, 719, 719, 332, 442, 664, 553, 830, 664, 719, 608, 719, 608, 498, 553, 719, 608, 830, 608, 553, 553, 332, 332, 332, 498, 498, 332, 498, 498, 442, 498, 442, 276, 498, 498, 276, 276, 442, 276, 719, 498, 498, 498, 498, 387, 387, 276, 498, 442, 664, 442, 442, 387, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 332, 498, 498, 498, 498, 498, 498, 498, 498, 498, 461, 885, 332, 498, 498, 498, 885, 351, 351, 498, 553, 498, 332, 498, 351, 498, 461, 885, 885, 885, 498, 608, 608, 608, 608, 608, 608, 885, 664, 608, 608, 608, 608, 332, 332, 332, 332, 719, 664, 719, 719, 719, 719, 719, 885, 719, 719, 719, 719, 719, 553, 608, 498, 498, 498, 498, 498, 498, 498, 664, 442, 442, 442, 442, 442, 276, 276, 276, 276, 498, 498, 498, 498, 498, 498, 498, 885, 498, 498, 498, 498, 498, 442, 498, 442 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 194, 53, 31, 166, 62, 186, 128, -29, 110, 164, 25, 165, 74, 20, 41, 43, 28, 25, 26, 12, 44, 106, 38, 33, 73, 25, 201, 171, 201, 158, 59, -53, -15, 83, -37, -19, -16, 73, -11, -15, -18, -4, -44, -25, -10, 68, 8, 63, -23, 27, 53, 112, 94, 81, -29, 91, -15, -10, 134, -89, 48, 0, 186, 11, 10, 38, 9, 33, -160, 1, 4, 34, -147, -4, 39, 8, 10, 22, -101, 25, 34, 7, 24, 32, 35, 23, -49, -46, -19, 114, 224, -35, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 79, -25, 13, 50, 224, 102, 202, 95, 119, 37, 166, 44, 95, 211, 184, 162, 71, 79, 254, 27, 65, 141, 53, 97, 150, 31, 143, 111, 163, 28, -53, -53, -53, -53, -53, -53, -24, 83, -19, -19, -19, -19, -15, -15, -15, -15, -37, -10, 68, 68, 68, 68, 68, 188, 41, 112, 112, 112, 112, 91, 8, -171, 11, 11, 11, 11, 11, 11, 21, 26, 33, 33, 33, 33, 34, 34, 34, 34, 22, 10, 22, 22, 22, 22, 22, 162, -5, 32, 32, 32, 32, -46, -101, -46 }, 2, 2, true, }, { "CGTimes-Bold", /* #10 */ NULL, NULL, "cg times-bold-r-normal", "CG Times", "serif", "normal", "bold", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire CGTimes family? */ 4101, 1, 0, 3, 277, 944, 250, 685, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 332, 461, 498, 498, 885, 830, 332, 332, 332, 498, 885, 332, 885, 332, 332, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 332, 332, 996, 885, 996, 498, 885, 719, 664, 719, 719, 664, 608, 774, 774, 387, 479, 774, 664, 940, 719, 774, 608, 774, 719, 553, 664, 719, 719, 996, 719, 719, 664, 332, 332, 332, 498, 498, 332, 498, 553, 442, 553, 442, 351, 498, 553, 276, 332, 553, 276, 830, 553, 498, 553, 553, 442, 387, 332, 553, 498, 719, 498, 498, 442, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 332, 498, 498, 498, 498, 498, 498, 498, 498, 498, 424, 885, 332, 498, 498, 498, 885, 351, 351, 498, 553, 498, 332, 498, 351, 498, 424, 885, 885, 885, 498, 719, 719, 719, 719, 719, 719, 1033, 719, 664, 664, 664, 664, 387, 387, 387, 387, 719, 719, 774, 774, 774, 774, 774, 885, 774, 719, 719, 719, 719, 719, 608, 553, 498, 498, 498, 498, 498, 498, 719, 442, 442, 442, 442, 442, 276, 276, 276, 276, 498, 553, 498, 498, 498, 498, 498, 885, 498, 553, 553, 553, 553, 498, 553, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 76, 12, 34, 76, 59, 73, 66, 10, 56, 122, 73, 153, 83, 31, 23, 64, 6, 11, 21, 21, 25, 21, 24, 24, 83, 73, 201, 152, 201, 57, 22, 20, 18, 38, 15, 14, 20, 40, 15, 22, -12, 28, 22, 13, 13, 31, 18, 32, 14, 45, 29, 7, 12, 13, 17, 19, 21, 73, 21, 8, 48, 0, 73, 24, 16, 21, 39, 26, 29, 30, 16, 19, -76, 20, 20, 14, 17, 24, 30, 37, 22, 27, 7, 16, 12, 13, 12, 12, 15, 71, 224, 59, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 57, 6, 48, -17, 224, 72, 87, 95, 87, 31, 147, 31, 95, 94, 108, 143, 26, 27, 186, 21, 65, 81, 118, 56, 94, 31, 83, 74, 61, 57, 20, 20, 20, 20, 20, 20, 21, 38, 14, 14, 14, 14, 22, 22, 22, 22, 15, 13, 31, 31, 31, 31, 31, 167, 32, 7, 7, 7, 7, 19, 18, 30, 24, 24, 24, 24, 24, 24, 34, 21, 26, 26, 26, 26, 16, 19, -2, -26, 24, 17, 24, 24, 24, 24, 24, 153, 24, 16, 16, 16, 16, 12, 30, 12 }, 2, 3, true, }, { "CGTimes-BoldItalic", /* #11 */ NULL, NULL, "cg times-bold-i-normal", "CG Times", "serif", "italic", "bold", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire CGTimes family? */ 4101, 1, 1, 3, 277, 944, 250, 685, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 387, 517, 498, 498, 885, 774, 332, 332, 332, 498, 885, 332, 885, 332, 332, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 332, 332, 996, 885, 996, 498, 885, 664, 664, 664, 719, 664, 608, 719, 774, 387, 498, 664, 608, 885, 719, 719, 608, 701, 664, 553, 608, 719, 664, 885, 664, 608, 608, 332, 332, 332, 498, 498, 332, 498, 498, 442, 498, 442, 351, 498, 553, 276, 276, 498, 276, 774, 553, 498, 498, 498, 387, 387, 276, 553, 442, 664, 498, 442, 387, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 387, 498, 498, 498, 498, 498, 498, 498, 498, 498, 442, 885, 332, 498, 498, 498, 885, 332, 332, 498, 553, 498, 332, 498, 332, 498, 442, 885, 885, 885, 498, 664, 664, 664, 664, 664, 664, 922, 664, 664, 664, 664, 664, 387, 387, 387, 387, 719, 719, 719, 719, 719, 719, 719, 885, 719, 719, 719, 719, 719, 608, 608, 498, 498, 498, 498, 498, 498, 498, 701, 442, 442, 442, 442, 442, 276, 276, 276, 276, 498, 553, 498, 498, 498, 498, 498, 885, 498, 553, 553, 553, 553, 442, 498, 442 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 169, 40, 10, 107, 46, 156, 62, -23, 119, 167, -8, 175, 45, 4, 47, 21, -4, 7, -2, 17, 50, 86, 41, 23, 47, -9, 201, 175, 201, 124, 42, -42, 5, 65, -11, -4, -8, 50, 1, -1, -6, 0, -19, -1, 3, 57, 3, 56, 5, 29, 86, 105, 102, 100, -10, 98, 17, -28, 134, -95, 48, 0, 156, 9, 14, 34, 9, 35, -135, -25, 6, 20, -168, 4, 18, 8, 14, 23, -98, 24, 12, 16, 10, 40, 44, 47, -20, -71, -20, 86, 224, -38, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 75, -6, 48, 19, 224, 72, 162, 95, 141, 28, 174, 34, 95, 160, 163, 160, 58, 71, 242, 21, 65, 123, 29, 68, 137, 7, 110, 100, 123, -16, -42, -42, -42, -42, -42, -42, -39, 65, -4, -4, -4, -4, -1, -1, -1, -1, -11, 3, 57, 57, 57, 57, 57, 190, -29, 105, 105, 105, 105, 98, 3, -173, 9, 9, 9, 9, 9, 9, 9, 1, 35, 35, 35, 35, 22, 22, 22, 22, 23, 14, 23, 23, 23, 23, 23, 176, -36, 40, 40, 40, 40, -71, -98, -71 }, 2, 4, true, }, { "AlbertusMedium", /* #12 */ NULL, NULL, "albertus-semibold-r-normal", "Albertus", "serif", "normal", "600", "normal", "2 14 6 2 3 3 4 2 3 4", /* Panose for AlbertusMedium font */ 4362, 1, 0, 1, 277, 997, 250, 764, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 313, 313, 498, 627, 627, 940, 867, 313, 406, 406, 627, 940, 313, 940, 313, 442, 627, 627, 627, 627, 627, 627, 627, 627, 627, 627, 313, 313, 996, 940, 996, 461, 940, 793, 572, 682, 701, 553, 517, 774, 756, 313, 406, 682, 535, 922, 812, 867, 517, 867, 627, 517, 627, 793, 774, 940, 682, 646, 608, 424, 442, 424, 498, 498, 313, 461, 535, 461, 553, 479, 313, 479, 535, 240, 240, 479, 240, 830, 535, 553, 553, 535, 369, 351, 332, 535, 479, 701, 479, 498, 387, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 313, 313, 627, 627, 627, 627, 498, 627, 627, 498, 387, 461, 940, 313, 498, 627, 517, 940, 387, 387, 627, 553, 627, 313, 627, 387, 387, 461, 940, 940, 940, 461, 793, 793, 793, 793, 793, 793, 977, 682, 553, 553, 553, 553, 313, 313, 313, 313, 756, 812, 867, 867, 867, 867, 867, 940, 867, 793, 793, 793, 793, 646, 517, 590, 461, 461, 461, 461, 461, 461, 738, 461, 479, 479, 479, 479, 240, 240, 240, 240, 553, 535, 553, 553, 553, 553, 553, 940, 553, 535, 535, 535, 535, 498, 553, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 90, 14, 96, 49, 42, 53, 96, 72, 114, 179, 14, 181, 75, 9, 27, 155, 34, 83, 76, 83, 46, 92, 76, 54, 75, 14, 201, 179, 201, 62, 50, -1, 70, 44, 68, 81, 69, 42, 74, 74, 3, 65, 70, 20, 21, 44, 41, 45, 79, 67, 22, 69, 17, 9, 11, 14, 34, 92, 9, 67, 48, 0, 39, 32, 43, 34, 47, 37, 45, 41, 45, 49, -11, 46, 48, 42, 49, 30, 52, 31, 51, 22, 7, 40, 2, 1, -6, -7, 10, 97, 224, 71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 115, 78, 77, 2, 224, 92, 164, 147, 56, 27, 177, 42, 147, 165, 81, 179, 22, 43, 268, -61, 117, 74, 206, 90, 18, 24, 121, 102, 99, 62, -1, -1, -1, -1, -1, -1, -6, 44, 81, 81, 81, 81, 39, 74, 21, 8, 56, 21, 44, 44, 44, 44, 44, 162, 44, 69, 69, 69, 69, 14, 41, 75, 32, 32, 32, 32, 32, 32, 31, 34, 37, 37, 37, 37, 15, 48, -20, -30, 27, 49, 30, 30, 30, 30, 30, 177, 30, 40, 40, 40, 40, -7, 52, -7 }, 3, 1, true, }, { "AlbertusExtraBold", /* #13 */ NULL, NULL, "albertus-extrabold-r-normal", "Albertus", "serif", "normal", "800", "normal", "2 14 8 2 4 3 4 2 2 4", /* Panose for AlbertusExtraBold font */ 4362, 1, 0, 4, 277, 1017, 260, 764, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 369, 369, 572, 664, 664, 977, 904, 369, 498, 498, 664, 977, 369, 977, 369, 498, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 369, 369, 996, 977, 996, 479, 977, 774, 701, 719, 774, 608, 572, 774, 812, 387, 442, 738, 572, 977, 848, 904, 646, 904, 701, 535, 627, 812, 756, 977, 756, 664, 664, 498, 498, 498, 498, 498, 369, 498, 608, 479, 590, 517, 369, 553, 590, 295, 295, 627, 295, 885, 590, 608, 590, 590, 424, 424, 406, 590, 553, 793, 627, 553, 461, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 369, 369, 664, 664, 664, 664, 498, 664, 664, 498, 461, 517, 977, 369, 498, 664, 553, 977, 461, 461, 664, 590, 664, 369, 664, 461, 461, 517, 977, 977, 977, 479, 774, 774, 774, 774, 774, 774, 1014, 719, 608, 608, 608, 608, 387, 387, 387, 387, 812, 848, 904, 904, 904, 904, 904, 977, 904, 812, 812, 812, 812, 664, 646, 646, 498, 498, 498, 498, 498, 498, 756, 479, 517, 517, 517, 517, 295, 295, 295, 295, 608, 590, 608, 608, 608, 608, 608, 977, 608, 590, 590, 590, 590, 553, 590, 553 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 81, 29, 57, 25, 38, 28, 76, 76, 128, 198, -9, 196, 76, 7, 30, 131, 25, 60, 49, 58, 60, 67, 64, 58, 76, -9, 201, 197, 201, 51, 35, -26, 62, 43, 70, 67, 74, 46, 64, 68, -35, 59, 67, -10, -4, 41, 67, 39, 60, 54, -9, 61, -24, -11, -13, -22, 24, 80, 7, 80, 48, 0, 53, 10, 39, 28, 24, 27, -6, 27, 30, 29, -44, 32, 28, 28, 29, 23, 31, 20, 31, 27, -4, 25, -27, -26, -10, -36, 0, 79, 224, 60, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 66, 55, 48, 10, 224, 78, 132, 147, 73, 17, 199, 42, 147, 133, 94, 198, 34, 56, 255, -61, 117, 76, 245, 89, 31, 17, 66, 42, 49, 51, -26, -26, -26, -26, -26, -26, -18, 43, 67, 67, 67, 67, 27, 68, 13, -6, 49, -4, 41, 41, 41, 41, 41, 202, 41, 61, 61, 61, 61, -22, 67, 33, 10, 10, 10, 10, 10, 10, 14, 28, 27, 27, 27, 27, -20, 29, -40, -54, 23, 29, 23, 23, 23, 23, 23, 198, 23, 25, 25, 25, 25, -36, 31, -36 }, 3, 3, true, }, { "AntiqueOlive", /* #14 */ NULL, NULL, "antique olive-medium-r-normal", "Antique Olive", "sans-serif", "normal", "normal", "normal", "0 0 0 0 0 0 0 0 0 0", /* no Panose known */ 4168, 1, 0, 0, 277, 1038, 250, 750, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 313, 424, 590, 590, 1014, 719, 258, 295, 295, 590, 1014, 295, 1014, 295, 313, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 295, 295, 996, 1014, 996, 572, 1014, 701, 664, 608, 701, 590, 572, 682, 738, 276, 461, 627, 517, 885, 738, 719, 627, 719, 627, 535, 572, 719, 627, 977, 627, 627, 608, 295, 313, 295, 498, 498, 258, 572, 701, 553, 701, 627, 442, 664, 682, 295, 295, 572, 276, 1033, 682, 682, 701, 701, 461, 461, 461, 664, 590, 904, 553, 590, 517, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 313, 590, 590, 590, 590, 498, 590, 590, 498, 590, 535, 1014, 295, 498, 590, 590, 1014, 387, 387, 590, 553, 590, 295, 590, 387, 590, 535, 1014, 1014, 1014, 572, 701, 701, 701, 701, 701, 701, 1162, 608, 590, 590, 590, 590, 276, 276, 276, 276, 701, 738, 719, 719, 719, 719, 719, 1014, 719, 719, 719, 719, 719, 627, 627, 627, 572, 572, 572, 572, 572, 572, 996, 553, 627, 627, 627, 627, 295, 295, 295, 295, 682, 682, 682, 682, 682, 682, 682, 1014, 682, 664, 664, 664, 664, 590, 701, 590 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 73, 91, 64, 76, 114, 66, 64, 11, 130, 211, 63, 207, 80, -4, 33, 67, 57, 70, 35, 85, 55, 53, 41, 50, 80, 64, 201, 209, 201, 69, 87, 20, 74, 41, 77, 74, 86, 50, 89, 84, 14, 96, 101, 80, 78, 45, 90, 47, 76, 40, 21, 85, 4, 0, 8, -5, 59, 83, -4, 43, 48, 0, 94, 32, 87, 53, 70, 57, 37, 44, 91, 77, -42, 83, 94, 85, 91, 57, 95, 69, 84, 35, 29, 82, 17, 15, 11, 16, 41, 97, 224, 71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 61, 71, 77, 51, 224, 121, 140, 147, 133, 53, 211, 36, 147, 164, 116, 206, 47, 49, 223, -61, 117, 80, 193, 56, 106, 39, 43, 36, 69, 69, 20, 20, 20, 20, 20, 20, 8, 41, 74, 74, 74, 74, -32, 0, -14, -18, 25, 78, 45, 45, 45, 45, 45, 206, 36, 85, 85, 85, 85, -5, 91, 83, 32, 32, 32, 32, 32, 32, 48, 53, 57, 57, 57, 57, -19, 20, -6, -12, 55, 91, 57, 57, 57, 57, 57, 207, 42, 82, 82, 82, 82, 16, 95, 16 }, 4, 1, true, }, { "AntiqueOlive-Italic", /* #15 */ NULL, NULL, "antique olive-medium-i-normal", "Antique Olive", "sans-serif", "oblique", "normal", "normal", "0 0 0 0 0 0 0 0 0 0", /* no Panose known */ 4168, 1, 1, 0, 277, 1035, 250, 750, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 295, 442, 590, 590, 996, 664, 295, 295, 295, 590, 996, 295, 996, 295, 295, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 295, 295, 996, 996, 996, 535, 996, 682, 627, 608, 719, 590, 572, 682, 738, 258, 461, 608, 479, 867, 738, 719, 627, 719, 608, 553, 553, 701, 646, 959, 627, 627, 608, 295, 295, 295, 498, 498, 295, 608, 682, 572, 682, 627, 424, 682, 682, 258, 276, 553, 258, 1014, 682, 664, 682, 682, 424, 479, 461, 682, 608, 922, 572, 590, 517, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 295, 295, 590, 590, 590, 590, 498, 590, 590, 498, 590, 517, 996, 295, 498, 590, 590, 996, 387, 387, 590, 553, 590, 295, 590, 387, 590, 517, 996, 996, 996, 535, 682, 682, 682, 682, 682, 682, 1069, 608, 590, 590, 590, 590, 258, 258, 258, 258, 719, 738, 719, 719, 719, 719, 719, 996, 719, 701, 701, 701, 701, 627, 627, 608, 608, 608, 608, 608, 608, 608, 977, 572, 627, 627, 627, 627, 258, 258, 258, 258, 664, 682, 664, 664, 664, 664, 664, 996, 664, 682, 682, 682, 682, 590, 682, 590 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 143, 85, 40, 116, 35, 120, 60, -44, 160, 198, -32, 198, 23, -68, 33, 83, 7, 26, 9, 33, 50, 58, 23, 19, 23, -33, 201, 199, 201, 100, 87, -44, 21, 51, 25, 17, 19, 55, 29, 15, -32, 22, 21, 22, 22, 51, 23, 59, 21, 16, 81, 67, 103, 101, -42, 99, -1, 23, 113, -26, 48, 0, 120, 26, 22, 45, 42, 50, 46, 46, 28, 15, -127, 22, 16, 21, 28, 51, -5, 42, 19, 10, 70, 59, 73, 77, -32, 64, -8, 116, 224, -71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 70, 11, 77, 88, 224, 123, 227, 147, 151, 51, 199, 32, 147, 250, 154, 198, 58, 57, 288, -61, 117, 94, 127, 68, 143, -18, 116, 131, 118, -12, -44, -44, -44, -44, -44, -44, -59, 51, 17, 17, 17, 17, 15, 15, 15, 15, 24, 22, 51, 51, 51, 51, 51, 200, -23, 67, 67, 67, 67, 99, 21, 21, 26, 26, 26, 26, 26, 26, 20, 45, 50, 50, 50, 50, 15, 15, 15, 15, 51, 28, 51, 51, 51, 51, 51, 197, -12, 59, 59, 59, 59, 64, -5, 64 }, 4, 2, true, }, { "AntiqueOlive-Bold", /* #16 */ NULL, NULL, "antique olive-bold-r-normal", "Antique Olive", "sans-serif", "normal", "bold", "normal", "0 0 0 0 0 0 0 0 0 0", /* no Panose known */ 4168, 1, 0, 3, 277, 1055, 250, 750, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 369, 461, 664, 664, 1143, 812, 258, 332, 332, 664, 1143, 332, 1143, 332, 406, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 332, 332, 996, 1143, 996, 608, 1143, 756, 682, 646, 738, 608, 608, 701, 738, 313, 517, 701, 553, 922, 756, 756, 701, 756, 682, 590, 646, 719, 719, 1033, 719, 719, 664, 332, 406, 332, 498, 498, 258, 646, 719, 590, 719, 664, 517, 719, 719, 332, 332, 646, 313, 1051, 719, 701, 719, 719, 517, 553, 535, 701, 664, 996, 664, 664, 572, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, 369, 664, 664, 664, 664, 498, 664, 664, 498, 553, 590, 1143, 332, 498, 664, 664, 1143, 442, 442, 664, 590, 664, 332, 664, 442, 553, 590, 1143, 1143, 1143, 608, 756, 756, 756, 756, 756, 756, 1143, 646, 608, 608, 608, 608, 313, 313, 313, 313, 738, 756, 756, 756, 756, 756, 756, 1143, 756, 719, 719, 719, 719, 719, 701, 701, 646, 646, 646, 646, 646, 646, 1033, 590, 664, 664, 664, 664, 332, 332, 332, 332, 701, 719, 701, 701, 701, 701, 701, 1143, 701, 701, 701, 701, 701, 664, 719, 664 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 55, 98, 60, 119, 82, 32, 33, 38, 144, 267, 68, 265, 53, 8, 29, 68, 64, 74, 42, 76, 53, 72, 25, 48, 53, 53, 201, 267, 201, 77, 119, 12, 56, 43, 67, 56, 71, 36, 66, 64, 30, 74, 70, 49, 58, 39, 63, 39, 63, 34, 38, 63, 15, 12, 21, 12, 47, 55, 8, 50, 48, 0, 54, 35, 62, 37, 42, 40, 31, 34, 66, 49, -21, 67, 59, 61, 64, 40, 60, 42, 62, 39, 20, 53, 10, 16, 12, 11, 36, 68, 224, 59, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 73, 66, 69, 24, 224, 112, 188, 147, 123, 27, 267, 32, 147, 140, 131, 267, 64, 63, 232, -61, 109, 56, 232, 63, 105, 27, 71, 74, 83, 55, 12, 12, 12, 12, 12, 12, 13, 43, 56, 56, 56, 56, -21, 0, -10, -5, 9, 58, 39, 39, 39, 39, 39, 274, 3, 63, 63, 63, 63, 12, 63, 72, 35, 35, 35, 35, 35, 35, 34, 37, 40, 40, 40, 40, -7, 23, -2, 5, 41, 64, 40, 40, 40, 40, 40, 266, -14, 53, 53, 53, 53, 11, 60, 11 }, 4, 3, true, }, { "Arial-Roman", /* #17 */ NULL, NULL, "arial-medium-r-normal", "Arial", "sans-serif", "normal", "normal", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Arial font? */ 16602, 1, 0, 0, 277, 913, 216, 715, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 278, 355, 556, 556, 889, 667, 222, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 222, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 45, 11, 36, 61, 41, 63, 72, 37, 31, 56, 83, 56, 88, 0, 43, 109, 30, 42, 13, 42, 38, 47, 42, 42, 88, 83, 55, 56, 55, 46, 55, -1, 73, 51, 77, 78, 82, 55, 79, 93, 28, 74, 73, 70, 74, 48, 78, 44, 79, 45, 23, 79, 4, 12, 4, 3, 20, 79, 0, 16, 27, -15, 63, 37, 65, 40, 34, 38, 12, 36, 66, 66, -46, 66, 67, 66, 66, 34, 66, 35, 65, 31, 8, 63, 13, 2, 7, 16, 20, 33, 92, 28, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 53, 14, 37, -2, 92, 38, 31, 1, 23, 69, 56, 32, 3, 22, 63, 39, 12, 16, 128, 78, 0, 88, 60, 52, 22, 68, 44, 30, 39, 79, -1, -1, -1, -1, -1, -1, 0, 51, 78, 78, 78, 78, 32, 69, -21, -4, -1, 74, 48, 48, 48, 48, 48, 79, 42, 79, 79, 79, 79, 3, 77, 75, 37, 37, 37, 37, 37, 37, 37, 40, 38, 38, 38, 38, 36, 64, -16, -6, 37, 66, 34, 34, 34, 34, 34, 38, 62, 63, 63, 63, 63, 16, 66, 16 }, 5, 1, true, }, { "Arial-Italic", /* #18 */ NULL, NULL, "arial-medium-i-normal", "Arial", "sans-serif", "oblique", "normal", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Arial font? */ 16602, 1, 1, 0, 277, 913, 213, 715, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 278, 355, 556, 556, 889, 667, 222, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 222, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 134, 34, 51, 107, 78, 129, 83, -54, 104, 90, 24, 93, 58, -51, 70, 148, 59, 56, 45, 69, 83, 126, 75, 66, 57, 24, 72, 90, 103, 128, 89, -20, 43, 91, 44, 45, 45, 99, 42, 58, 33, 44, 40, 44, 49, 83, 43, 83, 47, 70, 125, 99, 124, 114, -32, 117, 24, 7, 85, -58, 66, -39, 129, 44, 34, 57, 53, 52, 45, 26, 33, 30, -122, 34, 26, 33, 33, 49, -10, 51, 33, 40, 57, 62, 79, 78, -1, 0, 20, 52, 136, -84, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 76, 33, 75, 37, 136, 28, 111, 22, 75, 79, 90, 46, 22, 108, 128, 50, 65, 81, 202, 3, 69, 114, 19, 132, 69, 50, 71, 32, 94, 71, -20, -20, -20, -20, -20, -20, -40, 91, 45, 45, 45, 45, 58, 58, 58, 58, 41, 49, 83, 83, 83, 83, 83, 112, 84, 99, 99, 99, 99, 117, 43, 37, 44, 44, 44, 44, 44, 44, 42, 57, 52, 52, 52, 52, 61, 61, 61, 61, 50, 33, 49, 49, 49, 49, 49, 73, 85, 62, 62, 62, 62, 0, -10, 0 }, 5, 2, true, }, { "Arial-Bold", /* #19 */ NULL, NULL, "arial-bold-r-normal", "Arial", "sans-serif", "normal", "bold", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Arial font? */ 16602, 1, 0, 3, 277, 924, 211, 715, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 474, 556, 556, 889, 722, 278, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 278, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 55, 9, 35, 53, 44, 75, 54, 35, 13, 42, 57, 42, 72, -1, 45, 81, 25, 32, 19, 33, 44, 42, 40, 34, 99, 83, 46, 42, 46, 54, 28, 0, 74, 48, 73, 73, 74, 49, 74, 69, 17, 76, 77, 58, 70, 45, 73, 44, 74, 36, 22, 72, 0, 7, 0, -1, 15, 71, -1, 19, 54, -9, 75, 34, 66, 44, 42, 35, 15, 42, 71, 72, -45, 67, 72, 62, 71, 40, 68, 43, 66, 29, 7, 69, 5, 4, 6, 7, 17, 34, 86, 23, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 30, 6, 20, 2, 86, 37, 10, -4, 18, 45, 42, 33, -3, 20, 42, 24, 12, 20, 116, 54, -1, 72, 18, 46, 14, 45, 58, 27, 42, 51, 0, 0, 0, 0, 0, -1, -41, 48, 73, 73, 73, 73, 10, 62, -22, -26, 0, 70, 45, 45, 45, 45, 45, 54, 32, 72, 72, 72, 72, -1, 73, 68, 34, 34, 34, 34, 34, 34, 36, 44, 35, 35, 35, 35, 3, 60, -18, -20, 43, 71, 40, 40, 40, 40, 40, 24, 42, 69, 69, 69, 69, 7, 68, 7 }, 5, 3, true, }, { "Arial-BoldItalic", /* #20 */ NULL, NULL, "arial-bold-i-normal", "Arial", "sans-serif", "oblique", "bold", "normal", "2 11 6 4 2 2 2 2 2 4", /* Panose for entire Arial font? */ 16602, 1, 1, 3, 277, 924, 221, 715, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 474, 556, 556, 889, 722, 278, 333, 333, 389, 584, 278, 584, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 278, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 129, 28, 44, 105, 84, 125, 64, -80, 67, 78, 11, 78, 44, -43, 64, 119, 61, 42, 27, 63, 80, 104, 66, 51, 70, 48, 65, 78, 85, 124, 47, -11, 41, 94, 43, 41, 39, 86, 43, 35, 18, 40, 45, 41, 45, 81, 41, 78, 44, 63, 109, 91, 91, 118, -42, 104, 25, 12, 78, -57, 90, -9, 111, 45, 37, 61, 59, 57, 54, 31, 42, 40, -109, 38, 39, 36, 42, 63, -18, 60, 32, 22, 75, 65, 63, 72, -22, 6, 17, 41, 131, -86, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 57, 22, 43, 24, 131, 19, 91, 20, 81, 65, 72, 39, 21, 105, 111, 67, 78, 73, 219, -20, 61, 80, -6, 112, 70, 20, 85, 57, 112, 28, -11, -11, -11, -11, -11, -11, -32, 94, 41, 41, 41, 41, 35, 35, 35, 35, 37, 45, 81, 81, 81, 81, 81, 90, 78, 91, 91, 91, 91, 104, 41, 35, 45, 45, 45, 45, 45, 45, 45, 61, 57, 57, 57, 57, 40, 40, 40, 40, 61, 42, 63, 63, 63, 63, 63, 61, 55, 65, 65, 65, 65, 6, -5, 6 }, 5, 4, true, }, { "ClarendonCondensed", /* #21 */ NULL, NULL, "clarendon-medium-r-condensed", "Clarendon", "serif", "normal", "normal", "condensed", "2 4 7 6 4 7 5 4 2 4", /* Panose for ClarendonCondensed font */ 4140, 1, 4, 3, 277, 970, 261, 694, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 240, 442, 442, 442, 664, 627, 221, 221, 221, 442, 664, 221, 664, 221, 221, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 221, 221, 996, 664, 996, 442, 996, 517, 517, 479, 517, 517, 498, 517, 572, 295, 424, 553, 461, 682, 553, 517, 498, 535, 572, 461, 517, 498, 535, 738, 517, 498, 461, 221, 221, 221, 498, 498, 221, 517, 479, 424, 479, 442, 332, 517, 498, 258, 313, 498, 258, 738, 498, 461, 479, 479, 369, 424, 313, 498, 442, 664, 461, 461, 387, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 240, 442, 442, 664, 442, 498, 442, 442, 498, 442, 461, 664, 221, 498, 442, 442, 664, 295, 295, 442, 553, 461, 221, 442, 295, 442, 461, 664, 664, 664, 442, 517, 517, 517, 517, 517, 517, 867, 479, 517, 517, 517, 517, 295, 295, 295, 295, 517, 553, 517, 517, 517, 517, 517, 664, 517, 498, 498, 498, 498, 498, 498, 498, 517, 517, 517, 517, 517, 517, 682, 424, 442, 442, 442, 442, 258, 258, 258, 258, 461, 498, 461, 461, 461, 461, 461, 664, 461, 498, 498, 498, 498, 461, 479, 461 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 91, 15, 24, 63, 32, 28, -3, -5, 13, 54, 28, 54, 33, 16, 29, 91, 13, 21, 7, 22, 21, 15, 8, 21, 34, 29, 201, 54, 201, 36, 67, 7, 24, 53, 24, 26, 21, 46, 23, 25, 17, 11, 23, 18, 27, 48, 24, 48, 21, 39, 22, 9, 29, 14, 16, 10, 15, 17, 16, 18, 48, 0, 39, 33, 20, 33, 42, 42, 45, 21, 21, 17, -35, 12, 23, 17, 16, 40, 22, 37, 21, 36, 17, 15, 11, 2, 15, 13, 15, 71, 224, 59, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 39, 8, 48, 5, 224, 15, 65, 95, 36, 73, 28, 30, 95, 107, 73, 54, 24, 24, 139, 21, 65, 33, 109, 62, 46, 60, 28, 16, 27, 36, 7, 7, 7, 7, 7, 7, 12, 53, 26, 26, 26, 26, 25, 25, -4, -19, 24, 27, 48, 48, 48, 48, 48, 44, -1, 9, 9, 9, 9, 10, 24, 21, 33, 33, 33, 33, 33, 33, 25, 33, 42, 42, 42, 42, 17, 17, -30, -35, 40, 16, 40, 40, 40, 40, 40, 54, 40, 15, 15, 15, 15, 13, 22, 13 }, 6, 1, true, }, { "Coronet", /* #22 */ NULL, NULL, "coronet-medium-r-normal", "Coronet", "cursive", "normal", "normal", "normal", "3 3 5 2 4 4 6 7 6 5", /* Panose for Coronet font */ 4116, 1, 1, 0, 277, 898, 257, 744, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 185, 276, 406, 406, 517, 774, 166, 203, 203, 406, 517, 203, 517, 203, 203, 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, 203, 203, 996, 517, 996, 295, 517, 885, 535, 553, 885, 572, 646, 572, 904, 572, 498, 885, 682, 830, 590, 682, 535, 682, 572, 664, 590, 627, 627, 904, 572, 608, 682, 203, 203, 203, 498, 498, 166, 332, 313, 258, 332, 258, 221, 313, 332, 185, 166, 313, 203, 461, 313, 276, 313, 332, 221, 221, 185, 332, 258, 406, 221, 295, 221, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 185, 406, 406, 406, 406, 498, 406, 406, 498, 313, 276, 517, 203, 498, 406, 406, 517, 240, 240, 406, 553, 406, 203, 406, 240, 313, 276, 517, 517, 517, 295, 885, 885, 885, 885, 885, 885, 922, 553, 572, 572, 572, 572, 572, 572, 572, 572, 885, 590, 682, 682, 682, 682, 682, 517, 682, 627, 627, 627, 627, 608, 535, 351, 332, 332, 332, 332, 332, 332, 424, 258, 258, 258, 258, 258, 185, 185, 185, 185, 332, 313, 276, 276, 276, 276, 276, 517, 276, 332, 332, 332, 332, 295, 313, 295 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 256, 216, 125, 223, 176, 280, 131, 8, 379, 249, 105, 226, 155, 69, 162, 233, 149, 123, 128, 104, 155, 210, 154, 176, 155, 104, 201, 250, 201, 179, 158, 96, 112, 163, 146, 137, 164, 160, 101, 95, 58, 96, 107, 232, 223, 185, 78, 185, 100, 109, 164, 236, 244, 242, 89, 215, 98, 52, 208, 18, 48, 0, 280, 129, 137, 126, 125, 124, 51, 105, 124, 138, -12, 126, 139, 128, 127, 123, 50, 126, 125, 113, 133, 145, 134, 133, 88, 131, 100, 245, 224, 74, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 230, 93, 156, -20, 224, 138, 279, 95, 165, 133, 252, 120, 95, 297, 290, 224, 189, 172, 328, 27, 239, 197, 196, 238, 197, 76, 191, 192, 150, 51, 96, 96, 96, 96, 96, 96, 38, 163, 137, 137, 137, 137, 95, 95, 95, 95, 148, 223, 185, 185, 185, 185, 185, 247, 104, 236, 236, 236, 236, 215, 78, 55, 129, 129, 129, 129, 129, 129, 128, 112, 124, 124, 124, 124, 139, 139, 118, 139, 149, 127, 123, 123, 123, 123, 123, 246, 94, 145, 145, 145, 145, 131, 50, 131 }, 7, 1, true, }, { "Courier", /* #23 */ NULL, NULL, "courier-medium-r-normal", "Courier", "monospace", "normal", "normal", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 4099, 0, 0, 0, 277, 856, 253, 560, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 500, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 239, 165, 81, 118, 101, 105, 188, 295, 148, 113, 115, 184, 112, 231, 98, 120, 113, 86, 93, 74, 98, 109, 46, 112, 89, 231, 193, 152, 36, 124, 129, 38, 16, 50, 73, 38, 64, 80, 43, 43, 105, 54, 67, 58, 17, 26, 51, 86, 50, 52, 73, 48, 31, 17, 12, 34, 40, 89, 318, 98, 120, 187, -20, 188, 58, 22, 80, 61, 80, 95, 52, 33, 107, 75, 44, 107, 14, 39, 60, 25, 58, 81, 104, 75, 32, 24, 19, 29, 29, 110, 243, 281, 145, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 115, 91, 83, 35, 224, 129, 382, 66, 160, 91, 112, 181, 66, 278, 150, 115, 172, 171, 375, 39, 98, 236, 449, 185, 164, 91, 34, 27, 33, 129, 16, 16, 16, 16, 16, 16, 22, 72, 64, 64, 64, 64, 106, 106, 106, 106, 38, 26, 51, 51, 51, 51, 51, 143, 50, 31, 31, 31, 31, 40, 79, 62, 58, 58, 58, 58, 58, 58, 36, 80, 80, 80, 80, 80, 107, 107, 107, 107, 60, 39, 60, 60, 60, 60, 60, 112, 61, 32, 32, 32, 32, 29, 25, 29 }, 8, 1, true, }, { "Courier-Italic", /* #24 */ #ifndef USE_PS_FONTS_IN_PCL "Courier-Oblique", /* treat name of similar PS font as alias */ #else NULL, #endif NULL, "courier-medium-o-normal", "Courier", "monospace", "oblique", "normal", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 4099, 0, 1, 0, 277, 856, 253, 560, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 500, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 233, 116, 121, 147, 129, 256, 344, 134, 199, 169, 166, 170, 243, 84, 165, 116, 86, 100, 105, 104, 149, 167, 142, 87, 243, 172, 195, 99, 190, 215, 90, 16, 51, 122, 38, 64, 77, 95, 47, 104, 73, 67, 64, 17, 31, 101, 87, 98, 51, 79, 115, 139, 123, 122, 38, 145, 89, 298, 235, 104, 243, -19, 256, 85, 30, 118, 101, 119, 102, 67, 44, 107, 45, 57, 102, 13, 37, 101, -7, 95, 79, 103, 195, 114, 104, 97, 33, 4, 110, 259, 330, 187, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 272, 171, 143, 140, 147, 278, 126, 489, 183, 221, 138, 170, 238, 183, 390, 252, 112, 223, 227, 476, 91, 182, 300, 422, 242, 222, 107, 28, 21, 29, 158, 16, 16, 16, 16, 16, 16, 27, 123, 64, 64, 64, 64, 104, 104, 104, 104, 38, 31, 101, 101, 101, 101, 101, 175, 82, 139, 139, 139, 139, 145, 87, 62, 85, 85, 85, 85, 85, 85, 64, 119, 118, 118, 118, 118, 107, 107, 107, 107, 101, 37, 101, 101, 101, 101, 101, 171, 78, 114, 114, 114, 114, 4, -7, 4 }, 8, 2, true, }, { "Courier-Bold", /* #25 */ NULL, NULL, "courier-bold-r-normal", "Courier", "monospace", "normal", "bold", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 4099, 0, 0, 3, 277, 856, 237, 560, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 500, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 142, 66, 97, 48, 62, 152, 263, 112, 88, 102, 152, 98, 206, 72, 99, 94, 70, 67, 66, 78, 94, 68, 96, 67, 206, 153, 119, 36, 93, 108, 22, 2, 37, 53, 24, 49, 62, 40, 24, 89, 48, 60, 49, -12, 14, 36, 58, 36, 36, 55, 32, 17, -1, -3, 23, 22, 72, 289, 74, 102, 132, -28, 152, 58, -6, 60, 44, 64, 95, 42, 20, 103, 78, 30, 89, -15, 24, 45, 11, 49, 67, 85, 94, 21, 9, -8, 17, 15, 103, 223, 249, 128, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 99, 82, 60, 23, 224, 116, 348, 66, 157, 44, 98, 171, 66, 278, 150, 101, 152, 147, 330, 24, 73, 208, 447, 167, 149, 44, 4, 9, -21, 109, 2, 2, 2, 2, 2, 2, 10, 54, 49, 49, 49, 49, 69, 89, 89, 89, 24, 14, 36, 36, 36, 36, 36, 130, 36, 17, 17, 17, 17, 22, 40, 27, 56, 57, 57, 57, 57, 57, 3, 60, 64, 64, 64, 64, 19, 89, 89, 89, 55, 24, 45, 45, 45, 45, 45, 97, 45, 21, 21, 21, 21, 15, 11, 15 }, 8, 3, true, }, { "Courier-BoldItalic", /* #26 */ #ifndef USE_PS_FONTS_IN_PCL "Courier-BoldOblique", /* treat name of similar PS font as alias */ #else NULL, #endif NULL, "courier-bold-o-normal", "Courier", "monospace", "oblique", "bold", "normal", "2 7 4 9 2 2 5 2 4 4", /* Panose for entire Courier family? */ 4099, 0, 1, 3, 277, 856, 237, 560, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 500, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 593, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 152, 37, 41, 63, 32, 153, 248, 36, 104, 86, 106, 86, 155, -9, 86, 37, 9, 14, 29, 22, 79, 97, 67, 29, 154, 80, 60, 36, 125, 125, 4, -61, -27, 43, -37, -16, 0, 29, -33, 26, 6, -10, -13, -68, -43, 26, 20, 23, -26, -5, 31, 54, 32, 20, -38, 55, 11, 208, 144, 26, 149, -90, 153, 13, -26, 40, 9, 41, 20, -1, -48, 29, -10, -30, 28, -73, -38, 27, -60, 17, 1, 16, 99, 33, 13, 0, -45, -61, 30, 208, 188, 47, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 178, 90, 55, 52, 62, 224, 47, 395, 108, 128, 9, 86, 161, 108, 338, 210, 35, 137, 138, 386, 9, 92, 212, 350, 155, 130, -12, -47, -52, -28, 77, -61, -61, -61, -61, -61, -61, -51, 42, -16, -16, -16, -16, 26, 26, 26, 26, -37, -43, 26, 26, 26, 26, 26, 95, -7, 54, 54, 54, 54, 55, -14, -34, 13, 13, 13, 13, 13, 13, -26, 40, 42, 42, 42, 42, 29, 29, 29, 29, 43, -38, 27, 27, 27, 27, 27, 82, 1, 33, 33, 33, 33, -61, -60, -61 }, 8, 4, true, }, { "Garamond", /* #27 */ NULL, NULL, "garamond-medium-r-normal", "Garamond", "serif", "normal", "normal", "normal", "2 2 4 4 3 3 1 1 8 3", /* Panose for entire Garamond family? */ 4197, 1, 0, 0, 277, /* Garamond Antiqua */ 1023, 260, 695, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, 258, 424, 479, 479, 812, 830, 276, 295, 295, 479, 812, 258, 812, 258, 479, 479, 479, 479, 479, 479, 479, 479, 479, 479, 479, 258, 258, 996, 812, 996, 369, 816, 756, 608, 738, 793, 627, 590, 793, 848, 332, 369, 719, 608, 904, 848, 848, 590, 848, 701, 479, 682, 812, 719, 977, 756, 719, 664, 295, 479, 295, 498, 498, 276, 424, 535, 424, 517, 424, 313, 461, 553, 276, 258, 553, 276, 830, 553, 535, 535, 517, 387, 351, 332, 535, 498, 756, 498, 535, 461, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, 258, 479, 479, 479, 479, 498, 479, 479, 498, 479, 424, 812, 258, 498, 479, 479, 812, 332, 332, 479, 553, 479, 258, 479, 332, 479, 424, 812, 812, 812, 369, 756, 756, 756, 756, 756, 756, 1069, 738, 627, 627, 627, 627, 332, 332, 332, 332, 793, 848, 848, 848, 848, 848, 848, 812, 848, 812, 812, 812, 812, 719, 590, 553, 424, 424, 424, 424, 424, 424, 646, 424, 424, 424, 424, 424, 276, 276, 276, 276, 535, 553, 535, 535, 535, 535, 535, 812, 535, 535, 535, 535, 535, 535, 535, 535 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 91, 21, 51, 35, 46, 67, 79, -25, 68, 148, 57, 150, 68, 21, 37, 101, 23, 38, 21, 45, 44, 31, 59, 33, 67, 55, 198, 150, 199, 56, -7, 18, 17, 47, 16, 23, 17, 44, 23, 21, -54, 17, 25, 14, 11, 43, 18, 42, 21, 34, 33, 24, 15, 8, 17, 11, 33, 32, 24, 29, 47, 0, 53, 50, 32, 32, 31, 33, 24, 48, 27, 28, -6, 27, 30, 30, 28, 48, 10, 38, 36, 30, 32, 14, 4, 11, 15, 9, 28, 81, 223, 67, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 60, -37, -6, 14, 223, 46, 85, 34, 109, 36, 148, 17, 34, 118, 81, 148, 24, 26, 180, 26, 49, 67, 122, 73, 66, 32, 97, 78, 69, 44, 18, 18, 18, 18, 18, 18, 18, 47, 23, 23, 23, 23, 20, 20, 20, 9, 10, 11, 43, 43, 43, 43, 43, 154, 32, 24, 24, 24, 24, 11, 14, 21, 52, 52, 52, 52, 52, 52, 25, 33, 32, 32, 32, 32, 26, 28, 4, -32, 38, 28, 48, 48, 48, 48, 48, 146, 37, 14, 14, 14, 14, 9, 10, 9 }, 9, 1, true, }, { "Garamond-Italic", /* #28 */ NULL, NULL, "garamond-medium-i-normal", "Garamond", "serif", "italic", "normal", "normal", "2 2 4 4 3 3 1 1 8 3", /* Panose for entire Garamond family? */ 4197, 1, 1, 0, 277, /* Garamond Kursiv */ 984, 261, 695, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 424, 479, 479, 774, 682, 240, 240, 240, 479, 774, 240, 774, 240, 498, 479, 479, 479, 479, 479, 479, 479, 479, 479, 479, 240, 240, 996, 774, 996, 351, 779, 701, 572, 701, 756, 590, 498, 774, 774, 332, 313, 682, 590, 774, 738, 793, 553, 793, 682, 461, 608, 756, 719, 959, 701, 664, 627, 240, 498, 240, 498, 498, 240, 461, 479, 369, 498, 369, 276, 424, 479, 295, 240, 498, 276, 812, 553, 461, 461, 479, 387, 295, 313, 517, 517, 719, 461, 442, 424, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 258, 479, 479, 479, 479, 498, 479, 479, 498, 442, 406, 774, 240, 498, 479, 479, 774, 332, 332, 479, 553, 479, 240, 479, 332, 442, 406, 774, 774, 774, 351, 701, 701, 701, 701, 701, 701, 959, 701, 590, 590, 590, 590, 332, 332, 332, 332, 756, 738, 793, 793, 793, 793, 793, 774, 793, 756, 756, 756, 756, 664, 553, 498, 461, 461, 461, 461, 461, 461, 627, 369, 369, 369, 369, 369, 295, 295, 295, 295, 461, 553, 461, 461, 461, 461, 461, 774, 461, 517, 517, 517, 517, 442, 461, 442 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 165, 52, 51, 96, 48, 112, 17, -133, 147, 142, -11, 144, 16, -8, 62, 81, 41, -2, 48, 55, 53, 83, 52, 48, 17, -10, 198, 150, 199, 64, 6, -52, -2, 79, -23, -21, -15, 81, -20, -13, -103, -9, -10, -44, 7, 72, -18, 74, -26, 20, 93, 111, 138, 130, -21, 101, 45, -79, 171, -131, 47, 0, 150, -2, 11, 30, 14, 24, -146, -24, 8, 48, -109, 13, 35, 34, 37, 38, -86, 11, 33, -6, 46, 34, 23, 23, -8, -28, -10, 132, 223, -36, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 94, 8, 37, 67, 223, 46, 214, 187, 115, 49, 149, 42, 187, 198, 136, 141, 75, 59, 286, 26, 86, 98, 84, 96, 125, 28, 92, 55, 86, -33, -52, -52, -52, -52, -52, -52, -61, 79, -21, -21, -21, -21, -14, -14, -14, -14, -23, 7, 72, 72, 72, 72, 72, 154, 5, 110, 110, 110, 110, 101, -17, -190, -2, -2, -2, -2, -2, -2, -3, 29, 23, 23, 23, 23, 48, 48, 48, 48, 38, 37, 38, 38, 38, 38, 38, 140, -45, 34, 34, 34, 34, -28, -86, -28 }, 9, 2, true, }, { "Garamond-Bold", /* #29 */ NULL, NULL, "garamond-bold-r-normal", "Garamond", "serif", "normal", "bold", "normal", "2 2 4 4 3 3 1 1 8 3", /* Panose for entire Garamond family? */ 4197, 1, 0, 3, 277, /* Garamond Halbfett */ 1010, 261, 695, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 406, 498, 498, 830, 848, 258, 313, 313, 498, 830, 276, 830, 276, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 276, 276, 996, 830, 996, 387, 830, 756, 664, 756, 830, 627, 627, 812, 885, 387, 369, 738, 608, 940, 848, 867, 627, 867, 738, 535, 664, 812, 738, 996, 756, 701, 664, 313, 498, 313, 498, 498, 258, 461, 553, 424, 553, 442, 351, 535, 590, 295, 276, 553, 295, 867, 590, 535, 553, 553, 424, 369, 369, 590, 535, 756, 535, 517, 479, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 498, 498, 498, 498, 498, 498, 498, 498, 461, 479, 830, 276, 498, 498, 498, 830, 351, 351, 498, 553, 498, 276, 498, 351, 461, 479, 830, 830, 830, 387, 756, 756, 756, 756, 756, 756, 977, 756, 627, 627, 627, 627, 387, 387, 387, 387, 830, 848, 867, 867, 867, 867, 867, 830, 867, 812, 812, 812, 812, 701, 627, 590, 461, 461, 461, 461, 461, 461, 682, 424, 442, 442, 442, 442, 295, 295, 295, 295, 535, 590, 535, 535, 535, 535, 535, 830, 535, 590, 590, 590, 590, 517, 553, 517 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 74, 21, 52, 40, 42, 50, 20, 19, 57, 157, 46, 157, 56, 57, 46, 91, 21, 30, 39, 33, 46, 54, 48, 37, 55, 46, 199, 157, 199, 53, -5, 3, 30, 39, 29, 23, 32, 35, 26, 21, -66, 30, 28, 9, 13, 38, 28, 37, 25, 38, 13, 12, 3, 25, 20, 5, 24, 52, 42, 12, 47, 0, 44, 31, 10, 34, 34, 32, 32, 44, 28, 29, 11, 22, 24, 19, 30, 37, 14, 32, 32, 39, 14, 23, 9, 14, 21, 7, 30, 70, 223, 58, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 53, 17, -19, 14, 223, 40, 83, 45, 71, 46, 157, 31, 45, 113, 75, 156, 31, 34, 202, 20, 65, 50, 108, 67, 56, 49, 63, 60, 52, 54, 3, 3, 3, 3, 3, 3, -8, 39, 23, 23, 23, 23, 21, 21, 21, 21, 26, 13, 38, 38, 38, 38, 38, 156, 34, 12, 12, 12, 12, 5, 29, 31, 31, 31, 31, 31, 31, 31, 33, 34, 31, 31, 31, 31, 28, 29, 17, -19, 37, 30, 37, 37, 37, 37, 37, 157, 31, 24, 24, 24, 24, 7, 14, 7 }, 9, 3, true, }, { "Garamond-BoldItalic", /* #30 */ NULL, NULL, "garamond-bold-i-normal", "Garamond", "serif", "italic", "bold", "normal", "2 2 4 4 3 3 1 1 8 3", /* Panose for entire Garamond family? */ 4197, 1, 1, 3, 277, /* Garamond Kursiv Halbfett */ 1016, 264, 697, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, 258, 424, 498, 498, 830, 701, 258, 295, 295, 498, 830, 258, 830, 258, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 258, 258, 996, 830, 996, 387, 830, 738, 627, 738, 774, 627, 572, 793, 812, 387, 351, 719, 627, 867, 793, 830, 627, 830, 738, 498, 682, 812, 738, 996, 719, 738, 664, 295, 498, 295, 498, 498, 258, 517, 553, 424, 553, 424, 295, 479, 553, 313, 295, 535, 295, 812, 553, 479, 553, 535, 387, 332, 313, 535, 572, 774, 479, 498, 424, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, 258, 498, 498, 498, 498, 498, 498, 498, 498, 424, 424, 830, 258, 498, 498, 498, 830, 332, 332, 498, 553, 498, 258, 498, 332, 424, 424, 830, 830, 830, 387, 738, 738, 738, 738, 738, 738, 977, 738, 627, 627, 627, 627, 387, 387, 387, 387, 774, 793, 830, 830, 830, 830, 830, 830, 830, 812, 812, 812, 812, 738, 627, 535, 517, 517, 517, 517, 517, 517, 701, 424, 424, 424, 424, 424, 313, 313, 313, 313, 479, 553, 479, 479, 479, 479, 479, 830, 479, 535, 535, 535, 535, 498, 553, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 137, 48, 39, 101, 74, 101, 37, -112, 114, 157, 23, 157, 60, 7, 57, 46, 4, -17, 22, 75, 45, 99, 48, 46, 26, 9, 199, 157, 199, 87, 17, -19, -21, 80, -3, -8, -10, 89, -16, -19, -118, -8, -6, -50, -5, 78, 2, 78, -3, 21, 104, 115, 107, 92, -22, 131, 38, -58, 159, -92, 47, 0, 118, 33, 36, 32, 32, 33, -95, -39, 33, 30, -95, 33, 39, 38, 46, 36, -78, 30, 34, 14, 37, 44, 36, 30, -13, -19, -19, 85, 223, -39, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -45, 98, 5, 19, 82, 262, 51, 188, 167, 99, 26, 157, 28, 167, 205, 124, 156, 72, 63, 278, 20, 75, 91, 117, 109, 116, 10, 93, 94, 69, -15, -19, -19, -19, -19, -19, -19, -63, 80, -8, -8, -8, -8, -19, -19, -19, -19, -2, -5, 78, 78, 78, 78, 78, 160, 74, 115, 115, 115, 115, 131, 2, -138, 33, 33, 33, 33, 33, 33, 30, 32, 33, 33, 33, 33, 31, 31, 31, 31, 37, 46, 36, 36, 36, 36, 36, 157, 32, 43, 43, 43, 43, -18, -79, -18 }, 9, 4, true, }, { "LetterGothic", /* #31 */ NULL, NULL, "letter gothic-medium-r-normal", "Letter Gothic", "monospace", "normal", "normal", "normal", "0 0 0 0 0 0 0 0 0 0", /* no Panose known */ 4102, 0, 0, 0, 277, 946, 308, 721, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 135, -5, 75, 46, 47, 200, 147, 145, 29, 33, 200, 35, 206, 81, 77, 94, 61, 53, 29, 53, 61, 59, 52, 54, 205, 200, 35, 35, 35, 56, 30, 9, 70, 52, 66, 88, 86, 34, 63, 128, 32, 73, 78, 45, 72, 40, 89, 41, 71, 37, 24, 63, 55, 32, 62, 49, 59, 130, 71, 104, 49, 0, 200, 62, 51, 49, 46, 51, 74, 40, 73, 89, 58, 78, 92, 14, 56, 50, 53, 45, 94, 57, 32, 72, 58, 7, 42, -16, 54, 124, 225, 124, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 69, 38, 77, 49, 225, 65, 139, 147, 124, 8, 35, 126, 147, 109, 98, 33, 145, 116, 185, -13, 117, 211, 190, 152, 119, 3, 32, 18, 21, 115, 9, 9, 9, 9, 9, 9, 0, 52, 88, 88, 88, 88, 128, 128, 93, 128, -5, 72, 40, 40, 40, 40, 40, 42, 41, 63, 63, 63, 63, 49, 89, 89, 62, 62, 62, 62, 62, 62, -2, 49, 51, 51, 51, 51, 89, 89, 82, 89, 40, 56, 50, 50, 50, 50, 50, 33, 51, 72, 72, 72, 72, -16, 75, -16 }, 10, 1, true, }, { "LetterGothic-Italic", /* #32 */ NULL, NULL, "letter gothic-medium-i-normal", "Letter Gothic", "monospace", "oblique", "normal", "normal", "0 0 0 0 0 0 0 0 0 0", /* no Panose known */ 4102, 0, 1, 0, 277, 947, 308, 721, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 154, 200, 9, 39, 17, 24, 257, 162, 162, 81, 53, 155, 61, 197, 104, 67, 47, -2, 16, 21, 44, 53, 86, 34, 47, 164, 155, 23, 61, 46, 154, 47, -46, 18, 50, 2, 25, 27, 30, 10, 75, 51, 21, 44, -23, 17, 39, 21, 39, 13, 7, 104, 45, 152, 23, 0, 141, 4, 51, 167, 22, 49, 0, 286, 46, -14, 40, 36, 39, 118, 10, 23, 138, 14, 31, 187, -34, 21, 40, -34, 37, 53, 32, 85, 41, 117, 40, -30, -86, -3, 146, 225, 13, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 79, 41, 77, 90, 225, 83, 213, 147, 166, 8, 61, 145, 147, 198, 149, 59, 140, 128, 265, -13, 117, 224, 94, 153, 176, -42, 0, -6, 16, 55, -46, -46, -46, -46, -46, -46, -52, 50, 25, 25, 25, 25, 75, 75, 75, 75, 14, 17, 39, 39, 39, 39, 39, 68, -17, 45, 45, 45, 45, 141, 21, 40, 46, 46, 46, 46, 46, 46, -24, 40, 39, 39, 39, 39, 138, 138, 132, 138, 41, 21, 40, 40, 40, 40, 40, 59, 9, 41, 41, 41, 41, -86, -35, -86 }, 10, 2, true, }, { "LetterGothic-Bold", /* #33 */ NULL, NULL, "letter gothic-bold-r-normal", "Letter Gothic", "monospace", "normal", "bold", "normal", "0 0 0 0 0 0 0 0 0 0", /* no Panose known */ 4102, 0, 0, 3, 277, 988, 308, 721, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 203, -33, 66, 25, 27, 184, 141, 110, 28, 13, 184, 12, 185, 69, 59, 87, 41, 29, 18, 45, 45, 63, 26, 40, 185, 185, 34, 12, 34, 66, 15, -9, 48, 30, 47, 62, 76, 25, 46, 111, 37, 43, 80, 37, 45, 24, 68, 17, 46, 30, 9, 46, 33, 13, 35, 25, 41, 128, 74, 79, 49, 0, 184, 68, 44, 56, 44, 42, 86, 50, 79, 91, 77, 74, 77, 16, 55, 34, 47, 47, 74, 65, 40, 63, 49, -3, 14, 11, 55, 71, 225, 71, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 58, 40, 48, 25, 225, 59, 109, 147, 135, -12, 12, 159, 147, 100, 108, 13, 132, 107, 146, -30, 117, 177, 171, 133, 120, -12, 13, 7, -12, 71, -9, -9, -9, -9, -9, -9, -3, 30, 62, 62, 62, 62, 111, 111, 78, 106, -12, 45, 24, 24, 24, 24, 24, 15, 19, 46, 46, 46, 46, 25, 68, 96, 68, 68, 68, 68, 68, 68, 11, 56, 42, 42, 42, 42, 91, 91, 83, 91, 50, 55, 34, 34, 34, 34, 34, 10, 34, 63, 63, 63, 63, 11, 71, 11 }, 10, 3, true, }, { "Marigold", /* #34 */ NULL, NULL, "marigold-medium-r-normal", "Marigold", NULL, "normal", "normal", "normal", "3 2 7 2 4 4 2 2 5 4", /* Panose for Marigold font */ 4297, 1, 0, 0, 277, 770, 302, 450, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 240, 369, 369, 646, 479, 147, 258, 258, 369, 442, 221, 442, 221, 332, 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 221, 221, 996, 442, 996, 313, 682, 461, 406, 406, 479, 387, 369, 461, 461, 240, 240, 461, 332, 608, 498, 442, 369, 442, 442, 369, 387, 479, 461, 608, 461, 406, 406, 240, 332, 240, 498, 498, 147, 313, 258, 240, 295, 240, 147, 295, 313, 185, 147, 258, 147, 424, 295, 258, 295, 276, 240, 203, 203, 295, 276, 369, 276, 276, 276, 313, 498, 313, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 295, 369, 369, 369, 369, 498, 369, 442, 295, 240, 351, 442, 258, 295, 442, 295, 442, 276, 276, 442, 553, 442, 221, 442, 276, 240, 351, 646, 646, 646, 313, 461, 461, 461, 461, 461, 461, 664, 406, 387, 387, 387, 387, 240, 240, 240, 240, 479, 498, 442, 442, 442, 442, 442, 442, 442, 479, 479, 479, 479, 406, 369, 351, 313, 313, 313, 313, 313, 313, 406, 240, 240, 240, 240, 240, 185, 185, 185, 185, 276, 295, 258, 258, 258, 258, 258, 442, 258, 295, 295, 295, 295, 276, 295, 276 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 25, -27, 1, 40, 23, 43, 68, 9, 63, 48, -24, 48, 47, 40, 8, 80, 21, 5, 2, -7, 5, 50, 0, 29, 47, -24, 198, 48, 199, 40, 35, 4, 13, 24, 12, 5, 25, 21, 11, 28, -68, 13, 14, 15, 11, 22, 9, 22, 0, 15, 14, 24, 4, 18, 11, 0, -2, 45, 26, 24, 47, 0, 32, 15, 3, 26, 14, 17, -124, -108, 17, 33, -95, 1, 20, 11, 18, 18, -114, 19, 19, -5, 21, 8, 1, 7, -8, -54, -5, 66, 223, 27, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 68, -31, 6, -21, 223, 29, 158, 79, 42, -3, 51, 12, 79, 165, 42, 47, 31, 30, 228, 7, 73, 49, 101, 66, 65, -4, 62, 55, 30, -13, 4, 4, 4, 4, 4, 4, 4, 24, 5, 5, 5, 5, 28, 28, 28, 28, 12, 11, 22, 22, 22, 22, 22, 81, 12, 24, 24, 24, 24, 0, 9, -110, 15, 15, 15, 15, 15, 15, 11, 0, 17, 17, 17, 17, 33, 33, 21, 4, 22, 18, 18, 18, 18, 18, 18, 48, 19, 8, 8, 8, 8, -54, -114, -54 }, 11, 1, true, }, { "CGOmega", /* #35 */ NULL, NULL, "cg omega-medium-r-normal", "CG Omega", "serif", "normal", "normal", "normal", "2 11 5 2 5 5 8 2 3 4", /* Panose for entire CG Omega family? */ 4113, 1, 0, 0, 277, 895, 250, 683, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 406, 553, 553, 885, 719, 276, 276, 276, 553, 885, 276, 885, 276, 276, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 276, 276, 996, 885, 996, 387, 885, 664, 608, 664, 774, 498, 498, 774, 774, 276, 276, 608, 498, 885, 774, 830, 553, 830, 608, 498, 553, 774, 664, 996, 608, 608, 608, 276, 276, 276, 498, 498, 276, 479, 553, 479, 553, 498, 276, 498, 553, 276, 276, 498, 276, 830, 553, 553, 553, 553, 332, 387, 276, 553, 498, 774, 498, 498, 498, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 553, 553, 553, 553, 498, 553, 553, 498, 406, 369, 885, 276, 498, 553, 553, 885, 369, 369, 553, 553, 553, 276, 553, 369, 406, 369, 885, 885, 885, 387, 664, 664, 664, 664, 664, 664, 812, 664, 498, 498, 498, 498, 276, 276, 276, 276, 774, 774, 830, 830, 830, 830, 830, 885, 830, 774, 774, 774, 774, 608, 553, 553, 479, 479, 479, 479, 479, 479, 774, 479, 498, 498, 498, 498, 276, 276, 276, 276, 553, 553, 553, 553, 553, 553, 553, 885, 553, 553, 553, 553, 553, 498, 553, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 81, 25, 74, 98, 83, 75, 73, 27, 104, 184, 43, 184, 83, -28, 43, 108, 40, 68, 14, 68, 61, 85, 50, 57, 82, 43, 201, 191, 201, 89, 49, 12, 89, 44, 99, 94, 97, 42, 91, 88, -27, 91, 98, 39, 98, 45, 86, 44, 88, 45, 21, 103, 10, 17, 32, 16, 10, 72, -34, 7, 48, 0, 71, 36, 64, 39, 31, 36, 26, 39, 73, 90, -3, 69, 94, 70, 73, 40, 66, 37, 81, 44, 19, 81, 10, 18, 32, 15, 22, 97, 224, 71, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 76, 33, 77, -10, 224, 88, 131, 147, 55, 39, 184, 15, 147, 131, 120, 184, 30, 53, 231, -61, 117, 83, 161, 70, 33, 21, 108, 87, 118, 60, 12, 12, 12, 12, 12, 12, -27, 44, 94, 94, 94, 94, 27, 60, -3, -7, 31, 98, 45, 45, 45, 45, 45, 185, 40, 103, 103, 103, 103, 16, 86, 79, 36, 36, 36, 36, 36, 36, 40, 39, 36, 36, 36, 36, 22, 59, 1, -6, 40, 73, 40, 40, 40, 40, 40, 184, 35, 81, 81, 81, 81, 15, 71, 15 }, 12, 1, true, }, { "CGOmega-Italic", /* #36 */ NULL, NULL, "cg omega-medium-i-normal", "CG Omega", "serif", "oblique", "normal", "normal", "2 11 5 2 5 5 8 2 3 4", /* Panose for entire CG Omega family? */ 4113, 1, 1, 0, 277, 911, 250, 683, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 406, 553, 553, 885, 664, 276, 276, 276, 553, 885, 276, 885, 276, 276, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 276, 276, 996, 885, 996, 387, 885, 664, 608, 664, 774, 498, 498, 738, 774, 295, 276, 608, 461, 885, 774, 830, 553, 830, 627, 498, 553, 774, 608, 940, 553, 553, 608, 276, 276, 276, 498, 498, 276, 498, 553, 479, 553, 498, 276, 498, 553, 276, 276, 498, 276, 830, 553, 553, 553, 553, 332, 387, 295, 553, 498, 774, 442, 498, 498, 442, 498, 442, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 553, 553, 553, 553, 498, 553, 553, 498, 461, 369, 885, 276, 498, 553, 553, 885, 387, 387, 553, 553, 553, 276, 553, 387, 461, 369, 885, 885, 885, 387, 664, 664, 664, 664, 664, 664, 793, 664, 498, 498, 498, 498, 295, 295, 295, 295, 774, 774, 830, 830, 830, 830, 830, 885, 830, 774, 774, 774, 774, 553, 553, 535, 498, 498, 498, 498, 498, 498, 774, 479, 498, 498, 498, 498, 276, 276, 276, 276, 553, 553, 553, 553, 553, 553, 553, 885, 553, 553, 553, 553, 553, 498, 553, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 155, 28, 49, 154, 42, 103, 61, -37, 131, 194, -18, 194, 59, 4, 57, 176, 54, 47, 39, 54, 67, 83, 55, 86, 56, -19, 201, 191, 201, 99, 46, -22, 63, 65, 64, 54, 54, 75, 59, 60, -35, 62, 58, 54, 60, 63, 63, 63, 56, 17, 91, 105, 79, 84, -2, 70, 15, 12, 107, -55, 48, 0, 103, 28, 25, 39, 50, 38, 48, 17, 37, 61, -9, 41, 54, 34, 39, 37, -16, 52, 40, 13, 40, 63, 58, 56, -13, 52, 22, 97, 224, -52, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 88, 5, 54, 57, 224, 86, 191, 147, 114, 38, 198, 5, 147, 191, 151, 176, 79, 81, 284, -61, 98, 104, 122, 144, 111, 10, 136, 125, 100, 20, -22, -22, -22, -22, -22, -22, -76, 65, 54, 54, 54, 54, 60, 60, 60, 60, 14, 60, 63, 63, 63, 63, 63, 193, 27, 105, 105, 105, 105, 70, 63, 30, 28, 28, 28, 28, 28, 28, 24, 39, 38, 38, 38, 38, 61, 61, 61, 51, 37, 39, 37, 37, 37, 37, 37, 198, 4, 63, 63, 63, 63, 52, -17, 52 }, 12, 2, true, }, { "CGOmega-Bold", /* #37 */ NULL, NULL, "cg omega-bold-r-normal", "CG Omega", "serif", "normal", "bold", "normal", "2 11 5 2 5 5 8 2 3 4", /* Panose for entire CG Omega family? */ 4113, 1, 0, 3, 277, 924, 250, 686, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 461, 553, 553, 885, 719, 276, 276, 276, 553, 885, 276, 885, 276, 276, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 276, 276, 996, 885, 996, 442, 885, 664, 608, 664, 774, 498, 498, 774, 774, 332, 332, 627, 498, 885, 774, 830, 572, 830, 608, 498, 553, 774, 664, 996, 608, 608, 608, 276, 276, 276, 498, 498, 276, 498, 553, 498, 553, 498, 332, 498, 553, 276, 276, 498, 276, 830, 553, 553, 553, 553, 387, 387, 332, 553, 498, 774, 498, 498, 498, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 553, 553, 553, 553, 498, 553, 553, 498, 369, 442, 885, 276, 498, 553, 553, 885, 369, 369, 553, 590, 553, 276, 553, 369, 369, 442, 885, 885, 885, 442, 664, 664, 664, 664, 664, 664, 867, 664, 498, 498, 498, 498, 332, 332, 332, 332, 774, 774, 830, 830, 830, 830, 830, 885, 830, 774, 774, 774, 774, 608, 572, 553, 498, 498, 498, 498, 498, 498, 756, 498, 498, 498, 498, 498, 276, 276, 276, 276, 553, 553, 553, 553, 553, 553, 553, 885, 553, 553, 553, 553, 553, 498, 553, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 75, 31, 50, 64, 44, 63, 38, 5, 96, 184, 24, 184, 57, -4, 41, 87, 49, 47, 34, 32, 49, 76, 42, 42, 57, 20, 201, 184, 201, 68, 24, 6, 78, 41, 88, 76, 83, 43, 83, 85, 12, 82, 88, 36, 86, 42, 83, 42, 79, 46, 22, 87, 20, 15, 22, 12, 18, 44, -4, 21, 48, 0, 53, 23, 46, 33, 30, 34, 29, 32, 56, 63, -13, 47, 66, 55, 55, 32, 42, 37, 65, 37, 11, 52, 20, 22, 28, 20, 29, 79, 224, 60, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 46, 39, 48, -17, 224, 74, 156, 147, 27, 42, 184, 15, 147, 129, 113, 184, 42, 43, 235, -61, 117, 57, 146, 57, 15, 33, 101, 68, 84, 68, 6, 6, 6, 6, 6, 6, 0, 41, 76, 76, 76, 76, 52, 85, 9, 22, 18, 86, 42, 42, 42, 42, 42, 188, 38, 87, 87, 87, 87, 12, 82, 50, 23, 23, 23, 23, 23, 23, 19, 33, 34, 34, 34, 34, 27, 53, -22, -5, 32, 55, 32, 32, 32, 32, 32, 184, 26, 52, 52, 52, 52, 20, 42, 20 }, 12, 3, true, }, { "CGOmega-BoldItalic", /* #38 */ NULL, NULL, "cg omega-bold-i-normal", "CG Omega", "serif", "oblique", "bold", "normal", "2 11 5 2 5 5 8 2 3 4", /* Panose for entire CG Omega family? */ 4113, 1, 1, 3, 277, 923, 250, 686, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 461, 553, 553, 885, 719, 276, 276, 276, 553, 885, 276, 885, 276, 276, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, 276, 276, 996, 885, 996, 442, 885, 664, 608, 664, 774, 498, 498, 774, 774, 332, 332, 608, 498, 885, 774, 830, 553, 830, 608, 498, 553, 774, 664, 940, 608, 608, 608, 276, 276, 276, 498, 498, 276, 498, 553, 479, 553, 498, 332, 498, 553, 276, 276, 498, 276, 830, 553, 553, 553, 553, 387, 387, 332, 553, 498, 774, 498, 498, 498, 498, 498, 498, 996, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, 276, 553, 553, 553, 553, 498, 553, 553, 498, 369, 424, 885, 276, 498, 553, 553, 885, 351, 351, 553, 590, 553, 276, 553, 351, 369, 424, 885, 885, 885, 442, 664, 664, 664, 664, 664, 664, 867, 664, 498, 498, 498, 498, 332, 332, 332, 332, 774, 774, 830, 830, 830, 830, 830, 885, 830, 774, 774, 774, 774, 608, 553, 553, 498, 498, 498, 498, 498, 498, 756, 479, 498, 498, 498, 498, 276, 276, 276, 276, 553, 553, 553, 553, 553, 553, 553, 885, 553, 553, 553, 553, 553, 498, 553, 498 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 148, 41, 23, 128, 42, 70, 44, -42, 140, 184, -80, 184, 26, -54, 56, 142, 17, 19, 23, 24, 72, 54, 43, 65, 26, -80, 201, 204, 201, 100, 37, -49, 39, 73, 39, 22, 26, 80, 34, 33, -50, 36, 43, 21, 42, 67, 30, 64, 35, 17, 90, 90, 104, 110, -6, 104, -30, -35, 111, -35, 48, 0, 70, 14, 5, 43, 27, 32, 12, -13, 2, 1, -91, -2, 8, 1, 4, 26, -40, 28, 8, 3, 57, 34, 79, 86, -33, 5, -14, 101, 224, -78, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, 93, -4, 48, 55, 224, 85, 202, 147, 60, 45, 184, 9, 147, 191, 148, 184, 56, 54, 269, -61, 117, 78, 92, 105, 53, 19, 131, 117, 83, 48, -49, -49, -49, -49, -49, -49, -49, 73, 22, 22, 22, 22, 33, 33, 33, 33, 38, 42, 67, 67, 67, 67, 67, 226, 61, 90, 90, 90, 90, 104, 35, 4, 14, 14, 14, 14, 14, 14, 14, 43, 32, 32, 32, 32, 7, 7, 7, 7, 26, 4, 26, 26, 26, 26, 26, 184, 3, 34, 34, 34, 34, 5, -40, 5 }, 12, 4, true, }, { "TimesNewRoman", /* #39 */ NULL, NULL, "times new roman-medium-r-normal", "Times New Roman", "serif", "normal", "normal", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire TNR family? */ 16901, 1, 0, 0, 277, 913, 219, 662, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 408, 500, 500, 833, 778, 333, 333, 333, 500, 564, 250, 564, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 564, 564, 564, 444, 921, 722, 667, 667, 722, 611, 556, 722, 722, 333, 389, 722, 611, 889, 722, 722, 556, 722, 667, 556, 611, 722, 722, 944, 722, 722, 611, 333, 278, 333, 469, 500, 333, 444, 500, 444, 500, 444, 333, 500, 500, 278, 278, 500, 278, 778, 500, 500, 500, 500, 333, 389, 278, 500, 500, 722, 500, 500, 444, 480, 200, 480, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 500, 200, 500, 333, 760, 276, 500, 564, 333, 760, 333, 400, 549, 300, 300, 333, 576, 453, 250, 333, 300, 310, 500, 750, 750, 750, 444, 722, 722, 722, 722, 722, 722, 889, 667, 611, 611, 611, 611, 333, 333, 333, 333, 722, 722, 722, 722, 722, 722, 722, 564, 722, 722, 722, 722, 722, 722, 556, 500, 444, 444, 444, 444, 444, 444, 667, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 500, 500, 500, 500, 500, 500, 549, 500, 500, 500, 500, 500, 500, 500, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 65, 18, 53, 36, 37, 91, 41, 22, 70, 18, 54, 18, 71, 1, 39, 121, 21, 41, 16, 49, 45, 37, 63, 41, 86, 69, 19, 18, 18, 45, 61, 8, 17, 36, 18, 21, 17, 36, 17, 25, 21, 17, 21, 14, -15, 35, 17, 35, 17, 63, 30, 6, 9, 14, -4, 9, 13, 82, 1, 36, 18, -8, 91, 33, -2, 39, 34, 37, 21, 29, 2, 27, -77, 8, 29, 9, 3, 30, -2, 33, 7, 48, 7, 1, -8, 6, 13, 6, 20, 138, 80, 86, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 63, 31, 14, 1, 80, 77, 29, 35, -3, 32, 18, 41, 35, 16, 48, 8, 10, 22, 131, 65, -7, 71, 33, 68, 15, 32, 88, 68, 73, 42, 8, 8, 8, 8, 8, 8, -12, 36, 21, 21, 21, 21, 25, 25, 25, 25, 17, -15, 35, 35, 35, 35, 35, 81, 36, 6, 6, 6, 6, 9, 17, 17, 33, 33, 33, 33, 33, 33, 37, 39, 37, 37, 37, 37, 27, 27, -10, -2, 35, 3, 30, 30, 30, 30, 30, 11, 21, 1, 1, 1, 1, 6, -2, 6 }, 13, 1, true, }, { "TimesNewRoman-Italic", /* #40 */ NULL, NULL, "times new roman-medium-i-normal", "Times New Roman", "serif", "italic", "normal", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire TNR family? */ 16901, 1, 1, 0, 277, 913, 216, 662, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 420, 500, 500, 833, 778, 333, 333, 333, 500, 675, 250, 675, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 675, 675, 675, 500, 920, 611, 611, 667, 722, 611, 611, 722, 722, 333, 444, 667, 556, 833, 667, 722, 611, 722, 611, 500, 556, 722, 611, 833, 611, 556, 556, 389, 278, 389, 422, 500, 333, 500, 500, 444, 500, 444, 278, 500, 500, 278, 278, 444, 278, 722, 500, 500, 500, 500, 389, 389, 278, 500, 444, 667, 444, 444, 389, 400, 275, 400, 541, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 389, 500, 500, 500, 500, 275, 500, 333, 760, 276, 500, 675, 333, 760, 333, 400, 549, 300, 300, 333, 576, 523, 250, 333, 300, 310, 500, 750, 750, 750, 500, 611, 611, 611, 611, 611, 611, 889, 667, 611, 611, 611, 611, 333, 333, 333, 333, 722, 667, 722, 722, 722, 722, 722, 675, 722, 722, 722, 722, 722, 556, 611, 500, 500, 500, 500, 500, 500, 500, 667, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 500, 500, 500, 500, 500, 500, 549, 500, 500, 500, 500, 500, 444, 500, 444 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 144, 45, 42, 70, 48, 195, 68, -109, 106, 89, -10, 97, 34, -34, 57, 61, 16, 33, 31, 36, 64, 113, 34, 30, 60, 17, 91, 92, 91, 97, 47, -49, -23, 68, -30, -22, -24, 70, -26, -31, -34, -27, -32, -32, -28, 49, -24, 42, -23, 7, 70, 95, 131, 127, -67, 90, -2, 7, 106, -100, 21, -8, 212, 22, 25, 29, 19, 33, -173, -25, 21, 42, -166, 10, 39, 18, 20, 28, -111, 21, 19, -9, 42, 30, 21, 17, -34, -79, -29, 89, 144, -54, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 55, 24, 29, -7, 147, -7, 128, 52, 69, 41, 91, 26, 52, 124, 75, 8, 54, 65, 225, -33, 23, 98, -9, 80, 94, 18, 80, 80, 100, 36, -49, -49, -49, -49, -49, -48, -53, 68, -22, -22, -22, -22, -31, -31, -31, -31, -30, -28, 49, 49, 49, 49, 49, 155, 36, 95, 95, 95, 95, 90, -24, -161, 22, 22, 22, 22, 22, 22, 21, 24, 33, 33, 33, 33, 42, 42, 42, 42, 26, 20, 28, 28, 28, 28, 28, 36, 3, 30, 30, 30, 30, -79, -111, -79 }, 13, 2, true, }, { "TimesNewRoman-Bold", /* #41 */ NULL, NULL, "times new roman-bold-r-normal", "Times New Roman", "serif", "normal", "bold", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire TNR family? */ 16901, 1, 0, 3, 277, 913, 226, 662, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 555, 500, 500, 1000, 833, 333, 333, 333, 500, 570, 250, 570, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570, 570, 500, 930, 722, 667, 722, 722, 667, 611, 778, 778, 389, 500, 778, 667, 944, 722, 778, 611, 778, 722, 556, 667, 722, 722, 1000, 722, 722, 667, 333, 278, 333, 581, 500, 333, 500, 556, 444, 556, 444, 333, 500, 556, 278, 333, 556, 278, 833, 556, 500, 556, 556, 444, 389, 333, 556, 500, 722, 500, 500, 444, 394, 220, 394, 520, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 500, 500, 500, 500, 220, 500, 333, 747, 300, 500, 570, 333, 747, 333, 400, 549, 300, 300, 333, 576, 540, 250, 333, 300, 330, 500, 750, 750, 750, 500, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 389, 389, 389, 389, 722, 722, 778, 778, 778, 778, 778, 570, 778, 722, 722, 722, 722, 722, 611, 556, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 556, 500, 500, 500, 500, 500, 549, 500, 556, 556, 556, 556, 500, 556, 500 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 86, 20, 39, 74, 41, 74, 46, 12, 56, 20, 32, 19, 44, 1, 39, 66, 25, 17, 25, 34, 39, 31, 35, 34, 86, 75, 20, 20, 20, 61, 48, 5, 19, 40, 14, 26, 23, 41, 22, 21, 12, 23, 20, 19, 9, 40, 22, 39, 17, 52, 37, 15, 8, 11, 7, 9, 16, 104, 1, 33, 71, -9, 74, 42, 22, 42, 41, 42, 26, 36, 29, 24, -28, 32, 24, 39, 29, 37, 21, 42, 36, 47, 19, 26, 8, 9, 23, 8, 10, 81, 78, 44, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 63, 17, 12, 3, 78, 43, 3, 30, 21, 18, 20, 24, 30, 0, 29, 8, 12, 7, 113, 50, -9, 44, 87, 39, 28, 19, 73, 60, 67, 56, 5, 5, 5, 5, 5, 8, -11, 40, 26, 26, 26, 26, 21, 21, 21, 21, 18, 9, 40, 40, 40, 40, 40, 75, 40, 15, 15, 15, 15, 9, 17, 26, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 14, 24, -19, -18, 36, 29, 37, 37, 37, 37, 37, 8, 35, 26, 26, 26, 26, 8, 21, 8 }, 13, 3, true, }, { "TimesNewRoman-BoldItalic", /* #42 */ NULL, NULL, "times new roman-bold-i-normal", "Times New Roman", "serif", "italic", "bold", "normal", "2 2 6 3 5 4 5 2 3 4", /* Panose for entire TNR family? */ 16901, 1, 1, 3, 277, 913, 216, 662, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 389, 555, 500, 500, 833, 778, 333, 333, 333, 500, 570, 250, 606, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570, 570, 500, 832, 667, 667, 667, 722, 667, 667, 722, 778, 389, 500, 667, 611, 889, 722, 722, 611, 722, 667, 556, 611, 722, 667, 889, 667, 611, 611, 333, 278, 333, 570, 500, 333, 500, 500, 444, 500, 444, 333, 500, 556, 278, 278, 500, 278, 778, 556, 500, 500, 500, 389, 389, 278, 556, 444, 667, 500, 444, 389, 348, 220, 348, 570, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 389, 500, 500, 500, 500, 220, 500, 333, 747, 266, 500, 606, 333, 747, 333, 400, 549, 300, 300, 333, 576, 500, 250, 333, 300, 300, 500, 750, 750, 750, 500, 667, 667, 667, 667, 667, 667, 944, 667, 667, 667, 667, 667, 389, 389, 389, 389, 722, 722, 722, 722, 722, 722, 722, 570, 722, 722, 722, 722, 722, 611, 611, 500, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 556, 500, 500, 500, 500, 500, 549, 500, 556, 556, 556, 556, 444, 500, 444 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 165, 46, 39, 108, 46, 144, 50, -102, 120, 30, -28, 35, -14, -81, 52, 23, 4, 12, 18, 38, 63, 118, 38, 45, 40, 30, 37, 29, 42, 88, 36, -57, -25, 67, -36, -35, -16, 70, -32, -35, -8, -15, -30, -35, -32, 54, -30, 53, -32, -22, 80, 94, 118, 126, -61, 93, -27, -29, 78, -111, 95, -49, 142, 20, 10, 28, 20, 26, -160, -54, 12, 21, -160, 6, 16, 12, 13, 23, -122, 20, 18, -1, 20, 33, 29, 28, -45, -93, -5, 52, 107, -79, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 53, 36, 22, -9, 107, -13, 99, 43, 68, 40, 64, 6, 43, 80, 88, 12, 49, 54, 192, -62, -4, 75, -1, 60, 85, 6, 99, 59, 100, 4, -57, -57, -57, -57, -57, -57, -56, 67, -35, -35, -35, -35, -35, -35, -35, -35, -36, -32, 54, 54, 54, 54, 54, 86, 42, 94, 94, 94, 94, 93, -30, -170, 20, 20, 20, 20, 20, 20, 19, 22, 26, 26, 26, 26, 21, 21, 21, 21, 23, 13, 23, 23, 23, 23, 23, 16, 14, 33, 33, 33, 33, -93, -122, -93 }, 13, 4, true, }, /* note: 31402 below should be replaced by 6826 for LaserJet 4L's and 5L's */ { "Wingdings", /* #43, also called Tidbits */ "Tidbits", "Tidbits", /* use "Tidbits" in any output PS file */ "wingdings-medium-r-normal", "Wingdings", NULL, "normal", "normal", "normal", "5 2 1 2 1 8 4 8 7 8", /* Panose for Wingdings font */ 31402, 1, 0, 0, 18540, 895, 210, 723, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 1030, 1145, 1301, 1344, 894, 1217, 458, 1084, 892, 1132, 1132, 1171, 1171, 1431, 1431, 1096, 1343, 699, 699, 892, 554, 602, 1072, 948, 1078, 939, 891, 892, 892, 891, 910, 910, 587, 793, 674, 674, 942, 942, 549, 549, 892, 843, 843, 843, 1111, 660, 849, 1089, 888, 880, 650, 813, 747, 747, 723, 693, 794, 885, 892, 896, 891, 1156, 1054, 964, 1090, 941, 933, 946, 1025, 929, 1096, 1065, 780, 1050, 1271, 747, 953, 747, 891, 891, 891, 891, 458, 747, 986, 891, 578, 1060, 1060, 891, 892, 892, 530, 530, 1000, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 313, 458, 313, 891, 891, 891, 891, 891, 953, 458, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 1048, 1048, 1048, 1048, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1253, 1253, 794, 794, 891, 891, 891, 891, 891, 891, 979, 979, 891, 891, 776, 776, 776, 776, 1067, 1067, 891, 891, 873, 873, 873, 873, 891, 891, 811, 811, 1060, 811, 782, 782, 782, 782, 482, 385, 635, 786, 892, 892, 1035, }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* printable ASCII range */ 0, 36, 80, 84, 37, 74, 85, 96, 87, 86, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 37, 37, 84, 84, 84, 84, 85, 36, 36, 83, 84, 84, 84, 84, 84, 84, 84, 84, 43, 43, 43, 84, 81, 84, 84, 84, 87, 83, 89, 85, 85, 85, 87, 84, 85, 86, 84, 85, 85, 84, 85, 84, 84, 84, 85, 84, 85, 84, 84, 85, 59, 66, 85, 86, 85, 85, 85, 85, 85, 84, 85, 86, 86, 85, 86, 86, 84, 86, 86, 37, 37, 139, /* following four rows (chars. 128..159) are inaccessible */ 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 35, 35, 35, 35, 27, 27, 27, 27, 85, 84, /* printable 8-bit range */ 85, 85, 85, 85, 85, 85, 86, 85, 85, 134, 85, 102, 134, 86, 86, 85, 84, 84, 85, 172, 85, 85, 66, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 83, 83, 83, 83, 84, 84, 84, 0, 28, 2, 23, 24, 24, 24, 23, 24, 24, 24, 85, 85, 85, 85, 85, 85, 86, 102, 85, 85, 83, 83, 86, 86, 82, 82, 82, 82, 88, 88, 86, 86, 89, 89, 89, 89, 86, 86, 97, 97, 86, 97, 85, 84, 85, 84, 49, 49, 72, 72, 86, 86, 62 }, 14, 1, false, }, { "Symbol", /* #44 */ NULL, NULL, "symbol-medium-r-normal", "Symbol", NULL, "normal", "normal", "normal", "5 5 1 2 1 7 6 2 5 7", /* Panose for Symbol font */ 16686, 1, 0, 0, 621, 945, 284, 685, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 713, 500, 549, 833, 778, 439, 333, 333, 500, 549, 250, 549, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 549, 549, 549, 444, 549, 722, 667, 722, 612, 611, 763, 603, 722, 333, 631, 722, 686, 889, 722, 722, 768, 741, 556, 592, 611, 690, 439, 768, 645, 795, 611, 333, 863, 333, 658, 500, 500, 631, 549, 549, 494, 439, 521, 411, 603, 329, 603, 549, 549, 576, 521, 549, 549, 521, 549, 603, 439, 576, 713, 686, 493, 686, 494, 480, 603, 480, 549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 620, 247, 549, 167, 713, 500, 753, 753, 753, 753, 1042, 987, 603, 987, 603, 400, 549, 411, 549, 549, 713, 494, 460, 549, 549, 549, 549, 1000, 603, 1000, 658, 823, 686, 795, 987, 768, 768, 823, 768, 768, 713, 713, 713, 713, 713, 713, 713, 768, 713, 790, 790, 890, 823, 549, 250, 713, 603, 603, 1042, 987, 603, 987, 603, 494, 329, 790, 790, 786, 713, 384, 384, 384, 384, 384, 384, 494, 494, 494, 603, 762, 329, 274, 686, 384, 686, 384, 384, 384, 384, 494, 384, 494, 494, 494, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* printable ASCII range */ 0, 108, 55, -2, 66, 149, 46, 13, 27, 37, 69, 54, 50, 54, 68, -95, 39, 135, 42, 60, 41, 62, 55, 49, 68, 52, 82, 64, 72, 55, 72, 39, 53, -4, 34, 9, -15, 8, 23, 34, 6, 7, 48, 8, -21, 4, -2, 41, 19, 52, 11, -2, 12, -8, 36, 26, 29, 17, 6, 87, 125, 63, 0, 0, -27, 54, 85, 16, 27, 29, -17, -6, 43, 43, 26, 40, 35, 51, 38, 53, 2, 49, 89, 73, 0, 48, 58, 44, 58, 40, 40, 114, 305, 114, 54, 0, /* following four rows are inaccessible */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* printable 8-bit range */ 0, 0, 55, 43, -46, 13, -34, 31, 118, 68, 104, 181, 102, 145, 106, 145, 41, 54, 50, 42, 90, 59, 29, 106, 54, 55, 54, 54, 193, 305, -108, 14, 127, 20, 50, 219, 68, 68, 162, 150, 150, 25, 44, 45, 42, 45, 131, 152, 54, 36, 42, 42, -31, 47, 96, 73, 119, 66, 66, 132, 104, 135, 104, 135, 19, 14, 42, 42, 9, 58, 2, 2, 2, 2, 2, 2, 233, 51, 233, 272, 53, -14, -98, 305, 330, 6, -15, 330, -15, 46, 233, 46, 51, 233, 51, 0 }, 2, 0, false, }, { NULL, /* DUMMY */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, false, } }; /* Known PCL typefaces. Each plTypefaceInfoStruct contains the following information: (1) number of valid fonts [should be >= 2, since every typeface should include a symbol font (the zeroth font, the 1st listed)] (2) a list of fonts (each number is an index into the _pl_g_pcl_font_info[] array above). The number of valid fonts should be <= PL_MAX_FONTS_PER_TYPEFACE; the initializers are filled out with dummy fonts to get arrays of length PL_MAX_FONTS_PER_TYPEFACE. */ const struct plTypefaceInfoStruct _pl_g_pcl_typeface_info[] = { /* Univers, #0 */ { 5, { 44, 0, 1, 2, 3, 999, 999, 999, 999, 999 } }, /* Univers Condensed, #1 */ { 5, { 44, 4, 5, 6, 7, 999, 999, 999, 999, 999 } }, /* CG Times, #2 */ { 5, { 44, 8, 9, 10, 11, 999, 999, 999, 999, 999 } }, /* Albertus, #3 */ { 5, { 44, 12, 12, 13, 13, 999, 999, 999, 999, 999 } }, /* Antique Olive, #4 */ { 4, { 44, 14, 15, 16, 999, 999, 999, 999, 999, 999 } }, /* Arial, #5 */ { 5, { 44, 17, 18, 19, 20, 999, 999, 999, 999, 999 } }, /* Clarendon, #6 */ { 2, { 44, 21, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Coronet, #7 */ { 2, { 44, 22, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Courier, #8 */ { 5, { 44, 23, 24, 25, 26, 999, 999, 999, 999, 999 } }, /* Garamond, #9 */ { 5, { 44, 27, 28, 29, 30, 999, 999, 999, 999, 999 } }, /* Letter Gothic, #10 */ { 4, { 44, 31, 32, 33, 999, 999, 999, 999, 999, 999 } }, /* Marigold, #11 */ { 2, { 44, 34, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* CG Omega, #12 */ { 5, { 44, 35, 36, 37, 38, 999, 999, 999, 999, 999 } }, /* Times New Roman, #13 */ { 5, { 44, 39, 40, 41, 42, 999, 999, 999, 999, 999 } }, /* Wingdings, #14 */ { 2, { 44, 43, 999, 999, 999, 999, 999, 999, 999, 999 } }, }; /* Known Stick fonts (i.e., device-resident HP vector fonts) that are supported by HP-GL or HP-GL/2. These structures, one per font, are similar to the ones for the PCL fonts, but units are different, as is the interpretation of character `width'. Each character in any Stick font is defined on an abstract raster, of width equal to one-half the font size (by definition). Widths below are measured in terms of raster units. Each width is really the width of a (nominal) bounding box for the character. This is NOT the same as the character cell width, i.e., the logical width of the character in the PS sense. The reason that we tabulate bounding box widths here is that HP originally had no notion of logical width at all. For the Stick fonts as for the PCL fonts, native HP-GL or HP-GL/2 rendering begins at the `first ink' for the character, i.e., at the left edge of the bounding box, _not_ at the left edge of the character cell for the character (as in PS). This is an old pen plotter convention. The bounding box width is the distance between first ink and last ink. There is a separate `offset' field, measured in the same units, which measures the offset from the left edge of the character cell to the left edge of the bounding box, and the right edge of the bounding box to the right edge of the character cell. This was a later addition of HP's, for the (lamebrained) HP-GL/2 emulation performed by LaserJets. Apparently, HP added it to make the device-resident metrics for the Stick fonts similar to those for the PCL fonts. This offset, in LaserJets, must be the same for all characters in a character set. So relative to PS-style rendering, the `offset' field is the amount in abstract raster units by which a LaserJet renderer automatically shifts leftwards before rendering the character, to make the first ink appear at the current point. (In a sense, the abstract raster on which each character is defined has an unoccupied border to its left, of width equal to this offset.) We undo this leftward shift before rendering any string, by shifting rightwards. This `rightward shift' procedure is the same as the one we use for the PCL fonts (see h_text.c, where stick fonts as well as PCL fonts are rendered). For example, the standard fixed-width Stick font (whose name is also `Stick') is defined on a 32x32 abstract raster. Each character has nominal bounding box width of 32. The abstract raster is effectively the left 2/3 of a character cell, and the character cell width of each character is 48, in these units. The `offset' is 8, since 8 + 32 + 8 = 48. The nominal font size [measured horizontally] is 64 = 2 * 32, in accordance with the HP convention that the nominal font size equals twice the raster width. Similarly, the variable-width `Arc' font is defined on an abstract raster, of notional size 28x36. Most characters are narrower than 28 units; some stick out beyond the right edge of the raster. The offset is 5, so by adding 5 + 5 = 10 to the bounding box width for a character, you can get its cell width. These cell widths are character-dependent, unlike the case of the `Stick' font. The nominal font size for the Arc font [measured horizontally] is 56 = 2 * 28. In HP literature a nominal character cell width for the Arc font is sometimes given as 42 raster units. This is 2/3 of 56, i.e., 2/3 of the font size, just as for the `Stick' font. For any font, the abstract raster is mapped to device space by appropriate scaling in the x and y directions, the `natural' mapping being one where the mapped raster has a height equal to 1.4 = 7/5 (or maybe 10/7?) times its width. The value 1.4 is HP magic; we use it when we select a stick font, in h_font.c. The preceding explanation is fully valid only for the (lamebrained) HP-GL/2 emulation performed by LaserJets. In genuine HP-GL/2 (and also in earlier versions of HP-GL, such as the HP7550A version), Stick fonts were handled in a more sophisticated way. Instead of the distance between any two successive characters' bounding boxes being a fixed amount, namely 2 * offset, this distance was computed from device-resident lookup tables. I.e., the character sets in HP-GL/2 were automatically kerned. There were at least three device-resident `spacing tables': (1) a trivial spacing table for the fixed width character sets (which we now use in our Stick* fonts), (2) a spacing table used by most variable-width character sets (such as those now used in our Arc* fonts), (3) a spacing table for the Japanese Katakana character set (which we now use as the upper half of our ArcANK* fonts). Three different tables were needed, because these three sorts of character set were defined on abstract rasters of different widths: 32, 28, and 30, respectively. These three spacing tables were indexed by `row class' and `character class', i.e., `right edge class' and `left edge class' for the character. For details, see "Firmware Determines Plotter Personality", by L. W. Hennessee, A. K. Frankel, M. A. Overton, and R. B. Smith, Hewlett-Packard Journal, Nov. 1981, pp. 16-25. (There was an additional difference between LaserJet HP-GL/2 emulation and true HP-GL[/2]. In true HP-GL[/2], the width of each space character [i.e., ASCII SP] was 3/2 times as wide. Yes, even for the fixed-width character sets; the spacing tables compensated for that.) Below in this file, after the fonts and the character width information, we include the relevant kerning tables and spacing tables. Each font half (i.e., the lower half or upper half of a font) uses a kerning table. A kerning table maps each character in a 7-bit (i.e., 128-character) character set to its row class and column class. The kerning table also includes a pointer to the appropriate spacing table, which as noted is indexed by row class and column class. So when computing the spacing between two successive characters in a label, double indirection must be used. */ /* IMPORTANT: The fonts in this array may be referred to elsewhere in the code by number. If you change the numbering of Stick fonts, i.e., the order in which they appear in this array, be sure to update, e.g., the definitions PL_DEFAULT_STICK_FONT_INDEX, etc. in extern.h. */ const struct plStickFontInfoStruct _pl_g_stick_font_info[] = { { "Arc", /* #0 (our numbering) */ true, /* basic font */ 49, 1, 0, 0, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), /* 40 = height of top of parenthesis */ (int)(1000 * 1.4 * 9.0 / 64.0), /* 9 = depth of descender of `p' and `q' */ 28, 36, /* raster size = 28x36 (for lower half)*/ 28, 36, /* raster size = 28x36 (for upper half) */ 10, 17, /* charset numbers (pre-HP-GL/2) */ 6, 7, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 20, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 29, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 22, 29, 30, 25, 1, 24, 16, 28, 21, 26, 28, 28, 28, 42, 6, 26, 28, 28, 10, 26, 23, 2, 28, 28, 22, 26, 21, 21, 26, 20, 30, 30, 30, 30, 30, 30, 31, 34, 24, 24, 24, 24, 10, 10, 16, 16, 34, 27, 34, 34, 34, 34, 34, 28, 32, 26, 26, 26, 26, 28, 30, 23, 20, 20, 20, 20, 20, 20, 28, 22, 23, 23, 23, 23, 10, 10, 10, 17, 22, 18, 24, 24, 24, 24, 24, 28, 24, 18, 18, 18, 18, 20, 22, 20}, 5, /* offset */ 0, 1, false, true, }, { "Arc-Oblique", /* #1 */ true, /* basic font */ 49, 1, 0, 0, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), (int)(1000 * 1.4 * 9.0 / 64.0), 28, 36, /* raster size = 28x36 (for lower half)*/ 28, 36, /* raster size = 28x36 (for upper half) */ 10, 17, /* charset numbers (pre-HP-GL/2) */ 6, 7, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 20, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 29, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 22, 29, 30, 25, 1, 24, 16, 28, 21, 26, 28, 28, 28, 42, 6, 26, 28, 28, 10, 26, 23, 2, 28, 28, 22, 26, 21, 21, 26, 20, 30, 30, 30, 30, 30, 30, 31, 34, 24, 24, 24, 24, 10, 10, 16, 16, 34, 27, 34, 34, 34, 34, 34, 28, 32, 26, 26, 26, 26, 28, 30, 23, 20, 20, 20, 20, 20, 20, 28, 22, 23, 23, 23, 23, 10, 10, 10, 17, 22, 18, 24, 24, 24, 24, 24, 28, 24, 18, 18, 18, 18, 20, 22, 20}, 5, /* offset */ 0, 2, true, true, }, { "Arc-Bold", /* #2 */ true, /* basic font */ 49, 1, 0, 3, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), (int)(1000 * 1.4 * 9.0 / 64.0), 28, 36, /* raster size = 28x36 (for lower half)*/ 28, 36, /* raster size = 28x36 (for upper half) */ 10, 17, /* charset numbers (pre-HP-GL/2) */ 6, 7, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 20, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 29, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 22, 29, 30, 25, 1, 24, 16, 28, 21, 26, 28, 28, 28, 42, 6, 26, 28, 28, 10, 26, 23, 2, 28, 28, 22, 26, 21, 21, 26, 20, 30, 30, 30, 30, 30, 30, 31, 34, 24, 24, 24, 24, 10, 10, 16, 16, 34, 27, 34, 34, 34, 34, 34, 28, 32, 26, 26, 26, 26, 28, 30, 23, 20, 20, 20, 20, 20, 20, 28, 22, 23, 23, 23, 23, 10, 10, 10, 17, 22, 18, 24, 24, 24, 24, 24, 28, 24, 18, 18, 18, 18, 20, 22, 20}, 5, /* offset */ 0, 3, false, true, }, { "Arc-BoldOblique", /* #3 */ true, /* basic font */ 49, 1, 0, 3, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), (int)(1000 * 1.4 * 9.0 / 64.0), 28, 36, /* raster size = 28x36 (for lower half)*/ 28, 36, /* raster size = 28x36 (for upper half) */ 10, 17, /* charset numbers (pre-HP-GL/2) */ 6, 7, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 20, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 29, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 22, 29, 30, 25, 1, 24, 16, 28, 21, 26, 28, 28, 28, 42, 6, 26, 28, 28, 10, 26, 23, 2, 28, 28, 22, 26, 21, 21, 26, 20, 30, 30, 30, 30, 30, 30, 31, 34, 24, 24, 24, 24, 10, 10, 16, 16, 34, 27, 34, 34, 34, 34, 34, 28, 32, 26, 26, 26, 26, 28, 30, 23, 20, 20, 20, 20, 20, 20, 28, 22, 23, 23, 23, 23, 10, 10, 10, 17, 22, 18, 24, 24, 24, 24, 24, 28, 24, 18, 18, 18, 18, 20, 22, 20}, 5, /* offset */ 0, 4, true, true, }, { "ArcANK", /* #4 (our numbering) */ false, /* not basic font */ 49, 1, 0, 0, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), /* 40 = height of top of parenthesis */ (int)(1000 * 1.4 * 9.0 / 64.0), /* 9 = depth of descender of `p' and `q' */ 28, 36, /* raster size = 28x36 (for lower half)*/ 30, 36, /* raster size = 30x36 (for upper half) */ 16, 18, /* charset numbers (pre-HP-GL/2) */ 8, 9, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 25, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 42, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 8, 17, 17, 8, 8, 28, 28, 23, 26, 26, 27, 29, 30, 23, 27, 26, 30, 30, 28, 30, 30, 28, 30, 28, 30, 26, 28, 29, 30, 28, 28, 28, 28, 28, 30, 21, 30, 30, 26, 27, 28, 30, 24, 27, 30, 27, 27, 27, 30, 30, 30, 30, 30, 26, 30, 17, 30, 21, 22, 26, 28, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 5, /* offset */ 1, 1, false, false, }, { "ArcANK-Oblique", /* #5 */ false, /* not basic font */ 49, 1, 0, 0, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), (int)(1000 * 1.4 * 9.0 / 64.0), 28, 36, /* raster size = 28x36 (for lower half)*/ 30, 36, /* raster size = 30x36 (for upper half) */ 16, 18, /* charset numbers (pre-HP-GL/2) */ 8, 9, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 25, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 42, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 8, 17, 17, 8, 8, 28, 28, 23, 26, 26, 27, 29, 30, 23, 27, 26, 30, 30, 28, 30, 30, 28, 30, 28, 30, 26, 28, 29, 30, 28, 28, 28, 28, 28, 30, 21, 30, 30, 26, 27, 28, 30, 24, 27, 30, 27, 27, 27, 30, 30, 30, 30, 30, 26, 30, 17, 30, 21, 22, 26, 28, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 5, /* offset */ 1, 2, true, false, }, { "ArcANK-Bold", /* #6 */ false, /* not basic font */ 49, 1, 0, 3, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), (int)(1000 * 1.4 * 9.0 / 64.0), 28, 36, /* raster size = 28x36 (for lower half)*/ 30, 36, /* raster size = 30x36 (for upper half) */ 16, 18, /* charset numbers (pre-HP-GL/2) */ 8, 9, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 25, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 42, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 8, 17, 17, 8, 8, 28, 28, 23, 26, 26, 27, 29, 30, 23, 27, 26, 30, 30, 28, 30, 30, 28, 30, 28, 30, 26, 28, 29, 30, 28, 28, 28, 28, 28, 30, 21, 30, 30, 26, 27, 28, 30, 24, 27, 30, 27, 27, 27, 30, 30, 30, 30, 30, 26, 30, 17, 30, 21, 22, 26, 28, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 5, /* offset */ 1, 3, false, false, }, { "ArcANK-BoldOblique", /* #7 */ false, /* not basic font */ 49, 1, 0, 3, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), (int)(1000 * 1.4 * 9.0 / 64.0), 28, 36, /* raster size = 28x36 (for lower half)*/ 30, 36, /* raster size = 30x36 (for upper half) */ 16, 18, /* charset numbers (pre-HP-GL/2) */ 8, 9, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 30, 26, 34, 28, 24, 22, 34, 26, 1, 18, 26, 21, 34, 27, 34, 23, 32, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 25, 9, 16, 54, 10, 20, 22, 22, 22, 23, 13, 22, 18, 1, 7, 19, 1, 32, 18, 24, 22, 22, 11, 19, 12, 18, 20, 32, 22, 20, 21, 11, 1, 11, 42, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 8, 17, 17, 8, 8, 28, 28, 23, 26, 26, 27, 29, 30, 23, 27, 26, 30, 30, 28, 30, 30, 28, 30, 28, 30, 26, 28, 29, 30, 28, 28, 28, 28, 28, 30, 21, 30, 30, 26, 27, 28, 30, 24, 27, 30, 27, 27, 27, 30, 30, 30, 30, 30, 26, 30, 17, 30, 21, 22, 26, 28, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 5, /* offset */ 1, 4, true, false, }, { "ArcSymbol", /* #8 (our numbering) */ false, /* not basic font */ 49, 1, 0, 0, 595, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 40.0 / 64.0), /* 40 = height of top of parenthesis */ (int)(1000 * 1.4 * 9.0 / 64.0), /* 9 = depth of descender of `p' and `q' */ 28, 36, /* raster size = 28x36 (for lower half) */ 28, 36, /* raster size = 28x36 (for upper half) */ 15, -1, /* charset numbers (pre-HP-GL/2) */ 10, 11, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 10, 28, 26, 27, 28, 3, 8, 8, 26, 28, 3, 28, 2, 20, 26, 9, 22, 24, 29, 23, 25, 23, 24, 25, 2, 3, 27, 27, 27, 20, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 1, 25, 26, 28, 26, 26, 42, 27, 28, 27, 9, 20, 9, 16, 54, 10, 30, 30, 30, 30, 0, 29, 29, 29, 29, 27, 27, 27, 27, 27, 27, 26, 26, 33, 26, 33, 26, 34, 26, 18, 27, 6, 11, 1, 11, 29, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 5, /* offset */ 2, 1, false, false, }, { "Stick", /* #9 (our numbering) */ true, /* basic font */ 48, 0, 0, 0, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), /* 36 = height of top of parenthesis */ (int)(1000 * 1.4 * 8.0 / 64.0), /* 8 = depth of descender of `p' and `q' */ 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 0, 7, /* charset numbers (pre-HP-GL/2) */ 0, 1, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, /* offset */ 3, 1, false, true, }, { "Stick-Oblique", /* #10 */ true, /* basic font */ 48, 0, 0, 0, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), (int)(1000 * 1.4 * 8.0 / 64.0), 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 0, 7, /* charset numbers (pre-HP-GL/2) */ 0, 1, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, /* offset */ 3, 2, true, true, }, { "Stick-Bold", /* #11 */ true, /* basic font */ 48, 0, 0, 3, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), (int)(1000 * 1.4 * 8.0 / 64.0), 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 0, 7, /* charset numbers (pre-HP-GL/2) */ 0, 1, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, /* offset */ 3, 3, false, true, }, { "Stick-BoldOblique", /* #12 */ true, /* basic font */ 48, 0, 0, 3, 277, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), (int)(1000 * 1.4 * 8.0 / 64.0), 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 0, 7, /* charset numbers (pre-HP-GL/2) */ 0, 1, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, /* offset */ 3, 4, true, true, }, { "StickANK", /* #13 (our numbering) */ false, /* not basic font */ 48, 0, 0, 0, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), /* 36 = height of top of parenthesis */ (int)(1000 * 1.4 * 8.0 / 64.0), /* 8 = depth of descender of `p' and `q' */ 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 6, 8, /* charset numbers (pre-HP-GL/2) */ 2, 3, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, /* offset */ 4, 1, false, false, }, { "StickANK-Oblique", /* #14 */ false, /* not basic font */ 48, 0, 0, 0, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), (int)(1000 * 1.4 * 8.0 / 64.0), 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 6, 8, /* charset numbers (pre-HP-GL/2) */ 2, 3, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, 4, 2, true, false, }, { "StickANK-Bold", /* #15 */ false, /* not basic font */ 48, 0, 0, 3, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), (int)(1000 * 1.4 * 8.0 / 64.0), 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 6, 8, /* charset numbers (pre-HP-GL/2) */ 2, 3, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, 4, 3, false, false, }, { "StickANK-BoldOblique", /* #16 */ false, /* not basic font */ 48, 0, 0, 3, 11, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), (int)(1000 * 1.4 * 8.0 / 64.0), 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 6, 8, /* charset numbers (pre-HP-GL/2) */ 2, 3, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 8, 4, 4, true, false, }, { "StickSymbol", /* #17 (our numbering) */ false, /* not basic font */ 48, 0, 0, 0, 595, /* HP-GL/2 t'face, spacing, italic, wt., symset */ (int)(1000 * 1.4 * 36.0 / 64.0), /* 36 = height of top of parenthesis */ (int)(1000 * 1.4 * 8.0 / 64.0), /* 8 = depth of descender of `p' and `q' */ 32, 32, /* raster size = 32x32 (for lower half) */ 32, 32, /* raster size = 32x32 (for upper half) */ 5, -1, /* charset numbers (pre-HP-GL/2) */ 4, 5, /* kerning tables */ { /* lower half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 0, /* upper half */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 8, /* offset */ 5, 1, false, false, }, { NULL, /* DUMMY */ false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* kerning tables */ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0, false, false } }; /* Known HP vector typefaces. Each plTypefaceInfoStruct contains the following information: (1) number of valid fonts [should be >= 2, since every typeface should include a symbol font (the zeroth font, the 1st listed)] (2) a list of fonts (each number is an index into the _pl_g_pcl_font_info[] array above). The number of valid fonts should be <= PL_MAX_FONTS_PER_TYPEFACE; the initializers are filled out with dummy fonts to get arrays of length PL_MAX_FONTS_PER_TYPEFACE. */ const struct plTypefaceInfoStruct _pl_g_stick_typeface_info[] = { /* Arc, #0 */ { 5, { 0, 0, 1, 2, 3, 999, 999, 999, 999, 999 } }, /* ArcANK, #1 */ { 5, { 4, 4, 5, 6, 7, 999, 999, 999, 999, 999 } }, /* ArcSymbol, #2 */ { 2, { 8, 8, 999, 999, 999, 999, 999, 999, 999, 999 } }, /* Stick, #3 */ { 5, { 9, 9, 10, 11, 12, 999, 999, 999, 999, 999 } }, /* StickANK, #4 */ { 5, { 13, 13, 14, 15, 16, 999, 999, 999, 999, 999 } }, /* StickSymbol, #5 */ { 2, { 17, 17, 999, 999, 999, 999, 999, 999, 999, 999 } }, }; /* Kerning information for upper and lower halves of the Stick fonts, in HP-GL/2 and pre-HP-GL/2, e.g., in the HP7550A pen plotter. For background info, see "Firmware Determines Plotter Personality", by L. W. Hennessee, A. K. Frankel, M. A. Overton, and R. B. Smith, Hewlett-Packard Journal, Nov. 1981, pp. 16-25. Each kerning table specifies (1) an HP spacing table [see below], and (2) a map that takes each character in a 128-character font half to the appropriate row class and column class, i.e., to its `right edge class' and `left edge class'. Each of HP's spacing tables is indexed by row class and column class. The map from characters to row/column classes depends on our reencoding, if any. I.e., HP wouldn't necessarily recognize the kerning tables, unlike the underlying spacing tables. For example, several of the kerning tables identified as `upper half' are indexed by characters in the upper half of the ISO-Latin-1 encoding. We elsewhere map our ISO-Latin-1 fonts into HP's native Roman-8 encoding (see h_roman8.h), which is why we index by ISO-Latin-1 rather than Roman-8 here. */ /* our numbering of HP's spacing tables (see below) */ #define SPACING_FIXED_WIDTH 0 #define SPACING_VARIABLE_WIDTH 1 #define SPACING_VARIABLE_WIDTH_KATAKANA 2 /* kerning tables for 128-character font halves */ const struct plStickFontSpacingTableStruct _pl_g_stick_kerning_tables[] = { /* kerning table #0, used for lower half of our 4 basic Stick fonts (ASCII encoding) */ { SPACING_FIXED_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, }, /* kerning table #1, used for upper half of our 4 basic Stick fonts (ISO-Latin-1 encoding) */ { SPACING_FIXED_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, }, /* kerning table #2, used for lower half of StickANK (JIS ASCII encoding) */ { SPACING_FIXED_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, }, /* kerning table #3, used for upper half of StickANK (half-width Katakana encoding, also called `Kana-7') */ { SPACING_FIXED_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, }, /* kerning table #4, used for lower half of StickSymbol (HP's `Special Symbols' encoding; same as ASCII except that A..O are centered marker symbols; P, Q are misc. chars, a..z are mathematical symbols) */ { SPACING_FIXED_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }, }, /* kerning table #5, used for upper half of StickSymbol (empty) */ { SPACING_FIXED_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }, /* kerning table #6, used for lower half of our 4 basic Arc fonts (ASCII encoding) */ { SPACING_VARIABLE_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 3, 4, 5, 6, 1, 6, 1, 7, 6, 8, 9, 2,10,11,12,11, 2,12, 1, 1, 6, 6, 6,13, 6,14,13, 4, 4,15,16,15, 1, 1,15,17, 3, 1, 1, 4, 16,18,13,13, 7,15, 7, 7, 17, 7,17, 3, 1, 1,14, 3, 7,19, 5, 5,20, 5,21,20, 22,20,20,23,20,22,22, 5, 5,20,21,19,21,20,23,23, 23,23,23, 3, 1,13, 6, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 3, 4, 5, 6, 1, 6, 1, 7, 6, 8, 9, 2,10, 9, 6, 8, 2, 2, 1, 1, 6, 6, 6,11, 6, 7,12, 3,12,12,12, 3, 12,12, 4,12,12,12,12, 3, 12, 3,12,11,13,14,13,13, 15,13,15,12,13,13, 7, 4, 13,16, 1, 5, 5, 5,17, 5, 1, 1,18, 1, 1, 1, 1, 5, 1, 5, 1,16,17,16,19,19, 20,19,20,11,12,13, 6, 0 } }, /* kerning table #7, used for upper half of our 4 basic Arc fonts (ISO-Latin-1 encoding) */ { SPACING_VARIABLE_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 2,18, 7, 1, 2, 4, 0,19, 2, 0, 6, 0, 3, 1, 6, 0, 0, 4, 0, 0, 0, 0, 0, 5, 2, 2, 2, 0,13, 14,14,14,14,14,14,15, 4, 15,15,15,15, 1, 1, 1, 1, 4, 1, 4, 4, 4, 4, 4, 0, 18,15,15,15,15, 0,16,13, 19,19,19,19,19,19, 5, 5, 5, 5, 5, 5,21,21,21,21, 21,22, 5, 5, 5, 5, 5, 0, 5,20,20,20,20, 0, 5,23 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 2, 3,13,12, 2, 1, 0,16, 2, 0, 6, 0, 4, 1, 6, 0, 0, 1, 0, 0, 0, 0, 0, 5, 2, 2, 2, 0,11, 7, 7, 7, 7, 7, 7, 7, 3, 12,12,12,12,12,12,12,12, 13,12, 3, 3, 3, 3, 3, 0, 3,14,14,14,14, 0,13,12, 16,16,16,16,16,16,16, 5, 5, 5, 5, 5,17,17,17,17, 5, 1, 5, 5, 5, 5, 5, 0, 5,16,16,16,16, 0, 1,19 } }, /* kerning table #8, used for lower half of ArcANK (JIS ASCII encoding; same as basic lower-half Arc font table above except that \ and ~ are different characters (yen and overbar respectively) */ { SPACING_VARIABLE_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 3, 4, 5, 6, 1, 6, 1, 7, 6, 8, 9, 2,10,11,12,11, 2,12, 1, 1, 6, 6, 6,13, 6,14,13, 4, 4,15,16,15, 1, 1,15,17, 3, 1, 1, 4, 16,18,13,13, 7,15, 7, 7, 17, 7,17, 3, 7, 1,14, 3, 7,19, 5, 5,20, 5,21,20, 22,20,20,23,20,22,22, 5, 5,20,21,19,21,20,23,23, 23,23,23, 3, 1,13, 3, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 3, 4, 5, 6, 1, 6, 1, 7, 6, 8, 9, 2,10, 9, 6, 8, 2, 2, 1, 1, 6, 6, 6,11, 6, 7,12, 3,12,12,12, 3, 12,12, 4,12,12,12,12, 3, 12, 3,12,11,13,14,13,13, 15,13,15,12,13,13, 7, 4, 13,16, 1, 5, 5, 5,17, 5, 1, 1,18, 1, 1, 1, 1, 5, 1, 5, 1,16,17,16,19,19, 20,19,20,11,12,13, 4, 0 } }, /* kerning table #9, used for upper half of ArcANK (half-width Katakana encoding, also called `Kana-7') */ { SPACING_VARIABLE_WIDTH_KATAKANA, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 3, 3, 4, 4, 3, 2, 5, 6, 3, 4, 5, 7, 2, 3, 5, 7, 5, 3, 4, 4, 3, 3, 2, 3, 2, 8, 5, 4, 4, 4, 3, 9, 4, 3, 9, 4, 5, 4, 9, 3, 4, 5, 4, 7, 3, 7, 4, 3, 7, 3, 3,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 1, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 1, 4, 4, 4, 4, 4, 6, 7, 4, 5, 4, 4, 5, 5, 6, 4, 5, 4, 2, 5, 4, 4, 4, 8, 4, 2, 5, 9, 4, 5, 4,10, 3, 4, 5, 4, 4, 4, 2, 4, 2, 2, 4, 4,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, /* kerning table #10, used for lower half of ArcSymbol (HP's `Special Symbols' encoding; same as ASCII except that A..O are centered marker symbols; P, Q are misc. chars, a..z are mathematical symbols) */ { SPACING_VARIABLE_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 3, 4, 5, 6, 1, 6, 1, 7, 6, 8, 9, 2,10,11,12,11, 2,12, 1, 1, 6, 6, 6,13, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1,13,13, 7,15, 7, 7, 17, 7,17, 3, 1, 1,14, 3, 7, 2, 2, 2, 2, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 7, 2, 6, 5, 6, 1, 3, 1,13, 6, 0 }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 3, 4, 5, 6, 1, 6, 1, 7, 6, 8, 9, 2,10, 9, 6, 8, 2, 2, 1, 1, 6, 6, 6,11, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 1,12,11,13,14,13,13, 15,13,15,12,13,13, 7, 4, 13, 2, 2, 2, 2, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,11, 7,13, 2, 7, 5, 7, 1,11,12,13, 6, 0 } }, /* kerning table #11, used for upper half of ArcSymbol font (empty) */ { SPACING_VARIABLE_WIDTH, { /* row classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, { /* column classes */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } } }; /* The following are HP's device-resident spacing tables, as used in the pre-HP-GL/2 HP7550A pen plotter, and presumably in HP-GL/2 devices as well. Order agrees with the SPACING_* definitions above. There are three, because there are three distinct sorts of old-style 7-bit HP character set: (1) fixed width, (2) variable width, and (3) variable width Japanese Katakana. Characters in the three different sorts of character set are defined on abstract rasters of different sizes. Nominal character cell widths are 48 units, 42 units, and 45 units, respectively. Nominal `raster widths' are 2/3 of these: 32 units, 28 units, and 30 units, respectively. Character cell and raster widths are to be taken literally only for the fixed-width character sets. But font size, measured horizontally, is always twice the nominal raster width, i.e., 4/3 times the nominal character cell width. */ /* 2x2 spacing table for fixed-width character sets, which we use in our Stick, StickSymbol, etc. fonts. In these units, character cell width equals 48, and font size (measured horizontally) equals 64. This spacing table is a kludge. The width tables for the `fixed width' character sets don't list every character as having width 48 (the nominal width for the space character is 48, but all other characters have width 32). So this spacing table is employed to fix things up: e.g., the spacing between any two non-space characters is made equal to 16 units. */ const short _pl_g_fixed_width_spacings[] = { 0, 8, 8, 16 }; /* 24x21 spacing table for variable-width character sets (other than variable-width Katakana), which we use in our Arc, ArcSymbol, etc., fonts. In these units, nominal character cell width (see above) equals 42, and font size (measured horizontally) equals 56. */ const short _pl_g_variable_width_spacings[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,14,13,13,10,11,13,11,12,13,12,13,17,11,14,12,13,11,10,11,11, 0,12,18,11, 8,10,18,10,18,18,18,11,13, 9,13,10,11, 9, 6, 9, 8, 0, 8, 8, 6, 6, 8, 6, 7, 8, 8, 7, 8, 9, 3, 9, 7, 8, 3, 3, 3, 8, 0,12,11,11, 8,10,11, 9, 8,10, 9,11,13, 8,12, 9,11,10, 8, 9, 8, 0,12,10,10, 9,10,10, 9, 7, 9, 8,10,12, 6,11, 7,11,10, 8,10,10, 0,12,16,11, 8,10,16, 9,16,16,16,11,13, 8,12, 9,11,10, 8, 9, 8, 0,10, 9, 8, 3, 6, 8, 6, 8, 8, 6, 9,11, 8,11, 9, 6, 8, 6, 7, 7, 0,14,33,13,10,11,33,11,33,33,33,13,17,11,14,12,13,11,10,11,11, 0,10,20,11, 8, 9,20,10,20,20,20,11,13, 8,11, 8,10,10, 7,10, 9, 0,10,13,10, 8, 9,13,10,13,13,13,11,13, 8,11, 8,10,10, 7,10, 9, 0,10,19,10, 8, 9,19,10,19,19,19,11,13, 8,11, 8,10,10, 7,10, 9, 0,12,17,11, 8,10,17, 9,17,17,17,11,13, 8,12, 9,11,10, 8, 9, 8, 0,12,11,11, 8,10,11,10,10,11,10,11,13, 9,13,10,11, 9, 6, 9, 8, 0,11, 9, 9, 7,10, 9, 8, 8,10, 7, 9,11, 6,10, 8,11, 8,10, 8, 8, 0,13,12,12, 9,11,12,11,11,11,11,12,15,11,13,11,11,11,10,11,11, 0,11,10, 9, 7, 8, 9, 7, 8, 9, 8,10,11, 9,11, 9, 8,10, 6, 9, 9, 0,11,10, 9, 7, 7, 9, 8, 9, 8, 7,10,11, 8,11, 9, 8, 6, 8, 7, 8, 0,10,10,11, 9,11,11, 8,10,10,10,10,12, 8,12, 9,11,10, 6, 8, 8, 0,13,11,11,10,11,11, 9, 8,11, 8,11,11, 8,11, 9,11,10, 9,10,11, 0,14,11,12,10,12,12, 9,11,12,10,11,14,11,13,11,12,11,10,11,11, 0,12,10,10, 6, 9,10, 7, 9, 9, 7,10,11, 8,11, 9,10,11, 8,11,10, 0,13,11,11, 9,11,11,10,10,11, 8,11,13, 8,13,10,12,11,10,11,11, 0,11, 9, 9, 6,10, 9, 8, 9, 9, 8, 9,11, 8,11, 8, 9,10, 9, 9, 9 }; /* 11x12 spacing table for the variable-width Katakana character set, which we use as the upper half of our ArcANK font. In these units, nominal character cell width (see above) equals 45, and font size (measured horizontally) equals 60. */ const short _pl_g_variable_width_katakana_spacings[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,14,10,10,10,10,10,10,10,10,10, 0, 10,14,6, 10,10,6, 10,2, 10,10,2, 0, 10,14,10,10,10,10,10,6, 10,10,0, 0, 10,14,10,10,10,10,10,10,6, 10,0, 0, 6, 14,2, 10,10,6, 6, 2, 6, 6, 0, 0, 10,14,6, 10,10,6, 6, 6, 6, 10,10, 0, 10,14,10,14,14,10,10,10,10,14,0, 0, 10,14,6, 10,10,6, 10,2, 10,10,0, 0, 10,14,10,10,6, 10,10,10,6, 10,0, 0, 2, 10,2, 10,10,2, 6, 2, 10,2, 10 }; /* array we use to access spacing tables by number */ const struct plStickCharSpacingTableStruct _pl_g_stick_spacing_tables[] = { /* spacing table #0, SPACING_FIXED */ { 2, 2, /* number of rows, cols */ _pl_g_fixed_width_spacings }, /* spacing table #1, SPACING_VARIABLE_WIDTH */ { 24, 21, /* number of rows, cols */ _pl_g_variable_width_spacings }, /* spacing table #2, SPACING_VARIABLE_WIDTH_KATAKANA */ { 11, 12, /* number of rows, cols */ _pl_g_variable_width_katakana_spacings } }; plotutils-2.6/libplot/g_havecap.c0000644000175000017500000000453011037243261014070 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the havecap method, which is a GNU extension to libplot. It queries the current plotter to determine whether or not it has a specified capability, specified by a string. Return value is 0/1/2 (no/yes/maybe). If the capability is not recognized, the return value is 0. */ #include "sys-defines.h" #include "extern.h" int _API_havecap (R___(Plotter *_plotter) const char *s) { if (strcasecmp (s, "WIDE_LINES") == 0) return _plotter->data->have_wide_lines; else if (strcasecmp (s, "SOLID_FILL") == 0) return _plotter->data->have_solid_fill; else if (strcasecmp (s, "DASH_ARRAY") == 0) return _plotter->data->have_dash_array; else if (strcasecmp (s, "EVEN_ODD_FILL") == 0) return _plotter->data->have_odd_winding_fill; else if (strcasecmp (s, "NONZERO_WINDING_NUMBER_FILL") == 0) return _plotter->data->have_nonzero_winding_fill; else if (strcasecmp (s, "SETTABLE_BACKGROUND") == 0) return _plotter->data->have_settable_bg; else if (strcasecmp (s, "HERSHEY_FONTS") == 0) return 1; /* always supported */ else if (strcasecmp (s, "PS_FONTS") == 0) return _plotter->data->have_ps_fonts; else if (strcasecmp (s, "PCL_FONTS") == 0) return _plotter->data->have_pcl_fonts; else if (strcasecmp (s, "STICK_FONTS") == 0) return _plotter->data->have_stick_fonts; else if (strcasecmp (s, "EXTRA_STICK_FONTS") == 0) return _plotter->data->have_extra_stick_fonts; else return 0; } plotutils-2.6/libplot/g_her_glyph.c0000644000175000017500000103746211037243261014455 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the arrays _pl_g_occidental_hershey_glyphs[] and _pl_g_oriental_hershey_glyphs[]. The first array includes the standard (`occidental') Hershey glyphs digitized by Dr. Allen V. Hershey, some glyphs due to other people, and his Japanese Hiragana and Katakana glyphs. The second array includes his digitizations of Japanese ideographic symbols (Kanji glyphs). It originally included the Hiragana and Katakana glyphs as well, but they were moved to the first array because some people may not wish to include Kanji support. Dr. Hershey digitized the glyphs c. 1967, at what is now the U.S. Naval Surface Weapons Center in Dahlgren, Virginia. For many years he distributed copies of the glyphs, and his typographic software, on magnetic tape. Over 120 copies of the tape were distributed. There have been many other distributions of the glyphs. In the 1970's they were incorporated, not always with attribution, in several commercial plotting packages. They were first freely distributed in 1985(?), by being posted to Usenet (to vol. 4 of mod.sources) by Pete Holzmann , then at Octopus Enterprises. In the 1980's the glyphs were incorporated in at least two freeware plotting programs, Nelson Beebe's PLOT79 and Tim Pearson's PGPLOT. The latter is still available (see http://www.astro.caltech.edu/~tjp/pgplot/ ). The standard hardcopy reference for the occidental Hershey glyphs, which tabulates and displays them, is: @TechReport{Wolcott76, author = {Norman M. Wolcott and Joseph Hilsenrath}, title = {A Contribution to Computer Typesetting Techniques: Tables of Coordinates for {Hershey's} Repertory of Occidental Type Fonts and Graphic Symbols}, institution = {U.S. National Bureau of Standards}, year = {1976}, month = {April}, type = {Special Publication}, number = {424}, OPTnote = {US NTIS stock number PB251845}} This publication is available from the NTIS (US National Technical Information Service, +1 703 487 4650). The NTIS stock number is given above. See also Dr. Hershey's original TR, which describes the alphabets from which the glyphs were taken and gives information on the oriental glyphs: @TechReport{Hershey67, author = {Allen V. Hershey}, title = {Calligraphy for Computers}, institution = {U.S. Naval Weapons Laboratory}, address = {Dahlgren, VA}, year = {1967}, type = {Report}, number = {TR--2101}, month = {Aug}, OPTnote = {US NTIS stock number AD662398}} Additional references are given in the file ./doc/hershey.bib. The _pl_g_occidental_hershey_glyphs[] array below was constructed from releases of the Hershey glyphs that are later than the one described in the 1976 NBS publication above. For example, Fig. 15 of that work portrays 43 additional glyphs digitized by Norman Wolcott of the NBS; they are included here. See the file ./doc/hershey-number for details on how the array was assembled. The original Hershey glyphs, including the 43 Wolcott glyphs, are stored in the 0..3999 slots of the array. The _pl_g_occidental_hershey_glyphs[] array also includes non-Hershey glyphs taken from various sources. All post-Hershey glyphs have been placed in slots 4000..4194. This includes a few glyphs taken from the UGS (the Unified Graphics System, developed by Bob Beach at SLAC; see Computer Graphics, Fall 1974, pp. 22-23). As well, it includes some freeware glyphs developed by Thomas Wolff and distributed as part of the Ghostscript distribution. The Beach and Wolff glyphs are used in the Hershey Symbol fonts. Locally developed glyphs (accented characters, in particular) have been added too. The Japanese Hiragana and Katakana glyphs digitized by Dr. Hershey, formerly located among the `oriental' glyphs, are now located in slots 4195..4399 of the _pl_g_occidental_hershey_glyphs[] array. The format of the glyphs in the _pl_g_occidental_hershey_glyphs[] and _pl_g_oriental_hershey_glyphs[] arrays is the format in which the Hershey glyphs were distributed to mod.sources in 1985(?) by Pete Holzmann, and is due to Jim Hurt, then at Cognition Inc. Glyphs are encoded as strings consisting of pairs of printable ascii characters in the range 0x20 to 0x7e, i.e. SP (ascii space) through ~ (ascii tilde). Each character in the range [0x20,0x7e] encodes an integer. The integer may be obtained from the character by subtracting 'R', i.e, 0x52. Integers in the range [-0x32,0x2c], i.e., [-50,44], may be represented in this way. Actually, all integers appearing in the occidental Hershey glyphs are restricted to the range [-41,41], and those in the oriental glyphs are restricted to the range [-12,13]. (Note: the non-Hershey pointing hand glyphs in slots 4040..4043 of the _pl_g_occidental_hershey_glyphs[] array, which are due to Nelson Beebe, include integers drawn from the range [-50,50]. So the four corresponding strings include characters drawn from outside the printable ASCII range, e.g. \204 (i.e. 0x84), which represents 50.) The first two characters in each string encode the x range (xinit,xfinal) of a glyph. (The `width' of the glyph, as distinct from the x extent of its bounding box, is xfinal - xinit.) Subsequent pairs encode (x1,y1),(x2,y2),(x3,y3),..., i.e., the coordinates of points. The glyph is drawn by moving to (x1,y1), stroking a vector to (x2,y2), stroking a vector to (x3,y3), etc. The pair (-50,0), which is encoded as the pair of characters " R", if encountered in the string is interpreted as a `pen up' command: the vector immediately following should be drawn with pen up, i.e., should be interpreted as a motion command rather than a drawing command. (The pair (-50,0) could conceivably appear in the abovementioned pointing hand glyphs as the coordinates of a vector endpoint, but fortunately it does not. So Jim Hurt's encoding scheme works, even for the four pointing hands.) */ #include "sys-defines.h" #include "extern.h" #define NUM_OCCIDENTAL_HERSHEY_GLYPHS 4400 /*should agree with val in g_cntrlify.c */ #define NUM_ORIENTAL_HERSHEY_GLYPHS 5500 /* should agree with value in g_cntrlify.c */ const char * const _pl_g_occidental_hershey_glyphs[NUM_OCCIDENTAL_HERSHEY_GLYPHS] = { /******** Hershey Glyphs 0 to 99 ********/ "", "MWRMNV RRMVV RPSTS", "MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV", "MXVNTMRMPNOPOSPURVTVVU", "MWOMOV ROMRMTNUPUSTURVOV", "MWOMOV ROMUM ROQSQ ROVUV", "MVOMOV ROMUM ROQSQ", "MXVNTMRMPNOPOSPURVTVVUVR RSRVR", "MWOMOV RUMUV ROQUQ", "PTRMRV", "NUSMSTRVPVOTOS", "MWOMOV RUMOS RQQUV", "MVOMOV ROVUV", "LXNMNV RNMRV RVMRV RVMVV", "MWOMOV ROMUV RUMUV", "MXRMPNOPOSPURVSVUUVSVPUNSMRM", "MWOMOV ROMSMUNUQSROR", "MXRMPNOPOSPURVSVUUVSVPUNSMRM RSTVW", "MWOMOV ROMSMUNUQSROR RRRUV", "MWUNSMQMONOOPPTRUSUUSVQVOU", "MWRMRV RNMVM", "MXOMOSPURVSVUUVSVM", "MWNMRV RVMRV", "LXNMPV RRMPV RRMTV RVMTV", "MWOMUV RUMOV", "MWNMRQRV RVMRQ", "MWUMOV ROMUM ROVUV", "MWRMNV RRMVV RPSTS", "MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV", "MVOMOV ROMUM", "MWRMNV RRMVV RNVVV", "MWOMOV ROMUM ROQSQ ROVUV", "MWUMOV ROMUM ROVUV", "MWOMOV RUMUV ROQUQ", "MXRMPNOPOSPURVSVUUVSVPUNSMRM RQQTR RTQQR", "PTRMRV", "MWOMOV RUMOS RQQUV", "MWRMNV RRMVV", "LXNMNV RNMRV RVMRV RVMVV", "MWOMOV ROMUV RUMUV", "MWOMUM RPQTR RTQPR ROVUV", "MXRMPNOPOSPURVSVUUVSVPUNSMRM", "MWOMOV RUMUV ROMUM", "MWOMOV ROMSMUNUQSROR", "MWOMRQOV ROMUM ROVUV", "MWRMRV RNMVM", "MWNONNOMPMQNRPRV RVOVNUMTMSNRP", "LXRMRV RPONPNSPTTTVSVPTOPO", "MWOMUV RUMOV", "LXRMRV RNOOPOSQTSTUSUPVO", "MXOVQVOROPPNRMSMUNVPVRTVVV", "MWSMMV RSMUV ROSTS", "MWQMNV RQMTMVNVPSQPQ RSQURUTTURVNV", "LXVPUNTMRMPNOONQNSOUPVRVTUUT", "MXQMNV RQMUMVOVQUTTURVNV", "MVQMNV RQMVM RPQSQ RNVSV", "MVQMNV RQMVM RPQSQ", "LXVPUNTMRMPNOONQNSOUPVRVTUUSRS", "MXQMNV RWMTV RPQUQ", "PUTMQV", "OVUMSSRUQVPVOUOT", "MVQMNV RVMOS RRQTV", "NVRMOV ROVTV", "LYPMMV RPMQV RXMQV RXMUV", "MXQMNV RQMTV RWMTV", "LXRMPNOONQNSOUPVRVTUUTVRVPUNTMRM", "MWQMNV RQMUMVNVPUQSRPR", "LXRMPNOONQNSOUPVRVTUUTVRVPUNTMRM RQVPUPTQSRSSTTVUWVW", "MWQMNV RQMUMVNVPUQSRPR RQRRUSVTVUU", "MWVNTMRMPNPPQQTRUSUUSVPVNU", "MVSMPV RPMVM", "LXPMNSNUOVRVTUUSWM", "MWOMQV RWMQV", "KXNMNV RSMNV RSMSV RXMSV", "NWQMTV RWMNV", "NWQMSQQV RWMSQ", "MWQMWMNVTV", "", "", "", "", "", "", "LXNMRV RVMRV RNMVM", "MWNLVX", "LXRONU RROVU", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 100 to 199 ********/ "", "NWQPTPUQUV RURQSPTPUQVSVUU", "MWOMOV ROSPURVTUUSTQRPPQOS", "MWUQSPRPPQOSPURVSVUU", "MWUMUV RUSTQRPPQOSPURVTUUS", "MWOSUSTQRPPQOSPURVTV", "NVUNTMSMRNRV RPPTP", "MWUPUVTXRYPY RUSTQRPPQOSPURVTUUS", "MWOMOV ROSPQRPTQUSUV", "PTRLQMRNSMRL RRPRV", "PUSLRMSNTMSL RSPSXRYQYPX", "NWPMPV RUPPT RRSUV", "PTRMRV", "KYMPMV RMSNQOPPPQQRSRV RRSSQTPUPVQWSWV", "MWOPOV ROSPQRPTQUSUV", "MWRPPQOSPURVTUUSTQRP", "MWOPOY ROSPURVTUUSTQRPPQOS", "MWUPUY RUSTQRPPQOSPURVTUUS", "NVPPPV RPSQQSPTP", "NWUQTPQPPQPRQSTSUTUUTVQVPU", "NVRMRUSVTVUU RPPTP", "MWUPUV ROPOSPURVTUUS", "NVOPRV RUPRV", "LXNPPV RRPPV RRPTV RVPTV", "MWOPUV RUPOV", "MWOPRV RUPRVQXPYOY", "MWOPUPOVUV", "MXVPUSTURVPUOSPQRPTQUUVV", "MWOTQVSVTUTSSRPQRQTPUOUNTMRMQNPPOTNY", "MXNQOPQPRQRSQW RVPURSTQWPY", "MWTNSMRMQNQORPTQUSTURVPUOSPQRP", "NWUQSPQPPQPRQS RSSQSPTPUQVSVUU", "NWTMSNSOTP RUPSPQQPSPUQVSWSXRYQY", "LXNQOPPPQQQSPV RQSRQTPUPVQVSUVTY", "LXNQOPPPQQQURVSVTUUSVPVNUMTMSNSPTRUSWT", "OVRPQSQURVSVTU", "MWQPOV RUPTPRQPS RPSQUSVTV", "MWOMPMQNRPUV RRPOV", "LYPPMY RUPTSSUQVPVOUOS RTSTUUVVVWU", "MWNPOPOV RUPTSRUOV", "NWTMSNSOTP RUPSPQQQRRSTS RSSQTPUPVQWSXSYRZQZ", "MWRPPQOSPURVTUUSTQRP", "MXOQQPVP RQPQRPV RTPTRUV", "MWOSPURVTUUSTQRPPQOSNY", "MXVPRPPQOSPURVTUUSTQRP", "MXOQQPVP RSPRV", "KXMQNPOPPQPUQVSVTUUSVP", "MXPPOQOSPURVSVUUVSVQUPTPSQRSQY", "MWOPPPQQSXTYUY RUPTRPWOY", "KYTMRY RMQNPOPPQPUQVTVUUVSWP", "LXOPNRNTOVQVRTRR RUPVRVTUVSVRT", "LWTSSQQPOQNSOUQVSUTS RUPTSTUUVVV", "MWQMOSPURVTUUSTQRPPQOS", "MWUQSPRPPQOSPURVTV", "LWTSSQQPOQNSOUQVSUTS RVMTSTUUVVV", "MWOSTSURUQSPRPPQOSPURVTV", "OVVMUMTNSPQVPXOYNY RQPUP", "MXUSTQRPPQOSPURVTUUS RVPTVSXRYPYOX", "MVQMNV ROSPQQPSPTQTRSTSUTVUV", "PUSMSNTNTMSM RQPRPSQSRRTRUSVTV", "OUSMSNTNTMSM RQPRPSQSRRVQXPYOYNX", "NVRMOV RUPTPRQPS RPSQUSVTV", "OTSMQSQURVSV", "JYKPLPMQMSLV RMSNQOPQPRQRSQV RRSSQTPVPWQWRVTVUWVXV", "MWNPOPPQPSOV RPSQQRPTPUQURTTTUUVVV", "MWRPPQOSPURVTUUSTQRP", "MXNPOPPQPSNY RPSQUSVUUVSUQSPQQPS", "MXUSTQRPPQOSPURVTUUS RVPSY", "MVOPPPQQQSPV RUQTPSPRQQS", "NVTQSPQPPQPRQSRSSTSURVPVOU", "NUSMQSQURVSV RPPTP", "MWNPOPPQPROTOUPVRVSUTS RUPTSTUUVVV", "MWNPOPPQPROTOUPVRVTUURUP", "KYLPMPNQNRMTMUNVPVQURSSP RRSRUSVUVVUWRWP", "MWOQPPQPRQRUSVTVUU RVQUPTPSQQUPVOVNU", "MWNPOPPQPROTOUPVRVSUTS RUPSVRXQYOYNX", "NVUPOV RPQQPSPTQ RPUQVSVTU", "", "", "", "", "", "", "MWUSTQRPPQOSPURVTUUSUPTNRMQM", "MWUQSPRPPQOSPURVSVUU ROSSS", "MWRMQNPPOSOVPWRWSVTTUQUNTMRM RPRTR", "MWTMQY RRPPQOSPURVSVUUVSUQSPRP", "MWUQSPQPOQOSPTRUSVSWRXQX", "", "", "KYTPTSUTVTWSWQVOUNSMQMONNOMQMSNUOVQWSWUV RTQSPQPPQPSQTSTTS", "MWUNORUV", "MWONUROV", "OUTKQKQYTY", "OUPKSKSYPY", "OUTKSLRNROSQQRSSRURVSXTY", "OUPKQLRNROQQSRQSRURVQXPY", "LYPMQNQOPPOPNONNOMPMSNUNWMNV RUSTTTUUVVVWUWTVSUS", "PT", "NV", /******** Hershey Glyphs 200 to 299 ********/ "MWRMPNOPOSPURVTUUSUPTNRM", "MWPORMRV", "MWONQMSMUNUPTROVUV", "MWONQMSMUNUPSQ RRQSQURUUSVQVOU", "MWSMSV RSMNSVS", "MWPMOQQPRPTQUSTURVQVOU RPMTM", "MWTMRMPNOPOSPURVTUUSTQRPPQOS", "MWUMQV ROMUM", "MWQMONOPQQSQUPUNSMQM RQQOROUQVSVUUURSQ", "MWUPTRRSPROPPNRMTNUPUSTURVPV", "PURURVSVSURU", "PUSVRVRUSUSWRY", "PURPRQSQSPRP RRURVSVSURU", "PURPRQSQSPRP RSVRVRUSUSWRY", "PURMRR RSMSR RRURVSVSURU", "NWPNRMSMUNUPRQRRSRSQUP RRURVSVSURU", "PTRMRQ", "NVPMPQ RTMTQ", "NVQMPNPPQQSQTPTNSMQM", "MWRKRX RUNSMQMONOPQQTRUSUUSVQVOU", "MWVLNX", "OUTKRNQQQSRVTY", "OUPKRNSQSSRVPY", "PTRKRY", "LXNRVR", "LXRNRV RNRVR", "LXNPVP RNTVT", "MWOOUU RUOOU", "MWRORU ROPUT RUPOT", "PURQRRSRSQRQ", "PUSMRORQSQSPRP", "PUSNRNRMSMSORQ", "LXSOVRSU RNRVR", "MXQLQY RTLTY ROQVQ ROTVT", "LXVRURTSSURVOVNUNSORRQSPSNRMPMONOPQSSUUVVV", "LXNNOQOSNV RVNUQUSVV RNNQOSOVN RNVQUSUVV", "LYRQQPOPNQNSOTQTRSSQTPVPWQWSVTTTSSRQ", "", "H\\NRMQLRMSNR RVRWQXRWSVR", "H\\MPLQLRMSNSOROQNPMP RMQMRNRNQMQ RWPVQVRWSXSYRYQXPWP RWQWRXRXQWQ", "I[KRYR", "", "H\\RUJPRTZPRU", "", "", "", "", "", "F^ISJQLPNPPQTTVUXUZT[Q RISJPLONOPPTSVTXTZS[Q RIYJWLVNVPWTZV[X[ZZ[W RIYJVLUNUPVTYVZXZZY[W", "", "F^ISJQLPNPPQTTVUXUZT[Q RISJPLONOPPTSVTXTZS[Q RIW[W RI[[[", "", "CaGO]OXI RL[GU]U", "", "D`F^^^^FFFF^", "", "KYQVOUNSNQOOQNSNUOVQVSUUSVQV RSVVS RQVVQ ROUUO RNSSN RNQQN", "", "H\\IR[R", "H\\IR[R RIQ[Q", "", "LYPFSCSP RRDRP ROPVP RMRXR ROVOWNWNVOUQTTTVUWWVYTZQ[O\\N^Na RTTUUVWUYTZ RN`O_P_S`V`W_ RP_SaVaW_W^", "LYPFSCSP RRDRP ROPVP RMRXR ROVOWNWNVOUQTTTVUWWVYTZ RTTUUVWUYTZ RRZTZV[W]W^V`TaQaO`N_N^O^O_ RTZU[V]V^U`Ta", "LYPFSCSP RRDRP ROPVP RMRXR RVVVWWWWVVUTTRTPUOVNYN^O`QaTaV`W^W\\VZTYQYN[ RRTPVOYO^P`Qa RTaU`V^V\\UZTY", "LYPFSCSP RRDRP ROPVP RMRXR RQTOUNWOYQZTZVYWWVUTTQT RQTPUOWPYQZ RTZUYVWUUTT RQZO[N]N^O`QaTaV`W^W]V[TZ RQZP[O]O^P`Qa RTaU`V^V]U[TZ", "LYOEOFNFNEODQCTCVDWFVHTIQJOKNMNP RTCUDVFUHTI RNOONPNSOVOWN RPNSPVPWNWM RMRXR ROVOWNWNVOUQTTTVUWWVYTZ RTTUUVWUYTZ RRZTZV[W]W^V`TaQaO`N_N^O^O_ RTZU[V]V^U`Ta", "LYOEOFNFNEODQCTCVDWFVHTI RTCUDVFUHTI RRITIVJWLWMVOTPQPOONNNMOMON RTIUJVLVMUOTP RMRXR RQTOUNWOYQZTZVYWWVUTTQT RQTPUOWPYQZ RTZUYVWUUTT RQZO[N]N^O`QaTaV`W^W]V[TZ RQZP[O]O^P`Qa RTaU`V^V]U[TZ", "LYOCNI ROCVC RODSDVC RNIOHQGTGVHWJWMVOTPQPOONNNMOMON RTGUHVJVMUOTP RMRXR RQTOUNWOYQZTZVYWWVUTTQT RQTPUOWPYQZ RTZUYVWUUTT RQZO[N]N^O`QaTaV`W^W]V[TZ RQZP[O]O^P`Qa RTaU`V^V]U[TZ", "LYNCNG RVERLPP RWCTIQP RNEPCRCUE RNEPDRDUEVE RMRXR RQTOUNWOYQZTZVYWWVUTTQT RQTPUOWPYQZ RTZUYVWUUTT RQZO[N]N^O`QaTaV`W^W]V[TZ RQZP[O]O^P`Qa RTaU`V^V]U[TZ", "LYOCNI ROCVC RODSDVC RNIOHQGTGVHWJWMVOTPQPOONNNMOMON RTGUHVJVMUOTP RMRXR RVVVWWWWVVUTTRTPUOVNYN^O`QaTaV`W^W\\VZTYQYN[ RRTPVOYO^P`Qa RTaU`V^V\\UZTY", "LYPFSCSP RRDRP ROPVP RMRXR RSVSa RTTTa RTTM]X] RQaVa", "LYOEOFNFNEODQCTCVDWFVHTI RTCUDVFUHTI RRITIVJWLWMVOTPQPOONNNMOMON RTIUJVLVMUOTP RMRXR RSVSa RTTTa RTTM]X] RQaVa", "F^YXWZU[R[PZMXKWIWHXHZI[K[MZOWPURQTKWGYFZF[G\\H[IZH[G[FZFYFWGVHTLRPPVNZMZ ROPUP", "E^P[MZJXHUGRGOHLJIMGPFTFWGYI[L\\O\\R[UYXVZS[P[ RNJNW ROJOW RLJSJVKWMWNVPSQOQ RSJUKVMVNUPSQ RLWQW RSQTRUVVWWWXV RSQURVVWW", "E^P[MZJXHUGRGOHLJIMGPFTFWGYI[L\\O\\R[UYXVZS[P[ RUKVJVNUKSJPJNKMLLOLRMUNVPWSWUVVT RPJNLMOMRNUPW", "E_IM[M RIR[R RIW[W RK[YI", "CaHQGRHSIRHQ RRQQRRSSRRQ R\\Q[R\\S]R\\Q", "", "E_NWLTIRLPNM RLPJRLT RJRZR RVWXT[RXPVM RXPZRXT", "JZWNTLRIPLMN RPLRJTL RRJRZ RWVTXR[PXMV RPXRZTX", "F^ZJSJOKMLKNJQJSKVMXOYSZZZ RSFS^", "F^JJQJUKWLYNZQZSYVWXUYQZJZ RQFQ^", "F^JJQJUKWLYNZQZSYVWXUYQZJZ RORZR", "", "H\\LBL[ RRBR[ RXBX[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 300 to 399 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 400 to 499 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 500 to 599 ********/ "", "I[RFJ[ RRFZ[ RMTWT", "G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[", "H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV", "G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[", "H[LFL[ RLFYF RLPTP RL[Y[", "HZLFL[ RLFYF RLPTP", "H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS", "G]KFK[ RYFY[ RKPYP", "NVRFR[", "JZVFVVUYTZR[P[NZMYLVLT", "G\\KFK[ RYFKT RPOY[", "HYLFL[ RL[X[", "F^JFJ[ RJFR[ RZFR[ RZFZ[", "G]KFK[ RKFY[ RYFY[", "G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF", "G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ", "G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]", "G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[", "H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX", "JZRFR[ RKFYF", "G]KFKULXNZQ[S[VZXXYUYF", "I[JFR[ RZFR[", "F^HFM[ RRFM[ RRFW[ R\\FW[", "H\\KFY[ RYFK[", "I[JFRPR[ RZFRP", "H\\YFK[ RKFYF RK[Y[", "I[RFJ[ RRFZ[ RMTWT", "G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[", "HYLFL[ RLFXF", "I[RFJ[ RRFZ[ RJ[Z[", "H[LFL[ RLFYF RLPTP RL[Y[", "H\\YFK[ RKFYF RK[Y[", "G]KFK[ RYFY[ RKPYP", "G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF ROPUP", "NVRFR[", "G\\KFK[ RYFKT RPOY[", "I[RFJ[ RRFZ[", "F^JFJ[ RJFR[ RZFR[ RZFZ[", "G]KFK[ RKFY[ RYFY[", "I[KFYF ROPUP RK[Y[", "G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF", "G]KFK[ RYFY[ RKFYF", "G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ", "I[KFRPK[ RKFYF RK[Y[", "JZRFR[ RKFYF", "I[KKKILGMFOFPGQIRMR[ RYKYIXGWFUFTGSIRM", "H\\RFR[ RPKMLLMKOKRLTMUPVTVWUXTYRYOXMWLTKPK", "H\\KFY[ RK[YF", "G]RFR[ RILJLKMLQMSNTQUSUVTWSXQYMZL[L", "H\\K[O[LTKPKLLINGQFSFVGXIYLYPXTU[Y[", "G[G[IZLWOSSLVFV[UXSUQSNQLQKRKTLVNXQZT[Y[", "F]SHTITLSPRSQUOXMZK[J[IZIWJRKOLMNJPHRGUFXFZG[I[KZMYNWOTP RSPTPWQXRYTYWXYWZU[R[PZOX", "H\\TLTMUNWNYMZKZIYGWFTFQGOIMLLNKRKVLYMZO[Q[TZVXWV", "G^TFRGQIPMOSNVMXKZI[G[FZFXGWIWKXMZP[S[VZXXZT[O[KZHYGWFTFRHRJSMUPWRZT\\U", "H\\VJVKWLYLZKZIYGVFRFOGNINLONPOSPPPMQLRKTKWLYMZP[S[VZXXYV", "H\\RLPLNKMINGQFTFXG[G]F RXGVNTTRXPZN[L[JZIXIVJULUNV RQPZP", "G^G[IZMVPQQNRJRGQFPFOGNINLONQOUOXNYMZKZQYVXXVZS[O[LZJXIVIT", "F^MMKLJJJIKGMFNFPGQIQKPONULYJ[H[GZGX RMRVOXN[L]J^H^G]F\\FZHXLVRUWUZV[W[YZZY\\V", "IZWVUTSQROQLQIRGSFUFVGWIWLVQTVSXQZO[M[KZJXJVKUMUOV", "JYT^R[PVOPOJPGRFTFUGVJVMURR[PaOdNfLgKfKdLaN^P\\SZWX", "F^MMKLJJJIKGMFNFPGQIQKPONULYJ[H[GZGX R^I^G]F\\FZGXIVLTNROPO RROSQSXTZU[V[XZYY[V", "I\\MRORSQVOXMYKYHXFVFUGTISNRSQVPXNZL[J[IZIXJWLWNXQZT[V[YZ[X", "@aEMCLBJBICGEFFFHGIIIKHPGTE[ RGTJLLHMGOFPFRGSISKRPQTO[ RQTTLVHWGYFZF\\G]I]K\\PZWZZ[[\\[^Z_YaV", "E]JMHLGJGIHGJFKFMGNINKMPLTJ[ RLTOLQHRGTFVFXGYIYKXPVWVZW[X[ZZ[Y]V", "H]TFQGOIMLLNKRKVLYMZO[Q[TZVXXUYSZOZKYHXGVFTFRHRKSNUQWSZU\\V", "F_SHTITLSPRSQUOXMZK[J[IZIWJRKOLMNJPHRGUFZF\\G]H^J^M]O\\PZQWQUPTO", "H^ULTNSOQPOPNNNLOIQGTFWFYGZIZMYPWSSWPYNZK[I[HZHXIWKWMXPZS[V[YZ[X", "F_SHTITLSPRSQUOXMZK[J[IZIWJRKOLMNJPHRGUFYF[G\\H]J]M\\O[PYQVQSPTQUSUXVZX[ZZ[Y]V", "H\\H[JZLXOTQQSMTJTGSFRFQGPIPKQMSOVQXSYUYWXYWZT[P[MZKXJVJT", "H[RLPLNKMINGQFTFXG[G]F RXGVNTTRXPZN[L[JZIXIVJULUNV", "E]JMHLGJGIHGJFKFMGNINKMOLRKVKXLZN[P[RZSYUUXMZF RXMWQVWVZW[X[ZZ[Y]V", "F]KMILHJHIIGKFLFNGOIOKNOMRLVLYM[O[QZTWVTXPYMZIZGYFXFWGVIVKWNYP[Q", "C_HMFLEJEIFGHFIFKGLILLK[ RUFK[ RUFS[ RaF_G\\JYNVTS[", "F^NLLLKKKILGNFPFRGSISLQUQXRZT[V[XZYXYVXUVU R]I]G\\FZFXGVITLPUNXLZJ[H[GZGX", "F]KMILHJHIIGKFLFNGOIOKNOMRLVLXMZN[P[RZTXVUWSYM R[FYMVWT]RbPfNgMfMdNaP^S[VY[V", "H]ULTNSOQPOPNNNLOIQGTFWFYGZIZMYPWTTWPZN[K[JZJXKWNWPXQYR[R^QaPcNfLgKfKdLaN^Q[TYZV", "", "", "", "", "", "", "I[JFR[ RZFR[ RJFZF", "G]IL[b", "E_RJIZ RRJ[Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 600 to 699 ********/ "", "I\\XMX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX", "H[LFL[ RLPNNPMSMUNWPXSXUWXUZS[P[NZLX", "I[XPVNTMQMONMPLSLUMXOZQ[T[VZXX", "I\\XFX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX", "I[LSXSXQWOVNTMQMONMPLSLUMXOZQ[T[VZXX", "MYWFUFSGRJR[ ROMVM", "I\\XMX]W`VaTbQbOa RXPVNTMQMONMPLSLUMXOZQ[T[VZXX", "I\\MFM[ RMQPNRMUMWNXQX[", "NVQFRGSFREQF RRMR[", "MWRFSGTFSERF RSMS^RaPbNb", "IZMFM[ RWMMW RQSX[", "NVRFR[", "CaGMG[ RGQJNLMOMQNRQR[ RRQUNWMZM\\N]Q][", "I\\MMM[ RMQPNRMUMWNXQX[", "I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM", "H[LMLb RLPNNPMSMUNWPXSXUWXUZS[P[NZLX", "I\\XMXb RXPVNTMQMONMPLSLUMXOZQ[T[VZXX", "KXOMO[ ROSPPRNTMWM", "J[XPWNTMQMNNMPNRPSUTWUXWXXWZT[Q[NZMX", "MYRFRWSZU[W[ ROMVM", "I\\MMMWNZP[S[UZXW RXMX[", "JZLMR[ RXMR[", "G]JMN[ RRMN[ RRMV[ RZMV[", "J[MMX[ RXMM[", "JZLMR[ RXMR[P_NaLbKb", "J[XMM[ RMMXM RM[X[", "H]QMONMPLRKUKXLZN[P[RZUWWTYPZM RQMSMTNUPWXXZY[Z[", "I\\UFSGQIOMNPMTLZKb RUFWFYHYKXMWNUORO RROTPVRWTWWVYUZS[Q[OZNYMV", "I\\JPLNNMOMQNROSRSVR[ RZMYPXRR[P_Ob", "I[TMQMONMPLSLVMYNZP[R[TZVXWUWRVOTMRKQIQGRFTFVGXI", "JZWOVNTMQMONOPPRSS RSSOTMVMXNZP[S[UZWX", "JYTFRGQHQIRJUKXK RXKTMQONRMUMWNYP[S]T_TaSbQbP`", "H\\IQJOLMNMONOPNTL[ RNTPPRNTMVMXOXRWWTb", "G\\HQIOKMMMNNNPMUMXNZO[Q[SZUWVUWRXMXJWGUFSFRHRJSMUPWRZT", "LWRMPTOXOZP[R[TYUW", "I[OMK[ RYNXMWMUNQROSNS RNSPTQUSZT[U[VZ", "JZKFMFOGPHX[ RRML[", "H]OMIb RNQMVMYO[Q[SZUXWT RYMWTVXVZW[Y[[Y\\W", "I[LMOMNSMXL[ RYMXPWRUURXOZL[", "JZTFRGQHQIRJUKXK RUKRLPMOOOQQSTTVT RTTPUNVMXMZO\\S^T_TaRbPb", "J[RMPNNPMSMVNYOZQ[S[UZWXXUXRWOVNTMRM", "G]PML[ RUMVSWXX[ RIPKNNM[M", "I[MSMVNYOZQ[S[UZWXXUXRWOVNTMRMPNNPMSIb", "I][MQMONMPLSLVMYNZP[R[TZVXWUWRVOUNSM", "H\\SMP[ RJPLNOMZM", "H\\IQJOLMNMONOPMVMYO[Q[TZVXXTYPYM", "G]ONMOKQJTJWKYLZN[Q[TZWXYUZRZOXMVMTORSPXMb", "I[KMMMOOU`WbYb RZMYOWRM]K`Jb", "F]VFNb RGQHOJMLMMNMPLULXMZO[Q[TZVXXUZP[M", "F]NMLNJQITIWJZK[M[OZQW RRSQWRZS[U[WZYWZTZQYNXM", "L\\UUTSRRPRNSMTLVLXMZO[Q[SZTXVRUWUZV[W[YZZY\\V", "M[MVOSRNSLTITGSFQGPIOMNTNZO[P[RZTXUUURVVWWYW[V", "MXTTTSSRQROSNTMVMXNZP[S[VYXV", "L\\UUTSRRPRNSMTLVLXMZO[Q[SZTXZF RVRUWUZV[W[YZZY\\V", "NXOYQXRWSUSSRRQROSNUNXOZQ[S[UZVYXV", "OWOVSQUNVLWIWGVFTGSIQQNZKaJdJfKgMfNcOZP[R[TZUYWV", "L[UUTSRRPRNSMTLVLXMZO[Q[SZTY RVRTYPdOfMgLfLdMaP^S\\U[XY[V", "M\\MVOSRNSLTITGSFQGPIOMNSM[ RM[NXOVQSSRURVSVUUXUZV[W[YZZY\\V", "PWSMSNTNTMSM RPVRRPXPZQ[R[TZUYWV", "PWSMSNTNTMSM RPVRRLdKfIgHfHdIaL^O\\Q[TYWV", "M[MVOSRNSLTITGSFQGPIOMNSM[ RM[NXOVQSSRURVSVUTVQV RQVSWTZU[V[XZYY[V", "OWOVQSTNULVIVGUFSGRIQMPTPZQ[R[TZUYWV", "E^EVGSIRJSJTIXH[ RIXJVLSNRPRQSQTPXO[ RPXQVSSURWRXSXUWXWZX[Y[[Z\\Y^V", "J\\JVLSNROSOTNXM[ RNXOVQSSRURVSVUUXUZV[W[YZZY\\V", "LZRRPRNSMTLVLXMZO[Q[SZTYUWUUTSRRQSQURWTXWXYWZV", "KZKVMSNQMUGg RMUNSPRRRTSUUUWTYSZQ[ RMZO[R[UZWYZV", "L[UUTSRRPRNSMTLVLXMZO[Q[SZ RVRUUSZPaOdOfPgRfScS\\U[XY[V", "MZMVOSPQPSSSTTTVSYSZT[U[WZXYZV", "NYNVPSQQQSSVTXTZR[ RNZP[T[VZWYYV", "OXOVQSSO RVFPXPZQ[S[UZVYXV RPNWN", "L[LVNRLXLZM[O[QZSXUU RVRTXTZU[V[XZYY[V", "L[LVNRMWMZN[O[RZTXUUUR RURVVWWYW[V", "I^LRJTIWIYJ[L[NZPX RRRPXPZQ[S[UZWXXUXR RXRYVZW\\W^V", "JZJVLSNRPRQSQZR[U[XYZV RWSVRTRSSOZN[L[KZ", "L[LVNRLXLZM[O[QZSXUU RVRPdOfMgLfLdMaP^S\\U[XY[V", "LZLVNSPRRRTTTVSXQZN[P\\Q^QaPdOfMgLfLdMaP^S\\WYZV", "J\\K[NZQXSVUSWOXKXIWGUFSGRHQJPOPTQXRZT[V[XZYY", "", "", "", "", "", "I[WUWRVOUNSMQMONMPLSLVMYNZP[R[TZVXWUXPXKWHVGTFRFPGNI", "JZWNUMRMPNNPMSMVNYOZQ[T[VZ RMTUT", "J[TFRGPJOLNOMTMXNZO[Q[SZUWVUWRXMXIWGVFTF RNPWP", "H\\VFNb RQMNNLPKSKVLXNZQ[S[VZXXYUYRXPVNSMQM", "I[XOWNTMQMNNMOLQLSMUOWSZT\\T^S_Q_", "", "", "DaWNVLTKQKOLNMMOMRNTOUQVTVVUWS RWKWSXUYV[V\\U]S]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYY", "F^ZIJRZ[", "F^JIZRJ[", "KYOBOb ROBVB RObVb", "KYUBUb RNBUB RNbUb", "KYTBQEPHPJQMSOSPORSTSUQWPZP\\Q_Tb", "KYPBSETHTJSMQOQPURQTQUSWTZT\\S_Pb", "F^[FYGVHSHPGNFLFJGIIIKKMMMOLPJPHNF R[FI[ RYTWTUUTWTYV[X[ZZ[X[VYT", "NV", "JZ", /******** Hershey Glyphs 700 to 799 ********/ "H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF", "H\\NJPISFS[", "H\\LKLJMHNGPFTFVGWHXJXLWNUQK[Y[", "H\\MFXFRNUNWOXPYSYUXXVZS[P[MZLYKW", "H\\UFKTZT RUFU[", "H\\WFMFLOMNPMSMVNXPYSYUXXVZS[P[MZLYKW", "H\\XIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQLT", "H\\YFO[ RKFYF", "H\\PFMGLILKMMONSOVPXRYTYWXYWZT[P[MZLYKWKTLRNPQOUNWMXKXIWGTFPF", "H\\XMWPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLX", "MWRYQZR[SZRY", "MWSZR[QZRYSZS\\R^Q_", "MWRMQNROSNRM RRYQZR[SZRY", "MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_", "MWRFRT RRYQZR[SZRY", "I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY", "NVRFRM", "JZNFNM RVFVM", "KYQFOGNINKOMQNSNUMVKVIUGSFQF", "H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX", "G][BIb", "KYVBTDRGPKOPOTPYR]T`Vb", "KYNBPDRGTKUPUTTYR]P`Nb", "NVRBRb", "E_IR[R", "E_RIR[ RIR[R", "E_IO[O RIU[U", "G]KKYY RYKKY", "JZRLRX RMOWU RWOMU", "MWRQQRRSSRRQ", "MWSFRGQIQKRLSKRJ", "MWRHQGRFSGSIRKQL", "E_UMXP[RXTUW RIR[R", "G]OFOb RUFUb RJQZQ RJWZW", "E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y", "G]IIJKKOKUJYI[ R[IZKYOYUZY[[ RIIKJOKUKYJ[I RI[KZOYUYYZ[[", "F_\\Q[OYNWNUOTPQTPUNVLVJUISIQJOLNNNPOQPTTUUWVYV[U\\S\\Q", "KYOBO[ RUBU[", "F^RBR[ RI[[[", "F^[BI[[[", "E_RIQJRKSJRI RIYHZI[JZIY R[YZZ[[\\Z[Y", "F^RHNLKPJSJUKWMXOXQWRU RRHVLYPZSZUYWWXUXSWRU RRUQYP\\ RRUSYT\\ RP\\T\\", "F^RNQKPINHMHKIJKJOKRLTNWR\\ RRNSKTIVHWHYIZKZOYRXTVWR\\", "F^RGPJLOIR RRGTJXO[R RIRLUPZR] R[RXUTZR]", "F^RTTWVXXXZW[U[SZQXPVPSQ RSQUOVMVKUISHQHOINKNMOOQQ RQQNPLPJQISIUJWLXNXPWRT RRTQYP\\ RRTSYT\\ RP\\T\\", "F^RRR[Q\\ RRVQ\\ RRIQHOHNINKONRR RRISHUHVIVKUNRR RRRNOLNJNIOIQJR RRRVOXNZN[O[QZR RRRNULVJVIUISJR RRRVUXVZV[U[SZR", "F^ISJSLTMVMXLZ RISIRJQLQMRNTNWMYLZ RRGPIOLOOQUQXPZR\\ RRGTIULUOSUSXTZR\\ R[S[RZQXQWRVTVWWYXZ R[SZSXTWVWXXZ RKVYV", "", "", "", "PSSRRSQSPRPQQPRPSQSSRUQV RQQQRRRRQQQ", "PTQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ", "NVPOTU RTOPU RNRVR", "MWRKQMOPMR RRKSMUPWR RRMOQ RRMUQ RROPQ RROTQ RQQSQ RMRWR", "MWMRMQNOONQMSMUNVOWQWR RPNTN ROOUO RNPVP RNQVQ RMRWR", "LRLFLRRRLF RLIPQ RLLOR RLOMQ", "MWRKQMOPMR RRKSMUPWR", "MWWRWQVOUNSMQMONNOMQMR", "G]]R]P\\MZJWHTGPGMHJJHMGPGR", "MWMRMSNUOVQWSWUVVUWSWR", "LXLPNRQSSSVRXP", "RURUTTURTPRO", "RVRRUPVNVLUKTK", "NRRROPNNNLOKPK", "MWWHVGTFQFOGNHMJMLNNOOUSVTWVWXVZU[S\\P\\N[MZ", "G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M", "G]RRTUUVWWYW[V\\U]S]Q\\O[NYMWMUNTOPUOVMWKWIVHUGSGQHOINKMMMONPORR", "H\\KFK[ RHF[FQP[Z RZV[Y\\[ RZVZY RWYZY RWYZZ\\[", "KYUARBPCNELHKLKRLUNWQXSXVWXUYR RKPLMNKQJSJVKXMYPYVXZV]T_R`Oa", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ">f>RfR", "D`D``D", "RRR>Rf", "D`DD``", /******** Hershey Glyphs 800 to 899 ********/ "D`DR`R", "F^FY^K", "KYK^YF", "", "KYKFY^", "F^FK^Y", "KYKRYR", "MWMWWM", "", "MWMMWW", "", "", "", "", "D`DOGQKSPTTTYS]Q`O", "PUUDSGQKPPPTQYS]U`", "OTODQGSKTPTTSYQ]O`", "D`DUGSKQPPTPYQ]S`U", "KYRJYNKVRZ", "JZJRNKVYZR", "KYKVKNYVYN", "JZLXJPZTXL", "JZJ]L]O\\Q[TXUVVSVOULTJSIQIPJOLNONSOVPXS[U\\X]Z]", "I]]Z]X\\U[SXPVOSNONLOJPIQISJTLUOVSVVUXT[Q\\O]L]J", "JZZGXGUHSIPLONNQNUOXPZQ[S[TZUXVUVQUNTLQIOHLGJG", "G[GJGLHOIQLTNUQVUVXUZT[S[QZPXOUNQNNOLPISHUGXGZ", "E[EPFRHTJUMVQVUUXSZP[NZLWLSMQNNPLSKVKYL\\M^", "EYETHVKWPWSVVTXQYNYLXKVKSLPNNQMTMYN\\P_", "OUQOOQOSQUSUUSUQSOQO RQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ", "", "D`DRJR RORUR RZR`R", "D`DUDO`O`U", "JZRDJR RRDZR", "D`DR`R RJYZY RP`T`", "D`DR`R RDRRb R`RRb", "", "", "", "", "", "KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK", "LXLLLXXXXLLL", "KYRJKVYVRJ", "LXRHLRR\\XRRH", "JZRIPOJOOSMYRUWYUSZOTORI", "KYRKRY RKRYR", "MWMMWW RWMMW", "MWRLRX RMOWU RWOMU", "", "", "NVQNOONQNSOUQVSVUUVSVQUOSNQN ROQOS RPPPT RQOQU RRORU RSOSU RTPTT RUQUS", "NVNNNVVVVNNN ROOOU RPOPU RQOQU RRORU RSOSU RTOTU RUOUU", "MWRLMUWURL RROOT RROUT RRRQT RRRST", "LULRUWUMLR RORTU RORTO RRRTS RRRTQ", "MWRXWOMORX RRUUP RRUOP RRRSP RRRQP", "OXXROMOWXR RURPO RURPU RRRPQ RRRPS", "LXRLNWXPLPVWRL RRRRL RRRLP RRRNW RRRVW RRRXP", "", "", "", "MWRLRX ROOUO RMUOWQXSXUWWU", "LXRLRX RLQMOWOXQ RPWTW", "KYMNWX RWNMX ROLLOKQ RULXOYQ", "I[NII[ RVI[[ RMM[[ RWMI[ RNIVI RMMWM", "I[RGRV RMJWP RWJMP RIVL\\ R[VX\\ RIV[V RL\\X\\", "G[MJSV RKPSL RG\\[\\[RG\\", "LXPLPPLPLTPTPXTXTTXTXPTPTLPL", "KYYPXNVLSKQKNLLNKQKSLVNXQYSYVXXVYT RYPWNUMSMQNPOOQOSPUQVSWUWWVYT", "KYRJKVYVRJ RRZYNKNRZ", "G]PIPGQFSFTGTI RGZHXJVKTLPLKMJOIUIWJXKXPYTZV\\X]Z RGZ]Z RQZP[Q\\S\\T[SZ", "JZRMRS RRSQ\\ RRSS\\ RQ\\S\\ RRMQJPHNG RQJNG RRMSJTHVG RSJVG RRMNKLKJM RPLLLJM RRMVKXKZM RTLXLZM RRMPNOOOR RRMPOOR RRMTNUOUR RRMTOUR", "JZRIRK RRNRP RRSRU RRYQ\\ RRYS\\ RQ\\S\\ RRGQIPJ RRGSITJ RPJRITJ RRKPNNOMN RRKTNVOWN RNOPORNTOVO RRPPSNTLTKRKSLT RRPTSVTXTYRYSXT RNTPTRSTTVT RRUPXOYMZLZKYJWJYLZ RRUTXUYWZXZYYZWZYXZ RMZOZRYUZWZ", "JZRYQ\\ RRYS\\ RQ\\S\\ RRYUZXZZXZUYTWTYRZOYMWLUMVJUHSGQGOHNJOMMLKMJOKRMTKTJUJXLZOZRY", "JZRYQ\\ RRYS\\ RQ\\S\\ RRYVXVVXUXRZQZLYIXHVHTGPGNHLHKIJLJQLRLUNVNXRY", "I[IPKR RLKNP RRGRO RXKVP R[PYR", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "QSRQQRRSSRRQ", /******** Hershey Glyphs 900 to 999 ********/ "PTQPPQPSQTSTTSTQSPQP", "NVQNOONQNSOUQVSVUUVSVQUOSNQN", "MWQMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM", "KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK", "G]PGMHJJHMGPGTHWJZM\\P]T]W\\ZZ\\W]T]P\\MZJWHTGPG", "AcPALBJCGEEGCJBLAPATBXCZE]G_JaLbPcTcXbZa]__]aZbXcTcPbLaJ_G]EZCXBTAPA", "fRAPCMDJDGCEA>H@JAMAZB]D_G`M`PaRc RRATCWDZD]C_AfHdJcMcZb]`_]`W`TaRc", "AcRAPCMDJDGCEABGAKAPBTDXG\\L`Rc RRATCWDZD]C_AbGcKcPbT`X]\\X`Rc RBHbH", "H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[ RLbXF", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1000 to 1099 ********/ "", "KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX", "JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX", "KYVLWKWOVLTKQKOLNMMPMSNVOWQXTXVWWU RQKOMNPNSOVQX", "JZNKNX ROKOX RLKSKVLWMXPXSWVVWSXLX RSKULVMWPWSVVUWSX", "JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX", "JXNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXQX", "K[VLWKWOVLTKQKOLNMMPMSNVOWQXTXVW RQKOMNPNSOVQX RTXUWVU RVSVX RWSWX RTSYS", "J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX", "NWRKRX RSKSX RPKUK RPXUX", "LXSKSURWQX RTKTUSWQXPXNWMUNTOUNV RQKVK", "JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX", "KXOKOX RPKPX RMKRK RMXWXWTVX", "I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX", "JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX", "KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK", "JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX", "KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RPWPUQTSTTUUZV[W[XZ RTUUXVZW[", "JZNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX RSRTSUWVXWXXW RSRUSVWWX", "KZVMWKWOVMULSKQKOLNMNOOPQQTRVSWT RNNOOQPTQVRWSWVVWTXRXPWOVNTNXOV", "KZRKRX RSKSX RNKMOMKXKXOWK RPXUX", "J[NKNUOWQXTXVWWUWK ROKOUPWQX RLKQK RUKYK", "KYMKRX RNKRU RWKRX RKKPK RTKYK", "I[LKOX RMKOT RRKOX RRKUX RSKUT RXKUX RJKOK RVKZK", "KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX", "LYNKRRRX ROKSR RWKSRSX RLKQK RTKYK RPXUX", "LYVKNX RWKOX ROKNONKWK RNXWXWTVX", "KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX", "JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX", "KXOKOX RPKPX RMKWKWOVK RMXRX", "KYRKLX RRMWX RRKXX RMWVW RLXXX", "JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX", "LYVKNX RWKOX ROKNONKWK RNXWXWTVX", "J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX", "KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RQOQT RTOTT RQQTQ RQRTR", "NWRKRX RSKSX RPKUK RPXUX", "JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX", "KYRKMX RRNVX RRKWX RKXPX RTXYX", "I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX", "JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX", "JZMJLM RXJWM RPPOS RUPTS RMVLY RXVWY RMKWK RMLWL RPQTQ RPRTR RMWWW RMXWX", "KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK", "J[NKNX ROKOX RVKVX RWKWX RLKYK RLXQX RTXYX", "JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX", "K[MKRQ RNKSQMX RMKWKXOVK RNWWW RMXWXXTVX", "KZRKRX RSKSX RNKMOMKXKXOWK RPXUX", "KZMONLOKPKQLRORX RXOWLVKUKTLSOSX RMONMOLPLQMRO RXOWMVLULTMSO RPXUX", "KZRKRX RSKSX RQNNOMQMRNTQUTUWTXRXQWOTNQN RQNOONQNROTQU RTUVTWRWQVOTN RPKUK RPXUX", "KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX", "J[RKRX RSKSX RLPMONOOSQU RTUVSWOXOYP RMONROTQUTUVTWRXO RPKUK RPXUX", "KZMVNXQXMRMONMOLQKTKVLWMXOXRTXWXXV ROUNRNOOMQK RTKVMWOWRVU RNWPW RUWWW", "KYTKKX RSMTX RTKUX RNTTT RIXNX RRXWX", "JYPKLX RQKMX RNKUKWLWNVPSQ RUKVLVNUPSQ ROQRQTRUSUUTWQXJX RRQTSTUSWQX", "KXVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUU RRKPMOONRNVPX", "JYPKLX RQKMX RNKTKVLWNWQVTUVTWQXJX RTKULVNVQUTTVSWQX", "JYPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXTXUUSX", "JXPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXOX", "KYVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUVVS RRKPMOONRNVPX RRXTVUS RSSXS", "J[PKLX RQKMX RXKTX RYKUX RNKSK RVK[K ROQVQ RJXOX RRXWX", "NWTKPX RUKQX RRKWK RNXSX", "LXUKRUQWPX RVKSURWPXOXMWLUMTNUMV RSKXK", "JZPKLX RQKMX RYKOR RRPTX RSPUX RNKSK RVK[K RJXOX RRXWX", "KXQKMX RRKNX ROKTK RKXUXVUTX", "I\\OKKX ROMPX RPKQV RYKPX RYKUX RZKVX RMKPK RYK\\K RIXMX RSXXX", "JZPKLX RPKTX RQKTU RXKTX RNKQK RVKZK RJXNX", "KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK", "JYPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RJXOX", "KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK ROWOVPUQURVRZS[T[UZ RRVSZT[", "JZPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RSRTWUXVXWW RSRTSUWVX RJXOX", "KZWLXLYKXNWLUKRKPLOMOOPPUSVT RONPOURVSVVUWSXPXNWMULXMWNW", "KZTKPX RUKQX RPKNNOKZKYNYK RNXSX", "J[PKMUMWOXSXUWVUYK RQKNUNWOX RNKSK RWK[K", "KYOKPX RPKQV RYKPX RMKRK RVK[K", "I[NKMX ROKNV RTKMX RTKSX RUKTV RZKSX RLKQK RXK\\K", "KZPKTX RQKUX RYKLX RNKSK RVK[K RJXOX RRXWX", "LYPKRQPX RQKSQ RYKSQQX RNKSK RVK[K RNXSX", "LYXKLX RYKMX RQKONPKYK RLXUXVUTX", "", "", "", "", "", "", "", "KZMHX\\", "JZRMLW RRMXW", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1100 to 1199 ********/ "", "LZQOPPPQOQOPQOTOVQVWWXXX RTOUQUWWX RURRSPTOUOWPXSXTWUU RRSPUPWQX", "JYNKNX ROKOX RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLKOK", "LXVQUQURVRVQUPSOQOOPNRNUOWQXSXUWVV RQOPPOROUPWQX", "L[VKVX RWKWX RVRUPSOQOOPNRNUOWQXSXUWVU RQOPPOROUPWQX RTKWK RVXYX", "LXOSVSVRUPSOQOOPNRNUOWQXSXUWVV RUSUQSO RQOPPOROUPWQX", "LWTKULUMVMVLTKRKPMPX RRKQMQX RNOSO RNXSX", "LYQOOQOSQUSUUSUQSOQO RQOPQPSQU RSUTSTQSO RTPUOVO RPTOUOXPYTYVZ ROWPXTXVYV[T\\P\\N[NYPX", "J[NKNX ROKOX RORPPROTOVPWRWX RTOUPVRVX RLKOK RLXQX RTXYX", "NWRKRLSLSKRK RRORX RSOSX RPOSO RPXUX", "NWSKSLTLTKSK RSOSZR\\ RTOTZR\\P\\O[OZPZP[O[ RQOTO", "JZNKNX ROKOX RWOOU RRSVX RSSWX RLKOK RTOYO RLXQX RTXYX", "NWRKRX RSKSX RPKSK RPXUX", "F_JOJX RKOKX RKRLPNOPORPSRSX RPOQPRRRX RSRTPVOXOZP[R[X RXOYPZRZX RHOKO RHXMX RPXUX RXX]X", "J[NONX ROOOX RORPPROTOVPWRWX RTOUPVRVX RLOOO RLXQX RTXYX", "LYQOOPNRNUOWQXTXVWWUWRVPTOQO RQOPPOROUPWQX RTXUWVUVRUPTO", "JYNON\\ ROOO\\ RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLOOO RL\\Q\\", "KYUOU\\ RVOV\\ RURTPROPONPMRMUNWPXRXTWUU RPOOPNRNUOWPX RS\\X\\", "KXOOOX RPOPX RPRQPSOUOVPVQUQUPVP RMOPO RMXRX", "LYTOUPUQVQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWOVPVPWQX", "LWPKPVRXTXUWUV RQKQVRX RNOTO", "J[NONUOWQXSXUWVU ROOOUPWQX RVOVX RWOWX RLOOO RTOWO RVXYX", "KYNORX ROORV RVORX RLOQO RTOXO", "I[LOOX RMOOU RROOX RROUX RSOUU RXOUX RJOOO RVOZO", "KYNOUX ROOVX RVONX RLOQO RTOXO RLXPX RSXXX", "KYNORX ROORV RVORXP[N\\M\\L[LZMZM[L[ RLOQO RTOXO", "LXUONX RVOOX ROONQNOVO RNXVXVVUX", "K[QOOPNQMSMUNWPXQXSWUUWRXO RQOOQNSNUOWPX RQOSOUPWWXX RSOTPVWXXYX", "KXRKPMOOMUK\\ RQLPNNTL\\ RRKTKVLVNUPRQ RTKULUNTPRQ RRQTRUTUVTWRXQXOWNT RRQSRTTTVRX", "KYLQNOPORPSSSXR\\ RLQNPPPRQSS RWOVRSXQ\\", "KYSOQOOPNQMSMUNWPXRXTWUVVTVRUPRNQLQKRJTJUKVM RQOOQNSNVPX RRXTVUTUQSO RQLRKTKVM", "LXVPTOQOOPOQPRRS RQOPPPQRS RRSOTNUNWPXSXUW RRSPTOUOWPX", "LWRKQLQMSNVNVMSNPOOPNRNTOVPWRXSYS[R\\P\\O[ RSNQOPPOROTPVRX", "IYJRKPLONOOPOQMX RMONPNQLX ROQPPROTOVPVRS\\ RTOUPURR\\", "IYJSKQLPNPOQOVPX RMPNQNUOWPXQXSWTVUTVQVNULTKRKQLQNRPURWS RQXSVTTUQUNTK", "NWROPVPWQXSXUWVU RSOQVQWRX", "KYOOLX RPOMX RUOVPWPVOTORQOR RORPSRWTXVWWU RORQSSWTX", "LXLKNKPLWX RNKOLVX RRPMX RRPNX", "KZOOK\\ RPOL\\ RNUNWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX", "JYNOMX ROONUMX RVRVOWOVRTUQWNXMX RLOOO", "MXRKQLQMSNVN RTNQOPPPRRSUS RTNROQPQRRS RSSPTOUOWQXSYTZT[S\\Q\\ RSSQTPUPWQX", "KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO", "IZPPMX RPPNX RTPSX RTPTX RKQMOXO RKQMPXP", "JXSOQOOPNQMSJ\\ RQOOQNSK\\ RSOUPVRVTUVTWRXPXNWMU RSOUQUTTVRX", "K[YOQOOPNQMSMUNWPXRXTWUVVTVRUPYP RQOOQNSNVPX RRXTVUTUQSO", "KZSPQX RSPRX RMQOOXO RMQOPXP", "JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP", "KZOPNQMSMUNWPXRXUWWUXRXPWOUOTPSRRUO\\ RMUNVPWRWUVWTXR RXQWPUPSR RRUQXP\\", "KXMONOPPS[T\\ RNOOPR[T\\U\\ RVOTRNYL\\", "I[TKQ\\ RUKP\\ RJRKPLONOOPOVPWSWUVWT RMONPNTOWPXSXUWWTXRYO", "JZNPPPPONPMQLSLUMWNXPXQWRUSR RLUNWPWRU RRRRWSXUXWVXTXRWPVOVPWP RRUSWUWWV", "KZVOTVTWUXWXXWYU RWOUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX", "JXOKMR RPKNRNVPX RNROPQOSOUPVRVTUVTWRXPXNWMUMR RSOUQUTTVRX RMKPK", "KXUPUQVQUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX", "KZWKTVTWUXWXXWYU RXKUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RUKXK", "KWNURTTSURUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX", "MXWKXLXKVKTLSNPYO[N\\ RVKULTNQYP[N\\L\\L[M\\ RPOVO", "KYVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX", "KZPKLX RQKMX ROQPPROTOVPVRUUUWVX RTOUPURTUTWUXWXXWYU RNKQK", "MWSKSLTLTKSK RNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU", "MWTKTLULUKTK RORPPQOSOTPTRRYQ[O\\M\\M[N\\ RROSPSRQYP[O\\", "KXPKLX RQKMX RVPUQVQVPUOTORQPROR RORPSQWRXTXUWVU RORQSRWSX RNKQK", "NVSKPVPWQXSXTWUU RTKQVQWRX RQKTK", "F^GRHPIOKOLPLQJX RJOKPKQIX RLQMPOOQOSPSQQX RQORPRQPX RSQTPVOXOZPZRYUYWZX RXOYPYRXUXWYX[X\\W]U", "J[KRLPMOOOPPPQNX RNOOPOQMX RPQQPSOUOWPWRVUVWWX RUOVPVRUUUWVXXXYWZU", "KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO", "JYKRLPMOOOPPPQM\\ RNOOPOQL\\ RPQROTOVPWRWTVVUWSXQXOVOT RTOVQVTUVSX RJ\\O\\", "KYVOR\\ RWOS\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RP\\U\\", "LXMRNPOOQORPRQPX RPOQPQQOX RRQSPUOVOWPWQVQWP", "LYVPVQWQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWNVOVOW", "NWSKPVPWQXSXTWUU RTKQVQWRX RPOUO", "IZJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX", "JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP", "H\\IRJPKOMONPNRMUMWNX RLOMPMRLULWNXOXQWRV RTORVRWTX RUOSVSWTXUXWWYUZRZOYOZP", "JZMRNPPOROSPSR RQORPRRQUPWNXMXLWLVMVLW RXPWQXQXPWOVOTPSRRURWSX RQUQWRXTXVWWU", "IYJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\", "KYWOWPVQNVMWMX RNQOOROUQ ROPRPUQVQ RNVOVRWUW ROVRXUXVV", "H[RKSLSMTMTLRKOKMLLNLX ROKNLMNMX RXKYLYMZMZLXKVKTMTX RVKUMUX RJOWO RJXOX RRXWX", "J[UKVLWLWKQKOLNNNX RQKPLONOX RVOVX RWOWX RLOWO RLXQX RTXYX", "J[WKQKOLNNNX RQKPLONOX RUKVLVX RWKWX RLOVO RLXQX RTXYX", "F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX RYKZL[L[KUKSLRNRX RUKTLSNSX RZOZX R[O[X RHO[O RHXMX RPXUX RXX]X", "F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX R[KUKSLRNRX RUKTLSNSX RYKZLZX R[K[X RHOZO RHXMX RPXUX RXX]X", "NWRORX RSOSX RPOSO RPXUX", "", "LXVPTOROPPOQNSNUOWQXSXUW RROPQOSOVQX ROSSS", "LYSKQLPMOONRNUOWPXRXTWUVVTWQWNVLUKSK RSKQMPOOSOVPX RRXTVUTVPVMUK ROQVQ", "KZTKQ\\ RUKP\\ RQONPMRMUNWQXTXWWXUXRWPTOQO RQOOPNRNUOWQX RTXVWWUWRVPTO", "LXUPVRVQUPSOQOOPNRNTOVRX RQOOQOTPVRXSYS[R\\P\\", "", "", "", "I[VKWLXLVKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RZK[L[KYKWLVNSYR[Q\\ RYKXLWNTYS[Q\\O\\O[P\\ RLOYO", "IZVKWLXLXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RVOTVTWUXWXXWYU RWOUVUWVX RLOWO", "IZVKWL RXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RWKTVTWUXWXXWYU RXKUVUWVX RLOVO", "F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L\\L\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ RZOXVXWYX[X\\W]U R[OYVYWZX RIO[O", "F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L R\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ R[KXVXWYX[X\\W]U R\\KYVYWZX RIOZO", "MWNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU", "", "OU", "LX", /******** Hershey Glyphs 1200 to 1299 ********/ "LYQKOLNONTOWQXTXVWWTWOVLTKQK RQKPLOOOTPWQX RTXUWVTVOULTK", "LYPNSKSX RRLRX ROXVX", "LYOMONNNNMOLQKTKVLWNVPTQQROSNUNX RTKULVNUPTQ RNWOVPVSWVWWV RPVSXVXWVWU", "LYOMONNNNMOLQKTKVLWNVPTQ RTKULVNUPTQ RRQTQVRWTWUVWTXQXOWNVNUOUOV RTQURVTVUUWTX", "LYSMSX RTKTX RTKMTXT RQXVX", "LYOKNQ ROKVK ROLSLVK RNQOPQOTOVPWRWUVWTXQXOWNVNUOUOV RTOUPVRVUUWTX", "LYVMVNWNWMVLTKRKPLOMNPNUOWQXTXVWWUWSVQTPQPNR RRKPMOPOUPWQX RTXUWVUVSUQTP", "LYNKNO RVMRTPX RWKTQQX RNMPKRKUM RNMPLRLUMVM", "LYQKOLNNOPQQTQVPWNVLTKQK RQKPLONPPQQ RTQUPVNULTK RQQORNTNUOWQXTXVWWUWTVRTQ RQQPROTOUPWQX RTXUWVUVTURTQ", "LYOVOUNUNVOWQXSXUWVVWSWNVLTKQKOLNNNPORQSTSWQ RSXUVVSVNULTK RQKPLONOPPRQS", "NVRVQWRXSWRV", "NVSWRXQWRVSWSYQ[", "NVROQPRQSPRO RRVQWRXSWRV", "NVROQPRQSPRO RSWRXQWRVSWSYQ[", "NVRKQLRSSLRK RRLRO RRVQWRXSWRV", "LYNNONOONONNOLQKTKVLWNWOVQSRRSRTST RTKVMVPUQSR RRWRXSXSWRW", "OVRKRP RSKRP", "LXOKOP RPKOP RUKUP RVKUP", "MWQKPLPNQOSOTNTLSKQK", "MWRJRP ROKUO RUKOO", "KZXHM\\", "MWUHSJQMPPPTQWSZU\\ RSJRLQPQTRXSZ", "MWOHQJSMTPTTSWQZO\\ RQJRLSPSTRXQZ", "MWPHP\\ RQHQ\\ RPHUH RP\\U\\", "MWSHS\\ RTHT\\ ROHTH RO\\T\\", "LWSHRIQKQMRORPPRRTRUQWQYR[S\\ RRIQM RQKRO RRUQY RQWR[", "MXQHRISKSMRORPTRRTRUSWSYR[Q\\ RRISM RSKRO RRUSY RSWR[", "MWTHPRT\\", "MWPHTRP\\", "OURHR\\", "MWPHP\\ RTHT\\", "I[LRXR", "I[RLRX RLRXR", "JZRMRX RMRWR RMXWX", "JZRMRX RMMWM RMRWR", "JZMMWW RWMMW", "NVRQQRRSSRRQ", "I[RLQMRNSMRL RLRXR RRVQWRXSWRV", "I[LPXP RLTXT", "I[WLMX RLPXP RLTXT", "I[LNXN RLRXR RLVXV", "JZWLMRWX", "JZMLWRMX", "JZWKMOWS RMTWT RMXWX", "JZMKWOMS RMTWT RMXWX", "H[YUWUUTTSRPQOONNNLOKQKRLTNUOUQTRSTPUOWNYN", "JZLTLRMPOPUSWSXR RLRMQOQUTWTXRXP", "JZMSRPWS RMSRQWS", "NVSKPO RSKTLPO", "NVQKTO RQKPLTO", "LXNKOMQNSNUMVK RNKONQOSOUNVK", "NVSLRMQLRKSLSNQP", "NVSKQMQORPSORNQO", "NVQLRMSLRKQLQNSP", "NVQKSMSORPQORNSO", "", "JZWMQMONNOMQMSNUOVQWWW", "JZMMMSNUOVQWSWUVVUWSWM", "JZMMSMUNVOWQWSVUUVSWMW", "JZMWMQNOONQMSMUNVOWQWW", "JZWMQMONNOMQMSNUOVQWWW RMRUR", "I[TOUPXRUTTU RUPWRUT RLRWR", "MWRMRX ROPPORLTOUP RPORMTO", "I[POOPLROTPU ROPMROT RMRXR", "MWRLRW ROTPURXTUUT RPURWTU", "KYVSUPSOQOOPNQMSMUNWPXRXTWUVVTWQWNVLTKQKPLQLRK RQOOQNSNVPX RRXTVUTVQVNULTK", "JZLKRX RMKRV RXKRX RLKXK RNLWL", "G[IOLORW RKORX R[FRX", "I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[", "I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[ RQNOONQNSOUQVSVUUVSVQUOSNQN", "H\\ZRYTWUVUTTSSQPPONNMNKOJQJRKTMUNUPTQSSPTOVNWNYOZQZR", "JZXKLX ROKPLPNOOMOLNLLMKOKSLVLXK RUTTUTWUXWXXWXUWTUT", "J[YPXPXQYQYPXOWOVPUTTVSWQXOXMWLVLTMSORRPSNSLRKPKOLONPQUWWXXXYW ROXMVMTOR RONPPVWWX", "J[UPSOQOPQPRQTSTUS RUOUSVTXTYRYQXNVLSKRKOLMNLQLRMUOWRXSXVW", "KZQHQ\\ RTHT\\ RWLVLVMWMWLUKPKNLNNOPVSWT RNNOOVRWTWVVWTXQXOWNVNUOUOVNV", "KYPKP[ RTKT[ RMQWQ RMUWU", "LXTLSLSMTMTLSKQKPLPNQPTRUS RPNQOTQUSUUSW RQPOROTPVSXTY ROTPUSWTYT[S\\Q\\P[PZQZQ[P[", "LXRKQLRMSLRK RRMRQ RRQQSRVSSRQ RRVR\\ RPOONNOOPPOTOUNVOUPTO", "LXRMSLRKQLRMRQQRSURV RRQSRQURVRZQ[R\\S[RZ RPOONNOOPPOTOUNVOUPTO RPXOWNXOYPXTXUWVXUYTX", "LYVKVX RNKVK RQQVQ RNXVX", "", "H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRQQRRSSRRQ", "LYQKPLPMQN RTKULUMTN RRNPOOQORPTRUSUUTVRVQUOSNRN RRURY RSUSY ROWVW", "LYRKPLONOOPQRRSRUQVOVNULSKRK RRRRX RSRSX ROUVU", "H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRKRY RKRYR", "JYRRPQOQMRLTLUMWOXPXRWSUSTRR RWMRR RRMWMWR RRMVNWR", "JZLLMKOKQLRNRPQRPSNT ROKPLQNQQPS RVKUX RWKTX RNTXT", "JYNKNU ROKNR RNROPQOSOUPVQVTTVTXUYVYWX RSOUQUTTV RLKOK", "LYONRKRQ RVNSKSQ RRQPROTOUPWRXSXUWVUVTURSQ RRTRUSUSTRT", "JZRKRY RMKMPNRPSTSVRWPWK RLMMKNM RQMRKSM RVMWKXM ROVUV", "JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXVXVUUX", "LYWKTKQLONNQNSOVQXTYWY RWKTLRNQQQSRVTXWY", "JZRRPQOQMRLTLUMWOXPXRWSUSTRR RSLQQ RWMRR RXQSS", "KYPMTW RTMPW RMPWT RWPMT", "J[OUMULVLXMYOYPXPVNTMRMONMOLQKTKVLWMXOXRWTUVUXVYXYYXYVXUVU RNMPLULWM", "J[OOMOLNLLMKOKPLPNNPMRMUNWOXQYTYVXWWXUXRWPUNULVKXKYLYNXOVO RNWPXUXWW", "", "", "", "", /******** Hershey Glyphs 1300 to 1399 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1400 to 1499 ********/ "", "F^KHK\\ RLHL\\ RXHX\\ RYHY\\ RHH\\H RH\\O\\ RU\\\\\\", "H]KHRQJ\\ RJHQQ RJHYHZMXH RK[X[ RJ\\Y\\ZWX\\", "KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`", "KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`", "KYOBOb RPBPb ROBVB RObVb", "KYTBTb RUBUb RNBUB RNbUb", "JYTBQEPHPJQMSOSPORSTSUQWPZP\\Q_Tb RRDQGQKRN RRVQYQ]R`", "KZPBSETHTJSMQOQPURQTQUSWTZT\\S_Pb RRDSGSKRN RRVSYS]R`", "KYU@RCPFOIOLPOSVTYT\\S_Ra RRCQEPHPKQNTUUXU[T^RaOd", "KYO@RCTFUIULTOQVPYP\\Q_Ra RRCSETHTKSNPUOXO[P^RaUd", "AXCRGRR` RGSRa RFSRb RX:Rb", "F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1500 to 1599 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1600 to 1699 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1700 to 1799 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1800 to 1899 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 1900 to 1999 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 2000 to 2099 ********/ "", "H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[", "G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[", "G\\XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXXYV RQFOGMILKKNKSLVMXOZQ[", "G]LFL[ RMFM[ RIFSFVGXIYKZNZSYVXXVZS[I[ RSFUGWIXKYNYSXVWXUZS[", "G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[", "G[LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[P[", "G^XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXX RQFOGMILKKNKSLVMXOZQ[ RXSX[ RYSY[ RUS\\S", "F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[", "MXRFR[ RSFS[ ROFVF RO[V[", "KZUFUWTZR[P[NZMXMVNUOVNW RTFTWSZR[ RQFXF", "F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[", "I[NFN[ ROFO[ RKFRF RK[Z[ZUY[", "F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][", "G^LFL[ RMFYY RMHY[ RYFY[ RIFMF RVF\\F RI[O[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF", "G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF RNYNXOVQURUTVUXV_W`Y`Z^Z] RUXV\\W^X_Y_Z^", "G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUPMP RUFWGXHYJYLXNWOUP RI[P[ RRPTQURXYYZZZ[Y RTQUSWZX[Z[[Y[X", "H\\XIYFYLXIVGSFPFMGKIKKLMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[Q[NZLXKUK[LX", "I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[", "F^KFKULXNZQ[S[VZXXYUYF RLFLUMXOZQ[ RHFOF RVF\\F", "H\\KFR[ RLFRX RYFR[ RIFOF RUF[F", "F^JFN[ RKFNV RRFN[ RRFV[ RSFVV RZFV[ RGFNF RWF]F", "H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[", "H]KFRQR[ RLFSQS[ RZFSQ RIFOF RVF\\F RO[V[", "H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[", "H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[", "G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[", "I[NFN[ ROFO[ RKFZFZLYF RK[R[", "H\\RFJ[ RRFZ[ RRIY[ RKZYZ RJ[Z[", "G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[", "H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[", "F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF ROMOT RUMUT ROPUP ROQUQ", "MXRFR[ RSFS[ ROFVF RO[V[", "F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[", "H\\RFK[ RRFY[ RRIX[ RI[O[ RU[[[", "F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][", "G^LFL[ RMFYY RMHY[ RYFY[ RIFMF RVF\\F RI[O[", "G]KEJJ RZEYJ RONNS RVNUS RKWJ\\ RZWY\\ RKGYG RKHYH ROPUP ROQUQ RKYYY RKZYZ", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF", "F^KFK[ RLFL[ RXFX[ RYFY[ RHF\\F RH[O[ RU[\\[", "G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[", "H]KFRPJ[ RJFQP RJFYFZLXF RKZXZ RJ[Y[ZUX[", "I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[", "I\\KKKILGMFOFPGQIRMR[ RKIMGOGQI RZKZIYGXFVFUGTISMS[ RZIXGVGTI RO[V[", "H]RFR[ RSFS[ RPKMLLMKOKRLTMUPVUVXUYTZRZOYMXLUKPK RPKNLMMLOLRMTNUPV RUVWUXTYRYOXMWLUK ROFVF RO[V[", "H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[", "G^RFR[ RSFS[ RIMJLLMMQNSOTQU RJLKMLQMSNTQUTUWTXSYQZM[L RTUVTWSXQYM[L\\M ROFVF RO[V[", "G]JXK[O[MWKSJPJLKIMGPFTFWGYIZLZPYSWWU[Y[ZX RMWLTKPKLLINGPF RTFVGXIYLYPXTWW RKZNZ RVZYZ", "H\\UFH[ RUFV[ RTHU[ RLUUU RF[L[ RR[X[", "F^OFI[ RPFJ[ RLFWFZG[I[KZNYOVP RWFYGZIZKYNXOVP RMPVPXQYSYUXXVZR[F[ RVPWQXSXUWXUZR[", "H]ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[S[UZWXXV RTFRGPINLMOLSLVMYNZP[", "F]OFI[ RPFJ[ RLFUFXGYHZKZOYSWWUYSZO[F[ RUFWGXHYKYOXSVWTYRZO[", "F]OFI[ RPFJ[ RTLRT RLF[FZLZF RMPSP RF[U[WVT[", "F\\OFI[ RPFJ[ RTLRT RLF[FZLZF RMPSP RF[M[", "H^ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[R[UZWXYT RTFRGPINLMOLSLVMYNZP[ RR[TZVXXT RUT\\T", "E_NFH[ ROFI[ R[FU[ R\\FV[ RKFRF RXF_F RLPXP RE[L[ RR[Y[", "LYUFO[ RVFP[ RRFYF RL[S[", "I[XFSWRYQZO[M[KZJXJVKULVKW RWFRWQYO[ RTF[F", "F]OFI[ RPFJ[ R]FLS RSOW[ RROV[ RLFSF RYF_F RF[M[ RS[Y[", "H\\QFK[ RRFL[ RNFUF RH[W[YUV[", "E`NFH[ RNFO[ ROFPY R\\FO[ R\\FV[ R]FW[ RKFOF R\\F`F RE[K[ RS[Z[", "F_OFI[ ROFVX ROIV[ R\\FV[ RLFOF RYF_F RF[L[", "G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF RSFQGOIMLLOKSKVLYN[ RQ[SZUXWUXRYNYKXHVF", "F]OFI[ RPFJ[ RLFXF[G\\I\\K[NYPUQMQ RXFZG[I[KZNXPUQ RF[M[", "G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF RSFQGOIMLLOKSKVLYN[ RQ[SZUXWUXRYNYKXHVF RLYLXMVOUPURVSXS_T`V`W^W] RSXT^U_V_W^", "F^OFI[ RPFJ[ RLFWFZG[I[KZNYOVPMP RWFYGZIZKYNXOVP RRPTQURVZW[Y[ZYZX RURWYXZYZZY RF[M[", "G^ZH[H\\F[L[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJUI[JYKY", "H]UFO[ RVFP[ ROFLLNF]F\\L\\F RL[S[", "F_NFKQJUJXKZN[R[UZWXXU\\F ROFLQKUKXLZN[ RKFRF RYF_F", "H\\NFO[ ROFPY R\\FO[ RLFRF RXF^F", "E_MFK[ RNFLY RUFK[ RUFS[ RVFTY R]FS[ RJFQF RZF`F", "G]NFU[ ROFV[ R\\FH[ RLFRF RXF^F RF[L[ RR[X[", "H]NFRPO[ ROFSPP[ R]FSP RLFRF RYF_F RL[S[", "G][FH[ R\\FI[ ROFLLNF\\F RH[V[XUU[", "H\\KILKXWYYY[ RLLXX RKIKKLMXYY[ RPPLTKVKXLZK[ RKVMZ RLTLVMXMZK[ RSSXN RVIVLWNYNYLWKVI RVIWLYN", "H\\QIK[ RSIY[ RRIX[ RMUVU RI[O[ RU[[[ RQBOCNENGOIQJSJUIVGVEUCSBQB", "", "", "", "", "", "G]IB[b", "F^RJIZ RRJ[Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 2100 to 2199 ********/ "", "I]NONPMPMONNPMTMVNWOXQXXYZZ[ RWOWXXZZ[[[ RWQVRPSMTLVLXMZP[S[UZWX RPSNTMVMXNZP[", "G\\LFL[ RMFM[ RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIFMF", "H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[", "H]WFW[ RXFX[ RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTFXF RW[[[", "H[LSXSXQWOVNTMQMNNLPKSKULXNZQ[S[VZXX RWSWPVN RQMONMPLSLUMXOZQ[", "KXUGTHUIVHVGUFSFQGPIP[ RSFRGQIQ[ RMMUM RM[T[", "I\\QMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM RONNPNTOV RUVVTVPUN RVOWNYMYNWN RNUMVLXLYM[P\\U\\X]Y^ RLYMZP[U[X\\Y^Y_XaUbObLaK_K^L\\O[", "G]LFL[ RMFM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIFMF RI[P[ RT[[[", "MXRFQGRHSGRF RRMR[ RSMS[ ROMSM RO[V[", "MXSFRGSHTGSF RTMT_SaQbObNaN`O_P`Oa RSMS_RaQb RPMTM", "G\\LFL[ RMFM[ RWMMW RRSX[ RQSW[ RIFMF RTMZM RI[P[ RT[Z[", "MXRFR[ RSFS[ ROFSF RO[V[", "BcGMG[ RHMH[ RHPJNMMOMRNSPS[ ROMQNRPR[ RSPUNXMZM]N^P^[ RZM\\N]P][ RDMHM RD[K[ RO[V[ RZ[a[", "G]LML[ RMMM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIMMM RI[P[ RT[[[", "H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM", "G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb", "H\\WMWb RXMXb RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTb[b", "IZNMN[ ROMO[ ROSPPRNTMWMXNXOWPVOWN RKMOM RK[R[", "J[WOXMXQWOVNTMPMNNMOMQNRPSUUWVXW RMPNQPRUTWUXVXYWZU[Q[OZNYMWM[NY", "KZPFPWQZS[U[WZXX RQFQWRZS[ RMMUM", "G]LMLXMZP[R[UZWX RMMMXNZP[ RWMW[ RXMX[ RIMMM RTMXM RW[[[", "I[LMR[ RMMRY RXMR[ RJMPM RTMZM", "F^JMN[ RKMNX RRMN[ RRMV[ RSMVX RZMV[ RGMNM RWM]M", "H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[", "H[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM", "I[WML[ RXMM[ RMMLQLMXM RL[X[XWW[", "G^QMNNLPKRJUJXKZN[P[RZUWWTYPZM RQMONMPLRKUKXLZN[ RQMSMUNVPXXYZZ[ RSMTNUPWXXZZ[[[", "G\\TFQGOIMMLPKTJZIb RTFRGPINMMPLTKZJb RTFVFXGYHYKXMWNTOPO RVFXHXKWMVNTO RPOTPVRWTWWVYUZR[P[NZMYLV RPOSPURVTVWUYTZR[", "H\\IPKNMMOMQNROSRSVRZOb RJOLNPNRO RZMYPXRSYP^Nb RYMXPWRSY", "I\\VNTMRMONMQLTLWMYNZP[R[UZWWXTXQWOSJRHRFSEUEWFYH RRMPNNQMTMXNZ RR[TZVWWTWPVNTKSISGTFVFYH", "I[XPVNTMPMNNNPPRSS RPMONOPQRSS RSSNTLVLXMZP[S[UZWX RSSOTMVMXNZP[", "I[TFRGQHQIRJUKZKZJWKSMPOMRLULWMYP[S]T_TaSbQbPa RULQONRMUMWNYP[", "G]HQIOKMNMONOPNTL[ RMMNNNPMTK[ RNTPPRNTMVMXNYOYRXWUb RVMXOXRWWTb", "F]GQHOJMMMNNNPMUMXNZO[ RLMMNMPLULXMZO[Q[SZUXWUXRYMYIXGVFTFRHRJSMUPWRZT RSZUWVUWRXMXIWGVF", "LXRMPTOXOZP[S[UYVW RSMQTPXPZQ[", "H\\NMJ[ ROMK[ RXMYNZNYMWMUNQROSMS ROSQTSZT[ ROSPTRZS[U[WZYW", "H\\KFMFOGPHQJWXXZY[ RMFOHPJVXWZY[Z[ RRMJ[ RRMK[", "F]MMGb RNMHb RMPLVLYN[P[RZTXVU RXMUXUZV[Y[[Y\\W RYMVXVZW[", "H\\NML[ ROMNSMXL[ RYMXQVU RZMYPXRVUTWQYOZL[ RKMOM", "IZTFRGQHQIRJUKXK RUKQLOMNONQPSSTVT RUKRLPMOOOQQSST RSTOUMVLXLZN\\S^T_TaRbPb RSTPUNVMXMZO\\S^", "I[RMONMQLTLWMYNZP[R[UZWWXTXQWOVNTMRM RRMPNNQMTMXNZ RR[TZVWWTWPVN", "G]PNL[ RPNM[ RVNV[ RVNW[ RIPKNNM[M RIPKONN[N", "H[LVMYNZP[R[UZWWXTXQWOVNTMRMONMQLTHb RR[TZVWWTWPVN RRMPNNQMTIb", "H][MQMNNLQKTKWLYMZO[Q[TZVWWTWQVOUNSM RQMONMQLTLXMZ RQ[SZUWVTVPUN RUN[N", "H\\SNP[ RSNQ[ RJPLNOMZM RJPLOONZN", "H\\IQJOLMOMPNPPNVNYP[ RNMONOPMVMYNZP[Q[TZVXXUYRYOXMWNXOYR RXUYO", "G]ONMOKQJTJWKYLZN[Q[TZWXYUZRZOXMVMTORSPXMb RJWLYNZQZTYWWYU RZOXNVNTPRSPYNb", "I[KMMMONPPU_VaWb RMMNNOPT_UaWbYb RZMYOWRM]K`Jb", "F]UFOb RVFNb RGQHOJMMMNNNPMUMXOZRZTYWVYS RLMMNMPLULXMZO[R[TZVXXUYS[M", "F]JQLOONNMLNJQITIWJZK[M[OZQWRT RIWJYKZMZOYQW RQTQWRZS[U[WZYWZTZQYNXMWNYOZQ RQWRYSZUZWYYW", "H]XMVTUXUZV[Y[[Y\\W RYMWTVXVZW[ RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ", "H[PFLSLVMYNZ RQFMS RMSNPPNRMTMVNWOXQXTWWUZR[P[NZMWMS RVNWPWTVWTZR[ RMFQF", "I[WPWQXQXPWNUMRMONMQLTLWMYNZP[R[UZWW RRMPNNQMTMXNZ", "H]ZFVTUXUZV[Y[[Y\\W R[FWTVXVZW[ RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ RWF[F", "I[MVQUTTWRXPWNUMRMONMQLTLWMYNZP[R[UZWX RRMPNNQMTMXNZ", "KZZGYHZI[H[GZFXFVGUHTJSMP[O_Na RXFVHUJTNRWQ[P^O`NaLbJbIaI`J_K`Ja ROMYM", "H\\YMU[T^RaObLbJaI`I_J^K_J` RXMT[S^QaOb RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ", "H]PFJ[ RQFK[ RMTOPQNSMUMWNXOXQVWVZW[ RUMWOWQUWUZV[Y[[Y\\W RMFQF", "LYUFTGUHVGUF RMQNOPMSMTNTQRWRZS[ RRMSNSQQWQZR[U[WYXW", "LYVFUGVHWGVF RNQOOQMTMUNUQR[Q^P`OaMbKbJaJ`K_L`Ka RSMTNTQQ[P^O`Mb", "H\\PFJ[ RQFK[ RXNWOXPYOYNXMWMUNQROSMS ROSQTSZT[ ROSPTRZS[U[WZYW RMFQF", "MYUFQTPXPZQ[T[VYWW RVFRTQXQZR[ RRFVF", "AbBQCOEMHMINIPHTF[ RGMHNHPGTE[ RHTJPLNNMPMRNSOSQP[ RPMRORQO[ RRTTPVNXMZM\\N]O]Q[W[Z\\[ RZM\\O\\QZWZZ[[^[`YaW", "F]GQHOJMMMNNNPMTK[ RLMMNMPLTJ[ RMTOPQNSMUMWNXOXQVWVZW[ RUMWOWQUWUZV[Y[[Y\\W", "I[RMONMQLTLWMYNZP[R[UZWWXTXQWOVNTMRM RRMPNNQMTMXNZ RR[TZVWWTWPVN", "G\\HQIOKMNMONOPNTJb RMMNNNPMTIb RNTOQQNSMUMWNXOYQYTXWVZS[Q[OZNWNT RWNXPXTWWUZS[ RFbMb", "H\\XMRb RYMSb RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ RObVb", "IZJQKOMMPMQNQPPTN[ ROMPNPPOTM[ RPTRPTNVMXMYNYOXPWOXN", "J[XOXPYPYOXNUMRMONNONQORVVWW RNPOQVUWVWYVZS[P[MZLYLXMXMY", "KYTFPTOXOZP[S[UYVW RUFQTPXPZQ[ RNMWM", "F]GQHOJMMMNNNQLWLYN[ RLMMNMQKWKYLZN[P[RZTXVT RXMVTUXUZV[Y[[Y\\W RYMWTVXVZW[", "H\\IQJOLMOMPNPQNWNYP[ RNMONOQMWMYNZP[Q[TZVXXUYQYMXMYO", "C`DQEOGMJMKNKQIWIYK[ RIMJNJQHWHYIZK[M[OZQXRV RTMRVRYSZU[W[YZ[X\\V]R]M\\M]O RUMSVSYU[", "H\\KQMNOMRMSOSR RQMRORRQVPXNZL[K[JZJYKXLYKZ RQVQYR[U[WZYW RYNXOYPZOZNYMXMVNTPSRRVRYS[", "G\\HQIOKMNMONOQMWMYO[ RMMNNNQLWLYMZO[Q[SZUXWT RZMV[U^SaPbMbKaJ`J_K^L_K` RYMU[T^RaPb", "H\\YMXOVQNWLYK[ RLQMOOMRMVO RMOONRNVOXO RLYNYRZUZWY RNYR[U[WYXW", "G^VGUHVIWHWGUFRFOGMILLL[ RRFPGNIMLM[ R\\G[H\\I]H]G\\FZFXGWIW[ RZFYGXIX[ RIM[M RI[P[ RT[[[", "G]WGVHWIXHWGUFRFOGMILLL[ RRFPGNIMLM[ RWMW[ RXMX[ RIMXM RI[P[ RT[[[", "G]VGUHVIWHWGUF RXFRFOGMILLL[ RRFPGNIMLM[ RWHW[ RXFX[ RIMWM RI[P[ RT[[[", "BcRGQHRISHRGPFMFJGHIGLG[ RMFKGIIHLH[ R]G\\H]I^H]G[FXFUGSIRLR[ RXFVGTISLS[ R]M][ R^M^[ RDM^M RD[K[ RO[V[ RZ[a[", "BcRGQHRISHRGPFMFJGHIGLG[ RMFKGIIHLH[ R\\G[H\\I]H]G[F R^FXFUGSIRLR[ RXFVGTISLS[ R]H][ R^F^[ RDM]M RD[K[ RO[V[ RZ[a[", "MXRMR[ RSMS[ ROMSM RO[V[", "", "IZWNUMRMONMPLSLVMYNZQ[T[VZ RRMPNNPMSMVNYOZQ[ RMTUT", "I\\TFQGOJNLMOLTLXMZO[Q[TZVWWUXRYMYIXGVFTF RTFRGPJOLNOMTMXNZO[ RQ[SZUWVUWRXMXIWGVF RNPWP", "G]UFOb RVFNb RQMMNKPJSJVKXMZP[S[WZYXZUZRYPWNTMQM RQMNNLPKSKVLXNZP[ RS[VZXXYUYRXPVNTM", "I[TMVNXPXOWNTMQMNNMOLQLSMUOWSZ RQMONNOMQMSNUSZT\\T^S_Q_", "", "", "G]LMKNJPJRKUOYP[ RJRKTOXP[P]O`MbLbKaJ_J\\KXMTOQRNTMVMYNZPZTYXWZU[T[SZSXTWUXTY RVMXNYPYTXXWZ", "E_YGXHYIZHYGWFTFQGOINKMNLRJ[I_Ha RTFRGPIOKNNLWK[J^I`HaFbDbCaC`D_E`Da R_G^H_I`H`G_F]F[GZHYJXMU[T_Sa R]F[HZJYNWWV[U^T`SaQbObNaN`O_P`Oa RIM^M", "F^[GZH[I\\H[GXFUFRGPIOKNNMRK[J_Ia RUFSGQIPKONMWL[K^J`IaGbEbDaD`E_F`Ea RYMWTVXVZW[Z[\\Y]W RZMXTWXWZX[ RJMZM", "F^YGXHYIZHZGXF R\\FUFRGPIOKNNMRK[J_Ia RUFSGQIPKONMWL[K^J`IaGbEbDaD`E_F`Ea R[FWTVXVZW[Z[\\Y]W R\\FXTWXWZX[ RJMYM", "@cTGSHTIUHTGRFOFLGJIIKHNGRE[D_Ca ROFMGKIJKINGWF[E^D`CaAb?b>a>`?_@`?a R`G_H`IaH`G]FZFWGUITKSNRRP[O_Na RZFXGVIUKTNRWQ[P^O`NaLbJbIaI`J_K`Ja R^M\\T[X[Z\\[_[aYbW R_M]T\\X\\Z][ RDM_M", "@cTGSHTIUHTGRFOFLGJIIKHNGRE[D_Ca ROFMGKIJKINGWF[E^D`CaAb?b>a>`?_@`?a R^G]H^I_H_G]F RaFZFWGUITKSNRRP[O_Na RZFXGVIUKTNRWQ[P^O`NaLbJbIaI`J_K`Ja R`F\\T[X[Z\\[_[aYbW RaF]T\\X\\Z][ RDM^M", "LYMQNOPMSMTNTQRWRZS[ RRMSNSQQWQZR[U[WYXW", "", "NV", "JZ", /******** Hershey Glyphs 2200 to 2299 ********/ "H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF RQFOGNHMJLOLRMWNYOZQ[ RS[UZVYWWXRXOWJVHUGSF", "H\\NJPISFS[ RRGR[ RN[W[", "H\\LJMKLLKKKJLHMGPFTFWGXHYJYLXNUPPRNSLUKXK[ RTFVGWHXJXLWNTPPR RKYLXNXSZVZXYYX RNXS[W[XZYXYV", "H\\LJMKLLKKKJLHMGPFTFWGXIXLWNTOQO RTFVGWIWLVNTO RTOVPXRYTYWXYWZT[P[MZLYKWKVLUMVLW RWQXTXWWYVZT[", "H\\THT[ RUFU[ RUFJUZU RQ[X[", "H\\MFKP RKPMNPMSMVNXPYSYUXXVZS[P[MZLYKWKVLUMVLW RSMUNWPXSXUWXUZS[ RMFWF RMGRGWF", "H\\WIVJWKXJXIWGUFRFOGMILKKOKULXNZQ[S[VZXXYUYTXQVOSNRNOOMQLT RRFPGNIMKLOLUMXOZQ[ RS[UZWXXUXTWQUOSN", "H\\KFKL RKJLHNFPFUIWIXHYF RLHNGPGUI RYFYIXLTQSSRVR[ RXLSQRSQVQ[", "H\\PFMGLILLMNPOTOWNXLXIWGTFPF RPFNGMIMLNNPO RTOVNWLWIVGTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RPONPMQLSLWMYNZP[ RT[VZWYXWXSWQVPTO", "H\\XMWPURRSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNWMX RQSORMPLMLLMIOGQF RSFUGWIXLXRWVVXTZR[", "MWRYQZR[SZRY", "MWR[QZRYSZS\\R^Q_", "MWRMQNROSNRM RRYQZR[SZRY", "MWRMQNROSNRM RR[QZRYSZS\\R^Q_", "MWRFQHRTSHRF RRHRN RRYQZR[SZRY", "I[MJNKMLLKLJMHNGPFSFVGWHXJXLWNVORQRT RSFUGVHWJWLVNTP RRYQZR[SZRY", "NVRFQM RSFQM", "JZNFMM ROFMM RVFUM RWFUM", "KYQFOGNINKOMQNSNUMVKVIUGSFQF", "JZRFRR RMIWO RWIMO", "G][BIb", "KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`", "KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`", "KYOBOb RPBPb ROBVB RObVb", "KYTBTb RUBUb RNBUB RNbUb", "JYTBQEPHPJQMSOSPORSTSUQWPZP\\Q_Tb RRDQGQKRN RRVQYQ]R`", "KZPBSETHTJSMQOQPURQTQUSWTZT\\S_Pb RRDSGSKRN RRVSYS]R`", "KYUBNRUb", "KYOBVROb", "NVRBRb", "KYOBOb RUBUb", "E_IR[R", "E_RIR[ RIR[R", "F^RJR[ RJRZR RJ[Z[", "F^RJR[ RJJZJ RJRZR", "G]KKYY RYKKY", "MWQQQSSSSQQQ RRQRS RQRSR", "E_RIQJRKSJRI RIR[R RRYQZR[SZRY", "E_IO[O RIU[U", "E_YIK[ RIO[O RIU[U", "E_IM[M RIR[R RIW[W", "F^ZIJRZ[", "F^JIZRJ[", "F^ZFJMZT RJVZV RJ[Z[", "F^JFZMJT RJVZV RJ[Z[", "F_[WYWWVUTRPQOONMNKOJQJSKUMVOVQURTUPWNYM[M", "F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O", "G]JTROZT RJTRPZT", "LXTFOL RTFUGOL", "LXPFUL RPFOGUL", "H\\KFLHNJQKSKVJXHYF RKFLINKQLSLVKXIYF", "MWRHQGRFSGSIRKQL", "MWSFRGQIQKRLSKRJ", "MWRHSGRFQGQIRKSL", "MWQFRGSISKRLQKRJ", "E[HMLMRY RKMR[ R[BR[", "F^ZJSJOKMLKNJQJSKVMXOYSZZZ", "F^JJJQKULWNYQZSZVYXWYUZQZJ", "F^JJQJUKWLYNZQZSYVWXUYQZJZ", "F^JZJSKOLMNKQJSJVKXMYOZSZZ", "F^ZJSJOKMLKNJQJSKVMXOYSZZZ RJRVR", "E_XP[RXT RUMZRUW RIRZR", "JZPLRITL RMORJWO RRJR[", "E_LPIRLT ROMJROW RJR[R", "JZPXR[TX RMURZWU RRIRZ", "I\\XRWOVNTMRMONMQLTLWMYNZP[R[UZWXXUYPYKXHWGUFRFPGOHOIPIPH RRMPNNQMTMXNZ RR[TZVXWUXPXKWHUF", "H\\JFR[ RKFRY RZFR[ RJFZF RKGYG", "AbDMIMRY RHNR[ Rb:R[", "F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia", "F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia RQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK", "F_\\S[UYVWVUUTTQPPONNLNJOIQISJULVNVPUQTTPUOWNYN[O\\Q\\S", "F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[ZZ[X[VYTWT", "F_[NZO[P\\O\\N[MZMYNXPVUTXRZP[M[JZIXIUJSPORMSKSIRGPFNGMIMKNNPQUXWZZ[[[\\Z\\Y RM[KZJXJUKSMQ RMKNMVXXZZ[", "E`WNVLTKQKOLNMMPMSNUPVSVUUVS RQKOMNPNSOUPV RWKVSVUXVZV\\T]Q]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYZX RXKWSWUXV", "H\\PBP_ RTBT_ RXIWJXKYJYIWGTFPFMGKIKKLMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[P[MZKXKWLVMWLX", "G]OFOb RUFUb RJQZQ RJWZW", "JZUITJUKVJVIUGSFQFOGNINKOMQOVR ROMTPVRWTWVVXTZ RPNNPMRMTNVPXU[ RNVSYU[V]V_UaSbQbOaN_N^O]P^O_", "JZRFQHRJSHRF RRFRb RRQQTRbSTRQ RLMNNPMNLLM RLMXM RTMVNXMVLTM", "JZRFQHRJSHRF RRFRT RRPQRSVRXQVSRRP RRTRb RR^Q`RbS`R^ RLMNNPMNLLM RLMXM RTMVNXMVLTM RL[N\\P[NZL[ RL[X[ RT[V\\X[VZT[", "I\\XFX[ RKFXF RPPXP RK[X[", "", "E`QFNGKIILHOHRIUKXNZQ[T[WZZX\\U]R]O\\LZIWGTFQF RROQPQQRRSRTQTPSORO RRPRQSQSPRP", "J[PFNGOIQJ RPFOGOI RUFWGVITJ RUFVGVI RQJOKNLMNMQNSOTQUTUVTWSXQXNWLVKTJQJ RRUR[ RSUS[ RNXWX", "I\\RFOGMILLLMMPORRSSSVRXPYMYLXIVGSFRF RRSR[ RSSS[ RNWWW", "D`PFMGJIHLGOGSHVJYM[P\\T\\W[ZY\\V]S]O\\LZIWGTFPF RRFR\\ RGQ]Q", "G`PMMNKPJSJTKWMYPZQZTYVWWTWSVPTNQMPM R]GWG[HUN R]G]M\\IVO R\\HVN", "F\\IIJGLFOFQGRIRLQOPQNSKU ROFPGQIQMPPNS RVFT[ RWFS[ RKUYU", "I\\MFMU RNFMQ RMQNOONQMTMWNXPXRWTUV RTMVNWPWRTXTZU[W[YY RKFNF", "I\\RNOOMQLTLUMXOZR[S[VZXXYUYTXQVOSNRN RRHNJRFRN RSHWJSFSN RRSQTQURVSVTUTTSSRS RRTRUSUSTRT", "G^QHRFR[ RTHSFS[ RJHKFKMLPNRQSRS RMHLFLNMQ R[HZFZMYPWRTSSS RXHYFYNXQ RNWWW", "G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[Y[YVX[", "H[YGUGQHNJLMKPKSLVNYQ[U\\Y\\ RYGVHSJQMPPPSQVSYV[Y\\", "F_OQMQKRJSIUIWJYKZM[O[QZRYSWSURSQROQ RSHPQ RZJRR R\\QST", "H\\OKUY RUKOY RKOYU RYOKU", "F^NVLUKUIVHXHYI[K\\L\\N[OYOXNVKRJOJMKJMHPGTGWHYJZMZOYRVVUXUYV[X\\Y\\[[\\Y\\X[VYUXUVV RJMKKMIPHTHWIYKZM", "F^NMLNKNIMHKHJIHKGLGNHOJOKNMKQJTJVKYM[P\\T\\W[YYZVZTYQVMUKUJVHXGYG[H\\J\\K[MYNXNVM RJVKXMZP[T[WZYXZV", "I[KYYK RQLULYKXOXS RULXLXO", "I[YKKY RLQLUKYOXSX RLULXOX", "I[YYKK RSLOLKKLOLS ROLLLLO", "I[KKYY RQXUXYYXUXQ RUXXXXU", /******** Hershey Glyphs 2300 to 2399 ********/ "", "F_JMILIJJHLGNGPHQIRKSP RIJKHMHOIPJQLRPR[ R[M\\L\\J[HYGWGUHTISKRP R\\JZHXHVIUJTLSPS[", "F^IGJKKMMOPPTPWOYMZK[G RIGJJKLMNPOTOWNYLZJ[G RPONPMQLSLVMXOZQ[S[UZWXXVXSWQVPTO RPPNQMSMVNY RVYWVWSVQTP", "F^MJMV RNKNU RVKVU RWJWV RIGKIMJPKTKWJYI[G RIYKWMVPUTUWVYW[Y", "F^[ILIJJILINJPLQNQPPQNQLPJ[J RIMJOKPMQ RQMPKOJMI RIXXXZW[U[SZQXPVPTQSSSUTWIW R[TZRYQWP RSTTVUWWX", "F]OUMTLTJUIWIXJZL[M[OZPXPWOUJPINIKJILHOGSGWHYJZLZOYRVUUWUYV[X[YZZX RMSKPJNJKKILH RSGVHXJYLYOXRVU", "G_HKKHMKMV RJILLLV RMKPHRKRU ROIQLQU RRKUHWKW[ RTIVLV[ RWKZH[J\\M\\P[SZUXWUYP[ RYIZJ[M[PZSYUWWTYP[", "F^ISMSLRKOKMLJNHQGSGVHXJYMYOXRWS[S RITOTMRLOLMMJOHQG RSGUHWJXMXOWRUT[T RKXYX RKYYY", "F_GLJIMLMX RIJLMLX RMLPISLSX ROJRMRX RSLVIYLYW[Y RUJXMXXZZ]W", "G]ZIJY RZIWJQJ RXKUKQJ RZIYLYR RXKXNYR RQRJR RPSMSJR RQRQY RPSPVQY", "F^HOJKOU RJMOWRPWPZO[M[KZIXHWHUITKTMUPVRWUWXUZ RWHVIUKUMWQXTXWWYUZ", "F^IOLLPN RKMOORLUN RQMTOWLYN RVMXO[L RIULRPT RKSOURRUT RQSTUWRYT RVSXU[R", "F^JHNJPLQOQRPUNWJY RJHMIOJQLRO RRRQUOWMXJY RZHWIUJSLRO RRRSUUWWXZY RZHVJTLSOSRTUVWZY RIP[P RIQ[Q", "", "", "", "", "NVQQQSSSSQQQ RQQSS RSQQS", "JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY", "JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT", "H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR", "H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR", "J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT", "JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV", "JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV", "JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU", "E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L", "JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ", "JZMLWX RMLONQOTOVNWMWKUKUMTO RONTO RQOWM RVKVN RULWL RWXUVSUPUNVMWMYOYOWPU RUVPU RSUMW RNVNY RMXOX", "JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLWY", "A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH", "EfNSOUQVSVUUVSVQUOSNQNOONPMSMVNYP[S\\V\\Y[[Y\\W]T]P\\MZJXIUHRHOIMJKLIOHSHXI]KaMcPeTfYf]e`cba RKLJNIRIXJ\\L`NbQdUeYe]d_cba RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU RaLaNcNcLaL RbLbN RaMcM RaVaXcXcVaV RbVbX RaWcW", "D`H@Hd RM@Md RW@Wd R\\@\\d RMMWK RMNWL RMOWM RMWWU RMXWV RMYWW", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "NVQQQSSSSQQQ RQQSS RSQQS", "JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY", "JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT", "H\\PMMNLOKQKSLUMVPWTWWVXUYSYQXOWNTMPM RMNLPLSMUNVPW RWVXTXQWOVNTM", "H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR", "J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT", "JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV", "JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV", "JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU", "E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L", "JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ", "JZQCVMRTRU RULQS RTITKPRRUUY RW\\UYSXQXOYN[N]O_Ra RW\\UZSYOYO]P_Ra RSXPZN]", "JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLSY", "A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH", "IjNQOOQNSNUOVQVSUUSVQVOUNTMQMNNKPISHWH[I^K`NaRaW`[_]]`ZcVfQiMk RWHZI]K_N`R`W_[^]\\`YcTgQi RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU ReLeNgNgLeL RfLfN ReMgM ReVeXgXgVeV RfVfX ReWgW", "D`H>Hf RI>If RM>Mf RQBSBSDQDQAR?T>W>Y?[A\\D\\I[LYNWOUOSNRLQNOQNROSQVRXSVUUWUYV[X\\[\\`[cYeWfTfReQcQ`S`SbQb RRBRD RQCSC RY?ZA[D[IZLYN RRLRNPQNRPSRVRX RYVZX[[[`ZcYe RR`Rb RQaSa", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 2400 to 2499 ********/ "", "AcHBHb RIBIb R[B[b R\\B\\b RDB`B RDbMb RWb`b", "BaGBQPFb RFBPP REBPQ REB\\B^I[B RGa\\a RFb\\b^[[b", "I[X+U1R8P=OANFMNMVN^OcPgRlUsXy RU1S6QPBTJTLSNROMRRUSVTXTZPbOfOjPoRsVy RT.R2Q5P:P>QCRF RR^QaPfPjQoRrTv", "I\\N+R1T5U:U>TBPJPLQNROWRRUQVPXPZTbUfUjToRsNy RP.R2S5T:T>SCRF RR^SaTfTjSoRrPv", "I[V.S1Q4O8N=NCOIPMSXT\\UbUgTlSoQs RS1Q5P8O=OBPHQLTWU[VaVgUlSpQsNv", "I[N.Q1S4U8V=VCUITMQXP\\ObOgPlQoSs RQ1S5T8U=UBTHSLPWO[NaNgOlQpSsVv", "7Z:RARRo R@RQo R?RRr RZ\"VJRr", "Ca].\\.[/[0\\1]1^0^.],[+Y+W,U.T0S3R:QJQjPsOv R\\/\\0]0]/\\/ RR:Rj RU.T1S:SZRjQqPtOvMxKyIyGxFvFtGsHsItIuHvGv RGtGuHuHtGt", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 2500 to 2599 ********/ "", "H\\RFJ[ RRIK[J[ RRIY[Z[ RRFZ[ RMUWU RLVXV", "H\\LFL[ RMGMZ RLFTFWGXHYJYMXOWPTQ RMGTGWHXJXMWOTP RMPTPWQXRYTYWXYWZT[L[ RMQTQWRXTXWWYTZMZ", "H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV RZKYKXIWHUGQGOHMKLNLSMVOYQZUZWYXXYVZV", "H]LFL[ RMGMZ RLFSFVGXIYKZNZSYVXXVZS[L[ RMGSGVHWIXKYNYSXVWXVYSZMZ", "I\\MFM[ RNGNZ RMFYF RNGYGYF RNPTPTQ RNQTQ RNZYZY[ RM[Y[", "I[MFM[ RNGN[M[ RMFYF RNGYGYF RNPTPTQ RNQTQ", "H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZRUR RZKYKXIWHUGQGOHNIMKLNLSMVNXOYQZUZWYXXYVYSUSUR", "G]KFK[ RKFLFL[K[ RYFXFX[Y[ RYFY[ RLPXP RLQXQ", "NWRFR[S[ RRFSFS[", "J[VFVVUYSZQZOYNVMV RVFWFWVVYUZS[Q[OZNYMV", "H]LFL[M[ RLFMFM[ RZFYFMR RZFMS RPOY[Z[ RQOZ[", "IZMFM[ RMFNFNZ RNZYZY[ RM[Y[", "F^JFJ[ RKKK[J[ RKKR[ RJFRX RZFRX RYKR[ RYKY[Z[ RZFZ[", "G]KFK[ RLIL[K[ RLIY[ RKFXX RXFXX RXFYFY[", "G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RQGNHLKKNKSLVNYQZSZVYXVYSYNXKVHSGQG", "H\\LFL[ RMGM[L[ RLFUFWGXHYJYMXOWPUQMQ RMGUGWHXJXMWOUPMP", "G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RQGNHLKKNKSLVNYQZSZVYXVYSYNXKVHSGQG RSXX]Y] RSXTXY]", "H\\LFL[ RMGM[L[ RLFTFWGXHYJYMXOWPTQMQ RMGTGWHXJXMWOTPMP RRQX[Y[ RSQY[", "H\\YIWGTFPFMGKIKKLMMNOOTQVRWSXUXXWYTZPZNYMXKX RYIWIVHTGPGMHLILKMMONTPVQXSYUYXWZT[P[MZKX", "J[RGR[ RSGS[R[ RLFYFYG RLFLGYG", "G]KFKULXNZQ[S[VZXXYUYF RKFLFLUMXNYQZSZVYWXXUXFYF", "H\\JFR[ RJFKFRX RZFYFRX RZFR[", "E_GFM[ RGFHFMX RRFMX RRIM[ RRIW[ RRFWX R]F\\FWX R]FW[", "H\\KFX[Y[ RKFLFY[ RYFXFK[ RYFL[K[", "I\\KFRPR[S[ RKFLFSP RZFYFRP RZFSPS[", "H\\XFK[ RYFL[ RKFYF RKFKGXG RLZYZY[ RK[Y[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "E\\XFVHTKQPOSLWIZG[E[DZDXEWFXEY RXFWJUTT[ RXFU[ RT[TYSVRTPRNQLQKRKTLWOZR[V[XZ", "F^UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWIXHY ROLNNMOKOJNJLKJMHOGRFXFZG[I[KZMXNTORO RXFYGZIZKYMXN RTOWPXQYSYVXYWZU[S[RZRXSU RTOVPWQXSXVWYU[", "H]KHJJJLKNNOQOUNWMYKZIZGYFWFTGQJOMMQLULXMZP[R[UZWXXVXTWRURSSRU RWFUGRJPMNQMUMXNZP[", "F]UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWJWLXNZP[S[UZWXYTZOZLYIWGUFPFMGKIJKJMKNMNNMOK", "I\\WIVJVLWMYMZKZIYGWFTFRGQHPJPLQNSO RTFRHQJQMSO RSOQONPLRKTKWLYMZO[R[UZWXXVXTWRURSSRU RQOOPMRLTLXMZ", "G\\WHVJTORUQWOZM[ RQLPNNOLOKMKKLINGQF[FXGWHVKTSSVRXPZM[K[IZHYHXIWJXIY RSFWGXG ROSPRRQVQXPZMXT", "G]JIIKIMJOLPOPROTNWKXHXGWFVFTGRIQKPNPQQSSTUTWSYQZO RWFUGSIRKQNQRST RZOYSWWUYSZO[L[JZIXIWJVKWJX RYSWVUXRZO[", "F^LLKKKILGOFRFOQMWLYKZI[G[FZFXGWHXGY RRFOONRLWKYI[ RJTKSMRVOXN[L]J^H^G]F\\FZGXJWLURTVTYV[W[YZ[X R\\FZHXLVRUVUYV[", "IYWHUKSPQUPWNZL[ RYLWNTOQOONNLNJOHQGUFYFWHVJTPRVQXOZL[J[IZIXJWKXJY", "IZYFWHUKSPPYN] RYMWOTPQPOONMNKOIQGUFYFWIVKSTQXPZN]M^K_J^J\\KZMXOWRVVU", "F^LLKKKIMGPFRFOQMWLYKZI[G[FZFXGWHXGY RRFOONRLWKYI[ RZGWKUMSNPO R]G\\H]I^H^G]F\\FZGWLVMTNPO RPOSPTRUYV[ RPORPSRTYV[W[YZ[X", "I[MILKLMMOOPRPUOWNZK[H[GZFYFWGVHTKPUOWMZK[ RVHTLRSQVPXNZK[I[HZHXIWKWMXPZR[U[WZYX", "D`RFNOKUIXGZE[C[BZBXCWDXCY RRFPMOQNVNZP[ RRFQJPOOVOZP[ R[FWORXP[ R[FYMXQWVWZY[Z[\\Z^X R[FZJYOXVXZY[", "G^RFQJOPMULWJZH[F[EZEXFWGXFY RRFRKSVT[ RRFSKTVT[ R`G_H`IaHaG`F^F\\GZJYLWQUWT[", "H]SFQGOIMLLNKRKVLYMZO[Q[TZVXXUYSZOZKYHXGWGUHSJQNPSPV RQGOJMNLRLVMYO[", "F]UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWIXHY ROLNNMOKOJNJLKJMHOGRFVFYGZH[J[MZOYPVQTQRP RVFXGYHZJZMYOXPVQ", "H]UJULTNSOQPOPNNNLOIQGTFWFYGZIZMYPWSSWPYNZK[I[HZHXIWKWMXPZS[V[XZZX RWFXGYIYMXPVSSVOYK[", "F^UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWIXHY ROLNNMOKOJNJLKJMHOGRFWFZG[I[KZMYNVORO RWFYGZIZKYMXNVO RROUPVRWYX[ RROTPURVYX[Y[[Z]X", "H\\NIMKMMNOPPSPVOXN[K\\H\\G[FZFXGWHVJUMSTRWPZN[ RVJUNTUSXQZN[K[IZHXHWIVJWIX", "I[YHXJVOTUSWQZO[ RSLRNPONOMMMKNIPGSF\\FZGYHXKVSUVTXRZO[M[KZJYJXKWLXKY RUFYGZG", "G]HJJGLFMFOHOKNNKVKYL[ RMFNHNKKSJVJYL[N[PZSWUTVR RZFVRUVUYW[X[ZZ\\X R[FWRVVVYW[", "G\\HJJGLFMFOHOKNOLVLYM[ RMFNHNKLRKVKYM[N[QZTWVTXPYMZIZGYFXFWGVIVLWNYP[Q]Q", "F]ILHLGKGIHGJFNFMHLLKUJ[ RLLLUK[ RVFTHRLOUMYK[ RVFUHTLSUR[ RTLTUS[ R`F^G\\IZLWUUYS[", "H\\PKOLMLLKLIMGOFQFSGTITLSPQUOXMZJ[H[GZGXHWIXHY RQFRGSISLRPPUNXLZJ[ R]G\\H]I^H^G]F[FYGWIULSPRURXSZT[U[WZYX", "G]JJLGNFOFQGQIOOORPT ROFPGPINONRPTRTUSWQYNZL R\\FZLWTUX R]F[LYQWUUXSZP[L[JZIXIWJVKWJX", "G\\ZHYJWOVRUTSWQYOZL[ RSLRNPONOMMMKNIPGSF]F[GZHYKXOVUTXQZL[H[GZGXHWJWLXOZQ[T[WZYX RVFZG[G", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 2600 to 2699 ********/ "", "H\\WMW[X[ RWMXMX[ RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX", "H\\LFL[M[ RLFMFM[ RMPONQMTMVNXPYSYUXXVZT[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX", "I[XPVNTMQMONMPLSLUMXOZQ[T[VZXX RXPWQVOTNQNOONPMSMUNXOYQZTZVYWWXX", "H\\WFW[X[ RWFXFX[ RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX", "I[MTXTXQWOVNTMQMONMPLSLUMXOZQ[T[VZXX RMSWSWQVOTNQNOONPMSMUNXOYQZTZVYWWXX", "LZWFUFSGRJR[S[ RWFWGUGSH RTGSJS[ ROMVMVN ROMONVN", "H\\XMWMW\\V_U`SaQaO`N_L_ RXMX\\W_UaSbPbNaL_ RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX", "H\\LFL[M[ RLFMFM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[", "NWRFQGQHRISITHTGSFRF RRGRHSHSGRG RRMR[S[ RRMSMS[", "NWRFQGQHRISITHTGSFRF RRGRHSHSGRG RRMRbSb RRMSMSb", "H[LFL[M[ RLFMFM[ RXMWMMW RXMMX RPTV[X[ RQSX[", "NWRFR[S[ RRFSFS[", "CbGMG[H[ RGMHMH[ RHQKNMMPMRNSQS[ RHQKOMNONQORQR[S[ RSQVNXM[M]N^Q^[ RSQVOXNZN\\O]Q][^[", "H\\LML[M[ RLMMMM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[", "I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM RQNOONPMSMUNXOYQZTZVYWXXUXSWPVOTNQN", "H\\LMLbMb RLMMMMb RMPONQMTMVNXPYSYUXXVZT[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX", "H\\WMWbXb RWMXMXb RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX", "KYOMO[P[ ROMPMP[ RPSQPSNUMXM RPSQQSOUNXNXM", "J[XPWNTMQMNNMPNRPSUUWV RVUWWWXVZ RWYTZQZNY ROZNXMX RXPWPVN RWOTNQNNO RONNPOR RNQPRUTWUXWXXWZT[Q[NZMX", "MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN", "H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[", "JZLMR[ RLMMMRY RXMWMRY RXMR[", "F^IMN[ RIMJMNX RRMNX RRPN[ RRPV[ RRMVX R[MZMVX R[MV[", "I[LMW[X[ RLMMMX[ RXMWML[ RXMM[L[", "JZLMR[ RLMMMRY RXMWMRYNb RXMR[ObNb", "I[VNL[ RXMNZ RLMXM RLMLNVN RNZXZX[ RL[X[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRTXTZV[XZYY[V RWRUXUZV[", "LZLVNSPO RSFMXMZO[P[RZTXUUURVVWWXWZV RTFNXNZO[", "LXTSSTTTTSSRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[", "K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RZFTXTZV[XZYY[V R[FUXUZV[", "LXOYQXRWSUSSRRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[", "OXRRUOWLXIXGWFUGTIKdKfLgNfOcPZQ[S[UZVYXV RTISNRRO[M`Kd", "K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRPd RWRT[R`PdOfMgLfLdMaO_R]V[YY[V", "L[LVNSPO RSFL[ RTFM[ ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V", "NVSLRMSNTMSL RQROXOZQ[SZTYVV RRRPXPZQ[", "NVSLRMSNTMSL RQRKd RRRO[M`KdJfHgGfGdHaJ_M]Q[TYVV", "LZLVNSPO RSFL[ RTFM[ RURUSVSURTRRTOU ROURVSZT[ ROUQVRZT[U[XYZV", "NVNVPSRO RUFOXOZQ[SZTYVV RVFPXPZQ[", "E^EVGSIRKSKUI[ RIRJSJUH[ RKUMSORPRRSRUP[ RPRQSQUO[ RRUTSVRWRYSYUXXXZY[ RWRXSXUWXWZY[[Z\\Y^V", "I[IVKSMROSOUM[ RMRNSNUL[ ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V", "KYRRPRNSMTLVLXMZO[Q[SZTYUWUUTSRRQSQURWTXVXXWYV RPRNTMVMYO[", "L[LVNSPO RQLHg RRLIg ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V", "K[UUTSRRPRNSMTLVLXMZO[Q[SZ RPRNTMVMYO[ RVRPdPfQgSfTcT[V[YY[V RWRT[R`Pd", "LZLVNSPRRSRUP[ RPRQSQUO[ RRUTSVRWRVU RVRVUWWXWZV", "NZNVPSQQQSTUUWUYTZR[ RQSSUTWTYR[ RNZP[U[XYZV", "NVNVPSRO RUFOXOZQ[SZTYVV RVFPXPZQ[ RPNVN", "K[NRLXLZN[O[QZSXUU RORMXMZN[ RVRTXTZV[XZYY[V RWRUXUZV[", "KZNRMTLWLZN[O[RZTXUUUR RORNTMWMZN[ RURVVWWXWZV", "H]LRJTIWIZK[L[NZPX RMRKTJWJZK[ RRRPXPZR[S[UZWXXUXR RSRQXQZR[ RXRYVZW[W]V", "JZJVLSNRPRQSQUPXOZM[L[KZKYLYKZ RWSVTWTWSVRURSSRUQXQZR[U[XYZV RQSRU RSSQU RPXQZ RQXOZ", "K[NRLXLZN[O[QZSXUU RORMXMZN[ RVRPd RWRT[R`PdOfMgLfLdMaO_R]V[YY[V", "LYLVNSPRRRTSTVSXPZN[ RRRSSSVRXPZ RN[P\\Q^QaPdNfLgKfKdLaO^R\\VYYV RN[O\\P^PaOdNf", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "NV", "JZ", /******** Hershey Glyphs 2700 to 2799 ********/ "H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF ROGMJLOLRMWOZ RNYQZSZVY RUZWWXRXOWJUG RVHSGQGNH", "H\\NJPISFS[ RNJNKPJRHR[S[", "H\\LKLJMHNGPFTFVGWHXJXLWNUQL[ RLKMKMJNHPGTGVHWJWLVNTQK[ RLZYZY[ RK[Y[", "H\\MFXFQO RMFMGWG RWFPO RQNSNVOXQYTYUXXVZS[P[MZLYKWLW RPOSOVPXS RTOWQXTXUWXTZ RXVVYSZPZMYLW ROZLX", "H\\UIU[V[ RVFV[ RVFKVZV RUILV RLUZUZV", "H\\MFLO RNGMN RMFWFWG RNGWG RMNPMSMVNXPYSYUXXVZS[P[MZLYKWLW RLOMOONSNVOXR RTNWPXSXUWXTZ RXVVYSZPZMYLW ROZLX", "H\\VGWIXIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQ RWHTGRGOH RPGNJMOMTNXQZ RMVOYRZSZVYXV RTZWXXUXTWQTO RXSVPSOROOPMS RQONQMT", "H\\KFYFO[ RKFKGXG RXFN[O[", "H\\PFMGLILKMMNNPOTPVQWRXTXWWYTZPZMYLWLTMRNQPPTOVNWMXKXIWGTFPF RNGMIMKNMPNTOVPXRYTYWXYWZT[P[MZLYKWKTLRNPPOTNVMWKWIVG RWHTGPGMH RLXOZ RUZXX", "H\\WPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLXMXNZ RWMVPSR RWNUQRRQRNQLN RPRMPLMLLMIPG RLKNHQGRGUHWK RSGVIWMWRVWTZ RUYRZPZMY", "MXRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "MXTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^", "MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^", "MXRFRTST RRFSFST RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "I\\LKLJMHNGQFTFWGXHYJYLXNWOUPRQ RLKMKMJNHQGTGWHXJXLWNUORP RMIPG RUGXI RXMTP RRPRTSTSP RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "MXTFRGQIQLRMSMTLTKSJRJQK RRKRLSLSKRK RRGQK RQIRJ", "MXTHSIRIQHQGRFSFTGTJSLQM RRGRHSHSGRG RSITJ RTHSL", "F_\\MZMXNWPUVTXSYQZMZKYJWJUKSLRQOSMTKTISGQFPFNGMIMKNNPQUWXZZ[\\[ R\\M\\NZNWP RZMXPVVUXSZQ[M[KZJYIWIUJSLQQNRMSKSIRG RSHQGPGNH ROGNINKONQQVWXYZZ\\Z\\[", "I\\RBR_S_ RRBSBS_ RWIYIWGTFQFNGLILKMMNNVRWSXUXWWYTZQZOYNX RWIVHTGQGNHMIMKNMVQXSYUYWXYWZT[Q[NZLXNX RXXUZ", "G^[BIbJb R[B\\BJb", "KYUBSDQGOKNPNTOYQ]S`UbVb RUBVBTDRGPKOPOTPYR]T`Vb", "KYNBPDRGTKUPUTTYR]P`NbOb RNBOBQDSGUKVPVTUYS]Q`Ob", "JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO", "F_JQ[Q[R RJQJR[R", "F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R", "F_JM[M[N RJMJN[N RJU[U[V RJUJV[V", "NWSFRGRM RSGRM RSFTGRM", "I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM", "KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF", "F^ZIJRZ[ RZIZJLRZZZ[", "F^JIZRJ[ RJIJJXRJZJ[", "G^OFObPb ROFPFPb RUFUbVb RUFVFVb RJP[P[Q RJPJQ[Q RJW[W[X RJWJX[X", "F^[FYGVHSHPGNFLFJGIIIKKMMMOLPJPHNF R[FH[I[ R[F\\FI[ RYTWTUUTWTYV[X[ZZ[X[VYT RNFJGIKMMPJNF RLFIIKMOLPHLF RYTUUTYX[[XYT RWTTWV[ZZ[VWT", "E`WMTKQKOLNMMOMRNTOUQVTVWT RWMTLQLOMNONROTQUTUWT RVKVSWUYVZV\\U]S]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[U[YZ RVKWKWSXUZV RYV[U\\S\\O[LZJYIWHTGQGNHLIKJJLIOIRJUKWLXNYQZUZYYYZ", "E_JPLONOPPSTTUVVXVZU[S[QZOXNVNTOSPPTNULUJT RZPXOVOTPQTPUNVLVJUISIQJOLNNNPOQPTTVUXUZT RKOJQJSKU RYUZSZQYO", "", "", "", "", "", "", "", "", "", "", "", "", "NV", "JZ", "H]TFQGOIMLLOKSKVLYMZO[Q[TZVXXUYRZNZKYHXGVFTF RTFRGPINLMOLSLVMYO[ RQ[SZUXWUXRYNYKXHVF", "H]TJO[ RVFP[ RVFSIPKNL RUIQKNL", "H]OJPKOLNKNJOHPGSFVFYGZIZKYMWOTQPSMUKWI[ RVFXGYIYKXMVOPS RJYKXMXRZUZWYXW RMXR[U[WZXW", "H]OJPKOLNKNJOHPGSFVFYGZIZKYMVOSP RVFXGYIYKXMVO RQPSPVQWRXTXWWYVZS[O[LZKYJWJVKULVKW RSPUQVRWTWWVYUZS[", "H]XGR[ RYFS[ RYFJUZU", "H]QFLP RQF[F RQGVG[F RLPMOPNSNVOWPXRXUWXUZR[O[LZKYJWJVKULVKW RSNUOVPWRWUVXTZR[", "H]YIXJYKZJZIYGWFTFQGOIMLLOKSKWLYMZO[R[UZWXXVXSWQVPTOQOOPMRLT RTFRGPINLMOLSLXMZ RR[TZVXWVWRVP", "H]NFLL R[FZIXLSRQUPWO[ RXLRRPUOWN[ RMIPFRFWI RNHPGRGWIYIZH[F", "H]SFPGOHNJNMOOQPTPXOYNZLZIYGVFSF RSFQGPHOJOMPOQP RTPWOXNYLYIXGVF RQPMQKSJUJXKZN[R[VZWYXWXTWRVQTP RQPNQLSKUKXLZN[ RR[UZVYWWWSVQ", "H]YMXOVQTRQROQNPMNMKNIPGSFVFXGYHZJZNYRXUVXTZQ[N[LZKXKWLVMWLX ROQNONKOIQGSF RXGYIYNXRWUUXSZQ[", "MXPYOZP[QZPY", "MXP[OZPYQZQ[P]N_", "MXSMRNSOTNSM RPYOZP[QZ", "MXSMRNSOTNSM RP[OZPYQZQ[P]N_", "MXUFTGRS RUGRS RUFVGRS RPYOZP[QZPY", "H]OJPKOLNKNJOHPGSFWFZG[I[KZMYNSPQQQSRTTT RWFYGZIZKYMXNVO RPYOZP[QZPY", "MXVFTHSJSKTLUKTJ", "MXUHTGUFVGVHUJSL", "E_\\N[O\\P]O]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQUSXUZW[Y[ZYZX RK[IZHXHVITJSPP ROLPQQTSWUYWZYZZY", "H]TBL_ RYBQ_ RZJYKZL[K[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJVKULVKW", "G]_BEb", "KZZBVESHQKOONTNXO]P`Qb RVESIQMPPOUOZP_Qb", "JYSBTDUGVLVPUUSYQ\\N_Jb RSBTEUJUOTTSWQ[N_", "J[TFTR ROIYO RYIOO", "E_IR[R", "E_RIR[ RIR[R", "E_IO[O RIU[U", "NWUFSM RVFSM", "I[PFNM RQFNM RYFWM RZFWM", "KZSFQGPIPKQMSNUNWMXKXIWGUFSF", "F^ZIJRZ[", "F^JIZRJ[", "H]SFLb RYFRb RLQZQ RKWYW", "E_^F\\GXHUHQGOFMFKGJIJKLMNMPLQJQHOF R^FF[ RXTVTTUSWSYU[W[YZZXZVXT", "E`WNVLTKQKOLNMMPMSNUPVSVUUVS RQKOMNPNSOUPV RWKVSVUXVZV\\T]Q]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYZX RXKWSWUXV", "F_\\S[UYVWVUUTTQPPONNLNJOIQISJULVNVPUQTTPUOWNYN[O\\Q\\S", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 2800 to 2899 ********/ "", "H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[", "G]LFL[ RMFM[ RIFYFYLXF RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[", "G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[", "I[NFN[ ROFO[ RKFZFZLYF RK[R[", "F^NFNLMTLXKZJ[ RXFX[ RYFY[ RKF\\F RG[\\[ RG[Gb RH[Gb R[[\\b R\\[\\b", "G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[", "CbRFR[ RSFS[ ROFVF RGGHHGIFHFGGFHFIGJIKMLONPWPYOZM[I\\G]F^F_G_H^I]H^G RNPLQKSJXIZH[ RNPMQLSKXJZI[G[FZEX RWPYQZS[X\\Z][ RWPXQYSZX[Z\\[^[_Z`X RO[V[", "H\\LIKFKLLINGPFTFWGXIXLWNTOQO RTFVGWIWLVNTO RTOVPXRYTYWXYWZT[O[MZLYKWKVLUMVLW RWQXTXWWYVZT[", "F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RXHLY RH[O[ RU[\\[", "F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RXHLY RH[O[ RU[\\[ RN@N?M?M@NBPCTCVBW@", "F^KFK[ RLFL[ RHFOF RLPSPUOVMWIXGYFZF[G[HZIYHZG RSPUQVSWXXZY[ RSPTQUSVXWZX[Z[[Z\\X RH[O[", "E^MFMLLTKXJZI[H[GZGYHXIYHZ RXFX[ RYFY[ RJF\\F RU[\\[", "F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][", "F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF", "F^KFK[ RLFL[ RXFX[ RYFY[ RHF\\F RH[O[ RU[\\[", "G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[", "G\\XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXXYV RQFOGMILKKNKSLVMXOZQ[", "I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[", "H]KFRV RLFSV RZFSVQYPZN[M[LZLYMXNYMZ RIFOF RVF\\F", "F_RFR[ RSFS[ ROFVF RPILJJLIOIRJULWPXUXYW[U\\R\\O[LYJUIPI RPIMJKLJOJRKUMWPX RUXXWZU[R[OZLXJUI RO[V[", "H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[", "F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RH[\\[ R[[\\b R\\[\\b", "F]KFKQLSOTRTUSWQ RLFLQMSOT RWFW[ RXFX[ RHFOF RTF[F RT[[[", "BcGFG[ RHFH[ RRFR[ RSFS[ R]F][ R^F^[ RDFKF ROFVF RZFaF RD[a[", "BcGFG[ RHFH[ RRFR[ RSFS[ R]F][ R^F^[ RDFKF ROFVF RZFaF RD[a[ R`[ab Ra[ab", "F`PFP[ RQFQ[ RIFHLHFTF RQPXP[Q\\R]T]W\\Y[ZX[M[ RXPZQ[R\\T\\W[YZZX[", "CaHFH[ RIFI[ REFLF RIPPPSQTRUTUWTYSZP[E[ RPPRQSRTTTWSYRZP[ R[F[[ R\\F\\[ RXF_F RX[_[", "H]MFM[ RNFN[ RJFQF RNPUPXQYRZTZWYYXZU[J[ RUPWQXRYTYWXYWZU[", "H]LIKFKLLINGQFSFVGXIYKZNZSYVXXVZS[P[MZLYKWKVLUMVLW RSFUGWIXKYNYSXVWXUZS[ RPPYP", "CbHFH[ RIFI[ REFLF RE[L[ RVFSGQIPKOOORPVQXSZV[X[[Z]X^V_R_O^K]I[GXFVF RVFTGRIQKPOPRQVRXTZV[ RX[ZZ\\X]V^R^O]K\\IZGXF RIPOP", "G]WFW[ RXFX[ R[FOFLGKHJJJLKNLOOPWP ROFMGLHKJKLLNMOOP RRPPQORLYKZJZIY RPQOSMZL[J[IYIX RT[[[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 2900 to 2999 ********/ "", "I]NONPMPMONNPMTMVNWOXQXXYZZ[ RWOWXXZZ[[[ RWQVRPSMTLVLXMZP[S[UZWX RPSNTMVMXNZP[", "H\\XFWGQINKLNKQKULXNZQ[S[VZXXYUYSXPVNSMQMNNLPKS RXFWHUIQJNLLN RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM", "H\\MMM[ RNMN[ RJMUMXNYPYQXSUT RUMWNXPXQWSUT RNTUTXUYWYXXZU[J[ RUTWUXWXXWZU[", "HZMMM[ RNMN[ RJMXMXRWM RJ[Q[", "F]NMNQMWLZK[ RWMW[ RXMX[ RKM[M RI[H`H[[[[`Z[", "H[LSXSXQWOVNTMQMNNLPKSKULXNZQ[S[VZXX RWSWPVN RQMONMPLSLUMXOZQ[", "E`RMR[ RSMS[ ROMVM RJNIOHNIMJMKNMRNSPTUTWSXRZN[M\\M]N\\O[N RPTNUMVKZJ[ RPTNVLZK[I[HZGX RUTWUXVZZ[[ RUTWVYZZ[\\[]Z^X RO[V[", "I[MOLMLQMONNPMTMWNXPXQWSTT RTMVNWPWQVSTT RQTTTWUXWXXWZT[P[MZLXLWMVNWMX RTTVUWWWXVZT[", "G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[P[ RT[[[ RWNMZ", "G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[P[ RT[[[ RWNMZ ROGOFNFNGOIQJSJUIVG", "H\\MMM[ RNMN[ RJMQM RNTPTSSTRVNWMXMYNXOWN RPTSUTVVZW[ RPTRUSVUZV[X[YZZX RJ[Q[", "G]NMNQMWLZK[J[IZJYKZ RWMW[ RXMX[ RKM[M RT[[[", "G^LML[ RLMR[ RMMRY RXMR[ RXMX[ RYMY[ RIMMM RXM\\M RI[O[ RU[\\[", "G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RMTWT RI[P[ RT[[[", "H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM", "G]LML[ RMMM[ RWMW[ RXMX[ RIM[M RI[P[ RT[[[", "G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb", "H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[", "I\\RMR[ RSMS[ RMMLRLMYMYRXM RO[V[", "I[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM", "H]RFRb RSFSb ROFSF RRPQNPMNMLNKQKWLZN[P[QZRX RNMMNLQLWMZN[ RWMXNYQYWXZW[ RSPTNUMWMYNZQZWYZW[U[TZSX RObVb", "H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[", "G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[[[[`Z[", "G]LMLTMVPWRWUVWT RMMMTNVPW RWMW[ RXMX[ RIMPM RTM[M RT[[[", "CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[", "CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[``_[", "H]QMQ[ RRMR[ RLMKRKMUM RRTVTYUZWZXYZV[N[ RVTXUYWYXXZV[", "E_JMJ[ RKMK[ RGMNM RKTOTRUSWSXRZO[G[ ROTQURWRXQZO[ RYMY[ RZMZ[ RVM]M RV[][", "J[OMO[ RPMP[ RLMSM RPTTTWUXWXXWZT[L[ RTTVUWWWXVZT[", "I\\MOLMLQMONNPMSMVNXPYSYUXXVZS[P[NZLXLWMVNWMX RSMUNWPXSXUWXUZS[ RRTXT", "DaIMI[ RJMJ[ RFMMM RF[M[ RVMSNQPPSPUQXSZV[X[[Z]X^U^S]P[NXMVM RVMTNRPQSQURXTZV[ RX[ZZ\\X]U]S\\PZNXM RJTPT", "G\\VMV[ RWMW[ RZMOMLNKPKQLSOTVT ROMMNLPLQMSOT RTTQUPVNZM[ RTTRUQVOZN[L[KZJX RS[Z[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3000 to 3099 ********/ "", "H\\RFKZ RQIW[ RRIX[ RRFY[ RMUVU RI[O[ RT[[[ RKZJ[ RKZM[ RWZU[ RWYV[ RXYZ[", "G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZLYNXOUP RXHYJYLXN RUFWGXIXMWOUP RNPUPXQYRZTZWYYXZU[I[ RXRYTYWXY RUPWQXSXXWZU[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[", "G\\XIYFYLXIVGTFQFNGLIKKJNJSKVLXNZQ[T[VZXXYV RMILKKNKSLVMX RQFOGMJLNLSMWOZQ[", "G]LFL[ RMGMZ RNFN[ RIFSFVGXIYKZNZSYVXXVZS[I[ RWIXKYNYSXVWX RSFUGWJXNXSWWUZS[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[", "G\\LFL[ RMGMZ RNFN[ RIFYFYL RNPTP RTLTT RI[Y[YU RJFLG RKFLH ROFNH RPFNG RTFYG RVFYH RWFYI RXFYL RTLSPTT RTNRPTR RTOPPTQ RLZJ[ RLYK[ RNYO[ RNZP[ RT[YZ RV[YY RW[YX RX[YU", "G[LFL[ RMGMZ RNFN[ RIFYFYL RNPTP RTLTT RI[Q[ RJFLG RKFLH ROFNH RPFNG RTFYG RVFYH RWFYI RXFYL RTLSPTT RTNRPTR RTOPPTQ RLZJ[ RLYK[ RNYO[ RNZP[", "G^XIYFYLXIVGTFQFNGLIKKJNJSKVLXNZQ[T[VZXZY[YS RMILKKNKSLVMX RQFOGMJLNLSMWOZQ[ RXTXY RWSWYVZ RTS\\S RUSWT RVSWU RZSYU R[SYT", "F^KFK[ RLGLZ RMFM[ RWFW[ RXGXZ RYFY[ RHFPF RTF\\F RMPWP RH[P[ RT[\\[ RIFKG RJFKH RNFMH ROFMG RUFWG RVFWH RZFYH R[FYG RKZI[ RKYJ[ RMYN[ RMZO[ RWZU[ RWYV[ RYYZ[ RYZ[[", "LXQFQ[ RRGRZ RSFS[ RNFVF RN[V[ ROFQG RPFQH RTFSH RUFSG RQZO[ RQYP[ RSYT[ RSZU[", "JZSFSWRZQ[ RTGTWSZ RUFUWTZQ[O[MZLXLVMUNUOVOWNXMX RMVMWNWNVMV RPFXF RQFSG RRFSH RVFUH RWFUG", "F\\KFK[ RLGLZ RMFM[ RXGMR RPPW[ RQPX[ RQNY[ RHFPF RUF[F RH[P[ RT[[[ RIFKG RJFKH RNFMH ROFMG RWFXG RZFXG RKZI[ RKYJ[ RMYN[ RMZO[ RWYU[ RWYZ[", "I[NFN[ ROGOZ RPFP[ RKFSF RK[Z[ZU RLFNG RMFNH RQFPH RRFPG RNZL[ RNYM[ RPYQ[ RPZR[ RU[ZZ RW[ZY RX[ZX RY[ZU", "E_JFJZ RJFQ[ RKFQX RLFRX RXFQ[ RXFX[ RYGYZ RZFZ[ RGFLF RXF]F RG[M[ RU[][ RHFJG R[FZH R\\FZG RJZH[ RJZL[ RXZV[ RXYW[ RZY[[ RZZ\\[", "F^KFKZ RKFY[ RLFXX RMFYX RYGY[ RHFMF RVF\\F RH[N[ RIFKG RWFYG R[FYG RKZI[ RKZM[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RMILKKNKSLVMX RWXXVYSYNXKWI RQFOGMJLNLSMWOZQ[ RS[UZWWXSXNWJUGSF", "G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZMYOXPUQNQ RXHYJYMXO RUFWGXIXNWPUQ RI[Q[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RMILKKNKSLVMX RWXXVYSYNXKWI RQFOGMJLNLSMWOZQ[ RS[UZWWXSXNWJUGSF RNXOVQURUTVUXV^W`Y`Z^Z\\ RV\\W^X_Y_ RUXW]X^Y^Z]", "G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZLYNXOUPNP RXHYJYLXN RUFWGXIXMWOUP RRPTQUSWYX[Z[[Y[W RWWXYYZZZ RTQURXXYYZY[X RI[Q[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[", "H\\XIYFYLXIVGSFPFMGKIKLLNOPURWSXUXXWZ RLLMNOOUQWRXT RMGLILKMMONUPXRYTYWXYWZT[Q[NZLXKUK[LX", "H\\JFJL RQFQ[ RRGRZ RSFS[ RZFZL RJFZF RN[V[ RKFJL RLFJI RMFJH ROFJG RUFZG RWFZH RXFZI RYFZL RQZO[ RQYP[ RSYT[ RSZU[", "F^KFKULXNZQ[S[VZXXYUYG RLGLVMX RMFMVNYOZQ[ RHFPF RVF\\F RIFKG RJFKH RNFMH ROFMG RWFYG R[FYG", "H\\KFR[ RLFRXR[ RMFSX RYGR[ RIFPF RUF[F RJFLH RNFMH ROFMG RWFYG RZFYG", "F^JFN[ RKFNVN[ RLFOV RRFOVN[ RRFV[ RSFVVV[ RTFWV RZGWVV[ RGFOF RRFTF RWF]F RHFKG RIFKH RMFLH RNFLG RXFZG R\\FZG", "H\\KFW[ RLFX[ RMFY[ RXGLZ RIFPF RUF[F RI[O[ RT[[[ RJFMH RNFMH ROFMG RVFXG RZFXG RLZJ[ RLZN[ RWZU[ RWYV[ RWYZ[", "G]JFQQQ[ RKFRQRZ RLFSQS[ RYGSQ RHFOF RVF\\F RN[V[ RIFKG RNFLG RWFYG R[FYG RQZO[ RQYP[ RSYT[ RSZU[", "H\\YFKFKL RWFK[ RXFL[ RYFM[ RK[Y[YU RLFKL RMFKI RNFKH RPFKG RT[YZ RV[YY RW[YX RX[YU", "H\\RFKZ RQIW[ RRIX[ RRFY[ RMUVU RI[O[ RT[[[ RKZJ[ RKZM[ RWZU[ RWYV[ RXYZ[", "G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZLYNXOUP RXHYJYLXN RUFWGXIXMWOUP RNPUPXQYRZTZWYYXZU[I[ RXRYTYWXY RUPWQXSXXWZU[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[", "I[NFN[ ROGOZ RPFP[ RKFZFZL RK[S[ RLFNG RMFNH RQFPH RRFPG RUFZG RWFZH RXFZI RYFZL RNYM[ RNZL[ RPYQ[ RPZR[", "H\\RFJ[ RQIX[ RRIY[ RRFZ[ RKYXY RKZXZ RJ[Z[", "G\\LFL[ RMGMZ RNFN[ RIFYFYL RNPTP RTLTT RI[Y[YU RJFLG RKFLH ROFNH RPFNG RTFYG RVFYH RWFYI RXFYL RTLSPTT RTNRPTR RTOPPTQ RLZJ[ RLYK[ RNYO[ RNZP[ RT[YZ RV[YY RW[YX RX[YU", "H\\YFKFKL RWFK[ RXFL[ RYFM[ RK[Y[YU RLFKL RMFKI RNFKH RPFKG RT[YZ RV[YY RW[YX RX[YU", "F^KFK[ RLGLZ RMFM[ RWFW[ RXGXZ RYFY[ RHFPF RTF\\F RMPWP RH[P[ RT[\\[ RIFKG RJFKH RNFMH ROFMG RUFWG RVFWH RZFYH R[FYG RKZI[ RKYJ[ RMYN[ RMZO[ RWZU[ RWYV[ RYYZ[ RYZ[[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RMILKKNKSLVMX RWXXVYSYNXKWI RQFOGMJLNLSMWOZQ[ RS[UZWWXSXNWJUGSF ROMOT RUMUT ROPUP ROQUQ RONPP ROOQP RUNTP RUOSP RPQOS RQQOR RSQUR RTQUS", "LXQFQ[ RRGRZ RSFS[ RNFVF RN[V[ ROFQG RPFQH RTFSH RUFSG RQZO[ RQYP[ RSYT[ RSZU[", "F\\KFK[ RLGLZ RMFM[ RXGMR RPPW[ RQPX[ RQNY[ RHFPF RUF[F RH[P[ RT[[[ RIFKG RJFKH RNFMH ROFMG RWFXG RZFXG RKZI[ RKYJ[ RMYN[ RMZO[ RWYU[ RWYZ[", "H\\RFKZ RQIW[ RRIX[ RRFY[ RI[O[ RT[[[ RKZJ[ RKZM[ RWZU[ RWYV[ RXYZ[", "E_JFJZ RJFQ[ RKFQX RLFRX RXFQ[ RXFX[ RYGYZ RZFZ[ RGFLF RXF]F RG[M[ RU[][ RHFJG R[FZH R\\FZG RJZH[ RJZL[ RXZV[ RXYW[ RZY[[ RZZ\\[", "F^KFKZ RKFY[ RLFXX RMFYX RYGY[ RHFMF RVF\\F RH[N[ RIFKG RWFYG R[FYG RKZI[ RKZM[", "G]JEJL RZEZL ROMOT RUMUT RJUJ\\ RZUZ\\ RJGZG RJHZH RJIZI ROPUP ROQUQ RJXZX RJYZY RJZZZ RJFMH RZFWH RKIJK RLIJJ RXIZJ RYIZK RONPP ROOQP RUNTP RUOSP RPQOS RQQOR RSQUR RTQUS RJVKX RJWLX RZWXX RZVYX RMYJ[ RWYZ[", "G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RMILKKNKSLVMX RWXXVYSYNXKWI RQFOGMJLNLSMWOZQ[ RS[UZWWXSXNWJUGSF", "F^KFK[ RLGLZ RMFM[ RWFW[ RXGXZ RYFY[ RHF\\F RH[P[ RT[\\[ RIFKG RJFKH RNFMH ROFMG RUFWG RVFWH RZFYH R[FYG RKZI[ RKYJ[ RMYN[ RMZO[ RWZU[ RWYV[ RYYZ[ RYZ[[", "G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZMYOXPUQNQ RXHYJYMXO RUFWGXIXNWPUQ RI[Q[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[", "G]IFPPQQ RJFQP RKFRPI[ RIFYFZLYIWF RVFYH RTFYG RKYYY RJZYZ RI[Y[ZUYXWY", "H\\JFJL RQFQ[ RRGRZ RSFS[ RZFZL RJFZF RN[V[ RKFJL RLFJI RMFJH ROFJG RUFZG RWFZH RXFZI RYFZL RQZO[ RQYP[ RSYT[ RSZU[", "H\\JMKILGMFOFPGQIRM RLHMGOGPH RJMKJMHOHPIQMQ[ RRMR[ RZMYJWHUHTISMS[ RXHWGUGTH RZMYIXGWFUFTGSIRM RN[V[ RQYP[ RQZO[ RSZU[ RSYT[", "G]QFQ[ RRGRZ RSFS[ RNFVF RN[V[ ROFQG RPFQH RTFSH RUFSG RQZO[ RQYP[ RSYT[ RSZU[ ROKLLKMJOJRKTLUOVUVXUYTZRZOYMXLUKOK RLMKOKRLT RXTYRYOXM ROKMLLOLRMUOV RUVWUXRXOWLUK", "H\\KFW[ RLFX[ RMFY[ RXGLZ RIFPF RUF[F RI[O[ RT[[[ RJFMH RNFMH ROFMG RVFXG RZFXG RLZJ[ RLZN[ RWZU[ RWYV[ RWYZ[", "F^QFQ[ RRGRZ RSFS[ RNFVF RN[V[ ROFQG RPFQH RTFSH RUFSG RQZO[ RQYP[ RSYT[ RSZU[ RHMIMJNKQLSMTPUTUWTXSYQZN[M\\M RLRKNJLILKN RHMIKJKKLLPMSNTPU RYN[LZLYNXR RTUVTWSXPYLZK[K\\M", "G]NYKYJWK[O[MVKRJOJLKIMGPFTFWGYIZLZOYRWVU[Y[ZWYYVY RLSKOKLLI RXIYLYOXS RO[MULPLKMHNGPF RTFVGWHXKXPWUU[ RKZNZ RVZYZ", "H\\UFIZ RSJT[ RTHUZ RUFUHVYV[ RLUTU RF[L[ RQ[X[ RIZG[ RIZK[ RTZR[ RTYS[ RVYW[", "F^OFI[ RPFJ[ RQFK[ RLFWFZG[I[KZNYOVP RYGZIZKYNXO RWFXGYIYKXNVP RNPVPXQYSYUXXVZR[F[ RWQXSXUWXUZ RVPWRWUVXTZR[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[", "H]ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[S[UZWXXV RQHOJNLMOLSLWMY RTFRGPJOLNOMSMXNZP[", "F]OFI[ RPFJ[ RQFK[ RLFUFXGYHZKZOYSWWUYSZO[F[ RWGXHYKYOXSVWTY RUFWHXKXOWSUWRZO[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[", "F]OFI[ RPFJ[ RQFK[ RULST RLF[FZL RNPTP RF[U[WV RMFPG RNFOH RRFPH RSFPG RWFZG RXFZH RYFZI RZFZL RULSPST RTNRPSR RTOQPSQ RJZG[ RJYH[ RKYL[ RJZM[ RP[UZ RR[UY RUYWV", "F\\OFI[ RPFJ[ RQFK[ RULST RLF[FZL RNPTP RF[N[ RMFPG RNFOH RRFPH RSFPG RWFZG RXFZH RYFZI RZFZL RULSPST RTNRPSR RTOQPSQ RJZG[ RJYH[ RKYL[ RJZM[", "H^ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[R[UZWXYT RQHOJNLMOLSLWMY RVXWWXT RTFRGPJOLNOMSMXNZP[ RR[TZVWWT RTT\\T RUTWU RVTWW RZTXV R[TXU", "E_NFH[ ROFI[ RPFJ[ RZFT[ R[FU[ R\\FV[ RKFSF RWF_F RLPXP RE[M[ RQ[Y[ RLFOG RMFNH RQFOH RRFOG RXF[G RYFZH R]F[H R^F[G RIZF[ RIYG[ RJYK[ RIZL[ RUZR[ RUYS[ RVYW[ RUZX[", "KYTFN[ RUFO[ RVFP[ RQFYF RK[S[ RRFUG RSFTH RWFUH RXFUG ROZL[ ROYM[ RPYQ[ ROZR[", "I\\WFRWQYO[ RXFTSSVRX RYFUSSXQZO[M[KZJXJVKULUMVMWLXKX RKVKWLWLVKV RTF\\F RUFXG RVFWH RZFXH R[FXG", "F]OFI[ RPFJ[ RQFK[ R\\GMR RQOU[ RROV[ RSNWZ RLFTF RYF_F RF[N[ RR[Y[ RMFPG RNFOH RRFPH RSFPG RZF\\G R^F\\G RJZG[ RJYH[ RKYL[ RJZM[ RUZS[ RUYT[ RVYX[", "H\\QFK[ RRFL[ RSFM[ RNFVF RH[W[YU ROFRG RPFQH RTFRH RUFRG RLZI[ RLYJ[ RMYN[ RLZO[ RR[WZ RT[XX RV[YU", "D`MFGZ RMGNYN[ RNFOY ROFPX R[FPXN[ R[FU[ R\\FV[ R]FW[ RJFOF R[F`F RD[J[ RR[Z[ RKFMG RLFMH R^F\\H R_F\\G RGZE[ RGZI[ RVZS[ RVYT[ RWYX[ RVZY[", "F_OFIZ ROFV[ RPFVX RQFWX R\\GWXV[ RLFQF RYF_F RF[L[ RMFPG RNFPH RZF\\G R^F\\G RIZG[ RIZK[", "G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF ROIMLLOKSKWLY RUXWUXRYNYJXH RSFQGOJNLMOLSLXMZN[ RQ[SZUWVUWRXNXIWGVF", "F]OFI[ RPFJ[ RQFK[ RLFXF[G\\I\\K[NYPUQMQ RZG[I[KZNXP RXFYGZIZKYNWPUQ RF[N[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[", "G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF ROIMLLOKSKWLY RUXWUXRYNYJXH RSFQGOJNLMOLSLXMZN[ RQ[SZUWVUWRXNXIWGVF RLXMVOUPURVSXT]U^V^W] RT^U_V_ RSXS_T`V`W]W\\", "F^OFI[ RPFJ[ RQFK[ RLFWFZG[I[KZNYOVPNP RYGZIZKYNXO RWFXGYIYKXNVP RRPTQURWXXYYYZX RWYXZYZ RURVZW[Y[ZXZW RF[N[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[", "G^ZH[H\\F[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJUI[JYKY", "G]TFN[ RUFO[ RVFP[ RMFKL R]F\\L RMF]F RK[S[ RNFKL RPFLI RRFMG RYF\\G RZF\\H R[F\\I R\\F\\L ROZL[ ROYM[ RPYQ[ ROZR[", "F_NFKQJUJXKZN[R[UZWXXU\\G ROFLQKUKYLZ RPFMQLULYN[ RKFSF RYF_F RLFOG RMFNH RQFOH RRFOG RZF\\G R^F\\G", "H\\NFNHOYO[ ROGPX RPFQW R[GO[ RLFSF RXF^F RMFNH RQFPH RRFOG RYF[G R]F[G", "E_MFMHKYK[ RNGLX ROFMW RUFMWK[ RUFUHSYS[ RVGTX RWFUW R]GUWS[ RJFRF RUFWF RZF`F RKFNG RLFMH RPFNI RQFNG R[F]G R_F]G", "G]NFT[ ROFU[ RPFV[ R[GIZ RLFSF RXF^F RF[L[ RQ[X[ RMFOH RQFPH RRFPG RYF[G R]F[G RIZG[ RIZK[ RTZR[ RTYS[ RUYW[", "G]MFQPN[ RNFRPO[ ROFSPP[ R\\GSP RKFRF RYF_F RK[S[ RLFNG RPFOH RQFNG RZF\\G R^F\\G ROZL[ ROYM[ RPYQ[ ROZR[", "G]ZFH[ R[FI[ R\\FJ[ R\\FNFLL RH[V[XU ROFLL RPFMI RRFNG RR[VZ RT[WX RU[XU", "", "", "", "", "", "", "H\\JFR[ RKFRX RLFSX RJFZFR[ RLGYG RLHYH", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3100 to 3199 ********/ "", "I]NPNOOOOQMQMONNPMTMVNWOXQXXYZZ[ RVOWQWXXZ RTMUNVPVXWZZ[[[ RVRUSPTMULWLXMZP[S[UZVX RNUMWMXNZ RUSQTOUNWNXOZP[", "G\\LFL[MZOZ RMGMY RIFNFNZ RNPONQMSMVNXPYSYUXXVZS[Q[OZNX RWPXRXVWX RSMUNVOWRWVVYUZS[ RJFLG RKFLH", "H[WQWPVPVRXRXPVNTMQMNNLPKSKULXNZQ[S[VZXX RMPLRLVMX RQMONNOMRMVNYOZQ[", "H]VFV[[[ RWGWZ RSFXFX[ RVPUNSMQMNNLPKSKULXNZQ[S[UZVX RMPLRLVMX RQMONNOMRMVNYOZQ[ RTFVG RUFVH RXYY[ RXZZ[", "H[MSXSXQWOVNSMQMNNLPKSKULXNZQ[S[VZXX RWRWQVO RMPLRLVMX RVSVPUNSM RQMONNOMRMVNYOZQ[", "KYWHWGVGVIXIXGWFTFRGQHPKP[ RRHQKQZ RTFSGRIR[ RMMVM RM[U[ RPZN[ RPYO[ RRYS[ RRZT[", "I\\XNYOZNYMXMVNUO RQMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM ROONQNSOU RUUVSVQUO RQMPNOPOTPVQW RSWTVUTUPTNSM RNUMVLXLYM[N\\Q]U]X^Y_ RN[Q\\U\\X] RLYMZP[U[X\\Y^Y_XaUbObLaK_K^L\\O[ RObMaL_L^M\\O[", "G^LFL[ RMGMZ RIFNFN[ RNQOOPNRMUMWNXOYRY[ RWOXRXZ RUMVNWQW[ RI[Q[ RT[\\[ RJFLG RKFLH RLZJ[ RLYK[ RNYO[ RNZP[ RWZU[ RWYV[ RYYZ[ RYZ[[", "LXQFQHSHSFQF RRFRH RQGSG RQMQ[ RRNRZ RNMSMS[ RN[V[ ROMQN RPMQO RQZO[ RQYP[ RSYT[ RSZU[", "KXRFRHTHTFRF RSFSH RRGTG RRMR^QaPb RSNS]R` ROMTMT]S`RaPbMbLaL_N_NaMaM` RPMRN RQMRO", "G]LFL[ RMGMZ RIFNFN[ RWNNW RRSY[ RRTX[ RQTW[ RTM[M RI[Q[ RT[[[ RJFLG RKFLH RUMWN RZMWN RLZJ[ RLYK[ RNYO[ RNZP[ RWYU[ RVYZ[", "LXQFQ[ RRGRZ RNFSFS[ RN[V[ ROFQG RPFQH RQZO[ RQYP[ RSYT[ RSZU[", "AcFMF[ RGNGZ RCMHMH[ RHQIOJNLMOMQNROSRS[ RQORRRZ ROMPNQQQ[ RSQTOUNWMZM\\N]O^R^[ R\\O]R]Z RZM[N\\Q\\[ RC[K[ RN[V[ RY[a[ RDMFN REMFO RFZD[ RFYE[ RHYI[ RHZJ[ RQZO[ RQYP[ RSYT[ RSZU[ R\\ZZ[ R\\Y[[ R^Y_[ R^Z`[", "G^LML[ RMNMZ RIMNMN[ RNQOOPNRMUMWNXOYRY[ RWOXRXZ RUMVNWQW[ RI[Q[ RT[\\[ RJMLN RKMLO RLZJ[ RLYK[ RNYO[ RNZP[ RWZU[ RWYV[ RYYZ[ RYZ[[", "H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RMPLRLVMX RWXXVXRWP RQMONNOMRMVNYOZQ[ RS[UZVYWVWRVOUNSM", "G\\LMLb RMNMa RIMNMNb RNPONQMSMVNXPYSYUXXVZS[Q[OZNX RWPXRXVWX RSMUNVOWRWVVYUZS[ RIbQb RJMLN RKMLO RLaJb RL`Kb RN`Ob RNaPb", "H\\VNVb RWOWa RUNWNXMXb RVPUNSMQMNNLPKSKULXNZQ[S[UZVX RMPLRLVMX RQMONNOMRMVNYOZQ[ RSb[b RVaTb RV`Ub RX`Yb RXaZb", "IZNMN[ RONOZ RKMPMP[ RWOWNVNVPXPXNWMUMSNQPPS RK[S[ RLMNN RMMNO RNZL[ RNYM[ RPYQ[ RPZR[", "J[WOXMXQWOVNTMPMNNMOMQNSPTUUWVXY RNNMQ RNRPSUTWU RXVWZ RMONQPRUSWTXVXYWZU[Q[OZNYMWM[NY", "KZPHPVQYRZT[V[XZYX RQHQWRY RPHRFRWSZT[ RMMVM", "G^LMLVMYNZP[S[UZVYWW RMNMWNY RIMNMNWOZP[ RWMW[\\[ RXNXZ RTMYMY[ RJMLN RKMLO RYYZ[ RYZ[[", "I[LMR[ RMMRY RNMSY RXNSYR[ RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN", "F^JMN[ RKMNX RLMOX RRMOXN[ RRMV[ RSMVX RRMTMWX RZNWXV[ RGMOM RWM]M RHMKN RNMLN RXMZN R\\MZN", "H\\LMV[ RMMW[ RNMX[ RWNMZ RJMQM RTMZM RJ[P[ RS[Z[ RKMMN RPMNN RUMWN RYMWN RMZK[ RMZO[ RVZT[ RWZY[", "H[LMR[ RMMRY RNMSY RXNSYP_NaLbJbIaI_K_KaJaJ` RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN", "I[VML[ RWMM[ RXMN[ RXMLMLQ RL[X[XW RMMLQ RNMLP ROMLO RQMLN RS[XZ RU[XY RV[XX RW[XW", "G^[MZQYTWXUZR[P[MZKXJUJSKPMNPMRMUNVOWQYXZZ[[\\[ RZMYQXTWVUYTZR[ RLXKVKRLP RP[NZMYLVLRMONNPM RRMTNUOVQXXYZ[[", "G\\QFNGMHLJKNKb RNHMJLNLa RQFOGNIMNMb RQFSFVGWHXJXLWNVOSP RPPTPWQXRYTYWXYWZT[Q[OZNYMW RVHWJWLVN RWRXTXWWY RSFUGVIVMUOSP RTPVQWSWXVZT[ RKbMb", "F\\HRINKMMMONPOQRRYSb RIOKNMNOOPP RHRIPKOMOOPPQQTRYRa RXMWPVRTUSWR[Qb RYMWQ RZMYOWRTVSXR[ RXMZM RQbSb", "H\\SMQMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMPLNKMJMHNGPFSFWH RMPLSLUMX RWXXUXSWP RQMONNOMRMVNYOZQ[ RS[UZVYWVWRVOUNOKNJNIOHQGTGWH", "I[SMUNVOWOVNSMQMMNLOLQMRQS RSSQSMTKVKXMZP[S[VZXXWXVZ RNNMOMQNR RMULVLXMY RQMONNONQORQS RQSNTMVMXNZP[", "I[QHRGRFQFPGPIQJTKXKYKYJXJUKSLPNNPMRLULWMYNZP[S\\U]V_VaUbSbRaR`S`Sa RPOOPNRMUMWNYOZ RUKRMQNOQNTNWOYQ[S\\", "G]JMKNLPL[ RKMLNMPMZ RHPINJMLMMNNPN[ RUMVNWQWb RWOXRXa RNQOOPNRMUMWNXOYRYb RL[N[ RWbYb", "F]IMJNKPKTLWMYNZQ[S[VZWYXWYRYOXJVGTFRFPGOIOKPMSOVP[Q RJMKNLPLTMWNY RVYWWXRXOWJVHTG RGPHNIMKMLNMPMTNXOZQ[ RS[UZVXWSWNVJUHSGQGOI", "KZNMONPPPXQZS[U[WZXX ROMPNQPQXRZ RLPMNNMPMQNRPRXSZT[", "G]JMKNLPL[ RKMLNMPMZ RHPINJMLMMNNPN[ RSOUNWNXOXPZPZNXMVMTNQQOTNW RXNYOYP RPSQSWYYYZX RTWWZYZ RRTUZV[X[YZZX RL[N[", "H\\JGKFMFOGQIXXYZZ[ ROHPIWXXY RMFNGOIVXXZZ[[[ RRMJZJ[K[RM", "G]KMKb RLNLa RMMMb RVMVXWZX[Z[[Z\\X RWNWXXZY[ RXMXXYZZ[ RMXNZP[R[TZUYVW RKMMM RVMXM RKbMb", "G]JMKNLPMTN[ RKMLNMPNTOZ RHPINJMLMMNNPOTPZ RVVWTXQXMYMZNYQXSVVTXQZN[ RXRYOYM", "JZPGSFRFPGOHOIPJSKVLWKVJSKPLNMMOMQNRPSSTVUWTVSSTOUMVLXLZM[O\\S]U^V_VaTbRbOaPaRb ROMNONQOR RNVMXMZN[ RVKSKQLPMOOOQQSST RVTSTPUOVNXNZP\\S]", "H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RMPLRLVMX RWXXVXRWP RQMONNOMRMVNYOZQ[ RS[UZVYWVWRVOUNSM", "G]IQJOKNMM[M RKOMNZN RIQJPLO[O ROONZM[LZMWOO RUOVZW[XZWWUO R[M[O ROOMZ RUOWZ", "G\\QMNNLPKTKb RMPLTLa RQMONNOMSMb RMWNYOZQ[S[VZXXYUYSXPVNSMQM RWXXVXRWP RS[UZVYWVWRVOUNSM RKbMb", "G]PMMNKPJSJUKXMZP[R[UZWXXUXSWPUNRM RLPKRKVLX RVXWVWRVP RPMNNMOLRLVMYNZP[ RR[TZUYVVVRUOTNRM RRMZO[N[MPM RRMZN", "H\\JQKOLNNMZM RLONNYN RJQKPMOZO RROQZR[SZRO RZMZO RRORZ", "G\\JMKNLPLUMXOZQ[S[UZWXXVYRYNXMWMXPXSWWUZ RKMLNMPMUNX RWMXNXO RHPINJMLMMNNPNVOYQ[", "G]RQQNPMNMLNKOJRJUKXMZP[T[WZYXZUZRYOXNVMTMSNRQ RLOKRKULX RXXYUYRXO RNMMNLQLVMYNZP[ RT[VZWYXVXQWNVM RRQQb RRQRa RRQSb RQbSb", "H\\LMMNNPT_VaXbZb[a RNOOPU_V` RINJMLMNNPPV_WaXb RVSXPYMZMYOVSN\\K`JbKbL_N\\", "F]HNINJPJUKXMZP[T[VZXXYVZRZNYMXMYPYSXWVZ RJNKPKULX RXMYNYO RGPHNIMJMKNLPLVMYNZP[ RQFSb RRGRa RSFQb RQFSF RQbSb", "F^NMLNJPISIWJYKZM[O[QZRYSWSTRSQTQWRYSZU[W[YZZY[W[SZPXNVM RKPJSJWKY RRTRX RYYZWZSYP RNMLOKRKWLZM[ RW[XZYWYRXOVM", "G]WMUTUXVZW[Y[[Y\\W RXMVTVZ RWMYMWTVX RUTUQTNRMPMMNKQJTJVKYLZN[P[RZSYTWUT RNNLQKTKWLY RPMNOMQLTLWMZN[", "I\\PFNMMSMWNYOZQ[S[VZXWYTYRXOWNUMSMQNPOOQNT RQFOMNQNWOZ RVYWWXTXQWO RMFRFPMNT RS[UYVWWTWQVNUM RNFQG ROFPH", "I[WQWPVPVRXRXPWNUMRMONMQLTLVMYNZP[R[UZWW ROONQMTMWNY RRMPOOQNTNWOZP[", "G]YFVQUUUXVZW[Y[[Y\\W RZFWQVUVZ RVF[FWTVX RUTUQTNRMPMMNKQJTJVKYLZN[P[RZSYTWUT RMOLQKTKWLY RPMNOMQLTLWMZN[ RWFZG RXFYH", "I[MVQUTTWRXPWNUMRMONMQLTLVMYNZP[R[UZWX ROONQMTMWNY RRMPOOQNTNWOZP[", "JZZHZGYGYI[I[GZFXFVGTISKRNQRO[N^M`Kb RTJSMRRP[O^ RXFVHUJTMSRQZP]O_MaKbIbHaH_J_JaIaI` RNMYM", "H]XMT[S^QaOb RYMU[S_ RXMZMV[T_RaObLbJaI`I^K^K`J`J_ RVTVQUNSMQMNNLQKTKVLYMZO[Q[SZTYUWVT RNOMQLTLWMY RQMOONQMTMWNZO[", "G]OFI[K[ RPFJ[ RLFQFK[ RMTOPQNSMUMWNXPXSVX RWNWRVVVZ RWPUUUXVZW[Y[[Y\\W RMFPG RNFOH", "KXTFTHVHVFTF RUFUH RTGVG RLQMOOMQMRNSPSSQX RRNRRQVQZ RRPPUPXQZR[T[VYWW", "KXUFUHWHWFUF RVFVH RUGWG RMQNOPMRMSNTPTSRZQ]P_NaLbJbIaI_K_KaJaJ` RSNSSQZP]O_ RSPRTP[O^N`Lb", "G]OFI[K[ RPFJ[ RLFQFK[ RYOYNXNXPZPZNYMWMUNQROS RMSOSQTRUTYUZWZ RQUSYTZ ROSPTRZS[U[WZYW RMFPG RNFOH", "LXTFQQPUPXQZR[T[VYWW RUFRQQUQZ RQFVFRTQX RRFUG RSFTH", "@cAQBODMFMGNHPHSF[ RGNGSE[ RGPFTD[F[ RHSJPLNNMPMRNSPSSQ[ RRNRSP[ RRPQTO[Q[ RSSUPWNYM[M]N^P^S\\X R]N]R\\V\\Z R]P[U[X\\Z][_[aYbW", "F^GQHOJMLMMNNPNSL[ RMNMSK[ RMPLTJ[L[ RNSPPRNTMVMXNYPYSWX RXNXRWVWZ RXPVUVXWZX[Z[\\Y]W", "H\\QMNNLQKTKVLYMZP[S[VZXWYTYRXOWNTMQM RNOMQLTLWMY RVYWWXTXQWO RQMOONQMTMWNZP[ RS[UYVWWTWQVNTM", "G]HQIOKMMMNNOPOSNWKb RNNNSMWJb RNPMTIb ROTPQQORNTMVMXNYOZRZTYWWZT[R[PZOWOT RXOYQYTXWWY RVMWNXQXTWWVYT[ RFbNb RJaGb RJ`Hb RK`Lb RJaMb", "G\\WMQb RXMRb RWMYMSb RUTUQTNRMPMMNKQJTJVKYLZN[P[RZSYTWUT RMOLQKTKWLY RPMNOMQLTLWMZN[ RNbVb RRaOb RR`Pb RS`Tb RRaUb", "I[JQKOMMOMPNQPQTO[ RPNPTN[ RPPOTM[O[ RYOYNXNXPZPZNYMWMUNSPQT", "J[XPXOWOWQYQYOXNUMRMONNONQOSQTTUVVWX RONNQ RORQSTTVU RWVVZ RNOOQQRTSVTWVWXVZS[P[MZLYLWNWNYMYMX", "KYTFQQPUPXQZR[T[VYWW RUFRQQUQZ RTFVFRTQX RNMXM", "F^GQHOJMLMMNNPNSLX RMNMRLVLZ RMPKUKXLZN[P[RZTXVU RXMVUVXWZX[Z[\\Y]W RYMWUWZ RXMZMXTWX", "H\\IQJOLMNMONPPPSNX RONORNVNZ ROPMUMXNZP[R[TZVXXUYQYMXMXNYP", "CaDQEOGMIMJNKPKSIX RJNJRIVIZ RJPHUHXIZK[M[OZQXRU RTMRURXSZU[W[YZ[X]U^Q^M]M]N^P RUMSUSZ RTMVMTTSX", "G]JQLNNMPMRNSPSR RPMQNQRPVOXMZK[I[HZHXJXJZIZIY RRORRQVQY RZOZNYNYP[P[NZMXMVNTPSRRVRZS[ RPVPXQZS[U[WZYW", "G]HQIOKMMMNNOPOSMX RNNNRMVMZ RNPLULXMZO[Q[SZUXWT RYMU[T^RaPb RZMV[T_ RYM[MW[U_SaPbMbKaJ`J^L^L`K`K_", "H\\YMXOVQNWLYK[ RXOOOMPLR RVORNONNO RVORMOMMOLR RLYUYWXXV RNYRZUZVY RNYR[U[WYXV", "", "", "", "", "", "", "H\\WQVOUNSMQMNNLPKSKULXNZQ[S[VZWYXWYSYNXJWHVGSFQFNGMHNHOGQF RMPLRLVMX RVYWWXSXNWJVH RQMONNOMRMVNYOZQ[ RS[UZVXWTWMVIUGSF", "I[UMWNXOYOXNUMRMONMPLSLUMXOZR[U[XZYYXYWZU[ RNPMSMUNX RRMPNOONRNVOYPZR[ RNTTUUTTSNT RNTTT", "H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF RNHMJLNLSMWNY RVYWWXSXNWJVH RQFOGNIMNMSNXOZQ[ RS[UZVXWSWNVIUGSF RLPXQ RLQXP", "G]PMMNKPJSJUKXMZP[T[WZYXZUZSYPWNTMPM RLPKSKULX RXXYUYSXP RPMNNMOLRLVMYNZP[T[VZWYXVXRWOVNTM RQFSb RRGRa RSFQb RQFSF RQbSb", "H\\TMVNXPYPYOWNTMPMMNLOKQKSLUNWPXRYSZT\\T^S_Q_O^P^Q_ RMOLQLSMUOW RPMNNMPMSNURY RYPXO", "", "", "", "", "", "", "", "", "", "", "NV", "JZ", /******** Hershey Glyphs 3200 to 3299 ********/ "H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF RNHMJLNLSMWNY RVYWWXSXNWJVH RQFOGNIMNMSNXOZQ[ RS[UZVXWSWNVIUGSF", "H\\QHQ[ RRHRZ RSFS[ RSFPINJ RM[W[ RQZO[ RQYP[ RSYT[ RSZU[", "H\\LJLKMKMJLJ RLIMINJNKMLLLKKKJLHMGPFTFWGXHYJYLXNUPPRNSLUKXK[ RWHXJXLWN RTFVGWJWLVNTPPR RKYLXNXSYWYYX RNXSZWZXY RNXS[W[XZYXYV", "H\\LJLKMKMJLJ RLIMINJNKMLLLKKKJLHMGPFTFWGXIXLWNTO RVGWIWLVN RSFUGVIVLUNSO RQOTOVPXRYTYWXYWZT[P[MZLYKWKVLUMUNVNWMXLX RWRXTXWWY RSOUPVQWTWWVZT[ RLVLWMWMVLV", "H\\SIS[ RTHTZ RUFU[ RUFJUZU RP[X[ RSZQ[ RSYR[ RUYV[ RUZW[", "H\\MFKPMNPMSMVNXPYSYUXXVZS[P[MZLYKWKVLUMUNVNWMXLX RWPXRXVWX RSMUNVOWRWVVYUZS[ RLVLWMWMVLV RMFWF RMGUG RMHQHUGWF", "H\\VIVJWJWIVI RWHVHUIUJVKWKXJXIWGUFRFOGMILKKOKULXNZQ[S[VZXXYUYTXQVOSNQNOONPMR RNIMKLOLUMXNY RWXXVXSWQ RRFPGOHNJMNMUNXOZQ[ RS[UZVYWVWSVPUOSN", "H\\KFKL RYFYIXLTQSSRWR[ RSRRTQWQ[ RXLSQQTPWP[R[ RKJLHNFPFUIWIXHYF RMHNGPGRH RKJLINHPHUI", "H\\PFMGLILLMNPOTOWNXLXIWGTFPF RNGMIMLNN RVNWLWIVG RPFOGNINLONPO RTOUNVLVIUGTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RMQLSLWMY RWYXWXSWQ RPONPMSMWNZP[ RT[VZWWWSVPTO", "H\\MWMXNXNWMW RWOVQURSSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNVOWOXNYMY RMPLNLKMI RVHWIXLXRWVVX RQSORNQMNMKNHOGQF RSFUGVIWLWSVWUYTZR[", "MXRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "MXTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^", "MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^", "MXRFQGQIRQ RRFRTST RRFSFST RSFTGTISQ RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "I\\MKMJNJNLLLLJMHNGPFTFWGXHYJYLXNWOSQ RWHXIXMWN RTFVGWIWMVOUP RRQRTSTSQRQ RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY", "MXTFRGQIQLRMSMTLTKSJRJQK RRKRLSLSKRK RRGQK RQIRJ", "MXTHSIRIQHQGRFSFTGTJSLQM RRGRHSHSGRG RSITJ RTHSL", "E_[O[NZNZP\\P\\N[MZMYNXPVUTXRZP[L[JZIXIUJSPORMSKSIRGPFNGMIMLNOPRTWWZY[[[\\Y\\X RKZJXJUKSLR RRMSI RSKRG RNGMK RNNPQTVWYYZ RN[LZKXKULSPO RMINMQQUVXYZZ[Z\\Y", "H\\PBP_ RTBT_ RXKXJWJWLYLYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RLLMNOOUQWRXT RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWKUMUMWLWLV", "G^[BIbJb R[B\\BJb", "KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`", "KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`", "JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO", "F_JQ[Q[R RJQJR[R", "F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R", "F_JM[M[N RJMJN[N RJU[U[V RJUJV[V", "NWSFRGRM RSGRM RSFTGRM", "I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM", "KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF", "F^ZIJRZ[ RZIZJLRZZZ[", "F^JIZRJ[ RJIJJXRJZJ[", "G^OFObPb ROFPFPb RUFUbVb RUFVFVb RJP[P[Q RJPJQ[Q RJW[W[X RJWJX[X", "F^[FYGVHSHPGNFLFJGIIIKKMMMOLPJPHNF R[FH[ R[FI[ R[FJ[ RYTWTUUTWTYV[X[ZZ[X[VYT ROGLFIIJLMMPJOG RNFJGIK RKMOLPH RZUWTTWUZX[[XZU RYTUUTY RV[ZZ[V RH[J[", "E`VNULSKQKOLNMMOMRNTOUQVSVUUVS ROMNONROT RQKPLOOORPUQV RVKVSWUYVZV\\U]R]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYXYWZ RWLWSXU RVKXKXSYUZV", "", "", "", "", "", "", "", "", "", "", "", "", "", "NV", "JZ", "H]TFQGOIMLLOKSKVLYMZO[Q[TZVXXUYRZNZKYHXGVFTF RQHOJNLMOLSLWMY RTYVWWUXRYNYJXH RTFRGPJOLNOMSMXNZO[ RQ[SZUWVUWRXNXIWGVF", "H]TJO[Q[ RWFUJP[ RWFQ[ RWFTIQKOL RTJRKOL", "H]OKOJPJPLNLNJOHPGSFVFYGZIZKYMWOMUKWI[ RXGYIYKXMVOSQ RVFWGXIXKWMUOMU RJYKXMXRYWYXX RMXRZWZ RMXR[U[WZXXXW", "H]OKOJPJPLNLNJOHPGSFVFYGZIZKYMXNVOSP RXGYIYKXMWN RVFWGXIXKWMUOSP RQPSPVQWRXTXWWYUZR[O[LZKYJWJULULWKWKV RVRWTWWVY RSPUQVSVWUYTZR[", "H]WJR[T[ RZFXJS[ RZFT[ RZFJUZU", "H]QFLP RQF[F RQGYG RPHUHYG[F RLPMOPNSNVOWPXRXUWXUZQ[N[LZKYJWJULULWKWKV RVPWRWUVXTZ RSNUOVQVUUXSZQ[", "H]YJYIXIXKZKZIYGWFTFQGOIMLLOKSKVLYMZO[R[UZWXXVXSWQVPTOQOOPNQMS RPINLMOLSLWMY RVXWVWSVQ RTFRGPJOLNOMSMXNZO[ RR[TZUYVVVRUPTO", "H]NFLL R[FZIXLTQRTQWP[ RRSPWO[ RXLRRPUOWN[P[ RMIPFRFWI ROGRGWI RMIOHRHWIYIZH[F", "H]SFPGOHNJNMOOQPTPWOYNZLZIYGWFSF RUFPG RPHOJONPO ROORP RSPWO RXNYLYIXG RYGUF RSFQHPJPNQP RTPVOWNXLXHWF RQPMQKSJUJXKZN[R[VZWYXWXTWRVQTP RRPMQ RNQLSKUKXLZ RKZP[VZ RVYWWWTVR RVQSP RQPOQMSLULXMZN[ RR[TZUYVWVSUQTP", "H]XNWPVQTRQROQNPMNMKNIPGSFVFXGYHZKZNYRXUVXTZQ[N[LZKXKVMVMXLXLW ROPNNNKOI RXHYJYNXRWUUX RQRPQOOOKPHQGSF RVFWGXIXNWRVUUWSZQ[", "MXPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY", "MXQ[P[OZOYPXQXRYR[Q]P^N_ RPYPZQZQYPY RQ[Q\\P^", "MXSMRNROSPTPUOUNTMSM RSNSOTOTNSN RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY", "MXSMRNROSPTPUOUNTMSM RSNSOTOTNSN RQ[P[OZOYPXQXRYR[Q]P^N_ RPYPZQZQYPY RQ[Q\\P^", "MXVFUFTGRT RVGUGRT RVGVHRT RVFWGWHRT RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY", "H]OKOJPJPLNLNJOHPGSFWFZG[I[KZMYNWOSPQQQSSTTT RUFZG RYGZIZKYMXNVO RWFXGYIYKXMWNSPRQRSST RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY", "MXWFUGTHSJSLTMUMVLVKUJTJ RUGTITJ RTKTLULUKTK", "MXVIUITHTGUFVFWGWIVKULSM RUGUHVHVGUG RVIVJUL", "E_\\O\\N[N[P]P]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQURWTZV[X[YYYX RL[HZ RIZHXHVITJSLR RPPQSTYVZ RK[JZIXIVJTKSMRRO ROLPOQRSVUYWZXZYY", "H]TBL_ RYBQ_ RZKZJYJYL[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJULULWKWKV", "G^_BEbFb R_B`BFb", "JZZBXCUERHPKNOMSMXN\\O_Qb RSHQKOONTN\\ RZBWDTGRJQLPOOSN\\ RNTO]P`Qb", "JZSBUEVHWLWQVUTYR\\O_LaJb RVHVPUUSYQ\\ RSBTDUGVP RVHUQTUSXRZP]M`Jb", "J[TFSGUQTR RTFTR RTFUGSQTR ROIPIXOYO ROIYO ROIOJYNYO RYIXIPOOO RYIOO RYIYJONOO", "F_JQ[Q[R RJQJR[R", "F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R", "F_JM[M[N RJMJN[N RJU[U[V RJUJV[V", "MWUFTGRM RUGRM RUFVGRM", "H\\PFOGMM RPGMM RPFQGMM RZFYGWM RZGWM RZF[GWM", "KZSFQGPIPKQMSNUNWMXKXIWGUFSF RSFPIQMUNXKWGSF RUFQGPKSNWMXIUF", "F^ZIJRZ[ RZIZJLRZZZ[", "F^JIZRJ[ RJIJJXRJZJ[", "G^SFKbLb RSFTFLb RYFQbRb RYFZFRb RKP\\P\\Q RKPKQ\\Q RIWZWZX RIWIXZX", "E^^F\\GXHUHQGOFMFKGJIJKLMNMPLQJQHOF R^FE[ R^FF[ R^FG[ RXTVTTUSWSYU[W[YZZXZVXT RPGMFJIKLNMQJPG ROFKGJK RLMPLQH RYUVTSWTZW[ZXYU RXTTUSY RU[YZZV RE[G[", "E`UQUNTLRKPKNLMMLPLSMUOVQVSUTTUQ ROLNMMPMSNU RRKPLOMNPNSOUPV RVKUQUSVUXVZV\\U]R]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYXYWZ RWKVQVSWU RVKXKWQWSXUZV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3300 to 3399 ********/ "", "F^IHJIIJHIIGKFMFOGPHQKQOPRNTLUIV ROHPKPPOR RMFNGOJOPNSLU RLVOY RKVOZ RIVN[UV R\\G[H\\H\\G[FYFWGVHUJUYW[[W RWHVJVXXZ RYFXGWJWWYY", "E_GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGQHRJRRQUOW RPHQJQT RNFOGPJPUOW RRISGUFWFYGZH[J\\K RYHZJ RWFXGYJZK\\K R\\KRP RYM[O\\R\\U[XYZV[S[PZJWIWHX RXNYN[P RVNYO[Q\\S RTZRZLWKW RZYXZUZRYNWKVIVHXHZI[JZIY", "F^RHPFNFLGJJINIRJVLYNZQ[T[WZYY[W RLHKJJMJRKVMYPZ RNFMGLIKMKQLUMWOYRZUZXY[W RUFRHQIPKPLQNTPURUT RQKQLUPUQ RQIQJRLUNVPVRUTSURUPTOR RUFVGXHZH RUGVHWH RTGVIXIZH[G", "E_HLHKIIKGNFRFUGWHYJ[M\\Q\\U[XYZV[S[PZJWIWHX RKHMGRGUHWIYK[N RTZRZLWKW RHKJIMHRHUIWJYL[O\\R RZYXZUZRYNWKVIVHXHZI[JZIY RPHMKLMLONSNU RMNMONQNR RMKMMOQOSNUMVKVJUJT", "F^RHPFNFLGJJINIRJVLYNZQ[T[WZYY[W RLHKJJMJRKVMYPZ RNFMGLIKMKQLUMWOYRZUZXY[W RUFRHQIPKPLQNTPURUT RQKQLUPUQ RQIQJRLUNVPVRUTSURUPTOR RUFVGXHZH RUGVHWH RTGVIXIZH[G RUNYK RYKZL\\L RXLYMZM RWMXNZN\\L", "F^MNKMJKJIKGNFQFTGXI RKHMGRGUH RJKKIMHRHXIZI[H[GZFYF RSHRIQKQMROVSWVWYV\\U]S^ RTPWSXVXYW[ RQMSOVQXSYVYYX[V]S^O^L]K\\JZJWLTLRKQ RL\\K[KWLU RO^M]L[LWMTMRLQJQIRIS RUPYL RYLZM\\M RXMYNZN RWNXOZO\\M", "E_UJTHSGQFNFKGIJHNHRIUJWLYNZQ[T[WZYY[W\\T\\Q[NYL RKHJJIMIRJUKW RZW[U[QZNYM RNFLGKIJMJRKVLXNZ RWZYXZUZQYOWM RUFRHPJOLOMPOSQTSTU RPLPMTQTR RPJPKQMTOUQUSTURVQVOUNS RTOYLZJ R\\FZJ RYG]I R\\F[GYGZHZJ[I]I\\H\\F", "F_RFPGNIMKMMNOPQQSQU RNLNMQQQR RNINKOMQORQRSQUPVNWLWJVIUHSHQIPJQIR RRFTHVHXG RQGSH RPGQHSIUIXG RRPYK RYK[N\\Q\\T[WYYVZR[ RXLZN[Q[UZW RVMWMYOZRZVYXXYVZ RVZTZRYPYNZM\\N^P_R_T^ RSZQZ RR[PZNZ", "F_PPNPLOKNJLJJKHLGOFQFTGWJYK RLHNGRGTHUI RJJKIMHQHTIVJYK[K\\J\\H[GYG RJXKYJZIYIWJVLVNWPYR\\T^ RNXOYQ\\R] RLVMWNYP\\Q]S^V^X]Y\\ZZZWYUWRVPVO RYXYWVRVQ RX]Y[YYXWVTURUPWNYNZOZP", "F_PPNPLOKNJLJJKHLGOFQFTGWJYK RLHNGRGTHUI RJJKIMHQHTIVJYK[K\\J\\H[GYG RJXKYJZIYIWJVLVNWPYR\\T^ RNXOYQ\\R] RLVMWNYP\\Q]S^V^X]Y\\ZZZWYUWRVPVO RYXYWVRVQ RX]Y[YYXWVTURUPWNYNZOZP", "E_[KZIXGUFRFOGMILKLNMQPWPYN[ RMNMOPUPV RNHMJMMNOPSQVQXPZN[L[JZ RHVJZ RGYKW RHVHXGYIYJZJXKWIWHV RNONMOKQJTJVKXMYM RUKWM RRJTKULVN RYMPQ RUOYXZY[Y RTPXXZZ RSPWYY[\\X", "G^ZSYTVTUSUQVOXLYJYH RVQVPYLYK RWTVSVRWPYNZLZJYHXGUFPFMGLHKJKLLNNQOSOTNV RLKLLOQOR RLHLJMLOOPQPSOUMWJY RMWOWRYUZXZZY RNXOXSZTZ RJYLXMXQZT[V[YZZY[W", "BbEQERFSHSJRJOIMGJGHIF RIOGK RHSIRIPGMFKFIGGIFKFMGOIPLPROUNWLYI[HZGZ RNIOLORNUMW RJZIYHY RKFMHNKNRMVLXKYJXIXF[ RNGPFRFTGVIWLWRVUUWSYQ[PZOZ RUIVLVRUV RRZQYPY RRFTHUKUSTWSYRXQXN[ RUHVGXFZF\\G]H^J_K R\\H]J RZF[G\\J]K_K R_K\\M[NZQZT[X][`X R\\N[P[T\\W^Z R_K]M\\O\\S]W_Y", "D`GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGRISLSRRUQWOYL[KZIZG[ RQIRKRRQUPWOX RMZKYIY RNFPHQKQRPVNYLXJXG[ RRHSGUFWFYGZH[J\\K RYHZJ RWFXGYJZK\\K R\\KYMXNWQWTXXZ[]X RYNXPXTYW[Z R\\KZMYOYSZW\\Y", "D`PFNGLIKKKMMQMS RLLLMMOMP RLILKNONQMSLTJTISIR RPFQGWIZK[M\\P\\S[VZXXZU[R[OZIWHWGX RPGQHWJYKZL RPFPHQIWKYL[N\\P RSZQZKWJW RYYWZTZQYMWJVHVGXGZH[IZHY", "E`HQHRISKSMRMOLMJJJHLF RLOJK RKSLRLPJMIKIIJGLFOFQGRHSJSU RSWS\\R^P_M_L^L\\M[N\\M] RQHRJR\\Q^ ROFPGQJQU RQWQ\\P^O_ RSJXF RXFZI[K\\O\\R[UYXV[ RWGZK[N[O RVHXJZM[P[SZVYX RWYUVSU RQUOVMX RWZUWSVPV RV[TXSW RQWOWMX", "D`PFNGLIKKKMMQMS RLLLMMOMP RLILKNONQMSLTJTISIR RPFQGWIZK[M\\P\\S[VZX RXZU[R[OZIWHWGX RPGQHWJYKZL RPFPHQIWKYL[N\\P RSZQZKWJW RXZTZQYMWJVHVGXGZH[IZHY RTXVVXV\\Z]Z RWWXW[Z RUWVWZ[\\[^Y", "D`GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGQHRJRVQXOZM[K[IZ RPHQJQVPX RNFOGPJPVOYM[ RGVIZ RFYJW RGVGXFYHYIZIXJWHWGV RRISGUFWFYGZH[J\\K RYHZJ RWFXGYJZK\\K R\\KRP RTOXYZ[]X RUOYX[Z RVNZX[Y\\Y", "E`\\H[G\\F]G]I\\KZKVISHOHKIIK RYJVHSGOGLH R]I\\JZJVGSFOFLGJIIKHNHRIUJWLYNZQ[U[XZZY\\W]T]Q\\OZNWNUOSRQSOS RLXNYQZUZYY RIUKWMXPYUYYX[W\\V]T RXOWOSSRS R]Q[OYOWPUSSTQTOSNQNOOMQL", "F_LNJMIKIIJGMFRFUGYJ[J\\I RJHLGRGUHXJ RIKJILHRHUIYK[K\\I\\G[FZG[H RUIRLQNQPSTSV RRORPSRSS RRLRNTRTTSVRWPWOVOT RJYKZJ[IZIXJVLVOWSYVZYZ[Y RLWMWSZUZ RIXJWKWMXQZT[W[ZZ\\X", "G]JHKHLILWJX RKGMHMXPZ RIILFNHNWPYRY RJXKXMYO[RYVV RTHUHVIVYX[[X RUGWHWYYZ RSIVFYHXIXXYYZY", "D`GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGQHRJRRQUOW RPHQJQT RNFOGPJPUOW RRISGUFWFYG[J\\K RYHZJ RWFXGYJZK\\K RZKXKWLWNXP[R\\T RXO[Q RWMXN[P\\R\\V[XYZW[S[PZJWIWHX RTZRZLWKW RZYXZUZRYNWKVIVHXHZI[JZIY", "BcEQERFSHSJRJOIMGJGHIF RIOGK RHSIRIPGMFKFIGGIFLFNGOHPJPNOQMTKV RNHOJOONR RLFMGNJNOMSKV RNGPFSFUG RWFTGSISMTPVSWUWWVY RTMTNWSWT RWFUGTITLUNWQXTXVWXUZS[O[MZKXIWGWFX RNZKWJW RQ[OZLWJVGVFXFZG[HZGY RWFZF\\G^J_K R\\H]J RZF[G\\J]K_K R]K[KZLZN[P^R_T R[O^Q RZM[N^P_R_W^Y]Z[[X[UZ RYZXZVY R^Y\\ZZZXYWX", "F^KHMHOIPJQMQO RQQQUPXM[KZI[ RNZLYKY ROYNYLXI[ RMGPHQIRLRUSWUYWZ RIINFPGRISLSO RSQSTTWUXWYYY RQURXTZV[[X RSLTIWFYG[F RVGXHYH RUHVHXI[F RKSMOQO RSOWOYM RMPWP RKSMQQQ RSQWQYM", "E_HQHRISKSMRMOLMJJJHLF RLOJK RKSLRLPJMIKIIJGLFOFQGRHSJSORRQTQUSWTW RQHRJRPQSPUSX ROFPGQJQPPTOVRYUV RSJ[F RYGYZX] RZGZXY[ R[F[VZZY\\W^T_P_M^K\\JZKYLZK[", "F^NIOGQFTFVGWHXJXMWOVPTQ RQQOPNN RVHWIWNVO RTFUGVIVNUPTQ RMUNSORQQTQWRYTZVZZY\\W^T_P_N^KZJY RXTYVYZX\\ RTQWSXUX[W]V^T_ RO^N]LZKY RR_P^O]MZLYIYHZH\\I]J]", "", "", "", "F^IHJIIJHIIGKFMFOGPHQKQOPRNTLUIV ROHPKPPOR RMFNGOJOPNSLU RLVOY RKVOZ RIVN[UV R\\G[H\\H\\G[FYFWGVHUJUYW[[W RWHVJVXXZ RYFXGWJWWYY RP@OAOE RPAOE RP@QAOE RW@VAVE RWAVE RW@XAVE", "D`PFNGLIKKKMMQMS RLLLMMOMP RLILKNONQMSLTJTISIR RPFQGWIZK[M\\P\\S[VZXXZU[R[OZIWHWGX RPGQHWJYKZL RPFPHQIWKYL[N\\P RSZQZKWJW RYYWZTZQYMWJVHVGXGZH[IZHY RP@OAOE RPAOE RP@QAOE RW@VAVE RWAVE RW@XAVE", "G]JHKHLILWJX RKGMHMXPZ RIILFNHNWPYRY RJXKXMYO[RYVV RTHUHVIVYX[[X RUGWHWYYZ RSIVFYHXIXXYYZY RO@NANE ROANE RO@PANE RV@UAUE RVAUE RV@WAUE", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3400 to 3499 ********/ "", "J[TMQNOONPMSMVNYO[UX RNVOYPZ RQNOPNSNUOXQZ RRNSOUPUYW[ZX RSNVPVXXZ RTMUNWOXO RWPXO RWPWXXYYY", "J[LHMINK RTFQGOINKNXMY RPIOKOXRZ RTFRGQHPKPXRYSZ RMYNYPZQ[TZ RPPVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ", "KXRNTPVOTMRNOPNRNWOYQ[UY RSNUO RPPOROWPYQZ RQOPQPVQXSZ", "J[QFNINKOLSNVPWRWUVXTZ ROJOKSMVOWP ROHOIPJUMWOXRXUWXTZQ[ RRNNPNXMY ROPOXRZ RPOPXRYSZ RMYNYPZQ[", "KXPUVQSMOPNRNWOYQ[UY RUQRN RPPOROWPYQZ RTRROQOPQPVQXSZ", "LYXFWGUGSFQFPHPMOONP RVHTHRGQG RXFWHVITIRHQHPI RPKQMRNTOVOVP RNPPP RRPVP RPPPTQ` RSOPOQNQ[ RRPRTQ`", "J[TMQNOONPMSMVNYO[UX RNWOYPZ RQNOPNSNUOXQZ RRNSOUPUXV[V]U_ RSNVPVZ RTMUNWOXO RWPXO RWPW\\V^U_S`P`N_M^M]N]N^", "J[LHMINK RTFQGOINKNXMY RPIOKOYPZ RTFRGQHPKPXQYRY RMYOZP[SX RPPVMWOXSXWWZV\\T^Q` RUNVOWR RTNVQWTWWV[T^", "MWRFQGQHRISHSGRF RQGSH RQHSG ROOPOQPQYS[VX RPNRORXTZ RNPQMRNTO RSPTO RSPSXTYUY", "MWRFQGQHRISHSGRF RQGSH RQHSG ROOPOQPQ[P^O_M` RPNROR[Q] RNPQMRNTO RSPTO RSPS[R]P_M` RS[T]U^", "KYNHOIPK RUFSGQIPKPMOONP RPPPXOY RRIQKQM RQOPOQMQXSZ RUFSHRKRO RRPRXSYTY ROYQZR[UX RRLVIWJWLUNSO RUJVKVLUN RROWOWP RNPPP RRPWP", "MWOHPIQK RWFTGRIQKQXPY RSIRKRYTZ RWFUGTHSKSXTYUY RPYRZS[VX", "E_GOHOIPIXHYJ[ RHNJPJXIYJZKYJX RFPIMKOKXLYJ[ RNNPOQQQXPYR[ RPNQORQRXQYRZSYRX RKPNNPMRNSPSXTYR[ RVNWOYPYY[[^X RWNZPZX\\Z RSPVNXMYN[O\\O R[P\\O R[P[X\\Y]Y", "I[KOLOMPMXLYN[ RLNNPNXMYNZOYNX RJPMMOOOXPYN[ RRNSOUPUYW[ZX RSNVPVXXZ ROPRNTMUNWOXO RWPXO RWPWXXYYY", "J[NPNXMY ROPOXRZ RQOPPPXRYSZ RMYNYPZQ[TZ RNPQOVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ", "J[OJMLMNNQNXLZ RNYO` RNMNNOQO[ RNKNLONPQPXQXSYTZ RPYO` RSZQY RTZR[PY RNYLZ RPPVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ", "J[TMQNOONPMSMVNYO[UX RNWOYPZ RQNOPNSNUOXQZ RRNSOUPUXV` RSNVPV[ RTMUNWOXO RWPXO RWPWXV`", "KYNOOOPPPXOY RONQPQYSZ RMPPMRORXSYTY ROYQZR[UX RTNUPWOVMRO RUNVO", "LWXFWGUGSFQFPHPMOONP RVHTHRGQG RXFWHVITIRHQHPI RPKRP RPPPTQ` RQOPOQNQ[ RRPRTQ` RNPPP", "LXSIRLQNPONP RSISOVOVP RNPQP RSPVP RQPQXPY RROQORMRXTZ RSPSXTYUY RPYRZS[VX", "I[KOLOMPMXLY RLNNPNXPZ RJPMMOOOXQYRZ RLYMYOZP[RZUX RVMTOUPUYW[ZX RVPWOVNUOVPVXXZ RVMXOWPWXXYYY", "J[OKMMMONRNXMY RNNNOOROXRZ RNLNMOOPRPXRYSZ RMYNYPZQ[TZ RPPVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ", "F_KKIMIOJRJXIYK[ RJNJOKRKXJYKZLYKX RJLJMKOLRLXMYK[ RONQORQRXQY RQNROSQSXVZ RLPONQMSNTPTXVYWZ RQYRYTZU[XZ RTPZM[O\\R\\T[XZYXZ RYNZO[Q RXNZP[S[UZXXZ", "KZOOPOQPQXPXNYM[M]N_P`S`V_V^U^U_ RPNRPRXUZ RNPQMSOSXUYVZ RXYT[SZQYOYM[ RUNVPXOWMSO RVNWO", "J[OKMMMONRNXMY RNNNOOROYQZ RNLNMOOPRPXQYRY RMYOZP[SX RPPVMWOXSXWWZV\\T^Q` RUNVOWR RTNVQWTWWV[T^", "KYNPSMUNVPVRUTQV RSNUO RRNTOUQURTTSU RSUUWVYV]U_S`Q`O_N]N[OYQXWV RRVTWUY RQVTXUZU]T_S`", "JZRMPNMPMRNU RNPNROT RPNOOORPT RPNROTOVNWMWKVJTJ RQNSN RRMTNVN RNUVRWUWWVYR[ RUSVUVXUY RTSUUUXTZ RTZRYOYL[ RSZQZ RR[PZNZL[", "J[VFUGSGQFOFNHNMMOLP RTHRHPGOG RVFUHTIRIPHOHNI RNKPP RNPNTO` ROONOONO[ RPPPTO` RLPNP RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^", "J[PIOLNNMOKP RPIPXQYO[ ROONOONOXNYOZPYOX RKPNPNXMYO[ RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^", "J[TMQNOONPMSMVNYO[UX RNVOYPZ RQNOPNSNUOXQZ RRNSOUPUYW[ZX RSNVPVXXZ RTMUNWOXO RWPXO RWPWXXYYY RPGOHOL RPHOL RPGQHOL RWGVHVL RWHVL RWGXHVL", "J[NPNXMY ROPOXRZ RQOPPPXRYSZ RMYNYPZQ[TZ RNPQOVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ RPGOHOL RPHOL RPGQHOL RWGVHVL RWHVL RWGXHVL", "I[KOLOMPMXLY RLNNPNXPZ RJPMMOOOXQYRZ RLYMYOZP[RZUX RVMTOUPUYW[ZX RVPWOVNUOVPVXXZ RVMXOWPWXXYYY ROGNHNL ROHNL ROGPHNL RVGUHUL RVHUL RVGWHUL", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3500 to 3599 ********/ "", "G]LINGPFRFSGZW[X]X RQGRHYXZZ[YYX RNGPGQHXXYZZ[[[]X RLMMLOKPKQL RPLPM RMLOLPN RG[IYKXNXPY RJYNYOZ RG[JZMZN[PY RRJLX RNSVS", "F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RRIQJPLPU RQKQS RRIRRQTPU RRIXFZG[I[KYMUO RXGZIZK RVGXHYIYLWN RWNZP[R[X RYPZRZW RWNXOYQYX RJ[MYPXTXWY RLZOYTYVZ RJ[NZSZU[WYYX[X RUOUX RURYR RUUYU", "E]NGLHJJILHOHSIVJXMZP[S[VZXYZW[U RJKINISKWNYQZTZWY RNGLIKKJNJRKUNXQYTYWXYW[U RPJPV RQJQT RRIRSQUPV RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RWIWX", "G^IFWFYGZIZX RKGWGYIYW RIFJGLHWHXIXX ROKNLMNMOKOJPJRKQMQMV RNMNT RKPNP ROKOSNUMV RI[LYOXSXVY RKZNYSYUZ RI[MZRZT[VYXXZX RRHRX RRMTNVNXM RRSTRVRXS", "G]IHKFMFOGQF RLGNG RIHKGMHOHQF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RQMRJSHTGVFXF[G RTHVGXGZH RRJSIUHWHYI[G RQURRSPTOVOXP RTPVPWQ RRRSQUQVRXP RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RQMQX", "F]JHLFOFQGSF RMGPG RJHLGNHQHSF RPKOLNNNOLOKPKRLQNQNV ROMOT RLPOP RPKPSOUNV RSJSYRZQZMXKXIYG[ RTJTX RTPXP RPZOZMYJY RUIUOXO RXQUQUWTYP[N[LZJZG[ RSJUIXFZG\\G]F RWGYH[H RVHXIZI\\H]F RXIXW", "E^NGLHJJILHOHRIUJWLYNZQ[U[XZZX[V[SZQYPWOUO RJKINISJV RNGLIKKJNJSKVLXNZ RYXZWZSYQ RU[WZXYYWYSXQWPUO RPJPW RQJQU RRIRTQVPW RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RYHUOU[ RUSYS RUVYV", "F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZOYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOWNYLZM[P[TZXX[ RXMYNZPZUYX RWNXNYPYUX[ RUOUY RURYR RUUYU", "I\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZSZOXMXKYI[ RWKWW RRZQZOYLY RYHXJXVWXUZS[P[NZKZI[", "H\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZ RWKWW RYHXJXVWXUZR[O[LZJXJVKULUMVLWKW RJVMV", "F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZNYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOXLYM[N RWMYN[N R[NYQWSUU RWSYTZX[Z\\Z RYVZZ RWSXTYZZ[[[\\Z RUOUY", "G]IHKFNFPGRF RLGOG RIHKGMHPHRF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RSIRJQLQU RRKRS RSISRRTQU RSIUGWFYF[G RXGYGZH RUGWGYI[G RWGWX", "D`LJKKJMJOHOGPGRHQJQJU RKLKS RHPKP RLJLRKTJU RE[GYIXKXMYNYOX RHYKYMZ RE[GZJZL[M[NZOX RLJPFTJTWUYVY RPGSJSXRYSZTYSX RPPSP RNHOHRKROOO ROQRQRXQYS[VYWX RTJXF\\J\\W]Y^Y RXG[J[X]Z RXP[P RVHWHZKZOWO RWQZQZY\\[^Y ROHOX RWHWX", "E^GIIGKFMFOGQJVUXXYY RMGOIPKVWYZ RIGKGMHOKTVVYWZY[ RVHXIZI\\H]F RWGYH[H RVHXFZG\\G]F RKOIOHPHRIQKQ RIPKP RG[IYKXNXPY RJYMYOZ RG[JZMZN[PY RKGKX RYIY[ RRLSMUNWNYM RKTMSQSST", "E_NFLGJIIKHNHRIUJWLYNZQ[S[VZXYZW[U\\R\\N[KZIXGVFUGRIOJ RJJIMISJV RNFLHKJJMJSKVLXNZ RZV[S[MYIXH RVZXXYVZSZMYKWHUG ROJOW RPJPU RQJQTPVOW RUGUZ RUMWNXNZM RUSWRXRZS", "H^KFLGMIMOKOJPJRKQMQMYJ[MZMbO` RMHNJN` RKPNP RKFMGNHOJO` ROKRIVFZJZX RVGYJYX RTHUHXKXY RRXUXXY RSYUYWZ RRZTZV[XYZX RRIR_ RRMTNVNXM RRSTRVRXS", "E_NFLGJIIKHNHRIUJWLYNZP[T[VZXYZW[U\\R\\N[KZIXGVFUGRIOJ RJJIMISJV RNFLHKJJMJSKVLXNZ RZV[S[MYIXH RVZXXYVZSZMYKWHUG ROJOW RPJPU RQJQTPVOW RUGUZ RUMWNXNZM RUSWRXRZS RP[QZRZT[X`Za[a RT\\V_XaYa RRZS[VaXbZb[a", "F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXRXUY RLZNYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRIUGWFYGZIZLYNXOTQRR RWGXGYIYMXN RUGWHXJXMWOTQ RTQVRWSZX[Y\\Y RWTYX[Z RTQVSXYZ[\\Y", "G^UITHRGOF RVHTG RWGSFOFLGKHJJKLLMONWNYOZPZRYU RKKLLOMXMZN[O[QZS RKHKJLKOLYL[M\\O\\QYUU[ RIOJPLQUQVRVSUU RJQLRTRUS RIOIPJRLSSSUTUU RI[LYPXSXVY RKZNYRYUZ RI[MZRZU[ RWGUISL RRNPQ ROSMUKVJVJUKV", "E]JJILHOHSIVKYMZP[S[VZXYZW[U RISJVLXNYQZTZWY RJJIMIQJTLWNXQYTYWXYW[U RHIIGKFOFUGYG[F RPGTHXH RHIIHKGNGTIWIYH[F RSIRJPKPV RQKQT RRJRSQUPV RWIWX", "F^HHJFLFOGQF RKGNG RHHJGMHOHQF RKJJLIOISJVKXMZP[S[VZXYZ[\\Y RJSKVNYQZTZ RKJJNJQKTLVNXQYUYXX RUIQJPLPV RQKQT RRJRSQUPV RUIWHYFZG\\HZIZW[Y\\Y RYIZHYGXHYIYX[Z RWHXIXX RUIUY RUNXN RURXR", "G^JFKGLILOJOIPIRJQLQLXJY RLHMJMX RJPMP RNYQYSZ RJFLGMHNJNXRXUY RJYMYPZR[UYXXZX RRJUIWHYFZG\\HZIZX RYIZHYGXHYIYW RWHXIXX RRJRX RRMTNVNXM RRSTRVRXS", "E`HFIGJIJOHOGPGRHQJQJXHY RJHKJKX RHPKP RLYNYPZ RHFJGKHLJLXOXQY RHYKYNZO[QYTXVYW[YY\\X ROHRFTHTXWXYY RRGSHSX ROHQHRIRXQY RWYXZ RWHZF\\H\\X RZG[H[X RWHYHZIZXYY ROHOX RWHWX RONRN RORRR RWNZN RWRZR", "G]HIJGLFNFOGWYXZZZ RMGNHVYWZ RJGLGMHUZV[X[ZZ\\X RWFYG[G\\F RWGXHZH RVHWIYI[H\\F RH[IYKXMXNY RJYLYMZ RH[IZKZM[ RWFSO RQRM[ RLPPP RSPXP", "G^JFKGLILOJOIPIRJQLQLXJY RLHMJMX RJPMP RNYQYSZ RJFLGMHNJNXRXUY RJYMYPZR[UYXX RRJUIWHYFZG\\HZIZ^Y`WbUaQ`L` RYIZHYGXHYIYY RWHXIXXZ[ RXaV`S` RY`V_P_L` RRJRX RRMTNVNXM RRSTRVRXS", "H\\XGWIROOSMWJ[ RVKNV RZFWJUNRRMXLZ RJHLFOGUGZF RKGOHSHWG RJHNIRIVHXG RLZNYRXVXZY RMZQYUYYZ RJ[OZUZX[ZY RMPQP RTPXP", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3600 to 3699 ********/ "", "J[PRNTMVMXNZP[RYUX RMVNXOYQZ RNTNVOXQYRY RNPPPSOUNVMXOWPWXXYYY RONNOQO RTOWOVNVYWZ RMOOMPNROUPUYW[YY RMORT", "I[LHMJMXKY RNJMHNGNXQZ RLHOFOXQYRZ RKYMYOZP[RZUYWY ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY", "JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMUNWOXO RSNTOVO RPORNTPVPXO", "IZRMPNMOMXKY RNONXQZ RRMOOOXQYRZ RKYMYOZP[RZUYWY RMHPFQIWOWY RPINHOGPIVOVX RMHUPUY", "JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMWQURPU RSNVQ RPORNUR", "JWNHNXLYMYOZP[ ROHOYQZ RPHPXRYSYQZP[ RNHQGSFTGVHWH RRGSHUH RPHQGSIUIWH RKMNM RPMTM", "I[MOMXKYLYNZO[PZRYUX RNPNYPZ ROOOXQYRY RMOOORNTMUNWOYOWPW\\V_TaRbQaO`M` RSNVPV\\ RSaQ`P` RRNSOUPUZV]V_ RTaS`Q_O_M`", "I[LHMJMXKYLYNZO[ RNJMHNGNYPZ RLHOFOXQYO[ ROPROTNUMVNXOYOWPWYU[T] RTNVOVYU[ RROSOUPUYT]T`UbVbT`", "MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[UY RRPSORNQORPRYSZ RRMSNUOSPSXTYUY", "MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[T] RRPSORNQORPRYS[ RRMSNUOSPSYT]T`RbPbPaRb", "IZLHMJMXKYLYNZO[ RNJMHNGNYPZ RLHOFOXQYO[ ROPRNTMVPSROU RSNUP RRNTQ RSRTSVXWYXY RSSTTUYVZ RRSSTTYV[XY", "MWPHQJQXOYPYRZS[ RRJQHRGRYTZ RPHSFSXUYVYTZS[", "E_GOHOIPIXGYHYJZK[ RINJOJYLZ RGOIMKOKXMYK[ RKPNOPNQMSOSXUYS[ RPNRORYTZ RNOOOQPQXPYRZS[ RSPVOXNYMZN\\O]O[P[X\\Y]Y RXNZOZY[Z RVOWOYPYY[[]Y", "I[KOLOMPMXKYLYNZO[ RMNNONYPZ RKOMMOOOXQYO[ ROPROTNUMVNXOYOWPWXXYYY RTNVOVYWZ RROSOUPUYW[YY", "I[MOMXKY RNPNXQZ ROOOXQYRZ RKYMYOZP[RZUYWY RMOOORNTMUNWOYOWPWY RSNVPVX RRNSOUPUY", "I[LMMOMXKYMYMb RMNNONaO`N^ RNYOYQZ RLMNNOOOXQYRZ ROZP[RZUYWY ROZO^P`Mb ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY", "I[MOMXKY RNPNYPZ ROOOXQYRY RKYLYNZO[PZRYUX RMOOORNTMUNWOYOWPWb RSNVPVaU`V^ RRNSOUPU^T`Wb", "JXLOMONPNXLYMYOZP[ RMNOOOYQZ RLONMPOPXRYSYQZP[ RPOTMUNWOXO RSNTOVO RRNTPVPXO", "JZMOMSOTUTWUWY RNONS RVUVY RPNOOOSQT RSTUUUYTZ RMOPNRMTNVNWM RQNSN RPNROTOVN RWYTZR[PZNZL[ RSZQZ RTZRYOYL[ RWMVOTROWL[", "MWPHQJQXOYPYRZS[ RRJQHRGRYTZ RPHSFSXUYVYTZS[ RNMQM RSMVM", "I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPWXXYYY RTNVOVYWZ RUMSOUPUYW[YY", "I[LMMOMXP[RYUXWX RMNNONXQZ RLMNNOOOWPXRY RUMVNXOYOWPWX RTNVOVW RUMSOUPUX", "E_HMIOIXL[NYQX RINJOJXMZ RHMJNKOKWLXNY RQMOOQPQXT[VYYX[X RPNRORXUZ RQMRNTOSPSWTXVY RYMZN\\O]O[P[X RXNZOZW RYMWOYPYX", "H[KOLONPOQSYTZV[XY RMNOOTYVZ RKOMMONPOTWUXWYXY RRSUMVNXNYM RUNVOWO RTOVPXOYM RQUN[MZKZJ[ RNZMYLY ROYMXKYJ[ RMTPT RSTVT", "I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPW\\V_TaRbQaO`M` RTNVOV\\ RSaQ`P` RUMSOUPUZV]V_ RTaS`Q_O_M`", "I[XML[ RLONPQPTOXM RMNOOSO RLONMPNTNXM RL[PYSXVXXY RQYUYWZ RL[PZTZV[XY RNTVT", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "NV", "JZ", /******** Hershey Glyphs 3700 to 3799 ********/ "H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJYLYNZO[QZVYXY", "H\\OHPIQKQXOY RQIPHQGRIRYTZ ROHRFSHSXUYVY ROYPYRZS[TZVY", "H\\LHNHPGQFSGVHXH RPHRG RLHNIPIRHSG RVHVP RWIWO RXHXP RXPVPK[ RK[OYSXVXZY RNZQYVYYZ RK[PZUZX[ZY", "H\\LHMHOGPFRGVHXH ROHQG RLHNIPIRG RVHVO RWIWN RXHXOVOSPQQ RQPSQVRXRXY RWSWX RVRVY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY", "H\\UFKPKUTU RVUZU[V[TZU RLPLT RMNMU RTGTXRY RUJVHUGUYWZ RUFWHVJVXXYYY RRYSYUZV[WZYY", "H\\LFLO RLFXF RMGVG RLHUHWGXF RVLUMSNOOLO RSNTNVOVY RUMWNWX RVLWMYNZNXOXY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY", "H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHRGTFUGWHXH RSGUH RRGTIVIXH RNPOPSOUNVM RSOTOVPVY RUNWPWX RVMWNYOZOXPXY RJYLYNZO[QZVYXY", "H\\KHMFPGUGZF RLGOHTHWG RKHOIRIVHZF RZFYHWKSOQRPUPXQ[ RRQQTQWRZ RUMSPRSRVSYQ[", "H\\LILO RMJMN RNINO RLINISHUGVF RSHTHVIVO RUGWHWN RVFWGYHZHXIXO RLONOVRXR RXOVONRLR RLRLXJY RMSMXPZ RNRNXPYQZ RVRVY RWSWX RXRXY RJYLYNZO[QZVYXY", "H\\LHLQJR RMIMROS RNHNQPRQR RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJRKRMSNTOSQRUQVQ RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY", "LXRXPZR[TZRX RRYQZSZRY", "LXR^R\\PZRXSZS\\R^P_ RRYQZR[RY", "LXRMPORPTORM RRNQOSORN RRXPZR[TZRX RRYQZSZRY", "LXRMPORPTORM RRNQOSORN RR^R\\PZRXSZS\\R^P_ RRYQZR[RY", "LXRFQGOHQIRT RRISHRGQHRIRT RRFSGUHSIRT RRXPZR[TZRX RRYQZSZRY", "I[KIMIOHQFRHVJXJ ROIQHQGOI RKIMJOJQIRH RVJVP RWKWO RXJXP RXPTPQQPRRT RSQQRRSSQ RVPTQSRRT RRXPZR[TZRX RRYQZSZRY", "LXTFRGQIQKRMTKRIRG RRJRLSKRJ", "LXRLRJPHRFSHSJRLPM RRGQHRIRG", "F_MIOIQHRFSGUHWH RMIMN RNJNM ROION RQHSISN RRGTITM RWHUIUN RMNONUQWQZN RZN[O\\O]N RYOZP[P RXPYQZQ\\P]N RUNSNMQKQ RKQKXIY RLRLXNZOZ RMQMXPZ RUQUX RVRVW RWQWX RIYKYMZN[PZSZUXWXZ[ RXYYXZX\\Y][ RYZZY[Y RZ[[Z\\Z][", "G]XGUFOFLGKHJJJLKNLONPVPXQYSYTXW RWHUG RXGVITGRF RKLLNNOVOXPYQ RLGKIKKLMNNVNXOYPZRZTXWV[ RWYTXQXNYK[ RVZSYPYMZ RV[SZNZK[ RPBPF RPFPN RPPPX RPZP_ RTBTF RTGTN RTPTX RT[T_", "G^[BIbJb R[B\\BJb", "KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`", "KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`", "JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO", "F_JQ[Q[R RJQJR[R", "F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R", "F_JM[M[N RJMJN[N RJU[U[V RJUJV[V", "NWSFRGRM RSGRM RSFTGRM", "I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM", "KYNGOGQFSFUGVG RNGNL ROGOL RUGUL RVGVL RNLOLQMSMULVL", "F^ZIJRZ[ RZIZJLRZZZ[", "F^JIZRJ[ RJIJJXRJZJ[", "G^OFObPb ROFPFPb RUFUbVb RUFVFVb RJP[P[Q RJPJQ[Q RJW[W[X RJWJX[X", "F^JGKGMFOGPG RJGJK RKGKK ROGOK RPGPK RJKKKMLOKPK RZFI[J[ RZF[FJ[ RTVUVWUYVZV RTVTZ RUVUZ RYVYZ RZVZZ RTZUZW[YZZZ", "E`NMPMSLUKVLXL RNMNTMU RONOTPUQU RPMPTRU RSLUMUT RTLULVMVTWU RXLWMWTXV RMUOUPVRUUTVUXVZV\\U]R]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYXYWZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3800 to 3899 ********/ "", "E_NHLIJKIMHPHSIUKV RJLIOISJU RNHLJKLJOJRKVKXJZH[ RVHXHXYVY RYHYY RZGZZ RHFKGQHVHZG\\F RJPXP RH[KZQYVYZZ\\[", "E_LGLZ RMGMZ RPFNGNZP[ RHJJHLGPFUFXGZIZKYM RXHYIYKXM RUFWGXIXKWL RQUOTNRNPONPMSLVLYM[O\\Q\\T[WYYWZT[P[LZJYHW RZO[Q[UZW RVLYNZQZUYXWZ", "E_\\F[HZJXHVGSFQFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[Y\\[ R[HZMZT[Y RZKYJ RZNYKXIVG RJKINISJV RNGLIKKJNJSKVLXNZ RYWZV RVZXXYVZS", "E_KGKZ RLGLZ RNFMGMZN[ RHKIIKGNFSFVGXHZJ[L\\O\\R[UZWXYVZS[N[KZIXHV RZK[N[SZV RVGXIYKZNZSYVXXVZ", "E_\\F[HZJXHVGSFQFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[Y\\[ R[HZMZT[Y RZKYJ RZMXIVG RJKINISJV RNGLIKKJNJSKVLXNZ RYWZV RVZXXYVZS RJPKONOUQXQZP RPPRQURWRYQ RMORRUSWSYRZP RZMYLXLWMXNYM", "E_JHJZ RMGKHKY ROFMGLILYNY RHJJHLGOFSFVGXHYI\\F R\\F[HZLZO[S\\U RZIYK RVGXIYLZO RLPMOOOTPWPYO RQPTQVQXP RNOTRVRXQYOYLXKWKVLWMXL RH[JZNYSYYZ\\[", "E_\\F[HZJXHVGSFQFNGLHJJILHOHRIUJWLYNZQ[T[VZXYYXZV[Y\\[ R[HZMZT[Y RZKYJ RZNYKXIVG RJKINISJV RNGLIKKJNJSKVLXNZ RXXYVYR RVZWYXVXQ RKSLRMSLTKTJS RJPKNMMOMRNUPWQ RKOMNONROTP RJPLOOOUQYQZP", "E_JGJZH[ RKHKZ RNHLHLZ RHFJGNHSHYG\\F RLPMNOLRKVKYL[N\\Q\\T[UYV RZN[P[SZU RVKXLYMZOZSYVYXZZ\\[ RH[LZPZU[", "E_QIQY RRJRX RSISY RHFLHPITIXH\\F RH[KZOYUYYZ\\[", "E_TIVIVXUZS[ RWIWXVY RXHXY RHFLHPITIXH\\F RIOHQHUIXKZN[S[VZXYZW\\T RIUJXKY RHSJUKXLZN[", "E_JGJZH[ RKHKZ RNHLHLZ RHFJGNHSHYG\\F RLPMNOLRKUKXLYMYOXPSRQSPTPUQVRUQT RWLXMXOWP RUKWMWOVPSR RSRVRYSZUZWYX RWSYUYW RSRVSXUYXZZ[[\\[ RH[LZPZU[", "E_JGJZ RKHKY RNHLHLYNY R\\KZNYPXSXUYW[X RZOYRYUZW R\\K[MZQZT[X\\[ RHFJGNHSHYG\\F RH[JZNYSYYZ\\[", "E_QIQY RRJRX RSISY RNYLWJVIUHRHMIJKHMGPFTFWGYH[J\\M\\R[UZVXWVY RJUIRIMJJ RLWKUJRJLKIMG RZJ[M[RZU RWGYIZLZRYUXW RHFLHPITIXH\\F RH[KZOYUYYZ\\[", "E_JHJZH[ RLHKIKZ ROFMGLILZ RHJJHLGOFSFVGXHZJ[L\\O\\S[UYV RZK[N[RZU RVGXIYKZNZRYVYXZZ[[\\[ RH[LZPZU[", "E_QFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[U\\R\\O[LZJXHVGSFQF RJKINISJV RNGLIKKJNJSKVLXNZ RZV[S[NZK RVZXXYVZSZNYKXIVG", "E_JIJZ RMHKJKY RQFOGMILKLYNY RHKJINGQFTFWGYH[J\\M\\O[RYTVURUOTMRLO RZJ[L[PZR RWGYIZLZPYSVU RH[JZNYSYYZ\\[", "E_QFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[U\\R\\O[LZJXHVGSFQF RJKINISJV RNGLIKKJNJSKVLXNZ RZV[S[NZK RVZXXYVZSZNYKXIVG RJSKUNVTW[W\\X\\Z[[[Z\\Y RPWRW RKUNWQXSXTW", "E_JIJZH[ RKIKZ RLHLZ RHKJILHNGQFUFYG[I\\K\\N[PZQ RYHZI[K[NZP RUFWGYIZKZOYQ RXRUSRSPRPPROUOXPZR\\U\\W[XZX RXQYR[V[WZT RTOVPXRYTZX[Z\\[ RH[LZPZU[", "E_TFZG\\F[H[JYHWGTFPFMGJJIMIOJRLTOURUTTUSVQVP R[GZH[J RJPKRLSOTRTTS RKIJKJNKPMRPSRSTRVPWOXO RLQMQNPPNRMUMWNYPZRZUYXWZ RPMRLULXMZO[R[UZW RIWJYIZ RNPNOOMPLRKUKXL[O\\R\\T[WYYWZT[P[MZKYIWIYH[JZP[", "E_QHMHKIJJILHOHSIVJXKYMZP[S[VZXYZW[U\\R\\N[KYIWH RUHTITKULVKUJ RISJVLXNYQZTZWY RJJINIQJTLWNXQYTYWXYW[T\\R RHFKI RKHLG RIGJGKFMGQHWHZG\\F", "E_LHJJILHOHRIUJWLYNZQ[U[XZZY RKJJLIOISJV RKILJLKKMJPJSKVLXNZ RVHXHXXWZU[ RYHYXXY RZGZY\\[ RHFKGQHVHZG\\F", "E_HFR[ RIGJHQWRY RJGKHRWSX R\\FR[ RWNUS RYLUQTTTV RHFJGOHUHZG\\F", "E_LHJJILHOHRIUJWLYNZQ[S[VZXYZW[U\\R\\O[LZJXH RJLIOIRJUKW RJJKKKLJOJRKVLXNZ RYWZU[R[OZL RVZXXYVZRZOYLYKZJ RQIQ[ RRJRZ RSIS[ RHFLHPITIXH\\F", "E_HFXYYZ RIGKHZZ RLH\\[ R\\FSP RQRJZ RPSMULW RQRMTLUKWKY RHFLHPITIXH\\F RH[JZNYSYYZ\\[", "E_XHXZ RYHYY RZGZY RKHIJHMHPISKUMVPWSWVVXU RLUOVUV RHPIRKTNUTUVV RHFLHPITIXH\\F RHWJYLZP[T[XZ\\X", "E_HFIGKHNHSFVFYGZIZKYM RXGYIYKXM RVFWGXIXL RXNTOROPNPLRKTKXL RTKVLWMVNTO RYM[O\\R\\T[WYYWZT[P[MZKYIWHTHRIOJNLMNMPNPPOQNPOO RXMZO[Q[UZW RXNYOZQZUYXWZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 3900 to 3999 ********/ "", "J[PQMTMXP[TY RNTNXPZ ROROWRZ RRSMNNMONNO RONSNUMWOWXXY RUNVOVXUYVZWYVX RSNUPUXTYV[XY", "IZNHLFMJMXP[UYWX RNHNXPZ RNHPFOJOWRZ ROOTMWPWX RTNVPVX RRNUQUY", "KWNPNYP[RY ROPOYPZ RPOPXQYRY RNPTMVOTPRN RSNUO", "JZRMMPMXP[RZUYWY RNPNXPZ ROOOWRZ RPIPFQIWPWY RPIVPVX RPIMIPJUPUY", "KXNPNYP[RY ROPOYPZ RPOPXQYRY RNPTMWQPU RSNVQ RRNUR", "KWOIOXNYP[ RPIPXOYPZQYPX RQHQXRYP[ ROIUFWHUISG RTGVH RLMOM RQMUM", "J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW]V_U`SaQaO`MaObQa RTNVPV]U_ RPaNa RRNUQU^T`Sa", "I[NHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROORNTMWPWYT]T`UbVbT` RTNVPVYU[ RRNUQUZT]", "MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQXPYR[ RRPSORNQORPRXQYRZSYRX RRMTOSPSXTYR[", "MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQYT] RRPSORNQORPRYS[ RRMTOSPSZT]T`RbPaPbRb", "IZNHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROPRNTMVPSROU RSNUP RRNTQ RRSSTTYV[XY RSSTUUYVZ RSRTSVXWYXY", "MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[", "E_GOHOIPIXHYJ[ RINJOJXIYJZKYJX RGOIMKOKXLYJ[ RKONNPMSOSXTYR[ RPNRORXQYRZSYRX RNNQPQXPYR[ RSOVNXM[O[X\\YZ[ RXNZOZXYYZZ[YZX RVNYPYXXYZ[", "I[KOLOMPMXLYN[ RMNNONXMYNZOYNX RKOMMOOOXPYN[ ROORNTMWOWXXYV[ RTNVOVXUYVZWYVX RRNUPUXTYV[", "JZMPMXP[UYWX RNPNXPZ ROOOWRZ RMPOOTMWPWX RTNVPVX RRNUQUY", "IZLMMOMXKYMYM_LbN` RNON` RLMNNOOOXQYRZ RNYOYQZ ROZP[UYWX ROZO_PbN` ROORNTMWPWX RTNVPVX RRNUQUY", "J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW_XbV` RTNVPV` RRNUQU_TbV`", "KXMONOOPOXNYP[ RONPOPXOYPZQYPX RMOOMQOQXRYP[ RQOUMWOUPSN RTNVO", "JZMPMSOUURWTWX RNPNSOT ROOOSPT RUSVTVX RTSUTUY RMPSMVNTOQN RRNUN RWXQ[MYOXSZ ROYQZ", "MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[ RNMQM RSMVM", "I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPWXXYYY RVPWOVNUOVPVYWZ RVMTOUPUYW[YY", "I[LMMOMXQ[SYWW RMNNONXQZ RLMNNOOOWRYSY RVMXOWPWW RVPWOVNUOVPVW RVMTOUPUX", "E_HMIOIXM[OYQX RINJOJXMZ RHMJNKOKWNYOY RRMPOQPQXU[WY[W RRPSORNQORPRXUZ RRMTOSPSWVYWY RZM\\O[P[W RZP[OZNYOZPZW RZMXOYPYX", "I[LONPUZV[XY RMNOOUYWZ RLONMONVXXY RXMVMVOXOXMVOSS RQUNYL[N[NYLYL[ RNTQT RSTVT", "I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPW]V_U`SaQaO`MaObQa RVPWOVNUOVPV^U_ RPaNa RVMTOUPU^T`Sa", "L[RNOPOORNTMWOWSRU RTNVOVS RRNUPUSTT RRUWWW]V_U`SaQaO`MaObQa RVWV^U_ RPaNa RTVUWU^T`Sa", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Glyphs 4000 to 4099 ********/ "", /* BEGINNING OF NON-HERSHEY GLYPHS */ /* UGS characters designed by Bob Beach at SLAC. Used in ISO-Latin-1, Hershey Symbol fonts (plus over/underbar). */ /* arrowboth, prob. less good than Wolff [4001] */ "CaKPHRKT RNMIRNW RIR[R RVM[RVW RYP\\RYT", /* backslash (reversed version of 720 or 2220) [4002] */ "G]IB[b", /* circlemultiply [4003] */ "H\\QJNKLMKPKRLUNWQXSXVWXUYRYPXMVKSJQJ RVMNU RNMVU", /* circleplus [4004] */ "H\\QJNKLMKPKRLUNWQXSXVWXUYRYPXMVKSJQJ RRLRV RMQWQ", /* congruent, i.e. ~ over = [4005] */ "E_INJLLKNKQLSMVNXNZM[K RIR[R RIV[V", /* 1 UNUSED SLOT [4006] */ "", /* notelement [4007] */ "F^ZJSJOKMLKNJQJSKVMXOYSZZZ RJRVR RUHP\\", /* overbar (width 22, no space on either side) [4008] */ "G]G:]:", /* radicalex (width 22, no space on either side, displaced) [4009] */ "E[f:~:", /* reflexsubset [4010] */ "F^ZJOJMKKMJOJQKSMUOVZV RJZZZ", /* reflexsuperset [4011] */ "F^JJUJWKYMZOZQYSWUUVJV RJZZZ", /* underline (width 22, no space on either side) [4012] */ "G]Ga]a", /* underscore (total width 22, two units space on either side of bar of width 18) [4013] */ "G]I][]", /* universal [4014] */ "I[KFR[YF RMLWL", /* 4 UNUSED SLOTS [4015--4018] */ "", "", "", "", /* UGS characters designed by Bob Beach at SLAC. Not placed in our ISO-Latin-1 or Symbol fonts, but accessible via escape sequences */ /* congruent, i.e., ~ over - [4019] */ "E_IPJNLMNMQNSOVPXPZO[M RIT[T", /* hbar [4020] */ "G^MFM[ RNFN[ RNPPNSMUMXNYPY[ RUMWNXPX[ RJFNF RJ[Q[ RU[\\[ RWGIO", /* interbang [4021] */ "I[MLNMMNLMLLMJNIPHSHVIWJXLXNWPVQRS RSHUIVJWLWNVPTR RREQGRVSGRE RRGRO RRYQZR[SZRY", /* lambdabar [4022] */ "H\\KFMFOGPHQJWXXZY[ RMFOHPJVXWZY[Z[ RRMJ[ RRMK[ RUGKP", /* undefined [4023] */ /* NOTE: position of this glyph is #defined as `UNDE' in extern.h */ "F^J[Z[ RZWJW RJSZS RZOJO RJKZK RZGJG RJCZC", /* 16 UNUSED SLOTS [4024--4039] */ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* Glyphs designed by Nelson Beebe , and distributed as part of his PLOT79 utility */ /* large pointing hands [4040--4043] */ " \204.l'm*n.l/i/a-c*[+L-G.H0H-E)K(\\*f-k.l RKgMiPiRh RR[TWNW R\\MaTaZ]` Refdead]e\\i`lckefddabT]NWOUYL\\MeKmKpJxJ}H\200D\177B RvBvDzE\177C\177BvBmCVCQB8D,J+L+[/a7eIgOgRhVi`l", " \2048v7}6z8v;uCuAwIzXy]w\\v\\t_wY{H|>z9w8v R=Y;W;T??@@C?G;H8D9A>?@@BCGPMVOUXKWHY?Y7Z4Z,\\'`$b% Rb.`._*a%b%b.a7aNbS`lZxXyIyCu?m=[=Ue9c8`;\\?]@a?d>e RD]JaPaW\\ RIRMTMN R=K;M;P*9-8.", /* Wolff symbol glyphs (freeware, designed by Thomas Wolff ), used in Hershey Symbol fonts */ /* arrowvertex [4044] */ "JZR3Rk", /* arrowboth, prob. better than UGS [4045] */ "E_XP[RXT RUMZRUW RIR[R RLPIRLT ROMJROW", /* arrowdblboth [4046] */ "E_XP[RXT RUMZRUW RLPXP RLTXT RLPIRLT ROMJROW", /* arrowdbldown [4047] */ "JZPXR[TX RMURZWU RPIPX RTITX", /* arrowdblleft [4048] */ "E_LPIRLT ROMJROW RLP[P RLT[T", /* arrowdblright [4049] */ "E_XP[RXT RUMZRUW RIPXP RITXT", /* arrowdblup [4050] */ "JZPLRITL RMORJWO RPLP[ RTLT[", /* arrowhorizex [4051] */ "E_ARcR", /* 13 UNUSED SLOTS [4052--4064] */ "", "", "", "", "", "", "", "", "", "", "", "", "", /* carriagereturn [4065] */ "E_LPIRLT ROMJROW RJRYRYE", /* 4 UNUSED SLOTS [4066-4069] */ "", "", "", "", /* ellipsis [4070] */ "G]KYJZK[LZKY RRYQZR[SZRY RYYXZY[ZZYY", /* emptyset [4071] */ "D`PFMGJIHLGOGSHVJYM[P\\T\\W[ZY\\V]S]O\\LZIWGTFPF RE^^E", /* 6 UNUSED SLOTS [4072--4077] */ "", "", "", "", "", "", /* logicaland [4078] */ "F^J[RMZ[", /* 1 UNUSED SLOT [4079] */ "", /* logicalnot [4080] */ "E_JOZOZW", /* logicalor [4081] */ "F^JMR[ZM", /* notsubset [4082] */ "F^ZJSJOKMLKNJQJSKVMXOYSZZZ RUHP\\", /* omega1 [4083] */ "F]JQLOONNMLNJQITIWJZK[M[OZQWRT RIWJYKZMZOYQW RQTQWRZS[U[WZYWZTZQYNXMWNYOZQ RQWRYSZUZWYYW RIPKNNM[M RIPKONN[N", /* 13 UNUSED SLOTS [4084-4096] */ "", "", "", "", "", "", "", "", "", "", "", "", "", /* trademarksans [4097] */ "H^MGMP RIGQG RUGUP RUGYP R]GYP R]G]P", /* trademarkserif [4098] */ "G_MGMP RLPNP RIHIGQGQH RTGUGUP RTPVP RUGYP R]GYP R^G]G]P R\\P^P", /* 1 UNUSED SLOT [4099] */ "", /******** Non-Hershey Glyphs 4100 to 4199 ********/ /* Locally developed glyphs (Robert Maier) */ /* 4 UNUSED SLOTS [4100..4103] */ "", "", "", "", /* hyphen, length 10, 3 units space on either side [4104] */ "I[MSWS", /* bold hyphen, same dimensions [4105] */ "I[MRWR RMSWS", /* broken bar [4106] */ "NVRBRN RRVRb", /* bold broken bar [4107] */ "NWRBRN RRVRb RSBSN RSVSb", /* bold pipe [4108] */ "NWRBRb RSBSb", /* small and large circles superimposed (H. glyphs 903, 904) [4109] */ "G]PGMHJJHMGPGTHWJZM\\P]T]W\\ZZ\\W]T]P\\MZJWHTGPG RQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK", /* The inverted exclamation point and question mark are obtained from the non-inverted glyphs by reflection through (0,0), and shifting downward by 4 units. */ /* caret (modification of Hershey glyph 2262) [4110] */ "JZPLRITL RMORJWO", /* exclamdown, simplex (modification of Hershey glyph 714) [4111] */ "MWRbRT RROSNRMQNRO", /* questiondown, simplex (modification of Hershey glyph 715) [4112] */ "I[X]X^W`VaTbPbNaM`L^L\\MZNYRWRT RROSNRMQNRO", /* exclamdown, complex (modification of Hershey glyph 2214) [4113] */ "MWRbS`RTQ`Rb RR`RZ RROSNRMQNRO", /* questiondown, complex (modification of Hershey glyph 2215) [4114] */ "I[W^V]W\\X]X^W`VaTbQbNaM`L^L\\MZNYRWRT RQbOaN`M^M\\NZPX RROSNRMQNRO", /* exclamdown, duplex (modification of Hershey glyph 2714) [4115] */ "LWRbRTQT RRbQbQT RRPSOSNRMQMPNPOQPRP RRORNQNQORO", /* questiondown, duplex (modification of Hershey glyph 2715) [4116] */ "H[X]X^W`VaSbPbMaL`K^K\\LZMYOXRW RX]W]W^V`SaPaM`L^L\\MZOYRX RW_Ta ROaL_ RL[PX RRXRTQTQX RRPSOSNRMQMPNPOQPRP RRORNQNQORO", /* exclamdown, complex script (modification of Hershey glyph 2764) [4117] */ "LWObPaRU ROaRU RObNaRU RTOUNTMSNTO", /* questiondown, complex script (modification of Hershey glyph 2765) [4118] */ "G\\U^T]U\\V]V^U`TaQbMbJaI_I]J[KZQXSWSURTPT RMbKaJ_J]K[LZNY RTOUNTMSNTO", /* exclamdown, triplex (modification of Hershey glyph 3214) [4119] */ "LWRbSaS_RW RRbRTQT RRbQbQT RQbPaP_QW RRPSOSNRMQMPNPOQPRP RRORNQNQORO", /* questiondown, triplex (modification of Hershey glyph 3215) [4120] */ "H[W]W^V^V\\X\\X^W`VaTbPbMaL`K^K\\LZMYQW RM`L_L[MZ RPbNaM_M[NYOX RRWRTQTQWRW RRPSOSNRMQMPNPOQPRP RRORNQNQORO", /* exclamdown, triplex italic (modification of Hershey glyph 3264) [4121] */ "LWNbObPaRT RNaOaRT RNaN`RT RNbMaM`RT RTPUOUNTMSMRNROSPTP RTOTNSNSOTO", /* questiondown, triplex italic (modification of Hershey glyph 3265) [4122] */ "G\\U]U^T^T\\V\\V^U`TaQbMbJaI_I]J[KZMYQXSWSUQTPT RObJa RKaJ_J]K[LZNY RMbLaK_K]L[MZQXRWRUQT RTPUOUNTMSMRNROSPTP RTOTNSNSOTO", /* exclamdown, gothic english (modification of Hershey glyph 3714) [4123] */ "LXRbSaU`S_RT RR_Q`RaS`R_RT RRbQaO`Q_RT RRPTNRMPNRP RROSNQNRO", /* questiondown, gothic english (modification of Hershey glyph 3715) [4124] */ "I[X^W`VaSbQbNaM`L^L\\MZOXQW RW^V` RN`M_M[NZ RX^V]V_UaSb RQbOaN_N[OYQW RRWRTQWSWRT RRPTNRMPNRP RROSNQNRO", /* yen, complex (modification of Hershey glyph 2025) [4125] */ "H]KFRQR[ RLFSQS[ RZFSQ RIFOF RVF\\F RO[V[ RLQYQ RLUYU", /* yen, triplex (modification of Hershey glyph 3025) [4126] */ "G]JFQQQ[ RKFRQRZ RLFSQS[ RYGSQ RHFOF RVF\\F RN[V[ RIFKG RNFLG RWFYG R[FYG RQZO[ RQYP[ RSYT[ RSZU[ RKQYQ RKUYU", /* yen, simplex (modification of Hershey glyph 525) [4127] */ "I[JFRPR[ RZFRP RLPXP RLTXT", /* yen, duplex (modification of Hershey glyph 2525) [4128] */ "I\\KFRPR[S[ RKFLFSP RZFYFRP RZFSPS[ RLPYP RLTYT", /* yen, complex italic (modification of Hershey glyph 2075) [4129] */ "H]NFRPO[ ROFSPP[ R]FSP RLFRF RYF_F RL[S[ RLPYP RKTXT", /* yen, triplex italic (modification of Hershey glyph 3075) [4130] */ "G]MFQPN[ RNFRPO[ ROFSPP[ R\\GSP RKFRF RYF_F RK[S[ RLFNG RPFOH RQFNG RZF\\G R^F\\G ROZL[ ROYM[ RPYQ[ ROZR[ RLPYP RKTXT", /* bold centered dot [4131] */ "MXRQQRQSRTSTTSTRSQRQ RRRRSSSSRRR", /* inverted therefore (inversion of glyph 740) [4132] */ "E_R[SZRYQZR[ R[K\\J[IZJ[K RIKJJIIHJIK", /* inverted glaze (inversion of glyph 765) [4133] */ "G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M", /* 26 UNUSED SLOTS [4134--4159] */ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* versions of `dotless i', not included among original Hershey glyphs */ /* dotless i, triplex [4160] */ "LXQMQ[ RRNRZ RNMSMS[ RN[V[ ROMQN RPMQO RQZO[ RQYP[ RSYT[ RSZU[", /* dotless i, triplex italic [4161] */ "KXLQMOOMQMRNSPSSQX RRNRRQVQZ RRPPUPXQZR[T[VYWW", /* dotless i, simplex [4162] */ "NVRMR[", /* dotless i, duplex [4163] */ "NWRMR[S[ RRMSMS[", /* dotless i, gothic German [4164] */ "MWOOPOQPQYS[VX RPNRORXTZ RNPQMRNTO RSPTO RSPSXTYUY", /* dotless i, gothic English [4165] */ "MWRMQNOOQPQYS[UY RRPSORNQORPRYSZ RRMSNUOSPSXTYUY", /* dotless i, gothic Italian [4166] */ "MWRMPOQPQXPYR[ RRPSORNQORPRXQYRZSYRX RRMTOSPSXTYR[", /* 3 UNUSED SLOTS [4167--4169] */ "", "", "", /* Floor/ceiling brackets */ /* simplex left floor bracket [4170] */ "KYPBPb RPbVb", /* simplex right floor bracket [4171] */ "KYTBTb RNbTb", /* simplex left ceiling bracket [4172] */ "KYPBPb RPBVB", /* simplex right ceiling bracket [4173] */ "KYTBTb RNBTB", /* duplex left floor bracket [4174] */ "KYOBOb RPBPb RObVb", /* duplex right floor bracket [4175] */ "KYTBTb RUBUb RNbUb", /* duplex left ceiling bracket [4176] */ "KYOBOb RPBPb ROBVB", /* duplex right ceiling bracket [4177] */ "KYTBTb RUBUb RNBUB", /* Misc. extensions */ /* bold backslash (reversed 2720) [4178] */ "G^JB\\b[b RJBIB[b", /* Gothic-German `ch' ligature [4179] */ "G_NNPPROPMNNKPJRJWKYM[QY RONQO RLPKRKWLYMZ RMOLQLVMXOZ RPHQIRK RXFUGSIRKRXQY RTISKSYTZ RXFVGUHTKTXUYVY RQYSZT[WX RTPZM[O\\S\\W[ZZ\\X^U` RYNZO[R RXNZQ[T[WZ[X^", /* Accents, positioned at heights of lower-case letters (for upper-case, displace additionally upward by 7 units, also by 2 additional units rightward for upper-case italic). These are suggested by 2246--2252, the only accents in the original set of glyphs. Modifications mostly involved vertical displacements. The ring accent is a vertically displaced version of #900. */ /* acute accent [4180] */ "LXTEOK RTEUFOK", /* grave accent [4181] */ "LXPEUK RPEOFUK", /* dieresis [4182] */ "I[OHNGMHNIOH RUHVGWHVIUH", /* circumflex accent [4183] */ "G]JKRFZK RJKRGZK", /* small circumflex accent [4184] */ "I[LKRFXK RLKRGXK", /* tilde accent [4185] */ "JZLJLHMFOFUIWIXH RLHMGOGUJWJXHXF", /* "F^IJIHJELDNDPETHVIXIZH[F RIHJFLENEPFTIVJXJZI[F[D", */ /* ring accent for `a' [4186] */ "PTQFPGPIQJSJTITGSFQF", /* macron (width 14, no space on either side) [4187] */ "KYKIYI", /* acute accent, simplex [4188] */ "LXTEOK", /* grave accent, simplex [4189] */ "LXPEUK", /* circumflex accent, simplex [4190] */ "G]JKRFZK", /* small circumflex accent, simplex [4191] */ "I[LKRFXK", /* 3 UNUSED SLOTS [4192--4194] */ "", "", "", /* The following section is occupied by Japanese Hiragana and Katakana. It was moved to this array from the array of Hershey Oriental glyphs, since that array now consists entirely of Kanji, and is optional (it can be omitted by a compile-time option -DNO_KANJI). */ /* Japanese period, comma, overbar, two unuseds [4195--4199] (first three were originally Oriental 6200--6202) */ "D_HYGZH[IZHY", "D_H[GZHYIZI\\H^G_", "D_HOJQZP\\Q RIP\\Q", "", "", /******** Hershey Glyphs 4200 to 4299 (orig. Oriental 6000 to 6099) ********/ "D_OFQGQIPL RPGPRQV RKKMLRLUKXJ RUKVJXJ RSSTOUPSSPWNYLZJZIYIVJTLRNQQPVPYQ[S\\U\\W[YY[V\\T\\ RKZJYJVKTMRQP RVPXQZS[U[WZYX[V\\", "D_HHJIJKIMHP RIIIKHPHSIVJWLXMXMVNSOQ RJWLWMV RWLYM[P\\S\\UZTWU R[P[SZT", "D_NEOFQGUG ROFTFUGQI RKMKNLOMOPMRL RKNLNOMRLTLWMXOXRWUUXRZN\\ RTLVMWOWRVUUWSYP[", "D_NEOFQGUG ROFTFUGQI RJMJNKOMORMULVM RJNMNRM RVMRPLVHZ RULRP RHZHYLVNURUSVTZU[\\[ RW[ZZ[Z\\[", "D_MFOGOINM RNGN[ RNTOZN[MYKXHW RHMJNNNQMSL RNNPMQLSL RHXLUQRTQVQYRZTZVYXWYUYSXRV RHXHWLU RVQXRYTYVXXWY RWKYK[L\\MZMYN RYKZLZM", "D_NFPGPIOLMQH[ ROGOIMOKTH[ RHMHNIOJOMMOLRLTMUOURTVRZQ[P[PZOYMX RHNJNMM RRLTNTRSVRXPZ RWMYN[P\\R\\T[SYT RZO[Q[S", "D_NFQGRKSNURXVWW RPGRK RURWW RLKNLQLTK RIOJPMQRQWPZO RWPYNZO RWWUVRUNULVKWKYLZN[Q\\W\\ RN[V[W\\", "D_TFVGVHNP RUGTINPNQSVUYV[ RNQVXWZV[", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQNOONQMZM\\L RIUJWKX RVMZL[K\\L RVFXGXUWXUZR\\ RWGXJ RXRWVUYR\\", "D_MHOIRJTJWI ROITIVHWIQL RKSKULWNXRYYY RNXXXYY", "D_JKKLNMRMVLXKYJ RVLXJYJ RPFQIRKUOWRXT RPFQFQHRK RUOXRYTYU RYUXTVSRRNRKSJUJWKYMZQ[U[ RJWKXMYQZVZU[", "D_LFNGMSMXNZ RMGLSLWMYNZP[S[VZYX[V", "D_RFTGTSSUQVOUNSNROPQOSPTRTVSZQ\\ RSGTL RTVSYQ\\ RHJJLMLVKZJ\\K RIKML RVK\\K", "D_LJNKNVOXPYRZZZ RMKNN RUZXYYYZZ RUGWHWTVVUURS RVHWK RWQVTUU RHNJPLPPOUNYM[M\\N RIOPO RUN\\N", "D_NGPIVG ROHQHVGWH RWHTKNOJQ RVGUISKNO RIPKROP RJQOPUOZN[O RUO[O RUOSPQRPTPVQXRYUZYZ RQXTYXYYZ", "D_NFPGPINOMRKWI[ ROGOJNO RMRKVIYI[ RHMJNMNPMRLTK RRLSJTK RUNXN[OYOWP RXNYO RRVSXTYVZ[Z RSXUY\\Y[Z", "D_MFOGOIMNLRLTMU RNGNK RMNMU RHJKKOKSJUI RSJTHUI RMUOSRQUPXPZQ[S[VZXWZS[O[ RXPYQZSZVYXWZ", "D_HLJNOLSKWKZL[M\\O\\R[TZUXVUWPX RIMOL RWKYLZM[O[RZTXV", "D_HIJKLKPJUIYH[H\\I RIJPJ RUI\\I RYIVJSLQOPRPUQXRYTZX[[[ RPUQWRXTYXZZZ[[", "D_OFQGQQ RPGPMQQ RWNYPQQ RXOTPQQNRLSKUKWLYMZO[Z[ RLYNZYZZ[", "D_MFOGOIMOLRJWH[ RNGNJMO RLRJVHYH[ RHMJNLNOMQLSK RQLRJSK RVJXJZK\\MZLXM RXJZL RVOVQWTXVXXWZU[R[PZOXPVRUUUWV[Z RVQWVWYU[ RYXZZ[Z", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQ RIUJWKX RSJVIYI[JYJWK RWIYJ RQSQURWUX\\X RQURVUWZW\\X", "D_JILJLO RKJLOMRNTOVPW RNTPVPW RRGTHTJROOVMYKZIZHXHVISJQLOOMSLVLYM[O\\R\\U[XZYXZVZTYSXSWTVVUXUZV\\Y RSHSJRO RJZIXIUJRLO RVLXMZO[R[VZY RZV\\X\\Y", "D_MFOGOIM[ RNGN[M[LXKWIV RHLINKNOLOM RIMLMNLMP ROMMPKSHWHVKSOOSLVKXKZL[N[UZXYYWZUZSYRXRWSVUUWUYVZW\\Z RXKYLZNZVYY RZW\\Y\\Z", "D_QHRJRMQPPRNULWJWIVHTHQINKKNIQHTHWIYJ[L\\O\\R[UYWWXTYQY RNULVJVITIQJMKK RWIZL[O[RZUWX", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQ RIUJWKX RUGWHWWVYTZRZPYOWPURTTTVU[Y RVHWL RVU[X[Y RPMRNUNYM[L RYMZK[L", "D_IGJHLIPI RJHOHPI RPIMKKMIPHSHVIXJYLZOZRYTWUUVQVMUIVI RHUIWJXLYOYRXTVUTVQ RVIXLYN[Q\\SZSYT RUIXL RYNZQZS", "D_PFQISJ RQHSITITJ RTJQKOLNMNOOPQQSRTSUUUWTYRZPZMYKW RQQSSTUTWSYRZ RIYLVOTRS RVSYT[V\\XYX RIYIXLV RVSXTZV[X", "D_HPJRMM RIQNLPLUQYT[U\\VZVXW RUQZV", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQ RIUJWKX RQGSHUHYG RUHWGXFYG RPOSPVPYO[N RYOZM[N RUHWIWWVYTZRZPYOWPURTTTVU[Y RVIWM RVU[X[Y", "D_RFTGTXSZQ[O[MZLXMVOUQUTVWXZ[ RSGTK RWXZZZ[ RHIJKSKZJ RIJNK RSKWJYIZJ RMPOQSQWPYO RWPXNYO", "D_JGKIMIPHSFTG RKHPH RTGPMMSKVJWIWHVHTIRKQPQTRWS\\U RSFPM RTR\\T\\U RVMXNXTWWUYSZP[ RWNWUVX", "D_MFOGOINMMQLTKVJWIWHVHTIRJQKQLRLWMZO[U[XZYYXXWVVRVNWMYM[N\\P\\Q[QYR RNGNM RLWMYOZUZWYXX RYM[O[Q RHKKLNLQKSJ RQKRISJ", "D_JILJLO RKJLOMRNTOVPW RNTPVPW RSGUHUJTMRRQTOWMYKZIZHYHWITJRLPONRMVMYN[P\\S\\V[XZYXZU[R[ RTHTJRR RJZIYIVJSLP RVMXNZP[S[VZXXZ", "D_OFQGQIPM RPGPTQXRZT[X[ZZ[X[VZTXRUP RW[YZZXZUYS RLJMKPLSL RMKRKSL RSLPMNNLPKRLTNUSU", "D_PFRGSHTJSKPJMJLKLMOTQ[ RRGSISK ROTRZQ[ RHNIPKPNNRLVKYK[L\\N\\P[RZSWTTTQS RIOKONN RYKZL[N[PZRYSWT", "D_HHJIJKIMHP RIIIKHPHSIVJWLXMXMVNSOQ RJWLWMV RWLYM[P\\S\\UZTWU R[P[SZT", "D_HJJKJMIP RIKITJWKXKVLSMQONRKUJXJZK[L\\N\\Q[SYUWVTVRUPSOPOMPIQGSFUFVHVSUWTYQ[ RITJVKV RZK[N[QZT RVSUVTXQ[", "D_NEOFQGUG ROFTFUGQI RJMJNKOMORMULVM RJNMNRM RVMRPLVHZ RULRP RHZHYLVNURUSVTZU[\\[ RW[ZZ[Z\\[", "D_PFSGSIRN RRGRXQZO[L[JZIYIWJVLUOURVVX[[ RRVWX[Z[[ RRNUNYM RUNWMXLYM", "D_OFQFSGTHRHPI RQFRGRH RLLKNJRJTKUORQQTPWPYQZSZUYWWYUZQ[O[ RJRKTLT RWPXQYSYUXWVYTZQ[", "D_LFNGNILM RMGMILMLPMSNTNROOQLSJUIWIXJYMYRXVVYS[O\\ RLPMRNR RVIWJXMXRWVUYS[", "D_MGNIPIUG RNHPHUGVH RVHRKNPKU RUGRK RNPKSKU RKUMSPQSPVPXQYRZTZWYYXZV[S[QZPYPXQWSWUXWZ RVPXRYTYWXYV[", "D_MFOGOIM[ RNGN[M[LXKWIV RHLINKNOLOM RIMLMOLMP ROMMPKSHWHVKSOOSLVKWKYLZNYXYZZ[ RWKXLYNXXXZY[Z[[Z\\X", "D_MGNIPIUG RNHPHUGVH RVHRKNPKU RUGRK RNPKSKU RKUMSPQSPVPXQYRZTZWYYW[T\\R\\ RVPXRYTYWXZ", "D_MFOGOIM[ RNGN[M[LXKWIV RHLINKNOLOM RIMLMOLMP ROMMPKSHWHVKSNPQNTMWMYNZO[Q[TZWXYVZS[ RWMYOZQZTYWVZ", "D_MGNIPITG RNHPHTGUH RUHQNMVLXKYIYHWHUISKQNORNVNYO[Q\\S\\V[XYZW[T[RZQYQXRWTWVXXZ RTGQN RJYIWIUJR RZP[S[VZY", "D_NEOFQGUG ROFTFUGQI RKMKNLOMOPMRL RKNLNOMRLTLWMXOXRWUUXRZN\\ RTLVMWOWRVUUWSYP[", "D_LGMIOIQHTF RMHOHRGTFUG RUGQJMNJR RTFQJ RJRJPMNOMRLULWMXOXQWSUTPTOSOQPPRPSQSSRTNUKWHZH[I[KW RJYLXNXPZQZSXVWYW[X\\Y\\[[ZYZ RNXPYQYSX RYW[Y[Z", "D_PFRGRHPLNOKRHU RQGQHPL RKRHTHU RMPOOQOSPTRTV RQORPSRSWTV RIJLKOKSJWI RSJVHWI R[O\\QTRQSOTNVNXOZQ[Y[ R[PTR RT[XZY[", "D_QFSHPMLTH[ RRGPM RH[HYLTNRPQRQTRTWUYVZ RRQSRSWTYVZXZZY[W\\T", "", "", "", "", "D_NFPGPIOLMQH[ ROGOIMOKTH[ RHMHNIOJOMMOLRLTMUOURTVRZQ[P[PZOYMX RHNJNMM RRLTNTRSVRXPZ RWMYN[P\\R\\T[SYT RZO[Q[S RWHYJ RYF[H", "D_NFQGRKSNURXVWW RPGRK RURWW RLKNLQLTK RIOJPMQRQWPZO RWPYNZO RWWUVRUNULVKWKYLZN[Q\\W\\ RN[V[W\\ RWHYJ RYF[H", "D_TFVGVHNP RUGTINPNQSVUYV[ RNQVXWZV[ RYH[J R[F]H", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQNOONQMZM\\L RIUJWKX RVMZL[K\\L RVFXGXUWXUZR\\ RWGXJ RXRWVUYR\\ R[G]I R]E_G", "D_MHOIRJTJWI ROITIVHWIQL RKSKULWNXRYYY RNXXXYY RYG[I R[E]G", "D_JKKLNMRMVLXKYJ RVLXJYJ RPFQIRKUOWRXT RPFQFQHRK RUOXRYTYU RYUXTVSRRNRKSJUJWKYMZQ[U[ RJWKXMYQZVZU[ RZG\\I R\\E^G", "D_LFNGMSMXNZ RMGLSLWMYNZP[S[VZYX[V RSHUJ RUFWH", "D_RFTGTSSUQVOUNSNROPQOSPTRTVSZQ\\ RSGTL RTVSYQ\\ RHJJLMLVKZJ\\K RIKML RVK\\K RXFZH R[E]G", "D_LJNKNVOXPYRZZZ RMKNN RUZXYYYZZ RUGWHWTVVUURS RVHWK RWQVTUU RHNJPLPPOUNYM[M\\N RIOPO RUN\\N RZH\\J R\\F^H", "D_NGPIVG ROHQHVGWH RWHTKNOJQ RVGUISKNO RIPKROP RJQOPUOZN[O RUO[O RUOSPQRPTPVQXRYUZYZ RQXTYXYYZ RZH\\J R\\F^H", "D_NFPGPINOMRKWI[ ROGOJNO RMRKVIYI[ RHMJNMNPMRLTK RRLSJTK RUNXN[OYOWP RXNYO RRVSXTYVZ[Z RSXUY\\Y[Z RXHZJ RZF\\H", "D_MFOGOIMNLRLTMU RNGNK RMNMU RHJKKOKSJUI RSJTHUI RMUOSRQUPXPZQ[S[VZXWZS[O[ RXPYQZSZVYXWZ RXIZK RZG\\I", "D_HLJNOLSKWKZL[M\\O\\R[TZUXVUWPX RIMOL RWKYLZM[O[RZTXV RZH\\J R\\F^H", "D_HIJKLKPJUIYH[H\\I RIJPJ RUI\\I RYIVJSLQOPRPUQXRYTZX[[[ RPUQWRXTYXZZZ[[ RZM\\O R\\K^M", "D_OFQGQQ RPGPMQQ RWNYPQQ RXOTPQQNRLSKUKWLYMZO[Z[ RLYNZYZZ[ RXIZK RZG\\I", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQ RIUJWKX RUGWHWWVYTZRZPYOWPURTTTVU[Y RVHWL RVU[X[Y RPMRNUNYM[L RYMZK[L RZG\\I R\\E^G", "D_IGJHLIPI RJHOHPI RPIMKKMIPHSHVIXJYLZOZRYTWUUVQVMUIVI RHUIWJXLYOYRXTVUTVQ RVIXLYN[Q\\SZSYT RUIXL RYNZQZS RYH[J R[F]H", "D_PFQISJ RQHSITITJ RTJQKOLNMNOOPQQSRTSUUUWTYRZPZMYKW RQQSSTUTWSYRZ RIYLVOTRS RVSYT[V\\XYX RIYIXLV RVSXTZV[X RWIYK RYG[I", "D_HPJRMM RIQNLPLUQYT[U\\VZVXW RUQZV RUJWL RWHYJ", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQ RIUJWKX RQGSHUHYG RUHWGXFYG RPOSPVPYO[N RYOZM[N RUHWIWWVYTZRZPYOWPURTTTVU[Y RVIWM RVU[X[Y R[I]K R]G_I", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQ RIUJWKX RUGWHWWVYTZRZPYOWPURTTTVU[Y RVHWL RVU[X[Y RPMRNUNYM[L RYMZK[L R[EZFZH[I]I^H^F]E[E", "D_IGJHLIPI RJHOHPI RPIMKKMIPHSHVIXJYLZOZRYTWUUVQVMUIVI RHUIWJXLYOYRXTVUTVQ RVIXLYN[Q\\SZSYT RUIXL RYNZQZS RZFYGYIZJ\\J]I]G\\FZF", "D_PFQISJ RQHSITITJ RTJQKOLNMNOOPQQSRTSUUUWTYRZPZMYKW RQQSSTUTWSYRZ RIYLVOTRS RVSYT[V\\XYX RIYIXLV RVSXTZV[X RXGWHWJXKZK[J[HZGXG", "D_HPJRMM RIQNLPLUQYT[U\\VZVXW RUQZV RVHUIUKVLXLYKYIXHVH", "D_IGKHKJJMIQ RJHJKIQIUJYKZKXLTMQ RIUJWKX RQGSHUHYG RUHWGXFYG RPOSPVPYO[N RYOZM[N RUHWIWWVYTZRZPYOWPURTTTVU[Y RVIWM RVU[X[Y R\\G[H[J\\K^K_J_H^G\\G", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Hershey Glyphs 4300 to 4399 (orig. Oriental 6100 to 6199) ********/ /* Note: 4399 is an empty space of the same width as any of the glyphs */ /* Note: 4398 is a locally added glyph (Katakana 'vu') */ "D_HGJIOHUGZF\\H RIHOH RUG[G R\\HZJVMTN R[GYJWLTN RRMTNTQSUQXN[ RRMSNSQRUPY", "D_VFXHULRONRKT RWGVISMOQKT RSNUOU\\ RSNTOT[U\\", "D_PFSGSIRK RPFRGRK RJIKKKPLQ RLKLQ RLKYK RJIKJOK RUKXJZL RZLWRUURXOZM[ RYKXNVRSVPYM[", "D_QKSLSW RRLRW RJJLLXJZK RKKZK RHVJXZV\\W RIW\\W", "D_RFUGUYT[SYPW RTGTXSY RHLJNOMULZK\\L RIMOM RUL\\L RSMPQLUHX RTMRPOSKVHX", "D_QFSHRKPPNTLWI[ RRGQJOPMUI[ RILKNOMTLXKZM RJMOM RTLYL RZMYSXWWYU[TZRY RYLXSWWVYTZ", "D_OFRGT[ RQGS\\T[ RJLLNPMTLXKZL RKMPM RTLZL RHRJTOSURZQ\\R RISOS RUR\\R", "D_PFRHPLNOLQJS RQGPJNNLQ RQJSKXK RUKWJYL RYLVRSVPYM[K\\ RXKWNURRVOYK\\", "D_NFPHNLLOJQHS ROGNJLNJQ RLOTNYM\\N RTN\\N RROTQRUPXNZL\\ RSPRSPWNZ", "D_JJLLXJZL RKKYK RZLYOXV RYKXPXV RJVLXXVYW RKWYW", "D_LINJNOMS RMJMS RTFWGWLVQUTTVRYP[ RVGVLUQTURY RHMJOONUMZL\\M RINON RUM\\M", "D_MGOHPIPJOJNHMG RHNJOKPKQJQIOHN RIXKZOXSUWQ[L RJYOWST[L", "D_JILKWIYK RKJXJ RYKWNTQQSOTJV RXJWLUOSQPSJV RUSXUZWZXYXXVUS", "D_OGRHRJQS RQHQVRXTY[Y RVYZX[Y RHNJPOOUNZM\\O RIOOO RUN[N R\\OYQVT R[NVT", "D_IIKJLKLLKLJJII RXHZJWPTTQWNYLZ RYIXLVPSTPWLZ", "D_PFRHPLNOLQJS RQGPJNNLQ RQJSKXK RUKWJYL RYLVRSVPYM[K\\ RXKWNURRVOYK\\ RNPQQSRVTWUWVVVUTSR", "D_LJOJTIXG ROJRITHWFXG RPJSKSQRUPXM[ RRKRQQUOY RHNJPOOUNZM\\N RIOOO RUN\\N", "D_IIKJLKLLKLJJII ROHQIRJRKQKPIOH RXHZJWPTTQWNYLZ RYIXLVPSTPWLZ", "D_LFNHWFXG RMGXG RHNJPOOUNZM\\N RIOOO RUN\\N RSOSQRUPXM[ RRORQQUOY", "D_MFPGP\\ ROGO[P\\ RPOROUPVQVRURTPRO", "D_QFTGTLSQRTQVOYM[ RSGSLRQQUOY RHNJPOOUNZM\\N RIOOO RUN\\N", "D_LJNLWJXK RMKXK RHVJXZV\\W RIW\\W", "D_JILKWIYK RKJXJ RYKWNTQQSOTJV RXJWLUOSQPSJV RMOPPTRWTYVYWXWVTTR", "D_PFRGSHSIRIQGPF RJLLNVLXN RKMWM RXNTRQTOUJW RWMUPSRPTJW RRSSTS\\ RRSR[S\\ RXUZV[W[XZXYVXU", "D_WHYJVPSTPWMYKZ RXIWLTQQUNXKZ", "D_LLNNMQLSJUHV RMMLQJU RVLXNZQ\\U\\V[VZRXN", "D_IGLHLJKS RKHKVLXNYYY RQYUXWXYY RKROQRPXN RRPVNXN", "D_JGLIYI RKHOI RUIXHZJ RZJWPUSRVOXMY RYIXLVPSTPWMY", "D_GQISPLQL[V RHRJQNN RUPZT\\U[V", "D_PFSGSYR[QYOX RRGRXQY RHLJNOMULZK\\L RIMOM RUL\\L RLSJVIWHWHVJULS RXS[U\\V\\W[WZUXS", "D_HLJNOMULZK\\M RIMOM RUL[L R\\MZOVRTS R[LYOWQTS RQRTTVVVWUWTUQR", "D_PFSGUHVIVJUJSHPF RMMPNROSPSQRQPOMM RNVSXUYVZV[U[SYPWNV", "D_RITKMW RSJMW RHWJYYV RIXYV RVSXUZX[X[WYUVS", "D_WHYJVPSTPWMYKZ RXIWLUPRTOWKZ RONSPVRXTXUWUVSTQQO", "D_LINKWIXJ RMJXJ RQKQVRXTY[Y RRKRMQS RVYZX[Y RHQJSORUQZP\\Q RIROR RUQ\\Q", "D_OFRGT[ RQGS\\T[ RHLJNOMULZK\\M RIMOM RUL[L R\\MYPVRTS R[LZNWQTS", "D_VFXHULRONRKT RWGVISMOQKT RSNUOU\\ RSNTOT[U\\", "D_IJKLUJWL RJKVK RWLVOUV RVKUPUV RHVJXZV\\W RIW\\W", "D_QKSLSW RRLRW RJJLLXJZK RKKZK RHVJXZV\\W RIW\\W", "D_JJLLXJZL RKKYK RJPLRXP RKQXQ RJVLXXV RKWXW RZLYOYY RYKXPXY", "D_LFNHWFXG RMGXG RJMLOWMYO RKNXN RYOWRTUQWOXLY RXNWPUSSUPWLY", "D_LINJNOMS RMJMS RTFWGWQVUTXQ[ RVGVQUUTWQ[", "D_LJNKNNMRKUHX RMKMNLRKTHX RQISJSMRS RRJRVSXUXWWYU\\Q RRVSWVWXV", "D_HIKJKMJS RJJJVKXNXQWTUXR[O RJVKWNWQVUTXR", "D_JJLLXJZL RKKYK RKKKZ RLLLXKZ RZLYOXV RYKXPXV RLXXVYW RLWYW", "D_JGKIKNLO RLILO RLIYI RJGKHOI RUIXHZJ RZJWPUSRVOXMY RYIXLVPSTPWMY", "D_QFTGT[ RSGS\\T[ RJJLLXJZK RKKZK RLLNMNR RMMMR RHQJSZQ\\R RIR\\R", "D_PFSGSIRK RPFRGRK RJIKKKPLQ RLKLQ RLKYK RJIKJOK RUKXJZL RZLWRUURXOZM[ RYKXNVRSVPYM[", "D_JJLLXJZL RKKYK RZLWNSQ RYKSQ RQPSQSW RRQRW RHVJXZV\\W RIW\\W", "D_JGLIYI RKHOI RUIXHZJ RLNNPVO RMOVO RZJWPUSRVOXMY RYIXLVPSTPWMY", "D_JHLIMJMKLKKIJH RIWKYOWSTWP[K RJXOVSS[K", "", "", "", "", "D_QFSHRKPPNTLWI[ RRGQJOPMUI[ RILKNOMTLXKZM RJMOM RTLYL RZMYSXWWYU[TZRY RYLXSWWVYTZ RZH\\J R\\F^H", "D_OFRGT[ RQGS\\T[ RJLLNPMTLXKZL RKMPM RTLZL RHRJTOSURZQ\\R RISOS RUR\\R RZH\\J R\\F^H", "D_PFRHPLNOLQJS RQGPJNNLQ RQJSKXK RUKWJYL RYLVRSVPYM[K\\ RXKWNURRVOYK\\ RYH[J R[F]H", "D_NFPHNLLOJQHS ROGNJLNJQ RLOTNYM\\N RTN\\N RROTQRUPXNZL\\ RSPRSPWNZ RYH[J R[F]H", "D_JJLLXJZL RKKYK RZLYOXV RYKXPXV RJVLXXVYW RKWYW RZH\\J R\\F^H", "D_LINJNOMS RMJMS RTFWGWLVQUTTVRYP[ RVGVLUQTURY RHMJOONUMZL\\M RINON RUM\\M RZH\\J R\\F^H", "D_MGOHPIPJOJNHMG RHNJOKPKQJQIOHN RIXKZOXSUWQ[L RJYOWST[L RVHXJ RXFZH", "D_JILKWIYK RKJXJ RYKWNTQQSOTJV RXJWLUOSQPSJV RUSXUZWZXYXXVUS RZH\\J R\\F^H", "D_OGRHRJQS RQHQVRXTY[Y RVYZX[Y RHNJPOOUNZM\\O RIOOO RUN[N R\\OYQVT R[NVT RYH[J R[F]H", "D_IIKJLKLLKLJJII RXHZJWPTTQWNYLZ RYIXLVPSTPWLZ R[G]I R]E_G", "D_PFRHPLNOLQJS RQGPJNNLQ RQJSKXK RUKWJYL RYLVRSVPYM[K\\ RXKWNURRVOYK\\ RNPQQSRVTWUWVVVUTSR RYH[J R[F]H", "D_LJOJTIXG ROJRITHWFXG RPJSKSQRUPXM[ RRKRQQUOY RHNJPOOUNZM\\N RIOOO RUN\\N RZH\\J R\\F^H", "D_IIKJLKLLKLJJII ROHQIRJRKQKPIOH RXHZJWPTTQWNYLZ RYIXLVPSTPWLZ R[G]I R]E_G", "D_LFNHWFXG RMGXG RHNJPOOUNZM\\N RIOOO RUN\\N RSOSQRUPXM[ RRORQQUOY RZH\\J R\\F^H", "D_MFPGP\\ ROGO[P\\ RPOROUPVQVRURTPRO RTHVJ RVFXH", "D_LLNNMQLSJUHV RMMLQJU RVLXNZQ\\U\\V[VZRXN RYI[K R[G]I", "D_IGLHLJKS RKHKVLXNYYY RQYUXWXYY RKROQRPXN RRPVNXN RYI[K R[G]I", "D_JGLIYI RKHOI RUIXHZJ RZJWPUSRVOXMY RYIXLVPSTPWMY R[G]I R]E_G", "D_GQISPLQL[V RHRJQNN RUPZT\\U[V RVJXL RXHZJ", "D_PFSGSYR[QYOX RRGRXQY RHLJNOMULZK\\L RIMOM RUL\\L RLSJVIWHWHVJULS RXS[U\\V\\W[WZUXS RZG\\I R\\E^G", "D_LLNNMQLSJUHV RMMLQJU RVLXNZQ\\U\\V[VZRXN RZGYHYJZK\\K]J]H\\GZG", "D_IGLHLJKS RKHKVLXNYYY RQYUXWXYY RKROQRPXN RRPVNXN RZGYHYJZK\\K]J]H\\GZG", "D_JGLIYI RKHOI RUIXHZJ RZJWPUSRVOXMY RYIXLVPSTPWMY R\\E[F[H\\I^I_H_F^E\\E", "D_GQISPLQL[V RHRJQNN RUPZT\\U[V RWHVIVKWLYLZKZIYHWH", "D_PFSGSYR[QYOX RRGRXQY RHLJNOMULZK\\L RIMOM RUL\\L RLSJVIWHWHVJULS RXS[U\\V\\W[WZUXS R[EZFZH[I]I^H^F]E[E", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* Katakana 'vu' glyph (modified version of 4302) [4398] */ "D_PFSGSIRK RPFRGRK RJIKKKPLQ RLKLQ RLKYK RJIKJOK RUKXJZL RZLWRUURXOZM[ RYKXNVRSVPYM[ R[H]J R]F_H", /* empty Kanji glyph (space) [4399] */ "D_", }; #ifndef NO_KANJI const char * const _pl_g_oriental_hershey_glyphs[NUM_ORIENTAL_HERSHEY_GLYPHS] = { /******** Oriental Hershey Glyphs 0 to 99 ********/ "", "D_GQ]QZOXQ RXQ[P", "", "", "", "", "", "D_GG]G[EYG RYG\\F RQGPNORNTLWJYG[ RRGQNPRNVLXIZG[ RQMYM RXMYL[MYP RYMXTWXVYTZQY RWYVZUZ RZMYTXXWZV[U[TZ", "D_II[IYGWI RWIZH RKQYQWOUQ RUQXP RGZ]Z[XYZ RYZ\\Y", "D_GG]G[EYG RYG\\F RQGQ[ RRGR[ RTMVNXQYSZSZRYPWNTMRM", "", "", "", "", "", "D_IHZHXFVH RVHYG RQHNZ RRHOZ RIPVP RUPVOXPWR RVPUZ RWPWRVZ RGZ]Z[XYZ RYZ\\Y", "D_GG]G[EYG RYG\\F RQGQLPQNULXJZG\\ RRGRMQROVLYI[G\\ RSOTRVVXY[\\][ RYY[[ RSOUSXWZY][ RIN[NYLWN RWNZM", "D_GG]G[EYG RYG\\F RTJVITHRLOPKTGW RUITKQOMSIVGW RQOQ\\ RRMR\\ RWPYR[U\\U\\TZRWPUO", "", "", "", "", "", "", "D_GG]G[EYG RYG\\F RYGYXXZW[ RYYYZX[ RZGZZY\\X\\W[UZ RKLKV RKLLMLV RLMSM RSMSU RRMSLTMTU RLTST", "", "D_IG[GYEWG RWGZF RQGQ] RRGR] RKKLMMPNPNOMMJJ RXJUP RXJYKUP RGR]R[PYR RYR\\Q", "D_HG\\GZEXG RXG[F RRGR[ RSGS[ RMPNOLNL[ RMOM[ RSP[PYNWP RWPZO RG[][[YY[ RY[\\Z", "", "", "", "", "", "D_GG]G[EYG RYG\\F RRGOM RRGSHOM RLMJLJ[ RKMK[ RKMXM RWMXLZMYO RXMX[ RYMY[ RKSXS RKYXY", "D_GG]G[EYG RYG\\F RQGQV RRGRV RKLIKI\\ RJLJ\\ RJLYL RXLYK[LZN RYLYXXZW[ RYYYZX[ RZLZZY\\X\\W[UZ RMOMW RMONONW RNVUV RUOUW RUOVOVW", "D_GG]G[EYG RYG\\F RQGQU RRGRU RLKJJJ\\ RKKK\\ RKKXK RWKXJZKYM RXKXXWZV[ RXYXZW[ RYKYZX\\W\\V[TZ RKPXP RGU]U[TZU", "", "", "", "", "", "", "", "D_NGN[ ROGO[ RTGT[ RUGU[ RGG]G[EYG\\F RKMILIU RJMJU RJMYM RXMYL[MZO RYMYU RZMZU RJTYT RG[][[YY[\\Z", "", "", "", "", "", "D_GG]G[EYG RYG\\F ROGMM RPGNM RMMRM RRMRWQX RQMRLSMSWRYQXOW RLOMPNROROQNPLO RWNSR RWNXOSR RKURS RKULVRS RTSUTWWXWXVWUTS RHMH\\ RHMIMI\\ RI[Z[ RZMZ\\ RZM[M[\\", "D_GG]G[EYG RYG\\F RQGQV RRGRV RLKLW RLKMLMW RMLVL RVLVW RULVKWLWW RMQVQ RMVVV RHKH\\ RHKIKI\\ RI[Z[ RZKZ\\ RZK[K[\\", "", "", "D_LGJFJOITHV RKGKOJSIUGW RKGXG RWGXFZGYI RXGXM RYGYM RKLXL RULVNXQ[S]R RVNXPZQ]R RMPMX RMPNQNX RNQUQ RUQUX RTQUPVQVX RNTUT RNWUW RH[\\[ZZY[", "D_GG]G[EYG RYG\\F RTGPJKMGO RVGPKLMGO RQJQP RRIRP RVKXLZN[N[MYLVK RGR]R[PYR RYR\\Q RQRQ[ RRRR[ RMVNULUL[ RMVM[ RRVZVXUWV RG[][[YY[ RY[\\Z", "", "", "", "D_GG]G[EYG RYG\\F RQGPJ RRGQI RSGQJ RMJKIKS RLJLS RLJWJ RVJWIYJXL RWJWS RXJXS RLMWM RLPWP RKSXS RNTKWGZ RNTOUKXGZ RNVXV RWUUWQZO[L\\H] RWUXVTYP[M\\H] RNVQYT[W\\[]]\\ ROWRYTZW[]\\", "", "", "", "D_GG]G[EYG RYG\\F ROGOS RPGPS RTGTS RUGUS RIJIO RIJJKJO RJKZK RZKZO RYKZJ[K[O RIO[O RGS]S[QYS RYS\\R RMVM[N\\V\\W[VZ RMVNVNZO[U[VZVX RQURXSXSWQU RJWIYHZH[I[JYJW RYW[Y\\[][]Z\\YYW", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RHSGQFQ] RRGR] RJLHKHV RILIV RILZL RYLZK\\L[N RZLZV R[L[V RIUZU", "D_RHSGQFQLPPORMTJV RRGRMQPPRNTJV RRNSQTSVUWTUSSQ RJKHJH\\ RIKI\\ RIKZK RYKZJ\\K[M RZKZXYZX[ RZYZZY[ R[K[ZZ\\Y\\X[UZ", "", "", "", "", "", "", "", "", "", "D_KGIFIV RJGJV RJGYG RXGYF[GZI RYGYV RZGZV RQGQ\\ RRGR\\ RJNYN RJUYU", "", "", "", "D_RHSGQFQ\\ RRGR\\ RGL]L[JYL RYL\\K RPLMRJVGY RQMOQMTKVGY RSMTPURXV[Y]X RYV[X RSMTOWSZV]X RMWVWUVTW", "D_QFQ[ RQFRFR[ RJHJP RJHKHKP RKOXO RXHXP RXHYHYP RHSH\\ RHSISI\\ RI[Z[ RZSZ\\ RZS[S[\\", "", "", /******** Oriental Hershey Glyphs 100 to 199 ********/ "", "D_SFQFPI RSFPI RJIHHH[ RIII[ RII[I RZI[H]I\\K R[I[WZYYZ R[X[YZZ R\\I\\Y[[Z[YZWY RNMNV RNMONOV RONUN RUNUV RTNUMVNVV ROUUU", "", "D_OHPGNFN[ ROGO[ RUHVGTFT[ RUGU[ RJKHJH\\ RIKI\\ RIKZK RYKZJ\\K[M RZKZ\\ R[K[\\ RISZS RI[Z[", "", "", "", "D_QGQ\\ RRGR\\ RLGJFJP RKGKP RKGXG RWGXFZGYI RXGXP RYGYP RKKXK RKOXO RGS]S[RZS RPSNVKYH[ RQTMXJZH[ RSSTVVYXZ[[]Z RTVVXXY]Z", "D_RGSFQFQP RRGRP RIH[HYGXH RJLZLYKXL RHP\\PZOYP RQPNSJVGX RQPRQNTKVGX RRPSSTUVXXZ[\\][ RYZ[[ RTUVWYY][ RMTMZ RNTNZ RI[UW RI[K\\UW RXRUU RXRYSUU", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_NFPGQHRHRGPFNF RKLQL RPLQKSLRN RQLQXPZO[ RQYQZP[ RRLRZQ\\P\\O[MZ RSLTOVSXV[Y]X RYV[X RSLUPXTZV]X RGPOP RLPMOOPMR RMOLRKTIWGY RNPMSKVGY RZLVP RZL[MVP", "D_JHLJMLNLNKMJJH RHONO RLOMNOPMQ RMNLRJVGZ RNPLTJWGZ RRISGQFQXPZO[ RQYQZP[ RRGRZQ\\P\\O[MZ RSGSITNUQVSXV[Y]X RYV[X RSITMVQXTZV]X RZKVP RZK[LVP", "D_RHSGQFQ] RRGR] RJHKIMLNLNKMJJH RXHUM RXHYIUM RHO\\OZMXO RXO[N RGU]U[SYU RYU\\T", "", "", "", "", "", "D_IFJGKILILHKGIF RRFPFOIMNLPIUGX RQFOK RRFOLLQJTGX RGJUJ RTJUIWJVL RUJUN RVJVN RNNXN RWNXMZNYP RXNXS RYNYS RKS[S RZS[R]S[V R[SZZY[ R\\S[ZZ\\Y[WZ RKVJXIYIZJZKXKV RNVOZPZPYNV RRVSYTYTXRV RUUVVWXXXXWWVUU", "D_JFKGLJMJMILGJF ROFPGQJRJRIQGOF RWFUK RWFXGUK RLLJKJU RKLKU RKLXL RWLXKZLYN RXLXU RYLYU RQLQ] RRLR] RKPXP RKTXT RGX]X[WZX", "", "", "", "", "", "", "D_NIOHMGMRLVJYG\\ RNHNRMVKYG\\ RGNTM RSMTLVMUO RTMTZU[\\[]Z\\X R[Z\\Z\\Y RUMUYVZZZ\\X]U", "", "", "", "", "", "", "", "D_OGOLNQMTLVJY RPGPLOQNTLWJYG[ RPLQPSTUWXZ[\\][ RVWXY[[ RPLQORQTTXX[Z][ RIGXG RUGVFXGWH RVGTN RWHUN RTN\\N RYNZM\\NZP RZMXRVUSXPZL\\ R[NYRWUTXQZO[L\\", "", "D_IJOITHXGZI RRIYH RIJZI RQIQ\\ RRIR\\ RGQ]Q[OYQ RYQ\\P", "", "", "", "", "", "D_QIQ] RRIR] RLEILHN RLEMFLHHN RKI[IYGWIZH RGQ]Q[OYQ\\P", "", "", "", "D_RHSGQFQPPROS RQQQRPS RRGRRQTPTOSMR RLIIPHR RLIMJLLHR RVIXKZN[N[MYKVI RXPWRUURXOZM[ RXPYQVUSXPZM[I\\", "", "", "", "", "", "", "D_OFPENENRMVKYI[ ROFOSNVMXKZG\\ RUFVETET\\ RUFU\\ RIHYH RXHYG[HZJ RYHYN RZHZN RKMILHT RJMIT RJMYM RIR[R RZR[Q]R[U R[RZXYY R\\R[XZZYYWX", "", "", "", "", "", "D_RGSFQFQ\\ RRGR\\ RIJZJXHVJYI RGP]P[NYP\\O RQPPSNVKYH[ RQSOVLYH[ RRPTTVWXY[[]Z RTTWWZY]Z", "", "", "", "", "", "", "", "", "D_LFJKGQ RLFMGLIINGQ RLI\\IZGXI RXI[H RRIR\\ RSIS\\ RNOLNLU RMOMU RMO[OYMWO RWOZN RGU]U[SYU RYU\\T", "", "", "", "", "", "", "D_JHWFYG RJHYG RPGML RRGML RKKMMNOOOONNMKK RVJQQ RVJWKQQ RHRYQ RHRJSYQ RXOZQ[S\\S\\R[QXO RQRQ\\ RRRR\\ RLUKWIZ RLUMVIZ RVUXWYYZYZXYWVU", "D_RGSFQFQ\\ RRGR\\ RGI]I[GYI RYI\\H RLLJKJS RKLKS RKLXL RWLXKZLYN RXLXS RYLYS RKRXR RPRNUJY RQSOUJYG[ RSRTTVWYY\\Z]Y RTTVVYX]Y", "", "", "D_HHHW RHHIIIV ROJOSNWLZJ\\ ROJPJPSOWMZJ\\ RIIPFQG RIIQG RKNLQMQMPKN RGWLU RGWHXLU RTHT\\ RTHUIU\\ RUI[I R[I[XZY R[I[H\\I\\X[ZZYXX RWOXRYRYQWO", /******** Oriental Hershey Glyphs 200 to 299 ********/ "", "", "D_RHSGQFQ\\ RRGR\\ RIJ[JYHWJ RWJZI RKKLLMNNNNMMLKK RWKTP RWKXLTP RGP]P[NYP RYP\\O RQPPRNULWHZ RQROUMWJYHZ RSPTSVVXX[Z]Y RTSWVZX]Y", "", "", "", "", "", "", "", "", "D_IHQGXFZG RIHZG RQGQ[ RRGR[ RHL\\LZKYL RLLLV RMLMV RVLVV RWLWV RGQ]Q[OYQ RYQ\\P RHV\\VZUYV RG[][[YY[ RY[\\Z", "", "D_RGSFQFQ\\ RRGR\\ RGH]H[GZH RLLJKJU RKLKU RKLXL RWLXKZLYN RXLXU RYLYU RKPXP RKTXT RQTNWKYG[ RQVNXLYG[ RRTUXXZ[[]Z RRTUWYY]Z", "", "", "", "", "", "", "", "", "", "D_IHQGWFYG RIHYG RQGQ\\ RRGR\\ RHK\\K[JZK RLKLS RMKMS RVKVS RWKWS RGO]O[NZO RHS\\S[RZS RPSMWJYHZ RQTNWKYHZ RSSTUVWYY\\Z]Y RTUWWYX]Y", "D_QGQ[ RRGR[ RIHQGXFZG RIHZG RHK\\KZJYK RJMJT RJMKNKT RKNXN RXNXT RWNXMYNYT RKQXQ RJTYT RHW\\WZVYW RG[][[ZZ[", "", "", "", "", "", "D_SEQEPG RSEPG RMGKFKT RLGLT RLGWG RVGWFYGXI RWGWM RXGXM RLJWJ RLMXM RLP[PYOXP RLS[S RZS[R]S[U R[SZZY[ R\\S[ZZ\\Y[WZ RNUNZ RNUOUOZ RHVH[ RHVIVI[ RIZTZ RTVT[ RTVUVU[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IGUG RRGTFVH RTFSHJTIVIXJZL[[[\\Z[X RUGSI RZZ[Z[Y RVHTISJKTJVJXKYMZYZ[X\\U", "D_MINHLGLZM[Y[ZZYX RXZYZYY RMHMYNZWZYXZU RHQNPSO[MXLWN RWNYM", "", "", "", "", "", "", "", "", "", "", "D_RFSEQEQXPZO[ RQYQZP[ RRFRZQ\\P\\O[MZ RGH]H[GZH RJJJN RJJKKKN RKKXK RXKXN RWKXJYKYN RJNYN RHQXQ RXQXX RWQXPYQYX RGT]T[SZT RHWXW", "D_JJZJXHVJ RVJYI RGX]X[VYX RYX\\W", "", "D_IH[HYFWH RWHZG RGN]N[LYN RYN\\M RNNNRMVLXJZH[ RONORNVMXKZH[G[ RTNTZU[\\[]Z\\X R[Z\\Z\\Y RUNUYVZZZ\\X]U", "", "", "", "", "", "", "", "D_RISHQGQM RRHRM RGM]M[KYM RYM\\L RMQLTJXH[ RNRMT RMQORMUJYH[ RTQVSYWZY[Z\\Y[WXTTQ RYV[Y", "D_RIRGSFQFQI RGI]I[HZI RRLSKQKQ\\ RRLR\\ RLOJNJ[ RKOK[ RKOXO RWOXNZOYQ RXOXYWZ RYOYYX[WZUY", "D_OEPFQIRIRHQFOE RHJ\\JZHXJ[I RQJQ[ RRJR[ RIR[RYPWRZQ RG[][[YY[\\Z", "", "", "", "", "D_RHRFSEQEQH RGH]H[GZH RMJKLGO RMJNKKMGO RUJXL[O\\O\\NYLUJ RUPWOUNTQRTOWLYJZG[ RVOUQSTPWMYKZG[ RNNKPKR RNNKR RNNOQQTTWWY[[]Z RQTUWYY]Z", "", "", "", "", "D_RGRFSEQEQG RGG]G[EYG RYG\\F RLKJJJR RKKKR RKKXK RWKXJZKYM RXKXR RYKYR RKQXQ RQQQXPZO[ RQYQZP[ RRQRZQ\\P\\O[MZ RLTGY RLTMUGY RVTXVZY[Y[XZWVT", "", "", "D_RHRFSEQEQH RGH]H[GZH RLIKLIQGT RLIMJKNJPGT RJPJ\\ RKNK\\ RSIRLPPNS RSITJSLQONS RSL[L RZLYOWSUVRYO[ RYLZK[LZOXSVVTXQZO[L\\ RRNSOURVRVQUPRN RPPQSSVUXXZ[[]Z RSVVXYY]Z", "", /******** Oriental Hershey Glyphs 300 to 399 ********/ "", "", "", "", "", "", "D_RHRFSEQEQH RGH]H[GZH ROHNKLNJP RPHOKMNJPHQ RSHSNRO RTHTNSPROPN RJJGN RJJKKGN RWJXKZN[N[MZLWJ ROPKUGY ROPPQMTGY RNSXS RWRUURXOZM[ RVSWRXSTWPZM[I\\ RNSOUQXTZW[[\\][ ROUQWTYWZ][", "", "", "", "", "", "", "", "", "", "", "", "", "D_RHRFSEQEQH RHH\\HZGYH RQHOM RQHRIOM RMLNMOOPOPNOMML RUKQQ RUKVLQQ RLRUQ RLRMSUQ RUPVQWSXSXRWQUP RHJIKJMKMKLJKHJ RZJXM RZJ[KXM RKOHRIS RKOIS RXOYP[S\\S\\R[QXO RRUSTQSQ\\ RRTR\\ RGV]V[UZV", "", "D_RGRFSEQEQG RGG]G[FZG RMHNIOKPKPJOIMH RUHTK RUHVITK RJLHKH[ RILI[ RILZL RYLZK\\L[N RZLZYYZ R[L[YZ[YZWY ROLNOMQ ROLPMOOMQKR RSLSPTQWQXPWO RTLTOUPVPWOWN RNSNZ RNSOTOZ ROTTT RTTTZ RSTTSUTUZ ROYTY", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_QFQLPQNULXJZG\\ RRGRK RQFSGRNQROVLYI[G\\ RSGSKTQUTVVXY[\\][ RYY[[ RSKTPVTXWZY][", "", "", "", "", "", "", "", "", "", "", "D_MFKKIOGS RMFNGMIIPGS RKLK[ RLKL[ RTHUGSFSZT[\\[]Z\\X R[Z\\Z\\Y RTGTYUZZZ\\X]U R[KTQ R[K\\LTQ", "", "D_SFQFPHNKKNHP RRFPI RSFPJMMJOHP RSGTIVLXN[P]O RYN[O RTIWLZN]O RMOVOUNTO RLTVT RUTVSXTVW RVTU\\ RWTV\\", "", "", "", "", "", "", "", "", "D_LFKIINGR RLFMGKKGR RJMJ\\ RKKK\\ RUHVGTFTW RUGUW RPLQKOJOZP[\\[]Z\\X R[Z\\Z\\Y RPKPYQZZZ\\X]U RLRXKYK RXKYJ[KZM RYKYRXS RZKZRYTXSVR", "D_MFIOGS RMFNGLKIPGS RKMK\\ RLKL\\ RVHWGUFU[ RVGV[ RON]N[LYN\\M RP[\\[ZYX[[Z", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RSGTFRFRKSQTTUVWYY[[\\\\\\][\\Z RXYYZ[[\\[ RSGSKTQUTWWYY[Z\\Z]W RVFWGXIYIYHXGVF RKL]K[JZK", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_SFQFPHNKKNHP RRFPI RSFPJMMJOHP RSGTIVLXN[P]O RYN[O RTIWLZN]O RMPWPVOUP RNTLSL\\ RMTM\\ RMTWT RVTWSYTXV RWTW\\ RXTX\\ RM[W[", "D_SFQFPHNKKNHP RRFPI RSFPJMMJOHP RSGTIVLXN[P]O RYN[O RTIWLZN]O RLPXPVOUP RQPQ[ RRPR[ RKUYUWTVU RG[][[YY[ RY[\\Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 400 to 499 ********/ "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RUHVGTFTM RUGUM RNM\\MZKXM RXM[L ROPPRQVQXRXRVQSOP RYPVZ RYPZQVZ RN[][[YY[ RY[\\Z", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RVHWGUFU\\ RVGV\\ RQKOJOV RPKPV RPK[K RZK[J]K\\M R[K[V R\\K\\V RPP[P RPU[U", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RUHVGTFT\\ RUGU\\ RNL]L[KZL RTLSORQPTNV RTOSQQTNVLW RULVOWQYT\\W]V RVOXRZT]V RQWXWWVVW", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RQHRHPGPX RQHQW RNXWU RNXOYWU RRHWGZF\\G RRH\\G RVHVMWSXVYX[[\\\\]\\][\\Y R[Z\\[ RWGWMXSYVZX[Y\\Y]V RQO]O[NZO RQ[X[WZV[", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RRFQJOONQ RRFSGRJPNNQ RUKU\\ RVKV\\ RQK]K[IYK\\J RVQ]Q[OYQ\\P RVW]W[UYW\\V", "D_SFQFPHNKKNHP RRFPI RSFPJMMJOHP RSGTIVLXN[P]O RYN[O RTIWLZN]O RMOVOUNTO RQOQZP[ RRORZQ\\P[NZ RIS[SYRXS RMVKXHZ RMVNWHZ RTVWXYZZZZYYXWWTV", "D_KFILGQ RKFLGJLGQ RIMI\\ RJLJ\\ RMH]H[FYH RYH\\G RZHZXYZX[ RZYZZY[ R[H[ZZ\\Y\\X[VZ RNLNV RNLOMOV ROMUM RUMUU RTMULVMVU ROTUT", "", "", "", "", "", "", "", "", "", "", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ ROG]G[FZG RSGS[ RTGT[ RWGW[ RXGX[ RQOONO\\ RPOP\\ RPO[O RZO[N]O\\Q R[O[\\ R\\O\\\\ RP[[[", "", "", "", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ[ RKLK[ RMGVGUFTG RPGOLNPMR RQGPLOOMR RPLUL RTKSQRTQVOY RSLTKULTQSTQWOYL[ ROPPQQSRSRRQQOP RWIWU RWIXIXU R[F[YZZ R[F\\F\\Y[[ZZXY", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RSGTFRFRT RSGST RXGYFWFWT RXGXT RNL]L[KZL RNT]T[SZT RRVOZM\\ RRVSWQYM\\ RWVYX[\\\\\\\\[[YYWWV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RPHVGZF\\G RPH\\G RUHSL RUHVISL RPKQLRNSNSMRLPK RYKUQ RYKZLUQ ROR[Q RORPS[Q RZO[P\\R]R]Q\\PZO RURU\\ RVRV\\ RQUPWNZ RQURVNZ RYU[W\\Y]Y]X\\WYU", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RXEVEVK RWEVK RXEVK ROG]G[FZG RRJRX RRJSKSX RSKZK RZKZX RYKZJ[K[X RSOZO RSSZS RSWZW ROMPLNLN\\ ROMO\\ RO[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 500 to 599 ********/ "", "", "", "", "", "", "", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ[ RKLK[ ROFOV ROFPGPV RPGSG RSGSV RRGSFTGTV RPLSL RPQSQ ROVTV ROWM[ ROWPXM[ RSWT[U[UZSW RWHWU RWHXHXU R[F[YZZ R[F\\F\\Y[[ZZXY", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RMG]G[FZG ROIOSNXMZ ROIPJPSOWMZL[ RPJZJ RZJZN RYJZI[J[N RPN[N RRPR\\ RRPSQS\\ RSQ[Q R[Q[ZZ[ RZQ[P\\Q\\Z[\\Z[YZ RUQU[ RVQV[ RXQX[ RYQY[ RSU[U", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LFKIINGR RLFMGJMGR RJMJ\\ RKKK\\ ROKPJNJNUOVRVSURT ROKOTPUQURTRR RRLOO RRLSMOO RSG]G\\F[G RXGWK RYGWK RUJUW RUJVKVW RVK[K R[K[W RZK[J\\K\\W RVO[O RVS[S RUW\\W RWZVYS[Q\\ RWZQ\\ RZY[Z\\\\]\\][\\ZZY", "", "", "", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ\\ RKLK\\ RTFRFPIMM RTFMM RRHYH RWHXGYHWI RXGWIUK RPJPO RPJQKQO RQKZK RZKZO RYKZJ[K[O RUKUO RVKVO RPO[O RUOPRNS RVOUPSQNS RSQTTUXUZT[ RSQUUVXVZU\\T[RZ RTSQUNV RTTRUNV RUVQXNY RUWRXNY RVPWTXVZY\\[]Z RXVZX]Z R[RXU R[R\\SXU", "", "", "", "", "", "", "", "", "", "", "D_LFKJIOGS RLFMGLJJNGS RJNJ[ RKLK[ RUHUGVFTFTH ROH[HZGYH RQHRKSKSJQH RWHVK RXHVK RMK]K\\J[K ROMOU ROMPNPU RPNYN RYNYU RXNYMZNZU RPQYQ RPTYT RQVQZR[Y[ZZYY RQVRVRYSZXZYYYW ROWMYMZNZOW RTVUXVXVWTV R[W\\Y]Y]X[W", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_SGTFRFRP RSGSP RMGLJKLIO RMGNHMJKMIO RLK[KYIWK RWKZJ RGP]P[NYP RYP\\O RPPNVLYJ[H\\ RPPQQPTOVMYK[H\\ RTPT[U\\\\\\][\\Y R[[\\[\\Z RUPUZV[Z[\\Y]V", "", "", "D_RLQOOTMWJZG\\ RRLSMRPPTNWLYI[G\\ RLGUG RRGSFUGSI RSGSLTQUTVVXY[\\][ RYY[[ RSLTPVTXWZY][", "", "", "D_MKMNLRJVGY RNLNNMQ RMKOLNPMSKVGY RUKVPWSYW[Y]X RYV[X RUKVOWRYU[W]X", "D_MGLIJLGO RMGNHLKJMGO RUFVHYL\\O]N RVHYK]N RJOWO RVOWOYOXQ RWOVWUYTZ RVXVYUZ RXOWYV[U[TZRY ROONTLXJZH[ ROOPPOTMXKZH[", "D_MHLKJOHR RMHNILMIQGS RUHVKWMYP[R\\Q RVKXNZP\\Q RQONY RQORPNY RIZWY RIZK[WY RUVWXY[Z[ZZXXUV", "", "D_NGOFMFMT RNGNT RVGWFUFUT RVGVT RHL\\LZJXL RXL[K RGT]T[RYT RYT\\S RNVLXG\\ RNVOWLYG\\ RTVWXZ[[[[ZZYTV", "", "", "", "", "", "", "D_PGQFOFOV RPGPV RUGVFTFTV RUGUV RLJJIJV RKJKV RKJYJ RXJYI[JZL RYJYV RZJZV RKPYP RGV]V\\U[V ROYMXI[G\\ ROYMZG\\ RUXWYZ[[\\\\\\\\[[ZYYUX", "D_MFNGOJPJPIOGMF RVFTK RVFWGTK RHK\\KZIXK RXK[J ROKO[ RPKP[ RTKT[ RUKU[ RJOKRLWMWMULRJO RZOWX RZO[PWX RG[][[YY[ RY[\\Z", "D_NGOFMFMV RNGNV RVGWFUFUV RVGVV RHJ\\JZIYJ RNNUN RNRUR RGV]V[UZV RNXKZG\\ RNXOYJ[G\\ RUXXZZ\\[\\[[ZZXYUX", "", "", "", "", "D_MFNGOIPIPHOGMF RVFTJ RVFWGTJ RGJ]J[HYJ RYJ\\I RIMI\\ RIMJNJ\\ RJNON RONOZN[ RNNOMPNPZO\\N[LZ RJROR RJVOV RTOTX RTOUOUX RZMZZY[ RZM[M[ZZ\\Y[WZ", "", "", "", "", /******** Oriental Hershey Glyphs 600 to 699 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGIFI[ RJGJ[ RJGYG RXGYF[GZI RYGYWXYWZ RYXYYXZ RZGZYY[X[WZUY RQGQP RRGRP RJPYP", "", "D_JGHFH\\ RIGI\\ RIG[G RZG[F]G\\I R[G[XZZY[ R[Y[ZZ[ R\\G\\Z[\\Z\\Y[WZ RLKXKWJVK RNNNW RNNOOOW ROOUO RUOUW RTOUNVOVW ROVUV", "", "", "D_LGJFJTIYH[ RKGKTJXIZG\\ RKG[G RZG[F]G\\I R[G[ZZ[ R\\G\\Z[\\Z[XZ RSJTIRIRP RSJSP ROLWLVKUL RNPXPWOVP ROROY RORPSPY RPSUS RUSUY RTSURVSVY RPXUX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HGIHJJKJKIJHHG RLMIUGUIVIYHZI[J[KZJYJULM RIZJZ RTFRFQIONNP RSFQJ RTFNP RPL[L RZL[K]M[N R[L[N R\\L[NYP RTLTPSTRVPY RULUPTTRWPYM[ RUPVTWVYY\\[]Z RWVYX]Z", "", "", "", "D_HGIHJJKJKIJHHG RLMIUGUIVIYHZI[J[KZJYJULM RIZJZ RTFRFQIOMMP RSFQJ RTFRJONMP RTFUIVKXN[P]O RYN[O RTFUHWKYM]O RQOVOUNTO RNSYS RXSYR[SZU RYSYYXZ RZSZYY[XZVY RSSS\\ RTST\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HGZG RYGZF\\GZK RZGYVXYWZ RYXYYXZ R[GZYY[X[WZUY RQGQIPPOTMWKYH[ RRGRKQQPTOVMXJZH[", "", "D_KGLFJFJUKVOVPUOT RKGKTLUNUOTOR RGNQKOJOK ROGZG RYGZF\\GZJ RZGYXXZW[ RYYYZX[ R[GZZY\\X\\W[UZ RTGTMSSRVPYN[ RUGUMTSSVQYN[L\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 700 to 799 ********/ "", "", "", "D_NHNFOEMEMH RIGHIGJGKHKIIIG RIHRH RQHRGTIRJ RRHRJ RSHRJQK RMJMR RMJNJNR RJLRLQKPL RJOROQNPO RHRTRSQRR RITI[ RITJUJ[ RJUQU RQUQ[ RPUQTRUR[ RJZQZ RVHVU RVHWHWU R[F[YZZ R[F\\F\\Y[[ZZXY", "", "", "", "", "", "", "", "", "", "", "", "D_RHSGQFQJPQOTMWKYH[ RRGRKQQPTOVMXJZH[ RHLZL RYLZK\\L[N RZLYVXYWZ RYXYYXZ R[L[NZYY[X[WZUY", "D_LGMFKFKNJTIWG[ RLGLNKSJVIXG[ RGKPK RPKPTOYNZ ROKPJQKQTPYO[NZLY RTITZ RTIUJUZ RUJ[J R[J[Z RZJ[I\\J\\Z RUY[Y", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HHPFQG RHHQG RLHL[ RMGMZ RGKRKQJPK RHMHT RHMINIT RINPN RPNPT RONPMQNQT RIQPQ RHTQT RGWRWQVPW RG[QZ RG[H\\QZ RWHXGVFVSUXTZ RWGWSVWTZR\\ RSM[M R[M[VZZY[ RZM[L\\M\\V[ZZ\\Y[WZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_OGPFNFN\\ ROGO\\ RGNNN RGXNU RGXHYNU RUHVGTFTZU[\\[]Z\\X R[Z\\Z\\Y RUGUYVZZZ\\X]U R[KUP R[K\\LUP", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RHSGQFQ\\ RRGR\\ RGO]O[MYO RYO\\N", "", "D_RHSGQFQR RRGRR RHL\\LZJXL RXL[K RLRJQJ\\ RKRK\\ RKRXR RWRXQZRYT RXRX\\ RYRY\\ RK[X[", "", "", "", "", "D_TEREQK RSERH RTEQK RGG]G[FZG RPKNJNX ROKOX ROKYK RXKYJ[KZM RYKYX RZKZX ROOYO ROSYS ROWYW RJNKMIMI\\ RJNJ\\ RJ[][[ZZ[", "", "", "D_RGSFQFQL RRGRL RGH]H[GZH RJLHKH\\ RILI\\ RILZL RYLZK\\L[N RZLZZY[ R[L[ZZ\\Y[WZ RNLOPPPPONL RULSQ RULVMSQ RLQXQWPVQ RQQQ[ RRQR[ RLUXUWTVU", "", "", "", "", "D_SEQEPJ RREPJ RSEPJ RGG]G[FZG RMJKIKT RLJLT RLJWJ RVJWIYJXL RWJWT RXJXT RLMWM RLPWP RLSWS RGV]V[UZV RMXI[G\\ RMXNYLZG\\ RUXWYZ\\[\\[[ZZXYUX", "", "", "", "", "", "", "D_LGMFKFKM RLGLM RGIQIPHOI RGLGT RGLHMHT RHMOM ROMOT RNMOLPMPT RHPOP RHSOS RKSK\\ RLSL\\ RGWQWPVOW RXFWFVIUK RXFWHUKSM RXFYIZK\\M]L RYI[K]L RTP\\P[OZP RWPW\\ RXPX\\ RSU]U\\T[U", "D_IFJGKILILHKGIF RGIHJILJLJKIJGI RNIJOHOJPJRISJTKTLSKRKONI RJSKS RRFPJNM RRFSGNM RWFUJ RWFXGUJ RUJUS RVJVS RPJPS RQJQS RPJ\\JZIYJ RQM[MZLYM RQP[PZOYP RPS\\SZRYS RRVSUQUQ\\ RRVR\\ RGW]W[VZW", "", "", "", "", "", "", "D_RHSGQFQ[ RRGR[ RRP[PYNWP RWPZO RG[][[YY[ RY[\\Z", "", /******** Oriental Hershey Glyphs 800 to 899 ********/ "", "", "", "", "D_RGSFQFQN RRGRN RRJ\\JZIYJ RLNJMJV RKNKV RKNXN RWNXMZNYP RXNXV RYNYV RKUXU RIXHZG[G\\H\\IZIX RMXN\\O\\O[MX RSXT\\U\\U[SX RXXZZ[\\\\\\\\[ZYXX", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGKFKOJUIXHZ RLGLOKTJWHZG[ RLG]G[FZG RLMYM RWMXLZNXO RXMWPVRTUPYM[ RYNWRUURXOZM[J\\ RPMPOQRRTTWVYY[[\\][ RQRSUVXZZ][", "D_LGJFJRIWHZG\\ RKGKSJWIYG\\ RKG]G[EYG RYG\\F RTJUISIS[ RTJT[ RMP[PYNWP RWPZO RK[][[YY[ RY[\\Z", "", "", "", "", "", "", "D_LGJFJUIYG\\ RKGKUJXIZG\\ RKG]G[FZG RTGSK RTGUHSK RQKOJOS RPKPS RPKYK RXKYJ[KZM RYKYS RZKZS RPOYO ROSZS RTSTZS[ RUSUZT\\S[QZ RPVMZ RPVQWMZ RXVZX[Z\\Z\\Y[XXV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IHXH RWHYG[IXK RXHVNTRRUPWMYG[ RYHWM RZHXMVQTTQWNYKZG[ RLKMMOPRTVXYZ[[]Z RLKNNQRUVXXZY]Z", "", "", "", "D_HGQG RNGOFQGOJ ROFNMMRLUJY RPGOMNQMTLVJYH[ RIKLONRPVQVQUPSMOIK RQG\\G RYGZF\\GZJ RZFYMXRWUUY R[GZMYQXTWVUYS[Q\\ RTGTJUPVSWUYX\\[]Z RTJUOVRWTYW]Z", "", "", "", "", "", "", "", "", "D_LJJIJZ RKJKZ RKXYX RKJYJ RXJYI[JZL RYJYZ RZJZZ", "", "", "", "", "", "", "", "", "", "D_RITGRFPKNOLRIV RSGQLOOLSGX RGJ]J[HYJ RYJ\\I RORMQM\\ RNRN\\ RNRYR RXRYQ[RZT RYRY\\ RZRZ\\ RN[Y[", "", "", "", "D_NGLFLM RMGMM RMGWG RVGWFYGXI RWGWM RXGXM RMLWL RGP]P[NYP RYP\\O RMPKW RNPLW RMTXT RWTXSZTXW RXTWXVZT[ RWZV[U[ RYTXYW[V\\U\\T[RZ", "", "", "D_GIGU RGIHJHU RHJLJ RLJLT RKJLIMJMT RHSLS RQGQMPROUNWLZ RRGRMQRPUNXLZI\\ RRMSQUUWX[\\][ RXX[[ RRMSPTRVUZY][ RNGYG RWGUN RVGWFYGXHVN RUN[N RZN[M]N[P R[NYRWUTXQZM\\ R\\NZRXUUXRZP[M\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 900 to 999 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HGHU RHGIHIU RIHLH RLHLT RKHLGMHMT RISLS RVGWFUFU\\ RVGV\\ RPK\\KZJYK ROO]O[NZO RTORROVLY RUPSSPVLYJZ RVOWRXTZW\\Y]X RXT[W]X", "", "", "", "", "", "", "", "", "", "D_NGLFLO RMGMO RMGVG RUGVFXGWI RVGVO RWGWO RMNVN RJSHRH[ RISI[ RISNS RMSNRPSOU RNSN[ ROSO[ RIZNZ RVSTRT[ RUSU[ RUSZS RYSZR\\S[U RZSZ[ R[S[[ RUZZZ", "", "", "", "", "", "", "", "D_LGMFKFKPJQ RLGLPKRIP RGIOINHMI RGMOL RGMHNOL RTHRGRMQQPS RSHSMRPPS RTHYF[G RSHTH[G RSL]L[KZL RWLWR RXLXR RMUKTK\\ RLUL\\ RLUWU RVUWTYUXW RWUW\\ RXUX\\ RL[W[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HGHU RHGIHIU RIHLH RLHLT RKHLGMHMT RISLS RWEUETH RWETH RRHPGPQ RQHQQ RQHYH RXHYG[HZJ RYHYQ RZHZQ RQKYK RQNYN RPQZQ RTQSVRXPZL\\ RTQURTVSXQZO[L\\ RXRYTZTZSXR ROV]V\\U[V RVVWYY[[\\][ RVVWXXYZZ][", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IFIM RIFJGJM RJGOG ROGOM RNGOFPGPM RJLOL RSFSM RSFTGTM RTGYG RYGYM RXGYFZGZM RTLYL RQMOPLSIUGV RQMRNOQMSJUGV RGP]P[OZP RSPVSYU[V]U RTQWSYT]U RJUJ\\ RJUKVK\\ RKVOV ROVO\\ RNVOUPVP\\ RK[O[ RSUS\\ RSUTVT\\ RTVXV RXVX\\ RWVXUYVY\\ RT[X[", "", "", "", "", "", /******** Oriental Hershey Glyphs 1000 to 1099 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JIHHHZ RIIIZ RII[I RZI[H]I\\K R[I[Z R\\I\\Z ROIONNRMT RPIPNOQMTKV RSISSTTXTYSXR RTITRUSWSXRXP RIY[Y", "D_JGHFH\\ RIGI\\ RIG[G RZG[F]G\\I R[G[\\ R\\G\\\\ RRJSIQIQOPSNVLX RRJROQSOVLX RKMYMXLWM RTSVUWWXWXVWUTSRR RI[[[", "", "D_JGHFH[ RIGI[ RIG[G RZG[F]G\\I R[G[[ R\\G\\[ RNKNV RNKOLOV ROLUL RULUV RTLUKVLVV ROUUU RIZ[Z", "", "", "", "", "", "D_JGHFH\\ RIGI\\ RIGZG RYGZF\\G[I RZGZ\\ R[G[\\ RI[Z[ RLKMNNNNMLK RPIQLRLRKPI RVJSPQSNW RVJWKVMTPQTNWLY RLQORRTVXWXWWUURSPRLQ", "", "D_JGHFH\\ RIGI\\ RIGZG RYGZF\\G[I RZGZ\\ R[G[\\ RRJSIQIQQ RRJRQ RLLXLWKVL RMPMX RMPNQNX RNQUQ RUQUX RTQUPVQVX RNWUW RI[Z[", "D_JGHFH\\ RIGI\\ RIG[G RZG[F]G\\I R[G[\\ R\\G\\\\ RKKYKXJWK RQKQW RRKRW RLQXQWPVQ RKWYWXVWW RTSUUVUVTTS RI[[[", "", "", "", "", "", "", "", "D_JFHEH\\ RIFI\\ RIF[F RZF[E]F\\H R[F[\\ R\\F\\\\ RQHPKMQKT RQHRIPMNPKT RLHMKNKNJLH RUHTK RUHVITK RLLXLWKVL RSLTOVRXTYS RTOVQYS RKOYOXNWO RNRSR RSRSU RRRSQTRTU RNTNXOYVYWXVW RNTOUOWPXUXVWVV ROUTU RI[[[", "", "", "", "", "D_RHSGQFQ[ RRGR[ RIP[PYNWP RWPZO RG[][[YY[ RY[\\Z", "D_RGSFQFQR RRGRR RIL[LYJWL RWLZK RGR]R[PYR RYR\\Q RQRL[ RQRRSL[ RI[XZ RI[K\\XZ RVVXXZ\\[\\[[ZYXWVV", "", "", "", "D_RFPFOIMMKPGU RQFOJ RRFPJNMKQGU RGI]I[GYI\\H RLPMOKNK\\ RLOL\\ RUNVMTLT[ RUMU[ RNR\\RZQYR RL[][[YY[\\Z", "D_KGLFJFJW RKGKV RGMOMNLMM RGWNV RGWHXNV RRISHQGQZR[\\[]Z\\X R[Z\\Z\\Y RRHRYSZZZ\\X]V RWHXGVFVW RWGWW RNPZK[K RZK[J]K\\M R[K[RZS R\\K\\R[TZSXR", "", "", "", "", "", "", "", "", "D_KGLFJFJV RKGKU RGLNLMKLL RGVNU RGVHWNU RSFQKOO RSFTGSIOO RRJ[J RZJ[I]J[N R[JZWYYXZ RZXZYYZ R\\J[YZ[Y[XZVY RROXOWNVO RPUXS RPUQVXS", "", "", "", "", "", "", "", "", "", "", "", "D_GGSGRFQG RJGJKIPHR RKGKKJOIQGS RNGNR ROGOR RJLSLRKQL RVGVO RVGWGWO R[F[QZR R[F\\F\\Q[SZRXQ RRSSRQRQ[ RRSR[ RIV[VYUXV RG[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_NFOEMEMQ RNFNQ RVFWEUEUQ RVFVQ RHH\\HZGYH RNKUK RNNUN RGQ]Q[PZQ RMQLSJVGZ RMQNRGZ RUQVSXVZX\\Y]X RVSXU[W]X RRTSSQSQ[ RRTR[ RNWVWUVTW RI[[[YZX[", "", /******** Oriental Hershey Glyphs 1100 to 1199 ********/ "", "", "", "", "", "", "", "", "", "D_KGLFJFJV RKGKU RGLNLMKLL RGVMU RGVHWMU RSGTFRFRK RSGSK RYGZFXFXK RYGYK RNI]I\\H[I RULRPOS RULVMTOOS RULWOYQ\\S]R RWOZQ]R RSSXSWRVS RQUQ\\ RQURVR\\ RRVYV RYVY\\ RXVYUZVZ\\ RR[Y[", "", "", "", "D_KGLFJFJV RKGKU RGLNLMKLL RGVMU RGVHWMU RQFQN RQFRGRN RRGYG RYGYN RXGYFZGZN RRJYJ RRMYM ROP]P\\O[P RQPPTOV RQPRQQSOV RQS\\S R\\S[ZZ[ R[S\\R]S\\Z[\\Z[XZ RTSSVQXOY RUSTVRXOY RXSWVVXTZR[O\\ RYSXVWXUZS[O\\", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJV RKGKU RGLNLMKLL RGVNU RGVHWNU RSFQKON RSFTGRJON RSI\\I[HZI RQLQR RQLRMRR RRMYM RYMYR RXMYLZMZR RRQYQ ROTO[ ROTPUP[ RPU[U R[U[[ RZU[T\\U\\[ RSUS[ RTUT[ RWUW[ RXUX[ RN[][", "", "", "", "", "", "", "", "", "", "D_KGLFJFJU RKGKT RGLNLMKLL RGUNT RGUHVNT RVHVGWFUFUH ROH]H[GZH RRISLTLTKRI RXIWM RXIYJWM RPM\\M[LZM RPOPV RPOQPQV RQPYP RYPYV RXPYOZPZV RQSYS RPVZV RSVRXPZL\\ RTVSXQZO[L\\ RVVV[W\\\\\\][\\Z RWVWZX[[[\\Z]X", "", "D_KGLFJFJV RKGKV RGLNLMKLL RGVNU RGVHWNU RQFRGSITITHSGQF RZFXFWI RZFWI RUJUR RVJVR RQJOIOR RPJPR RPJ[J RZJ[I]J\\L R[J[R R\\J\\R RPN[N ROR\\R RQTQ\\ RQTRUR\\ RRUYU RYUY\\ RXUYTZUZ\\ RRXYX RR[Y[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RHSGQFQ[ RRGR[ RGN]N[LYN RYN\\M RI[[[YYW[ RW[ZZ", "D_QFOFMJKMGR RPFNI RQFOIKNGR ROIXI RWHUKROORKUHW RVIWHXIUMQQMTHW RNJPMSPWS[U]T RWR[T RPMTPXR]T RQTRUSWTWTVSUQT RMYQZT[V\\W\\W[SZMY", "D_KIMGKFJKIOHR RLGKKJNGT RKKQK RPJOONRLVJY ROKPJQKPOORNTLWH[ RJNJQKULWNYPZT[\\[]Z RJQKTLVNXPYTZ]Z RVGTFTQSTRV RUGUQTTQW RUGYG RXGYF[GZI RYGYUZV]V]T]R RZGZT[U\\U]T", "D_RFPFMJJM RRFNJJMGO ROIXI RWHTLRNNQJSGT RVIWHXISNOQKSGT ROIPKRNUQXS[T]S RRNUPYR]S RLTL\\ RLTMUM\\ RMUVU RVUV\\ RUUVTWUW\\ RM[V[", "", "", "", "D_PIRGPFOJMNKQHT RQGPJNNLQHT RPJ[J RYJZI\\KYM RZIXOVSSWOZM[ R[JYPXRVUSXPZM[I\\ ROMPNRQSSTSTRSPQNOM", "D_MFLJKMJOHR RMFNGMKLMJPGS RMKTK RQKRJTKSL RRKQOPROTMWJZG\\ RSLRPQSOVLYI[G\\ RKOMQNSOSORNQKO RXHYGWFW\\ RXGX\\ RTKUNWQYS\\U]T RTKUMXQ[S]T", "D_SFQFNIJL RSFOILKHM RPHXH RWHXGZIXJ RXHTLPOLQ RYIVLSNOPLQHR RNKOLPNQNQMPLNK RUPSPPSMUKVHW RUPSRPTLVHW RSR[R RZR[Q]S[T R[RWVTXPZM[H\\ R\\SYVVXRZN[H\\ RQURVSXTXTWSVQU", "D_QGRFPFOHMKJNGP RQGOJLMIOGP RPHYH RWHXGZIWK RXHVKSOPRLUIW RYIUNQRMUGX RNLOMPOQOQNPMNL RRSPRP\\ RQSQ\\ RQS[S RZS[R]S\\U R[S[\\ R\\S\\\\ RQ[[[", "D_QFQLPQNULXJZG\\ RRGRK RQFSGRNQROVLYI[G\\ RGM]M[KYM RYM\\L RSMTQUTVVXY[\\][ RYY[[ RSMTPVTXWZY][", "D_SGQFQLPQNULXJZG\\ RRGRK RSGRNQROVLYI[G\\ RGM]M[KYM RYM\\L RSMTQUTVVXY[\\][ RYY[[ RSMTPVTXWZY][ RPVQWRZSZSYRWPV", "", "", "", "", "", "", "", "", "", "", "", "", "D_PFOJKV RQGPJ RPFRGQIONLV RGL]L[JYL RYL\\K RVLUPSTQWOYL[H\\ RWLVO RXLVQUSSVPYM[H\\ RNTRUTVWX[[\\[\\Z[YXWVVSUNTLT", "", "", "", "D_LFKKIRHU RLFMGLKJRIU RGKPK RPKOPNSMUKXG\\ ROKPJQKPPOSNULXJZG\\ RLUOXPZQZQYOWLUJT RTITZ RTIUJUZ RUJ[J R[J[Z RZJ[I\\J\\Z RUY[Y", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 1200 to 1299 ********/ "", "", "", "", "", "", "", "", "D_KFHT RKFLFIT RGKNK RNKMPLSJWG[ RMKNJOKNPMSLUJXG[ RKUMXN[O[OZMWKUIS RVFSN RVFWGSN RQN[M RQNRO[M RYK[M\\O]O]N\\MYK RTSRRR[ RSSS[ RSSZS RYSZR\\S[U RZSZ[ R[S[[ RSZZZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JGXG RWGXFZHWI RXGWI RYGWITK RSLTKRKRWQZP[NZ RRYRZQ[ RSLSZR\\Q\\P[ RGQ]Q[OYQ RYQ\\P", "", "", "D_GH]H[FYH\\G ROIRGPFNKKQHV RQGNMLPHV RLPL\\ RMNM\\ RNLZL RYLZK\\MYN RZLYN R[LYNVP RUPUZT[ RUPVPVZU\\T[RZ ROT]T[RYT\\S", "", "", "", "D_KFLGMININHMGKF RPFQGRISISHRGPF RYFWFVI RYFVI RIIHKGLGMHMIKII RIJ[J RZJ[I]KZL R[JZL R\\JZLYM RLNVN RUNVMXOUP RVNUP RWNUPRR RQRQXPZO[ RQYQZP[ RQRRRRZQ\\P\\O[MZ RGT]T[RYT RYT\\S", "", "", "", "", "", "", "", "", "D_RHRGSFQFQH RIHHJGKGLHLIJIG RIH[H RZH[G]IZJ R[HZJ R\\HZJYK RKMYMWKUMXL RQMQXPZO[ RQYQZP[ RRMRZQ\\P\\O[MZ RGS]S[QYS\\R", "D_RHRGSFQFQH RIHHJGKGLHLIJIG RIH[H RZH[G]IZJ R[HZJ R\\HZJYK RKLWL RVLWKYMVN RWLVN RXLVNSP RRQSPQPQXPZO[ RQYQZP[ RRQRZQ\\P\\O[MZ RGT]T[RYT RYT\\S", "", "", "", "", "", "", "", "", "", "D_RHRGSFQFQH RIHHJGKGLHLIJIG RIH[H RZH[G]IZJ R[HZJ R\\HZJYK RRKSJQJQ[ RRKR[ RLOJNJ\\ RKOK\\ RKOXO RWOXNZOYQ RXOX\\ RYOY\\ RKUXU RK[X[", "", "", "", "", "D_RHRGSFQFQH RIHHJGKGLHLIJIG RIH[H RZH[G]I[J R[H[J R\\H[JZK RIMZMXLWM RQMQZ RRMRZ RRSZSXRWS RMOKTIXG[ RMONPLTJWG[ RKULWOZS[\\[]Z RLWOYSZ]Z", "D_RHRGSFQFQH RIGHIGJGKHKIIIG RIH[H RZH[G]I[J R[H[J R\\H[JZK RQJQQPUOWMYJ[G\\ RRJRRQUPWNYK[G\\ RSTUXWZY[\\\\][ RSTUWWYYZ][ RJLZLYKXL RJPZPYOXP RGT]T[SZT", "", "", /******** Oriental Hershey Glyphs 1300 to 1399 ********/ "D_RHRGSFQFQH RIGHIGJGKHKIIIG RIH\\H RZH[G]I[J R[G[J R\\H[JZK RJLZLYKXL RQLOP RQLRMOP RHQXP RHQJRXP RUNWOZR[R[QZPXOUN RRTSSQSQ[ RRTR[ RJVZVYUXV RG[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "D_RHRGSFQFQH RIHHJGKGLHLIJIG RIH[H RZH[G]I[J R[H[J R\\H[JZK RJLZLYKXL RQLONKQ RSLOOKQHR ROOQRRVRXQZP[ RRYRZQ[ ROOQQRSSVSZR\\Q\\P[NZ RQQKU RQRKUHV RRUOWKY RRVPWKYHZ RSMTQUTVVYY[Z]Y RTQUSWVZX]Y RZOVS RZO[PVS", "", "", "", "", "D_RHRGSFQFQH RIGHIGJGKHKIIIG RIH[H RZH[G]I[J R[G[J R\\H[JZK RMLMRNSWSXRWQ RMLNLNQORVRWQWO RIMHOGPGQHQIOIM RPIQLRLRKPI RZN[O\\Q]Q]P\\OZN RVKSNOQKS RVKWLSOPQKSGT RQUQ[ RQURUR[ RIVI\\ RIVJVJ\\ RJ[Y[ RYVY\\ RYVZVZ\\", "", "", "", "", "", "D_RHRGSFQFQH RIGHIGJGKHKIIIG RIH[H RZH[G]I[J R[H[J R\\H[JZK ROKPJNJNR ROKOR RUKVJTJTR RUKUR RJLZLYKXL RJOZOYNXO RGR]R[QZR RNRJWGZ RNROSLVGZ RURVUWWYY\\Z]Y RVUXWZX]Y RQUSWTWTVQU ROYRZU\\V\\V[TZOY", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IEJFKHLHLGKFIE RGLKL RJLKKMLLN RKLKQGTHULQ RLLLQ RLQNTPU\\U]T RLQNSPT]T RRESHTHTGRE RZEXEWH RZEWH ROH]H\\G[H RUHTK RUHVITK RPJPR RPJQKQR RQKZK RZKZR RYKZJ[K[R RQMZM RQOZO RQQZQ RVUV[U\\ RWUW[V]U\\S[ RGX]X[WZX RLYMZN\\O\\O[NZLY", "D_SHTGRFRWQZP[ RRYRZQ[ RSGSZR\\Q\\P[NZ RMLLPJTHW RMLNMMPLRJUHW RVMXOZR[V\\V\\T[RYOVM", "", "", "D_RHSGQFQP RRGRP RJILKMNNNNMMKJI RXITO RXIYJTO RGP]P[NYP RYP\\O ROPORNVLYJ[H\\ RPPPROVMYK[H\\ RSPS[T\\\\\\][\\Y R[[\\[\\Z RTPTZU[Z[\\Y]V", "D_KGLIMLNLNKMIKG RRHSGQFQN RRGRN RXGTM RXGYHTM RINYN RXNYM[NZP RYNY[ RZNZ[ RITYT RIZYZ", "", "", "", "", "D_RGSFQFQJ RRGRJ RKFMININHKF RWFTJ RWFXGTJ RIIHKGLGMHMIKII RIJ[J RZJ[I]K[L R[I[L R\\J[LZM RKLKQ RKLLMLQ RLMWM RWMWQ RVMWLXMXQ RKQXQ RQQQ\\ RRQR\\ RJSJ[ RJSKTK[ RKTXT RXTXYWZ RWTXSYTYYX[WZUY", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGKFKTJXIZ RLGLTKWIZG\\ RLGWG RVGWFYGXI RWGWN RXGXN RLMWM RQNRQSSUVXY[[]Z RRQTTWWZY]Z", "", "", "", "", "", "D_JFJSIXHZ RJFKGKSJWHZG[ RKGZG RZGZK RYGZF[G[K RKK[K RMPTNWMYN RMPYN RRORZS[\\[]Z\\Y RSOSYTZ[Z\\Y]W RMTZRYQXR RLX[VZUYV", "", "", "D_LGJFJTIYH[ RKGKTJXH[G\\ RKGZG RYGZF\\G[I RZGZM R[G[M RKLZL RTNT[ RTNUNU[ ROOOT ROOPOPT RPSYS RYOYT RYOZOZT RNVN\\ RNVOVO\\ RO[Z[ RZVZ\\ RZV[V[\\", "D_LGJFJTIYH[ RKGKTJXH[G\\ RKGZG RYGZF\\G[I RZGZM R[G[M RKLZL RTNUMSLSU RTMTU RKP]P[OZP RPUNTN\\ ROUO\\ ROUYU RXUYT[UZW RYUY\\ RZUZ\\ RO[Y[", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 1400 to 1499 ********/ "", "", "D_IFIVHZG\\ RIFJGJVIYG\\ RJG[G R[G[J RZG[F\\G\\J RJJ\\J RQJRMSMSLQJ RWJUM RWJXKUM RTMTS RUMUS RMLMS RMLNMNS RNM[M R[M[S RZM[L\\M\\S RNP[P RMS\\S ROUO\\ ROUPVP\\ RPVYV RYVY\\ RXVYUZVZ\\ RPYYY RO\\Z\\", "", "", "", "", "D_RHSGQFQY RRGRY RJLKKIJI[ RJKJ[ RJYYY RZL[KYJY[ RZKZ[", "", "", "", "", "", "", "", "", "", "", "D_RERI RRESESI RJFJI RJFKFKI RJI[I RZFZI RZF[F[I RJLJUIYG\\ RJLKMKVJYG\\ RKM\\MZLYM RSOSRRVQXOZK\\ RSOTOTRSVRXPZN[K\\ RTRUUWXZ[\\\\][ RWXZZ][ RPQNTNUOUPQ RZRYQUU RZRUU", "", "", "", "", "", "", "", "", "", "", "", "", "D_QEQI RQERERI RIFII RIFJFJI RYFYI RYFZFZI RIIZI RKLIKIWHZG\\ RJLJWIZG\\ RJLYL RXLYK[LZN RYLYUZY[[\\\\]\\]Z]X R[Z\\[][ RZLZU[Y\\Z]Z RMOTNVO RMOVO RQOQY RRORY RMQMV RMQNRNV RNRUR RURUV RTRUQVRVV RMVVV RLZUY RLZN[UY RTXUYV[W[WZVYTX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KHLGJFJUIYG\\ RKGKVJYG\\ RSITHRGRY RSHSY R[H\\GZFZ\\ R[G[\\", "", "", "", "D_IH[HYFWH RWHZG RQHQZ RRHRZ RGZ]Z[XYZ RYZ\\Y", "", "", "", "D_QISGQFOLMQKUG[ RRGQJOOMSKVG[ RGJ]J[HYJ RYJ\\I RMR[RYPWR RWRZQ RSRS[ RTRT[ RK[][[YY[ RY[\\Z", "", "", "", "D_GIOINHMI RKIKU RLILT RGUOT RGUHVOT RPG]G[FZG RVGUK RVGWHUK RSKQJQW RRKRW RRKZK RYKZJ\\K[M RZKZW R[K[W RROZO RRSZS RQW[W RSXO[M\\ RSXTYRZM\\ RXX\\\\]\\][\\ZXX", "", "", "", "", "", "", "D_JFKGLIMIMHLGJF RQHSGQFOKMOKR RRGPKNNKRHU RWGVFTJ RWGTJ RHJ\\JZIYJ RTKUMWPYR\\T]S RUMXP[R]S RGN]N[MZN RNRUR RURUW RTRUQVRVW RNVUV RMUMZN[Z[[ZZY RMUNVNYOZYZZYZW", "", "D_PFNJKOHS RPFQGMMJQGT RFJ]J[HYJ RYJ\\I RSMTLRLR\\ RSMS\\ RMPKOKZ RLPLZ RLPYP RXPYO[PZR RYPYVXXWY RYWYXXY RZPZXYZXZWYUX", "D_LHMGKFK\\ RLGL\\ RGJGW RGJHKHW RHKOK ROKOUNV RNKOJPKPUOWMU RSFSTRXQZO\\ RSFTGTTSXRZO\\ RTGYG RYGYZZ[][]Y]W RXGYFZGZY[Z\\Z]Y RUNWRXRXQUN", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LHMGKFK\\ RLGL\\ RGJGW RGJHKHW RHKOK ROKOUNV RNKOJPKPUOWMU RRG]G\\F[G RTJTP RTJUKUP RUKZK RZKZP RYKZJ[K[P RUOZO RWSW[ RXSX[ RSRS\\ RSRTST\\ RTS[S R[S[\\ RZS[R\\S\\\\ RTW[W RT[[[", "", "", "", "", "", "", "", "D_IG[GYEWG RWGZF RQGQ] RRGR] RGP]P[NYP RYP\\O", "", "", "", "D_RGSFQFQORTTXW[Y\\\\\\][\\Z RRGROSTUXWZY[[[\\Z]W RKFJJ RKFLGJJ RHIJLKLKKHI RNIJO RNIOJJO RGONO RGOHPNO RNMOPPPPONM RWFVJ RWFXGVJ RTIVLWLWKTI RZIVO RZI[JVO RSOZO RSOTPZO RZM[P\\P\\OZM RVPWRXRXQVP RGS]S[RZS RKSKVJYH\\ RLSLVKYH\\ RLVMWNYOYOXNWLV RXUUXRZN\\ RXUYVXWUYQ[N\\", "", "", "", /******** Oriental Hershey Glyphs 1500 to 1599 ********/ "", "", "", "", "D_SISGTFRFRI RKIIHITHYG[ RJIJTIXG[ RJI]I[GYI RYI\\H RRPSOQNQZR[X[YZXY RRORYSZWZXYXW RNTMVLWLXMXNVNT RTLUMVOWOWNVMTL RZT[U\\W]W]V\\UZT", "", "", "", "D_SHSGTFRFRH RKHIGITHYG[ RJHJTIXG[ RJH]H[GZH RPLNKNX ROLOX RPLYJ[K RNLOL[K RUKUQVUXXZZ\\[]Z\\Y RZY\\Z RVKVQWUYX[Y\\Y]W ROQ]Q[PZQ RKYTV RKYLZTV RO[W[VZU[", "", "", "D_SHSGTFRFRH RIGIUHYG[ RIGJHJUIXG[ RJH]H[GZH ROIOQ ROIPIPQ RUIUQ RUIVIVQ RJL]L[KZL RPPUP RMSYS ROSQVSXVZX[\\\\][ RSXUYXZ][ RXRTVPYM[ RXRYSTWQYM[J\\", "", "", "D_SHSGTFRFRH RIGIUHYG[ RIGJHJUIXG[ RJH]H[GZH RJKPK ROJMR RNKOJPKNR RMRRR RQQPUOWMZ RPRQQRRQUOXMZJ\\ RMTLULW RMTLW RMTNWPZS[\\[]Z RNWPYSZ]Z RSLWKZJ\\K RSL\\K RWKWW RXKXW RSQ]Q\\P[Q RSW]W\\V[W", "D_SHSGTFRFRH RHGHUGYF[ RHGIHIUHXF[ RIH]H[GZH RSKTJRJR[ RSKS[ RNKMNLPJS RNKOLNNLQJS RMPNQOSPSPROQMP RXKWNVPTS RXKYLXNVQTS RXPYQZS[S[RZQXP RKV[VZUYV RI[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_SGTFRFRKSQTTUVWYY[[\\\\\\][\\Z RXYYZ[[\\[ RSGSKTQUTWWYY[Z\\Z]W RVFWGXIYIYHXGVF RGK]K[JZK RGPPPOONP RKPKY RLPLY RGZRW RGZH[RW", "", "", "", "D_IGXG RWGXFZGYI RXGXN RYGYN RKMXM RLMJLIT RKMJT RJSZS RYSZR\\SZU RZSXYWZU[ RXZW[V[ R[SYYX[W\\V\\U[RZ", "", "D_HGPG ROGPFRGQI RPGPM RQGQM RJLPL RIKHR RIKJKIR RIQQQ RPQQPSQQT RQQOYNZL[ ROZN[M[ RRQPYO[N\\M\\L[JZ RZH[GYFY\\ RZGZ\\", "", "", "", "", "D_GGLG RLGLM RKGLFMGMM RGKGS RGKHLHS RHLLL RHRLR RLRKZJ[ RKRLQMRLZK\\J[HZ RPHPUOZN\\ RPHQIQUPYN\\ RQIZF\\G RQI\\G RZGZT[Z\\\\][ RZT[X\\Z][ RUJUZ RUJVJVY RRZXY RRZS[XY RXWY[Z[ZZXW", "D_GGLG RLGLM RKGLFMGMM RGKGS RGKHLHS RHLLL RHRLR RLRKZJ[ RKRLQMRLZK\\J[HZ RVGWFUFUJ RVGVJ RPJ]J[IZJ RUJRQ RUJVKRQ RPPRRSTTTTSSRPP RYOS[ RYOZPS[ RO[[Z RO[Q\\[Z RYX[Z\\\\]\\][\\ZYX", "", "", "D_HGLG RLGLM RKGLFMGMM RILLL RHKHS RHKILIS RIRLR RLRKZJ[ RKRLQMRLZK\\J[HZ RUFSL RUFVGSL ROL[K ROLQM[K RYI[K\\M]M]L\\KYI RULU[ RVLVZ RRPPOPV RQPQV RQPZP RYPZO\\P[R RZPZV R[P[V RQUZU RO[[Z RO[Q\\[Z RYX[Z\\\\]\\][\\ZYX", "", "", "", "D_HGMG RMGMM RLGMFNGNM RILML RHKHS RHKILIS RIRMR RMRLZK[ RLRMQNRMZL\\K[IZ RQFRISISHQF RUFVIWIWHUF R[FXK R[F\\GXK RQKQU RQKRLRU RRL[L R[L[U RZL[K\\L\\U RVLV\\ RWLW\\ RRP[P RRT[T RPX]X[WZX", "", "", "", "", "", "", "D_MHNGLFLTKXJZH\\ RMGMULXKZH\\ RINHPGQGRHRIPIM RQGYG RYGYM RXGYFZGZM RQJYJ RQMZM RQOPQOROSPSQQQO RQP[P RZP[O]Q[R R[P[R R\\P[RZS RUPU\\ RVPV\\ RQTQ[ RQTRUR[ RRUYU RYUYYXZ RXUYTZUZYY[WY", "", "", "", "", "", "", "D_KGKSJWIYG\\ RLGLSKWIZG\\ RPGPZQ[ RQGQ[ RHGUGTFSG RHOUOTNSO R\\FYIVK R\\F]G\\HYJVK R\\MYPVRTS R\\M]N\\OYQWRTS R\\TYWUZ R\\T]U\\VYXUZR[", "", "", "", "", "", "", "", "", "D_LFHJ RLFMGHJ RLKIPGS RLKMLJPGS RJPJ\\ RKOK\\ RRGPFPKONNO RQGQKPNNO RQGVG RUGVFXGWI RVGVMWN\\N]M\\L RWGWLXM[M\\L]J RNQWQ RWQVSTVQYN[ RXQVT RVQWPYQVUSXPZL\\ RPQQSSVUXXZ[[]Z RQSTVWXYY]Z", "", /******** Oriental Hershey Glyphs 1600 to 1699 ********/ "", "", "D_LFHJ RLFMGHJ RLKIPGS RLKMLJPGS RJPJ\\ RKOK\\ ROG[G RZFYHVLRP RYGZF[GXKUNRPOR RRHSKUNWPYQ\\R]Q RUNYP]Q RUSVRTRT[ RUSU[ ROU[UZTYU RM[][[ZZ[", "", "D_LFHJ RLFMGHJ RLKIPGS RLKMLIQGS RJPJ\\ RKOK\\ RVGWFUFUP RVGVP RRJPIPSOWNYL\\ RQJQSPWNZL\\ RQJ[J RZJ[I]K[L R[J[L R\\J[LZN RQPYP RYPXSVVSYP[ RZPYR RXPYO[PZRXUUXRZN\\ RSPTTVXY[[\\][ RYZ[[ RTTVWXYZZ][", "", "", "", "", "", "D_LFHJ RLFMGHJ RLKIPGS RLKMLJPGS RJPJ[ RKOK[ RSFQJ RSFTGQJ ROIPJQLRLRKQJOI RXHSO RXHYISO RNOZN RNOOPZN RYLZM[O\\O\\N[MYL RSQRSOWK[ RSQTRRUOXK[ RTR[R RZQYSWVUXRZO[ RZQ[RYUVXSZO[ RTRUUWXYZ[[]Z RTRUTWWZY]Z", "", "", "D_LFHJ RLFMGHJ RLKIPGS RLKMLJPGS RJPJ\\ RKOK\\ RQFRGSJTJTISGQF RYFWK RYFZGWK ROL]L[KZL RULUZ RVLVZ RVR[RZQYR RPPPUOYN[ RPPQPQUPXN[M\\ RQVRXTZW[\\[]Z RRXTYWZ]Z", "D_LFHJ RLFMGHJ RLKIPGS RLKMLJPGS RJPJ\\ RKOK\\ RVGWFUFUZ RVGVZ RPI\\IZHYI RON]N[MZN RVS[SZRYS RPQPUOYN[ RPQQQQUPXN[M\\ RQVRXTZW[\\[]Z RRXTYWZ]Z", "", "", "", "", "", "", "D_KFGJ RKFLGGJ RKKIOGR RKKLLGR RIPI\\ RJOJ\\ RRGSFQFQ\\ RRGR\\ RUGVIWIWHUG RMLWLVKUL RLWNTOQOONONQMULW RTOUTUVVVVTUQTO RWH]H\\G[H RWN]N\\M[N RZNZZY[ R[N[ZZ\\Y[WZ", "", "", "", "", "", "", "D_KFGJ RKFLGGJ RKKIOGR RKKLLGR RIPI\\ RJOJ\\ ROFMK ROFPGMK ROHUHTGSH RQHQX RRHRX RMMVMULTM RRRURTQSR RNQNY RNQOQOY RLYUW RLYMZUW RWGW\\ RWGXHX\\ RXH[H R[H[WZX RZH[G\\H\\W[YYW", "", "", "D_JFFJ RJFKGFJ RJKHOFR RJKKLFR RHPH\\ RIOI\\ RPFPM RPFQFQM RMHMN RMHNHNN RNMSM RSHSN RSHTHTN RLQUQTPSQ RNQNTMXLZ ROQOTNWLZ RRQRX RSQSX RPYVV RPYQZVV RXFWJUP RXFYGWLUP RWM]M\\L[M R[MZRYUXWVZ R\\M[RZUXXVZS\\ RWMWPXTYWZY\\\\][ RXTYV[Y][", "", "", "", "", "", "", "D_KFGJ RKFLGGJ RKKGR RKKLLGR RIOI\\ RJNJ\\ RNHTFUG RNHUG RQGQZ RRGRZ RMJWJVIUJ RMLMS RMLNMNS RNMUM RUMUS RTMULVMVS RNPUP RMSVS RMVWVVUUV RMZVY RMZN[VY RWG]G\\F[G RWM]M\\L[M RZMZZY[ R[M[ZZ\\Y[WZ", "", "", "D_KFGJ RKFLGGJ RKKIOGR RKKLLGR RIPI\\ RJOJ\\ RQFOFNIMK RQFMK ROHUH RTGQK RTGUHQK RQLQVPYO[ RRLRVQYO[M\\ RMKMS RMKNLNS RNLUL RULUS RTLUKVLVS RNOUO RNRUR RLVWVVUUV RRXSYT[U[UZTYRX RWH]H\\G[H RWN]N\\M[N RZNZZY[ R[N[ZZ\\Y[WZ", "", "", "", "D_OMPLNKNZO[W[XZWX RVZWZWY ROLOYPZUZWXXU RPGRHTJUJUITHPG RSHTI RJPISGVGWHWIVJSJP RITHV RXOZQ[S\\U]U]T\\RZPXO R[R\\T", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RHLGNFOFPGPHNHL RLJMKNMOMOLNKLJ RWGXFVFV[ RWGW[ RSIRLPQOS RSITJRNOS RSL\\L[KZL RRS\\S[RZS RN[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RHLGNFOFPGPHNHL RLJMKNMOMOLNKLJ ROG]G[FZG RSKQJQX RRKRX RRKZK RYKZJ\\K[M RZKZX R[K[X RRQZQ RRWZW RO[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 1700 to 1799 ********/ "", "", "", "", "", "", "", "", "", "", "D_SFTERERJSNUQWSYT\\U]T\\S RXS[T\\T RSFSJTNVQWRZS\\S]Q RVEWGXGXFVE RGI]I[HZI RXLVOSRPT RXLYMVPRSPT RIKIP RIKJLJP RJLNL RNLNP RMLNKOLOP RJONO RGSOR RGSHTOR RMVM[N\\V\\W[VZ RMVNVNZO[U[VZVX RJWIYHZH[I[JYJW RQVRXSXSWQV RYWZX[Z\\Z\\Y[XYW", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGNFLFLT RMGMT RHJQJPIOJ RLJKMJOHR RLMJPHR RONPPQPQOON RTFTT RTFUGUT RUG[G R[G[T RZG[F\\G\\T RUK[K RUO[O RUS[S RMVM[N\\V\\W[VZ RMVNVNZO[U[VZVX RQURXSXSWQU RJWIYHZH[I[JYJW RZW[X\\Z]Z]Y\\XZW", "", "", "D_TFUESESJTNVQYT\\U]T\\S RYS[T\\T RTFTJUNWQXRZS\\S]Q RWEXGYGYFWE RKIIHIOHSGU RJIJOIRGU RJI]I[HZI RZMXPUSRU RZM[NXQTTRU RLLQLPKOL RLNLS RLNMOMS RMOPO RPOPS ROOPNQOQS RLSQS RMVM[N\\V\\W[VZ RMVNVNZO[U[VZVX RJWIYHZH[I[JYJW RQVRXSXSWQV RYWZX[Z\\Z\\Y[XYW", "", "", "", "", "", "", "", "", "", "", "", "D_MFKFJH RMFJH RGHPH RGHHIPH ROFPGQIRIRHQGOF RIJIT RIJJKJT RJKOK ROKOSNT RNKOJPKPSOUNTLS RJNON RJQOQ RUGVFTFTKUL\\L]K\\J RUGUJVK[K\\J]H RUIYGZH RUIZH RUOVNTNTSUT\\T]S\\R RUOURVS[S\\R]P RUQYOZP RUQZP RMWM[N\\W\\X[WZ RMWNWNZO[V[WZWX RJWIXGYGZHZIYJW RQWSYTYTXQW RZW[X\\Z]Z]Y\\XZW", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RHLGNFOFPGPHNHL RLKMLNNONOMNLLK RUGUM RVGVM RQFQM RQFRGRM RRGYG RYGYM RXGYFZGZM ROJ]J\\I[J RQMZM RSPQOQY RRPRY RRPYP RXPYO[PZR RYPYY RZPZY RRSYS RRVYV RQYZY RT[RZO\\M] RT[Q\\M] RXZZ[\\]]]]\\[[XZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RGSFQFQKRQSTTVVYX[Z\\[\\\\[[Z RWYXZZ[[[ RRGRKSQTTVWXYZZ[Z\\W RUFVIWIWHUF RHK\\KZIXK RXK[J RZNXNWQVSTVQYN[ RYNWR RZNXRVUSXPZL\\", "", "", "", "", "D_KKIJITHYG[ RJKJTIXG[ RJK]K[JZK RJONO RNONVMW RMONNOOOVNXMWKV RSGTFRFRKSQTTUVWYY[[\\\\\\][\\Z RXYYZ[[\\[ RSGSKTQUTWWYY[Z\\Z]W RVFWGXIYIYHXGVF RYQ[OYNXQWSUVRYO[ RZOYRWUTXQZM\\", /******** Oriental Hershey Glyphs 1800 to 1899 ********/ "", "", "D_SGTFRFRKSQTTUVWYY[[\\\\\\][\\Z RXYYZ[[\\[ RSGSKTQUTWWYY[Z\\Z]W RVFWGXIYIYHXGVF RGK]K[JZK RIMIU RIMJNJU RJNNN RNNNT RMNNMONOT RJSNS RGZPW RGZH[PW R[NYNXQWSUVRYO[ RZNXR R[NYRWUTXQZM\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_GG]G[EYG RYG\\F RMLKKKSJWIYG\\ RLLLSKWIZG\\ RLLXL RWLXKZLYN RXLXS RYLYS RLRXR", "", "", "", "", "", "D_GG]G[FZG RIIIUHYG[ RIIJJJUIXG[ RJJ[J R[J[N RZJ[I\\J\\N RJN\\N RJQRQ RRQRZQ[ RQQRPSQSZR\\Q[OZ RLSMUNUNTLS RLXQV RLXMYQV RSQ[Q R[Q[ZZ[ RZQ[P\\Q\\Z[\\Z[XZ RUSVUWUWTUS RUXZV RUXVYZV", "", "", "", "D_JIRHVGXFZH RTHYG RJIZH RRHRXQZP[ RRYRZQ[ RSHSZR\\Q\\P[MZ RIN[NYLWN RWNZM RHS]S[QYS RYS\\R", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJZI[ RKGKZJ\\I[GZ RGKOKNJMK RGROP RGRHSOP RTHRGRRQVPXN[ RSHSRRVPYN[L\\ RTHXGZF\\G RSHTH\\G RSP]P[OZP RXPX\\ RYPY\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LGMFKFKZJ[ RLGLZK\\J[HZ RGKPKOJNK RGQOO RGQHROO RQFQV RQFRGRV RRG[G R[G[V RZG[F\\G\\V RVGV\\ RWGW\\ RRN[N RRU[U", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 1900 to 1999 ********/ "", "", "", "D_KGLFJFJZI[ RKGKZJ\\I[GZ RGKOKNJMK RGROP RGRHSOP RVGWFUFUP RVGVP RQK[KZJYK ROP]P[OZP RXPXZW[ RYPYZX\\W[UZ RNT]T[SZT RPVQWRYSYSXRWPV", "D_LGMFKFKZJ[ RLGLZK\\J[HZ RHKOKNJMK RHQOO RHQIROO RRGSFQFQNRO\\O]N\\M RRGRMSN[N\\M]K RRJYGZH RRJZH RQRQ\\ RQRRSR\\ RRSZS RZSZ\\ RYSZR[S[\\ RRWZW RR[Z[", "", "", "", "", "", "", "", "", "", "D_KGLFJFJZI[ RKGKZJ\\I[GZ RGKNKMJLK RGQNO RGQHRNO RNGTG RSFPO RRGSFTGQO RPOTO RTOSSQWOZ RSOTNUOTSSUQXM\\ RORNSNUOR RORPVQXSZV[\\[]Z RORPUQWSYVZ]Z RUIXH[F]G RUI]G RXHXV RYHYV RUO]O\\N[O RUV]V\\U[V", "", "", "", "", "", "D_KGLFJFJYIZ RKGKYJ[IZGY RGKNKMJLK RGQNO RGQHRNO RRGPFPROVNXL[ RQGQRPVNYL[ RQG]G[FZG RQKYKXJWK RQO]O[NZO RTOTY RUOUX RRYYW RRYSZYW RXOXRYVZX\\Z]Y RXRYU[X]Y R\\RZU R\\R]SZU", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJYIZ RKGKYJ[IZGY RGKOKNJMK RGQNO RGQHRNO RQGQRPVOXM[ RQGRHRRQVOYM[ RRHWG[F]G RRH]G RRK[K R[K[O RZK[J\\K\\O RRO\\O RVOVTUWSZ RWOWTVWSZQ[ RXPYRZRZQXP RRT]T\\S[T RWTXWZZ\\[]Z RXWZY]Z", "", "", "", "", "", "", "", "", "D_KGLFJFJZI[ RKGKZJ\\I[GZ RGKNKMJLK RGQNO RGQHRNO RVGWFUFUI RVGVI RPI\\I[HZI RRJSNTNTMRJ RXJWO RXJYKWO RNO]O\\N[O RTPPW RTPUPQW RNS]S[RZS RXSWUUXR[ RXSYTWWUYR[O\\ RSWVXYZ[\\\\\\\\[YYWXSWPW", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJZI[ RKGKZJ\\I[GZ RGKNKMJLK RGRMP RGRHSMP RVGWFUFUI RVGVI ROI]I[HZI RRJSMTMTLRJ RXJWN RXJYKWN RQNOMO\\ RPNP\\ RPN[N RZN[M]N\\P R[N[ZZ[ R\\N\\Z[\\Z[XZ RUNUT RVNVT RRQYQXPWQ RSTSX RTTTX RSTXT RWTWX RXTXX RSXXX", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 2000 to 2099 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RGSFQFQN RRGRN RGI]I[GYI RYI\\H RJNWN RVNWMYOVQ RWNVQTTQWNYJ[ RXOWQUTRWOYMZJ[G\\ RMNMONRPUSXVZX[[\\][ RPUTXVYYZ][", "", "", "", "", "D_LGMFKFKQ RLGLQ RGKQKPJOK RHPHY RHPIQIY RIQNQ RNQNY RMQNPOQOY RIXNX RUFTISKQN RUFVGUISLQN RSK\\K[JZK RYKXOWRUVSY RYKZLYPWTTXRZO\\ RSLSOTSUUWXYZ[[]Z RUUWWZY]Z", "", "", "", "", "", "", "", "D_LGMFKFKM RLGLM RIIOINHMI RGMRMQLPM RQFOJLOIS RQFRGQIOLKQGU RHPPP ROPPORQOR RPPOR RQPORMS RLSLZK[ RLSMSMZL\\K[IZ RIVQU RIVJWQU RVFTKRO RVFWGVIRO RTM]M\\L[M RZMYRXUVXTZQ\\ R[MZRYUWXUZQ\\ RTMUQVTWVYY\\\\][ RVTXWZY][", "", "", "", "D_KGLFJFJN RKGKN ROGPFNFNN ROGON RHIRIQHPI RGNSNRMQN RIPI\\ RIPJQJ\\ RJQOQ ROQOZN[ RNQOPPQPZO\\N[LZ RJTOT RJWOW RWFVITNSP RWFXGVKSP RTN]N\\M[N RZNYRXUWWUZ R[NZRYUWXUZR\\ RUOVTWWXYZ[\\\\][ RVTXXZZ][", "D_MGNFLFLQ RMGMQ RHGJJKJKIHG RPGNJ RPGQHNJ RGKSKRJQK RKKJMHP RLLHP RNMONPPQPQOPNNM RLSIX RLSMSJX RGUSURTQU RPUOWMYJ[H\\ RQUPWNYK[H\\ RKWNYP[Q[QZPYNXKW RUFTKSN RUFVGUJRP RUK]K\\J[K R[KZPYSXUVXTZQ\\ R\\K[PZSYUWXUZQ\\ RTLUQVTWVYY\\\\][ RVTXWZY][", "", "", "", "", "", "", "D_RGSFQFQJ RRGRJ RGJ]J[HYJ RYJ\\I RWLXKVJUNTQSSQVNYK[H\\ RWKVN RWLVOTSRVOYL[H\\G\\ RMJMMNPORQUTXWZ[\\][ RXZ[[ RNPPSSVVXXY][", "", "", "D_MGNFLFLJ RMGMJ RGJSJRIQJ RPKNPKUIX RPKQLOPMSIXGZ RHLLQNTPXQXQWPUMQHL RZG[FYFYXXZW[ RYYYZX[ RZGZZY\\X\\W[UZ RRM]M\\L[M RSPTQUSVSVRUQSP", "", "", "", "", "", "", "D_NFLFJIFN RNFFN RMGOHRKSKSJRIPHMG RIMQMPLOM RLMLZK[ RMMMZL\\K[IZ RGQRQQPPQ RISGX RISJTGX ROTPUQWRWRVQUOT RZG[FYFY\\ RZGZ\\ RTHUIVKWKWJVITH RSNTOUQVQVPUOSN RRV]S\\R[S", "", "", "", "", "", "D_MHMGNFLFLH RGHSHRGQH RIIJMKMKLII ROINM ROIPJNM RGNSNRMQN RLNL\\ RMNM\\ RHRRRQQPR RLQKTJVHY RLTJWHY RNTOUPWQWQVPUNT RUGUSTWRZP\\ RUGVHVSUWSZP\\ RVH[F]G RVH]G RVO]O\\N[O RZOZ\\ R[O[\\", "", "D_RGSFQFQK RRGRK RGK]K[IYK RYK\\J RQKPPOSNULXJZG\\ RQKRLQPPSNWLYI[G\\ RQP\\P RYPZO\\PZS RZPYVXYWZU[ RXZW[V[ R[PZVYYX[W\\V\\U[RZ", "D_LHMGKFKNJUIXG\\ RLGLOKTJWIYG\\ RGKPKOJNK RLOOO ROOOVNZM[ RNOONPOPVOZN\\M[KZ RWFVKUNTP RWFXGWKVMTPRR RXIYL[P\\R]Q RYL[O]Q RVRWSXUYUYTXSVR RUXWYZ\\[\\[[ZZXYUX", "D_LHMGKFKNJUIXG\\ RLGLOKTJWIYG\\ RGKPKOJNK RLOOO ROOOVNZM[ RNOONPOPVOZN\\M[KZ RVFTFRKQM RUFTH RVFTIQM RSK]K[JZK RYKXPWTUX RZKYPXSWUUXSZQ[ RTKTMURVUXXZZ\\[]Z RURVTXWZY]Z", "", "", "", "", "", "", "", "", "", "", "", "", "D_MHKGK\\ RLHL\\ RLZXZ RLHXH RWHXGZHYJ RXHX\\ RYHY\\ RLQXQ", "", "", /******** Oriental Hershey Glyphs 2100 to 2199 ********/ "D_LGJFJR RKGKR RKGXG RWGXFZGYI RXGXR RYGYR RKLXL RKQXQ RQQQ] RRQR] RGV]V[TYV\\U", "", "", "", "", "", "", "D_MGKFKP RLGLP RLGWG RVGWFYGXI RWGWP RXGXP RLKWK RLOWO RNOLRIU RNOOPLSIUGV RLSYS ROSMVKX ROSPTNVKXHY RTSSUPYM[J\\ RTSUTSWQYN[J\\H\\ RXSYR[SYU RYSWYVZT[ RWZV[U[ RZSXYW[V\\U\\T[RZ", "D_OGPFNFNO ROGOO RUGVFTFTO RUGUO RIJ[JYIXJ RGO]O[NZO RMSKRK\\ RLSL\\ RLSWS RVSWRYSXU RWSW\\ RXSX\\ RLWWW RL[W[", "", "D_HFHU RHFIGIU RIGNG RNGNT RMGNFOGOT RIMNM RISNS RTFTSSWRYO\\ RTFUGUSTWRZO\\ RUG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUM[M RUS[S", "", "", "", "", "", "", "", "", "D_HFHX RHFIGIX RIGMG RMGMX RLGMFNGNX RIOMO RIWMW RRFPLON RRFSGRION RQJ]J[HYJ\\I RUJU\\ RVJV\\ RVP]P[NYP\\O RVV]V[TYV\\U", "", "D_MGKFKN RLGLN RLGXG RWGXFZGYI RXGXN RYGYN RLJXJ RLMXM RROR[ RROSOS[ RLPKSJUHX RLPMQLSJVHX RLRZRYQXR RLVZVYUXV RG[][[ZZ[", "D_RFPFOIMNJSGW RQFOJ RRFOLLQIUGW RHH[HYGXH RIKYKXJWK RSLTNVQXS[U]T RYS[T RTNVPYR]T RGN]N[MZN RLRL\\ RLRMSM\\ RMSVS RVSV\\ RUSVRWSW\\ RMWVW RM[V[", "", "", "", "D_HFHW RHFIGIW RIGMG RMGMV RLGMFNGNV RINMN RIUMU RUGVFTFTN RUGUN RPJ[JYIXJ RNN]N[MZN RWNWZV[ RXNXZW\\V[TZ RNR]R[QZR RQTRUSWTWTVSUQT", "", "", "", "", "", "", "", "", "", "", "D_NGLFLP RMGMP RMGWG RVGWFYGXI RWGWP RXGXP RMKWK RMOWO RKSIRI\\ RJSJ\\ RJSOS RNSORQSPU ROSO\\ RPSP\\ RJWOW RJ[O[ RVSTRT\\ RUSU\\ RUSZS RYSZR\\S[U RZSZ\\ R[S[\\ RUWZW RU[Z[", "D_KEKL RKELFLL RLFWF RWFWL RVFWEXFXL RLIWI RKLXL RPLPR RQLQR RIOTOSNRO RGR]R[QZR RXMSQNTJV RXMYNVPQSMUJVGW RLTL\\ RLTMUM\\ RMUWU RWUW\\ RVUWTXUX\\ RMXWX RM[W[", "", "", "D_KEKL RKELFLL RLFWF RWFWL RVFWEXFXL RLIWI RKLXL RHN\\NZMYN RQPQ[ RRPR[ RKPKV RLPLV RKPXP RWPWV RXPXV RLSWS RKVXV RIX[XZWYX RG[][[ZZ[", "", "D_HFHW RHFIGIW RIGMG RMGMV RLGMFNGNV RINMN RIUMU RWFXEVEVN RWFWN RQH\\H[GZH RRK[KZJYK RPN]N\\M[N RRPR\\ RRPSQS\\ RSQZQ RZQZZY[ RYQZP[Q[ZZ\\Y[WZ RSTZT RSWZW", "", "", "D_LELL RLEMFML RMFVF RVFVL RUFVEWFWL RMIVI RLLWL RGO]O[NZO RJOJY RKOKY RGZOX RGZH[OX RPOP\\ RQOQ\\ RKRPR RKUPU RSR\\R R[QZTXWUZR\\ RZR[Q\\R[TYWWYT[R\\ RTSUVWYY[[\\][ RUVWXZZ][", "", "", "", "", "", "", "", "D_HFHX RHFIGIX RIGMG RMGMX RLGMFNGNX RIOMO RIWMW RVIVGWFUFUI RPI\\I[HZI RRJSMTMTLRJ RXIWN RXIYJWN ROO]O[NZO RSSQRQ\\ RRSR\\ RRSYS RXSYR[SZU RYSY\\ RZSZ\\ RRWYW RR[Y[", "", "", "", "", "", "D_KEKJ RKELFLJ RLFWF RWFWJ RVFWEXFXJ RLHWH RKJXJ RKLYLXKWL RQLQR RRLRR RIMHOGPGQHQIOIM RIN[N RZN[M]O[P R[M[P R\\N[PZQ RKPNP RUPXP RKRNR RURXR RITZTYSXT RGW]W[VZW ROWN[ ROWPXN[ RI[XZ RI[K\\XZ RWYXZY\\Z\\Z[YZWY", "", "", "", "D_IFIM RIFJGJM RJGOG ROGOM RNGOFPGPM RJJOJ RIMPM RGPRPQOPP RLPLX RMPMY RMTQTPSOT RISIUHYG[ RISJSJUIXG[ RJVKXMZP[\\[]Z RKXMYPZ]Z RSG]G\\F[G RWGVK RWGXHVK RTJTT RTJUKUT RUKZK RZKZT RYKZJ[K[T RUNZN RUQZQ RTT[T RUURX RUUVVRX RYU\\X]X]WYU", "", "", "", "", "D_OGMFMNLTKWIZG\\ RNGNNMTLWJZG\\ RNGXG RWGXFZGYI RXGXXWZV[ RXYXZW[ RYGYZX\\W\\V[TZ RNMXM RMSXS", "D_RHSGQFQ\\ RRGR\\ RGL]L[JYL RYL\\K RPLMRJVGY RQMOQMTKVGY RSMTPURXV[Y]X RYV[X RSMTOWSZV]X", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLPMQNSOSORNQLP RTHRGRRQVPXN[ RSHSRRVPYN[L\\ RTHXGZF\\G RSHTH\\G RSP]P[OZP RXPX\\ RYPY\\", "", "", "", "", "", /******** Oriental Hershey Glyphs 2200 to 2299 ********/ "", "", "", "", "", "", "", "", "", "", "D_MHNGLFL\\ RMGM\\ RHLQLPKOL RLLKPJRGV RLPJSGV RNPOQPSQSQRPQNP RWHXGVFV\\ RWGW\\ RQL]L[KZL RVLUPSUQX RVPTTRWPY RWMXQYTZV\\Y]X RWMXPZT\\W]X", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLOMPNROROQNPLO RVGWFUFUO RVGVO ROK]K[JZK RPOZO RZOYRWUTXQZ R[OZQ RYOZN\\O[QXUVWSYQZN[ RQPRSTVVXYZ[[]Z RTVWXYY]Z", "D_KGLFJFJ[ RKGK[ RGKOKNJMK RJLIPHSGU RJPIRGU RLOMPNROROQNPLO RTGRMQO RTGUHSLQO RXFYJZL\\O]N RXFYI[L]N RVORZ RVOWPRZ ROZZX ROZP[ZX RZV[X\\[][]Z\\XZV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RGKNKMJLK RJLIPHSGU RJPIRGU RKOLPMRNRNQMPKO ROGOV ROGPHPV RPHTFUG RPHUG RSISVRYP[N\\ RSITITVSYQ[N\\ RNVST RNVOWST RWHW\\ RWHXIX\\ RXI[I R[I[VZW RZI[H\\I\\V[XZWXV", "", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLOMPNROROQNPLO RSFTGUIVIVHUGSF RPK]K[JZK RUKU[ RVKV[ RQS[SZRYS RO[][[ZZ[", "", "", "", "", "D_LHMGKFK\\ RLGL\\ RGLPLOKNL RKNJQISGV RKQITGV RMPNQOSPSPROQMP RSGS\\ RSGTHT\\ RTH[H R[H[\\ RZH[G\\H\\\\ RTN[N RTT[T RTZ[Z", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLPMQNSOSORNQLP RWGXFVFVJ RWGWJ RQJ]J\\I[J RUJSO RUJVKSO RQNROSQTQTPSOQN RYNWQTTQV RYNZOVSSUOW R\\RZUWXTZ R\\R]SYWVYR[O\\ RYX[Z\\\\]\\][\\ZYX", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLOMPNROROQNPLO ROFPGQJRJRIQGOF RTFUGVJWJWIVGTF R\\FZK R\\F]GZK RTMQW RTMUMRW RPQ]Q\\P[Q RYQXTWVUYS[Q\\ RYQZRXVVYT[Q\\P\\ RTVWWZY\\[][]ZZXXWTVRV", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLPMQNSOSORNQLP RQFQY RQFRGRX RRGYG RYGYO RXGYFZGZO RRKYK RROZO RUOVRWTYW\\Z]Y RVRXUZW]Y RNYXW RNYOZXW R[QXT R[Q\\RXT", "", "", "D_JGKFIFI\\ RJGJ\\ RGKMKLJKK RIOHSGU RIRGU RJPKQLSMSMRLQJP RXGYFWFWNXUYXZZ[[\\[]Z\\Y RZY[Z\\Z RXGXNYUZX[Y\\Y]W RZF[H\\H\\GZF RMK]K[JZK R[NZRYUWY R[N\\O[RYVWYU[S\\ ROMOTNXMZ ROMPMPTOWMZL[ RRMRY RRMSMSY RMRVRUQTR", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 2300 to 2399 ********/ "", "D_RGSFQFQP RRGRP RHI\\IZHYI RQIOKLMHO RRJOLKNHO RRITLWNZO\\N RRITKXM\\N RMRNQLQL\\ RMRM\\ RGTQTPSOT RLTIXGZ RMVJXGZ RNVOXPXPWNV RWRXQVQV\\ RWRW\\ RQT]T\\S[T RVTSXQZ RVVTXQZ RWTXVZX\\Y]X RXVZW]X", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RKOLPMRNRNQMPKO RYFWFVL RXFWI RYFVL RQI]I\\H[I RTKTX RTKULUX RUL[L R[L[X RZL[K\\L\\X RUP[P RUT[T RTX\\X RQORNPNP\\ RQOQ\\ RQ[][[ZZ[", "", "D_IGJFHFH\\ RIGI\\ RFLLLKKJL RHOGSFU RHRFU RIPJQKSLSLRKQIP RMG]G[FZG RRGPL RSGQL RQKUK RUKUVTW RTKUJVKVVUXTWRV RNNNT RNNOOOT ROORO RRORS RQORNSOSS ROSSS RVM]M R\\L[QZTYV R[M\\L]M\\Q[SYVXW RXMXNYR[V\\W]V RYR[U]V RM[][[ZZ[", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLOMPNROROQNPLO RWFUFTHRK RWFPM RQH]H[GZH RRK[KZJYK RVKVN RWKWN RQN]N[MZN RRPR\\ RRPSQS\\ RSQZQ RZQZZY[ RYQZP[Q[ZZ\\Y[WZ RSTZT RSWZW", "", "", "", "", "", "", "", "", "", "", "D_QEPH RQERFPH RNGNQ RNGOHOQ ROHTH RTHTQ RSHTGUHUQ ROLTL ROPTP RHGIHJJKJKIJHHG RZGVK RZG[HVK RGOMM RGOHPMM RWNYO[Q\\Q\\PZOWN RRSSRQRQ\\ RRSR\\ RGU]U[TZU RPUMXJZ RQVNXJZG[ RRTUXXZ[[]Z RSVVXYY]Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RKOLPMRNRNQMPKO RTGUFSFSN RTGTN RXGYFWFWN RXGXN RPH\\H[GZH RQK[KZJYK RON]N\\M[N RUNUW RVNVW RPPP\\ RPPQQQ\\ RQQZQ RZQZZY[ RYQZP[Q[ZZ\\Y[WZ RQTZT ROW\\W", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JGKFIFI\\ RJGJ\\ RGLMLLKKL RIOHSGU RIRGU RJPKQLSMSMRLQJP RNG]G[FZG RSGSP RTGTP RWGWP RXGXP ROJOP ROJPKPP RPK[K R[K[P RZK[J\\K\\P ROP\\P RQSZSYRXS RNV]V[UZV RUVU[T\\ RVVV[U]T\\R[ RPXN[ RPXQYN[ RYXZY[[\\[\\Z[YYX", "", "D_KGLFJFJ\\ RKGK\\ RGKOKNJMK RJLIPHSGU RJPIRGU RLOMPNROROQNPLO RUGVFTFTL RUGUL RYGZFXFXL RYGYL RQI]I\\H[I RQL]L\\K[L RQNQX RQNRORX RRO[O R[O[X RZO[N\\O\\X RVLVW RWLWW RRS[S RRW[W RTYQ[O\\ RTYUZS[O\\ RXYZZ\\\\]\\][[ZXY", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JGKFIFI\\ RJGJ\\ RGLMLLKKL RIOHSGU RIRGU RJPKQLSMSMRLQJP RPHTGXFZG RPHZG RTGRKPN RTGUHQMOO ROJ\\J[IZJ RWJXLZO\\P]O RXLZN]O RRMRR RRMSNSR RSNXN RXNXR RWNXMYNYR RSQXQ ROSO\\ ROSPTP\\ RPT[T R[T[ZZ[ RZT[S\\T\\Z[\\Z[XZ RSVSZ RSVTWTZ RTWWW RWWWZ RVWWVXWXZ RSZXZ", "D_IGJFHFH\\ RIGI\\ RFLLLKKJL RHOGSFU RHRFU RIPJQKSLSLRKQIP RUGVFTFTRUWVYX[Z\\\\\\][\\Z RUGURVWWYXZZ[[[\\Z]X ROFNJ ROFPGNJ RMINLOLOKMI RQINO RQIRJNO RLOQO RLOMPQO RQMRPSPSOQM RYFXJ RYFZGXJ RWIXLYLYKWI R[IXO R[I\\JXO RVO[O RVOWP[O R[M\\P]P]O[M RWPXRYRYQWP ROS]S[RZS ROSOUNYM[ RPSPUOXM[ RPUQVRXSXSWRVPU RZUWXTZP\\ RZU[VWYS[P\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 2400 to 2499 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "D_OFMFLIINGQ RNFMH ROFKLGQ RKK[K RYKZJ\\LYM RZJYM R[KYMXN RQKPPOSNULXJZG\\ RRKQPPSOUMXKZG\\ RSKTPUSWWYZ[\\][ RYY[[ RUSWVZY][", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_SHTGRFR[ RSGS[ RMONNLML[ RMNM[ RSP[PYNWP RWPZO RG[][[YY[ RY[\\Z", "D_NGOFMFMX RNGNX RJLKKIKIY RJLJY RNNRNQMPN RGYSW RGYHZSW RUGVFTFTZU[\\[]Z\\X R[Z\\Z\\Y RUGUYVZZZ\\X]U R[KUQ R[K\\LUQ", "", "", "", "", "D_HKHY RHKIKIY RKFKY RKFLFLX RLNNNMMLN RFYOX RFYGZOX ROFOYPZSZSW ROFPFPXQYRYSX RRKPN RRKSLPN RWFVITNSP RWFXGWISP R[FYK R[F\\GYK RULU\\ RVLV\\ RUL]L\\K[L RYLY[ RZLZ[ RVQ]Q\\P[Q RVV]V\\U[V RV[][\\Z[[", "D_MFNELELS RMFMS RGGRGQFPG RHIHM RHIIJIM RIJPJ RPJPM ROJPIQJQM RHMQM RKMIPGR RLNGR RNOOPPRQRQQPPNO RUFTJSL RUFVGUISL RUI]I\\H[I RZIYLXNVQ RZI[JZLXOVQTR RUIVLWNYP\\R]Q RWNZP]Q RHU\\UZTYU RRUR[ RSUS[ RSXYXXWWX RLXL[ RLXMXM[ RG[][[ZZ[", "", "D_GGRGQFPG RLGKLJOIQ RMGLLKNIQGS RLLPL RPLOQNTLWJYG[ ROLPKQLPQOTNVLXIZG[ RJPLRMTNTNSMRJP RUIUU RUIVIVU R[F[YZZ R[F\\F\\Y[[ZZXY", "D_GG]G[EYG RYG\\F RLGKLJOIQ RMGLLKNIQGS RLLPL RPLOQNTLWJYG[ ROLPKQLPQOTNVLXIZG[ RJPLRMTNTNSMRJP RTGTZU[\\[]Z\\X R[Z\\Z\\Y RUGUYVZZZ\\X]U RZMUQ RZM[NUQ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LGJFIY RKGJY RKGXG RWGXFZGYI RXGWXVZU[ RWYWZV[ RYGXZW\\V\\U[SZ RPIQJRLSLSKRJPI RGO]O[NZO ROQPRQTRTRSQROQ RJW]W[VZW", "D_NFLFJJGN RNFKJGN RLH]H[GZH RMLKKJY RLLKY RLLYL RXLYK[LYO RYLXXWZV[ RXYXZW[ RZLYZX\\W\\V[TZ RRLQX RSLRX RGR]R\\Q[R RKX]X\\W[X", "", "", "D_KHLGJFJY RKGKY RKOPOONNO RGZQW RIZLY RGZI[QW RTHUGSFSZT[\\[]Z\\X R[Z\\Z\\Y RTGTYUZZZ\\X]U RTPWNYL[M RXNYM RTP[M", "", "", "D_GINHTGXFZG RGIZG RPHPZQ[\\[]Z\\X R[Z\\Z\\Y RQHQYRZZZ\\X]U RHN[LYKXL RGT]R[QZR", "", "", "", "", "D_LHJGJY RKHKX RLHRGWFYG RKHLHYG RGYSV RGYIZSV RRGRPSUTXW[Z\\\\\\][\\Z RSGSPTUUXWZZ[[[\\Z]W RKO\\OZMXO RXO[N", "", "D_OFMFLHJKGO ROFKKGO RLI\\IZHYI RLLZLXKWL RJOXO RWOXNZOYQ RXOXTYX[[\\\\]\\][\\Y R[Z\\[ RYOYTZX[Y\\Y]V RTQOVKYG[ RTQURRUNXJZG[ RIRLTPWSZTZTYRWMTIR", "", "D_RISGQFQWPZO[MZ RQYQZP[ RRGRZQ\\P\\O[ RHLML RLLMKOLNN RMLMMLQKTJVGZ RNLNNMRLTJWGZ RSGSITNUQVSXV[Y]X RYV[X RSITMVQXTZV]X RZKVP RZK[LVP", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 2500 to 2599 ********/ "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RRGPFPTOXNZ RQGQTPWNZM[ RQGYG RXGYF[GZI RYGYO RZGZO RQNYN RUNUQVUWWYY\\[]Z RUQVTWVYX]Z", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RRFPKOM RRFSGRIOM RRI\\I[HZI RPLZLYKXL ROOXO RWOXNZOYQ RXOXTYX[[\\\\]\\][\\Y R[Z\\[ RYOYTZX[Y\\Y]V", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RUGVFTFTQSURWPYM[ RUGUQTUSWQYM[ ROJYJ RYJYQ RXJYIZJZQ RNQ]Q\\P[Q RUQVUWWYY\\[]Z RUQVTWVYX]Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RVGWFUFUP RVGVP RRJPIPSOWNYL\\ RQJQSPWNZL\\ RQJ[J RZJ[I]K[L R[J[L R\\J[LZN RQPYP RYPXSVVSYP[ RZPYR RXPYO[PZRXUUXRZN\\ RSPTTVXY[[\\][ RTTVWXYZZ][", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RMH]H[FYH\\G RZHZXYZX[ RZYZZY[ R[H[ZZ\\Y\\X[VZ ROLOU ROLPMPU RPMUM RUMUU RTMULVMVU RPTUT", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RVGWFUFUZ RVGVZ RQLOKO[ RPLP[ RPL[L RZL[K]L\\N R[L[[ R\\L\\[ RPS[S RPZ[Z", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RUHVGTFTR RUGUR ROL[LZKYL RNR]R[QZR RTSQZ RTSUTQZ RMZYY RMZO[YY RXWYX[[\\[\\Z[YXW", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RRFPJNM RRFSGNM RQI]I[HZI RRMPLOX RQMPX RQMZM RYMZL\\MZP RZMYZX[ R[MZZY\\X[VZ RUMTW RVMUW RNR]R\\Q[R RPW]W\\V[W", "", "", "", "", "", "", "", "", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ ROGZG RYGZF\\HYI RZGYI R[GYIVK RRITKUMVLTJPH RUMU\\ RVMV\\ RQMOLO\\ RPMP\\ RPM[M RZM[L]M\\O R[M[ZZ[ R\\M\\Z[\\Z[XZ RPQ[Q RPU[U", "", "", "", "", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RNG]G[FZG RSGSNRQPS RTGTNSQPS RWGWQXR[R RXGXPYQ[Q RQLOKO[ RPLP[ RPL[L RZL[K]L\\N R[L[[ R\\L\\[ RPV[V RPZ[Z", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RUIUGVFTFTI RNI]I[HZI RTJRO RTJUKRO ROO[N ROOPP[N RYL[N\\P]P]O\\NYL RPRPVOYM[ RPRQRQVPYM[ RTRT[ RTRURU[ RXRXZY[][]W RXRYRYYZZ\\Z]Y", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RVGWFUFUI RVGVI ROI]I\\H[I RQJOOMS RQJRKQMMS ROPO[ RPNP[ RWIVLTPRS RWIXJWMUPRS RVN\\N R[MZQXUUY R[M\\N[QZSXVUYR[ RVPWQXSYSYRXQVP RTRUUWXZZ\\[]Z RUUWWZY]Z", /******** Oriental Hershey Glyphs 2600 to 2699 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RQFQP RQFRGRP RRGYG RYGYP RXGYFZGZP RUKUP RUKVLVP RVLYL ROOO\\ ROOPPP\\ RPP[P R[P[ZZ[ RZP[O\\P\\Z[\\Z[XZ RSSSX RSSTTTX RTTWT RWTWX RVTWSXTXX RSXXX", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RRGPFPP RQGQP RQGZG RYGZF\\G[I RZGZP R[G[P RQKZK RQOZO RSRS[ RSRTRT[ RWRW[ RWRXRX[ ROUPYQYQXOU R[UYY R[U\\VYY RN[][[ZZ[", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ ROFOV ROFPGPV RPGSG RSGSV RRGSFTGTV RPLSL RPQSQ ROVTV ROWM[ ROWPXM[ RSWT[U[UZSW RWHWU RWHXHXU R[F[YZZ R[F\\F\\Y[[ZZXY", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RRGPFPO RQGQO RQGZG RYGZF\\G[I RZGZO R[G[O RQKZK RPO[O RORO[ RORPSP[ RPS[S R[S[[ RZS[R\\S\\[ RSSS[ RTST[ RWSW[ RXSX[ RN[][", "", "", "D_GFHGIIJIJHIGGF RFLGMHOIOINHMFL RLNHVFVHWHYGZH[I[JZIYIVLN RHZIZ RMJMTLYK[ RMJNKNTMXK[ RNK]K[JZK RXGYFWFWOXUYXZZ\\\\]\\]X RXGXOYUZX[Z][ R[F\\H]H]G[F RPOUOTNSO RPRPX RPRQSQX RQSTS RTSTW RSSTRUSUW RQWUW R\\N[RZTXWVYS[ R\\N]O\\R[TYWWYS[P\\", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RUHUGVFTFTH ROH[HZGYH RQHRLSLSKQH RWHVM RWHXIVM RNM]M[LZM ROOOW ROOPPPW RPPYP RYPYW RXPYOZPZW RPSYS RPVYV RTPTZU[\\[]Z\\Y RUPUYVZ[Z\\Y]W", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RNENRMWLY RNEOFORNVLY ROF]F[EZF RVFUJ RWFUJ RRIRS RRISJSS RSJZJ RZJZS RYJZI[J[S RSNZN RSRZR RVRVYUZ RWRWYV[UZSY RRUOZ RRUSVOZ RZU\\Y]Y]XZU", "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RVHVGWFUFUH RPGOINJNKOKPIPG RPH[H RZH[G]I[J R[H[J R\\H[JZK RRLOO RRLSMOO RXLYMZO[O[NZMXL RUOSRQT RUOVPTRQTOU RVPYS\\U]T RWQZS]T RQUQ\\ RQURVR\\ RRVYV RYVY\\ RXVYUZVZ\\ RR[Y[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 2700 to 2799 ********/ "", "", "D_HFIGJIKIKHJGHF RGLHMIOJOJNIMGL RMNIVGVIWIYHZI[J[KZJYJVMN RIZJZ RRGSFQFQM RRGRM RNJUJTISJ RNLNS RNLOMOS ROMTM RTMTS RSMTLUMUS ROPTP RNSUS RQSQ[ RRSR[ RNVUVTUSV RWFWUVYU[ RWFXGXUWXU[ RXG[G R[G[YZZ RZG[F\\G\\Y[[ZZYY RXM[M RXS[S", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_QFQLPQNULXJZG\\ RRGRK RQFSGRNQROVLYI[G\\ RSGSKTQUTVVXY[\\][ RYY[[ RSKTPVTXWZY][ RLLKOIQIRJRKQLNLL RZLUQ RZL[MUQ", "", "D_MGNFLFLRKVIYG[ RMGMRLVJYG[ RILHNGOGPHPINIK RPJMN RPJQKMN RMTNUPXQXQWPVMT RRH]H[FYH RYH\\G RWHWWVYUZ RWXWYVZ RXHXYW[V[UZSY", "", "", "", "", "D_LGMFKFKSJWIY RLGLSKVIYG[ RILHNGOGPHPINIL ROKMN ROKPLMN RLUMVNXOXOWNVLU RQG]G[FZG RTLRKRSQXPZ RSLSSRWPZN\\ RSLZL RYLZK\\L[N RZLZS R[L[S RSRZR", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KFJJIMGQ RKFLGKJINGQ RKJPJ RPJOMMQJU ROJPIQJPMOOMRJUGW RKLMNNNNMKL RIOJPKRLRLQKPIO RVGWFUFUMTQSSQUOV RVGVNUQTSRUOV RXHYJZJZIXH RPM]M[LZM RVNWQYT\\V]U RWQYS]U RIXHZG[G\\H\\IZIX RMXN\\O\\O[MX RSXT\\U\\U[SX RXXZZ[\\\\\\\\[ZYXX", "", "D_KGLFJFJSIXHZ RKGKSJWHZG[ RHLGNFOFPGPHNHL RNJKN RNJOKKN RLUMVNXOXOWNVLU RVGWFUFUN RVGVN RPI\\I[HZI RON]N\\M[N RQKQS RQKRKRS RYKYS RYKZKZS ROS]S\\R[S RSSSURXQZ RTSTUSXQZO[ RWSWZX[\\[]Z\\Y RXSXYYZ[Z\\Y]W", "D_LFJFIIGM RLFJIGM RLHJGJV RKHKV RKH]H\\G[H ROHOV RPHPV RTHTV RUHUV RYHYV RZHZV RGO]O\\N[O RGV]V\\U[V RIXHZG[G\\H\\IZIX RMXN\\O\\O[MX RSXT\\U\\U[SX RXXZZ[\\\\\\\\[ZYXX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGNFLFLL RMGML RHIQIPHOI RGLRLQKPL RJLJMIOGQ RKLKMJOGQ RNLNOOPRPRN ROLOOQORN RLQLV RLQMQMV RHSQSPROS RGVQV RGVHWQV RVGWFUFUQTTRV RVGVQUTRV RRIYI RYIYUZV]V]T]R RXIYHZIZU\\U]T RTOVQWSXRVPTO RIXHZG[G\\H\\IZIX RMXN\\O\\O[MX RSXT\\U\\U[SX RXXZZ[\\\\\\\\[ZYXX", "", "", /******** Oriental Hershey Glyphs 2800 to 2899 ********/ "", "", "", "", "", "", "", "D_KGLFJFJSIXHZ RKGKSJWHZG[ RHLGNFOFPGPHNHL RMJKM RMJNKKM RKVLYMYMXKV RVGWFUFUQ RVGVQ RPGQHRJSJSIRHPG RZGXJ RZG[HXJ ROK]K\\J[K RTKRMOO RULOO RVKYN[O\\N RWLYM\\N RPQOTNV RPQQRNV RPTTT RSSRVQXO[ RRTSSTTSVQYN\\ ROVPXQXQWOV RYRY\\ RYRZRZ\\ RTT]T\\S[T RVTVX RWTWX RRX]X\\W[X", "D_KGLFJFJSIXHZ RKGKSJWHZG[ RHLGNFOFPGPHNHL RMJKM RMJNKKM RKVLYMYMXKV RQFPKON RQFRGQJNP RQIUI RTHSMQS RSITHUISOQSOV RQKRMSMSLQK RONPQQQQPON RXGYFWFWNVRUTSV RXGXNWRVTSV RZH[J\\J\\IZH RTM]M[LZM RXNYRZT\\V]U RYR[T]U RPXO[O\\P\\PX RSXS\\T\\T[SX RVXW\\X\\X[VX RYX[\\\\\\\\[YX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JGRFXEZF RJGZF RKHLIMKNKNJMIKH RPHQKRKRJPH RVGUK RVGWHUK RIJHLGMGNHNILIJ RIK[K RZK[J]L[M R[K[M R\\K[MZN RMMMQNRVRWQVP RMMNMNPOQUQVPVN RPMROSOSNPM RKNIPIQJQKN RYNZQ[Q[PYN RNSJWGY RNSOTLVGY RMUXU RWTUVQYM[ RWTXUTXPZM[I\\ RMTOWPXSZV[[\\][ RPXRYVZ][", "", "", "D_NGLIHL RNGOHHL RUGXI[L\\L\\KZIXHUG RNMJP RNMKQJP RNMOQQTTWWY[[]Z RNMOPQSSUVWZY]Z RVNVMXNWO RVNUQSTPWMYKZH[ RWNVP RWOVQTTQWNYLZH[", "", "", "", "", "", "", "D_LGMFKFK[ RLGL[ RGIHLILIKGI RGSKQ RGSHTKQ RUGVFTFTMSRRUQWOZ RUGUMTRSUQXOZM[ RXFZH[H[GXF RNL]L[KZL RUMVQWTXVZY\\[]Z RVQXUZX]Z", "", "", "D_KHLGJFJTIYH[ RKGKTJXH[G\\ RSHTGRFRL RSGSL RKL]L[JYL RYL\\K RKRTR RSRTQVRUT RTRT\\ RURU\\", "", "", "", "", "", "D_IG\\GZEXG[F RTGTWSYRZ RTXTYSZ RUGUYT[S[RZPY RMGMO RNGNO RMO[OYMWOZN RSOQRNUKW RTPPTMVIX", "", "", "", "D_RHSGQFQ] RRGR] RKGJJHOGQ RKGLHJLGQ RJLZLXJVL RVLYK RGS]S[QYS RYS\\R", "", "", "", "", "D_LGMFKFK[ RLGL[ RHIGQ RHIIJGQ RHLOLNKML RGUNQ RGUHVNQ RSFPMOO RSFTGSIOO RQL[L R[L[TZYYZ RZL[K\\L\\T[YZ[YZWY RTLSORQPT RULTORRPT RXLWQUUSX RYLXQVUSXPZ", "", "", "D_MGNFLFL\\ RMGM\\ RIHGP RIHJIGP RILQLPKOL RGTQQ RGTHUQQ RWGXFVFVO RWGWO RRJ\\J[IZJ RQO]O[NZO RXOXZW[ RYOYZX\\W[UZ RQS]S[RZS RRUSVTXUXUWTVRU", "", "", "", "", "", "", "", "D_SGQFQLPQNULXJZG\\ RRGRK RSGRNQROVLYI[G\\ RVGWHXJYJYIXHVG RGM]M[KYM RYM\\L RSMTQUTVVXY[\\][ RYY[[ RSMTPVTXWZY][", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 2900 to 2999 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HH\\HZFXH[G RQHQ[ RRHR[ RIQ[QYOWQZP RG[][[YY[\\Z", "D_HH\\HZFXH RXH[G RQHQ[ RRHR[ RIQ[QYOWQ RWQZP RG[][[YY[ RY[\\Z RUTVUWWXWXVWUUT", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_GGPGOFNG RKGKW RLGLV RHNONNMMN RGWPV RGWIXPV RWGXFVEVO RWFWO RRI\\I[HZI RQO]O[NZO RWRXQVPV[ RWQW[ RRU\\U[TZU RQ[][[ZZ[", "", "", "", "D_GGPGOFNG RKGKW RLGLV RHNONNMMN RGWPV RGWHXPV RWGXFVFVZU[ RWGWZV\\U[SZ RZF[H\\H\\GZF RPK]K\\J[K RQNROSQTQTPSOQN RWKXQYUZW\\Z]Y RXQYT[W]Y RPVVT RPVQWVT R[NYR R[N\\OYR", "D_GGPGOFNG RKGKW RLGLV RHNONNMMN RGWPV RGWIXPV RVGV[ RWGW[ RQFQR RQFRGRR RRG[G R[G[R RZG[F\\G\\R RRL[L RRQ[Q RQV\\V[UZV RP[][[ZZ[", "D_GGPGOFNG RKGKV RLGLU RHNONNMMN RGVPU RGVIWPU RTGRFRS RSGSS RSGZG RYGZF\\G[I RZGZS R[G[S RSKZK RSOZO RRS[S RTSSVQYN[ RUSTVRYN[ RWSWZX[\\[]Z\\Y RXSXYYZ[Z\\Y]W", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MIKHKPJUIXG[ RLILPKUJXG[ RMISHWGYFZG RLIMIUHZG RWHWLXRYVZX\\[]Z RXRYU[X]Z RQIQX RRIRX RLYUX RLYMZUX RTUUWVZWZWYVWTU", "", "", "", "D_GH]H[FYH RYH\\G RMHJZ RNHKZ RMMVM RUMVLXMWO RVMVZW[\\[]Z\\Y RWMWYXZ[Z\\Y]V RNQPSQURURTQSNQLP RGZTY RGZH[TY", "", "", "", "", "", "", "", "", "", "", "D_MGNFLFL\\ RMGM\\ RWGXFVFV\\ RWGW\\ RGL]L[JYL RYL\\K RMSVS RM[V[", "", "", "D_SHTGRFR[ RSHS[ RLHKLJOIQGU RLHMILLJPGU RLL[LYJWL RWLZK RKSZSXQVS RVSYR RG[][[YY[ RY[\\Z", "", "D_LGJFJTIYH[ RKGKTJXIZG\\ RKGZG RYGZF\\G[I RZGZXYZX[ RZYZZY[ R[G[ZZ\\Y\\X[VZ RRGR[ RSGS[ RKMZM RKSZS", "D_QIQY RRIRY RKIIHI[ RJIJ[ RJIYI RXIYH[IZK RYIY[ RZIZ[ RJQYQ RJYYY", "", "D_RGRO RSGSO RMGKFKP RLGLP RLGYG RXGYF[GZI RYGYP RZGZP RLKYK RLOYO RSRTQRPRQQUOXMZK[H\\ RSRRUPXNZL[H\\ RGT[T RZT[S]T[V R[TZXYZX[ RZYZZY[ R\\T[ZZ\\Y\\X[VZ", "", "D_QGQO RRGRO RLGJFJP RKGKP RKGXG RWGXFZGYI RXGXP RYGYP RKKXK RKOXO RQOORKUGW RQORPOSLUJVGW RRPVTYV[W]V RRPVSZU]V RNSNVMYK[I\\ RNSOSOVNYL[I\\ RTST\\ RTSUSU\\", "", /******** Oriental Hershey Glyphs 3000 to 3099 ********/ "", "D_QGQQ RRGRQ RLGJFJR RKGKR RKGXG RWGXFZGYI RXGXR RYGYR RKLXL RKQXQ RMUNTLTL[M\\W\\X[WZ RMUMZN[V[WZWX RQTRUSWTWTVSUQT RIVHXGYGZHZIXIV RZV[W\\Y]Y]X\\WZV", "", "", "", "", "", "", "D_KFKP RKFLGLP RLGWG RWGWP RVGWFXGXP RQGQO RRGRO RLKWK RLOWO RNPNW RNPOPOW RTPTW RTPUPUW RISZSYRXS RGW]W[VZW RNYMZJ\\H] RNYOZM[H] RTYVZY\\Z][][\\Z[XZTY", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_THTGUFSFSH RJGJWIZG\\ RJGKHKWJZG\\ RKH]H[GZH RGIHLILIKGI RGSGQJP RGSJP RML]L[KZL RTLTQSTRV RULUQTTRVPW RPPNON\\ ROPO\\ ROPZP RYPZO\\P[R RZPZZY[ R[P[ZZ\\Y[WZ RURVTWWXWXVWTUR", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IFQF RQFPHMLJNGO RQFRGPJNLKNGO RRGTJVLYN[O]N RRGUJXLZM]N RIHJIKKLKLJKIIH RWFUI RWFXGUI RZIXL RZI[JXL RLOWOVNUO ROOORNVMXKZI[ RPOPROVNXLZI[ RSOSZT[\\[]Z\\Y RTOTYUZ[Z\\Y]W RGT\\TZSYT", "", "", "D_TFRFQJ RSFRH RTFQJ RLJJIJ\\ RKJK\\ RKJYJ RXJYI[JZL RYJY\\ RZJZ\\ RKRYR RKZYZ", "", "D_KFJJ RKFLGJJ RHIH\\ RHIIJI\\ RIJNJ RNJN[ RMJNIOJO[ RIRNR RIZNZ RUFSKRM RUFVGUIRM RTJ[J RZJ[I]J\\L R[J[XZZY[ R[Y[ZZ[ R\\J\\Z[\\Z\\Y[WZ RTPUQVSWSWRVQTP", "", "", /******** Oriental Hershey Glyphs 3100 to 3199 ********/ "", "", "", "", "", "", "", "", "", "D_RGSFQFQP RRGRP RKJIIIUHYG[ RJJJUIXG[ RJJ[J RYJZI\\KYL RZIYL R[JYLXM RJPWP RVPWOYQVS RWPTUQXM[ RXQVTRXOZM[J\\ RNQOSQVTYW[[\\][ RQVUYXZ][", "", "", "", "D_LHJGJZ RKHKZ RKHYH RXHYG[HZJ RYHYZ RZHZZ ROHOZ RPHPZ RTHTZ RUHUZ RHZ]Z\\Y[Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MHKGK\\ RLHL\\ RLHXH RWHXGZHYJ RXHX\\ RYHY\\ RLNXN RLTXT RLZXZ", "D_NGLFLT RMGMT RMGVG RUGVFXGWI RVGVT RWGWT RMKVK RMOVO RMSVS RGV]V[UZV RMYJ[G\\ RMYNZK[G\\ RUYWZZ\\[\\[[YZUY", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JGWG RVGWFYHVI RWGVI RXGVISL RMJOKRNSNSMRLPKMJ RGN[N RZN[M]OZP R[NZP R\\NZPXR RRNRXQZP[ RRYRZQ[ RSNSZR\\Q\\P[NZ RQNORLVJXGZ RQNROQQOTLWIYGZ", "", "", "", "D_OFMFKJIM RNFLI ROFLJIM RLJ[JYHWJ RWJZI RQJQOPSNWLYI[G\\ RRJROQSOWMYJ[G\\ RGP]P[NYP RYP\\O RSPTTVXXZ[\\][ RYZ[[ RSPTSVVYY][", "D_JFIJHMGO RJFKGJJILGO RJJQJPIOJ RLJLSKWIZG\\ RMJMSLWJZG\\ RGPRPQOPP RNUOWPZQZQYPWNU RTITZ RTIUJUZ RUJ[J R[J[Z RZJ[I\\J\\Z RUY[Y", "", "", "D_IFHJGMFO RIFJGIJHLFO RHKPKOJNK RKKKRJVIXG[ RLKLRKVIYG[ RGQPQOPNQ RLUNWOYPYPXNVLU RQG]G[FZG RRKRS RRKSLSS RSLZL RZLZS RYLZK[L[S RSRZR RSTTYUYUXST RZTX[ RZT[UX[ RQ[][\\Z[[", "", "", "", "D_GH]H[FYH RYH\\G RQHOMMQKTGY RRHPL RSHQLNQKUGY RPQNPN\\ ROQO\\ ROQYQ RXQYP[QZS RYQY\\ RZQZ\\ ROZYZ", "", "", "", "D_GGOGNFMG RJGINHR RKGJMIPGT RINIZ RINJOJZ RJOMO RMOMY RLOMNNONY RJXMX RSGSRRVQXO[ RTGTRSVQYO[M\\ RWGW\\ RXGX\\ RPG]G[FZG RPQ]Q[PZQ", "", "", "", "", "", "", "", "", "", "", "D_FGNGMFLG RIGHNGR RJGIMHPFT RHNHZ RHNIOIZ RIOLO RLOLY RKOLNMOMY RIXLX RUGVFTFTI RUGUI RNI]I[HZI RTJRO RTJUKRO ROO[N ROOPP[N RYL[N\\P]P]O\\NYL RPRPVOYN[ RPRQRQVPYN[ RTRT[ RTRURU[ RXRXZY[][]W RXRYRYYZZ\\Z]Y", "D_GGOGNFMG RJGINHR RKGJMIPGT RIOI[ RIOJPJ[ RJPMP RMPMZ RLPMONPNZ RJYMY RWGXFVFVN RWGWN RRHSKTKTJRH R[HYK R[H\\IYK RRMR\\ RRMSNS\\ RSNZN RZNZZY[ RYNZM[N[ZZ\\Y[WZ RSRZR RSVZV", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 3200 to 3299 ********/ "D_FGMGLFKG RHGGNFR RIGHLFR RGNGZ RGNHOHZ RHOKO RKOKY RJOKNLOLY RHXKX ROFOTNYM[ ROFPGPTOXM[ RPGSG RSGSYRZ RRGSFTGTYS[QY RPMSM RPSSS RWFWTVYU[ RWFXGXTWXU[ RXG[G R[G[YZZ RZG[F\\G\\Y[[YY RXM[M RXS[S", "", "", "", "", "", "", "", "", "D_GGOGNFMG RJGINHR RKGJMIPGT RIOI[ RIOJPJ[ RJPMP RMPMZ RLPMONPNZ RJYMY RRFSJTJTIRF RYFWK RYFZGWK ROK]K\\J[K RSKQR RSKTLQR ROQPRQTRTRSQROQ RUPQZ RUPVQQZ RPZUZ RPZQ[UZ RTXU[V[VZTX RZKXR RZK[LXR RVQWRXTYTYSXRVQ R\\PXZ R\\P]QXZ RWZ\\Z RWZX[\\Z R[X\\[][]Z[X", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JHYHWFUH RUHXG RGN]N[LYN RYN\\M RQNQXPZO[ RQYQZP[ RRNRZQ\\P\\O[MZ RLQIWGZ RLQMRLTGZ RVRXTZW[Y\\Y\\X[VYTVR", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HHLGOFPG RHHPG RLGL\\ RMGM\\ RGLRLQKPL RLMKPITGW RLPJSGW RNQORPTQTQSPRNQ RUIUU RUIVIVU R[F[YZZ R[F\\F\\Y[[ZZXY", "D_HHLGOFPG RHHPG RLGL\\ RMGM\\ RGLRLQKPL RLMKPITGW RLPJSGW RNQORPTQTQSPRNQ RXFVFSY RWFVK RXFSY RPYZW RPYRZZW RXTZV\\Y]Y]X[VXT", "", "", "D_HHLGOFPG RHHPG RLGL\\ RMGM\\ RGLRLQKPL RLMKPITGW RLPJSGW RNQORPTQTQSPRNQ RTITZ RTIUJUZ RUJ[J R[J[Z RZJ[I\\J\\Z RUY[Y", "", "", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RWGXFVFVQUR RWGWQVSURSQ RRKPO RRKSLPO RZK[L\\N]N]M\\LZK R[RXVUYR[ R[R\\SWXTZR[O\\", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RRHSITKUKUJTIRH RQNROSQTQTPSOQN RYGZFXFX\\ RYGY\\ RPV]T\\S[T", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RVHWGUFUNTSSVQYN\\ RVGVPUTTVRYN\\ RVNWRXUZY\\\\][ RWRYV[Y][ RRMQOPPPQQQRORM R[LWQ R[L\\MWQ", "", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RRG\\G[FZG RVGV\\ RWGW\\ RSJRMQO RSJTKQO RYJZL[O\\O\\N[LYJ RQR]R[QZR", "", "", "", "", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RSFQKOO RSFTGSIOO RQL]L[KZL RVLVZU[ RWLWZV\\U[SZ RSQRTPX RSQTRPX RYQ[T\\W]W]V[SYQ", "", "", "", "", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RRFRN RRFSGSN RSGZG RZGZN RYGZF[G[N RSMZM RQQ]Q[PZQ RVQV[ RWQW[ RQV\\V[UZV RP[][[ZZ[", "", "", "", "", "", "", "", "", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RPIUH[F]G RPIXH]G RQKRNSNSMQK RVKWNXNXMVK R\\J[N R\\J]K[N RQPQ\\ RQPRPR\\ RUPU\\ RUPVQV\\ RVQ[Q R[Q[\\ RZQ[P\\Q\\\\ RVV[V RV[[[", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RRIVHZF[G RRI[G RVHV[ RWHW[ RQK]K\\J[K RQMQT RQMRNRT RRN[N R[N[T RZN[M\\N\\T RRQ[Q RQT\\T RQW\\W[VZW RP[][\\Z[[", "", "", "", "", /******** Oriental Hershey Glyphs 3300 to 3399 ********/ "", "", "", "", "", "", "D_GHMFNG RGHNG RJGJ\\ RKGK\\ RGLOLNKML RJOIRGV RJRGV RLQMRNTOTOSNRLQ RVGWFUFUN RVGVN RPH]H[GZH RQK[KZJYK RPN]N[MZN RQPQZ RQPRQRZ RRQYQ RYQYZ RXQYPZQZZ RRTYT RRWYW RQZZZ RT[SZN] RT[N] RXZ[\\\\]]]]\\[[XZ", "", "", "", "", "", "", "D_RIRGSFQFQI RIHHJGKGLHLIJIH RII\\I RZI[H]JZK R[HZK R\\IZKYL RMPLTKVIY RNQLU RMPOQNSKWG[ RTNTPUTVVXY[[]Z RXX[Z RTPUSWVYX]Z", "D_RHRGSFQFQH RIGHIGJGKHKIIIG RIH\\H RZH[G]IZJ R[GZJ R\\HZJYK RNHNJMMKOIP ROHOJNMLOIPGP RTHTNUO\\O]N\\M RUHUMVN[N\\M]K RPQQPOPOSNWMYK[I\\ RPQPSOWNYL[I\\G\\ RISTS RSSTRVSUU RTSTZU[\\[]Z\\Y RUSUYVZ[Z\\Y]W", "", "", "D_RHRGSFQFQH RIGHIGJGKHKIIIG RIH\\H RZH[G]IZJ R[GZJ R\\HZJYK RNHNJMMKOIP ROHOJNMLOIPGP RTHTNUO\\O]N\\M RUHUMVN[N\\M]K RHT\\TZRXT RXT[S RQTQ[ RRTR[ RG[][[YY[ RY[\\Z", "", "", "", "", "", "", "", "D_RGRFSEQEQG RIFHHGIGJHJIHIF RIG\\G RZG[F]HZI R[FZI R\\GZIYJ RNGMJLL RNGOHNJLLJMHM RTGTLUM\\M]L\\K RUGUKVL[L\\K\\J RGP]P[OZP ROPNT RPPOR RQPNT RITYT RITKUYT RVRXSZU[U[TYSVR RQTQ[ RRTR[ RIX[XZWYX RG[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RGSFQFQL RRGRL RHL\\LZJXL RXL[K RKOLRMXNWNUMRKO RWNTZ RWNXPTZ RG[][[YY[ RY[\\Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KFJJIMGR RLGKI RKFMGKKGR RJLRLPJNL RNLQK RLLL\\ RMLM\\ RUFTJSMQR RVGUI RUFWGUKQR RTL]L[JYL RYL\\K RWLWXVZU[ RWYWZV[ RXLXZW\\V\\U[SZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LEJEIGGJ RLEGJ RJGQGPFOG RLGMJNJNILG RWEUETGRJ RWERJ RUG]G[FZG RWGXJYJYIWG RQLQ\\ RRLR\\ RILYL RYLYQ RXLYKZLZQ RIOHU RIOJPIU RJPYP RITZT RYTZS\\TZV RZTYYXZ R[TZYY[XZVY RPTMWIZ RQUNWIZG[", "", "", "", "", "", "", "", "", "", "", "D_LEJEIGGJ RLEGJ RJGQGPFOG RLGMJNJNILG RWEUETGRJ RWERJ RUG]G[FZG RWGXJYJYIWG RRLSKQKQQ RRLRQ RJNZNYMXN RGQ]Q[PZQ RUQUZT[ RVQVZU\\T[RZ RHT\\TZSYT RLVMWNYOYOXNWLV", "D_LEJEIGGJ RLEGJ RJGQGPFOG RLGMJNJNILG RWEUETGRJ RWERJ RUG]G[FZG RWGXJYJYIWG RRLSKQKQ\\ RRLR\\ RJMXM RXMXS RWMXLYMYS RGP]P[OZP RJSYS RIVZVYUXV RGY]Y[XZY", "", "", /******** Oriental Hershey Glyphs 3400 to 3499 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LEJEIGGJ RLEGJ RJGQGPFOG RLGMJNJNILG RWEUETGRJ RWERJ RUG]G[FZG RWGXJYJYIWG RKKKU RKKLLLU RLLXL RXLXU RWLXKYLYU RLOXO RLRXR RKUYU ROUOWNZL\\J] RPUPWOZM\\J] RTUT] RUUU] RGX]X[WZX", "D_LEJEIGGJ RLEGJ RJGQGPFOG RLGMJNJNILG RWEUETGRJ RWERJ RUG]G[FZG RWGXJYJYIWG RRLRKSJQJQL RIKHMGNGOHOIMIK RIL\\L RZL[K]MZN R[KZN R\\LZNYO RKOK\\ RKOLPL\\ RLPVP RVPVT RUPVOWPWT RLTWT RLWXW RXWX\\ RWWXVYWY\\ RL[X[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LEJEIGGJ RLEGJ RJGQGPFOG RLGMJNJNILG RWEUETGRJ RWERJ RUG]G[FZG RWGXJYJYIWG RHMQMPLOM RMMMLLLLM RIMJPKPKOIM RNMMP RNMONMP RGPRPQOPP RIRI\\ RIRJSJ\\ RJSOS ROSOZN[ RNSORPSPZO\\N[LZ RJUOU RJWOW RTLTO RTLULUO RUM]M\\L[M RTO[O RZOZR R[O[R RUR[R RTQT[U\\]\\]Z]X RTQURUZV[\\[]Z RUT[TZSYT RUV[VZUYV RUX[XZWYX", "", "", "D_RHSGQFQ\\ RRGR\\ RJILKMMNMNLMKJI RXHTO RXHYITO RGO]O[MYO RYO\\N RQOPRNULWHZ RQROUMWJYHZ RSPTSVVXX[Z]Y RTSWVZX]Y", "", "", "", "", "", "", "D_LGMFKFK\\ RLGL\\ RGHHLILIKGH ROHML ROHPIML RFNQNPMON RKOISGV RKQGV RMQNROTPTPSORMQ RYGZFXFX\\ RYGY\\ RSHTIUKVKVJUISH RRNSOTQUQUPTORN RQV]T\\S[T", "", "", "D_LGMFKFK\\ RLGL\\ RGHHLILIKGH ROHML ROHPIML RFNQNPMON RKOISGV RKQGV RMQNROTPTPSORMQ RWGXFVFVL RWGWL RRL\\L[KZL RSNTVTYUYUWTRSN RZNXY RZN[OXY RP[][\\Z[[", "D_LGMFKFK\\ RLGL\\ RGHHLILIKGH ROHML ROHPIML RFNQNPMON RKOISGV RKQGV RMQNROTPTPSORMQ RWGXFVFVS RWGWS RWL\\L[KZL RRRR\\ RRRSSS\\ RSSZS RZSZ\\ RYSZR[S[\\ RS[Z[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_QFNK RQFRGNK RKILJNMOMOLNKKI RVIQP RVIWJQP RHQZP RHQJRZP RYMZO[R\\R\\Q[OYM RQQQ\\ RRQR\\ RMTJXHZ RMTNULWHZ RUTWVYYZYZXYWUT", "", "", "", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RSGSTRXQZ RTGTTSXQZO[ RTKUQVTWVYY\\[]Z RWVYX]Z ROGYG RYGWO RXGYFZGXO RXN]N R\\M[QZTYVWY R[N\\M]N\\R[TYWWYT[R\\", "", "", "", /******** Oriental Hershey Glyphs 3500 to 3599 ********/ "", "", "", "", "", "", "", "", "", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RWGXFVFVZW[\\[]Z\\Y RWGWYXZ[Z\\Y]W RQJWI[H]I RQJ]I RRMRU RRMSMSU RSTZT RZMZU RZM[M[U", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RSGSY RSGTHTY RTHXG[F]G RTH]G RPYYX RPYQZYX RXGXPYVZY[[\\\\]\\][\\Y R[Z\\[ RYGYPZV[Y\\Y]V RTO]O\\N[O", "D_RFSEQEQM RRFRM RHG\\GZFYG RJJYJXIWJ RGM]M[LZM RQNOQ RQNROOQ RLPMQNSOSORNQLP RVORU RVOWPRU RHUZU RHUJVZU RYSZT[V\\V\\U[TYS RQUQ] RRUR] RLXJZG\\ RLXMYG\\ RVXYZ[\\\\\\\\[[ZYYVX", "", "", "", "", "", "", "", "", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RSFS[ RSFTGT[ RTGYG RYGY[ RXGYFZGZ[ RTMYM RTTYT RP[][\\Z[[", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RWFUFTISKQN RWFQN RTI\\I R[HZJXMUQ RZI[H\\IYMUQRS RTIUKWNZQ\\R]Q RWNZP]Q RVSWTXVYVYUXTVS RSXWZZ\\[\\[[YZSX", "D_JFHK RJFKGHK RGJHMIMILGJ RLJIQ RLJMKIQ RFQMQ RFQGRMQ RMONROROQMO RJQJ\\ RKQK\\ RHTGX RHTIUGX RKTLUMWNWNVMUKT RQGQ\\ RQGRHR\\ RRH[H R[H[\\ RZH[G\\H\\\\ RVHVZ RWHWZ RRQ[Q RRZ[Z", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RSGZG RZGYJXLUP RYGZF[GZJXMUPRR RTHUKWNZP\\Q]P RUKWMZO]P RWSXRVRV[ RWSW[ RSV[VZUYV RQ[][\\Z[[", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RVFUITKRN RVFWGVITLQO RWGXJZM\\O]N RWGXIZL]N RTOYOXNWO RQT]T\\S[T RVTT[ RVTWUT[ RP[[Z RP[R\\[Z RZW[Y\\\\]\\][\\YZW", "", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RVFTFSIRKPN RVFPN RTHZH RYGWK RXHYGZHWK RVLVR RWLWR RRKRZS[\\[]Z\\Y RRKSLSYTZ[Z\\Y]W RSLZL RZLZS RYLZK[L[S RSRZR", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RWGXFVFVQ RWGWQ RQK]K\\J[K RRQ\\Q[PZQ RRTR\\ RRTSUS\\ RSUZU RZUZ\\ RYUZT[U[\\ RS[Z[", "", "", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RTFTK RTFUGUK RUGZG RZGZK RYGZF[G[K RTK[K RSMS\\ RSMTNT\\ RTN[N R[N[ZZ[ RZN[M\\N\\Z[\\Z[XZ RTR[R RTV[V", "D_JFHK RJFKGHK RGJHMIMILGJ RLJIQ RLJMKIQ RFQMQ RFQGRMQ RMONROROQMO RJQJ\\ RKQK\\ RHTGX RHTIUGX RKTLUMWNWNVMUKT RWGXFVFVM RWGWM RQI]I\\H[I RRM\\M[LZM RROQQPRPSQSRQRO RRP[P RZP[O]Q[R R[P[R R\\P[RZS RTSTUSXRZ RTSUSUUTXRZP[ RXSXZY[\\[]Z\\Y RXSYSYYZZ[Z\\Y]W", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JFHK RJFKGHK RGJHMIMILGJ RLJIQ RLJMKIQ RFQMQ RFQGRMQ RMONROROQMO RJQJ\\ RKQK\\ RHTGX RHTIUGX RKTLUMWNWNVMUKT RSFQJOM RSFTGOM RXFYIZK\\M]L RYI[K]L RUKSQ RUKVLSQ RQQZP RQQRRZP RYNZO[Q\\Q\\P[OYN RRURZS[Y[ZZYY RRUSUSYTZXZYYYW RPXNZN[O[PX RUSVVWVWUUS R[V\\Y]Y]X[V", "", "", "", "", "", "", "", "", "", "", "", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RVFUFUL RVFUL RRIYI RYIYL RXIYHZIYL RQL]L\\K[L RSNSR RSNTOTR RTOZO RZOZR RYOZN[O[R RSR[R RWSW\\ RWSXSX\\ RSTSX RSTTUTX RTU\\U[TZU RPX]X[WZX", "D_KFIK RKFLGIK RGJHKIMJMJLIKGJ RNJJQ RNJOKJQ RGQNQ RGQHRNQ RNOORPRPQNO RKQK\\ RLQL\\ RITGX RITJUGX RMTNUOWPWPVOUMT RWFVFUH RWFUH RRGRP RRGSHSP RSHZH RZHZP RYHZG[H[P RSLZL RRP[P RVPVZU[ RWPWZV\\U[SZ RQTUT RTSSVRX RTSUTTVRXPY RWPXTZW\\Y]X RWPXSYU[W]X R\\RYU R\\R]SYU", "D_JFHK RJFKGHK RGJHMIMILGJ RLJIQ RLJMKIQ RFQMQ RFQGRMQ RMONROROQMO RJQJ\\ RKQK\\ RHTGX RHTIUGX RKTLUMWNWNVMUKT RWHWGXFVFVH RPH]H\\G[H RSITLULUKSI RYIXM RYIZJXM RRLQNPOPPQPRNRL RRM[M RZM[L]N[O R[M[O R\\M[OZP RWPXOVOV\\ RWPW\\ RQRQ[ RQRRSR[ RRS[S R[S[ZZ[ RZS[R\\S\\Z[\\Z[XZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_JFHK RJFKGHK RGJHMIMILGJ RLJIQ RLJMKIQ RGQLQ RGQHRLQ RLPMRNRNQLP RJQJ\\ RKQK\\ RHUGY RHUIVGY RLUMXNXNWLU RRFOL RRFSGOL RUFVJWJWIUF RZFYK RZF[GYK RSKQPOT RSKTLQQOT RQQQ\\ RROR\\ RTL]L\\K[L RXLXZ RYLY[ RUQUVTZS\\ RUQVQVVUYS\\ RYS]S\\R[S RVVWYX[Z\\\\\\][ RWYXZZ[][", "", "", /******** Oriental Hershey Glyphs 3600 to 3699 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HEHI RHEIFII RIFZF RZFZI RYFZE[F[I RNFNI ROFOI RTFTI RUFUI RHI[I RQIPO RRIQL RSIPO RGL]L[KZL RMNMY RMNNONY RNOWO RWOWY RVOWNXOXY RNRWR RNUWU RNXWX RHOH\\ RHOIOI\\ RI[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", "D_LFMGNJOJOINGLF RWFUFTK RVFUH RWFTK RQKQ] RRKR] RGK]K[IYK RYK\\J RIP[PYNWP RWPZO RGV]V[TYV RYV\\U", "", "D_MENHOHOGME RUETH RUEVFTH RGH]H[GZH RQHQP RRHRP RJLZLYKXL RGP]P[OZP RQQPUOWMYJ[G\\ RQQRRQUPWNYK[G\\ RGT]T[SZT RSTUXWZY[\\\\][ RSTUWWYYZ][", "", "", "", "D_MFNIOIOHMF RUFTI RUFVGTI RQIQQ RRIRQ RGI]I[HZI RJMZMYLXM RGQ]Q[PZQ RNQMTLVJYH[ ROQNTMVKYH[ RSUS[ RTUT[ RNUZUYTXU RL[][[ZZ[", "", "", "D_LFMGNIOIOHNGLF RWFUFTI RWFTI RHI\\IZHYI RQIQO RRIRO RILYLXKWL RGO]O[NZO RNOLSJVGZ RNOOPMSJWGZ RORMQM\\ RNRN\\ RNRWR RVRWQYRXT RWRW\\ RXRX\\ RNUWU RNXWX RN[W[", "", "", "", "", "", "", "", "D_GGOG RNGOFQGPI ROGOXNZM[ ROYOZN[ RPGPZO\\N\\M[KZ RHKILJNKNKMJLHK RGTNQ RGTHUNQ RQG[G RZG[F]G\\I R[G[XZZY[ R[Y[ZZ[ R\\G\\Z[\\Z\\Y[WZ RTKULVNWNWMVLTK RRTZQ RRTSUZQ", "", "", "D_GGOG ROGOM RNGOFPGPM RLGJIGK RNGGK RMJIMGN RMJNKGN RSG[G R[G[M RZG[F\\G\\M RZGVISK RZGSK RYJUMSN RYJZKSN RRQRPSOQOQQ RGQ]Q[PZQ RMQKTIV ROQMSIV RMSNTOVPVPUOTMS RWQUTSV RYQWSSV RWSXTYVZVZUYTWS RRXSWQWQ\\ RRXR\\ RGY]Y[XZY", "", "", "", "D_GFOF ROFOK RNFOEPFPK RIGLILHIG RGJNJ RGJHKNJ RSF[F R[F[K RZF[E\\F\\K RUGXIXHUG RSJZJ RSJTKZJ RQMQS RRMRS RKLKS RKLLMLS RLMWM RWMWS RVMWLXMXS RLPWP RKSXS RNSNY ROSOY RTSTY RUSUY RIV[VZUYV RGY]Y[XZY RO[MZJ\\H] RO[L\\H] RUZW[Z][][\\Y[UZ", "", "", "D_QGRFPFPN RQGQN RIIVIUHTI RGN]N[MZN RYGWJTNPRLUIW RYGZHVMRQNTIWGX RPSQROQOZP[\\[]Z\\X R[Z\\Z\\Y RPRPYQZZZ\\X]U RPVSUWSYRZS RPVUUXTZS", "D_PGQFOFOM RPGPM RJIUITHSI RGM]M[LZM RWGUJRNNRJUGW RWGXHTMORLTGW RPRNQMW RORNW RPRXPYQ RORPRYQ RNUXU RWUXTZUXW RXUWYVZT[ RWZV[U[ RYUXYW[V\\U\\T[RZ", "D_QGRFPFPM RQGQM RIIUITHSI RGM]M[LZM RXGUKRNNQIT RXGYHTMPPMRITGU ROQMPM\\ RNQN\\ RNQXQ RWQXPZQYS RXQX\\ RYQY\\ RNVXV RN[X[", "", "", "", "", "", "", "", "", "", "", "", "D_HH\\HZFXH RXH[G RLHLW RMHMW RWHW\\ RXHX\\ RMMWM RMRWR RGX]V[TYV RYV\\U", "", "D_GGTGRFQG RJGJX RKGKW RPGP\\ RQGQ\\ RKLPL RKQPQ RGXPV RGXHYPV RQJ\\J R[IZNYQWVUY RZJ[I\\J[NZQXUUYR\\ RTKUPVSWUYX\\[]Z RUPWTYW]Z", /******** Oriental Hershey Glyphs 3700 to 3799 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RFSEQEQS RRFRS RJGWG RVGWFYGXI RWGWM RXGXM RGJ]J[IZJ RJMXM RJPYPXOWP RGS]S[RZS RMVKUK\\ RLVL\\ RLVWV RVVWUYVXX RWVW\\ RXVX\\ RLYWY RK\\X\\", "", "", "", "", "D_JIHHH\\ RIII\\ RIIZI RYIZH\\I[K RZIZXYZX[ RZYZZY[ R[I[ZZ\\Y\\X[VZ RRGSFQFPJNNLQ RRGQJPLNOLQJR RQKSLVNWOXOXNWMULQK RRPSOQOPROTLX RRPQROULXJY RQSSTVVWWXWXVWUUTQS", "", "", "D_RFPFOIMMKPHT RQFOJ RRFQHNMKQHT RGI]I[GYI RYI\\H RMNM\\ RNMN\\ RNMXM RWMXLZMYO RXMXWWZV[ RXYXZW[ RYMYZX\\W\\V[TZ RNQXQ RNUXU", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IFIUHYG[ RIFJGJUIXG[ RJGMG RMGMYLZ RLGMFNGNYM[KY RJMMM RJSMS RTFRFQKPN RTFPN RSHZH RYHZG\\H[J RZHZUYV R[H[UZWYVWU RQMVM RVMVS RUMVLWMWS RQQQZR[\\[]Z\\Y RQQRRRYSZ[Z\\Y]W RRRVR", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJU RKGKU RPGQFOFOU RPGPU RGISIRHQI RKMOM RKQOQ RGUSURTQU RJWIYG\\ RJWKXG\\ ROWPXQZRZRYQXOW RUFUTTYS[ RUFVGVTUXTZR\\ RVG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RVM[M RVS[S", "", "", "D_MGNFLFLL RMGML RGIRIQHPI RHKHS RHKILIS RILPL RPLPS ROLPKQLQS RIOPO RIRPR RLRL\\ RMRM\\ RGVRVQUPV RUFUSTWRZP\\ RUFVGVSUWSZP\\ RVG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RVL[L RVQ[Q", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 3800 to 3899 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGIFI\\ RJGJ\\ RJG\\GZEXG RXG[F RQGQM RRGRM RJMYM RXMYL[MZO RYMYU RZMZU RJTYT RQTQ[ RRTR[ RJ[][[YY[ RY[\\Z", "", "", "", "D_REPEOH RREOH RLHJGJ\\ RKHK\\ RKHYH RXHYG[HZJ RYHY\\ RZHZ\\ RKNYN RKTYT RKZYZ", "", "", "", "D_GG]G[EYG RYG\\F RQGMO RQGRHMO RIOXN RIOKPXN RULXNZP[P[OZNXMUL RRQSPQOQ[ RRPR[ RIU[UYSWU RWUZT RG[][[YY[ RY[\\Z", "", "", "", "", "", "", "", "", "", "D_HIOHTGWFYH RQHXG RHIYH RQHQS RRHRS RGM]M[KYM RYM\\L RMSKRK\\ RLSL\\ RLSWS RVSWRYSXU RWSW\\ RXSX\\ RL[W[", "D_GILHOGQFSG RGINHSG RMHMS RNHNS RGMTMSLRM RIRI[ RIRJSJ[ RJSQS RQSQ[ RPSQRRSR[ RJZQZ RWHXGVFVZW[\\[]Z\\X R[Z\\Z\\Y RWGWYXZZZ\\X]U", "", "", "", "D_GHKGNFPG RGHPG RKGKS RLGLS RGMPMOLNM RHRH[ RHRISI[ RISNS RNSN[ RMSNROSO[ RIZNZ RWGXFVFVJ RWGWJ RRJ\\J[IZJ RSKTOUOUNSK RYKXO RYKZLXO RQP]P\\O[P RVPV\\ RWPW\\ RRU\\U[TZU", "", "", "D_RFPFOI RRFOI RMIKHKSJWIYG\\ RLILSKWIZG\\ RLIWI RVIWHYIXK RWIWXVZU[ RWYWZV[ RXIXZW\\V\\U[SZ RPKQLRNSNSMRLPK RGP]P[NYP RYP\\O RPRQSRUSUSTRSPR", "", "D_MFLI RMFNGLI RIHIUHYG[ RIHJIJUIXG[ RJIPI RPIPZO[ ROIPHQIQZP\\O[MZ RLKMNNNNMLK RGQSO RGQHRSO RLSMVNVNULS RUFUJTMSO RUFVGVJUMSO RVGYG RYGYMZN]N]J RXGYFZGZL[M\\M]L RSQZQ RZQYTXVUZ RYQZP[QZTXWUZR\\ RTRUUWXZZ\\[]Z RUUWWZY]Z", "", "", "", "", "", "", "", "D_MFLI RMFNGLI RIHIVHZG\\ RIHJIJVIYG\\ RJIPI RPIPZO[ ROIPHQIQZP\\O[MZ RLKMNNNNMLK RGQSO RGQHRSO RLSMVNVNULS RVGUKTNSP RVGWHVKUMSP RYGZK[N\\P]O RZK\\N]O RTRT\\ RTRUSU\\ RUS[S R[S[\\ RZS[R\\S\\\\ RU[[[", "", "", "", "", "", "", "", "", "", "", "", "D_RGRFSEQEQG RMGKFKZ RLGLZ RLGWG RVGWFYGXI RWGWR RXGXR RLLWL RLQWQ RPQQTSWUYX[[\\][ RPQQSSVTWWYYZ][ RG[SX RG[H\\SX RXSTW RXSYTTW", "", "", "", "D_OFMFKJIM ROFKKGO RMIUI RTIUHWJTK RUITK RVITKRM RRMRR RSMSR RMMKLKZL[\\[]Z\\X R[Z\\Z\\Y RLMLYMZZZ\\X]U RLMYM RXMYL[MZO RYMYS RZMZS RLRYR", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 3900 to 3999 ********/ "", "", "", "", "", "", "", "", "", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RNLLPJSGW RNLOMMPJTGW RLQL[ RMPM[ RUNVMTLTZU[\\[]Z\\X R[Z\\Z\\Y RUMUYVZZZ\\X]U RZOUS RZO[PUS", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_OFPENENJ ROFOJ RUFVETETJ RUFUJ RGG]G[FZG RQKOOLSGX RQKRLQNNRKUGX RGO]O[NZO RLSL\\ RLSMTM\\ RMTWT RWTW\\ RVTWSXTX\\ RM[W[", "", "", "", "", "", "", "", "", "", "", "", "", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RLKJJJT RKKKT RKKXK RWKXJZKYM RXKXT RYKYT RKOXO RKSXS RQSQ\\ RRSR\\ RGW]W[VZW", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RQJPLNOKR RQJRKPNNPKRGT RRKTNVPYR\\S]R RTNWPYQ]R RRRSQQQQ\\ RRRR\\ RLTXTWSVT RMVLXJZ RMVNWMXJZH[ RUVWWZZ[Z[YZXXWUV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RKJJMHRGT RKJLKKMGT RJOJ\\ RKMK\\ RML]L[KZL RYLYZX[ RZLZZY\\X[VZ ROOOW ROOPPPW RPPTP RTPTW RSPTOUPUW RPVTV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RMJIOGQ RMJNKLMGQ RMLZL RYLZK\\L[N RZLZ[Y\\ R[L[[Z]Y\\W[ RROSNQNQ[ RROR[ RLOMPNROROQNPLO RVOTS RVOWPTS RJTXTWSVT RPTKXHZ RQUNWHZ RTVUWVYWYWXVWTV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4000 to 4099 ********/ "", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RQJQP RQJRJRP RROWO RWJWP RWJXJXP RHL\\L[KZL RKKKS RKKLKLS RLR[RZQYR RQRQ\\ RRRR\\ RGU]U[TZU RPUMXJZ RQVNXJZG[ RRUUXXZ[[]Z RSVVXYY]Z", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RJKYK RVKWJYKVL RWJVL RVLSN RROSNQNQSPT RRORSQUPTNS RSNUQXT[V]U RUQXSZT]U RGONO RMNLPJSGV RLOMNNOLRJTGV RZNVQ RZN[OVQ RJWXWWVVW RIYG[G\\H\\IY RMYN\\O\\O[MY RSYT\\U\\U[SY RYYZZ[\\\\\\\\[[ZYY", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_OFPENENI ROFOI RUFVETETI RUFUI RGG]G[FZG RQIPL RQIRJPL RNKNS RNKOLOS ROLTL RTLTS RSLTKULUS ROOTO RORTR RHKILJNKNKMJLHK RZKVO RZK[LVO RGQMO RGQHRMO RWOYP[R\\R\\QZPWO RQRQ\\ RRRR\\ RGU]U[TZU RPUNWKYG[ RQVNXJZG[ RSUUXXZ[[]Z RSUUWYY]Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4100 to 4199 ********/ "", "", "", "", "", "", "", "", "", "D_RFSEQEQPRQ\\Q]P\\O RRFROSP[P\\O\\N RRGZGYFXG RIIIUHYG[ RIIJJJUIXG[ RJJ\\J RZJ[I]K[L R[I[L R\\J[LZM RJNXMWLVM RMVNYOYOXMV RRUSTQTQ[ RRUR[ RVUWTUTU[ RVUV[ RZVWZ RZV[WWZ RK[][\\Z[[", "", "", "", "", "", "D_RGSFQFQZ RRGRZ RLKJJJT RKKKT RKKXK RWKXJZKYM RXKXT RYKYT RKSXS RG[YY RG[I\\YY RWVYX\\\\]\\][[YWV", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4200 to 4299 ********/ "", "", "", "", "", "D_SEQEOI RSEOI RLIJHJZ RKIKZ RKIYI RXIYH[IZK RYIYZ RZIZZ ROIOZ RPIPZ RTITZ RUIUZ RGZ]Z\\Y[Z", "", "", "", "", "", "", "", "D_MFKHGK RMFNGGK RMKKNGS RMKNLGS RKOK\\ RLNL\\ ROG[GYEWG RWGZF ROM]M[KYM RYM\\L RXMXXWZV[ RXYXZW[ RYMYZX\\W\\V[TZ", "D_RGSFQFQK RRGRK RHK\\KZIXK RXK[J RQKPMNPKTGX RQKRLPOMSKUGX RNQNZ ROPOY RJ[UW RJ[K\\UW RSLTPUSVUXX[[]Z RYX[Z RTPURWUZX]Z RZOVT RZO[PVT", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGNFLFLO RMGMO RGGHHIJJJJIIHGG RGMKL RGMHNKL RVGWFUFUN RVGVN ROJ]J[IZJ RPN[NZMYN RRRRQSPQPQR RGR]R[QZR RPRNTJWGY RRRNUKWGY RRRSUUXWZ[\\][ RSUVXYZ][ RMVMZ RNUNZ RJ[TX RJ[K\\TX RYTVW RYTZUVW", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KGLFJFJJ RKGKJ RGJNJ RMILKJNGR RLJMINJKNGR RJOJ\\ RKNK\\ RNOKR RNOOPKR RLRMSNUOUOTNSLR RUFSFQJ RUFQJ RSH]H[GZH RRJRQ RRJSKSQ RSKZK RZKZQ RYKZJ[K[Q RSNZN RRQ[Q RTRPX RTRUSPX RTT[T RZSYUWXUZS[P\\ RYTZS[TYWWYT[P\\ RTTUWWZY[\\\\][ RUWWYYZ][", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_GG]G[EYG RYG\\F ROGOPNTMV RPGPPOSMVKX RSGSTTUWUXTWS RTGTSUTVTWSWQ RJMHLH\\ RIMI\\ RIMZM RYMZL\\M[O RZMZ\\ R[M[\\ RIZZZ", "D_GG]G[EYG RYG\\F ROGOO RPGPO RTGTO RUGUO RJJJO RJJKKKO RKKYK RYKYO RXKYJZKZO RJOZO RGS]S[QYS RYS\\R RQOLV RQORPMVLV RVSTVQYN[K\\ RVSWTRYO[K\\I\\ RMVQWVYY[Z\\[\\[[ZZVXRWMV", "", "", "", "", "", "", "", "", "", "D_MGKFKT RLGLT RLGWG RVGWFYGXI RWGWT RXGXT RLKWK RLOWO RLSWS RNSMWLYJ[H\\ ROSNWMYK[H\\G\\ RSSS[T\\\\\\][\\Y R[[\\[\\Z RTSTZU[Z[\\Y]V", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4300 to 4399 ********/ "", "D_OFMFKJIM ROFKKGO RMHUH RTHUGWITJ RUHTJ RVHTJRL RMLKKKUJYI[ RLLLVKYI[G\\ RLLYL RXLYK[LZN RYLYXXZW[ RYYYZX[ RZLZZY\\X\\W[UZ RRLRV RSLSV RLQYQ RLVYV", "", "", "", "", "D_JEHKGM RJEKFJHGM RJHOH RNGMK RMHNGOHMK RIJITHYG[ RIJJKJTIXG[ RJKQK RQKQZP[ RPKQJRKRZQ\\P[NZ RMKMS RNKNS RJOQO RJSQS RRG\\G R\\G[KZL R[G\\F]G\\K[MYK RWGVKUM RXGWJUM RXNX\\ RXNYNY\\ RUOTT RUOVPTT RUQ\\Q[PZQ RUV]V\\U[V", "", "", "D_KGYGWFVG RHJ\\JZIYJ RKMYMWLVM RKPYPWOVP RMTKSK\\ RLTL\\ RLTWT RVTWSYTXV RWTW\\ RXTX\\ RL[W[", "", "", "D_HGPGOFNG RGJQJPIOJ RHMPMOLNM RHPPPOONP RHSH\\ RHSITI\\ RITOT ROTO\\ RNTOSPTP\\ RI[O[ RXHYGWFW\\ RXGX\\ RSN]N\\M[N", "", "", "", "", "", "D_HGNGMFLG RGJOJNIMJ RHMNMMLLM RHPNPMOLP RHSH[ RHSITI[ RITMT RMTM[ RLTMSNTN[ RIZMZ RRHZH RYHZG\\H[J RZHZP R[H[P RTORNRZS[\\[]Z\\Y RSOSYTZ[Z\\Y]W RSOZO", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HGMGLFKG RGJNJMILJ RHMMMLLKM RHPMPLOKP RHSH\\ RHSITI\\ RITLT RLTL[ RKTLSMTM[ RIZLZ ROG]G[EYG RYG\\F RVGV[ RWGW[ RSPTORNR[ RSOS[ RWP\\PZNXP RXP[O RO[][[YY[ RY[\\Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HGNGMFLG RGJOJNIMJ RHMNMMLLM RHPNPMOLP RHSH[ RHSITI[ RITMT RMTM[ RLTMSNTN[ RIZMZ RQIUHXGZF\\G RQIWH\\G RVHVS RWHWS RQM]M[LZM RRRR[ RRRSSS[ RSSZS RZSZ[ RYSZR[S[[ RSZZZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HGNGMFLG RGJOJNIMJ RHMNMMLLM RHPNPMOLP RHSH[ RHSITI[ RITMT RMTM[ RLTMSNTN[ RIZMZ RPG]G[FZG RUGSP RVGTP RQKXK RXKWP RWKXJYKXP RPP]P[OZP RTTRSR[ RSTS[ RSTYT RXTYS[TZV RYTY[ RZTZ[ RSZYZ", "D_HGNGMFLG RGJOJNIMJ RHMNMMLLM RHPNPMOLP RHSH[ RHSITI[ RITLT RLTL[ RKTLSMTM[ RIZLZ RVGWFUFUM RVGVM RPI]I[HZI RQM[MYLXM RQOPQOROSPSQQQO RQP[P RZP[O]Q[R R[P[R R\\P[RZS RSSSURYQ[ RSSTSTUSXRZP\\ RWSW[X\\\\\\][\\Z RWSXSXZY[[[\\Z]Y", "", "", "", "", "", "", "", "", "D_HGNGMFLG RGJOJNIMJ RHMNMMLLM RHPNPMOLP RHSH\\ RHSITI[ RITMT RMTM\\ RLTMSNTN\\ RI[M[ RTFSIQN RTFUGQN RYFWL RYFZGWL RRLR\\ RSLS\\ RRL]L[KZL RWLW[ RXLX[ RSQ\\Q[PZQ RSV\\V[UZV RS[][[ZZ[", "", "", "", "", "", "", "D_GGLGKFJG RFJMJLIKJ RGMLMKLJM RGPLPKOJP RGSG\\ RGSHTH\\ RHTKT RKTK[ RJTKSLTL[ RHZKZ RUFSJPM RUFVGTJRLNN RVHXKZM\\N]M RVHXJ[L]M RSNXNWMVN ROPO\\ ROPPQP\\ RPQ[Q R[Q[ZZ[ RZQ[P\\Q\\Z[\\YZ RSQS[ RTQT[ RWQW[ RXQX[ RPU[U", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4400 to 4499 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_NGLFKHIKGM RMGKI RNGKJGM RUFWGYIZK[K\\J[IXGUF RZI[J RQJPLMPJRGS RQJRKPNNPKRGS RRKTNVPYR[S]R RRKUNXPZQ]R ROUMTM\\ RNUN\\ RNUVU RUUVTXUWW RVUV\\ RWUW\\ RN[V[", "", "", "", "", "", "", "D_IG[GYEWG RWGZF RMLKKKS RLLLS RLLWL RVLWKYLXN RWLWS RXLXS RLRWR RLTMVNYOYOXNVLT RWTTZ RWTXUTZ RG[][[YY[ RY[\\Z", "", "", "", "", "", "", "D_PENELHJJ RPENGJJGL RNGVG RUFTHRK RTGUFVGRK RRKRO RSKSO RKJKO RKJLKLO RLKYK RYKYO RXKYJZKZO RKOZO RQONQLR RSOOQLRHS RPQRTSWS[R]Q\\O[ RPQQSRWR[Q\\ RQSNULV RQTLVHW RRWLZ RRXLZH[ RSOTSVWXY[[]Z RTSVVXXZY]Z RZQVU RZQ[RVU", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGKFKW RLGLW RLGXG RWGXFZGYI RXGXW RYGYW RLLXL RLQXQ RLVXV RNXI[G\\ RNXOYMZG\\ RUXYZ\\\\]\\][\\ZYYUX", "", "D_PFNFLIHN RPFHN RNHVH RUHVGXIUJ RVHUJ RWHUJSL RNLLKLY RMLMY RMLYL RXLYK[LZN RYLYY RZLZY RMPYP RMTYT RMXYX RP[NZK\\H] RP[M\\H] RVZX[[]\\]\\\\Z[VZ", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4500 to 4599 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IFIKHMGN RIFJGJKIMGN RJGPFQG RJGQG RJJRJQIPJ RMJMN RNJNN RTFTKSMRN RTFUGUKTMRN RUG[F\\G RUG\\G RUJ]J\\I[J RXJXN RYJYN RKOKY RKOLPLY RLPXP RXPXY RWPXOYPYY RLSXS RLVXV RKYYY ROZH] ROZP[H] RUZ[]\\]\\\\Y[UZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RGSFQFQO RRGRO RIJ[JYHWJ RWJZI RGO]O[MYO RYO\\N RNONRMVLXJZG\\ ROOORNVMXKZG\\ RTOTXSZR[ RTZS[ RUOUZT\\S\\R[PZ RIRHUFX RIRJSHVFX RWRYS[V\\X]X]W\\UZSWR", "", "", "", "", "D_RGSFQFQZ RRGRZ RHJ[JYHWJ RWJZI RGO]O[MYO RYO\\N RRTZTXRVT RVTYS RLRKUIYG\\ RLRMSLUJXG\\ RKULWOZS[\\[]Z RLWOYSZ]Z", "", "", "", "D_MGNFLFLX RMGMY RIIQIPHOI RGNRNQMPN RMSQSPROS RIQIUHYG[ RIQJQJUIXG[ RJVKXMZP[\\[]Z RKXMYPZ]Z RRG\\G R\\G[LZM R[G\\F]G\\L[NYL RVGULTN RWGVKUMSO RSPSX RSPTQTX RTQ[Q R[Q[X RZQ[P\\Q\\X RTW[W", "", "", "D_NGLFLO RMGMO RMGXG RWGXFZGYI RXGXO RYGYO RMNXN RRNR[ RSNS[ RST\\TZRXT RXT[S RLRKUIYG\\ RLRMSLUJXG\\ RKULWOZS[\\[]Z RLWOYSZ]Z", "", "D_HFHN RHFIGIN RIGNG RNGNN RMGNFOGON RIMNM RKMKY RLMLY RHQHY RHQIQIY RLRPROQNR RGYPX RGYHZPX RRFR[ RRFSGS[ RSG]G[FZG RSLZL RZLZU RYLZK[L[U RSTZT RSZ]Z[YZZ", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFHN RHFIGIN RIGNG RNGNN RMGNFOGON RIMNM RKMKY RLMLY RHQHY RHQIQIY RLRPROQNR RGYPX RGYHZPX RWFUFTISKQN RWFQN RTI\\I R[HZJXMUQ RZI[H\\IYMUQRS RTIUKWNZQ\\R]Q RWNZP]Q RSSS\\ RSSTTT\\ RTTZT RZTZ\\ RYTZS[T[\\ RT[Z[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4600 to 4699 ********/ "", "D_SFQFPH RSFPH ROHMGMU RNHNT RNHXH RWHXGZHYJ RXHXXWZV[ RXYXZW[ RYHYZX\\W\\V[TZ RNLXL RNPXP RHUXS RHUIVXS R\\OXSSWNZ R\\O]P[RWUTWNZK[G\\", "", "D_NFLFKI RNFKI RIHIR RIHJIJR RJIPI RPIPZO[ ROIPHQIQZP\\O[MZ RJLPL RJOPO RGRPR RGRHSPR RPQMUJX RPSNUJXGZ RZG[FYFYXXZW[ RYYYZX[ RZGZZY\\X\\W[UZ RQL]L\\K[L RSOTPURVRVQUPSO", "", "", "", "", "D_RGSFQFQ\\ RRGR\\ RHI\\IZGXI RXI[H RLLJKJU RKLKU RKLXL RWLXKZLYN RXLXU RYLYU RKPXP RKTXT RGX]X[VYX RYX\\W", "", "D_MGNFLFL\\ RMGM\\ RGIRIQHPI RHLHT RHLIMIT RIMPM RPMPT ROMPLQMQT RIPPP RISPS RGWRWQVPW RVGWFUFURTWSY RVGVRUVSYQ[ RRMYL RYLYZZ[][]W RXLYKZLZY[Z\\Z]Y", "", "", "", "", "D_MGNFLFL\\ RMGM\\ RGIRIQHPI RHLHT RHLIMIT RIMPM RPMPT ROMPLQMQT RIPPP RISPS RGWRWQVPW RSI\\I[HZI RRP]P[OZP RWPUZ RWPXQUZ RRZ[Y RRZS[[Y RZV[X\\[][]Z\\XZV", "", "", "", "D_LGMFKFK\\ RLGL\\ RGIPIOHNI RGKGS RGKHLHS RHLOL ROLOS RNLOKPLPS RHOOO RHROR RGVPVOUNV RXGYFWFWZ RXGXZ RSKS\\ RSKTLT\\ RTL[L R[L[\\ RZL[K\\L\\\\ RTS[S RTZ[Z", "D_MGNFLFL\\ RMGM\\ RGIRIQHPI RHLHT RHLIMIT RIMPM RPMPT ROMPLQMQT RIPPP RISPS RGWRWQVPW RSGZG RZGYJXLUP RYGZF[GZJXMUPRR RTHUKWNZP\\Q]P RUKWMZO]P RWSXRVRV[ RWSW[ RSV[VZUYV RQ[][\\Z[[", "", "", "D_MGNFLFL\\ RMGM\\ RGIRIQHPI RHLHT RHLIMIT RIMPM RPMPT ROMPLQMQT RIPPP RISPS RGWRWQVPW RXIXGYFWFWI RSI]I\\H[I RUKSN RUKVLSN RZK[L\\N]N]M\\LZK RZPYSWVTYQ[O\\ RZP[QZSXVUYR[O\\ RSRVP RSRTSVP RVPWTYX\\\\][ RVPWSXUZX][", "", "", "", "", "", "", "D_LGMFKFK\\ RLGL\\ RGIPIOHNI RGKGS RGKHLHS RHLOL ROLOS RNLOKPLPS RHOOO RHROR RGVPVOUNV RWFVHTKQN RWFXGVJTLQN RWGXIZL\\N]M RXIZK]M RTNYNXMWN RRPR\\ RRPSQS\\ RSQ[Q R[Q[ZZ[ RZQ[P\\Q\\Z[\\Z[YZ RUQU[ RVQV[ RXQX[ RYQY[ RSV[V", "", "", "D_LGMFKFK\\ RLGL\\ RGIPIOHNI RGKGS RGKHLHS RHLOL ROLOS RNLOKPLPS RHOOO RHROR RGVPVOUNV RRG]G\\F[G RTJTP RTJUKUP RUKZK RZKZP RYKZJ[K[P RUOZO RSRS\\ RSRTST\\ RTS[S R[S[\\ RZS[R\\S\\\\ RWSW[ RXSX[ RTW[W RT[[[", "", "", "", "", "", "", "", "", "", "", "", "", "D_RGSFQFQI RRGRI RHI\\IZGXI RXI[H RLJMLNPOPONNLLJ RVJTP RVJWKTP RGQ]Q[OYQ RYQ\\P RQQQ] RRQR] RIV[VYTWV RWVZU", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZ RLPLW RLWH[GZ RLWNZQ[\\[]Z RLWNYQZ]Z RPGTG RSGTFVGUI RTGTJSMQQNU RUGUJTMSOQRNU RUJVMWOYR\\U]T RVMXPZR]T", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z ROH[H RZH[G]H\\J R[HZRYTXU RZSZTYU R\\H\\J[TZVYVXUVT RUHTLSORQPT RVHULSPPTNV", "", "", "", "", "", "", "", "", "", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RRHPGPPOTNV RQHQPPSNV RRHVGYF[G RQHRH[G RQM]M[LZM RWMWW RXMXW", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RRFSITITHRF RZFXFWJ RZFWJ ROJ]J\\I[J RUJUTTVSW RVJVTUVSWQW RPMPS RPMQMQS RQRZR RZMZS RZM[M[S", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4700 to 4799 ********/ "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKW RLPLW RKWGZ RLWH[GZ RLWNZQ[\\[]Z RLWNYQZ]Z RVGWFUFUX RVGVX ROI]I[HZI RPLPQ RPKQLQQ RQLZL RZLZQ RYLZK[L[Q RPQ[Q RUQSTQV RUSTTQVOW RVSXT[W\\W\\V[UYTVS", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RVGWFUFUM RVGVM RSGQGPK RSGPK RQI[IZHYI ROM]M[LZM RQPQW RQPRQRW RRQYQ RYQYW RXQYPZQZW RRVYV", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RVGWFUFUW RVGVW ROH]H\\G[H RPJPQ RPJQKQQ RQKZK RZKZQ RYKZJ[K[Q RQNZN RPQ[Q ROT]T\\S[T", "D_HGIHJJKJKIJHHG RGPJP RIPJOLPKR RJPJWGZH[KW RKPKW RKWMZP[\\[]Z RKWMYPZ]Z ROG[G RYGZF\\HYH RZFYH R[GYHWI RSHTIUKVKVJUISH RQKOJOW RPKPW RPK[K RZK[J]K\\M R[K[UZV R\\K\\U[WZVXU RUKUW RVKVW RPO[O RPS[S", "", "", "", "", "", "D_HGIHJJKJKIJHHG RGPJP RIPJOLPKR RJPJWGZH[KW RKPKW RKWMZP[\\[]Z RKWMYPZ]Z RSFQFPINM RRFQH RSFNM RYFWFVJ RXFWH RYFVJ RPIPW RPIQJQW RQJ]J[IZJ RVJVV RWJWV RQN\\N[MZN RQR\\R[QZR RQV]V[UZV", "", "", "", "", "", "", "", "", "", "", "", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RVFWEUEUK RVFVK RQH[HZGYH ROK]K[JZK RRKSOTOTNRK RYKWO RYKZLWO ROO]O[NZO RUOUX RVOVX RRRZRYQXR ROU]U[TZU", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKW RLPLW RKWGZ RLWH[GZ RLWNZQ[\\[]Z RLWNYQZ]Z RPFPQOVNX RPFQGQQPUNX RQG\\G R\\G\\J R[G\\F]G]J RQJ]J RSJTNUNUMSJ RYJXN RYJZKXN RVNVX RWNWX RQN]N\\M[N RRQ\\Q[PZQ RQT]T\\S[T", "D_HGIHJJKJKIJHHG RGPJP RIPJOLPKR RJPJWGZH[KW RKPKW RKWMZP[\\[]Z RKWMYPZ]Z RQFQN RQFRGRN RRGYG RYGYN RXGYFZGZN RUIUN RUIVJVN RVJYJ ROMOW ROMPNPW RPN[N R[N[VZW RZN[M\\N\\V[XZWXV RSPSU RSPTQTU RTQWQ RWQWU RVQWPXQXU RSUXU", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RPFQGRISISHRGPF RXFWJ RXFYGWJ RNJ]J[IZJ RUJTM RWJTM RRMPLPW RQMQW RQMYM RXMYL[MZO RYMYW RZMZW RQPYP RQSYS RQVYV", "D_HGIHJJKJKIJHHG RGPJP RIPJOLPKR RJPJWGZH[KW RKPKW RKWMZP[\\[]Z RKWMYPZ]Z RPFNHNIOIPF RPG[G RZG[F]H[H R[F[H R\\G[HZI RVIWHUHUX RVIVX RPJ[JZIYJ RPLPS RPLQMQS RQMZM RZMZS RYMZL[M[S RQPZP RPS[S RNV]V[UZV", "", "", "", "", "", "", "", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RVFWEUEUK RVFVK RQH[HZGYH ROK]K[JZK RQMQQ RQMRNRQ RRNYN RYNYQ RXNYMZNZQ RQQZQ RUQUX RVQVX RUQRTOV RVRQUOV RVSXT[W\\W\\V[UYTVS R[RYT R[R\\SYT", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IGJHKJLJLIKHIG RGPKP RJPKOMPLR RKPKWGZH[LW RLPLW RLWNZQ[\\[]Z RLWNYQZ]Z RSFSI RTFTI RWFWI RXFXI ROEOI ROEPFPI RPF[F R[F[I RZF[E\\F\\I ROI\\I RNL]L[KZL RPNPR RPNQOQR RQOZO RZOZR RYOZN[O[R RPR[R RURUX RVRVX RURRUOW RVSQVOW RWTYU[W\\W\\VZUWT R[SYU R[S\\TYU", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_GGSGRFQG RKGKNJR RLGLNKQIS RNGNQORQR ROGOPPQQQ RHKH[ RHKILI[ RILQL RQLQ[ RPLQKRLR[ RIVQV RIZQZ RWFVJ RWFXGVJ RSJ[J RSJTK[J R[H\\K]K]J[H RVJVMUOTP RWJWMVOTPSP RYJYOZP]P]M RZJZO\\O]N RVQUTTV RVQWRTV RVS\\S R[RZTXWUZ R[R\\SZVXXUZS[ RVQWUYYZZ\\[]Z RXWZY]Z", "", "", "", "", "", "", "", "", "D_GGQGPFOG RJGJNIR RKGKNJQHS RMGMQNRPR RNGNPOQPQ RGKG[ RGKHLH[ RHLPL RPLP[ ROLPKQLQ[ RHVPV RHZPZ RWEVH RWEXFVH RSGSP RSGTHTP RTH[H R[H[P RZH[G\\H\\P RWHWP RXHXP RTL[L RSP\\P RTRTUSYR[ RTRURUUTXR[ RWQWZX[][]X RWQXQXYYZ\\Z]Y R[RZRYU R[RYU RXU\\U RXUYV\\U R\\T\\V]V\\T", "", /******** Oriental Hershey Glyphs 4800 to 4899 ********/ "", "", "", "", "", "", "", "", "", "D_GHKGNFPG RGHPG RKGK\\ RLGL\\ RHJIMJMJLHJ ROIMM ROIPJMM RFNQNPMON RKOISGV RKQGV RMQNROTPTPSORMQ RSFSSRXQZ RSFTGTSSWQZO\\ RTG[G R[G[O RZG[F\\G\\O RTN[N RWNXSYVZX\\[]Z RWNXRYU[X]Z", "", "D_IHQGWFYG RIHYG RQGQS RRGRS RLIMLNLNKLI RWIUL RWIXJUL RGM]M[LZM RPMNOJRGT RQNNPISGT RSMTOWR[T]S RTOWQYR]S RQUQ[ RRUR[ RMUKTK\\ RLUL\\ RLUWU RVUWTYUXW RWUW\\ RXUX\\ RLXWX RL[W[", "", "D_LGJFJR RKGKR RKGXG RWGXFZGYI RXGXR RYGYR RQGQ[ RRGR[ RKLXL RKQXQ RIV[VYTWV RWVZU RG[][[YY[ RY[\\Z", "", "D_SFQFPHNKKNHP RRFPI RSFPJMMJOHP RSGTIVLXN[P]O RYN[O RTIWLZN]O RNOVOUNTO RQOQ[ RROR[ RISZSYRXS RKULWMZNZNYMWKU RXUUZ RXUYVUZ RG[][[YY[ RY[\\Z", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_KEIJGN RKELFKHGN RMGNHOJPJPIOHMG RIMOMNLMM RKMKZ RLMLZ RGQPQOPNQ RGSHWIWIVGS ROSMX ROSPTMX RGZPY RGZH[PY RWGXFVFVL RWGWL RRKRTQXPZ RRKSLSTRWPZO[ RSL]L[KZL RXNUY RXNYOUY RSZ[X RSZT[[X RZV[X\\[][]Z\\XZV", "D_KEIJGN RKELFKHGN RMGNHOJPJPIOHMG RIMOMNLMM RKMKZ RLMLZ RGQPQOPNQ RGSHWIWIVGS ROSMX ROSPTMX RGZPY RGZH[PY RWGXFVFVRUVSYQ[ RWGWRVVTYQ[N\\ RSHRLQN RSHTISKQN RSK\\K[JZK RPQ]Q[PZQ RWRXVZZ\\\\][ RXVZY][", "", "", "", "", "", "", "", "", "D_KEIJGN RKELFKHGN RMGNHOJPJPIOHMG RIMOMNLMM RKMKZ RLMLZ RGQPQOPNQ RGSHWIWIVGS ROSMX ROSPTMX RGZPY RGZH[PY RRFR\\ RRFSGS\\ RSG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUKYKXJWK RUNUX RUNVOVX RVOXO RXOXW RWOXNYOYW RVVXV", "", "D_KEIJGN RKELFKHGN RMGNHOJPJPIOHMG RIMOMNLMM RKMKZ RLMLZ RGQPQOPNQ RGSHWIWIVGS ROSMX ROSPTMX RGZPY RGZH[PY RRFR[ RRFSGSZ RSGZG RZGZO RYGZF[G[O RSKZK RSO[O RWPWRXVZY\\[]Z RWRXUZX]Z R\\QYU R\\Q]RYU RP[XX RP[Q\\XX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_IEFK RIEJFFK RJGLJMJMIJG RGMMMLLKM RIMIZ RJMJZ RFQNQMPLQ RFSGWHWHVFS RMSKW RMSNTKW RGZMY RGZH[MY RQGOFO\\ RPGP\\ RPG[G RZG[F]G\\I R[G[ZZ[ R\\G\\Z[\\Z[XZ RRHSLTLTKRH RXHWL RXHYIWL RQMZMYLXM RUMUW RVMVW RRPRX RRPSPSX RSWXW RXPXX RXPYPYX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 4900 to 4999 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGKFKZ RLGLZ RLG[GYFXG RLJXJWIVJ RLMXMWLVM RGP]P[OZP RPQQTSWUYX[[\\][ RPQQSSVTWWYYZ][ RXRUV RXRYSUV RG[SX RG[H\\SX", "", "D_HFH\\ RHFIGI\\ RIGOG ROGOP RNGOFPGPP RIKOK RIOOO RTFTP RTFUGUP RUG[G R[G[XZZY[ R[Y[ZZ[ RZG[F\\G\\Z[\\Z\\Y[WZ RUK[K RUO[O", "", "", "", "D_HFH\\ RHFIGI\\ RIGOG ROGOP RNGOFPGPP RIKOK RIOOO RTFTP RTFUGUP RUG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUK[K RUO[O RNRNZ RNROSOZ ROSUS RUSUZ RTSURVSVZ ROYUY", "D_HFH\\ RHFIGI\\ RIGOG ROGOM RNGOFPGPM RIJOJ RIMPM RTFTM RTFUGUM RUG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUJ[J RTM[M RRORZQ[ RROSOSZR\\Q[OZ RKRXRWQVR RQRMWKY RRSPUKY", "", "", "", "D_HFH\\ RHFIGI\\ RIGOG ROGOM RNGOFPGPM RIJOJ RIMPM RTFTM RTFUGUM RUG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUJ[J RTM[M RNPNZ RNPOQOZ ROQUQ RUQUZ RTQUPVQVZ ROUUU ROYUY", "D_HFH\\ RHFIGI\\ RIGOG ROGOM RNGOFPGPM RIJOJ RIMPM RTFTM RTFUGUM RUG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUJ[J RTM[M RMPXPWOVP ROPOUNXMZ RPPPUOXMZK[ RTPT[ RUPU[ RLTXTWSVT", "", "", "", "", "", "", "", "D_HFH\\ RHFIGI\\ RIGOG ROGOM RNGOFPGPM RIJOJ RIMPM RTFTM RTFUGUM RUG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUJ[J RTM[M RMONPORPRPQOPMO RUOSS RUOVPSS RLSXSWRVS RQSQUPXOZ RRSRUQXOZM[ RRTSWTYV[WZ RSWUYWZ RKVYVXUWV", "D_HFH\\ RHFIGI\\ RIGOG ROGOM RNGOFPGPM RIJOJ RIMPM RTFTM RTFUGUM RUG[G R[G[ZZ[ RZG[F\\G\\Z[\\Z[XZ RUJ[J RTM[M RLPXPWOVP RNPNZ ROPOZ RUPU[ RVPV[ ROSUS ROVUV RLZXX RLZM[XX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFH[ RHFIGI[ RIGNG RMFKM RLGMFNGKM RKMLQLTKUJU RKMMQMTLVKVJUHT RQFQY RQFRGRX RRGYG RYGYO RXGYFZGZO RRKYK RROZO RUOVRWTYW\\Z]Y RVRXUZW]Y RNYXW RNYOZXW R[QXT R[Q\\RXT", "", "", "", "", "", "D_HFH[ RHFIGI[ RIGNG RMFKM RLGMFNGKM RKMLQLTKUJU RKMMQMTLVKVJUHT RUFSIPL RUFVGSJPLNM RUFWIXJZL\\M]L RXJZK]L RRNYNXMWN RUNUYTZ RVNVYU[TZRY ROR\\R[QZR RQUPWNZ RQURVNZ RYUZW[Z\\Z\\Y[WYU", "D_HFH[ RHFIGI[ RIGNG RMFKM RLGMFNGKM RKMLQLTKUJU RKMMQMTLVKVJUHT RUFSFRIPL RUFQKOM RRI[I RZHXKUNRP RYIZH[IXLTOPQ RTIUKWNZP\\Q]P RUKWMZO]P RVQV\\ RVQWQW\\ RRRRW RRRSSSW RSS[SZRYS RNW]W[VZW", "", "", "", "", "", /******** Oriental Hershey Glyphs 5000 to 5099 ********/ "", "", "", "", "", "D_HFH\\ RHFIGI\\ RIGNG RMFKM RLGMFNGKM RKMLQLTKUJU RKMMQMTLVKVJUHT RVGWFUFUM RVGVM RQI[IZHYI ROM]M\\L[M RSMSORQQR RTMTOSQQRPR RWMWQXR\\R]Q\\P RXMXPYQ[Q\\P\\O RUSU[ RUSVSV[ RQV[VZUYV RO[][\\Z[[", "D_HFH\\ RHFIGI\\ RIGNG RMFKM RLGMFNGKM RKMLQLTKUJU RKMMQMTLVKVJUHT RUFSIPL RUFVGSJPLNM RVGWIZL\\M]L RXJZK]L RSLWLVKUL RPOXO RXOXR RWOXNYOYR RPR\\R[QZR ROU]U[TZU RTURZ RVURZ ROZZY ROZP[ZY RYXZY[[\\[\\Z[YYX", "", "", "", "", "", "D_HFH\\ RHFIGI\\ RIGNG RMFKM RLGMFNGKM RKMLQLTKUJU RKMMQMTLVKVJUHT RQFQN RQFRGRN RRGYG RYGYN RXGYFZGZN RRJYJ RRMYM ROP]P\\O[P RQPPTOV RQPRQQSOV RQS\\S RTSSVQXOY RUSTVRXOY RXSWVVXTZR[O\\ RYSXVWXUZS[O\\ R\\S[ZZ[ R[S\\R]S\\Z[\\Z[XZ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_LGMFKFKRJVIX RLGLRKUIXGZ RGKQKPJOK ROPMX ROPPQMX RKYPX RKYLZPX RPVQYRYRXPV RUFTIRN RUFVGRN RYFXK RYFZGXK RTJT\\ RTJUKU\\ RUK]K\\J[K RXKXZ RYKYZ RUP]P\\O[P RUU]U\\T[U RUZ]Z\\Y[Z", "", "", "", "", "", "", "", "D_KGLFJFJK RKGKK ROGPFNFNK ROGOK RGIRIQHPI RHLHP RHLIMIP RIMPM RPMPP ROMPLQMQP RHPQP RLMLUKYJ[ RMMMVLYJ[H\\ RHSQSPROS RGVRVQUPV RNXOYP[Q[QZPYNX RUFTIRN RUFVGRN RYFXK RYFZGXK RTJT\\ RTJUKU\\ RXKXZ RYKYZ RUK]K\\J[K RUP]P\\O[P RUU]U\\T[U RUZ]Z\\Y[Z", "", "D_MHMGNFLFLH RGHRHQGPH RJJOONP RKKMNNP RJPOKNJ RKOMLNJ RHJHP RHJIJIP RHPQP RPJPP RPJQJQP RLPKW RLPMQKW RJWNV RJWKXNV RNUNXOXOWNU RGRG\\ RGRHSH\\ RHSQS RQSQZP[ RPSQRRSRZQ\\P[NZ RUFTIRN RUFVGRN RYFXK RYFZGXK RTJT\\ RTJUKU\\ RUK]K\\J[K RXKXZ RYKYZ RUP]P\\O[P RUU]U\\T[U RUZ]Z\\Y[Z", "", "D_GG]G[EYG RYG\\F RQGQ\\ RRGR\\ RJLHKH\\ RILI\\ RILZL RYLZK\\L[N RZLZZY[ R[L[ZZ\\Y[WZ RKNLOMQNQNPMOKN RTNUOVQWQWPVOTN RKTLUMWNWNVMUKT RTTUUVWWWWVVUTT", "", "D_KGYGWFVG RQGQQ RRGRQ RIIHKGLGMHMIKII RIJ[J RZJ[I]K[L R[I[L R\\J[LZM RKMNM RUMXM RKPNP RUPXP RISYS RXSYR[SZU RYSY\\ RZSZ\\ RIWYW RI[Y[", "", "D_KGYGWFVG RQGQQ RRGRQ RIIHKGLGMHMIKII RIJ[J RZJ[I]K[L R[I[L R\\J[LZM RKMNM RUMXM RKPNP RUPXP RISZSYRXS RGV]V[UZV ROVN[ ROVPWN[ RI[WZ RI[K\\WZ RVXXZY\\Z\\Z[YZVX", "", "D_KGYGWFVG RQGQP RRGRP RIIHKGLGMHMIKII RIJ[J RZJ[I]K[L R[J[L R\\J[LZM RKMNM RUMXM RKPNP RUPXP RQPORLTHV RQPRQOSKUHV RRQVTXU[V]U RRQVSYT]U ROUTUSTRU RKXWX RWXWZV[ RVXWWXXXZW\\V[TZ ROXO\\ RPXP\\", "D_KGYGWFVG RQGQQ RRGRQ RIIHKGLGMHMIKII RIJ[J RZJ[I]K[L R[I[L R\\J[LZM RKMNM RUMXM RKPNP RUPXP RLSJRJ\\ RKSK\\ RKSXS RWSXRZSYU RXSX\\ RYSY\\ RQSQ[ RRSR[ RKWXW RK[X[", "D_KFYFWEVF RQFQP RRFRP RIHHJGKGLHLIJIH RII[I RZI[H]J[K R[I[K R\\I[KZL RKLNL RULXL RKONO RUOXO RLRJQJX RKRKX RKRXR RWRXQZRYT RXRXX RYRYX RKUXU RJXYX RQRQ[R\\\\\\][\\Y R[[\\[\\Z RRRRZS[Z[\\Y]V", "", "", "", "", "D_KFYFWEVF RQFQN RRFRN RIHHJGKGLHLIJIH RII[I RZI[H]J[K R[H[K R\\I[KZL RKKNK RUKXK RKMNM RUMXM RIOIWHZG\\ RIOJPJWIZG\\ RJP[PYOXP RLRXRWQVR RJT\\TZSYT RNTN[ ROTOZ RSUTWVYY[\\\\][ RTWWYYZ][ RK[UY RK[L\\UY RYVVX RYVZWVX", "D_KFYFWEVF RQFQN RRFRN RIHHJGKGLHLIJIH RII[I RZI[H]J[K R[I[K R\\I[KZL RKKNK RUKXK RKMNM RUMXM RJPXPWOVP RHS\\SZRYS ROTO[ ROTPTP[ RSTS[ RSTTTT[ RIUKYLYLXIU RYUVZ RYUZVVZ RG[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_RGSFQFQN RRGRN RIH[HYGXH RKKYKXJWK RGN]N[MZN RMQKPK\\ RLQL\\ RLQWQ RVQWPYQXS RWQWZV[ RXQXZW\\V[TZ RLTWT RLWWW", "D_LGMFKFKN RLGLN RGHPHOGNH RIKOKNJMK RGNPNOMNN RHPH\\ RHPIQI\\ RIQNQ RNQNZM[ RMQNPOQOZN\\LZ RITNT RIWNW RVFTFRK RVFRK RTHYH RXGUL RWHXGYHUL RUMUZT[ RVMVZU\\T[RZ RQMYM RYMYV RXMYLZMZV RPQ]Q\\P[Q RQUYU", "", "", "D_OGPFNFNRMVKYH\\ ROGORNVLYH\\ RUGVFTFT\\ RUGU\\ RGJNJ RUJ]J[HYJ RYJ\\I RHPNP RUP\\PZNXP RXP[O RGVTS RGVHWTS RUV]V[TYV RYV\\U", "", "", "D_OFPENENLMO ROFOLNNLPJQ RUFVETETP RUFUP RGHNH RUH]H[GZH RGKNK RUK]K[JZK RGNMN RGNHOMN RUN]N[MZN RGROR ROROZN[ RNROQPRPZO\\N[LZ RKRGV RMRGV RORJXG[ ROTMVG[ RSR[R R[R[ZZ[ RZR[Q\\R\\Z[\\Z[XZ RWRSV RYRSV R[RVXS[ R[TYVS[", "", "", "", "D_GG]G[EYG RYG\\F RPGNL RRGNL RJLHKH\\ RILI\\ RILZL RYLZK\\L[N RZLZ\\ R[L[\\ RNLN[ ROLO[ RTLT[ RULU[ ROQTQ ROVTV RI[Z[", "D_NGOFMFML RNGNL RVGWFUFUL RVGVL RGI]I[HZI RMLVL RQLQ] RRLR] RLOJNJU RKOKU RKOXO RWOXNZOYQ RXOXU RYOYU RKTXT RGX]X[WZX", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 5100 to 5199 ********/ "", "", "", "", "", "", "", "", "", "", "D_RHRGSFQFQH RHH[HYGXH RLHMJNMOMOLNJLH RVHTM RVHWITM RGM]M[LZM RMQKPK\\ RLQL\\ RLQWQ RVQWPYQXS RWQW\\ RXQX\\ RLVWV RL[W[", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MGNFLFLQ RMGMQ RHGJJKJKIHG RPGNJ RPGQHNJ RGKRKQJPK RKKJMHP RLLHP RNMONPPQPQOPNNM RLRKWJY RLRMRLVKXIZG[ RGURUQTPU RNWOXPZQZQYPXNW RSG]G\\F[G RXGWK RXGYHWK RTJTW RTJUKUW RUK[K R[K[W RZK[J\\K\\W RUO[O RUS[S RTW\\W RUYR\\ RUYVZR\\ RZY[Z\\\\]\\][\\ZZY", "", "", "", "", "", "", "", "", "", "D_KGIFIUHZG\\ RJGJUIYG\\ RJGYG RXGYF[GZI RYGYUZY[[\\\\]\\]Z]X R[Z\\[][ RZGZU[Y\\Z]Z RLKUIVJ RLKVJ RQKQZ RRJRY RMMMU RMMNNNU RNNUN RUNUU RTNUMVNVU RNTUT RLZVY RLZM[VY RUWW[X[XZUW", "", "", "", "D_GGTG RSGTFVGUI RTGTIULWOZQ\\Q]P\\O RUGUIVLXOZP[P\\O]M RYGVK RYGZHVK RWKYMZMZLWK RGMLKML RGMML RJLJTIYH[ RKLKTJXH[G\\ RPJQIOIO\\ RPJP\\ RGRTR RSRTQVRUT RTRTTUWWZZ\\\\\\][\\Z RURUTVWXZZ[[[\\Z]X RYRVV RYRZSVV RWVYXZXZWWV", "", "D_QFPHMLJNGO RQFRGPJNLKNGO RRGTJVLYN[O]N RRGUJXLZM]N RRORNSMQMQO RLNL\\ RLNMOM[ RMOVO RVOVU RUOVNWOWU RMRVR RMUWU RQURWTZW\\[]]\\ RRWTYX[]\\ RI\\SZ RI\\J]SZ RXVUY RXVYWUY", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_MFNGOIPIPHOGMF RUFTJ RUFVGTJ RGJ]J[HYJ RYJ\\I RRJPN RRJSKPN RMNKMK\\ RLNL\\ RLNXN RWNXMZNYP RXNX\\ RYNY\\ RLRXR RLVXV RLZXZ", "", "D_JHQGVFXG RJHXG RQGQS RRGRS RGK]K[IYK RYK\\J RPKMNIQGR RQLMOJQGR RRKTMVOYQ[R]Q RTMWOYP]Q RNSLRL\\ RMSM\\ RMSVS RUSVRXSWU RVSV\\ RWSW\\ RMWVW RM[V[", "", "", "D_IFIT RIFJGJT RJG[GYFXG RQGQS RRGRS RJKZKYJXK RJOZOYNXO RJS[S RZS[R]S[U R[SZZY[ R\\S[ZZ\\Y[WZ RIWHYGZG[H[IYIW RLWM[N[NZLW RQVRZSZSYQV RUUVVWXXXXWWVUU", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 5200 to 5299 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_HFHQ RHFIGIQ RIGQGPFOG RLGLP RMGMP RIJQJPIOJ RIMQMPLOM RIPPP RPPPVOZN[ ROPPOQPQVPZO\\N[LZ RHUGXHXHU RJUJXKWJU RLTMWNVLT RMROTOSMR RWFTJRL RWFXGVIRL RXGZJ\\L]K RXGZI]K RUMZMYLXM RWMWTVXUZT[R\\ RXMXTWXVZU[R\\ RSOSU RSOTPTU RTP[P R[P[U RZP[O\\P\\U RTT[T RXUYXZZ\\\\][ RYX[Z][", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_NGLFLN RMGMN RMGWG RVGWFYGXI RWGWN RXGXN RQIQN RQIRJRN RRJWJ RIMHOGPGQHQIOIM RIN\\N RZN[M]O[P R[M[P R\\N[PZQ RNQLPL\\ RMQM\\ RMQWQ RVQWPYQXS RWQWXVZU[ RWYWZV[ RXQXZW\\V\\U[SZ RMTWT RMWWW", "", "", "", "", "", "", "", "", "", "", "", "D_RHRFSEQEQH RGH]H[GZH RLJLN RLJMKMN RMKVK RVKVN RUKVJWKWN RLNWN RHPH\\ RHPIQI\\ RIQZQ RZQZZY[ RYQZP[Q[ZZ\\Y[WZ RMSMX RMSNTNX RNTUT RUTUX RTTUSVTVX RMXVX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_REPEOH RREOH RLHJGJQ RKHKQ RKHXH RWHXGZHYJ RXHXQ RYHYQ RQHQP RRHRP RKLXL RKPXP RNQMVLXJZH[ RNQORNVMXKZH[G[ RRQRZS[\\[]Z\\Y RRQSQSYTZ[Z\\Y]W RXRWRVU RXRVU RUUYU RUUVVYU RYTZV[V[UYT", "", "", "", "", "D_PENELIJLGP RPELJGP RNHVH RTHUGWITJ RUGTJ RVHTJRL RMLKKKV RLLLV RLLYL RXLYK[LZN RYLYV RZLZV RRLRV RSLSV RLQYQ RKVZV RIXHZG[G\\H\\IZIX RMXN\\O\\O[MX RSXT\\U\\U[SX RXXYY[\\\\\\\\[ZYXX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /******** Oriental Hershey Glyphs 5300 to 5399 ********/ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_SEQEPG RSEPG RMGKFKT RLGLT RLGWG RVGWFYGXI RWGWM RXGXM RLJWJ RLMXM RLP[PYOXP RLS[S RZS[R]S[U R[SZZY[ R\\S[ZZ\\Y[WZ RIWHYGZG[H[IYIW RLWM[N[NZLW RQVRZSZSYQV RUUVVWXXXXWWVUU", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_SHSGTFRFRH RIGIUHZG\\ RIGJHJUIYG\\ RJH]H[GZH ROHOP RPHPP RUHUP RVHVP RJL[L R[L[P RZL[K\\L\\P RJP\\P ROQOZ ROQPQPZ RPUTUSTRU RK[UX RK[L\\UX RUQU[V\\\\\\][\\Z RUQVQVZW[[[\\Z]X RVV[S\\T RVV\\T", "", "", "", "", "", "", "", "", "", "D_RGSFQFQO RRGRO RHI\\IZHYI RILZLYKXL RGO]O[NZO RPPNRJUGW RPPQQNSKUGW RNSXS RWRSVOYK[H\\ RWRXSSWPYL[H\\ RNSOUQXTZW[[\\][ ROUQWTYWZ][", "", "", "", "", "D_SHSGTFRFRH RIGIVHZG\\ RIGJHJVIYG\\ RJH]H[GZH ROKPJNJN\\ ROKO\\ RJNTNSMRN RNPMTLWKY RNTMVKY RPQQRRTSTSSRRPQ RXKYJWJW\\ RXKX\\ RTN]N[MZN RWPVTUVSY RWTVVSY RXQYTZW\\Z]Y RYT[W]Y", "", "", "", "", "", "", "", "", "D_OGPFNFNM ROGOM RUGVFTFTM RUGUM RHI\\IZHYI RGM]M[LZM RQMQX RRMRX RLPJOJX RKPKX RKPXP RWPXOZPYR RXPXX RYPYX RKTXT RJXYX RNYG\\ RNYOZG\\ RUYXZ\\\\]\\][ZZUY", /******** Oriental Hershey Glyphs 5400 to 5499 ********/ "", "", "", "D_QGQV RRGRV RLGJFJP RKGKP RKGXG RWGXFZGYI RXGXP RYGYP RKKXK RKOXO RISZSYRXS RGV]V[UZV RIXHZG[G\\H\\IZIX RMXN\\O\\O[MX RSXT\\U\\U[SX RXXZZ[\\\\\\\\[ZYXX", "D_QFQR RRFRR RJEJL RJEKFKL RKFXF RXFXL RWFXEYFYL RKIXI RJLYL RIOZOYNXO RGR]R[QZR RITGUGVHVIT RMTNVOVOUMT RTTUVVVVUTT RZT[V\\V\\UZT RQVQ[ RQVRVR[ RJXZXYWXX RG[][[ZZ[", "", "", "", "", "", "", "", "", "", "", "D_MGNFLFLM RMGMM RGISIQHPI RHMRMQLPM RIOIT RIOJPJT RJPOP ROPOT RNPOOPPPT RITPT RIUJXKXKWIU ROUNX ROUPVNX RGZRX RGZH[RX RWGXFVFVQ RWGWQ RRK]K[JZK RRQZQ RZQYTWWUYR[ RYQZP[QZTXWVYR[O\\ RSRTUVXYZ\\[]Z RTUVWYY]Z", "", "", "", "", "", "D_SEQEPG RSEPG RKFKM RKFLGLM RLGWG RWGWM RVGWFXGXM RLIWI RLKWK RKMXM RQOQU RRORU RJOJU RKOKU RJOYO RXOXU RYOYU RKRXR RJUYU RNUNZM\\L] ROUOZN\\L]J] RTUT] RUUU] RGX]X[WZX", "", "", "", "", "", "", "D_RFSEQEQK RRFRK RLHMGKGKK RLHLK RRHXHWGVH RGK]K[JZK RRNSMQMQY RRNRY RLMMNNPOPOONNLM RVMTQ RVMWNTQ RJRYRXQWR RPRMVKX RQSOUKX RSTTUVXWXWWVVST RHMH\\ RHMIMI\\ RI[Z[ RZMZ\\ RZM[M[\\", "", "", "", "", "", "", "", "", "", "", "", "D_RHRGSFQFQH RHH\\HZGYH RLHNLOLOKLH RVHTL RVHWITL RGL]L[KZL RLOJNJX RKOKX RKOXO RWOXNZOYQ RXOXX RYOYX RKSXS RKWXW RQOQ[R\\\\\\][\\Y R[[\\[\\Z RRORZS[Z[\\Y]V", "", "", "", "", "D_NELEJHGL RNEGL RMFSF RRFSEUGRH RSFRH RTFRHQI RJHJO RJHKIKO RKIXI RXIXO RWIXHYIYO RKLXL RJOYO RQIQ[R\\\\\\][\\Z RRIRZS[[[\\Z]X RIQIY RIQJRJY RJRYR RYRYY RXRYQZRZY RJUYU RJXYX", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D_", }; #else /* NO_KANJI */ const char * const _pl_g_oriental_hershey_glyphs[NUM_ORIENTAL_HERSHEY_GLYPHS] = { }; #endif /* KANJI */ plotutils-2.6/libplot/g_integer.c0000644000175000017500000001641611037243261014124 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the versions of the Plotter methods that (i) take as arguments, and/or (ii) return integers rather than doubles. */ #include "sys-defines.h" #include "extern.h" int _API_arc (R___(Plotter *_plotter) int xc, int yc, int x0, int y0, int x1, int y1) { return _API_farc (R___(_plotter) (double)xc, (double)yc, (double)x0, (double)y0, (double)x1, (double)y1); } int _API_arcrel (R___(Plotter *_plotter) int dxc, int dyc, int dx0, int dy0, int dx1, int dy1) { return _API_farcrel (R___(_plotter) (double)dxc, (double)dyc, (double)dx0, (double)dy0, (double)dx1, (double)dy1); } int _API_bezier2 (R___(Plotter *_plotter) int xc, int yc, int x0, int y0, int x1, int y1) { return _API_fbezier2 (R___(_plotter) (double)xc, (double)yc, (double)x0, (double)y0, (double)x1, (double)y1); } int _API_bezier2rel (R___(Plotter *_plotter) int dxc, int dyc, int dx0, int dy0, int dx1, int dy1) { return _API_fbezier2rel (R___(_plotter) (double)dxc, (double)dyc, (double)dx0, (double)dy0, (double)dx1, (double)dy1); } int _API_bezier3 (R___(Plotter *_plotter) int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { return _API_fbezier3 (R___(_plotter) (double)x0, (double)y0, (double)x1, (double)y1, (double)x2, (double)y2, (double)x3, (double)y3); } int _API_bezier3rel (R___(Plotter *_plotter) int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { return _API_fbezier3rel (R___(_plotter) (double)x0, (double)y0, (double)x1, (double)y1, (double)x2, (double)y2, (double)x3, (double)y3); } int _API_box (R___(Plotter *_plotter) int x0, int y0, int x1, int y1) { return _API_fbox (R___(_plotter) (double)x0, (double)y0, (double)x1, (double)y1); } int _API_boxrel (R___(Plotter *_plotter) int dx0, int dy0, int dx1, int dy1) { return _API_fboxrel (R___(_plotter) (double)dx0, (double)dy0, (double)dx1, (double)dy1); } int _API_circle (R___(Plotter *_plotter) int x, int y, int r) { return _API_fcircle (R___(_plotter) (double)x, (double)y, (double)r); } int _API_circlerel (R___(Plotter *_plotter) int dx, int dy, int r) { return _API_fcirclerel (R___(_plotter) (double)dx, (double)dy, (double)r); } int _API_cont (R___(Plotter *_plotter) int x, int y) { return _API_fcont (R___(_plotter) (double)x, (double)y); } int _API_contrel (R___(Plotter *_plotter) int dx, int dy) { return _API_fcontrel (R___(_plotter) (double)dx, (double)dy); } int _API_ellarc (R___(Plotter *_plotter) int xc, int yc, int x0, int y0, int x1, int y1) { return _API_fellarc (R___(_plotter) (double)xc, (double)yc, (double)x0, (double)y0, (double)x1, (double)y1); } int _API_ellarcrel (R___(Plotter *_plotter) int dxc, int dyc, int dx0, int dy0, int dx1, int dy1) { return _API_fellarcrel (R___(_plotter) (double)dxc, (double)dyc, (double)dx0, (double)dy0, (double)dx1, (double)dy1); } int _API_ellipse (R___(Plotter *_plotter) int x, int y, int rx, int ry, int angle) { return _API_fellipse (R___(_plotter) (double)x, (double)y, (double)rx, (double)ry, (double)angle); } int _API_ellipserel (R___(Plotter *_plotter) int dx, int dy, int rx, int ry, int angle) { return _API_fellipserel (R___(_plotter) (double)dx, (double)dy, (double)rx, (double)ry, (double)angle); } int _API_fontname (R___(Plotter *_plotter) const char *s) { double new_size = _API_ffontname (R___(_plotter) s); return IROUND(new_size); } int _API_fontsize (R___(Plotter *_plotter) int size) { double new_size = _API_ffontsize (R___(_plotter) (double)size); return IROUND(new_size); } int _API_line (R___(Plotter *_plotter) int x0, int y0, int x1, int y1) { return _API_fline (R___(_plotter) (double)x0, (double)y0, (double)x1, (double)y1); } int _API_linedash (R___(Plotter *_plotter) int n, const int *dashes, int offset) { double *idashes; int i, retval; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "linedash: invalid operation"); return -1; } /* sanity checks */ if (n < 0 || (n > 0 && dashes == NULL)) return -1; for (i = 0; i < n; i++) if (dashes[i] < 0) return -1; idashes = (double *)_pl_xmalloc ((unsigned int)n * sizeof(double)); for (i = 0; i < n; i++) idashes[i] = dashes[i]; retval = _API_flinedash (R___(_plotter) n, idashes, (double)offset); free (idashes); return retval; } int _API_linerel (R___(Plotter *_plotter) int dx0, int dy0, int dx1, int dy1) { return _API_flinerel (R___(_plotter) (double)dx0, (double)dy0, (double)dx1, (double)dy1); } int _API_labelwidth (R___(Plotter *_plotter) const char *s) { double width = _API_flabelwidth (R___(_plotter) s); return IROUND(width); } int _API_linewidth (R___(Plotter *_plotter) int new_line_width) { return _API_flinewidth (R___(_plotter) (double)new_line_width); } int _API_marker (R___(Plotter *_plotter) int x, int y, int type, int size) { return _API_fmarker (R___(_plotter) (double)x, (double)y, type, (double)size); } int _API_markerrel (R___(Plotter *_plotter) int dx, int dy, int type, int size) { return _API_fmarkerrel (R___(_plotter) (double)dx, (double)dy, type, (double)size); } int _API_move (R___(Plotter *_plotter) int x, int y) { return _API_fmove (R___(_plotter) (double)x, (double)y); } int _API_moverel (R___(Plotter *_plotter) int x, int y) { return _API_fmoverel (R___(_plotter) (double)x, (double)y); } int _API_point (R___(Plotter *_plotter) int x, int y) { return _API_fpoint (R___(_plotter) (double)x, (double)y); } int _API_pointrel (R___(Plotter *_plotter) int dx, int dy) { return _API_fpointrel (R___(_plotter) (double)dx, (double)dy); } int _API_space (R___(Plotter *_plotter) int x0, int y0, int x1, int y1) { return _API_fspace (R___(_plotter) (double)x0, (double)y0, (double)x1, (double)y1); } int _API_space2 (R___(Plotter *_plotter) int x0, int y0, int x1, int y1, int x2, int y2) { return _API_fspace2 (R___(_plotter) (double)x0, (double)y0, (double)x1, (double)y1, (double)x2, (double)y2); } int _API_textangle (R___(Plotter *_plotter) int angle) { double new_size = _API_ftextangle (R___(_plotter) (double)angle); return IROUND(new_size); } plotutils-2.6/libplot/g_line.c0000644000175000017500000002101111037243261013401 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the line method, which is a standard part of libplot. It draws an object: a line segment extending from the point x0,y0 to the point x1,y1. By repeatedly invoking cont(), the user may extend this line object to a polyline object. As implemented, the line method is a wrapper around the cont method. */ /* This file also contains the cont method, which is a standard part of libplot. It continues a line from the current position of the graphics cursor to the point specified by x and y. This method is used in the construction of paths. By repeatedly invoking cont(), the user may construct a polyline of arbitrary length. arc() and ellarc() may also be invoked, to add circular or elliptic arc elements to the path. The path will terminate when the user either (1) explicitly invokes the endpath() method, or (2) changes the value of one of the relevant drawing attributes, e.g. by invoking move(), linemod(), linewidth(), pencolor(), fillcolor(), or filltype(), or (3) draws some non-path object, by invoking box(), circle(), point(), label(), alabel(), etc., or (4) invokes restorestate() to restore an earlier drawing state. */ #include "sys-defines.h" #include "extern.h" int _API_fline (R___(Plotter *_plotter) double x0, double y0, double x1, double y1) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fline: invalid operation"); return -1; } if (_plotter->drawstate->path != (plPath *)NULL && (_plotter->drawstate->path->type != PATH_SEGMENT_LIST || (_plotter->drawstate->path->type == PATH_SEGMENT_LIST && _plotter->drawstate->path->primitive))) /* There's a simple path under construction (so that endsubpath() must not have been invoked), and it contains a closed primitive (box/circle/ellipse). So flush out the whole compound path. (It may include other, previously drawn simple paths.) */ _API_endpath (S___(_plotter)); /* if new segment not contiguous, move to its starting point (first flushing out the compound path under construction, if any) */ if (x0 != _plotter->drawstate->pos.x || y0 != _plotter->drawstate->pos.y) { if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); _plotter->drawstate->pos.x = x0; _plotter->drawstate->pos.y = y0; } return _API_fcont (R___(_plotter) x1, y1); } int _API_fcont (R___(Plotter *_plotter) double x, double y) { int prev_num_segments; plPoint p0, p1; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fcont: invalid operation"); return -1; } if (_plotter->drawstate->path != (plPath *)NULL && (_plotter->drawstate->path->type != PATH_SEGMENT_LIST || (_plotter->drawstate->path->type == PATH_SEGMENT_LIST && _plotter->drawstate->path->primitive))) /* There's a simple path under construction (so that endsubpath() must not have been invoked), and it contains a closed primitive (box/circle/ellipse). So flush out the whole compound path. (It may include other, previously drawn simple paths.) */ _API_endpath (S___(_plotter)); p0 = _plotter->drawstate->pos; p1.x = x; p1.y = y; if (_plotter->drawstate->path == (plPath *)NULL) /* begin a new path, of segment list type */ { _plotter->drawstate->path = _new_plPath (); prev_num_segments = 0; _add_moveto (_plotter->drawstate->path, p0); } else prev_num_segments = _plotter->drawstate->path->num_segments; /* if segment buffer is occupied by a single arc, replace arc by a polyline if that's called for (Plotter-dependent) */ if (_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 2) { _pl_g_maybe_replace_arc (S___(_plotter)); if (_plotter->drawstate->path->num_segments > 2) prev_num_segments = 0; } /* add new line segment to the path buffer */ _add_line (_plotter->drawstate->path, p1); /* move to endpoint */ _plotter->drawstate->pos = p1; /* pass all the newly added segments to the Plotter-specific function maybe_paint_segments(), since some Plotters plot paths in real time, i.e., prepaint them, rather than waiting until endpath() is called */ _plotter->maybe_prepaint_segments (R___(_plotter) prev_num_segments); /* If the path is getting too long (and it doesn't have to be filled), flush it out by invoking endpath(), and begin a new one. `Too long' is Plotter-dependent; some don't do this flushing at all. */ if ((_plotter->drawstate->path->num_segments >= _plotter->data->max_unfilled_path_length) && (_plotter->drawstate->fill_type == 0) && _plotter->path_is_flushable (S___(_plotter))) _API_endpath (S___(_plotter)); return 0; } /* Some Plotters, such as FigPlotters, support the drawing of single arc segments as primitives, but they don't allow mixed segment lists to appear in the path storage buffer, because they don't know how to handle them. A `mixed segment list' is a sequence of arc segments interspersed with line segments, or a path consisting of more than a single contiguous arc. I.e., a mixed path is defined by a segment list that is not a pure polyline and has length >1. For such Plotters, this function may be invoked by fcont() or farc() or fellarc() or fbezier2() or fbezier3(), to delete a single arc from the buffer and replace it by its polygonal approximation, i.e. by a polyline. I.e., it is invoked to keep the stored path from becoming mixed. */ void _pl_g_maybe_replace_arc (S___(Plotter *_plotter)) { /* sanity check */ if (!(_plotter->data->have_mixed_paths == false && _plotter->drawstate->path->num_segments == 2)) return; switch (_plotter->drawstate->path->segments[1].type) { plPoint pc, pd, p1; case S_ARC: /* segment buffer contains a single circular arc segment, so remove it */ pc = _plotter->drawstate->path->segments[1].pc; p1 = _plotter->drawstate->path->segments[1].p; _plotter->drawstate->path->num_segments = 1; /* add polygonal approximation to circular arc to the segment buffer */ _add_arc_as_lines (_plotter->drawstate->path, pc, p1); break; case S_ELLARC: /* segment buffer contains a single elliptic arc segment, so remove it */ pc = _plotter->drawstate->path->segments[1].pc; p1 = _plotter->drawstate->path->segments[1].p; _plotter->drawstate->path->num_segments = 1; /* add polygonal approximation to elliptic arc to the segment buffer */ _add_ellarc_as_lines (_plotter->drawstate->path, pc, p1); break; case S_QUAD: /* segment buffer contains a single quad. Bezier segment, so remove it */ pc = _plotter->drawstate->path->segments[1].pc; p1 = _plotter->drawstate->path->segments[1].p; _plotter->drawstate->path->num_segments = 1; /* add polygonal approximation to quad. Bezier to the segment buffer */ _add_bezier2_as_lines (_plotter->drawstate->path, pc, p1); break; case S_CUBIC: /* segment buffer contains a single cubic Bezier segment, so remove it */ pc = _plotter->drawstate->path->segments[1].pc; pd = _plotter->drawstate->path->segments[1].pd; p1 = _plotter->drawstate->path->segments[1].p; _plotter->drawstate->path->num_segments = 1; /* add polygonal approximation to cubic Bezier to the segment buffer */ _add_bezier3_as_lines (_plotter->drawstate->path, pc, pd, p1); break; default: /* other segment type (presumably a line segment, see above); OK */ break; } } plotutils-2.6/libplot/g_linewidth.c0000644000175000017500000000633711037243261014457 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the linewidth method, which is a GNU extension to libplot. It sets a drawing attribute: the line width used in subsequent drawing operations, in user units. It also computes an estimate for the width of lines in device units. This quantity is used by display devices that do not support `sheared lines'. */ #include "sys-defines.h" #include "extern.h" int _API_flinewidth(R___(Plotter *_plotter) double new_line_width) { double device_line_width, min_sing_val, max_sing_val; int quantized_device_line_width; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "flinewidth: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ if (new_line_width < 0.0) /* reset to default */ { new_line_width = _plotter->drawstate->default_line_width; _plotter->drawstate->line_width_is_default = true; } else _plotter->drawstate->line_width_is_default = false; /* set the new linewidth in the drawing state */ _plotter->drawstate->line_width = new_line_width; /* Also compute and set the device-frame line width, and a quantized (i.e. integer) version of same, which is used by most Plotters that use integer device coordinates. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); device_line_width = min_sing_val * new_line_width; quantized_device_line_width = IROUND(device_line_width); /* Don't quantize the device-frame line width to 0 if user specified nonzero width. If it has a bitmap display (rendered with libxmi), quantizing to 0 might be regarded as OK, since libxmi treats 0-width lines as Bresenham lines rather than invisible. However, the Hershey fonts don't look good at small sizes if their line segments are rendered as Bresenham lines. */ if (quantized_device_line_width == 0 && device_line_width > 0.0) quantized_device_line_width = 1; _plotter->drawstate->device_line_width = device_line_width; _plotter->drawstate->quantized_device_line_width = quantized_device_line_width; /* flag linewidth as having been invoked on this page (so that fsetmatrix will no longer automatically adjust the line width to a reasonable value) */ _plotter->data->linewidth_invoked = true; return 0; } plotutils-2.6/libplot/g_mark.c0000644000175000017500000005350511037243261013421 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the marker method, which is a GNU extension to libplot. It plots an object: a marker, of specified size, at a specified location. This marker may be one of a list of standard symbols, or a single character in the current font. The `size' argument is expressed in terms of user coordinates. If the marker is a character, it is the font size (i.e., the em size of the font). If the marker is a symbol, the maximum dimension of the symbol will be a fixed fraction of `size'. */ /* This is a generic version. Currently, it is overridden only by Metafile and CGM Plotters. */ #include "sys-defines.h" #include "extern.h" /* The maximum dimension of most markers, e.g. the diameter of the circle marker (marker #4). Expressed as a fraction of the `size' argument. */ #define MAXIMUM_MARKER_DIMENSION (5.0/8.0) /* Line width used while drawing marker symbols. Expressed as a fraction of the `size' argument. */ #define LINE_SCALE (0.05 * MAXIMUM_MARKER_DIMENSION) /* The diameter of a `dot' (marker #1), as a fraction of the maximum marker dimension (see above). This applies only if the Plotter has a physical display, i.e. the PAGESIZE parameter is meaningful for it, or if the Plotter has a virtual display that uses real coordinates. Currently, none of our Plotters falls into the 2nd category. If the Plotter falls into neither of these two categories, we assume that fpoint() draws a single pixel, or something like it, and we use fpoint() to draw marker #1. E.g., we do so on Tektronix, GIF, PNM, X, and X Drawable displays. For them, RELATIVE_DOT_SIZE is ignored. */ #define RELATIVE_DOT_SIZE 0.15 /* Argument for filltype(), when we draw the half-filled marker symbols. (This isn't exactly half, but it looks better than half.) */ #define NOMINAL_HALF 0xa000 int _API_fmarker (R___(Plotter *_plotter) double x, double y, int type, double size) { bool drawn; char label_buf[2]; double x_dev, y_dev, delta_x_dev, delta_y_dev; double delta_x_user = 0.0, delta_y_user = 0.0; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fmarker: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* update our notion of position */ _plotter->drawstate->pos.x = x; _plotter->drawstate->pos.y = y; if (_plotter->drawstate->pen_type == 0) /* no pen to draw with, so do nothing */ return 0; /* attempt to draw marker in a Plotter-specific way */ drawn = _plotter->paint_marker (R___(_plotter) type, size); if (drawn) return 0; /* Plotter couldn't do it, so draw the marker in a generic way, by constructing it from other libplot primitives. */ if (type < 0) /* silently return if marker type < 0 */ return 0; type %= 256; /* compute marker type mod 256 */ /* begin by saving drawing attributes we may change */ _API_savestate (S___(_plotter)); if (_plotter->data->display_coors_type != (int)DISP_DEVICE_COORS_REAL) /* move temporarily to nearest point with integer device coordinates, so that marker will be symmetrically positioned */ { x_dev = XD(x, y); y_dev = YD(x, y); delta_x_dev = IROUND(x_dev) - x_dev; delta_y_dev = IROUND(y_dev) - y_dev; delta_x_user = XUV(delta_x_dev, delta_y_dev); delta_y_user = YUV(delta_x_dev, delta_y_dev); _plotter->drawstate->pos.x += delta_x_user; _plotter->drawstate->pos.y += delta_y_user; } if (type > 31) /* plot a single character, in current font */ { _API_pentype (R___(_plotter) 1); _API_ffontsize (R___(_plotter) size); _API_textangle (R___(_plotter) 0); label_buf[0] = (char)type; label_buf[1] = '\0'; _API_alabel (R___(_plotter) 'c', 'c', label_buf); } else /* plot a handcrafted marker symbol */ { _API_pentype (R___(_plotter) 1); _API_linemod (R___(_plotter) "solid"); _API_capmod (R___(_plotter) "butt"); _API_joinmod (R___(_plotter) "miter"); _API_flinewidth (R___(_plotter) LINE_SCALE * size); _API_fillcolor (R___(_plotter) _plotter->drawstate->fgcolor.red, _plotter->drawstate->fgcolor.green, _plotter->drawstate->fgcolor.blue); /* beautification kludge: if display is a bitmap device using libxmi or a compatible scan-conversion scheme, and line thickness is one pixel or less, but not zero, then change it to zero thickess (which will be interpreted as specifying a Bresenham line). */ if ((_plotter->data->display_coors_type == (int)DISP_DEVICE_COORS_INTEGER_LIBXMI) && _plotter->drawstate->quantized_device_line_width == 1) _API_flinewidth (R___(_plotter) 0.0); size *= (0.5 * MAXIMUM_MARKER_DIMENSION); switch (type) /* N.B. 5-pointed star should be added some day */ { case (int)M_NONE: /* no-op */ default: break; case (int)M_DOT: /* dot, GKS 1 */ if (_plotter->data->display_model_type == (int)DISP_MODEL_PHYSICAL || _plotter->data->display_coors_type ==(int)DISP_DEVICE_COORS_REAL) { _API_filltype (R___(_plotter) 1); _API_fcirclerel (R___(_plotter) 0.0, 0.0, RELATIVE_DOT_SIZE * size); } else /* see comment above */ _API_fpointrel (R___(_plotter) 0.0, 0.0); break; case (int)M_PLUS: /* plus, GKS 2 */ _API_fmoverel (R___(_plotter) -size, 0.0); _API_fcontrel (R___(_plotter) 2 * size, 0.0); _API_fmoverel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) 0.0, 2 * size); _API_fmoverel (R___(_plotter) 0.0, -size); break; case (int)M_ASTERISK: /* asterisk, GKS 3 */ { double vert = 0.5 * size; double hori = 0.5 * M_SQRT3 * size; _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) 0.0, 2 * size); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) hori, vert); _API_fmoverel (R___(_plotter) -hori, -vert); _API_fcontrel (R___(_plotter) -hori, -vert); _API_fmoverel (R___(_plotter) hori, vert); _API_fcontrel (R___(_plotter) hori, -vert); _API_fmoverel (R___(_plotter) -hori, vert); _API_fcontrel (R___(_plotter) -hori, vert); _API_fmoverel (R___(_plotter) hori, -vert); } break; case (int)M_CIRCLE: /* circle, GKS 4 */ _API_filltype (R___(_plotter) 0); _API_fcirclerel (R___(_plotter) 0.0, 0.0, size); break; case (int)M_CROSS: /* cross, GKS 5 */ _API_fmoverel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) 2 * size, 2 * size); _API_fmoverel (R___(_plotter) 0.0, - 2 * size); _API_fcontrel (R___(_plotter) -2 * size, 2 * size); _API_fmoverel (R___(_plotter) size, -size); break; case (int)M_STAR: /* star */ _API_fmoverel (R___(_plotter) -size, 0.0); _API_fcontrel (R___(_plotter) 2 * size, 0.0); _API_fmoverel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) 0.0, 2 * size); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) size, size); _API_fmoverel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) size, -size); _API_fmoverel (R___(_plotter) -size, size); _API_fcontrel (R___(_plotter) -size, size); _API_fmoverel (R___(_plotter) size, -size); _API_fcontrel (R___(_plotter) -size, -size); _API_fmoverel (R___(_plotter) size, size); break; case (int)M_SQUARE: /* square */ _API_filltype (R___(_plotter) 0); _API_fboxrel (R___(_plotter) -size, -size, size, size); _API_fmoverel (R___(_plotter) -size, -size); break; case (int)M_DIAMOND: /* diamond */ _API_filltype (R___(_plotter) 0); _API_fmoverel (R___(_plotter) size, 0.0); _API_fcontrel (R___(_plotter) -size, size); _API_fcontrel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) size, -size); _API_fcontrel (R___(_plotter) size, size); _API_fmoverel (R___(_plotter) -size, 0.0); break; case (int)M_TRIANGLE: /* triangle */ { double halfwidth = 0.5 * M_SQRT3 * size; _API_filltype (R___(_plotter) 0); _API_fmoverel (R___(_plotter) 0.0, size); _API_fcontrel (R___(_plotter) halfwidth, -1.5 * size); _API_fcontrel (R___(_plotter) -2 * halfwidth, 0.0); _API_fcontrel (R___(_plotter) halfwidth, 1.5 * size); _API_fmoverel (R___(_plotter) 0.0, -size); } break; case (int)M_INVERTED_TRIANGLE: /* triangle, vertex down */ { double halfwidth = 0.5 * M_SQRT3 * size; _API_filltype (R___(_plotter) 0); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) halfwidth, 1.5 * size); _API_fcontrel (R___(_plotter) -2 * halfwidth, 0.0); _API_fcontrel (R___(_plotter) halfwidth, -1.5 * size); _API_fmoverel (R___(_plotter) 0.0, size); } break; case (int)M_FILLED_SQUARE: /* filled square */ _API_filltype (R___(_plotter) 1); _API_fboxrel (R___(_plotter) -size, -size, size, size); _API_fmoverel (R___(_plotter) -size, -size); break; case (int)M_FILLED_DIAMOND: /* filled diamond */ _API_filltype (R___(_plotter) 1); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) size, size); _API_fcontrel (R___(_plotter) -size, size); _API_fcontrel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) size, -size); _API_fmoverel (R___(_plotter) 0.0, size); break; case (int)M_FILLED_TRIANGLE: /* filled triangle */ { double halfwidth = 0.5 * M_SQRT3 * size; _API_filltype (R___(_plotter) 1); _API_fmoverel (R___(_plotter) 0.0, size); _API_fcontrel (R___(_plotter) halfwidth, -1.5 * size); _API_fcontrel (R___(_plotter) -2 * halfwidth, 0.0); _API_fcontrel (R___(_plotter) halfwidth, 1.5 * size); _API_fmoverel (R___(_plotter) 0.0, -size); } break; case (int)M_FILLED_INVERTED_TRIANGLE: /* filled triangle, vertex down*/ { double halfwidth = 0.5 * M_SQRT3 * size; _API_filltype (R___(_plotter) 1); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) halfwidth, 1.5 * size); _API_fcontrel (R___(_plotter) -2 * halfwidth, 0.0); _API_fcontrel (R___(_plotter) halfwidth, -1.5 * size); _API_fmoverel (R___(_plotter) 0.0, size); } break; case (int)M_FILLED_CIRCLE: /* filled circle */ _API_filltype (R___(_plotter) 1); _API_fcirclerel (R___(_plotter) 0.0, 0.0, size); break; case (int)M_STARBURST: /* starburst */ _API_fmoverel (R___(_plotter) -0.5 * size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, 0.0); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 0.5 * size, 0.0); _API_fcontrel (R___(_plotter) 0.0, -0.5 * size); _API_fmoverel (R___(_plotter) size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 0.0, 0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.0); _API_fmoverel (R___(_plotter) 0.0, size); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) -0.5 * size, 0.0); _API_fcontrel (R___(_plotter) 0.0, 0.5 * size); _API_fmoverel (R___(_plotter) -size, 0.0); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) 0.5 * size, -0.5 * size); break; case (int)M_FANCY_PLUS: /* ornate plus */ _API_fmoverel (R___(_plotter) -size, 0.0); _API_fcontrel (R___(_plotter) 2 * size, 0.0); _API_fmoverel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) 0.0, 2 * size); _API_fmoverel (R___(_plotter) 0.5 * size, 0.0); _API_fcontrel (R___(_plotter) -size, 0.0); _API_fmoverel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.0, -size); _API_fmoverel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) size, 0.0); _API_fmoverel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, size); _API_fmoverel (R___(_plotter) -size, 0.0); break; case (int)M_FANCY_CROSS: /* ornate cross */ _API_fmoverel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) 2 * size, 2 * size); _API_fmoverel (R___(_plotter) 0.0, -2 * size); _API_fcontrel (R___(_plotter) -2 * size, 2 * size); _API_fmoverel (R___(_plotter) 2 * size, -0.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) -size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) size, 0.0); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) -size, 0.5 * size); break; case (int)M_FANCY_SQUARE: /* ornate square */ _API_filltype (R___(_plotter) 0); _API_fboxrel (R___(_plotter) -0.5 * size, -0.5 * size, 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) -1.5 * size, -1.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) 1.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) -1.5 * size, 1.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 1.5 * size, -1.5 * size); break; case (int)M_FANCY_DIAMOND: /* diamond */ _API_filltype (R___(_plotter) 0); _API_fmoverel (R___(_plotter) 0.5 * size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_endpath (S___(_plotter)); _API_fcontrel (R___(_plotter) 0.5 * size, 0.0); _API_fmoverel (R___(_plotter) -size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, 0.5 * size); _API_fmoverel (R___(_plotter) -0.5 * size, -size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.0); _API_fmoverel (R___(_plotter) size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.0, -0.5 * size); _API_fmoverel (R___(_plotter) 0.0, size); break; case (int)M_FILLED_FANCY_SQUARE: /* filled ornate square */ _API_filltype (R___(_plotter) 1); _API_fboxrel (R___(_plotter) -0.5 * size, -0.5 * size, 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) -1.5 * size, -1.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) 1.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) -1.5 * size, 1.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 1.5 * size, -1.5 * size); break; case (int)M_FILLED_FANCY_DIAMOND: /* filled ornate diamond */ _API_filltype (R___(_plotter) 1); _API_fmoverel (R___(_plotter) 0.5 * size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_endpath (S___(_plotter)); _API_fcontrel (R___(_plotter) 0.5 * size, 0.0); _API_fmoverel (R___(_plotter) -size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, 0.5 * size); _API_fmoverel (R___(_plotter) -0.5 * size, -size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.0); _API_fmoverel (R___(_plotter) size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.0, -0.5 * size); _API_fmoverel (R___(_plotter) 0.0, size); break; case (int)M_HALF_FILLED_SQUARE: /* half_filled square */ _API_filltype (R___(_plotter) NOMINAL_HALF); _API_fboxrel (R___(_plotter) -size, -size, size, size); _API_fmoverel (R___(_plotter) -size, -size); break; case (int)M_HALF_FILLED_DIAMOND: /* half_filled diamond */ _API_filltype (R___(_plotter) NOMINAL_HALF); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) size, size); _API_fcontrel (R___(_plotter) -size, size); _API_fcontrel (R___(_plotter) -size, -size); _API_fcontrel (R___(_plotter) size, -size); _API_fmoverel (R___(_plotter) 0.0, size); break; case (int)M_HALF_FILLED_TRIANGLE: /* half_filled triangle */ { double halfwidth = 0.5 * M_SQRT3 * size; _API_filltype (R___(_plotter) NOMINAL_HALF); _API_fmoverel (R___(_plotter) 0.0, size); _API_fcontrel (R___(_plotter) halfwidth, -1.5 * size); _API_fcontrel (R___(_plotter) -2 * halfwidth, 0.0); _API_fcontrel (R___(_plotter) halfwidth, 1.5 * size); _API_fmoverel (R___(_plotter) 0.0, -size); } break; case (int)M_HALF_FILLED_INVERTED_TRIANGLE: /* half_filled triangle, vertex down */ { double halfwidth = 0.5 * M_SQRT3 * size; _API_filltype (R___(_plotter) NOMINAL_HALF); _API_fmoverel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) halfwidth, 1.5 * size); _API_fcontrel (R___(_plotter) -2 * halfwidth, 0.0); _API_fcontrel (R___(_plotter) halfwidth, -1.5 * size); _API_fmoverel (R___(_plotter) 0.0, size); } break; case (int)M_HALF_FILLED_CIRCLE: /* half_filled circle */ _API_filltype (R___(_plotter) NOMINAL_HALF); _API_fcirclerel (R___(_plotter) 0.0, 0.0, size); break; case (int)M_HALF_FILLED_FANCY_SQUARE: /* half-filled ornate square */ _API_filltype (R___(_plotter) NOMINAL_HALF); _API_fboxrel (R___(_plotter) -0.5 * size, -0.5 * size, 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) -1.5 * size, -1.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) 1.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) -1.5 * size, 1.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fmoverel (R___(_plotter) 1.5 * size, -1.5 * size); break; case (int)M_HALF_FILLED_FANCY_DIAMOND: /* half-filled ornate diamond */ _API_filltype (R___(_plotter) NOMINAL_HALF); _API_fmoverel (R___(_plotter) 0.5 * size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_endpath (S___(_plotter)); _API_fcontrel (R___(_plotter) 0.5 * size, 0.0); _API_fmoverel (R___(_plotter) -size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, 0.5 * size); _API_fmoverel (R___(_plotter) -0.5 * size, -size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.0); _API_fmoverel (R___(_plotter) size, -0.5 * size); _API_fcontrel (R___(_plotter) 0.0, -0.5 * size); _API_fmoverel (R___(_plotter) 0.0, size); break; case (int)M_OCTAGON: /* octagon */ _API_filltype (R___(_plotter) 0); _API_fmoverel (R___(_plotter) -size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) size, 0.0); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) -size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) size, -0.5 * size); break; case (int)M_FILLED_OCTAGON: /* filled octagon */ _API_filltype (R___(_plotter) 1); _API_fmoverel (R___(_plotter) -size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, -size); _API_fcontrel (R___(_plotter) 0.5 * size, -0.5 * size); _API_fcontrel (R___(_plotter) size, 0.0); _API_fcontrel (R___(_plotter) 0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) 0.0, size); _API_fcontrel (R___(_plotter) -0.5 * size, 0.5 * size); _API_fcontrel (R___(_plotter) -size, 0.0); _API_fcontrel (R___(_plotter) -0.5 * size, -0.5 * size); _API_fmoverel (R___(_plotter) size, -0.5 * size); break; } } if (_plotter->data->display_coors_type != (int)DISP_DEVICE_COORS_REAL) /* undo the small repositioning (see above) */ { _plotter->drawstate->pos.x -= delta_x_user; _plotter->drawstate->pos.y -= delta_y_user; } /* restore the original values of all drawing attributes */ _API_restorestate (S___(_plotter)); return 0; } /* The paint_marker method, which is an internal function that is called when the marker() method is invoked. It plots an object: a marker of a specified type, at a specified size, at the current location. If this returns `false', marker() will construct the marker from other libplot primitives, in a generic way. */ /* Nearly all Plotters use this version, which does nothing but returns `false'. */ bool _pl_g_paint_marker (R___(Plotter *_plotter) int type, double size) { return false; } plotutils-2.6/libplot/g_matrix.c0000644000175000017500000001050311037243261013762 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* Computes the product of two PS-style transformation matrices (i.e. matrix representations of affine transformations). */ void _matrix_product (const double m[6], const double n[6], double product[6]) { double local_product[6]; local_product[0] = m[0] * n[0] + m[1] * n[2]; local_product[1] = m[0] * n[1] + m[1] * n[3]; local_product[2] = m[2] * n[0] + m[3] * n[2]; local_product[3] = m[2] * n[1] + m[3] * n[3]; local_product[4] = m[4] * n[0] + m[5] * n[2] + n[4]; local_product[5] = m[4] * n[1] + m[5] * n[3] + n[5]; memcpy (product, local_product, 6 * sizeof (double)); return; } /* Computes the inverse of a PS-style transformation matrix, which should be nonsingular for correct results. */ void _matrix_inverse (const double m[6], double inverse[6]) { double det = m[0] * m[3] - m[1] * m[2]; if (det == 0.0) /* bogus */ inverse[0] = inverse[1] = inverse[2] = inverse[3] = inverse[4] = inverse[5] = 0.0; else { double invdet = 1.0 / det; inverse[0] = invdet * m[3]; inverse[1] = - invdet * m[1]; inverse[2] = - invdet * m[2]; inverse[3] = invdet * m[0]; inverse[4] = invdet * (m[2] * m[5] - m[3] * m[4]); inverse[5] = invdet * (m[1] * m[4] - m[0] * m[5]); } } /* _matrix_norm computes the matrix norm (in the l^2 sense) of the linear transformation part of a PS-style transformation matrix. Actually we compute instead the geometric mean of the l^1 and l^infinity norms. By Hadamard's 3-line theorem, this geometric mean is an upper bound on the true l^2 norm. This function is called only to select appropriate line widths and font sizes. For the purposes of those functions, the above approximation should suffice. */ double _matrix_norm (const double m[6]) { double mt[4], pm[4]; double norm1, norm2; double a[4]; int i; mt[0] = m[0]; /* transpose of m */ mt[1] = m[2]; mt[2] = m[1]; mt[3] = m[3]; pm[0] = m[0] * mt[0] + m[1] * mt[2]; /* pm = m * mt */ pm[1] = m[0] * mt[1] + m[1] * mt[3]; pm[2] = m[2] * mt[0] + m[3] * mt[2]; pm[3] = m[2] * mt[1] + m[3] * mt[3]; for (i = 0; i < 4; i++) a[i] = fabs(pm[i]); /* compute l^1 and l^infinity norms of m * mt */ norm1 = DMAX(a[0]+a[1], a[2]+a[3]); norm2 = DMAX(a[0]+a[2], a[1]+a[3]); /* l^2 norm of m is sqrt of l^2 norm of m * mt */ return sqrt(sqrt(norm1 * norm2)); } /* Compute the minimum and maximum singular values of a 2-by-2 matrix M. The singular values are the square roots of the eigenvalues of M times its transpose. */ void _matrix_sing_vals (const double m[6], double *min_sing_val, double *max_sing_val) { double mt[4], pm[4]; double trace, det, disc, sqrtdisc; double s1, s2; mt[0] = m[0]; /* transpose of m */ mt[1] = m[2]; mt[2] = m[1]; mt[3] = m[3]; pm[0] = m[0] * mt[0] + m[1] * mt[2]; /* pm = m * mt */ pm[1] = m[0] * mt[1] + m[1] * mt[3]; pm[2] = m[2] * mt[0] + m[3] * mt[2]; pm[3] = m[2] * mt[1] + m[3] * mt[3]; trace = pm[0] + pm[3]; det = pm[0] * pm[3] - pm[1] * pm[2]; /* s^2 + b s + c = 0, where b = -trace, c = det */ disc = trace * trace - 4.0 * det; disc = DMAX(0.0, disc); /* paranoia */ sqrtdisc = sqrt (disc); s1 = 0.5 * (trace - sqrtdisc); s2 = 0.5 * (trace + sqrtdisc); s1 = DMAX(0.0, s1); /* paranoia */ s2 = DMAX(0.0, s2); /* paranoia */ *min_sing_val = sqrt(s1); *max_sing_val = sqrt(s2); } plotutils-2.6/libplot/g_miscmi.c0000644000175000017500000001326611037243261013750 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains a function called by Bitmap Plotters (including PNM Plotters), and GIF Plotters, just before drawing. It sets the attributes in the graphics context (of type `miGC') used by the libxmi scan conversion routines. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" /* use libxmi scan conversion module */ /* libxmi joinstyles, indexed by internal number (miter/rd./bevel/triangular)*/ static const int mi_join_style[] = { MI_JOIN_MITER, MI_JOIN_ROUND, MI_JOIN_BEVEL, MI_JOIN_TRIANGULAR }; /* libxmi capstyles, indexed by internal number (butt/rd./project/triangular)*/ static const int mi_cap_style[] = { MI_CAP_BUTT, MI_CAP_ROUND, MI_CAP_PROJECTING, MI_CAP_TRIANGULAR }; void _set_common_mi_attributes (plDrawState *drawstate, void * ptr) { int line_style, num_dashes, offset; unsigned int *dashbuf; bool dash_array_allocated = false; miGCAttribute attributes[5]; int values [5]; unsigned int local_dashbuf[PL_MAX_DASH_ARRAY_LEN]; miGC *pGC; pGC = (miGC *)ptr; /* recover passed libxmi GC */ /* set all miGC attributes that are not dash related */ /* set five integer-valued miGC attributes */ attributes[0] = MI_GC_FILL_RULE; values[0] = (drawstate->fill_rule_type == PL_FILL_NONZERO_WINDING ? MI_WINDING_RULE : MI_EVEN_ODD_RULE); attributes[1] = MI_GC_JOIN_STYLE; values[1] = mi_join_style[drawstate->join_type]; attributes[2] = MI_GC_CAP_STYLE; values[2] = mi_cap_style[drawstate->cap_type]; attributes[3] = MI_GC_ARC_MODE; values[3] = MI_ARC_CHORD; /* libplot convention */ attributes[4] = MI_GC_LINE_WIDTH; values[4] = drawstate->quantized_device_line_width; miSetGCAttribs (pGC, 5, attributes, values); /* set a double-valued miGC attribute */ miSetGCMiterLimit (pGC, drawstate->miter_limit); /* now determine and set dashing-related attributes */ if (drawstate->dash_array_in_effect) /* have user-specified dash array */ { int i; num_dashes = drawstate->dash_array_len; if (num_dashes > 0) /* non-solid line type */ { bool odd_length; double min_sing_val, max_sing_val; int dash_cycle_length; /* compute minimum singular value of user->device coordinate map, which we use as a multiplicative factor to convert line widths (cf. g_linewidth.c), dash lengths, etc. */ _matrix_sing_vals (drawstate->transform.m, &min_sing_val, &max_sing_val); line_style = MI_LINE_ON_OFF_DASH; odd_length = (num_dashes & 1 ? true : false); { int array_len; array_len = (odd_length ? 2 : 1) * num_dashes; if (array_len <= PL_MAX_DASH_ARRAY_LEN) dashbuf = local_dashbuf; /* use dash buffer on stack */ else { dashbuf = (unsigned int *)_pl_xmalloc (array_len * sizeof(unsigned int)); dash_array_allocated = true; } } dash_cycle_length = 0; for (i = 0; i < num_dashes; i++) { double unrounded_dashlen; int dashlen; unrounded_dashlen = min_sing_val * drawstate->dash_array[i]; dashlen = IROUND(unrounded_dashlen); dashlen = IMAX(dashlen, 1); dashbuf[i] = (unsigned int)dashlen; dash_cycle_length += dashlen; if (odd_length) { dashbuf[num_dashes + i] = (unsigned int)dashlen; dash_cycle_length += dashlen; } } if (odd_length) num_dashes *= 2; offset = IROUND(min_sing_val * drawstate->dash_offset); if (dash_cycle_length > 0) /* choose an offset in range 0..dash_cycle_length-1 */ { while (offset < 0) offset += dash_cycle_length; offset %= dash_cycle_length; } } else /* zero-length dash array, i.e. solid line type */ { line_style = MI_LINE_SOLID; dashbuf = NULL; offset = 0; } } else /* have one of the canonical line types */ { if (drawstate->line_type == PL_L_SOLID) { line_style = MI_LINE_SOLID; num_dashes = 0; dashbuf = NULL; offset = 0; } else { const int *dash_array; int scale, i; line_style = MI_LINE_ON_OFF_DASH; num_dashes = _pl_g_line_styles[drawstate->line_type].dash_array_len; dash_array = _pl_g_line_styles[drawstate->line_type].dash_array; dashbuf = local_dashbuf; /* it is large enough */ offset = 0; /* scale by line width in terms of pixels, if nonzero */ scale = drawstate->quantized_device_line_width; if (scale <= 0) scale = 1; for (i = 0; i < num_dashes; i++) { int dashlen; dashlen = scale * dash_array[i]; dashlen = IMAX(dashlen, 1); dashbuf[i] = (unsigned int)dashlen; } } } /* set dash-related attributes in libxmi's graphics context */ miSetGCAttrib (pGC, MI_GC_LINE_STYLE, line_style); if (line_style != (int)MI_LINE_SOLID) miSetGCDashes (pGC, num_dashes, dashbuf, offset); if (dash_array_allocated) free (dashbuf); } plotutils-2.6/libplot/g_move.c0000644000175000017500000000313311037243261013425 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the move method, which is a standard part of libplot. It sets a drawing attribute: the location of the graphics cursor, which determines the position of the next object drawn on the graphics device. */ #include "sys-defines.h" #include "extern.h" int _API_fmove (R___(Plotter *_plotter) double x, double y) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fmove: invalid operation"); return -1; } /* flush path under construction, if any */ if (_plotter->drawstate->path) _API_endpath (S___(_plotter)); _plotter->drawstate->pos.x = x; /* update our notion of position */ _plotter->drawstate->pos.y = y; return 0; } plotutils-2.6/libplot/g_openpl.c0000644000175000017500000002242211037243261013756 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the openpl method, which is a standard part of libplot. It opens a Plotter object. */ #include "sys-defines.h" #include "extern.h" int _API_openpl (S___(Plotter *_plotter)) { bool retval; if (_plotter->data->open) { _plotter->error (R___(_plotter) "openpl: invalid operation"); return -1; } /* prepare buffer in which we'll cache graphics code for this page */ switch ((int)_plotter->data->output_model) { case (int)PL_OUTPUT_NONE: /* a single page buffer is created here, and will be deleted by closepl(); it's never actually written out */ _plotter->data->page = _new_outbuf (); break; break; case (int)PL_OUTPUT_ONE_PAGE: case (int)PL_OUTPUT_ONE_PAGE_AT_A_TIME: /* a single page buffer is created here, and will be written out and deleted by closepl(); in the former case, only page #1 is written out */ _plotter->data->page = _new_outbuf (); break; case (int)PL_OUTPUT_PAGES_ALL_AT_ONCE: { plOutbuf *new_page = _new_outbuf(); if (_plotter->data->opened == false) /* first page */ { _plotter->data->page = new_page; /* Save a pointer to the first page, since we'll be caching all pages until the Plotter is deleted. */ _plotter->data->first_page = new_page; } else /* add new page to tail of list, update pointer to current page */ { _plotter->data->page->next = new_page; _plotter->data->page = new_page; } } break; case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES: case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME: case (int)PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM: /* Plotter does its own output, and doesn't use libplot's plOutbuf-based output system */ _plotter->data->page = (plOutbuf *)NULL; break; default: /* shouldn't happen */ break; } /* flag device as open */ _plotter->data->open = true; _plotter->data->opened = true; _plotter->data->page_number++; /* keep track of these; some lusers don't invoke ffontsize() or flinewidth(), so we need to choose a reasonable font size and/or line width for them */ _plotter->data->fontsize_invoked = false; _plotter->data->linewidth_invoked = false; /* frames in page are numbered starting with zero */ _plotter->data->frame_number = 0; /* create first drawing state, add it to the linked list of drawing states (this fills in only the device-independent part of the state) */ _pl_g_create_first_drawing_state (S___(_plotter)); /* copy background color, accessible to the user as a Plotter parameter, to the drawing state */ { const char *bg_color_name_s; bg_color_name_s = (const char *)_get_plot_param (_plotter->data, "BG_COLOR"); if (bg_color_name_s) _API_bgcolorname (R___(_plotter) bg_color_name_s); } /* invoke Plotter-specific `begin page' method, to create device-dependent part of drawing state, if any; and possibly, do device-specific initializations of Plotter variables, such as the (NDC_frame)->(device_frame) map, which some Plotters initialize, once they've realized how large their device-space drawing region will be, by calling _compute_ndc_to_device_map() in g_space.c */ retval = _plotter->begin_page (S___(_plotter)); /* Set the composite (user frame)->(NDC_frame->(device frame) map in the drawing state, as if fsetmatrix() had been called. At this point, the (user_frame)->(NDC_frame) map is the default, i.e., the identity, and we pass it to fsetmatrix as its argument. The fsetmatrix method computes the (user_frame)->(NDC_frame)->(device_frame) map by composing the (user_frame)->(NDC frame) map with the (NDC_frame)->(device_frame) map (mentioned above). Any subsequent user invocations of fsetmatrix() will not affect the latter. */ _API_fsetmatrix (R___(_plotter) _plotter->drawstate->transform.m_user_to_ndc[0], _plotter->drawstate->transform.m_user_to_ndc[1], _plotter->drawstate->transform.m_user_to_ndc[2], _plotter->drawstate->transform.m_user_to_ndc[3], _plotter->drawstate->transform.m_user_to_ndc[4], _plotter->drawstate->transform.m_user_to_ndc[5]); return (retval == true ? 0 : -1); } /* Plotter-specific initializations that take place when openpl() is invoked. In a generic Plotter, this does nothing. */ bool _pl_g_begin_page (S___(Plotter *_plotter)) { return true; } /* Create a new drawing state that will become the first drawing state in a Plotter's linked list of drawing states. See above. */ void _pl_g_create_first_drawing_state (S___(Plotter *_plotter)) { plDrawState *drawstate; const plDrawState *copyfrom; char *fill_rule, *line_mode, *join_mode, *cap_mode; /* create a new state */ drawstate = (plDrawState *)_pl_xmalloc (sizeof(plDrawState)); /* copy from default drawing state (see g_defstate.c) */ copyfrom = &_default_drawstate; memcpy (drawstate, copyfrom, sizeof(plDrawState)); /* elements of state that are strings are treated specially */ fill_rule = (char *)_pl_xmalloc (strlen (copyfrom->fill_rule) + 1); line_mode = (char *)_pl_xmalloc (strlen (copyfrom->line_mode) + 1); join_mode = (char *)_pl_xmalloc (strlen (copyfrom->join_mode) + 1); cap_mode = (char *)_pl_xmalloc (strlen (copyfrom->cap_mode) + 1); strcpy (fill_rule, copyfrom->fill_rule); strcpy (line_mode, copyfrom->line_mode); strcpy (join_mode, copyfrom->join_mode); strcpy (cap_mode, copyfrom->cap_mode); drawstate->fill_rule = fill_rule; drawstate->line_mode = line_mode; drawstate->join_mode = join_mode; drawstate->cap_mode = cap_mode; /* dash array, if non-empty, is treated specially too */ if (copyfrom->dash_array_len > 0) { int i; double *dash_array; dash_array = (double *)_pl_xmalloc (copyfrom->dash_array_len * sizeof(double)); for (i = 0; i < copyfrom->dash_array_len; i++) dash_array[i] = copyfrom->dash_array[i]; drawstate->dash_array = dash_array; } /* The font_name, true_font_name, font_type, typeface_index, and font_index fields are special, since for the initial drawing state they're Plotter-dependent. The fill_rule_type field is also treated specially in the initial drawing state, because not all Plotters support both types of filling (odd vs. nonzero winding number). */ { const char *font_name_init; char *font_name, *true_font_name; int typeface_index, font_index; switch (_plotter->data->default_font_type) { case PL_F_HERSHEY: default: font_name_init = PL_DEFAULT_HERSHEY_FONT; typeface_index = PL_DEFAULT_HERSHEY_TYPEFACE_INDEX; font_index = PL_DEFAULT_HERSHEY_FONT_INDEX; break; case PL_F_POSTSCRIPT: font_name_init = PL_DEFAULT_POSTSCRIPT_FONT; typeface_index = PL_DEFAULT_POSTSCRIPT_TYPEFACE_INDEX; font_index = PL_DEFAULT_POSTSCRIPT_FONT_INDEX; break; case PL_F_PCL: font_name_init = PL_DEFAULT_PCL_FONT; typeface_index = PL_DEFAULT_PCL_TYPEFACE_INDEX; font_index = PL_DEFAULT_PCL_FONT_INDEX; break; case PL_F_STICK: font_name_init = PL_DEFAULT_STICK_FONT; typeface_index = PL_DEFAULT_STICK_TYPEFACE_INDEX; font_index = PL_DEFAULT_STICK_FONT_INDEX; break; } font_name = (char *)_pl_xmalloc (strlen (font_name_init) + 1); strcpy (font_name, font_name_init); drawstate->font_name = font_name; true_font_name = (char *)_pl_xmalloc (strlen (font_name_init) + 1); strcpy (true_font_name, font_name_init); drawstate->true_font_name = true_font_name; drawstate->font_type = _plotter->data->default_font_type; drawstate->typeface_index = typeface_index; drawstate->font_index = font_index; /* Examine default fill mode. If Plotter doesn't support it, use the other fill mode. */ if (drawstate->fill_rule_type == PL_FILL_ODD_WINDING && _plotter->data->have_odd_winding_fill == 0) drawstate->fill_rule_type = PL_FILL_NONZERO_WINDING; else if (drawstate->fill_rule_type == PL_FILL_NONZERO_WINDING && _plotter->data->have_nonzero_winding_fill == 0) drawstate->fill_rule_type = PL_FILL_ODD_WINDING; } /* page begins with no compound path under construction */ drawstate->path = (plPath *)NULL; drawstate->paths = (plPath **)NULL; drawstate->num_paths = 0; /* install new state at head of the state list */ drawstate->previous = NULL; _plotter->drawstate = drawstate; } plotutils-2.6/libplot/g_outbuf.c0000644000175000017500000001770311037243261013773 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains routines for creating, manipulating, and deleting a special sort of output buffer: a plOutbuf. They are invoked by drawing methods for Plotters that do not do real-time output. Such Plotters store the device code for each page of graphics in a plOutbuf. Along with a page of device code, a plOutbuf optionally stores bounding box information for the page. plOutbufs are resized when they are too full. The strange resizing method (_UPDATE_BUFFER) is needed because on many systems, sprintf() does not return the number of characters it writes. _UPDATE_BUFFER must be called after each call to sprintf(); it is not invoked automatically. Output buffers of this sort are a bit of a kludge. They may eventually be replaced or supplemented by an in-core object hierarchy, which deletepl() will scan. When erase() is invoked on the Plotter, _RESET_OUTBUF is called, to remove all graphics from the plOutbuf. There is provision for keeping a section of initialization code in the plOutbuf, untouched. This is arranged by a previous call to _FREEZE_OUTBUF. Anything in the plOutbuf at that time will be untouched by a later call to _RESET_OUTBUF. */ #include "sys-defines.h" #include "extern.h" /* Initial length for a plOutbuf (should be large enough to handle any single one of our sprintf's or strcpy's [including final NUL], or other write operations, without overflow). Note: in p_defplot.c we write long blocks of Postscript initialization code (see p_header.h) into a plOutbuf, so this should be quite large. We may also write large substrings into a plOutbuf in c_emit.c. */ #define INITIAL_OUTBUF_LEN 8192 /* New (larger) length of a plOutbuf, as function of the old; used when reallocating due to exhaustion of storage. */ #define NEW_OUTBUF_LEN(old_outbuf_len) ((old_outbuf_len) < 10000000 ? 2 * (old_outbuf_len) : (old_outbuf_len) + 10000000) plOutbuf * _new_outbuf (void) { plOutbuf *bufp; bufp = (plOutbuf *)_pl_xmalloc(sizeof(plOutbuf)); bufp->header = (plOutbuf *)NULL; bufp->trailer = (plOutbuf *)NULL; bufp->base = (char *)_pl_xmalloc(INITIAL_OUTBUF_LEN * sizeof(char)); bufp->len = (unsigned long)INITIAL_OUTBUF_LEN; bufp->next = NULL; bufp->reset_point = bufp->base; bufp->reset_contents = (unsigned long)0L; _reset_outbuf (bufp); return bufp; } void _reset_outbuf (plOutbuf *bufp) { int i; *(bufp->reset_point) = '\0'; bufp->point = bufp->reset_point; bufp->contents = bufp->reset_contents; /* also initialize elements used by some drivers */ /* initialize bounding box to an empty (self-contradictory) box */ bufp->xrange_min = DBL_MAX; bufp->xrange_max = -(DBL_MAX); bufp->yrange_min = DBL_MAX; bufp->yrange_max = -(DBL_MAX); /* initialize `font used' arrays for the page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) bufp->ps_font_used[i] = false; for (i = 0; i < PL_NUM_PCL_FONTS; i++) bufp->pcl_font_used[i] = false; } void _freeze_outbuf (plOutbuf *bufp) { bufp->reset_point = bufp->point; bufp->reset_contents = bufp->contents; } void _delete_outbuf (plOutbuf *bufp) { if (bufp) { free (bufp->base); free (bufp); } } /* UPDATE_BUFFER is called manually, after each sprintf() and other object write operation. It assumes that the buffer is always a null-terminated string, so that strlen() can be used, to determine how many additional characters were added. */ void _update_buffer (plOutbuf *bufp) { int additional; /* determine how many add'l chars were added */ additional = strlen (bufp->point); bufp->point += additional; bufp->contents += additional; if (bufp->contents + 1 > bufp->len) /* need room for NUL */ /* shouldn't happen! */ { fprintf (stderr, "libplot: output buffer overrun\n"); exit (EXIT_FAILURE); } if (bufp->contents > (bufp->len >> 1)) /* expand buffer */ { unsigned long oldlen, newlen; oldlen = bufp->len; newlen = NEW_OUTBUF_LEN(oldlen); bufp->base = (char *)_pl_xrealloc (bufp->base, newlen * sizeof(char)); bufp->len = newlen; bufp->point = bufp->base + bufp->contents; bufp->reset_point = bufp->base + bufp->reset_contents; } } /* A variant of _UPDATE_BUFFER in which the caller specifies how many bytes have been added. Used in cases when the buffer contains something other than a null-terminated string (e.g., raw binary bytes). */ void _update_buffer_by_added_bytes (plOutbuf *bufp, int additional) { bufp->point += additional; bufp->contents += additional; if (bufp->contents + 1 > bufp->len) /* need room for NUL */ /* shouldn't happen! */ { fprintf (stderr, "libplot: output buffer overrun\n"); exit (EXIT_FAILURE); } if (bufp->contents > (bufp->len >> 1)) /* expand buffer */ { unsigned long oldlen, newlen; oldlen = bufp->len; newlen = NEW_OUTBUF_LEN(oldlen); bufp->base = (char *)_pl_xrealloc (bufp->base, newlen * sizeof(char)); bufp->len = newlen; bufp->point = bufp->base + bufp->contents; bufp->reset_point = bufp->base + bufp->reset_contents; } } /* update bounding box information for a plOutbuf, to take account of a point being plotted on the associated page */ void _update_bbox (plOutbuf *bufp, double x, double y) { if (x > bufp->xrange_max) bufp->xrange_max = x; if (x < bufp->xrange_min) bufp->xrange_min = x; if (y > bufp->yrange_max) bufp->yrange_max = y; if (y < bufp->yrange_min) bufp->yrange_min = y; } /* return bounding box information for a plOutbuf */ void _bbox_of_outbuf (plOutbuf *bufp, double *xmin, double *xmax, double *ymin, double *ymax) { double page_x_min = DBL_MAX; double page_y_min = DBL_MAX; double page_x_max = -(DBL_MAX); double page_y_max = -(DBL_MAX); if (bufp) { page_x_max = bufp->xrange_max; page_x_min = bufp->xrange_min; page_y_max = bufp->yrange_max; page_y_min = bufp->yrange_min; } *xmin = page_x_min; *ymin = page_y_min; *xmax = page_x_max; *ymax = page_y_max; } /* compute bounding box information for a linked list of plOutbufs (i.e. pages), starting with a specified plOutbuf (i.e., page) */ void _bbox_of_outbufs (plOutbuf *bufp, double *xmin, double *xmax, double *ymin, double *ymax) { double doc_x_min = DBL_MAX; double doc_y_min = DBL_MAX; double doc_x_max = -(DBL_MAX); double doc_y_max = -(DBL_MAX); double page_x_min, page_x_max, page_y_min, page_y_max; plOutbuf *page = bufp; while (page) { page_x_max = page->xrange_max; page_x_min = page->xrange_min; page_y_max = page->yrange_max; page_y_min = page->yrange_min; if (!((page_x_max < page_x_min || page_y_max < page_y_min))) /* nonempty page */ { if (page_x_max > doc_x_max) doc_x_max = page_x_max; if (page_y_max > doc_y_max) doc_y_max = page_y_max; if (page_x_min < doc_x_min) doc_x_min = page_x_min; if (page_y_min < doc_y_min) doc_y_min = page_y_min; } page = page->next; } *xmin = doc_x_min; *ymin = doc_y_min; *xmax = doc_x_max; *ymax = doc_y_max; } plotutils-2.6/libplot/g_outfile.c0000644000175000017500000000365311037243261014135 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the outfile method, which is a GNU extension to libplot. It selects an output stream for all subsequent plot commands. The outfile method may only be invoked outside an openpl()...closepl() pair. */ /* THIS METHOD IS NOW DEPRECATED. IT WILL SOON GO AWAY. */ #include "sys-defines.h" #include "extern.h" /* outfile takes a single argument, a stream that has been opened for writing. It may be called only outside an openpl()....closepl() pair. It switches all future output to the new, specified stream. The old output stream, which is not closed, is returned. */ FILE * _API_outfile(R___(Plotter *_plotter) FILE *outfile) { FILE *oldoutfile; if (_plotter->data->open) { _plotter->error (R___(_plotter) "outfile: invalid operation"); return (FILE *)NULL; } oldoutfile = _plotter->data->outfp; _plotter->data->outfp = outfile; #ifdef LIBPLOTTER _plotter->data->outstream = NULL; #endif _plotter->data->page_number = 0; /* reset */ return oldoutfile; } plotutils-2.6/libplot/g_pagetype.c0000644000175000017500000001570211037243261014302 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains a utility function, _set_page_type(), which searches the database of known pagetypes for the one specified in the PAGESIZE parameter, sets page-related data (dimensions, size of viewport) in the Plotter, and also passes back the viewport offset vector. The PAGESIZE parameter should be of a form resembling "letter", or "a4", or "letter,xoffset=-1.2in", or "a4,yoffset=0.5cm,xoffset = 2mm". */ #include "sys-defines.h" #include "extern.h" #include "g_pagetype.h" /* forward references */ static bool parse_page_type (const char *pagesize, const plPageData **pagedata, double *xoffset, double *yoffset, double *xorigin, double *yorigin, double *xsize, double *ysize); static bool string_to_inches (const char *string, double *inches); void _set_page_type (plPlotterData *data) { const char *pagesize; const plPageData *pagedata; double viewport_xoffset, viewport_yoffset; double viewport_xorigin, viewport_yorigin; double viewport_xsize, viewport_ysize; /* examine user-specified value for PAGESIZE parameter, or the default value if we can't parse the user-specified value */ pagesize = (const char *)_get_plot_param (data, "PAGESIZE"); if (!parse_page_type (pagesize, &pagedata, &viewport_xoffset, &viewport_yoffset, &viewport_xorigin, &viewport_yorigin, &viewport_xsize, &viewport_ysize)) { pagesize = (const char *)_get_default_plot_param ("PAGESIZE"); parse_page_type (pagesize, &pagedata, &viewport_xoffset, &viewport_yoffset, &viewport_xorigin, &viewport_yorigin, &viewport_xsize, &viewport_ysize); } /* set page data in Plotter */ data->page_data = pagedata; data->viewport_xoffset = viewport_xoffset; data->viewport_yoffset = viewport_yoffset; data->viewport_xorigin = viewport_xorigin; data->viewport_yorigin = viewport_yorigin; data->viewport_xsize = viewport_xsize; data->viewport_ysize = viewport_ysize; } static bool parse_page_type (const char *pagesize, const plPageData **pagedata, double *xoffset, double *yoffset, double *xorigin, double *yorigin, double *xsize, double *ysize) { const plPageData *local_pagedata = _pagedata; char *viewport_pagesize, *first, *next; char xoffset_s[32], yoffset_s[32]; /* each field should have length <=31 */ char xorigin_s[32], yorigin_s[32]; char xsize_s[32], ysize_s[32]; bool anotherfield, success; bool got_xoffset = false, got_yoffset = false; bool got_xorigin = false, got_yorigin = false; bool got_xsize = false, got_ysize = false; int i; viewport_pagesize = (char *)_pl_xmalloc (strlen (pagesize) + 1); strcpy (viewport_pagesize, pagesize); first = viewport_pagesize; next = strchr (viewport_pagesize, (int)','); if (next) { anotherfield = true; *next = '\0'; next++; } else anotherfield = false; /* try to match page type to a page type on our list */ success = false; for (i = 0; i < PL_NUM_PAGESIZES; i++, local_pagedata++) if (strcasecmp (local_pagedata->name, viewport_pagesize) == 0 || (local_pagedata->alt_name && strcasecmp (local_pagedata->alt_name, viewport_pagesize) == 0)) { success = true; break; } if (success) /* matched page type, at least */ { /* pass back pointer to page data via pointer */ *pagedata = local_pagedata; while (anotherfield && *next) /* i.e. while there's a nonempty field */ { first = next; next = strchr (next, (int)','); if (next) { anotherfield = true; *next = '\0'; next++; } else anotherfield = false; /* try to parse field */ if (sscanf (first, "xoffset = %31s", xoffset_s) == 1) got_xoffset = true; else if (sscanf (first, "yoffset = %31s", yoffset_s) == 1) got_yoffset = true; else if (sscanf (first, "xorigin = %31s", xorigin_s) == 1) got_xorigin = true; else if (sscanf (first, "yorigin = %31s", yorigin_s) == 1) got_yorigin = true; else if (sscanf (first, "xsize = %31s", xsize_s) == 1) got_xsize = true; else if (sscanf (first, "ysize = %31s", ysize_s) == 1) got_ysize = true; } /* pass back viewport size-and-location data via pointers */ { double viewport_xsize, viewport_ysize; double viewport_xorigin, viewport_yorigin; double viewport_xoffset, viewport_yoffset; /* xsize, ysize default to this page type's default */ if (!(got_xsize && string_to_inches (xsize_s, &viewport_xsize))) viewport_xsize = local_pagedata->default_viewport_size; if (!(got_ysize && string_to_inches (ysize_s, &viewport_ysize))) viewport_ysize = local_pagedata->default_viewport_size; /* xorigin, yorigin default to whatever is needed to center the viewport on the page */ if (!(got_xorigin && string_to_inches (xorigin_s, &viewport_xorigin))) viewport_xorigin = 0.5 * (local_pagedata->xsize - viewport_xsize); if (!(got_yorigin && string_to_inches (yorigin_s, &viewport_yorigin))) viewport_yorigin = 0.5 * (local_pagedata->ysize - viewport_ysize); /* xoffset, yoffset default to zero */ if (!(got_xoffset && string_to_inches (xoffset_s, &viewport_xoffset))) viewport_xoffset = 0.0; if (!(got_yoffset && string_to_inches (yoffset_s, &viewport_yoffset))) viewport_yoffset = 0.0; *xsize = viewport_xsize; *ysize = viewport_ysize; *xorigin = viewport_xorigin; *yorigin = viewport_yorigin; *xoffset = viewport_xoffset; *yoffset = viewport_yoffset; } } free (viewport_pagesize); /* indicate whether we were able to match the page type */ return success; } /* convert a string representing a distance measurement to inches; units `in', `cm', `mm' are supported */ static bool string_to_inches (const char *string, double *inches) { double val; char s[4]; if (sscanf (string, "%lf %3s" , &val, s) == 2) { if (strlen (s) > 2) return false; if (strcmp (s, "in") == 0) { *inches = val; return true; } else if (strcmp (s, "cm") == 0) { *inches = val / 2.54; return true; } else if (strcmp (s, "mm") == 0) { *inches = val / 25.4; return true; } } return false; } plotutils-2.6/libplot/g_param.c0000644000175000017500000001577411037243261013575 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the PlotterParams class, which is a helper class. A PlotterParams object is used for specifying device driver parameters when a Plotter is instantiated. (In libplot, a PlotterParams struct is created with pl_newplparams() and deleted with pl_deleteplparams(). These are defined in apinewc.c; there is also a copy constructor, pl_copyplparams().) This file also includes the functions that are used for copying the parameters into the Plotter at instantiation time, and for accessing them later. These are Plotter class members. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a PlotterParams struct. */ const PlotterParams _default_plotter_params = { /* methods */ _setplparam }; #endif /* not LIBPLOTTER */ #ifdef LIBPLOTTER PlotterParams::PlotterParams () { int i; for (i = 0; i < NUM_PLOTTER_PARAMETERS; i++) plparams[i] = (void *)NULL; } PlotterParams::~PlotterParams () { int i; for (i = 0; i < NUM_PLOTTER_PARAMETERS; i++) if (_known_params[i].is_string && plparams[i] != NULL) free (plparams[i]); } PlotterParams::PlotterParams (const PlotterParams& oldPlotterParams) { int i; for (i = 0; i < NUM_PLOTTER_PARAMETERS; i++) plparams[i] = oldPlotterParams.plparams[i]; } PlotterParams& PlotterParams::operator= (const PlotterParams& oldPlotterParams) { int i; for (i = 0; i < NUM_PLOTTER_PARAMETERS; i++) plparams[i] = oldPlotterParams.plparams[i]; return (*this); } #endif /* The parameter-setting method. This is a PlotterParams method in libplotter (i.e. it is #defined to be PlotterParams::setplparam). In libplot, a pointer to a PlotterParams struct must be passed to it as its first argument. */ int _setplparam (R___(PlotterParams *_plotter_params) const char *parameter, void * value) { int j; for (j = 0; j < NUM_PLOTTER_PARAMETERS; j++) { if (strcmp (_known_params[j].parameter, parameter) == 0) { if (_known_params[j].is_string) /* parameter value is a string, so treat specially: copy the string, byte by byte */ { if (_plotter_params->plparams[j]) free (_plotter_params->plparams[j]); if (value != NULL) { _plotter_params->plparams[j] = (char *)_pl_xmalloc (strlen ((char *)value) + 1); strcpy ((char *)_plotter_params->plparams[j], (char *)value); } else _plotter_params->plparams[j] = NULL; } else /* parameter value is a (void *), so just copy the user-specified pointer */ _plotter_params->plparams[j] = value; /* matched, so return happily */ return 0; } } /* silently ignore requests to set unknown parameters */ return 0; } /**********************************************************************/ /* This function is called when a Plotter is instantiated. It copies parameters from a PlotterParams object into the Plotter. We adopt the following convention: if the PlotterParams object does not include a value for a parameter, a default value (retrieved in the global _known_params[] array) is used. Unless, that is, an environment variable of the same name has been set, in which case its value is used instead. We support both parameters whose values are strings (which must be copied byte-by-byte) and those whose values are void pointers (which may simply be copied. */ void _pl_g_copy_params_to_plotter (R___(Plotter *_plotter) const PlotterParams *plotter_params) { int j; char *envs; for (j = 0; j < NUM_PLOTTER_PARAMETERS; j++) { if (!_known_params[j].is_string) /* not a string, just copy the void pointer into the plotter */ _plotter->data->params[j] = plotter_params->plparams[j]; else /* parameter value is a string, so use malloc and strcpy */ { if (plotter_params->plparams[j]) /* have user-specified value */ { _plotter->data->params[j] = (char *)_pl_xmalloc (strlen ((char *)plotter_params->plparams[j]) + 1); strcpy ((char *)_plotter->data->params[j], (char *)plotter_params->plparams[j]); } else if ((envs = getenv (_known_params[j].parameter)) != NULL) /* have value of environment variable */ { _plotter->data->params[j] = (char *)_pl_xmalloc (strlen (envs) + 1); strcpy ((char *)_plotter->data->params[j], envs); } else if (_known_params[j].default_value) /* have default libplot value */ { _plotter->data->params[j] = (char *)_pl_xmalloc (strlen ((char *)_known_params[j].default_value) + 1); strcpy ((char *)_plotter->data->params[j], (char *)_known_params[j].default_value); } else /* punt */ _plotter->data->params[j] = NULL; } } } /* This retrieves the value of any specified Plotter parameter, as stored in a Plotter instance. */ void * _get_plot_param (const plPlotterData *data, const char *parameter_name) { int j; for (j = 0; j < NUM_PLOTTER_PARAMETERS; j++) if (strcmp (_known_params[j].parameter, parameter_name) == 0) return data->params[j]; return (void *)NULL; /* name not matched */ } /* This function is called when a Plotter is deleted, to delete the instance-specific copies of Plotter parameters. */ void _pl_g_free_params_in_plotter (S___(Plotter *_plotter)) { int j; /* deallocate stored values of class variables */ for (j = 0; j < NUM_PLOTTER_PARAMETERS; j++) if (_known_params[j].is_string && _plotter->data->params[j] != NULL) /* stored parameter is a previously malloc'd string, so free it */ free (_plotter->data->params[j]); } /* This retrieves the default value of any specified Plotter parameter. Default values for each parameter are stored in the _known_params[] array, which is read-only global data. So unlike the preceding functions, this is not a Plotter method. */ void * _get_default_plot_param (const char *parameter_name) { int j; for (j = 0; j < NUM_PLOTTER_PARAMETERS; j++) if (strcmp (_known_params[j].parameter, parameter_name) == 0) return _known_params[j].default_value; return (void *)NULL; /* name not matched */ } plotutils-2.6/libplot/g_param2.c0000644000175000017500000000725011037243261013645 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This database lists the Plotter parameters parameters (i.e. device driver parameters) that are recognized, and their default values. Whether or not a parameter is a string is listed too. */ /* The `default_value' field should be specified for each parameter that is string-valued (i.e. (char *)-valued). [Exception: HPGL_PENS is set to NULL, because the default behavior is determined by the value of HPGL_VERSION. See h_defplot.c.]. */ /* Beside each parameter there is a comment indicating which type(s) of Plotter the parameter is relevant to, and which datatype its value should be, if it is not a (char *). */ #include "sys-defines.h" #include "extern.h" const struct plParamRecord _known_params[NUM_PLOTTER_PARAMETERS] = { /* String-valued (i.e. really (char *)-valued */ {"AI_VERSION", (char *)"5", true}, /* ai [obsolescent; undocumented] */ {"BG_COLOR", (char *)"white", true}, /* X, pnm, gif, cgm */ {"BITMAPSIZE", (char *)"570x570", true}, /* X, pnm, gif */ {"CGM_ENCODING", (char *)"binary", true}, /* cgm */ {"CGM_MAX_VERSION", (char *)"4", true}, /* cgm */ {"DISPLAY", (char *)"", true}, /* X */ {"EMULATE_COLOR", (char *)"no", true}, /* all except meta */ {"GIF_ANIMATION", (char *)"yes", true}, /* gif */ {"GIF_DELAY", (char *)"0", true}, /* gif */ {"GIF_ITERATIONS", (char *)"0", true}, /* gif */ {"HPGL_ASSIGN_COLORS", (char *)"no", true}, /* hpgl */ {"HPGL_OPAQUE_MODE", (char *)"yes", true}, /* hpgl */ {"HPGL_PENS", (char *)NULL, true}, /* hpgl */ {"HPGL_ROTATE", (char *)"no", true}, /* hpgl */ {"HPGL_VERSION", (char *)"2", true}, /* hpgl */ {"INTERLACE", (char *)"no", true}, /* gif */ {"MAX_LINE_LENGTH", (char *)PL_MAX_UNFILLED_PATH_LENGTH_STRING, true}, /* all but tek and meta */ {"META_PORTABLE", (char *)"no", true}, /* meta */ {"PAGESIZE", (char *)"letter", true}, /* hpgl, pcl, fig, cgm, ps, ai */ {"PCL_ASSIGN_COLORS", (char *)"no", true}, /* pcl */ {"PCL_BEZIERS", (char *)"yes", true}, /* pcl */ {"PNM_PORTABLE", (char *)"no", true}, /* pnm */ {"ROTATION", (char *)"no", true}, /* tek, hpgl, pcl, fig, ps, ai, X, XDrawable */ {"TERM", (char *)"tek", true}, /* tek only! */ {"TRANSPARENT_COLOR", (char *)"none", true}, /* gif */ {"USE_DOUBLE_BUFFERING", (char *)"no", true}, /* X, XDrawable */ {"VANISH_ON_DELETE", (char *)"no", true}, /* X */ {"X_AUTO_FLUSH", (char *)"yes", true}, /* X */ /* Pointer-valued (i.e. non-string, i.e. non-(char *)-valued) */ {"XDRAWABLE_COLORMAP", NULL, false}, /* XDrawable, is a Colormap* */ {"XDRAWABLE_DISPLAY", NULL, false}, /* XDrawable, is a Display* */ {"XDRAWABLE_DRAWABLE1", NULL, false}, /* XDrawable, is a Drawable* */ {"XDRAWABLE_DRAWABLE2", NULL, false}, /* XDrawable, is a Drawable* */ {"XDRAWABLE_VISUAL", NULL, false}, /* XDrawable, is a Visual* */ }; plotutils-2.6/libplot/g_path.c0000644000175000017500000000450011037243261013412 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This file also contains the internal path_is_flushable() method, which is invoked after any path segment is added to the segment list, provided (0) the segment list has become greater than or equal to the `max_unfilled_path_length' Plotter parameter, (1) the path isn't to be filled. In most Plotters, this operation simply returns true. */ /* This file also contains the internal maybe_prepaint_segments() method. It is called immediately after any segment is added to a path. Some Plotters, at least under some circumstances, treat endpath() as a no-op, and plot the segments of a path in real time, instead. They accomplish this by overloading this method. */ #include "sys-defines.h" #include "extern.h" /* In a generic Plotter, paint_path() does nothing. */ void _pl_g_paint_path (S___(Plotter *_plotter)) { return; } /* In a generic Plotter, path_is_flushable() simply returns true. */ bool _pl_g_path_is_flushable (S___(Plotter *_plotter)) { return true; } /* In a generic Plotter, maybe_prepaint_segments() does nothing. */ void _pl_g_maybe_prepaint_segments (R___(Plotter *_plotter) int prev_num_segments) { return; } /* In a generic Plotter, paint_paths() does nothing but returns `true'. */ bool _pl_g_paint_paths (S___(Plotter *_plotter)) { return true; } plotutils-2.6/libplot/g_pentype.c0000644000175000017500000001002611037243261014142 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the pentype method, which is a GNU extension to libplot. It sets a drawing attribute: whether or not a pen should be used. (Objects drawn without a pen may still be filled.) */ /* This file also contains the filltype method, which is a GNU extension to libplot. It sets a drawing attribute: the desaturation level of the filling, for all objects created by the drawing operations that follow. (For those that can be filled, that is; text cannot be filled.) The argument to filltype ranges from 0 to 0xFFFF. The value 0 is special; it signifies no filling at all (the object will be transparent). The value 1 signifies that the fill color should be the user-specified fill color, and a value of 0xFFFF signifies complete desaturation of this color (i.e., white). Values intermediate between 1 and 0xFFFF yield intermediate saturations of the user-specified fill color. An out-of-bounds argument resets the desaturation level to a default value. */ #include "sys-defines.h" #include "extern.h" int _API_pentype (R___(Plotter *_plotter) int level) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "pentype: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ if ((level < 0) || (level > 0xffff)) /* OOB switches to default */ level = _default_drawstate.pen_type; _plotter->drawstate->pen_type = level; return 0; } int _API_filltype (R___(Plotter *_plotter) int level) { int red, green, blue; double red_d, green_d, blue_d; double desaturate; plColor new_rgb; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "filltype: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ if ((level < 0) || (level > 0xffff)) /* OOB switches to default */ level = _default_drawstate.fill_type; _plotter->drawstate->fill_type = level; if (level == 0) /* won't be doing filling, so stop right here */ return 0; /* update fillcolor, taking fill type into account */ /* start with base fillcolor */ red = _plotter->drawstate->fillcolor_base.red; green = _plotter->drawstate->fillcolor_base.green; blue = _plotter->drawstate->fillcolor_base.blue; /* scale each RGB from a 16-bit quantity to range [0.0,1.0] */ red_d = ((double)red)/0xFFFF; green_d = ((double)green)/0xFFFF; blue_d = ((double)blue)/0xFFFF; /* fill_type, if nonzero, specifies the extent to which the nominal fill color should be desaturated. 1 means no desaturation, 0xffff means complete desaturation (white). */ desaturate = ((double)_plotter->drawstate->fill_type - 1.)/0xFFFE; red_d = red_d + desaturate * (1.0 - red_d); green_d = green_d + desaturate * (1.0 - green_d); blue_d = blue_d + desaturate * (1.0 - blue_d); /* restore each RGB to a 16-bit quantity (48 bits in all) */ new_rgb.red = IROUND(0xFFFF * red_d); new_rgb.green = IROUND(0xFFFF * green_d); new_rgb.blue = IROUND(0xFFFF * blue_d); /* store actual fill color in drawing state */ _plotter->drawstate->fillcolor = new_rgb; return 0; } plotutils-2.6/libplot/g_point.c0000644000175000017500000000404311037243261013611 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the point method, which is a standard part of libplot. It plots an object: a point with coordinates x,y. */ #include "sys-defines.h" #include "extern.h" int _API_fpoint (R___(Plotter *_plotter) double x, double y) { if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fpoint: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* update our notion of position */ _plotter->drawstate->pos.x = x; _plotter->drawstate->pos.y = y; if (_plotter->drawstate->pen_type == 0) /* no pen to draw with, so do nothing */ return 0; /* call internal function: draw marker at current location, in a Plotter-specific way */ _plotter->paint_point (S___(_plotter)); return 0; } /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ /* This implementation is for a generic Plotter. It does nothing. */ void _pl_g_paint_point (S___(Plotter *_plotter)) { return; } plotutils-2.6/libplot/g_relative.c0000644000175000017500000001101611037243261014271 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the libplot methods that take floating-point relative coordinates as arguments. */ #include "sys-defines.h" #include "extern.h" int _API_farcrel (R___(Plotter *_plotter) double dxc, double dyc, double dx0, double dy0, double dx1, double dy1) { return _API_farc (R___(_plotter) _plotter->drawstate->pos.x + dxc, _plotter->drawstate->pos.y + dyc, _plotter->drawstate->pos.x + dx0, _plotter->drawstate->pos.y + dy0, _plotter->drawstate->pos.x + dx1, _plotter->drawstate->pos.y + dy1); } int _API_fbezier2rel (R___(Plotter *_plotter) double dxc, double dyc, double dx0, double dy0, double dx1, double dy1) { return _API_fbezier2 (R___(_plotter) _plotter->drawstate->pos.x + dxc, _plotter->drawstate->pos.y + dyc, _plotter->drawstate->pos.x + dx0, _plotter->drawstate->pos.y + dy0, _plotter->drawstate->pos.x + dx1, _plotter->drawstate->pos.y + dy1); } int _API_fbezier3rel (R___(Plotter *_plotter) double dx0, double dy0, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3) { return _API_fbezier3 (R___(_plotter) _plotter->drawstate->pos.x + dx0, _plotter->drawstate->pos.y + dy0, _plotter->drawstate->pos.x + dx1, _plotter->drawstate->pos.y + dy1, _plotter->drawstate->pos.x + dx2, _plotter->drawstate->pos.y + dy2, _plotter->drawstate->pos.x + dx3, _plotter->drawstate->pos.y + dy3); } int _API_fellarcrel (R___(Plotter *_plotter) double dxc, double dyc, double dx0, double dy0, double dx1, double dy1) { return _API_fellarc (R___(_plotter) _plotter->drawstate->pos.x + dxc, _plotter->drawstate->pos.y + dyc, _plotter->drawstate->pos.x + dx0, _plotter->drawstate->pos.y + dy0, _plotter->drawstate->pos.x + dx1, _plotter->drawstate->pos.y + dy1); } int _API_fboxrel (R___(Plotter *_plotter) double dx0, double dy0, double dx1, double dy1) { return _API_fbox (R___(_plotter) _plotter->drawstate->pos.x + dx0, _plotter->drawstate->pos.y + dy0, _plotter->drawstate->pos.x + dx1, _plotter->drawstate->pos.y + dy1); } int _API_fcirclerel (R___(Plotter *_plotter) double dx, double dy, double r) { return _API_fcircle (R___(_plotter) _plotter->drawstate->pos.x + dx, _plotter->drawstate->pos.y + dy, r); } int _API_fellipserel (R___(Plotter *_plotter) double dx, double dy, double rx, double ry, double angle) { return _API_fellipse (R___(_plotter) _plotter->drawstate->pos.x + dx, _plotter->drawstate->pos.y + dy, rx, ry, angle); } int _API_fcontrel (R___(Plotter *_plotter) double dx, double dy) { return _API_fcont (R___(_plotter) _plotter->drawstate->pos.x + dx, _plotter->drawstate->pos.y + dy); } int _API_flinerel (R___(Plotter *_plotter) double dx0, double dy0, double dx1, double dy1) { return _API_fline (R___(_plotter) _plotter->drawstate->pos.x + dx0, _plotter->drawstate->pos.y + dy0, _plotter->drawstate->pos.x + dx1, _plotter->drawstate->pos.y + dy1); } int _API_fmarkerrel (R___(Plotter *_plotter) double dx, double dy, int type, double size) { return _API_fmarker (R___(_plotter) _plotter->drawstate->pos.x + dx, _plotter->drawstate->pos.y + dy, type, size); } int _API_fmoverel (R___(Plotter *_plotter) double x, double y) { return _API_fmove (R___(_plotter) _plotter->drawstate->pos.x + x, _plotter->drawstate->pos.y + y); } int _API_fpointrel (R___(Plotter *_plotter) double dx, double dy) { return _API_fpoint (R___(_plotter) _plotter->drawstate->pos.x + dx, _plotter->drawstate->pos.y + dy); } plotutils-2.6/libplot/g_range.c0000644000175000017500000003271211037402617013562 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains functions that update the bounding box information for a page whenever a new object (ellipse, line segment, or Bezier segment) is plotted. Updating takes the line width into account, more or less. The bounding box information is stored in terms of device units, in the page's plOutbuf structure. */ #include "sys-defines.h" #include "extern.h" #define VLENGTH(v) sqrt( (v).x * (v).x + (v).y * (v).y ) /* update bounding box due to drawing of ellipse (args are in user coors) */ /* WARNING: This is not completely accurate, due to the nonzero width of the pen used to draw the ellipse. Notoriously, the outer boundary of a `wide ellipse' isn't an ellipse at all: in general it's an eighth-order curve (see Foley and van Damm), though it's a fourth-order curve if the axes are aligned with the coordinate axes. Here we approximate it as an ellipse, with semimajor and semiminor axes in the user frame increased by one-half of the line width. This approximation is good unless the line width is large. */ void _set_ellipse_bbox (plOutbuf *bufp, double x, double y, double rx, double ry, double costheta, double sintheta, double linewidth, double m[6]) { double ux, uy, vx, vy; double mixing_angle; double semi_axis_1_x, semi_axis_1_y, semi_axis_2_x, semi_axis_2_y; double rx_device, ry_device; double theta_device, costheta_device, sintheta_device; double xdeviation, ydeviation; /* take user-frame line width into account (approximately! see above) */ rx += 0.5 * linewidth; ry += 0.5 * linewidth; /* perform affine user->device coor transformation; (ux,uy) and (vx,vy) are forward images of the semiaxes, i.e. they are conjugate radial vectors in the device frame */ ux = XDV_INTERNAL(rx * costheta, rx * sintheta, m); uy = YDV_INTERNAL(rx * costheta, rx * sintheta, m); vx = XDV_INTERNAL(-ry * sintheta, ry * costheta, m); vy = YDV_INTERNAL(-ry * sintheta, ry * costheta, m); /* angle by which the conjugate radial vectors should be mixed, in order to yield vectors along the major and minor axes in the device frame */ mixing_angle = 0.5 * _xatan2 (2.0 * (ux * vx + uy * vy), ux * ux + uy * uy - vx * vx + vy * vy); /* semi-axis vectors in device coordinates */ semi_axis_1_x = ux * cos(mixing_angle) + vx * sin(mixing_angle); semi_axis_1_y = uy * cos(mixing_angle) + vy * sin(mixing_angle); semi_axis_2_x = ux * cos(mixing_angle + M_PI_2) + vx * sin(mixing_angle + M_PI_2); semi_axis_2_y = uy * cos(mixing_angle + M_PI_2) + vy * sin(mixing_angle + M_PI_2); /* semi-axis lengths in device coordinates */ rx_device = sqrt (semi_axis_1_x * semi_axis_1_x + semi_axis_1_y * semi_axis_1_y); ry_device = sqrt (semi_axis_2_x * semi_axis_2_x + semi_axis_2_y * semi_axis_2_y); /* angle of inclination of the first semi-axis, in device frame */ theta_device = - _xatan2 (semi_axis_1_y, semi_axis_1_x); costheta_device = cos (theta_device); sintheta_device = sin (theta_device); /* maximum displacement in horizontal and vertical directions while drawing ellipse, in device frame */ xdeviation = sqrt (rx_device * rx_device * costheta_device * costheta_device + ry_device * ry_device * sintheta_device * sintheta_device); ydeviation = sqrt (rx_device * rx_device * sintheta_device * sintheta_device + ry_device * ry_device * costheta_device * costheta_device); /* record these displacements, for bounding box */ _update_bbox (bufp, XD_INTERNAL(x,y,m) + xdeviation, YD_INTERNAL(x,y,m) + ydeviation); _update_bbox (bufp, XD_INTERNAL(x,y,m) + xdeviation, YD_INTERNAL(x,y,m) - ydeviation); _update_bbox (bufp, XD_INTERNAL(x,y,m) - xdeviation, YD_INTERNAL(x,y,m) + ydeviation); _update_bbox (bufp, XD_INTERNAL(x,y,m) - xdeviation, YD_INTERNAL(x,y,m) - ydeviation); } /* update bounding box due to drawing of a line end (args are in user coors) */ void _set_line_end_bbox (plOutbuf *bufp, double x, double y, double xother, double yother, double linewidth, int capstyle, double m[6]) { plVector v, vrot; double xs, ys; double halfwidth = 0.5 * linewidth; switch (capstyle) { case PL_CAP_BUTT: default: vrot.x = yother - y; vrot.y = x - xother; _vscale (&vrot, halfwidth); xs = x + vrot.x; ys = y + vrot.y; _update_bbox (bufp, XD_INTERNAL(xs,ys,m), YD_INTERNAL(xs,ys,m)); xs = x - vrot.x; ys = y - vrot.y; _update_bbox (bufp, XD_INTERNAL(xs,ys,m), YD_INTERNAL(xs,ys,m)); break; case PL_CAP_PROJECT: v.x = xother - x; v.y = yother - y; _vscale (&v, halfwidth); vrot.x = yother - y; vrot.y = x - xother; _vscale (&vrot, halfwidth); xs = x - v.x + vrot.x; ys = y - v.y + vrot.y; _update_bbox (bufp, XD_INTERNAL(xs,ys,m), YD_INTERNAL(xs,ys,m)); xs = x - v.x - vrot.x; ys = y - v.y - vrot.y; _update_bbox (bufp, XD_INTERNAL(xs,ys,m), YD_INTERNAL(xs,ys,m)); break; case PL_CAP_ROUND: _set_ellipse_bbox (bufp, x, y, halfwidth, halfwidth, 1.0, 0.0, 0.0, m); break; case PL_CAP_TRIANGULAR: /* add projecting vertex */ v.x = xother - x; v.y = yother - y; _vscale (&v, halfwidth); xs = x + v.x; ys = y + v.y; _update_bbox (bufp, XD_INTERNAL(xs,ys,m), YD_INTERNAL(xs,ys,m)); /* add other two vertices */ vrot.x = yother - y; vrot.y = x - xother; _vscale (&vrot, halfwidth); xs = x + vrot.x; ys = y + vrot.y; _update_bbox (bufp, XD_INTERNAL(xs,ys,m), YD_INTERNAL(xs,ys,m)); xs = x - vrot.x; ys = y - vrot.y; _update_bbox (bufp, XD_INTERNAL(xs,ys,m), YD_INTERNAL(xs,ys,m)); break; } } /* update bounding box due to drawing of a line join (args are in user coors)*/ void _set_line_join_bbox (plOutbuf *bufp, double xleft, double yleft, double x, double y, double xright, double yright, double linewidth, int joinstyle, double miterlimit, double m[6]) { plVector v1, v2, vsum; double v1len, v2len; double halfwidth; double mitrelen; switch (joinstyle) { case PL_JOIN_MITER: default: v1.x = xleft - x; v1.y = yleft - y; v2.x = xright - x; v2.y = yright - y; v1len = VLENGTH(v1); v2len = VLENGTH(v2); if (v1len == 0.0 || v2len == 0.0) _update_bbox (bufp, XD_INTERNAL(x,y,m), YD_INTERNAL(x,y,m)); else { double cosphi; /* The maximum value the cosine of the angle between two joining lines may have, if the join is to be mitered rather than beveled, is 1-2/(M*M), where M is the mitrelimit. This is because M equals the cosecant of one-half the minimum angle. */ cosphi = ((v1.x * v2.x + v1.y * v2.y) / v1len) / v2len; if (miterlimit <= 1.0 || (cosphi > (1.0 - 2.0 / (miterlimit * miterlimit)))) /* bevel rather than miter */ { _set_line_end_bbox (bufp, x, y, xleft, yleft, linewidth, PL_CAP_BUTT, m); _set_line_end_bbox (bufp,x, y, xright, yright, linewidth, PL_CAP_BUTT, m); } else { mitrelen = sqrt (1.0 / (2.0 - 2.0 * cosphi)) * linewidth; vsum.x = v1.x + v2.x; vsum.y = v1.y + v2.y; _vscale (&vsum, mitrelen); x -= vsum.x; y -= vsum.y; _update_bbox (bufp, XD_INTERNAL(x,y,m), YD_INTERNAL(x,y,m)); } } break; case PL_JOIN_TRIANGULAR: /* add a miter vertex, and same vertices as when bevelling */ v1.x = xleft - x; v1.y = yleft - y; v2.x = xright - x; v2.y = yright - y; vsum.x = v1.x + v2.x; vsum.y = v1.y + v2.y; _vscale (&vsum, 0.5 * linewidth); x -= vsum.x; y -= vsum.y; _update_bbox (bufp, XD_INTERNAL(x,y,m), YD_INTERNAL(x,y,m)); x += vsum.x; y += vsum.y; /* fall through */ case PL_JOIN_BEVEL: _set_line_end_bbox (bufp, x, y, xleft, yleft, linewidth, PL_CAP_BUTT, m); _set_line_end_bbox (bufp, x, y, xright, yright, linewidth, PL_CAP_BUTT, m); break; case PL_JOIN_ROUND: halfwidth = 0.5 * linewidth; _set_ellipse_bbox (bufp, x, y, halfwidth, halfwidth, 1.0, 0.0, 0.0, m); break; } } /* Update bounding box due to drawing of a quadratic Bezier segment. This takes into account only extremal x/y values in the interior of the segment, i.e. it doesn't take the endpoints into account. */ /* WARNING: Like _set_ellipse_bbox above, this does not properly take line width into account. The boundary of a `thick Bezier' is not a nice curve at all. */ #define QUAD_COOR(t,x0,x1,x2) (((x0)-2*(x1)+(x2))*t*t + 2*((x1)-(x2))*t + (x2)) void _set_bezier2_bbox (plOutbuf *bufp, double x0, double y0, double x1, double y1, double x2, double y2, double device_line_width, double m[6]) { double a_x, b_x, t_x; double a_y, b_y, t_y; double x, y, xdevice, ydevice; double device_halfwidth = 0.5 * device_line_width; /* compute coeffs of linear equation at+b=0, for both x and y coors */ a_x = x0 - 2 * x1 + x2; b_x = (x1 - x2); a_y = y0 - 2 * y1 + y2; b_y = (y1 - y2); if (a_x != 0.0) /* can solve the linear eqn. */ { t_x = -b_x / a_x; if (t_x > 0.0 && t_x < 1.0) /* root is in meaningful range */ { x = QUAD_COOR(t_x, x0, x1, x2); y = QUAD_COOR(t_x, y0, y1, y2); xdevice = XD_INTERNAL(x,y,m); ydevice = YD_INTERNAL(x,y,m); _update_bbox (bufp, xdevice + device_halfwidth, ydevice); _update_bbox (bufp, xdevice - device_halfwidth, ydevice); } } if (a_y != 0.0) /* can solve the linear eqn. */ { t_y = -b_y / a_y; if (t_y > 0.0 && t_y < 1.0) /* root is in meaningful range */ { x = QUAD_COOR(t_y, x0, x1, x2); y = QUAD_COOR(t_y, y0, y1, y2); xdevice = XD_INTERNAL(x,y,m); ydevice = YD_INTERNAL(x,y,m); _update_bbox (bufp, xdevice, ydevice + device_halfwidth); _update_bbox (bufp, xdevice, ydevice - device_halfwidth); } } } /* Update bounding box due to drawing of a cubic Bezier segment. This takes into account only extremal x/y values in the interior of the segment, i.e. it doesn't take the endpoints into account. */ /* WARNING: Like _set_ellipse_bbox above, this does not properly take line width into account. The boundary of a `thick Bezier' is not a nice curve at all. */ #define CUBIC_COOR(t,x0,x1,x2,x3) (((x0)-3*(x1)+3*(x2)-(x3))*t*t*t + 3*((x1)-2*(x2)+(x3))*t*t + 3*((x2)-(x3))*t + (x3)) void _set_bezier3_bbox (plOutbuf *bufp, double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double device_line_width, double m[6]) { double a_x, b_x, c_x, s_x, t_x; double a_y, b_y, c_y, s_y, t_y; double x, y, xdevice, ydevice; double device_halfwidth = 0.5 * device_line_width; double sqrt_disc; /* compute coeffs of quad. equation at^2+bt+c=0, for both x and y coors */ a_x = x0 - 3 * x1 + 3 * x2 - x3; b_x = 2 * (x1 - 2 * x2 + x3); c_x = x2 - x3; a_y = y0 - 3 * y1 + 3 * y2 - y3; b_y = 2 * (y1 - 2 * y2 + y3); c_y = y2 - y3; if (a_x != 0.0) /* can solve the quadratic */ { sqrt_disc = sqrt (b_x * b_x - 4 * a_x * c_x); s_x = (- b_x + sqrt_disc) / (2 * a_x); t_x = (- b_x - sqrt_disc) / (2 * a_x); if (s_x > 0.0 && s_x < 1.0) /* root is in meaningful range */ { x = CUBIC_COOR(s_x, x0, x1, x2, x3); y = CUBIC_COOR(s_x, y0, y1, y2, y3); xdevice = XD_INTERNAL(x,y,m); ydevice = YD_INTERNAL(x,y,m); _update_bbox (bufp, xdevice + device_halfwidth, ydevice); _update_bbox (bufp, xdevice - device_halfwidth, ydevice); } if (t_x > 0.0 && t_x < 1.0) /* root is in meaningful range */ { x = CUBIC_COOR(t_x, x0, x1, x2, x3); y = CUBIC_COOR(t_x, y0, y1, y2, y3); xdevice = XD_INTERNAL(x,y,m); ydevice = YD_INTERNAL(x,y,m); _update_bbox (bufp, xdevice + device_halfwidth, ydevice); _update_bbox (bufp, xdevice - device_halfwidth, ydevice); } } if (a_y != 0.0) /* can solve the quadratic */ { sqrt_disc = sqrt (b_y * b_y - 4 * a_y * c_y); s_y = (- b_y + sqrt_disc) / (2 * a_y); t_y = (- b_y - sqrt_disc) / (2 * a_y); if (s_y > 0.0 && s_y < 1.0) /* root is in meaningful range */ { x = CUBIC_COOR(s_y, x0, x1, x2, x3); y = CUBIC_COOR(s_y, y0, y1, y2, y3); xdevice = XD_INTERNAL(x,y,m); ydevice = YD_INTERNAL(x,y,m); _update_bbox (bufp, xdevice, ydevice + device_halfwidth); _update_bbox (bufp, xdevice, ydevice - device_halfwidth); } if (t_y > 0.0 && t_y < 1.0) /* root is in meaningful range */ { x = CUBIC_COOR(t_y, x0, x1, x2, x3); y = CUBIC_COOR(t_y, y0, y1, y2, y3); xdevice = XD_INTERNAL(x,y,m); ydevice = YD_INTERNAL(x,y,m); _update_bbox (bufp, xdevice, ydevice + device_halfwidth); _update_bbox (bufp, xdevice, ydevice - device_halfwidth); } } } plotutils-2.6/libplot/g_retrieve.c0000644000175000017500000003562411037243261014316 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal _pl_g_set_font method, which is called when the font_name, font_size, and textangle fields of the current drawing state have been filled in. It retrieves the specified font, and fills in the true_font_name, true_font_size, font_type, typeface_index, font_index, font_is_iso8858_1, font_ascent, font_descent, and font_cap_height fields of the drawing state. _pl_g_set_font is invoked by _API_alabel() and _API_flabelwidth(), and also by _API_fontname(), _API_fontsize(), and _API_textangle() (only because those three functions in the API must return a font size). _pl_g_set_font does the following, in order: 1. If font_name is the name of a supported Hershey font, i.e., one in libplot's database, it fills in the fields itself. 2. If the font name is the name of a supported font of a non-Hershey type (i.e. PS/PCL/Stick), it _tentatively_ fills in the fields. If the font name doesn't appear in libplot's internal database, it simply sets the font_type to `PL_F_OTHER'. 3a. If the font name isn't the name of a supported Hershey font, it invokes the Plotter-specific `retrieve_font' method. In most Plotters this simply returns true. (See the stub _pl_g_retrieve_font() below.) But in principle it may modify the fields arbitrarily, perhaps consult an external database, etc. 3b. If retrieve_font returns false, a default Hershey font is substituted, and the fields are filled in. This feature is used e.g. by Fig Plotters, which support any of the 35 PS fonts in libplot's database, except when the user frame -> device frame map is anisotropic (i.e. non-uniform). It is also used by X Drawable Plotters, which may or may not have a PS font available, and in fact may or may not have any given font of type `PL_F_OTHER' (see above) available. */ #include "sys-defines.h" #include "extern.h" #include "g_her_metr.h" #define MAP_HERSHEY_UNITS_TO_USER_UNITS(size, drawstate) \ ((size)*(drawstate->true_font_size)/(HERSHEY_EM)) /* forward references */ static bool _match_hershey_font (plDrawState *drawstate); static bool _match_ps_font (plDrawState *drawstate); static bool _match_pcl_font (plDrawState *drawstate); static bool _match_stick_font (plDrawState *drawstate, bool have_extra_stick_fonts); void _pl_g_set_font (S___(Plotter *_plotter)) { plDrawState *drawstate = _plotter->drawstate; plPlotterData *data = _plotter->data; const char *default_font_name; bool matched; /* try to match font name in our database */ if (_match_hershey_font (drawstate)) /* Matched a Hershey font name in our database, and all fields filled in definitively, so return without invoking Plotter-specific `retrieve_font', which knows nothing about Hershey fonts anyway */ return; matched = false; /* Try to match the font name with the name of a PCL font or a PS font in the database, and tentatively fill in fields. But there is a namespace collision: "Courier" etc. and "Symbol" occur on both lists. Which list we search first depends on what type of Plotter this is. */ if (data->pcl_before_ps) { /* search PCL font list first */ if ((data->have_pcl_fonts && _match_pcl_font (drawstate)) || (data->have_ps_fonts && _match_ps_font (drawstate))) matched = true; } else { /* search PS font list first */ if ((data->have_ps_fonts && _match_ps_font (drawstate)) || (data->have_pcl_fonts && _match_pcl_font (drawstate))) matched = true; } /* if unmatched, search through Stick font list too */ if (matched == false && data->have_stick_fonts && _match_stick_font (drawstate, data->have_extra_stick_fonts ? true : false)) matched = true; if (matched == false) /* fill in the only fields we can */ { free ((char *)drawstate->true_font_name); drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (drawstate->font_name) + 1); strcpy ((char *)drawstate->true_font_name, drawstate->font_name); drawstate->true_font_size = drawstate->font_size; drawstate->font_type = PL_F_OTHER; drawstate->typeface_index = 0; drawstate->font_index = 1; /* NOT filled in yet: font_is_iso8859_1, font_ascent, font_descent, and font_cap_height; they're left to Plotter-specific retrieval routine, if it can supply them (in the case of a Metafile Plotter, it surely can't). */ } /* If we got here, font name isn't that of a Hershey font, and `matched' indicates whether or not it's listed in our font name database, as one of the types of font this Plotter can handle. So invoke low-level Plotter-specific retrieval routine. Do it even if we haven't matched the font, if this Plotter claims to be able to handle `other' fonts, i.e., ones not listed in our database. */ if (matched || (!matched && data->have_other_fonts)) /* try to invoke low-level Plotter-specific routine to finish the job of filling in fields, including Plotter-specific ones */ { if (_plotter->retrieve_font (S___(_plotter))) /* all finished... */ return; } /* Plotter-specific retrieval failed: it doesn't like the font name or other drawstate parameters (size, textangle, transformation matrix?) */ /* Via a recursive call, try to retrieve default font for this Plotter type (if it's different from the one we just failed to retrieve; otherwise retrieve the default Hershey font). */ switch (data->default_font_type) { case PL_F_POSTSCRIPT: default_font_name = PL_DEFAULT_POSTSCRIPT_FONT; break; case PL_F_PCL: default_font_name = PL_DEFAULT_PCL_FONT; break; case PL_F_STICK: default_font_name = PL_DEFAULT_STICK_FONT; break; case PL_F_HERSHEY: /* Hershey shouldn't happen */ default: default_font_name = PL_DEFAULT_HERSHEY_FONT; break; /* N.B. No support yet for a Plotter-specific default font that is of PL_F_OTHER type, i.e., isn't listed in the libplot font database. */ } if (strcmp (drawstate->font_name, default_font_name) == 0 || strcmp (drawstate->true_font_name, default_font_name) == 0) /* default font is the one we just failed to retrieve: so use Hershey: internal and guaranteed to be available */ default_font_name = PL_DEFAULT_HERSHEY_FONT; /* stash fontname we failed to retrieve; then do recursive call, turning off font warnings for the duration; restore fontname field */ { const char *saved_font_name; bool saved_font_warning_issued; saved_font_name = drawstate->font_name; drawstate->font_name = default_font_name; saved_font_warning_issued = _plotter->data->font_warning_issued; _plotter->data->font_warning_issued = true; /* turn off warnings */ _pl_g_set_font (S___(_plotter)); _plotter->data->font_warning_issued = saved_font_warning_issued; drawstate->font_name = saved_font_name; } if (data->issue_font_warning && !_plotter->data->font_warning_issued) /* squawk */ { char *buf; buf = (char *)_pl_xmalloc (strlen (drawstate->font_name) + strlen (drawstate->true_font_name) + 100); sprintf (buf, "cannot retrieve font \"%s\", using default \"%s\"", drawstate->font_name, drawstate->true_font_name); _plotter->warning (R___(_plotter) buf); free (buf); _plotter->data->font_warning_issued = true; } } static bool _match_hershey_font (plDrawState *drawstate) { int i; /* is font a Hershey font? */ i = -1; while (_pl_g_hershey_font_info[++i].name) { if (_pl_g_hershey_font_info[i].visible) /* i.e. font not internal-only */ if (strcasecmp (_pl_g_hershey_font_info[i].name, drawstate->font_name) == 0 || (_pl_g_hershey_font_info[i].othername && strcasecmp (_pl_g_hershey_font_info[i].othername, drawstate->font_name) == 0)) /* fill in fields */ { free ((char *)drawstate->true_font_name); drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (_pl_g_hershey_font_info[i].name) + 1); strcpy ((char *)drawstate->true_font_name, _pl_g_hershey_font_info[i].name); drawstate->true_font_size = drawstate->font_size; drawstate->font_type = PL_F_HERSHEY; drawstate->typeface_index = _pl_g_hershey_font_info[i].typeface_index; drawstate->font_index = _pl_g_hershey_font_info[i].font_index; drawstate->font_is_iso8859_1 = _pl_g_hershey_font_info[i].iso8859_1; /* N.B. this macro uses true_font_size */ drawstate->font_cap_height = MAP_HERSHEY_UNITS_TO_USER_UNITS(HERSHEY_CAPHEIGHT, drawstate); drawstate->font_ascent = MAP_HERSHEY_UNITS_TO_USER_UNITS(HERSHEY_ASCENT, drawstate); drawstate->font_descent = MAP_HERSHEY_UNITS_TO_USER_UNITS(HERSHEY_DESCENT, drawstate); return true; } } return false; } static bool _match_pcl_font (plDrawState *drawstate) { int i = -1; /* is font a PCL font in libplot's database? */ while (_pl_g_pcl_font_info[++i].ps_name) { if (strcasecmp (_pl_g_pcl_font_info[i].ps_name, drawstate->font_name) == 0 /* try alternative PS font name if any */ || (_pl_g_pcl_font_info[i].ps_name_alt != NULL && strcasecmp (_pl_g_pcl_font_info[i].ps_name_alt, drawstate->font_name) == 0) /* try X font name too */ || strcasecmp (_pl_g_pcl_font_info[i].x_name, drawstate->font_name) == 0) { free ((char *)drawstate->true_font_name); drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (_pl_g_pcl_font_info[i].ps_name) + 1); strcpy ((char *)drawstate->true_font_name, _pl_g_pcl_font_info[i].ps_name); drawstate->true_font_size = drawstate->font_size; drawstate->font_type = PL_F_PCL; drawstate->typeface_index = _pl_g_pcl_font_info[i].typeface_index; drawstate->font_index = _pl_g_pcl_font_info[i].font_index; drawstate->font_is_iso8859_1 = _pl_g_pcl_font_info[i].iso8859_1; drawstate->font_ascent = drawstate->true_font_size * (double)(_pl_g_pcl_font_info[i].font_ascent)/1000.0; drawstate->font_descent = drawstate->true_font_size * (double)(_pl_g_pcl_font_info[i].font_descent)/1000.0; drawstate->font_cap_height = drawstate->true_font_size * (double)(_pl_g_pcl_font_info[i].font_cap_height)/1000.0; return true; } } return false; } static bool _match_ps_font (plDrawState *drawstate) { int i = -1; /* is font a PS font in libplot's database ? */ while (_pl_g_ps_font_info[++i].ps_name) { if (strcasecmp (_pl_g_ps_font_info[i].ps_name, drawstate->font_name) == 0 /* try alternative PS font name if any */ || (_pl_g_ps_font_info[i].ps_name_alt != NULL && strcasecmp (_pl_g_ps_font_info[i].ps_name_alt, drawstate->font_name) == 0) /* try 2nd alternative PS font name if any */ || (_pl_g_ps_font_info[i].ps_name_alt2 != NULL && strcasecmp (_pl_g_ps_font_info[i].ps_name_alt2, drawstate->font_name) == 0) /* try X font name too */ || strcasecmp (_pl_g_ps_font_info[i].x_name, drawstate->font_name) == 0 /* try alternative X font name if any */ || (_pl_g_ps_font_info[i].x_name_alt != NULL && strcasecmp (_pl_g_ps_font_info[i].x_name_alt, drawstate->font_name) == 0)) { free ((char *)drawstate->true_font_name); drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (_pl_g_ps_font_info[i].ps_name) + 1); strcpy ((char *)drawstate->true_font_name, _pl_g_ps_font_info[i].ps_name); drawstate->true_font_size = drawstate->font_size; drawstate->font_type = PL_F_POSTSCRIPT; drawstate->typeface_index = _pl_g_ps_font_info[i].typeface_index; drawstate->font_index = _pl_g_ps_font_info[i].font_index; drawstate->font_is_iso8859_1 = _pl_g_ps_font_info[i].iso8859_1; drawstate->font_ascent = drawstate->true_font_size * (double)(_pl_g_ps_font_info[i].font_ascent)/1000.0; drawstate->font_descent = drawstate->true_font_size * (double)(_pl_g_ps_font_info[i].font_descent)/1000.0; drawstate->font_cap_height = drawstate->true_font_size * (double)(_pl_g_ps_font_info[i].font_cap_height)/1000.0; return true; } } return false; } static bool _match_stick_font (plDrawState *drawstate, bool have_extra_stick_fonts) { int i = -1; /* is font a PCL font in libplot's database? */ while (_pl_g_stick_font_info[++i].ps_name) { if (_pl_g_stick_font_info[i].basic == false && !have_extra_stick_fonts) /* not a basic Stick font, and this Plotter supports only the basic ones */ continue; if (strcasecmp (_pl_g_stick_font_info[i].ps_name, drawstate->font_name) == 0) /* fill in fields */ { free ((char *)drawstate->true_font_name); drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (_pl_g_stick_font_info[i].ps_name) + 1); strcpy ((char *)drawstate->true_font_name, _pl_g_stick_font_info[i].ps_name); drawstate->true_font_size = drawstate->font_size; drawstate->true_font_size = drawstate->font_size; drawstate->true_font_size = drawstate->font_size; drawstate->font_type = PL_F_STICK; drawstate->typeface_index = _pl_g_stick_font_info[i].typeface_index; drawstate->font_index = _pl_g_stick_font_info[i].font_index; drawstate->font_is_iso8859_1 = _pl_g_stick_font_info[i].iso8859_1; drawstate->font_ascent = drawstate->true_font_size * (double)(_pl_g_stick_font_info[i].font_ascent)/1000.0; drawstate->font_descent = drawstate->true_font_size * (double)(_pl_g_stick_font_info[i].font_descent)/1000.0; drawstate->font_cap_height /* The `0.7' is undocumented HP magic; see comments in h_font.c and g_fontd2.c */ = 0.7 * drawstate->true_font_size; return true; } } return false; } /* This is the generic version of the _retrieve_font method, which does nothing. Many types of Plotter use this, but some, e.g., FigPlotters and XDrawablePlotters (and X Plotters) override it. See _pl_f_retrieve_font() and _pl_x_retrieve_font(). */ bool _pl_g_retrieve_font (S___(Plotter *_plotter)) { return true; } plotutils-2.6/libplot/g_savestate.c0000644000175000017500000001577511037243261014475 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the savestate method, which is a GNU extension to libplot. It creates a new drawing state and pushes it onto the stack of drawing states. By definition, a `drawing state' comprises the set of drawing attributes, and the state of any path being incrementally drawn. The new state will have the same drawing attributes as the old state. If a path was being drawn incrementally in the old state, the new state will not contain it. The old state may be returned to by invoking the restorestate routine, which pops drawing states off the stack. If the incremental drawing of a path was in progress, it may be returned to at that time. This version of savestate() assumes that the device-specific part of the drawing state contains no strings. Plotter objects for which this is not true must supplement this by defining push_state() appropriately, since they need to call malloc() to allocate space for the string in the new state. */ /* This file also contains the restorestate method, which is a GNU extension to libplot. It pops off the drawing state on the top of the stack of drawing states. Drawing states (other than the one which is always present, and may not be popped off) are created and pushed onto the stack by invoking the savestate() routine. This version of restorestate() assumes that the device-specific part of the state contains no strings or other dynamically allocated data. Versions of libplot in which this is not true must supplement this by defining pop_state() appropriately, since they need to call free() to deallocate space for the strings. */ /* N.B. The drawing state stack, during user use of libplot, always contains at least one drawing state. The first state is added by openpl() and deleted by closepl(). */ #include "sys-defines.h" #include "extern.h" int _API_savestate(S___(Plotter *_plotter)) { plDrawState *oldstate = _plotter->drawstate; /* non-NULL */ plDrawState *drawstate; char *fill_rule, *line_mode, *join_mode, *cap_mode; char *font_name, *true_font_name; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "savestate: invalid operation"); return -1; } /* create a new state */ drawstate = (plDrawState *)_pl_xmalloc (sizeof(plDrawState)); /* copy from old state */ memcpy (drawstate, oldstate, sizeof(plDrawState)); /* elements of state that are strings are treated specially */ fill_rule = (char *)_pl_xmalloc (strlen (oldstate->fill_rule) + 1); line_mode = (char *)_pl_xmalloc (strlen (oldstate->line_mode) + 1); join_mode = (char *)_pl_xmalloc (strlen (oldstate->join_mode) + 1); cap_mode = (char *)_pl_xmalloc (strlen (oldstate->cap_mode) + 1); strcpy (fill_rule, oldstate->fill_rule); strcpy (line_mode, oldstate->line_mode); strcpy (join_mode, oldstate->join_mode); strcpy (cap_mode, oldstate->cap_mode); drawstate->fill_rule = fill_rule; drawstate->line_mode = line_mode; drawstate->join_mode = join_mode; drawstate->cap_mode = cap_mode; /* dash array, if non-empty, is treated specially too */ if (oldstate->dash_array_len > 0) { int i; double *dash_array; dash_array = (double *)_pl_xmalloc (oldstate->dash_array_len * sizeof(double)); for (i = 0; i < oldstate->dash_array_len; i++) dash_array[i] = oldstate->dash_array[i]; drawstate->dash_array = dash_array; } /* The font_name, true_font_name, font_type, typeface_index, and font_index fields are special, since for the initial drawing state they're Plotter-dependent. For later drawing states, we just copy them from the previous state. Since only the first two (font_name and true_font_name) are strings, for later states we don't worry about the other three: they've already been copied. The fill_rule_type field is also treated specially in the initial drawing state, because not all Plotters support both types of filling (odd vs. nonzero winding number). */ font_name = (char *)_pl_xmalloc (strlen (oldstate->font_name) + 1); strcpy (font_name, oldstate->font_name); drawstate->font_name = font_name; true_font_name = (char *)_pl_xmalloc (strlen (oldstate->true_font_name) + 1); strcpy (true_font_name, oldstate->true_font_name); drawstate->true_font_name = true_font_name; /* Our memcpy copied the pointer to the compound path under construction (if any). So we knock it out, to start afresh */ drawstate->path = (plPath *)NULL; drawstate->paths = (plPath **)NULL; drawstate->num_paths = 0; /* install new state at head of the state list */ drawstate->previous = oldstate; _plotter->drawstate = drawstate; /* add any device-dependent fields to new state */ _plotter->push_state (S___(_plotter)); return 0; } int _API_restorestate(S___(Plotter *_plotter)) { plDrawState *oldstate = _plotter->drawstate->previous; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "restorestate: invalid operation"); return -1; } if (_plotter->drawstate->previous == NULL) /* this is an attempt to pop the lowest state off the stack */ { _plotter->error (R___(_plotter) "restorestate: invalid operation"); return -1; } _API_endpath (S___(_plotter)); /* flush path if any */ /* tear down any device-dependent fields in state */ _plotter->pop_state (S___(_plotter)); /* elements of current state that are strings are first freed */ free ((char *)_plotter->drawstate->fill_rule); free ((char *)_plotter->drawstate->line_mode); free ((char *)_plotter->drawstate->join_mode); free ((char *)_plotter->drawstate->cap_mode); free ((char *)_plotter->drawstate->true_font_name); free ((char *)_plotter->drawstate->font_name); /* free dash array too, if nonempty */ if (_plotter->drawstate->dash_array_len > 0) free ((double *)_plotter->drawstate->dash_array); /* pop state off the stack */ free (_plotter->drawstate); _plotter->drawstate = oldstate; return 0; } void _pl_g_push_state (S___(Plotter *_plotter)) { return; } void _pl_g_pop_state (S___(Plotter *_plotter)) { return; } plotutils-2.6/libplot/g_space.c0000644000175000017500000004443111037267467013576 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the space method, which is a standard part of libplot. It sets the mapping from user coordinates to display coordinates. On the display device, the drawing region is a fixed rectangle (usually a square). The arguments to the space method are the lower left and upper right vertices of a `window' (a drawing rectangle), in user coordinates. This window, whose axes are aligned with the coordinate axes, will be mapped affinely onto the drawing region on the display device. Equivalently, the space method sets the transformation matrix attribute that will be used for graphical objects that are subsequently drawn. Any transformation matrix produced by invoking space() will necessarily preserve coordinate axes. This file also contains the space2 method, which is a GNU extension to libplot. The arguments to the space2 method are the vertices of an `affine window' (a drawing parallelogram), in user coordinates. (The specified vertices are the lower left, the lower right, and the upper left.) This window will be mapped affinely onto the drawing region on the display device. Transformation matrices produced by invoking space() do not necessarily preserve coordinate axes. space and space2 are simply wrappers around the fsetmatrix() method. */ /* This file also contains the fsetmatrix method, which is a GNU extension to libplot. Much as in Postscript, it sets the transformation matrix from user coordinates to NDC (normalized device coordinates). This, in turn, determines the map from user coordinates to device coordinates. The resulting transformation matrix will be used as an attribute of objects that are subsequently drawn on the graphics display. */ /* This file also contains the fconcat method, which is a GNU extension to libplot. fconcat is simply a wrapper around fsetmatrix. As in Postscript, it left-multiplies the transformation matrix from user coordinates to NDC coordinates by a specified matrix. That is, it modifies the affine transformation from user coordinates to NDC and hence to device coordinates, by requiring that the transformation currently in effect be be preceded by a specified affine transformation. */ /* N.B. Invoking fsetmatrix causes the default line width and default font size, which are expressed in user units, to be recomputed. That is because those two quantities are specified as a fraction of the size of the display: in device terms, rather than in terms of user units. The idea is that no matter what the arguments of fsetmatrix are, switching later to the default line width or default font size, by passing an out-of-bounds argument to linewidth() or fontsize(), should yield a reasonable result. */ #include "sys-defines.h" #include "extern.h" /* potential roundoff error (absolute, for defining boundary of display) */ #define ROUNDING_FUZZ 0.0000001 /* potential roundoff error (relative, used for checking isotropy etc.) */ #define OTHER_FUZZ 0.0000001 /* The vertices of the parallelogram in user space have coordinates (going counterclockwise) (x0,y0), (x1,y1), (x1,y1)+(x2,y2)-(x0,y0), and (x2,y2). */ int _API_fspace2 (R___(Plotter *_plotter) double x0, double y0, double x1, double y1, double x2, double y2) { double s[6]; double v0x, v0y, v1x, v1y, v2x, v2y; double cross; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fspace2: invalid operation"); return -1; } /* Compute affine transformation from user frame to NDC [normalized device coordinates] frame. The parallelogram in the user frame is mapped to the square [0,1]x[0,1] in the NDC frame. */ v0x = x0; v0y = y0; v1x = x1 - x0; v1y = y1 - y0; v2x = x2 - x0; v2y = y2 - y0; cross = v1x * v2y - v1y * v2x; if (cross == 0.0) { _plotter->error (R___(_plotter) "the requested singular affine transformation cannot be performed"); return -1; } /* linear transformation */ s[0] = v2y / cross; s[1] = -v1y / cross; s[2] = -v2x / cross; s[3] = v1x / cross; /* translation */ s[4] = - (v0x * v2y - v0y * v2x) / cross; s[5] = (v0x * v1y - v0y * v1x) / cross; return _API_fsetmatrix (R___(_plotter) s[0], s[1], s[2], s[3], s[4], s[5]); } int _API_fspace (R___(Plotter *_plotter) double x0, double y0, double x1, double y1) { return _API_fspace2 (R___(_plotter) x0, y0, x1, y0, x0, y1); } int _API_fsetmatrix (R___(Plotter *_plotter) double m0, double m1, double m2, double m3, double m4, double m5) { int i; double s[6], t[6]; double norm, min_sing_val, max_sing_val; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fsetmatrix: invalid operation"); return -1; } /* linear transformation */ s[0] = m0; s[1] = m1; s[2] = m2; s[3] = m3; /* translation */ s[4] = m4; s[5] = m5; /* store new user_frame->NDC_frame map in drawing state */ for (i = 0; i < 6; i++) _plotter->drawstate->transform.m_user_to_ndc[i] = s[i]; /* compute the user_frame -> device_frame map, as product of this map with the following NDC_frame->device_frame map: store in drawing state */ _matrix_product (s, _plotter->data->m_ndc_to_device, t); for (i = 0; i < 6; i++) _plotter->drawstate->transform.m[i] = t[i]; /* for convenience, precompute boolean properties of the user_frame->device_frame map: store in drawing state */ /* Does the user_frame->device_frame map preserve axis directions? */ _plotter->drawstate->transform.axes_preserved = (t[1] == 0.0 && t[2] == 0.0) ? true : false; /* Is the user_frame->device_frame map a uniform scaling (possibly involving a rotation or reflection)? We need to know this because it's only uniform maps that map circles to circles, and circular arcs to circular arcs. Also some Plotters, e.g. Fig Plotters, don't support non-uniformly transformed fonts. */ #define IS_ZERO(arg) (IS_ZERO1(arg) && IS_ZERO2(arg)) #define IS_ZERO1(arg) (FABS(arg) < OTHER_FUZZ * DMAX(t[0] * t[0], t[1] * t[1])) #define IS_ZERO2(arg) (FABS(arg) < OTHER_FUZZ * DMAX(t[2] * t[2], t[3] * t[3])) /* if row vectors are of equal length and orthogonal... */ if (IS_ZERO(t[0] * t[0] + t[1] * t[1] - t[2] * t[2] - t[3] * t[3]) && IS_ZERO(t[0] * t[2] + t[1] * t[3])) /* map's scaling is uniform */ _plotter->drawstate->transform.uniform = true; else /* map's scaling not uniform */ _plotter->drawstate->transform.uniform = false; /* Does the user_frame->physical_frame map involve a reflection? This is useful to know because some Plotters, e.g. Fig Plotters, don't support reflected fonts, even if they're uniformly transformed. This is a tricky question, because it isn't a question about the user_frame->device_frame map alone. There's a sequence of maps: user_frame -> NDC_frame -> device_frame -> physical_frame If the device_frame uses `flipped y' coordinates, then by definition, the default NDC_frame->device_frame map and the device_frame->physical_frame map both include a reflection, so they cancel each other out. (Though depending on the Plotter, non-default behavior could obtain. For example, the PAGESIZE parameter allows the specification of xsize and ysize, and if exactly one of these two is negative, the NDC_frame->device_frame map will include an extra reflection.) What we do is look at the `sign' or orientation-preservingness of the user_frame->device_frame map, and flip it if the device_frame->physical_frame map is flagged as `flipped y'. */ { double det; det = t[0] * t[3] - t[1] * t[2]; _plotter->drawstate->transform.nonreflection = ((_plotter->data->flipped_y ? -1 : 1) * det >= 0) ? true : false; } /* DO SOME OTHER STUFF, ALL RELATED TO LINE WIDTHS AND FONT SIZES */ /* For scaling purposes, compute matrix norm of linear transformation appearing in the affine map from the user frame to the NDC frame. */ /* This minimum singular value isn't really the norm. But it's close enough. */ _matrix_sing_vals (s, &min_sing_val, &max_sing_val); norm = min_sing_val; /* Set new default line width in user frame. This default value will be switched to, later, if the user calls linewidth() with a negative (i.e. out-of-bound) argument. */ if (_plotter->data->display_coors_type == (int)DISP_DEVICE_COORS_INTEGER_LIBXMI) /* using libxmi or a compatible rendering algorithm; so set default line width to zero (interpreted as specifying a Bresenham line) */ _plotter->drawstate->default_line_width = 0.0; else /* not using libxmi or a compatible rendering algorithm; so set default line width to a nonzero fraction of the display size */ { if (norm == 0.0) /* avoid division by 0 */ _plotter->drawstate->default_line_width = 0.0; else _plotter->drawstate->default_line_width = PL_DEFAULT_LINE_WIDTH_AS_FRACTION_OF_DISPLAY_SIZE / norm; } if (_plotter->data->linewidth_invoked == false) /* help out lusers who rely on us to initialize the linewidth to a reasonable value, as if this were plot(3) rather than GNU libplot */ { /* invoke API function flinewidth(), which computes a nominal device-frame line width, using the transformation matrix; specifying a negative linewidth switches to the default */ _API_flinewidth (R___(_plotter) -1.0); /* pretend we haven't invoked flinewidth() yet, so that the luser can invoke space() and/or fsetmatrix() additional times, each time automatically resetting the linewidth */ _plotter->data->linewidth_invoked = false; } else /* invoke API function merely to compute a new nominal device-frame line width, from the current user-frame line width */ _API_flinewidth (R___(_plotter) _plotter->drawstate->line_width); /* Similarly, set new default font size in user frame. This default value will be switched to, later, if the user calls fontsize() with out-of-bound arguments. */ if (norm == 0.0) /* avoid division by 0 */ _plotter->drawstate->default_font_size = 0.0; else _plotter->drawstate->default_font_size = PL_DEFAULT_FONT_SIZE_AS_FRACTION_OF_DISPLAY_SIZE / norm; /* Help out users who rely on us to choose a reasonable font size, as if this were Unix plot(3) rather than GNU libplot. We don't wish to retrieve an actual font here, so we don't invoke _API_fontsize(). However, this size will be used by the Plotter-specific method _paint_text(), which will first do the retrieval. */ if (_plotter->data->fontsize_invoked == false) _plotter->drawstate->font_size = _plotter->drawstate->default_font_size; return 0; } int _API_fconcat (R___(Plotter *_plotter) double m0, double m1, double m2, double m3, double m4, double m5) { double m[6], s[6]; if (!_plotter->data->open) { _plotter->error (R___(_plotter) "fconcat: invalid operation"); return -1; } m[0] = m0; m[1] = m1; m[2] = m2; m[3] = m3; m[4] = m4; m[5] = m5; /* compute new user->NDC affine map */ _matrix_product (m, _plotter->drawstate->transform.m_user_to_ndc, s); /* set it in drawing state */ return _API_fsetmatrix (R___(_plotter) s[0], s[1], s[2], s[3], s[4], s[5]); } /* Compute the affine transformation from the NDC frame to the device frame. This is an internal method, called by any Plotter at initialization time, or at latest during the first invocation of openpl(). The square [0,1]x[0,1] in the NDC frame is mapped to the viewport in the device frame (a square or rectangular region). So, the NDC_frame->device_frame map preserves coordinate axes. (Though either the x or y axis may be flipped, the latter being more common, because some devices' native coordinate system has a flipped-y convention, which means that the final device_frame->physical_frame map flips in the y direction.) There is support for the ROTATION Plotter parameter, which allows the NDC frame to be rotated by 90, 180, or 270 degrees, before it is mapped to the device frame. */ bool _compute_ndc_to_device_map (plPlotterData *data) { double t[6]; double map_1[6], map_2[6], map_1a[6], map_1b[6], map_1ab[6], map_1c[6]; double device_x_left, device_x_right, device_y_bottom, device_y_top; const char *rotation_s; double rotation_angle; int i; /* begin by computing device coordinate ranges */ switch (data->display_model_type) { case (int)DISP_MODEL_PHYSICAL: /* Plotter has a physical display, ranges in device coordinates of the viewport are known (they're expressed in inches, and are computed from the PAGESIZE parameter when the Plotter is created, see ?_defplot.c). E.g., AI, Fig, HPGL, PCL, and PS Plotters. */ { device_x_left = data->xmin; device_x_right = data->xmax; device_y_bottom = data->ymin; device_y_top = data->ymax; } break; case (int)DISP_MODEL_VIRTUAL: default: /* Plotter has a display, but its size isn't specified in physical units such as inches. E.g., CGM, SVG, GIF, PNM, Tektronix, X, and X Drawable Plotters. CGM and SVG Plotters are hybrids of a sort: the PAGESIZE parameter is meaningful for them, as far as nominal viewport size goes, but we treat a CGM or SVG display as `virtual' because a CGM or SVG viewer or interpreter is free to ignore the requested viewport size. */ { switch ((int)data->display_coors_type) { case (int)DISP_DEVICE_COORS_REAL: default: /* Real-coordinate virtual display device. E.g., generic and Metafile Plotters; also SVG Plotters. */ device_x_left = data->xmin; device_x_right = data->xmax; device_y_bottom = data->ymin; device_y_top = data->ymax; break; case (int)DISP_DEVICE_COORS_INTEGER_LIBXMI: case (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI: /* Integer-coordinate virtual display device, in the sense that we emit integer coordinates only (sometimes by choice). Of the Plotters that have virtual displays (see above), GIF, PNM, X, and X Drawable Plotters use libxmi-compatible scan conversion; Tektronix Plotters and CGM Plotters do not. In both cases, compute device coordinate ranges from imin, imax, jmin, jmax, which are already available (see ?_defplot.c; e.g., for Plotters with adjustable-size displays, they are taken from the BITMAPSIZE parameter). The subtraction/addition of 0.5-ROUNDING_FUZZ, which widens the rectangle by nearly 0.5 pixel on each side, is magic. */ { /* test whether NCD_frame->device_frame map reflects in the x and/or y direction */ double x_sign = (data->imin < data->imax ? 1.0 : -1.0); double y_sign = (data->jmin < data->jmax ? 1.0 : -1.0); device_x_left = ((double)(data->imin) + x_sign * (- 0.5 + ROUNDING_FUZZ)); device_x_right = ((double)(data->imax) + x_sign * (0.5 - ROUNDING_FUZZ)); device_y_bottom = ((double)(data->jmin) + y_sign * (- 0.5 + ROUNDING_FUZZ)); device_y_top = ((double)(data->jmax) + y_sign * (0.5 - ROUNDING_FUZZ)); } break; } } break; } /* Device coordinate ranges now known, so work out transformation from NDC frame to device frame; take ROTATION parameter into account. The (NDC_frame)->(device_frame) map is the composition of two maps: (1) a preliminary rotation about (0.5,0.5) in the NDC frame, (2) the default (NDC_frame)->(device frame) map, in that order. And the first of these is the composition of three: (1a) translate by -(0.5,0.5) (1b) rotate by ROTATION degrees about (0,0) (1c) translate by +(0.5,0.5). */ /* compute map #1 as product of maps 1a, 1b, 1c */ rotation_s = (const char *)_get_plot_param (data, "ROTATION"); if (rotation_s == NULL) rotation_s = (const char *)_get_default_plot_param ("ROTATION"); if (strcmp (rotation_s, "no") == 0) rotation_angle = 0.0; /* "no" means 0 degrees */ else if (strcmp (rotation_s, "yes") == 0) rotation_angle = 90.0; /* "yes" means 90 degrees */ else if (sscanf (rotation_s, "%lf", &rotation_angle) <= 0) rotation_angle = 0.0; /* default */ rotation_angle *= (M_PI / 180.0); /* convert to radians */ map_1a[0] = map_1a[3] = 1.0; map_1a[1] = map_1a[2] = 0.0; map_1a[4] = map_1a[5] = -0.5; map_1b[0] = cos (rotation_angle); map_1b[1] = sin (rotation_angle); map_1b[2] = - sin (rotation_angle); map_1b[3] = cos (rotation_angle); map_1b[4] = map_1b[5] = 0.0; map_1c[0] = map_1c[3] = 1.0; map_1c[1] = map_1c[2] = 0.0; map_1c[4] = map_1c[5] = 0.5; _matrix_product (map_1a, map_1b, map_1ab); _matrix_product (map_1ab, map_1c, map_1); /* compute map #2: the default (NDC frame)->(device frame) map */ /* NDC point (0,0) [lower left corner] gets mapped into this */ map_2[4] = device_x_left; map_2[5] = device_y_bottom; /* NDC vector (1,0) gets mapped into this */ map_2[0] = device_x_right - device_x_left; map_2[1] = 0.0; /* NDC vector (0,1) gets mapped into this */ map_2[2] = 0.0; map_2[3] = device_y_top - device_y_bottom; /* compute (NDC_frame)->(device frame) map as a product of maps 1,2 */ _matrix_product (map_1, map_2, t); /* set affine transformation in Plotter */ for (i = 0; i < 6; i++) data->m_ndc_to_device[i] = t[i]; return true; } plotutils-2.6/libplot/g_subpaths.c0000644000175000017500000021625111037243261014317 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains all of libplot's low-level code for constructing and manipulating paths, both simple and compound. It includes functions that construct polygonal and Bezier approximations to a given path. They are used by Plotters whose output format does not support all of libplot's graphics primitives. */ /* E.g., _fakearc() draws polygonal approximations to circular and elliptic quarter-arcs. Each polygonal approximation will contain 2**NUM_ARC_SUBDIVISIONS line segments. Similarly, polygonal approximations to quadratic and cubic Beziers will contain no more than 2**MAX_NUM_BEZIER2_SUBDIVISIONS and 2**MAX_NUM_BEZIER3_SUBDIVISIONS line segments. However, each bisection algorithm used for drawing a Bezier normally usually its recursion based on a relative flatness criterion (see below). */ #include "sys-defines.h" #include "extern.h" #include "g_arc.h" /* for chord table */ /* Number of times a circular arc or quarter-ellipse will be recursively subdivided. Two raised to this power is the number of line segments that the polygonalization will contain. */ /* NOTE: the maximum allowed value for NUM_ARC_SUBDIVISIONS is TABULATED_ARC_SUBDIVISIONS (i.e., the size of the chordal deviation table for a quarter-circle or quarter-ellipse, defined in g_arc.h). */ #define NUM_ARC_SUBDIVISIONS 5 /* Maximum number of times quadratic and cubic Beziers will be recursively subdivided. For Beziers we use an adaptive algorithm, in which bisection stops when a specified relative flatness has been reached. But these parameters provide a hard cutoff, which overrides the relative flatness end condition. */ #define MAX_NUM_BEZIER2_SUBDIVISIONS 6 #define MAX_NUM_BEZIER3_SUBDIVISIONS 7 /* The relative flatness parameters. */ #define REL_QUAD_FLATNESS 5e-4 #define REL_CUBIC_FLATNESS 5e-4 #define DATAPOINTS_BUFSIZ PL_MAX_UNFILLED_PATH_LENGTH #define DIST(p0,p1) (sqrt( ((p0).x - (p1).x)*((p0).x - (p1).x) \ + ((p0).y - (p1).y)*((p0).y - (p1).y))) #define MIDWAY(x0, x1) (0.5 * ((x0) + (x1))) /* forward references */ static void _prepare_chord_table (double sagitta, double custom_chord_table[TABULATED_ARC_SUBDIVISIONS]); static void _fakearc (plPath *path, plPoint p0, plPoint p1, int arc_type, const double *custom_chord_table, const double m[4]); /* ctor for plPath class; constructs an empty plPath, with type set to PATH_SEGMENT_LIST (default type) */ plPath * _new_plPath (void) { plPath *path; path = (plPath *)_pl_xmalloc (sizeof (plPath)); path->type = PATH_SEGMENT_LIST; path->segments = (plPathSegment *)NULL; path->segments_len = 0; /* number of slots allocated */ path->num_segments = 0; /* number of slots occupied */ path->primitive = false; path->llx = DBL_MAX; path->lly = DBL_MAX; path->urx = -(DBL_MAX); path->ury = -(DBL_MAX); return path; } /* dtor for plPath class */ void _delete_plPath (plPath *path) { if (path == (plPath *)NULL) return; if (path->type == PATH_SEGMENT_LIST && path->segments_len > 0) /* number of slots allocated */ free (path->segments); free (path); } /* reset function for plPath class */ void _reset_plPath (plPath *path) { if (path == (plPath *)NULL) return; if (path->type == PATH_SEGMENT_LIST && path->segments_len > 0) /* number of slots allocated */ free (path->segments); path->segments = (plPathSegment *)NULL; path->segments_len = 0; path->type = PATH_SEGMENT_LIST; /* restore to default */ path->num_segments = 0; path->primitive = false; path->llx = DBL_MAX; path->lly = DBL_MAX; path->urx = -(DBL_MAX); path->ury = -(DBL_MAX); } void _add_moveto (plPath *path, plPoint p) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; /* empty, so allocate a segment buffer */ path->segments = (plPathSegment *) _pl_xmalloc (DATAPOINTS_BUFSIZ * sizeof(plPathSegment)); path->segments_len = DATAPOINTS_BUFSIZ; path->segments[0].type = S_MOVETO; path->segments[0].p = p; path->num_segments = 1; path->llx = p.x; path->lly = p.y; path->urx = p.x; path->ury = p.y; } void _add_line (plPath *path, plPoint p) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; if (path->num_segments == 0) /* empty, so allocate a segment buffer */ { path->segments = (plPathSegment *) _pl_xmalloc (DATAPOINTS_BUFSIZ * sizeof(plPathSegment)); path->segments_len = DATAPOINTS_BUFSIZ; } if (path->num_segments == path->segments_len) /* full, so reallocate */ { path->segments = (plPathSegment *) _pl_xrealloc (path->segments, 2 * path->segments_len * sizeof(plPathSegment)); path->segments_len *= 2; } path->segments[path->num_segments].type = S_LINE; path->segments[path->num_segments].p = p; path->num_segments++; path->llx = DMIN(path->llx, p.x); path->lly = DMIN(path->lly, p.y); path->urx = DMAX(path->urx, p.x); path->ury = DMAX(path->ury, p.y); } void _add_closepath (plPath *path) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; if (path->num_segments == 0) /* meaningless */ return; if (path->num_segments == path->segments_len) /* full, so reallocate */ { path->segments = (plPathSegment *) _pl_xrealloc (path->segments, 2 * path->segments_len * sizeof(plPathSegment)); path->segments_len *= 2; } path->segments[path->num_segments].type = S_CLOSEPATH; path->segments[path->num_segments].p = path->segments[0].p; path->num_segments++; } void _add_bezier2 (plPath *path, plPoint pc, plPoint p) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; if (path->num_segments == 0) /* empty, so allocate a segment buffer */ { path->segments = (plPathSegment *) _pl_xmalloc (DATAPOINTS_BUFSIZ * sizeof(plPathSegment)); path->segments_len = DATAPOINTS_BUFSIZ; } if (path->num_segments == path->segments_len) /* full, so reallocate */ { path->segments = (plPathSegment *) _pl_xrealloc (path->segments, 2 * path->segments_len * sizeof(plPathSegment)); path->segments_len *= 2; } path->segments[path->num_segments].type = S_QUAD; path->segments[path->num_segments].p = p; path->segments[path->num_segments].pc = pc; path->num_segments++; } void _add_bezier3 (plPath *path, plPoint pc, plPoint pd, plPoint p) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; if (path->num_segments == 0) /* empty, so allocate a segment buffer */ { path->segments = (plPathSegment *) _pl_xmalloc (DATAPOINTS_BUFSIZ * sizeof(plPathSegment)); path->segments_len = DATAPOINTS_BUFSIZ; } if (path->num_segments == path->segments_len) /* full, so reallocate */ { path->segments = (plPathSegment *) _pl_xrealloc (path->segments, 2 * path->segments_len * sizeof(plPathSegment)); path->segments_len *= 2; } path->segments[path->num_segments].type = S_CUBIC; path->segments[path->num_segments].p = p; path->segments[path->num_segments].pc = pc; path->segments[path->num_segments].pd = pd; path->num_segments++; } void _add_arc (plPath *path, plPoint pc, plPoint p1) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; if (path->num_segments == 0) /* empty, so allocate a segment buffer */ { path->segments = (plPathSegment *) _pl_xmalloc (DATAPOINTS_BUFSIZ * sizeof(plPathSegment)); path->segments_len = DATAPOINTS_BUFSIZ; } if (path->num_segments == path->segments_len) /* full, so reallocate */ { path->segments = (plPathSegment *) _pl_xrealloc (path->segments, 2 * path->segments_len * sizeof(plPathSegment)); path->segments_len *= 2; } path->segments[path->num_segments].type = S_ARC; path->segments[path->num_segments].p = p1; path->segments[path->num_segments].pc = pc; path->num_segments++; } void _add_ellarc (plPath *path, plPoint pc, plPoint p1) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; if (path->num_segments == 0) /* empty, so allocate a segment buffer */ { path->segments = (plPathSegment *) _pl_xmalloc (DATAPOINTS_BUFSIZ * sizeof(plPathSegment)); path->segments_len = DATAPOINTS_BUFSIZ; } if (path->num_segments == path->segments_len) /* full, so reallocate */ { path->segments = (plPathSegment *) _pl_xrealloc (path->segments, 2 * path->segments_len * sizeof(plPathSegment)); path->segments_len *= 2; } path->segments[path->num_segments].type = S_ELLARC; path->segments[path->num_segments].p = p1; path->segments[path->num_segments].pc = pc; path->num_segments++; } void _add_box (plPath *path, plPoint p0, plPoint p1, bool clockwise) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; path->type = PATH_BOX; path->p0 = p0; path->p1 = p1; path->clockwise = clockwise; path->llx = DMIN(path->llx, p0.x); path->lly = DMIN(path->lly, p0.y); path->urx = DMAX(path->urx, p0.x); path->ury = DMAX(path->ury, p0.y); path->llx = DMIN(path->llx, p1.x); path->lly = DMIN(path->lly, p1.y); path->urx = DMAX(path->urx, p1.x); path->ury = DMAX(path->ury, p1.y); } void _add_circle (plPath *path, plPoint pc, double radius, bool clockwise) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; path->type = PATH_CIRCLE; path->pc = pc; path->radius = radius; path->clockwise = clockwise; } void _add_ellipse (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise) { if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; path->type = PATH_ELLIPSE; path->pc = pc; path->rx = rx; path->ry = ry; path->angle = angle; path->clockwise = clockwise; } /* Draw a polygonal approximation to the circular arc from p0 to p1, with center pc, by calling _fakearc(), which in turn repeatedly calls _add_line(). It is assumed that p0 and p1 are distinct. It is assumed that pc is on the perpendicular bisector of the line segment joining them, and that the graphics cursor is initially located at p0. */ void _add_arc_as_lines (plPath *path, plPoint pc, plPoint p1) { /* starting point */ plPoint p0; /* bisection point of arc, and midpoint of chord */ plPoint pb, pm; /* rotation matrix */ double m[4]; /* other variables */ plVector v, v0, v1; double radius, sagitta; double cross, orientation; /* handcrafted relative chordal deviation table, for this arc */ double custom_chord_table[TABULATED_ARC_SUBDIVISIONS]; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; /* determine starting point */ p0 = path->segments[path->num_segments - 1].p; if (p0.x == p1.x && p0.y == p1.y) /* zero-length arc, draw as zero-length line segment */ _add_line (path, p0); else /* genuine polygonal approximation */ { /* vectors from pc to p0, and pc to p1 */ v0.x = p0.x - pc.x; v0.y = p0.y - pc.y; v1.x = p1.x - pc.x; v1.y = p1.y - pc.y; /* cross product, zero if points are collinear */ cross = v0.x * v1.y - v1.x * v0.y; /* Compute orientation. Note libplot convention: if p0, p1, pc are collinear then arc goes counterclockwise from p0 to p1. */ orientation = (cross >= 0.0 ? 1.0 : -1.0); radius = DIST(pc, p0); /* radius is distance to p0 or p1 */ pm.x = 0.5 * (p0.x + p1.x); /* midpoint of chord from p0 to p1 */ pm.y = 0.5 * (p0.y + p1.y); v.x = p1.x - p0.x; /* chord vector from p0 to p1 */ v.y = p1.y - p0.y; _vscale(&v, radius); pb.x = pc.x + orientation * v.y; /* bisection point of arc */ pb.y = pc.y - orientation * v.x; sagitta = DIST(pb, pm) / radius; /* fill in entries of chordal deviation table for this user-defined sagitta */ _prepare_chord_table (sagitta, custom_chord_table); /* call _fakearc(), using for `rotation' matrix m[] a clockwise or counterclockwise rotation by 90 degrees, depending on orientation */ m[0] = 0.0, m[1] = orientation, m[2] = -orientation, m[3] = 0.0; _fakearc (path, p0, p1, USER_DEFINED_ARC, custom_chord_table, m); } } /* Draw a polygonal approximation to a quarter-ellipse from p0 to p1, by calling _fakearc(), which in turn repeatedly calls _add_line(). pc is the center of the arc, and p0, p1, pc are assumed not to be collinear. It is assumed that the graphics cursor is located at p0 when this function is called. The control triangle for the elliptic arc will have vertices p0, p1, and K = p0 + (p1 - pc) = p1 + (p0 - pc). The arc will pass through p0 and p1, and will be tangent at p0 to the edge from p0 to K, and at p1 to the edge from p1 to K. */ void _add_ellarc_as_lines (plPath *path, plPoint pc, plPoint p1) { plPoint p0; plVector v0, v1; double cross; double m[4]; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; /* determine starting point */ p0 = path->segments[path->num_segments - 1].p; /* vectors from pc to p0, and pc to p1 */ v0.x = p0.x - pc.x; v0.y = p0.y - pc.y; v1.x = p1.x - pc.x; v1.y = p1.y - pc.y; /* cross product */ cross = v0.x * v1.y - v1.x * v0.y; if (FROUND(cross) == 0.0) /* collinear points, draw line segment from p0 to p1 (not quite right, could be bettered) */ _add_line (path, p1); else { /* `rotation' matrix (it maps v0 -> -v1 and v1 -> v0) */ m[0] = - (v0.x * v0.y + v1.x * v1.y) / cross; m[1] = (v0.x * v0.x + v1.x * v1.x) / cross; m[2] = - (v0.y * v0.y + v1.y * v1.y) / cross; m[3] = (v0.x * v0.y + v1.x * v1.y) / cross; /* draw polyline inscribed in the quarter-ellipse */ _fakearc (path, p0, p1, QUARTER_ARC, (double *)NULL, m); } } /* A function that approximates a circular arc by a cubic Bezier. The approximation used is a standard one. E.g., a quarter circle extending from (1,0) to (0,1), with center (0,0), would be approximated by a cubic Bezier with control points (1,KAPPA) and (KAPPA,1). Here KAPPA = (4/3)[sqrt(2)-1] = 0.552284749825, approximately. The cubic Bezier will touch the quarter-circle along the line x=y. For a quarter-circle, the maximum relative error in r as a function of theta is about 2.7e-4. The error in r has the same sign, for all theta. */ /* According to Berthold K. P. Horn , the general formula for KAPPA, for a radius-1 circular arc (not necessary a quarter-circle), KAPPA = (4/3)sqrt[(1-cos H)/(1+cos H)] = (4/3)[1-cos H]/[sin H] = (4/3)[sin H]/[1+cosH] where H is half the angle subtended by the arc. H=45 degrees for a quarter circle. This is the formula we use. */ /* Louis Vosloo points out that for a quarter-circle, the value 0.55228... for KAPPA is, for some purposes, sub-optimal. By dropping the requirement that the quarter-circle and the Bezier touch each other along the symmetry line x=y, one can slightly decrease the maximum relative error. He says 0.5541... is the best possible choice. He doesn't have an improved value of KAPPA for a general arc, though. */ void _add_arc_as_bezier3 (plPath *path, plPoint pc, plPoint p1) { plPoint p0; plVector v0, v1; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; /* determine starting point */ p0 = path->segments[path->num_segments - 1].p; /* vectors to starting, ending points */ v0.x = p0.x - pc.x; v0.y = p0.y - pc.y; v1.x = p1.x - pc.x; v1.y = p1.y - pc.y; if ((v0.x == 0.0 && v0.y == 0.0) || (v1.x == 0.0 && v1.y == 0.0) || (v0.x == v1.x && v0.y == v1.y)) /* degenerate case */ _add_line (path, p1); else /* normal case */ { double oldangle, newangle, anglerange; double cross; int orientation; /* cross product, zero if points are collinear */ cross = v0.x * v1.y - v1.x * v0.y; /* Compute orientation. Note libplot convention: if p0, p1, pc are collinear then arc goes counterclockwise from p0 to p1. */ orientation = (cross >= 0.0 ? 1 : -1); /* compute signed subtended angle */ oldangle = _xatan2 (v0.y, v0.x); newangle = _xatan2 (v1.y, v1.x); anglerange = newangle - oldangle; if (anglerange > M_PI) anglerange -= (2 * M_PI); if (anglerange <= -(M_PI)) anglerange += (2 * M_PI); if (FABS(anglerange) > 0.51 * M_PI) /* subtended angle > 0.51 * pi, so split arc in two and recurse, since Bezier approximation isn't very good for angles much greater than 90 degrees */ { double radius; plPoint pb; plVector v; radius = DIST(pc, p0); /* radius is distance to p0 or p1 */ v.x = p1.x - p0.x; /* chord vector from p0 to p1 */ v.y = p1.y - p0.y; _vscale(&v, radius); pb.x = pc.x + orientation * v.y; /* bisection point of arc */ pb.y = pc.y - orientation * v.x; _add_arc_as_bezier3 (path, pc, pb); _add_arc_as_bezier3 (path, pc, p1); } else /* subtended angle <= 0.51 * pi, so a single Bezier suffices */ { double halfangle, sinhalf, coshalf, kappa; plPoint pc_bezier3, pd_bezier3; halfangle = 0.5 * FABS(anglerange); sinhalf = sin (halfangle); coshalf = cos (halfangle); /* compute kappa using either of two formulae, depending on numerical stability */ if (FABS(sinhalf) < 0.5) kappa = (4.0/3.0) * sinhalf / (1.0 + coshalf); else kappa = (4.0/3.0) * (1.0 - coshalf) / sinhalf; pc_bezier3.x = p0.x - kappa * orientation * v0.y; pc_bezier3.y = p0.y + kappa * orientation * v0.x; pd_bezier3.x = p1.x + kappa * orientation * v1.y; pd_bezier3.y = p1.y - kappa * orientation * v1.x; _add_bezier3 (path, pc_bezier3, pd_bezier3, p1); } } } #define KAPPA_FOR_QUARTER_CIRCLE 0.552284749825 void _add_ellarc_as_bezier3 (plPath *path, plPoint pc, plPoint p1) { plPoint p0, pc_bezier3, pd_bezier3; plVector v0, v1; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; /* determine starting point */ p0 = path->segments[path->num_segments - 1].p; /* vectors to starting, ending points */ v0.x = p0.x - pc.x; v0.y = p0.y - pc.y; v1.x = p1.x - pc.x; v1.y = p1.y - pc.y; /* replace by cubic Bezier, with computed control points */ pc_bezier3.x = p0.x + KAPPA_FOR_QUARTER_CIRCLE * v1.x; pc_bezier3.y = p0.y + KAPPA_FOR_QUARTER_CIRCLE * v1.y; pd_bezier3.x = p1.x + KAPPA_FOR_QUARTER_CIRCLE * v0.x; pd_bezier3.y = p1.y + KAPPA_FOR_QUARTER_CIRCLE * v0.y; _add_bezier3 (path, pc_bezier3, pd_bezier3, p1); } /* Approximate a quadratic Bezier by a polyline: standard deCasteljau bisection algorithm. However, we stop subdividing when an appropriate metric of the quadratic Bezier to be drawn is sufficiently small. If (p0,p1,p2) defines the quadratic Bezier, we require that the length of p0-2*p1+p2 be less than REL_QUAD_FLATNESS times the distance between the endpoints of the original Bezier. */ void _add_bezier2_as_lines (plPath *path, plPoint pc, plPoint p) { plPoint r0[MAX_NUM_BEZIER2_SUBDIVISIONS + 1], r1[MAX_NUM_BEZIER2_SUBDIVISIONS + 1], r2[MAX_NUM_BEZIER2_SUBDIVISIONS + 1]; int level[MAX_NUM_BEZIER2_SUBDIVISIONS + 1]; int n = 0; /* index of top of stack, < MAX_NUM_BEZIER2_SUBDIVISIONS */ int segments_drawn = 0; plPoint p0; double sqdist, max_squared_length; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; /* determine starting point */ p0 = path->segments[path->num_segments - 1].p; /* squared distance between p0 and p */ sqdist = (p.x - p0.x) * (p.x - p0.x) + (p.y - p0.y) * (p.y - p0.y); max_squared_length = REL_QUAD_FLATNESS * REL_QUAD_FLATNESS * sqdist; r0[0] = p0; r1[0] = pc; r2[0] = p; level[0] = 0; while (n >= 0) /* i.e. while stack is nonempty */ { int current_level; plPoint q0, q1, q2; current_level = level[n]; q0 = r0[n]; q1 = r1[n]; q2 = r2[n]; if (current_level >= MAX_NUM_BEZIER2_SUBDIVISIONS) /* to avoid stack overflow, draw as line segment */ { _add_line (path, q2); segments_drawn++; n--; } else /* maybe bisect the Bezier */ { plPoint qq0, qq1; plPoint qqq0; plVector vec1; vec1.x = q0.x - 2 * q1.x + q2.x; vec1.y = q0.y - 2 * q1.y + q2.y; if (vec1.x * vec1.x + vec1.y * vec1.y < max_squared_length) /* very flat Bezier, so draw as line segment */ { _add_line (path, q2); segments_drawn++; n--; } else /* split Bezier into pair and recurse */ /* level[n] >= n is an invariant */ { qq0.x = MIDWAY(q0.x, q1.x); qq0.y = MIDWAY(q0.y, q1.y); qq1.x = MIDWAY(q1.x, q2.x); qq1.y = MIDWAY(q1.y, q2.y); qqq0.x = MIDWAY(qq0.x, qq1.x); qqq0.y = MIDWAY(qq0.y, qq1.y); /* first half, deal with next */ r0[n+1] = q0; r1[n+1] = qq0; r2[n+1] = qqq0; level[n+1] = current_level + 1; /* second half, deal with later */ r0[n] = qqq0; r1[n] = qq1; r2[n] = q2; level[n] = current_level + 1; n++; } } } } /* Approximate a cubic Bezier by a polyline: standard deCasteljau bisection algorithm. However, we stop subdividing when an appropriate metric of the cubic Bezier to be drawn is sufficiently small. If (p0,p1,p2,p3) defines the cubic Bezier, we require that the lengths of p0-2*p1+p2 and p1-2*p2+p3 be less than REL_CUBIC_FLATNESS times the distance between the endpoints of the original Bezier. */ void _add_bezier3_as_lines (plPath *path, plPoint pc, plPoint pd, plPoint p) { plPoint r0[MAX_NUM_BEZIER3_SUBDIVISIONS + 1], r1[MAX_NUM_BEZIER3_SUBDIVISIONS + 1], r2[MAX_NUM_BEZIER3_SUBDIVISIONS + 1], r3[MAX_NUM_BEZIER3_SUBDIVISIONS + 1]; int level[MAX_NUM_BEZIER3_SUBDIVISIONS + 1]; int n = 0; /* index of top of stack, < MAX_NUM_BEZIER3_SUBDIVISIONS */ int segments_drawn = 0; plPoint p0; double sqdist, max_squared_length; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments == 0) return; /* determine starting point */ p0 = path->segments[path->num_segments - 1].p; /* squared distance between p0 and p */ sqdist = (p.x - p0.x) * (p.x - p0.x) + (p.y - p0.y) * (p.y - p0.y); max_squared_length = REL_CUBIC_FLATNESS * REL_CUBIC_FLATNESS * sqdist; r0[0] = p0; r1[0] = pc; r2[0] = pd; r3[0] = p; level[0] = 0; while (n >= 0) /* i.e. while stack is nonempty */ { int current_level; plPoint q0, q1, q2, q3; current_level = level[n]; q0 = r0[n]; q1 = r1[n]; q2 = r2[n]; q3 = r3[n]; if (current_level >= MAX_NUM_BEZIER3_SUBDIVISIONS) /* draw line segment, to avoid stack overflow */ { _add_line (path, q3); segments_drawn++; n--; } else /* maybe bisect the Bezier */ { plPoint qq0, qq1, qq2; plPoint qqq0, qqq1; plPoint qqqq0; plVector vec1, vec2; vec1.x = q0.x - 2 * q1.x + q2.x; vec1.y = q0.y - 2 * q1.y + q2.y; vec2.x = q1.x - 2 * q2.x + q3.x; vec2.y = q1.y - 2 * q2.y + q3.y; if (vec1.x * vec1.x + vec1.y * vec1.y < max_squared_length && vec2.x * vec2.x + vec2.y * vec2.y < max_squared_length) /* very flat Bezier, so draw as line segment */ { _add_line (path, q3); segments_drawn++; n--; } else /* split Bezier into pair and recurse */ /* level[n] >= n is an invariant */ { qq0.x = MIDWAY(q0.x, q1.x); qq0.y = MIDWAY(q0.y, q1.y); qq1.x = MIDWAY(q1.x, q2.x); qq1.y = MIDWAY(q1.y, q2.y); qq2.x = MIDWAY(q2.x, q3.x); qq2.y = MIDWAY(q2.y, q3.y); qqq0.x = MIDWAY(qq0.x, qq1.x); qqq0.y = MIDWAY(qq0.y, qq1.y); qqq1.x = MIDWAY(qq1.x, qq2.x); qqq1.y = MIDWAY(qq1.y, qq2.y); qqqq0.x = MIDWAY(qqq0.x, qqq1.x); qqqq0.y = MIDWAY(qqq0.y, qqq1.y); /* first half, deal with next */ level[n+1] = current_level + 1; r0[n+1] = q0; r1[n+1] = qq0; r2[n+1] = qqq0; r3[n+1] = qqqq0; /* second half, deal with later */ level[n] = current_level + 1; r0[n] = qqqq0; r1[n] = qqq1; r2[n] = qq2; r3[n] = q3; n++; } } } } void _add_box_as_lines (plPath *path, plPoint p0, plPoint p1, bool clockwise) { bool x_move_is_first; plPoint newpoint; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; _add_moveto (path, p0); /* if counterclockwise, would first pen motion be in x direction? */ x_move_is_first = ((p1.x >= p0.x && p1.y >= p0.y) || (p1.x < p0.x && p1.y < p0.y) ? true : false); if (clockwise) /* take complement */ x_move_is_first = (x_move_is_first == true ? false : true); if (x_move_is_first) { newpoint.x = p1.x; newpoint.y = p0.y; } else { newpoint.x = p0.x; newpoint.y = p1.y; } _add_line (path, newpoint); _add_line (path, p1); if (x_move_is_first) { newpoint.x = p0.x; newpoint.y = p1.y; } else { newpoint.x = p1.x; newpoint.y = p0.y; } _add_line (path, newpoint); _add_line (path, p0); path->primitive = true; /* flag as flattened primitive */ } void _add_ellipse_as_bezier3s (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise) { plPoint startpoint, newpoint; double theta, costheta, sintheta; double xc, yc; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; /* draw ellipse by drawing four elliptic arcs */ theta = (M_PI / 180.0) * angle; /* convert to radians */ costheta = cos (theta); sintheta = sin (theta); xc = pc.x; yc = pc.y; startpoint.x = xc + rx * costheta; startpoint.y = yc + rx * sintheta; _add_moveto (path, startpoint); if (clockwise) { newpoint.x = xc + ry * sintheta; newpoint.y = yc - ry * costheta; } else { newpoint.x = xc - ry * sintheta; newpoint.y = yc + ry * costheta; } _add_ellarc_as_bezier3 (path, pc, newpoint); newpoint.x = xc - rx * costheta; newpoint.y = yc - rx * sintheta; _add_ellarc_as_bezier3 (path, pc, newpoint); if (clockwise) { newpoint.x = xc - ry * sintheta; newpoint.y = yc + ry * costheta; } else { newpoint.x = xc + ry * sintheta; newpoint.y = yc - ry * costheta; } _add_ellarc_as_bezier3 (path, pc, newpoint); _add_ellarc_as_bezier3 (path, pc, startpoint); path->primitive = true; /* flag as flattened primitive */ } void _add_ellipse_as_ellarcs (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise) { plPoint startpoint, newpoint; double theta, costheta, sintheta; double xc, yc; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; /* draw ellipse by drawing four elliptic arcs */ theta = (M_PI / 180.0) * angle; /* convert to radians */ costheta = cos (theta); sintheta = sin (theta); xc = pc.x; yc = pc.y; startpoint.x = xc + rx * costheta; startpoint.y = yc + rx * sintheta; _add_moveto (path, startpoint); if (clockwise) { newpoint.x = xc + ry * sintheta; newpoint.y = yc - ry * costheta; } else { newpoint.x = xc - ry * sintheta; newpoint.y = yc + ry * costheta; } _add_ellarc (path, pc, newpoint); newpoint.x = xc - rx * costheta; newpoint.y = yc - rx * sintheta; _add_ellarc (path, pc, newpoint); if (clockwise) { newpoint.x = xc - ry * sintheta; newpoint.y = yc + ry * costheta; } else { newpoint.x = xc + ry * sintheta; newpoint.y = yc - ry * costheta; } _add_ellarc (path, pc, newpoint); _add_ellarc (path, pc, startpoint); path->primitive = true; /* flag as flattened primitive */ } void _add_ellipse_as_lines (plPath *path, plPoint pc, double rx, double ry, double angle, bool clockwise) { plPoint startpoint, newpoint; double theta, costheta, sintheta; double xc, yc; if (path == (plPath *)NULL) return; if (path->type != PATH_SEGMENT_LIST || path->num_segments > 0) return; /* draw ellipse by drawing four fake elliptic arcs */ theta = (M_PI / 180.0) * angle; /* convert to radians */ costheta = cos (theta); sintheta = sin (theta); xc = pc.x; yc = pc.y; startpoint.x = xc + rx * costheta; startpoint.y = yc + rx * sintheta; _add_moveto (path, startpoint); if (clockwise) { newpoint.x = xc + ry * sintheta; newpoint.y = yc - ry * costheta; } else { newpoint.x = xc - ry * sintheta; newpoint.y = yc + ry * costheta; } _add_ellarc_as_lines (path, pc, newpoint); newpoint.x = xc - rx * costheta; newpoint.y = yc - rx * sintheta; _add_ellarc_as_lines (path, pc, newpoint); if (clockwise) { newpoint.x = xc - ry * sintheta; newpoint.y = yc + ry * costheta; } else { newpoint.x = xc + ry * sintheta; newpoint.y = yc - ry * costheta; } _add_ellarc_as_lines (path, pc, newpoint); _add_ellarc_as_lines (path, pc, startpoint); path->primitive = true; /* flag as flattened primitive */ } void _add_circle_as_bezier3s (plPath *path, plPoint pc, double radius, bool clockwise) { if (path == (plPath *)NULL) return; _add_ellipse_as_bezier3s (path, pc, radius, radius, 0.0, clockwise); path->primitive = true; /* flag as flattened primitive */ } void _add_circle_as_ellarcs (plPath *path, plPoint pc, double radius, bool clockwise) { if (path == (plPath *)NULL) return; _add_ellipse_as_ellarcs (path, pc, radius, radius, 0.0, clockwise); path->primitive = true; /* flag as flattened primitive */ } void _add_circle_as_lines (plPath *path, plPoint pc, double radius, bool clockwise) { if (path == (plPath *)NULL) return; _add_ellipse_as_lines (path, pc, radius, radius, 0.0, clockwise); path->primitive = true; /* flag as flattened primitive */ } /* The _fakearc() subroutine below, which is called by _add_arc_as_lines() and _add_ellarc_as_lines(), contains a remote descendent of the arc-drawing algorithm of Ken Turkowski described in Graphics Gems V. His algorithm is a recursive circle subdivision algorithm, which relies on the fact that if s and s' are the (chordal deviation)/radius associated to (respectively) an arc and a half-arc, then s' is approximately equal to s/4. The exact formula is s' = 1 - sqrt (1 - s/2), which applies for all s in the meaningful range, i.e. 0 <= s <= 2. Ken's algorithm rotates the chord of an arc by 90 degrees and scales it to have length s'. The resulting vector will be the chordal deviation vector of the arc, which gives the midpoint of the arc, and hence the endpoints of each half of the arc. So this drawing technique is recursive. The problem with this approach is that scaling a vector to a specified length requires a square root, so there are two square roots in each subdivision step. One can attempt to remove one of them by noticing that the chord half-length h always satisfies h = sqrt(s * (2-s))). So one can rotate the chord vector by 90 degrees, and multiply its length by s/2h, i.e., s/2sqrt(s * (2-s)), to get the chordal deviation vector. This factor still includes a square root though. Also one still needs to compute a square root in order to proceed from one subdivision step to the next, i.e. to compute s' from s. We can get around the square root problem by drawing only circular arcs with subtended angle of 90 degrees (quarter-circles), or elliptic arcs that are obtained from such quarter-circles by affine transformations (so-called quarter-ellipses). To draw the latter, we need only replace the 90 degree rotation matrix mentioned above by an affine transformation that maps v0->-v1 and v1->v0, where v0 = p0 - pc and v1 = p1 - pc are the displacement vectors from the center of the ellipse to the endpoints of the arc. If we do this, we get an elliptic arc with p0 and p1 as endpoints. The vectors v0 and v1 are said lie along conjugate diameters of the quarter-ellipse. So for drawing quarter-ellipses, the only initial value of s we need to consider is the one for a quarter-circle, which is 1-sqrt(1/2). The successive values of s/2h that will be encountered, after each bisection, are pre-computed and stored in a lookup table, found in g_arc.h. This approach lets us avoid, completely, any computation of square roots during the drawing of quarter-circles and quarter-ellipses. The only square roots we need are precomputed. We don't need any floating point divisions in the main loop either. Of course for other angles than 90 degrees, we precompute a chord table and pass it to _fakearc(). The implementation below does not use recursion (we use a local array, rather than the call stack, to store the sequence of generated points). */ static void _fakearc (plPath *path, plPoint p0, plPoint p1, int arc_type, const double *custom_chord_table, const double m[4]) { plPoint p[NUM_ARC_SUBDIVISIONS + 1], q[NUM_ARC_SUBDIVISIONS + 1]; int level[NUM_ARC_SUBDIVISIONS + 1]; int n = 0; /* index of top of stack, < NUM_ARC_SUBDIVISIONS */ int segments_drawn = 0; const double *our_chord_table; if (arc_type == USER_DEFINED_ARC) our_chord_table = custom_chord_table; else /* custom_chord_table arg ignored */ our_chord_table = _chord_table[arc_type]; p[0] = p0; q[0] = p1; level[0] = 0; while (n >= 0) /* i.e. while stack is nonempty */ { if (level[n] >= NUM_ARC_SUBDIVISIONS) { /* draw line segment */ _add_line (path, q[n]); segments_drawn++; n--; } else /* bisect line segment */ { plVector v; plPoint pm, pb; v.x = q[n].x - p[n].x; /* chord = line segment from p[n] to q[n] */ v.y = q[n].y - p[n].y; pm.x = p[n].x + 0.5 * v.x; /* midpoint of chord */ pm.y = p[n].y + 0.5 * v.y; /* Compute bisection point. If m=[0 1 -1 0] this just rotates the chord clockwise by 90 degrees, and scales it to yield the chordal deviation vector, which is used as an offset. */ pb.x = pm.x + our_chord_table[level[n]] * (m[0] * v.x + m[1] * v.y); pb.y = pm.y + our_chord_table[level[n]] * (m[2] * v.x + m[3] * v.y); /* replace line segment by pair; level[n] >= n is an invariant */ p[n+1] = p[n]; q[n+1] = pb; /* first half, deal with next */ level[n+1] = level[n] + 1; p[n] = pb; q[n] = q[n]; /* second half, deal with later */ level[n] = level[n] + 1; n++; } } } /* prepare_chord_table() computes the list of chordal deviation factors that _fakearc() needs when it is employed to draw a circular arc of subtended angle other than the default angles it supports */ static void _prepare_chord_table (double sagitta, double custom_chord_table[TABULATED_ARC_SUBDIVISIONS]) { double half_chord_length; int i; half_chord_length = sqrt ( sagitta * (2.0 - sagitta) ); for (i = 0; i < TABULATED_ARC_SUBDIVISIONS; i++) { custom_chord_table[i] = 0.5 * sagitta / half_chord_length; sagitta = 1.0 - sqrt (1.0 - 0.5 * sagitta); half_chord_length = 0.5 * half_chord_length / (1.0 - sagitta); } } /* Flatten a simple path into a path of segment list type, consisting only of line segments. As supplied, the path may be perfectly general: it may be a segment list (not all segments necessarily being line segments), or be a closed primitive (box/circle/ellipse). If supplied path already consists only of line segments (with an initial moveto and possibly a final closepath), it is returned unchanged; this can be tested for by comparing pointers for equality. If a new path is returned, it must be freed with _delete_plPath(). */ plPath * _flatten_path (const plPath *path) { plPath *newpath; if (path == (plPath *)NULL) return (plPath *)NULL; switch (path->type) { case PATH_SEGMENT_LIST: { bool do_flatten = false; int i; for (i = 0; i < path->num_segments; i++) { if (path->segments[i].type != S_MOVETO && path->segments[i].type != S_LINE && path->segments[i].type != S_CLOSEPATH) { do_flatten = true; break; } } if (do_flatten == false) newpath = (plPath *)path; /* just return original path */ else { newpath = _new_plPath (); for (i = 0; i < path->num_segments; i++) { switch ((int)(path->segments[i].type)) { case (int)S_MOVETO: _add_moveto (newpath, path->segments[i].p); break; case (int)S_LINE: _add_line (newpath, path->segments[i].p); break; case (int)S_CLOSEPATH: _add_closepath (newpath); break; /* now, the types of segment we flatten: */ case (int)S_ARC: _add_arc_as_lines (newpath, path->segments[i].pc, path->segments[i].p); break; case (int)S_ELLARC: _add_ellarc_as_lines (newpath, path->segments[i].pc, path->segments[i].p); break; case (int)S_QUAD: _add_bezier2_as_lines (newpath, path->segments[i].pc, path->segments[i].p); break; case (int)S_CUBIC: _add_bezier3_as_lines (newpath, path->segments[i].pc, path->segments[i].pd, path->segments[i].p); break; default: /* shouldn't happen */ break; } } } break; } case PATH_CIRCLE: newpath = _new_plPath (); _add_circle_as_lines (newpath, path->pc, path->radius, path->clockwise); break; case PATH_ELLIPSE: newpath = _new_plPath (); _add_ellipse_as_lines (newpath, path->pc, path->rx, path->ry, path->angle, path->clockwise); break; case PATH_BOX: newpath = _new_plPath (); _add_box_as_lines (newpath, path->p0, path->p1, path->clockwise); break; default: /* shouldn't happen */ newpath = _new_plPath (); break; } return newpath; } /**********************************************************************/ /* The code below exports the _merge_paths() function, which munges an array of plPath objects and returns a new array. Heuristic "path-merging" of this sort is performed in g_endpath.c when filling a compound path (i.e., a multi-plPath path), if the output driver supports only the filling of single plPaths. That is the case for nearly all of libplot's output drivers. `Child' paths are merged into their `parents', so each location in the returned array where a child was present will contain NULL. Also, any non-child that had no children will be returned without modification. You should take this into account when freeing the returned array of plPaths. Only the elements that are (1) non-NULL, and (2) differ from the corresponding elements in the originally passed array should have _delete_plPath() invoked on them. The array as a whole may be deallocated by calling free(). The _merge_paths() function was inspired by a similar function in Wolfgang Glunz's pstoedit, which was originally written by Burkhard Plaum . */ /* Note: a well-formed plPath has the form: { moveto { line | arc }* { closepath }? } The _merge_paths function was written to merge _closed_ plPath's, i.e. ones whose endpoint is the same as the startpoint (possibly implicitly, i.e. closepath is allowed). However, libplot applies it to open paths too, in which case an `implicit closepath' is added to the path to close it. NOTE: The current release of libplot does not yet support `closepath' segments at a higher level. So we regard a pass-in plPath as `closed' if its last defining vertex is the same as the first. THIS CONVENTION WILL GO AWAY. */ /* ad hoc structure for an annotated plPath, in particular one that has been flattened into line segments and annotated; used only in this file, for merging purposes */ typedef struct subpath_struct { plPathSegment *segments; /* segment array */ int num_segments; /* number of segments */ struct subpath_struct **parents; /* array of pointers to possible parents */ struct subpath_struct *parent; /* pointer to parent path */ struct subpath_struct **children; /* array of pointers to child paths */ int num_children; /* number of children */ int num_outside; /* number of subpaths outside this one */ double llx, lly, urx, ury; /* bounding box of the subpath */ bool inserted; /* subpath has been inserted into result? */ } subpath; /* forward references */ /* 0. ctors, dtors */ static subpath * new_subpath (void); static subpath ** new_subpath_array (int n); static void delete_subpath (subpath *s); static void delete_subpath_array (subpath **s, int n); /* 1. functions that act on a subpath, i.e. an `annotated path' */ static bool is_inside_of (const subpath *s, const subpath *other); static double _cheap_lower_bound_on_distance (const subpath *path1, const subpath *path2); static void linearize_subpath (subpath *s); static void read_into_subpath (subpath *s, const plPath *path); /* 2. miscellaneous */ static void find_parents_in_subpath_list (subpath **annotated_paths, int num_paths); static void insert_subpath (plPathSegment *parent_segments, const plPathSegment *child_segments, int parent_size, int child_size, int parent_index, int child_index); static void _compute_closest (const plPathSegment *p1, const plPathSegment *p2, int size1, int size2, double *distance, int *index1, int *index2); /**********************************************************************/ /* ctor for subpath class */ static subpath * new_subpath (void) { subpath *s; s = (subpath *)_pl_xmalloc (sizeof (subpath)); s->segments = (plPathSegment *)NULL; s->num_segments = 0; s->parents = (subpath **)NULL; s->parent = (subpath *)NULL; s->children = (subpath **)NULL; s->num_children = 0; s->num_outside = 0; s->llx = DBL_MAX; s->lly = DBL_MAX; s->urx = -DBL_MAX; s->ury = -DBL_MAX; s->inserted = false; return s; } /* corresponding ctor for a subpath array */ static subpath ** new_subpath_array (int n) { int i; subpath **s; s = (subpath **)_pl_xmalloc (n * sizeof (subpath *)); for (i = 0; i < n; i++) s[i] = new_subpath (); return s; } /* dtor for subpath class */ static void delete_subpath (subpath *s) { if (s) { if (s->segments) free (s->segments); if (s->children) free (s->children); if (s->parents) free (s->parents); free (s); } } /* corresponding dtor for a subpath array */ static void delete_subpath_array (subpath **s, int n) { int i; if (s) { for (i = 0; i < n; i++) delete_subpath (s[i]); free (s); } } /* replace every segment in a subpath by a lineto (invoked only on a child subpath, i.e. a subpath with an identified parent) */ static void linearize_subpath (subpath *s) { /* replace first segment (moveto) with a lineto */ s->segments[0].type = S_LINE; /* if final segment is a closepath, also replace with a lineto, back to point #0 */ if (s->segments[s->num_segments-1].type == S_CLOSEPATH) { s->segments[s->num_segments-1].type = S_LINE; s->segments[s->num_segments-1].p = s->segments[0].p; } } /* Read a sequence of plPathSegments from a plPath into a previously empty annotated subpath. (This is called only after the plPath has been flattened, so the segments include no arcs.) Because the way in which _merge_paths() is currently called in libplot, we need to handle the possibility that the plPath may not be closed. If it isn't, we add a closepath. At present, we allow a final lineto to the start vertex to serve the same purpose. THIS IS A LIBPLOT CONVENTION THAT WILL GO AWAY. */ static void read_into_subpath (subpath *s, const plPath *path) { bool need_to_close = false; int i; /* sanity check */ if (path->type != PATH_SEGMENT_LIST) return; /* allocate space for segment array of subpath; add 1 extra slot for manual closure, if needed */ s->segments = (plPathSegment *)_pl_xmalloc((path->num_segments + 1) * sizeof (plPathSegment)); s->num_segments = path->num_segments; /* sanity check */ if (path->num_segments == 0) return; /* Is this path closed? If not, we'll close manually the annotated path that we'll construct. WE CURRENTLY TREAT FINAL = INITIAL AS INDICATING CLOSURE. */ if (path->segments[path->num_segments - 1].type != S_CLOSEPATH && (path->segments[path->num_segments - 1].p.x != path->segments[0].p.x || path->segments[path->num_segments - 1].p.y != path->segments[0].p.y)) need_to_close = true; /* copy the segments, updating bounding box to take each juncture point into account */ for (i = 0; i < path->num_segments; i++) { plPathSegment e; e = path->segments[i]; s->segments[i] = e; if (e.p.x < s->llx) s->llx = e.p.x; if (e.p.y < s->lly) s->lly = e.p.y; if (e.p.x > s->urx) s->urx = e.p.x; if (e.p.y > s->ury) s->ury = e.p.y; } if (need_to_close) { #if 0 s->segments[path->num_segments].type = S_CLOSEPATH; #else /* currently, use line segment instead of closepath */ s->segments[path->num_segments].type = S_LINE; #endif s->segments[path->num_segments].p = path->segments[0].p; s->num_segments++; } } /* check if a subpath is inside another subpath */ static bool is_inside_of (const subpath *s, const subpath *other) { int inside = 0; int outside = 0; int i; /* if bbox fails to lie inside the other's bbox, false */ if (!((s->llx >= other->llx) && (s->lly >= other->lly) && (s->urx <= other->urx) && (s->ury <= other->ury))) return false; /* otherwise, check all juncture points */ for (i = 0; i < s->num_segments; i++) { bool point_is_inside; if (s->segments[i].type == S_CLOSEPATH) /* should have i = num_segments - 1, no associated juncture point */ continue; /* Check if the vertex s->segments[i].p is inside `other'. Could be done in a separate function, but we inline it for speed. */ { /* These two factors should be small positive floating-point numbers. They should preferably be incommensurate, to minimize the probability of a degenerate case occurring: two line segments intersecting at the endpoint of one or the other. */ #define SMALL_X_FACTOR (M_SQRT2 * M_PI) #define SMALL_Y_FACTOR (M_SQRT2 + M_PI) /* argument of the now-inlined function (besides `other') */ plPoint p; /* local variables of the now-inlined function */ int k, crossings; /* (x1,y1) is effectively the point at infinity */ double x1, y1; /* (x2,y2) is specified point */ double x2, y2; /* argument of the now-inlined function (besides `other') */ p = s->segments[i].p; /* (x1,y1) is effectively the point at infinity */ x1 = (DMAX(p.x, other->urx) + SMALL_X_FACTOR * (DMAX(p.x, other->urx) - DMIN(p.x, other->llx))); y1 = (DMAX(p.y, other->ury) + SMALL_Y_FACTOR * (DMAX(p.y, other->ury) - DMIN(p.y, other->lly))); /* (x2,y2) is specified point */ x2 = p.x; y2 = p.y; crossings = 0; for (k = 0; k < other->num_segments; k++) { int j; double x3, y3, x4, y4, det, det1, det2; if (other->segments[k].type == S_CLOSEPATH) /* k > 0 */ { x3 = other->segments[k-1].p.x; y3 = other->segments[k-1].p.y; } else { x3 = other->segments[k].p.x; y3 = other->segments[k].p.y; } j = (k == other->num_segments - 1 ? 0 : k + 1); if (other->segments[j].type == S_CLOSEPATH) continue; x4 = other->segments[j].p.x; y4 = other->segments[j].p.y; /* (x3,y3)-(x4,y4) is a line segment in the closed path */ /* Check whether the line segments (x1,y1)-(x2,y2) and (x3-y3)-(x4,y4) cross each other. System to solve is: [p1 + (p2 - p1) * t1] - [p3 + (p4 - p3) * t2] = 0 i.e. (x2 - x1) * t1 - (x4 - x3) * t2 = x3 - x1; (y2 - y1) * t1 - (y4 - y3) * t2 = y3 - y1; Solutions are: t1 = det1/det t2 = det2/det The line segments cross each other (in their interiors) if 0.0 < t1 < 1.0 and 0.0 < t2 < 1.0 */ det = (x2 - x1) * (-(y4 - y3)) - (-(x4 - x3)) * (y2 - y1); if (det == 0.0) /* line segments are parallel; ignore the degenerate case that they might overlap */ continue; det1 = (x3 - x1) * (-(y4 - y3)) - (-(x4 - x3)) * (y3 - y1); det2 = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1); if ((det<0.0 && (det1>0.0 || det2>0.0 || det10.0 && (det1<0.0 || det2<0.0 || det1>det || det2>det))) /* solution for at least one of t1 and t2 is outside the interval [0,1], so line segments do not cross */ continue; /* We ignore the possibility that t1, t2 are both in the interval [0,1], but (t1 == 0.0) || (t1 == 1.0) || (t2 == 0.0) || (t2 == 1.0). t1 == 0.0 should never happen, if p1 is effectively the point at infinity. So this degenerate case occurs only if the line segment (x1,y1)-(x2,y2) goes through either (x3,y3) or (x4,y4), or the specified point (x2,y2) lies on the line segment (x3,y3)-(x4,y4) that is part of the path. */ crossings++; } /* our determination of whether the point is inside the path; before we inlined this function, this was the return value */ point_is_inside = (crossings & 1) ? true : false; } /* increment inside,outside depending on whether or not the juncture point was inside the other path */ if (point_is_inside) inside++; else outside++; } /* make a democratic decision as to whether the path as a whole is inside the other path */ return (inside > outside ? true : false); } /* Find parent (if any) of each subpath in a list of subpaths. When this is invoked, each subpath should consist of an initial moveto, at least one lineto, and a closepath (not currently enforced). */ static void find_parents_in_subpath_list (subpath **annotated_paths, int num_paths) { int i, j; subpath *parent; /* determine for each subpath the subpaths that are nominally outside it */ for (i = 0; i < num_paths; i++) { annotated_paths[i]->parents = new_subpath_array (num_paths); for (j = 0; j < num_paths; j++) { if (j != i) { if (is_inside_of (annotated_paths[i], annotated_paths[j])) { annotated_paths[i]->parents[annotated_paths[i]->num_outside] = annotated_paths[j]; annotated_paths[i]->num_outside++; } } } } /* Now find the real parent subpaths, i.e. the root subpaths. A subpath is a parent subpath if the number of nominally-outside subpaths is even, and is a child subpath only if the number is odd. An odd number, together with a failure to find a suitable potential parent, will flag a path as an isolate: technically a parent, but without children. */ for (i = 0; i < num_paths; i++) { if ((annotated_paths[i]->num_outside & 1) == 0) /* an even number of subpaths outside, definitely a parent (i.e. doesn't have a parent itself, may or may not have children) */ { /* allocate space for children (if any) */ annotated_paths[i]->children = new_subpath_array (num_paths); } } /* now determine which are children, and link them to their parents */ for (i = 0; i < num_paths; i++) { if ((annotated_paths[i]->num_outside & 1) == 0) /* even number outside, definitely a parent subpath (whether it has children remains to be determined) */ continue; else /* odd number outside, possibly a child, so search linearly through possible parents until we get a hit; if so, this is a child; if not, this is an isolate (classed as a parent) */ { for (j = 0; j < annotated_paths[i]->num_outside; j++) { if (annotated_paths[i]->num_outside == annotated_paths[i]->parents[j]->num_outside + 1) /* number outside is one more than the number outside a potential parent; flag as a child, and add it to the parent's child list */ { parent = annotated_paths[i]->parents[j]; annotated_paths[i]->parent = parent; /* give it a parent */ parent->children[parent->num_children] = annotated_paths[i]; parent->num_children++; break; } } } } } /* Compute closest vertices in two paths. Indices of closest vertices, and (squared) distance between them, are returned via pointers. This is invoked in _merge_paths() only on paths that have been flattened, and have had the initial moveto and the optional final closepath replaced by line segments. So when this is called, each segment type is S_LINE. */ static void _compute_closest (const plPathSegment *p1, const plPathSegment *p2, int size1, int size2, double *distance, int *index1, int *index2) { int best_i = 0, best_j = 0; /* keep compiler happy */ double best_distance = DBL_MAX; int ii, jj; for (ii = 0; ii < size1; ii++) { plPoint point1; point1 = p1[ii].p; for (jj = 0; jj < size2; jj++) { double tmp1, tmp2, distance; plPoint point2; point2 = p2[jj].p; tmp1 = point1.x - point2.x; tmp2 = point1.y - point2.y; distance = tmp1 * tmp1 + tmp2 * tmp2; if (distance < best_distance) { best_distance = distance; best_i = ii; best_j = jj; } } } /* return the three quantities */ *distance = best_distance; *index1 = best_i; *index2 = best_j; } /* Compute a cheap lower bound on the (squared) distance between two subpaths, by looking at their bounding boxes. */ static double _cheap_lower_bound_on_distance (const subpath *path1, const subpath *path2) { double xdist = 0.0, ydist = 0.0, dist; if (path1->urx < path2->llx) xdist = path2->llx - path1->urx; else if (path2->urx < path1->llx) xdist = path1->llx - path2->urx; if (path1->ury < path2->lly) ydist = path2->lly - path1->ury; else if (path2->ury < path1->lly) ydist = path1->lly - path2->ury; dist = xdist * xdist + ydist * ydist; return dist; } /* Insert a closed child subpath into a closed parent, by connecting the two, twice, at a specified vertex of the parent path and a specified vertex of the child path. This is the key function invoked by _merge_paths(). Both paths are supplied as segment lists, and all segments are lines; the final segment of each is a line back to the starting point. I.e., for both subpaths, the final vertex duplicates the start vertex. So we ignore the final vertex of the child (but not that of the parent). I.e. if the child vertices are numbered 0..child_size-1, we map the case child_index = child_size-1 to child_index = 0. The new path has parent_size + child_size + 1 vertices, of which the last is a repetition of the first. */ /* INDEX MAP: PARENT -> NEW PATH i --> i (if 0 <= i < parent_index + 1) i --> i+child_size+1 (if parent_index + 1 <= i < parent_size) CHILD -> NEW PATH i --> i+parent_index+child_size-child_index (0 <= i < child_index+1) i --> i+parent_index-child_index+1 (child_index+1 <= i < child_size-1) (0'th element of the child is same as child_size-1 element) NEW PATH CONTENTS 0..parent_index 0..parent_index of PARENT parent_index+1 child_index of CHILD (i.e. ->join) parent_index+2..parent_index+child_size-child_index-1 child_index+1..child_size-2 of CHILD parent_index+child_size-child_index..parent_index+child_size 0..child_index of CHILD parent_index+child_size+1 parent_index of PARENT (i.e. ->join) parent_index+child_size+2..parent_size+child_size parent_index+1..parent_size-1 of PARENT */ /* Macros that map from vertices in the child path and the parent path, to vertices in the merged path. Here the argument `i' is the index in the original path, and each macro evaluates to the index in the merger. */ /* The first macro should not be applied to i=child_size-1; as noted above, that vertex is equivalent to i=0, so apply it to i=0 instead. */ #define CHILD_VERTEX_IN_MERGED_PATH(i,parent_index,parent_size,child_index,child_size) ((i) <= (child_index) ? (i) + (parent_index) + (child_size) - (child_index) : (i) + (parent_index) - (child_index) + 1) #define PARENT_VERTEX_IN_MERGED_PATH(i,parent_index,parent_size,child_index,child_size) ((i) <= (parent_index) ? (i) : (i) + (child_size) + 1) static void insert_subpath (plPathSegment *parent, const plPathSegment *child, int parent_size, int child_size, int parent_index, int child_index) { int i; plPathSegment e1, e2; int src_index; /* map case when joining vertex is final vertex of child to case when it's the 0'th vertex */ if (child_index == child_size - 1) child_index = 0; /* move up: add child_size+1 empty slots to parent path */ for (i = parent_size - 1; i >= parent_index + 1; i--) parent[i + child_size + 1] = parent[i]; /* add a line segment from specified vertex of parent path to specified vertex of child path */ e1 = child[child_index]; e1.type = S_LINE; /* unnecessary */ parent[parent_index + 1] = e1; /* copy vertices of child into parent, looping back to start in child if necessary; note we skip the last (i.e. child_size-1'th) vertex, since the 0'th vertex is the same */ src_index = child_index; for (i = 0; i < child_size - 1; i++) { src_index++; if (src_index == child_size - 1) src_index = 0; parent[parent_index + 2 + i] = child[src_index]; } /* add a line segment back from specified vertex of child path to specified vertex of parent path */ e2 = parent[parent_index]; e2.type = S_LINE; parent[parent_index + child_size + 1] = e2; } /* The key function exported by this module, which is used by libplot for filling compound paths. */ plPath ** _merge_paths (const plPath **paths, int num_paths) { int i; subpath **annotated_paths; plPath **flattened_paths; plPath **merged_paths; /* flatten every path to a list of line segments (some paths may come back unaltered; will be able to compare pointers to check for that) */ flattened_paths = (plPath **)_pl_xmalloc (num_paths * sizeof(plPath *)); for (i = 0; i < num_paths; i++) { flattened_paths[i] = _flatten_path (paths[i]); #ifdef DEBUG fprintf (stderr, "path %d: %d segments, flattened to %d segments\n", i, paths[i]->num_segments, flattened_paths[i]->num_segments); #endif } /* Copy each flattened path into a corresponding annotated path (`subpath'). Manual closure, if necessary (see above) is performed, i.e. we always add a final closepath to close the path. At this stage bounding boxes are computed. */ annotated_paths = new_subpath_array (num_paths); for (i = 0; i < num_paths; i++) read_into_subpath (annotated_paths[i], flattened_paths[i]); /* Flattened paths no longer needed, so delete them carefully (some may be the same as the original paths, due to _flatten_path() having simply returned its argument) */ for (i = 0; i < num_paths; i++) if (flattened_paths[i] != paths[i]) _delete_plPath (flattened_paths[i]); /* determine which subpaths are parents, children */ find_parents_in_subpath_list (annotated_paths, num_paths); /* in each child, replace each moveto/closepath by a lineto */ for (i = 0; i < num_paths; i++) if (annotated_paths[i]->parent != (subpath *)NULL) /* child path */ linearize_subpath (annotated_paths[i]); /* create array of merged paths: parent paths will have child paths merged into them, and child paths won't appear */ /* allocate space for new array, to be returned */ merged_paths = (plPath **)_pl_xmalloc (num_paths * sizeof(plPath *)); for (i = 0; i < num_paths; i++) { int j, k, num_segments_in_merged_path; subpath *parent; plPath *merged_path; double *parent_to_child_distances; int *child_best_indices, *parent_best_indices; if (annotated_paths[i]->parent != (subpath *)NULL) /* child path; original path will be merged into parent */ { merged_paths[i] = (plPath *)NULL; continue; } if (annotated_paths[i]->num_children == 0) /* no parent, but no children either, so no merging done; in output path array, place original unflattened path */ { merged_paths[i] = (plPath *)paths[i]; continue; } /* this path must be a parent, with one or more children to be merged into it; so create new empty `merged path' with segments array that will hold it, and the merged-in children */ parent = annotated_paths[i]; num_segments_in_merged_path = parent->num_segments; for (j = 0; j < parent->num_children; j++) num_segments_in_merged_path += (parent->children[j]->num_segments + 1); merged_path = _new_plPath (); merged_path->segments = (plPathSegment *)_pl_xmalloc(num_segments_in_merged_path * sizeof (plPathSegment)); merged_path->num_segments = 0; merged_path->segments_len = num_segments_in_merged_path; /* copy parent path into new empty path, i.e. initialize the merged path */ for (j = 0; j < parent->num_segments; j++) merged_path->segments[j] = parent->segments[j]; merged_path->num_segments = parent->num_segments; /* Create temporary storage for `closest vertex pairs' and inter-path distances. We first compute the shortest distance between each child path. We also keep track of the shortest distance between each child and the merged path being constructed, and update it when any child is added. */ parent_to_child_distances = (double *)_pl_xmalloc(parent->num_children * sizeof (double)); parent_best_indices = (int *)_pl_xmalloc(parent->num_children * sizeof (int)); child_best_indices = (int *)_pl_xmalloc(parent->num_children * sizeof (int)); /* compute closest vertices between merged path (i.e., right now, the parent) and any child; these arrays will be updated when any child is inserted into the merged path */ for (j = 0; j < parent->num_children; j++) _compute_closest (parent->segments, parent->children[j]->segments, parent->num_segments, parent->children[j]->num_segments, &(parent_to_child_distances[j]), &(parent_best_indices[j]), &(child_best_indices[j])); for (k = 0; k < parent->num_children; k++) /* insert a child (the closest remaining one!) into the built-up merged path; and flag the child as having been inserted so that we don't pay attention to it thereafter */ { double min_distance; int closest = 0; /* keep compiler happy */ double *new_parent_to_child_distances; int *new_child_best_indices, *new_parent_best_indices; /* allocate storage for arrays that will be used to update the three abovementioned arrays, with each pass through the loop */ new_parent_to_child_distances = (double *)_pl_xmalloc(parent->num_children * sizeof (double)); new_parent_best_indices = (int *)_pl_xmalloc(parent->num_children * sizeof (int)); new_child_best_indices = (int *)_pl_xmalloc(parent->num_children * sizeof (int)); /* initially, they're the same as the current arrays */ for (j = 0; j < parent->num_children; j++) { new_parent_to_child_distances[j] = parent_to_child_distances[j]; new_parent_best_indices[j] = parent_best_indices[j]; new_child_best_indices[j] = child_best_indices[j]; } /* find closest child to merged path, which has not yet been inserted */ min_distance = DBL_MAX; for (j = 0; j < parent->num_children; j++) { if (parent->children[j]->inserted) /* ignore this child */ continue; if (parent_to_child_distances[j] < min_distance) { closest = j; min_distance = parent_to_child_distances[j]; } } /* closest remaining child has index `closest'; it will be inserted into the current merged path */ /* loop over all children, skipping inserted ones and also skipping `closest', the next child to be inserted */ for (j = 0; j < parent->num_children; j++) { double inter_child_distance; int inter_child_best_index1, inter_child_best_index2; double lower_bound_on_inter_child_distance; bool compute_carefully; if (parent->children[j]->inserted) /* ignore */ continue; if (j == closest) /* ignore */ continue; /* compute distance (and closest vertex pairs) between `closest' and the j'th child; result is only of interest if the distance is less than parent_to_child_distances[j], so we first compute a cheap lower bound on the result by looking at bounding boxes. */ lower_bound_on_inter_child_distance = _cheap_lower_bound_on_distance (parent->children[j], parent->children[closest]); compute_carefully = (lower_bound_on_inter_child_distance < parent_to_child_distances[j]) ? true : false; if (compute_carefully) /* compute accurate inter-child distance; also which two vertices yield the minimum distance */ _compute_closest (parent->children[j]->segments, parent->children[closest]->segments, parent->children[j]->num_segments, parent->children[closest]->num_segments, &inter_child_distance, &inter_child_best_index1, /* vertex in j */ &inter_child_best_index2); /* in `closest' */ /* fill in j'th element of the new arrays parent_to_child_distances[], parent_best_indices[] and child_best_indices[] so as to take the insertion of the child into account; but we don't update the old arrays until we do the actual insertion */ if (compute_carefully && inter_child_distance < parent_to_child_distances[j]) /* j'th child is nearer to a vertex in `closest', the child to be inserted, than to any vertex in the current merged path, so all three arrays are affected */ { int nearest_index_in_closest_child; new_parent_to_child_distances[j] = inter_child_distance; new_child_best_indices[j] = inter_child_best_index1; nearest_index_in_closest_child = inter_child_best_index2; /* Compute new value of parent_best_indices[j], taking into account that `closest' will be inserted into the merged path, thereby remapping the relevant index in `closest'. The macro doesn't perform correctly if its first arg takes the maximum possible value; so instead, we map that possibility to `0'. See comment above, before the macro definition. */ if (nearest_index_in_closest_child == parent->children[closest]->num_segments - 1) nearest_index_in_closest_child = 0; new_parent_best_indices[j] = CHILD_VERTEX_IN_MERGED_PATH(nearest_index_in_closest_child, parent_best_indices[closest], merged_path->num_segments, child_best_indices[closest], parent->children[closest]->num_segments); } else /* j'th child is nearer to a vertex in the current merged path than to any vertex in `closest', the child to be inserted into the merged path */ { int nearest_index_in_parent; nearest_index_in_parent = parent_best_indices[j]; /* compute new value of parent_best_indices[j], taking into account that `closest' will be inserted into the merged path, thereby remapping the relevant index in the merged path */ new_parent_best_indices[j] = PARENT_VERTEX_IN_MERGED_PATH(nearest_index_in_parent, parent_best_indices[closest], merged_path->num_segments, child_best_indices[closest], parent->children[closest]->num_segments); } } /* do the actual insertion, by adding a pair of lineto's between closest vertices; flag child as inserted */ insert_subpath (merged_path->segments, parent->children[closest]->segments, merged_path->num_segments, parent->children[closest]->num_segments, parent_best_indices[closest], child_best_indices[closest]); merged_path->num_segments += (parent->children[closest]->num_segments + 1); parent->children[closest]->inserted = true; /* update the old arrays to take insertion into account: replace them by the new ones */ for (j = 0; j < parent->num_children; j++) { parent_to_child_distances[j] = new_parent_to_child_distances[j]; parent_best_indices[j] = new_parent_best_indices[j]; child_best_indices[j] = new_child_best_indices[j]; } free (new_parent_to_child_distances); free (new_parent_best_indices); free (new_child_best_indices); } /* End of loop over all children of parent subpath; all >=1 children have now been inserted into the parent, i.e. into the `merged path' which the parent initialized. However, the merged path's segments are all lines; so change the first to a moveto. */ merged_path->segments[0].type = S_MOVETO; merged_paths[i] = merged_path; /* NOTE: SHOULD ALSO REPLACE LAST LINE SEGMENT BY A CLOSEPATH! */ /* delete temporary storage for `closest vertex pairs' and inter-path distances */ free (parent_to_child_distances); free (parent_best_indices); free (child_best_indices); } /* end of loop over parent subpaths */ /* no more annotated paths needed */ delete_subpath_array (annotated_paths, num_paths); return merged_paths; } plotutils-2.6/libplot/g_vector.c0000644000175000017500000000676211037243261013774 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file includes vector-related utility routines. */ #include "sys-defines.h" #include "extern.h" #define VLENGTH(v) sqrt( (v).x * (v).x + (v).y * (v).y ) /* Scale an input vector to a new length, and return it. */ plVector * _vscale(plVector *v, double newlen) { double len = VLENGTH(*v); if (len != 0.0) { v->x *= newlen/len; v->y *= newlen/len; } return(v); } /* Compute angle (arctangent) of 2-D vector via atan2, but standardize handling of singular cases. */ double _xatan2 (double y, double x) { if (y == 0.0 && x >= 0.0) return 0.0; else if (y == 0.0 && x < 0.0) return M_PI; else if (x == 0.0 && y >= 0.0) return M_PI_2; else if (x == 0.0 && y < 0.0) return -(M_PI_2); else return atan2(y, x); } /* Compute angle between vectors pc..p0 and pc..pp1, in range -pi..pi; collinear vectors yield an angle of pi. This is used when drawing arcs. */ double _angle_of_arc(plPoint p0, plPoint pp1, plPoint pc) { plVector v0, v1; double cross, angle, angle0; /* vectors from pc to p0, and pc to pp1 */ v0.x = p0.x - pc.x; v0.y = p0.y - pc.y; v1.x = pp1.x - pc.x; v1.y = pp1.y - pc.y; /* relative polar angle of p0 */ angle0 = _xatan2 (v0.y, v0.x); /* cross product, zero means points are collinear */ cross = v0.x * v1.y - v1.x * v0.y; if (cross == 0.0) /* by libplot convention, sweep angle should be M_PI not -(M_PI), in the collinear case */ angle = M_PI; else /* compute angle in range -(M_PI)..M_PI */ { double angle1; angle1 = _xatan2 (v1.y, v1.x); angle = angle1 - angle0; if (angle > M_PI) angle -= (2.0 * M_PI); else if (angle < -(M_PI)) angle += (2.0 * M_PI); } return angle; } /* Adjust the location of pc so it can be used as the center of a circle or circular arc through p0 and p1. If pc does not lie on the line that perpendicularly bisects the line segment from p0 to p1, it is projected orthogonally onto it. p0 and p1 are assumed not to be coincident. */ plPoint _truecenter(plPoint p0, plPoint p1, plPoint pc) { plPoint pm; plVector a, b, c; double scale; /* midpoint */ pm.x = 0.5 * (p0.x + p1.x); pm.y = 0.5 * (p0.y + p1.y); /* a points along perpendicular bisector */ a.x = -p1.y + p0.y; a.y = p1.x - p0.x; /* b points from midpoint to pc */ b.x = pc.x - pm.x; b.y = pc.y - pm.y; /* c is orthogonal projection of b onto a */ scale = (a.x * b.x + a.y * b.y) / (a.x * a.x + a.y * a.y); c.x = scale * a.x; c.y = scale * a.y; /* adjust pc */ pc.x = pm.x + c.x; pc.y = pm.y + c.y; return pc; } plotutils-2.6/libplot/g_version.c0000644000175000017500000000212211037243261014141 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file includes version information that is compiled into libplot/libplotter. */ #include "sys-defines.h" #include "extern.h" const char pl_libplot_ver[8] = PL_LIBPLOT_VER_STRING; plotutils-2.6/libplot/g_write.c0000644000175000017500000000335411037243261013616 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* These are the lowest-level output routines in libplot/libplotter. Plotters that write to output streams use these. */ #include "sys-defines.h" #include "extern.h" void _write_byte (const plPlotterData *data, unsigned char c) { if (data->outfp) putc ((int)c, data->outfp); #ifdef LIBPLOTTER else if (data->outstream) data->outstream->put (c); #endif } void _write_bytes (const plPlotterData *data, int n, const unsigned char *c) { int i; if (data->outfp) { for (i = 0; i < n; i++) putc ((int)(c[i]), data->outfp); } #ifdef LIBPLOTTER else if (data->outstream) data->outstream->write((const char *)c, n); #endif } void _write_string (const plPlotterData *data, const char *s) { if (data->outfp) fputs (s, data->outfp); #ifdef LIBPLOTTER else if (data->outstream) (*(data->outstream)) << s; #endif } plotutils-2.6/libplot/g_xmalloc.c0000644000175000017500000000425311037243261014122 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Wrappers for standard storage allocation functions, for libplot/libplotter with the exception of the libxmi scan conversion module, which has its own more complicated versions (see mi_alloc.c). */ #include "sys-defines.h" #include "extern.h" /* wrapper for malloc() */ void * _pl_xmalloc (size_t size) { void * p; p = (void *) malloc (size); if (p == (void *)NULL) { fputs ("libplot: ", stderr); perror ("out of memory"); exit (EXIT_FAILURE); } #ifdef DEBUG_MALLOC fprintf (stderr, "malloc (%d) = %p\n", size, p); #endif return p; } /* wrapper for calloc() */ void * _pl_xcalloc (size_t nmemb, size_t size) { void * p; p = (void *) calloc (nmemb, size); if (p == (void *)NULL) { fputs ("libplot: ", stderr); perror ("out of memory"); exit (EXIT_FAILURE); } #ifdef DEBUG_MALLOC fprintf (stderr, "calloc (%d, %d) = %p\n", nmemb, size, p); #endif return p; } /* wrapper for realloc() */ void * _pl_xrealloc (void * p, size_t size) { void * q; q = (void *) realloc (p, size); if (q == (void *)NULL) { fputs ("libplot: ", stderr); perror ("out of memory"); exit (EXIT_FAILURE); } #ifdef DEBUG_MALLOC fprintf (stderr, "realloc (%p, %d) = %p\n", p, size, q); #endif return q; } plotutils-2.6/libplot/g_xstring.c0000644000175000017500000000355411037243261014164 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Replacement for system strcasecmp() if it doesn't exist. */ #include "sys-defines.h" #include "extern.h" #ifndef HAVE_STRCASECMP int strcasecmp(const char *s1, const char *s2) { bool retval_set = false; int retval = 0; char *t1, *t2, *t1_base, *t2_base; t1 = t1_base = (char *)_pl_xmalloc (strlen (s1) + 1); t2 = t2_base = (char *)_pl_xmalloc (strlen (s2) + 1); strcpy (t1, s1); strcpy (t2, s2); while (*t1 && *t2) { unsigned int c1 = tolower ((int)(unsigned char)*t1); unsigned int c2 = tolower ((int)(unsigned char)*t2); if (c1 > c2) { retval = 1; retval_set = true; break; } else if (c1 < c2) { retval = -1; retval_set = true; break; } else { t1++; t2++; } } if (!retval_set) { if (*t1) retval = 1; else if (*t2) retval = -1; else retval = 0; } free (t1_base); free (t2_base); return retval; } #endif /* not HAVE_STRCASECMP */ plotutils-2.6/libplot/b_closepl.c0000644000175000017500000000403411037243260014113 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" bool _pl_b_end_page (S___(Plotter *_plotter)) { int retval; /* Possibly output the page's bitmap. In the base BitmapPlotter class this is a no-op (see below), but it may do something in derived classes. */ retval = _maybe_output_image (S___(_plotter)); /* tear down */ _pl_b_delete_image (S___(_plotter)); return (retval < 0 ? false : true); } /* tear down image, i.e. deallocate libxmi canvas */ void _pl_b_delete_image (S___(Plotter *_plotter)) { /* deallocate libxmi's drawing canvas (and painted set struct too) */ miDeleteCanvas ((miCanvas *)_plotter->b_canvas); _plotter->b_canvas = (void *)NULL; miDeletePaintedSet ((miPaintedSet *)_plotter->b_painted_set); _plotter->b_painted_set = (void *)NULL; } /* This is the BitmapPlotter-specific version of the _maybe_output_image() method, which is invoked when a page is finished. It's a no-op; in derived classes such as the PNMPlotter and PNGPlotter classes, it's overridden by a version that actually does something. */ int _pl_b_maybe_output_image (S___(Plotter *_plotter)) { return 0; } plotutils-2.6/libplot/b_defplot.c0000644000175000017500000002337711037243260014122 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any Bitmap Plotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" /* use libxmi scan conversion module */ /* forward references */ static bool parse_bitmap_size (const char *bitmap_size_s, int *width, int *height); #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a BitmapPlotter struct. */ const Plotter _pl_b_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_b_initialize, _pl_b_terminate, /* page manipulation */ _pl_b_begin_page, _pl_b_erase_page, _pl_b_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_b_paint_path, _pl_b_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_b_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_b_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_BITMAP; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_NONE; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 1; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 0; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_HERSHEY; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_ellarc_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_NONE; _plotter->data->allowed_circle_scaling = AS_NONE; _plotter->data->allowed_ellipse_scaling = AS_AXES_PRESERVED; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_LIBXMI; _plotter->data->flipped_y = true; _plotter->data->imin = 0; _plotter->data->imax = 569; _plotter->data->jmin = 569; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize data members specific to this derived class */ _plotter->b_xn = _plotter->data->imax + 1; _plotter->b_yn = _plotter->data->jmin + 1; _plotter->b_painted_set = (void *)NULL; _plotter->b_canvas = (void *)NULL; /* initialize storage used by libxmi's reentrant miDrawArcs_r() function for cacheing rasterized ellipses */ _plotter->b_arc_cache_data = (void *)miNewEllipseCache (); /* determine the range of device coordinates over which the graphics display will extend (and hence the transformation from user to device coordinates). */ { const char *bitmap_size_s; int width = 1, height = 1; bitmap_size_s = (const char *)_get_plot_param (_plotter->data, "BITMAPSIZE"); if (bitmap_size_s && parse_bitmap_size (bitmap_size_s, &width, &height) /* insist on >=1 */ && width >= 1 && height >= 1) /* override defaults above */ { _plotter->data->imax = width - 1; _plotter->data->jmin = height - 1; _plotter->b_xn = width; _plotter->b_yn = height; } } /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* initialize certain data members from device driver parameters */ /* for this class, there are none */ } static bool parse_bitmap_size (const char *bitmap_size_s, int *width, int *height) { int local_width = 1, local_height = 1; if (bitmap_size_s /* should parse this better */ && sscanf (bitmap_size_s, "%dx%d", &local_width, &local_height) == 2 && local_width > 0 && local_height > 0) { *width = local_width; *height = local_height; return true; } else return false; } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points (temporarily) to the Plotter that is about to be deleted. */ void _pl_b_terminate (S___(Plotter *_plotter)) { /* free storage used by libxmi's reentrant miDrawArcs_r() function */ miDeleteEllipseCache ((miEllipseCache *)_plotter->b_arc_cache_data); #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER BitmapPlotter::BitmapPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (FILE *outfile) :Plotter (outfile) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (ostream& out) : Plotter (out) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter () { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_b_initialize (); } BitmapPlotter::BitmapPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_b_initialize (); } BitmapPlotter::~BitmapPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_b_terminate (); } #endif #ifndef LIBPLOTTER /* The following forwarding functions provide special support in libplot for deriving classes such as the PNMPlotter and PNGPlotter classes from the BitmapPlotter class. In libplotter, forwarding is implemented by a virtual function; see plotter.h. */ /* Forwarding function called by any BitmapPlotter in closepl. See b_closepl.c, n_write.c, z_write.c for the forwarded-to functions. The first is currently a no-op. */ int _maybe_output_image (Plotter *_plotter) { int retval; switch ((int)(_plotter->data->type)) { case (int)PL_BITMAP: default: retval = _pl_b_maybe_output_image (_plotter); break; case (int)PL_PNM: retval = _pl_n_maybe_output_image (_plotter); break; #ifdef INCLUDE_PNG_SUPPORT case (int)PL_PNG: retval = _pl_z_maybe_output_image (_plotter); break; #endif } return retval; } #endif /* not LIBPLOTTER */ plotutils-2.6/libplot/b_erase.c0000644000175000017500000000232411037243260013551 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_b_erase_page (S___(Plotter *_plotter)) { /* delete image, i.e., deallocate libxmi canvas */ _pl_b_delete_image (S___(_plotter)); /* create new image, i.e. libxmi canvas, initialized to background color */ _pl_b_new_image (S___(_plotter)); return true; } plotutils-2.6/libplot/b_openpl.c0000644000175000017500000000371511037243260013754 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" bool _pl_b_begin_page (S___(Plotter *_plotter)) { /* create new pixmap of specified size (all pixels of background color) */ _pl_b_new_image (S___(_plotter)); return true; } /* internal function: create new image, consisting of a bitmap; also fill with Plotter's background color */ void _pl_b_new_image (S___(Plotter *_plotter)) { unsigned char red, green, blue; miPixel pixel; /* compute 24-bit bg color, and construct a miPixel for it */ red = ((unsigned int)(_plotter->drawstate->bgcolor.red) >> 8) & 0xff; green = ((unsigned int)(_plotter->drawstate->bgcolor.green) >> 8) & 0xff; blue = ((unsigned int)(_plotter->drawstate->bgcolor.blue) >> 8) & 0xff; pixel.type = MI_PIXEL_RGB_TYPE; pixel.u.rgb[0] = red; pixel.u.rgb[1] = green; pixel.u.rgb[2] = blue; /* create libxmi miPaintedSet and miCanvas structs */ _plotter->b_painted_set = (void *)miNewPaintedSet (); _plotter->b_canvas = (void *)miNewCanvas ((unsigned int)_plotter->b_xn, (unsigned int)_plotter->b_yn, pixel); } plotutils-2.6/libplot/b_path.c0000644000175000017500000005423211037243260013413 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() method, which the public method endpath() is a wrapper around. */ /* This version is for Bitmap Plotters. By construction, for Bitmap Plotters our path buffer always contains either a segment list, or an ellipse object. If it's a segment list, it contains either (1) a sequence of line segments, or (2) a single circular or elliptic arc segment. Those are all sorts of path that libxmi can handle. (For an ellipse or circular/elliptic arc segment to have been added to the path buffer, the map from user to device coordinates must preserve axes.) */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" /* use libxmi scan conversion module */ #define DIST(p1, p2) sqrt( ((p1).x - (p2).x) * ((p1).x - (p2).x) \ + ((p1).y - (p2).y) * ((p1).y - (p2).y)) void _pl_b_paint_path (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { int i, polyline_len; bool identical_user_coordinates = true; double xu_last, yu_last; miGC *pGC; miPoint *miPoints, offset; miPixel fgPixel, bgPixel; miPixel pixels[2]; unsigned char red, green, blue; plPoint p0, p1, pc; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1)/* shouldn't happen */ break; if (_plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[1].type == S_ARC) /* segment buffer contains a single circular arc, not a polyline */ { p0 = _plotter->drawstate->path->segments[0].p; p1 = _plotter->drawstate->path->segments[1].p; pc = _plotter->drawstate->path->segments[1].pc; /* use libxmi rendering */ _pl_b_draw_elliptic_arc (R___(_plotter) p0, p1, pc); break; } if (_plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[1].type == S_ELLARC) /* segment buffer contains a single elliptic arc, not a polyline */ { p0 = _plotter->drawstate->path->segments[0].p; p1 = _plotter->drawstate->path->segments[1].p; pc = _plotter->drawstate->path->segments[1].pc; /* use libxmi rendering */ _pl_b_draw_elliptic_arc_2 (R___(_plotter) p0, p1, pc); break; } /* neither of above applied, so segment buffer contains a polyline, not an arc */ /* construct point array for libxmi module; convert vertices to device coordinates, removing runs */ miPoints = (miPoint *)_pl_xmalloc (_plotter->drawstate->path->num_segments * sizeof(miPoint)); polyline_len = 0; xu_last = 0.0; yu_last = 0.0; identical_user_coordinates = true; for (i = 0; i < _plotter->drawstate->path->num_segments; i++) { double xu, yu; int device_x, device_y; xu = _plotter->drawstate->path->segments[i].p.x; yu = _plotter->drawstate->path->segments[i].p.y; if (i > 0 && (xu != xu_last || yu != yu_last)) /* in user space, not all points are the same */ identical_user_coordinates = false; device_x = IROUND(XD(xu, yu)); device_y = IROUND(YD(xu, yu)); if ((polyline_len == 0) || (device_x != miPoints[polyline_len-1].x) || (device_y != miPoints[polyline_len-1].y)) /* add point, in integer device coordinates, to the array */ { miPoints[polyline_len].x = device_x; miPoints[polyline_len].y = device_y; polyline_len++; } xu_last = xu; yu_last = yu; } /* determine background pixel color */ bgPixel.type = MI_PIXEL_RGB_TYPE; bgPixel.u.rgb[0] = _plotter->drawstate->bgcolor.red & 0xff; bgPixel.u.rgb[1] = _plotter->drawstate->bgcolor.green & 0xff; bgPixel.u.rgb[2] = _plotter->drawstate->bgcolor.blue & 0xff; pixels[0] = bgPixel; pixels[1] = bgPixel; /* construct an miGC (graphics context for the libxmi module); copy attributes from the Plotter's GC to it */ pGC = miNewGC (2, pixels); _set_common_mi_attributes (_plotter->drawstate, (void *)pGC); if (_plotter->drawstate->fill_type) /* not transparent, will fill */ { /* flattened drawing primitives, i.e., box/circle/ellipse, are always convex */ miPolygonShape polygon_shape = (_plotter->drawstate->path->primitive ? MI_SHAPE_CONVEX : MI_SHAPE_GENERAL); /* set fg color in GC to a 24-bit version of our fill color */ red = ((unsigned int)(_plotter->drawstate->fillcolor.red) >> 8) & 0xff; green = ((unsigned int)(_plotter->drawstate->fillcolor.green) >> 8) & 0xff; blue = ((unsigned int)(_plotter->drawstate->fillcolor.blue) >> 8) & 0xff; fgPixel.type = MI_PIXEL_RGB_TYPE; fgPixel.u.rgb[0] = red; fgPixel.u.rgb[1] = green; fgPixel.u.rgb[2] = blue; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); /* do the filling */ if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* special case: all user-space points in polyline were mapped to a single integer pixel, so just paint it */ miDrawPoints ((miPaintedSet *)_plotter->b_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, miPoints); else /* normal case */ miFillPolygon ((miPaintedSet *)_plotter->b_painted_set, pGC, polygon_shape, MI_COORD_MODE_ORIGIN, polyline_len, miPoints); } if (_plotter->drawstate->pen_type) /* pen is present, so edge the polyline */ { /* set pen color in GC to a 24-bit version of our pen color (and set bg color too) */ red = ((unsigned int)(_plotter->drawstate->fgcolor.red) >> 8) & 0xff; green = ((unsigned int)(_plotter->drawstate->fgcolor.green) >> 8) & 0xff; blue = ((unsigned int)(_plotter->drawstate->fgcolor.blue) >> 8) & 0xff; fgPixel.type = MI_PIXEL_RGB_TYPE; fgPixel.u.rgb[0] = red; fgPixel.u.rgb[1] = green; fgPixel.u.rgb[2] = blue; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); if (polyline_len == 1) /* Special case: all user-space points in the polyline were mapped to a single pixel. If (1) they weren't all the same to begin with, or (2) they were all the same to begin with and the cap mode is "round", then draw as a filled circle of diameter equal to the line width; otherwise draw nothing. */ { if (identical_user_coordinates == false || _plotter->drawstate->cap_type == PL_CAP_ROUND) { unsigned int sp_size = (unsigned int)_plotter->drawstate->quantized_device_line_width; if (sp_size == 0) sp_size = 1; if (sp_size == 1) /* subcase: just draw a point */ miDrawPoints ((miPaintedSet *)_plotter->b_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, miPoints); else /* draw a filled circle */ { int sp_offset; miArc arc; sp_offset = (_plotter->drawstate->quantized_device_line_width + 1) / 2; arc.x = miPoints[0].x - sp_offset; arc.y = miPoints[0].y - sp_offset; arc.width = sp_size; arc.height = sp_size; arc.angle1 = 0; arc.angle2 = 64 * 360; miFillArcs ((miPaintedSet *)_plotter->b_painted_set, pGC, 1, &arc); } } } else /* normal case: draw a nondegenerate polyline in integer device space */ miDrawLines ((miPaintedSet *)_plotter->b_painted_set, pGC, MI_COORD_MODE_ORIGIN, polyline_len, miPoints); } /* deallocate miGC and free temporary points array */ miDeleteGC (pGC); free (miPoints); /* copy from painted set to canvas, and clear */ offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas ((miPaintedSet *)_plotter->b_painted_set, (miCanvas *)_plotter->b_canvas, offset); miClearPaintedSet ((miPaintedSet *)_plotter->b_painted_set); } break; case (int)PATH_ELLIPSE: { int ninetymult; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; plPoint pc; double rx, ry, angle; pc = _plotter->drawstate->path->pc; rx = _plotter->drawstate->path->rx; ry = _plotter->drawstate->path->ry; angle = _plotter->drawstate->path->angle; /* if angle is multiple of 90 degrees, modify to permit use of libxmi's arc rendering */ ninetymult = IROUND(angle / 90.0); if (angle == (double) (90 * ninetymult)) { angle = 0.0; if (ninetymult % 2) { double temp; temp = rx; rx = ry; ry = temp; } } rx = (rx < 0.0 ? -rx : rx); /* avoid obscure libxmi problems */ ry = (ry < 0.0 ? -ry : ry); /* axes flipped? (by default y-axis is, due to libxmi's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); /* location of `origin' (upper left corner of bounding rect. for ellipse) and width and height; libxmi's flipped-y convention affects these values */ xorigin = IROUND(XD(pc.x - x_orientation * rx, pc.y - y_orientation * ry)); yorigin = IROUND(YD(pc.x - x_orientation * rx, pc.y - y_orientation * ry)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * rx, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * ry)); /* Because this ellipse object was added to the path buffer, we already know that (1) the user->device frame map preserves coordinate axes, (2) effectively, angle == 0. These are necessary for the libxmi scan-conversion module to do the drawing. */ /* draw ellipse (elliptic arc aligned with the coordinate axes, arc range = 64*360 64'ths of a degree) */ _pl_b_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, 0, 64 * 360); } break; default: /* shouldn't happen */ break; } } /* Use libxmi rendering to draw what would be a circular arc in the user frame. If this is called, the map from user to device coordinates is assumed to preserve coordinate axes (it may be anisotropic [x and y directions scaled differently], and it may include a reflection through either or both axes). So it will be a circular or elliptic arc in the device frame, of the sort that libxmi supports. */ void _pl_b_draw_elliptic_arc (R___(Plotter *_plotter) plPoint p0, plPoint p1, plPoint pc) { double radius; double theta0, theta1; int startangle, anglerange; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; /* axes flipped? (by default y-axis is, due to xmi's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); /* radius of circular arc in user frame is distance to p0, and also to p1 */ radius = DIST(pc, p0); /* location of `origin' (upper left corner of bounding rect. on display) and width and height; X's flipped-y convention affects these values */ xorigin = IROUND(XD(pc.x - x_orientation * radius, pc.y - y_orientation * radius)); yorigin = IROUND(YD(pc.x - x_orientation * radius, pc.y - y_orientation * radius)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * radius, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * radius)); theta0 = _xatan2 (-y_orientation * (p0.y - pc.y), x_orientation * (p0.x - pc.x)) / M_PI; theta1 = _xatan2 (-y_orientation * (p1.y - pc.y), x_orientation * (p1.x - pc.x)) / M_PI; if (theta1 < theta0) theta1 += 2.0; /* adjust so that difference > 0 */ if (theta0 < 0.0) { theta0 += 2.0; /* adjust so that startangle > 0 */ theta1 += 2.0; } if (theta1 - theta0 > 1.0) /* swap if angle appear to be > 180 degrees */ { double tmp; tmp = theta0; theta0 = theta1; theta1 = tmp; theta1 += 2.0; /* adjust so that difference > 0 */ } if (theta0 >= 2.0 && theta1 >= 2.0) /* avoid obscure X bug */ { theta0 -= 2.0; theta1 -= 2.0; } startangle = IROUND(64 * theta0 * 180.0); /* in 64'ths of a degree */ anglerange = IROUND(64 * (theta1 - theta0) * 180.0); /* likewise */ _pl_b_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } /* Use libxmi rendering to draw what would be a quarter-ellipse in the user frame. If this is called, the map from user to device coordinates is assumed to preserve coordinate axes (it may be anisotropic [x and y directions scaled differently], and it may include a reflection through either or both axes). So it will be a quarter-ellipse in the device frame, of the sort that libxmi supports. */ void _pl_b_draw_elliptic_arc_2 (R___(Plotter *_plotter) plPoint p0, plPoint p1, plPoint pc) { double rx, ry; double x0, y0, x1, y1, xc, yc; int startangle, endangle, anglerange; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; /* axes flipped? (by default y-axis is, due to xmi's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); xc = pc.x, yc = pc.y; x0 = p0.x, y0 = p0.y; x1 = p1.x, y1 = p1.y; if (y0 == yc && x1 == xc) /* initial pt. on x-axis, final pt. on y-axis */ { /* semi-axes in user frame */ rx = (x0 > xc) ? x0 - xc : xc - x0; ry = (y1 > yc) ? y1 - yc : yc - y1; /* starting and ending angles; note flipped-y convention */ startangle = ((x0 > xc ? 1 : -1) * x_orientation == 1) ? 0 : 180; endangle = ((y1 > yc ? 1 : -1) * y_orientation == -1) ? 90 : 270; } else /* initial pt. on y-axis, final pt. on x-axis */ { /* semi-axes in user frame */ rx = (x1 > xc) ? x1 - xc : xc - x1; ry = (y0 > yc) ? y0 - yc : yc - y0; /* starting and ending angles; note flipped-y convention */ startangle = ((y0 > yc ? 1 : -1) * y_orientation == -1) ? 90 : 270; endangle = ((x1 > xc ? 1 : -1) * x_orientation == 1) ? 0 : 180; } if (endangle < startangle) endangle += 360; anglerange = endangle - startangle; /* always 90 or 270 */ /* our convention: a quarter-ellipse can only be 90 degrees of a libxmi ellipse, not 270 degrees, so interchange points */ if (anglerange == 270) { int tmp; tmp = startangle; startangle = endangle; endangle = tmp; anglerange = 90; } if (startangle >= 360) /* avoid obscure libxmi bug */ startangle -= 360; /* endangle no longer relevant */ /* location of `origin' (upper left corner of bounding rect. on display) and width and height; xmi's flipped-y convention affects these values */ xorigin = IROUND(XD(xc - x_orientation * rx, yc - y_orientation * ry)); yorigin = IROUND(YD(xc - x_orientation * rx, yc - y_orientation * ry)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * rx, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * ry)); /* reexpress in 64'ths of a degree (libxmi convention) */ startangle *= 64; anglerange *= 64; _pl_b_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } /* Draw an elliptic arc aligned with the coordinate axes, by invoking functions in the libxmi API. Takes account of the possible need for filling. The cases squaresize_x = 0 and squaresize_y = 0 are handled specially, since miFillArcs() and miDrawArcs() do not support them. */ void _pl_b_draw_elliptic_arc_internal (R___(Plotter *_plotter) int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange) { miGC *pGC; miArc arc; miPixel fgPixel, bgPixel; miPixel pixels[2]; miPoint offset; unsigned char red, green, blue; /* determine background pixel color */ bgPixel.type = MI_PIXEL_RGB_TYPE; bgPixel.u.rgb[0] = _plotter->drawstate->bgcolor.red & 0xff; bgPixel.u.rgb[1] = _plotter->drawstate->bgcolor.green & 0xff; bgPixel.u.rgb[2] = _plotter->drawstate->bgcolor.blue & 0xff; pixels[0] = bgPixel; pixels[1] = bgPixel; /* construct an miGC (graphics context for the libxmi module); copy attributes from the Plotter's GC to it */ pGC = miNewGC (2, pixels); _set_common_mi_attributes (_plotter->drawstate, (void *)pGC); /* libxmi's definition of an elliptic arc aligned with the axes */ arc.x = xorigin; arc.y = yorigin; arc.width = squaresize_x; arc.height = squaresize_y; arc.angle1 = startangle; arc.angle2 = anglerange; if (_plotter->drawstate->fill_type) /* not transparent, so fill the arc */ { double red_d, green_d, blue_d; double desaturate; /* scale fillcolor RGB values from 16-bits to range [0.0,1.0] */ red_d = ((double)((_plotter->drawstate->fillcolor).red))/0xFFFF; green_d = ((double)((_plotter->drawstate->fillcolor).green))/0xFFFF; blue_d = ((double)((_plotter->drawstate->fillcolor).blue))/0xFFFF; /* fill_type, if nonzero, specifies the extent to which the nominal fill color should be desaturated. 1 means no desaturation, 0xffff means complete desaturation (white). */ desaturate = ((double)_plotter->drawstate->fill_type - 1.)/0xFFFE; red_d = red_d + desaturate * (1.0 - red_d); green_d = green_d + desaturate * (1.0 - green_d); blue_d = blue_d + desaturate * (1.0 - blue_d); /* convert desaturated RGB values to 8 bits each (24 bits in all) */ red = IROUND(0xff * red_d); green = IROUND(0xff * green_d); blue = IROUND(0xff * blue_d); /* set fg color in GC to the 24-bit desaturated RGB (and set bg color too) */ fgPixel.type = MI_PIXEL_RGB_TYPE; fgPixel.u.rgb[0] = red; fgPixel.u.rgb[1] = green; fgPixel.u.rgb[2] = blue; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); /* fill the arc */ if (squaresize_x <= 1 || squaresize_y <= 1) /* a special case, which miFillArcs() doesn't handle in the way we'd like; just paint a single pixel, irrespective of angle range */ { miPoint point; point.x = xorigin; point.y = yorigin; miDrawPoints ((miPaintedSet *)_plotter->b_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, &point); } else /* default case */ miFillArcs ((miPaintedSet *)_plotter->b_painted_set, pGC, 1, &arc); } if (_plotter->drawstate->pen_type) /* pen is present, so edge the arc */ { unsigned int sp_size = 0; /* keep compiler happy */ /* set fg color in GC to a 24-bit version of our pen color (and set bg color too) */ red = ((unsigned int)(_plotter->drawstate->fgcolor.red) >> 8) & 0xff; green = ((unsigned int)(_plotter->drawstate->fgcolor.green) >> 8) & 0xff; blue = ((unsigned int)(_plotter->drawstate->fgcolor.blue) >> 8) & 0xff; fgPixel.type = MI_PIXEL_RGB_TYPE; fgPixel.u.rgb[0] = red; fgPixel.u.rgb[1] = green; fgPixel.u.rgb[2] = blue; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); if (squaresize_x <= 1 || squaresize_y <= 1) /* Won't call miDrawArcs in the usual way, because it performs poorly when one of these two is zero, at least. Irrespective of angle range, will fill a disk of diameter equal to line width */ { int sp_offset; sp_size = (unsigned int)_plotter->drawstate->quantized_device_line_width; sp_offset = (int)(_plotter->drawstate->quantized_device_line_width + 1) / 2; if (sp_size == 0) sp_size = 1; arc.x -= sp_offset; arc.y -= sp_offset; arc.width = sp_size; arc.height = sp_size; arc.angle1 = 0; arc.angle2 = 64 * 360; } /* edge the arc by invoking libxmi's reentrant arc-drawing function, passing it as final argument a pointer to persistent storage maintained by the Plotter */ if (squaresize_x <= 1 || squaresize_y <= 1) /* miDrawArcs doesn't handle this case as we'd wish, will treat specially */ { if (sp_size == 1) /* special subcase: line width is small too, so just paint a single pixel rather than filling abovementioned disk */ { miPoint point; point.x = xorigin; point.y = yorigin; miDrawPoints ((miPaintedSet *)_plotter->b_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, &point); } else /* normal version of special case: draw filled disk of diameter equal to the line width, irrespective of the angle range */ miFillArcs((miPaintedSet *)_plotter->b_painted_set, pGC, 1, &arc); } else /* default case, which is what is almost always used */ miDrawArcs_r ((miPaintedSet *)_plotter->b_painted_set, pGC, 1, &arc, (miEllipseCache *)(_plotter->b_arc_cache_data)); } /* deallocate miGC */ miDeleteGC (pGC); /* copy from painted set to canvas, and clear */ offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas ((miPaintedSet *)_plotter->b_painted_set, (miCanvas *)_plotter->b_canvas, offset); miClearPaintedSet ((miPaintedSet *)_plotter->b_painted_set); } bool _pl_b_paint_paths (S___(Plotter *_plotter)) { return false; } plotutils-2.6/libplot/b_point.c0000644000175000017500000000635611037243260013614 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" void _pl_b_paint_point (S___(Plotter *_plotter)) { double xx, yy; int ixx, iyy; unsigned char red, green, blue; miGC *pGC; miPixel fgPixel, bgPixel, pixels[2]; miPoint point, offset; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* convert point to floating-point device coordinates */ xx = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); yy = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); /* round to integer device coordinates */ ixx = IROUND(xx); iyy = IROUND(yy); /* compute 24-bit color */ red = ((unsigned int)(_plotter->drawstate->fgcolor.red) >> 8) & 0xff; green = ((unsigned int)(_plotter->drawstate->fgcolor.green) >> 8) & 0xff; blue = ((unsigned int)(_plotter->drawstate->fgcolor.blue) >> 8) & 0xff; /* compute background and foreground color for miGC */ bgPixel.type = MI_PIXEL_RGB_TYPE; bgPixel.u.rgb[0] = _plotter->drawstate->bgcolor.red & 0xff; bgPixel.u.rgb[1] = _plotter->drawstate->bgcolor.green & 0xff; bgPixel.u.rgb[2] = _plotter->drawstate->bgcolor.blue & 0xff; fgPixel.type = MI_PIXEL_RGB_TYPE; fgPixel.u.rgb[0] = red; fgPixel.u.rgb[1] = green; fgPixel.u.rgb[2] = blue; pixels[0] = bgPixel; pixels[1] = fgPixel; /* construct an miGC (graphics context for the libxmi module); copy attributes from the Plotter's GC to it */ pGC = miNewGC (2, pixels); _set_common_mi_attributes (_plotter->drawstate, (void *)pGC); point.x = ixx; point.y = iyy; miDrawPoints ((miPaintedSet *)_plotter->b_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, &point); /* deallocate miGC */ miDeleteGC (pGC); /* copy from painted set to canvas, and clear */ offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas ((miPaintedSet *)_plotter->b_painted_set, (miCanvas *)_plotter->b_canvas, offset); miClearPaintedSet ((miPaintedSet *)_plotter->b_painted_set); } } plotutils-2.6/libplot/m_attribs.c0000644000175000017500000003354611037243261014150 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* ARGS: mask = attributes to be updated */ void _pl_m_set_attributes (R___(Plotter *_plotter) unsigned int mask) { if (mask & PL_ATTR_POSITION) { if (_plotter->meta_pos.x != _plotter->drawstate->pos.x || _plotter->meta_pos.y != _plotter->drawstate->pos.y) { _pl_m_emit_op_code (R___(_plotter) O_FMOVE); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.x); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = _plotter->drawstate->pos; } } if (mask & PL_ATTR_TRANSFORMATION_MATRIX) { bool need_change = false; int i; for (i = 0; i < 6; i++) { if (_plotter->meta_m_user_to_ndc[i] != _plotter->drawstate->transform.m_user_to_ndc[i]) { need_change = true; break; } } if (need_change) { _pl_m_emit_op_code (R___(_plotter) O_FSETMATRIX); for (i = 0; i < 6; i++) { _pl_m_emit_float (R___(_plotter) _plotter->drawstate->transform.m_user_to_ndc[i]); _plotter->meta_m_user_to_ndc[i] = _plotter->drawstate->transform.m_user_to_ndc[i]; } _pl_m_emit_terminator (S___(_plotter)); } } if (mask & PL_ATTR_PEN_COLOR) { if (_plotter->meta_fgcolor.red != _plotter->drawstate->fgcolor.red || _plotter->meta_fgcolor.green != _plotter->drawstate->fgcolor.green || _plotter->meta_fgcolor.blue != _plotter->drawstate->fgcolor.blue) { _pl_m_emit_op_code (R___(_plotter) O_PENCOLOR); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->fgcolor.red); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->fgcolor.green); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->fgcolor.blue); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_fgcolor = _plotter->drawstate->fgcolor; } } if (mask & PL_ATTR_FILL_COLOR) { if (_plotter->meta_fillcolor_base.red != _plotter->drawstate->fillcolor_base.red || _plotter->meta_fillcolor_base.green != _plotter->drawstate->fillcolor_base.green || _plotter->meta_fillcolor_base.blue != _plotter->drawstate->fillcolor_base.blue) { _pl_m_emit_op_code (R___(_plotter) O_FILLCOLOR); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->fillcolor_base.red); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->fillcolor_base.green); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->fillcolor_base.blue); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_fillcolor_base = _plotter->drawstate->fillcolor_base; } } if (mask & PL_ATTR_BG_COLOR) { if (_plotter->meta_bgcolor.red != _plotter->drawstate->bgcolor.red || _plotter->meta_bgcolor.green != _plotter->drawstate->bgcolor.green || _plotter->meta_bgcolor.blue != _plotter->drawstate->bgcolor.blue) { _pl_m_emit_op_code (R___(_plotter) O_BGCOLOR); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->bgcolor.red); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->bgcolor.green); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->bgcolor.blue); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_bgcolor = _plotter->drawstate->bgcolor; } } if (mask & PL_ATTR_PEN_TYPE) { if (_plotter->meta_pen_type != _plotter->drawstate->pen_type) { _pl_m_emit_op_code (R___(_plotter) O_PENTYPE); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->pen_type); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pen_type = _plotter->drawstate->pen_type; } } if (mask & PL_ATTR_FILL_TYPE) { if (_plotter->meta_fill_type != _plotter->drawstate->fill_type) { _pl_m_emit_op_code (R___(_plotter) O_FILLTYPE); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->fill_type); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_fill_type = _plotter->drawstate->fill_type; } } if (mask & PL_ATTR_LINE_STYLE) { if (_plotter->drawstate->dash_array_in_effect) /* desired line style specified by a dashing pattern */ { bool array_ok = true, offset_ok = true; int i; if (_plotter->meta_dash_array_in_effect == false || (_plotter->meta_dash_array_len != _plotter->drawstate->dash_array_len)) array_ok = false; else { for (i = 0; i < _plotter->meta_dash_array_len; i++) { if (_plotter->meta_dash_array[i] != _plotter->drawstate->dash_array[i]) { array_ok = false; break; } } } if (_plotter->meta_dash_offset != _plotter->drawstate->dash_offset) offset_ok = false; if (array_ok == false || offset_ok == false) { _pl_m_emit_op_code (R___(_plotter) O_FLINEDASH); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->dash_array_len); for (i = 0; i < _plotter->drawstate->dash_array_len; i++) _pl_m_emit_float (R___(_plotter) _plotter->drawstate->dash_array[i]); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->dash_offset); _pl_m_emit_terminator (S___(_plotter)); if (array_ok == false) { double *new_dash_array; if (_plotter->meta_dash_array != (const double *)NULL) free ((double *)_plotter->meta_dash_array); new_dash_array = (double *)_pl_xmalloc (_plotter->drawstate->dash_array_len * sizeof (double)); for (i = 0; i < _plotter->drawstate->dash_array_len; i++) new_dash_array[i] = _plotter->drawstate->dash_array[i]; _plotter->meta_dash_array = new_dash_array; _plotter->meta_dash_array_len = _plotter->drawstate->dash_array_len; } if (offset_ok == false) _plotter->meta_dash_offset = _plotter->drawstate->dash_offset; _plotter->meta_dash_array_in_effect = true; } } else /* desired line style is a builtin line mode */ { if (_plotter->drawstate->points_are_connected == false) /* select special "disconnected" line mode */ { if (_plotter->meta_dash_array_in_effect || _plotter->meta_points_are_connected) { _pl_m_emit_op_code (R___(_plotter) O_LINEMOD); _pl_m_emit_string (R___(_plotter) "disconnected"); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_points_are_connected = false; _plotter->meta_line_type = PL_L_SOLID; } } else /* select a normal line mode */ { if (_plotter->meta_dash_array_in_effect || _plotter->meta_points_are_connected == false || (_plotter->meta_line_type != _plotter->drawstate->line_type)) { const char *line_mode; _pl_m_emit_op_code (R___(_plotter) O_LINEMOD); switch (_plotter->drawstate->line_type) { case PL_L_SOLID: default: line_mode = "solid"; break; case PL_L_DOTTED: line_mode = "dotted"; break; case PL_L_DOTDASHED: line_mode = "dotdashed"; break; case PL_L_SHORTDASHED: line_mode = "shortdashed"; break; case PL_L_LONGDASHED: line_mode = "longdashed"; break; case PL_L_DOTDOTDASHED: line_mode = "dotdotdashed"; break; case PL_L_DOTDOTDOTDASHED: line_mode = "dotdotdotdashed"; break; } _pl_m_emit_string (R___(_plotter) line_mode); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_points_are_connected = true; _plotter->meta_line_type = _plotter->drawstate->line_type; } } /* discard current dash array if any, since we've selected a builtin line mode rather than a user-specified dashing mode */ _plotter->meta_dash_array_in_effect = false; if (_plotter->meta_dash_array != (const double *)NULL) { free ((double *)_plotter->meta_dash_array); _plotter->meta_dash_array = (const double *)NULL; } } } if (mask & PL_ATTR_LINE_WIDTH) { if ((_plotter->meta_line_width_is_default == false && _plotter->drawstate->line_width_is_default == false && _plotter->meta_line_width != _plotter->drawstate->line_width) || (_plotter->meta_line_width_is_default != _plotter->drawstate->line_width_is_default)) { _pl_m_emit_op_code (R___(_plotter) O_FLINEWIDTH); if (_plotter->drawstate->line_width_is_default) /* switch to default by emitting negative line width */ _pl_m_emit_float (R___(_plotter) -1.0); else _pl_m_emit_float (R___(_plotter) _plotter->drawstate->line_width); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_line_width = _plotter->drawstate->line_width; _plotter->meta_line_width_is_default = _plotter->drawstate->line_width_is_default; } } if (mask & PL_ATTR_ORIENTATION) { if (_plotter->meta_orientation != _plotter->drawstate->orientation) { _pl_m_emit_op_code (R___(_plotter) O_ORIENTATION); _pl_m_emit_integer (R___(_plotter) _plotter->drawstate->orientation); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_orientation = _plotter->drawstate->orientation; } } if (mask & PL_ATTR_MITER_LIMIT) { if (_plotter->meta_miter_limit != _plotter->drawstate->miter_limit) { _pl_m_emit_op_code (R___(_plotter) O_FMITERLIMIT); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->miter_limit); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_miter_limit = _plotter->drawstate->miter_limit; } } if (mask & PL_ATTR_FILL_RULE) { if (_plotter->meta_fill_rule_type != _plotter->drawstate->fill_rule_type) { const char *fill_mode; _pl_m_emit_op_code (R___(_plotter) O_FILLMOD); switch (_plotter->drawstate->fill_rule_type) { case PL_FILL_ODD_WINDING: default: fill_mode = "even-odd"; break; case PL_FILL_NONZERO_WINDING: fill_mode = "nonzero-winding"; break; } _pl_m_emit_string (R___(_plotter) fill_mode); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_fill_rule_type = _plotter->drawstate->fill_rule_type; } } if (mask & PL_ATTR_JOIN_STYLE) { if (_plotter->meta_join_type != _plotter->drawstate->join_type) { const char *join_mode; _pl_m_emit_op_code (R___(_plotter) O_JOINMOD); switch (_plotter->drawstate->join_type) { case PL_JOIN_MITER: default: join_mode = "miter"; break; case PL_JOIN_ROUND: join_mode = "round"; break; case PL_JOIN_BEVEL: join_mode = "bevel"; break; case PL_JOIN_TRIANGULAR: join_mode = "triangular"; break; } _pl_m_emit_string (R___(_plotter) join_mode); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_join_type = _plotter->drawstate->join_type; } } if (mask & PL_ATTR_CAP_STYLE) { if (_plotter->meta_cap_type != _plotter->drawstate->cap_type) { const char *cap_mode; _pl_m_emit_op_code (R___(_plotter) O_CAPMOD); switch (_plotter->drawstate->cap_type) { case PL_CAP_BUTT: default: cap_mode = "butt"; break; case PL_CAP_ROUND: cap_mode = "round"; break; case PL_CAP_PROJECT: cap_mode = "project"; break; case PL_CAP_TRIANGULAR: cap_mode = "triangular"; break; } _pl_m_emit_string (R___(_plotter) cap_mode); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_cap_type = _plotter->drawstate->cap_type; } } if (mask & PL_ATTR_FONT_NAME) { const char *font_name = _plotter->drawstate->font_name; if (_plotter->meta_font_name == (const char *)NULL || strcasecmp (_plotter->meta_font_name, font_name) != 0) { char *copied_font_name; copied_font_name = (char *)_pl_xmalloc (strlen (font_name) + 1); strcpy (copied_font_name, font_name); _pl_m_emit_op_code (R___(_plotter) O_FONTNAME); _pl_m_emit_string (R___(_plotter) copied_font_name); _pl_m_emit_terminator (S___(_plotter)); if (_plotter->meta_font_name != (const char *)NULL) free ((char *)_plotter->meta_font_name); _plotter->meta_font_name = copied_font_name; } } if (mask & PL_ATTR_FONT_SIZE) { if ((_plotter->meta_font_size_is_default == false && _plotter->drawstate->font_size_is_default == false && _plotter->meta_font_size != _plotter->drawstate->font_size) || (_plotter->meta_font_size_is_default != _plotter->drawstate->font_size_is_default)) { _pl_m_emit_op_code (R___(_plotter) O_FFONTSIZE); if (_plotter->drawstate->font_size_is_default) /* switch to default by emitting negative font size */ _pl_m_emit_float (R___(_plotter) -1.0); else _pl_m_emit_float (R___(_plotter) _plotter->drawstate->font_size); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_font_size = _plotter->drawstate->font_size; _plotter->meta_font_size_is_default = _plotter->drawstate->font_size_is_default; } } if (mask & PL_ATTR_TEXT_ANGLE) { if (_plotter->meta_text_rotation != _plotter->drawstate->text_rotation) { _pl_m_emit_op_code (R___(_plotter) O_FTEXTANGLE); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->text_rotation); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_text_rotation = _plotter->drawstate->text_rotation; } } } plotutils-2.6/libplot/m_closepl.c0000644000175000017500000000256611037243261014137 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_m_end_page (S___(Plotter *_plotter)) { _pl_m_emit_op_code (R___(_plotter) O_CLOSEPL); _pl_m_emit_terminator (S___(_plotter)); /* clean up device-specific Plotter members that are heap-allocated */ if (_plotter->meta_font_name != (const char *)NULL) free ((char *)_plotter->meta_font_name); if (_plotter->meta_dash_array != (const double *)NULL) free ((double *)_plotter->meta_dash_array); return true; } plotutils-2.6/libplot/m_defplot.c0000644000175000017500000002165411037243261014132 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any MetaPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a MetaPlotter struct. */ const Plotter _pl_m_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_m_initialize, _pl_m_terminate, /* page manipulation */ _pl_m_begin_page, _pl_m_erase_page, _pl_m_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_m_paint_path, _pl_m_paint_paths, _pl_m_path_is_flushable, _pl_m_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_m_paint_marker, _pl_m_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_m_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* internal `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* internal `error handler' methods */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_m_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_META; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 2; _plotter->data->have_dash_array = 2; _plotter->data->have_solid_fill = 2; _plotter->data->have_odd_winding_fill = 2; _plotter->data->have_nonzero_winding_fill = 2; _plotter->data->have_settable_bg = 2; _plotter->data->have_escaped_string_support = 1; _plotter->data->have_ps_fonts = 1; _plotter->data->have_pcl_fonts = 1; _plotter->data->have_stick_fonts = 1; _plotter->data->have_extra_stick_fonts = 1; _plotter->data->have_other_fonts = 1; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_HERSHEY; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = true; _plotter->data->have_vertical_justification = true; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal) */ _plotter->data->max_unfilled_path_length = PL_MAX_UNFILLED_PATH_LENGTH; _plotter->data->have_mixed_paths = true; _plotter->data->allowed_arc_scaling = AS_ANY; _plotter->data->allowed_ellarc_scaling = AS_ANY; _plotter->data->allowed_quad_scaling = AS_ANY; _plotter->data->allowed_cubic_scaling = AS_ANY; _plotter->data->allowed_box_scaling = AS_ANY; _plotter->data->allowed_circle_scaling = AS_ANY; _plotter->data->allowed_ellipse_scaling = AS_ANY; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_REAL; _plotter->data->flipped_y = false; _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 1.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 1.0; _plotter->data->page_data = (plPageData *)NULL; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* initialize data members specific to this derived class */ /* parameters */ _plotter->meta_portable_output = false; /* dynamic variables */ _plotter->meta_pos.x = 0.0; _plotter->meta_pos.y = 0.0; _plotter->meta_position_is_unknown = false; _plotter->meta_m_user_to_ndc[0] = 1.0; _plotter->meta_m_user_to_ndc[1] = 0.0; _plotter->meta_m_user_to_ndc[2] = 0.0; _plotter->meta_m_user_to_ndc[3] = 1.0; _plotter->meta_m_user_to_ndc[4] = 0.0; _plotter->meta_m_user_to_ndc[5] = 0.0; _plotter->meta_fill_rule_type = PL_FILL_ODD_WINDING; _plotter->meta_line_type = PL_L_SOLID; _plotter->meta_points_are_connected = true; _plotter->meta_cap_type = PL_CAP_BUTT; _plotter->meta_join_type = PL_JOIN_MITER; _plotter->meta_miter_limit = PL_DEFAULT_MITER_LIMIT; _plotter->meta_line_width = 0.0; _plotter->meta_line_width_is_default = true; _plotter->meta_dash_array = (const double *)NULL; _plotter->meta_dash_array_len = 0; _plotter->meta_dash_offset = 0.0; _plotter->meta_dash_array_in_effect = false; _plotter->meta_pen_type = 1; _plotter->meta_fill_type = 0; _plotter->meta_orientation = 1; _plotter->meta_font_name = (const char *)NULL; _plotter->meta_font_size = 0.0; _plotter->meta_font_size_is_default = true; _plotter->meta_text_rotation = 0.0; _plotter->meta_fgcolor.red = 0; _plotter->meta_fgcolor.green = 0; _plotter->meta_fgcolor.blue = 0; _plotter->meta_fillcolor_base.red = 0; _plotter->meta_fillcolor_base.green = 0; _plotter->meta_fillcolor_base.blue = 0; _plotter->meta_bgcolor.red = 65535; _plotter->meta_bgcolor.green = 65535; _plotter->meta_bgcolor.blue = 65535; /* initialize certain data members from device driver parameters */ /* determine version of metafile format */ { const char *portable_s; portable_s = (const char *)_get_plot_param (_plotter->data, "META_PORTABLE"); if (strcasecmp (portable_s, "yes") == 0) _plotter->meta_portable_output = true; else _plotter->meta_portable_output = false; /* default value */ } } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_m_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER MetaPlotter::MetaPlotter (FILE *infile, FILE *outfile, FILE *errfile) : Plotter (infile, outfile, errfile) { _pl_m_initialize (); } MetaPlotter::MetaPlotter (FILE *outfile) : Plotter (outfile) { _pl_m_initialize (); } MetaPlotter::MetaPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_m_initialize (); } MetaPlotter::MetaPlotter (ostream& out) : Plotter (out) { _pl_m_initialize (); } MetaPlotter::MetaPlotter () { _pl_m_initialize (); } MetaPlotter::MetaPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_m_initialize (); } MetaPlotter::MetaPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_m_initialize (); } MetaPlotter::MetaPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_m_initialize (); } MetaPlotter::MetaPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_m_initialize (); } MetaPlotter::MetaPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_m_initialize (); } MetaPlotter::~MetaPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_m_terminate (); } #endif plotutils-2.6/libplot/m_emit.c0000644000175000017500000001312011037243261013420 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal _pl_m_emit_integer, _pl_m_emit_float, _pl_m_emit_op_code, and _pl_m_emit_string routines, which are used by MetaPlotters. They take into account the desired format (binary metafile format or ascii [human-readable] metafile format. In the unnumbered versions of libplot prior to version 0.0 (which was released as part of plotutils-2.0, in 1/98), we assumed that in binary metafile format, two bytes sufficed to represent any integer. This was the convention used in traditional plot(5) format, and can be traced to the PDP-11. Unfortunately it confined us to the range -0x10000..0x7fff (assuming two's complement). Actually, the parsing in our `plot' utility always treated the arguments to pencolor(), fillcolor(), and filltype() specially. An argument of any of those functions was treated as an unsigned integer, so it could be in the range 0..0xffff. In version 0.0 of libplot, we switched in binary metafile format to representing integers as machine integers. The parsing of metafiles by `plot' now takes this into account. `plot' has command-line options for backward compatibility with plot(5) format. Our representation for floating-point numbers in binary metafiles is simply the machine representation for single-precision floating point. plot(5) format did not support floating point arguments, so there are no concerns over backward compatibility. */ #include "sys-defines.h" #include "extern.h" /* emit one unsigned character, passed as an int */ void _pl_m_emit_op_code (R___(Plotter *_plotter) int c) { if (_plotter->data->outfp) putc (c, _plotter->data->outfp); #ifdef LIBPLOTTER else if (_plotter->data->outstream) _plotter->data->outstream->put ((unsigned char)c); #endif } void _pl_m_emit_integer (R___(Plotter *_plotter) int x) { if (_plotter->data->outfp) { if (_plotter->meta_portable_output) fprintf (_plotter->data->outfp, " %d", x); else fwrite ((void *) &x, sizeof(int), 1, _plotter->data->outfp); } #ifdef LIBPLOTTER else if (_plotter->data->outstream) { if (_plotter->meta_portable_output) (*(_plotter->data->outstream)) << ' ' << x; else _plotter->data->outstream->write((char *)&x, sizeof(int)); } #endif } void _pl_m_emit_float (R___(Plotter *_plotter) double x) { if (_plotter->data->outfp) { if (_plotter->meta_portable_output) { /* treat equality with zero specially, since some printf's print negative zero differently from positive zero, and that may prevent regression tests from working properly */ fprintf (_plotter->data->outfp, x == 0.0 ? " 0" : " %g", x); } else { float f; f = FROUND(x); fwrite ((void *) &f, sizeof(float), 1, _plotter->data->outfp); } } #ifdef LIBPLOTTER else if (_plotter->data->outstream) { if (_plotter->meta_portable_output) (*(_plotter->data->outstream)) << ' ' << x; else { float f; f = FROUND(x); _plotter->data->outstream->write((char *)&f, sizeof(float)); } } #endif } void _pl_m_emit_string (R___(Plotter *_plotter) const char *s) { bool has_newline; char *t = NULL; /* keep compiler happy */ char *nl; const char *u; /* null pointer handled specially */ if (s == NULL) s = "(null)"; if (strchr (s, '\n')) /* don't grok arg strings containing newlines; truncate at first newline if any */ { has_newline = true; t = (char *)_pl_xmalloc (strlen (s) + 1); strcpy (t, s); nl = strchr (t, '\n'); *nl = '\0'; u = t; } else { has_newline = false; u = s; } /* emit string, with appended newline if output format is binary (old plot(3) convention, which makes sense only if there can be at most one string among the command arguments, and it's positioned last) */ if (_plotter->data->outfp) { fputs (u, _plotter->data->outfp); if (_plotter->meta_portable_output == false) putc ('\n', _plotter->data->outfp); } #ifdef LIBPLOTTER else if (_plotter->data->outstream) { (*(_plotter->data->outstream)) << u; if (_plotter->meta_portable_output == false) (*(_plotter->data->outstream)) << '\n'; } #endif if (has_newline) free (t); } /* End a directive that was begun by invoking _pl_m_emit_op_code() (q.v.). In portable format, the terminator is a newline; in binary format, there is no terminator. */ void _pl_m_emit_terminator (S___(Plotter *_plotter)) { if (_plotter->meta_portable_output) { if (_plotter->data->outfp) putc ('\n', _plotter->data->outfp); #ifdef LIBPLOTTER else if (_plotter->data->outstream) (*(_plotter->data->outstream)) << '\n'; #endif } } plotutils-2.6/libplot/m_erase.c0000644000175000017500000000224111037243261013563 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_m_erase_page (S___(Plotter *_plotter)) { _pl_m_set_attributes (R___(_plotter) PL_ATTR_BG_COLOR); _pl_m_emit_op_code (R___(_plotter) O_ERASE); _pl_m_emit_terminator (S___(_plotter)); return true; } plotutils-2.6/libplot/m_mark.c0000644000175000017500000000351511037243261013423 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The paint_marker method, which is an internal function that is called when the marker() method is invoked. It plots an object: a marker of a specified type, at a specified size, at the current location. If this returns `false', marker() will construct the marker from other libplot primitives, in a generic way. */ #include "sys-defines.h" #include "extern.h" bool _pl_m_paint_marker (R___(Plotter *_plotter) int type, double size) { _pl_m_set_attributes (R___(_plotter) PL_ATTR_TRANSFORMATION_MATRIX | PL_ATTR_PEN_COLOR | PL_ATTR_PEN_TYPE); _pl_m_emit_op_code (R___(_plotter) O_FMARKER); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.x); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.y); _pl_m_emit_integer (R___(_plotter) type); _pl_m_emit_float (R___(_plotter) size); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = _plotter->drawstate->pos; return true; } plotutils-2.6/libplot/m_openpl.c0000644000175000017500000000577011037243261013773 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_m_begin_page (S___(Plotter *_plotter)) { if (_plotter->data->page_number == 1) /* emit metafile header, i.e. magic string */ { _write_string (_plotter->data, PL_PLOT_MAGIC); /* format type 1 = GNU binary, type 2 = GNU portable */ if (_plotter->meta_portable_output) _write_string (_plotter->data, " 2\n"); else _write_string (_plotter->data, " 1\n"); } _pl_m_emit_op_code (R___(_plotter) O_OPENPL); _pl_m_emit_terminator (S___(_plotter)); /* reset page-specific, i.e. picture-specific, dynamic variables */ _plotter->meta_pos.x = 0.0; _plotter->meta_pos.y = 0.0; _plotter->meta_position_is_unknown = false; _plotter->meta_m_user_to_ndc[0] = 1.0; _plotter->meta_m_user_to_ndc[1] = 0.0; _plotter->meta_m_user_to_ndc[2] = 0.0; _plotter->meta_m_user_to_ndc[3] = 1.0; _plotter->meta_m_user_to_ndc[4] = 0.0; _plotter->meta_m_user_to_ndc[5] = 0.0; _plotter->meta_fill_rule_type = PL_FILL_ODD_WINDING; _plotter->meta_line_type = PL_L_SOLID; _plotter->meta_points_are_connected = true; _plotter->meta_cap_type = PL_CAP_BUTT; _plotter->meta_join_type = PL_JOIN_MITER; _plotter->meta_miter_limit = PL_DEFAULT_MITER_LIMIT; _plotter->meta_line_width = 0.0; _plotter->meta_line_width_is_default = true; _plotter->meta_dash_array = (const double *)NULL; _plotter->meta_dash_array_len = 0; _plotter->meta_dash_offset = 0.0; _plotter->meta_dash_array_in_effect = false; _plotter->meta_pen_type = 1; _plotter->meta_fill_type = 0; _plotter->meta_orientation = 1; _plotter->meta_font_name = (const char *)NULL; _plotter->meta_font_size = 0.0; _plotter->meta_font_size_is_default = true; _plotter->meta_text_rotation = 0.0; _plotter->meta_fgcolor.red = 0; _plotter->meta_fgcolor.green = 0; _plotter->meta_fgcolor.blue = 0; _plotter->meta_fillcolor_base.red = 0; _plotter->meta_fillcolor_base.green = 0; _plotter->meta_fillcolor_base.blue = 0; _plotter->meta_bgcolor.red = 65535; _plotter->meta_bgcolor.green = 65535; _plotter->meta_bgcolor.blue = 65535; return true; } plotutils-2.6/libplot/m_path.c0000644000175000017500000002302011037243261013416 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ #include "sys-defines.h" #include "extern.h" void _pl_m_paint_path (S___(Plotter *_plotter)) { const plPath *path; bool explicit_endpath, sync_miter_limit = false; /* sync basic path attributes */ _pl_m_set_attributes (R___(_plotter) PL_ATTR_TRANSFORMATION_MATRIX | PL_ATTR_PEN_COLOR | PL_ATTR_PEN_TYPE | PL_ATTR_LINE_STYLE | PL_ATTR_LINE_WIDTH | PL_ATTR_JOIN_STYLE | PL_ATTR_CAP_STYLE | PL_ATTR_FILL_COLOR | PL_ATTR_FILL_TYPE | PL_ATTR_FILL_RULE); /* our one and only simple path to paint */ path = _plotter->drawstate->path; if (_plotter->drawstate->join_type == PL_JOIN_MITER && (path->type == PATH_SEGMENT_LIST || path->type == PATH_BOX)) /* path may have mitered juncture points */ sync_miter_limit = true; if (sync_miter_limit) _pl_m_set_attributes (R___(_plotter) PL_ATTR_MITER_LIMIT); if (path->type == PATH_SEGMENT_LIST) explicit_endpath = true; else explicit_endpath = false; /* emit metafile object-drawing instructions to draw the path; include a preliminary syncing of the `orientation' attribute if relevant */ _pl_m_paint_path_internal (R___(_plotter) path); if (explicit_endpath) { _pl_m_emit_op_code (R___(_plotter) O_ENDPATH); _pl_m_emit_terminator (S___(_plotter)); } } bool _pl_m_paint_paths (S___(Plotter *_plotter)) { const plPath *path; bool sync_miter_limit = false; int i; /* sanity check */ if (_plotter->drawstate->num_paths == 0) return true; /* sync basic path attributes */ _pl_m_set_attributes (R___(_plotter) PL_ATTR_TRANSFORMATION_MATRIX | PL_ATTR_PEN_COLOR | PL_ATTR_PEN_TYPE | PL_ATTR_LINE_STYLE | PL_ATTR_LINE_WIDTH | PL_ATTR_JOIN_STYLE | PL_ATTR_CAP_STYLE | PL_ATTR_FILL_COLOR | PL_ATTR_FILL_TYPE | PL_ATTR_FILL_RULE); if (_plotter->drawstate->join_type == PL_JOIN_MITER) { for (i = 0; i < _plotter->drawstate->num_paths; i++) { path = _plotter->drawstate->paths[i]; if (path->type == PATH_SEGMENT_LIST || path->type == PATH_BOX) /* compound path may have mitered juncture points */ { sync_miter_limit = true; break; } } } if (sync_miter_limit) _pl_m_set_attributes (R___(_plotter) PL_ATTR_MITER_LIMIT); /* loop over simple paths in compound path */ for (i = 0; i < _plotter->drawstate->num_paths; i++) { path = _plotter->drawstate->paths[i]; /* emit metafile object-drawing instructions to draw the path; first sync `orientation' attribute, if relevant */ _pl_m_paint_path_internal (R___(_plotter) path); if (i < _plotter->drawstate->num_paths - 1) { _pl_m_emit_op_code (R___(_plotter) O_ENDSUBPATH); _pl_m_emit_terminator (S___(_plotter)); } } if (_plotter->drawstate->paths[_plotter->drawstate->num_paths - 1]->type == PATH_SEGMENT_LIST) /* append explicit (as opposed to implicit) endpath; if we didn't wish to be clever, we'd append one even if the final simple path isn't a segment list */ { _pl_m_emit_op_code (R___(_plotter) O_ENDPATH); _pl_m_emit_terminator (S___(_plotter)); } /* succesfully painted compound path */ return true; } /* Internal routine, called by the MetaPlotter-specific versions of paint_path() and paint_paths(). Besides emitting metafile instructions to draw a path, it may emit an instruction to update the `orientation' attribute, relevant to paths that are boxes/circles/ellipses. */ void _pl_m_paint_path_internal (R___(Plotter *_plotter) const plPath *path) { if (path->type == PATH_BOX || path->type == PATH_CIRCLE || path->type == PATH_ELLIPSE) /* sync orientation; orientation is stored in the path itself, not in the drawing state */ { int orientation = (path->clockwise ? -1 : 1); if (_plotter->meta_orientation != orientation) { _pl_m_emit_op_code (R___(_plotter) O_ORIENTATION); _pl_m_emit_integer (R___(_plotter) orientation); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_orientation = orientation; } } switch ((int)path->type) { case (int)PATH_SEGMENT_LIST: { plPathSegment segment; int i; /* last-minute sanity check */ if (path->num_segments == 0)/* nothing to do */ break; if (path->num_segments == 1) /* shouldn't happen */ break; segment = path->segments[0]; /* initial moveto */ if (_plotter->meta_pos.x != segment.p.x || _plotter->meta_pos.y != segment.p.y) { _pl_m_emit_op_code (R___(_plotter) O_FMOVE); _pl_m_emit_float (R___(_plotter) segment.p.x); _pl_m_emit_float (R___(_plotter) segment.p.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = segment.p; } for (i = 1; i < path->num_segments; i++) { plPathSegment prev_segment; prev_segment = segment; segment = path->segments[i]; switch ((int)segment.type) { case (int)S_LINE: _pl_m_emit_op_code (R___(_plotter) O_FCONT); _pl_m_emit_float (R___(_plotter) segment.p.x); _pl_m_emit_float (R___(_plotter) segment.p.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = segment.p; break; case (int)S_ARC: _pl_m_emit_op_code (R___(_plotter) O_FARC); _pl_m_emit_float (R___(_plotter) segment.pc.x); _pl_m_emit_float (R___(_plotter) segment.pc.y); _pl_m_emit_float (R___(_plotter) prev_segment.p.x); _pl_m_emit_float (R___(_plotter) prev_segment.p.y); _pl_m_emit_float (R___(_plotter) segment.p.x); _pl_m_emit_float (R___(_plotter) segment.p.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = segment.p; break; case (int)S_ELLARC: _pl_m_emit_op_code (R___(_plotter) O_FELLARC); _pl_m_emit_float (R___(_plotter) segment.pc.x); _pl_m_emit_float (R___(_plotter) segment.pc.y); _pl_m_emit_float (R___(_plotter) prev_segment.p.x); _pl_m_emit_float (R___(_plotter) prev_segment.p.y); _pl_m_emit_float (R___(_plotter) segment.p.x); _pl_m_emit_float (R___(_plotter) segment.p.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = segment.p; break; case (int)S_QUAD: _pl_m_emit_op_code (R___(_plotter) O_FBEZIER2); _pl_m_emit_float (R___(_plotter) prev_segment.p.x); _pl_m_emit_float (R___(_plotter) prev_segment.p.y); _pl_m_emit_float (R___(_plotter) segment.pc.x); _pl_m_emit_float (R___(_plotter) segment.pc.y); _pl_m_emit_float (R___(_plotter) segment.p.x); _pl_m_emit_float (R___(_plotter) segment.p.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = segment.p; break; case (int)S_CUBIC: _pl_m_emit_op_code (R___(_plotter) O_FBEZIER3); _pl_m_emit_float (R___(_plotter) prev_segment.p.x); _pl_m_emit_float (R___(_plotter) prev_segment.p.y); _pl_m_emit_float (R___(_plotter) segment.pc.x); _pl_m_emit_float (R___(_plotter) segment.pc.y); _pl_m_emit_float (R___(_plotter) segment.pd.x); _pl_m_emit_float (R___(_plotter) segment.pd.y); _pl_m_emit_float (R___(_plotter) segment.p.x); _pl_m_emit_float (R___(_plotter) segment.p.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = segment.p; break; default: /* shouldn't happen */ break; } } } break; case (int)PATH_BOX: { _pl_m_emit_op_code (R___(_plotter) O_FBOX); _pl_m_emit_float (R___(_plotter) path->p0.x); _pl_m_emit_float (R___(_plotter) path->p0.y); _pl_m_emit_float (R___(_plotter) path->p1.x); _pl_m_emit_float (R___(_plotter) path->p1.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos.x = 0.5 * (path->p0.x + path->p1.x); _plotter->meta_pos.y = 0.5 * (path->p0.y + path->p1.y); } break; case (int)PATH_CIRCLE: { _pl_m_emit_op_code (R___(_plotter) O_FCIRCLE); _pl_m_emit_float (R___(_plotter) path->pc.x); _pl_m_emit_float (R___(_plotter) path->pc.y); _pl_m_emit_float (R___(_plotter) path->radius); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = path->pc; } break; case (int)PATH_ELLIPSE: { _pl_m_emit_op_code (R___(_plotter) O_FELLIPSE); _pl_m_emit_float (R___(_plotter) path->pc.x); _pl_m_emit_float (R___(_plotter) path->pc.y); _pl_m_emit_float (R___(_plotter) path->rx); _pl_m_emit_float (R___(_plotter) path->ry); _pl_m_emit_float (R___(_plotter) path->angle); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = path->pc; } break; default: /* shouldn't happen */ break; } } bool _pl_m_path_is_flushable (S___(Plotter *_plotter)) { return true; } void _pl_m_maybe_prepaint_segments (R___(Plotter *_plotter) int prev_num_segments) { return; } plotutils-2.6/libplot/m_point.c0000644000175000017500000000316411037243261013622 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ #include "sys-defines.h" #include "extern.h" void _pl_m_paint_point (S___(Plotter *_plotter)) { _pl_m_set_attributes (R___(_plotter) PL_ATTR_TRANSFORMATION_MATRIX | PL_ATTR_PEN_COLOR | PL_ATTR_PEN_TYPE); _pl_m_emit_op_code (R___(_plotter) O_FPOINT); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.x); _pl_m_emit_float (R___(_plotter) _plotter->drawstate->pos.y); _pl_m_emit_terminator (S___(_plotter)); _plotter->meta_pos = _plotter->drawstate->pos; return; } plotutils-2.6/libplot/m_text.c0000644000175000017500000000302311037243261013447 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" void _pl_m_paint_text_string_with_escapes (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { _pl_m_set_attributes (R___(_plotter) PL_ATTR_POSITION | PL_ATTR_TRANSFORMATION_MATRIX | PL_ATTR_PEN_COLOR | PL_ATTR_PEN_TYPE | PL_ATTR_FONT_NAME | PL_ATTR_FONT_SIZE | PL_ATTR_TEXT_ANGLE); _pl_m_emit_op_code (R___(_plotter) O_ALABEL); _pl_m_emit_op_code (R___(_plotter) h_just); _pl_m_emit_op_code (R___(_plotter) v_just); _pl_m_emit_string (R___(_plotter) (const char *)s); _pl_m_emit_terminator (S___(_plotter)); return; } plotutils-2.6/libplot/t_attribs.c0000644000175000017500000001112211037243262014142 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This internal method is invoked before drawing any polyline. It sets the relevant attributes of a Tektronix display (line type only, since cap type, join type, line width are not supported) to what they should be. Our canonical line types are the same as those of a Tektronix, except that we also support "dotdotdashed" lines. So setting the line type is straightforward. kermit's assignment of line types is different from that of a genuine Tektronix, though. */ #include "sys-defines.h" #include "extern.h" void _pl_t_set_attributes (S___(Plotter *_plotter)) { if ((!(_plotter->tek_line_type_is_unknown)) && (_plotter->tek_line_type == _plotter->drawstate->line_type)) return; switch (_plotter->drawstate->line_type) { default: case PL_L_SOLID: /* ASCII ESC `, i.e. ^[` */ _write_string (_plotter->data, "\033`"); break; case PL_L_DOTTED: /* ASCII ESC a, i.e. ^[a */ _write_string (_plotter->data, "\033a"); break; /* following two are interchanged in kermit emulator */ case PL_L_DOTDASHED: if (_plotter->tek_display_type == TEK_DPY_KERMIT) /* ASCII ESC c, i.e. ^[c */ _write_string (_plotter->data, "\033c"); else /* ASCII ESC b, i.e. ^[b */ _write_string (_plotter->data, "\033b"); break; case PL_L_SHORTDASHED: if (_plotter->tek_display_type == TEK_DPY_KERMIT) /* ASCII ESC b, i.e. ^[b */ _write_string (_plotter->data, "\033b"); else /* ASCII ESC c, i.e. ^[c */ _write_string (_plotter->data, "\033c"); break; case PL_L_LONGDASHED: /* in kermit emulator, the following switches to "dotlongdashed" rather than "longdashed", but we can live with that */ /* ASCII ESC d, i.e. ^[d */ _write_string (_plotter->data, "\033d"); break; case PL_L_DOTDOTDASHED: if (_plotter->tek_display_type == TEK_DPY_KERMIT) /* ASCII ESC e, i.e. ^[e */ _write_string (_plotter->data, "\033e"); else /* not supported on a genuine Tektronix, so punt */ /* ASCII ESC b, i.e. ^[b */ _write_string (_plotter->data, "\033b"); break; case PL_L_DOTDOTDOTDASHED: /* not supported, so punt */ /* ASCII ESC b, i.e. ^[b */ _write_string (_plotter->data, "\033b"); break; } /* Tek now agrees with us on line type */ _plotter->tek_line_type = _plotter->drawstate->line_type; _plotter->tek_line_type_is_unknown = false; } /* The reason for the kermit-specific modifications above is that according to kermit documentation, the MS-DOS kermit Tektronix emulator has a different ordering for line types: ` = solid 11111111 11111111 a = dotted 10101010 10101010 b = shortdashed 11110000 11110000 c = dotdashed 11111010 11111010 d = dotlongdashed 11111111 11001100 e = dotdotdashed 11111100 10010010 x = user defined (by ESC / Pn a) y = user defined (by ESC / Pn b) z = user defined (by ESC / Pn c) Incidentally, line type characters recognized by VT-type terminals in Tektronix emulator mode also allegedly differ. According to an old doc file, ` = solid a = dotted b = shortdashed c = dotdashed d = dotlongdashed h = solid (bold) i = dotted (bold) j = shortdashed (bold) k = dotdashed (bold) l = dotlongdashed (bold) Interestingly, BSD atoplot(1) recognizes "dotlongdashed", "dotshortdashed", and "dotdotdashed" (with final "ed" omitted), besides the five canonical Tektronix line types. So when atoplot(1) was written, there must have been plot(1) filters for output devices that supported those additional types. Presumably on VT-type terminals? */ plotutils-2.6/libplot/t_closepl.c0000644000175000017500000000324211037243262014137 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_t_end_page (S___(Plotter *_plotter)) { _pl_t_tek_move (R___(_plotter) 0, 0); /* go to lower left corner in Tek space */ _pl_t_tek_mode (R___(_plotter) TEK_MODE_ALPHA); /* switch to alpha mode */ switch (_plotter->tek_display_type) /* exit from Tek mode */ { case TEK_DPY_KERMIT: /* use VT340 command to exit graphics mode */ _write_string (_plotter->data, "\033[?38l"); /* following command may be an alternative */ /* _write_string (_plotter->data, "\030"); */ break; case TEK_DPY_XTERM: /* ESC C-c, restore to VT102 mode */ _write_string (_plotter->data, "\033\003"); break; case TEK_DPY_GENERIC: default: break; } return true; } plotutils-2.6/libplot/t_color.c0000644000175000017500000000773211037243262013624 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* For TekPlotter objects, setting the pen color or background color has no effect unless the plotter is using the Tektronix emulation of MS-DOS kermit. If so, we compute a quantized color and output the appropriate ANSI escape sequence, if the color is different from the ANSI.SYS color the emulation is currently using. When the TekPlotter is created, the current ANSI.SYS pen and bg colors are set to -1 (see t_defplot.c). That's a nonsensical value, equivalent to `unknown'. */ #include "sys-defines.h" #include "extern.h" #define ONEBYTE (0xff) /* forward references */ static int kermit_pseudocolor (int red, int green, int blue); void _pl_t_set_pen_color(S___(Plotter *_plotter)) { if (_plotter->tek_display_type == TEK_DPY_KERMIT) { int new_kermit_fgcolor; new_kermit_fgcolor = kermit_pseudocolor (_plotter->drawstate->fgcolor.red, _plotter->drawstate->fgcolor.green, _plotter->drawstate->fgcolor.blue); if (new_kermit_fgcolor != _plotter->tek_kermit_fgcolor) { _write_string (_plotter->data, _pl_t_kermit_fgcolor_escapes[new_kermit_fgcolor]); _plotter->tek_kermit_fgcolor = new_kermit_fgcolor; } } } void _pl_t_set_bg_color(S___(Plotter *_plotter)) { if (_plotter->tek_display_type == TEK_DPY_KERMIT) { int new_kermit_bgcolor; new_kermit_bgcolor = kermit_pseudocolor (_plotter->drawstate->bgcolor.red, _plotter->drawstate->bgcolor.green, _plotter->drawstate->bgcolor.blue); if (new_kermit_bgcolor != _plotter->tek_kermit_bgcolor) { _write_string (_plotter->data, _pl_t_kermit_bgcolor_escapes[new_kermit_bgcolor]); _plotter->tek_kermit_bgcolor = new_kermit_bgcolor; } } } /* kermit_pseudocolor quantizes to one of kermit's native 16 colors. (They provide a [rather strange] partition of the color cube; see t_color2.c.) */ /* find closest known point within the RGB color cube, using Euclidean distance as our metric */ static int kermit_pseudocolor (int red, int green, int blue) { unsigned long int difference = INT_MAX; int i; int best = 0; /* reduce to 24 bits */ red = (red >> 8) & ONEBYTE; green = (green >> 8) & ONEBYTE; blue = (blue >> 8) & ONEBYTE; for (i = 0; i < TEK_NUM_ANSI_SYS_COLORS; i++) { unsigned long int newdifference; if (_pl_t_kermit_stdcolors[i].red == 0xff && _pl_t_kermit_stdcolors[i].green == 0xff && _pl_t_kermit_stdcolors[i].blue == 0xff) /* white is a possible quantization only for white itself (our convention) */ { if (red == 0xff && green == 0xff && blue == 0xff) { difference = 0; best = i; } continue; } newdifference = (((_pl_t_kermit_stdcolors[i].red - red) * (_pl_t_kermit_stdcolors[i].red - red)) + ((_pl_t_kermit_stdcolors[i].green - green) * (_pl_t_kermit_stdcolors[i].green - green)) + ((_pl_t_kermit_stdcolors[i].blue - blue) * (_pl_t_kermit_stdcolors[i].blue - blue))); if (newdifference < difference) { difference = newdifference; best = i; } } return best; } plotutils-2.6/libplot/t_color2.c0000644000175000017500000000640611037243262013703 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The 16 standard colors (ANSI, ISO 6429) supported by the Tektronix mode of MS-DOS Kermit. (Reportedly `color xterm' supports them too, but maybe not in Tektronix emulation mode?) It includes the 8 standard colors (vertices of the RGB cube). It also includes an intermediate brightness for each of the 6 colors other than black and white, and two intermediate brightnesses for white (i.e., two shades of gray intermediate between black and white). The two shades of gray are the only colors in the interior of the cube. */ #include "sys-defines.h" #include "extern.h" const plColor _pl_t_kermit_stdcolors[TEK_NUM_ANSI_SYS_COLORS] = { {0x00, 0x00, 0x00}, /* black */ {0x8b, 0x00, 0x00}, /* red4 */ {0x00, 0x8b, 0x00}, /* green4 */ {0x8b, 0x8b, 0x00}, /* yellow4 */ {0x00, 0x00, 0x8b}, /* blue4 */ {0x8b, 0x00, 0x8b}, /* magenta4 */ {0x00, 0x8b, 0x8b}, /* cyan4 */ {0x8b, 0x8b, 0x8b}, /* gray55 */ {0x4d, 0x4d, 0x4d}, /* gray30 */ {0xff, 0x00, 0x00}, /* red */ {0x00, 0xff, 0x00}, /* green */ {0xff, 0xff, 0x00}, /* yellow */ {0x00, 0x00, 0xff}, /* blue */ {0xff, 0x00, 0xff}, /* magenta */ {0x00, 0xff, 0xff}, /* cyan */ {0xff, 0xff, 0xff} /* white */ }; /* Ordering of these two lists of ANSI escape sequences must match the above. */ const char * const _pl_t_kermit_fgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS] = { "\033[0;30m", /* black */ "\033[0;31m", /* red4 */ "\033[0;32m", /* green4 */ "\033[0;33m", /* yellow4 */ "\033[0;34m", /* blue4 */ "\033[0;35m", /* magenta4 */ "\033[0;36m", /* cyan4 */ "\033[0;37m", /* gray55 */ "\033[1;30m", /* gray30 */ "\033[1;31m", /* red */ "\033[1;32m", /* green */ "\033[1;33m", /* yellow */ "\033[1;34m", /* blue */ "\033[1;35m", /* magenta */ "\033[1;36m", /* cyan */ "\033[1;37m" /* white */ }; const char * const _pl_t_kermit_bgcolor_escapes[TEK_NUM_ANSI_SYS_COLORS] = { "\033[0;40m", /* black */ "\033[0;41m", /* red4 */ "\033[0;42m", /* green4 */ "\033[0;43m", /* yellow4 */ "\033[0;44m", /* blue4 */ "\033[0;45m", /* magenta4 */ "\033[0;46m", /* cyan4 */ "\033[0;47m", /* gray55 */ "\033[1;40m", /* gray30 */ "\033[1;41m", /* red */ "\033[1;42m", /* green */ "\033[1;43m", /* yellow */ "\033[1;44m", /* blue */ "\033[1;45m", /* magenta */ "\033[1;46m", /* cyan */ "\033[1;47m" /* white */ }; plotutils-2.6/libplot/t_defplot.c0000644000175000017500000002126511037243262014140 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any TekPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ /* Note that Tektronix displays are rectangular, and wider than they are high: the aspect ratio is approximately 4:3. In terms of integer Tektronix coordinates the Tektronix display is a [0..4095]x[0..3119] rectangle, and we choose our viewport to be the square [488..3607]x[0..3119]. I.e. we define it to be a square, occupying the entire height of the display, and centered on the display. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a TekPlotter struct. */ const Plotter _pl_t_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_t_initialize, _pl_t_terminate, /* page manipulation */ _pl_t_begin_page, _pl_t_erase_page, _pl_t_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_g_paint_path, _pl_g_paint_paths, _pl_t_path_is_flushable, _pl_t_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_t_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_t_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_TEK; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 0; _plotter->data->have_dash_array = 0; _plotter->data->have_solid_fill = 0; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 0; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 0; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_HERSHEY; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal) */ _plotter->data->max_unfilled_path_length = PL_MAX_UNFILLED_PATH_LENGTH; _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_NONE; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_NONE; _plotter->data->allowed_circle_scaling = AS_NONE; _plotter->data->allowed_ellipse_scaling = AS_NONE; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI; _plotter->data->flipped_y = false; _plotter->data->imin = 488; _plotter->data->imax = 3607; _plotter->data->jmin = 0; _plotter->data->jmax = 3119; _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* initialize data members specific to this derived class */ _plotter->tek_display_type = TEK_DPY_GENERIC; _plotter->tek_mode = TEK_MODE_ALPHA; _plotter->tek_line_type = PL_L_SOLID; _plotter->tek_mode_is_unknown = true; _plotter->tek_line_type_is_unknown = true; _plotter->tek_kermit_fgcolor = -1; /* nonsensical value; means `unknown' */ _plotter->tek_kermit_bgcolor = -1; /* same */ _plotter->tek_position_is_unknown = true; _plotter->tek_pos.x = 0; _plotter->tek_pos.y = 0; /* initialize certain data members from device driver parameters */ /* determine Tek display type (xterm(1) / kermit(1) / generic Tektronix); there are so many possible termcap/terminfo names out there that we key only on an initial substring */ { const char* term_type; term_type = (const char *)_get_plot_param (_plotter->data, "TERM"); if (term_type != NULL) { if (strncmp (term_type, "xterm", 5) == 0 || strncmp (term_type, "nxterm", 6) == 0 || strncmp (term_type, "kterm", 5) == 0) _plotter->tek_display_type = TEK_DPY_XTERM; else if (strncmp (term_type, "ansi.sys", 8) == 0 || strncmp (term_type, "nansi.sys", 9) == 0 || strncmp (term_type, "ansisys", 7) == 0 /* undocumented */ || strncmp (term_type, "kermit", 6) == 0) _plotter->tek_display_type = TEK_DPY_KERMIT; else _plotter->tek_display_type = TEK_DPY_GENERIC; } else _plotter->tek_display_type = TEK_DPY_GENERIC; /* default value */ } } /* The private `terminate' method, which is invoked when a Plotter is deleted, provided that it is non-NULL. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_t_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER TekPlotter::TekPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_t_initialize (); } TekPlotter::TekPlotter (FILE *outfile) :Plotter (outfile) { _pl_t_initialize (); } TekPlotter::TekPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_t_initialize (); } TekPlotter::TekPlotter (ostream& out) : Plotter (out) { _pl_t_initialize (); } TekPlotter::TekPlotter () { _pl_t_initialize (); } TekPlotter::TekPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_t_initialize (); } TekPlotter::TekPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_t_initialize (); } TekPlotter::TekPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_t_initialize (); } TekPlotter::TekPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_t_initialize (); } TekPlotter::TekPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_t_initialize (); } TekPlotter::~TekPlotter () { _pl_t_terminate (); } #endif plotutils-2.6/libplot/t_erase.c0000644000175000017500000000314511037243262013577 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_t_erase_page (S___(Plotter *_plotter)) { /* erase: emit ESC C-l, i.e. ^[^l */ _write_string (_plotter->data, "\033\014"); _plotter->tek_mode = TEK_MODE_ALPHA; /* erasing enters alpha mode */ /* Note: kermit Tek emulator, on seeing ESC C-l , seems to enter graphics mode, not alpha mode. Maybe we should specify TEK_MODE_PLOT above, instead of TEK_MODE_ALPHA? The above won't hurt though, because we don't use TEK_MODE_ALPHA anyway (we'll have to switch away from it). */ /* set background color (a no-op unless we're writing to a kermit Tektronix emulator, see t_color.c) */ _pl_t_set_bg_color (S___(_plotter)); return true; } plotutils-2.6/libplot/t_openpl.c0000644000175000017500000000263411037243262013777 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This version is for Tek Plotters. We emit terminal initialization codes, depending on the Tektronix type. */ #include "sys-defines.h" #include "extern.h" bool _pl_t_begin_page (S___(Plotter *_plotter)) { /* send graphics initialization commands to output stream if necessary */ if (_plotter->tek_display_type == TEK_DPY_XTERM || _plotter->tek_display_type == TEK_DPY_KERMIT) /* VT340 command, put xterm / kermit into Tek mode */ _write_string (_plotter->data, "\033[?38h"); return true; } plotutils-2.6/libplot/t_path.c0000644000175000017500000001727611037243262013446 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal path_is_flushable() method, which is invoked after any path segment is added to the segment list, provided (0) the segment list has become greater than or equal to the `max_unfilled_path_length' Plotter parameter, (1) the path isn't to be filled. In most Plotters, this operation simply returns true. */ /* This file also contains the internal maybe_prepaint_segments() method. It is called immediately after any segment is added to a path. Some Plotters, at least under some circumstances, treat endpath() as a no-op. Instead, they plot the segments of a path in real time. */ /**********************************************************************/ /* This version of the internal method path_is_flushable() is for Tektronix Plotters, which (1) reduce all paths to line segments as they are constructed, and (2) plot the resulting line segments ("vectors") in real time. Unlike the generic version, which returns true, this version returns false. */ #include "sys-defines.h" #include "extern.h" bool _pl_t_path_is_flushable (S___(Plotter *_plotter)) { return false; } /**********************************************************************/ /* This version of the internal method maybe_prepaint_segments() is for Tektronix Plotters, which (1) reduce all paths to line segments as they are constructed, and (2) plot the resulting line segments ("vectors") in real time. This is what does all the painting of line segments on a Tektronix display. */ /* for Cohen-Sutherland clipper, see g_clipper.c */ enum { ACCEPTED = 0x1, CLIPPED_FIRST = 0x2, CLIPPED_SECOND = 0x4 }; void _pl_t_maybe_prepaint_segments (R___(Plotter *_plotter) int prev_num_segments) { int i; /* sanity check */ if (_plotter->drawstate->path->num_segments < 2) return; if (_plotter->drawstate->path->num_segments == prev_num_segments) /* nothing to paint */ return; /* skip drawing if pen level is set to `0' */ if (_plotter->drawstate->pen_type == 0) return; /* Skip drawing if the pen color is white. Since our TekPlotter class doesn't support filling, this is ok to do if the Tektronix isn't a kermit emulator (the kermit emulator supports color). */ if (_plotter->tek_display_type != TEK_DPY_KERMIT && _plotter->drawstate->fgcolor.red == 0xffff && _plotter->drawstate->fgcolor.green == 0xffff && _plotter->drawstate->fgcolor.blue == 0xffff) return; /* iterate over all new segments, i.e. segments to be painted */ for (i = IMAX(1, prev_num_segments); i < _plotter->drawstate->path->num_segments; i++) { plPoint start, end; /* endpoints of line seg. (in device coors) */ plIntPoint istart, iend; /* same, quantized to integer Tek coors */ int clipval; bool same_point, force; /* nominal starting point and ending point for new line segment, in floating point device coordinates */ start.x = XD(_plotter->drawstate->path->segments[i-1].p.x, _plotter->drawstate->path->segments[i-1].p.y); start.y = YD(_plotter->drawstate->path->segments[i-1].p.x, _plotter->drawstate->path->segments[i-1].p.y); end.x = XD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); end.y = YD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); same_point = (start.x == end.x && start.y == end.y) ? true : false; /* clip line segment to rectangular clipping region in device frame */ clipval = _clip_line (&start.x, &start.y, &end.x, &end.y, TEK_DEVICE_X_MIN_CLIP, TEK_DEVICE_X_MAX_CLIP, TEK_DEVICE_Y_MIN_CLIP, TEK_DEVICE_Y_MAX_CLIP); if (!(clipval & ACCEPTED)) /* line segment is OOB */ continue; /* convert clipped starting point, ending point to integer Tek coors */ istart.x = IROUND(start.x); istart.y = IROUND(start.y); iend.x = IROUND(end.x); iend.y = IROUND(end.y); if (i == 1) /* New polyline is beginning, so start to draw it on the display: move to starting point of the first line segment, in Tek space. As a side-effect, the escape sequence emitted by _pl_t_tek_move() will shift the Tektronix to the desired mode, either PLOT or POINT. Note that if we are already in the desired mode, emitting the escape sequence will prevent a line being drawn at the time of the move (the "dark vector" concept). That is of course what we want. */ _pl_t_tek_move (R___(_plotter) istart.x, istart.y); else /* A polyline is underway, >=1 line segments already. So check whether the position on the Tektronix is the same as the starting point of the new line segment; if it differs, move to the latter. Such a difference can occur on account of clipping. Also the Tektronix position could have changed on us if a savestate()...restorestate() occurred since the last call to cont(). */ { int correct_tek_mode = _plotter->drawstate->points_are_connected ? TEK_MODE_PLOT : TEK_MODE_POINT; if (_plotter->tek_position_is_unknown || _plotter->tek_pos.x != istart.x || _plotter->tek_pos.y != istart.y || _plotter->tek_mode_is_unknown || _plotter->tek_mode != correct_tek_mode) /* Move to desired position. This automatically shifts the Tektronix to correct mode, PLOT or POINT; see comment above. */ _pl_t_tek_move (R___(_plotter) istart.x, istart.y); } /* Sync Tek's linestyle with ours; an escape sequence is emitted only if necessary. Linestyle could have changed on us if a savestate()...restorestate() occurred since the last call to cont(). Sync Tek's color and background color too (significant only for kermit Tek emulator). */ _pl_t_set_attributes (S___(_plotter)); _pl_t_set_pen_color (S___(_plotter)); _pl_t_set_bg_color (S___(_plotter)); /* If this is initial line segment of a polyline, force output of a vector even if line segment has zero length, so that something visible will appear on the display. We do this only if (1) the line segment in the user frame was of nonzero length, or (2) it was of zero length but the cap mode is "round". This more or less agrees with our convention, on bitmap Plotters (X, PNM, GIF, etc.), for dealing with device-frame vectors that are of (quantized) zero length. */ if (i == 1 && (same_point == false || (same_point == true && _plotter->drawstate->cap_type == PL_CAP_ROUND))) force = true; else force = false; /* continue polyline by drawing vector on Tek display */ _pl_t_tek_vector_compressed (R___(_plotter) iend.x, iend.y, istart.x, istart.y, force); /* update our notion of Tek's notion of position */ _plotter->tek_pos.x = iend.x; _plotter->tek_pos.y = iend.y; } } plotutils-2.6/libplot/t_point.c0000644000175000017500000000536111037243262013633 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ /* TekPlotter objects display a point as a zero-length line segment. */ #include "sys-defines.h" #include "extern.h" void _pl_t_paint_point (S___(Plotter *_plotter)) { double xx, yy; int ixx, iyy; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* convert point to floating-point device coordinates */ xx = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); yy = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); /* do nothing if point is outside device clipping rectangle */ if ((xx < TEK_DEVICE_X_MIN_CLIP) || (xx > TEK_DEVICE_X_MAX_CLIP) || (yy < TEK_DEVICE_Y_MIN_CLIP) || (yy > TEK_DEVICE_Y_MAX_CLIP)) return; /* round to integer device (Tektronix) coordinates */ ixx = IROUND(xx); iyy = IROUND(yy); /* emit an escape sequence if necessary, to switch to POINT mode */ _pl_t_tek_mode (R___(_plotter) TEK_MODE_POINT); /* sync Tek's color too (significant only for kermit Tek emulator) */ _pl_t_set_pen_color (S___(_plotter)); /* Output the point. If in fact we were already in POINT mode, this is slightly suboptimal because we can't call _pl_t_tek_vector_compressed() to save (potentially) a few bytes, because we don't know what the last-plotted point was. Unlike when incrementally drawing a polyline, when plotting points we don't keep track of "where we last were". */ _pl_t_tek_vector (R___(_plotter) ixx, iyy); /* update our notion of Tek's notion of position */ _plotter->tek_pos.x = ixx; _plotter->tek_pos.y = iyy; } } plotutils-2.6/libplot/t_tek_md.c0000644000175000017500000001267511037243262013753 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains a low-level routine for shifting a Tektronix graphics device to a specified display mode, by emitting an escape sequence if necessary. */ /* Basic Tektronix modes are alpha mode (for drawing alphanumeric characters in any of four character sizes), ``graph mode'' i.e. vector plot mode (for drawing line segments), and GIN (graphics input) mode, which requests a cursor location from the user. The EGM (enhanced graphics module), besides increasing the addressable point from 0..1023 x 0..1023 to 0..4095 x 0..4095, added three additional modes: point plot mode, special point plot mode, and incremental plot mode. Switching among the three basic modes is accomplished thus: US, CR, or ESC FF: enter alpha mode (CR repositions cursor to left edge, and ESC FF homes it) GS: enter graph mode ESC ENQ: enquire cursor location (works in both alpha, graph mode), i.e. temporarily enter GIN mode and back out. In alpha mode cursor location is lower left corner of flickerint 8x9 cursor. ESC SUB: enter GIN mode, turn on positionable crosshair cursor and send address in response to ESC ENQ. Thumbwheels (potentiometers located on the keyboard) were used for positioning. Getting back to alpha / graph mode from GIN is complicated; it's best to send a US or GS to ensure this happens. A genuine 4014 doesn't normally plot the first vector drawn after graph mode is entered via GS (it's ``dark vector''). To get it plotted, you need to issue a BEL, VT, HT, LF, CR or BS immediately after issuing the GS. Only the first of these (BEL) won't disturb the location of the graphics cursor. If the EGM is present, we also have: FS: enter point plot mode RS: enter incremental mode ESC FS: enter special point plot mode Point plot commands are identical to vector plot commands (the endpoint of the vector is drawn). Incremental plot mode allows motion by one unit in any of 8 directions, on receipt of a single byte. First byte after RS must be a beam-off or beam-on command. In special point plot mode, the byte after the ESC FS (and the byte which precedes every point address thereafter) is interpreted as an intensity character, which determines the on-time of the beam. It is loaded into an intensity register. This allows control of the dot size (focused vs. unfocused), and brightness, in any of these three new modes. The user can also control the trichotomy normal z-axis (i.e. focused beam) / defocused z-axis (i.e. defocused beam) / write-thru mode (see tek2plot.c for the control codes used for this). Write-thru simply means that written data, whether alpha characters or vectors, are written to screen but are not refreshed. So they appear briefly and then vanish (unless they are refreshed under user control, by drawing them repeatedly). WARNING: it is a peculiarity of the 4014 that in the following list, one can mode-switch only _downward_, not upward! The exception is that one can always switch up to alpha mode. alpha mode vector mode point plot mode special point plot mode incremental plot mode. Control codes that would switch `upward' are ignored. GIN mode can be switched into from any mode, however. */ #include "sys-defines.h" #include "extern.h" void _pl_t_tek_mode(R___(Plotter *_plotter) int newmode) { if (_plotter->tek_mode_is_unknown || _plotter->tek_mode != newmode) /* need to emit escape sequence */ { switch (newmode) { case TEK_MODE_ALPHA: /* ASCII US, i.e. ^_ (enter alpha mode) */ _write_byte (_plotter->data, '\037'); break; case TEK_MODE_PLOT: if ((_plotter->tek_mode_is_unknown) || (_plotter->tek_mode == TEK_MODE_POINT) || (_plotter->tek_mode == TEK_MODE_INCREMENTAL)) /* ASCII US, i.e. ^_ (enter alpha) */ _write_byte (_plotter->data, '\037'); /* ASCII GS, i.e. ^] (enter vector mode)*/ _write_byte (_plotter->data, '\035'); break; case TEK_MODE_POINT: if ((_plotter->tek_mode_is_unknown) || (_plotter->tek_mode == TEK_MODE_INCREMENTAL)) /* ASCII US, i.e. ^_ (enter alpha) */ _write_byte (_plotter->data, '\037'); /* ASCII FS, i.e. ^\ (enter point mode) */ _write_byte (_plotter->data, '\034'); break; case TEK_MODE_INCREMENTAL: /* ASCII RS, i.e. ^^ (enter incplot mode)*/ _write_byte (_plotter->data, '\036'); break; default: break; } /* Tektronix is now in specified internal state */ _plotter->tek_mode = newmode; _plotter->tek_mode_is_unknown = false; } } plotutils-2.6/libplot/t_tek_mv.c0000644000175000017500000000477111037243262013773 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains a low-level routine for repositioning the graphics cursor on a Tektronix display, by emitting an escape sequence. The reposition command automatically knocks the Tektronix into a non-alpha mode. We choose either PLOT or POINT mode, depending on whether the polyline we're drawing is connected, or is simply a set of disconnected points. That information is stored in our drawing state. If we are already in PLOT/POINT mode, emitting the escape sequence will prevent a line being drawn at the time of the move (the "dark vector" concept). That is just what we want. */ #include "sys-defines.h" #include "extern.h" void _pl_t_tek_move (R___(Plotter *_plotter) int xx, int yy) { int correct_tek_mode = _plotter->drawstate->points_are_connected ? TEK_MODE_PLOT : TEK_MODE_POINT; switch (correct_tek_mode) { case TEK_MODE_POINT: /* ASCII FS, i.e. ^\ (enter POINT mode)*/ _write_byte (_plotter->data, '\034'); break; case TEK_MODE_PLOT: /* ASCII GS, i.e. ^] (enter PLOT mode) */ _write_byte (_plotter->data, '\035'); break; default: /* shouldn't happen */ return; } /* output location to the Tektronix */ _pl_t_tek_vector (R___(_plotter) xx, yy); /* Tek position is now correct */ _plotter->tek_pos.x = xx; _plotter->tek_pos.y = yy; _plotter->tek_position_is_unknown = false; /* Tek is now in correct mode for plotting vectors */ _plotter->tek_mode_is_unknown = false; _plotter->tek_mode = correct_tek_mode; /* re-emphasize: on return we'll be in either PLOT or POINT mode. */ return; } plotutils-2.6/libplot/t_tek_vec.c0000644000175000017500000001517711037243262014130 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the low-level _pl_t_tek_vector() method, which takes two integer arguments and writes them, in the format used by a Tektronix 4014 terminal for addresses while in vector or point-plot mode, to a specified output stream. It is called by several TekPlotter methods. Original Tek 4014 resolution was 1024 by 1024, with 1024 by 780 displayable, i.e. 0x400 by 0x30c. Extended (EGM) resolution, supported by 4014's with the Enhanced Graphics Module, is four times that: 4096 by 3120. This is the resolution of the xterm Tektronix emulator. With EGM, have an allowed range of 12 bits (0 <= x,y <=4095). A Tek code for a point address (x,y) consists of a sequence of bytes: [Hi_Y] [EGM] [Lo_Y] [Hi_X] Lo_X. Since the EGM byte was added later, to improve resolution, it contains the lowest 2 bits of each of the X and Y bytes, packed into the lowest four bits of the byte. The remaining 10 bits are subdivided as follows among the remaining four code bytes. Lo=lowest 5 of the 10 bits, Hi=highest 5 of the 10 bits, all packed into the lowest 5 bits of the byte. Code bytes are distinguished from each other by the pattern of the high three bits. (Hi_Y = ?01, EGM = ?11, Lo_Y = ?11, Hi_X = ?01, Lo_X = ?10, where ? is ignored [or should be].) If EGM is included then Lo_Y must be included to prevent ambiguity. Also if Hi_X is included then Lo_Y must be included. If a byte is omitted, then its value defaults to the value of the corresponding byte in the most recently received point. The exception is the EGM byte; if omitted, it defaults to zero. Warning: some emulators, the xterm emulator in particular, get this scheme wrong. The xterm emulator will behave unpredicably if Lo_Y is omitted. And if EGM is omitted, its value (as far as the xterm emulator goes) is not zero, but is equal to the value of the EGM byte in the most recently received point. */ #include "sys-defines.h" #include "extern.h" #define FIVEBITS 0x1F #define TWOBITS 0x03 /* a dollar and six bits for a haircut... */ void _pl_t_tek_vector (R___(Plotter *_plotter) int xx, int yy) { unsigned char xx_high, yy_high; unsigned char xx_low, yy_low; unsigned char xx_topsig, yy_topsig; unsigned char egm; unsigned char byte_buf[5]; int num_bytes = 0; #ifdef NO_WRAP /* could completely restrict to box */ if (xx < 0) xx = 0; if (yy < 0) yy = 0; #endif xx_high = (xx>>7) & FIVEBITS; /* bits 11 through 7 of xx */ yy_high = (yy>>7) & FIVEBITS; /* bits 11 through 7 of yy */ xx_low = (xx>>2) & FIVEBITS; /* bits 6 through 2 of xx */ yy_low = (yy>>2) & FIVEBITS; /* bits 6 through 2 of yy */ xx_topsig = xx & TWOBITS; /* bits 1 through 0 of xx */ yy_topsig = yy & TWOBITS; /* bits 1 through 0 of yy */ egm = (yy_topsig<<2) + xx_topsig; /* The bit patterns 0x20, 0x40, 0x60 are magic */ byte_buf[num_bytes++] = yy_high | 0x20; /* bits 5 through 9 of yy */ #ifdef CAN_OMIT_EGM if (egm) #endif byte_buf[num_bytes++] = egm | 0x60; byte_buf[num_bytes++] = yy_low | 0x60; /* bits 0 through 4 of yy */ byte_buf[num_bytes++] = xx_high | 0x20; /* bits 5 through 9 of xx */ byte_buf[num_bytes++] = xx_low | 0x40; /* bits 0 through 4 of xx */ /* invoke low-level output routine */ _write_bytes (_plotter->data, num_bytes, byte_buf); return; } /* This version checks whether the supplied x and y coordinates are similar to the x and y coordinates of another point, presumed to be the most recently output point. If they are, the Tek code is shortened by the omission of optional bytes. Hi_Y, Lo_Y and Hi_X are all held in memory, so need not be transmitted if they did not change. Lo_X must always be transmitted. EGM is not held in memory; if not transmitted, it defaults to zero. The `force' argument will force output even if the vector has zero length. */ void _pl_t_tek_vector_compressed (R___(Plotter *_plotter) int xx, int yy, int oldxx, int oldyy, bool force) { unsigned char xx_high, yy_high, oldxx_high, oldyy_high; unsigned char xx_low, yy_low, oldyy_low; unsigned char xx_top, yy_top; unsigned char egm; unsigned char byte_buf[5]; int num_bytes = 0; #ifdef NO_WRAP /* could completely restrict to box */ if (xx < 0) xx = 0; if (yy < 0) yy = 0; #endif /* if line segment has zero length, do nothing unless forcing an output */ if (!force && (xx == oldxx) && (yy == oldyy)) return; xx_high = (xx>>7) & FIVEBITS; /* bits 11 through 7 of xx */ yy_high = (yy>>7) & FIVEBITS; /* bits 11 through 7 of yy */ oldxx_high = (oldxx>>7) & FIVEBITS; /* bits 11 through 7 of oldxx */ oldyy_high = (oldyy>>7) & FIVEBITS; /* bits 11 through 7 of oldyy */ xx_low = (xx>>2) & FIVEBITS; /* bits 6 through 2 of xx */ yy_low = (yy>>2) & FIVEBITS; /* bits 6 through 2 of yy */ oldyy_low = (oldyy>>2) & FIVEBITS; /* bits 4 through 0 of oldyy */ xx_top = xx & TWOBITS; /* bits 1 through 0 of xx */ yy_top = yy & TWOBITS; /* bits 1 through 0 of yy */ egm = (yy_top<<2) + xx_top; /* The bit patterns 0x20, 0x40, 0x60 are magic */ if (yy_high != oldyy_high) byte_buf[num_bytes++] = yy_high | 0x20; /* bits 11 through 7 of yy: Hi_Y */ #ifdef CAN_OMIT_EGM if (egm) #endif byte_buf[num_bytes++] = egm | 0x60; /* bits 1 through 0 of xx and yy */ #ifdef CAN_OMIT_LO_Y if ((yy_low != oldyy_low) || (xx_high != oldxx_high) || egm) #endif byte_buf[num_bytes++] = yy_low | 0x60; /* bits 6 through 2 of yy: Lo_Y */ if (xx_high != oldxx_high) byte_buf[num_bytes++] = xx_high | 0x20; /* bits 11 through 7 of xx: Hi_X */ byte_buf[num_bytes++] = xx_low | 0x40; /* bits 6 through 2 of xx: Lo_X */ /* invoke low-level output routine */ _write_bytes (_plotter->data, num_bytes, byte_buf); return; } plotutils-2.6/libplot/r_attribs.c0000644000175000017500000000421511037243261014144 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This internal method is invoked before drawing any polyline. It sets the relevant attributes of a ReGIS display to what they should be. */ #include "sys-defines.h" #include "extern.h" /* ReGIS 8-bit `patterns', i.e., line types, indexed into by our internal line style number (PL_L_SOLID/PL_L_DOTTED/ PL_L_DOTDASHED/PL_L_SHORTDASHED/PL_L_LONGDASHED/PL_L_DOTDOTDASHED/PL_L_DOTDOTDOTDASHED). ReGIS supports standard patterns P0..P9, and user-specified patterns made up of 2 to 8 bits. If fewer than 8 bits are supplied, ReGIS repeats as much of the pattern as possible in what remains of the 8-bit segment. Standard pattern P1 is solid. */ static const char * const regis_line_types[PL_NUM_LINE_TYPES] = { "P1", "P1000", "P11100100", "P11110000", "P11111100", "P11101010", "P10" }; void _pl_r_set_attributes (S___(Plotter *_plotter)) { if (_plotter->regis_line_type_is_unknown || _plotter->regis_line_type != _plotter->drawstate->line_type) { char tmpbuf[32]; sprintf (tmpbuf, "W(%s)\n", regis_line_types[_plotter->drawstate->line_type]); _write_string (_plotter->data, tmpbuf); _plotter->regis_line_type_is_unknown = false; _plotter->regis_line_type = _plotter->drawstate->line_type; } } plotutils-2.6/libplot/r_closepl.c0000644000175000017500000000233511037243261014136 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_r_end_page (S___(Plotter *_plotter)) { /* leave ReGIS graphics mode */ _write_string (_plotter->data, "\033\\"); /* move terminal cursor to first line of screen, to keep from obstructing graphics */ _write_string (_plotter->data, "\033[1;1H"); return true; } plotutils-2.6/libplot/r_color.c0000644000175000017500000001013711037243261013612 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #define ONEBYTE 0xff #define REGIS_NUM_STD_COLORS 8 /* standard ReGIS colors */ static const plColor regis_stdcolors[REGIS_NUM_STD_COLORS] = { {0xff, 0x00, 0x00}, /* Red */ {0x00, 0xff, 0x00}, /* Green */ {0x00, 0x00, 0xff}, /* Blue */ {0x00, 0xff, 0xff}, /* Cyan */ {0xff, 0x00, 0xff}, /* Magenta */ {0xff, 0xff, 0x00}, /* Yellow */ {0x00, 0x00, 0x00}, /* Black */ {0xff, 0xff, 0xff} /* White */ }; /* corresponding one-letter abbreviations (in same order as preceding) */ static const char regis_color_chars[REGIS_NUM_STD_COLORS] = { 'r', 'g', 'b', 'c', 'm', 'y', 'd', 'w' }; /* forward references */ static int rgb_to_best_stdcolor (plColor rgb); void _pl_r_set_pen_color(S___(Plotter *_plotter)) { int new_color; new_color = rgb_to_best_stdcolor (_plotter->drawstate->fgcolor); if (_plotter->regis_fgcolor_is_unknown || _plotter->regis_fgcolor != new_color) { char tmpbuf[32]; sprintf (tmpbuf, "W(I(%c))\n", regis_color_chars[new_color]); _write_string (_plotter->data, tmpbuf); _plotter->regis_fgcolor = new_color; _plotter->regis_fgcolor_is_unknown = false; } } void _pl_r_set_fill_color(S___(Plotter *_plotter)) { int new_color; /* sanity check */ if (_plotter->drawstate->fill_type == 0) return; new_color = rgb_to_best_stdcolor (_plotter->drawstate->fillcolor); if (_plotter->regis_fgcolor_is_unknown || _plotter->regis_fgcolor != new_color) { char tmpbuf[32]; sprintf (tmpbuf, "W(I(%c))\n", regis_color_chars[new_color]); _write_string (_plotter->data, tmpbuf); _plotter->regis_fgcolor = new_color; _plotter->regis_fgcolor_is_unknown = false; } } void _pl_r_set_bg_color(S___(Plotter *_plotter)) { int new_color; new_color = rgb_to_best_stdcolor (_plotter->drawstate->bgcolor); if (_plotter->regis_bgcolor_is_unknown || _plotter->regis_bgcolor != new_color) { char tmpbuf[32]; sprintf (tmpbuf, "S(I(%c))\n", regis_color_chars[new_color]); _write_string (_plotter->data, tmpbuf); _plotter->regis_bgcolor = new_color; _plotter->regis_bgcolor_is_unknown = false; /* note: must do an erase, for the just-set background color to show up on the ReGIS display */ } } /* compute best approximation, in color table, to a specified 48-bit color */ static int rgb_to_best_stdcolor (plColor rgb) { int red, green, blue; unsigned long int difference = INT_MAX; int i, best = 0; /* keep compiler happy */ /* convert from 48-bit color to 24-bit */ red = rgb.red; green = rgb.green; blue = rgb.blue; red = (red >> 8) & ONEBYTE; green = (green >> 8) & ONEBYTE; blue = (blue >> 8) & ONEBYTE; for (i = 0; i < REGIS_NUM_STD_COLORS; i++) { unsigned long int newdifference; newdifference = (((regis_stdcolors[i].red - red) * (regis_stdcolors[i].red - red)) + ((regis_stdcolors[i].green - green) * (regis_stdcolors[i].green - green)) + ((regis_stdcolors[i].blue - blue) * (regis_stdcolors[i].blue - blue))); if (newdifference < difference) { difference = newdifference; best = i; } } return best; } plotutils-2.6/libplot/r_defplot.c0000644000175000017500000001761311037243261014137 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any ReGISPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ /* Note that ReGIS displays are rectangular, and wider than they are high. In terms of integer ReGIS coordinates a ReGIS display is a [0..767]x[0..479] rectangle, and we choose our viewport to be the square [144..623]x[0..479]. I.e. we define it to be a square, occupying the entire height of the display, and centered on the display. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a ReGISPlotter struct. */ const Plotter _pl_r_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_r_initialize, _pl_r_terminate, /* page manipulation */ _pl_r_begin_page, _pl_r_erase_page, _pl_r_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_r_paint_path, _pl_r_paint_paths, _pl_r_path_is_flushable, _pl_r_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_r_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_r_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_REGIS; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES_IN_REAL_TIME; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 0; _plotter->data->have_dash_array = 0; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 0; _plotter->data->have_settable_bg = 1; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 0; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_HERSHEY; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal) */ _plotter->data->max_unfilled_path_length = PL_MAX_UNFILLED_PATH_LENGTH; _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_NONE; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_NONE; _plotter->data->allowed_circle_scaling = AS_UNIFORM; _plotter->data->allowed_ellipse_scaling = AS_NONE; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI; _plotter->data->flipped_y = true; _plotter->data->imin = 144; _plotter->data->imax = 623; _plotter->data->jmin = 479; _plotter->data->jmax = 0; /* flipped y */ _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* initialize data members specific to this derived class */ _plotter->regis_pos.x = 0; /* dummy */ _plotter->regis_pos.y = 0; /* dummy */ _plotter->regis_position_is_unknown = true; _plotter->regis_line_type = PL_L_SOLID; /* dummy */ _plotter->regis_line_type_is_unknown = true; _plotter->regis_fgcolor = 0; /* dummy */ _plotter->regis_bgcolor = 0; /* dummy */ _plotter->regis_fgcolor_is_unknown = true; _plotter->regis_bgcolor_is_unknown = true; /* initialize certain data members from device driver parameters */ } /* The private `terminate' method, which is invoked when a Plotter is deleted, provided that it is non-NULL. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_r_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* invoke generic method, e.g. to deallocate instance-specific copies of class variables */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER ReGISPlotter::ReGISPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (FILE *outfile) :Plotter (outfile) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (ostream& out) : Plotter (out) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter () { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_r_initialize (); } ReGISPlotter::ReGISPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_r_initialize (); } ReGISPlotter::~ReGISPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_r_terminate (); } #endif plotutils-2.6/libplot/r_erase.c0000644000175000017500000000233311037243261013572 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_r_erase_page (S___(Plotter *_plotter)) { /* if necessary, update background color in internal ReGIS state */ _pl_r_set_bg_color (S___(_plotter)); /* erase screen (causing background color to show up) */ _write_string (_plotter->data, "S(E)\n"); return true; } plotutils-2.6/libplot/r_openpl.c0000644000175000017500000000304211037243261013766 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This version is for ReGIS Plotters. */ #include "sys-defines.h" #include "extern.h" bool _pl_r_begin_page (S___(Plotter *_plotter)) { /* send graphics initialization commands to output stream */ /* clear terminal screen */ _write_string (_plotter->data, "\033[2J"); /* enter ReGIS graphics */ _write_string (_plotter->data, "\033P1p"); /* turn off graphics cursor */ _write_string (_plotter->data, "S(C0)\n"); /* copy libplot's background color to internal ReGIS state */ _pl_r_set_bg_color (S___(_plotter)); /* erase screen (causing background color to show up) */ _write_string (_plotter->data, "S(E)\n"); return true; } plotutils-2.6/libplot/r_path.c0000644000175000017500000003115111037243261013427 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This file contains the internal path_is_flushable() method, which is invoked after any path segment is added to the segment list, provided (0) the segment list has become greater than or equal to the `max_unfilled_path_length' Plotter parameter, (1) the path isn't to be filled. In most Plotters, this operation simply returns true. */ /* This file also contains the internal maybe_prepaint_segments() method. It is called immediately after any segment is added to a path. Some Plotters, at least under some circumstances, treat endpath() as a no-op. Instead, they plot the segments of a path in real time. */ #include "sys-defines.h" #include "extern.h" /* for Cohen-Sutherland clipper, see g_clipper.c */ enum { ACCEPTED = 0x1, CLIPPED_FIRST = 0x2, CLIPPED_SECOND = 0x4 }; /* forward references */ static void _emit_regis_vector (plIntPoint istart, plIntPoint iend, bool skip_null, char *tmpbuf); void _pl_r_paint_path (S___(Plotter *_plotter)) { char tmpbuf[32]; if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { int i; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /*shouldn't happen */ break; if (_plotter->drawstate->fill_type) /* fill the path */ { bool within_display = true; /* are all juncture points contained within the ReGIS display? */ for (i = 0; i < _plotter->drawstate->path->num_segments; i++) { double x, y; int i_x, i_y; x = XD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); y = YD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); i_x = IROUND(x); i_y = IROUND(y); if (i_x < REGIS_DEVICE_X_MIN || i_x > REGIS_DEVICE_X_MAX || i_y < REGIS_DEVICE_Y_MIN || i_y > REGIS_DEVICE_Y_MAX) { within_display = false; break; } } if (within_display) /* can fill path using ReGIS primitives */ { double x, y; plIntPoint first, oldpoint, newpoint; _pl_r_set_fill_color (S___(_plotter)); x = XD(_plotter->drawstate->path->segments[0].p.x, _plotter->drawstate->path->segments[0].p.y); y = YD(_plotter->drawstate->path->segments[0].p.x, _plotter->drawstate->path->segments[0].p.y); first.x = IROUND(x); first.y = IROUND(y); _pl_r_regis_move (R___(_plotter) first.x, first.y); /* use P[..] */ _write_string (_plotter->data, "F("); _write_string (_plotter->data, "V"); oldpoint = first; for (i = 1; i < _plotter->drawstate->path->num_segments; i++) { x = XD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); y = YD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); newpoint.x = IROUND(x); newpoint.y = IROUND(y); /* emit vector; omit it if it has zero-length in the integer device frame (unless it's the 1st vector) */ _emit_regis_vector (oldpoint, newpoint, i > 1 ? true : false, tmpbuf); _write_string (_plotter->data, tmpbuf); oldpoint = newpoint; } /* if path isn't closed, add a vector to close it (ReGIS behaves unreliably if this isn't done) */ _emit_regis_vector (newpoint, first, true, tmpbuf); _write_string (_plotter->data, tmpbuf); /* terminate F(V..) command */ _write_string (_plotter->data, ")\n"); _plotter->regis_position_is_unknown = true; /* to us */ } else /* path extends beyond ReGIS display, so must clip before filling */ { /* NOT IMPLEMENTED YET */ } } if (_plotter->drawstate->pen_type) /* edge the path */ { bool attributes_set = false; bool path_in_progress = false; for (i = 1; i < _plotter->drawstate->path->num_segments; i++) { plPoint start, end; /* endpoints of seg. (in device coors) */ plIntPoint istart, iend; /* same, quantized to integer */ int clipval; /* nominal starting point and ending point for new line segment, in floating point device coordinates */ start.x = XD(_plotter->drawstate->path->segments[i-1].p.x, _plotter->drawstate->path->segments[i-1].p.y); start.y = YD(_plotter->drawstate->path->segments[i-1].p.x, _plotter->drawstate->path->segments[i-1].p.y); end.x = XD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); end.y = YD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y); /* clip line segment to rectangular clipping region in device frame */ clipval = _clip_line (&start.x, &start.y, &end.x, &end.y, REGIS_DEVICE_X_MIN_CLIP, REGIS_DEVICE_X_MAX_CLIP, REGIS_DEVICE_Y_MIN_CLIP, REGIS_DEVICE_Y_MAX_CLIP); if (!(clipval & ACCEPTED)) /* line segment is OOB */ { if (path_in_progress) /* terminate it */ _write_string (_plotter->data, "\n"); path_in_progress = false; continue; /* drop this line segment */ } if (clipval & CLIPPED_FIRST) /* must move */ { if (path_in_progress) /* terminate it */ _write_string (_plotter->data, "\n"); path_in_progress = false; } /* convert clipped starting point, ending point to integer ReGIS coors */ istart.x = IROUND(start.x); istart.y = IROUND(start.y); iend.x = IROUND(end.x); iend.y = IROUND(end.y); if (path_in_progress && istart.x == iend.x && istart.y == iend.y) /* redundant, so drop this line segment */ continue; if (attributes_set == false) /* will be drawing something, so sync ReGIS line type and set the ReGIS foreground color to be our pen color; this code gets executed the first time we get here */ { _pl_r_set_attributes (S___(_plotter)); _pl_r_set_pen_color (S___(_plotter)); attributes_set = true; } if (path_in_progress == false) { /* if necessary, move graphics cursor to first point of line segment, using P command */ _pl_r_regis_move (R___(_plotter) istart.x, istart.y); /* emit op code for V command, to begin polyline */ _write_string (_plotter->data, "V"); if (iend.x != istart.x || iend.y != istart.y) /* emit V[] command: ensure initial pixel is painted */ _write_string (_plotter->data, "[]"); path_in_progress = true; } _emit_regis_vector (istart, iend, true, tmpbuf); _write_string (_plotter->data, tmpbuf); /* update our notion of ReGIS's notion of position */ _plotter->regis_pos.x = iend.x; _plotter->regis_pos.y = iend.y; } /* entire path has been drawn */ if (path_in_progress == true) _write_string (_plotter->data, "\n"); } } break; case (int)PATH_CIRCLE: { double xd, yd, radius_d; int i_x, i_y, i_radius; /* center and radius, quantized */ plPoint pc; double radius; pc = _plotter->drawstate->path->pc; radius = _plotter->drawstate->path->radius; /* known to be a circle in device frame, so compute center and radius in that frame */ xd = XD(pc.x, pc.y); yd = YD(pc.x, pc.y); radius_d = sqrt (XDV(radius,0) * XDV(radius,0) + YDV(radius,0) * YDV(radius,0)); i_x = IROUND(xd); i_y = IROUND(yd); i_radius = IROUND(radius_d); if (i_x - i_radius < REGIS_DEVICE_X_MIN || i_x + i_radius > REGIS_DEVICE_X_MAX || i_y - i_radius < REGIS_DEVICE_Y_MIN || i_y + i_radius > REGIS_DEVICE_Y_MAX) /* circle extends beyond edge of display, so polygonalize and recurse */ { plPath *oldpath = _plotter->drawstate->path; _plotter->drawstate->path = _flatten_path (oldpath); _plotter->paint_path (S___(_plotter)); /* recursive invocation */ _delete_plPath (_plotter->drawstate->path); _plotter->drawstate->path = oldpath; } else /* circle contained within display, can draw using ReGIS circle primitive */ { if (_plotter->drawstate->fill_type) /* fill the circle */ { _pl_r_set_fill_color (S___(_plotter)); _pl_r_regis_move (R___(_plotter) i_x, i_y); /* use P command */ if (i_radius > 0) { sprintf (tmpbuf, "F(C[+%d])\n", i_radius); _plotter->regis_position_is_unknown = true; /* to us */ } else sprintf (tmpbuf, "V[]\n"); _write_string (_plotter->data, tmpbuf); } if (_plotter->drawstate->pen_type) /* edge the circle */ { _pl_r_set_attributes (S___(_plotter)); _pl_r_set_pen_color (S___(_plotter)); _pl_r_regis_move (R___(_plotter) i_x, i_y); /* use P command */ if (i_radius > 0) { sprintf (tmpbuf, "C[+%d]\n", i_radius); _plotter->regis_position_is_unknown = true; /* to us */ } else sprintf (tmpbuf, "V[]\n"); _write_string (_plotter->data, tmpbuf); } } } break; default: /* shouldn't happen */ break; } } /* A low-level method for moving the graphics cursor of a ReGIS device to agree with the Plotter's notion of what the graphics cursor should be. */ void _pl_r_regis_move (R___(Plotter *_plotter) int xx, int yy) { char tmpbuf[32]; plIntPoint newpoint; /* sanity check */ if (xx < REGIS_DEVICE_X_MIN || xx > REGIS_DEVICE_X_MAX || yy < REGIS_DEVICE_Y_MIN || yy > REGIS_DEVICE_Y_MAX) return; newpoint.x = xx; newpoint.y = yy; if (_plotter->regis_position_is_unknown) { sprintf (tmpbuf, "P[%d,%d]\n", xx, yy); _write_string (_plotter->data, tmpbuf); } else if (xx != _plotter->regis_pos.x || yy != _plotter->regis_pos.y) { _write_string (_plotter->data, "P"); _emit_regis_vector (_plotter->regis_pos, newpoint, false, tmpbuf); _write_string (_plotter->data, tmpbuf); _write_string (_plotter->data, "\n"); } /* update our knowledge of cursor position */ _plotter->regis_position_is_unknown = false; _plotter->regis_pos = newpoint; } static void _emit_regis_vector (plIntPoint istart, plIntPoint iend, bool skip_null, char *tmpbuf) { plIntVector v; bool xneg = false, yneg = false; char xrelbuf[32], yrelbuf[32], xbuf[32], ybuf[32]; int xrellen, yrellen, xlen, ylen; char *x, *y; v.x = iend.x - istart.x; v.y = iend.y - istart.y; /* trivial case */ if (v.x == 0 && v.y == 0) { if (skip_null == false) sprintf (tmpbuf, "[]"); else *tmpbuf = '\0'; /* empty string */ return; } /* compute length of endpoint in terms of characters, when printed in relative and absolute coordinates */ if (v.x < 0) { xneg = true; v.x = -v.x; } if (v.y < 0) { yneg = true; v.y = -v.y; } sprintf (xrelbuf, "%s%d", (xneg ? "-" : "+"), v.x); xrellen = strlen (xrelbuf); sprintf (yrelbuf, "%s%d", (yneg ? "-" : "+"), v.y); yrellen = strlen (yrelbuf); sprintf (xbuf, "%d", iend.x); xlen = strlen (xbuf); sprintf (ybuf, "%d", iend.y); ylen = strlen (ybuf); /* use whichever (relative/absolute) is shorter; prefer relative */ x = (xrellen <= xlen ? xrelbuf : xbuf); y = (yrellen <= ylen ? yrelbuf : ybuf); /* draw vector: emit point coordinates */ if (v.x == 0) sprintf (tmpbuf, "[,%s]", y); else if (v.y == 0) sprintf (tmpbuf, "[%s]", x); else sprintf (tmpbuf, "[%s,%s]", x, y); } bool _pl_r_paint_paths (S___(Plotter *_plotter)) { return false; } bool _pl_r_path_is_flushable (S___(Plotter *_plotter)) { return true; } void _pl_r_maybe_prepaint_segments (R___(Plotter *_plotter) int prev_num_segments) { } plotutils-2.6/libplot/r_point.c0000644000175000017500000000442411037243261013627 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ #include "sys-defines.h" #include "extern.h" void _pl_r_paint_point (S___(Plotter *_plotter)) { double xx, yy; int ixx, iyy; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* convert point to floating-point device coordinates */ xx = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); yy = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); /* do nothing if point is outside device clipping rectangle */ if ((xx < REGIS_DEVICE_X_MIN_CLIP) || (xx > REGIS_DEVICE_X_MAX_CLIP) || (yy < REGIS_DEVICE_Y_MIN_CLIP) || (yy > REGIS_DEVICE_Y_MAX_CLIP)) return; /* round to integer device (ReGIS) coordinates */ ixx = IROUND(xx); iyy = IROUND(yy); /* sync ReGIS's foreground color to be the same as our pen color */ _pl_r_set_pen_color (S___(_plotter)); /* output the point, as a single pixel */ _pl_r_regis_move (R___(_plotter) ixx, iyy); _write_string (_plotter->data, "V[]\n"); /* update our notion of ReGIS's notion of position */ _plotter->regis_pos.x = ixx; _plotter->regis_pos.y = iyy; } } plotutils-2.6/libplot/h_attribs.c0000644000175000017500000003567611037243261014151 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This internal method is invoked before drawing any path. It sets the relevant attributes of an HP-GL or HP-GL/2 plotter (fill rule, line type, cap type, join type, line width) to what they should be. */ #include "sys-defines.h" #include "extern.h" /* Each dash and gap in our canonical line modes ("shortdashed", "dotdashed") etc. has length that we take to be an integer multiple of the line width. (For the integers, see g_dash2.c). Actually, when performing this computation we impose a floor on the line width (measured in the device frame, in scaled HP-GL coordinates. */ #define MIN_DASH_UNIT (PL_MIN_DASH_UNIT_AS_FRACTION_OF_DISPLAY_SIZE * (HPGL_SCALED_DEVICE_RIGHT - HPGL_SCALED_DEVICE_LEFT)) /* HP-GL's native line types, indexed into by our internal line style number (PL_L_SOLID/PL_L_DOTTED/ PL_L_DOTDASHED/PL_L_SHORTDASHED/PL_L_LONGDASHED/PL_L_DOTDOTDASHED/PL_L_DOTDOTDOTDASHED). We use HP-GL's native line types only if we aren't emitting HP-GL/2, since HP-GL/2 supports programmatic definition of line styles. */ static const int _hpgl_line_type[PL_NUM_LINE_TYPES] = { HPGL_L_SOLID, HPGL_L_DOTTED, HPGL_L_DOTDASHED, HPGL_L_SHORTDASHED, HPGL_L_LONGDASHED, HPGL_L_DOTDOTDASHED, HPGL_L_DOTDOTDOTDASHED }; /* In HP-GL/2, native line type (HP-GL/2 numbering) that will be redefined programmatically as the dashed line style which we'll use. Should not be any of the preceding, and should be in range 1..8. */ #define SPECIAL_HPGL_LINE_TYPE 8 /* HP-GL/2 joinstyles, indexed by internal number(miter/rd./bevel/triangular)*/ static const int _hpgl_join_style[] = { HPGL_JOIN_MITER_BEVEL, HPGL_JOIN_ROUND, HPGL_JOIN_BEVEL, HPGL_JOIN_TRIANGULAR }; /* HP-GL/2 capstyles, indexed by internal number(butt/rd./project/triangular)*/ static const int _hpgl_cap_style[] = { HPGL_CAP_BUTT, HPGL_CAP_ROUND, HPGL_CAP_PROJECT, HPGL_CAP_TRIANGULAR }; #define FUZZ 0.0000001 void _pl_h_set_attributes (S___(Plotter *_plotter)) { double desired_hpgl_pen_width; double width, height, diagonal_p1_p2_distance; /* first, compute desired linewidth in scaled HP-GL coors (i.e. as fraction of diagonal distance between P1,P2) */ width = (double)(HPGL_SCALED_DEVICE_RIGHT - HPGL_SCALED_DEVICE_LEFT); height = (double)(HPGL_SCALED_DEVICE_TOP - HPGL_SCALED_DEVICE_BOTTOM); diagonal_p1_p2_distance = sqrt (width * width + height * height); desired_hpgl_pen_width = _plotter->drawstate->device_line_width / diagonal_p1_p2_distance; /* if plotter's policy on dashing lines needs to be adjusted, do so */ if (_plotter->hpgl_version == 2 && (_plotter->drawstate->dash_array_in_effect || (_plotter->hpgl_line_type != _hpgl_line_type[_plotter->drawstate->line_type]) || (_plotter->hpgl_pen_width != desired_hpgl_pen_width))) /* HP-GL/2 case, and we need to emit HP-GL/2 instructions that define a new line type. Why? Several possibilities: (1) user called linedash(), in which case we always define the line type here, or (2) user called linemod() to change the canonical line style, in which case we need to define a line type here containing the corresponding dash array, or (3) user called linewidth(), in which case we need to define the new line type here because (in the canonical line style case) the dash lengths we'll use depend on the line width. */ { double min_sing_val, max_sing_val; double *dashbuf, dash_cycle_length; int i, num_dashes; /* compute minimum singular value of user->device coordinate map, which we use as a multiplicative factor to convert line widths (cf. g_linewidth.c), dash lengths, etc. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); if (_plotter->drawstate->dash_array_in_effect) /* user invoked linedash() */ { num_dashes = _plotter->drawstate->dash_array_len; if (num_dashes > 0) dashbuf = (double *)_pl_xmalloc (num_dashes * sizeof(double)); else dashbuf = NULL; /* solid line */ dash_cycle_length = 0.0; for (i = 0; i < num_dashes; i++) { /* convert dash length to device coordinates */ dashbuf[i] = min_sing_val * _plotter->drawstate->dash_array[i]; dash_cycle_length += dashbuf[i]; } } else /* have a canonical line type, but since this is HP-GL/2, rather than pre-HP-GL/2 or generic HP-GL, we'll implement it as a user-defined line type for accuracy */ { if (_plotter->drawstate->line_type == PL_L_SOLID) { num_dashes = 0; dash_cycle_length = 0.0; dashbuf = NULL; } else { const int *dash_array; double scale; num_dashes = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array_len; dashbuf = (double *)_pl_xmalloc (num_dashes * sizeof(double)); /* scale the array of integers by line width (actually by floored line width; see comments at head of file) */ dash_array = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array; scale = DMAX(MIN_DASH_UNIT,_plotter->drawstate->device_line_width); dash_cycle_length = 0.0; for (i = 0; i < num_dashes; i++) { dashbuf[i] = scale * dash_array[i]; dash_cycle_length += dashbuf[i]; } } } if (num_dashes == 0 || dash_cycle_length == 0.0) /* just switch to solid line type */ { strcpy (_plotter->data->page->point, "LT;"); _update_buffer (_plotter->data->page); _plotter->hpgl_line_type = HPGL_L_SOLID; } else /* create user-defined line-type, and switch to it */ { bool odd_length = (num_dashes & 1 ? true : false); /* create user-defined line type */ sprintf (_plotter->data->page->point, "UL%d", SPECIAL_HPGL_LINE_TYPE); _update_buffer (_plotter->data->page); for (i = 0; i < num_dashes; i++) { sprintf (_plotter->data->page->point, ",%.3f", /* dash length as frac of iteration interval */ 100.0 * (odd_length ? 0.5 : 1.0) * dashbuf[i] / dash_cycle_length); _update_buffer (_plotter->data->page); } if (odd_length) /* if an odd number of dashes, emit the dash array twice (HP-GL/2 doesn't handle odd-length patterns the way that Postscript does, so an even-length pattern is better) */ { for (i = 0; i < num_dashes; i++) { sprintf (_plotter->data->page->point, ",%.3f", /* dash length as frac of iteration interval */ 100.0 * (odd_length ? 0.5 : 1.0) * dashbuf[i] / dash_cycle_length); _update_buffer (_plotter->data->page); } } sprintf (_plotter->data->page->point, ";"); _update_buffer (_plotter->data->page); /* switch to new line type */ { double width, height, diagonal_p1_p2_distance; double iter_interval; /* specify iteration interval as percentage of P1-P2 distance */ width = (double)(HPGL_SCALED_DEVICE_RIGHT-HPGL_SCALED_DEVICE_LEFT); height = (double)(HPGL_SCALED_DEVICE_TOP-HPGL_SCALED_DEVICE_BOTTOM); diagonal_p1_p2_distance = sqrt (width * width + height * height); iter_interval = 100 * (odd_length ? 2 : 1) * (dash_cycle_length/diagonal_p1_p2_distance); sprintf (_plotter->data->page->point, "LT%d,%.4f;", SPECIAL_HPGL_LINE_TYPE, iter_interval); _update_buffer (_plotter->data->page); if (_plotter->drawstate->dash_array_in_effect) _plotter->hpgl_line_type = SPECIAL_HPGL_LINE_TYPE; else /* keep track of plotter's line type as if it were one of the built-in ones */ _plotter->hpgl_line_type = _hpgl_line_type[_plotter->drawstate->line_type]; } } free (dashbuf); } /* Not HP-GL/2, so the only line types at our disposal are HP-GL's traditional line types. Check whether we need to switch. */ if (_plotter->hpgl_version < 2 && ((_plotter->hpgl_line_type != _hpgl_line_type[_plotter->drawstate->line_type]) || /* special case #1, mapped to "shortdashed" */ (_plotter->drawstate->dash_array_in_effect && _plotter->drawstate->dash_array_len == 2 && (_plotter->drawstate->dash_array[1] == _plotter->drawstate->dash_array[0])) || /* special case #2, mapped to "dotted" */ (_plotter->drawstate->dash_array_in_effect && _plotter->drawstate->dash_array_len == 2 && (_plotter->drawstate->dash_array[1] > (3 - FUZZ) * _plotter->drawstate->dash_array[0]) && (_plotter->drawstate->dash_array[1] < (3 + FUZZ) * _plotter->drawstate->dash_array[0])))) /* switch to one of HP-GL's traditional line types */ { double dash_cycle_length, iter_interval; double min_sing_val, max_sing_val; int line_type; if (_plotter->drawstate->dash_array_in_effect && _plotter->drawstate->dash_array_len == 2 && (_plotter->drawstate->dash_array[1] == _plotter->drawstate->dash_array[0])) /* special case #1, user-specified dashing (equal on/off lengths): treat effectively as "shortdashed" line mode */ { /* Minimum singular value is the nominal device-frame line width divided by the actual user-frame line-width (see g_linewidth.c), so it's the user->device frame conversion factor. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); dash_cycle_length = min_sing_val * 2.0 * _plotter->drawstate->dash_array[0]; line_type = PL_L_SHORTDASHED; } else if (_plotter->drawstate->dash_array_in_effect && _plotter->drawstate->dash_array_len == 2 && (_plotter->drawstate->dash_array[1] > (3 - FUZZ) * _plotter->drawstate->dash_array[0]) && (_plotter->drawstate->dash_array[1] < (3 + FUZZ) * _plotter->drawstate->dash_array[0])) /* special case #2, user-specified dashing (dash on length = 1/4 of cycle length): treat effectively as "dotted" line mode */ { /* Minimum singular value is the nominal device-frame line width divided by the actual user-frame line-width (see g_linewidth.c), so it's the user->device frame conversion factor. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); dash_cycle_length = min_sing_val * 2.0 * 4.0 * _plotter->drawstate->dash_array[0]; line_type = PL_L_DOTTED; } else /* general case: user must have changed canonical line types by invoking linemod(); will implement new line style as one of the traditional HP-GL line types. */ { const int *dash_array; int i, num_dashes; double scale; dash_array = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array; num_dashes = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array_len; /* compute iter interval in device coors, scaling by floored line width (see comments at head of file) */ scale = DMAX(MIN_DASH_UNIT,_plotter->drawstate->device_line_width); if (scale < 1.0) scale = 1.0; dash_cycle_length = 0.0; for (i = 0; i < num_dashes; i++) dash_cycle_length += scale * dash_array[i]; line_type = _plotter->drawstate->line_type; } /* compute iteration interval as percentage of P1-P2 distance */ { double width, height, diagonal_p1_p2_distance; width = (double)(HPGL_SCALED_DEVICE_RIGHT-HPGL_SCALED_DEVICE_LEFT); height = (double)(HPGL_SCALED_DEVICE_TOP-HPGL_SCALED_DEVICE_BOTTOM); diagonal_p1_p2_distance = sqrt (width * width + height * height); iter_interval = 100 * (dash_cycle_length/diagonal_p1_p2_distance); } switch (line_type) { case PL_L_SOLID: /* "solid" */ strcpy (_plotter->data->page->point, "LT;"); break; case PL_L_DOTTED: /* "dotted": emulate dots by selecting shortdashed pattern with a short iteration interval */ sprintf (_plotter->data->page->point, "LT%d,%.4f;", HPGL_L_SHORTDASHED, 0.5 * iter_interval); break; case PL_L_DOTDOTDOTDASHED: /* not a native line type before HP-GL/2; use "dotdotdashed" */ sprintf (_plotter->data->page->point, "LT%d,%.4f;", HPGL_L_DOTDOTDASHED, iter_interval); break; default: sprintf (_plotter->data->page->point, "LT%d,%.4f;", _hpgl_line_type[_plotter->drawstate->line_type], iter_interval); } _update_buffer (_plotter->data->page); _plotter->hpgl_line_type = _hpgl_line_type[_plotter->drawstate->line_type]; } /* if plotter's line attributes don't agree with what they should be, adjust them (HP-GL/2 only) */ if (_plotter->hpgl_version == 2) { if ((_plotter->hpgl_cap_style != _hpgl_cap_style[_plotter->drawstate->cap_type]) || (_plotter->hpgl_join_style != _hpgl_join_style[_plotter->drawstate->join_type])) { sprintf (_plotter->data->page->point, "LA1,%d,2,%d;", _hpgl_cap_style[_plotter->drawstate->cap_type], _hpgl_join_style[_plotter->drawstate->join_type]); _update_buffer (_plotter->data->page); _plotter->hpgl_cap_style = _hpgl_cap_style[_plotter->drawstate->cap_type]; _plotter->hpgl_join_style = _hpgl_join_style[_plotter->drawstate->join_type]; } } /* if plotter's miter limit doesn't agree with what it should be, update it (HP-GL/2 only) */ if (_plotter->hpgl_version == 2 && _plotter->hpgl_miter_limit != _plotter->drawstate->miter_limit) { double new_limit = _plotter->drawstate->miter_limit; int new_limit_integer; if (new_limit > 32767.0) /* clamp */ new_limit = 32767.0; else if (new_limit < 1.0) new_limit = 1.0; new_limit_integer = (int)new_limit; /* floor */ sprintf (_plotter->data->page->point, "LA3,%d;", new_limit_integer); _update_buffer (_plotter->data->page); _plotter->hpgl_miter_limit = _plotter->drawstate->miter_limit; } /* if plotter's pen width doesn't agree with what it should be (i.e. the device-frame version of our line width), update it (HP-GL/2 only) */ if (_plotter->hpgl_version == 2) { if (_plotter->hpgl_pen_width != desired_hpgl_pen_width) { sprintf (_plotter->data->page->point, "PW%.4f;", 100.0 * desired_hpgl_pen_width); _update_buffer (_plotter->data->page); _plotter->hpgl_pen_width = desired_hpgl_pen_width; } } } plotutils-2.6/libplot/h_closepl.c0000644000175000017500000000535311037243261014127 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This version is for both HPGLPlotters and PCLPlotters. For HPGL Plotter objects, we output all plotted objects, which we have saved in a resizable outbuf structure for the current page. An HP-GL or HP-GL/2 prologue and epilogue are included. We then flush the output stream, and reset all datastructures. */ #include "sys-defines.h" #include "extern.h" bool _pl_h_end_page (S___(Plotter *_plotter)) { /* output HP-GL epilogue to page buffer */ if (_plotter->hpgl_pendown == true) /* lift pen */ { sprintf (_plotter->data->page->point, "PU;"); _update_buffer (_plotter->data->page); } /* move to lower left hand corner */ sprintf (_plotter->data->page->point, "PA0,0;"); _update_buffer (_plotter->data->page); /* select pen zero, i.e. return pen to carousel */ if (_plotter->hpgl_pen != 0) { sprintf (_plotter->data->page->point, "SP0;"); _update_buffer (_plotter->data->page); } if (_plotter->hpgl_version >= 1) /* have a `page advance' command, so use it */ { sprintf (_plotter->data->page->point, "PG0;"); _update_buffer (_plotter->data->page); } /* add newline at end */ sprintf (_plotter->data->page->point, "\n"); _update_buffer (_plotter->data->page); /* if a PCL Plotter, switch back from HP-GL/2 mode to PCL mode */ _maybe_switch_from_hpgl (S___(_plotter)); /* set this, so that no drawing on the next page will take place without a pen advance */ _plotter->hpgl_position_is_unknown = true; _plotter->hpgl_pendown = false; /* be on the safe side */ return true; } void _pl_h_maybe_switch_from_hpgl (S___(Plotter *_plotter)) { } void _pl_q_maybe_switch_from_hpgl (S___(Plotter *_plotter)) { /* switch back from HP-GL/2 to PCL 5 mode */ strcpy (_plotter->data->page->point, "\033%0A"); _update_buffer (_plotter->data->page); } plotutils-2.6/libplot/h_color.c0000644000175000017500000007354311037243261013612 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #define ONEBYTE (0xff) #define USE_PEN_ZERO (_plotter->hpgl_version == 2 && (_plotter->hpgl_use_opaque_mode || _plotter->hpgl_can_assign_colors)) /* _h_set_pen_color() sets the pen color used by the HP-GL[/2] device to match the pen color in our current drawing state. It's invoked just before any drawing operation. If the device's palette contains a matching color, the corresponding pen is selected. Otherwise, we do one of several things. 1. If we can add colors to the palette, we add the specified color, and then select the corresponding pen. 2. If we can't add colors to the palette, but we can specify a shading level, i.e., a desaturation level, we find the closest point in the RGB cube to the specified color that's a shaded version of one of the colors in the palette. Then we select it, by both selecting the appropriate pen, and selecting a shading level. There are two subcases to case #2: either the drawing operation to follow this invocation of set_pen_color will draw a path, or it will draw a text string using a font native to the HP-GL interpreter. In the former case, we use the `SV' (screened vector) instruction to set the shading level; in the latter, we use the `CF' (character fill) instruction to set the shading level. The two sub-cases are distinguished by a hint that's passed to us, by being placed in the HP-GL-specific part of the drawing state before this function is called. 3. If we can't do either (1) or (2), then we search the palette for the closest match, and the corresponding `quantized' pen is selected. We adopt a convention: nonwhite pen colors are never quantized to white. Pen #0 is the canonical white pen. But on pen plotters, drawing with pen #0 isn't meaningful. So we won't actually use pen #0 to draw with, unless HPGL_VERSION==2 and HPGL_OPAQUE_MODE=yes (or HPGL_ASSIGN_COLORS=yes, which presumably means the output is directed to a DesignJet). If the closest match in case #3 is pen #0 and we won't be using pen #0 to draw with, we set the advisory `hpgl_bad_pen' flag in the Plotter to `true'; otherwise we set it to `false'. */ void _pl_h_set_pen_color(R___(Plotter *_plotter) int hpgl_object_type) { bool found; int longred, longgreen, longblue; int red, green, blue; int i; plColor color; color = _plotter->drawstate->fgcolor; longred = color.red; longgreen = color.green; longblue = color.blue; /* truncate to 24-bit color */ red = (longred >> 8) & ONEBYTE; green = (longgreen >> 8) & ONEBYTE; blue = (longblue >> 8) & ONEBYTE; /* Check whether color is in the palette, in which case all we need to do is select it. */ found = false; for (i = 0; i < HPGL2_MAX_NUM_PENS; i++) { if (_plotter->hpgl_pen_defined[i] != 0 /* i.e. defined (hard or soft) */ && _plotter->hpgl_pen_color[i].red == red && _plotter->hpgl_pen_color[i].green == green && _plotter->hpgl_pen_color[i].blue == blue) { found = true; break; } } if (found) /* Color is in palette: the simplest case. Besides selecting the corresponding pen, must set pen type to solid, if there's support for altering the pen type via `screening of vectors'; since in that case the pen type could have been set to `shaded' previously. If a label is to be drawn rather than a path, we must similarly update the character rendition type to `solid fill' rather than `shaded'. */ { if (i != 0 || (i == 0 && USE_PEN_ZERO)) /* can be selected */ { /* select the pen */ _pl_h_set_hpgl_pen (R___(_plotter) i); /* in HP-GL/2 case, be sure that `solid' vector screening or character filling is used (one or the other, depending on a hint as to which type of object is to be drawn) */ switch (hpgl_object_type) { case HPGL_OBJECT_PATH: if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_screened_vectors == true) /* set pen type to solid */ _pl_h_set_hpgl_pen_type (R___(_plotter) HPGL_PEN_SOLID, /* options ignored */ 0.0, 0.0); break; case HPGL_OBJECT_LABEL: if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_char_fill == true) /* if necessary, emit `CF' instruction: specify that characters are to be rendered by being filled solid with the current pen color without edging, which is the default */ if (_plotter->hpgl_char_rendering_type != HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE) { sprintf (_plotter->data->page->point, "CF;"); _update_buffer (_plotter->data->page); _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE; } break; default: break; } _plotter->hpgl_bad_pen = false; } else /* won't use pen #0, so set advisory flag */ _plotter->hpgl_bad_pen = true; } else /* color not in palette, must do something */ if (_plotter->hpgl_version == 2 && _plotter->hpgl_can_assign_colors) /* CASE #1: can soft-define pen colors (HP-GL/2, presumably a DesignJet) */ { /* assign current `free pen' to be the new color */ sprintf (_plotter->data->page->point, "PC%d,%d,%d,%d;", _plotter->hpgl_free_pen, red, green, blue); _update_buffer (_plotter->data->page); _plotter->hpgl_pen_color[_plotter->hpgl_free_pen].red = red; _plotter->hpgl_pen_color[_plotter->hpgl_free_pen].green = green; _plotter->hpgl_pen_color[_plotter->hpgl_free_pen].blue = blue; _plotter->hpgl_pen_defined[_plotter->hpgl_free_pen] = 1; /* soft-def */ /* select pen */ _pl_h_set_hpgl_pen (R___(_plotter) _plotter->hpgl_free_pen); /* update free pen, i.e. choose next non-hard-defined pen */ do _plotter->hpgl_free_pen = (_plotter->hpgl_free_pen + 1) % HPGL2_MAX_NUM_PENS; while (_plotter->hpgl_pen_defined[_plotter->hpgl_free_pen] == 2); /* in HP-GL/2 case, be sure that `solid' vector screening or character filling is used (one or the other, depending on a hint as to which type of object is to be drawn) */ switch (hpgl_object_type) { case HPGL_OBJECT_PATH: if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_screened_vectors == true) /* set pen type to solid */ _pl_h_set_hpgl_pen_type (R___(_plotter) HPGL_PEN_SOLID, /* options ignored */ 0.0, 0.0); break; case HPGL_OBJECT_LABEL: if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_char_fill == true) /* if necessary, emit `CF' instruction: specify that characters are to be rendered by being filled solid with the current pen color without edging, which is the default */ if (_plotter->hpgl_char_rendering_type != HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE) { sprintf (_plotter->data->page->point, "CF;"); _update_buffer (_plotter->data->page); _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE; } break; default: break; } _plotter->hpgl_bad_pen = false; } else if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_screened_vectors == true && hpgl_object_type == HPGL_OBJECT_PATH) /* CASE #2a: HP-GL/2, and we have a path to draw, according to the passed hint; can't soft-define pen colors, but can set a pen shading level via the `SV' instruction. So locate closest point in RGB cube that is a desaturated version of one of the defined pen colors, and shade at the appropriate level. */ { double shading; _pl_h_hpgl_shaded_pseudocolor (R___(_plotter) red, green, blue, &i, &shading); if (i != 0 || (i == 0 && USE_PEN_ZERO)) /* can be selected */ { /* select the pen */ _pl_h_set_hpgl_pen (R___(_plotter) i); /* set shading level, as a percentage */ _pl_h_set_hpgl_pen_type (R___(_plotter) HPGL_PEN_SHADED, /* 2nd option ignored for HPGL_PEN_SHADED */ 100.0 * shading, 0.0); _plotter->hpgl_bad_pen = false; } else /* won't use pen #0, so set advisory flag */ _plotter->hpgl_bad_pen = true; } else if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_char_fill == true && hpgl_object_type == HPGL_OBJECT_LABEL) /* CASE #2b: HP-GL/2, and we have a label to draw, according to the passed hint; can't soft-define pen colors, but can set a character shading level via the `CF' instruction. So locate closest point in RGB cube that is a desaturated version of one of the defined pen colors, and shade at the appropriate level. */ { double shading; _pl_h_hpgl_shaded_pseudocolor (R___(_plotter) red, green, blue, &i, &shading); if (i != 0 || (i == 0 && USE_PEN_ZERO)) /* can be selected */ { /* select the pen */ _pl_h_set_hpgl_pen (R___(_plotter) i); /* if necessary, emit `CF' instruction: specify that characters are to be rendered in a non-default way, by being filled with the current fill type (without edging) */ if (_plotter->hpgl_char_rendering_type != HPGL_CHAR_FILL) { sprintf (_plotter->data->page->point, "CF%d;", HPGL_CHAR_FILL); _update_buffer (_plotter->data->page); _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL; } /* set the fill type to be a shading level (expressed as a percentage) */ _pl_h_set_hpgl_fill_type (R___(_plotter) HPGL_FILL_SHADED, 100.0 * shading, 0.0); /* 2nd option ignord */ _plotter->hpgl_bad_pen = false; } else /* won't use pen #0, so set advisory flag */ _plotter->hpgl_bad_pen = true; } else /* CASE #3: we're stuck with a fixed set of pen colors, from which we need to choose. [HPGL_VERSION may be "1" (i.e. generic HP-GL) or "1.5" (i.e. HP7550A), or "2" (i.e. modern HP-GL/2, but without the ability to define a palette).] So select closest defined pen in RGB cube, using Euclidean distance as metric. Final arg here is `true' on account of our convention that a non-white pen color [unlike a fill color] is never quantized to white (i.e. to pen #0). */ { i = _pl_h_hpgl_pseudocolor (R___(_plotter) red, green, blue, true); if (i != 0 || (i == 0 && USE_PEN_ZERO)) /* can be selected */ { /* select the pen */ _pl_h_set_hpgl_pen (R___(_plotter) i); /* do some updating, based on the type of object to be drawn */ switch (hpgl_object_type) { case HPGL_OBJECT_PATH: if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_screened_vectors == true) /* set pen type to solid */ _pl_h_set_hpgl_pen_type (R___(_plotter) HPGL_PEN_SOLID, /* options ignored */ 0.0, 0.0); break; case HPGL_OBJECT_LABEL: if (_plotter->hpgl_version == 2 && _plotter->hpgl_have_char_fill == true) /* if necessary, emit `CF' instruction: specify that characters are to be rendered by being filled solid with the current pen color without edging, which is the default */ if (_plotter->hpgl_char_rendering_type != HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE) { sprintf (_plotter->data->page->point, "CF;"); _update_buffer (_plotter->data->page); _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE; } break; default: break; } _plotter->hpgl_bad_pen = false; } else /* won't use pen #0, so set advisory flag */ _plotter->hpgl_bad_pen = true; } } /* _pl_h_set_fill_color() is similar to _pl_h_set_pen_color: it sets the HP-GL pen color (and fill type, if appropriate) to match the fill color in our current drawing state. It's invoked before any filling operation. (Note that all filling operations will use the polygon buffer, except when we're emitting generic HP-GL [i.e., HPGL_VERSION="1"], which has no polygon buffer and no support for general filling operations. In that case the only filling operations we perform are the filling of circles and rectangles aligned with the coordinate axes.) There are three cases. (1) An HP-GL/2 device supporting modification of the palette, i.e. `soft-definition' of pen colors. I.e., HPGL_VERSION="2" and HPGL_ASSIGN_COLORS="yes". We use solid filling, after defining the fill color as a new pen color if necessary. (2) An HP-GL/2 device not supporting modification of the palette, but which do support shading at any specified intensity. I.e., HPGL_VERSION="2" and HPGL_ASSIGN_COLORS="no". We determine which shade of which defined pen is closest to the fill color in the sense of Euclidean distance within the RGB cube. `Shades' are really desaturations (interpolations between a pen color, and white). (3) An HP7550A-like device or generic HP-GL device, neither of which has firmware support for shading. I.e., HPGL_VERSION="1.5" or "1". Such devices do support cross-hatching, though. So we (a) determine which shade of which defined pen is closest to the fill color in the sense of Euclidean distance within the RGB cube, and (b) select a cross-hatch distance that will emulate this shade. For this, we use the algorithm that the HP-GL/2 counterpart of the HP7550A, the HP7550B, uses. (WARNING: our selection of cross-hatching includes the setting of the line type to `solid'. As a consequence, if HPGL_VERSION="1.5" or "1", then `_pl_h_set_fill_color' does not commute with `_pl_h_set_attributes'. This is taken into account in several places in h_path.c; grep for KLUDGE.) Pen #0 is the canonical white pen. But on pen plotters, filling with pen #0 isn't meaningful. So we won't actually use pen #0 to fill with unless HPGL_VERSION==2 and HPGL_OPAQUE_MODE=yes (or HPGL_ASSIGN_COLORS=yes, which presumably means the output is directed to a DesignJet). Accordingly if the closest match here is pen #0, we set the advisory `hpgl_bad_pen' flag in the Plotter to `true'; otherwise we set it to `false'. This is just as in set_pen_color() above. */ void _pl_h_set_fill_color(R___(Plotter *_plotter) bool force_pen_color) { bool found; int longred, longgreen, longblue; int red, green, blue; int i; if (force_pen_color == false && _plotter->drawstate->fill_type == 0) /* won't be doing filling, so punt */ return; /* get 48-bit color; if force_pen_color is set, use pen color instead of fill color */ if (force_pen_color) { longred = _plotter->drawstate->fgcolor.red; longgreen = _plotter->drawstate->fgcolor.green; longblue = _plotter->drawstate->fgcolor.blue; } else { longred = _plotter->drawstate->fillcolor.red; longgreen = _plotter->drawstate->fillcolor.green; longblue = _plotter->drawstate->fillcolor.blue; } /* truncate to 24-bit color */ red = (longred >> 8) & ONEBYTE; green = (longgreen >> 8) & ONEBYTE; blue = (longblue >> 8) & ONEBYTE; /* check whether color is already in palette, in which case all we need to do is select it (and set fill type to solid) */ found = false; for (i = 0; i < HPGL2_MAX_NUM_PENS; i++) { if (_plotter->hpgl_pen_defined[i] != 0 /* i.e. defined (hard or soft) */ && _plotter->hpgl_pen_color[i].red == red && _plotter->hpgl_pen_color[i].green == green && _plotter->hpgl_pen_color[i].blue == blue) { found = true; break; } } if (found) /* color is in palette */ { if (i != 0 || (i == 0 && USE_PEN_ZERO)) /* can be selected */ { /* select it */ _pl_h_set_hpgl_pen (R___(_plotter) i); /* set fill type to solid, unidirectional */ _pl_h_set_hpgl_fill_type (R___(_plotter) HPGL_FILL_SOLID_UNI, 0.0, 0.0); /* options ignored */ _plotter->hpgl_bad_pen = false; } else /* aren't using pen #0, so set advisory flag */ _plotter->hpgl_bad_pen = true; } else /* color not in palette, must do something */ if (_plotter->hpgl_version == 2 && _plotter->hpgl_can_assign_colors) /* CASE #1: HP-GL/2 and can soft-define pen colors */ { /* assign current `free pen' to be the new color */ sprintf (_plotter->data->page->point, "PC%d,%d,%d,%d;", _plotter->hpgl_free_pen, red, green, blue); _update_buffer (_plotter->data->page); _plotter->hpgl_pen_color[_plotter->hpgl_free_pen].red = red; _plotter->hpgl_pen_color[_plotter->hpgl_free_pen].green = green; _plotter->hpgl_pen_color[_plotter->hpgl_free_pen].blue = blue; _plotter->hpgl_pen_defined[_plotter->hpgl_free_pen] = 1; /* soft-def */ /* select pen */ _pl_h_set_hpgl_pen (R___(_plotter) _plotter->hpgl_free_pen); /* update free pen, i.e. choose next non-hard-defined pen */ do _plotter->hpgl_free_pen = (_plotter->hpgl_free_pen + 1) % HPGL2_MAX_NUM_PENS; while (_plotter->hpgl_pen_defined[_plotter->hpgl_free_pen] == 2); /* set fill type to solid, unidirectional */ _pl_h_set_hpgl_fill_type (R___(_plotter) HPGL_FILL_SOLID_UNI, 0.0, 0.0); /* options ignored */ _plotter->hpgl_bad_pen = false; } else if (_plotter->hpgl_version == 2 && _plotter->hpgl_can_assign_colors == false) /* CASE #2: HP-GL/2, but can't soft-define pen colors; locate closest point in RGB cube that is a desaturated version of one of the defined pen colors, and fill by shading at the appropriate level */ { double shading; _pl_h_hpgl_shaded_pseudocolor (R___(_plotter) red, green, blue, &i, &shading); if (i != 0 || (i == 0 && USE_PEN_ZERO)) /* can be selected */ { _pl_h_set_hpgl_pen (R___(_plotter) i); /* shading level in HP-GL/2 is expressed as a percentage */ _pl_h_set_hpgl_fill_type (R___(_plotter) HPGL_FILL_SHADED, 100.0 * shading, 0.0); /* 2nd option ignord */ _plotter->hpgl_bad_pen = false; } else /* aren't using pen #0, so set advisory flag */ _plotter->hpgl_bad_pen = true; } else /* CASE #3: HPGL_VERSION must be "1" (i.e. generic HP-GL) or "1.5" (i.e. HP7550A), so (a) determine which shade of which defined pen is closest to the fill color in the sense of Euclidean distance within the RGB cube, and (b) select a cross-hatch distance that will emulate this shade. For this, we use the algorithm that the HP-GL/2 counterpart of the HP7550A, the HP7550B, uses. As with the HP7550B, we use a cross-hatch angle of 45 degrees. */ { double shading; _pl_h_hpgl_shaded_pseudocolor (R___(_plotter) red, green, blue, &i, &shading); if (i != 0 && shading > 0.01) /* pen can be selected; note that we insist that shading level be at least 1%, to avoid silly huge inter-line spacings, and also division by zero */ { double interline_distance; _pl_h_set_hpgl_pen (R___(_plotter) i); /* convert shading fraction to cross-hatch distance */ /* If w=width of pen, d=distance between lines, and f=fraction, then f = (2wd - w^2)/(d^2). I.e., fd^2 - 2wd +w^2 = 0. Relevant solution is d = (w/f) [1 + sqrt(1-f)]. HP7550B algorithm assume that w = 0.3mm = 12 plotter units, which is a standard width for plotter pens. So that's what we use for w also; we call it HPGL_NOMINAL_PEN_WIDTH. We specify spacing in native plotter units because that's what the HP7550B does. Its interpretation of shading level as crosshatching is entirely independent of the definition of user units, the locations of the scaling points, etc. */ interline_distance = HPGL_NOMINAL_PEN_WIDTH * (1.0 + sqrt (1.0 - shading)) /shading; _pl_h_set_hpgl_fill_type (R___(_plotter) HPGL_FILL_CROSSHATCHED_LINES, interline_distance, 45.0); /* 45 degrees */ _plotter->hpgl_bad_pen = false; } else /* aren't doing any filling (which would be white or near-white), so set advisory flag */ _plotter->hpgl_bad_pen = true; } } /* Low-level routine that emits the HP-GL `SP' instruction to set the pen color by selecting a pen in the palette, by number. */ void _pl_h_set_hpgl_pen (R___(Plotter *_plotter) int new_pen) { if (new_pen != _plotter->hpgl_pen) /* need to select new pen */ { if (_plotter->hpgl_pendown) { sprintf (_plotter->data->page->point, "PU;"); _update_buffer (_plotter->data->page); _plotter->hpgl_pendown = false; } sprintf (_plotter->data->page->point, "SP%d;", new_pen); _update_buffer (_plotter->data->page); _plotter->hpgl_pen = new_pen; } } /* Low-level routine for HP-GL/2 only, which emits an `SV' instruction to select not a pen, but rather a `screening type', i.e. an area fill type such as a shading, that will be applied to all pen strokes. (Nearly all HP-GL/2 devices that aren't pen plotters support `screened vectors'.) This permits accurate matching of user-specified pen colors; see above. */ void _pl_h_set_hpgl_pen_type (R___(Plotter *_plotter) int new_hpgl_pen_type, double option1, double option2) { if (new_hpgl_pen_type != _plotter->hpgl_pen_type /* in shading case, we store the current shading level in the option1 field */ || (new_hpgl_pen_type == HPGL_PEN_SHADED && _plotter->hpgl_pen_option1 != option1) /* in predefined pattern case (there are six cross-hatch patterns that are imported from PCL or RTL, each of which has line width 4 dots and cell size 32x32 dots on a 600dpi printer), we store the current pattern type in the option1 field */ || (new_hpgl_pen_type == HPGL_PEN_PREDEFINED_CROSSHATCH && _plotter->hpgl_pen_option1 != option1)) /* need to emit `SV' instruction to change vector screening */ { switch (new_hpgl_pen_type) { case HPGL_PEN_SOLID: default: /* options ignored */ sprintf (_plotter->data->page->point, "SV;"); break; case HPGL_PEN_SHADED: /* option1 is shading level in percent */ sprintf (_plotter->data->page->point, "SV%d,%.1f;", new_hpgl_pen_type, option1); /* stash shading level */ _plotter->hpgl_pen_option1 = option1; break; case HPGL_PEN_PREDEFINED_CROSSHATCH: /* imported from PCL or RTL */ /* option1 is pattern type, in range 1..6 */ sprintf (_plotter->data->page->point, "SV%d,%d;", new_hpgl_pen_type, IROUND(option1)); /* stash pattern type */ _plotter->hpgl_pen_option1 = option1; break; } _update_buffer (_plotter->data->page); _plotter->hpgl_pen_type = new_hpgl_pen_type; } } /* Low-level routine, which emits the HP-GL `FT' instruction to set a `fill type', e.g., a shading or a cross-hatching, that will be applied when doing filling operations. WARNING: in the case of filling with cross-hatched or parallel lines, this monkeys with the line type (it sets it to `solid'). */ void _pl_h_set_hpgl_fill_type (R___(Plotter *_plotter) int new_hpgl_fill_type, double option1, double option2) { if (new_hpgl_fill_type != _plotter->hpgl_fill_type /* in shading case, we store the current shading level in the option1 field */ || (new_hpgl_fill_type == HPGL_FILL_SHADED && _plotter->hpgl_fill_option1 != option1) /* in cross-hatched or parallel line case, we store the current inter-line distance (in plotter units) in the option1 field, and and the line angle in the option2 field */ || ((new_hpgl_fill_type == HPGL_FILL_CROSSHATCHED_LINES || new_hpgl_fill_type == HPGL_FILL_PARALLEL_LINES) && (_plotter->hpgl_fill_option1 != option1 || _plotter->hpgl_fill_option2 != option2)) /* in predefined fill pattern case (there are six cross-hatch patterns that are imported from PCL or RTL, each of which has line width 4 dots and cell size 32x32 dots on a 600dpi printer), we store the current pattern type in the option1 field */ || (new_hpgl_fill_type == HPGL_FILL_PREDEFINED_CROSSHATCH && _plotter->hpgl_fill_option1 != option1)) /* need to emit `FT' instruction to change fill type */ { switch (new_hpgl_fill_type) { case HPGL_FILL_SOLID_BI: /* bidirectional solid fill */ case HPGL_FILL_SOLID_UNI: /* unidirectional solid fill */ default: /* options ignored */ sprintf (_plotter->data->page->point, "FT%d;", new_hpgl_fill_type); break; case HPGL_FILL_SHADED: /* option1 is shading level in percent */ sprintf (_plotter->data->page->point, "FT%d,%.1f;", new_hpgl_fill_type, option1); /* stash shading level */ _plotter->hpgl_fill_option1 = option1; break; case HPGL_FILL_CROSSHATCHED_LINES: case HPGL_FILL_PARALLEL_LINES: /* Our convention: option1 is inter-line distance in plotter units (option2 is angle of lines). By emitting `SC' commands, we switch from using user units to plotter units, and back (for the latter, cf. setup commands in h_openpl.c). Also, we always switch to the solid line type for drawing the lines (see warning above). */ sprintf (_plotter->data->page->point, "LT;SC;FT%d,%d,%d;SC%d,%d,%d,%d;", new_hpgl_fill_type, IROUND(option1), IROUND(option2), IROUND (_plotter->data->xmin), IROUND (_plotter->data->xmax), IROUND (_plotter->data->ymin), IROUND (_plotter->data->ymax)); _plotter->hpgl_line_type = HPGL_L_SOLID; /* stash inter-line distance and angle of lines */ _plotter->hpgl_fill_option1 = option1; _plotter->hpgl_fill_option2 = option2; break; case HPGL_FILL_PREDEFINED_CROSSHATCH: /* imported from PCL or RTL */ /* option1 is pattern type, in range 1..6 */ sprintf (_plotter->data->page->point, "FT%d,%d;", new_hpgl_fill_type, IROUND(option1)); /* stash pattern type */ _plotter->hpgl_fill_option1 = option1; break; } _update_buffer (_plotter->data->page); _plotter->hpgl_fill_type = new_hpgl_fill_type; } } /* Find closest point within the RGB color cube that is a defined pen color, using Euclidean distance as our metric. Final arg, if set, specifies that nonwhite colors should never be quantized to white. */ int _pl_h_hpgl_pseudocolor (R___(Plotter *_plotter) int red, int green, int blue, bool restrict_white) { unsigned long int difference = INT_MAX; int i; int best = 0; if (red == 0xff && green == 0xff && blue == 0xff) /* white pen */ return 0; for (i = (restrict_white ? 1 : 0); i < HPGL2_MAX_NUM_PENS; i++) { if (_plotter->hpgl_pen_defined[i] != 0) { unsigned long int newdifference; int ored, ogreen, oblue; ored = _plotter->hpgl_pen_color[i].red; ogreen = _plotter->hpgl_pen_color[i].green; oblue = _plotter->hpgl_pen_color[i].blue; newdifference = ((red - ored) * (red - ored) + (green - ogreen) * (green - ogreen) + (blue - oblue) * (blue - oblue)); if (newdifference < difference) { difference = newdifference; best = i; } } } return best; } /* Locate closest point in RGB cube that is a desaturated ("shaded") version of one of the defined pen colors, using Euclidean distance as our metric. */ void _pl_h_hpgl_shaded_pseudocolor (R___(Plotter *_plotter) int red, int green, int blue, int *pen_ptr, double *shading_ptr) { int best = 0; int i; double best_shading = 0.0; double difference = INT_MAX; double red_shifted, green_shifted, blue_shifted; /* shift color vector so that it emanates from `white' */ red_shifted = (double)(red - 0xff); green_shifted = (double)(green - 0xff); blue_shifted = (double)(blue - 0xff); /* begin with pen #1 */ for (i = 1; i < HPGL2_MAX_NUM_PENS; i++) { int ored, ogreen, oblue; double ored_shifted, ogreen_shifted, oblue_shifted; double red_proj_shifted, green_proj_shifted, blue_proj_shifted; double reciprocal_normsquared, dotproduct; double newdifference, shading; /* skip undefined pens */ if (_plotter->hpgl_pen_defined[i] == 0) continue; /* shift each pen color vector so that it emanates from `white' */ ored = _plotter->hpgl_pen_color[i].red; ogreen = _plotter->hpgl_pen_color[i].green; oblue = _plotter->hpgl_pen_color[i].blue; /* if luser specified a white pen, skip it to avoid division by 0 */ if (ored == 0xff && ogreen == 0xff && oblue == 0xff) continue; ored_shifted = (double)(ored - 0xff); ogreen_shifted = (double)(ogreen - 0xff); oblue_shifted = (double)(oblue - 0xff); /* project shifted color vector onto shifted pen color vector */ reciprocal_normsquared = 1.0 / (ored_shifted * ored_shifted + ogreen_shifted * ogreen_shifted + oblue_shifted * oblue_shifted); dotproduct = (red_shifted * ored_shifted + green_shifted * ogreen_shifted + blue_shifted * oblue_shifted); shading = reciprocal_normsquared * dotproduct; red_proj_shifted = shading * ored_shifted; green_proj_shifted = shading * ogreen_shifted; blue_proj_shifted = shading * oblue_shifted; newdifference = (((red_proj_shifted - red_shifted) * (red_proj_shifted - red_shifted)) + ((green_proj_shifted - green_shifted) * (green_proj_shifted - green_shifted)) + ((blue_proj_shifted - blue_shifted) * (blue_proj_shifted - blue_shifted))); if (newdifference < difference) { difference = newdifference; best = i; best_shading = shading; } } /* compensate for roundoff error */ if (best_shading <= 0.0) best_shading = 0.0; *pen_ptr = best; *shading_ptr = best_shading; } plotutils-2.6/libplot/h_defplot.c0000644000175000017500000010344111037243261014120 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initializations for HPGLPlotter and PCLPlotter objects including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ /* Originally, the only differences between the two types of Plotter were the PCL5 control codes that must be emitted to switch a PCL5 printer into HP-GL/2 mode, and back out of it. More recently, the two types of Plotter are distinguished by their viewport positioning. A PCL Plotter positions its viewport on the page in the same position that a PS, AI, or Fig Plotter does, i.e. it centers it. But a pure HPGL[/2] Plotter doesn't know where on the page the origin of the device coordinate system lies. (Though it's probably close to a corner.) Nor does can it set programmatically whether it's plotting in portrait or landscape mode. (It can flip between them, but it doesn't know which is which.) So HPGL Plotters use a viewport of the same default size as PCL, PS, AI, and Fig Plotters. But they don't position it: the lower left corner of the viewport is chosen to be the origin of the device coordinate system: what in HP-GL[/2] jargon is called "scaling point P1". For this to look reasonably good, the viewport needs to have a size appropriate for an HP-GL[/2] device. And in fact, that's what determines our choice of default viewport size -- for all Plotters, not just HPGLPlotters. See comments in g_pagetype.h. */ #include "sys-defines.h" #include "extern.h" #define MAX_COLOR_NAME_LEN 32 /* long enough for all known colors */ #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a HPGLPlotter struct. */ const Plotter _pl_h_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_h_initialize, _pl_h_terminate, /* page manipulation */ _pl_h_begin_page, _pl_h_erase_page, _pl_h_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_h_paint_path, _pl_h_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_h_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_h_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a PCLPlotter struct. It is the same as the above except for the different initialization and termination routines. */ const Plotter _pl_q_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_q_initialize, _pl_q_terminate, /* page manipulation */ _pl_h_begin_page, _pl_h_erase_page, _pl_h_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_h_paint_path, _pl_h_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_h_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_h_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ /* The initializations for HPGL and PCL Plotters are similar. For HPGL Plotters, we determine the HP-GL version from the environment variable HPGL_VERSION ("1", "1.5", or "2", meaning generic HP-GL, HP7550A, and modern HP-GL/2 respectively), and determine the page size and the location on the page of the viewport, so that we'll be able to work out the map from user coordinates to device coordinates in g_space.c. We allow the user to shift the location of the viewport by specifying an offset vector, since the origin of the HP-GL coordinate system and the size of the `hard-clip region' within which graphics can be drawn are not known. (There are so many HP-GL and HP-GL/2 devices.) We also work out which pens are available, and whether the device, if an HP-GL/2 device, supports the Palette Extension so that new logical pens can be defined as RGB triples. The HPGL_PENS and HPGL_ASSIGN_COLORS environment variables are used for this. (The default is for a generic HP-GL device to have exactly 1 pen, #1, and for an HP7550A or HP-GL/2 device to have 7 pens, #1 through #7, with colors equal to the seven non-white vertices of the RGB color cube. We allow the user to specify up to 31 pens, #1 through #31, via HPGL_PENS. */ void _pl_h_initialize (S___(Plotter *_plotter)) { int i; #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override generic initializations (which are appropriate to the base Plotter class), as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_HPGL; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_ONE_PAGE_AT_A_TIME; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 0; _plotter->data->have_escaped_string_support = 0; #ifdef USE_PS_FONTS_IN_PCL _plotter->data->have_ps_fonts = 1; #else _plotter->data->have_ps_fonts = 0; #endif _plotter->data->have_pcl_fonts = 1; _plotter->data->have_stick_fonts = 1; _plotter->data->have_extra_stick_fonts = 1; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user) */ _plotter->data->default_font_type = PL_F_HERSHEY; _plotter->data->pcl_before_ps = true; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->kern_stick_fonts = true; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = true; _plotter->data->allowed_arc_scaling = AS_UNIFORM; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_circle_scaling = AS_UNIFORM; _plotter->data->allowed_ellipse_scaling = AS_NONE; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI; _plotter->data->flipped_y = false; _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = HPGL_SCALED_DEVICE_LEFT; _plotter->data->xmax = HPGL_SCALED_DEVICE_RIGHT; _plotter->data->ymin = HPGL_SCALED_DEVICE_BOTTOM; _plotter->data->ymax = HPGL_SCALED_DEVICE_TOP; _plotter->data->page_data = (plPageData *)NULL; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* initialize data members specific to this derived class */ /* parameters */ _plotter->hpgl_version = 2; _plotter->hpgl_rotation = 0; _plotter->hpgl_p1.x = 0.0; _plotter->hpgl_p1.y = 8128.0; _plotter->hpgl_p2.x = 0.0; _plotter->hpgl_p2.y = 8128.0; _plotter->hpgl_plot_length = 10668.0; _plotter->hpgl_have_screened_vectors = false; _plotter->hpgl_have_char_fill = false; _plotter->hpgl_can_assign_colors = false; _plotter->hpgl_use_opaque_mode = true; /* dynamic variables */ /* pen_color[] and pen_defined[] arrays also used */ _plotter->hpgl_pen = 1; _plotter->hpgl_free_pen = 2; _plotter->hpgl_bad_pen = false; _plotter->hpgl_pendown = false; _plotter->hpgl_pen_width = 0.001; _plotter->hpgl_line_type = HPGL_L_SOLID; _plotter->hpgl_cap_style = HPGL_CAP_BUTT; _plotter->hpgl_join_style = HPGL_JOIN_MITER; _plotter->hpgl_miter_limit = 5.0; /* default HP-GL/2 value */ _plotter->hpgl_pen_type = HPGL_PEN_SOLID; _plotter->hpgl_pen_option1 = 0.0; _plotter->hpgl_pen_option2 = 0.0; _plotter->hpgl_fill_type = HPGL_FILL_SOLID_BI; _plotter->hpgl_fill_option1 = 0.0; _plotter->hpgl_fill_option2 = 0.0; _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE; _plotter->hpgl_symbol_set = PCL_ROMAN_8; _plotter->hpgl_spacing = 0; _plotter->hpgl_posture = 0; _plotter->hpgl_stroke_weight = 0; _plotter->hpgl_pcl_typeface = PCL_STICK_TYPEFACE; _plotter->hpgl_charset_lower = HPGL_CHARSET_ASCII; _plotter->hpgl_charset_upper = HPGL_CHARSET_ASCII; _plotter->hpgl_rel_char_height = 0.0; _plotter->hpgl_rel_char_width = 0.0; _plotter->hpgl_rel_label_rise = 0.0; _plotter->hpgl_rel_label_run = 0.0; _plotter->hpgl_tan_char_slant = 0.0; _plotter->hpgl_position_is_unknown = true; _plotter->hpgl_pos.x = 0; _plotter->hpgl_pos.y = 0; /* note: this driver also uses pen_color[], pen_defined[] arrays; see initializations below */ /* initialize certain data members from device driver parameters */ /* determine HP-GL version */ { const char *version_s; version_s = (const char *)_get_plot_param (_plotter->data, "HPGL_VERSION"); /* there are three subcases: "1", "1.5", and "2" (default, see above) */ if (strcmp (version_s, "1") == 0) /* generic HP-GL, HP7220 or HP7475A */ { _plotter->hpgl_version = 0; _plotter->data->have_wide_lines = 0; _plotter->data->have_dash_array = 0; _plotter->data->have_solid_fill = 0; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 0; _plotter->data->have_ps_fonts = 0; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 1; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->kern_stick_fonts = true; _plotter->data->have_other_fonts = 0; } else if (strcmp (version_s, "1.5") == 0) /* HP7550A */ { _plotter->hpgl_version = 1; _plotter->data->have_wide_lines = 0; _plotter->data->have_dash_array = 0; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 0; _plotter->data->have_ps_fonts = 0; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 1; _plotter->data->have_extra_stick_fonts = 1; _plotter->data->kern_stick_fonts = true; _plotter->data->have_other_fonts = 0; } } /* Determine range of device coordinates over which the viewport will extend (and hence the transformation from user to device coordinates; see g_space.c). */ /* NOTE: HP-GL Plotters, unlike PCL Plotters, ignore the xorigin and yorigin fields of the PAGESIZE parameter. That's because the device coordinate system isn't well specified. However, the viewport can be shifted relative to its default location, as usual, by specifying the xoffset and yoffset fields. */ /* We use the corners of the viewport, in device coordinates, as our `scaling points' P1 and P2 (see h_openpl.c). The coordinates we use in our output file will be normalized device coordinates, not physical device coordinates (for the map from the former to the latter, which is accomplished by the HP-GL `SC' instruction, see h_openpl.c). */ { /* determine page type, and viewport size and location */ _set_page_type (_plotter->data); /* by default, viewport lower left corner is (0,0) in HP-GL coordinates; if a user wishes to change this, the xoffset and yoffset parameters should be added to PAGESIZE */ _plotter->hpgl_p1.x = (HPGL_UNITS_PER_INCH * (0.0 + _plotter->data->viewport_xoffset)); _plotter->hpgl_p2.x = (HPGL_UNITS_PER_INCH * (0.0 + _plotter->data->viewport_xoffset + _plotter->data->viewport_xsize)); _plotter->hpgl_p1.y = (HPGL_UNITS_PER_INCH * (0.0 + _plotter->data->viewport_yoffset)); _plotter->hpgl_p2.y = (HPGL_UNITS_PER_INCH * (0.0 + _plotter->data->viewport_yoffset + _plotter->data->viewport_ysize)); _plotter->data->xmin = HPGL_SCALED_DEVICE_LEFT; _plotter->data->xmax = HPGL_SCALED_DEVICE_RIGHT; _plotter->data->ymin = HPGL_SCALED_DEVICE_BOTTOM; _plotter->data->ymax = HPGL_SCALED_DEVICE_TOP; /* plot length (to be emitted in an HP-GL/2 `PS' instruction, important mostly for roll plotters; see h_openpl.c) */ _plotter->hpgl_plot_length = _plotter->data->page_data->hpgl2_plot_length * HPGL_UNITS_PER_INCH; } /* determine whether to rotate the figure (e.g. horizontal instead of vertical, see h_openpl.c) */ { const char *rotate_s; rotate_s = (const char *)_get_plot_param (_plotter->data, "HPGL_ROTATE"); /* four subcases: 0 (default), 90, 180, 270 (latter two only if "2") */ if (strcasecmp (rotate_s, "yes") == 0 || strcmp (rotate_s, "90") == 0) _plotter->hpgl_rotation = 90; else if (strcmp (rotate_s, "180") == 0 && _plotter->hpgl_version == 2) _plotter->hpgl_rotation = 180; else if (strcmp (rotate_s, "270") == 0 && _plotter->hpgl_version == 2) _plotter->hpgl_rotation = 270; else _plotter->hpgl_rotation = 0; } /* Should we avoid emitting the `white is opaque' HP-GL/2 instruction? (HP-GL/2 pen plotters may not like it) */ { const char *transparent_s; transparent_s = (const char *)_get_plot_param (_plotter->data, "HPGL_OPAQUE_MODE" ); if (strcasecmp (transparent_s, "no") == 0) _plotter->hpgl_use_opaque_mode = false; } /* do we support the HP-GL/2 palette extension, i.e. can we define new logical pens as RGB triples? (user must request this with HPGL_ASSIGN_COLORS) */ if (_plotter->hpgl_version == 2) { const char *palette_s; palette_s = (const char *)_get_plot_param (_plotter->data, "HPGL_ASSIGN_COLORS"); if (strcasecmp (palette_s, "yes") == 0) _plotter->hpgl_can_assign_colors = true; } /* initialize pen color array, typically 0..31 */ for (i = 0; i < HPGL2_MAX_NUM_PENS; i++) _plotter->hpgl_pen_defined[i] = 0; /* pen absent, or at least undefined */ /* pen #0 (white pen, RGB=255,255,255) is always defined */ _plotter->hpgl_pen_color[0].red = 255; _plotter->hpgl_pen_color[0].green = 255; _plotter->hpgl_pen_color[0].blue = 255; _plotter->hpgl_pen_defined[0] = 2; /* i.e. hard-defined */ /* determine initial palette, i.e. available pens in 1..31 range */ { const char *pen_s; pen_s = (const char *)_get_plot_param (_plotter->data, "HPGL_PENS"); if (pen_s == NULL || _pl_h_parse_pen_string (R___(_plotter) pen_s) == false || (_plotter->hpgl_can_assign_colors == false && _plotter->hpgl_pen_defined[1] == 0)) /* Either user didn't assign a value, or it was bad; use default. Note that if no logical pens, we insist on pen #1 being present (for backward compatibility?). */ { if (_plotter->hpgl_version == 0) /* i.e. generic HP-GL */ pen_s = HPGL_DEFAULT_PEN_STRING; else pen_s = HPGL2_DEFAULT_PEN_STRING; _pl_h_parse_pen_string (R___(_plotter) pen_s); /* default is guaranteed to parse */ } } /* Examine presence or absence of hard-defined pens in 2..31 range. 0 = undefined, 1 = soft-defined (not yet), 2 = hard-defined. */ { bool undefined_pen_seen = false; for (i = 2; i < HPGL2_MAX_NUM_PENS; i++) { if (_plotter->hpgl_pen_defined[i] == 0) /* at least one pen with number > 1 is not yet defined */ { /* record which such was encountered first */ _plotter->hpgl_free_pen = i; undefined_pen_seen = true; break; } } if (!undefined_pen_seen) /* too many pens specified, can't soft-define colors */ _plotter->hpgl_can_assign_colors = false; } } /* Initialization for the PCLPlotter class, which is subclassed from the HPGLPlotter class. */ void _pl_q_initialize (S___(Plotter *_plotter)) { int i; #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_h_initialize (S___(_plotter)); #endif /* Superclass initialization (i.e., of an HPGLPlotter) may well have screwed things up, since e.g. for a PCLPlotter, hpgl_version should always be equal to 2, irrespective of what HPGL_VERSION is; also the viewport positioning is different. So we redo a large part of the initialization, most of which is redundant (FIXME). */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_PCL; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_ONE_PAGE_AT_A_TIME; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 0; _plotter->data->have_escaped_string_support = 0; #ifdef USE_PS_FONTS_IN_PCL _plotter->data->have_ps_fonts = 1; #else _plotter->data->have_ps_fonts = 0; #endif _plotter->data->have_pcl_fonts = 1; _plotter->data->have_stick_fonts = 1; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user) */ _plotter->data->default_font_type = PL_F_PCL; _plotter->data->pcl_before_ps = true; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->kern_stick_fonts = false; /* in PCL5 printers' HP-GL/2 emulation */ _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = true; _plotter->data->allowed_arc_scaling = AS_UNIFORM; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_ANY; _plotter->data->allowed_box_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_circle_scaling = AS_UNIFORM; _plotter->data->allowed_ellipse_scaling = AS_NONE; /* dimensions, differ in derived classes */ _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI; _plotter->data->flipped_y = false; _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = HPGL_SCALED_DEVICE_LEFT; _plotter->data->xmax = HPGL_SCALED_DEVICE_RIGHT; _plotter->data->ymin = HPGL_SCALED_DEVICE_BOTTOM; _plotter->data->ymax = HPGL_SCALED_DEVICE_TOP; _plotter->data->page_data = (plPageData *)NULL; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* initialize data members specific to this derived class */ /* parameters */ _plotter->hpgl_version = 2; _plotter->hpgl_rotation = 0; _plotter->hpgl_p1.x = 0.0; _plotter->hpgl_p1.y = 8128.0; _plotter->hpgl_p2.x = 0.0; _plotter->hpgl_p2.y = 8128.0; _plotter->hpgl_plot_length = 10668.0; _plotter->hpgl_have_screened_vectors = true; /* different from HPGLPlotter */ _plotter->hpgl_have_char_fill = true; /* different from HPGLPlotter */ _plotter->hpgl_can_assign_colors = false; _plotter->hpgl_use_opaque_mode = true; /* dynamic variables */ /* pen_color[] and pen_defined[] arrays also used */ _plotter->hpgl_pen = 1; _plotter->hpgl_free_pen = 2; _plotter->hpgl_bad_pen = false; _plotter->hpgl_pendown = false; _plotter->hpgl_pen_width = 0.001; _plotter->hpgl_line_type = HPGL_L_SOLID; _plotter->hpgl_cap_style = HPGL_CAP_BUTT; _plotter->hpgl_join_style = HPGL_JOIN_MITER; /* Maximum value the cosecant of the half-angle between any two line segments can have, if the join is to be mitered rather than beveled. Default HP-GL/2 value is 5.0. */ _plotter->hpgl_miter_limit = 5.0; _plotter->hpgl_pen_type = HPGL_PEN_SOLID; _plotter->hpgl_pen_option1 = 0.0; _plotter->hpgl_pen_option2 = 0.0; _plotter->hpgl_fill_type = HPGL_FILL_SOLID_BI; _plotter->hpgl_fill_option1 = 0.0; _plotter->hpgl_fill_option2 = 0.0; _plotter->hpgl_char_rendering_type = HPGL_CHAR_FILL_SOLID_AND_MAYBE_EDGE; _plotter->hpgl_symbol_set = PCL_ROMAN_8; _plotter->hpgl_spacing = 0; _plotter->hpgl_posture = 0; _plotter->hpgl_stroke_weight = 0; _plotter->hpgl_pcl_typeface = PCL_STICK_TYPEFACE; _plotter->hpgl_charset_lower = HPGL_CHARSET_ASCII; _plotter->hpgl_charset_upper = HPGL_CHARSET_ASCII; _plotter->hpgl_rel_char_height = 0.0; _plotter->hpgl_rel_char_width = 0.0; _plotter->hpgl_rel_label_rise = 0.0; _plotter->hpgl_rel_label_run = 0.0; _plotter->hpgl_tan_char_slant = 0.0; /* note: this driver also uses pen_color[], pen_defined[] arrays; see initializations below */ /* initialize certain data members from device driver parameters */ /* Determine range of device coordinates over which the viewport will extend (and hence the transformation from user to device coordinates; see g_space.c). */ /* We use the corners of the viewport, in device coordinates, as our `scaling points' P1 and P2 (see h_openpl.c). The coordinates we use in our output file will be normalized device coordinates, not physical device coordinates (for the map from the former to the latter, which is accomplished by the HP-GL `SC' instruction, see h_openpl.c). */ { /* determine page type, viewport size and location */ _set_page_type (_plotter->data); /* convert viewport size-and-location data (in terms of inches) to device coordinates (i.e. HP-GL units) */ /* NOTE: origin of HP-GL/2 coordinate system used by a PCL5 device is not at lower left corner of page; must compensate by subtracting the `pcl_hpgl2_?origin' quantities. */ _plotter->hpgl_p1.x = (HPGL_UNITS_PER_INCH * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset - _plotter->data->page_data->pcl_hpgl2_xorigin)); _plotter->hpgl_p2.x = (HPGL_UNITS_PER_INCH * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset + _plotter->data->viewport_xsize - _plotter->data->page_data->pcl_hpgl2_xorigin)); _plotter->hpgl_p1.y = (HPGL_UNITS_PER_INCH * (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset - _plotter->data->page_data->pcl_hpgl2_yorigin)); _plotter->hpgl_p2.y = (HPGL_UNITS_PER_INCH * (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset + _plotter->data->viewport_ysize - _plotter->data->page_data->pcl_hpgl2_yorigin)); /* plot length (to be emitted in an HP-GL/2 `PS' instruction, important mostly for roll plotters; see h_openpl.c) */ _plotter->hpgl_plot_length = _plotter->data->page_data->hpgl2_plot_length * HPGL_UNITS_PER_INCH; } /* don't make use of HP-GL/2's plotting-area rotation facility; if we wish to switch between portrait and landscape modes we'll do so from within PCL5 */ _plotter->hpgl_rotation = 0; /* do we support the HP-GL/2 palette extension, i.e. can we define new logical pens as RGB triples? (user must request this with PCL_ASSIGN_COLORS) */ _plotter->hpgl_can_assign_colors = false; { const char *palette_s; palette_s = (const char *)_get_plot_param (_plotter->data, "PCL_ASSIGN_COLORS"); if (strcasecmp (palette_s, "yes") == 0) _plotter->hpgl_can_assign_colors = true; } /* do we use the HP-GL/2 `BZ' instruction for drawing Beziers? (the LaserJet III did not support it) */ { const char *bezier_s; bezier_s = (const char *)_get_plot_param (_plotter->data, "PCL_BEZIERS"); if (strcasecmp (bezier_s, "yes") != 0) _plotter->data->allowed_cubic_scaling = AS_NONE; } /* initialize pen color array, typically 0..31 */ for (i = 0; i < HPGL2_MAX_NUM_PENS; i++) _plotter->hpgl_pen_defined[i] = 0; /* pen absent, or at least undefined */ /* pen #0 (white pen, RGB=255,255,255) is always defined */ _plotter->hpgl_pen_color[0].red = 255; _plotter->hpgl_pen_color[0].green = 255; _plotter->hpgl_pen_color[0].blue = 255; _plotter->hpgl_pen_defined[0] = 2; /* i.e. hard-defined */ /* determine initial palette, i.e. available pens in 1..31 range; for a PCLPlotter we use the default HP-GL/2 pen string */ { const char *pen_s; pen_s = HPGL2_DEFAULT_PEN_STRING; _pl_h_parse_pen_string (R___(_plotter) pen_s); /* default is guaranteed to parse */ } /* Examine presence or absence of hard-defined pens in 2..31 range. 0 = undefined, 1 = soft-defined (not yet), 2 = hard-defined. */ { bool undefined_pen_seen = false; for (i = 2; i < HPGL2_MAX_NUM_PENS; i++) { if (_plotter->hpgl_pen_defined[i] == 0) /* at least one pen with number > 1 is not yet defined */ { /* record which such was encountered first */ _plotter->hpgl_free_pen = i; undefined_pen_seen = true; break; } } if (!undefined_pen_seen) /* too many pens specified, can't soft-define colors */ _plotter->hpgl_can_assign_colors = false; } } /* Parse a pen string, e.g. a user-specified HPGL_PENS environment variable, specifying which pens are available. Result is stored in the Plotter. More pens (logical pens) may be added later to the array of available pens, if the plotter is an HP-GL/2 device and supports the palette extension. User specifies this by setting the HPGL_ASSIGN_COLORS environment variable to "yes"; see above. */ bool _pl_h_parse_pen_string (R___(Plotter *_plotter) const char *pen_s) { const char *charp; char name[MAX_COLOR_NAME_LEN]; int i; charp = pen_s; while (*charp) { int pen_num; bool got_digit; const char *tmp; plColor color; if (*charp == ':') /* skip any ':' */ { charp++; continue; /* back to top of while loop */ } pen_num = 0; got_digit = false; while (*charp >= '0' && *charp <= '9') { pen_num = 10 * pen_num + (int)*charp - (int)'0'; got_digit = true; charp++; } if (!got_digit || pen_num < 1 || pen_num >= HPGL2_MAX_NUM_PENS) return false; if (*charp != '=') return false; charp++; for (tmp = charp, i = 0; i < MAX_COLOR_NAME_LEN; tmp++, i++) { if (*tmp == ':') /* end of color name string */ { name[i] = '\0'; charp = tmp + 1; break; } else if (*tmp == '\0') /* end of name string and env var also */ { name[i] = '\0'; charp = tmp; break; } else name[i] = *tmp; } /* got color name string, parse it */ if (_string_to_color (name, &color, _plotter->data->color_name_cache)) { _plotter->hpgl_pen_color[pen_num] = color; _plotter->hpgl_pen_defined[pen_num] = 2; /* hard-defined */ } else /* couldn't match color name string */ return false; } return true; } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_h_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } void _pl_q_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_h_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER HPGLPlotter::HPGLPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (FILE *outfile) :Plotter (outfile) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (ostream& out) : Plotter (out) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter () { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_h_initialize (); } HPGLPlotter::HPGLPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_h_initialize (); } HPGLPlotter::~HPGLPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_h_terminate (); } #endif #ifdef LIBPLOTTER PCLPlotter::PCLPlotter (FILE *infile, FILE *outfile, FILE *errfile) :HPGLPlotter (infile, outfile, errfile) { _pl_q_initialize (); } PCLPlotter::PCLPlotter (FILE *outfile) :HPGLPlotter (outfile) { _pl_q_initialize (); } PCLPlotter::PCLPlotter (istream& in, ostream& out, ostream& err) : HPGLPlotter (in, out, err) { _pl_q_initialize (); } PCLPlotter::PCLPlotter (ostream& out) : HPGLPlotter (out) { _pl_q_initialize (); } PCLPlotter::PCLPlotter () { _pl_q_initialize (); } PCLPlotter::PCLPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :HPGLPlotter (infile, outfile, errfile, parameters) { _pl_q_initialize (); } PCLPlotter::PCLPlotter (FILE *outfile, PlotterParams ¶meters) :HPGLPlotter (outfile, parameters) { _pl_q_initialize (); } PCLPlotter::PCLPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : HPGLPlotter (in, out, err, parameters) { _pl_q_initialize (); } PCLPlotter::PCLPlotter (ostream& out, PlotterParams ¶meters) : HPGLPlotter (out, parameters) { _pl_q_initialize (); } PCLPlotter::PCLPlotter (PlotterParams ¶meters) : HPGLPlotter (parameters) { _pl_q_initialize (); } PCLPlotter::~PCLPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_q_terminate (); } #endif #ifndef LIBPLOTTER /* The following forwarding functions provide special support in libplot for deriving the PCLPlotter class from the HPGLPlotter class. In libplotter, forwarding is implemented by a virtual function; see plotter.h. */ /* Two forwarding functions called by any HPGLPlotter/PCLPlotter in begin_page() and end_page(), respectively. See h_openpl.c and h_closepl.c for the forwarded-to functions _pl_h_maybe_switch_to_hpgl(), _pl_q_maybe_switch_to_hpgl(), _pl_h_maybe_switch_from_hpgl(), _pl_q_maybe_switch_from_hpgl(). The HPGLPlotter versions are no-ops, but the PCLPlotter versions switch the printer to HP-GL/2 mode from PCL 5 mode, and back to PCL 5 mode from HP-GL/2 mode. */ /* Eject page (if page number > 1) and switch from PCL 5 mode to HP-GL/2 mode, if a PCL 5 printer (otherwise it's a no-op). Invoked by begin_page(). */ void _maybe_switch_to_hpgl (Plotter *_plotter) { switch ((int)(_plotter->data->type)) { case (int)PL_HPGL: default: _pl_h_maybe_switch_to_hpgl (_plotter); /* no-op */ break; case (int)PL_PCL: _pl_q_maybe_switch_to_hpgl (_plotter); break; } } /* Switch back to PCL 5 mode from HP-GL/2 mode, if a PCL 5 printer (otherwise it's a no-op). Invoked by end_page(). */ void _maybe_switch_from_hpgl (Plotter *_plotter) { switch ((int)(_plotter->data->type)) { case (int)PL_HPGL: default: _pl_h_maybe_switch_from_hpgl (_plotter); /* no-op */ break; case (int)PL_PCL: _pl_q_maybe_switch_from_hpgl (_plotter); break; } } #endif /* not LIBPLOTTER */ plotutils-2.6/libplot/h_erase.c0000644000175000017500000000200411037243261013553 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_h_erase_page (S___(Plotter *_plotter)) { return true; } plotutils-2.6/libplot/h_font.c0000644000175000017500000005005711037243261013435 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains a low-level method for adjusting the font of an HP-GL or PCL device to agree with an HPGL or PCL Plotter's notion of what it should be, prior to plotting a label. Note: The `PCL 5' output by any PCL Plotter is simply a wrapped version of HP-GL/2. Before HP-GL/2 (introduced c. 1990), HP-GL devices supported only Stick fonts. In modern PCL5 printers, the suite of 45 PCL fonts is accessible too. Only a few modern high-end PCL5/PS printers (e.g. LaserJet 4000 series laser printers) also support PS fonts in PCL mode. PS fonts are supported by HP-GL/2 and PCL Plotters if the `--enable-ps-fonts-in-pcl' option is specified at configure time. After selecting the font, this method invokes the HP-GL DR/SR/SL instructions to size and slant the font, as needed. The font selection itself is accomplished in either of two ways. 1. In versions of HP-GL prior to HP-GL/2, 7-bit font halves are selected with `CS' and `CA' instructions. They must be switched between when the label is plotted via SO/SI; see h_text.c. The HP-GL device will usually supply the upper font half in the Roman-8 encoding, and that too will need to be taken into account when the label is plotted. 2. In HP-GL/2, a single 8-bit font is selected with the HP-GL/2 `SD' instruction. In principle, no switching between 7-bit font halves is needed. In practice, it's more complicated than that. For ISO-Latin-1 PCL fonts, the SD instruction allegedly allows the ISO-Latin-1 encoding to be requested. But it doesn't work! One or two characters in the lower half (!) don't come out right. So instead, we use the `SD' instruction to retrieve an 8-bit version that uses the Roman-8 encoding, and the `AD' instruction to retrieve an alternative 8-bit version that uses the ISO-Latin-1 encoding. We'll use the former for characters in the lower half, and the latter for characters in the upper half. This is bizarre, but it works. See additional comments in h_text.c. */ /* NOTE: This code assumes that P1 and P2 have different x coordinates, and different y coordinates. If that isn't the case, it'll divide by zero. So we check for that possibility in _pl_h_paint_text_string() before calling this function. See comment in h_text.c. */ #include "sys-defines.h" #include "extern.h" /* Shearing factor for oblique fonts, new_x = x + SHEAR * y */ #define SHEAR (2.0/7.0) void _pl_h_set_font (S___(Plotter *_plotter)) { bool font_changed = false; bool oblique; double cos_slant = 1.0, sin_slant = 0.0; double new_relative_label_run, new_relative_label_rise; double theta, sintheta, costheta; plVector base, up, base_native, up_native; double base_native_len, up_native_len, tan_slant; /* sanity check, should be unnecessary */ if (_plotter->drawstate->font_type == PL_F_HERSHEY) return; if (_plotter->drawstate->font_type == PL_F_STICK) /* check whether obliquing of this font is called for */ { int master_font_index; /* compute index of font in master table of fonts, in g_fontdb.c */ master_font_index = (_pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; oblique = _pl_g_stick_font_info[master_font_index].obliquing; } else oblique = false; /* label rotation angle in radians, in user frame */ theta = M_PI * _plotter->drawstate->text_rotation / 180.0; costheta = cos (theta); sintheta = sin (theta); /* compute in the device frame a `base vector' which is (in the user frame) directed along the label, with length equal to the font size) */ base.x = _plotter->drawstate->true_font_size * XDV(costheta,sintheta); base.y = _plotter->drawstate->true_font_size * YDV(costheta,sintheta); /* Compute rise and run, relative to x-distance and y-distance between scaling points P1,P2. (Either rise or run can be negative; overall normalization, e.g. the `100', is irrelevant. We include the `100' to express them as percentages.) */ new_relative_label_run = 100 * base.x / (HPGL_SCALED_DEVICE_RIGHT - HPGL_SCALED_DEVICE_LEFT); new_relative_label_rise = 100 * base.y / (HPGL_SCALED_DEVICE_TOP - HPGL_SCALED_DEVICE_BOTTOM); if (new_relative_label_run != 0.0 || new_relative_label_rise != 0.0) /* (will always be true except when the font size is so small there's really no point in printing the label) */ { /* update device-frame label rotation angle if needed */ if (_plotter->hpgl_rel_label_run != new_relative_label_run || _plotter->hpgl_rel_label_rise != new_relative_label_rise) { sprintf (_plotter->data->page->point, "DR%.3f,%.3f;", new_relative_label_run, new_relative_label_rise); _update_buffer (_plotter->data->page); _plotter->hpgl_rel_label_run = new_relative_label_run; _plotter->hpgl_rel_label_rise = new_relative_label_rise; } } /* emit command to select new font, if needed (see below) */ if (_plotter->hpgl_version == 2) font_changed = _pl_h_hpgl2_maybe_update_font (S___(_plotter)); else /* 0 or 1, i.e. generic HP-GL or HP7550A */ font_changed = _pl_h_hpgl_maybe_update_font (S___(_plotter)); /* Compute image, in the device frame, of a so-called `up vector': a vector which in the user frame is perpendicular to the above `base' vector, and has the same length. Some fonts are specially obliqued, so we take font obliquing (if any) into account here. */ up.x = _plotter->drawstate->true_font_size * XDV(-sintheta,costheta); up.y = _plotter->drawstate->true_font_size * YDV(-sintheta,costheta); up.x += (oblique ? SHEAR : 0.0) * base.x; up.y += (oblique ? SHEAR : 0.0) * base.y; /* Our `device frame' base and up vectors are really vectors in the normalized device frame, in which the viewport has a fixed size. See h_defplot.c. E.g., the viewport corners (0,0) and (1,1) in the NDC frame are respectively mapped to (HPGL_SCALED_DEVICE_LEFT,HPGL_SCALED_DEVICE_BOTTOM) and (HPGL_SCALED_DEVICE_RIGHT,HPGL_SCALED_DEVICE_TOP) in the normalized device frame. The further mapping to native HP-GL coordinates is accomplished by an `SC' scaling instruction emitted at the head of the output file; see h_openpl.c. This further mapping depends on the PAGESIZE parameter. Unfortunately, when dealing with anamorphically transformed fonts we need to manipulate not just vectors in the normalized device frame, but also vectors in the true device frame, i.e., in native HP-GL units. */ /* These vectors use native HP-GL units. */ base_native.x = base.x * (_plotter->hpgl_p2.x - _plotter->hpgl_p1.x) / (HPGL_SCALED_DEVICE_RIGHT - HPGL_SCALED_DEVICE_LEFT); base_native.y = base.y * (_plotter->hpgl_p2.y - _plotter->hpgl_p1.y) / (HPGL_SCALED_DEVICE_TOP - HPGL_SCALED_DEVICE_BOTTOM); up_native.x = up.x * (_plotter->hpgl_p2.x - _plotter->hpgl_p1.x) / (HPGL_SCALED_DEVICE_RIGHT - HPGL_SCALED_DEVICE_LEFT); up_native.y = up.y * (_plotter->hpgl_p2.y - _plotter->hpgl_p1.y) / (HPGL_SCALED_DEVICE_TOP - HPGL_SCALED_DEVICE_BOTTOM); base_native_len = sqrt (base_native.x * base_native.x + base_native.y * base_native.y); up_native_len = sqrt (up_native.x * up_native.x + up_native.y * up_native.y); /* compute character slant angle (in the true device frame, NOT in the normalized device frame) */ if (base_native_len == 0.0 || up_native_len == 0.0) /* a bad situation */ tan_slant = 0.0; else { sin_slant = ((base_native.x * up_native.x + base_native.y * up_native.y) / (base_native_len * up_native_len)); cos_slant = sqrt (1 - sin_slant * sin_slant); tan_slant = sin_slant / cos_slant; } /* Compute nominal horizontal and vertical character sizes as percentages of the horizontal and vertical distances between scaling points P1 and P2, and specify them with the SR instruction. The two arguments of the SR instruction (the horizontal and vertical character sizes) should apparently be 0.5 times the font size, and 0.7 times the font size. Why? The 0.5 and 0.7 = 1.4 * 0.5 factors are undocumented HP magic. This convention must have been introduced by HP to adapt the SR instruction, which dates back to fixed-width plotter fonts (i.e., the original Stick font), to modern outline fonts. Fixed-width plotter fonts did not have a font size in the modern sense: they had a character width and a character height. (The former being the width of the character proper, which occupied the left 2/3 of a character cell, and the latter being what we would nowadays call a cap height.) The convention probably arose because Stick fonts look best if the aspect ratio is 1.4 (= 0.7/0.5), i.e. if the `character height' is 1.4 times the `character width'. I am not sure where the 0.5 came from. Possibly back in stick font days, the nominal font size was defined to be 4/3 times the width of a character cell, or equivalently the width of a character cell was chosen to be 3/4 times the nominal font size. This would make the maximum character width (2/3)x(3/4) = (1/2) times the nominal font size. */ { double fractional_char_width = 0.5; double fractional_char_height = 1.4 * 0.5; double new_relative_char_width, new_relative_char_height; /* If, in the physical device frame, the font is reflected, we must flip the sign of HP-GL's `character height', as used in the SR instruction. To determine whether this sign-flipping is needed, we use the fact that the user_frame->physical_device_frame map is the product of the user_frame->normalized_device_frame map and the normalized_device_frame->physical_device_frame map. Whether the first includes a reflection is precomputed and stored in the drawing state. The second will include a reflection only if exactly one of the xsize,ysize fields of PAGESIZE is negative. We can easily check for that by comparing the x,y coordinates of the HP-GL scaling points P1,P2. */ int orientation = _plotter->drawstate->transform.nonreflection ? 1 : -1; if ((_plotter->hpgl_p2.x - _plotter->hpgl_p1.x) / (HPGL_SCALED_DEVICE_RIGHT - HPGL_SCALED_DEVICE_LEFT) < 0.0) orientation *= -1; if ((_plotter->hpgl_p2.y - _plotter->hpgl_p1.y) / (HPGL_SCALED_DEVICE_TOP - HPGL_SCALED_DEVICE_BOTTOM) < 0.0) orientation *= -1; new_relative_char_width = fractional_char_width * 100 * base_native_len / (_plotter->hpgl_p2.x - _plotter->hpgl_p1.x); new_relative_char_height = fractional_char_height * 100 * orientation * cos_slant * up_native_len / (_plotter->hpgl_p2.y - _plotter->hpgl_p1.y); /* emit SR instruction only if font was changed or if current size was wrong */ if (font_changed || (new_relative_char_width != _plotter->hpgl_rel_char_width || new_relative_char_height != _plotter->hpgl_rel_char_height)) { sprintf (_plotter->data->page->point, "SR%.3f,%.3f;", new_relative_char_width, new_relative_char_height); _update_buffer (_plotter->data->page); _plotter->hpgl_rel_char_width = new_relative_char_width; _plotter->hpgl_rel_char_height = new_relative_char_height; } } /* update slant angle if necessary */ if (tan_slant != _plotter->hpgl_tan_char_slant) { sprintf (_plotter->data->page->point, "SL%.3f;", tan_slant); _update_buffer (_plotter->data->page); _plotter->hpgl_tan_char_slant = tan_slant; } } /* If needed, emit a new-style (HP-GL/2) `SD' font-selection command. Return value indicates whether font was changed. */ bool _pl_h_hpgl2_maybe_update_font (S___(Plotter *_plotter)) { bool font_change = false; bool font_is_iso_latin_1; int master_font_index; int symbol_set, spacing, posture, stroke_weight, typeface; /* PCL, PS, and Stick fonts are handled separately here only because the font information for them is stored in different tables in g_fontdb.c. We compute parameters we'll need for the HP-GL/2 `SD' font-selection command. */ switch (_plotter->drawstate->font_type) { case PL_F_PCL: default: /* compute index of font in master table of fonts, in g_fontdb.c */ master_font_index = (_pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* #1: symbol set */ symbol_set = _pl_g_pcl_font_info[master_font_index].hpgl_symbol_set; /* #2: spacing */ spacing = _pl_g_pcl_font_info[master_font_index].hpgl_spacing; /* #3, #4 are pitch and height (we use defaults) */ /* #5: posture */ posture = _pl_g_pcl_font_info[master_font_index].hpgl_posture; /* #6: stroke weight */ stroke_weight = _pl_g_pcl_font_info[master_font_index].hpgl_stroke_weight; /* #7: typeface */ typeface = _pl_g_pcl_font_info[master_font_index].pcl_typeface; /* ISO-Latin-1 after reencoding (if any)? */ font_is_iso_latin_1 = _pl_g_pcl_font_info[master_font_index].iso8859_1; break; case PL_F_POSTSCRIPT: /* compute index of font in master table of fonts, in g_fontdb.c */ master_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* #1: symbol set */ symbol_set = _pl_g_ps_font_info[master_font_index].hpgl_symbol_set; /* #2: spacing */ spacing = _pl_g_ps_font_info[master_font_index].hpgl_spacing; /* #3, #4 are pitch and height (we use defaults) */ /* #5: posture */ posture = _pl_g_ps_font_info[master_font_index].hpgl_posture; /* #6: stroke weight */ stroke_weight = _pl_g_ps_font_info[master_font_index].hpgl_stroke_weight; /* #7: typeface */ typeface = _pl_g_ps_font_info[master_font_index].pcl_typeface; /* ISO-Latin-1 after reencoding (if any)? */ font_is_iso_latin_1 = _pl_g_ps_font_info[master_font_index].iso8859_1; break; case PL_F_STICK: /* compute index of font in master table of fonts, in g_fontdb.c */ master_font_index = (_pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* #1: symbol set */ symbol_set = _pl_g_stick_font_info[master_font_index].hpgl_symbol_set; /* #2: spacing */ spacing = _pl_g_stick_font_info[master_font_index].hpgl_spacing; /* #3, #4 are pitch and height (we use defaults) */ /* #5: posture */ posture = _pl_g_stick_font_info[master_font_index].hpgl_posture; /* #6: stroke weight */ stroke_weight = _pl_g_stick_font_info[master_font_index].hpgl_stroke_weight; /* #7: typeface */ typeface = _pl_g_stick_font_info[master_font_index].pcl_typeface; /* ISO-Latin-1 after reencoding (if any)? */ font_is_iso_latin_1 = _pl_g_stick_font_info[master_font_index].iso8859_1; break; } if (symbol_set != _plotter->hpgl_symbol_set || spacing != _plotter->hpgl_spacing || posture != _plotter->hpgl_posture || stroke_weight != _plotter->hpgl_stroke_weight || typeface != _plotter->hpgl_pcl_typeface) font_change = true; if (font_change) { if (spacing == HPGL2_FIXED_SPACING) /* fixed-width font */ sprintf (_plotter->data->page->point, /* #4 (nominal point size) not needed but included anyway */ "SD1,%d,2,%d,3,%.3f,4,%.3f,5,%d,6,%d,7,%d;", symbol_set, spacing, (double)HPGL2_NOMINAL_CHARS_PER_INCH, (double)HPGL2_NOMINAL_POINT_SIZE, posture, stroke_weight, typeface); else /* variable-width font */ sprintf (_plotter->data->page->point, /* #3 (nominal chars per inch) not needed but incl'd anyway */ "SD1,%d,2,%d,3,%.3f,4,%.3f,5,%d,6,%d,7,%d;", symbol_set, spacing, (double)HPGL2_NOMINAL_CHARS_PER_INCH, (double)HPGL2_NOMINAL_POINT_SIZE, posture, stroke_weight, typeface); _update_buffer (_plotter->data->page); /* A hack. Due to HP's idiosyncratic definition of `ISO-Latin-1 encoding' for PCL fonts, when plotting a label in an ISO-Latin-1 PCL font we'll map characters in the lower half into HP's Roman-8 encoding, and characters in the upper half into HP's ISO-Latin-1 encoding. We implement this by using two fonts: standard and alternative. See h_text.c for the DFA that switches back and forth (if necessary) when the label is rendered. */ if (_plotter->drawstate->font_type == PL_F_PCL && font_is_iso_latin_1 && symbol_set == PCL_ROMAN_8) { if (spacing == HPGL2_FIXED_SPACING) /* fixed-width font */ sprintf (_plotter->data->page->point, /* #4 (nominal point size) not needed but included anyway */ "AD1,%d,2,%d,3,%.3f,4,%.3f,5,%d,6,%d,7,%d;", PCL_ISO_8859_1, spacing, (double)HPGL2_NOMINAL_CHARS_PER_INCH, (double)HPGL2_NOMINAL_POINT_SIZE, posture, stroke_weight, typeface); else /* variable-width font */ sprintf (_plotter->data->page->point, /* #3 (nominal chars per inch) not needed but included anyway */ "AD1,%d,2,%d,3,%.3f,4,%.3f,5,%d,6,%d,7,%d;", PCL_ISO_8859_1, spacing, (double)HPGL2_NOMINAL_CHARS_PER_INCH, (double)HPGL2_NOMINAL_POINT_SIZE, posture, stroke_weight, typeface); _update_buffer (_plotter->data->page); } _plotter->hpgl_symbol_set = symbol_set; _plotter->hpgl_spacing = spacing; _plotter->hpgl_posture = posture; _plotter->hpgl_stroke_weight = stroke_weight; _plotter->hpgl_pcl_typeface = typeface; } return font_change; /* was font changed? */ } /* If needed, emit an old-style (pre-HP-GL/2) `CS' font-selection command, and also a `CA' font-change command to make the upper half of the selected font available via SO/SI. Return value indicates whether font was changed. (This is used only for Stick fonts, which is all that pre-HP/GL-2 HP-GL devices had.) */ bool _pl_h_hpgl_maybe_update_font (S___(Plotter *_plotter)) { bool font_change = false; int new_hpgl_charset_lower, new_hpgl_charset_upper, master_font_index; /* compute index of font in master table of fonts, in g_fontdb.c */ master_font_index = (_pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* determine HP character set numbers (old style, pre-HP-GL/2) */ new_hpgl_charset_lower = _pl_g_stick_font_info[master_font_index].hpgl_charset_lower; new_hpgl_charset_upper = _pl_g_stick_font_info[master_font_index].hpgl_charset_upper; /* using `CS', select charset for lower half of font */ if (new_hpgl_charset_lower != _plotter->hpgl_charset_lower) { sprintf (_plotter->data->page->point, "CS%d;", new_hpgl_charset_lower); _update_buffer (_plotter->data->page); _plotter->hpgl_charset_lower = new_hpgl_charset_lower; font_change = true; } /* using `CA', select charset for upper half, if we have a genuine one (a negative value for the upper charset is our way of flagging that this is a 7-bit font; see comment in h_text.c) */ if (new_hpgl_charset_upper >= 0 && new_hpgl_charset_upper != _plotter->hpgl_charset_upper) { sprintf (_plotter->data->page->point, "CA%d;", new_hpgl_charset_upper); _update_buffer (_plotter->data->page); _plotter->hpgl_charset_upper = new_hpgl_charset_upper; font_change = true; } return font_change; } plotutils-2.6/libplot/h_openpl.c0000644000175000017500000001622011037243261013756 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_h_begin_page (S___(Plotter *_plotter)) { int i; /* With each call to openpl(), we reset our knowledge of the HP-GL internal state, i.e. the dynamic derived-class-specific data members of the HPGL or PCL Plotter. The values are the same as are used in initializing the Plotter (see h_defplot.c). */ /* reset any soft-defined colors in the pen color array */ for (i = 0; i < HPGL2_MAX_NUM_PENS; i++) if (_plotter->hpgl_pen_defined[i] == 1) /* i.e. soft-defined */ _plotter->hpgl_pen_defined[i] = 0; /* i.e. undefined */ /* reset current pen */ _plotter->hpgl_pen = 1; /* if we can soft-define pen colors, reset free_pen data member by determining what the next free pen is */ { bool undefined_pen_seen = false; if (_plotter->hpgl_can_assign_colors) /* can soft-define pen colors */ for (i = 2; i < HPGL2_MAX_NUM_PENS; i++) { if (_plotter->hpgl_pen_defined[i] == 0) /* at least one pen with number > 1 is not yet defined */ { /* record which such was encountered first */ _plotter->hpgl_free_pen = i; undefined_pen_seen = true; break; } } if (!undefined_pen_seen) /* too many pens specified, can't soft-define colors */ _plotter->hpgl_can_assign_colors = false; } /* reset additional data members of Plotter */ _plotter->hpgl_bad_pen = false; _plotter->hpgl_pendown = false; _plotter->hpgl_pen_width = 0.001; _plotter->hpgl_line_type = HPGL_L_SOLID; _plotter->hpgl_cap_style = HPGL_CAP_BUTT; _plotter->hpgl_join_style = HPGL_JOIN_MITER; _plotter->hpgl_miter_limit = 5.0; /* default HP-GL/2 value */ _plotter->hpgl_fill_type = HPGL_FILL_SOLID_BI; _plotter->hpgl_fill_option1 = 0.0; _plotter->hpgl_fill_option2 = 0.0; _plotter->hpgl_symbol_set = PCL_ROMAN_8; _plotter->hpgl_spacing = 0; _plotter->hpgl_posture = 0; _plotter->hpgl_stroke_weight = 0; _plotter->hpgl_pcl_typeface = PCL_STICK_TYPEFACE; _plotter->hpgl_charset_lower = HPGL_CHARSET_ASCII; _plotter->hpgl_charset_upper = HPGL_CHARSET_ASCII; _plotter->hpgl_rel_char_height = 0.0; _plotter->hpgl_rel_char_width = 0.0; _plotter->hpgl_rel_label_rise = 0.0; _plotter->hpgl_rel_label_run = 0.0; _plotter->hpgl_tan_char_slant = 0.0; _plotter->hpgl_position_is_unknown = true; _plotter->hpgl_pos.x = 0; _plotter->hpgl_pos.y = 0; /* if a PCL Plotter, switch from PCL mode to HP-GL/2 mode */ _maybe_switch_to_hpgl (S___(_plotter)); /* output HP-GL prologue */ if (_plotter->hpgl_version == 2) { sprintf (_plotter->data->page->point, "BP;IN;"); _update_buffer (_plotter->data->page); /* include HP-GL/2 `plot length' directive; important mostly for roll plotters */ sprintf (_plotter->data->page->point, "PS%d;", IROUND(_plotter->hpgl_plot_length)); _update_buffer (_plotter->data->page); } else { sprintf (_plotter->data->page->point, "IN;"); _update_buffer (_plotter->data->page); } /* make use of HP-GL's plotting-area rotation capability, if requested by the HPGL_ROTATE parameter (this does not apply to PCL Plotters, for which rotation=0 always) */ if (_plotter->hpgl_rotation != 0) { sprintf (_plotter->data->page->point, "RO%d;", _plotter->hpgl_rotation); _update_buffer (_plotter->data->page); } /* Set scaling points P1, P2 at lower left and upper right corners of our viewport; or more accurately, at the two points that (0,0) and (1,1), which are the lower right and upper right corners in NDC space, get mapped to. */ sprintf (_plotter->data->page->point, "IP%d,%d,%d,%d;", IROUND(_plotter->hpgl_p1.x), IROUND(_plotter->hpgl_p1.y), IROUND(_plotter->hpgl_p2.x), IROUND(_plotter->hpgl_p2.y)); _update_buffer (_plotter->data->page); /* Set up `scaled device coordinates' within the viewport. All coordinates in the output file will be scaled device coordinates, not physical device coordinates. The range of scaled coordinates will be independent of the viewport positioning, page size, etc.; see the definitions of xmin,xmax,ymin,ymax in h_defplot.c. */ sprintf (_plotter->data->page->point, "SC%d,%d,%d,%d;", IROUND (_plotter->data->xmin), IROUND (_plotter->data->xmax), IROUND (_plotter->data->ymin), IROUND (_plotter->data->ymax)); _update_buffer (_plotter->data->page); if (_plotter->hpgl_version == 2) { /* Begin to define a palette, by specifying a number of logical pens. (All HP-GL/2 devices should support the `NP' instruction, even though many support only a default palette.) */ if (_plotter->hpgl_can_assign_colors) { sprintf (_plotter->data->page->point, "NP%d;", HPGL2_MAX_NUM_PENS); _update_buffer (_plotter->data->page); } /* use relative units for pen width */ sprintf (_plotter->data->page->point, "WU1;"); _update_buffer (_plotter->data->page); } /* select pen #1 (standard plotting convention) */ sprintf (_plotter->data->page->point, "SP1;"); _update_buffer (_plotter->data->page); /* For HP-GL/2 devices, set transparency mode to `opaque', if the user allows it. It should always be opaque to agree with libplot conventions, but on some HP-GL/2 devices (mostly pen plotters) the `TR' command allegedly does not NOP gracefully. */ if (_plotter->hpgl_version == 2 && _plotter->hpgl_use_opaque_mode) { sprintf (_plotter->data->page->point, "TR0;"); _update_buffer (_plotter->data->page); } /* freeze contents of output buffer, i.e. the initialization code we've just written to it, so that any later invocation of erase(), i.e., erase_page(), won't remove it */ _freeze_outbuf (_plotter->data->page); return true; } void _pl_h_maybe_switch_to_hpgl (S___(Plotter *_plotter)) { } void _pl_q_maybe_switch_to_hpgl (S___(Plotter *_plotter)) { if (_plotter->data->page_number > 1) /* not first page */ /* eject previous page, by issuing PCL command */ { strcpy (_plotter->data->page->point, "\f"); /* i.e. form feed */ _update_buffer (_plotter->data->page); } /* switch from PCL 5 to HP-GL/2 mode */ strcpy (_plotter->data->page->point, "\033%0B\n"); _update_buffer (_plotter->data->page); } plotutils-2.6/libplot/h_path.c0000644000175000017500000005204311037243261013420 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This version is for HPGL and PCL Plotters. By construction, for these Plotters our path buffer always contains either a segment list, or a rectangle or circle object. If it's a segment list, it may include an arbitrary sequence of line, circular arc, and Bezier elements. (For circular arcs to be included, the map from user to device coordinates must be uniform, so that e.g. the angle subtended by the arc will be the same in user and device coordinates.) */ #include "sys-defines.h" #include "extern.h" #define DIST(p0,p1) (sqrt( ((p0).x - (p1).x)*((p0).x - (p1).x) \ + ((p0).y - (p1).y)*((p0).y - (p1).y))) void _pl_h_paint_path (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { plIntPathSegment *xarray; plPoint p0, pp1, pc, savedpoint; bool closed, use_polygon_buffer; double last_x, last_y; int i, polyline_len; bool identical_user_coordinates = true; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /* shouldn't happen*/ break; if ((_plotter->drawstate->path->num_segments >= 3)/*check for closure*/ && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.x == _plotter->drawstate->path->segments[0].p.x) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.y == _plotter->drawstate->path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ /* convert vertices to integer device coordinates, removing runs */ /* array for points, with positions expressed in integer device coors*/ xarray = (plIntPathSegment *)_pl_xmalloc (_plotter->drawstate->path->num_segments * sizeof(plIntPathSegment)); /* add first point of path to xarray[] (type field is a moveto) */ xarray[0].p.x = IROUND(XD(_plotter->drawstate->path->segments[0].p.x, _plotter->drawstate->path->segments[0].p.y)); xarray[0].p.y = IROUND(YD(_plotter->drawstate->path->segments[0].p.x, _plotter->drawstate->path->segments[0].p.y)); polyline_len = 1; /* save user coors of last point added to xarray[] */ last_x = _plotter->drawstate->path->segments[0].p.x; last_y = _plotter->drawstate->path->segments[0].p.y; for (i = 1; i < _plotter->drawstate->path->num_segments; i++) { plPathSegment datapoint; double xuser, yuser, xdev, ydev; int device_x, device_y; datapoint = _plotter->drawstate->path->segments[i]; xuser = datapoint.p.x; yuser = datapoint.p.y; if (xuser != last_x || yuser != last_y) /* in user space, not all points are the same */ identical_user_coordinates = false; xdev = XD(xuser, yuser); ydev = YD(xuser, yuser); device_x = IROUND(xdev); device_y = IROUND(ydev); if (device_x != xarray[polyline_len-1].p.x || device_y != xarray[polyline_len-1].p.y) /* integer device coor(s) changed, so stash point (incl. type field) */ { plPathSegmentType element_type; int device_xc, device_yc; xarray[polyline_len].p.x = device_x; xarray[polyline_len].p.y = device_y; element_type = datapoint.type; xarray[polyline_len].type = element_type; if (element_type == S_ARC) /* an arc element, so compute center, subtended angle too */ { double angle; device_xc = IROUND(XD(datapoint.pc.x, datapoint.pc.y)); device_yc = IROUND(YD(datapoint.pc.x, datapoint.pc.y)); xarray[polyline_len].pc.x = device_xc; xarray[polyline_len].pc.y = device_yc; p0.x = last_x; p0.y = last_y; pp1 = datapoint.p; pc = datapoint.pc; angle = _angle_of_arc (p0, pp1, pc); /* if user coors -> device coors includes a reflection, flip sign */ if (!_plotter->drawstate->transform.nonreflection) angle = -angle; xarray[polyline_len].angle = angle; } else if (element_type == S_CUBIC) /* a cubic Bezier element, so compute control points too */ { xarray[polyline_len].pc.x = IROUND(XD(datapoint.pc.x, datapoint.pc.y)); xarray[polyline_len].pc.y = IROUND(YD(datapoint.pc.x, datapoint.pc.y)); xarray[polyline_len].pd.x = IROUND(XD(datapoint.pd.x, datapoint.pd.y)); xarray[polyline_len].pd.y = IROUND(YD(datapoint.pd.x, datapoint.pd.y)); } /* save user coors of last point added to xarray[] */ last_x = datapoint.p.x; last_y = datapoint.p.y; polyline_len++; } } /* Check first for special subcase: all user-space juncture points in the polyline were mapped to a single integer HP-GL pseudo-pixel. If (1) they weren't all the same to begin with, or (2) they were all the same to begin with and the cap mode is "round", then draw as a filled circle, of diameter equal to the line width; otherwise draw nothing. */ if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* all points mapped to a single integer pseudo-pixel */ { if (identical_user_coordinates == false || _plotter->drawstate->cap_type == PL_CAP_ROUND) { double r = 0.5 * _plotter->drawstate->line_width; double device_frame_radius; /* draw single filled circle, using HP-GL's native circle-drawing facility */ /* move to center of circle */ savedpoint = _plotter->drawstate->pos; _plotter->drawstate->pos = _plotter->drawstate->path->segments[0].p; _pl_h_set_position (S___(_plotter)); _plotter->drawstate->pos = savedpoint; /* set fill color to pen color, arrange to do filling; sync attributes too, incl. pen width */ { /* emit HP-GL directives; select a fill color that's actually the pen color */ _pl_h_set_fill_color (R___(_plotter) true); _pl_h_set_attributes (S___(_plotter)); } /* compute radius in device frame */ device_frame_radius = sqrt(XDV(r,0)*XDV(r,0)+YDV(r,0)*YDV(r,0)); /* Syncing the fill color may have set the _plotter->hpgl_bad_pen flag (e.g. if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before using the pen. */ if (_plotter->hpgl_bad_pen == false) /* fill the circle (360 degree wedge) */ { sprintf (_plotter->data->page->point, "WG%d,0,360;", IROUND(device_frame_radius)); _update_buffer (_plotter->data->page); } /* KLUDGE: in pre-HP-GL/2, our `set_fill_color' function may alter the line type, since it may request *solid* crosshatching; so reset the line type */ if (_plotter->hpgl_version < 2) _pl_h_set_attributes (S___(_plotter)); } /* free our temporary array and depart */ free (xarray); break; } /* At this point, we know we have a nondegenerate path in our pseudo-integer device space. */ /* will draw vectors (or arcs) into polygon buffer if appropriate */ use_polygon_buffer = (_plotter->hpgl_version == 2 || (_plotter->hpgl_version == 1 /* i.e. "1.5" */ && (polyline_len > 2 || _plotter->drawstate->fill_type)) ? true : false); /* Sync pen color. This is needed here only if HPGL_VERSION is 1, but we always do it here so that HP-GL/2 output that draws a polyline, if sent erroneously to a generic HP-GL device, will yield a polyline in the correct color, so long as the color isn't white. */ _pl_h_set_pen_color (R___(_plotter) HPGL_OBJECT_PATH); /* set_pen_color() sets the advisory bad_pen flag if white pen (pen #0) would have been selected, and we can't use pen #0 to draw with. Such a situation isn't fatal if HPGL_VERSION is "1.5" or "2", since we may be filling the polyline with a nonwhite color, as well as using a white pen to draw it. But if HPGL_VERSION is "1", we don't fill polylines, so we might as well punt right now. */ if (_plotter->hpgl_bad_pen && _plotter->hpgl_version == 1) { /* free integer storage buffer and depart */ free (xarray); break; } /* sync attributes, incl. pen width if possible; move pen to p0 */ _pl_h_set_attributes (S___(_plotter)); savedpoint = _plotter->drawstate->pos; _plotter->drawstate->pos = _plotter->drawstate->path->segments[0].p; _pl_h_set_position (S___(_plotter)); _plotter->drawstate->pos = savedpoint; if (use_polygon_buffer) /* have a polygon buffer, and can use it to fill polyline */ { /* enter polygon mode */ strcpy (_plotter->data->page->point, "PM0;"); _update_buffer (_plotter->data->page); } if (use_polygon_buffer || _plotter->drawstate->pen_type) /* either (1) we'll be drawing into a polygon buffer, and will be using it for at least one of (a) filling and (b) edging, or (2) we won't be drawing into a polygon buffer, so we won't be filling, but we'll be edging (because pen_type isn't zero) */ { /* ensure that pen is down for drawing */ if (_plotter->hpgl_pendown == false) { strcpy (_plotter->data->page->point, "PD;"); _update_buffer (_plotter->data->page); _plotter->hpgl_pendown = true; } /* loop through points in xarray[], emitting HP-GL instructions */ i = 1; while (i < polyline_len) { switch ((int)xarray[i].type) { case (int)S_LINE: /* emit one or more pen advances */ strcpy (_plotter->data->page->point, "PA"); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%d,%d", xarray[i].p.x, xarray[i].p.y); _update_buffer (_plotter->data->page); i++; while (i < polyline_len && xarray[i].type == S_LINE) { sprintf (_plotter->data->page->point, ",%d,%d", xarray[i].p.x, xarray[i].p.y); _update_buffer (_plotter->data->page); i++; } sprintf (_plotter->data->page->point, ";"); _update_buffer (_plotter->data->page); break; case (int)S_CUBIC: /* emit one or more cubic Bezier segments */ strcpy (_plotter->data->page->point, "BZ"); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%d,%d,%d,%d,%d,%d", xarray[i].pc.x, xarray[i].pc.y, xarray[i].pd.x, xarray[i].pd.y, xarray[i].p.x, xarray[i].p.y); _update_buffer (_plotter->data->page); i++; while (i < polyline_len && xarray[i].type == S_CUBIC) { sprintf (_plotter->data->page->point, ",%d,%d,%d,%d,%d,%d", xarray[i].pc.x, xarray[i].pc.y, xarray[i].pd.x, xarray[i].pd.y, xarray[i].p.x, xarray[i].p.y); _update_buffer (_plotter->data->page); i++; } sprintf (_plotter->data->page->point, ";"); _update_buffer (_plotter->data->page); break; case (int)S_ARC: { double degrees; int int_degrees; /* emit an arc, using integer sweep angle if possible */ degrees = 180.0 * xarray[i].angle / M_PI; int_degrees = IROUND (degrees); if (_plotter->hpgl_version > 0) /* HPGL_VERSION = 1.5 or 2 */ { if (degrees == (double)int_degrees) sprintf (_plotter->data->page->point, "AA%d,%d,%d;", xarray[i].pc.x, xarray[i].pc.y, int_degrees); else sprintf (_plotter->data->page->point, "AA%d,%d,%.3f;", xarray[i].pc.x, xarray[i].pc.y, degrees); } else /* HPGL_VERSION = 1, i.e. generic HP-GL */ /* note: generic HP-GL can only handle integer sweep angles */ sprintf (_plotter->data->page->point, "AA%d,%d,%d;", xarray[i].pc.x, xarray[i].pc.y, int_degrees); _update_buffer (_plotter->data->page); i++; } break; default: /* shouldn't happen: unknown type for path segment, ignore */ i++; break; } } } if (use_polygon_buffer) /* using polygon mode; will now employ polygon buffer to do filling (possibly) and edging */ { if (!closed) /* polyline is open, so lift pen and exit polygon mode */ { strcpy (_plotter->data->page->point, "PU;"); _update_buffer (_plotter->data->page); _plotter->hpgl_pendown = false; strcpy (_plotter->data->page->point, "PM2;"); _update_buffer (_plotter->data->page); } else /* polyline is closed, so exit polygon mode and then lift pen */ { strcpy (_plotter->data->page->point, "PM2;"); _update_buffer (_plotter->data->page); strcpy (_plotter->data->page->point, "PU;"); _update_buffer (_plotter->data->page); _plotter->hpgl_pendown = false; } if (_plotter->drawstate->fill_type) /* polyline should be filled */ { /* Sync fill color. This may set the _plotter->hpgl_bad_pen flag (if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before using the pen to fill with. */ _pl_h_set_fill_color (R___(_plotter) false); if (_plotter->hpgl_bad_pen == false) /* fill polyline, specifying nonzero winding rule if necessary */ { switch (_plotter->drawstate->fill_rule_type) { case PL_FILL_ODD_WINDING: default: strcpy (_plotter->data->page->point, "FP;"); break; case PL_FILL_NONZERO_WINDING: if (_plotter->hpgl_version == 2) strcpy (_plotter->data->page->point, "FP1;"); else /* pre-HP-GL/2 doesn't support nonzero rule */ strcpy (_plotter->data->page->point, "FP;"); break; } _update_buffer (_plotter->data->page); } /* KLUDGE: in pre-HP-GL/2, our `set_fill_color' function may alter the line type, since it may request *solid* crosshatching; so reset the line type */ if (_plotter->hpgl_version < 2) _pl_h_set_attributes (S___(_plotter)); } if (_plotter->drawstate->pen_type) /* polyline should be edged */ { /* Sync pen color. This may set the _plotter->hpgl_bad_pen flag (if optimal pen is #0 and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before using the pen. */ _pl_h_set_pen_color (R___(_plotter) HPGL_OBJECT_PATH); if (_plotter->hpgl_bad_pen == false) /* select appropriate pen for edging, and edge the polyline */ { _pl_h_set_pen_color (R___(_plotter) HPGL_OBJECT_PATH); strcpy (_plotter->data->page->point, "EP;"); _update_buffer (_plotter->data->page); } } } /* We know where the pen now is: if we used a polygon buffer, then _plotter->hpgl_pos is now xarray[0].p. If we didn't (as would be the case if we're outputting generic HP-GL), then _plotter->hpgl_pos is now xarray[polyline_len - 1].p. Unfortunately we can't simply update _plotter->hpgl_pos, because we want the generated HP-GL[/2] code to work properly on both HP-GL and HP-GL/2 devices. So we punt. */ _plotter->hpgl_position_is_unknown = true; /* free integer storage buffer and depart */ free (xarray); } break; case (int)PATH_BOX: { plPoint p0, p1, savedpoint; p0 = _plotter->drawstate->path->p0; p1 = _plotter->drawstate->path->p1; /* sync line attributes, incl. pen width */ _pl_h_set_attributes (S___(_plotter)); /* move HP-GL pen to first vertex */ savedpoint = _plotter->drawstate->pos; _plotter->drawstate->pos = p0; _pl_h_set_position (S___(_plotter)); _plotter->drawstate->pos = savedpoint; if (_plotter->drawstate->fill_type) /* rectangle should be filled */ { /* Sync fill color. This may set the _plotter->hpgl_bad_pen flag (e.g. if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before using the pen. */ _pl_h_set_fill_color (R___(_plotter) false); if (_plotter->hpgl_bad_pen == false) /* fill the rectangle */ { sprintf (_plotter->data->page->point, "RA%d,%d;", IROUND(XD(p1.x,p1.y)), IROUND(YD(p1.x,p1.y))); _update_buffer (_plotter->data->page); } /* KLUDGE: in pre-HP-GL/2, our `set_fill_color' function may alter the line type, since it may request *solid* crosshatching; so reset it */ if (_plotter->hpgl_version < 2) _pl_h_set_attributes (S___(_plotter)); } if (_plotter->drawstate->pen_type) /* rectangle should be edged */ { /* Sync pen color. This may set the _plotter->hpgl_bad_pen flag (e.g. if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before using the pen. */ _pl_h_set_pen_color (R___(_plotter) HPGL_OBJECT_PATH); if (_plotter->hpgl_bad_pen == false) /* edge the rectangle */ { sprintf (_plotter->data->page->point, "EA%d,%d;", IROUND(XD(p1.x,p1.y)), IROUND(YD(p1.x,p1.y))); _update_buffer (_plotter->data->page); } } } break; case (int)PATH_CIRCLE: { plPoint pc, savedpoint; double r = _plotter->drawstate->path->radius; double radius = sqrt(XDV(r,0)*XDV(r,0)+YDV(r,0)*YDV(r,0)); pc = _plotter->drawstate->path->pc; /* sync attributes, incl. pen width; move to center of circle */ _pl_h_set_attributes (S___(_plotter)); savedpoint = _plotter->drawstate->pos; _plotter->drawstate->pos = pc; _pl_h_set_position (S___(_plotter)); _plotter->drawstate->pos = savedpoint; if (_plotter->drawstate->fill_type) /* circle should be filled */ { /* Sync fill color. This may set the _plotter->hpgl_bad_pen flag (e.g. if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before using the pen. */ _pl_h_set_fill_color (R___(_plotter) false); if (_plotter->hpgl_bad_pen == false) /* fill the circle (360 degree wedge) */ { sprintf (_plotter->data->page->point, "WG%d,0,360;", IROUND(radius)); _update_buffer (_plotter->data->page); } /* KLUDGE: in pre-HP-GL/2, our `set_fill_color' function may alter the line type, since it may request *solid* crosshatching; so reset it */ if (_plotter->hpgl_version < 2) _pl_h_set_attributes (S___(_plotter)); } if (_plotter->drawstate->pen_type) /* circle should be edged */ { /* Sync pen color. This may set the _plotter->hpgl_bad_pen flag (e.g. if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before using the pen. */ _pl_h_set_pen_color (R___(_plotter) HPGL_OBJECT_PATH); if (_plotter->hpgl_bad_pen == false) /* do the edging */ { sprintf (_plotter->data->page->point, "CI%d;", IROUND(radius)); _update_buffer (_plotter->data->page); } } } break; default: /* unrecognized path type, shouldn't happen */ break; } } /* A low-level method for moving the pen position of an HP-GL pen plotter to agree with the Plotter's notion of what the graphics cursor position should be. The state of the pen (up vs. down) after calling this function is not uniquely determined. */ void _pl_h_set_position (S___(Plotter *_plotter)) { int xnew, ynew; /* if plotter's pen position doesn't agree with what it should be, adjust it */ xnew = IROUND(XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y)); ynew = IROUND(YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y)); if (_plotter->hpgl_position_is_unknown == true || xnew != _plotter->hpgl_pos.x || ynew != _plotter->hpgl_pos.y) { if (_plotter->hpgl_pendown == true) { sprintf (_plotter->data->page->point, "PU;PA%d,%d;", xnew, ynew); _plotter->hpgl_pendown = false; } else sprintf (_plotter->data->page->point, "PA%d,%d;", xnew, ynew); _update_buffer (_plotter->data->page); /* update our knowledge of pen position */ _plotter->hpgl_position_is_unknown = false; _plotter->hpgl_pos.x = xnew; _plotter->hpgl_pos.y = ynew; } } bool _pl_h_paint_paths (S___(Plotter *_plotter)) { return false; } plotutils-2.6/libplot/h_point.c0000644000175000017500000000640711037243261013620 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ #include "sys-defines.h" #include "extern.h" /* size of a `point' as fraction of diagonal distance between scaling points P1 and P2, i.e. as fraction of distance between opposite corners of the viewport */ #define POINT_HPGL_SIZE 0.0001 void _pl_h_paint_point (S___(Plotter *_plotter)) { int saved_join_type, saved_cap_type; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* Sync pen color. This may set the _plotter->hpgl_bad_pen flag (if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before drawing the point (see below). */ _pl_h_set_pen_color (R___(_plotter) HPGL_OBJECT_PATH); /* temporarily store line attributes */ saved_join_type = _plotter->drawstate->join_type; saved_cap_type = _plotter->drawstate->cap_type; _plotter->drawstate->join_type = PL_JOIN_ROUND; _plotter->drawstate->cap_type = PL_CAP_ROUND; /* sync line attributes and pen position */ _pl_h_set_attributes (S___(_plotter)); _pl_h_set_position (S___(_plotter)); /* we wish to set a pen width in terms of HP-GL coordinates, which _pl_h_set_attributes can't do; so we do it specially */ if (_plotter->hpgl_version == 2) { if (_plotter->hpgl_pen_width != POINT_HPGL_SIZE) { sprintf (_plotter->data->page->point, "PW%.4f;", 100.0 * POINT_HPGL_SIZE); _update_buffer (_plotter->data->page); _plotter->hpgl_pen_width = POINT_HPGL_SIZE; } } if (_plotter->hpgl_bad_pen == false) /* no problems with nonexistent pen */ { if (_plotter->hpgl_pendown == false) /* N.B. if pen were down, point would be invisible */ { strcpy (_plotter->data->page->point, "PD;"); _update_buffer (_plotter->data->page); _plotter->hpgl_pendown = true; } strcpy (_plotter->data->page->point, "PU;"); _update_buffer (_plotter->data->page); _plotter->hpgl_pendown = false; } /* restore line attributes */ _plotter->drawstate->join_type = saved_join_type; _plotter->drawstate->cap_type = saved_cap_type; } } plotutils-2.6/libplot/h_text.c0000644000175000017500000003444111037243261013452 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This is the low-level method which is used by any HP-GL or PCL Plotter for rendering a single-font label in a PCL, PS, or Stick font. Note: The `PCL 5' output by any PCL Plotter is simply a wrapped version of HP-GL/2. This method internally invokes _pl_h_set_font to select the font. See h_font.c for the font selection code. Before HP-GL/2 (introduced c. 1990), HP-GL devices supported only Stick fonts. In modern PCL5 printers, the suite of 45 PCL fonts is accessible too. Only a few modern high-end PCL5/PS printers (e.g. LaserJet 4000 series laser printers) also support PS fonts in PCL mode. PS fonts are supported by HP-GL/2 and PCL Plotters if the `--enable-ps-fonts-in-pcl' option is specified at configure time. Novel features of this driver include (1) the rightward shift that all fonts need, when accessed through HP-GL, (2) the re-encoding that Stick fonts need, (3) the compensation for the kerning used by full-featured HP-GL devices when rendering variable-width Stick fonts, and (4) the bizarre re-encoding that we apply to ISO-Latin-1 PCL fonts, due to HP's idiosyncratic definition of ISO-Latin-1 ("ECMA-96 Latin 1"): 1. HP-GL rendering of a string is displaced leftward, relative to PS rendering, by an amount equal to the distance between the bounding box left edge and the left edge (`first ink') for the first character. This is so that the first ink will be put on the page right where we start rendering the string. This convention dates back to pen plotter days. The offset[] arrays in g_fontdb.c hold the information that we need to undo this leftward shift by a compensating initial rightward shift. After rendering the string, we undo the shift. 2. On most devices, stick fonts are available only in HP's Roman-8 encoding. So we need to remap them, if they are to be ISO-Latin-1 fonts. There are a few characters missing, but we do our best. 3. Ideally, any HP-GL device kerns the variable-width Stick fonts that it supports, if any. We compensate for this in g_alabel.c by using the spacing tables in g_fontd2.c when computing label widths. The inclusion of kerning in the label width computation affects the horizontal positioning of the label, if it is centered or right-justifified rather than left-justified. 4. PCL fonts (and the PS fonts available in PCL mode on a few high-end devices) in principle support ISO-Latin-1 encoding, natively. However, HP interprets ISO-Latin-1 in an idiosyncratic way. For example, left-quote and right-quote show up as accents, and tilde shows up as a tilde accent. For this reason, for ISO-Latin-1 PCL fonts we use HP's Roman-8 encoding for the lower half, and HP's ISO-Latin-1 encoding for the upper half. */ #include "sys-defines.h" #include "extern.h" #include "h_roman8.h" /* for switching to upper half of font charset, and switching back */ #define SHIFT_OUT 14 /* i.e. ASCII 0x0e, i.e. ^N */ #define SHIFT_IN 15 /* i.e. ASCII 0x0f, i.e. ^O */ /* for DFA that keeps track of which half we're in */ typedef enum { LOWER_HALF, UPPER_HALF } state_type; /* kludge, see comment in code */ #define HP_ROMAN_8_MINUS_CHAR 0366 /* ARGS: h_just,v_just are PL_JUST_{LEFT|CENTER|RIGHT}, PL_JUST_{TOP etc.} */ double _pl_h_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { bool created_temp_string = false; bool reencode_iso_as_roman8 = false; double hp_offset; double theta, costheta, sintheta; int master_font_index; unsigned char *t; unsigned char instruction_buf[4]; /* if empty string, nothing to do */ if (*s == (unsigned char)'\0') return 0.0; /* sanity checks: this routine supports only baseline positioning and left-justification */ if (v_just != PL_JUST_BASE || h_just != PL_JUST_LEFT) return 0.0; /* sanity check, should be unnecessary */ #ifndef USE_PS_FONTS_IN_PCL if (_plotter->drawstate->font_type != PL_F_PCL && _plotter->drawstate->font_type != PL_F_STICK) return 0.0; #else /* USE_PS_FONTS_IN_PCL */ if (_plotter->drawstate->font_type != PL_F_POSTSCRIPT && _plotter->drawstate->font_type != PL_F_PCL && _plotter->drawstate->font_type != PL_F_STICK) return 0.0; #endif /* Many HP-GL interpreters can't handle zero font size. So bail if the font size we'll emit is zero. */ if (_plotter->drawstate->true_font_size == 0.0) return 0.0; /* Our font selection code in h_font.c will divide by zero if the viewport in the device frame has zero area, i.e., if the HP-GL scaling points P1,P2 have the same x or y coordinates. So bail now if that's the case. */ if (_plotter->hpgl_p1.x == _plotter->hpgl_p2.x || _plotter->hpgl_p1.y == _plotter->hpgl_p2.y) return _plotter->get_text_width (R___(_plotter) s); /* compute index of font in master table in g_fontdb.c */ switch (_plotter->drawstate->font_type) { case PL_F_PCL: default: master_font_index = (_pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; break; case PL_F_POSTSCRIPT: master_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; break; case PL_F_STICK: master_font_index = (_pl_g_stick_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; break; } /* label rotation angle in radians, in user frame */ theta = M_PI * _plotter->drawstate->text_rotation / 180.0; sintheta = sin (theta); costheta = cos (theta); switch (_plotter->drawstate->font_type) { case PL_F_PCL: default: if (_pl_g_pcl_font_info[master_font_index].hpgl_symbol_set == PCL_ROMAN_8 && _pl_g_pcl_font_info[master_font_index].iso8859_1) /* An ISO-Latin-1 PCL font, for which we use HP's Roman-8 for lower half and HP's Latin-1 for upper half. Why? Because it's what works best; see comments in the font retrieval code in h_font.c. There is one exception to this: right here, we map the ASCII minus character `-', in the lower half, to HP_ROMAN_8_MINUS_CHAR, i.e., to 0366. This is a kludge, needed to get a character whose width matches the width in the AFM files that HP distributes. */ { state_type dfa_state = LOWER_HALF; unsigned const char *sptr = s; unsigned char *tptr; /* temp string for rewritten label */ t = (unsigned char *)_pl_xmalloc (3 * strlen ((const char *)s) + 1); tptr = t; created_temp_string = true; /* SHIFT_OUT switches to alt. charset, SHIFT_IN back to standard */ while (*sptr) { unsigned char c; c = *sptr++; if (c < 0x80) /* lower half of font, use standard font (HP Roman-8) */ { if (c == '-') /* kludge, map to a char in upper half */ c = HP_ROMAN_8_MINUS_CHAR; if (dfa_state == UPPER_HALF) { *tptr++ = SHIFT_IN; dfa_state = LOWER_HALF; } *tptr++ = c; } else /* upper half of font, use alt. font (HP ECMA-96 Latin-1) */ { if (dfa_state == LOWER_HALF) { *tptr++ = SHIFT_OUT; dfa_state = UPPER_HALF; } *tptr++ = c; } } if (dfa_state == UPPER_HALF) *tptr++ = SHIFT_IN; *tptr = '\0'; /* end of rewritten label */ } else /* a non-ISO-Latin-1 PCL font, no need for reencoding */ t = (unsigned char *)s; break; case PL_F_POSTSCRIPT: /* no need for reencoding (HP's encoding of the font is good enough) */ t = (unsigned char *)s; break; case PL_F_STICK: if (_pl_g_stick_font_info[master_font_index].hpgl_symbol_set == PCL_ROMAN_8 && _pl_g_stick_font_info[master_font_index].iso8859_1) /* stick font uses HP's Roman-8 encoding for its upper half, so must reencode ISO-Latin-1 as Roman-8 */ reencode_iso_as_roman8 = true; if (_plotter->hpgl_version <= 1) /* HP-GL version is no greater than "1.5", i.e. HP7550A; so in h_font.c, we'll have made both lower and upper font halves available as 7-bit fonts that can be switched between via SO/SI */ { bool bogus_upper_half = false; state_type dfa_state = LOWER_HALF; unsigned const char *sptr = s; unsigned char *tptr; /* Check whether font is meant to be a pure 7-bit font with no upper half; if so, we'll ignore all 8-bit characters. This case is recognized by the charset number for the upper half being -1 (see table in g_fontdb.c). */ if (_pl_g_stick_font_info[master_font_index].hpgl_charset_upper < 0) bogus_upper_half = true; /* temp string for rewritten label */ t = (unsigned char *)_pl_xmalloc (3 * strlen ((const char *)s) + 1); tptr = t; created_temp_string = true; /* do 7-bit reencoding, using SO/SI */ /* SHIFT_OUT switches to alt. charset, SHIFT_IN back to standard */ while (*sptr) { unsigned char c; c = *sptr++; if (c >= 0x80 && reencode_iso_as_roman8) /* reencode upper half via lookup table in h_roman8.h */ c = iso_to_roman8[c - 0x80]; if (c < 0x80) /* lower half of font, pass through */ { if (dfa_state == UPPER_HALF) { *tptr++ = SHIFT_IN; dfa_state = LOWER_HALF; } *tptr++ = c; } else /* upper half of font, move to lower half */ if (bogus_upper_half == false) { if (dfa_state == LOWER_HALF) { *tptr++ = SHIFT_OUT; dfa_state = UPPER_HALF; } *tptr++ = c - 0x80; } } /* ensure we switch back to standard font at end of label */ if (dfa_state == UPPER_HALF) *tptr++ = SHIFT_IN; *tptr = '\0'; /* end of rewritten label */ } else /* HP-GL version is "2", i.e. HP-GL/2, so the only Stick fonts we have are 8-bit ones; no need for 7-bit reencoding via a DFA. Will still need to map ISO-Latin-1 to Roman-8, though. */ { unsigned const char *sptr = s; unsigned char *tptr; t = (unsigned char *)_pl_xmalloc (strlen ((const char *)s) + 1); tptr = t; created_temp_string = true; while (*sptr) { if (*sptr < 0x80) *tptr++ = *sptr++; else { if (reencode_iso_as_roman8) /* reencode upper half via lookup table in h_roman8.h */ *tptr++ = iso_to_roman8[(*sptr++) - 0x80]; else *tptr++ = *sptr++; } } *tptr = '\0'; /* end of rewritten label */ } break; } /* compute abovementioned HP-style rightward shift; depends on `offset' for first character in label, i.e. its `first ink' */ switch (_plotter->drawstate->font_type) { case PL_F_PCL: default: /* per-character offset expressed in units where font size = 1000 */ hp_offset = _pl_g_pcl_font_info[master_font_index].offset[*((unsigned char *)s)] / 1000.0; break; case PL_F_POSTSCRIPT: /* per-character offset expressed in units where font size = 1000 */ hp_offset = _pl_g_ps_font_info[master_font_index].offset[*((unsigned char *)s)] / 1000.0; break; case PL_F_STICK: /* Offset expressed in HP's abstract raster units, need to divide by what the font size equals in raster units. (Font size = 2 * raster width, by definition.) */ /* For Stick fonts that we've defined in such a way that the raster width differs between lower and upper halves, not sure what to do here. In particular ArcANK has JIS-ASCII encoding for lower half, with raster width 42, and half-width Katakana encoding for upper half, with raster width 45. For now, just use the raster width for the lower half. */ hp_offset = (((double)(_pl_g_stick_font_info[master_font_index].offset)) / (2.0 * _pl_g_stick_font_info[master_font_index].raster_width_lower)); break; } /* do the rightward shift */ _plotter->drawstate->pos.x += costheta * _plotter->drawstate->true_font_size * hp_offset; _plotter->drawstate->pos.y += sintheta * _plotter->drawstate->true_font_size * hp_offset; /* sync font and pen position */ _pl_h_set_font (S___(_plotter)); _pl_h_set_position (S___(_plotter)); /* Sync pen color. This may set the _plotter->hpgl_bad_pen flag (if optimal pen is #0 [white] and we're not allowed to use pen #0 to draw with). So we test _plotter->hpgl_bad_pen before drawing the label (see below). */ _pl_h_set_pen_color (R___(_plotter) HPGL_OBJECT_LABEL); if (t[0] != '\0' /* i.e. label nonempty */ && _plotter->hpgl_bad_pen == false) /* output the label via an `LB' instruction, including label terminator; don't use sprintf to avoid having to escape % and \ */ { strcpy (_plotter->data->page->point, "LB"); _update_buffer (_plotter->data->page); strcpy (_plotter->data->page->point, (const char *)t); _update_buffer (_plotter->data->page); instruction_buf[0] = (unsigned char)3; /* ^C = default label terminator*/ instruction_buf[1] = ';'; instruction_buf[2] = '\0'; strcpy (_plotter->data->page->point, (const char *)instruction_buf); _update_buffer (_plotter->data->page); /* where is the plotter pen now located?? we don't know, exactly */ _plotter->hpgl_position_is_unknown = true; } if (created_temp_string) /* created a temp string, so free it */ free (t); /* Undo HP's rightward shift */ _plotter->drawstate->pos.x -= costheta * _plotter->drawstate->true_font_size * hp_offset; _plotter->drawstate->pos.y -= sintheta * _plotter->drawstate->true_font_size * hp_offset; return _plotter->get_text_width (R___(_plotter) s); } plotutils-2.6/libplot/f_closepl.c0000644000175000017500000000515411037243260014123 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* For FigPlotter objects, we place all user-defined colors [``color pseudo-objects''], which must appear first in the .fig file, in a header for the page. Note that a Fig file may contain no more than a single page of graphics. Later pages are simply deallocated by closepl(), even though we go to som trouble to prepare them. */ #include "sys-defines.h" #include "extern.h" bool _pl_f_end_page (S___(Plotter *_plotter)) { int i; const char *units; plOutbuf *fig_header; /* prepare Fig header, write it to a plOutbuf */ fig_header = _new_outbuf (); units = (_plotter->data->page_data->metric ? "Metric" : "Inches"); sprintf (fig_header->point, "#FIG 3.2\n%s\n%s\n%s\n%s\n%.2f\n%s\n%d\n%d %d\n", "Portrait", /* portrait mode, not landscape */ "Flush Left", /* justification */ units, /* "Metric" or "Inches" */ _plotter->data->page_data->fig_name, /* paper size */ 100.00, /* export and print magnification */ "Single", /* "Single" or "Multiple" pages */ -2, /* color number for transparent color */ IROUND(FIG_UNITS_PER_INCH), /* Fig units per inch */ 2 /* origin in lower left corner (ignored) */ ); _update_buffer (fig_header); /* output user-defined colors if any */ for (i = 0; i < _plotter->fig_num_usercolors; i++) { sprintf (fig_header->point, "#COLOR\n%d %d #%06lx\n", 0, /* color pseudo-object */ FIG_USER_COLOR_MIN + i, /* color num, in xfig's range */ _plotter->fig_usercolors[i] /* 24-bit RGB value */ ); _update_buffer (fig_header); } /* place header in the plOutbuf for the page */ _plotter->data->page->header = fig_header; return true; } plotutils-2.6/libplot/f_color.c0000644000175000017500000002547111037243260013604 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains device-specific color database access routines. They are called by various FigPlotter methods, before drawing objects. They set the appropriate FigPlotter-specific fields in the drawing state. */ #include "sys-defines.h" #include "extern.h" #define ONEBYTE 0xff /* by setting this undocumented variable, user may request quantization of colors (no user-defined colors, only native xfig ones). */ #ifdef SUPPORT_FIG_COLOR_QUANTIZATION int _libplotfig_use_pseudocolor = 0; #endif /* FIG_COLOR returns the index of the Fig color corresponding to specified a 48-bit RGB value. This has (or may have) a side effect. If the Fig color is not standard, it will be added to the database of user-defined colors, and a Fig `color pseudo-object' will be output later. Note: according to Fig documentation, xfig should support as many as FIG_NUM_USER_COLORS (i.e., 512) user-defined colors. However, I have observed that on at least one platform, it pops up a warning message unless the number is 511 or less. That's why FIG_NUM_USER_COLORS - 1 appears in the code below. We do not call this function whenever the user calls pencolor() or fillcolor(), since we don't want to fill up the database with colors that the user may not actually use. Instead, we call it just before we write a colored object to the output buffer (lazy evaluation), by evaluating the f_set_pen_color() and f_set_fill_color() functions below. If the external variable _libplotfig_use_pseudocolor is nonzero, we don't actually maintain a database of user-defined colors. Instead we just quantize to one of xfig's native 32 colors. (They provide a [rather strange] partition of the color cube; see f_color2.c.) */ /* forward references */ static int _fig_pseudocolor (int red, int green, int blue, const long int *fig_usercolors, int fig_num_usercolors); int _pl_f_fig_color(R___(Plotter *_plotter) int red, int green, int blue) { int fig_fgcolor_red, fig_fgcolor_green, fig_fgcolor_blue; long int fig_fgcolor_rgb; int i; /* xfig supports only 24-bit color, so extract 8 bits for each of R,G,B */ fig_fgcolor_red = (red >> 8) & ONEBYTE; fig_fgcolor_green = (green >> 8) & ONEBYTE; fig_fgcolor_blue = (blue >> 8) & ONEBYTE; #ifdef SUPPORT_FIG_COLOR_QUANTIZATION if (_libplotfig_use_pseudocolor) /* always quantize: approximate by closest standard color, and don't create user-defined colors at all */ return _fig_pseudocolor (fig_fgcolor_red, fig_fgcolor_green, fig_fgcolor_blue, (const long int *)NULL, 0); #endif /* search list of standard colors */ for (i = 0; i < FIG_NUM_STD_COLORS; i++) { if ((_pl_f_fig_stdcolors[i].red == fig_fgcolor_red) && (_pl_f_fig_stdcolors[i].green == fig_fgcolor_green) && (_pl_f_fig_stdcolors[i].blue == fig_fgcolor_blue)) /* perfect match, return it */ return i; } /* This is the 24-bit (i.e. 3-byte) integer used internally by xfig, and also by us when we stored user-defined colors. We assume long ints are wide enough to handle 3 bytes. */ fig_fgcolor_rgb = (fig_fgcolor_red << 16) + (fig_fgcolor_green << 8) + (fig_fgcolor_blue); /* search list of user-defined colors */ for (i = 0; i < _plotter->fig_num_usercolors; i++) { if (_plotter->fig_usercolors[i] == fig_fgcolor_rgb) /* perfect match, return it */ return FIG_USER_COLOR_MIN + i; } /* color wasn't found in either list */ if (_plotter->fig_num_usercolors == FIG_MAX_NUM_USER_COLORS - 1) /* can't add new color to user-defined list, must approximate */ { if (_plotter->fig_colormap_warning_issued == false) { _plotter->warning (R___(_plotter) "supply of user-defined colors is exhausted"); _plotter->fig_colormap_warning_issued = true; } return _fig_pseudocolor (fig_fgcolor_red, fig_fgcolor_green, fig_fgcolor_blue, _plotter->fig_usercolors, FIG_MAX_NUM_USER_COLORS - 1); } else /* create new user-defined color, will emit it to the .fig file */ { _plotter->fig_usercolors[_plotter->fig_num_usercolors] = fig_fgcolor_rgb; _plotter->fig_num_usercolors++; return FIG_USER_COLOR_MIN + _plotter->fig_num_usercolors - 1; } } /* Find closest known point to a specified 24-bit color within the RGB color cube, using Euclidean distance as our metric. We search both Fig's standard colors and a specified number of user-defined colors, which are stored in an array, a pointer to which is passed. Return value is Fig color index. Standard Fig colors are located in 0..FIG_NUM_STD_COLORS-1, and user-defined colors beginning at FIG_USER_COLOR_MIN, which is equal to FIG_NUM_STD_COLORS. */ static int _fig_pseudocolor (int red, int green, int blue, const long int *fig_usercolors, int fig_num_usercolors) { unsigned long int difference = INT_MAX; int i; int best = 0; for (i = 0; i < FIG_NUM_STD_COLORS; i++) { unsigned long int newdifference; if (_pl_f_fig_stdcolors[i].red == 0xff && _pl_f_fig_stdcolors[i].green == 0xff && _pl_f_fig_stdcolors[i].blue == 0xff) /* white is a possible quantization only for white itself (our convention) */ { if (red == 0xff && green == 0xff && blue == 0xff) { difference = 0; best = i; } continue; } newdifference = (((_pl_f_fig_stdcolors[i].red - red) * (_pl_f_fig_stdcolors[i].red - red)) + ((_pl_f_fig_stdcolors[i].green - green) * (_pl_f_fig_stdcolors[i].green - green)) + ((_pl_f_fig_stdcolors[i].blue - blue) * (_pl_f_fig_stdcolors[i].blue - blue))); if (newdifference < difference) { difference = newdifference; best = i; /* save Fig color index */ } } /* search through passed array of user-defined colors too */ for (i = 0; i < fig_num_usercolors; i++) { unsigned long int newdifference; plColor usercolor; /* extract 3 RGB octets from 24-byte Fig-style color */ usercolor.red = (fig_usercolors[i] >> 16) & ONEBYTE; usercolor.green = (fig_usercolors[i] >> 8) & ONEBYTE; usercolor.blue = (fig_usercolors[i] >> 0) & ONEBYTE; newdifference = ((usercolor.red - red) * (usercolor.red - red) + (usercolor.green - green) * (usercolor.green - green) + (usercolor.blue - blue) * (usercolor.blue - blue)); if (newdifference < difference) { difference = newdifference; best = i + FIG_USER_COLOR_MIN; /* save Fig color index */ } } return best; } /* we call this routine to evaluate _plotter->drawstate->fig_fgcolor lazily, i.e. only when needed (just before an object is written to the output buffer) */ void _pl_f_set_pen_color(S___(Plotter *_plotter)) { /* OOB switches to default color */ if (((_plotter->drawstate->fgcolor).red > 0xffff) || ((_plotter->drawstate->fgcolor).green > 0xffff) || ((_plotter->drawstate->fgcolor).blue > 0xffff)) _plotter->drawstate->fig_fgcolor = _default_drawstate.fig_fgcolor; else _plotter->drawstate->fig_fgcolor = _pl_f_fig_color (R___(_plotter) (_plotter->drawstate->fgcolor).red, (_plotter->drawstate->fgcolor).green, (_plotter->drawstate->fgcolor).blue); return; } /* we call this routine to evaluate _plotter->drawstate->fig_fillcolor and _plotter->drawstate->fig_fill_level lazily, i.e. only when needed (just before an object is written to the output buffer) */ void _pl_f_set_fill_color(S___(Plotter *_plotter)) { double fill_level; /* OOB switches to default color */ if (_plotter->drawstate->fillcolor_base.red > 0xffff || _plotter->drawstate->fillcolor_base.green > 0xffff || _plotter->drawstate->fillcolor_base.blue > 0xffff) _plotter->drawstate->fig_fillcolor = _default_drawstate.fig_fillcolor; else _plotter->drawstate->fig_fillcolor = _pl_f_fig_color (R___(_plotter) _plotter->drawstate->fillcolor_base.red, _plotter->drawstate->fillcolor_base.green, _plotter->drawstate->fillcolor_base.blue); /* Now that we know drawstate->fig_fillcolor, we can compute the fig fill level that will match the user's requested fill level. Fig fill level is interpreted in a color dependent way, as follows. The value -1 is special; means no fill at all (objects will be transparent). For other values, this is the interpretation: Color = black or default: fill = 0 -> white fill = 1 -> very light grey . . fill = 19 -> very dark grey fill = 20 -> black Color = all colors other than black or default, including white fill = 0 -> black fill = 1 -> color, very faint intensity . . fill = 19 -> color, very bright intensity fill = 20 -> color, full intensity So 1->20 give increasingly intense "shades" of the color, with 20 giving the color itself. Values 20->40 are increasingly desaturated "tints" of the color, ranging from the color itself (20) to white (40). A tint is defined as the color mixed with white. (Values 21->40 are not used when the color is black or default, or white itself.) */ fill_level = ((double)_plotter->drawstate->fill_type - 1.)/0xFFFE; /* OOB sets fill level to a non-OOB default value */ if (fill_level > 1.) fill_level = ((double)_default_drawstate.fill_type - 1.)/0xFFFE; /* level = 0 turns off filling (objects will be transparent) */ else if (fill_level < 0.) fill_level = -1.0; if (fill_level == -1.0) _plotter->drawstate->fig_fill_level = -1; else { switch (_plotter->drawstate->fig_fillcolor) { case FIG_C_WHITE: /* can't desaturate white */ _plotter->drawstate->fig_fill_level = 20; break; case FIG_C_BLACK: _plotter->drawstate->fig_fill_level = IROUND(20.0 - 20.0 * fill_level); break; default: /* interpret fill level as a saturation */ _plotter->drawstate->fig_fill_level = IROUND(20.0 + 20.0 * fill_level); break; } } return; } plotutils-2.6/libplot/f_color2.c0000644000175000017500000000535611037243260013666 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Fig's 32 standard colors, taken from xfig source. The list includes the 8 standard colors (vertices of the RGB cube, listed first). It also includes three intermediate intensities for each of the 6 standard colors other than black and white (except that yellow is missing, so there are only 5, giving 15 additional shades in all). Also included are 8 random colors (LtBlue, Gold, Brown?, Pink, and Pink?, with ? = 2,3,4) apparently present because someone liked them. LtBlue is the only color in the interior of the cube. */ #include "sys-defines.h" #include "extern.h" const plColor _pl_f_fig_stdcolors[FIG_NUM_STD_COLORS] = { {0x00, 0x00, 0x00}, /* Black */ {0x00, 0x00, 0xff}, /* Blue */ {0x00, 0xff, 0x00}, /* Green */ {0x00, 0xff, 0xff}, /* Cyan */ {0xff, 0x00, 0x00}, /* Red */ {0xff, 0x00, 0xff}, /* Magenta */ {0xff, 0xff, 0x00}, /* Yellow */ {0xff, 0xff, 0xff}, /* White */ {0x00, 0x00, 0x90}, /* Blue4 */ {0x00, 0x00, 0xb0}, /* Blue3 */ {0x00, 0x00, 0xd0}, /* Blue2 */ {0x87, 0xce, 0xff}, /* LtBlue [SkyBlue1 in rgb.txt] */ {0x00, 0x90, 0x00}, /* Green4 */ {0x00, 0xb0, 0x00}, /* Green3 */ {0x00, 0xd0, 0x00}, /* Green2 */ {0x00, 0x90, 0x90}, /* Cyan4 */ {0x00, 0xb0, 0xb0}, /* Cyan3 */ {0x00, 0xd0, 0xd0}, /* Cyan2 */ {0x90, 0x00, 0x00}, /* Red4 */ {0xb0, 0x00, 0x00}, /* Red3 */ {0xd0, 0x00, 0x00}, /* Red2 */ {0x90, 0x00, 0x90}, /* Magenta4 */ {0xb0, 0x00, 0xb0}, /* Magenta3 */ {0xd0, 0x00, 0xd0}, /* Magenta2 */ {0x80, 0x30, 0x00}, /* Brown4, ad hoc */ {0xa0, 0x40, 0x00}, /* Brown3, ad hoc */ {0xc0, 0x60, 0x00}, /* Brown2, ad hoc */ {0xff, 0x80, 0x80}, /* Pink4, ad hoc */ {0xff, 0xa0, 0xa0}, /* Pink3, ad hoc */ {0xff, 0xc0, 0xc0}, /* Pink2, ad hoc */ {0xff, 0xe0, 0xe0}, /* Pink, ad hoc */ {0xff, 0xd7, 0x00} /* Gold [as in rgb.txt] */ }; plotutils-2.6/libplot/f_defplot.c0000644000175000017500000002101611037243260014112 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any FigPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a FigPlotter struct. */ const Plotter _pl_f_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_f_initialize, _pl_f_terminate, /* page manipulation */ _pl_f_begin_page, _pl_f_erase_page, _pl_f_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_f_paint_path, _pl_f_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_f_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_f_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_f_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ /* For FigPlotter objects, we determine the page size and the location of the viewport on the page, so that we'll be able to work out the map from user coordinates to device coordinates in space.c. */ void _pl_f_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_FIG; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_ONE_PAGE; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 0; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 0; _plotter->data->have_settable_bg = 0; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 1; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_POSTSCRIPT; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = true; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_UNIFORM; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_circle_scaling = AS_UNIFORM; _plotter->data->allowed_ellipse_scaling = AS_ANY; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI; _plotter->data->flipped_y = true; _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize data members specific to this derived class */ /* dynamic variables */ _plotter->fig_drawing_depth = FIG_INITIAL_DEPTH; _plotter->fig_num_usercolors = 0; /* note: this driver also uses fig_usercolors[] */ _plotter->fig_colormap_warning_issued = false; /* initialize certain data members from device driver parameters */ /* Determine range of device coordinates over which the viewport will extend (and hence the transformation from user to device coordinates; see g_space.c). */ { /* determine page type, viewport size and location */ _set_page_type (_plotter->data); /* convert viewport size-and-location data (in terms of inches) to device coordinates (i.e. Fig units) */ _plotter->data->xmin = (FIG_UNITS_PER_INCH * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset)); _plotter->data->xmax = (FIG_UNITS_PER_INCH * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset + _plotter->data->viewport_xsize)); /* Fig coor system has flipped y: y=0 is at the top of the page */ _plotter->data->ymin = (FIG_UNITS_PER_INCH * (_plotter->data->page_data->ysize - (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset))); _plotter->data->ymax = (FIG_UNITS_PER_INCH * (_plotter->data->page_data->ysize - (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset + _plotter->data->viewport_ysize))); } /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_f_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER FigPlotter::FigPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_f_initialize (); } FigPlotter::FigPlotter (FILE *outfile) :Plotter (outfile) { _pl_f_initialize (); } FigPlotter::FigPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_f_initialize (); } FigPlotter::FigPlotter (ostream& out) : Plotter (out) { _pl_f_initialize (); } FigPlotter::FigPlotter () { _pl_f_initialize (); } FigPlotter::FigPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_f_initialize (); } FigPlotter::FigPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_f_initialize (); } FigPlotter::FigPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_f_initialize (); } FigPlotter::FigPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_f_initialize (); } FigPlotter::FigPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_f_initialize (); } FigPlotter::~FigPlotter () { _pl_f_terminate (); } #endif plotutils-2.6/libplot/f_erase.c0000644000175000017500000000226211037243260013556 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_f_erase_page (S___(Plotter *_plotter)) { /* reset our knowledge of xfig's internal state */ _plotter->fig_drawing_depth = FIG_INITIAL_DEPTH; _plotter->fig_num_usercolors = 0; /* forget user-defined colors */ return true; } plotutils-2.6/libplot/f_openpl.c0000644000175000017500000000253211037243260013754 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_f_begin_page (S___(Plotter *_plotter)) { /* With each call to openpl(), we reset our knowledge of Fig's internal state, i.e. the dynamic Fig-specific data members of the FigPlotter. The values are the same as are used in initializing the FigPlotter (see f_defplot.c). */ _plotter->fig_drawing_depth = FIG_INITIAL_DEPTH; _plotter->fig_num_usercolors = 0; return true; } plotutils-2.6/libplot/f_path.c0000644000175000017500000006225611234111474013424 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This version is for FigPlotters. By construction, for FigPlotters our path buffer always contains either a segment list, or a rectangle or circle or ellipse object. If it's a segment list, it consists of either (1) a sequence of line segments, or (2) a single circular arc segment. Those are the only sorts of path that xfig can handle. (For the last to be included, the map from user to device coordinates must be uniform.) */ #include "sys-defines.h" #include "extern.h" /* subtypes of xfig POLYLINE object type (xfig numbering) */ #define P_OPEN 1 #define P_BOX 2 #define P_CLOSED 3 /* subtypes of xfig ELLIPSE object type (xfig numbering) */ #define SUBTYPE_ELLIPSE 1 /* ellipse defined by radii */ #define SUBTYPE_CIRCLE 3 /* circle defined by radius */ /* Fig's line styles, indexed into by internal line number (PL_L_SOLID/PL_L_DOTTED/PL_L_DOTDASHED/PL_L_SHORTDASHED/PL_L_LONGDASHED/PL_L_DOTDOTDASHED) */ const int _pl_f_fig_line_style[PL_NUM_LINE_TYPES] = { FIG_L_SOLID, FIG_L_DOTTED, FIG_L_DASHDOTTED, FIG_L_DASHED, FIG_L_DASHED, FIG_L_DASHDOUBLEDOTTED, FIG_L_DASHTRIPLEDOTTED }; /* Fig join styles, indexed by internal number (miter/rd./bevel/triangular) */ const int _pl_f_fig_join_style[PL_NUM_JOIN_TYPES] = { FIG_JOIN_MITER, FIG_JOIN_ROUND, FIG_JOIN_BEVEL, FIG_JOIN_ROUND }; /* Fig cap styles, indexed by internal number (butt/rd./project/triangular) */ const int _pl_f_fig_cap_style[PL_NUM_CAP_TYPES] = { FIG_CAP_BUTT, FIG_CAP_ROUND, FIG_CAP_PROJECT, FIG_CAP_ROUND }; #define FUZZ 0.0000001 void _pl_f_paint_path (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { bool closed; const char *format; int i, polyline_subtype, line_style; double nominal_spacing; double device_line_width; int quantized_device_line_width; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /*shouldn't happen */ break; if (_plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[1].type == S_ARC) /* segment buffer contains a single arc, not a polyline */ { double x0 = _plotter->drawstate->path->segments[0].p.x; double y0 = _plotter->drawstate->path->segments[0].p.y; double x1 = _plotter->drawstate->path->segments[1].p.x; double y1 = _plotter->drawstate->path->segments[1].p.y; double xc = _plotter->drawstate->path->segments[1].pc.x; double yc = _plotter->drawstate->path->segments[1].pc.y; _pl_f_draw_arc_internal (R___(_plotter) xc, yc, x0, y0, x1, y1); break; } if ((_plotter->drawstate->path->num_segments >= 3)/*check for closure*/ && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.x == _plotter->drawstate->path->segments[0].p.x) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.y == _plotter->drawstate->path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ if (closed) { polyline_subtype = P_CLOSED; format = "#POLYLINE [CLOSED]\n%d %d %d %d %d %d %d %d %d %.3f %d %d %d %d %d %d"; } else { polyline_subtype = P_OPEN; format = "#POLYLINE [OPEN]\n%d %d %d %d %d %d %d %d %d %.3f %d %d %d %d %d %d"; } /* evaluate fig colors lazily, i.e. only when needed */ _pl_f_set_pen_color (S___(_plotter)); _pl_f_set_fill_color (S___(_plotter)); /* In a .fig file, the width of a line is expressed as a non-negative integer (a positive integer, if the line is to be visible). Originally, the width, if positive, was interpreted as a multiple of a fundamental `Fig display unit', namely 1/80 inch. However, the interpretation of the in-file line width was subsequently changed, thus: Width in .fig file Width as actually displayed by xfig 1 0.5 2 1 3 2 4 3 etc. In consequence, our line width in terms of Fig display units usually needs to be adjusted upward, before we round it to the closest integer. Thanks to Wolfgang Glunz and Bart De Schutter for pointing this out. (See the addition of 0.75 below, which is what they recommend.) */ device_line_width = FIG_UNITS_TO_FIG_DISPLAY_UNITS(_plotter->drawstate->device_line_width); if (device_line_width > 0.75) device_line_width += 1.0; /* round xfig's notion of the line width to the closest integer; but never round it down to 0 (which would yield an invisible line) if the line width in user coordinates is positive; instead, round it upward to 1 */ quantized_device_line_width = IROUND(device_line_width); if (quantized_device_line_width == 0 && device_line_width > 0.0) quantized_device_line_width = 1; /* compute line style (type of dotting/dashing, spacing of dots/dashes)*/ _pl_f_compute_line_style (R___(_plotter) &line_style, &nominal_spacing); /* update xfig's `depth' attribute */ if (_plotter->fig_drawing_depth > 0) (_plotter->fig_drawing_depth)--; sprintf(_plotter->data->page->point, format, 2, /* polyline object */ polyline_subtype, /* polyline subtype */ line_style, /* Fig line style */ /* thickness, in Fig display units */ (_plotter->drawstate->pen_type == 0 ? 0 : quantized_device_line_width), _plotter->drawstate->fig_fgcolor, /* pen color */ _plotter->drawstate->fig_fillcolor, /* fill color */ _plotter->fig_drawing_depth, /* depth */ 0, /* pen style, ignored */ _plotter->drawstate->fig_fill_level, /* area fill */ nominal_spacing, /* style val, in Fig display units (float) */ _pl_f_fig_join_style[_plotter->drawstate->join_type],/*join style */ _pl_f_fig_cap_style[_plotter->drawstate->cap_type], /* cap style */ 0, /* radius(of arc boxes, ignored here) */ 0, /* forward arrow */ 0, /* backward arrow */ _plotter->drawstate->path->num_segments /*num points in line */ ); _update_buffer (_plotter->data->page); for (i=0; i<_plotter->drawstate->path->num_segments; i++) { plPathSegment datapoint; double xu, yu, xd, yd; int device_x, device_y; datapoint = _plotter->drawstate->path->segments[i]; xu = datapoint.p.x; yu = datapoint.p.y; xd = XD(xu, yu); yd = YD(xu, yu); device_x = IROUND(xd); device_y = IROUND(yd); if ((i%5) == 0) sprintf (_plotter->data->page->point, "\n\t");/* make human-readable */ else sprintf (_plotter->data->page->point, " "); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%d %d", device_x, device_y); _update_buffer (_plotter->data->page); } sprintf (_plotter->data->page->point, "\n"); _update_buffer (_plotter->data->page); } break; case (int)PATH_BOX: { plPoint p0, p1; p0 = _plotter->drawstate->path->p0; p1 = _plotter->drawstate->path->p1; _pl_f_draw_box_internal (R___(_plotter) p0, p1); } break; case (int)PATH_CIRCLE: { double x = _plotter->drawstate->path->pc.x; double y = _plotter->drawstate->path->pc.y; double r = _plotter->drawstate->path->radius; _pl_f_draw_ellipse_internal (R___(_plotter) x, y, r, r, 0.0, SUBTYPE_CIRCLE); } break; case (int)PATH_ELLIPSE: { double x = _plotter->drawstate->path->pc.x; double y = _plotter->drawstate->path->pc.y; double rx = _plotter->drawstate->path->rx; double ry = _plotter->drawstate->path->ry; double angle = _plotter->drawstate->path->angle; _pl_f_draw_ellipse_internal (R___(_plotter) x, y, rx, ry, angle, SUBTYPE_ELLIPSE); } break; default: /* shouldn't happen */ break; } } /* Emit Fig code for an arc. This is called if the segment buffer contains not a polyline, but a single circular arc. If an arc was placed there, we can count on the map from the user frame to the device frame being isotropic (so the arc will be circular in the device frame too), and we can count on the arc not being of zero length. See g_arc.c. */ #define DIST(p1, p2) sqrt( ((p1).x - (p2).x) * ((p1).x - (p2).x) \ + ((p1).y - (p2).y) * ((p1).y - (p2).y)) void _pl_f_draw_arc_internal (R___(Plotter *_plotter) double xc, double yc, double x0, double y0, double x1, double y1) { plPoint p0, p1, pc, pb; plVector v, v0, v1; double cross, radius, nominal_spacing; int line_style, orientation; double device_line_width; int quantized_device_line_width; pc.x = xc, pc.y = yc; p0.x = x0, p0.y = y0; p1.x = x1, p1.y = y1; /* vectors from pc to p0, and pc to p1 */ v0.x = p0.x - pc.x; v0.y = p0.y - pc.y; v1.x = p1.x - pc.x; v1.y = p1.y - pc.y; /* cross product, zero means points are collinear */ cross = v0.x * v1.y - v1.x * v0.y; /* Compute orientation. Note libplot convention: if p0, p1, pc are collinear then arc goes counterclockwise from p0 to p1. */ orientation = (cross >= 0.0 ? 1 : -1); radius = DIST(pc, p0); /* radius is distance to p0 or p1 */ v.x = p1.x - p0.x; /* chord vector from p0 to p1 */ v.y = p1.y - p0.y; _vscale(&v, radius); pb.x = pc.x + orientation * v.y; /* bisection point of arc */ pb.y = pc.y - orientation * v.x; /* evaluate fig colors lazily, i.e. only when needed */ _pl_f_set_pen_color (S___(_plotter)); _pl_f_set_fill_color (S___(_plotter)); /* xfig expresses the width of a line as an integer number of `Fig display units', so convert the width to those units */ device_line_width = FIG_UNITS_TO_FIG_DISPLAY_UNITS(_plotter->drawstate->device_line_width); /* the interpretation of line width in a .fig file is now more complicated (see comments in _pl_f_paint_path() above), so this value must usually be incremented */ if (device_line_width > 0.75) device_line_width += 1.0; /* round xfig's notion of the line width to the closest integer; but never round it down to 0 (which would yield an invisible line) if the line width in user coordinates is positive; instead, round it upward to 1 */ quantized_device_line_width = IROUND(device_line_width); if (quantized_device_line_width == 0 && device_line_width > 0.0) quantized_device_line_width = 1; /* compute line style (type of dotting/dashing, spacing of dots/dashes) */ _pl_f_compute_line_style (R___(_plotter) &line_style, &nominal_spacing); /* update xfig's `depth' attribute */ if (_plotter->fig_drawing_depth > 0) (_plotter->fig_drawing_depth)--; /* compute orientation in NDC frame */ orientation *= (_plotter->drawstate->transform.nonreflection ? 1 : -1); if (orientation == -1) /* interchange p0, p1 (since xfig insists that p0, pb, p1 must appear in counterclockwise order around the arc) */ { plPoint ptmp; ptmp = p0; p0 = p1; p1 = ptmp; } sprintf(_plotter->data->page->point, "#ARC\n%d %d %d %d %d %d %d %d %d %.3f %d %d %d %d %.3f %.3f %d %d %d %d %d %d\n", 5, /* arc object */ 1, /* open-ended arc subtype */ line_style, /* Fig line style */ /* thickness, in Fig display units */ (_plotter->drawstate->pen_type == 0 ? 0 : quantized_device_line_width), _plotter->drawstate->fig_fgcolor, /* pen color */ _plotter->drawstate->fig_fillcolor, /* fill color */ _plotter->fig_drawing_depth, /* depth */ 0, /* pen style, ignored */ _plotter->drawstate->fig_fill_level, /* area fill */ nominal_spacing, /* style val, in Fig display units (float) */ _pl_f_fig_cap_style[_plotter->drawstate->cap_type], /* cap style */ 1, /* counterclockwise */ 0, /* no forward arrow */ 0, /* no backward arrow */ XD(pc.x, pc.y), /* center_x (float) */ YD(pc.x, pc.y), /* center_y (float) */ IROUND(XD(p0.x, p0.y)), /* 1st point user entered (p0) */ IROUND(YD(p0.x, p0.y)), IROUND(XD(pb.x, pb.y)), /* 2nd point user entered (bisection point)*/ IROUND(YD(pb.x, pb.y)), IROUND(XD(p1.x, p1.y)), /* last point user entered (p1) */ IROUND(YD(p1.x, p1.y))); _update_buffer (_plotter->data->page); } void _pl_f_draw_box_internal (R___(Plotter *_plotter) plPoint p0, plPoint p1) { int xd0, xd1, yd0, yd1; /* in device coordinates */ double nominal_spacing; int line_style; double device_line_width; int quantized_device_line_width; /* evaluate fig colors lazily, i.e. only when needed */ _pl_f_set_pen_color (S___(_plotter)); _pl_f_set_fill_color (S___(_plotter)); /* xfig expresses the width of a line as an integer number of `Fig display units', so convert the width to those units */ device_line_width = FIG_UNITS_TO_FIG_DISPLAY_UNITS(_plotter->drawstate->device_line_width); /* the interpretation of line width in a .fig file is now more complicated (see comments in _pl_f_paint_path() above), so this value must usually be incremented */ if (device_line_width > 0.75) device_line_width += 1.0; /* round xfig's notion of the line width to the closest integer; but never round it down to 0 (which would yield an invisible line) if the line width in user coordinates is positive; instead, round it upward to 1 */ quantized_device_line_width = IROUND(device_line_width); if (quantized_device_line_width == 0 && device_line_width > 0.0) quantized_device_line_width = 1; /* compute line style (type of dotting/dashing, spacing of dots/dashes)*/ _pl_f_compute_line_style (R___(_plotter) &line_style, &nominal_spacing); /* update xfig's `depth' attribute */ if (_plotter->fig_drawing_depth > 0) (_plotter->fig_drawing_depth)--; sprintf(_plotter->data->page->point, "#POLYLINE [BOX]\n%d %d %d %d %d %d %d %d %d %.3f %d %d %d %d %d %d\n", 2, /* polyline object */ P_BOX, /* polyline subtype */ line_style, /* Fig line style */ /* thickness, in Fig display units */ (_plotter->drawstate->pen_type == 0 ? 0 : quantized_device_line_width), _plotter->drawstate->fig_fgcolor, /* pen color */ _plotter->drawstate->fig_fillcolor, /* fill color */ _plotter->fig_drawing_depth, /* depth */ 0, /* pen style, ignored */ _plotter->drawstate->fig_fill_level, /* area fill */ nominal_spacing, /* style val, in Fig display units (float) */ _pl_f_fig_join_style[_plotter->drawstate->join_type], /* join style */ _pl_f_fig_cap_style[_plotter->drawstate->cap_type], /* cap style */ 0, /* radius (of arc boxes, ignored here) */ 0, /* forward arrow */ 0, /* backward arrow */ 5 /* number of points in line */ ); _update_buffer (_plotter->data->page); p0 = _plotter->drawstate->path->p0; p1 = _plotter->drawstate->path->p1; xd0 = IROUND(XD(p0.x, p0.y)); yd0 = IROUND(YD(p0.x, p0.y)); xd1 = IROUND(XD(p1.x, p1.y)); yd1 = IROUND(YD(p1.x, p1.y)); sprintf (_plotter->data->page->point, "\t%d %d ", xd0, yd0); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%d %d ", xd0, yd1); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%d %d ", xd1, yd1); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%d %d ", xd1, yd0); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%d %d\n", xd0, yd0); _update_buffer (_plotter->data->page); } void _pl_f_draw_ellipse_internal (R___(Plotter *_plotter) double x, double y, double rx, double ry, double angle, int subtype) { const char *format; double theta, mixing_angle; double ux, uy, vx, vy; double semi_axis_1_x, semi_axis_1_y; double semi_axis_2_x, semi_axis_2_y; double rx_device, ry_device, theta_device; double costheta, sintheta; double nominal_spacing; int line_style; double device_line_width; int quantized_device_line_width; /* inclination angle (radians), in user frame */ theta = M_PI * angle / 180.0; costheta = cos (theta); sintheta = sin (theta); /* perform affine user->device coor transformation; (ux,uy) and (vx,vy) are forward images of the semiaxes, i.e. they are conjugate radial vectors in the device frame */ ux = XDV(rx * costheta, rx * sintheta); uy = YDV(rx * costheta, rx * sintheta); vx = XDV(-ry * sintheta, ry * costheta); vy = YDV(-ry * sintheta, ry * costheta); /* angle by which the conjugate radial vectors should be mixed, in order to yield vectors along the major and minor axes in the device frame */ mixing_angle = 0.5 * _xatan2 (2.0 * (ux * vx + uy * vy), ux * ux + uy * uy - vx * vx + vy * vy); /* semi-axis vectors in device coordinates */ semi_axis_1_x = ux * cos(mixing_angle) + vx * sin(mixing_angle); semi_axis_1_y = uy * cos(mixing_angle) + vy * sin(mixing_angle); semi_axis_2_x = ux * cos(mixing_angle + M_PI_2) + vx * sin(mixing_angle + M_PI_2); semi_axis_2_y = uy * cos(mixing_angle + M_PI_2) + vy * sin(mixing_angle + M_PI_2); /* semi-axis lengths in device coordinates */ rx_device = sqrt (semi_axis_1_x * semi_axis_1_x + semi_axis_1_y * semi_axis_1_y); ry_device = sqrt (semi_axis_2_x * semi_axis_2_x + semi_axis_2_y * semi_axis_2_y); /* angle of inclination of the first semi-axis, in device frame (note flipped-y convention) */ theta_device = - _xatan2 (semi_axis_1_y, semi_axis_1_x); if (theta_device == 0.0) theta_device = 0.0; /* remove sign bit if any */ if (subtype == SUBTYPE_CIRCLE && IROUND (rx_device) != IROUND (ry_device)) subtype = SUBTYPE_ELLIPSE; /* evaluate fig colors lazily, i.e. only when needed */ _pl_f_set_pen_color (S___(_plotter)); _pl_f_set_fill_color (S___(_plotter)); /* xfig expresses the width of a line as an integer number of `Fig display units', so convert the width to those units */ device_line_width = FIG_UNITS_TO_FIG_DISPLAY_UNITS(_plotter->drawstate->device_line_width); /* the interpretation of line width in a .fig file is now more complicated (see comments in _pl_f_paint_path() above), so this value must usually be incremented */ if (device_line_width > 0.75) device_line_width += 1.0; /* round xfig's notion of the line width to the closest integer; but never round it down to 0 (which would yield an invisible line) if the line width in user coordinates is positive; instead, round it upward to 1 */ quantized_device_line_width = IROUND(device_line_width); if (quantized_device_line_width == 0 && device_line_width > 0.0) quantized_device_line_width = 1; /* compute line style (type of dotting/dashing, spacing of dots/dashes) */ _pl_f_compute_line_style (R___(_plotter) &line_style, &nominal_spacing); /* update xfig's `depth' attribute */ if (_plotter->fig_drawing_depth > 0) (_plotter->fig_drawing_depth)--; if (subtype == SUBTYPE_CIRCLE) format = "#ELLIPSE [CIRCLE]\n%d %d %d %d %d %d %d %d %d %.3f %d %.3f %d %d %d %d %d %d %d %d\n"; else format = "#ELLIPSE\n%d %d %d %d %d %d %d %d %d %.3f %d %.3f %d %d %d %d %d %d %d %d\n"; sprintf(_plotter->data->page->point, format, 1, /* ellipse object */ subtype, /* subtype, see above */ line_style, /* Fig line style */ /* thickness, in Fig display units */ (_plotter->drawstate->pen_type == 0 ? 0 : quantized_device_line_width), _plotter->drawstate->fig_fgcolor, /* pen color */ _plotter->drawstate->fig_fillcolor, /* fill color */ _plotter->fig_drawing_depth, /* depth */ 0, /* pen style, ignored */ _plotter->drawstate->fig_fill_level, /* area fill */ nominal_spacing, /* style val, in Fig display units (float) */ 1, /* direction, always 1 */ theta_device, /* inclination angle, in radians (float) */ IROUND(XD(x,y)), /* center_x (not float, unlike arc) */ IROUND(YD(x,y)), /* center_y (not float, unlike arc) */ IROUND(rx_device), /* radius_x */ IROUND(ry_device), /* radius_y */ IROUND(XD(x,y)), /* start_x, 1st point entered */ IROUND(YD(x,y)), /* start_y, 1st point entered */ IROUND(XD(x,y) /* end_x, last point entered */ + semi_axis_1_x + semi_axis_2_x), IROUND(YD(x,y) /* end_y, last point entered */ + semi_axis_1_y + semi_axis_2_y) ); _update_buffer(_plotter->data->page); } /* compute appropriate Fig line style, and also appropriate value for Fig's notion of `dash length/dot gap' (in Fig display units) */ void _pl_f_compute_line_style (R___(Plotter *_plotter) int *style, double *spacing) { int fig_line_style; double fig_nominal_spacing; if (_plotter->drawstate->dash_array_in_effect && _plotter->drawstate->dash_array_len == 2 && (_plotter->drawstate->dash_array[1] == _plotter->drawstate->dash_array[0])) /* special case of user-specified dashing (equal on/off lengths); we map this into Fig's `dashed' line type */ { double min_sing_val, max_sing_val; /* Minimum singular value is the nominal device-frame line width divided by the actual user-frame line-width (see g_linewidth.c), so it's the user->device frame conversion factor. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); /* desired cycle length in Fig display units */ fig_nominal_spacing = FIG_UNITS_TO_FIG_DISPLAY_UNITS(min_sing_val * 2.0 * _plotter->drawstate->dash_array[0]); fig_line_style = FIG_L_DASHED; } else if (_plotter->drawstate->dash_array_in_effect && _plotter->drawstate->dash_array_len == 2 && (_plotter->drawstate->dash_array[1] > (3 - FUZZ) * _plotter->drawstate->dash_array[0]) && (_plotter->drawstate->dash_array[1] < (3 + FUZZ) * _plotter->drawstate->dash_array[0])) /* special case of user-specified dashing (gap length = 3 * dash length); we map this into Fig's `dotted' line type, since it agrees with libplot's convention for dashing `dotted' lines (see g_dash2.c) */ { double min_sing_val, max_sing_val; _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); /* desired cycle length in Fig display units */ fig_nominal_spacing = FIG_UNITS_TO_FIG_DISPLAY_UNITS(min_sing_val * 4.0 * _plotter->drawstate->dash_array[0]); fig_line_style = FIG_L_DOTTED; } else /* canonical line type; retrieve dash array from database (in g_dash2.c) */ { int i, num_dashes, cycle_length; const int *dash_array; double display_size_in_fig_units, min_dash_unit, dash_unit; num_dashes = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array_len; dash_array = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array; cycle_length = 0; for (i = 0; i < num_dashes; i++) cycle_length += dash_array[i]; /* multiply cycle length of dash array by device-frame line width in Fig display units, with a floor on the latter (see comments at head of file) */ display_size_in_fig_units = DMIN(_plotter->data->xmax - _plotter->data->xmin, /* flipped y */ _plotter->data->ymin - _plotter->data->ymax); min_dash_unit = PL_MIN_DASH_UNIT_AS_FRACTION_OF_DISPLAY_SIZE * FIG_UNITS_TO_FIG_DISPLAY_UNITS(display_size_in_fig_units); dash_unit = DMAX(min_dash_unit, FIG_UNITS_TO_FIG_DISPLAY_UNITS(_plotter->drawstate->device_line_width)); /* desired cycle length in Fig display units */ fig_nominal_spacing = cycle_length * dash_unit; fig_line_style = _pl_f_fig_line_style[_plotter->drawstate->line_type]; } /* compensate for Fig's (or fig2dev's) peculiarities; value stored in Fig output file isn't really the cycle length */ switch (fig_line_style) { case FIG_L_SOLID: default: /* shouldn't happen */ break; case FIG_L_DOTTED: fig_nominal_spacing -= 1.0; break; case FIG_L_DASHDOTTED: fig_nominal_spacing -= 1.0; /* fall thru */ case FIG_L_DASHED: fig_nominal_spacing *= 0.5; break; case FIG_L_DASHDOUBLEDOTTED: fig_nominal_spacing -= 2.0; fig_nominal_spacing /= (1.9 + 1/3.0); /* really */ break; case FIG_L_DASHTRIPLEDOTTED: fig_nominal_spacing -= 3.0; fig_nominal_spacing /= 2.4; break; } if (fig_nominal_spacing <= 1.0) fig_nominal_spacing = 1.0; /* pass back what Fig will need */ *style = fig_line_style; *spacing = fig_nominal_spacing; } bool _pl_f_paint_paths (S___(Plotter *_plotter)) { return false; } plotutils-2.6/libplot/f_point.c0000644000175000017500000000552411037243260013614 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ /* So far as a FigPlotter objects goes, a point is a single-vertex polyline (that is the only sort of point that xfig supports). */ #include "sys-defines.h" #include "extern.h" /* xfig polyline subtypes */ #define P_OPEN 1 #define P_BOX 2 #define P_CLOSED 3 void _pl_f_paint_point (S___(Plotter *_plotter)) { double x, y; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* evaluate fig colors lazily, i.e. only when needed */ _pl_f_set_pen_color (S___(_plotter)); _pl_f_set_fill_color (S___(_plotter)); /* update xfig's `depth' attribute */ if (_plotter->fig_drawing_depth > 0) (_plotter->fig_drawing_depth)--; /* get location */ x = _plotter->drawstate->pos.x; y = _plotter->drawstate->pos.x; sprintf(_plotter->data->page->point, "#POLYLINE [OPEN]\n%d %d %d %d %d %d %d %d %d %.3f %d %d %d %d %d %d\n\t%d %d\n", 2, /* polyline object */ P_OPEN, /* polyline subtype */ FIG_L_SOLID, /* style */ 1, /* thickness, in Fig display units */ _plotter->drawstate->fig_fgcolor, /* pen color */ _plotter->drawstate->fig_fgcolor, /* fill color */ _plotter->fig_drawing_depth, /* depth */ 0, /* pen style, ignored */ 20, /* fig fill level (20 = full intensity) */ 0.0, /* style val, ignored (?) */ FIG_JOIN_ROUND, /* join style = round */ FIG_CAP_ROUND, /* cap style = round */ 0, /* radius (of arc boxes, ignored) */ 0, /* forward arrow */ 0, /* backward arrow */ 1, /* number of points in polyline */ IROUND(XD(x,y)), IROUND(YD(x,y)) ); _update_buffer (_plotter->data->page); } } plotutils-2.6/libplot/f_retrieve.c0000644000175000017500000001052711037243260014307 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the Plotter-specific _retrieve_font method, which is called by the _set_font() function, which in turn is invoked by the API functions alabel() and flabelwidth(). It is called when the font_name, font_size, and textangle fields of the current drawing state have been filled in. It retrieves the specified font, and fills in the font_type, typeface_index, font_index, font_is_iso8858, true_font_size, and font_ascent, and font_descent fields of the drawing state. */ /* This version is for FigPlotters. It also fills in the fig_point_size field of the drawing state. */ /* This Fig-specific version is needed because xfig supports arbitrary (non-integer) font sizes for PS fonts only on paper. The current releases (3.1 and 3.2) of xfig round them to integers. So we quantize the user-specified font size in such a way that the font size that xfig will see, and use, will be precisely an integer. */ #include "sys-defines.h" #include "extern.h" bool _pl_f_retrieve_font (S___(Plotter *_plotter)) { double theta; double dx, dy, device_dx, device_dy, device_vector_len; double pointsize, fig_pointsize, size, quantized_size; int int_fig_pointsize; double quantization_factor; /* sanity check */ if (_plotter->drawstate->font_type != PL_F_POSTSCRIPT) return false; if (!_plotter->drawstate->transform.uniform || !_plotter->drawstate->transform.nonreflection) /* anamorphically transformed PS font not supported, will use Hershey */ return false; /* text rotation in radians */ theta = _plotter->drawstate->text_rotation * M_PI / 180.0; /* unit vector along which we'll move when printing label */ dx = cos (theta); dy = sin (theta); /* convert to device frame, and compute length in fig units */ device_dx = XDV(dx, dy); device_dy = YDV(dx, dy); device_vector_len = sqrt(device_dx * device_dx + device_dy * device_dy); /* compute xfig pointsize we should use when printing a string in a PS font, so as to match this vector length. */ size = _plotter->drawstate->font_size; /* in user units */ pointsize = FIG_UNITS_TO_POINTS(size * device_vector_len); /* FIG_FONT_SCALING = 80/72 is a silly undocumented factor that shouldn't exist, but does. In xfig, a `point' is not 1/72 inch, but 1/80 inch! */ fig_pointsize = FIG_FONT_SCALING * pointsize; /* integer xfig pointsize (which really refers to ascent, not overall size)*/ int_fig_pointsize = IROUND(fig_pointsize); /* Integer font size that xfig will see, in the .fig file. If this is zero, we won't actually emit a text object to the .fig file, since xfig can't handle text strings with zero font size. See f_text.c. */ _plotter->drawstate->fig_font_point_size = int_fig_pointsize; /* what size in user units should have been, to make fig_font_point_size an integer */ if (device_vector_len == 0.0) quantized_size = 0.0; /* degenerate case */ else quantized_size = (POINTS_TO_FIG_UNITS((double)int_fig_pointsize / FIG_FONT_SCALING)) / (device_vector_len); _plotter->drawstate->true_font_size = quantized_size; /* quantize other fields */ if (size == 0.0) quantization_factor = 0.0; /* degenerate case */ else quantization_factor = quantized_size / size; _plotter->drawstate->font_ascent *= quantization_factor; _plotter->drawstate->font_descent *= quantization_factor; _plotter->drawstate->font_cap_height *= quantization_factor; return true; } plotutils-2.6/libplot/f_text.c0000644000175000017500000001730711037243260013451 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the Fig-driver-specific version of the low-level paint_text_string() method, which is called to plot a label in the current PS font, at the current fontsize and textangle. The label is just a string: no control codes (font switching or sub/superscripts). The width of the string in user units is returned. This version does not support `sheared' fonts, since xfig does not support them. But it does support center-justification and right justification as well as the default left-justification, since the xfig format supports them. */ #include "sys-defines.h" #include "extern.h" #define FONT_TYPE_LATEX 0 /* don't support LaTeX fonts currently */ #define FONT_TYPE_PS 4 #define GOOD_PRINTABLE_ASCII(c) ((c >= 0x20) && (c <= 0x7E)) /* Fig horizontal alignment styles, indexed by internal number (left/center/right) */ #define FIG_ALIGN_LEFT 0 #define FIG_ALIGN_CENTER 1 #define FIG_ALIGN_RIGHT 2 static const int fig_horizontal_alignment_style[PL_NUM_HORIZ_JUST_TYPES] = { FIG_ALIGN_LEFT, FIG_ALIGN_CENTER, FIG_ALIGN_RIGHT }; /* This prints a single-font, single-font-size label. When this is called, the current point is on the intended baseline of the label. */ /* ARGS: h_just,v_just are PL_JUST_{LEFT|CENTER|RIGHT}, PL_JUST_{TOP etc.} */ double _pl_f_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { int len, master_font_index; unsigned char *ptr, *t; double theta, costheta, sintheta; double label_width, label_ascent; double initial_x, initial_y; double horizontal_x, horizontal_y, vertical_x, vertical_y; double horizontal_fig_length, vertical_fig_length; double horizontal_fig_x, vertical_fig_x; double horizontal_fig_y, vertical_fig_y; double angle_device; /* sanity check */ if (_plotter->drawstate->font_type != PL_F_POSTSCRIPT) return 0.0; /* sanity check; this routine supports only baseline positioning */ if (v_just != PL_JUST_BASE) return 0.0; /* if empty string, nothing to do */ if (*s == (unsigned char)'\0') return 0.0; /* if font (previously retrieved) has a font size of zero in terms of integer `Fig points', bail out right now, since xfig can't handle text strings with zero point size */ if (_plotter->drawstate->fig_font_point_size == 0) return 0.0; /* label rotation angle in radians */ theta = M_PI * _plotter->drawstate->text_rotation / 180.0; sintheta = sin (theta); costheta = cos (theta); /* compute index of font in master table of PS fonts, in g_fontdb.h */ master_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* compute label height and width, in user units */ label_width = _plotter->get_text_width (R___(_plotter) s); label_ascent = _plotter->drawstate->true_font_size * (_pl_g_ps_font_info[master_font_index]).font_ascent / 1000.0; /* vector along baseline of label, and an orthogonal vector which is the other side of a rectangle containing the portion of the string above the baseline (both in the user frame) */ horizontal_x = costheta * label_width; horizontal_y = sintheta * label_width; vertical_x = - sintheta * label_ascent; vertical_y = costheta * label_ascent; /* Convert two above orthogonal vectors to the device frame, and compute their lengths. In the device frame they may no longer be orthogonal. But xfig supports setting up only rectangular `hot regions', so we'll use their lengths as the sides of a rectangle. If user coor->device coor map is highly sheared, this would be inappropriate. Incidentally, the height of the rectangular hot region should really be the string ascent (from its bounding box), not the font ascent. But since we don't include the bounding boxes of individual characters in our g_fontdb.c, we have no way of computing the former. */ horizontal_fig_x = XDV(horizontal_x, horizontal_y); horizontal_fig_y = YDV(horizontal_x, horizontal_y); horizontal_fig_length = sqrt(horizontal_fig_x * horizontal_fig_x + horizontal_fig_y * horizontal_fig_y); /* text angle in device frame (note flipped-y convention) */ angle_device = - _xatan2 (horizontal_fig_y, horizontal_fig_x); if (angle_device == 0.0) angle_device = 0.0; /* remove sign bit if any */ /* avoid triggering a bug in xfig, which as of release 3.2.2 can't handle rotated text strings consisting of a single space character (they cause it to crash) */ if (angle_device != 0.0 && strcmp ((const char *)s, " ") == 0) return _plotter->get_text_width (R___(_plotter) s); vertical_fig_x = XDV(vertical_x, vertical_y); vertical_fig_y = YDV(vertical_x, vertical_y); vertical_fig_length = sqrt(vertical_fig_x * vertical_fig_x + vertical_fig_y * vertical_fig_y); /* where we should start from, in device frame (i.e. in Fig units) */ initial_x = XD((_plotter->drawstate->pos).x, (_plotter->drawstate->pos).y); initial_y = YD((_plotter->drawstate->pos).x, (_plotter->drawstate->pos).y); /* evaluate fig colors lazily, i.e. only when needed */ _pl_f_set_pen_color (S___(_plotter)); /* escape all backslashes in the text string, before output */ len = strlen ((char *)s); ptr = (unsigned char *)_pl_xmalloc ((4 * len + 1) * sizeof(char)); t = ptr; while (*s) { switch (*s) { case '\\': *ptr++ = (unsigned char)'\\'; *ptr++ = *s++; break; default: if GOOD_PRINTABLE_ASCII (*s) *ptr++ = *s++; else { sprintf ((char *)ptr, "\\%03o", (unsigned int)*s); ptr += 4; s++; } break; } } *ptr = (unsigned char)'\0'; /* update xfig's `depth' attribute */ if (_plotter->fig_drawing_depth > 0) (_plotter->fig_drawing_depth)--; sprintf(_plotter->data->page->point, "#TEXT\n%d %d %d %d %d %d %.3f %.3f %d %.3f %.3f %d %d %s\\001\n", 4, /* text object */ /* xfig supports 3 justification types: left, center, or right. */ fig_horizontal_alignment_style[h_just],/* horizontal just. type */ _plotter->drawstate->fig_fgcolor, /* pen color */ _plotter->fig_drawing_depth, /* depth */ 0, /* pen style, ignored */ _pl_g_ps_font_info[master_font_index].fig_id, /* Fig font id */ (double)_plotter->drawstate->fig_font_point_size, /* point size (float) */ angle_device, /* text rotation in radians (float) */ FONT_TYPE_PS, /* Fig font type */ /* these next two are used only for setting up `hot spots' */ vertical_fig_length, /* string height, Fig units (float) */ horizontal_fig_length, /* string width, Fig units (float) */ /* coors of origin of label, in Fig units */ IROUND(initial_x), IROUND(initial_y), t); /* munged string */ free (t); _update_buffer (_plotter->data->page); return label_width; } plotutils-2.6/libplot/c_attribs.c0000644000175000017500000004234311037243260014130 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This internal method is invoked by a CGMPlotter before drawing any path. It sets the relevant CGM attributes (line type, cap type, join type, line width) to what they should be. */ #include "sys-defines.h" #include "extern.h" /* CGM join styles, indexed by internal number (miter/rd./bevel/triangular) */ static const int _cgm_join_style[PL_NUM_JOIN_TYPES] = { CGM_JOIN_MITER, CGM_JOIN_ROUND, CGM_JOIN_BEVEL, CGM_JOIN_ROUND }; /* CGM cap styles, indexed by internal number (butt/rd./project/triangular) */ /* Note: we map libplot's triangular cap style to CGM's round cap style, not CGM's triangular cap style, since the latter plots an equilateral triangle, which is not libplot's convention. */ static const int _cgm_cap_style[PL_NUM_CAP_TYPES] = { CGM_CAP_BUTT, CGM_CAP_ROUND, CGM_CAP_PROJECTING, CGM_CAP_ROUND }; /* ARGS: object type = close path / open path / marker etc. */ void _pl_c_set_attributes (R___(Plotter *_plotter) int object_type) { int desired_width = _plotter->drawstate->quantized_device_line_width; int desired_line_type = CGM_L_SOLID; /* keep compiler happy */ double desired_dash_offset = 0.0; if (_plotter->drawstate->pen_type == 0) /* won't be edging; at most, will be filling; so nothing to do */ return; /* alter CGM line width if necessary */ switch (object_type) { case CGM_OBJECT_OPEN: if (_plotter->cgm_line_width != desired_width) /* emit "LINE WIDTH" command */ { int byte_count, data_byte_count, data_len; data_len = CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 3, data_len, &byte_count, "LINEWIDTH"); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_width, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update line width */ _plotter->cgm_line_width = desired_width; } break; case CGM_OBJECT_CLOSED: if (_plotter->cgm_edge_width != desired_width) /* emit "EDGE WIDTH" command */ { int byte_count, data_byte_count, data_len; data_len = CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 28, data_len, &byte_count, "EDGEWIDTH"); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_width, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge width */ _plotter->cgm_edge_width = desired_width; } break; default: /* shouldn't happen */ break; } /* determine line type */ if (_plotter->data->have_dash_array && _plotter->drawstate->dash_array_in_effect) /* user specified a dash array, and this version of CGM supports them; so compute a CGM-style dash array, and maybe add a new line type to page-specific line type table */ { int num_dashes = _plotter->drawstate->dash_array_len; int our_num_dashes = num_dashes; /* will double if array length is odd */ if (num_dashes > 0) /* non-solid line type */ { double min_sing_val, max_sing_val; int i, *dashbuf; plCGMCustomLineType *line_type_ptr, *old_line_type_ptr; int line_type; bool odd_length, matched_line_type; /* compute minimum singular value of user->device coordinate map, which we use as a multiplicative factor to convert line widths (cf. g_linewidth.c), dash lengths, etc. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); /* double array length if odd (we don't trust CGM interpreters to handle odd-length dash arrays in the way that PS does) */ odd_length = (num_dashes % 2 != 0 ? true : false); if (odd_length) our_num_dashes *= 2; dashbuf = (int *)_pl_xmalloc (our_num_dashes * sizeof(int)); for (i = 0; i < num_dashes; i++) { double dashlen; int i_dashlen; dashlen = min_sing_val * _plotter->drawstate->dash_array[i]; i_dashlen = IROUND(dashlen); if (i_dashlen == 0 && dashlen > 0.0) i_dashlen = 1; /* don't use 0 if user specified non-0 */ dashbuf[i] = i_dashlen; if (odd_length) dashbuf[i + num_dashes] = i_dashlen; } /* compute offset as fraction of cycle length; must be in range [0.0,1.0] (CGM convention) */ { int cycle_length = 0; for (i = 0; i < our_num_dashes; i++) cycle_length += dashbuf[i]; /* cycle length now guaranteed to be > 0 */ desired_dash_offset = min_sing_val * _plotter->drawstate->dash_offset / cycle_length; desired_dash_offset -= IFLOOR(desired_dash_offset); if (desired_dash_offset < 0.0 || desired_dash_offset >= 1.0) desired_dash_offset = 0.0; } /* search table of user-defined, page-specific CGM line types; they're numbered -1, -2, -3, ... */ line_type_ptr = (plCGMCustomLineType *)_plotter->data->page->extra; old_line_type_ptr = (plCGMCustomLineType *)NULL; line_type = 0; matched_line_type = false; while (line_type_ptr != (plCGMCustomLineType *)NULL) { line_type--; if (line_type_ptr->dash_array_len == our_num_dashes) { bool foundit = true; for (i = 0; i < our_num_dashes; i++) { if (dashbuf[i] != line_type_ptr->dashes[i]) { foundit = false; break; /* break out of for loop */ } } if (foundit) { matched_line_type = true; break; /* break out of while loop */ } } /* on to next entry in line type table */ old_line_type_ptr = line_type_ptr; line_type_ptr = line_type_ptr->next; } /* on exit from while(), either matched_line_type = true (with line_type set correctly), or old_line_type_ptr points to tail of line type list, and `line_type' is the last valid type */ if (matched_line_type) { desired_line_type = line_type; free (dashbuf); } else { /* construct new record from `dashbuf', add to tail of list; `dashbuf' and the record will be freed when the page is written out */ plCGMCustomLineType *newguy; newguy = (plCGMCustomLineType *)_pl_xmalloc (sizeof(plCGMCustomLineType)); newguy->dashes = dashbuf; newguy->dash_array_len = our_num_dashes; newguy->next = (plCGMCustomLineType *)NULL; if (old_line_type_ptr != (plCGMCustomLineType *)NULL) old_line_type_ptr->next = newguy; else _plotter->data->page->extra = newguy; /* new line type index is one less than most negative previously defined index */ desired_line_type = line_type - 1; } } else /* zero-length dash array, i.e. solid line type */ { desired_line_type = CGM_L_SOLID; desired_dash_offset = 0.0; } } else /* dash array not in effect or cannot be used, use one of CGM's canonical line types instead */ { switch (_plotter->drawstate->line_type) { case PL_L_SOLID: default: desired_line_type = CGM_L_SOLID; break; case PL_L_DOTTED: desired_line_type = CGM_L_DOTTED; break; case PL_L_DOTDASHED: desired_line_type = CGM_L_DOTDASHED; break; case PL_L_SHORTDASHED: desired_line_type = CGM_L_DASHED; break; case PL_L_LONGDASHED: /* can't distinguish from shortdashed */ desired_line_type = CGM_L_DASHED; break; case PL_L_DOTDOTDASHED: desired_line_type = CGM_L_DOTDOTDASHED; break; case PL_L_DOTDOTDOTDASHED: /* map to "dotdotdashed" */ desired_line_type = CGM_L_DOTDOTDASHED; break; } desired_dash_offset = 0.0; } switch (object_type) { case CGM_OBJECT_OPEN: if (_plotter->cgm_line_type != desired_line_type) /* emit "LINE TYPE" command */ { int byte_count, data_byte_count, data_len; data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 2, data_len, &byte_count, "LINETYPE"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, desired_line_type, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update line type */ _plotter->cgm_line_type = desired_line_type; } if (_plotter->cgm_max_version >= 3 && _plotter->cgm_dash_offset != desired_dash_offset) /* emit "LINE TYPE INITIAL OFFSET" command */ { int byte_count, data_byte_count, data_len; data_len = 4; /* 4 bytes per fixed-pt. real */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 40, data_len, &byte_count, "LINETYPEINITOFFSET"); _cgm_emit_real_fixed_point (_plotter->data->page, false, _plotter->cgm_encoding, desired_dash_offset, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update dash offset, and CGM version needed for this page */ _plotter->cgm_dash_offset = desired_dash_offset; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } break; case CGM_OBJECT_CLOSED: if (_plotter->cgm_edge_type != desired_line_type) /* emit "EDGE TYPE" command */ { int byte_count, data_byte_count, data_len; data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 27, data_len, &byte_count, "EDGETYPE"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, desired_line_type, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge type */ _plotter->cgm_edge_type = desired_line_type; } if (_plotter->cgm_max_version >= 3 && _plotter->cgm_edge_dash_offset != desired_dash_offset) /* emit "EDGE TYPE INITIAL OFFSET" command */ { int byte_count, data_byte_count, data_len; data_len = 4; /* 4 bytes per fixed-pt. real */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 47, data_len, &byte_count, "EDGETYPEINITOFFSET"); _cgm_emit_real_fixed_point (_plotter->data->page, false, _plotter->cgm_encoding, desired_dash_offset, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update dash offset, and CGM version needed for this page */ _plotter->cgm_edge_dash_offset = desired_dash_offset; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } break; default: break; } if (_plotter->cgm_max_version >= 3) /* have line/edge cap/join style, and miter limit commands */ { int desired_join_style = _cgm_join_style[_plotter->drawstate->join_type]; int desired_cap_style = _cgm_cap_style[_plotter->drawstate->cap_type]; double desired_miter_limit = _plotter->drawstate->miter_limit; switch (object_type) { case CGM_OBJECT_OPEN: if (_plotter->cgm_cap_style != desired_cap_style) /* emit "LINE CAP" command */ { int byte_count, data_byte_count, data_len; /* set line cap style */ data_len = 2 * 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 37, data_len, &byte_count, "LINECAP"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, desired_cap_style, data_len, &data_byte_count, &byte_count); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, CGM_DASH_CAP_MATCH, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update cap style, and CGM version needed for this page */ _plotter->cgm_cap_style = desired_cap_style; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } break; case CGM_OBJECT_CLOSED: if (_plotter->cgm_edge_cap_style != desired_cap_style) /* emit "EDGE CAP" command */ { int byte_count, data_byte_count, data_len; data_len = 2 * 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 44, data_len, &byte_count, "EDGECAP"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, desired_cap_style, data_len, &data_byte_count, &byte_count); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, CGM_DASH_CAP_MATCH, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge cap style, and CGM version needed for this page */ _plotter->cgm_edge_cap_style = desired_cap_style; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } break; default: break; } switch (object_type) { case CGM_OBJECT_OPEN: if (_plotter->cgm_join_style != desired_join_style) /* emit "LINE JOIN" command */ { int byte_count, data_byte_count, data_len; /* set line join style */ data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 38, data_len, &byte_count, "LINEJOIN"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, desired_join_style, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update join style, and CGM version needed for this page */ _plotter->cgm_join_style = desired_join_style; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } break; case CGM_OBJECT_CLOSED: if (_plotter->cgm_edge_join_style != desired_join_style) /* emit "EDGE JOIN" command */ { int byte_count, data_byte_count, data_len; /* do it over again, this time for edge join style */ data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 45, data_len, &byte_count, "EDGEJOIN"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, desired_join_style, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge join style, and CGM version needed for this page*/ _plotter->cgm_edge_join_style = desired_join_style; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } break; default: break; } if (_plotter->cgm_miter_limit != desired_miter_limit) /* emit "MITRE LIMIT" command */ { int byte_count, data_byte_count, data_len; data_len = 4; /* 4 bytes per fixed-point real */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_CONTROL_ELEMENT, 19, data_len, &byte_count, "MITRELIMIT"); _cgm_emit_real_fixed_point (_plotter->data->page, false, _plotter->cgm_encoding, desired_miter_limit, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update miter limit, and CGM version needed for this page */ _plotter->cgm_miter_limit = desired_miter_limit; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } } } plotutils-2.6/libplot/c_closepl.c0000644000175000017500000000765411037243260014127 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This version is used for CGMPlotters, which emit graphics only after all pages of graphics have been drawn, and the Plotter is deleted. Such Plotters maintain a linked list of pages (graphics are only written to the output stream when a Plotter is deleted, and the appropriate `terminate' method is invoked). */ #include "sys-defines.h" #include "extern.h" bool _pl_c_end_page (S___(Plotter *_plotter)) { int i, fullstrength, red, green, blue; /* update CGM profile for this page to take into account number of user-defined line types (nonzero only if output file can include version-3 constructs; see c_attribs.c) */ { plCGMCustomLineType *line_type_ptr = (plCGMCustomLineType *)_plotter->data->page->extra; int num_line_types = 0; bool violates_profile = false; while (line_type_ptr != (plCGMCustomLineType *)NULL) { if (line_type_ptr->dash_array_len > CGM_PL_MAX_DASH_ARRAY_LENGTH) violates_profile = true; line_type_ptr = line_type_ptr->next; num_line_types++; } if (num_line_types > CGM_MAX_CUSTOM_LINE_TYPES) violates_profile = true; if (violates_profile) _plotter->cgm_page_profile = IMAX(_plotter->cgm_page_profile, CGM_PROFILE_NONE); } /* update CGM version number for this page to take into account whether fonts were used on it; if allowed version is >=3 then we'll emit version-3 "FONT PROPERTIES" commands for every font (see c_defplot.c) */ if (_plotter->cgm_max_version >= 3) { for (i = 0; i < PL_NUM_PS_FONTS; i++) { if (_plotter->data->page->ps_font_used[i] == true) { _plotter->cgm_page_version = IMAX(_plotter->cgm_page_version, 3); break; } } } /* update the CGM version number of the output file, and its profile type, to take this page into account */ _plotter->cgm_version = IMAX(_plotter->cgm_version, _plotter->cgm_page_version); _plotter->cgm_profile = IMAX(_plotter->cgm_profile, _plotter->cgm_page_profile); /* Check whether a color other than black or white has been used on this page: check the background color in particular (all other colors have already been taken into account). */ red = _plotter->cgm_bgcolor.red; green = _plotter->cgm_bgcolor.green; blue = _plotter->cgm_bgcolor.blue; fullstrength = (1 << (8 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT)) - 1; if ((red != 0 || green != 0 || blue != 0) && (red != fullstrength || green != fullstrength || blue != fullstrength)) _plotter->cgm_page_need_color = true; /* update `color needed' flag to take this page into account */ if (_plotter->cgm_page_need_color) _plotter->cgm_need_color = true; /* copy the background color from the CGM Plotter into the `bgcolor' element of the plOutbuf for this page (we'll use it when writing the page header into the CGM output file, see c_defplot.c) */ _plotter->data->page->bg_color = _plotter->cgm_bgcolor; _plotter->data->page->bg_color_suppressed = _plotter->cgm_bgcolor_suppressed; /* color is really "none"? */ return true; } plotutils-2.6/libplot/c_color.c0000644000175000017500000002654411037243260013603 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains device-specific color database access routines. These routines are called by various CGMPlotter methods, before drawing objects. The CGM output file will use either 24-bit RGB or 48-bit RGB, depending on the value of CGM_BINARY_BYTES_PER_COLOR_COMPONENT (set in extern.h; 1 or 2, respectively). This code assumes that the value is 1 or 2, even though CGM files allow 3 or 4 as well. To handle the `4' case, we should rewrite this to use unsigned ints rather than signed ints. The reason we don't bother with 3 or 4 is that internally, libplot uses 48-bit color. So 48-bit RGB in the CGM output file is all we need. */ #include "sys-defines.h" #include "extern.h" void _pl_c_set_pen_color(R___(Plotter *_plotter) int cgm_object_type) { int red_long, green_long, blue_long; int red, green, blue; int byte_count, data_byte_count, data_len; int fullstrength; if (_plotter->drawstate->pen_type == 0 && cgm_object_type != CGM_OBJECT_TEXT) /* don't do anything, pen color will be ignored when writing objects */ return; /* 48-bit RGB */ red_long = _plotter->drawstate->fgcolor.red; green_long = _plotter->drawstate->fgcolor.green; blue_long = _plotter->drawstate->fgcolor.blue; /* 24-bit or 48-bit RGB (as used in CGMs) */ switch (CGM_BINARY_BYTES_PER_COLOR_COMPONENT) { case 1: /* 24-bit */ red = (((unsigned int)red_long) >> 8) & 0xff; green = (((unsigned int)green_long) >> 8) & 0xff; blue = (((unsigned int)blue_long) >> 8) & 0xff; break; case 2: default: /* 48-bit */ red = red_long; green = green_long; blue = blue_long; break; } fullstrength = (1 << (8 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT)) - 1; if ((red != 0 || green != 0 || blue != 0) && (red != fullstrength || green != fullstrength || blue != fullstrength)) _plotter->cgm_page_need_color = true; switch (cgm_object_type) { case CGM_OBJECT_OPEN: if (_plotter->cgm_line_color.red != red || _plotter->cgm_line_color.green != green || _plotter->cgm_line_color.blue != blue) /* emit "LINE_COLOR" command */ { data_len = 3 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 4, data_len, &byte_count, "LINECOLR"); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)red, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)green, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)blue, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of CGM's pen color */ _plotter->cgm_line_color.red = red; _plotter->cgm_line_color.green = green; _plotter->cgm_line_color.blue = blue; } break; case CGM_OBJECT_CLOSED: if (_plotter->cgm_edge_color.red != red || _plotter->cgm_edge_color.green != green || _plotter->cgm_edge_color.blue != blue) /* emit "EDGE_COLOR" command */ { data_len = 3 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 29, data_len, &byte_count, "EDGECOLR"); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)red, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)green, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)blue, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of CGM's edge color */ _plotter->cgm_edge_color.red = red; _plotter->cgm_edge_color.green = green; _plotter->cgm_edge_color.blue = blue; } break; case CGM_OBJECT_MARKER: if (_plotter->cgm_marker_color.red != red || _plotter->cgm_marker_color.green != green || _plotter->cgm_marker_color.blue != blue) /* emit "MARKER COLOR" command */ { data_len = 3 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 8, data_len, &byte_count, "MARKERCOLR"); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)red, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)green, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)blue, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of CGM's marker color */ _plotter->cgm_marker_color.red = red; _plotter->cgm_marker_color.green = green; _plotter->cgm_marker_color.blue = blue; } break; case CGM_OBJECT_TEXT: if (_plotter->cgm_text_color.red != red || _plotter->cgm_text_color.green != green || _plotter->cgm_text_color.blue != blue) /* emit "TEXT COLOR" command */ { data_len = 3 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 14, data_len, &byte_count, "TEXTCOLR"); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)red, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)green, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)blue, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of CGM's text color */ _plotter->cgm_text_color.red = red; _plotter->cgm_text_color.green = green; _plotter->cgm_text_color.blue = blue; } break; default: break; } } void _pl_c_set_fill_color(R___(Plotter *_plotter) int cgm_object_type) { int red_long, green_long, blue_long; int red, green, blue; int fullstrength; int byte_count, data_byte_count, data_len; if (_plotter->drawstate->fill_type == 0) /* don't do anything, fill color will be ignored when writing objects */ return; if (cgm_object_type != CGM_OBJECT_OPEN && cgm_object_type != CGM_OBJECT_CLOSED) /* don't do anything; won't be filling */ return; /* obtain each RGB as a 16-bit quantity (48 bits in all) */ red_long = _plotter->drawstate->fillcolor.red; green_long = _plotter->drawstate->fillcolor.green; blue_long = _plotter->drawstate->fillcolor.blue; /* 24-bit or 48-bit RGB (as used in CGMs) */ switch (CGM_BINARY_BYTES_PER_COLOR_COMPONENT) { case 1: /* 24-bit */ red = (((unsigned int)red_long) >> 8) & 0xff; green = (((unsigned int)green_long) >> 8) & 0xff; blue = (((unsigned int)blue_long) >> 8) & 0xff; break; case 2: default: /* 48-bit */ red = red_long; green = green_long; blue = blue_long; break; } fullstrength = (1 << (8 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT)) - 1; if ((red != 0 || green != 0 || blue != 0) && (red != fullstrength || green != fullstrength || blue != fullstrength)) _plotter->cgm_page_need_color = true; if (_plotter->cgm_fillcolor.red != red || _plotter->cgm_fillcolor.green != green || _plotter->cgm_fillcolor.blue != blue) /* emit "FILL COLOR" command */ { data_len = 3 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 23, data_len, &byte_count, "FILLCOLR"); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)red, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)green, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (_plotter->data->page, false, _plotter->cgm_encoding, (unsigned int)blue, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of CGM's fill color */ _plotter->cgm_fillcolor.red = red; _plotter->cgm_fillcolor.green = green; _plotter->cgm_fillcolor.blue = blue; } } void _pl_c_set_bg_color(S___(Plotter *_plotter)) { int red_long, green_long, blue_long; int red, green, blue; /* 48-bit RGB */ red_long = _plotter->drawstate->bgcolor.red; green_long = _plotter->drawstate->bgcolor.green; blue_long = _plotter->drawstate->bgcolor.blue; /* 24-bit or 48-bit RGB (as used in CGMs) */ switch (CGM_BINARY_BYTES_PER_COLOR_COMPONENT) { case 1: /* 24-bit */ red = (((unsigned int)red_long) >> 8) & 0xff; green = (((unsigned int)green_long) >> 8) & 0xff; blue = (((unsigned int)blue_long) >> 8) & 0xff; break; case 2: default: /* 48-bit */ red = red_long; green = green_long; blue = blue_long; break; } /* update our knowledge of what CGM's background color should be (we'll use it only when we write the picture header) */ _plotter->cgm_bgcolor.red = red; _plotter->cgm_bgcolor.green = green; _plotter->cgm_bgcolor.blue = blue; /* should the just-computed color be ignored, i.e., did the user really specify "none" as the background color? */ _plotter->cgm_bgcolor_suppressed = _plotter->drawstate->bgcolor_suppressed; } plotutils-2.6/libplot/c_defplot.c0000644000175000017500000020002611037267374014123 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any CGMPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" /* localtime_r() is currently not used, because there is apparently _no_ universal way of ensuring that it is declared. On some systems (e.g. Red Hat Linux), `#define _POSIX_SOURCE' will do it. But on other systems, doing `#define _POSIX_SOURCE' **removes** the declaration! */ #ifdef HAVE_LOCALTIME_R #undef HAVE_LOCALTIME_R #endif #ifdef MSDOS #include /* for fsync() */ #endif /* song and dance to define time_t, and declare both time() and localtime() */ #ifdef HAVE_SYS_TYPES_H #include /* for time_t on some pre-ANSI Unix systems */ #endif #ifdef TIME_WITH_SYS_TIME #include /* for time() on some pre-ANSI Unix systems */ #include /* for localtime() */ #else /* not TIME_WITH_SYS_TIME, include only one (prefer ) */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ /* forward references */ static void build_sdr_from_index (plOutbuf *sdr_buffer, int cgm_encoding, int x); static void build_sdr_from_string (plOutbuf *sdr_buffer, int cgm_encoding, const char *s, int string_length, bool use_double_quotes); static void build_sdr_from_ui8s (plOutbuf *sdr_buffer, int cgm_encoding, const int *x, int n); #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a CGMPlotter struct. */ const Plotter _pl_c_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_c_initialize, _pl_c_terminate, /* page manipulation */ _pl_c_begin_page, _pl_c_erase_page, _pl_c_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_c_paint_path, _pl_c_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_c_paint_marker, _pl_c_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_c_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_c_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override generic initializations (which are appropriate to the base Plotter class), as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_CGM; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_PAGES_ALL_AT_ONCE; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 0; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 0; _plotter->data->have_settable_bg = 1; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 1; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_POSTSCRIPT; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = true; _plotter->data->have_vertical_justification = true; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_NONE; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_circle_scaling = AS_UNIFORM; _plotter->data->allowed_ellipse_scaling = AS_ANY; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_NON_LIBXMI; _plotter->data->flipped_y = false; /* we choose viewport coor range to be 1/4 of the integer range */ _plotter->data->imin = - ((1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) - 1); _plotter->data->imax = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) - 1; _plotter->data->jmin = - ((1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) - 1); _plotter->data->jmax = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) - 1; _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize data members specific to this derived class */ /* parameters */ _plotter->cgm_encoding = CGM_ENCODING_BINARY; _plotter->cgm_max_version = 4; /* most important dynamic variables (global) */ _plotter->cgm_version = 1; _plotter->cgm_profile = CGM_PROFILE_WEB; _plotter->cgm_need_color = false; /* corresponding dynamic variables (page-specific, i.e. picture-specific) */ _plotter->cgm_page_version = 1; _plotter->cgm_page_profile = CGM_PROFILE_WEB; _plotter->cgm_page_need_color = false; /* colors (24-bit or 48-bit, initialized to nonphysical or dummy values) */ _plotter->cgm_line_color.red = -1; _plotter->cgm_line_color.green = -1; _plotter->cgm_line_color.blue = -1; _plotter->cgm_edge_color.red = -1; _plotter->cgm_edge_color.green = -1; _plotter->cgm_edge_color.blue = -1; _plotter->cgm_fillcolor.red = -1; _plotter->cgm_fillcolor.green = -1; _plotter->cgm_fillcolor.blue = -1; _plotter->cgm_marker_color.red = -1; _plotter->cgm_marker_color.green = -1; _plotter->cgm_marker_color.blue = -1; _plotter->cgm_text_color.red = -1; _plotter->cgm_text_color.green = -1; _plotter->cgm_text_color.blue = -1; _plotter->cgm_bgcolor.red = -1; /* set in c_begin_page() */ _plotter->cgm_bgcolor.green = -1; _plotter->cgm_bgcolor.blue = -1; /* other dynamic variables */ _plotter->cgm_line_type = CGM_L_SOLID; _plotter->cgm_dash_offset = 0.0; _plotter->cgm_join_style = CGM_JOIN_UNSPEC; _plotter->cgm_cap_style = CGM_CAP_UNSPEC; _plotter->cgm_dash_cap_style = CGM_CAP_UNSPEC; /* CGM's default line width: 1/1000 times the max VDC dimension */ _plotter->cgm_line_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500; _plotter->cgm_interior_style = CGM_INT_STYLE_HOLLOW; _plotter->cgm_edge_type = CGM_L_SOLID; _plotter->cgm_edge_dash_offset = 0.0; _plotter->cgm_edge_join_style = CGM_JOIN_UNSPEC; _plotter->cgm_edge_cap_style = CGM_CAP_UNSPEC; _plotter->cgm_edge_dash_cap_style = CGM_CAP_UNSPEC; /* CGM's default edge width: 1/1000 times the max VDC dimension */ _plotter->cgm_edge_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500; _plotter->cgm_edge_is_visible = false; _plotter->cgm_miter_limit = 32767.0; _plotter->cgm_marker_type = CGM_M_ASTERISK; /* CGM's default marker size: 1/1000 times the max VDC dimension */ _plotter->cgm_marker_size = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) /500; /* label-related variables */ _plotter->cgm_char_height = -1; /* impossible (dummy) value */ _plotter->cgm_char_base_vector_x = 1; _plotter->cgm_char_base_vector_y = 0; _plotter->cgm_char_up_vector_x = 0; _plotter->cgm_char_up_vector_y = 1; _plotter->cgm_horizontal_text_alignment = CGM_ALIGN_NORMAL_HORIZONTAL; _plotter->cgm_vertical_text_alignment = CGM_ALIGN_NORMAL_VERTICAL; _plotter->cgm_font_id = -1; /* impossible (dummy) value */ _plotter->cgm_charset_lower = 0; /* dummy value (we use values 1..4) */ _plotter->cgm_charset_upper = 0; /* dummy value (we use values 1..4) */ _plotter->cgm_restricted_text_type = CGM_RESTRICTED_TEXT_TYPE_BASIC; /* initialize certain data members from device driver parameters */ /* determine page type, and viewport size and location */ _set_page_type (_plotter->data); /* user may have specified a viewport aspect ratio other than 1:1, so carefully compute device-space coordinate ranges (i.e. don't use above default values for imin,imax,jmin,jmax, which are appropriate only for a square viewport) */ { /* our choice: the larger side of the viewport will essentially be 1/4 times the maximum range for integer device coordinates, i.e., half the larger side will be 1/8 times the maximum range */ int half_side = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) - 1; int half_other_side; double xsize = _plotter->data->viewport_xsize; double ysize = _plotter->data->viewport_ysize; int xsign = xsize < 0.0 ? -1 : 1; int ysign = ysize < 0.0 ? -1 : 1; double fraction; /* There are two cases, plus a degenerate case. For each, `scaling_factor' is the conversion factor from virtual to physical units. */ if (xsize == 0.0 && ysize == 0.0) /* degenerate case, scaling_factor = 0 (or anything else :-)) */ { _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; } else if (FABS(ysize) > FABS(xsize)) /* scaling_factor = FABS(ysize) / (2*half_side) */ { fraction = FABS(xsize) / FABS(ysize); half_other_side = IROUND(half_side * fraction); _plotter->data->imin = - xsign * half_other_side; _plotter->data->imax = xsign * half_other_side; _plotter->data->jmin = - ysign * half_side; _plotter->data->jmax = ysign * half_side; } else /* FABS(ysize) <= FABS(xsize), which is nonzero */ /* scaling_factor = FABS(xsize) / (2*half_side) */ { fraction = FABS(ysize) / FABS(xsize); half_other_side = IROUND(half_side * fraction); _plotter->data->imin = - xsign * half_side; _plotter->data->imax = xsign * half_side; _plotter->data->jmin = - ysign * half_other_side; _plotter->data->jmax = ysign * half_other_side; } } /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* determine CGM encoding */ { const char* cgm_encoding_type; cgm_encoding_type = (const char *)_get_plot_param (_plotter->data, "CGM_ENCODING"); if (cgm_encoding_type != NULL) { if (strcmp (cgm_encoding_type, "binary") == 0) _plotter->cgm_encoding = CGM_ENCODING_BINARY; else if (strcmp (cgm_encoding_type, "clear text") == 0 || (strcmp (cgm_encoding_type, "cleartext") == 0) || (strcmp (cgm_encoding_type, "clear_text") == 0)) _plotter->cgm_encoding = CGM_ENCODING_CLEAR_TEXT; else /* we don't support the character encoding */ _plotter->cgm_encoding = CGM_ENCODING_BINARY; } else _plotter->cgm_encoding = CGM_ENCODING_BINARY; /* default value */ } /* determine upper bound on CGM version number */ { const char* cgm_max_version_type; cgm_max_version_type = (const char *)_get_plot_param (_plotter->data, "CGM_MAX_VERSION"); if (cgm_max_version_type != NULL) { if (strcmp (cgm_max_version_type, "1") == 0) _plotter->cgm_max_version = 1; else if (strcmp (cgm_max_version_type, "2") == 0) _plotter->cgm_max_version = 2; else if (strcmp (cgm_max_version_type, "3") == 0) _plotter->cgm_max_version = 3; else if (strcmp (cgm_max_version_type, "4") == 0) _plotter->cgm_max_version = 4; else /* use default */ _plotter->cgm_max_version = 4; } else _plotter->cgm_max_version = 4; /* use default */ } /* If the maximum CGM version number is greater than 1, relax the constraints on what path segments can be stored in libplot's path buffer. By default, we allow only line segments. */ /* Counterclockwise circular arcs have been in the CGM standard since version 1, but clockwise circular arcs were only added in version 2. To include a circular arc we insist on a uniform map from user to device coordinates, since otherwise it wouldn't be mapped to a circle. Similarly, we don't allow elliptic arcs into the arc buffer unless the version is 2 or higher. Elliptic arcs have been in the standard since version 1, but the `closed figure' construction that we use to fill single elliptic (and circular!) arcs was only added in version 2. */ if (_plotter->cgm_max_version >= 2) { _plotter->data->allowed_arc_scaling = AS_UNIFORM; _plotter->data->allowed_ellarc_scaling = AS_ANY; } /* Bezier cubics were added to the standard in version 3. Closed mixed paths (`closed figures' in CGM jargon) have been in the standard since version 2, but open mixed paths (`compound lines' in CGM jargon) were only added in version 3. */ if (_plotter->cgm_max_version >= 3) { _plotter->data->allowed_cubic_scaling = AS_ANY; _plotter->data->have_mixed_paths = true; } /* Beginning in version 3 CGM's, user can define line types, by specifying a precise dashing style. */ if (_plotter->cgm_max_version >= 3) _plotter->data->have_dash_array = 1; } /* Lists of metafile elements that we use, indexed by the CGM version less unity, i.e., by 0,1,2,3 for CGM versions 1,2,3,4. We use a standard shorthand: element class -1, and element id 0, 1, 2, etc., specifies certain sets of metafile elements. E.g., class=-1 and id=1 specifies all the version-1 metafile elements; in the clear text encoding this is written as "DRAWINGPLUS". */ #define MAX_CGM_ELEMENT_LIST_LENGTH 1 typedef struct { const char *text_string; int length; /* number of genuine entries in list */ int class_id[MAX_CGM_ELEMENT_LIST_LENGTH]; int element_id[MAX_CGM_ELEMENT_LIST_LENGTH]; } plCGMElementList; static const plCGMElementList _metafile_element_list[4] = { /* version 1 */ { "DRAWINGPLUS", 1, {-1}, {1} }, /* version 2 */ { "VERSION2", 1, {-1}, {2} }, /* version 3 */ { "VERSION3", 1, {-1}, {5} }, /* version 4 */ { "VERSION4", 1, {-1}, {6} } }; /* CGM character sets, for upper and lower halves of both ISO-Latin-1 and Symbol fonts. We use standard 8-bit encoding when writing text strings in either sort of font, but the character set used in each font half needs to be specified explicitly. Supported types of character set include "standard 94-character set" and "standard 96-character set". The character set is further specified by the "tail" string. */ typedef struct { int type; /* a CGM enumerative */ const char *type_string; /* its string representation, for cleartext */ const char *tail; /* the `designation sequence tail' */ } plCGMCharset; static const plCGMCharset _iso_latin_1_cgm_charset[2] = { { 0, "std94", "4/2" }, /* ISO 8859-1 LH, tail is "A" */ { 1, "std96", "4/1" } /* ISO 8859-1 RH, tail is "B" */ }; static const plCGMCharset _symbol_cgm_charset[2] = { { 0, "std94", "2/10 3/10" }, /* Symbol LH, tail is "*:" */ { 0, "std94", "2/6 3/10" } /* Symbol RH, tail is "&:" */ }; /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ /* This version is for CGM Plotters... (CGM Plotters differ from most other plotters that do not plot in real time in that they emit output only after all pages have pages have been drawn, rather than at the end of each page. This is necessary in order to produce the correct header lines.) When this is called, the CGM code for the body of each page is stored in a plOutbuf, and the page plOutbufs form a linked list. */ void _pl_c_terminate (S___(Plotter *_plotter)) { int i; plOutbuf *current_page; bool ps_font_used_in_doc[PL_NUM_PS_FONTS]; bool symbol_font_used_in_doc; bool cgm_font_id_used_in_doc[PL_NUM_PS_FONTS]; bool doc_uses_fonts; int max_cgm_font_id; /* if no pages of graphics (i.e. Plotter was never opened), CGM file won't contain any pictures, and won't satisfy any standard profile */ if (_plotter->data->first_page == (plOutbuf *)NULL) _plotter->cgm_profile = IMAX(_plotter->cgm_profile, CGM_PROFILE_NONE); /* COMMENTED OUT BECAUSE USERS WOULD FIND THIS TOO CONFUSING! */ #if 0 /* only the binary encoding satisfies the WebCGM profile */ if (_plotter->cgm_encoding != CGM_ENCODING_BINARY) _plotter->cgm_profile = IMAX(_plotter->cgm_profile, CGM_PROFILE_MODEL); #endif #ifdef LIBPLOTTER if (_plotter->data->outfp || _plotter->data->outstream) #else if (_plotter->data->outfp) #endif /* have an output stream, will emit CGM commands */ { plOutbuf *doc_header, *doc_trailer; int byte_count, data_byte_count, data_len, string_length; doc_header = _new_outbuf (); /* emit "BEGIN METAFILE" command */ { const char *string_param; string_param = "CGM plot"; string_length = strlen (string_param); data_len = CGM_BINARY_BYTES_PER_STRING(string_length); byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 1, data_len, &byte_count, "BEGMF"); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, string_param, string_length, true, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* emit "METAFILE VERSION" command */ { data_len = CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 1, data_len, &byte_count, "MFVERSION"); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, _plotter->cgm_version, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* emit "METAFILE ELEMENT LIST" command; this is encoding-dependent */ { const plCGMElementList *element_list = &(_metafile_element_list[_plotter->cgm_version - 1]); int length = element_list->length; int k; /* 1 integer, plus `length' pairs of 2-byte indices */ data_len = CGM_BINARY_BYTES_PER_INTEGER + 2 * 2 * length; byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 11, data_len, &byte_count, "MFELEMLIST"); switch (_plotter->cgm_encoding) { case CGM_ENCODING_BINARY: default: _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, length, data_len, &data_byte_count, &byte_count); for (k = 0; k < length; k++) { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, element_list->class_id[k], data_len, &data_byte_count, &byte_count); _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, element_list->element_id[k], data_len, &data_byte_count, &byte_count); } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, element_list->text_string, (int) strlen (element_list->text_string), true, data_len, &data_byte_count, &byte_count); break; } _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* emit "METAFILE DESCRIPTION" command, including profile string etc. */ { time_t clock; const char *profile_string, *profile_edition_string; char string_param[254]; struct tm *local_time_struct_ptr; #ifdef HAVE_LOCALTIME_R struct tm local_time_struct; #endif /* Work out ASCII specification of profile */ switch (_plotter->cgm_profile) { case CGM_PROFILE_WEB: profile_string = "WebCGM"; profile_edition_string = "1.0"; break; case CGM_PROFILE_MODEL: profile_string = "Model-Profile"; profile_edition_string = "1"; break; case CGM_PROFILE_NONE: default: profile_string = "None"; profile_edition_string = "0.0"; /* waggish */ break; } /* Compute an ASCII representation of the current time, in a reentrant way if we're supporting pthreads (i.e. by using localtime_r if it's available). */ time (&clock); #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H #ifdef HAVE_LOCALTIME_R localtime_r (&clock, &local_time_struct); local_time_struct_ptr = &local_time_struct; #else local_time_struct_ptr = localtime (&clock); #endif #else /* not HAVE_PTHREAD_H */ local_time_struct_ptr = localtime (&clock); #endif /* not HAVE_PTHREAD_H */ #else /* not PTHREAD_SUPPORT */ local_time_struct_ptr = localtime (&clock); #endif /* not PTHREAD_SUPPORT */ sprintf (string_param, "\"ProfileId:%s\" \"ProfileEd:%s\" \"ColourClass:%s\" \"Source:GNU libplot %s\" \"Date:%04d%02d%02d\"", profile_string, profile_edition_string, _plotter->cgm_need_color ? "colour" : "monochrome", PL_LIBPLOT_VER_STRING, 1900 + local_time_struct_ptr->tm_year, 1 + local_time_struct_ptr->tm_mon, local_time_struct_ptr->tm_mday); string_length = strlen (string_param); data_len = CGM_BINARY_BYTES_PER_STRING(string_length); byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 2, data_len, &byte_count, "MFDESC"); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, string_param, string_length, false, /* delimit by single quotes */ data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* emit "VDC TYPE" command, selecting integer VDC's for the metafile */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 3, data_len, &byte_count, "VDCTYPE"); _cgm_emit_enum (doc_header, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "integer"); _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* Emit "INTEGER PRECISION" command. Parameters are encoding-dependent: in the binary encoding, the number of bits k, and in clear text, a pair of integers: the minimum and maximum integers representable in CGM format, i.e. -(2^(k-1) - 1) and (2^(k-1) - 1), where k=8*CGM_BINARY_BYTES_PER_INTEGER. */ { int j, max_int; data_len = 2; /* in binary, 16 bits of data; see comment */ byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 4, data_len, &byte_count, "INTEGERPREC"); switch (_plotter->cgm_encoding) { case CGM_ENCODING_BINARY: default: /* The integer precision, in terms of bits, should be encoded as an integer at the current precision (the default, which is 16 bits), not the eventual precision. So we don't call _cgm_emit_integer; we call _cgm_emit_index instead. We always represent indices by 16 bits (the default). */ _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, 8 * CGM_BINARY_BYTES_PER_INTEGER, data_len, &data_byte_count, &byte_count); break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: max_int = 0; for (j = 0; j < (8 * CGM_BINARY_BYTES_PER_INTEGER - 1); j++) max_int += (1 << j); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, -max_int, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, max_int, data_len, &data_byte_count, &byte_count); break; } _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* Emit "REAL PRECISION" command, selecting default precision. Parameters are encoding-dependent. In the clear text encoding, three numbers: the minimum real, the maximum real, and the number of significant decimal digits (an integer). Typical choices are (-32767.0, 32767.0, 4) [the default]. In the binary encoding, three objects: a 2-octet enumerative specifying the encoding of reals (0=floating, 1=fixed), and two integers at current intege precision specifying the size of each piece of the encoded real. Typical choices are (1,16,16) [the default] or (0,9,23). */ { data_len = 2 + 2 * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 5, data_len, &byte_count, "REALPREC"); switch (_plotter->cgm_encoding) { case CGM_ENCODING_BINARY: default: _cgm_emit_enum (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "DUMMY"); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 16, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 16, data_len, &data_byte_count, &byte_count); break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: _cgm_emit_real_fixed_point (doc_header, false, _plotter->cgm_encoding, -32767.0, data_len, &data_byte_count, &byte_count); _cgm_emit_real_fixed_point (doc_header, false, _plotter->cgm_encoding, 32767.0, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 4, data_len, &data_byte_count, &byte_count); break; } _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* Emit "COLOR PRECISION" command. Parameters are encoding-dependent: in the binary encoding, an integer specifying the number of bits k, and in clear text, the maximum possible color component value, i.e. (2^k - 1), where k=8*CGM_BINARY_BYTES_PER_COLOR_COMPONENT. */ { int j; unsigned int max_component; data_len = CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 7, data_len, &byte_count, "COLRPREC"); switch (_plotter->cgm_encoding) { case CGM_ENCODING_BINARY: default: _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 8 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT, data_len, &data_byte_count, &byte_count); break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: max_component = 0; for (j = 0; j < (8 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT); j++) max_component += (1 << j); _cgm_emit_unsigned_integer (doc_header, false, _plotter->cgm_encoding, max_component, data_len, &data_byte_count, &byte_count); break; } _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* emit "COLOR VALUE EXTENT" command, duplicating the information we just supplied (this is necessary) */ { int j; unsigned int max_component; data_len = 6 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT; byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 10, data_len, &byte_count, "COLRVALUEEXT"); _cgm_emit_color_component (doc_header, false, _plotter->cgm_encoding, (unsigned int)0, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (doc_header, false, _plotter->cgm_encoding, (unsigned int)0, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (doc_header, false, _plotter->cgm_encoding, (unsigned int)0, data_len, &data_byte_count, &byte_count); max_component = 0; for (j = 0; j < (8 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT); j++) max_component += (1 << j); _cgm_emit_color_component (doc_header, false, _plotter->cgm_encoding, max_component, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (doc_header, false, _plotter->cgm_encoding, max_component, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (doc_header, false, _plotter->cgm_encoding, max_component, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* determine fonts needed by document, by examining all pages */ { current_page = _plotter->data->first_page; for (i = 0; i < PL_NUM_PS_FONTS; i++) ps_font_used_in_doc[i] = false; while (current_page) { for (i = 0; i < PL_NUM_PS_FONTS; i++) if (current_page->ps_font_used[i]) ps_font_used_in_doc[i] = true; current_page = current_page->next; } } /* Map our internal indexing of PS fonts to the indexing we use in a CGM file (which may be different, because we want the traditional `Adobe 13' to come first, out of the `Adobe 35'). Also work out whether Symbol font, which has its own character sets, is used. */ symbol_font_used_in_doc = false; for (i = 0; i < PL_NUM_PS_FONTS; i++) { cgm_font_id_used_in_doc[_pl_g_ps_font_to_cgm_font_id[i]] = ps_font_used_in_doc[i]; if (ps_font_used_in_doc[i] && strcmp (_pl_g_ps_font_info[i].ps_name, "Symbol") == 0) symbol_font_used_in_doc = true; } /* compute maximum used font id, if any */ max_cgm_font_id = 0; doc_uses_fonts = false; for (i = 0; i < PL_NUM_PS_FONTS; i++) { if (cgm_font_id_used_in_doc[i] == true) { doc_uses_fonts = true; max_cgm_font_id = i; } } if (doc_uses_fonts) { /* emit "FONT LIST" command */ /* command will include encoded strings, which are the names of fonts in range 0..max_cgm_font_id; later in the CGM file, they'll be referred to as 1..max_cgm_font_id+1 */ data_len = 0; for (i = 0; i <= max_cgm_font_id; i++) { int ps_font_index; int font_name_length, encoded_font_name_length; ps_font_index = _pl_g_cgm_font_id_to_ps_font[i]; font_name_length = (int) strlen (_pl_g_ps_font_info[ps_font_index].ps_name); encoded_font_name_length = CGM_BINARY_BYTES_PER_STRING(font_name_length); data_len += encoded_font_name_length; } byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 13, data_len, &byte_count, "FONTLIST"); for (i = 0; i <= max_cgm_font_id; i++) { int ps_font_index; ps_font_index = _pl_g_cgm_font_id_to_ps_font[i]; _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, _pl_g_ps_font_info[ps_font_index].ps_name, (int) strlen (_pl_g_ps_font_info[ps_font_index].ps_name), true, data_len, &data_byte_count, &byte_count); } _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); if (_plotter->cgm_version >= 3) /* emit version-3 "FONT PROPERTIES" commands; note that if fonts are used and CGM_MAX_VERSION is >=3, then cgm_version was previously bumped up to 3 in c_closepl.c */ { /* For each font in the font list, we specify 7 properties. Each "FONT PROPERTIES" command refers to a single font. Its argument list is a sequence of 3-tuples, each being of the form (property type [an index], priority [an integer], value), where `value' is an SDR (structured data record). One of the supported property types is CGM_FONT_PROP_INDEX, the value of which is an index into the font list. For any invocation of the command, this property type and its value must be supplied. An SDR is a string-encoded structure, and each `run' of a single CGM datatype within an SDR is encoded as (A) an identifier for the datatype [an index], (B) a count of the number of occurrences [an integer], and (C) the occurrences of the datatype, themselves. So in the binary encoding, bytes per SDR equals 2 + bytes_per_integer + data_bytes, since we always encode CGM indices as 2 bytes. The only SDR's that occur in this context are (1) single CGM indices [used for 5 of the 7 font properties], (2) single CGM strings [used for the `family' property], and (3) three 8-bit unsigned integers [used for the font's `design group']. Because we always encode CGM indices as 2 bytes, bytes per SDR, in the binary encoding, in these 3 cases are: (1) 1+ CGM_BINARY_BYTES_PER_INTEGER + 4, (2) 1+ CGM_BINARY_BYTES_PER_INTEGER + 2 + CGM_BYTES_PER_STRING (3) 1+ CGM_BINARY_BYTES_PER_INTEGER + 5. (This takes account of the initial byte used for the string encoding of the SDR.) And bytes per 3-tuple in these three cases are: (1) 2*CGM_BINARY_BYTES_PER_INTEGER + 7, (2) 2*CGM_BINARY_BYTES_PER_INTEGER + 5 + CGM_BYTES_PER_STRING (3) 2*CGM_BINARY_BYTES_PER_INTEGER + 8. Since for every included font, we emit 5 3-tuples of type 1, 1 of type 2, and 1 of type 3, bytes per emitted font equals 14*CGM_BINARY_BYTES_PER_INTEGER + 48 + CGM_BYTES_PER_STRING(). In the binary encoding, this is the length, in bytes, of the argument list of each "FONT PROPERTIES" command. Here CGM_BYTES_PER_STRING() stands for the string-encoded length of the family name of the font. */ for (i = 0; i <= max_cgm_font_id; i++) { int family_length; plOutbuf *sdr_buffer; family_length = strlen(_pl_g_cgm_font_properties[i].family); data_len = (14 * CGM_BINARY_BYTES_PER_INTEGER + 48 /* hardcoded constants; see above */ + CGM_BINARY_BYTES_PER_STRING(family_length)); byte_count = data_byte_count = 0; sdr_buffer = _new_outbuf (); _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 21, data_len, &byte_count, "FONTPROP"); /* now emit a sequence of 3-tuples: (index, integer, SDR); for each 2nd element (a priority), we just specify `1' */ /* specify index of font in table (beginning with 1, not with 0) */ { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, CGM_FONT_PROP_INDEX, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 1, /* priority */ data_len, &data_byte_count, &byte_count); build_sdr_from_index (sdr_buffer, _plotter->cgm_encoding, i + 1); /* add 1 to index */ _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, sdr_buffer->base, (int)(sdr_buffer->contents), false, data_len, &data_byte_count, &byte_count); _reset_outbuf (sdr_buffer); } /* specify font family */ { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, CGM_FONT_PROP_FAMILY, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count); build_sdr_from_string (sdr_buffer, _plotter->cgm_encoding, _pl_g_cgm_font_properties[i].family, (int)(strlen (_pl_g_cgm_font_properties[i].family)), true); /* use double quotes */ _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, sdr_buffer->base, (int)(sdr_buffer->contents), false, data_len, &data_byte_count, &byte_count); _reset_outbuf (sdr_buffer); } /* specify font posture */ { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, CGM_FONT_PROP_POSTURE, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count); build_sdr_from_index (sdr_buffer, _plotter->cgm_encoding, _pl_g_cgm_font_properties[i].posture); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, sdr_buffer->base, (int)(sdr_buffer->contents), false, data_len, &data_byte_count, &byte_count); _reset_outbuf (sdr_buffer); } /* specify font weight */ { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, CGM_FONT_PROP_WEIGHT, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count); build_sdr_from_index (sdr_buffer, _plotter->cgm_encoding, _pl_g_cgm_font_properties[i].weight); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, sdr_buffer->base, (int)(sdr_buffer->contents), false, data_len, &data_byte_count, &byte_count); _reset_outbuf (sdr_buffer); } /* specify font width */ { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, CGM_FONT_PROP_WIDTH, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count); build_sdr_from_index (sdr_buffer, _plotter->cgm_encoding, _pl_g_cgm_font_properties[i].proportionate_width); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, sdr_buffer->base, (int)(sdr_buffer->contents), false, data_len, &data_byte_count, &byte_count); _reset_outbuf (sdr_buffer); } /* specify font design group */ { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, CGM_FONT_PROP_DESIGN_GROUP, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count); build_sdr_from_ui8s (sdr_buffer, _plotter->cgm_encoding, _pl_g_cgm_font_properties[i].design_group, 3); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, sdr_buffer->base, (int)(sdr_buffer->contents), false, data_len, &data_byte_count, &byte_count); _reset_outbuf (sdr_buffer); } /* specify font structure */ { _cgm_emit_index (doc_header, false, _plotter->cgm_encoding, CGM_FONT_PROP_STRUCTURE, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count); build_sdr_from_index (sdr_buffer, _plotter->cgm_encoding, _pl_g_cgm_font_properties[i].structure); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, sdr_buffer->base, (int)(sdr_buffer->contents), false, data_len, &data_byte_count, &byte_count); _reset_outbuf (sdr_buffer); } _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); _delete_outbuf (sdr_buffer); } } /* Emit a "CHARACTER SET LIST" command. Argument list is a sequence of character sets, with each character set being expressed both as a CGM enumerative and a CGM string (the `designation sequence tail'). We include the 2 character sets used in the 8-bit ISO-Latin-1 encoding, and, if we're using the Symbol font, the two character sets that Symbol uses, also. So internally, we index these character sets by 1,2,3,4 (the latter two may not be present). */ data_len = 0; for (i = 0; i < 2; i++) { int tail_length, encoded_tail_length; data_len += 2; /* 2 bytes per enum */ tail_length = strlen (_iso_latin_1_cgm_charset[i].tail); encoded_tail_length = CGM_BINARY_BYTES_PER_STRING(tail_length); data_len += encoded_tail_length; } if (symbol_font_used_in_doc) for (i = 0; i < 2; i++) { int tail_length, encoded_tail_length; data_len += 2; /* 2 bytes per enum */ tail_length = (int) strlen (_symbol_cgm_charset[i].tail); encoded_tail_length = CGM_BINARY_BYTES_PER_STRING(tail_length); data_len += encoded_tail_length; } byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 14, data_len, &byte_count, "CHARSETLIST"); for (i = 0; i < 2; i++) { _cgm_emit_enum (doc_header, false, _plotter->cgm_encoding, _iso_latin_1_cgm_charset[i].type, data_len, &data_byte_count, &byte_count, _iso_latin_1_cgm_charset[i].type_string); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, _iso_latin_1_cgm_charset[i].tail, (int) strlen (_iso_latin_1_cgm_charset[i].tail), true, data_len, &data_byte_count, &byte_count); } if (symbol_font_used_in_doc) for (i = 0; i < 2; i++) { _cgm_emit_enum (doc_header, false, _plotter->cgm_encoding, _symbol_cgm_charset[i].type, data_len, &data_byte_count, &byte_count, _symbol_cgm_charset[i].type_string); _cgm_emit_string (doc_header, false, _plotter->cgm_encoding, _symbol_cgm_charset[i].tail, (int) strlen (_symbol_cgm_charset[i].tail), true, data_len, &data_byte_count, &byte_count); } _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* emit "CHARACTER CODING ANNOUNCER" command, selecting 8-bit character codes (no switching between font halves for us!) */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_header, _plotter->cgm_encoding, CGM_METAFILE_DESCRIPTOR_ELEMENT, 15, data_len, &byte_count, "CHARCODING"); _cgm_emit_enum (doc_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "basic8bit"); _cgm_emit_command_terminator (doc_header, _plotter->cgm_encoding, &byte_count); } /* WRITE DOCUMENT HEADER */ _write_bytes (_plotter->data, (int)(doc_header->contents), (unsigned char *)doc_header->base); _delete_outbuf (doc_header); /* loop over plOutbufs in which successive pages of graphics are stored; emit each page as a CGM picture, and delete each plOutbuf as we finish with it */ current_page = _plotter->data->first_page; i = 1; while (current_page) { plOutbuf *next_page; plOutbuf *current_page_header, *current_page_trailer; /* prepare a page header */ current_page_header = _new_outbuf (); /* emit "BEGIN PICTURE" command */ { char picture[32]; const char *string_param; sprintf (picture, "picture_%d", i); string_param = picture; string_length = strlen (string_param); data_len = CGM_BINARY_BYTES_PER_STRING(string_length); byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 3, data_len, &byte_count, "BEGPIC"); _cgm_emit_string (current_page_header, false, _plotter->cgm_encoding, string_param, string_length, true, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* emit "VDC EXTENT" command [specify virtual device coor ranges] */ { int imin_true, imax_true, jmin_true, jmax_true; data_len = 2 * 2 * 2; byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 6, data_len, &byte_count, "VDCEXT"); /* To see how we set extent values, see the initialize() routine. In that routine, we choose device-coordinates ranges imin,imax,jmin,jmax so that the length of the longer side of the viewport is one-fourth the maximum integer range. The other side will be reduced if the user specifies (via PAGESIZE) an aspect ratio other than 1:1. With this scheme, if the user specifies xsize=ysize > 0, the same user->device coordinate map will result, no matter what xsize and ysize equal. However, if the user specifies (via PAGESIZE) a negative xsize or ysize, we flip the sign of imax-imin or jmax-jmin, thereby greatly modifying the user->device coordinate map. Which means we must flip it back, right here, before emitting the VDC extents. The reason for this sign-flipping is that we don't trust CGM viewers to handle negative VDC extents. */ if (_plotter->data->imax < _plotter->data->imin) { imin_true = _plotter->data->imax; imax_true = _plotter->data->imin; } else { imin_true = _plotter->data->imin; imax_true = _plotter->data->imax; } if (_plotter->data->jmax < _plotter->data->jmin) { jmin_true = _plotter->data->jmax; jmax_true = _plotter->data->jmin; } else { jmin_true = _plotter->data->jmin; jmax_true = _plotter->data->jmax; } /* In binary, we write each of these four coordinates as a 16-bit `index' i.e. integer, because we haven't yet changed the VDC integer precision to our desired value (we can't do that until the beginning of the picture). */ _cgm_emit_index (current_page_header, false, _plotter->cgm_encoding, imin_true, data_len, &data_byte_count, &byte_count); _cgm_emit_index (current_page_header, false, _plotter->cgm_encoding, jmin_true, data_len, &data_byte_count, &byte_count); _cgm_emit_index (current_page_header, false, _plotter->cgm_encoding, imax_true, data_len, &data_byte_count, &byte_count); _cgm_emit_index (current_page_header, false, _plotter->cgm_encoding, jmax_true, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* emit "SCALING MODE" command. Specify metric scaling (required by WebCGM profile). The argument is the number of millimeters per VDC unit; it must be a floating-point real. */ { int irange, jrange; double scaling_factor; data_len = 6; /* 2 bytes per enum, 4 per floating-pt. real */ byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 1, data_len, &byte_count, "SCALEMODE"); _cgm_emit_enum (current_page_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "metric"); /* Compute a metric scaling factor from the criterion that the nominal physical width and height of VDC space be the viewport xsize and ysize, as determined by the PAGESIZE parameter. We can get this scaling factor easily, by computing a quotient, because our scheme for setting imin,imax,jmin,jmax in the initialize() method preserves aspect ratio, and signs, as well (see comment immediately above). But we must be careful not to divide by zero, since zero-width and zero-height viewports are allowed. */ irange = _plotter->data->imax - _plotter->data->imin; jrange = _plotter->data->jmax - _plotter->data->jmin; if (irange != 0) scaling_factor = (25.4 * _plotter->data->viewport_xsize) / irange; else if (jrange != 0) scaling_factor = (25.4 * _plotter->data->viewport_ysize) / jrange; else /* degenerate case, viewport has zero size */ scaling_factor = 0.0; /* yes, this needs to be a floating-point real, not fixed-point! */ _cgm_emit_real_floating_point (current_page_header, false, _plotter->cgm_encoding, scaling_factor, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* emit "LINE WIDTH SPECIFICATION MODE" command [specify absolute coordinates] */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 3, data_len, &byte_count, "LINEWIDTHMODE"); _cgm_emit_enum (current_page_header, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "abs"); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* emit "EDGE WIDTH SPECIFICATION MODE" command [specify absolute coordinates] */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 5, data_len, &byte_count, "EDGEWIDTHMODE"); _cgm_emit_enum (current_page_header, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "abs"); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* emit "MARKER SIZE SPECIFICATION MODE" command [specify absolute coordinates] */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 4, data_len, &byte_count, "MARKERSIZEMODE"); _cgm_emit_enum (current_page_header, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "abs"); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* emit "COLOR SELECTION MODE" command [specify direct color, not indexed color] */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 2, data_len, &byte_count, "COLRMODE"); _cgm_emit_enum (current_page_header, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "direct"); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } if (current_page->bg_color_suppressed == false) /* user didn't specify "none" as background color, so emit "BACKGROUND COLOR" command. (Note that in a CGM file, background color is always a direct color specified by color components, never an indexed color.) The background color for any page is stored in the `bg_color' element of its plOutbuf at the time the page is closed; see g_closepl.c. */ { data_len = 3 * CGM_BINARY_BYTES_PER_COLOR_COMPONENT; byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 7, data_len, &byte_count, "BACKCOLR"); _cgm_emit_color_component (current_page_header, false, _plotter->cgm_encoding, (unsigned int)current_page->bg_color.red, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (current_page_header, false, _plotter->cgm_encoding, (unsigned int)current_page->bg_color.green, data_len, &data_byte_count, &byte_count); _cgm_emit_color_component (current_page_header, false, _plotter->cgm_encoding, (unsigned int)current_page->bg_color.blue, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* if user defined any line types, emit a sequence of "LINE AND EDGE TYPE DEFINITION" commands */ { plCGMCustomLineType *linetype_ptr = (plCGMCustomLineType *)current_page->extra; int linetype = 0; while (linetype_ptr) { int k, cycle_length, dash_array_len, *dash_array; linetype--; /* user-defined ones are -1,-2,-3,... */ dash_array_len = linetype_ptr->dash_array_len; dash_array = linetype_ptr->dashes; cycle_length = 0; for (k = 0; k < dash_array_len; k++) cycle_length += dash_array[k]; /* data: a 2-byte index, the cycle length, and the array of dash lengths (all integers) */ data_len = 2 + (1 + dash_array_len) * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_PICTURE_DESCRIPTOR_ELEMENT, 17, data_len, &byte_count, "LINEEDGETYPEDEF"); _cgm_emit_index (current_page_header, false, _plotter->cgm_encoding, linetype, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (current_page_header, false, _plotter->cgm_encoding, cycle_length, data_len, &data_byte_count, &byte_count); for (k = 0; k < dash_array_len; k++) _cgm_emit_integer (current_page_header, false, _plotter->cgm_encoding, dash_array[k], data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); /* on to next user-defined line type */ linetype_ptr = linetype_ptr->next; } } /* emit "BEGIN PICTURE BODY" command */ { data_len = 0; byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 4, data_len, &byte_count, "BEGPICBODY"); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* Emit "VDC INTEGER PRECISION" command. Very similar to the "INTEGER PRECISION" command, except we emit this at the start of each picture. */ { int j, max_int; data_len = CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_CONTROL_ELEMENT, 1, data_len, &byte_count, "VDCINTEGERPREC"); switch (_plotter->cgm_encoding) { case CGM_ENCODING_BINARY: default: _cgm_emit_integer (current_page_header, false, _plotter->cgm_encoding, 8 * CGM_BINARY_BYTES_PER_INTEGER, data_len, &data_byte_count, &byte_count); break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: max_int = 0; for (j = 0; j < (8 * CGM_BINARY_BYTES_PER_INTEGER - 1); j++) max_int += (1 << j); _cgm_emit_integer (current_page_header, false, _plotter->cgm_encoding, -max_int, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (current_page_header, false, _plotter->cgm_encoding, max_int, data_len, &data_byte_count, &byte_count); break; } _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } if (doc_uses_fonts) /* emit "TEXT PRECISION" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_header, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 11, data_len, &byte_count, "TEXTPREC"); _cgm_emit_enum (current_page_header, false, _plotter->cgm_encoding, 2, data_len, &data_byte_count, &byte_count, "stroke"); _cgm_emit_command_terminator (current_page_header, _plotter->cgm_encoding, &byte_count); } /* write the page header */ _write_bytes (_plotter->data, (int)(current_page_header->contents), (unsigned char *)current_page_header->base); _delete_outbuf (current_page_header); /* WRITE THE PICTURE */ _write_bytes (_plotter->data, (int)(current_page->contents), (unsigned char *)current_page->base); /* prepare a page trailer */ current_page_trailer = _new_outbuf (); /* emit "END PICTURE" command (no parameters) */ { data_len = 0; byte_count = data_byte_count = 0; _cgm_emit_command_header (current_page_trailer, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 5, data_len, &byte_count, "ENDPIC"); _cgm_emit_command_terminator (current_page_trailer, _plotter->cgm_encoding, &byte_count); } /* write page trailer */ _write_bytes (_plotter->data, (int)(current_page_trailer->contents), (unsigned char *)current_page_trailer->base); _delete_outbuf (current_page_trailer); /* on to next page (if any) */ next_page = current_page->next; current_page = next_page; i++; } /* prepare a document trailer */ doc_trailer = _new_outbuf (); /* emit "END METAFILE" command (no parameters) */ { data_len = 0; byte_count = data_byte_count = 0; _cgm_emit_command_header (doc_trailer, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 2, data_len, &byte_count, "ENDMF"); _cgm_emit_command_terminator (doc_trailer, _plotter->cgm_encoding, &byte_count); } /* WRITE DOCUMENT TRAILER */ _write_bytes (_plotter->data, (int)(doc_trailer->contents), (unsigned char *)doc_trailer->base); _delete_outbuf (doc_trailer); } /* delete all plOutbufs in which document pages are stored */ current_page = _plotter->data->first_page; while (current_page) { plOutbuf *next_page; next_page = current_page->next; /* deallocate page-specific table of user-specified line types, if any */ if (current_page->extra) { plCGMCustomLineType *linetype_ptr = (plCGMCustomLineType *)current_page->extra; plCGMCustomLineType *old_linetype_ptr; while (linetype_ptr) { if (linetype_ptr->dash_array_len > 0 /* paranoia */ && linetype_ptr->dashes) free (linetype_ptr->dashes); old_linetype_ptr = linetype_ptr; linetype_ptr = linetype_ptr->next; free (old_linetype_ptr); } _plotter->data->page->extra = (void *)NULL; } _delete_outbuf (current_page); current_page = next_page; } /* flush output stream if any */ if (_plotter->data->outfp) { if (fflush(_plotter->data->outfp) < 0 #ifdef MSDOS /* data can be caught in DOS buffers, so do an fsync() too */ || fsync (_plotter->data->outfp) < 0 #endif ) _plotter->error (R___(_plotter) "the output stream is jammed"); } #ifdef LIBPLOTTER else if (_plotter->data->outstream) { _plotter->data->outstream->flush (); if (!(*(_plotter->data->outstream))) _plotter->error (R___(_plotter) "the output stream is jammed"); } #endif #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } static void build_sdr_from_index (plOutbuf *sdr_buffer, int cgm_encoding, int x) { int dummy_data_len, dummy_data_byte_count, dummy_byte_count; dummy_data_len = dummy_data_byte_count = dummy_byte_count = 0; _cgm_emit_index (sdr_buffer, true, cgm_encoding, CGM_SDR_DATATYPE_INDEX, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); _cgm_emit_integer (sdr_buffer, true, cgm_encoding, 1, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); _cgm_emit_index (sdr_buffer, true, cgm_encoding, x, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); } static void build_sdr_from_string (plOutbuf *sdr_buffer, int cgm_encoding, const char *s, int string_length, bool use_double_quotes) { int dummy_data_len, dummy_data_byte_count, dummy_byte_count; dummy_data_len = dummy_data_byte_count = dummy_byte_count = 0; _cgm_emit_index (sdr_buffer, true, cgm_encoding, CGM_SDR_DATATYPE_STRING_FIXED, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); _cgm_emit_integer (sdr_buffer, true, cgm_encoding, 1, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); _cgm_emit_string (sdr_buffer, true, cgm_encoding, s, string_length, use_double_quotes, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); } static void build_sdr_from_ui8s (plOutbuf *sdr_buffer, int cgm_encoding, const int *x, int n) { int i, dummy_data_len, dummy_data_byte_count, dummy_byte_count; dummy_data_len = dummy_data_byte_count = dummy_byte_count = 0; _cgm_emit_index (sdr_buffer, true, cgm_encoding, CGM_SDR_DATATYPE_UNSIGNED_INTEGER_8BIT, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); _cgm_emit_integer (sdr_buffer, true, cgm_encoding, n, dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); for (i = 0; i < n; i++) _cgm_emit_unsigned_integer_8bit (sdr_buffer, true, cgm_encoding, (unsigned int)(x[i]), dummy_data_len, &dummy_data_byte_count, &dummy_byte_count); } #ifdef LIBPLOTTER CGMPlotter::CGMPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_c_initialize (); } CGMPlotter::CGMPlotter (FILE *outfile) :Plotter (outfile) { _pl_c_initialize (); } CGMPlotter::CGMPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_c_initialize (); } CGMPlotter::CGMPlotter (ostream& out) : Plotter (out) { _pl_c_initialize (); } CGMPlotter::CGMPlotter () { _pl_c_initialize (); } CGMPlotter::CGMPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_c_initialize (); } CGMPlotter::CGMPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_c_initialize (); } CGMPlotter::CGMPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_c_initialize (); } CGMPlotter::CGMPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_c_initialize (); } CGMPlotter::CGMPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_c_initialize (); } CGMPlotter::~CGMPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_c_terminate (); } #endif plotutils-2.6/libplot/c_emit.c0000644000175000017500000010045311037243260013413 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains low-level functions used by CGMPlotters. E.g., _cgm_emit_command_header and _cgm_emit_command_terminator, which begin and end a CGM command. A CGM output file, in either the binary or clear text encoding, is simply a sequence of CGM commands. Commands are usually written to the CGMPlotter's output buffer, in which the current page of graphics (i.e. "picture", in CGM jargon) is stored. An output buffer (a plOutbuf) is manipulated by the routines in g_outbuf.c. It includes an array of char, which can grow. This file also contains _cgm_emit_integer, _cgm_emit_unsigned_integer, _cgm_emit_point, _cgm_emit_points, _cgm_emit_index, _cgm_emit_enum, _cgm_emit_color_component, and _cgm_emit_string, etc., routines, which write the parameters of the command (i.e., its `data') to the output buffer. The caller invokes zero or more of these routines between a _cgm_emit_command_header .. _cgm_emit_command_terminator pair. There is support for specifying a non-default output buffer, i.e., one not associated with the CGMPlotter in the usual way. That is useful for preparing the output file's header and trailer, and per-page headers. See c_defplot.c. If the binary CGM encoding is used, CGM's data partitioning scheme is used. As a command and its arguments are emitted, variables that play a role in implementing the data partitioning scheme are updated via pointers. These include the number of data bytes written, and the total number of bytes written as part of the command. The caller should initialize these variables to zero at the beginning of the CGM command. There is support for turning off data partitioning. _cgm_emit_integer() and the other commands for emitting command parameters support a `no_partitioning' flag argument. This is useful because some CGM commands take a `structured data record' argument. An SDR is essentially a string [a sequence of octets], which may be emitted by calling _cgm_emit_string(), like an ordinary string. However, an SDR must first be formed by calling a sequence of zero or more such commands as _cgm_emit_integer() etc., with output to a plOutbuf (with data partitioning turned off, if the binary encoding is used). */ /* Note: in the binary encoding is used, we go to extremes to make the written-out CGM file portable. E.g., we hand-craft a big-endian 2's-complement representation (the CGM standard) for each integer or unsigned integer, and write each octet individually to the output buffer as an unsigned char or char. We don't assume the system represents integers using 2's complement. We do assume that casting an unsigned char to a char doesn't change the bit pattern. The number of octets used in the CGM representation of an integer or unsigned integer, CGM_BINARY_BYTES_PER_INTEGER, is set in extern.h. It should NOT be greater than the number of octets used in the system representation of an unsigned int; see comment below. On nearly all systems that GNU supports, this maximum value for CGM_BINARY_BYTES_PER_INTEGER is 4 (it is never 2). Many CGM files use CGM_BINARY_BYTES_PER_INTEGER = 2. In some old, noncompliant CGM parsers this value is hard-coded, even though it shouldn't be. So use higher values (e.g., 3 and 4) with caution. The "CGM Handbook" says the use of 3, rather than 2 or 4, is very rare. */ #include "sys-defines.h" #include "extern.h" /* In the binary encoding, if the data section, i.e., the list of parameters for the command, contains more than 30 bytes, it is written in partitioned format. This is the maximum number of data bytes we place in each block of the partition. Could be as large as 32767, but we keep it small to avoid a buffer overrun (see comment in g_outbuf.c). */ #define CGM_BINARY_DATA_BYTES_PER_PARTITION 3000 /* How to recognize the beginning of a new block of the partition (*data_byte_count is the running count of emitted data bytes, initialized by the caller to zero, and updated throughout the CGM command). */ #define CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count) \ (((data_len) > 30) && ((*(data_byte_count)) % CGM_BINARY_DATA_BYTES_PER_PARTITION == 0)) /* forward references */ static void cgm_emit_partition_control_word (plOutbuf *outbuf, int data_len, const int *data_byte_count, int *byte_count); static void double_to_ieee_single_precision (double d, unsigned char output[4]); static void int_to_cgm_int (int n, unsigned char *cgm_int, int octets_per_cgm_int); static void unsigned_int_to_cgm_unsigned_int (unsigned int n, unsigned char *cgm_unsigned_int, int octets_per_cgm_unsigned_int); /* Write the header of a CGM command. In the clear text encoding, a string (the `op code') is written. In the binary encoding, a 2-byte word is written: it specifies the CGM element class and element ID, and `data_len': the number of data bytes that the caller will write, by subsequently calling the functions that emit command arguments. `data_len' includes CGM_BINARY_BYTES_PER_INTEGER bytes for an integer, and twice that for a point; two bytes for an index or enumerative, and four bytes for a real. For a string, the number of data bytes can be computed from the CGM_BINARY_BYTES_PER_STRING() macro. The caller should initialize *byte_count to zero, and also *data_byte_count (the latter is updated by the argument-emitting functions). */ void _cgm_emit_command_header (plOutbuf *outbuf, int cgm_encoding, int element_class, int id, int data_len, int *byte_count, const char *op_code) { switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: { int temp; if (data_len > 30) data_len = 31; /* set all 5 bits; will partition the data */ temp = (element_class & 017) << 4; /* 4 bits, shifted up by 4 */ temp |= (id >> 3) & 017; /* top 4 of 7 bits, shifted down by 3 */ outbuf->point[0] = (char)(unsigned char)temp; temp = (id & 0177) << 5; /* lower 3 of 7 bits, shifted up by 5 */ temp |= (data_len & 037); /* 5 bits, not shifted */ outbuf->point[1] = (char)(unsigned char)temp; _update_buffer_by_added_bytes (outbuf, 2); (*byte_count) += 2; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, "%s", op_code); _update_buffer (outbuf); break; } } /* In the binary encoding, this is called automatically at the beginning of each data partition, if a partitioned parameter list is used. It writes a 2-byte big-endian control word that specifies how many data bytes the partition will contain. It may set a continuation flag in the control word, to indicate that another data partition will follow. */ static void cgm_emit_partition_control_word (plOutbuf *outbuf, int data_len, const int *data_byte_count, int *byte_count) { int bytes_remaining = data_len - (*data_byte_count); int bytes_in_partition; unsigned int control_word; if (bytes_remaining > CGM_BINARY_DATA_BYTES_PER_PARTITION) { bytes_in_partition = CGM_BINARY_DATA_BYTES_PER_PARTITION; control_word = 1 << 15; /* set continuation flag */ } else { bytes_in_partition = bytes_remaining; control_word = 0; } control_word |= (unsigned int)bytes_in_partition; /* write control word, big-endian */ outbuf->point[0] = (char)(unsigned char)((control_word >> 8) & 0377); outbuf->point[1] = (char)(unsigned char)(control_word & 0377); _update_buffer_by_added_bytes (outbuf, 2); (*byte_count) += 2; } /* Encode a (signed) integer in binary CGM format. This is a big-endian 2's complement format, with k=8*octets_per_cgm_int bits per integer. The signed integer is clamped to the range -(2^(k-1) - 1) .. (2^(k-1)-1) and split into octets, with attention paid to the sign bit. We do not assume the system representation of integers is a 2's complement format. We do assume that the system uses at least k octets per unsigned int. The octets are returned in an array of unsigned chars. Since any of our output buffers contains an array of char, we'll be assuming that the bit pattern of chars and unsigned chars is the same, so that we can cast unsigned chars to chars with impunity. */ static void int_to_cgm_int (int n, unsigned char *cgm_int, int octets_per_cgm_int) { int max_int, i; unsigned int u; bool negative = false; /* clamp integer; we assume here that the system uses at least octest_per_cgm_int octets per unsigned int, i.e. that the system precision is at least as great as the CGM precision */ max_int = 0; for (i = 0; i < (8 * octets_per_cgm_int - 1); i++) max_int += (1 << i); if (n > max_int) n = max_int; else if (n < -max_int) n = -max_int; if (n < 0) { int temp; negative = true; temp = -(n + 1); u = (unsigned int)(max_int - temp); /* compute 2's complement */ } else u = (unsigned int)n; for (i = 0; i < octets_per_cgm_int; i++) { unsigned char v; v = 0xff & (u >> (8 * ((octets_per_cgm_int - 1) - i))); if (i == 0 && negative) v |= 0x80; cgm_int[i] = v; } } /* similar to the preceding, but for unsigned ints rather than signed ints */ static void unsigned_int_to_cgm_unsigned_int (unsigned int n, unsigned char *cgm_unsigned_int, int octets_per_cgm_unsigned_int) { unsigned int max_unsigned_int; int i; /* clamp unsigned integer; we assume here that the system uses at least octets_per_cgm_unsigned_int octets per unsigned int, i.e. that the system precision is at least as great as the CGM precision */ max_unsigned_int = 0; for (i = 0; i < (8 * octets_per_cgm_unsigned_int); i++) max_unsigned_int += (1 << i); if (n > max_unsigned_int) n = max_unsigned_int; for (i = 0; i < octets_per_cgm_unsigned_int; i++) { unsigned char v; v = 0xff & (n >> (8 * ((octets_per_cgm_unsigned_int - 1) - i))); cgm_unsigned_int[i] = v; } } /* Write a (signed) integer in CGM format. In the binary encoding, CGM_BINARY_BYTES_PER_INTEGER bytes are written. In CGM files the default value for that parameter (defined in extern.h) is 2, but it can be increased. */ void _cgm_emit_integer (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count) { int i; unsigned char cgm_int[CGM_BINARY_BYTES_PER_INTEGER]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: int_to_cgm_int (x, cgm_int, CGM_BINARY_BYTES_PER_INTEGER); for (i = 0; i < CGM_BINARY_BYTES_PER_INTEGER; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " %d", x); _update_buffer (outbuf); break; } } /* similar to the preceding, but writes an unsigned integer rather than a signed integer. */ void _cgm_emit_unsigned_integer (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count) { int i; unsigned char cgm_unsigned_int[CGM_BINARY_BYTES_PER_INTEGER]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: unsigned_int_to_cgm_unsigned_int (x, cgm_unsigned_int, CGM_BINARY_BYTES_PER_INTEGER); for (i = 0; i < CGM_BINARY_BYTES_PER_INTEGER; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_unsigned_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " %u", x); _update_buffer (outbuf); break; } } /* similar to the preceding, but writes an `8-bit' unsigned integer (an unsigned integer in the range 0.255) as a single byte. */ void _cgm_emit_unsigned_integer_8bit (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count) { /* clamp to 0..255 */ if (x > (unsigned int)255) x = (unsigned int)255; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(unsigned char)x; _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " %u", x); _update_buffer (outbuf); break; } } /* Write a point, i.e. a pair of (signed) integers, in CGM format. In the binary encoding, 2 * CGM_BINARY_BYTES_PER_INTEGER bytes are written. */ void _cgm_emit_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int y, int data_len, int *data_byte_count, int *byte_count) { int i; unsigned char cgm_int[CGM_BINARY_BYTES_PER_INTEGER]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: int_to_cgm_int (x, cgm_int, CGM_BINARY_BYTES_PER_INTEGER); for (i = 0; i < CGM_BINARY_BYTES_PER_INTEGER; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } int_to_cgm_int (y, cgm_int, CGM_BINARY_BYTES_PER_INTEGER); for (i = 0; i < CGM_BINARY_BYTES_PER_INTEGER; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " (%d, %d)", x, y); _update_buffer (outbuf); break; } } /* Write a list of points, i.e. a list of pairs of (signed) integers, in CGM format. */ void _cgm_emit_points (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, const int *x, const int *y, int npoints, int data_len, int *data_byte_count, int *byte_count) { int i, j; unsigned char cgm_int[CGM_BINARY_BYTES_PER_INTEGER]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: for (j = 0; j < npoints; j++) { int_to_cgm_int (x[j], cgm_int, CGM_BINARY_BYTES_PER_INTEGER); for (i = 0; i < CGM_BINARY_BYTES_PER_INTEGER; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } int_to_cgm_int (y[j], cgm_int, CGM_BINARY_BYTES_PER_INTEGER); for (i = 0; i < CGM_BINARY_BYTES_PER_INTEGER; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: for (i = 0; i < npoints; i++) { sprintf (outbuf->point, " (%d, %d)", x[i], y[i]); _update_buffer (outbuf); } break; } } /* Write an `enumerative', in CGM format. In the binary encoding, 2 bytes are written. This is just like _cgm_emit_integer, except that the precision is fixed at 16 bits. In the clear text encoding, a text string is written. */ void _cgm_emit_enum (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count, const char *text_string) { int i; unsigned char cgm_int[2]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: int_to_cgm_int (x, cgm_int, 2); for (i = 0; i < 2; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " %s", text_string); _update_buffer (outbuf); break; } } /* Write an `index' in CGM format. In the binary encoding, 2 bytes are written. This is just like _cgm_emit_integer, except that we fix the precision at 16 bits (this could be changed, but according to the "CGM Handbook", using any other index precision is very rare). In c_defplot.c, we use this routine also for writing 2-byte integers or VDC integers (necessary before we reset the integer and VDC integer precisions). */ void _cgm_emit_index (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, int x, int data_len, int *data_byte_count, int *byte_count) { int i; unsigned char cgm_int[2]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: int_to_cgm_int (x, cgm_int, 2); for (i = 0; i < 2; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " %d", x); _update_buffer (outbuf); break; } } /* Write a `color component' in CGM format. In the binary encoding, CGM_BINARY_BYTES_PER_COLOR_COMPONENT bytes are written. Valid values for that parameter (set in extern.h) are 1, 2, 3, 4, but our code in c_color.c supports only 1 or 2, i.e. 24-bit color or 48-bit color. */ void _cgm_emit_color_component (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, unsigned int x, int data_len, int *data_byte_count, int *byte_count) { int i; unsigned char cgm_unsigned_int[CGM_BINARY_BYTES_PER_COLOR_COMPONENT]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: unsigned_int_to_cgm_unsigned_int (x, cgm_unsigned_int, CGM_BINARY_BYTES_PER_COLOR_COMPONENT); for (i = 0; i < CGM_BINARY_BYTES_PER_COLOR_COMPONENT; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_unsigned_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " %u", x); _update_buffer (outbuf); break; } } /* Write a real quantity. In the binary encoding, the default CGM fixed-point format is used. That is 32 bits, with 16 bits for integer part [including sign bit] and 16 for added fraction in range [0,1); numbers from -32767.0 to 32768.0- may be represented. In the clear text encoding, a conventional representation is used. */ void _cgm_emit_real_fixed_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, double x, int data_len, int *data_byte_count, int *byte_count) { int x_floor; unsigned int x_frac; int i; unsigned char cgm_int[2], cgm_unsigned_int[2]; /* clamp to range [-32767.0,32767.0] */ if (x < -32767.0) x = -32767.0; else if (x > 32767.0) x = 32767.0; x_floor = (x >= 0.0 ? (int)x : -1 - ((int)(-x))); x_frac = (unsigned int)(65536 * (x - x_floor)); switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: int_to_cgm_int (x_floor, cgm_int, 2); for (i = 0; i < 2; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } unsigned_int_to_cgm_unsigned_int (x_frac, cgm_unsigned_int, 2); for (i = 0; i < 2; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cgm_unsigned_int[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: if (x != 0.0) sprintf (outbuf->point, " %.8f", x); else sprintf (outbuf->point, " 0.0"); _update_buffer (outbuf); break; } } /* Express a real number (a C `double') in IEEE single precision format: 32 bits, including 1 sign bit, 8 exponent bits, and 23 mantissa bits, split into 4 octets, i.e. bytes, in big-endian order. The octets are returned in an array of unsigned chars. Since any of our output buffers contains an array of char, we'll be assuming that the bit pattern of chars and unsigned chars is the same, so that we can cast unsigned chars to chars with impunity. */ static void double_to_ieee_single_precision (double d, unsigned char output[4]) { double min_magnitude, max_magnitude, tmp_power, max_power; bool got_a_bit; int i, j; int sign_bit; int mantissa_bits[23]; /* leading `1' omitted */ int exponent_bits[8]; int biased_exponent = 0; /* usually 1..254, meaning 1-127..254-127 */ int bits[256]; /* as indices, 1..254 are meaningful */ int output_bits[32]; /* compute min, max magnitudes we'll produce */ /* minimum = 2^(1-127) = 2^(-126). This is the minimum non-subnormalized IEEE single-precision floating point number. */ min_magnitude = 1.0; for (i = 0; i < 127-1; i++) min_magnitude /= 2; /* maximum = 2^(255-127) [1.0 - 2^(-24)] = 2^128 - 2^104 = 1.11111111111111111111111 * 2^(254-127) = 1.11111111111111111111111 * 2^127 This is the maximum IEEE single-precision floating point number. */ tmp_power = 1.0; max_magnitude = 0.0; for (i = 0; i <= 254-127; i++) { if (i >= 104) max_magnitude += tmp_power; tmp_power *= 2; } /* replace NaN by maximum positive value */ if (d != d) d = max_magnitude; /* extract sign bit */ if (d < 0.0) { sign_bit = 1; d = -d; } else sign_bit = 0; /* if nonzero, clamp to allowed range */ if (d != 0.0 && d < min_magnitude) d = min_magnitude; else if (d > max_magnitude) d = max_magnitude; /* compute max power of two that can occur in binary expansion, i.e. 2^(254-127) = 2^127 */ max_power = 1.0; for (i = 0; i < 254-127; i++) max_power *= 2; /* compute bits array; location of first `1' will be biased exponent */ for (i = 0; i < 256; i++) bits[i] = 0; got_a_bit = false; for (i = 254, tmp_power = max_power; i >= 1; i--, tmp_power /= 2) if (d >= tmp_power) { if (got_a_bit == false) { biased_exponent = i; /* will be in range 1..254, if set */ got_a_bit = true; } bits[i] = 1; d -= tmp_power; } if (got_a_bit == false) /* d = 0.0, use bogus value for biased exponent */ biased_exponent = 0; /* extract mantissa bits: in bits array, they start after first `1' */ for (j = 0; j < 23; j++) mantissa_bits[j] = 0; if (got_a_bit == true) for (i = biased_exponent - 1, j = 0; i >= 1 && j < 23; i--, j++) mantissa_bits[j] = bits[i]; /* extract exponent bits; exponent is in range 0..254 */ for (j = 7; j >= 0; j--) { exponent_bits[j] = biased_exponent % 2; biased_exponent /= 2; } /* construct output array of 32 bits */ output_bits[0] = sign_bit; for (j = 0; j < 8; j++) output_bits[j + 1] = exponent_bits[j]; for (j = 0; j < 23; j++) output_bits[j + 9] = mantissa_bits[j]; for (j = 0; j < 4; j++) output[j] = (unsigned char)0; for (j = 0; j < 32; j++) if (output_bits[j] == 1) output[j / 8] |= (1 << ((31 - j) % 8)); } /* Write a real quantity. Like the _cgm_emit_real_fixed_point, but in the binary encoding, rather than a fixed-point format, a floating-point format is used. In particular, IEEE single-precision format, occupying 32 bits; split into octets in big-endian order. A CGMPlotter calls this function only to write a mandatory `scaling factor' that is probably bogus. See c_defplot.c. */ void _cgm_emit_real_floating_point (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, double x, int data_len, int *data_byte_count, int *byte_count) { int i; unsigned char cp[4]; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: double_to_ieee_single_precision (x, cp); for (i = 0; i < 4; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = (char)(cp[i]); _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: sprintf (outbuf->point, " %.8f", x); _update_buffer (outbuf); break; } } /* Write a string, in CGM format. In the binary encoding, string encoding depends on string length. (1) If length <= 254 bytes, the length is prepended to the string, as a single byte. (2) If length >= 255 bytes, the encoding begins with a byte equal to 255. Then there is a sixteen-bit word containing a length (up to 32767) and a continuation flag, followed by data bytes; the two of them constitute a `string partition', which may be repeated arbitrarily many times. We use at most CGM_STRING_PARTITION_SIZE data bytes in a partition, rather than 32767, to avoid buffer overrun; see comment above. The total byte length of the encoded string, if string_length=original length, equals CGM_BINARY_BYTES_PER_STRING(string_length). This macro is defined in extern.h. In the clear text encoding, we surround the string by quotes, and escape any quote that it contains by doubling it. We use single quotes unless the `use_double_quotes' flag is set. */ void _cgm_emit_string (plOutbuf *outbuf, bool no_partitioning, int cgm_encoding, const char *s, int string_length, bool use_double_quotes, int data_len, int *data_byte_count, int *byte_count) { int i, encoded_string_length; const char *sp = s; char *t, *tp, c; switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: { #if 0 fprintf (stderr, "cgm_emit_string(), length=%d\n", string_length); for (i = 0; i < string_length; i++) putc (s[i], stderr); putc ('\n', stderr); #endif /* first, encode the string */ encoded_string_length = CGM_BINARY_BYTES_PER_STRING(string_length); tp = t = (char *)_pl_xmalloc (encoded_string_length * sizeof(char)); if (string_length <= 254) { /* begin with `count' byte, follow by original string */ *tp++ = (char)(unsigned char)string_length; for (i = 0; i < string_length; i++) *tp++ = *sp++; } else { /* first byte is `255' */ *tp++ = (char)255; /* copy data bytes, with string partition headers interpolated as needed; `i' counts data bytes copied */ for (i = 0; i < string_length; i++, sp++) { if (i % CGM_STRING_PARTITION_SIZE == 0) /* write two-byte string partition header */ { int bytes_remaining = string_length - i; int string_header_word; if (bytes_remaining <= CGM_STRING_PARTITION_SIZE) string_header_word = bytes_remaining; else /* must continue; set continuation flag */ { string_header_word = (1 << 15); string_header_word |= CGM_STRING_PARTITION_SIZE; } /* write string partition header word, big-endian */ *tp++ = (char)((string_header_word >> 8) & 0377); *tp++ = (char)(string_header_word & 0377); } /* copy byte */ *tp++ = *sp; } } /* copy encoded string to output buffer; it may require more than one data partition */ for (i = 0; i < encoded_string_length; i++) { if (no_partitioning == false && CGM_BINARY_DATA_PARTITION_BEGINS(data_len, data_byte_count)) cgm_emit_partition_control_word (outbuf, data_len, data_byte_count, byte_count); *(outbuf->point) = t[i]; _update_buffer_by_added_bytes (outbuf, 1); (*data_byte_count)++; (*byte_count)++; } /* free encoded string */ free (t); } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: { /* allocate space for encoded string, including initial and final quotes, a space for readability, and a final NULL */ encoded_string_length = 2 * string_length + 3; tp = t = (char *)_pl_xmalloc ((encoded_string_length + 1) * sizeof(char)); /* begin with a space for readability, and a quote */ *tp++ = ' '; *tp++ = (use_double_quotes ? '"' : '\''); while ((c = *sp++) != '\0') { /* escape all quotes by doubling them */ if (((use_double_quotes == true) && c == '"') || ((use_double_quotes == false) && c == '\'')) *tp++ = c; *tp++ = c; } /* end with a quote */ *tp++ = (use_double_quotes ? '"' : '\''); *tp++ = '\0'; strcpy (outbuf->point, t); _update_buffer (outbuf); free (t); } break; } } /* Write the terminator of a CGM command. In the binary encoding this writes a single null if and only if the number of bytes previously written (kept track of via the `byte_count' pointer) is odd; otherwise it does nothing. In the clear text encoding it writes ";\n". */ void _cgm_emit_command_terminator (plOutbuf *outbuf, int cgm_encoding, int *byte_count) { switch (cgm_encoding) { case CGM_ENCODING_BINARY: default: if ((*byte_count) % 2 == 1) { *(outbuf->point) = '\0'; _update_buffer_by_added_bytes (outbuf, 1); (*byte_count)++; } break; case CGM_ENCODING_CHARACTER: /* not supported */ break; case CGM_ENCODING_CLEAR_TEXT: strcpy (outbuf->point, ";\n"); _update_buffer (outbuf); break; } } plotutils-2.6/libplot/c_erase.c0000644000175000017500000001112211037243260013546 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_c_erase_page (S___(Plotter *_plotter)) { int i; /* reinitialize `font used' array(s) for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; /* deallocate table of user-specified line types, if any */ if (_plotter->data->page->extra) { plCGMCustomLineType *linetype_ptr = (plCGMCustomLineType *)_plotter->data->page->extra; plCGMCustomLineType *old_linetype_ptr; while (linetype_ptr) { if (linetype_ptr->dash_array_len > 0 /* paranoia */ && linetype_ptr->dashes) free (linetype_ptr->dashes); old_linetype_ptr = linetype_ptr; linetype_ptr = linetype_ptr->next; free (old_linetype_ptr); } _plotter->data->page->extra = (void *)NULL; } /* reset other page-specific, i.e. picture-specific, CGMPlotter variables, as if the page had just been opened */ _plotter->cgm_page_version = 1; _plotter->cgm_page_profile = CGM_PROFILE_WEB; _plotter->cgm_page_need_color = false; /* colors */ _plotter->cgm_line_color.red = -1; _plotter->cgm_line_color.green = -1; _plotter->cgm_line_color.blue = -1; _plotter->cgm_edge_color.red = -1; _plotter->cgm_edge_color.green = -1; _plotter->cgm_edge_color.blue = -1; _plotter->cgm_fillcolor.red = -1; _plotter->cgm_fillcolor.green = -1; _plotter->cgm_fillcolor.blue = -1; _plotter->cgm_marker_color.red = -1; _plotter->cgm_marker_color.green = -1; _plotter->cgm_marker_color.blue = -1; _plotter->cgm_text_color.red = -1; _plotter->cgm_text_color.green = -1; _plotter->cgm_text_color.blue = -1; _plotter->cgm_bgcolor.red = -1; _plotter->cgm_bgcolor.green = -1; _plotter->cgm_bgcolor.blue = -1; /* other dynamic variables */ _plotter->cgm_line_type = CGM_L_SOLID; _plotter->cgm_dash_offset = 0.0; _plotter->cgm_join_style = CGM_JOIN_UNSPEC; _plotter->cgm_cap_style = CGM_CAP_UNSPEC; _plotter->cgm_dash_cap_style = CGM_CAP_UNSPEC; /* CGM's default line width: 1/1000 times the max VDC dimension */ _plotter->cgm_line_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500; _plotter->cgm_interior_style = CGM_INT_STYLE_HOLLOW; _plotter->cgm_edge_type = CGM_L_SOLID; _plotter->cgm_edge_dash_offset = 0.0; _plotter->cgm_edge_join_style = CGM_JOIN_UNSPEC; _plotter->cgm_edge_cap_style = CGM_CAP_UNSPEC; _plotter->cgm_edge_dash_cap_style = CGM_CAP_UNSPEC; /* CGM's default edge width: 1/1000 times the max VDC dimension */ _plotter->cgm_edge_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500; _plotter->cgm_edge_is_visible = false; _plotter->cgm_miter_limit = 32767.0; _plotter->cgm_marker_type = CGM_M_ASTERISK; /* CGM's default marker size: 1/1000 times the max VDC dimension */ _plotter->cgm_marker_size = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) /500; /* label-related variables */ _plotter->cgm_char_height = -1; /* impossible (dummy) value */ _plotter->cgm_char_base_vector_x = 1; _plotter->cgm_char_base_vector_y = 0; _plotter->cgm_char_up_vector_x = 0; _plotter->cgm_char_up_vector_y = 1; _plotter->cgm_horizontal_text_alignment = CGM_ALIGN_NORMAL_HORIZONTAL; _plotter->cgm_vertical_text_alignment = CGM_ALIGN_NORMAL_VERTICAL; _plotter->cgm_font_id = -1; /* impossible (dummy) value */ _plotter->cgm_charset_lower = 0; /* dummy value (we use values 1..4) */ _plotter->cgm_charset_upper = 0; /* dummy value (we use values 1..4) */ _plotter->cgm_restricted_text_type = CGM_RESTRICTED_TEXT_TYPE_BASIC; /* copy the bg color currently in the drawing state to the CGM-specific part of the CGMPlotter; it'll be written to the output file at the head of the picture */ _pl_c_set_bg_color (S___(_plotter)); return true; } plotutils-2.6/libplot/c_mark.c0000644000175000017500000001176211037243260013413 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The paint_marker method, which is an internal function that is called when the marker() method is invoked. It plots an object: a marker of a specified type, at a specified size, at the current location. If this returns `false', marker() will construct the marker from other libplot primitives, in a generic way. */ /* This implementation is for CGM Plotters. CGM format supports the first few of our marker types, as CGM primitive objects. */ #include "sys-defines.h" #include "extern.h" /* The maximum dimension of most markers, e.g. the diameter of the circle marker (marker #4). Expressed as a fraction of the `size' argument. */ #define MAXIMUM_MARKER_DIMENSION (5.0/8.0) bool _pl_c_paint_marker (R___(Plotter *_plotter) int type, double size) { int desired_marker_type, desired_marker_size; double xd, yd, size_d; int i_x, i_y; switch (type) { case M_DOT: desired_marker_type = CGM_M_DOT; break; case M_PLUS: desired_marker_type = CGM_M_PLUS; break; case M_ASTERISK: desired_marker_type = CGM_M_ASTERISK; break; case M_CIRCLE: desired_marker_type = CGM_M_CIRCLE; break; case M_CROSS: desired_marker_type = CGM_M_CROSS; break; default: return false; /* can't draw it in CGM format */ break; } if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { if (_plotter->cgm_marker_type != desired_marker_type) /* emit "MARKER TYPE" command */ { int byte_count, data_byte_count, data_len; data_len = 2; /* number of bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 6, data_len, &byte_count, "MARKERTYPE"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, desired_marker_type, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update marker type */ _plotter->cgm_marker_type = desired_marker_type; } /* compute size of marker in device frame */ size_d = sqrt(XDV(size,0)*XDV(size,0)+YDV(size,0)*YDV(size,0)); desired_marker_size = IROUND(MAXIMUM_MARKER_DIMENSION * size_d); if (desired_marker_type != CGM_M_DOT && _plotter->cgm_marker_size != desired_marker_size) /* emit "MARKER SIZE" command (for a dot we don't bother, since dots are meant to be drawn as small as possible) */ { int byte_count, data_byte_count, data_len; data_len = CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 7, data_len, &byte_count, "MARKERSIZE"); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_marker_size, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update marker size */ _plotter->cgm_marker_size = desired_marker_size; } /* set CGM marker color */ _pl_c_set_pen_color (R___(_plotter) CGM_OBJECT_MARKER); /* compute location in device frame */ xd = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); yd = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); i_x = IROUND(xd); i_y = IROUND(yd); /* emit "POLYMARKER" command, to draw a single marker */ { int byte_count, data_byte_count, data_len; data_len = 1 * 2 * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 3, data_len, &byte_count, "MARKER"); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, i_x, i_y, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); } } return true; } plotutils-2.6/libplot/c_openpl.c0000644000175000017500000001047011037243260013751 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This version is for CGM Plotters, which graphics only after all pages of graphics have been drawn, and the Plotter is deleted. */ #include "sys-defines.h" #include "extern.h" bool _pl_c_begin_page (S___(Plotter *_plotter)) { int i; /* CGM Plotters use the `extra' field of their single plOutbuf (a void pointer; it points to the head of a linked list of user-defined line types for the page) */ _plotter->data->page->extra = (void *)NULL; /* initialize `font used' array(s) for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; /* reset page-specific, i.e. picture-specific, dynamic variables */ _plotter->cgm_page_version = 1; _plotter->cgm_page_profile = CGM_PROFILE_WEB; _plotter->cgm_page_need_color = false; /* colors */ _plotter->cgm_line_color.red = -1; _plotter->cgm_line_color.green = -1; _plotter->cgm_line_color.blue = -1; _plotter->cgm_edge_color.red = -1; _plotter->cgm_edge_color.green = -1; _plotter->cgm_edge_color.blue = -1; _plotter->cgm_fillcolor.red = -1; _plotter->cgm_fillcolor.green = -1; _plotter->cgm_fillcolor.blue = -1; _plotter->cgm_marker_color.red = -1; _plotter->cgm_marker_color.green = -1; _plotter->cgm_marker_color.blue = -1; _plotter->cgm_text_color.red = -1; _plotter->cgm_text_color.green = -1; _plotter->cgm_text_color.blue = -1; _plotter->cgm_bgcolor.red = -1; _plotter->cgm_bgcolor.green = -1; _plotter->cgm_bgcolor.blue = -1; /* other dynamic variables */ _plotter->cgm_line_type = CGM_L_SOLID; _plotter->cgm_dash_offset = 0.0; _plotter->cgm_join_style = CGM_JOIN_UNSPEC; _plotter->cgm_cap_style = CGM_CAP_UNSPEC; _plotter->cgm_dash_cap_style = CGM_CAP_UNSPEC; /* CGM's default line width: 1/1000 times the max VDC dimension */ _plotter->cgm_line_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500; _plotter->cgm_interior_style = CGM_INT_STYLE_HOLLOW; _plotter->cgm_edge_type = CGM_L_SOLID; _plotter->cgm_edge_dash_offset = 0.0; _plotter->cgm_edge_join_style = CGM_JOIN_UNSPEC; _plotter->cgm_edge_cap_style = CGM_CAP_UNSPEC; _plotter->cgm_edge_dash_cap_style = CGM_CAP_UNSPEC; /* CGM's default edge width: 1/1000 times the max VDC dimension */ _plotter->cgm_edge_width = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) / 500; _plotter->cgm_edge_is_visible = false; _plotter->cgm_miter_limit = 32767.0; _plotter->cgm_marker_type = CGM_M_ASTERISK; /* CGM's default marker size: 1/1000 times the max VDC dimension */ _plotter->cgm_marker_size = (1 << (8*CGM_BINARY_BYTES_PER_INTEGER - 3)) /500; /* label-related variables */ _plotter->cgm_char_height = -1; /* impossible (dummy) value */ _plotter->cgm_char_base_vector_x = 1; _plotter->cgm_char_base_vector_y = 0; _plotter->cgm_char_up_vector_x = 0; _plotter->cgm_char_up_vector_y = 1; _plotter->cgm_horizontal_text_alignment = CGM_ALIGN_NORMAL_HORIZONTAL; _plotter->cgm_vertical_text_alignment = CGM_ALIGN_NORMAL_VERTICAL; _plotter->cgm_font_id = -1; /* impossible (dummy) value */ _plotter->cgm_charset_lower = 0; /* dummy value (we use values 1..4) */ _plotter->cgm_charset_upper = 0; /* dummy value (we use values 1..4) */ _plotter->cgm_restricted_text_type = CGM_RESTRICTED_TEXT_TYPE_BASIC; /* copy background color to the CGM-specific part of the CGMPlotter; it'll be written to the output file at the head of the picture */ _pl_c_set_bg_color (S___(_plotter)); return true; } plotutils-2.6/libplot/c_path.c0000644000175000017500000011641611037243260013417 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This version is for CGMPlotters. By construction, for CGMPlotters our path storage buffer may include any of the three builtin closed primitives (box, circle, ellipse), or a sequence of segments, such as line segments. If the parameter CGM_MAX_VERSION is "1", the only possible contents of the segment list is a sequence of line segments, i.e., a polyline. If CGM_MAX_VERSION is "2", the segment list may contain, instead, a single elliptic or circular arc. If CGM_MAX_VERSION is "3", the segment list may contain an arbitrary sequence of line segments, arc segments, and cubic Beziers too, i.e., an arbitrary `mixed path'. These restrictions on the segment list contents are implemented by setting internal Plotter parameters at initialization time (e.g., _plotter->data->have_mixed_paths; see c_defplot.c). The reason for the restrictions is obvious: to store in the segment list only those primitives that can be represented by a single CGM object, either simple or compound. For example, circular arcs are not stored unless the emitting of version-2 CGM primitives is supported. That's because although version-1 CGM's support counterclockwise arcs, clockwise arcs are supported only beginning with version 2. And even though version-2 CGM's support arbitrary closed mixed paths, at least ones that don't contain Beziers ("closed figures"), arbitrary open mixed paths ("compound lines") are supported only beginning with version 3. */ #include "sys-defines.h" #include "extern.h" void _pl_c_paint_path (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { bool closed; plIntPathSegment *xarray; int polyline_len; bool draw_as_cgm_compound, path_is_single_polyline; int pass; plPathSegmentType first_element_type; int i, byte_count, data_byte_count, data_len; int desired_interior_style; const char *desired_interior_style_string; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /*shouldn't happen */ break; /* check for closure */ if ((_plotter->drawstate->path->num_segments >= 3) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.x == _plotter->drawstate->path->segments[0].p.x) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.y == _plotter->drawstate->path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ /* set CGM pen/fill colors and line attributes, by emitting appropriate commands */ /* N.B. pen color and line attributes don't need to be set if pen_type is zero, signifying an edgeless (presumably filled) path */ _pl_c_set_pen_color (R___(_plotter) closed ? CGM_OBJECT_CLOSED : CGM_OBJECT_OPEN); _pl_c_set_fill_color (R___(_plotter) closed ? CGM_OBJECT_CLOSED : CGM_OBJECT_OPEN); _pl_c_set_attributes (R___(_plotter) closed ? CGM_OBJECT_CLOSED : CGM_OBJECT_OPEN); /* array for points, with positions expressed in integer device coors */ xarray = (plIntPathSegment *)_pl_xmalloc (_plotter->drawstate->path->num_segments * sizeof(plIntPathSegment)); /* add first point of path to xarray[] (a moveto, presumably) */ xarray[0].p.x = IROUND(XD(_plotter->drawstate->path->segments[0].p.x, _plotter->drawstate->path->segments[0].p.y)); xarray[0].p.y = IROUND(YD(_plotter->drawstate->path->segments[0].p.x, _plotter->drawstate->path->segments[0].p.y)); polyline_len = 1; /* convert to integer CGM coordinates (unlike the HP-GL case [see h_path.c], we don't remove runs, so after this loop completes, polyline_len equals _plotter->drawstate->path->num_segments) */ for (i = 1; i < _plotter->drawstate->path->num_segments; i++) { plPathSegment datapoint; double xuser, yuser, xdev, ydev; int device_x, device_y; datapoint = _plotter->drawstate->path->segments[i]; xuser = datapoint.p.x; yuser = datapoint.p.y; xdev = XD(xuser, yuser); ydev = YD(xuser, yuser); device_x = IROUND(xdev); device_y = IROUND(ydev); { plPathSegmentType element_type; int device_xc, device_yc; xarray[polyline_len].p.x = device_x; xarray[polyline_len].p.y = device_y; element_type = datapoint.type; xarray[polyline_len].type = element_type; if (element_type == S_ARC || element_type == S_ELLARC) /* an arc or elliptic arc element, so compute center too */ { device_xc = IROUND(XD(datapoint.pc.x, datapoint.pc.y)); device_yc = IROUND(YD(datapoint.pc.x, datapoint.pc.y)); xarray[polyline_len].pc.x = device_xc; xarray[polyline_len].pc.y = device_yc; } else if (element_type == S_CUBIC) /* a cubic Bezier element, so compute control points too */ { xarray[polyline_len].pc.x = IROUND(XD(datapoint.pc.x, datapoint.pc.y)); xarray[polyline_len].pc.y = IROUND(YD(datapoint.pc.x, datapoint.pc.y)); xarray[polyline_len].pd.x = IROUND(XD(datapoint.pd.x, datapoint.pd.y)); xarray[polyline_len].pd.y = IROUND(YD(datapoint.pd.x, datapoint.pd.y)); } polyline_len++; } } /* A hack for CGM: if a circular or elliptic arc segment in integer device coordinates looks bogus, i.e. endpoints are the same or either is the same as the center point, replace it by a line segment. This will allow us to assume, later, that the displacement vectors from the center to the two endpoints are nonzero and unequal. */ for (i = 1; i < polyline_len; i++) { if (xarray[i].type == S_ARC || xarray[i].type == S_ELLARC) if ((xarray[i-1].p.x == xarray[i].p.x && xarray[i-1].p.y == xarray[i].p.y) || (xarray[i-1].p.x == xarray[i].pc.x && xarray[i-1].p.y == xarray[i].pc.y) || (xarray[i].p.x == xarray[i].pc.x && xarray[i].p.y == xarray[i].pc.y)) xarray[i].type = S_LINE; } /* set CGM attributes (differently, depending on whether path is closed or open, because different CGM graphical primitives will be emitted in the two cases to draw the path) */ if (closed) { if (_plotter->drawstate->fill_type == 0) /* won't do filling */ { desired_interior_style = CGM_INT_STYLE_EMPTY; desired_interior_style_string = "empty"; } else /* will do filling */ { desired_interior_style = CGM_INT_STYLE_SOLID; desired_interior_style_string = "solid"; } if (_plotter->cgm_interior_style != desired_interior_style) /* emit "INTERIOR STYLE" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 22, data_len, &byte_count, "INTSTYLE"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, desired_interior_style, data_len, &data_byte_count, &byte_count, desired_interior_style_string); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update interior style */ _plotter->cgm_interior_style = desired_interior_style; } if (_plotter->drawstate->pen_type) /* should draw the closed path so that edge is visible */ { if (_plotter->cgm_edge_is_visible != true) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "on"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = true; } } else /* shouldn't edge the closed path */ { if (_plotter->cgm_edge_is_visible != false) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "off"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = false; } } } else /* open! */ { if (_plotter->drawstate->fill_type != 0) /* will `fill' the path by first drawing an edgeless solid-filled polygon, or an edgeless solid-filled closed figure; in both cases edge visibility will be turned off */ { if (_plotter->cgm_interior_style != CGM_INT_STYLE_SOLID) /* emit "INTERIOR STYLE" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 22, data_len, &byte_count, "INTSTYLE"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, CGM_INT_STYLE_SOLID, data_len, &data_byte_count, &byte_count, "solid"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update interior style */ _plotter->cgm_interior_style = CGM_INT_STYLE_SOLID; } if (_plotter->cgm_edge_is_visible) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "off"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = false; } } } /* Will path be drawn as a CGM compound primitive, containing > 1 graphical primitives? If it contains more than one type of path segment, or if it contains more than a single circular arc segment or elliptic arc segment, answer is `yes'. Because of our policies, implemented elsewhere, on what may be stored in the segment buffer (see above), we'll draw as a compound primitive only if CGM_MAX_VERSION >= 3. */ draw_as_cgm_compound = false; first_element_type = xarray[1].type; for (i = 2; i < polyline_len; i++) { if (xarray[i].type == S_ARC || xarray[i].type == S_ELLARC || xarray[i].type != first_element_type) { draw_as_cgm_compound = true; break; } } /* is path simply a polyline? */ { path_is_single_polyline = true; for (i = 1; i < polyline_len; i++) { if (xarray[i].type != S_LINE) { path_is_single_polyline = false; break; } } } /* Make two passes through segment buffer: (0) draw and fill, if necessary, a closed CGM object, e.g. a `closed figure' [necessary iff path is closed, or is open and filled], and (1) edge an open CGM object, e.g. a `compound line' [necessary iff path is open]. */ for (pass = 0; pass < 2; pass++) { int primitives_emitted; if (pass == 0 && !(closed || _plotter->drawstate->fill_type != 0)) /* no drawing of a closed object needed: skip pass 0 */ continue; if (pass == 1 && (closed || (!closed && _plotter->drawstate->pen_type == 0))) /* no need for a special `draw edge' pass: skip pass 1 */ continue; /* keep track of individual graphical primitives emitted per pass (profile requires <=128 per composite primitive, closed or open) */ primitives_emitted = 0; if (pass == 0 && !path_is_single_polyline) /* emit `BEGIN CLOSED FIGURE' command (no parameters); drawing of closed polylines and filling of open ones is handled specially (see below) */ { data_len = 0; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 8, data_len, &byte_count, "BEGFIGURE"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update CGM version needed for this page */ _plotter->cgm_page_version = IMAX(2, _plotter->cgm_page_version); } if (pass == 1 && draw_as_cgm_compound) /* emit `BEGIN COMPOUND LINE' command (no parameters) */ { data_len = 0; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 15, data_len, &byte_count, "BEGCOMPOLINE"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update CGM version needed for this page */ _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } /* iterate over path elements, combining runs of line segments into polylines, and runs of Beziers into poly-Beziers, but emitting each circular arc and elliptic arc individually (since CGM doesn't support poly-arcs) */ i = 0; while (i + 1 < polyline_len) { int j, end_of_run; plPathSegmentType element_type; /* determine `run' (relevant only for lines, Beziers) */ element_type = xarray[i + 1].type; for (j = i + 1; j < polyline_len && xarray[j].type == element_type; j++) ; end_of_run = j - 1; switch ((int)element_type) { case (int)S_LINE: if ((pass == 0 && !path_is_single_polyline) || (pass == 1)) /* normal case: emit "POLYLINE" command to draw polyline */ /* number of line segments in polyline: end_of_run - i */ /* number of points in polyline: 1 + (end_of_run - i) */ { /* update CGM profile for this page */ if (1 + (end_of_run - i) > 4096) _plotter->cgm_page_profile = IMAX(_plotter->cgm_page_profile, CGM_PROFILE_NONE); data_len = 2 * CGM_BINARY_BYTES_PER_INTEGER * (1 + end_of_run - i); byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 1, data_len, &byte_count, "LINE"); /* combine line segments into polyline */ for ( ; i <= end_of_run; i++) _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].p.x, xarray[i].p.y, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); primitives_emitted++; /* next CGM component object begins at i=end_of_run */ i--; } else /* Special case: we're running pass 0, and path consists of a single polyline. So emit "POLYGON" command, omitting the final point if the polyline is closed, to agree with CGM conventions. */ { /* update CGM profile for this page */ if (polyline_len - (closed ? 1 : 0) > 4096) _plotter->cgm_page_profile = IMAX(_plotter->cgm_page_profile, CGM_PROFILE_NONE); data_len = 2 * CGM_BINARY_BYTES_PER_INTEGER * (polyline_len - (closed ? 1 : 0)); byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 7, data_len, &byte_count, "POLYGON"); for (i = 0; i < polyline_len - (closed ? 1 : 0); i++) _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].p.x, xarray[i].p.y, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); primitives_emitted++; /* we've used up the entire segment buffer: no more primitives to emit */ i = polyline_len - 1; } break; case (int)S_ARC: /* emit "CIRCULAR ARC CENTRE [REVERSED]" command */ { int delta0_x = xarray[i].p.x - xarray[i + 1].pc.x; int delta0_y = xarray[i].p.y - xarray[i + 1].pc.y; int delta1_x = xarray[i + 1].p.x - xarray[i + 1].pc.x; int delta1_y = xarray[i + 1].p.y - xarray[i + 1].pc.y; double radius = sqrt((double)delta0_x * (double)delta0_x + (double)delta0_y * (double)delta0_y); int i_radius = IROUND(radius); double dot = ((double)delta0_x * (double)delta1_y - (double)delta0_y * (double)delta1_x); bool reversed = (dot >= 0.0 ? false : true); /* args: 1 point, 2 vectors, and the radius */ data_len = (3 * 2 + 1) * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; if (reversed) _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 20, data_len, &byte_count, "ARCCTRREV"); else _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 15, data_len, &byte_count, "ARCCTR"); /* center point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i + 1].pc.x, xarray[i + 1].pc.y, data_len, &data_byte_count, &byte_count); /* vector from center to starting point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, delta0_x, delta0_y, data_len, &data_byte_count, &byte_count); /* vector from center to ending point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, delta1_x, delta1_y, data_len, &data_byte_count, &byte_count); /* radius (distance from center to starting point) */ _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, i_radius, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); primitives_emitted++; /* update CGM version needed for this page */ if (reversed) _plotter->cgm_page_version = IMAX(2, _plotter->cgm_page_version); } /* on to next CGM component object */ i++; break; case (int)S_ELLARC: /* emit "ELLIPTICAL ARC" command to draw quarter-ellipse */ { /* args: 3 points, 2 vectors */ data_len = 5 * 2 * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 18, data_len, &byte_count, "ELLIPARC"); /* center point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i + 1].pc.x, xarray[i + 1].pc.y, data_len, &data_byte_count, &byte_count); /* starting point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].p.x, xarray[i].p.y, data_len, &data_byte_count, &byte_count); /* ending point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i + 1].p.x, xarray[i + 1].p.y, data_len, &data_byte_count, &byte_count); /* vector from center to starting point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].p.x - xarray[i + 1].pc.x, xarray[i].p.y - xarray[i + 1].pc.y, data_len, &data_byte_count, &byte_count); /* vector from center to ending point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i + 1].p.x - xarray[i + 1].pc.x, xarray[i + 1].p.y - xarray[i + 1].pc.y, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); primitives_emitted++; } /* on to next CGM component object */ i++; break; case (int)S_CUBIC: /* emit "POLYBEZIER" command */ /* number of Bezier segments in path: end_of_run - i */ /* number of points in path: 1 + 3 * (end_of_run - i) */ /* Note: arguments include also a single `continuity indicator' (a two-byte CGM index) */ { /* update CGM profile for this page */ if (1 + 3 * (end_of_run - i) > 4096) _plotter->cgm_page_profile = IMAX(_plotter->cgm_page_profile, CGM_PROFILE_NONE); data_len = 2 + (2 * CGM_BINARY_BYTES_PER_INTEGER) * (1 + 3 * (end_of_run - i)); byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 26, data_len, &byte_count, "POLYBEZIER"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, /* poly-Bezier continuity index: `2' means successive Beziers abut, so (after the first) each is specified by only three points; `1' means they don't abut. Our Beziers are contiguous, so we specify `2'. We used to specify `1' if there's only one Bezier, but the browser plug-in from SYSDEV didn't like that (it produced a parse error when such a Bezier was the only element of a CGM `closed figure'). */ #if 0 (end_of_run - i > 1 ? 2 : 1), #else (end_of_run - i > 1 ? 2 : 2), #endif data_len, &data_byte_count, &byte_count); /* starting point */ _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].p.x, xarray[i].p.y, data_len, &data_byte_count, &byte_count); i++; /* combine Bezier segments into poly-Bezier */ for ( ; i <= end_of_run; i++) { _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].pc.x, xarray[i].pc.y, data_len, &data_byte_count, &byte_count); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].pd.x, xarray[i].pd.y, data_len, &data_byte_count, &byte_count); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xarray[i].p.x, xarray[i].p.y, data_len, &data_byte_count, &byte_count); } _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); primitives_emitted++; /* update CGM version needed for this page */ _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); /* next CGM component object begins at i=end_of_run */ i--; } break; default: /* shouldn't happen: unknown path segment type, ignore */ i++; break; } } if (pass == 0 && !path_is_single_polyline) /* emit `END CLOSED FIGURE' command (no parameters) */ { data_len = 0; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 9, data_len, &byte_count, "ENDFIGURE"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update CGM version needed for this page */ _plotter->cgm_page_version = IMAX(2, _plotter->cgm_page_version); /* update CGM profile for this page */ if (primitives_emitted > 128) _plotter->cgm_page_profile = IMAX(_plotter->cgm_page_profile, CGM_PROFILE_NONE); } if (pass == 1 && draw_as_cgm_compound) /* emit `END COMPOUND LINE' command (no parameters) */ { data_len = 0; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_DELIMITER_ELEMENT, 16, data_len, &byte_count, "ENDCOMPOLINE"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update CGM version needed for this page */ _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); /* update CGM profile for this page */ if (primitives_emitted > 128) _plotter->cgm_page_profile = IMAX(_plotter->cgm_page_profile, CGM_PROFILE_NONE); } } /* end of loop over passes */ /* free arrays of device-frame points */ free (xarray); } break; case (int)PATH_BOX: { plPoint p0, p1; int xd0, xd1, yd0, yd1; /* in integer device coordinates */ int byte_count, data_byte_count, data_len; int desired_interior_style; const char *desired_interior_style_string; p0 = _plotter->drawstate->path->p0; p1 = _plotter->drawstate->path->p1; /* compute corners in device coors */ xd0 = IROUND(XD(p0.x, p0.y)); yd0 = IROUND(YD(p0.x, p0.y)); xd1 = IROUND(XD(p1.x, p1.y)); yd1 = IROUND(YD(p1.x, p1.y)); /* set CGM edge color and attributes, by emitting appropriate commands */ _pl_c_set_pen_color (R___(_plotter) CGM_OBJECT_CLOSED); _pl_c_set_fill_color (R___(_plotter) CGM_OBJECT_CLOSED); _pl_c_set_attributes (R___(_plotter) CGM_OBJECT_CLOSED); if (_plotter->drawstate->fill_type == 0) /* won't do filling */ { desired_interior_style = CGM_INT_STYLE_EMPTY; desired_interior_style_string = "empty"; } else /* will do filling */ { desired_interior_style = CGM_INT_STYLE_SOLID; desired_interior_style_string = "solid"; } if (_plotter->cgm_interior_style != desired_interior_style) /* emit "INTERIOR STYLE" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 22, data_len, &byte_count, "INTSTYLE"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, desired_interior_style, data_len, &data_byte_count, &byte_count, desired_interior_style_string); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update interior style */ _plotter->cgm_interior_style = desired_interior_style; } if (_plotter->drawstate->pen_type) /* should edge the rectangle */ { if (_plotter->cgm_edge_is_visible != true) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "on"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = true; } } else /* shouldn't edge the rectangle */ { if (_plotter->cgm_edge_is_visible != false) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "off"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = false; } } /* emit "RECTANGLE" command */ { data_len = 2 * 2 * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 11, data_len, &byte_count, "RECT"); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xd0, yd0, data_len, &data_byte_count, &byte_count); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xd1, yd1, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); } } break; case (int)PATH_CIRCLE: { double xd, yd, radius_d; int i_x, i_y, i_radius; /* center and radius, quantized */ plPoint pc; double radius; int byte_count, data_byte_count, data_len; int desired_interior_style; const char *desired_interior_style_string; pc = _plotter->drawstate->path->pc; radius = _plotter->drawstate->path->radius; /* known to be a circle in device frame, so compute center and radius in that frame */ xd = XD(pc.x, pc.y); yd = YD(pc.x, pc.y); radius_d = sqrt (XDV(radius,0) * XDV(radius,0) + YDV(radius,0) * YDV(radius,0)); i_x = IROUND(xd); i_y = IROUND(yd); i_radius = IROUND(radius_d); /* set CGM edge color and attributes, by emitting appropriate commands */ _pl_c_set_pen_color (R___(_plotter) CGM_OBJECT_CLOSED); _pl_c_set_fill_color (R___(_plotter) CGM_OBJECT_CLOSED); _pl_c_set_attributes (R___(_plotter) CGM_OBJECT_CLOSED); if (_plotter->drawstate->fill_type == 0) /* won't do filling */ { desired_interior_style = CGM_INT_STYLE_EMPTY; desired_interior_style_string = "empty"; } else /* will do filling */ { desired_interior_style = CGM_INT_STYLE_SOLID; desired_interior_style_string = "solid"; } if (_plotter->cgm_interior_style != desired_interior_style) /* emit "INTERIOR STYLE" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 22, data_len, &byte_count, "INTSTYLE"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, desired_interior_style, data_len, &data_byte_count, &byte_count, desired_interior_style_string); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update interior style */ _plotter->cgm_interior_style = desired_interior_style; } if (_plotter->drawstate->pen_type) /* should edge the circle */ { if (_plotter->cgm_edge_is_visible != true) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "on"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = true; } } else { if (_plotter->cgm_edge_is_visible != false) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "off"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = false; } } /* emit "CIRCLE" command */ { data_len = 3 * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 12, data_len, &byte_count, "CIRCLE"); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, i_x, i_y, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, i_radius, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); } } break; case (int)PATH_ELLIPSE: { double xd, yd; /* center, in device frame */ int i_x, i_y; /* center, quantized */ double theta, costheta, sintheta; double cd1_endpoint_x, cd1_endpoint_y; /* conjugate diameter endpts */ double cd2_endpoint_x, cd2_endpoint_y; int i1_x, i1_y, i2_x, i2_y; /* same, quantized */ plPoint pc; double rx, ry, angle; int byte_count, data_byte_count, data_len; int desired_interior_style; const char *desired_interior_style_string; pc = _plotter->drawstate->path->pc; rx = _plotter->drawstate->path->rx; ry = _plotter->drawstate->path->ry; angle = _plotter->drawstate->path->angle; /* compute center, in device frame */ xd = XD(pc.x, pc.y); yd = YD(pc.x, pc.y); i_x = IROUND(xd); i_y = IROUND(yd); /* inclination angle (radians), in user frame */ theta = M_PI * angle / 180.0; costheta = cos (theta); sintheta = sin (theta); /* perform affine user->device coor transformation, computing endpoints of conjugate diameter pair, in device frame */ cd1_endpoint_x = XD(pc.x + rx * costheta, pc.y + rx * sintheta); cd1_endpoint_y = YD(pc.x + rx * costheta, pc.y + rx * sintheta); cd2_endpoint_x = XD(pc.x - ry * sintheta, pc.y + ry * costheta); cd2_endpoint_y = YD(pc.x - ry * sintheta, pc.y + ry * costheta); i1_x = IROUND(cd1_endpoint_x); i1_y = IROUND(cd1_endpoint_y); i2_x = IROUND(cd2_endpoint_x); i2_y = IROUND(cd2_endpoint_y); /* set CGM edge color and attributes, by emitting appropriate commands */ _pl_c_set_pen_color (R___(_plotter) CGM_OBJECT_CLOSED); _pl_c_set_fill_color (R___(_plotter) CGM_OBJECT_CLOSED); _pl_c_set_attributes (R___(_plotter) CGM_OBJECT_CLOSED); if (_plotter->drawstate->fill_type == 0) /* won't do filling */ { desired_interior_style = CGM_INT_STYLE_EMPTY; desired_interior_style_string = "empty"; } else /* will do filling */ { desired_interior_style = CGM_INT_STYLE_SOLID; desired_interior_style_string = "solid"; } if (_plotter->cgm_interior_style != desired_interior_style) /* emit "INTERIOR STYLE" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 22, data_len, &byte_count, "INTSTYLE"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, desired_interior_style, data_len, &data_byte_count, &byte_count, desired_interior_style_string); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update interior style */ _plotter->cgm_interior_style = desired_interior_style; } if (_plotter->drawstate->pen_type) /* should edge the ellipse */ { if (_plotter->cgm_edge_is_visible != true) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "on"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = true; } } else { if (_plotter->cgm_edge_is_visible != false) /* emit "EDGE VISIBILITY" command */ { data_len = 2; /* 2 bytes per enum */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 30, data_len, &byte_count, "EDGEVIS"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 0, data_len, &data_byte_count, &byte_count, "off"); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update edge visibility */ _plotter->cgm_edge_is_visible = false; } } /* emit "ELLIPSE" command */ { data_len = 3 * 2 * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 17, data_len, &byte_count, "ELLIPSE"); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, i_x, i_y, data_len, &data_byte_count, &byte_count); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, i1_x, i1_y, data_len, &data_byte_count, &byte_count); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, i2_x, i2_y, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); } } break; default: /* shouldn't happen */ break; } } bool _pl_c_paint_paths (S___(Plotter *_plotter)) { return false; } plotutils-2.6/libplot/c_point.c0000644000175000017500000000625111037243260013607 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ /* This version is for CGMPlotters. It draws a point as CGM marker #1. */ #include "sys-defines.h" #include "extern.h" void _pl_c_paint_point (S___(Plotter *_plotter)) { double xd, yd; int i_x, i_y; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { if (_plotter->cgm_marker_type != CGM_M_DOT) /* emit "MARKER TYPE" command */ { int byte_count, data_byte_count, data_len; data_len = 2; /* number of bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 6, data_len, &byte_count, "MARKERTYPE"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, CGM_M_DOT, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update marker type */ _plotter->cgm_marker_type = CGM_M_DOT; } /* N.B. Should we set the marker size as well? Any good CGM interpreter should draw a dot marker as a very small dot, perhaps a single pixel. */ /* set CGM marker color */ _pl_c_set_pen_color (R___(_plotter) CGM_OBJECT_MARKER); /* compute location in device frame */ xd = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); yd = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); i_x = IROUND(xd); i_y = IROUND(yd); /* emit "POLYMARKER" command, to draw a single marker */ { int byte_count, data_byte_count, data_len; data_len = 1 * 2 * CGM_BINARY_BYTES_PER_INTEGER; byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 3, data_len, &byte_count, "MARKER"); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, i_x, i_y, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); } } } plotutils-2.6/libplot/c_text.c0000644000175000017500000004343211037243260013444 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #define GOOD_PRINTABLE_ASCII(c) ((c >= 0x20) && (c <= 0x7E)) /* CGM horizontal alignment styles, indexed by internal number (left/center/right) */ static const int cgm_horizontal_alignment_style[PL_NUM_HORIZ_JUST_TYPES] = { CGM_ALIGN_LEFT, CGM_ALIGN_CENTER, CGM_ALIGN_RIGHT }; /* corresponding strings, as used in the text encoding */ static const char * const cgm_horizontal_alignment_style_string[PL_NUM_HORIZ_JUST_TYPES] = { "left", "ctr", "right" }; /* CGM vertical alignment styles, indexed by internal number (top/half/base/bottom/cap) */ static const int cgm_vertical_alignment_style[PL_NUM_VERT_JUST_TYPES] = { CGM_ALIGN_TOP, CGM_ALIGN_HALF, CGM_ALIGN_BASE, CGM_ALIGN_BOTTOM, CGM_ALIGN_CAP }; /* corresponding strings, as used in the text encoding */ static const char * const cgm_vertical_alignment_style_string[PL_NUM_VERT_JUST_TYPES] = { "top", "half", "base", "bottom", "cap" }; /* This prints a single-font, single-font-size label. */ double _pl_c_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { int master_font_index, desired_cgm_font_id; double theta, costheta, sintheta; double user_text_transformation_matrix[6]; double text_transformation_matrix[6]; int desired_char_base_vector_x, desired_char_base_vector_y; int desired_char_up_vector_x, desired_char_up_vector_y; double relative_cap_height, user_cap_height; double up_vector_x, up_vector_y, cap_height; double base_vector_x, base_vector_y, base_width; int desired_char_height, desired_base_width; bool font_is_symbol, need_lower_half, need_upper_half; bool set_lower_half_charset = false, set_upper_half_charset = false; int lower_half_charset = 0, upper_half_charset = 0; /* dummy values */ const unsigned char *t; double width; int desired_cgm_h_alignment, desired_cgm_v_alignment; int byte_count, data_byte_count, data_len; /* sanity check */ if (_plotter->drawstate->font_type != PL_F_POSTSCRIPT) return 0.0; /* if empty string, nothing to do */ if (*s == (unsigned char)'\0') return 0.0; /* Many CGM interpreters can't handle zero font size (i.e., zero `character height'). [The RALCGM viewer actually crashes!] So bail if the font size is zero. */ if (_plotter->drawstate->true_font_size == 0.0) return 0.0; /* set CGM text color */ _pl_c_set_pen_color (R___(_plotter) CGM_OBJECT_TEXT); /* compute index of font in master table of PS fonts, in g_fontdb.c */ master_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* flag current PS font as used on this page */ _plotter->data->page->ps_font_used[master_font_index] = true; /* synchronize CGM's font with our notion of current font, by setting the CGM font index (in range 1..35; as explained in g_fontdb.c, the traditional `Adobe 13' will be placed in slots 1..13) */ desired_cgm_font_id = _pl_g_ps_font_to_cgm_font_id[master_font_index]; if (_plotter->cgm_font_id != desired_cgm_font_id) /* emit "TEXT FONT INDEX" command */ { data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 10, data_len, &byte_count, "TEXTFONTINDEX"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, /* index value in range 1..35, not 0..34 */ desired_cgm_font_id + 1, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update CGM font id */ _plotter->cgm_font_id = desired_cgm_font_id; } /* label rotation angle in radians, in user frame */ theta = M_PI * _plotter->drawstate->text_rotation / 180.0; sintheta = sin (theta); costheta = cos (theta); /* this transformation matrix rotates, and translates: it maps (0,0) to the origin of the string, in user coordinates */ user_text_transformation_matrix[0] = costheta; user_text_transformation_matrix[1] = sintheta; user_text_transformation_matrix[2] = - sintheta; user_text_transformation_matrix[3] = costheta; user_text_transformation_matrix[4] = _plotter->drawstate->pos.x; user_text_transformation_matrix[5] = _plotter->drawstate->pos.y; /* Construct a temporary matrix that rotates, translates, and then maps to device coordinates. This matrix transforms from a frame in which nominal character sizes are roughly 1 unit in the horizontal and vertical directions, to device coordinates. */ _matrix_product (user_text_transformation_matrix, _plotter->drawstate->transform.m, text_transformation_matrix); /* Character base and up vectors, in the device frame, are what vectors (1,0) and (0,1) in the user frame are mapped to. According to CGM documentation, their overall normalization isn't important, but the ratio between their lengths affects the aspect ratio of the font. The `4000' factor is arbitrary; but it gives good quantization to integers. */ { double base_x = text_transformation_matrix[0]; double base_y = text_transformation_matrix[1]; double up_x = text_transformation_matrix[2]; double up_y = text_transformation_matrix[3]; double base_len = sqrt (base_x * base_x + base_y * base_y); double up_len = sqrt (up_x * up_x + up_y * up_y); double max_len = DMAX(base_len, up_len); if (max_len != 0.0) { base_x /= max_len; base_y /= max_len; up_x /= max_len; up_y /= max_len; } #define QUANTIZATION_FACTOR 4000 desired_char_base_vector_x = IROUND(QUANTIZATION_FACTOR * base_x); desired_char_base_vector_y = IROUND(QUANTIZATION_FACTOR * base_y); desired_char_up_vector_x = IROUND(QUANTIZATION_FACTOR * up_x); desired_char_up_vector_y = IROUND(QUANTIZATION_FACTOR * up_y); } if (_plotter->cgm_char_base_vector_x != desired_char_base_vector_x || _plotter->cgm_char_base_vector_y != desired_char_base_vector_y || _plotter->cgm_char_up_vector_x != desired_char_up_vector_x || _plotter->cgm_char_up_vector_y != desired_char_up_vector_y) /* emit CHARACTER ORIENTATION command */ { data_len = 4 * CGM_BINARY_BYTES_PER_INTEGER; /* args: 4 integers */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 16, data_len, &byte_count, "CHARORI"); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_char_up_vector_x, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_char_up_vector_y, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_char_base_vector_x, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_char_base_vector_y, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update char and base vectors */ _plotter->cgm_char_base_vector_x = desired_char_base_vector_x; _plotter->cgm_char_base_vector_y = desired_char_base_vector_y; _plotter->cgm_char_up_vector_x = desired_char_up_vector_x; _plotter->cgm_char_up_vector_y = desired_char_up_vector_y; } /* cap height as fraction of font height */ relative_cap_height = _pl_g_ps_font_info[master_font_index].font_cap_height / 1000.0; /* cap height in user frame */ user_cap_height = relative_cap_height * _plotter->drawstate->true_font_size; /* true up vector (pointing up to cap height level) in device frame */ up_vector_x = user_cap_height * text_transformation_matrix[2]; up_vector_y = user_cap_height * text_transformation_matrix[3]; /* length of up vector in device frame, i.e. desired cap height */ cap_height = sqrt (up_vector_x * up_vector_x + up_vector_y * up_vector_y); /* in CGM, `character height' means cap height, measured along up vector */ desired_char_height = IROUND(cap_height); if (_plotter->cgm_char_height != desired_char_height) /* emit CHARACTER HEIGHT command */ { data_len = CGM_BINARY_BYTES_PER_INTEGER; /* args: 1 integer */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 15, data_len, &byte_count, "CHARHEIGHT"); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_char_height, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update character height */ _plotter->cgm_char_height = desired_char_height; } /* is label to be rendered in Symbol font (which has its own charsets)? */ if (strcmp (_pl_g_ps_font_info[master_font_index].ps_name, "Symbol") == 0) font_is_symbol = true; else font_is_symbol = false; /* will we be using lower, upper halves of font? */ need_lower_half = need_upper_half = false; for (t = s; *t != (unsigned char)'\0'; t++) { if ((*t) <= 127) need_lower_half = true; else need_upper_half = true; } /* Do we need to switch lower/upper CGM charsets? Our indexing of charsets (see c_defplot.c) is: 1=lower half ISO-Latin-1, 2=upper half ISO-Latin-1, 3=lower half Symbol, 4=upper half Symbol. */ if (font_is_symbol) /* may need to switch to CGM's Symbol charset(s) */ { if (need_lower_half && _plotter->cgm_charset_lower != 3) { set_lower_half_charset = true; lower_half_charset = 3; } if (need_upper_half && _plotter->cgm_charset_upper != 4) { set_upper_half_charset = true; upper_half_charset = 4; } } else /* font is ISO-Latin-1, for CGM purposes; may need to switch charset(s) */ { if (need_lower_half && _plotter->cgm_charset_lower != 1) { set_lower_half_charset = true; lower_half_charset = 1; } if (need_upper_half && _plotter->cgm_charset_upper != 2) { set_upper_half_charset = true; upper_half_charset = 2; } } if (set_lower_half_charset) /* emit SET CHARACTER SET INDEX command */ { data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 19, data_len, &byte_count, "CHARSETINDEX"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, lower_half_charset, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of CGM's lower-half charset */ _plotter->cgm_charset_lower = lower_half_charset; } if (set_upper_half_charset) /* emit SET ALTERNATE CHARACTER SET INDEX command */ { data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 20, data_len, &byte_count, "ALTCHARSETINDEX"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, upper_half_charset, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of CGM's upper-half charset */ _plotter->cgm_charset_upper = upper_half_charset; } /* update CGM text alignment if necessary */ desired_cgm_h_alignment = cgm_horizontal_alignment_style[h_just]; desired_cgm_v_alignment = cgm_vertical_alignment_style[v_just]; if (_plotter->cgm_horizontal_text_alignment != desired_cgm_h_alignment || _plotter->cgm_vertical_text_alignment != desired_cgm_v_alignment) /* emit "TEXT ALIGNMENT" command (args = 2 enums, 2 reals) */ { const char *desired_cgm_h_alignment_string, *desired_cgm_v_alignment_string; desired_cgm_h_alignment_string = cgm_horizontal_alignment_style_string[h_just]; desired_cgm_v_alignment_string = cgm_vertical_alignment_style_string[v_just]; data_len = 2 * 2 + 2 * 4; /* 2 bytes per enum, 4 bytes per real */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 18, data_len, &byte_count, "TEXTALIGN"); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, desired_cgm_h_alignment, data_len, &data_byte_count, &byte_count, desired_cgm_h_alignment_string); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, desired_cgm_v_alignment, data_len, &data_byte_count, &byte_count, desired_cgm_v_alignment_string); _cgm_emit_real_fixed_point (_plotter->data->page, false, _plotter->cgm_encoding, 0.0, data_len, &data_byte_count, &byte_count); _cgm_emit_real_fixed_point (_plotter->data->page, false, _plotter->cgm_encoding, 0.0, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update our knowledge of text alignment */ _plotter->cgm_horizontal_text_alignment = desired_cgm_h_alignment; _plotter->cgm_vertical_text_alignment = desired_cgm_v_alignment; } if (_plotter->cgm_max_version >= 3) /* can specify type of restricted text */ { if (_plotter->cgm_restricted_text_type != CGM_RESTRICTED_TEXT_TYPE_BOXED_CAP) /* emit "RESTRICTED TEXT TYPE" command */ { data_len = 2; /* 2 bytes per index */ byte_count = data_byte_count = 0; _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_ATTRIBUTE_ELEMENT, 42, data_len, &byte_count, "RESTRTEXTTYPE"); _cgm_emit_index (_plotter->data->page, false, _plotter->cgm_encoding, CGM_RESTRICTED_TEXT_TYPE_BOXED_CAP, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update restricted text type, and CGM version for this page */ _plotter->cgm_restricted_text_type = CGM_RESTRICTED_TEXT_TYPE_BOXED_CAP; _plotter->cgm_page_version = IMAX(3, _plotter->cgm_page_version); } } /* compute string width in user coordinates */ width = _plotter->get_text_width (R___(_plotter) s); /* true base vector (pointing across to end of string) in device frame */ base_vector_x = width * text_transformation_matrix[0]; base_vector_y = width * text_transformation_matrix[1]; /* length of base vector in device frame, i.e. width of string */ base_width = sqrt (base_vector_x * base_vector_x + base_vector_y * base_vector_y); /* same (integer device coordinates) */ desired_base_width = IROUND(base_width); /* emit "RESTRICTED TEXT" command (args= 2 ints, 1 point, 1 enum, 1 string)*/ { int string_length, encoded_string_length; double xdev, ydev; int xdev_int, ydev_int; string_length = strlen ((const char *)s); encoded_string_length = CGM_BINARY_BYTES_PER_STRING(string_length); /* bytes per integer coordinate may vary; 2 bytes per enum */ data_len = (4 * CGM_BINARY_BYTES_PER_INTEGER) + 2 + encoded_string_length; byte_count = data_byte_count = 0; xdev = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); ydev = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); xdev_int = IROUND(xdev); ydev_int = IROUND(ydev); _cgm_emit_command_header (_plotter->data->page, _plotter->cgm_encoding, CGM_GRAPHICAL_PRIMITIVE_ELEMENT, 5, data_len, &byte_count, "RESTRTEXT"); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_base_width, data_len, &data_byte_count, &byte_count); _cgm_emit_integer (_plotter->data->page, false, _plotter->cgm_encoding, desired_char_height, data_len, &data_byte_count, &byte_count); _cgm_emit_point (_plotter->data->page, false, _plotter->cgm_encoding, xdev_int, ydev_int, data_len, &data_byte_count, &byte_count); _cgm_emit_enum (_plotter->data->page, false, _plotter->cgm_encoding, 1, data_len, &data_byte_count, &byte_count, "final"); _cgm_emit_string (_plotter->data->page, false, _plotter->cgm_encoding, (const char *)s, string_length, true, data_len, &data_byte_count, &byte_count); _cgm_emit_command_terminator (_plotter->data->page, _plotter->cgm_encoding, &byte_count); /* update CGM profile for this page */ if (string_length > 254) _plotter->cgm_page_profile = IMAX(_plotter->cgm_page_profile, CGM_PROFILE_NONE); } /* return string width in user coordinates */ return width; } plotutils-2.6/libplot/p_closepl.c0000644000175000017500000000200211037243261014123 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_p_end_page (S___(Plotter *_plotter)) { return true; } plotutils-2.6/libplot/p_color.c0000644000175000017500000002110011037243261013600 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains device-specific color computation routines. They are called by various PSPlotter methods, before drawing objects. They set the appropriate PSPlotter-specific fields in the drawing state. */ #include "sys-defines.h" #include "extern.h" /* forward references */ static int _idraw_pseudocolor (int red, int green, int blue); /* We call this routine to evaluate _plotter->drawstate->ps_fgcolor lazily, i.e. only when needed (just before an object is written to the output buffer). It finds the best match from among idraw's "foreground colors", i.e., pen colors. See p_color2.c for the list of colors. */ void _pl_p_set_pen_color(S___(Plotter *_plotter)) { _plotter->drawstate->ps_fgcolor_red = ((double)((_plotter->drawstate->fgcolor).red))/0xFFFF; _plotter->drawstate->ps_fgcolor_green = ((double)((_plotter->drawstate->fgcolor).green))/0xFFFF; _plotter->drawstate->ps_fgcolor_blue = ((double)((_plotter->drawstate->fgcolor).blue))/0xFFFF; /* quantize for idraw */ _plotter->drawstate->ps_idraw_fgcolor = _idraw_pseudocolor ((_plotter->drawstate->fgcolor).red, (_plotter->drawstate->fgcolor).green, (_plotter->drawstate->fgcolor).blue); return; } /* We call this routine to evaluate _plotter->drawstate->ps_fillcolor lazily, i.e. only when needed (just before an object is written to the output buffer). It finds the best match from among the possible idraw colors. In idraw, the fill color is always an interpolation between a "foreground color" and a "background color", both of which are selected from a fixed set. See p_color2.c. */ void _pl_p_set_fill_color(S___(Plotter *_plotter)) { double red, green, blue; if (_plotter->drawstate->fill_type == 0) /* don't do anything, fill color will be ignored when writing objects*/ return; red = ((double)((_plotter->drawstate->fillcolor).red))/0xFFFF; green = ((double)((_plotter->drawstate->fillcolor).green))/0xFFFF; blue = ((double)((_plotter->drawstate->fillcolor).blue))/0xFFFF; _plotter->drawstate->ps_fillcolor_red = red; _plotter->drawstate->ps_fillcolor_green = green; _plotter->drawstate->ps_fillcolor_blue = blue; /* next subroutine needs fields that this will fill in... */ _pl_p_set_pen_color (S___(_plotter)); /* Quantize for idraw, in a complicated way; we can choose from among a finite discrete set of values for ps_idraw_bgcolor and ps_idraw_shading, to approximate the fill color. We also adjust ps_fillcolor_* because the PS interpreter will use the ps_idraw_shading variable to interpolate between fgcolor and bgcolor, i.e. fgcolor and fillcolor. */ _pl_p_compute_idraw_bgcolor (S___(_plotter)); return; } /* Find, within the RGB color cube, the idraw pen color ("foreground color") that is closest to a specified color (our pen color). Euclidean distance is our metric. Our convention: no non-white color should be mapped to white. */ static int _idraw_pseudocolor (int red, int green, int blue) { double difference; int i; int best = 0; difference = DBL_MAX; for (i = 0; i < PS_NUM_IDRAW_STD_COLORS; i++) { double newdifference; if (_pl_p_idraw_stdcolors[i].red == 0xffff && _pl_p_idraw_stdcolors[i].green == 0xffff && _pl_p_idraw_stdcolors[i].blue == 0xffff) /* white is a possible quantization only for white itself (our convention) */ { if (red == 0xffff && green == 0xffff && blue == 0xffff) { difference = 0.0; best = i; } continue; } newdifference = ((double)(_pl_p_idraw_stdcolors[i].red - red) * (double)(_pl_p_idraw_stdcolors[i].red - red)) + ((double)(_pl_p_idraw_stdcolors[i].green - green) * (double)(_pl_p_idraw_stdcolors[i].green - green)) + ((double)(_pl_p_idraw_stdcolors[i].blue - blue) * (double)(_pl_p_idraw_stdcolors[i].blue - blue)); if (newdifference < difference) { difference = newdifference; best = i; } } return best; } /* Once the idraw foreground color (i.e. quantized pen color) has been determined, this routine computes the idraw background color and idraw shading (0.0, 0.25, 0.5, 0.75, or 1.0) that will most closely match the user-specified fill color. It is called only when the elements ps_fillcolor_*, ps_idraw_fgcolor_* of the drawing state have been filled in. At the end of this function we adjust ps_fillcolor_* so that the output file will produce similar colors when parsed both by idraw and the PS interpreter. In fact we can persuade the PS interpreter to produce exactly the fill color specified by the user, except when the idraw shading is 0.0. In that case the fill color must be the same as the pen color. That situation will occur only if the user-specified fill color is very close to the user-specified pen color. */ void _pl_p_compute_idraw_bgcolor(S___(Plotter *_plotter)) { double truered, truegreen, trueblue; double fgred, fggreen, fgblue; double difference = DBL_MAX; int i, j; int best_bgcolor = 0, best_shading = 0; double best_shade = 0.0; truered = 0xFFFF * _plotter->drawstate->ps_fillcolor_red; truegreen = 0xFFFF * _plotter->drawstate->ps_fillcolor_green; trueblue = 0xFFFF * _plotter->drawstate->ps_fillcolor_blue; fgred = (double)(_pl_p_idraw_stdcolors[_plotter->drawstate->ps_idraw_fgcolor].red); fggreen = (double)(_pl_p_idraw_stdcolors[_plotter->drawstate->ps_idraw_fgcolor].green); fgblue = (double)(_pl_p_idraw_stdcolors[_plotter->drawstate->ps_idraw_fgcolor].blue); for (i = 0; i < PS_NUM_IDRAW_STD_COLORS; i++) { double bgred, bggreen, bgblue; bgred = (double)(_pl_p_idraw_stdcolors[i].red); bggreen = (double)(_pl_p_idraw_stdcolors[i].green); bgblue = (double)(_pl_p_idraw_stdcolors[i].blue); for (j = 0; j < PS_NUM_IDRAW_STD_SHADINGS; j++) { double approxred, approxgreen, approxblue; double shade, newdifference; shade = _pl_p_idraw_stdshadings[j]; approxred = shade * bgred + (1.0 - shade) * fgred; approxgreen = shade * bggreen + (1.0 - shade) * fggreen; approxblue = shade * bgblue + (1.0 - shade) * fgblue; newdifference = (truered - approxred) * (truered - approxred) + (truegreen - approxgreen) * (truegreen - approxgreen) + (trueblue - approxblue) * (trueblue - approxblue); if (newdifference < difference) { difference = newdifference; best_bgcolor = i; best_shading = j; best_shade = shade; } } } _plotter->drawstate->ps_idraw_bgcolor = best_bgcolor; _plotter->drawstate->ps_idraw_shading = best_shading; /* now adjust ps_fillcolor_* fields so that interpolation between ps_fgcolor_* and ps_fillcolor_*, as specified by the shade, will yield the user-specified fill color. According to the PS prologue, the PS interpreter will compute a fill color thus: true_FILLCOLOR = shade * PS_FILLCOLOR + (1-shade) * PS_FGCOLOR we can compute an adjusted fillcolor thus: PS_FILLCOLOR = (true_FILLCOLOR - (1-shade) * PS_FGCOLOR) / shade. This is possible unless shade=0.0, in which case both idraw and the PS interpreter will use the pen color as the fill color. */ if (best_shade != 0.0) { _plotter->drawstate->ps_fillcolor_red = (_plotter->drawstate->ps_fillcolor_red - (1.0 - best_shade) * _plotter->drawstate->ps_fgcolor_red) / best_shade; _plotter->drawstate->ps_fillcolor_green = (_plotter->drawstate->ps_fillcolor_green - (1.0 - best_shade) * _plotter->drawstate->ps_fgcolor_green) / best_shade; _plotter->drawstate->ps_fillcolor_blue = (_plotter->drawstate->ps_fillcolor_blue - (1.0 - best_shade) * _plotter->drawstate->ps_fgcolor_blue) / best_shade; } } plotutils-2.6/libplot/p_color2.c0000644000175000017500000000533011037243261013671 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* idraw's 12 standard colors, taken from idraw source. These are the only pen colors that idraw understands, so we must quantize. Quantization of fill colors is more complicated; see below. The list of 12 standard colors include 6 of the 8 vertices of the RGB cube; Magenta and Cyan are missing. It also includes Orange and Indigo (on the boundary of the cube; they more or less substitute for Magenta and Cyan). Also included are four points in the interior of the cube: Light Gray, Dark Gray, Violet, and Brown. */ const plColor _pl_p_idraw_stdcolors[PS_NUM_IDRAW_STD_COLORS] = { {0x0000, 0x0000, 0x0000}, /* Black */ {0xa500, 0x2a00, 0x2a00}, /* Brown */ {0xffff, 0x0000, 0x0000}, /* Red */ {0xffff, 0xa5a5, 0x0000}, /* Orange */ {0xffff, 0xffff, 0x0000}, /* Yellow */ {0x0000, 0xffff, 0x0000}, /* Green */ {0x0000, 0x0000, 0xffff}, /* Blue */ {0xbf00, 0x0000, 0xff00}, /* Indigo */ {0x4f00, 0x2f00, 0x4f00}, /* Violet */ {0xffff, 0xffff, 0xffff}, /* White */ {0xc350, 0xc350, 0xc350}, /* LtGray */ {0x80e8, 0x80e8, 0x80e8} /* DkGray */ }; const char * const _pl_p_idraw_stdcolornames[PS_NUM_IDRAW_STD_COLORS] = { "Black", "Brown", "Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet", "White", "LtGray", "DkGray" }; /* Idraw allows a fill color to be an interpolation of a pen color (``foreground color'') and a background color; both must be in the above list. The following is a list of the interpolations (``shadings'') that idraw recognizes. 0.0 means use foreground color, 1.0 means use background color. (Idraw shadings are actually a special case of idraw patterns, which include bitmap fillings as well.) */ const double _pl_p_idraw_stdshadings[PS_NUM_IDRAW_STD_SHADINGS] = { 0.0, 0.25, 0.5, 0.75, 1.0 }; plotutils-2.6/libplot/p_defplot.c0000644000175000017500000006311411257252772014145 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any PSPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" /* ctime_r() is currently not used, because there is apparently _no_ universal way of ensuring that it is declared. On some systems (e.g. Red Hat Linux), `#define _POSIX_SOURCE' will do it. But on other systems, doing `#define _POSIX_SOURCE' **removes** the declaration! */ #ifdef HAVE_CTIME_R #undef HAVE_CTIME_R #endif #ifdef MSDOS #include /* for fsync() */ #endif /* song and dance to define time_t, and declare both time() and ctime() */ #ifdef HAVE_SYS_TYPES_H #include /* for time_t on some pre-ANSI Unix systems */ #endif #ifdef TIME_WITH_SYS_TIME #include /* for time() on some pre-ANSI Unix systems */ #include /* for ctime() */ #else /* not TIME_WITH_SYS_TIME, include only one (prefer ) */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ #include "p_header.h" /* idraw Postscript header (from InterViews) */ #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a PSPlotter struct. */ const Plotter _pl_p_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_p_initialize, _pl_p_terminate, /* page manipulation */ _pl_p_begin_page, _pl_p_erase_page, _pl_p_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_p_paint_path, _pl_p_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_p_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_p_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ /* For PS Plotter objects, we initialize the used-font array(s). We also determine the page size and the location on the page of the graphics display, so that we'll be able to work out the map from user coordinates to device coordinates in space.c. */ void _pl_p_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override generic initializations (which are appropriate to the base Plotter class), as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_PS; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_PAGES_ALL_AT_ONCE; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 0; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 1; #ifdef USE_LJ_FONTS_IN_PS _plotter->data->have_pcl_fonts = 1; #else _plotter->data->have_pcl_fonts = 0; #endif _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_POSTSCRIPT; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_NONE; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_ANY; _plotter->data->allowed_circle_scaling = AS_ANY; _plotter->data->allowed_ellipse_scaling = AS_ANY; /* color-related parameters (also internal) */ _plotter->data->emulate_color = false; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_REAL; _plotter->data->flipped_y = false; _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize certain data members from device driver parameters */ /* Determine range of device coordinates over which the viewport will extend (and hence the transformation from user to device coordinates; see g_space.c). */ { /* determine page type, viewport size and location */ _set_page_type (_plotter->data); /* convert viewport size-and-location data (in terms of inches) to device coordinates (i.e. points) */ _plotter->data->xmin = 72 * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset); _plotter->data->xmax = 72 * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset + _plotter->data->viewport_xsize); _plotter->data->ymin = 72 * (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset); _plotter->data->ymax = 72 * (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset + _plotter->data->viewport_ysize); } /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ /* This version is for Postscript Plotters. It writes out the idraw-derived PS prologue to the output stream, and copies each stored page of graphics to it too, making sure to include the proper DSC [Document Structuring Convention] comment lines at the beginning and the end of the document, and at the beginning and end of each page. (PS Plotters differ from most other plotters that do not plot in real time in that they emit output only after all pages have pages have been drawn, rather than at the end of each page. This is necessary for DSC compliance.) When this is called, the PS code for the body of each page is stored in a plOutbuf, and the page plOutbufs form a linked list. In this function we write the document header, the document trailer, and the header/trailer for each page, all to separate plOutbufs. We then copy the plOutbufs, one after another, to the output stream. */ void _pl_p_terminate (S___(Plotter *_plotter)) { double x_min, x_max, y_min, y_max; int i, n; time_t clock; plOutbuf *doc_header, *doc_trailer, *current_page; bool ps_font_used_in_doc[PL_NUM_PS_FONTS]; #ifdef USE_LJ_FONTS_IN_PS bool pcl_font_used_in_doc[PL_NUM_PCL_FONTS]; #endif char *time_string, time_string_buffer[32]; #ifdef LIBPLOTTER if (_plotter->data->outfp || _plotter->data->outstream) #else if (_plotter->data->outfp) #endif /* have an output stream */ { int num_pages = _plotter->data->page_number; /* First, prepare the document header (DSC lines, etc.), and write it to a plOutbuf. The header is very long: most of it is simply the idraw header (see p_header.h). */ doc_header = _new_outbuf (); if (num_pages == 1) /* will plot an EPS file, not just a PS file */ sprintf (doc_header->point, "\ %%!PS-Adobe-3.0 EPSF-3.0\n"); else sprintf (doc_header->point, "\ %%!PS-Adobe-3.0\n"); _update_buffer (doc_header); /* Compute an ASCII representation of the current time, in a reentrant way if we're supporting pthreads (i.e. by using ctime_r if it's available). */ time (&clock); #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H #ifdef HAVE_CTIME_R ctime_r (&clock, time_string_buffer); time_string = time_string_buffer; #else time_string = ctime (&clock); #endif #else time_string = ctime (&clock); #endif #else time_string = ctime (&clock); #endif sprintf (doc_header->point, "\ %%%%Creator: GNU libplot drawing library %s\n\ %%%%Title: PostScript plot\n\ %%%%CreationDate: %s\ %%%%DocumentData: Clean7Bit\n\ %%%%LanguageLevel: 1\n\ %%%%Pages: %d\n\ %%%%PageOrder: Ascend\n\ %%%%Orientation: Portrait\n", PL_LIBPLOT_VER_STRING, time_string, num_pages); _update_buffer (doc_header); /* emit the bounding box for the document */ _bbox_of_outbufs (_plotter->data->first_page, &x_min, &x_max, &y_min, &y_max); if (x_min > x_max || y_min > y_max) /* all pages empty */ sprintf (doc_header->point, "\ %%%%BoundingBox: 0 0 0 0\n"); else sprintf (doc_header->point, "\ %%%%BoundingBox: %d %d %d %d\n", IROUND(x_min - 0.5), IROUND(y_min - 0.5), IROUND(x_max + 0.5), IROUND(y_max + 0.5)); _update_buffer (doc_header); /* determine fonts needed by document, by examining all pages */ { current_page = _plotter->data->first_page; for (i = 0; i < PL_NUM_PS_FONTS; i++) ps_font_used_in_doc[i] = false; #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) pcl_font_used_in_doc[i] = false; #endif while (current_page) { for (i = 0; i < PL_NUM_PS_FONTS; i++) if (current_page->ps_font_used[i]) ps_font_used_in_doc[i] = true; #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) if (current_page->pcl_font_used[i]) pcl_font_used_in_doc[i] = true; #endif current_page = current_page->next; } } /* write out list of fonts needed by the document */ { bool first_font = true; strcpy (doc_header->point, "\ %%DocumentNeededResources: "); _update_buffer (doc_header); for (i = 0; i < PL_NUM_PS_FONTS; i++) { if (ps_font_used_in_doc[i]) { if (first_font == false) { strcpy (doc_header->point, "%%+ "); _update_buffer (doc_header); } strcpy (doc_header->point, "font "); _update_buffer (doc_header); strcpy (doc_header->point, _pl_g_ps_font_info[i].ps_name); _update_buffer (doc_header); strcpy (doc_header->point, "\n"); _update_buffer (doc_header); first_font = false; } } #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) { if (pcl_font_used_in_doc[i]) { if (first_font == false) { strcpy (doc_header->point, "%%+ "); _update_buffer (doc_header); } strcpy (doc_header->point, "font "); _update_buffer (doc_header); /* use replacement font name if any (this is only to support the Tidbits-is-Wingdings botch) */ if (_pl_g_pcl_font_info[i].substitute_ps_name) strcpy (doc_header->point, _pl_g_pcl_font_info[i].substitute_ps_name); else strcpy (doc_header->point, _pl_g_pcl_font_info[i].ps_name); _update_buffer (doc_header); strcpy (doc_header->point, "\n"); _update_buffer (doc_header); first_font = false; } } #endif if (first_font) /* no fonts needed in document */ { strcpy (doc_header->point, "\n"); _update_buffer (doc_header); } } /* emit final DSC lines in header */ if (num_pages > 0) { sprintf (doc_header->point, "\ %%%%DocumentSuppliedResources: procset %s %s 0\n", PS_PROCSET_NAME, PS_PROCSET_VERSION); _update_buffer (doc_header); } strcpy (doc_header->point, "\ %%EndComments\n\n"); _update_buffer (doc_header); /* write out list of fonts needed by the document, all over again; this time it's interpreted as the default font list for each page */ { bool first_font = true; strcpy (doc_header->point, "\ %%BeginDefaults\n"); _update_buffer (doc_header); strcpy (doc_header->point, "\ %%PageResources: "); _update_buffer (doc_header); for (i = 0; i < PL_NUM_PS_FONTS; i++) { if (ps_font_used_in_doc[i]) { if (first_font == false) { strcpy (doc_header->point, "%%+ "); _update_buffer (doc_header); } strcpy (doc_header->point, "font "); _update_buffer (doc_header); strcpy (doc_header->point, _pl_g_ps_font_info[i].ps_name); _update_buffer (doc_header); strcpy (doc_header->point, "\n"); _update_buffer (doc_header); first_font = false; } } #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) { if (pcl_font_used_in_doc[i]) { if (first_font == false) { strcpy (doc_header->point, "%%+ "); _update_buffer (doc_header); } strcpy (doc_header->point, "font "); _update_buffer (doc_header); if (_pl_g_pcl_font_info[i].substitute_ps_name) /* this is to support the Tidbits-is-Wingdings botch */ strcpy (doc_header->point, _pl_g_pcl_font_info[i].substitute_ps_name); else strcpy (doc_header->point, _pl_g_pcl_font_info[i].ps_name); _update_buffer (doc_header); strcpy (doc_header->point, "\n"); _update_buffer (doc_header); first_font = false; } } #endif if (first_font) /* no fonts needed in document */ { strcpy (doc_header->point, "\n"); _update_buffer (doc_header); } strcpy (doc_header->point, "\ %%EndDefaults\n\n"); _update_buffer (doc_header); } /* Document Prolog */ strcpy (doc_header->point, "\ %%BeginProlog\n"); _update_buffer (doc_header); if (num_pages > 1) /* PS [not EPS] file, include procset in document prolog */ { sprintf (doc_header->point, "\ %%%%BeginResource: procset %s %s 0\n", PS_PROCSET_NAME, PS_PROCSET_VERSION); _update_buffer (doc_header); /* write out idraw-derived PS prologue (makes many definitions) */ for (i=0; *_ps_procset[i]; i++) { strcpy (doc_header->point, _ps_procset[i]); _update_buffer (doc_header); } strcpy (doc_header->point, "\ %%EndResource\n"); _update_buffer (doc_header); } strcpy (doc_header->point, "\ %%EndProlog\n\n"); _update_buffer (doc_header); /* Document Setup */ strcpy (doc_header->point, "\ %%BeginSetup\n"); _update_buffer (doc_header); /* tell driver to include any PS [or PCL] fonts that are needed */ for (i = 0; i < PL_NUM_PS_FONTS; i++) if (ps_font_used_in_doc[i]) { sprintf (doc_header->point, "\ %%%%IncludeResource: font %s\n", _pl_g_ps_font_info[i].ps_name); _update_buffer (doc_header); } #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) if (pcl_font_used_in_doc[i]) { /* this is to support the Tidbits-is-Wingdings botch */ if (_pl_g_pcl_font_info[i].substitute_ps_name) sprintf (doc_header->point, "\ %%%%IncludeResource: font %s\n", _pl_g_pcl_font_info[i].substitute_ps_name); else sprintf (doc_header->point, "\ %%%%IncludeResource: font %s\n", _pl_g_pcl_font_info[i].ps_name); _update_buffer (doc_header); } #endif /* push private dictionary on stack */ strcpy (doc_header->point, "\ /DrawDict 50 dict def\n\ DrawDict begin\n"); _update_buffer (doc_header); /* do ISO-Latin-1 reencoding for any fonts that need it */ { bool need_to_reencode = false; for (i = 0; i < PL_NUM_PS_FONTS; i++) if (ps_font_used_in_doc[i] && _pl_g_ps_font_info[i].iso8859_1) { need_to_reencode = true; break; } #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) if (pcl_font_used_in_doc[i] && _pl_g_pcl_font_info[i].iso8859_1) { need_to_reencode = true; break; } #endif if (need_to_reencode) { strcpy (doc_header->point, _ps_fontproc); _update_buffer (doc_header); for (i = 0; i < PL_NUM_PS_FONTS; i++) { if (ps_font_used_in_doc[i] && _pl_g_ps_font_info[i].iso8859_1) { sprintf (doc_header->point, "\ /%s reencodeISO def\n", _pl_g_ps_font_info[i].ps_name); _update_buffer (doc_header); } } #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) { if (pcl_font_used_in_doc[i] && _pl_g_pcl_font_info[i].iso8859_1) { sprintf (doc_header->point, "\ /%s reencodeISO def\n", _pl_g_pcl_font_info[i].ps_name); _update_buffer (doc_header); } } #endif } } if (num_pages == 1) /* EPS [not just PS] file, include procset in setup section, so that it will modify only the private dictionary */ { sprintf (doc_header->point, "\ %%%%BeginResource: procset %s %s 0\n", PS_PROCSET_NAME, PS_PROCSET_VERSION); _update_buffer (doc_header); /* write out idraw-derived PS prologue in p_header.h (makes many definitions) */ for (i=0; *_ps_procset[i]; i++) { strcpy (doc_header->point, _ps_procset[i]); _update_buffer (doc_header); } strcpy (doc_header->point, "\ %%EndResource\n"); _update_buffer (doc_header); } strcpy (doc_header->point, "\ %%EndSetup\n\n"); _update_buffer (doc_header); /* Document header is now prepared, and stored in a plOutbuf. Now do the same for the doc trailer (much shorter). */ /* Document Trailer: just pop private dictionary off stack */ doc_trailer = _new_outbuf (); strcpy (doc_trailer->point, "\ %%Trailer\n\ end\n\ %%EOF\n"); _update_buffer (doc_trailer); /* WRITE DOCUMENT HEADER (and free its plOutbuf) */ _write_string (_plotter->data, doc_header->base); _delete_outbuf (doc_header); /* now loop through pages, emitting each in turn */ if (num_pages > 0) { for (current_page = _plotter->data->first_page, n=1; current_page; current_page = current_page->next, n++) { plOutbuf *page_header, *page_trailer; /* prepare page header, and store it in a plOutbuf */ page_header = _new_outbuf (); sprintf (page_header->point, "\ %%%%Page: %d %d\n", n, n); _update_buffer (page_header); /* write out list of fonts needed by the page */ { bool first_font = true; strcpy (page_header->point, "\ %%PageResources: "); _update_buffer (page_header); for (i = 0; i < PL_NUM_PS_FONTS; i++) { if (current_page->ps_font_used[i]) { if (first_font == false) { strcpy (page_header->point, "%%+ "); _update_buffer (page_header); } strcpy (page_header->point, "font "); _update_buffer (page_header); strcpy (page_header->point, _pl_g_ps_font_info[i].ps_name); _update_buffer (page_header); strcpy (page_header->point, "\n"); _update_buffer (page_header); first_font = false; } } #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) { if (current_page->pcl_font_used[i]) { if (first_font == false) { strcpy (page_header->point, "%%+ "); _update_buffer (page_header); } strcpy (page_header->point, "font "); _update_buffer (page_header); if (_pl_g_pcl_font_info[i].substitute_ps_name) /* this is to support the Tidbits-is-Wingdings botch */ strcpy (page_header->point, _pl_g_pcl_font_info[i].substitute_ps_name); else strcpy (page_header->point, _pl_g_pcl_font_info[i].ps_name); _update_buffer (page_header); strcpy (page_header->point, "\n"); _update_buffer (page_header); first_font = false; } } #endif if (first_font) /* no fonts needed on page */ { strcpy (page_header->point, "\n"); _update_buffer (page_header); } } /* emit the bounding box for the page */ _bbox_of_outbuf (current_page, &x_min, &x_max, &y_min, &y_max); if (x_min > x_max || y_min > y_max) /* empty page */ sprintf (page_header->point, "\ %%%%PageBoundingBox: 0 0 0 0\n"); else sprintf (page_header->point, "\ %%%%PageBoundingBox: %d %d %d %d\n", IROUND(x_min - 0.5), IROUND(y_min - 0.5), IROUND(x_max + 0.5), IROUND(y_max + 0.5)); _update_buffer (page_header); /* Page Setup */ strcpy (page_header->point, "\ %%BeginPageSetup\n"); _update_buffer (page_header); /* emit initialization code (including idraw, PS directives) */ /* N.B. `8' below is the version number of the idraw PS format we're producing; see */ strcpy (page_header->point, "\ %I Idraw 8\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\ [ 1 0 0 1 0 0 ] concat\n\ /originalCTM matrix currentmatrix def\n\ /trueoriginalCTM matrix currentmatrix def\n"); _update_buffer (page_header); strcpy (page_header->point, "\ %%EndPageSetup\n\n"); _update_buffer (page_header); /* Page header is now prepared, and stored in a plOutbuf. Do the same for the page trailer (much shorter). */ page_trailer = _new_outbuf (); /* Page Trailer: includes `showpage' */ strcpy (page_trailer->point, "\ %%PageTrailer\n\ End %I eop\n\ showpage\n\n"); _update_buffer (page_trailer); /* Page trailer is now ready */ /* WRITE PS CODE FOR THIS PAGE, including header, trailer */ _write_string (_plotter->data, page_header->base); if (current_page->len > 0) _write_string (_plotter->data, current_page->base); _write_string (_plotter->data, page_trailer->base); /* free header, trailer plOutbufs */ _delete_outbuf (page_trailer); _delete_outbuf (page_header); } } /* WRITE DOCUMENT TRAILER (and free its plOutbuf) */ _write_string (_plotter->data, doc_trailer->base); _delete_outbuf (doc_trailer); } /* delete all plOutbufs in which document pages are stored */ current_page = _plotter->data->first_page; while (current_page) { plOutbuf *next_page; next_page = current_page->next; _delete_outbuf (current_page); current_page = next_page; } /* flush output stream if any */ if (_plotter->data->outfp) { if (fflush(_plotter->data->outfp) < 0 #ifdef MSDOS /* data can be caught in DOS buffers, so do an fsync() too */ || fsync (_plotter->data->outfp) < 0 #endif ) _plotter->error (R___(_plotter) "the output stream is jammed"); } #ifdef LIBPLOTTER else if (_plotter->data->outstream) { _plotter->data->outstream->flush (); if (!(*(_plotter->data->outstream))) _plotter->error (R___(_plotter) "the output stream is jammed"); } #endif #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER PSPlotter::PSPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_p_initialize (); } PSPlotter::PSPlotter (FILE *outfile) :Plotter (outfile) { _pl_p_initialize (); } PSPlotter::PSPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_p_initialize (); } PSPlotter::PSPlotter (ostream& out) : Plotter (out) { _pl_p_initialize (); } PSPlotter::PSPlotter () { _pl_p_initialize (); } PSPlotter::PSPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_p_initialize (); } PSPlotter::PSPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_p_initialize (); } PSPlotter::PSPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_p_initialize (); } PSPlotter::PSPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_p_initialize (); } PSPlotter::PSPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_p_initialize (); } PSPlotter::~PSPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_p_terminate (); } #endif plotutils-2.6/libplot/p_erase.c0000644000175000017500000000272711037243261013577 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* A PSPlotter simply resets the output buffer, discarding all objects written to it, resets the bounding box, and marks all Postscript fonts as unused on the current page. */ #include "sys-defines.h" #include "extern.h" bool _pl_p_erase_page (S___(Plotter *_plotter)) { int i; /* reinitialize `font used' array(s) for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) _plotter->data->page->pcl_font_used[i] = false; #endif return true; } plotutils-2.6/libplot/p_openpl.c0000644000175000017500000000277111037243261013774 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Note: a PS Plotter emits graphics only after all pages of graphics have been drawn, and the Plotter is deleted. This delayed output allows the output to satisfy the DSC (Document Structuring Conventions). */ #include "sys-defines.h" #include "extern.h" bool _pl_p_begin_page (S___(Plotter *_plotter)) { int i; /* initialize `font used' array(s) for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; #ifdef USE_LJ_FONTS_IN_PS for (i = 0; i < PL_NUM_PCL_FONTS; i++) _plotter->data->page->pcl_font_used[i] = false; #endif return true; } plotutils-2.6/libplot/p_path.c0000644000175000017500000006423411037243261013435 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This version is for PSPlotters. By construction, for PSPlotters our path storage buffer, if it contains a path of segment array type, contains a sequence of line segments only (no other path elements such as arcs or Beziers are allowed). That's because our PS driver draws objects by calling PS functions defined in the idraw header, and the header doesn't include functions that draw arcs or Beziers. */ #include "sys-defines.h" #include "extern.h" /* 16-bit brush patterns for idraw (1 = on, 0 = off), indexed by our internal numbering of line types, i.e. by L_{SOLID,DOTTED,DOTDASHED, SHORTDASHED,LONGDASHED,DOTDOTDASHED,DOTDOTDOTDASHED} */ static const long idraw_brush_pattern[PL_NUM_LINE_TYPES] = { 0xffff, 0x8888, 0xfc30, 0xf0f0, 0xffc0, 0xfccc, 0xfdb6 }; /* PS join styles, indexed by internal number (miter/rd./bevel/triangular) */ static const int ps_join_style[PL_NUM_JOIN_TYPES] = { PS_LINE_JOIN_MITER, PS_LINE_JOIN_ROUND, PS_LINE_JOIN_BEVEL, PS_LINE_JOIN_ROUND }; /* PS cap styles, indexed by internal number (butt/rd./project/triangular) */ static const int ps_cap_style[PL_NUM_CAP_TYPES] = { PS_LINE_CAP_BUTT, PS_LINE_CAP_ROUND, PS_LINE_CAP_PROJECT, PS_LINE_CAP_ROUND }; void _pl_p_paint_path (S___(Plotter *_plotter)) { double granularity; if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; /* Compute `granularity': factor by which user-frame coordinates will be scaled up, so that when they're emitted as integers (which idraw requires), resolution loss won't be excessive. CTM factors will be scaled down by this factor. */ { /* compute norm of user->device affine transformation */ double norm, min_sing_val, max_sing_val; /* This minimum singular value isn't really the norm. But it's the nominal device-frame line width divided by the actual user-frame line-width (see g_linewidth.c), and that's what we need. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); norm = min_sing_val; granularity = norm / (PS_MIN_RESOLUTION); } if (granularity == 0.0) /* must have norm = 0, quit now to avoid division by zero */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { bool closed, closed_int; int i, numpoints, index_start, index_increment; int polyline_len; plIntPoint *xarray; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /*shouldn't happen */ break; if ((_plotter->drawstate->path->num_segments >= 3)/*check for closure*/ && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.x == _plotter->drawstate->path->segments[0].p.x) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.y == _plotter->drawstate->path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ /* scale up each point coordinate by granularity factor and round it to closest integer, removing runs of points with the same scaled integer coordinates */ xarray = (plIntPoint *)_pl_xmalloc (_plotter->drawstate->path->num_segments * sizeof(plIntPoint)); polyline_len = 0; for (i = 0; i < _plotter->drawstate->path->num_segments; i++) { plPoint datapoint; int x_int, y_int; datapoint = _plotter->drawstate->path->segments[i].p; x_int = IROUND(granularity * datapoint.x); y_int = IROUND(granularity * datapoint.y); if ((polyline_len == 0) || (x_int != xarray[polyline_len-1].x) || (y_int != xarray[polyline_len-1].y)) /* add point, in integer coordinates, to the array */ { xarray[polyline_len].x = x_int; xarray[polyline_len].y = y_int; polyline_len++; } } /* Handle awkward cases: due to rounding and elimination of runs, may be only 1 or 2 distinct vertices left in the polyline. */ if (polyline_len == 1) /* add a second point */ { xarray[1] = xarray[0]; polyline_len = 2; } if (polyline_len == 2) closed_int = false; /* 2-point ones should be open */ else closed_int = closed; /* number of points to be output, given that we're quantizing coordinates and removing runs */ numpoints = polyline_len - (closed_int ? 1 : 0); /* emit prolog and idraw instructions: start of MLine or Poly */ if (closed_int) strcpy (_plotter->data->page->point, "Begin %I Poly\n"); else strcpy (_plotter->data->page->point, "Begin %I MLine\n"); _update_buffer (_plotter->data->page); /* emit common attributes: CTM, fill rule, cap and join styles and miter limit, dash array, foreground and background colors, and idraw brush. */ _pl_p_emit_common_attributes (S___(_plotter)); /* emit transformation matrix (all 6 elements) */ strcpy (_plotter->data->page->point, "%I t\n["); _update_buffer (_plotter->data->page); for (i = 0; i < 6; i++) { if ((i==0) || (i==1) || (i==2) || (i==3)) sprintf (_plotter->data->page->point, "%.7g ", _plotter->drawstate->transform.m[i] / granularity); else sprintf (_plotter->data->page->point, "%.7g ", _plotter->drawstate->transform.m[i]); _update_buffer (_plotter->data->page); } strcpy (_plotter->data->page->point, "\ ] concat\n"); _update_buffer (_plotter->data->page); /* emit idraw instruction: number of points in line */ sprintf (_plotter->data->page->point, "\ %%I %d\n", numpoints); _update_buffer (_plotter->data->page); /* if polyline is closed, loop through points _backward_, since the `Poly' function in the idraw prologue draws closed polylines in reverse, and we want the dasharray to be interpreted correctly */ if (closed_int) { index_start = numpoints - 1; index_increment = -1; } else { index_start = 0; index_increment = 1; } for (i = index_start; i >= 0 && i <= numpoints - 1; i += index_increment) { /* output the data point */ sprintf (_plotter->data->page->point, "\ %d %d\n", xarray[i].x, xarray[i].y); _update_buffer (_plotter->data->page); } if (closed_int) sprintf (_plotter->data->page->point, "\ %d Poly\n\ End\n\n", numpoints); else sprintf (_plotter->data->page->point, "\ %d MLine\n\ End\n\n", numpoints); _update_buffer (_plotter->data->page); /* free temporary storage for quantized points */ free (xarray); /* Update bounding box, by iterating over segments in the original segment array (no quantizing, please). But for consistency, iterate in much the same way as above. */ /* number of points that we'd have emitted, had we not quantized and removed runs */ numpoints = _plotter->drawstate->path->num_segments - (closed ? 1 : 0); if (closed) { index_start = numpoints - 1; index_increment = -1; } else { index_start = 0; index_increment = 1; } for (i = index_start; i >= 0 && i <= numpoints - 1; i += index_increment) { if (!closed && ((i == 0) || (i == numpoints - 1))) /* an end rather than a join */ { int j; j = (i == 0 ? 1 : numpoints - 2); _set_line_end_bbox (_plotter->data->page, _plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y, _plotter->drawstate->path->segments[j].p.x, _plotter->drawstate->path->segments[j].p.y, _plotter->drawstate->line_width, _plotter->drawstate->cap_type, _plotter->drawstate->transform.m); } else /* a join rather than an end */ { int a, b, c; if (closed && i == 0) /* wrap */ { a = numpoints - 1; b = 0; c = 1; } else /* normal join */ { a = i - 1; b = i; c = i + 1; } _set_line_join_bbox(_plotter->data->page, _plotter->drawstate->path->segments[a].p.x, _plotter->drawstate->path->segments[a].p.y, _plotter->drawstate->path->segments[b].p.x, _plotter->drawstate->path->segments[b].p.y, _plotter->drawstate->path->segments[c].p.x, _plotter->drawstate->path->segments[c].p.y, _plotter->drawstate->line_width, _plotter->drawstate->join_type, _plotter->drawstate->miter_limit, _plotter->drawstate->transform.m); } } } break; case (int)PATH_BOX: { int i; /* emit prolog and idraw instructions: start of Rect */ strcpy (_plotter->data->page->point, "Begin %I Rect\n"); _update_buffer (_plotter->data->page); /* emit common attributes: CTM, fill rule, cap and join styles and miter limit, dash array, foreground and background colors, and idraw brush. */ _pl_p_emit_common_attributes (S___(_plotter)); /* emit transformation matrix (all 6 elements) */ strcpy (_plotter->data->page->point, "%I t\n["); _update_buffer (_plotter->data->page); for (i = 0; i < 6; i++) { if ((i==0) || (i==1) || (i==2) || (i==3)) sprintf (_plotter->data->page->point, "%.7g ", _plotter->drawstate->transform.m[i] / granularity); else sprintf (_plotter->data->page->point, "%.7g ", _plotter->drawstate->transform.m[i]); _update_buffer (_plotter->data->page); } strcpy (_plotter->data->page->point, "\ ] concat\n"); _update_buffer (_plotter->data->page); /* output the two defining vertices (preceded by an empty idraw instruction), and wind things up */ sprintf (_plotter->data->page->point, "\ %%I\n\ %d %d %d %d Rect\n\ End\n\n", IROUND(granularity * _plotter->drawstate->path->p0.x), IROUND(granularity * _plotter->drawstate->path->p0.y), IROUND(granularity * _plotter->drawstate->path->p1.x), IROUND(granularity * _plotter->drawstate->path->p1.y)); _update_buffer (_plotter->data->page); /* update bounding box */ _set_line_join_bbox(_plotter->data->page, _plotter->drawstate->path->p0.x, _plotter->drawstate->path->p1.y, _plotter->drawstate->path->p0.x, _plotter->drawstate->path->p0.y, _plotter->drawstate->path->p1.x, _plotter->drawstate->path->p0.y, _plotter->drawstate->line_width, _plotter->drawstate->join_type, _plotter->drawstate->miter_limit, _plotter->drawstate->transform.m); _set_line_join_bbox(_plotter->data->page, _plotter->drawstate->path->p0.x, _plotter->drawstate->path->p0.y, _plotter->drawstate->path->p1.x, _plotter->drawstate->path->p0.y, _plotter->drawstate->path->p1.x, _plotter->drawstate->path->p1.y, _plotter->drawstate->line_width, _plotter->drawstate->join_type, _plotter->drawstate->miter_limit, _plotter->drawstate->transform.m); _set_line_join_bbox(_plotter->data->page, _plotter->drawstate->path->p1.x, _plotter->drawstate->path->p0.y, _plotter->drawstate->path->p1.x, _plotter->drawstate->path->p1.y, _plotter->drawstate->path->p0.x, _plotter->drawstate->path->p1.y, _plotter->drawstate->line_width, _plotter->drawstate->join_type, _plotter->drawstate->miter_limit, _plotter->drawstate->transform.m); _set_line_join_bbox(_plotter->data->page, _plotter->drawstate->path->p1.x, _plotter->drawstate->path->p1.y, _plotter->drawstate->path->p0.x, _plotter->drawstate->path->p1.y, _plotter->drawstate->path->p0.x, _plotter->drawstate->path->p0.y, _plotter->drawstate->line_width, _plotter->drawstate->join_type, _plotter->drawstate->miter_limit, _plotter->drawstate->transform.m); } break; case (int)PATH_CIRCLE: { plPoint pc; double radius; pc = _plotter->drawstate->path->pc; radius = _plotter->drawstate->path->radius; /* final arg flags this for idraw as a circle, not an ellipse */ _pl_p_fellipse_internal (R___(_plotter) pc.x, pc.y, radius, radius, 0.0, true); } break; case (int)PATH_ELLIPSE: { double x = _plotter->drawstate->path->pc.x; double y = _plotter->drawstate->path->pc.y; double rx = _plotter->drawstate->path->rx; double ry = _plotter->drawstate->path->ry; double angle = _plotter->drawstate->path->angle; /* final arg flags this for idraw as an ellipse, not a circle */ _pl_p_fellipse_internal (R___(_plotter) x, y, rx, ry, angle, false); } break; default: /* shouldn't happen */ break; } } /* ARGS: circlep = drawn as a circle in user frame? */ void _pl_p_fellipse_internal (R___(Plotter *_plotter) double x, double y, double rx, double ry, double angle, bool circlep) { if (_plotter->drawstate->pen_type || _plotter->drawstate->fill_type) /* have something to draw */ { double granularity; double costheta, sintheta; double offcenter_rotation_matrix[6]; double ellipse_transformation_matrix[6]; int i; /* emit prolog instruction and idraw directive: start of Elli or Circ */ if (circlep) strcpy (_plotter->data->page->point, "Begin %I Circ\n"); else strcpy (_plotter->data->page->point, "Begin %I Elli\n"); _update_buffer(_plotter->data->page); /* emit common attributes: CTM, fill rule, cap and join styles and miter limit, dash array, foreground and background colors, and idraw brush. */ granularity = _pl_p_emit_common_attributes (S___(_plotter)); /* An affine tranformation must be applied to the ellipse produced by the Elli routine in the idraw prologue, to turn it into the ellipse we want. The Elli routine produces an ellipse with specified semi-axes, aligned parallel to the coordinate axes in user space, and centered on the point (x,y). I.e. it produces, symbolically, [unit circle centered on (0,0)] S T where S is a diagonal matrix that scales the unit circle to give the specified semi-axis lengths, and T translates (0,0) to (x,y). This is not what we want, since the ellipse is not rotated (it has zero inclination angle). What we want is [unit circle centered on (0,0)] S R T where R is a rotation matrix. This may be rewritten as [unit circle centered on (0,0)] S T (T^{-1} R T) where T^{-1} R T is a so-called offcenter rotation matrix, which rotates about the point (x,y). So the ellipse transformation matrix we'll place in the PS code will be (T^{-1} R T) times the matrix that transforms from user space to device space. */ costheta = cos (M_PI * angle / 180.0); sintheta = sin (M_PI * angle / 180.0); offcenter_rotation_matrix[0] = costheta; /* 1st 4 els are those of R */ offcenter_rotation_matrix[1] = sintheta; offcenter_rotation_matrix[2] = - sintheta; offcenter_rotation_matrix[3] = costheta; offcenter_rotation_matrix[4] = x * (1.0 - costheta) + y * sintheta; offcenter_rotation_matrix[5] = y * (1.0 - costheta) - x * sintheta; _matrix_product (offcenter_rotation_matrix, _plotter->drawstate->transform.m, ellipse_transformation_matrix); /* emit idraw directive: transformation matrix (all 6 elements) */ sprintf (_plotter->data->page->point, "%%I t\n["); _update_buffer(_plotter->data->page); for (i = 0; i < 6; i++) { if ((i==0) || (i==1) || (i==2) || (i==3)) sprintf (_plotter->data->page->point, "%.7g ", ellipse_transformation_matrix[i] / granularity); else sprintf (_plotter->data->page->point, "%.7g ", ellipse_transformation_matrix[i]); _update_buffer(_plotter->data->page); } sprintf (_plotter->data->page->point, "] concat\n"); _update_buffer(_plotter->data->page); /* emit idraw directive: draw Elli, and end Elli (or same for Circ) */ if (circlep) sprintf (_plotter->data->page->point, "%%I\n%d %d %d Circ\nEnd\n\n", IROUND(granularity * x), IROUND(granularity * y), IROUND(granularity * rx)); else sprintf (_plotter->data->page->point, "%%I\n%d %d %d %d Elli\nEnd\n\n", IROUND(granularity * x), IROUND(granularity * y), IROUND(granularity * rx), IROUND(granularity * ry)); _update_buffer(_plotter->data->page); /* update bounding box */ _set_ellipse_bbox (_plotter->data->page, x, y, rx, ry, costheta, sintheta, _plotter->drawstate->line_width, _plotter->drawstate->transform.m); } } /* Emit the common attributes, for PS and idraw, of any path object, either polyline, ellipse, or box. This includes the CTM, fill rule, cap and join styles and miter limit, dash array, foreground and background colors, and idraw brush. Return value is the `granularity': a factor by which user-frame coordinates, when emitted to the output file as integers, should be scaled up. This is to avoid loss of precision when using integer coordinates. The CTM emitted here will automatically compensate for the granularity factor. Note: some of the functions that call this one (see _pl_p_paint_path() above) need to compute the granularity themselves, since they can't need to quit if the granularity is zero, without calling this function . */ double _pl_p_emit_common_attributes (S___(Plotter *_plotter)) { bool singular_map; int i; double invnorm = 0.0, granularity = 1.0; double linewidth_adjust = 1.0; double min_sing_val, max_sing_val, norm; /* compute norm of user->device affine transformation */ /* This minimum singular value isn't really the norm. But it's the nominal device-frame line width divided by the actual user-frame line-width (see g_linewidth.c), and that's what we need. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); norm = min_sing_val; /* granularity = scaleup factor for user coordinates, so that when they're emitted as integers, resolution loss won't be excessive. CTM entries will be scaled down by this factor. */ granularity = norm / (PS_MIN_RESOLUTION); if (norm != 0.0) { /* invnorm is `norm' of device->user coordinate transformation */ invnorm = 1.0 / norm; singular_map = false; } else singular_map = true; /* redefine `originalCTM' matrix, which is the CTM applied when the polyline is stroked (as opposed to drawn). We define it to be the same as the one in effect when the polyline was drawn. */ if (singular_map != true) { int integer_linewidth = _plotter->drawstate->quantized_device_line_width; double double_linewidth = _plotter->drawstate->device_line_width; /* adjustment to CTM needed, due to our specifying line widths as integers */ if (integer_linewidth != 0) linewidth_adjust = double_linewidth / integer_linewidth; else linewidth_adjust = 1.0; strcpy (_plotter->data->page->point, "["); _update_buffer (_plotter->data->page); for (i = 0; i < 4; i++) { sprintf (_plotter->data->page->point, "%.7g ", linewidth_adjust * invnorm * _plotter->drawstate->transform.m[i]); _update_buffer (_plotter->data->page); } _update_buffer (_plotter->data->page); strcpy (_plotter->data->page->point, "\ 0 0 ] trueoriginalCTM originalCTM\n\ concatmatrix pop\n"); _update_buffer (_plotter->data->page); } /* specify cap style and join style, and miter limit if mitering */ if (_plotter->drawstate->join_type == PL_JOIN_MITER) sprintf (_plotter->data->page->point, "\ %d setlinecap %d setlinejoin %.4g setmiterlimit\n", ps_cap_style[_plotter->drawstate->cap_type], ps_join_style[_plotter->drawstate->join_type], _plotter->drawstate->miter_limit); else sprintf (_plotter->data->page->point, "\ %d setlinecap %d setlinejoin\n", ps_cap_style[_plotter->drawstate->cap_type], ps_join_style[_plotter->drawstate->join_type]); _update_buffer (_plotter->data->page); /* specify fill rule (i.e. whether to use even-odd filling) */ if (_plotter->drawstate->fill_rule_type == PL_FILL_NONZERO_WINDING) sprintf (_plotter->data->page->point, "\ /eoFillRule false def\n"); else sprintf (_plotter->data->page->point, "\ /eoFillRule true def\n"); _update_buffer (_plotter->data->page); if (_plotter->drawstate->pen_type != 0) /* pen is present, so will brush an outline of the path */ { int num_dashes; double scale; double *dashbuf, dash_cycle_length, offset; if (_plotter->drawstate->dash_array_in_effect) /* have user-specified dash array */ { /* idraw instruction: brush type (spec'd as bit vector, but for now we just use a solid brush */ sprintf (_plotter->data->page->point, "\ %%I b %ld\n", (long int)0xffff); _update_buffer (_plotter->data->page); num_dashes = _plotter->drawstate->dash_array_len; if (num_dashes > 0) dashbuf = (double *)_pl_xmalloc (num_dashes * sizeof(double)); else dashbuf = NULL; /* solid line */ /* take the adjustment to the CTM into account */ scale = norm / linewidth_adjust; dash_cycle_length = 0.0; for (i = 0; i < num_dashes; i++) { double dashlen; dashlen = _plotter->drawstate->dash_array[i]; dash_cycle_length += dashlen; dashbuf[i] = scale * dashlen; } if (dash_cycle_length > 0.0) /* choose an offset in range 0..true_cycle_length */ { double true_cycle_length; offset = _plotter->drawstate->dash_offset; true_cycle_length = dash_cycle_length * (num_dashes % 2 == 1 ? 2 : 1); while (offset < 0.0) offset += true_cycle_length; offset = fmod (offset, true_cycle_length); offset *= scale; } else offset = 0.0; } else /* have one of the canonical line types */ { /* idraw brush type (spec'd as bit vector) */ sprintf (_plotter->data->page->point, "\ %%I b %ld\n", idraw_brush_pattern[_plotter->drawstate->line_type]); _update_buffer (_plotter->data->page); if (_plotter->drawstate->line_type == PL_L_SOLID) { num_dashes = 0; dashbuf = NULL; offset = 0.0; } else { const int *dash_array; double display_size_in_points, min_dash_unit; /* compute PS dash array for this line type */ dash_array = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array; num_dashes = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array_len; dashbuf = (double *)_pl_xmalloc (num_dashes * sizeof(double)); /* scale the array of integers by line width (actually by floored line width) */ display_size_in_points = DMIN(_plotter->data->xmax - _plotter->data->xmin, _plotter->data->ymax - _plotter->data->ymin); min_dash_unit = (PL_MIN_DASH_UNIT_AS_FRACTION_OF_DISPLAY_SIZE * display_size_in_points); scale = DMAX(min_dash_unit, _plotter->drawstate->device_line_width); /* take the adjustment to the CTM into account */ scale /= linewidth_adjust; for (i = 0; i < num_dashes; i++) dashbuf[i] = scale * dash_array[i]; offset = 0.0; } } /* PS instruction: SetB (i.e. setbrush), with args LineWidth, LeftArrow, RightArrow, DashArray, DashOffset. */ /* Note LineWidth must be an integer for idraw compatibility. */ /* emit dash array */ sprintf (_plotter->data->page->point, "%d 0 0 [ ", _plotter->drawstate->quantized_device_line_width); _update_buffer (_plotter->data->page); for (i = 0; i < num_dashes; i++) { sprintf (_plotter->data->page->point, "%.3g ", dashbuf[i]); _update_buffer (_plotter->data->page); } sprintf (_plotter->data->page->point, "] %.3g SetB\n", offset); _update_buffer (_plotter->data->page); free (dashbuf); } else /* pen_type = 0, we have no pen to draw with (though we may do filling) */ { sprintf (_plotter->data->page->point, "\ %%I b n\n\ none SetB\n"); _update_buffer (_plotter->data->page); } /* idraw instruction: set foreground color */ _pl_p_set_pen_color (S___(_plotter)); /* invoked lazily, when needed */ sprintf (_plotter->data->page->point, "\ %%I cfg %s\n\ %g %g %g SetCFg\n", _pl_p_idraw_stdcolornames[_plotter->drawstate->ps_idraw_fgcolor], _plotter->drawstate->ps_fgcolor_red, _plotter->drawstate->ps_fgcolor_green, _plotter->drawstate->ps_fgcolor_blue); _update_buffer (_plotter->data->page); /* idraw instruction: set background color */ _pl_p_set_fill_color (S___(_plotter)); /* invoked lazily, when needed */ sprintf (_plotter->data->page->point, "\ %%I cbg %s\n\ %g %g %g SetCBg\n", _pl_p_idraw_stdcolornames[_plotter->drawstate->ps_idraw_bgcolor], _plotter->drawstate->ps_fillcolor_red, _plotter->drawstate->ps_fillcolor_green, _plotter->drawstate->ps_fillcolor_blue); _update_buffer (_plotter->data->page); /* includes idraw instruction: set fill pattern */ if (_plotter->drawstate->fill_type == 0) /* transparent */ sprintf (_plotter->data->page->point, "\ %%I p\n\ none SetP\n"); else /* filled, i.e. shaded, in the sense of idraw */ sprintf (_plotter->data->page->point, "\ %%I p\n\ %f SetP\n", _pl_p_idraw_stdshadings[_plotter->drawstate->ps_idraw_shading]); _update_buffer (_plotter->data->page); /* return factor we'll later use to scale up user-frame coordinates */ return granularity; } bool _pl_p_paint_paths (S___(Plotter *_plotter)) { return false; } plotutils-2.6/libplot/p_point.c0000644000175000017500000000342711037243261013627 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ /* In the PSPlotter class, a `point' is displayed as a small filled circle (one of libplot's standard marker symbols). */ #include "sys-defines.h" #include "extern.h" void _pl_p_paint_point (S___(Plotter *_plotter)) { double norm; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* compute size of a `point' in user coordinates */ norm = _matrix_norm (_plotter->drawstate->transform.m); if (norm != 0.0) { double user_size; user_size = PS_SIZE_OF_POINT / _matrix_norm (_plotter->drawstate->transform.m); _plotter->paint_marker (R___(_plotter) (int)M_FILLED_CIRCLE, user_size); } } } plotutils-2.6/libplot/p_text.c0000644000175000017500000003123711037243261013462 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the PS-driver-specific version of the low-level paint_text_string method, which is called to plot a label in the current font (either PS or PCL), at the current fontsize and textangle. The label is just a string: no control codes (font switching or sub/superscripts). The width of the string in user units is returned. This version does not support center-justification and right-justification; only the default left-justification. That is all right, since label justification is handled at a higher level. */ #include "sys-defines.h" #include "extern.h" #define GOOD_PRINTABLE_ASCII(c) ((c >= 0x20) && (c <= 0x7E)) double _pl_p_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { int i, master_font_index; double width; unsigned char *ptr; double theta, costheta, sintheta; double norm; double crockshift_x, crockshift_y; double dx0,dy0,dx1,dy1,dx2,dy2,dx3,dy3; double font_ascent, font_descent, up, down; double user_font_size = _plotter->drawstate->true_font_size; double device_font_size; double user_text_transformation_matrix[6]; double text_transformation_matrix[6]; bool pcl_font; /* sanity check; this routine supports only baseline positioning */ if (v_just != PL_JUST_BASE) return 0.0; /* similarly for horizontal justification */ if (h_just != PL_JUST_LEFT) /* shouldn't happen */ return 0.0; /* if empty string, nothing to do */ if (*s == (unsigned char)'\0') return 0.0; /* sanity check */ #ifndef USE_LJ_FONTS_IN_PS if (_plotter->drawstate->font_type != PL_F_POSTSCRIPT) return 0.0; #else /* USE_LJ_FONTS_IN_PS */ if (_plotter->drawstate->font_type != PL_F_POSTSCRIPT && _plotter->drawstate->font_type != PL_F_PCL) return 0.0; #endif pcl_font = (_plotter->drawstate->font_type == PL_F_PCL ? true : false); /* compute index of font in master table of PS [or PCL] fonts, in g_fontdb.c */ if (pcl_font) /* one of the 45 standard PCL fonts */ master_font_index = (_pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; else /* one of the 35 standard PS fonts */ master_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* label rotation angle in radians, in user frame */ theta = M_PI * _plotter->drawstate->text_rotation / 180.0; sintheta = sin (theta); costheta = cos (theta); /* font ascent and descent (taken from the font's bounding box) */ if (pcl_font) { font_ascent = (double)((_pl_g_pcl_font_info[master_font_index]).font_ascent); font_descent = (double)((_pl_g_pcl_font_info[master_font_index]).font_descent); } else /* PS font */ { font_ascent = (double)((_pl_g_ps_font_info[master_font_index]).font_ascent); font_descent = (double)((_pl_g_ps_font_info[master_font_index]).font_descent); } up = user_font_size * font_ascent / 1000.0; down = user_font_size * font_descent / 1000.0; /* Current point is on the baseline, but the rendering logic of the PS code in the idraw prologue requires us to perform a vertical shift at this point. (We'll undo the vertical shift immediately.) */ _plotter->drawstate->pos.x -= (user_font_size - down) * sintheta; _plotter->drawstate->pos.y += (user_font_size - down) * costheta; /* the idraw PS prologue (see p_header.c) performs an additional [gratuitous] vertical shift by 1 unit, which we must compensate for */ { double ctm_norm = _matrix_norm (_plotter->drawstate->transform.m); crockshift_x = sintheta / ctm_norm; crockshift_y = costheta / ctm_norm; } _plotter->drawstate->pos.x += crockshift_x; _plotter->drawstate->pos.y -= crockshift_y; /* this transformation matrix rotates, and translates: it maps (0,0) to the origin of the string, in user coordinates */ user_text_transformation_matrix[0] = costheta; user_text_transformation_matrix[1] = sintheta; user_text_transformation_matrix[2] = - sintheta; user_text_transformation_matrix[3] = costheta; user_text_transformation_matrix[4] = _plotter->drawstate->pos.x; user_text_transformation_matrix[5] = _plotter->drawstate->pos.y; /* undo vertical shifts performed above */ _plotter->drawstate->pos.x += (user_font_size - down) * sintheta; _plotter->drawstate->pos.y -= (user_font_size - down) * costheta; _plotter->drawstate->pos.x -= crockshift_x; _plotter->drawstate->pos.y += crockshift_y; /* Construct a temporary matrix that rotates, translates, and then maps to device coordinates. This matrix transforms from a frame in which nominal character sizes are roughly 1 unit in the horizontal and vertical directions, to device coordinates. */ _matrix_product (user_text_transformation_matrix, _plotter->drawstate->transform.m, text_transformation_matrix); /* We need to extract a quantity we can call a font size in device coordinates, for the benefit of idraw. (Idraw needs to retrieve an X font, and scale it. Idraw does not make use of modern [X11R6+] font scaling technology; it does its own scaling of bitmaps.) We define this to be user_font_size (the nominal font size in user coordinates), times the norm of the linear tranformation contained in the temporary matrix we just constructed (the magnitude of its larger singular value). Recall that for any square matrix M, the singular values are the square roots of the eigenvalues of the symmetric matrix M^t M. */ norm = _matrix_norm (text_transformation_matrix); if (norm == 0.0) /* avoid division by zero */ return 0.0; device_font_size = norm * user_font_size; /* Many PS interpreters can't handle zero font size. So bail if the font size we'll emit is zero. */ { char charbuf[64]; double emitted_device_font_size; sprintf (charbuf, "%f", device_font_size); sscanf (charbuf, "%lf", &emitted_device_font_size); if (emitted_device_font_size == 0.0) return 0.0; } /* Now scale the text transformation matrix so that the linear transformation contained in it has unit norm (if there is no shearing, it will just be a rotation; if there is no rotation either, it will be the identity matrix). */ for (i = 0; i < 4; i++) text_transformation_matrix[i] /= norm; /* prologue instruction, plus idraw directive: start of Text */ strcpy (_plotter->data->page->point, "Begin %I Text\n"); _update_buffer (_plotter->data->page); /* idraw directive, plus prologue instruction: set foreground color */ _pl_p_set_pen_color (S___(_plotter)); /* invoked lazily, i.e. when needed */ sprintf (_plotter->data->page->point, "%%I cfg %s\n%g %g %g SetCFg\n", _pl_p_idraw_stdcolornames[_plotter->drawstate->ps_idraw_fgcolor], _plotter->drawstate->ps_fgcolor_red, _plotter->drawstate->ps_fgcolor_green, _plotter->drawstate->ps_fgcolor_blue); _update_buffer (_plotter->data->page); /* idraw directive: X Windows font name, which incorporates the X font size. We use our primary X font name (the `x_name' field, not the `x_name_alt' field if any). */ /* N.B. this directive sets the _pixel_ size of the X font to be our current point size. That would really be appropriate only if the screen resolution is 72 dpi. But idraw seems to prefer setting the pixel size to setting the point size. */ if (pcl_font) /* one of the 45 PCL fonts */ { const char *ps_name; /* this is to support the Tidbits-is-Wingdings botch */ if (_pl_g_pcl_font_info[master_font_index].substitute_ps_name) ps_name = _pl_g_pcl_font_info[master_font_index].substitute_ps_name; else ps_name = _pl_g_pcl_font_info[master_font_index].ps_name; sprintf (_plotter->data->page->point, "%%I f -*-%s-*-%d-*-*-*-*-*-*-*\n", (_pl_g_pcl_font_info[master_font_index]).x_name, IROUND(device_font_size)); _update_buffer (_plotter->data->page); /* prolog instruction: PS font name and size */ sprintf (_plotter->data->page->point, "/%s %f SetF\n", ps_name, device_font_size); _update_buffer (_plotter->data->page); } else /* one of the 35 PS fonts */ { sprintf (_plotter->data->page->point, "%%I f -*-%s-*-%d-*-*-*-*-*-*-*\n", (_pl_g_ps_font_info[master_font_index]).x_name, IROUND(device_font_size)); _update_buffer (_plotter->data->page); /* prolog instruction: PS font name and size */ sprintf (_plotter->data->page->point, "/%s %f SetF\n", _pl_g_ps_font_info[master_font_index].ps_name, device_font_size); _update_buffer (_plotter->data->page); } /* idraw directive and prologue instruction: text transformation matrix */ strcpy (_plotter->data->page->point, "%I t\n[ "); _update_buffer (_plotter->data->page); for (i = 0; i < 6; i++) { sprintf (_plotter->data->page->point, "%.7g ", text_transformation_matrix[i]); _update_buffer (_plotter->data->page); } /* width of the string in user units (used below in constructing a bounding box, and as return value) */ width = _plotter->get_text_width (R___(_plotter) s); /* to compute an EPS-style bounding box, first compute offsets to the four vertices of the smallest rectangle containing the string */ dx0 = - sintheta * (-down); dy0 = costheta * (-down); dx1 = - sintheta * up; dy1 = costheta * up; dx2 = costheta * width - sintheta * (-down); dy2 = sintheta * width + costheta * (-down); dx3 = costheta * width - sintheta * up; dy3 = sintheta * width + costheta * up; /* record that we're using all four vertices (args of _update_bbox() are in device units, not user units) */ _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx0, (_plotter->drawstate->pos).y + dy0), YD ((_plotter->drawstate->pos).x + dx0, (_plotter->drawstate->pos).y + dy0)); _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx1, (_plotter->drawstate->pos).y + dy1), YD ((_plotter->drawstate->pos).x + dx1, (_plotter->drawstate->pos).y + dy1)); _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx2, (_plotter->drawstate->pos).y + dy2), YD ((_plotter->drawstate->pos).x + dx2, (_plotter->drawstate->pos).y + dy2)); _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx3, (_plotter->drawstate->pos).y + dy3), YD ((_plotter->drawstate->pos).x + dx3, (_plotter->drawstate->pos).y + dy3)); /* Finish outputting transformation matrix; begin outputting string. */ /* Escape all backslashes etc. in the text string, before output. */ strcpy (_plotter->data->page->point, " ] concat\n\ %I\n\ [\n\ ("); _update_buffer (_plotter->data->page); ptr = (unsigned char *)_plotter->data->page->point; while (*s) { switch (*s) { case '(': /* for PS, escape ()/ */ case ')': case '\\': *ptr++ = (unsigned char)'\\'; *ptr++ = *s++; break; default: if GOOD_PRINTABLE_ASCII (*s) *ptr++ = *s++; else { sprintf ((char *)ptr, "\\%03o", (unsigned int)*s); ptr += 4; s++; } break; } } *ptr = (unsigned char)'\0'; _update_buffer (_plotter->data->page); /* prologue instruction: end of text */ strcpy (_plotter->data->page->point, ")\n\ ] Text\n\ End\n\ \n"); _update_buffer (_plotter->data->page); /* flag current PS or PCL font as used on this page */ #ifdef USE_LJ_FONTS_IN_PS if (pcl_font) _plotter->data->page->pcl_font_used[master_font_index] = true; else _plotter->data->page->ps_font_used[master_font_index] = true; #else _plotter->data->page->ps_font_used[master_font_index] = true; #endif return width; } plotutils-2.6/libplot/a_attribs.c0000644000175000017500000001662511037243260014132 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This internal method is invoked by an Illustrator Plotter before drawing any object. It sets the relevant attributes (fill rule [if filling], cap type, join type, miter limit, line width) to what they should be. */ #include "sys-defines.h" #include "extern.h" /* Pseudo line type, which we use internally when AI's line type, i.e. dashing style, is set to agree with what the user specifies with linedash(), rather than with what the user specifies with linemod(). Should not equal any of our canonical line types, i.e. PL_L_SOLID etc. */ #define SPECIAL_AI_LINE_TYPE 100 /* AI fill rule types (in version 5 and later), indexed by our internal fill rule number (PL_FILL_ODD_WINDING/PL_FILL_NONZERO_WINDING) */ static const int _ai_fill_rule[PL_NUM_FILL_RULES] = { AI_FILL_ODD_WINDING, AI_FILL_NONZERO_WINDING }; /* AI (i.e. PS) join styles, indexed by internal number (miter/rd./bevel/triangular) */ static const int _ai_join_style[PL_NUM_JOIN_TYPES] = { AI_LINE_JOIN_MITER, AI_LINE_JOIN_ROUND, AI_LINE_JOIN_BEVEL, AI_LINE_JOIN_ROUND }; /* AI (i.e. PS) cap styles, indexed by internal number (butt/rd./project/triangular) */ static const int _ai_cap_style[PL_NUM_CAP_TYPES] = { AI_LINE_CAP_BUTT, AI_LINE_CAP_ROUND, AI_LINE_CAP_PROJECT, AI_LINE_CAP_ROUND }; void _pl_a_set_attributes (S___(Plotter *_plotter)) { bool changed_width = false; int desired_fill_rule = _ai_fill_rule[_plotter->drawstate->fill_rule_type]; double desired_ai_line_width = _plotter->drawstate->device_line_width; int desired_ai_cap_style = _ai_cap_style[_plotter->drawstate->cap_type]; int desired_ai_join_style = _ai_join_style[_plotter->drawstate->join_type]; double desired_ai_miter_limit = _plotter->drawstate->miter_limit; int desired_ai_line_type = _plotter->drawstate->line_type; int i; double display_size_in_points, min_dash_unit; if (_plotter->ai_version >= AI_VERSION_5 && _plotter->drawstate->fill_type > 0 && _plotter->ai_fill_rule_type != desired_fill_rule) { sprintf (_plotter->data->page->point, "%d XR\n", desired_fill_rule); _update_buffer (_plotter->data->page); _plotter->ai_fill_rule_type = desired_fill_rule; } if (_plotter->ai_cap_style != desired_ai_cap_style) { sprintf (_plotter->data->page->point, "%d J\n", desired_ai_cap_style); _update_buffer (_plotter->data->page); _plotter->ai_cap_style = desired_ai_cap_style; } if (_plotter->ai_join_style != desired_ai_join_style) { sprintf (_plotter->data->page->point, "%d j\n", desired_ai_join_style); _update_buffer (_plotter->data->page); _plotter->ai_join_style = desired_ai_join_style; } if (_plotter->drawstate->join_type == PL_JOIN_MITER && _plotter->ai_miter_limit != desired_ai_miter_limit) { sprintf (_plotter->data->page->point, "%.4g M\n", desired_ai_miter_limit); _update_buffer (_plotter->data->page); _plotter->ai_miter_limit = desired_ai_miter_limit; } if (_plotter->ai_line_width != desired_ai_line_width) { sprintf (_plotter->data->page->point, "%.4f w\n", desired_ai_line_width); _update_buffer (_plotter->data->page); _plotter->ai_line_width = desired_ai_line_width; changed_width = true; } if (_plotter->drawstate->dash_array_in_effect || _plotter->ai_line_type != desired_ai_line_type || (changed_width && desired_ai_line_type != PL_L_SOLID)) /* must tell AI which dash array to use */ { double *dashbuf; int num_dashes; double offset; if (_plotter->drawstate->dash_array_in_effect) /* have user-specified dash array */ { num_dashes = _plotter->drawstate->dash_array_len; if (num_dashes > 0) /* non-solid line type */ { double min_sing_val, max_sing_val; /* compute minimum singular value of user->device coordinate map, which we use as a multiplicative factor to convert line widths (cf. g_linewidth.c), dash lengths, etc. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); dashbuf = (double *)_pl_xmalloc (num_dashes * sizeof(double)); for (i = 0; i < num_dashes; i++) { double dashlen; dashlen = min_sing_val * _plotter->drawstate->dash_array[i]; dashbuf[i] = dashlen; } offset = min_sing_val * _plotter->drawstate->dash_offset; } else /* zero-length dash array, i.e. solid line type */ { dashbuf = NULL; offset = 0; } /* we'll keep track of the fact that AI is using a special user-specified dash array by setting the `hpgl_line_type' data member to this bogus value */ desired_ai_line_type = SPECIAL_AI_LINE_TYPE; } else /* dash array not in effect, have a canonical line type instead */ { if (desired_ai_line_type == PL_L_SOLID) { num_dashes = 0; dashbuf = NULL; offset = 0.0; } else { const int *dash_array; double scale; num_dashes = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array_len; dashbuf = (double *)_pl_xmalloc (num_dashes * sizeof(double)); /* compute PS dash array for this line type */ dash_array = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array; /* scale the array of integers by line width (actually by floored line width; see comments at head of file) */ display_size_in_points = DMIN(_plotter->data->xmax - _plotter->data->xmin, _plotter->data->ymax - _plotter->data->ymin); min_dash_unit = (PL_MIN_DASH_UNIT_AS_FRACTION_OF_DISPLAY_SIZE * display_size_in_points); scale = DMAX(min_dash_unit, _plotter->drawstate->device_line_width); for (i = 0; i < num_dashes; i++) dashbuf[i] = scale * dash_array[i]; offset = 0.0; } } /* emit dash array */ sprintf (_plotter->data->page->point, "["); _update_buffer (_plotter->data->page); for (i = 0; i < num_dashes; i++) { if (i == 0) sprintf (_plotter->data->page->point, "%.4f", dashbuf[i]); else sprintf (_plotter->data->page->point, " %.4f", dashbuf[i]); _update_buffer (_plotter->data->page); } sprintf (_plotter->data->page->point, "] %.4f d\n", offset); _update_buffer (_plotter->data->page); /* Update our knowledge of AI's line type (i.e. dashing style). This new value will be one of PL_L_SOLID etc., or the pseudo value SPECIAL_AI_LINE_TYPE. */ _plotter->ai_line_type = desired_ai_line_type; free (dashbuf); } return; } plotutils-2.6/libplot/a_color.c0000644000175000017500000001066411037243260013575 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* We call these routines, which set the Illustrator pen and fill colors, lazily i.e. only when needed (just before an object is written to the output buffer). */ #include "sys-defines.h" #include "extern.h" void _pl_a_set_pen_color(S___(Plotter *_plotter)) { double red, green, blue; double cyan, magenta, yellow, black, temp; /* convert from RGB to CMYK */ red = ((double)((_plotter->drawstate->fgcolor).red))/0xFFFF; green = ((double)((_plotter->drawstate->fgcolor).green))/0xFFFF; blue = ((double)((_plotter->drawstate->fgcolor).blue))/0xFFFF; cyan = 1.0 - red; magenta = 1.0 - green; yellow = 1.0 - blue; temp = magenta < yellow ? magenta : yellow; black = cyan < temp ? cyan : temp; cyan -= black; magenta -= black; yellow -= black; if ((_plotter->ai_pen_cyan != cyan) || (_plotter->ai_pen_magenta != magenta) || (_plotter->ai_pen_yellow != yellow) || (_plotter->ai_pen_black != black)) /* need to change pen CMYK */ { sprintf (_plotter->data->page->point, "%.4f %.4f %.4f %.4f K\n", cyan, magenta, yellow, black); _update_buffer (_plotter->data->page); _plotter->ai_pen_cyan = cyan; _plotter->ai_pen_magenta = magenta; _plotter->ai_pen_yellow = yellow; _plotter->ai_pen_black = black; } /* keep track of which colors AI uses */ if (_plotter->ai_pen_cyan > 0.0) _plotter->ai_cyan_used = true; if (_plotter->ai_pen_magenta > 0.0) _plotter->ai_magenta_used = true; if (_plotter->ai_pen_yellow > 0.0) _plotter->ai_yellow_used = true; if (_plotter->ai_pen_black > 0.0) _plotter->ai_black_used = true; } void _pl_a_set_fill_color(R___(Plotter *_plotter) bool force_pen_color) { double red, green, blue; double cyan, magenta, yellow, black, temp; if (force_pen_color == false && _plotter->drawstate->fill_type == 0) /* won't be doing filling, so punt */ return; /* get color; if force_pen_color is set, get pen color instead of fill color */ if (force_pen_color) { red = ((double)((_plotter->drawstate->fgcolor).red))/0xFFFF; green = ((double)((_plotter->drawstate->fgcolor).green))/0xFFFF; blue = ((double)((_plotter->drawstate->fgcolor).blue))/0xFFFF; } else { red = ((double)((_plotter->drawstate->fillcolor).red))/0xFFFF; green = ((double)((_plotter->drawstate->fillcolor).green))/0xFFFF; blue = ((double)((_plotter->drawstate->fillcolor).blue))/0xFFFF; } /* convert from RGB to CMYK */ cyan = 1.0 - red; magenta = 1.0 - green; yellow = 1.0 - blue; temp = magenta < yellow ? magenta : yellow; black = cyan < temp ? cyan : temp; cyan -= black; magenta -= black; yellow -= black; if ((_plotter->ai_fill_cyan != cyan) || (_plotter->ai_fill_magenta != magenta) || (_plotter->ai_fill_yellow != yellow) || (_plotter->ai_fill_black != black)) /* need to change AI fill CMYK */ { sprintf (_plotter->data->page->point, "%.4f %.4f %.4f %.4f k\n", cyan, magenta, yellow, black); _update_buffer (_plotter->data->page); _plotter->ai_fill_cyan = cyan; _plotter->ai_fill_magenta = magenta; _plotter->ai_fill_yellow = yellow; _plotter->ai_fill_black = black; } /* keep track of which colors AI uses */ if (_plotter->ai_fill_cyan > 0.0) _plotter->ai_cyan_used = true; if (_plotter->ai_fill_magenta > 0.0) _plotter->ai_magenta_used = true; if (_plotter->ai_fill_yellow > 0.0) _plotter->ai_yellow_used = true; if (_plotter->ai_fill_black > 0.0) _plotter->ai_black_used = true; } plotutils-2.6/libplot/a_closepl.c0000644000175000017500000005345311037243260014123 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the closepl method, which is a standard part of libplot. It closes a Plotter object. For an AIPlotter objects, we prepare an Illustrator header for the page. After the header comes the graphics code for all objects, which we have saved in a resizable outbuf structure for the page. Then a trailer. AI format supports only single-page documents. */ #include "sys-defines.h" #include "extern.h" /* song and dance to define time_t, and declare both time() and ctime() */ #ifdef HAVE_SYS_TYPES_H #include /* for time_t on some pre-ANSI Unix systems */ #endif #ifdef TIME_WITH_SYS_TIME #include /* for time() on some pre-ANSI Unix systems */ #include /* for ctime() */ #else /* not TIME_WITH_SYS_TIME, include only one (prefer ) */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ static const char * const _ai_symbol_reencoding = "32/space\n/exclam\n/universal\n/numbersign\n/existential\n/percent\n/ampersand\n/suchthat\n/parenleft\n/parenright\n/asteriskmath\n/plus\n/comma\n/minus\n/period\n/slash\n/zero\n/one\n/two\n/three\n/four\n/five\n/six\n/seven\n/eight\n/nine\n/colon\n/semicolon\n/less\n/equal\n/greater\n/question\n/congruent\n/Alpha\n/Beta\n/Chi\n/Delta\n/Epsilon\n/Phi\n/Gamma\n/Eta\n/Iota\n/theta1\n/Kappa\n/Lambda\n/Mu\n/Nu\n/Omicron\n/Pi\n/Theta\n/Rho\n/Sigma\n/Tau\n/Upsilon\n/sigma1\n/Omega\n/Xi\n/Psi\n/Zeta\n/bracketleft\n/therefore\n/bracketright\n/perpendicular\n/underscore\n/radicalex\n/alpha\n/beta\n/chi\n/delta\n/epsilon\n/phi\n/gamma\n/eta\n/iota\n/phi1\n/kappa\n/lambda\n/mu\n/nu\n/omicron\n/pi\n/theta\n/rho\n/sigma\n/tau\n/upsilon\n/omega1\n/omega\n/xi\n/psi\n/zeta\n/braceleft\n/bar\n/braceright\n/similar\n161/Upsilon1\n/minute\n/lessequal\n/fraction\n/infinity\n/florin\n/club\n/diamond\n/heart\n/spade\n/arrowboth\n/arrowleft\n/arrowup\n/arrowright\n/arrowdown\n/degree\n/plusminus\n/second\n/greaterequal\n/multiply\n/proportional\n/partialdiff\n/bullet\n/divide\n/notequal\n/equivalence\n/approxequal\n/ellipsis\n/arrowvertex\n/arrowhorizex\n/carriagereturn\n/aleph\n/Ifraktur\n/Rfraktur\n/weierstrass\n/circlemultiply\n/circleplus\n/emptyset\n/intersection\n/union\n/propersuperset\n/reflexsuperset\n/notsubset\n/propersubset\n/reflexsubset\n/element\n/notelement\n/angle\n/gradient\n/registerserif\n/copyrightserif\n/trademarkserif\n/product\n/radical\n/dotmath\n/logicalnot\n/logicaland\n/logicalor\n/arrowdblboth\n/arrowdblleft\n/arrowdblup\n/arrowdblright\n/arrowdbldown\n/lozenge\n/angleleft\n/registersans\n/copyrightsans\n/trademarksans\n/summation\n/parenlefttp\n/parenleftex\n/parenleftbt\n/bracketlefttp\n/bracketleftex\n/bracketleftbt\n/bracelefttp\n/braceleftmid\n/braceleftbt\n/braceex\n241/angleright\n/integral\n/integraltp\n/integralex\n/integralbt\n/parenrighttp\n/parenrightex\n/parenrightbt\n/bracketrighttp\n/bracketrightex\n/bracketrightbt\n/bracerighttp\n/bracerightmid\n/bracerightbt\n"; static const char * const _ai_zapf_dingbats_reencoding = "32/space\n/a1\n/a2\n/a202\n/a3\n/a4\n/a5\n/a119\n/a118\n/a117\n/a11\n/a12\n/a13\n/a14\n/a15\n/a16\n/a105\n/a17\n/a18\n/a19\n/a20\n/a21\n/a22\n/a23\n/a24\n/a25\n/a26\n/a27\n/a28\n/a6\n/a7\n/a8\n/a9\n/a10\n/a29\n/a30\n/a31\n/a32\n/a33\n/a34\n/a35\n/a36\n/a37\n/a38\n/a39\n/a40\n/a41\n/a42\n/a43\n/a44\n/a45\n/a46\n/a47\n/a48\n/a49\n/a50\n/a51\n/a52\n/a53\n/a54\n/a55\n/a56\n/a57\n/a58\n/a59\n/a60\n/a61\n/a62\n/a63\n/a64\n/a65\n/a66\n/a67\n/a68\n/a69\n/a70\n/a71\n/a72\n/a73\n/a74\n/a203\n/a75\n/a204\n/a76\n/a77\n/a78\n/a79\n/a81\n/a82\n/a83\n/a84\n/a97\n/a98\n/a99\n/a100\n160/space\n/a101\n/a102\n/a103\n/a104\n/a106\n/a107\n/a108\n/a112\n/a111\n/a110\n/a109\n/a120\n/a121\n/a122\n/a123\n/a124\n/a125\n/a126\n/a127\n/a128\n/a129\n/a130\n/a131\n/a132\n/a133\n/a134\n/a135\n/a136\n/a137\n/a138\n/a139\n/a140\n/a141\n/a142\n/a143\n/a144\n/a145\n/a146\n/a147\n/a148\n/a149\n/a150\n/a151\n/a152\n/a153\n/a154\n/a155\n/a156\n/a157\n/a158\n/a159\n/a160\n/a161\n/a163\n/a164\n/a196\n/a165\n/a192\n/a166\n/a167\n/a168\n/a169\n/a170\n/a171\n/a172\n/a173\n/a162\n/a174\n/a175\n/a176\n/a177\n/a178\n/a179\n/a193\n/a180\n/a199\n/a181\n/a200\n/a182\n241/a201\n/a183\n/a184\n/a197\n/a185\n/a194\n/a198\n/a186\n/a195\n/a187\n/a188\n/a189\n/a190\n/a191\n"; bool _pl_a_end_page (S___(Plotter *_plotter)) { bool fonts_used = false; int i; /* Beginning of Page Header */ { char *time_s; double x_min, x_max, y_min, y_max; double xmid, ymid; int ixmid, iymid; time_t clock; plOutbuf *page_header; /* first, prepare AI header, and write it to a plOutbuf */ page_header = _new_outbuf (); /* compute center of viewport in device coors (i.e. points) */ xmid = 0.5 * (_plotter->data->xmin + _plotter->data->xmax); ymid = 0.5 * (_plotter->data->ymin + _plotter->data->ymax); ixmid = IROUND(xmid); iymid = IROUND(ymid); /* emit first few comment lines */ sprintf (page_header->point, "\ %%!PS-Adobe-3.0\n\ %%%%Creator: GNU libplot drawing library %s\n\ %%%%For: (Unknown) (Unknown)\n\ %%%%Title: (Untitled)\n", PL_LIBPLOT_VER_STRING); _update_buffer (page_header); /* emit creation date and time, if possible */ time(&clock); time_s = ctime(&clock); if (time_s != NULL) { char weekday[32], month[32], day[32], hour_min_sec[32], year[32]; int num_matched; num_matched = sscanf (time_s, "%s %s %s %s %s", weekday, month, day, hour_min_sec, year); if (num_matched == 5) { sprintf (page_header->point, "\ %%%%CreationDate: (%s %s %s) (%s)\n", day, month, year, hour_min_sec); _update_buffer (page_header); } } /* emit bounding box for the page */ _bbox_of_outbuf (_plotter->data->page, &x_min, &x_max, &y_min, &y_max); if (x_min > x_max || y_min > y_max) /* no objects */ /* place degenerate box at center of page */ sprintf (page_header->point, "\ %%%%BoundingBox: %d %d %d %d\n", ixmid, iymid, ixmid, iymid); else /* emit true bounding box */ sprintf (page_header->point, "\ %%%%BoundingBox: %d %d %d %d\n", IROUND(x_min - 0.5), IROUND(y_min - 0.5), IROUND(x_max + 0.5), IROUND(y_max + 0.5)); _update_buffer (page_header); if (_plotter->ai_version >= AI_VERSION_5) /* emit hi-res bounding box too */ { if (x_min > x_max || y_min > y_max) /* empty page */ /* place degenerate box at center of page */ sprintf (page_header->point, "\ %%%%HiResBoundingBox: %.4f %.4f %.4f %.4f\n", xmid, ymid, xmid, ymid); else /* emit true bounding box */ sprintf (page_header->point, "\ %%%%HiResBoundingBox: %.4f %.4f %.4f %.4f\n", x_min, y_min, x_max, y_max); _update_buffer (page_header); } /* emit process colors used */ sprintf (page_header->point, "\ %%%%DocumentProcessColors:"); _update_buffer (page_header); if (_plotter->ai_cyan_used) { sprintf (page_header->point, " Cyan"); _update_buffer (page_header); } if (_plotter->ai_magenta_used) { sprintf (page_header->point, " Magenta"); _update_buffer (page_header); } if (_plotter->ai_yellow_used) { sprintf (page_header->point, " Yellow"); _update_buffer (page_header); } if (_plotter->ai_black_used) { sprintf (page_header->point, " Black"); _update_buffer (page_header); } sprintf (page_header->point, "\n"); _update_buffer (page_header); /* tell AI to include any PS [or PCL] fonts that are needed */ sprintf (page_header->point, "\ %%%%DocumentFonts: "); _update_buffer (page_header); for (i = 0; i < PL_NUM_PS_FONTS; i++) if (_plotter->data->page->ps_font_used[i]) { if (fonts_used) /* not first font */ sprintf (page_header->point, "%%%%+ %s\n", _pl_g_ps_font_info[i].ps_name); else /* first font */ sprintf (page_header->point, "%s\n", _pl_g_ps_font_info[i].ps_name); _update_buffer (page_header); fonts_used = true; } for (i = 0; i < PL_NUM_PCL_FONTS; i++) if (_plotter->data->page->pcl_font_used[i]) { if (fonts_used) /* not first font */ sprintf (page_header->point, "%%%%+ %s\n", _pl_g_pcl_font_info[i].ps_name); else /* first font */ sprintf (page_header->point, "%s\n", _pl_g_pcl_font_info[i].ps_name); _update_buffer (page_header); fonts_used = true; } if (!fonts_used) { sprintf (page_header->point, "\n"); _update_buffer (page_header); } /* tell AI or print spooler that we need procsets */ if (_plotter->ai_version == AI_VERSION_5) { sprintf (page_header->point, "\ %%%%DocumentNeededResources: procset Adobe_level2_AI5 1.0 0\n\ %%%%+ procset Adobe_typography_AI5 1.0 0\n\ %%%%+ procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6\n\ %%%%+ procset Adobe_Illustrator_AI5 1.0 0\n"); _update_buffer (page_header); /* claim to be AI 7.0 (that's what `3' means) */ sprintf (page_header->point, "\ %%AI5_FileFormat 3\n"); _update_buffer (page_header); } else /* AI_VERSION_3 */ { sprintf (page_header->point, "\ %%%%DocumentNeededResources: procset Adobe_packedarray 2.0 0\n\ %%%%+ procset Adobe_cmykcolor 1.1 0\n\ %%%%+ procset Adobe_cshow 1.1 0\n\ %%%%+ procset Adobe_customcolor 1.0 0\n\ %%%%+ procset Adobe_typography_AI3 1.0 1\n\ %%%%+ procset Adobe_pattern_AI3 1.0 0\n\ %%%%+ procset Adobe_Illustrator_AI3 1.0 1\n"); _update_buffer (page_header); } /* AI3 directives. */ /* tell AI whether or not we're monochrome */ sprintf (page_header->point, "\ %%AI3_ColorUsage: "); _update_buffer (page_header); if (_plotter->ai_cyan_used || _plotter->ai_magenta_used || _plotter->ai_yellow_used) sprintf (page_header->point, "Color\n"); else sprintf (page_header->point, "Black&White\n"); _update_buffer (page_header); /* no linked images are embedded in this file */ sprintf (page_header->point, "\ %%AI7_ImageSettings: 0\n"); _update_buffer (page_header); /* place degenerate template box at center of viewport (used for centering, in case size of artboard changes between successive versions of AI) */ sprintf (page_header->point, "\ %%AI3_TemplateBox: %d %d %d %d\n", ixmid, iymid, ixmid, iymid); _update_buffer (page_header); /* nominal imageable area of the page (used only by Macintosh version of AI?): we specify our horizontal range, and the full page height */ sprintf (page_header->point, "\ %%AI3_TileBox: %d %d %d %d\n", IROUND(_plotter->data->xmin), 0, IROUND(_plotter->data->xmax), IROUND(72 * _plotter->data->page_data->ysize)); _update_buffer (page_header); sprintf (page_header->point, "\ %%AI3_DocumentPreview: None\n"); _update_buffer (page_header); /* AI5 directives. */ /* Note: AI5_ArtFlags consists of nine 0/1 flags that describe the settings found in the Document Setup dialogue; meaning of each `1' is: use page setup / use print tiles / show placed images / preview patterns / split long paths / tile full pages / use printer's default screens / use auto default screens [meaningful only if previous flag = 1] / use compatible gradient printing */ /* Note: we could add an %AI5_OpenToView line, between the %AI5_NumLayers line and the %AI5_OpenViewLayers line. Such a line would look like %AI5_OpenToView: -318 780 -2 624 379 18 0 1 98 74 0 0 with 12 parameters. It specifies the size, location, and orientation of the artwork within the AI display, when the file is opened. Parameters are: 1,2. (ulx, uly). Position, in integer artwork coors, of upper left corner of AI's artwork window. 3. zoom. Integer zoom factor (a negative number represents 1/x). 4,5. w,h. Width and height of the artwork window, in pixels. Allegedly floating point, not integer. 6. view_style. An integer specifying what's displayed (e.g. 25=artwork, 26=preview, 30=preview selection). 7. ruler. 0/1 flag, 1 means show ruler. 8. tiling. 0/1 flag, 1 means show tiling. 9,10. (ul_monx, ul_mony). Upper left corner of the artwork window on the monitor, in integer coordinates. (!) 11. grid. 0/1 flag, 1 means display grid. 12. snap_grid. 0/1 flag, 1 means snap to grid. */ if (_plotter->ai_version >= AI_VERSION_5) { sprintf (page_header->point, "\ %%AI5_ArtSize: %d %d\n\ %%AI5_RulerUnits: %d\n\ %%AI5_ArtFlags: 1 0 0 1 0 0 1 1 0\n\ %%AI5_TargetResolution: 800\n\ %%AI5_NumLayers: 1\n\ %%AI5_OpenViewLayers: 7\n", /* For `ArtSize' (size of the artboard in points), we specify the entire physical page. */ /* page width */ IROUND(72 * _plotter->data->page_data->xsize), /* page height */ IROUND(72 * _plotter->data->page_data->ysize), /* label AI's rulers with centimeters or inches (4 = cm, 0 = in) */ _plotter->data->page_data->metric ? 4 : 0); _update_buffer (page_header); } /* following three may be used only by old Macintosh versions of AI? */ /* so-called page origin, taken to be lower left corner of nominal imageable area (see above) */ sprintf (page_header->point, "\ %%%%PageOrigin:%d %d\n", IROUND(_plotter->data->xmin), 0); _update_buffer (page_header); /* paper rectangle, relative to the lower left corner of the nominal imageable area (see above) */ sprintf (page_header->point, "\ %%%%AI3_PaperRect:%d %d %d %d\n", -IROUND(_plotter->data->xmin), IROUND(72 * _plotter->data->page_data->ysize), IROUND(72 * _plotter->data->page_data->xsize - _plotter->data->xmin), 0); _update_buffer (page_header); /* margins on all sides of the paper, i.e. the offsets between page edges and the nominal imageable area (see above) */ sprintf (page_header->point, "\ %%%%AI3_Margin:%d %d %d %d\n", IROUND(_plotter->data->xmin), 0, IROUND(-(72 * _plotter->data->page_data->xsize - _plotter->data->xmax)), 0); _update_buffer (page_header); /* gridlines; parameters are: num. horizontal points between gridlines / num. horizontal subdivisions / num. vertical points between gridlines / num. vertical subdivisions / gridlines in front/back of artwork (0/1) / grid style lines/dots (0/1) / RGB for gridlines / RGB for subdivisions */ if (_plotter->data->page_data->metric) /* visible grid spacing = 1 cm, 3 subdivisions / division */ sprintf (page_header->point, "\ %%AI7_GridSettings: %.4f 3 %.4f 3 1 0 0.8 0.8 0.8 0.9 0.9 0.9\n", 72.0/2.54, 72.0/2.54); else /* visible grid spacing = 1 in, 8 subdivisions / division */ sprintf (page_header->point, "\ %%AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9\n"); _update_buffer (page_header); sprintf (page_header->point, "\ %%%%EndComments\n"); _update_buffer (page_header); /* Prolog section: include the procsets */ if (_plotter->ai_version == AI_VERSION_5) sprintf (page_header->point, "\ %%%%BeginProlog\n\ %%%%IncludeResource: procset Adobe_level2_AI5 1.0 0\n\ %%%%IncludeResource: procset Adobe_typography_AI5 1.0 0\n\ %%%%IncludeResource: procset Adobe_Illustrator_AI6_vars Adobe_Illustrator_AI6\n\ %%%%IncludeResource: procset Adobe_Illustrator_AI5 1.0 0\n\ %%%%EndProlog\n"); else /* AI_VERSION_3 */ sprintf (page_header->point, "\ %%%%BeginProlog\n\ %%%%IncludeResource: procset Adobe_packedarray 2.0 0\n\ Adobe_packedarray /initialize get exec\n\ %%%%IncludeResource: procset Adobe_cmykcolor 1.1 0\n\ %%%%IncludeResource: procset Adobe_cshow 1.1 0\n\ %%%%IncludeResource: procset Adobe_customcolor 1.0 0\n\ %%%%IncludeResource: procset Adobe_typography_AI3 1.0 1\n\ %%%%IncludeResource: procset Adobe_pattern_AI3 1.0 0\n\ %%%%IncludeResource: procset Adobe_Illustrator_AI3 1.0 1\n\ %%%%EndProlog\n"); _update_buffer (page_header); /* beginning of Setup section */ sprintf (page_header->point, "\ %%%%BeginSetup\n"); _update_buffer (page_header); /* include fonts if any */ if (fonts_used) { for (i = 0; i < PL_NUM_PS_FONTS; i++) if (_plotter->data->page->ps_font_used[i]) { sprintf (page_header->point, "\ %%%%IncludeFont: %s\n", _pl_g_ps_font_info[i].ps_name); _update_buffer (page_header); } for (i = 0; i < PL_NUM_PCL_FONTS; i++) if (_plotter->data->page->pcl_font_used[i]) { sprintf (page_header->point, "\ %%%%IncludeFont: %s\n", _pl_g_pcl_font_info[i].ps_name); _update_buffer (page_header); } } /* do setup of procsets */ if (_plotter->ai_version == AI_VERSION_5) sprintf (page_header->point, "\ Adobe_level2_AI5 /initialize get exec\n\ Adobe_Illustrator_AI5_vars Adobe_Illustrator_AI5 Adobe_typography_AI5 /initialize get exec\n\ Adobe_ColorImage_AI6 /initialize get exec\n\ Adobe_Illustrator_AI5 /initialize get exec\n"); else /* AI_VERSION_3 */ sprintf (page_header->point, "\ Adobe_cmykcolor /initialize get exec\n\ Adobe_cshow /initialize get exec\n\ Adobe_customcolor /initialize get exec\n\ Adobe_typography_AI3 /initialize get exec\n\ Adobe_pattern_AI3 /initialize get exec\n\ Adobe_Illustrator_AI3 /initialize get exec\n"); _update_buffer (page_header); if (fonts_used) /* do whatever font reencodings are needed */ { /* don't modify StandardEncoding */ sprintf (page_header->point, "[\n\ TE\n"); _update_buffer (page_header); /* reencode each used font */ for (i = 0; i < PL_NUM_PS_FONTS; i++) if (_plotter->data->page->ps_font_used[i]) { const char *reencoding; if (_pl_g_ps_font_info[i].iso8859_1) /* ISO-Latin-1 font */ reencoding = ""; else if (strcmp (_pl_g_ps_font_info[i].ps_name, "ZapfDingbats")== 0) reencoding = _ai_zapf_dingbats_reencoding; else if (strcmp (_pl_g_ps_font_info[i].ps_name, "Symbol") == 0) reencoding = _ai_symbol_reencoding; else /* don't know what to do */ reencoding = ""; sprintf (page_header->point, "\ %%AI3_BeginEncoding: _%s %s\n\ [%s/_%s/%s 0 0 0 TZ\n\ %%AI3_EndEncoding AdobeType\n", _pl_g_ps_font_info[i].ps_name, _pl_g_ps_font_info[i].ps_name, reencoding, _pl_g_ps_font_info[i].ps_name, _pl_g_ps_font_info[i].ps_name); _update_buffer (page_header); } for (i = 0; i < PL_NUM_PCL_FONTS; i++) if (_plotter->data->page->pcl_font_used[i]) { sprintf (page_header->point, "\ %%AI3_BeginEncoding: _%s %s\n\ [/_%s/%s 0 0 0 TZ\n\ %%AI3_EndEncoding TrueType\n", _pl_g_pcl_font_info[i].ps_name, _pl_g_pcl_font_info[i].ps_name, _pl_g_pcl_font_info[i].ps_name, _pl_g_pcl_font_info[i].ps_name); _update_buffer (page_header); } } /* end of Setup section */ sprintf (page_header->point, "\ %%%%EndSetup\n"); _update_buffer (page_header); if (_plotter->ai_version >= AI_VERSION_5) /* objects will belong to layer #1 (if layers are supported) */ { /* 10 layer attributes, of which the first 6 are 0/1 flags, with `1' meaning: visible / preview / enabled / printing layer / dimmed / has multilayer masks. The next attribute is a color ID for the layer (0 = light blue), and the final three attributes are intensities of R,G,B, on a 0..255 scale (79,128,255 apparently being what AI normally uses) */ sprintf (page_header->point, "\ %%AI5_BeginLayer\n\ 1 1 1 1 0 0 0 79 128 255 Lb\n\ (Layer 1) Ln\n"); _update_buffer (page_header); } /* place header in the plOutbuf of page */ _plotter->data->page->header = page_header; } /* End of Page Header */ /* Beginning of Page Trailer */ { plOutbuf *page_trailer; page_trailer = _new_outbuf (); if (_plotter->ai_version >= AI_VERSION_5) /* after outputing objects, must end layer */ { sprintf (page_trailer->point, "\ LB\n\ %%AI5_EndLayer--\n"); _update_buffer (page_trailer); } sprintf (page_trailer->point, "\ %%%%PageTrailer\n\ gsave annotatepage grestore showpage\n"); _update_buffer (page_trailer); /* trailer: terminate procsets */ if (_plotter->ai_version == AI_VERSION_5) sprintf (page_trailer->point, "\ %%%%Trailer\n\ Adobe_Illustrator_AI5 /terminate get exec\n\ Adobe_ColorImage_AI6 /terminate get exec\n\ Adobe_typography_AI5 /terminate get exec\n\ Adobe_level2_AI5 /terminate get exec\n\ %%%%EOF\n"); else /* AI_VERSION_3 */ sprintf (page_trailer->point, "\ %%%%Trailer\n\ Adobe_Illustrator_AI3 /terminate get exec\n\ Adobe_pattern_AI3 /terminate get exec\n\ Adobe_typography_AI3 /terminate get exec\n\ Adobe_customcolor /terminate get exec\n\ Adobe_cshow /terminate get exec\n\ Adobe_cmykcolor /terminate get exec\n\ Adobe_packedarray /terminate get exec\n\ %%%%EOF\n"); _update_buffer (page_trailer); /* place header in the plOutbuf of the page */ _plotter->data->page->trailer = page_trailer; } /* End of Page Trailer */ return true; } plotutils-2.6/libplot/a_defplot.c0000644000175000017500000002340511037243260014111 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any AIPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of an AIPlotter struct. */ const Plotter _pl_a_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_a_initialize, _pl_a_terminate, /* page manipulation */ _pl_a_begin_page, _pl_a_erase_page, _pl_a_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_a_paint_path, _pl_a_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_a_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_a_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ /* For AI Plotter objects, we determine the page size and the location of the viewport on the page, so that we'll be able to work out the map from user coordinates to device coordinates in space.c. Also we determine which version of Illustrator file format we'll emit. */ void _pl_a_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_AI; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_ONE_PAGE; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 0; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 1; _plotter->data->have_pcl_fonts = 1; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_POSTSCRIPT; _plotter->data->pcl_before_ps = false; _plotter->data->issue_font_warning = true; _plotter->data->have_horizontal_justification = true; _plotter->data->have_vertical_justification = false; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = true; _plotter->data->allowed_arc_scaling = AS_NONE; _plotter->data->allowed_ellarc_scaling = AS_NONE; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_ANY; _plotter->data->allowed_box_scaling = AS_NONE; _plotter->data->allowed_circle_scaling = AS_NONE; _plotter->data->allowed_ellipse_scaling = AS_NONE; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_PHYSICAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_REAL; _plotter->data->flipped_y = false; _plotter->data->imin = 0; _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize data members specific to this derived class */ _plotter->ai_version = AI_VERSION_5; _plotter->ai_pen_cyan = 0.0; _plotter->ai_pen_magenta = 0.0; _plotter->ai_pen_yellow = 0.0; _plotter->ai_pen_black = 1.0; _plotter->ai_fill_cyan = 0.0; _plotter->ai_fill_magenta = 0.0; _plotter->ai_fill_yellow = 0.0; _plotter->ai_fill_black = 1.0; _plotter->ai_cyan_used = false; _plotter->ai_magenta_used = false; _plotter->ai_yellow_used = false; _plotter->ai_black_used = false; _plotter->ai_cap_style = AI_LINE_CAP_BUTT; _plotter->ai_join_style = AI_LINE_JOIN_MITER; /* Maximum value the cosecant of the half-angle between any two line segments can have, if the join is to be mitered rather than beveled. Default value for AI is 4.0. */ _plotter->ai_miter_limit = 4.0; _plotter->ai_line_type = PL_L_SOLID; _plotter->ai_line_width = 1.0; _plotter->ai_fill_rule_type = 0; /* i.e. nonzero winding number rule */ /* initialize certain data members from device driver parameters */ /* determine which version of AI format we'll emit (obsolescent) */ { const char *version_s; version_s = (const char *)_get_plot_param (_plotter->data, "AI_VERSION"); if (strcmp (version_s, "3") == 0) _plotter->ai_version = AI_VERSION_3; else if (strcmp (version_s, "5") == 0) _plotter->ai_version = AI_VERSION_5; else { version_s = (const char *)_get_default_plot_param ("AI_VERSION"); if (strcmp (version_s, "3") == 0) _plotter->ai_version = AI_VERSION_3; else if (strcmp (version_s, "5") == 0) _plotter->ai_version = AI_VERSION_5; } } /* AI didn't support even-odd fill until version 5 */ if (_plotter->ai_version == AI_VERSION_3) _plotter->data->have_odd_winding_fill = 0; /* Determine range of device coordinates over which the viewport will extend (and hence the transformation from user to device coordinates; see g_space.c). */ { /* determine page type, viewport size and location */ _set_page_type (_plotter->data); /* convert viewport size-and-location data (in terms of inches) to device coordinates (i.e. points) */ _plotter->data->xmin = 72 * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset); _plotter->data->xmax = 72 * (_plotter->data->viewport_xorigin + _plotter->data->viewport_xoffset + _plotter->data->viewport_xsize); _plotter->data->ymin = 72 * (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset); _plotter->data->ymax = 72 * (_plotter->data->viewport_yorigin + _plotter->data->viewport_yoffset + _plotter->data->viewport_ysize); } /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_a_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER AIPlotter::AIPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_a_initialize (); } AIPlotter::AIPlotter (FILE *outfile) :Plotter (outfile) { _pl_a_initialize (); } AIPlotter::AIPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_a_initialize (); } AIPlotter::AIPlotter (ostream& out) : Plotter (out) { _pl_a_initialize (); } AIPlotter::AIPlotter () { _pl_a_initialize (); } AIPlotter::AIPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_a_initialize (); } AIPlotter::AIPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_a_initialize (); } AIPlotter::AIPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_a_initialize (); } AIPlotter::AIPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_a_initialize (); } AIPlotter::AIPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_a_initialize (); } AIPlotter::~AIPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_a_terminate (); } #endif plotutils-2.6/libplot/a_erase.c0000644000175000017500000000402511037243260013550 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_a_erase_page (S___(Plotter *_plotter)) { int i; /* The following resetting code should duplicate what is done in begin_page(). */ /* reinitialize `font used' array for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; /* reset other AIPlotter variables, as if the page had just been opened */ _plotter->ai_pen_cyan = 0.0; _plotter->ai_pen_magenta = 0.0; _plotter->ai_pen_yellow = 0.0; _plotter->ai_pen_black = 1.0; _plotter->ai_fill_cyan = 0.0; _plotter->ai_fill_magenta = 0.0; _plotter->ai_fill_yellow = 0.0; _plotter->ai_fill_black = 1.0; _plotter->ai_cyan_used = false; _plotter->ai_magenta_used = false; _plotter->ai_yellow_used = false; _plotter->ai_black_used = false; _plotter->ai_cap_style = AI_LINE_CAP_BUTT; _plotter->ai_join_style = AI_LINE_JOIN_MITER; _plotter->ai_miter_limit = 4.0; /* default value for AI */ _plotter->ai_line_type = PL_L_SOLID; _plotter->ai_line_width = 1.0; _plotter->ai_fill_rule_type = 0; /* i.e. nonzero winding number rule */ return true; } plotutils-2.6/libplot/a_openpl.c0000644000175000017500000000431111037243260013744 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_a_begin_page (S___(Plotter *_plotter)) { int i; /* The following resetting code should duplicate what is done in erase_page(). */ /* initialize `font used' array for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; /* With each call to openpl(), we reset our knowledge of Illustrator's internal state, i.e. the dynamic AI-specific data members of the AIPlotter. The values are the same as are used in initializing the AIPlotter (see a_defplot.c). */ _plotter->ai_pen_cyan = 0.0; _plotter->ai_pen_magenta = 0.0; _plotter->ai_pen_yellow = 0.0; _plotter->ai_pen_black = 1.0; _plotter->ai_fill_cyan = 0.0; _plotter->ai_fill_magenta = 0.0; _plotter->ai_fill_yellow = 0.0; _plotter->ai_fill_black = 1.0; _plotter->ai_cyan_used = false; _plotter->ai_magenta_used = false; _plotter->ai_yellow_used = false; _plotter->ai_black_used = false; _plotter->ai_cap_style = AI_LINE_CAP_BUTT; _plotter->ai_join_style = AI_LINE_JOIN_MITER; _plotter->ai_miter_limit = 4.0; /* default value for AI */ _plotter->ai_line_type = PL_L_SOLID; _plotter->ai_line_width = 1.0; _plotter->ai_fill_rule_type = 0; /* i.e. nonzero winding number rule */ return true; } plotutils-2.6/libplot/a_path.c0000644000175000017500000002531011037243260013405 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This version is for AIPlotters. By construction, for AIPlotters our path storage buffer may include only a segment list: a list of line segments and/or cubic Bezier segments. No primitives such as ellipses, circles, and boxes are allowed: any such primitive, if drawn, is replaced by a segment list at a higher level. */ #include "sys-defines.h" #include "extern.h" /* Maximum value for squared sine of angle between two segments, if their juncture is to be a `smooth point' rather than a corner point. (In Illustrator, smooth points have only one direction handle; not two.) */ #define MAX_SQUARED_SINE (1e-6) void _pl_a_paint_path (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { int i, numpoints; bool closed; double linewidth; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /*shouldn't happen */ break; if ((_plotter->drawstate->path->num_segments >= 3)/*check for closure*/ && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.x == _plotter->drawstate->path->segments[0].p.x) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.y == _plotter->drawstate->path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ /* set fill color and pen color */ if (_plotter->drawstate->fill_type) /* will be filling the path */ _pl_a_set_fill_color (R___(_plotter) false); else /* won't be filling the path, but set AI's fill color anyway; in particular, to be the same as the pen color (this is a convenience for AI users who may wish e.g. to switch from stroking to filling) */ _pl_a_set_fill_color (R___(_plotter) true); _pl_a_set_pen_color (S___(_plotter)); /* update line attributes (cap style, join style, line width), if necessary */ _pl_a_set_attributes (S___(_plotter)); linewidth = _plotter->drawstate->line_width; numpoints = _plotter->drawstate->path->num_segments; /* loop over segments in path */ for (i = 0; i < numpoints; i++) { bool smooth_join_point; /* if a path join point, a smooth one? */ /* update bounding box to take into account the segment's terminal point (which is either a path join point or a path end point) */ if (!closed && (i == 0 || i == numpoints - 1)) /* for the path, an end rather than a join */ { double xcurrent, ycurrent, xother, yother; smooth_join_point = false; /* compute path end point, and a nearby point, the vector to which will determine the shape of the path end */ xcurrent = _plotter->drawstate->path->segments[i].p.x; ycurrent = _plotter->drawstate->path->segments[i].p.y; if (i == 0) /* i = 0, initial end point */ { if (_plotter->drawstate->path->segments[i+1].type == S_CUBIC) { xother = _plotter->drawstate->path->segments[i+1].pc.x; yother = _plotter->drawstate->path->segments[i+1].pc.y; } else /* line segment */ { xother = _plotter->drawstate->path->segments[i+1].p.x; yother = _plotter->drawstate->path->segments[i+1].p.y; } } else /* i = numpoints - 1, final end point */ { if (_plotter->drawstate->path->segments[i].type == S_CUBIC) { xother = _plotter->drawstate->path->segments[i].pd.x; yother = _plotter->drawstate->path->segments[i].pd.y; } else /* line segment */ { xother = _plotter->drawstate->path->segments[i-1].p.x; yother = _plotter->drawstate->path->segments[i-1].p.y; } } /* take path end into account: update bounding box */ _set_line_end_bbox (_plotter->data->page, xcurrent, ycurrent, xother, yother, linewidth, _plotter->drawstate->cap_type, _plotter->drawstate->transform.m); } else /* for the path, a join rather than an end */ { int a, b, c; double xcurrent, ycurrent, xleft, yleft, xright, yright; if (closed && (i == 0 || i == numpoints - 1)) /* wrap */ { a = numpoints - 2; b = numpoints - 1; c = 1; } else /* normal join */ { a = i - 1; b = i; c = i + 1; } xcurrent = _plotter->drawstate->path->segments[b].p.x; ycurrent = _plotter->drawstate->path->segments[b].p.y; /* compute points to left and right, vectors to which will determine the shape of the path join */ switch ((int)_plotter->drawstate->path->segments[b].type) { case (int)S_LINE: default: xleft = _plotter->drawstate->path->segments[a].p.x; yleft = _plotter->drawstate->path->segments[a].p.y; break; case (int)S_CUBIC: xleft = _plotter->drawstate->path->segments[b].pd.x; yleft = _plotter->drawstate->path->segments[b].pd.y; break; } switch ((int)_plotter->drawstate->path->segments[c].type) { case (int)S_LINE: default: xright = _plotter->drawstate->path->segments[c].p.x; yright = _plotter->drawstate->path->segments[c].p.y; break; case (int)S_CUBIC: xright = _plotter->drawstate->path->segments[c].pc.x; yright = _plotter->drawstate->path->segments[c].pc.y; break; } /* take path join into account: update bounding box */ _set_line_join_bbox(_plotter->data->page, xleft, yleft, xcurrent, ycurrent, xright, yright, linewidth, _plotter->drawstate->join_type, _plotter->drawstate->miter_limit, _plotter->drawstate->transform.m); /* is join smooth? */ { double ux, uy, vx, vy, cross, dot, uselfdot, vselfdot; ux = xleft - xcurrent; uy = yleft - ycurrent; vx = xright - xcurrent; vy = yright - ycurrent; cross = ux * vy - uy * vx; dot = ux * vx + uy * vy; uselfdot = ux * ux + uy * uy; vselfdot = vx * vx + vy * vy; if (cross * cross < MAX_SQUARED_SINE * uselfdot * vselfdot && dot < 0.0) smooth_join_point = true; else smooth_join_point = false; } } /* output to Illustrator the points that define this segment */ if (i != 0 && (_plotter->drawstate->path->segments)[i].type == S_CUBIC) /* cubic Bezier segment, so output control points */ { sprintf (_plotter->data->page->point, "%.4f %.4f %.4f %.4f ", XD(_plotter->drawstate->path->segments[i].pc.x, _plotter->drawstate->path->segments[i].pc.y), YD(_plotter->drawstate->path->segments[i].pc.x, _plotter->drawstate->path->segments[i].pc.y), XD(_plotter->drawstate->path->segments[i].pd.x, _plotter->drawstate->path->segments[i].pd.y), YD(_plotter->drawstate->path->segments[i].pd.x, _plotter->drawstate->path->segments[i].pd.y)); _update_buffer (_plotter->data->page); /* update bounding box due to extremal x/y values in device frame */ _set_bezier3_bbox (_plotter->data->page, _plotter->drawstate->path->segments[i-1].p.x, _plotter->drawstate->path->segments[i-1].p.y, _plotter->drawstate->path->segments[i].pc.x, _plotter->drawstate->path->segments[i].pc.y, _plotter->drawstate->path->segments[i].pd.x, _plotter->drawstate->path->segments[i].pd.y, _plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y, _plotter->drawstate->device_line_width, _plotter->drawstate->transform.m); } /* output terminal point of segment */ sprintf (_plotter->data->page->point, "%.4f %.4f ", XD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y), YD(_plotter->drawstate->path->segments[i].p.x, _plotter->drawstate->path->segments[i].p.y)); _update_buffer (_plotter->data->page); /* tell Illustrator what sort of path segment this is */ if (i == 0) /* start of path, so just move to point */ sprintf (_plotter->data->page->point, "m\n"); else /* append line segment or Bezier segment to path */ switch ((int)_plotter->drawstate->path->segments[i].type) { case (int)S_LINE: default: sprintf (_plotter->data->page->point, smooth_join_point ? "l\n" : "L\n"); break; case (int)S_CUBIC: sprintf (_plotter->data->page->point, smooth_join_point ? "c\n" : "C\n"); break; } _update_buffer (_plotter->data->page); } /* end of loop over segments */ if (_plotter->drawstate->pen_type) /* have a pen to draw with */ { /* emit `closepath' if path is closed; stroke and maybe fill */ if (_plotter->drawstate->fill_type) { if (closed) /* close path, fill and stroke */ sprintf (_plotter->data->page->point, "b\n"); else /* fill and stroke */ sprintf (_plotter->data->page->point, "B\n"); } else { if (closed) /* close path, stroke */ sprintf (_plotter->data->page->point, "s\n"); else /* stroke */ sprintf (_plotter->data->page->point, "S\n"); } } else /* no pen to draw with, but we may do filling */ { /* emit `closepath' if path is closed; don't stroke */ if (_plotter->drawstate->fill_type) { if (closed) /* close path, fill */ sprintf (_plotter->data->page->point, "f\n"); else /* fill */ sprintf (_plotter->data->page->point, "F\n"); } } _update_buffer (_plotter->data->page); } break; default: /* shouldn't happen */ break; } } bool _pl_a_paint_paths (S___(Plotter *_plotter)) { return false; } plotutils-2.6/libplot/a_point.c0000644000175000017500000000343611037243260013607 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ /* In the AIPlotter class, a `point' is displayed as a small filled circle (one of libplot's standard marker symbols). */ #include "sys-defines.h" #include "extern.h" void _pl_a_paint_point (S___(Plotter *_plotter)) { double norm; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* compute size of a `point' in user coordinates */ norm = _matrix_norm (_plotter->drawstate->transform.m); if (norm != 0.0) { double user_size; user_size = AI_SIZE_OF_POINT / _matrix_norm (_plotter->drawstate->transform.m); _plotter->paint_marker (R___(_plotter) (int)M_FILLED_CIRCLE, user_size); } } } plotutils-2.6/libplot/a_text.c0000644000175000017500000002753011037243260013443 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the AI-driver-specific version of the low-level paint_text_string() method, which is called to plot a label in the current font (either PS or PCL), at the current fontsize and textangle. The label is just a string: no control codes (font switching or sub/superscripts). The width of the string in user units is returned. */ #include "sys-defines.h" #include "extern.h" #define GOOD_PRINTABLE_ASCII(c) ((c >= 0x20) && (c <= 0x7E)) /* This prints a single-font, single-font-size label. When this is called, the current point is on the intended baseline of the label. */ /* ARGS: h_just = horiz justification, PL_JUST_LEFT, CENTER, or RIGHT v_just = vert justificattion, PL_JUST_TOP, BASE, or BOTTOM */ double _pl_a_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { int i, master_font_index; int justify_code; double width; unsigned char *ptr; double theta, costheta, sintheta; double norm; double dx0,dy0,dx1,dy1,dx2,dy2,dx3,dy3; double font_ascent, font_descent, up, down; double user_font_size = _plotter->drawstate->true_font_size; double device_font_size; double user_text_transformation_matrix[6]; double text_transformation_matrix[6]; double lshift; bool pcl_font; /* sanity check; this routine supports only baseline positioning */ if (v_just != PL_JUST_BASE) return 0.0; /* if empty string, nothing to do */ if (*s == (unsigned char)'\0') return 0.0; /* sanity check */ if (_plotter->drawstate->font_type != PL_F_POSTSCRIPT && _plotter->drawstate->font_type != PL_F_PCL) return 0.0; pcl_font = (_plotter->drawstate->font_type == PL_F_PCL ? true : false); /* compute index of font in master table of PS [or PCL] fonts, in g_fontdb.c */ if (pcl_font) /* one of the 45 standard PCL fonts */ master_font_index = (_pl_g_pcl_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; else /* one of the 35 standard PS fonts */ master_font_index = (_pl_g_ps_typeface_info[_plotter->drawstate->typeface_index].fonts)[_plotter->drawstate->font_index]; /* font ascent and descent (taken from the font's bounding box) */ if (pcl_font) { font_ascent = (double)((_pl_g_pcl_font_info[master_font_index]).font_ascent); font_descent = (double)((_pl_g_pcl_font_info[master_font_index]).font_descent); } else /* PS font */ { font_ascent = (double)((_pl_g_ps_font_info[master_font_index]).font_ascent); font_descent = (double)((_pl_g_ps_font_info[master_font_index]).font_descent); } up = user_font_size * font_ascent / 1000.0; down = user_font_size * font_descent / 1000.0; /* label rotation angle in radians, in user frame */ theta = M_PI * _plotter->drawstate->text_rotation / 180.0; sintheta = sin (theta); costheta = cos (theta); /* this transformation matrix rotates, and translates; it maps (0,0) to the origin of the string, in user coordinates */ user_text_transformation_matrix[0] = costheta; user_text_transformation_matrix[1] = sintheta; user_text_transformation_matrix[2] = - sintheta; user_text_transformation_matrix[3] = costheta; user_text_transformation_matrix[4] = _plotter->drawstate->pos.x; user_text_transformation_matrix[5] = _plotter->drawstate->pos.y; /* Construct a temporary matrix that rotates, translates, and then maps to device coordinates. This matrix transforms from a frame in which nominal character sizes are roughly 1 unit in the horizontal and vertical directions, to device coordinates. */ _matrix_product (user_text_transformation_matrix, _plotter->drawstate->transform.m, text_transformation_matrix); /* We need to extract a quantity we can call a font size in device coordinates, for the benefit of AI. (AI needs to retrieve a font, and transform it.) We define this to be user_font_size (the nominal font size in user coordinates), times the norm of the linear tranformation contained in the temporary matrix we just constructed (the magnitude of its larger singular value). Recall that for any square matrix M, the singular values are the square roots of the eigenvalues of the symmetric matrix M^t M. */ norm = _matrix_norm (text_transformation_matrix); if (norm == 0.0) /* avoid division by zero */ return 0.0; device_font_size = norm * user_font_size; /* Now scale the text transformation matrix so that the linear transformation contained in it has unit norm (if there is no shearing, it will just be a rotation; if there is no rotation either, it will be the identity matrix). */ for (i = 0; i < 4; i++) text_transformation_matrix[i] /= norm; /* AI directive: begin `point text' object */ strcpy (_plotter->data->page->point, "0 To\n"); _update_buffer (_plotter->data->page); /* output text transformation matrix */ for (i = 0; i < 6; i++) { sprintf (_plotter->data->page->point, "%.4f ", text_transformation_matrix[i]); _update_buffer (_plotter->data->page); } strcpy (_plotter->data->page->point, "0 Tp\nTP\n"); _update_buffer (_plotter->data->page); /* set render mode: fill text, rather than several other possibilities */ strcpy (_plotter->data->page->point, "0 Tr\n"); _update_buffer (_plotter->data->page); /* set AI's fill color to be the same as libplot's notion of pen color (since letters in label will be drawn as filled outlines) */ _pl_a_set_fill_color (R___(_plotter) true); /* set AI's pen color also, in particular set it to be the same as libplot's notion of pen color (even though we'll be filling, not stroking); this is a convenience for AI users who may wish e.g. to switch from filling letter outlines to stroking them */ _pl_a_set_pen_color (S___(_plotter)); /* emit AI directive */ /* AI directive: set font name and size */ { const char *ps_name; if (pcl_font) /* one of the 45 PCL fonts */ ps_name = _pl_g_pcl_font_info[master_font_index].ps_name; else /* one of the 35 PS fonts */ ps_name = _pl_g_ps_font_info[master_font_index].ps_name; /* specify font name (underscore indicates reencoding), font size */ sprintf (_plotter->data->page->point, "/_%s %.4f Tf\n", ps_name, device_font_size); _update_buffer (_plotter->data->page); } /* set line horizontal expansion factor, in percent */ strcpy (_plotter->data->page->point, "100 Tz\n"); _update_buffer (_plotter->data->page); /* NO track kerning, please */ strcpy (_plotter->data->page->point, "0 Tt\n"); _update_buffer (_plotter->data->page); /* turn off pairwise kerning (currently, a libplot convention) */ strcpy (_plotter->data->page->point, "0 TA\n"); _update_buffer (_plotter->data->page); /* turn off ALL inter-character spacing */ strcpy (_plotter->data->page->point, "0 0 0 TC\n"); _update_buffer (_plotter->data->page); /* use the default inter-word spacing; no more, no less */ strcpy (_plotter->data->page->point, "100 100 100 TW\n"); _update_buffer (_plotter->data->page); /* no indentation at beginning of `paragraphs' */ strcpy (_plotter->data->page->point, "0 0 0 Ti\n"); _update_buffer (_plotter->data->page); /* specify justification */ switch (h_just) { case PL_JUST_LEFT: default: justify_code = 0; break; case PL_JUST_CENTER: justify_code = 1; break; case PL_JUST_RIGHT: justify_code = 2; break; } sprintf (_plotter->data->page->point, "%d Ta\n", justify_code); _update_buffer (_plotter->data->page); /* no hanging quotation marks */ strcpy (_plotter->data->page->point, "0 Tq\n"); _update_buffer (_plotter->data->page); /* no leading between lines of a paragraph or between paragraphs */ strcpy (_plotter->data->page->point, "0 0 Tl\n"); _update_buffer (_plotter->data->page); /* compute width of the substring in user units (used below in constructing a bounding box) */ width = _plotter->get_text_width (R___(_plotter) s); /* for computing bounding box, compute justification-dependent leftward shift, as fraction of label width */ switch (h_just) { case PL_JUST_LEFT: default: lshift = 0.0; break; case PL_JUST_CENTER: lshift = 0.5; break; case PL_JUST_RIGHT: lshift = 1.0; break; } /* to compute an EPS-style bounding box, first compute offsets to the four vertices of the smallest rectangle containing the string */ dx0 = costheta * (- lshift) * width - sintheta * (-down); dy0 = sintheta * (- lshift) * width + costheta * (-down); dx1 = costheta * (- lshift) * width - sintheta * up; dy1 = sintheta * (- lshift) * width + costheta * up; dx2 = costheta * (1.0 - lshift) * width - sintheta * (-down); dy2 = sintheta * (1.0 - lshift) * width + costheta * (-down); dx3 = costheta * (1.0 - lshift) * width - sintheta * up; dy3 = sintheta * (1.0 - lshift) * width + costheta * up; /* record that we're using all four vertices (args of _update_bbox() are in device units, not user units) */ _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx0, (_plotter->drawstate->pos).y + dy0), YD ((_plotter->drawstate->pos).x + dx0, (_plotter->drawstate->pos).y + dy0)); _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx1, (_plotter->drawstate->pos).y + dy1), YD ((_plotter->drawstate->pos).x + dx1, (_plotter->drawstate->pos).y + dy1)); _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx2, (_plotter->drawstate->pos).y + dy2), YD ((_plotter->drawstate->pos).x + dx2, (_plotter->drawstate->pos).y + dy2)); _update_bbox (_plotter->data->page, XD ((_plotter->drawstate->pos).x + dx3, (_plotter->drawstate->pos).y + dy3), YD ((_plotter->drawstate->pos).x + dx3, (_plotter->drawstate->pos).y + dy3)); /* output string as a PS string (i.e. surrounded by parentheses) */ ptr = (unsigned char *)_plotter->data->page->point; *ptr++ = '('; while (*s) { switch (*s) { case '(': /* for PS, escape ()/ */ case ')': case '\\': *ptr++ = (unsigned char)'\\'; *ptr++ = *s++; break; default: if GOOD_PRINTABLE_ASCII (*s) *ptr++ = *s++; else { sprintf ((char *)ptr, "\\%03o", (unsigned int)*s); ptr += 4; s++; } break; } } *ptr++ = ')'; *ptr = (unsigned char)'\0'; _update_buffer (_plotter->data->page); /* AI directive: this is the text to be rendered */ strcpy (_plotter->data->page->point, " Tx\n"); _update_buffer (_plotter->data->page); /* AI directive: end of text object */ strcpy (_plotter->data->page->point, "TO\n"); _update_buffer (_plotter->data->page); /* flag current PS or PCL font as used */ if (pcl_font) _plotter->data->page->pcl_font_used[master_font_index] = true; else _plotter->data->page->ps_font_used[master_font_index] = true; return width; } plotutils-2.6/libplot/s_closepl.c0000644000175000017500000003710711037671306014151 00000000000000/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* forward references */ static void write_svg_transform (plOutbuf *outbuf, const double m[6]); bool _pl_s_end_page (S___(Plotter *_plotter)) { plOutbuf *svg_header, *svg_trailer; /* SVG files contain only one page of graphics so this is a sanity check */ if (_plotter->data->page_number != 1) return true; /* prepare SVG header (i.e. page header), write it to a plOutbuf */ svg_header = _new_outbuf (); /* start with DTD */ sprintf (svg_header->point, "\ \n\ \n"); _update_buffer (svg_header); /* Emit nominal physical size of the device-frame viewport (and specify that in the device-frame coordinates we use, it's a unit square). viewport_{x,y}size are set from the PAGESIZE Plotter parameter, via the xsize and ysize options, and either or both may be negative. If they are, we flipped the NDC_frame->device_frame map to compensate (see s_defplot.c). Which is why we can take absolute values here. */ if (_plotter->data->page_data->metric) sprintf (svg_header->point, "data->viewport_xsize), 2.54 * FABS(_plotter->data->viewport_ysize)); else sprintf (svg_header->point, "data->viewport_xsize), FABS(_plotter->data->viewport_ysize)); _update_buffer (svg_header); sprintf (svg_header->point, "%s %s %s %s %s>\n", "viewBox=\"0 0 1 1\"", "preserveAspectRatio=\"none\"", /* bind SVG namespace */ "xmlns=\"http://www.w3.org/2000/svg\"", /* bind XLink and XML Events namespaces for good measure */ "xmlns:xlink=\"http://www.w3.org/1999/xlink\"", "xmlns:ev=\"http://www.w3.org/2001/xml-events\""); _update_buffer (svg_header); sprintf (svg_header->point, "SVG drawing\n"); _update_buffer (svg_header); sprintf (svg_header->point, "This was produced by version %s of GNU libplot, a free library for exporting 2-D vector graphics.\n", PL_LIBPLOT_VER_STRING); _update_buffer (svg_header); if (_plotter->s_bgcolor_suppressed == false) /* place a background rectangle behind, covering entire viewport */ { char color_buf[8]; /* enough room for "#ffffff", incl. NUL */ sprintf (svg_header->point, "\n", _libplot_color_to_svg_color (_plotter->s_bgcolor, color_buf)); _update_buffer (svg_header); } /* enclose everything else in a container */ sprintf (svg_header->point, "s_matrix_is_unknown == false && _plotter->s_matrix_is_bogus == false) /* Place a transform in the container: this page's default transformation matrix, which is simply the transformation matrix attribute of the very first graphical object plotted on the page. In libplot, `transformation matrix attribute' refers to the affine map from user space to NDC space. So we're careful to multiply by `m_ndc_to_device', which transforms NDC space to device space. Because SVG uses a flipped-y convention, `m_ndc_to_device' flips the y coordinate. (There will be additional flipping if the user-specified xsize, ysize are negative; see s_defplot.c. Also, if the ROTATION Plotter parameter is specified by the user, it may rotate.) */ { double product[6]; _matrix_product (_plotter->s_matrix, _plotter->data->m_ndc_to_device, product); write_svg_transform (svg_header, product); } /* turn off SVG's default [unfortunate] XML-inherited treatment of spaces */ sprintf (svg_header->point, "xml:space=\"preserve\" "); _update_buffer (svg_header); /* specify style properties (all libplot defaults) */ sprintf (svg_header->point, "stroke=\"%s\" ", "black"); _update_buffer (svg_header); sprintf (svg_header->point, "stroke-linecap=\"%s\" ", "butt"); _update_buffer (svg_header); sprintf (svg_header->point, "stroke-linejoin=\"%s\" ", "miter"); _update_buffer (svg_header); sprintf (svg_header->point, "stroke-miterlimit=\"%.5g\" ", PL_DEFAULT_MITER_LIMIT); _update_buffer (svg_header); sprintf (svg_header->point, "stroke-dasharray=\"%s\" ", "none"); _update_buffer (svg_header); /* should use `px' here to specify user units, per the SVG Authoring Guide, but ImageMagick objects to that */ sprintf (svg_header->point, "stroke-dashoffset=\"%.5g\" ", 0.0); _update_buffer (svg_header); sprintf (svg_header->point, "stroke-opacity=\"%.5g\" ", 1.0); _update_buffer (svg_header); sprintf (svg_header->point, "fill=\"%s\" ", "none"); _update_buffer (svg_header); sprintf (svg_header->point, "fill-rule=\"%s\" ", "evenodd"); _update_buffer (svg_header); sprintf (svg_header->point, "fill-opacity=\"%.5g\" ", 1.0); _update_buffer (svg_header); sprintf (svg_header->point, "font-style=\"%s\" ", "normal"); _update_buffer (svg_header); sprintf (svg_header->point, "font-variant=\"%s\" ", "normal"); _update_buffer (svg_header); sprintf (svg_header->point, "font-weight=\"%s\" ", "normal"); _update_buffer (svg_header); sprintf (svg_header->point, "font-stretch=\"%s\" ", "normal"); _update_buffer (svg_header); sprintf (svg_header->point, "font-size-adjust=\"%s\" ", "none"); _update_buffer (svg_header); sprintf (svg_header->point, "letter-spacing=\"%s\" ", "normal"); _update_buffer (svg_header); sprintf (svg_header->point, "word-spacing=\"%s\" ", "normal"); _update_buffer (svg_header); sprintf (svg_header->point, "text-anchor=\"%s\"", "start"); _update_buffer (svg_header); sprintf (svg_header->point, ">\n"); _update_buffer (svg_header); /* place SVG header in this page's plOutbuf */ _plotter->data->page->header = svg_header; /* prepare SVG trailer too, write it to a plOutbuf */ svg_trailer = _new_outbuf (); sprintf (svg_trailer->point, "\n"); _update_buffer (svg_trailer); sprintf (svg_trailer->point, "\n"); _update_buffer (svg_trailer); /* place SVG trailer in this page's plOutbuf */ _plotter->data->page->trailer = svg_trailer; return true; } /* This function is invoked while writing any graphical object on a page to the page's output buffer. It emits the string "transform=\"...\" ", where the "\"...\"" is computed from a transformation matrix attribute of the object, which is passed. I.e., it transforms a per-object transformation matrix to an SVG-style transformation matrix, and emits the latter as an SVG element attribute. The per-object transformation matrix is always the identity, except for rotated text strings and ellipses. This code evaluates the SVG transformation matrix as the composition of two transformations: the local transformation, which acts first (in user space), which is passed as an argument; and a 2nd transformation, which is the current transformation from user to NDC coordinates. Typically, it's the 1st which this code emits as the value of the `transform' attribute. That's because when this is called for the first time on a page (or newly erased page), the 2nd is stored in `s_matrix', the global transformation matrix for the page, which will later be written at the head of the SVG code for the page when closepl() is invoked (see above). This separation of the two distinct transformations will of course work only if the 2nd doesn't change from object to object on the page. For this reason, what's actually emitted as the value of the SVG transform attribute is a composite transformation, made up in succession of (1) the passed per-object transformation (2) the current value of the transformation from user to NDC coordinates (3) the inverse of s_matrix. If the user space -> NDC space map is the same for all objects on the page, then (2) and (3) will cancel each other out for all objects on the page. Note that in this code we flag `s_matrix' as bogus if it's singular. If it's bogus, it won't be written out when closepl() is invoked, and the global transformation matrix of the page will effectively be the identity (i.e., we'll punt). */ void _pl_s_set_matrix (R___(Plotter *_plotter) const double m_local[6]) { double m_base[6], m[6]; const double *m_emitted = (const double *)NULL; /* keep compiler happy */ bool need_transform_attribute = false; int i; for (i = 0; i < 6; i++) m_base[i] = _plotter->drawstate->transform.m_user_to_ndc[i]; /* if this is the first time this function is invoked on a page (or newly erased page), store the current user-to-NDC matrix for later use as the global transformation matrix for the page */ if (_plotter->s_matrix_is_unknown) { for (i = 0; i < 6; i++) _plotter->s_matrix[i] = m_base[i]; _plotter->s_matrix_is_unknown = false; if (m_base[0] * m_base[3] - m_base[1] * m_base[2] == 0.0) /* singular, won't be used even though stored */ _plotter->s_matrix_is_bogus = true; } /* compute product: current transformation matrix (in the transformation from user to NDC coors, local acts first, then base) */ _matrix_product (m_local, m_base, m); /* determine whether current matrix is different from the global one that will be wrapped around the entire page (if there is one) */ if (_plotter->s_matrix_is_bogus == false) /* have a global page-specific transformation matrix that will be applied, so object's transform attribute may need to compensate */ { for (i = 0; i < 6; i++) { if (m[i] != _plotter->s_matrix[i]) /* different, so need to compensate */ { need_transform_attribute = true; break; } } if (need_transform_attribute) { double inverse_of_global[6], product[6]; _matrix_inverse (_plotter->s_matrix, inverse_of_global); /* emitted transform attribute of object will be a product of three matrices: (1) the passed matrix, (2) the current user-to-NDC transformation matrix, and (3) the inverse of the global transformation matrix */ _matrix_product (m, inverse_of_global, product); m_emitted = product; } } else /* no global transformation matrix for this page (no doubt because of the abovementioned non-invertibility problem), so object's transform attribute will simply be the current matrix */ { need_transform_attribute = true; m_emitted = m; } /* emit object's transform attribute if it's not the identity */ if (need_transform_attribute) write_svg_transform (_plotter->data->page, m_emitted); } /* Internal function for writing out a PS-style affine transformation as a SVG-style affine transformation. If matrix is the identity, nothing is written. In SVG format, the value of the `transform' attribute is a sequence of transformations such as `rotate', `scale', and `translate', where the sequence (as a composite transformation from user space to device [NDC] space) is read from right to left. This is the opposite of the PS convention. SVG documentation uses column vectors, while PS documentation uses row vectors. Presumably the SVG convention arose from a desire to make the `nestedness' of the transform attribute, implemented as the computation of a composite transformation, more intuitive. */ static void write_svg_transform (plOutbuf *outbuf, const double m[6]) { double mm[6]; double max_value = 0.0; int i; int type = 0; /* default */ /* compensate for possible roundoff error: treat very small elements of linear transformation (if any) as zero */ #define VERY_SMALL_FACTOR 1e-10 for (i = 0; i < 4; i++) max_value = DMAX(max_value, FABS(m[i])); for (i = 0; i < 6; i++) if (i < 4 && FABS(m[i]) < VERY_SMALL_FACTOR * max_value) mm[i] = 0; else mm[i] = m[i]; if (mm[0] == 1.0 && mm[1] == 0.0 && mm[2] == 0.0 && mm[3] == 1.0 && mm[4] == 0.0 && mm[5] == 0.0) /* identity matrix, unnecessary to write it */ return; /* treat several types of affine transformation specially */ if (mm[1] == 0.0 && mm[2] == 0.0) type = 1; /* scale + translation */ else if (mm[0] == 0.0 && mm[1] == 1.0 && mm[2] == -1.0 && mm[3] == 0.0) type = 2; /* rotation by 90 + translation */ else if (mm[0] == 0.0 && mm[1] == -1.0 && mm[2] == 1.0 && mm[3] == 0.0) type = 3; /* rotation by 270 + translation */ else if (mm[0] == 0.0 && mm[1] == 1.0 && mm[2] == 1.0 && mm[3] == 0.0) type = 4; /* y-flip + rotation by 90 + translation */ else if (mm[0] == 0.0 && mm[1] == -1.0 && mm[2] == -1.0 && mm[3] == 0.0) type = 5; /* y-flip + rotation by 270 + translation */ sprintf (outbuf->point, "transform=\""); _update_buffer (outbuf); if (type != 0) { /* emit translation if any (SVG will perform it last, since SVG uses opposite order from PS for multiplying matrices) */ if (mm[4] != 0.0 || mm[5] != 0.0) { if (mm[5] == 0.0) sprintf (outbuf->point, "translate(%.5g) ", mm[4]); else sprintf (outbuf->point, "translate(%.5g,%.5g) ", mm[4], mm[5]); _update_buffer (outbuf); } switch (type) { case 1: if (mm[0] != 1.0 || mm[3] != 1.0) { if (mm[3] == mm[0]) sprintf (outbuf->point, "scale(%.5g) ", mm[0]); else if (mm[3] == -mm[0]) { if (mm[0] != 1.0) sprintf (outbuf->point, "scale(1,-1) scale(%.5g) ", mm[0]); else sprintf (outbuf->point, "scale(1,-1) "); } else sprintf (outbuf->point, "scale(%.5g,%.5g) ", mm[0], mm[3]); _update_buffer (outbuf); } break; case 2: sprintf (outbuf->point, "rotate(90) "); _update_buffer (outbuf); break; case 3: sprintf (outbuf->point, "rotate(270) "); _update_buffer (outbuf); break; case 4: sprintf (outbuf->point, "rotate(90) scale(1,-1) "); _update_buffer (outbuf); break; case 5: sprintf (outbuf->point, "rotate(270) scale(1,-1) "); _update_buffer (outbuf); break; default: /* shouldn't happen */ break; } } else /* general affine transformation */ { sprintf (outbuf->point, "matrix(%.5g %.5g %.5g %.5g %.5g %.5g) ", mm[0], mm[1], mm[2], mm[3], mm[4], mm[5]); _update_buffer (outbuf); } sprintf (outbuf->point, "\" "); _update_buffer (outbuf); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/s_color.c���������������������������������������������������������������������0000644�0001750�0001750�00000004746�11037243261�013624� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #define NUM_SVG_COLORNAMES 16 static const plColorNameInfo _svg_colornames[NUM_SVG_COLORNAMES + 1] = { {"aqua", 0x00, 0xff, 0xff}, {"black", 0x00, 0x00, 0x00}, {"blue", 0x00, 0x00, 0xff}, {"fuchsia", 0xff, 0x00, 0xff}, {"gray", 0x80, 0x80, 0x80}, {"green", 0x00, 0x80, 0x00}, {"lime", 0x00, 0xff, 0x00}, {"maroon", 0x80, 0x00, 0x00}, {"navy", 0x00, 0x00, 0x80}, {"olive", 0x80, 0x80, 0x00}, {"purple", 0x80, 0x00, 0x80}, {"red", 0xff, 0x00, 0x00}, {"silver", 0xc0, 0xc0, 0xc0}, {"teal", 0x00, 0x80, 0x80}, {"white", 0xff, 0xff, 0xff}, {"yellow", 0xff, 0xff, 0x00}, {NULL, 0, 0, 0} }; /* convert a 48-bit libplot color to a string resembling "#ffffff" for SVG; may also return a string in our database of SVG's builtin colors */ const char * _libplot_color_to_svg_color (plColor color_48, char charbuf[8]) { plColor color_24; int i; bool found = false; const char *svg_color; color_24.red = ((unsigned int)color_48.red) >> 8; color_24.green = ((unsigned int)color_48.green) >> 8; color_24.blue = ((unsigned int)color_48.blue) >> 8; for (i = 0; i < NUM_SVG_COLORNAMES; i++) { if (color_24.red == _svg_colornames[i].red && color_24.green == _svg_colornames[i].green && color_24.blue == _svg_colornames[i].blue) { found = true; break; } } if (found) svg_color = _svg_colornames[i].name; else { sprintf (charbuf, "#%02x%02x%02x", color_24.red, color_24.green, color_24.blue); svg_color = charbuf; } return svg_color; } ��������������������������plotutils-2.6/libplot/s_defplot.c�������������������������������������������������������������������0000644�0001750�0001750�00000021413�11234715041�014130� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any SVGPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a SVGPlotter struct. */ const Plotter _pl_s_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_s_initialize, _pl_s_terminate, /* page manipulation */ _pl_s_begin_page, _pl_s_erase_page, _pl_s_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_s_paint_path, _pl_s_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_s_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_s_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_s_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override generic initializations (which are appropriate to the base Plotter class), as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_SVG; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_ONE_PAGE; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 1; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 1; _plotter->data->have_pcl_fonts = 1; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_POSTSCRIPT; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_ANY; _plotter->data->allowed_ellarc_scaling = AS_ANY; _plotter->data->allowed_quad_scaling = AS_ANY; _plotter->data->allowed_cubic_scaling = AS_ANY; _plotter->data->allowed_box_scaling = AS_ANY; _plotter->data->allowed_circle_scaling = AS_ANY; _plotter->data->allowed_ellipse_scaling = AS_ANY; /* color-related parameters (also internal) */ _plotter->data->emulate_color = false; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_REAL; _plotter->data->flipped_y = true; _plotter->data->imin = 0; /* not used */ _plotter->data->imax = 0; _plotter->data->jmin = 0; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 1.0; _plotter->data->ymin = 1.0; /* note flipped y coordinate */ _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize data members specific to this derived class */ _plotter->s_matrix[0] = 1.0;/* dummy matrix values */ _plotter->s_matrix[1] = 0.0; _plotter->s_matrix[2] = 0.0; _plotter->s_matrix[3] = 1.0; _plotter->s_matrix[4] = 0.0; _plotter->s_matrix[5] = 0.0; _plotter->s_matrix_is_unknown = true; _plotter->s_matrix_is_bogus = false; _plotter->s_bgcolor.red = -1; /* initialized in s_begin_page */ _plotter->s_bgcolor.green = -1; _plotter->s_bgcolor.blue = -1; _plotter->s_bgcolor_suppressed = false; /* Note: xmin,xmax,ymin,ymax determine the range of device coordinates over which the viewport will extend (and hence the transformation from user to device coordinates; see g_space.c). For an SVG Plotter, `device coordinates' are usually almost the same as libplot's NDC coordinates, on account of the way we wrap a global transformation matrix around all graphics in the output file; see s_closepl.c. However, SVG uses a flipped-y convention: ymin,ymax are 1 and 0 respectively (see above). Actually, if the user specifies a negative xsize or ysize as part of the PAGESIZE parameter, we perform an additional flipping, so we can emit nonnegative width and height attributes for the top-level SVG element. We do this additional flipping right now. */ /* determine page type, and viewport size and location/offset (the viewport size, i.e., (xsize,ysize), will be written out at the head of the SVG file, and the location/offset, i.e., (xorigin,yorigin) and (xoffset,yoffset), will be ignored) */ _set_page_type (_plotter->data); if (_plotter->data->viewport_xsize < 0.0) /* flip map from user to NDC space */ { _plotter->data->xmin = 1.0; _plotter->data->xmax = 0.0; } if (_plotter->data->viewport_ysize < 0.0) /* flip map from user to NDC space */ { _plotter->data->ymin = 0.0; _plotter->data->ymax = 1.0; } /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_s_terminate (S___(Plotter *_plotter)) { } #ifdef LIBPLOTTER SVGPlotter::SVGPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_s_initialize (); } SVGPlotter::SVGPlotter (FILE *outfile) :Plotter (outfile) { _pl_s_initialize (); } SVGPlotter::SVGPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_s_initialize (); } SVGPlotter::SVGPlotter (ostream& out) : Plotter (out) { _pl_s_initialize (); } SVGPlotter::SVGPlotter () { _pl_s_initialize (); } SVGPlotter::SVGPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_s_initialize (); } SVGPlotter::SVGPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_s_initialize (); } SVGPlotter::SVGPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_s_initialize (); } SVGPlotter::SVGPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_s_initialize (); } SVGPlotter::SVGPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_s_initialize (); } SVGPlotter::~SVGPlotter () { _pl_s_terminate (); } #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/s_erase.c���������������������������������������������������������������������0000644�0001750�0001750�00000003606�11234661042�013577� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_s_erase_page (S___(Plotter *_plotter)) { int i; /* reinitialize `font used' array(s) for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; for (i = 0; i < PL_NUM_PCL_FONTS; i++) _plotter->data->page->pcl_font_used[i] = false; /* reset page-specific SVGPlotter variables, as if the page had just been opened */ _plotter->s_matrix[0] = 1.0;/* dummy matrix values */ _plotter->s_matrix[1] = 0.0; _plotter->s_matrix[2] = 0.0; _plotter->s_matrix[3] = 1.0; _plotter->s_matrix[4] = 0.0; _plotter->s_matrix[5] = 0.0; _plotter->s_matrix_is_unknown = true; _plotter->s_matrix_is_bogus = false; /* update our knowledge of what SVG's background color should be (we'll use it when we write the SVG page header) */ _plotter->s_bgcolor = _plotter->drawstate->bgcolor; _plotter->s_bgcolor_suppressed = _plotter->drawstate->bgcolor_suppressed; return true; } ��������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/s_openpl.c��������������������������������������������������������������������0000644�0001750�0001750�00000003116�11234661064�013775� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_s_begin_page (S___(Plotter *_plotter)) { int i; /* initialize `font used' arrays for this page */ for (i = 0; i < PL_NUM_PS_FONTS; i++) _plotter->data->page->ps_font_used[i] = false; for (i = 0; i < PL_NUM_PCL_FONTS; i++) _plotter->data->page->pcl_font_used[i] = false; /* copy background color to the SVG-specific part of the SVGPlotter; that value will be written out at the head of the page (also, it'll be updated before that, if erase() is invoked) */ _plotter->s_bgcolor = _plotter->drawstate->bgcolor; _plotter->s_bgcolor_suppressed = _plotter->drawstate->bgcolor_suppressed; return true; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/s_path.c����������������������������������������������������������������������0000644�0001750�0001750�00000054064�11257234764�013454� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This version of paint_path() is for SVGPlotters. It renders a libplot path in terms of SVG shapes: path/rect/circle/ellipse/line/polyline/polygon. */ #include "sys-defines.h" #include "extern.h" /* SVG join styles, i.e., stroke-linejoin attribute, indexed by internal number (miter/rd./bevel/triangular) */ static const char * const svg_join_style[PL_NUM_JOIN_TYPES] = { "miter", "round", "bevel", "round" }; /* SVG cap styles, i.e., stroke-linecap attribute, indexed by internal number (butt/rd./project/triangular) */ static const char * const svg_cap_style[PL_NUM_CAP_TYPES] = { "butt", "round", "square", "round" }; /* SVG fill rule styles, i.e., fill-rule attribute, indexed by internal number (evenodd/nonzero winding number) */ static const char * const svg_fill_style[PL_NUM_FILL_RULES] = { "evenodd", "nonzero" }; static const double identity_matrix[6] = { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }; /* forward references */ static void write_svg_path_data (plOutbuf *page, const plPath *path); static void write_svg_path_style (plOutbuf *page, const plDrawState *drawstate, bool need_cap, bool need_join); void _pl_s_paint_path (S___(Plotter *_plotter)) { switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { bool closed, lines_only; int i; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /*shouldn't happen */ break; if ((_plotter->drawstate->path->num_segments >= 3)/*check for closure*/ && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.x == _plotter->drawstate->path->segments[0].p.x) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.y == _plotter->drawstate->path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ /* determine which sort of SVG primitive shape this should be: line/polyline/polygon, or general path */ lines_only = true; for (i = 1; i < _plotter->drawstate->path->num_segments; i++) { plPathSegmentType element_type; element_type = _plotter->drawstate->path->segments[i].type; if (element_type != S_LINE) { lines_only = false; break; } } if (lines_only && _plotter->drawstate->path->num_segments == 2) /* SVG line */ { sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); sprintf (_plotter->data->page->point, "x1=\"%.5g\" y1=\"%.5g\" x2=\"%.5g\" y2=\"%.5g\" ", _plotter->drawstate->path->segments[0].p.x, _plotter->drawstate->path->segments[0].p.y, _plotter->drawstate->path->segments[1].p.x, _plotter->drawstate->path->segments[1].p.y); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, true, false); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); } else if (lines_only && !closed) /* SVG polyline */ { sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); sprintf (_plotter->data->page->point, "points=\""); _update_buffer (_plotter->data->page); for (i = 0; i < _plotter->drawstate->path->num_segments; i++) { plPoint p; p = _plotter->drawstate->path->segments[i].p; sprintf (_plotter->data->page->point, "%.5g,%.5g ", p.x, p.y); _update_buffer (_plotter->data->page); } sprintf (_plotter->data->page->point, "\" "); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, true, true); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); } else if (lines_only && closed) /* SVG polygon */ { sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); sprintf (_plotter->data->page->point, "points=\""); _update_buffer (_plotter->data->page); for (i = 0; i < _plotter->drawstate->path->num_segments - 1; i++) { plPoint p; p = _plotter->drawstate->path->segments[i].p; sprintf (_plotter->data->page->point, "%.5g,%.5g ", p.x, p.y); _update_buffer (_plotter->data->page); } sprintf (_plotter->data->page->point, "\" "); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, false, true); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); } else /* general SVG path */ { sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); sprintf (_plotter->data->page->point, "d=\""); _update_buffer (_plotter->data->page); /* write SVG path data string */ write_svg_path_data (_plotter->data->page, _plotter->drawstate->path); sprintf (_plotter->data->page->point, "\" "); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, true, true); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); } } break; case (int)PATH_BOX: { plPoint p0, p1; double xmin, ymin, xmax, ymax; p0 = _plotter->drawstate->path->p0; p1 = _plotter->drawstate->path->p1; xmin = DMIN(p0.x, p1.x); ymin = DMIN(p0.y, p1.y); xmax = DMAX(p0.x, p1.x); ymax = DMAX(p0.y, p1.y); sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); sprintf (_plotter->data->page->point, "x=\"%.5g\" y=\"%.5g\" width=\"%.5g\" height=\"%.5g\" ", xmin, ymin, xmax - xmin, ymax - ymin); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, false, true); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); } break; case (int)PATH_CIRCLE: { plPoint pc; double radius = _plotter->drawstate->path->radius; sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); pc = _plotter->drawstate->path->pc; sprintf (_plotter->data->page->point, "cx=\"%.5g\" cy=\"%.5g\" r=\"%.5g\" ", pc.x, pc.y, radius); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, false, false); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); } break; case (int)PATH_ELLIPSE: { plPoint pc; double rx = _plotter->drawstate->path->rx; double ry = _plotter->drawstate->path->ry; double angle = _plotter->drawstate->path->angle; double local_matrix[6]; sprintf (_plotter->data->page->point, "data->page); pc = _plotter->drawstate->path->pc; local_matrix[0] = cos (M_PI * angle / 180.0); local_matrix[1] = sin (M_PI * angle / 180.0); local_matrix[2] = -sin (M_PI * angle / 180.0); local_matrix[3] = cos (M_PI * angle / 180.0); local_matrix[4] = pc.x; local_matrix[5] = pc.y; _pl_s_set_matrix (R___(_plotter) local_matrix); sprintf (_plotter->data->page->point, "rx=\"%.5g\" ry=\"%.5g\" ", rx, ry); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, false, false); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); } break; default: /* shouldn't happen */ break; } } bool _pl_s_paint_paths (S___(Plotter *_plotter)) { int i; sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); sprintf (_plotter->data->page->point, "d=\""); _update_buffer (_plotter->data->page); for (i = 0; i < _plotter->drawstate->num_paths; i++) { plPath *path = _plotter->drawstate->paths[i]; switch ((int)path->type) { case (int)PATH_SEGMENT_LIST: /* write SVG path data string */ write_svg_path_data (_plotter->data->page, path); break; case (int)PATH_CIRCLE: /* draw as four quarter-circles */ { plPoint pc; double radius; pc = path->pc; radius = path->radius; if (path->clockwise == false) /* counter-clockwise */ sprintf (_plotter->data->page->point, "\ M%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g Z ", pc.x + radius, pc.y, radius, radius, 0.0, 0, 1, pc.x, pc.y + radius, radius, radius, 0.0, 0, 1, pc.x - radius, pc.y, radius, radius, 0.0, 0, 1, pc.x, pc.y - radius, radius, radius, 0.0, 0, 1, pc.x + radius, pc.y); else /* clockwise */ sprintf (_plotter->data->page->point, "\ M%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g Z ", pc.x + radius, pc.y, radius, radius, 0.0, 0, 0, pc.x, pc.y - radius, radius, radius, 0.0, 0, 0, pc.x - radius, pc.y, radius, radius, 0.0, 0, 0, pc.x, pc.y + radius, radius, radius, 0.0, 0, 0, pc.x + radius, pc.y); _update_buffer (_plotter->data->page); } break; case (int)PATH_ELLIPSE: /* draw as four quarter-ellipses */ { plPoint pc; double rx, ry, angle; plVector v1, v2; pc = path->pc; rx = path->rx; ry = path->ry; angle = path->angle; v1.x = rx * cos (M_PI * angle / 180.0); v1.y = rx * sin (M_PI * angle / 180.0); v2.x = -ry * sin (M_PI * angle / 180.0); v2.y = ry * cos (M_PI * angle / 180.0); if (path->clockwise == false) /* counter-clockwise */ sprintf (_plotter->data->page->point, "\ M%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g Z ", pc.x + v1.x, pc.y + v1.y, rx, ry, 0.0, 0, 1, pc.x + v2.x, pc.y + v2.y, rx, ry, 0.0, 0, 1, pc.x - v1.x, pc.y - v1.y, rx, ry, 0.0, 0, 1, pc.x - v2.x, pc.y - v2.y, rx, ry, 0.0, 0, 1, pc.x + v1.x, pc.y + v1.y); else /* clockwise */ sprintf (_plotter->data->page->point, "\ M%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g \ A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g Z ", pc.x + v1.x, pc.y + v1.y, rx, ry, 0.0, 0, 0, pc.x - v2.x, pc.y - v2.y, rx, ry, 0.0, 0, 0, pc.x - v1.x, pc.y - v1.y, rx, ry, 0.0, 0, 0, pc.x + v2.x, pc.y + v2.y, rx, ry, 0.0, 0, 0, pc.x + v1.x, pc.y + v1.y); _update_buffer (_plotter->data->page); } break; case (int)PATH_BOX: { plPoint p0, p1; bool x_move_is_first; p0 = path->p0; p1 = path->p1; /* if counterclockwise, would first pen motion be in x direction? */ x_move_is_first = ((p1.x >= p0.x && p1.y >= p0.y) || (p1.x < p0.x && p1.y < p0.y) ? true : false); if (path->clockwise) /* take complement */ x_move_is_first = (x_move_is_first == true ? false : true); if (x_move_is_first) sprintf (_plotter->data->page->point, "M%.5g,%.5g H%.5g V%.5g H%.5g Z ", p0.x, p0.y, p1.x, p1.y, p0.x); else sprintf (_plotter->data->page->point, "M%.5g,%.5g V%.5g H%.5g V%.5g Z ", p0.x, p0.y, p1.y, p1.x, p0.y); _update_buffer (_plotter->data->page); } break; default: /* shouldn't happen */ break; } } sprintf (_plotter->data->page->point, "\" "); _update_buffer (_plotter->data->page); write_svg_path_style (_plotter->data->page, _plotter->drawstate, true, true); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); return true; } /* Write an SVG path data string that specifies a single simple path. This may be called only on a libplot segment-list path, not on a libplot path that consists of a single closed path primitive (box/circle/ellipse). */ static void write_svg_path_data (plOutbuf *page, const plPath *path) { bool closed; plPoint p, oldpoint; int i; /* sanity check */ if (path->type != PATH_SEGMENT_LIST) return; if ((path->num_segments >= 3) /* check for closure */ && (path->segments[path->num_segments - 1].p.x == path->segments[0].p.x) && (path->segments[path->num_segments - 1].p.y == path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ p = path->segments[0].p; /* initial seg should be a moveto */ sprintf (page->point, "M%.5g,%.5g ", p.x, p.y); _update_buffer (page); oldpoint = p; for (i = 1; i < path->num_segments; i++) { plPathSegmentType type; plPoint pc, pd; type = path->segments[i].type; p = path->segments[i].p; pc = path->segments[i].pc; pd = path->segments[i].pd; if (closed && i == path->num_segments - 1 && type == S_LINE) continue; /* i.e. don't end with line-as-closepath */ switch ((int)type) { case (int)S_LINE: if (p.y == oldpoint.y) sprintf (page->point, "H%.5g ", p.x); else if (p.x == oldpoint.x) sprintf (page->point, "V%.5g ", p.y); else sprintf (page->point, "L%.5g,%.5g ", p.x, p.y); break; case (int)S_ARC: { double radius; double angle; /* compute angle in radians, range -pi..pi */ angle = _angle_of_arc (oldpoint, p, pc); radius = sqrt ((p.x - pc.x)*(p.x - pc.x) + (p.y - pc.y)*(p.y - pc.y)); sprintf (page->point, "A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g ", radius, radius, 0.0, /* rotation of x-axis of ellipse */ 0, /* large-arc-flag, 0/1 = small/large */ angle >= 0.0 ? 1 : 0,/* sweep-flag, 0/1 = clock/c'clock */ p.x, p.y); } break; case (int)S_ELLARC: { double cross, mixing_angle, rx, ry, theta; plVector u, v, semi_axis_1, semi_axis_2; bool clockwise; /* conjugate radial vectors for the quarter-ellipse */ u.x = oldpoint.x - pc.x; u.y = oldpoint.y - pc.y; v.x = p.x - pc.x; v.y = p.y - pc.y; cross = u.x * v.y - v.x * u.y; clockwise = cross < 0.0 ? true : false; /* angle by which they should be mixed, to yield vectors along the major and minor axes */ mixing_angle = 0.5 * _xatan2 (2.0 * (u.x * v.x + u.y * v.y), u.x * u.x + u.y * u.y - v.x * v.x + v.y * v.y); /* semi-axis vectors */ semi_axis_1.x = u.x * cos(mixing_angle) + v.x * sin(mixing_angle); semi_axis_1.y = u.y * cos(mixing_angle) + v.y * sin(mixing_angle); semi_axis_2.x = (u.x * cos(mixing_angle + M_PI_2) + v.x * sin(mixing_angle + M_PI_2)); semi_axis_2.y = (u.y * cos(mixing_angle + M_PI_2) + v.y * sin(mixing_angle + M_PI_2)); /* semi-axis lengths */ rx = sqrt (semi_axis_1.x * semi_axis_1.x + semi_axis_1.y * semi_axis_1.y); ry = sqrt (semi_axis_2.x * semi_axis_2.x + semi_axis_2.y * semi_axis_2.y); /* angle of inclination of first semi-axis */ theta = _xatan2 (semi_axis_1.y, semi_axis_1.x); /* compensate for possible roundoff error: treat a very small inclination angle of the 1st semi-axis, relative to the x-axis, as zero */ #define VERY_SMALL_ANGLE 1e-10 if (theta < VERY_SMALL_ANGLE && theta > -(VERY_SMALL_ANGLE)) theta = 0.0; sprintf (page->point, "A%.5g,%.5g,%.5g,%d,%d,%.5g,%.5g ", rx, ry, theta * 180.0 / M_PI, /* rotation of x-axis of ellipse */ 0, /* large-arc-flag, 0/1 = small/large */ clockwise ? 0 : 1, /* sweep-flag, 0/1 = clock/c'clock */ p.x, p.y); } break; case (int)S_QUAD: sprintf (page->point, "Q%.5g,%.5g,%.5g,%.5g ", pc.x, pc.y, p.x, p.y); break; case (int)S_CUBIC: sprintf (page->point, "C%.5g,%.5g,%.5g,%.5g,%.5g,%.5g ", pc.x, pc.y, pd.x, pd.y, p.x, p.y); break; default: /* shouldn't happen */ break; } _update_buffer (page); oldpoint = p; } if (closed) { sprintf (page->point, "Z "); _update_buffer (page); } } static void write_svg_path_style (plOutbuf *page, const plDrawState *drawstate, bool need_cap, bool need_join) { char color_buf[8]; /* enough room for "#ffffff", incl. NUL */ if (drawstate->pen_type) { if (drawstate->fgcolor.red != 0 || drawstate->fgcolor.green != 0 || drawstate->fgcolor.blue != 0) /* non-black, i.e. non-default */ { sprintf (page->point, "stroke=\"%s\" ", _libplot_color_to_svg_color (drawstate->fgcolor, color_buf)); _update_buffer (page); } /* should use `px' here to specify user units, per the SVG Authoring Guide, but ImageMagick objects to that */ sprintf (page->point, "stroke-width=\"%.5g\" ", drawstate->line_width); _update_buffer (page); if (need_cap) { if (drawstate->cap_type != PL_CAP_BUTT) /* i.e. not default */ { sprintf (page->point, "stroke-linecap=\"%s\" ", svg_cap_style[drawstate->cap_type]); _update_buffer (page); } } if (need_join) { if (drawstate->join_type != PL_JOIN_MITER) /* i.e. not default */ { sprintf (page->point, "stroke-linejoin=\"%s\" ", svg_join_style[drawstate->join_type]); _update_buffer (page); } if (drawstate->join_type == PL_JOIN_MITER && drawstate->miter_limit != PL_DEFAULT_MITER_LIMIT) { sprintf (page->point, "stroke-miterlimit=\"%.5g\" ", drawstate->miter_limit); _update_buffer (page); } } if ((drawstate->dash_array_in_effect /* user-specified dash array */ && drawstate->dash_array_len > 0) || (drawstate->dash_array_in_effect == false && drawstate->line_type != PL_L_SOLID)) /* non-solid builtin linetype*/ /* need to specify stroke-array, maybe stroke-offset too */ { int i; double *dashbuf, offset; int num_dashes; if (drawstate->dash_array_in_effect) { dashbuf = (double *)(drawstate->dash_array); num_dashes = drawstate->dash_array_len; offset = drawstate->dash_offset; } else /* builtin line type, handcraft a SVG-style dash array for it */ { const int *dash_array; double min_sing_val, max_sing_val, min_width, scale; /* compute maximum singular value of user->device coordinate map, which we use as a divisive factor to convert size in NCD frame back to size in the user frame */ _matrix_sing_vals (drawstate->transform.m_user_to_ndc, &min_sing_val, &max_sing_val); if (max_sing_val != 0.0) min_width = PL_DEFAULT_LINE_WIDTH_AS_FRACTION_OF_DISPLAY_SIZE / max_sing_val; else min_width = 0.0; scale = DMAX(drawstate->line_width, min_width); /* take normalized dash array (linemode-specific) from internal table */ dash_array = _pl_g_line_styles[drawstate->line_type].dash_array; num_dashes = _pl_g_line_styles[drawstate->line_type].dash_array_len; dashbuf = (double *)_pl_xmalloc (num_dashes * sizeof(double)); /* scale length of each dash by current line width, unless it's too small (see above computation) */ for (i = 0; i < num_dashes; i++) dashbuf[i] = scale * dash_array[i]; offset = 0.0; /* true for all builtin line types */ } sprintf (page->point, "stroke-dasharray=\""); _update_buffer (page); for (i = 0; i < num_dashes; i++) { sprintf (page->point, "%.5g%s", dashbuf[i], i < num_dashes - 1 ? ", " : "\""); _update_buffer (page); } if (offset != 0.0) /* not default */ { /* should use `px' here to specify user units, per the SVG Authoring Guide, but ImageMagick objects to that */ sprintf (page->point, "stroke-dashoffset=\"%.5g\" ", offset); _update_buffer (page); } if (drawstate->dash_array_in_effect == false) /* have a handcrafted dash array to free */ free (dashbuf); } else /* solid, so don't specify stroke-dasharray or stroke-offset */ { } } else { sprintf (page->point, "stroke=\"none\" "); _update_buffer (page); } if (drawstate->fill_type) { sprintf (page->point, "fill=\"%s\" ", _libplot_color_to_svg_color (drawstate->fillcolor, color_buf)); _update_buffer (page); if (drawstate->fill_rule_type != PL_FILL_ODD_WINDING) /* not default */ { sprintf (page->point, "fill-rule=\"%s\" ", svg_fill_style[drawstate->fill_rule_type]); _update_buffer (page); } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/s_point.c���������������������������������������������������������������������0000644�0001750�0001750�00000004443�11037243262�013632� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ #include "sys-defines.h" #include "extern.h" static const double identity_matrix[6] = { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }; /* forward references */ static void write_svg_point_style (plOutbuf *page, const plDrawState *drawstate); void _pl_s_paint_point (S___(Plotter *_plotter)) { sprintf (_plotter->data->page->point, "data->page); _pl_s_set_matrix (R___(_plotter) identity_matrix); sprintf (_plotter->data->page->point, "cx=\"%.5g\" cy=\"%.5g\" r=\"%s\" ", _plotter->drawstate->pos.x, _plotter->drawstate->pos.y, "0.5px"); /* diameter = 1 pixel */ _update_buffer (_plotter->data->page); write_svg_point_style (_plotter->data->page, _plotter->drawstate); sprintf (_plotter->data->page->point, "/>\n"); _update_buffer (_plotter->data->page); return; } static void write_svg_point_style (plOutbuf *page, const plDrawState *drawstate) { char color_buf[8]; /* enough room for "#ffffff", incl. NUL */ sprintf (page->point, "stroke=\"none\" "); _update_buffer (page); sprintf (page->point, "fill=\"%s\"", _libplot_color_to_svg_color (drawstate->fgcolor, color_buf)); _update_buffer (page); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/s_text.c����������������������������������������������������������������������0000644�0001750�0001750�00000026614�11234706307�013474� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This prints a single-font, single-font-size label. When this is called, the current point is on the intended baseline of the label. */ /* This version is for SVGPlotters. We use the ISO-Latin-1 encoding, so < > & and left-quote and double-quote are the only characters we need to escape. */ #include "sys-defines.h" #include "extern.h" /* maximum length we support */ #define PL_MAX_SVG_STRING_LEN 256 /* The fixed value we specify for the font-size parameter, when any font is retrieved, in terms of `px'. (We now scale as needed by choosing an appropriate transformation matrix.) According to the SVG Authoring Guide, a `px' means simply a user-space unit, but some SVG renderers (e.g., in Firefox) get confused if it's smaller than 1.0 or so, and return absurdly scaled fonts. Maybe they think px stands for pixels? :-) */ #define PL_SVG_FONT_SIZE_IN_PX 20.0 /* forward references */ static void write_svg_text_style (plOutbuf *page, const plDrawState *drawstate, int h_just, int v_just); typedef struct { char c; const char *s; } plCharEscape; #define NUM_SVG_CHAR_ESCAPES 5 static const plCharEscape _svg_char_escapes[NUM_SVG_CHAR_ESCAPES] = { {'\'', "apos"}, {'"', "quot"}, {'&', "amp"}, {'<', "lt"}, {'>', "gt"} }; #define MAX_SVG_CHAR_ESCAPE_LEN 4 /* i.e., length of "apos" or "quot" */ /* SVG horizontal alignment styles, i.e., text-anchor attribute, indexed by internal number (left/center/right) */ static const char * const svg_horizontal_alignment_style[PL_NUM_HORIZ_JUST_TYPES] = { "start", "middle", "end" }; /* SVG vertical alignment styles, i.e., alignment-baseline attribute, indexed by internal number (top/half/base/bottom/cap) */ static const char * const svg_vertical_alignment_style[PL_NUM_VERT_JUST_TYPES] = { "text-before-edge", "central", "alphabetic", "text-after-edge", "hanging" }; /* This version of the paint_text_string method, for SVG Plotters, supports each of libplot's possible vertical justifications (see the list immediately above). However, only the `baseline' justification is currently used. That's because in s_defplot.c we set the Plotter parameter `have_vertical_justification' to false. Too many SVG renderers don't support the SVG alignment-baseline attribute; e.g., Firefox 1.5 doesn't. So it's best for libplot to do its own vertical positioning of text strings. */ double _pl_s_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { const unsigned char *sp = s; unsigned char *t, *tp; int i, n = 0; double local_matrix[6]; double angle = _plotter->drawstate->text_rotation; /* replace certain printable ASCII characters by entities */ tp = t = (unsigned char *)_pl_xmalloc ((2 + MAX_SVG_CHAR_ESCAPE_LEN) * strlen ((const char *)s) + 1); while (*sp && n < PL_MAX_SVG_STRING_LEN) { bool matched; int i; matched = false; for (i = 0; i < NUM_SVG_CHAR_ESCAPES; i++) { if (*sp == (unsigned char)_svg_char_escapes[i].c) { matched = true; break; } } if (matched) { *tp++ = (unsigned char)'&'; strcpy ((char *)tp, _svg_char_escapes[i].s); tp += strlen (_svg_char_escapes[i].s); *tp++ = (unsigned char)';'; } else *tp++ = *sp; sp++; n++; } *tp = '\0'; sprintf (_plotter->data->page->point, "data->page); /* CTM equals CTM_local * CTM_base, if matrix multiplication is defined as in PS and libplot. (Which is the opposite of the SVG convention, since SVG documentation uses column vectors instead of row vectors, so that the CTM is effectively transposed. Although SVG's matrix() construct uses PS order for the six matrix elements... go figure.) Here CTM_local rotates by the libplot's text angle parameter, and translates to the correct position. And CTM_base is libplot's current user_to_ndc transformation matrix. We separate them because we use the CTM of the first-plotted object on the page as the page's global transformation matrix, and if that object happens to be a text object, we'd like it to simply to be the current user_to_ndc transformation matrix, i.e. not to include irrelevancies such as the text position and angle. Sigh... If only things were so simple. SVG's native coordinate frame, which libplot's user coordinates must ultimately be mapped to, unfortunately uses a flipped-y convention, unlike PS and libplot. (The global flipping of y, relative to libplot's NDC coordinates, is accomplished by a scale(1,-1) that's placed at the head of the SVG file; see s_output.c.) This flipping has a special effect on the drawing of text strings, though no other libplot primitive. For everything to work out when drawing a text string, we must precede the sequence of transformations leading from user coordinates to native SVG coordinates by an initial scale(1,-1). CTM_local, as defined above, must have two elements sign-flipped (see below). Trust me. */ local_matrix[0] = cos (M_PI * angle / 180.0); local_matrix[1] = sin (M_PI * angle / 180.0); local_matrix[2] = -sin (M_PI * angle / 180.0) * (-1); /* SEE ABOVE */ local_matrix[3] = cos (M_PI * angle / 180.0) * (-1); /* SEE ABOVE */ /* since we now specify a fixed font-size, equal to PL_SVG_FONT_SIZE_IN_PX (see below), rather than specifying a font size equal to the font size in user units, we must here scale the text string to the right size */ for (i = 0; i < 4; i++) local_matrix[i] *= (_plotter->drawstate->font_size / PL_SVG_FONT_SIZE_IN_PX); local_matrix[4] = _plotter->drawstate->pos.x; local_matrix[5] = _plotter->drawstate->pos.y; _pl_s_set_matrix (R___(_plotter) local_matrix); write_svg_text_style (_plotter->data->page, _plotter->drawstate, h_just, v_just); sprintf (_plotter->data->page->point, ">"); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "%s", (char *)t); _update_buffer (_plotter->data->page); sprintf (_plotter->data->page->point, "\n"); _update_buffer (_plotter->data->page); free (t); return _plotter->get_text_width (R___(_plotter) s); } static void write_svg_text_style (plOutbuf *page, const plDrawState *drawstate, int h_just, int v_just) { const char *ps_name, *css_family, *css_generic_family; /* last may be NULL */ const char *css_style, *css_weight, *css_stretch; bool css_family_is_ps_name; char color_buf[8]; /* enough room for "#ffffff", incl. NUL */ /* extract official PS font name, and CSS font specification, from master table of PS [or PCL] fonts, in g_fontdb.c */ switch (drawstate->font_type) { int master_font_index; case PL_F_POSTSCRIPT: master_font_index = (_pl_g_ps_typeface_info[drawstate->typeface_index].fonts)[drawstate->font_index]; ps_name = _pl_g_ps_font_info[master_font_index].ps_name; css_family = _pl_g_ps_font_info[master_font_index].css_family; css_generic_family = _pl_g_ps_font_info[master_font_index].css_generic_family; css_style = _pl_g_ps_font_info[master_font_index].css_style; css_weight = _pl_g_ps_font_info[master_font_index].css_weight; css_stretch = _pl_g_ps_font_info[master_font_index].css_stretch; /* flag this font as used */ page->ps_font_used[master_font_index] = true; break; case PL_F_PCL: master_font_index = (_pl_g_pcl_typeface_info[drawstate->typeface_index].fonts)[drawstate->font_index]; ps_name = _pl_g_pcl_font_info[master_font_index].ps_name; css_family = _pl_g_pcl_font_info[master_font_index].css_family; css_generic_family = _pl_g_pcl_font_info[master_font_index].css_generic_family; css_style = _pl_g_pcl_font_info[master_font_index].css_style; css_weight = _pl_g_pcl_font_info[master_font_index].css_weight; css_stretch = _pl_g_pcl_font_info[master_font_index].css_stretch; /* flag this font as used */ page->pcl_font_used[master_font_index] = true; break; default: /* shouldn't happen */ return; break; } if (strcmp (ps_name, css_family) == 0) /* no need to specify both */ css_family_is_ps_name = true; else css_family_is_ps_name = false; /* N.B. In each of the following four sprintf()'s, we should apparently enclose css_family in single quotes, at least if it contains a space. But doing so would cause the SVG renderer in `display', which is part of the ImageMagick package, to reject the emitted SVG file. */ if (css_generic_family) { if (css_family_is_ps_name) sprintf (page->point, "font-family=\"%s,%s\" ", css_family, css_generic_family); else sprintf (page->point, "font-family=\"%s,%s,%s\" ", ps_name, css_family, css_generic_family); } else { if (css_family_is_ps_name) sprintf (page->point, "font-family=\"%s\" ", css_family); else sprintf (page->point, "font-family=\"%s,%s\" ", ps_name, css_family); } _update_buffer (page); if (strcmp (css_style, "normal") != 0) /* not default */ { sprintf (page->point, "font-style=\"%s\" ", css_style); _update_buffer (page); } if (strcmp (css_weight, "normal") != 0) /* not default */ { sprintf (page->point, "font-weight=\"%s\" ", css_weight); _update_buffer (page); } if (strcmp (css_stretch, "normal") != 0) /* not default */ { sprintf (page->point, "font-stretch=\"%s\" ", css_stretch); _update_buffer (page); } sprintf (page->point, "font-size=\"%.5gpx\" ", /* see comments above for why we don't simply specify drawstate->font_size here */ PL_SVG_FONT_SIZE_IN_PX); _update_buffer (page); if (h_just != PL_JUST_LEFT) /* not default */ { sprintf (page->point, "text-anchor=\"%s\" ", svg_horizontal_alignment_style[h_just]); _update_buffer (page); } if (v_just != PL_JUST_BASE) /* not default */ { sprintf (page->point, "alignment-baseline=\"%s\" ", svg_vertical_alignment_style[v_just]); _update_buffer (page); } /* currently, we never draw character outlines; we only fill */ sprintf (page->point, "stroke=\"none\" "); _update_buffer (page); if (drawstate->pen_type) /* according to libplot convention, text should be filled, and since SVG's default filling is "none", we must say so */ { sprintf (page->point, "fill=\"%s\" ", _libplot_color_to_svg_color (drawstate->fgcolor, color_buf)); _update_buffer (page); } } ��������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/i_closepl.c�������������������������������������������������������������������0000644�0001750�0001750�00000034401�11037243261�014124� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "i_rle.h" /* use miGIF RLE (non-LZW) compression */ #include "xmi.h" /* GIF89a frame disposal methods (a 3-bit field; values 4..7 are reserved) */ #define DISP_UNSPECIFIED 0 #define DISP_NONE 1 #define DISP_RESTORE_TO_BACKGROUND 2 #define DISP_RESTORE_TO_PREVIOUS 3 /* forward references */ static bool same_colormap (plColor cmap1[256], plColor cmap2[256], int num1, int num2); bool _pl_i_end_page (S___(Plotter *_plotter)) { /* Output current frame as a GIF image, preceded by a GIF header if necessary. This applies only if this is page #1. */ #ifdef LIBPLOTTER if (_plotter->data->outfp || _plotter->data->outstream) #else if (_plotter->data->outfp) #endif /* have an output stream */ { if (_plotter->data->page_number == 1) { if (_plotter->i_header_written == false) { _pl_i_write_gif_header (S___(_plotter)); _plotter->i_header_written = true; } /* emit GIF image of current frame using RLE module (see i_rle.c) */ _pl_i_write_gif_image (S___(_plotter)); _pl_i_write_gif_trailer (S___(_plotter)); } } /* delete image: deallocate frame's canvas, reset frame's color table */ _pl_i_delete_image (S___(_plotter)); return true; } void _pl_i_write_gif_header (S___(Plotter *_plotter)) { int i, packed_bits; /* determine whether transparency extension is really needed */ if (_plotter->i_transparent) { if (_plotter->i_animation) /* transparent color index will be #0 in each image's color table; see i_color.c */ { _plotter->i_transparent = true; _plotter->i_transparent_index = 0; } else /* only 1 image, and 1 color table */ { bool found = false; plColor t_color; t_color = _plotter->i_transparent_color; /* search for user-specified color */ for (i = 0; i < _plotter->i_num_color_indices; i++) { if (_plotter->i_colormap[i].red == t_color.red && _plotter->i_colormap[i].green == t_color.green && _plotter->i_colormap[i].blue == t_color.blue) { found = true; break; } } if (found) { _plotter->i_transparent = true; _plotter->i_transparent_index = i; } else /* transparency not needed */ _plotter->i_transparent = false; } } /* Header block, including Signature and Version. */ /* To express transparency, a nontrivial number of iterations, or a nontrivial delay between successive images, need GIF89a format, not GIF87a. */ if (_plotter->i_transparent || (_plotter->i_animation && _plotter->i_iterations > 0) || (_plotter->i_animation && _plotter->i_delay > 0)) _write_string (_plotter->data, "GIF89a"); else _write_string (_plotter->data, "GIF87a"); /* Logical Screen Descriptor Block */ /* Logical Screen Width and Height (2-byte unsigned ints) */ _pl_i_write_short_int (R___(_plotter) (unsigned int)_plotter->i_xn); _pl_i_write_short_int (R___(_plotter) (unsigned int)_plotter->i_yn); /* Global Color Table Flag (1 bit) [1/0 = global table follows / doesn't follow]. Represented by 0x80 / 0x00 respectively. */ packed_bits = 0x80; /* Color Resolution, i.e. bitdepth minus 1, with min=0 (3 bits) */ packed_bits |= (IMAX(_plotter->i_bit_depth - 1, 0)) << 4; /* Sort Flag [0 = unordered] (1 bit) */ /* Size of Global Color Table, i.e. bitdepth minus 1, with min=0 (3 bits) */ packed_bits |= (IMAX(_plotter->i_bit_depth - 1, 0)); /* write 1 byte of packed bits */ _write_byte (_plotter->data, (unsigned char)packed_bits); /* Background Color Index (if there's no global color table this field should be set to 0) */ _write_byte (_plotter->data, _plotter->drawstate->i_bg_color_index); /* Pixel Aspect Ratio (0 = field unused) */ _write_byte (_plotter->data, (unsigned char)0); /* Global Color Table (expanded to next higher power of 2, with min=2) */ for (i = 0; i < (1 << IMAX(_plotter->i_bit_depth, 1)); ++i) { _write_byte (_plotter->data, (unsigned char)_plotter->i_colormap[i].red); _write_byte (_plotter->data, (unsigned char)_plotter->i_colormap[i].green); _write_byte (_plotter->data, (unsigned char)_plotter->i_colormap[i].blue); /* stash table (for comparison with color tables of later frames) */ _plotter->i_global_colormap[i] = _plotter->i_colormap[i]; } _plotter->i_num_global_color_indices = _plotter->i_num_color_indices; /* Netscape Loop Extension Block (extension blocks are a GIF89a feature; this requests `looping' of subsequent images) */ if (_plotter->i_animation && _plotter->i_iterations > 0) { /* Extension Introducer */ _write_byte (_plotter->data, (unsigned char)'!'); /* Application Extension Label */ _write_byte (_plotter->data, (unsigned char)0xff); /* Block Size (fixed at 11) */ _write_byte (_plotter->data, (unsigned char)11); /* Application Identifier (8 bytes) and Auth. Code (3 bytes) */ _write_string (_plotter->data, "NETSCAPE2.0"); /* Block Size (fixed at 3) */ _write_byte (_plotter->data, (unsigned char)0x03); /* Block, 3 bytes long */ _write_byte (_plotter->data, (unsigned char)0x01);/* what is this? */ _pl_i_write_short_int (R___(_plotter) (unsigned int)(_plotter->i_iterations)); /* Block Terminator (0-length data block) */ _write_byte (_plotter->data, (unsigned char)0x00); } } /* Write image descriptor, including color table. Also scan image, and compress and write the resulting stream of color indices. */ void _pl_i_write_gif_image (S___(Plotter *_plotter)) { bool write_local_table; int i, min_code_size, packed_bits; /* Graphic Control Block (a GIF89a feature; modifies following image descriptor). Needed to express transparency of each image, or a non-default delay after each image. */ if (_plotter->i_transparent || (_plotter->i_animation && _plotter->i_delay > 0)) { unsigned char packed_byte; /* Extension Introducer */ _write_byte (_plotter->data, (unsigned char)'!'); /* Graphic Control Label */ _write_byte (_plotter->data, (unsigned char)0xf9); /* Block Size (fixed at 4) */ _write_byte (_plotter->data, (unsigned char)4); /* Packed fields: Reserved (3 bits), Disposal Method (3 bits), User Input Flag (1 bit), Transparency Flag (final 1 bit) */ packed_byte = 0; if (_plotter->i_transparent) packed_byte |= 1; if (_plotter->i_transparent && _plotter->i_animation) packed_byte |= (DISP_RESTORE_TO_BACKGROUND << 2); else packed_byte |= (DISP_UNSPECIFIED << 2); _write_byte (_plotter->data, packed_byte); /* Delay time in hundredths of a second [the same for all frames] (2-byte unsigned int) */ _pl_i_write_short_int (R___(_plotter) (unsigned int)(_plotter->i_delay)); /* Transparent Color Index [the same for all frames] */ _write_byte (_plotter->data, (unsigned char)_plotter->i_transparent_index); /* Block Terminator (0-length data block) */ _write_byte (_plotter->data, (unsigned char)0); } /* Image Descriptor */ /* Image Separator */ _write_byte (_plotter->data, (unsigned char)','); /* Image Left and Top Positions (w/ respect to logical screen; 2-byte unsigned ints) */ _pl_i_write_short_int (R___(_plotter) 0); _pl_i_write_short_int (R___(_plotter) 0); /* Image Width, Height (2-byte unsigned ints) */ _pl_i_write_short_int (R___(_plotter) (unsigned int)_plotter->i_xn); _pl_i_write_short_int (R___(_plotter) (unsigned int)_plotter->i_yn); /* does current frame's color table differ from zeroth frame's color table (i.e. GIF file's global color table)? */ write_local_table = same_colormap (_plotter->i_colormap, _plotter->i_global_colormap, _plotter->i_num_color_indices, _plotter->i_num_global_color_indices) ? false : true; /* Packed fields: Local Color Table (1 bit), Interlace Flag (1 bit), Sort Flag (1 bit), Reserved (2 bits), Local Color Table Size (3 bits) */ packed_bits = 0x00; if (write_local_table) { packed_bits |= 0x80; packed_bits |= (IMAX(_plotter->i_bit_depth - 1, 0)); } /* interlace? */ if (_plotter->i_interlace) packed_bits |= 0x40; /* write one byte of packed bits */ _write_byte (_plotter->data, (unsigned char)packed_bits); /* Local Color Table (expanded to next higher power of 2, with min=2) */ if (write_local_table) { for (i = 0; i < (1 << IMAX(_plotter->i_bit_depth, 1)); ++i) { _write_byte (_plotter->data, (unsigned char)_plotter->i_colormap[i].red); _write_byte (_plotter->data, (unsigned char)_plotter->i_colormap[i].green); _write_byte (_plotter->data, (unsigned char)_plotter->i_colormap[i].blue); } } /* Table-Based Image Data */ /* LZW Minimum Code Size. (Minimum number of bits required to represent the set of actual pixel values, which will be the same as the bit depth, since our allocated color indices are contiguous. However, this has a floor of 2, and, also compression codes must start out one bit longer than the floored version, "because of some algorithmic constraints". See i_rle.c.) */ min_code_size = IMAX(_plotter->i_bit_depth, 2); _write_byte (_plotter->data, (unsigned char)min_code_size); /* initialize pixel scanner */ _pl_i_start_scan (S___(_plotter)); /* Image Data, consisting of a sequence of sub-blocks of size at most 255 bytes each, encoded as LZW with variable-length code (actually, we use miGIF [RLE] rather than LZW; see i_rle.c) */ { rle_out *rle; int pixel; #ifdef LIBPLOTTER rle = _rle_init (_plotter->data->outfp, _plotter->data->outstream, _plotter->i_bit_depth); #else rle = _rle_init (_plotter->data->outfp, _plotter->i_bit_depth); #endif while ((pixel = _pl_i_scan_pixel (S___(_plotter))) != -1) _rle_do_pixel (rle, pixel); _rle_terminate (rle); } /* Block Terminator */ _write_byte (_plotter->data, (unsigned char)0); } void _pl_i_write_gif_trailer (S___(Plotter *_plotter)) { /* Trailer Block */ _write_byte (_plotter->data, (unsigned char)';'); } /* reset scanner variables (first pixel scanned is (0,0), i.e. upper left-hand corner) */ void _pl_i_start_scan (S___(Plotter *_plotter)) { _plotter->i_pixels_scanned = 0; _plotter->i_pass = 0; _plotter->i_hot.x = 0; _plotter->i_hot.y = 0; } /* Return index (in color table) of pixel under the hot spot, and continue the scan by moving to the next pixel. Return -1 when scan is finished. */ int _pl_i_scan_pixel (S___(Plotter *_plotter)) { if (_plotter->i_pixels_scanned < _plotter->i_num_pixels) { miCanvas *canvas; int x, y; miPixel full_pixel; int pixel; /* use a libxmi macro, defined in xmi.h, to extract the miPixel at the hotspot; extract index field from it */ canvas = (miCanvas *)_plotter->i_canvas; x = _plotter->i_hot.x; y = _plotter->i_hot.y; MI_GET_CANVAS_DRAWABLE_PIXEL(canvas, x, y, full_pixel) pixel = full_pixel.u.index; _plotter->i_hot.x++; if (_plotter->i_hot.x == _plotter->i_xn) { _plotter->i_hot.x = 0; if (_plotter->i_interlace == false) _plotter->i_hot.y++; else /* move to next scan line */ { switch (_plotter->i_pass) { case 0: /* every 8th row, starting with row 0 */ _plotter->i_hot.y += 8; if (_plotter->i_hot.y >= _plotter->i_yn) { _plotter->i_pass++; _plotter->i_hot.y = 4; } break; case 1: /* every 8th row, starting with row 4 */ _plotter->i_hot.y += 8; if (_plotter->i_hot.y >= _plotter->i_yn) { _plotter->i_pass++; _plotter->i_hot.y = 2; } break; case 2: /* every 4th row, starting with row 2 */ _plotter->i_hot.y += 4; if (_plotter->i_hot.y >= _plotter->i_yn) { _plotter->i_pass++; _plotter->i_hot.y = 1; } break; case 3: /* every 2nd row, starting with row 1 */ _plotter->i_hot.y += 2; break; } } } _plotter->i_pixels_scanned++; return pixel; } else /* scan is finished */ return -1; } /* write out an unsigned short int, in range 0..65535, as 2 bytes in little-endian order */ void _pl_i_write_short_int (R___(Plotter *_plotter) unsigned int i) { unsigned char bytes[2]; bytes[0] = (unsigned char)(i & 0xff); bytes[1] = (unsigned char)((i >> 8) & 0xff); _write_bytes (_plotter->data, 2, bytes); } /* tear down image, i.e. deallocate libxmi canvas and reset colormap */ void _pl_i_delete_image (S___(Plotter *_plotter)) { /* deallocate libxmi's drawing canvas (and painted set struct too) */ miDeleteCanvas ((miCanvas *)_plotter->i_canvas); _plotter->i_canvas = (void *)NULL; miDeletePaintedSet ((miPaintedSet *)_plotter->i_painted_set); _plotter->i_painted_set = (void *)NULL; /* reset colormap */ _plotter->i_num_color_indices = 0; /* flag color indices in drawing state as bogus */ _plotter->drawstate->i_pen_color_status = false; _plotter->drawstate->i_fill_color_status = false; _plotter->drawstate->i_bg_color_status = false; } /* compare two partially filled size-256 colormaps for equality */ static bool same_colormap (plColor cmap1[256], plColor cmap2[256], int num1, int num2) { int i; if (num1 != num2) return false; for (i = 0; i < num1; i++) if ((cmap1[i].red != cmap2[i].red) || (cmap1[i].green != cmap2[i].green) || (cmap1[i].blue != cmap2[i].blue)) return false; return true; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/i_color.c���������������������������������������������������������������������0000644�0001750�0001750�00000016472�11037243261�013611� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains device-specific color database access routines. These routines are called by various GIFPlotter methods, before drawing objects. They set the appropriate GIFPlotter-specific fields in the drawing state. */ #include "sys-defines.h" #include "extern.h" /* forward references */ static int bit_depth (int colors); /* we call this routine to evaluate _plotter->drawstate->i_pen_color_index lazily, i.e. only when needed (just before a drawing operation) */ void _pl_i_set_pen_color(S___(Plotter *_plotter)) { int red_long, green_long, blue_long; int red, green, blue; /* 48-bit RGB */ red_long = _plotter->drawstate->fgcolor.red; green_long = _plotter->drawstate->fgcolor.green; blue_long = _plotter->drawstate->fgcolor.blue; /* 24-bit RGB (as used in GIFs) */ red = (((unsigned int)red_long) >> 8) & 0xff; green = (((unsigned int)green_long) >> 8) & 0xff; blue = (((unsigned int)blue_long) >> 8) & 0xff; if (!(_plotter->drawstate->i_pen_color_status && _plotter->drawstate->i_pen_color.red == red && _plotter->drawstate->i_pen_color.green == green && _plotter->drawstate->i_pen_color.blue == blue)) /* need another color index: search table, expand if necessary */ { unsigned char index; index = _pl_i_new_color_index (R___(_plotter) red, green, blue); /* set new 24-bit RGB and color index in the drawing state */ _plotter->drawstate->i_pen_color.red = red; _plotter->drawstate->i_pen_color.green = green; _plotter->drawstate->i_pen_color.blue = blue; _plotter->drawstate->i_pen_color_index = index; /* flag this color index as genuine */ _plotter->drawstate->i_pen_color_status = true; } } /* we call this routine to evaluate _plotter->drawstate->i_fill_color_index lazily, i.e. only when needed (just before a filling operation) */ void _pl_i_set_fill_color(S___(Plotter *_plotter)) { int red_long, green_long, blue_long; int red, green, blue; if (_plotter->drawstate->fill_type == 0) /* don't do anything, fill color will be ignored when writing objects */ return; /* 48-bit RGB */ red_long = _plotter->drawstate->fillcolor.red; green_long = _plotter->drawstate->fillcolor.green; blue_long = _plotter->drawstate->fillcolor.blue; /* 24-bit RGB (as used in GIFs) */ red = (((unsigned int)red_long) >> 8) & 0xff; green = (((unsigned int)green_long) >> 8) & 0xff; blue = (((unsigned int)blue_long) >> 8) & 0xff; if (!(_plotter->drawstate->i_fill_color_status && _plotter->drawstate->i_fill_color.red == red && _plotter->drawstate->i_fill_color.green == green && _plotter->drawstate->i_fill_color.blue == blue)) /* need another color index: search table, expand if necessary */ { unsigned char index; index = _pl_i_new_color_index (R___(_plotter) red, green, blue); /* set new 24-bit RGB and color index in the drawing state */ _plotter->drawstate->i_fill_color.red = red; _plotter->drawstate->i_fill_color.green = green; _plotter->drawstate->i_fill_color.blue = blue; _plotter->drawstate->i_fill_color_index = index; } } /* we call this routine to compute and set _plotter->drawstate->i_bg_color_index, e.g. in _pl_i_new_image */ void _pl_i_set_bg_color(S___(Plotter *_plotter)) { int red_long, green_long, blue_long; int red, green, blue; /* 48-bit RGB */ red_long = _plotter->drawstate->bgcolor.red; green_long = _plotter->drawstate->bgcolor.green; blue_long = _plotter->drawstate->bgcolor.blue; /* 24-bit RGB (as used in GIFs) */ red = (((unsigned int)red_long) >> 8) & 0xff; green = (((unsigned int)green_long) >> 8) & 0xff; blue = (((unsigned int)blue_long) >> 8) & 0xff; if (!(_plotter->drawstate->i_bg_color_status && _plotter->drawstate->i_bg_color.red == red && _plotter->drawstate->i_bg_color.green == green && _plotter->drawstate->i_bg_color.blue == blue)) /* need another color index: search table, expand if necessary */ { unsigned char index; index = _pl_i_new_color_index (R___(_plotter) red, green, blue); /* set new 24-bit RGB and color index in the drawing state */ _plotter->drawstate->i_bg_color.red = red; _plotter->drawstate->i_bg_color.green = green; _plotter->drawstate->i_bg_color.blue = blue; _plotter->drawstate->i_bg_color_index = index; /* flag this color index as genuine */ _plotter->drawstate->i_bg_color_status = true; } } /* Internal function, called by each of the above. It searches for a 24-bit RGB in the color table. If not found, it's added to table, unless table can't be expanded, in which case index with closest RGB is returned. */ unsigned char _pl_i_new_color_index (R___(Plotter *_plotter) int red, int green, int blue) { int i, j; int sqdist; bool found = false; for (i = 0; i < _plotter->i_num_color_indices; i++) if (_plotter->i_colormap[i].red == red && _plotter->i_colormap[i].green == green && _plotter->i_colormap[i].blue == blue) { found = true; break; } if (found) return (unsigned char)i; /* not found, try to allocate new index */ i = _plotter->i_num_color_indices; if (i < 256) { _plotter->i_colormap[i].red = red; _plotter->i_colormap[i].green = green; _plotter->i_colormap[i].blue = blue; _plotter->i_num_color_indices = i + 1; /* New bit depth of colormap, e.g. sizes 129..256 get mapped to 8. In effect the colormap for any of these sizes will be of size 256. */ _plotter->i_bit_depth = bit_depth (i + 1); return (unsigned char)i; } /* table full, do our best */ sqdist = INT_MAX; i = 0; for (j = 0; j < 256; j++) { int new_sqdist; int a_red, a_green, a_blue; a_red = _plotter->i_colormap[j].red; a_green = _plotter->i_colormap[j].green; a_blue = _plotter->i_colormap[j].blue; new_sqdist = ((a_red - red) * (a_red - red) + (a_green - green) * (a_green - green) + (a_blue - blue) * (a_blue - blue)); if (new_sqdist <= sqdist) { sqdist = new_sqdist; i = j; /* best to date */ } } return (unsigned char)i; } /* compute number of bits needed to represent all color indices (when this is called, colors >= 1) */ static int bit_depth (int colors) { int size; unsigned int ucolors; /* subtract 1, see how many bits needed to represent result */ size = 0; for (ucolors = colors - 1; ucolors; ucolors = ucolors >> 1) size++; return size; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/i_defplot.c�������������������������������������������������������������������0000644�0001750�0001750�00000026432�11037243261�014125� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any GIFPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" /* use libxmi scan conversion module */ /* forward references */ static bool parse_bitmap_size (const char *bitmap_size_s, int *width, int *height); #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a GIFPlotter struct. */ const Plotter _pl_i_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_i_initialize, _pl_i_terminate, /* page manipulation */ _pl_i_begin_page, _pl_i_erase_page, _pl_i_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_i_paint_path, _pl_i_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_i_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_i_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_GIF; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 1; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 0; _plotter->data->have_pcl_fonts = 0; _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 0; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_HERSHEY; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_ellarc_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_NONE; _plotter->data->allowed_circle_scaling = AS_NONE; _plotter->data->allowed_ellipse_scaling = AS_AXES_PRESERVED; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_LIBXMI; _plotter->data->flipped_y = true; _plotter->data->imin = 0; _plotter->data->imax = 569; _plotter->data->jmin = 569; _plotter->data->jmax = 0; _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize data members specific to this derived class */ /* parameters */ _plotter->i_xn = _plotter->data->imax + 1; _plotter->i_yn = _plotter->data->jmin + 1; _plotter->i_num_pixels = (_plotter->i_xn) * (_plotter->i_yn); _plotter->i_animation = true; /* default, can be turned off */ _plotter->i_iterations = 0; _plotter->i_delay = 0; _plotter->i_interlace = false; _plotter->i_transparent = false; _plotter->i_transparent_color.red = 255; /* dummy */ _plotter->i_transparent_color.green = 255; /* dummy */ _plotter->i_transparent_color.blue = 255; /* dummy */ _plotter->i_transparent_index = 0; /* dummy */ /* storage used by libxmi's reentrant miDrawArcs_r() function for cacheing rasterized ellipses */ _plotter->i_arc_cache_data = (void *)miNewEllipseCache (); /* dynamic variables */ _plotter->i_painted_set = (void *)NULL; _plotter->i_canvas = (void *)NULL; /* N.B. _plotter->i_colormap is initialized in i_openpl.c */ _plotter->i_num_color_indices = 0; _plotter->i_bit_depth = 0; _plotter->i_frame_nonempty = false; _plotter->i_pixels_scanned = 0; _plotter->i_pass = 0; _plotter->i_hot.x = 0; _plotter->i_hot.y = 0; /* N.B. _plotter->i_global_colormap, i_num_global_color_indices are copied into later */ _plotter->i_header_written = false; /* initialize certain data members from device driver parameters */ /* is there a user-specified transparent color? */ { const char *transparent_name_s; plColor color; transparent_name_s = (const char *)_get_plot_param (_plotter->data, "TRANSPARENT_COLOR"); if (transparent_name_s && _string_to_color (transparent_name_s, &color, _plotter->data->color_name_cache)) /* have 24-bit RGB */ { _plotter->i_transparent = true; _plotter->i_transparent_color = color; } } /* produce an interlaced GIF? */ { const char *interlace_s; interlace_s = (const char *)_get_plot_param (_plotter->data, "INTERLACE" ); if (strcasecmp (interlace_s, "yes") == 0) _plotter->i_interlace = true; } /* turn off animation? */ { const char *animate_s; animate_s = (const char *)_get_plot_param (_plotter->data, "GIF_ANIMATION" ); if (strcasecmp (animate_s, "no") == 0) _plotter->i_animation = false; } /* determine number of iterations to be used (if animating) */ { const char *iteration_s; int num_iterations; iteration_s = (const char *)_get_plot_param (_plotter->data, "GIF_ITERATIONS" ); if (sscanf (iteration_s, "%d", &num_iterations) > 0 && num_iterations >= 0 && num_iterations <= 65535) _plotter->i_iterations = num_iterations; } /* determine delay after each frame, in 1/100 sec units */ { const char *delay_s; int delay; delay_s = (const char *)_get_plot_param (_plotter->data, "GIF_DELAY" ); if (sscanf (delay_s, "%d", &delay) > 0 && delay >= 0 && delay <= 65535) _plotter->i_delay = delay; } /* determine the range of device coordinates over which the graphics display will extend (and hence the transformation from user to device coordinates). */ { const char *bitmap_size_s; int width = 1, height = 1; bitmap_size_s = (const char *)_get_plot_param (_plotter->data, "BITMAPSIZE"); if (bitmap_size_s && parse_bitmap_size (bitmap_size_s, &width, &height) /* insist on range of 1..65535 for GIF format */ && width >= 1 && height >= 1 && width <= 65535 && height <= 65535) /* override defaults above */ { _plotter->data->imax = width - 1; _plotter->data->jmin = height - 1; _plotter->i_xn = width; _plotter->i_yn = height; _plotter->i_num_pixels = width * height; } } /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); } static bool parse_bitmap_size (const char *bitmap_size_s, int *width, int *height) { int local_width = 1, local_height = 1; if (bitmap_size_s /* should parse this better */ && sscanf (bitmap_size_s, "%dx%d", &local_width, &local_height) == 2 && local_width > 0 && local_height > 0) { *width = local_width; *height = local_height; return true; } else return false; } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points (temporarily) to the Plotter that is about to be deleted. */ void _pl_i_terminate (S___(Plotter *_plotter)) { /* free storage used by libxmi's reentrant miDrawArcs_r() function */ miDeleteEllipseCache ((miEllipseCache *)_plotter->i_arc_cache_data); #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER GIFPlotter::GIFPlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_i_initialize (); } GIFPlotter::GIFPlotter (FILE *outfile) :Plotter (outfile) { _pl_i_initialize (); } GIFPlotter::GIFPlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_i_initialize (); } GIFPlotter::GIFPlotter (ostream& out) : Plotter (out) { _pl_i_initialize (); } GIFPlotter::GIFPlotter () { _pl_i_initialize (); } GIFPlotter::GIFPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_i_initialize (); } GIFPlotter::GIFPlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_i_initialize (); } GIFPlotter::GIFPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_i_initialize (); } GIFPlotter::GIFPlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_i_initialize (); } GIFPlotter::GIFPlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_i_initialize (); } GIFPlotter::~GIFPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_i_terminate (); } #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/i_erase.c���������������������������������������������������������������������0000644�0001750�0001750�00000004112�11037243261�013556� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_i_erase_page (S___(Plotter *_plotter)) { /* If we're animating, emit the GIF header, and emit the just-finished frame as one of the images in the animated GIF. But don't do this for the zeroth frame unless it's nonempty. */ if (_plotter->i_animation && _plotter->data->page_number == 1 && _plotter->data->outfp && (_plotter->data->frame_number > 0 || _plotter->i_frame_nonempty)) { if (_plotter->i_header_written == false) { _pl_i_write_gif_header (S___(_plotter)); _plotter->i_header_written = true; } /* emit image using RLE module (see i_rle.c) */ _pl_i_write_gif_image (S___(_plotter)); } /* delete image: deallocate frame's libxmi canvas, reset frame's color table */ _pl_i_delete_image (S___(_plotter)); /* Create new image, consisting of libxmi canvas and colormap; initialized to background color. First entries in the color table will be (1) transparent color [if there is one, and we're animating] and (2) background color. */ _pl_i_new_image (S___(_plotter)); /* next frame will start empty */ _plotter->i_frame_nonempty = false; return true; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/i_openpl.c��������������������������������������������������������������������0000644�0001750�0001750�00000007762�11037243261�013772� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" bool _pl_i_begin_page (S___(Plotter *_plotter)) { /* With each call to openpl(), we reset the dynamic GIF-specific data members of the GIFPlotter. The data members, and the values that are set, are the same as are used in initializing the GIFPlotter (see i_defplot.c). */ _plotter->i_painted_set = (void *)NULL; _plotter->i_canvas = (void *)NULL; _plotter->i_num_color_indices = 0; _plotter->i_bit_depth = 0; _plotter->i_frame_nonempty = false; _plotter->i_pixels_scanned = 0; _plotter->i_pass = 0; _plotter->i_hot.x = 0; _plotter->i_hot.y = 0; _plotter->i_header_written = false; /* Create new image, consisting of bitmap and colormap; initialized to background color. First entries in color table will be (1) transparent color [if there is one, and we're animating] and (2) background color. May be the same. */ _pl_i_new_image (S___(_plotter)); /* frame starts empty */ _plotter->i_frame_nonempty = false; /* GIF file header not yet written */ _plotter->i_header_written = false; return true; } /* Internal function: Create new image, consisting of bitmap and colormap; initialized to background color. First entries in color table will be (1) transparent color [if there is one, and we're animating] and (2) background color. Maybe the same. */ void _pl_i_new_image (S___(Plotter *_plotter)) { int i; miPixel pixel; /* colormap starts empty (unused entries initted to `black'; we may later need to output some of the unused entries because GIF colormap lengths are always powers of 2) */ _plotter->i_num_color_indices = 0; for (i = 0; i < 256; i++) { _plotter->i_colormap[i].red = 0; _plotter->i_colormap[i].green = 0; _plotter->i_colormap[i].blue = 0; } /* flag any color indices stored in current drawing state as bogus */ _plotter->drawstate->i_pen_color_status = false; _plotter->drawstate->i_fill_color_status = false; _plotter->drawstate->i_bg_color_status = false; /* Transparency feature of GIF89a files requires that the index of the transparent color be the same for all images in the file. So if we're animating, i.e. writing a multi-image file, we allocate the transparent color as the first color index (#0) in all images. */ if (_plotter->i_transparent && _plotter->i_animation) /* allocate color cell in colormap; see i_color.c */ _pl_i_new_color_index (R___(_plotter) _plotter->i_transparent_color.red, _plotter->i_transparent_color.green, _plotter->i_transparent_color.blue); /* allocate bg color as next color index in colormap (it could well be the same as the transparent index); also construct a miPixel for it */ _pl_i_set_bg_color (S___(_plotter)); pixel.type = MI_PIXEL_INDEX_TYPE; pixel.u.index = _plotter->drawstate->i_bg_color_index; /* create libxmi miPaintedSet and miCanvas structs */ _plotter->i_painted_set = (void *)miNewPaintedSet (); _plotter->i_canvas = (void *)miNewCanvas ((unsigned int)_plotter->i_xn, (unsigned int)_plotter->i_yn, pixel); } ��������������plotutils-2.6/libplot/i_path.c����������������������������������������������������������������������0000644�0001750�0001750�00000050252�11037243261�013421� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This version is for GIF Plotters. By construction, for GIF Plotters our path buffer always contains either a segment list, or an ellipse object. If it's a segment list, it contains either (1) a sequence of line segments, or (2) a single circular or elliptic arc segment. Those are all sorts of path that libxmi can handle. (For an ellipse or circular/elliptic arc segment to have been added to the path buffer, the map from user to device coordinates must preserve axes.) */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" /* use libxmi scan conversion module */ #define DIST(p1, p2) sqrt( ((p1).x - (p2).x) * ((p1).x - (p2).x) \ + ((p1).y - (p2).y) * ((p1).y - (p2).y)) void _pl_i_paint_path (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { int i, polyline_len; bool identical_user_coordinates = true; double xu_last, yu_last; miGC *pGC; miPoint *miPoints, offset; miPixel fgPixel, bgPixel; miPixel pixels[2]; plPoint p0, p1, pc; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1)/* shouldn't happen */ break; if (_plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[1].type == S_ARC) /* segment buffer contains a single circular arc, not a polyline */ { p0 = _plotter->drawstate->path->segments[0].p; p1 = _plotter->drawstate->path->segments[1].p; pc = _plotter->drawstate->path->segments[1].pc; /* use libxmi rendering */ _pl_i_draw_elliptic_arc (R___(_plotter) p0, p1, pc); break; } if (_plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[1].type == S_ELLARC) /* segment buffer contains a single elliptic arc, not a polyline */ { p0 = _plotter->drawstate->path->segments[0].p; p1 = _plotter->drawstate->path->segments[1].p; pc = _plotter->drawstate->path->segments[1].pc; /* use libxmi rendering */ _pl_i_draw_elliptic_arc_2 (R___(_plotter) p0, p1, pc); break; } /* neither of above applied, so segment buffer contains a polyline, not an arc */ /* construct point array for libxmi module; convert vertices to device coordinates, removing runs */ miPoints = (miPoint *)_pl_xmalloc (_plotter->drawstate->path->num_segments * sizeof(miPoint)); polyline_len = 0; xu_last = 0.0; yu_last = 0.0; identical_user_coordinates = true; for (i = 0; i < _plotter->drawstate->path->num_segments; i++) { double xu, yu; int device_x, device_y; xu = _plotter->drawstate->path->segments[i].p.x; yu = _plotter->drawstate->path->segments[i].p.y; if (i > 0 && (xu != xu_last || yu != yu_last)) /* in user space, not all points are the same */ identical_user_coordinates = false; device_x = IROUND(XD(xu, yu)); device_y = IROUND(YD(xu, yu)); if ((polyline_len == 0) || (device_x != miPoints[polyline_len-1].x) || (device_y != miPoints[polyline_len-1].y)) /* add point, in integer device coordinates, to the array */ { miPoints[polyline_len].x = device_x; miPoints[polyline_len].y = device_y; polyline_len++; } xu_last = xu; yu_last = yu; } /* determine background pixel color */ bgPixel.type = MI_PIXEL_INDEX_TYPE; bgPixel.u.index = _plotter->drawstate->i_bg_color_index; pixels[0] = bgPixel; pixels[1] = bgPixel; /* construct an miGC (graphics context for the libxmi module); copy attributes from the Plotter's GC to it */ pGC = miNewGC (2, pixels); _set_common_mi_attributes (_plotter->drawstate, (void *)pGC); if (_plotter->drawstate->fill_type) /* not transparent, will fill */ { /* flattened drawing primitives, i.e., box/circle/ellipse, are always convex */ miPolygonShape polygon_shape = (_plotter->drawstate->path->primitive ? MI_SHAPE_CONVEX : MI_SHAPE_GENERAL); /* set fg color in GC (and bg color too) */ _pl_i_set_fill_color (S___(_plotter)); fgPixel.type = MI_PIXEL_INDEX_TYPE; fgPixel.u.index = _plotter->drawstate->i_fill_color_index; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); /* do the filling */ if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* special case: all user-space points in polyline were mapped to a single integer pixel, so just paint it */ miDrawPoints ((miPaintedSet *)_plotter->i_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, miPoints); else /* normal case */ miFillPolygon ((miPaintedSet *)_plotter->i_painted_set, pGC, polygon_shape, MI_COORD_MODE_ORIGIN, polyline_len, miPoints); } if (_plotter->drawstate->pen_type) /* pen is present, so edge the polyline */ { /* set fg color in GC (and bg color too) */ _pl_i_set_pen_color (S___(_plotter)); fgPixel.type = MI_PIXEL_INDEX_TYPE; fgPixel.u.index = _plotter->drawstate->i_pen_color_index; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); if (polyline_len == 1) /* All user-space points in the polyline were mapped to a single pixel. If (1) they weren't all the same to begin with, or (2) they were all the same to begin with and the cap mode is "round", then draw as a filled circle of diameter equal to the line width; otherwise draw nothing. */ { if (identical_user_coordinates == false || _plotter->drawstate->cap_type == PL_CAP_ROUND) { unsigned int sp_size = (unsigned int)_plotter->drawstate->quantized_device_line_width; if (sp_size == 0) sp_size = 1; if (sp_size == 1) /* subcase: just draw a point */ miDrawPoints ((miPaintedSet *)_plotter->i_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, miPoints); else /* draw a filled circle */ { int sp_offset; miArc arc; sp_offset = (_plotter->drawstate->quantized_device_line_width + 1) / 2; arc.x = miPoints[0].x - sp_offset; arc.y = miPoints[0].y - sp_offset; arc.width = sp_size; arc.height = sp_size; arc.angle1 = 0; arc.angle2 = 64 * 360; miFillArcs ((miPaintedSet *)_plotter->i_painted_set, pGC, 1, &arc); } } } else /* normal case: draw a nondegenerate polyline in integer device space */ miDrawLines ((miPaintedSet *)_plotter->i_painted_set, pGC, MI_COORD_MODE_ORIGIN, polyline_len, miPoints); } /* deallocate miGC and free temporary points array */ miDeleteGC (pGC); free (miPoints); /* copy from painted set to canvas, and clear */ offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas ((miPaintedSet *)_plotter->i_painted_set, (miCanvas *)_plotter->i_canvas, offset); miClearPaintedSet ((miPaintedSet *)_plotter->i_painted_set); } /* something was drawn in frame */ _plotter->i_frame_nonempty = true; break; case (int)PATH_ELLIPSE: { int ninetymult; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; plPoint pc; double rx, ry, angle; pc = _plotter->drawstate->path->pc; rx = _plotter->drawstate->path->rx; ry = _plotter->drawstate->path->ry; angle = _plotter->drawstate->path->angle; /* if angle is multiple of 90 degrees, modify to permit use of libxmi's arc rendering */ ninetymult = IROUND(angle / 90.0); if (angle == (double) (90 * ninetymult)) { angle = 0.0; if (ninetymult % 2) { double temp; temp = rx; rx = ry; ry = temp; } } rx = (rx < 0.0 ? -rx : rx); /* avoid obscure libxmi problems */ ry = (ry < 0.0 ? -ry : ry); /* axes flipped? (by default y-axis is, due to libxmi's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); /* location of `origin' (upper left corner of bounding rect. for ellipse) and width and height; libxmi's flipped-y convention affects these values */ xorigin = IROUND(XD(pc.x - x_orientation * rx, pc.y - y_orientation * ry)); yorigin = IROUND(YD(pc.x - x_orientation * rx, pc.y - y_orientation * ry)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * rx, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * ry)); /* Because this ellipse object was added to the path buffer, we already know that (1) the user->device frame map preserves coordinate axes, (2) effectively, angle == 0. These are necessary for the libxmi scan-conversion module to do the drawing. */ /* draw ellipse (elliptic arc aligned with the coordinate axes, arc range = 64*360 64'ths of a degree) */ _pl_i_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, 0, 64 * 360); } break; default: /* shouldn't happen */ break; } } /* Use libxmi rendering to draw what would be a circular arc in the user frame. If this is called, the map from user to device coordinates is assumed to preserve coordinate axes (it may be anisotropic [x and y directions scaled differently], and it may include a reflection through either or both axes). So it will be a circular or elliptic arc in the device frame, of the sort that libxmi supports. */ void _pl_i_draw_elliptic_arc (R___(Plotter *_plotter) plPoint p0, plPoint p1, plPoint pc) { double radius; double theta0, theta1; int startangle, anglerange; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; /* axes flipped? (by default y-axis is, due to xmi's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); /* radius of circular arc in user frame is distance to p0, and also to p1 */ radius = DIST(pc, p0); /* location of `origin' (upper left corner of bounding rect. on display) and width and height; X's flipped-y convention affects these values */ xorigin = IROUND(XD(pc.x - x_orientation * radius, pc.y - y_orientation * radius)); yorigin = IROUND(YD(pc.x - x_orientation * radius, pc.y - y_orientation * radius)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * radius, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * radius)); theta0 = _xatan2 (-y_orientation * (p0.y - pc.y), x_orientation * (p0.x - pc.x)) / M_PI; theta1 = _xatan2 (-y_orientation * (p1.y - pc.y), x_orientation * (p1.x - pc.x)) / M_PI; if (theta1 < theta0) theta1 += 2.0; /* adjust so that difference > 0 */ if (theta0 < 0.0) { theta0 += 2.0; /* adjust so that startangle > 0 */ theta1 += 2.0; } if (theta1 - theta0 > 1.0) /* swap if angle appear to be > 180 degrees */ { double tmp; tmp = theta0; theta0 = theta1; theta1 = tmp; theta1 += 2.0; /* adjust so that difference > 0 */ } if (theta0 >= 2.0 && theta1 >= 2.0) /* avoid obscure X bug */ { theta0 -= 2.0; theta1 -= 2.0; } startangle = IROUND(64 * theta0 * 180.0); /* in 64'ths of a degree */ anglerange = IROUND(64 * (theta1 - theta0) * 180.0); /* likewise */ _pl_i_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } /* Use libxmi rendering to draw what would be a quarter-ellipse in the user frame. If this is called, the map from user to device coordinates is assumed to preserve coordinate axes (it may be anisotropic [x and y directions scaled differently], and it may include a reflection through either or both axes). So it will be a quarter-ellipse in the device frame, of the sort that libxmi supports. */ void _pl_i_draw_elliptic_arc_2 (R___(Plotter *_plotter) plPoint p0, plPoint p1, plPoint pc) { double rx, ry; double x0, y0, x1, y1, xc, yc; int startangle, endangle, anglerange; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; /* axes flipped? (by default y-axis is, due to xmi's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); xc = pc.x, yc = pc.y; x0 = p0.x, y0 = p0.y; x1 = p1.x, y1 = p1.y; if (y0 == yc && x1 == xc) /* initial pt. on x-axis, final pt. on y-axis */ { /* semi-axes in user frame */ rx = (x0 > xc) ? x0 - xc : xc - x0; ry = (y1 > yc) ? y1 - yc : yc - y1; /* starting and ending angles; note flipped-y convention */ startangle = ((x0 > xc ? 1 : -1) * x_orientation == 1) ? 0 : 180; endangle = ((y1 > yc ? 1 : -1) * y_orientation == -1) ? 90 : 270; } else /* initial pt. on y-axis, final pt. on x-axis */ { /* semi-axes in user frame */ rx = (x1 > xc) ? x1 - xc : xc - x1; ry = (y0 > yc) ? y0 - yc : yc - y0; /* starting and ending angles; note flipped-y convention */ startangle = ((y0 > yc ? 1 : -1) * y_orientation == -1) ? 90 : 270; endangle = ((x1 > xc ? 1 : -1) * x_orientation == 1) ? 0 : 180; } if (endangle < startangle) endangle += 360; anglerange = endangle - startangle; /* always 90 or 270 */ /* our convention: a quarter-ellipse can only be 90 degrees of a libxmi ellipse, not 270 degrees, so interchange points */ if (anglerange == 270) { int tmp; tmp = startangle; startangle = endangle; endangle = tmp; anglerange = 90; } if (startangle >= 360) /* avoid obscure libxmi bug */ startangle -= 360; /* endangle no longer relevant */ /* location of `origin' (upper left corner of bounding rect. on display) and width and height; xmi's flipped-y convention affects these values */ xorigin = IROUND(XD(xc - x_orientation * rx, yc - y_orientation * ry)); yorigin = IROUND(YD(xc - x_orientation * rx, yc - y_orientation * ry)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * rx, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * ry)); /* reexpress in 64'ths of a degree (libxmi convention) */ startangle *= 64; anglerange *= 64; _pl_i_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } /* Draw an elliptic arc aligned with the coordinate axes, by invoking a function in the libxmi API. Takes account of the possible need for filling. The cases squaresize_x = 0 and squaresize_y = 0 are handled specially, since miFillArcs() and miDrawArcs() do not support them. */ void _pl_i_draw_elliptic_arc_internal (R___(Plotter *_plotter) int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange) { miGC *pGC; miArc arc; miPixel fgPixel, bgPixel; miPixel pixels[2]; miPoint offset; /* determine background pixel color */ bgPixel.type = MI_PIXEL_INDEX_TYPE; bgPixel.u.index = _plotter->drawstate->i_bg_color_index; pixels[0] = bgPixel; pixels[1] = bgPixel; /* construct an miGC (graphics context for the libxmi module); copy attributes from the Plotter's GC to it */ pGC = miNewGC (2, pixels); _set_common_mi_attributes (_plotter->drawstate, pGC); /* libxmi's definition of an elliptic arc aligned with the axes */ arc.x = xorigin; arc.y = yorigin; arc.width = squaresize_x; arc.height = squaresize_y; arc.angle1 = startangle; arc.angle2 = anglerange; if (_plotter->drawstate->fill_type) /* not transparent, so fill the arc */ { /* set fg color in GC (and bg color too) */ _pl_i_set_fill_color (S___(_plotter)); fgPixel.type = MI_PIXEL_INDEX_TYPE; fgPixel.u.index = _plotter->drawstate->i_fill_color_index; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); /* fill the arc */ if (squaresize_x <= 1 || squaresize_y <= 1) /* a special case, which miFillArcs() doesn't handle in the way we'd like; just paint a single pixel, irrespective of angle range */ { miPoint point; point.x = xorigin; point.y = yorigin; miDrawPoints ((miPaintedSet *)_plotter->i_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, &point); } else /* default case */ miFillArcs ((miPaintedSet *)_plotter->i_painted_set, pGC, 1, &arc); } if (_plotter->drawstate->pen_type) /* pen is present, so edge the arc */ { unsigned int sp_size = 0; /* keep compiler happy */ /* set fg color in GC (and bg color too) */ _pl_i_set_pen_color (S___(_plotter)); fgPixel.type = MI_PIXEL_INDEX_TYPE; fgPixel.u.index = _plotter->drawstate->i_pen_color_index; pixels[0] = bgPixel; pixels[1] = fgPixel; miSetGCPixels (pGC, 2, pixels); if (squaresize_x <= 1 || squaresize_y <= 1) /* Won't call miDrawArcs in the usual way, because it performs poorly when one of these two is zero, at least. Irrespective of angle range, will fill a disk of diameter equal to line width */ { int sp_offset; sp_size = (unsigned int)_plotter->drawstate->quantized_device_line_width; sp_offset = (int)(_plotter->drawstate->quantized_device_line_width + 1) / 2; if (sp_size == 0) sp_size = 1; arc.x -= sp_offset; arc.y -= sp_offset; arc.width = sp_size; arc.height = sp_size; arc.angle1 = 0; arc.angle2 = 64 * 360; } /* edge the arc by invoking libxmi's reentrant arc-drawing function, passing it as final argument a pointer to persistent storage maintained by the Plotter */ if (squaresize_x <= 1 || squaresize_y <= 1) /* miDrawArcs doesn't handle this case as we'd wish, will treat specially */ { if (sp_size == 1) /* special subcase: line width is small too, so just paint a single pixel rather than filling abovementioned disk */ { miPoint point; point.x = xorigin; point.y = yorigin; miDrawPoints ((miPaintedSet *)_plotter->i_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, &point); } else /* normal version of special case: draw filled disk of diameter equal to the line width, irrespective of the angle range */ miFillArcs((miPaintedSet *)_plotter->i_painted_set, pGC, 1, &arc); } else /* default case, which is what is almost always used */ miDrawArcs_r ((miPaintedSet *)_plotter->i_painted_set, pGC, 1, &arc, (miEllipseCache *)(_plotter->i_arc_cache_data)); } /* deallocate miGC */ miDeleteGC (pGC); /* copy from painted set to canvas, and clear */ offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas ((miPaintedSet *)_plotter->i_painted_set, (miCanvas *)_plotter->i_canvas, offset); miClearPaintedSet ((miPaintedSet *)_plotter->i_painted_set); } bool _pl_i_paint_paths (S___(Plotter *_plotter)) { return false; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/i_point.c���������������������������������������������������������������������0000644�0001750�0001750�00000005640�11037243261�013617� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" void _pl_i_paint_point (S___(Plotter *_plotter)) { double xx, yy; int ixx, iyy; miGC *pGC; miPixel fgPixel, bgPixel, pixels[2]; miPoint point, offset; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* convert point to floating-point device coordinates */ xx = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); yy = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); /* round to integer device (GIF) coordinates */ ixx = IROUND(xx); iyy = IROUND(yy); /* compute background and foreground color for miGC */ _pl_i_set_pen_color (S___(_plotter)); bgPixel.type = MI_PIXEL_INDEX_TYPE; bgPixel.u.index = _plotter->drawstate->i_bg_color_index; fgPixel.type = MI_PIXEL_INDEX_TYPE; fgPixel.u.index = _plotter->drawstate->i_pen_color_index; pixels[0] = bgPixel; pixels[1] = fgPixel; /* construct an miGC (graphics context for the libxmi module); copy attributes from the Plotter's GC to it */ pGC = miNewGC (2, pixels); _set_common_mi_attributes (_plotter->drawstate, (void *)pGC); point.x = ixx; point.y = iyy; miDrawPoints ((miPaintedSet *)_plotter->i_painted_set, pGC, MI_COORD_MODE_ORIGIN, 1, &point); /* deallocate miGC */ miDeleteGC (pGC); /* copy from painted set to canvas, and clear */ offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas ((miPaintedSet *)_plotter->i_painted_set, (miCanvas *)_plotter->i_canvas, offset); miClearPaintedSet ((miPaintedSet *)_plotter->i_painted_set); /* something was drawn in frame */ _plotter->i_frame_nonempty = true; } } ������������������������������������������������������������������������������������������������plotutils-2.6/libplot/i_rle.c�����������������������������������������������������������������������0000644�0001750�0001750�00000026073�11037243261�013253� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file (i_rle.c) is a module that does run-length encoding on a sequence of integers ("pixel values"), and writes the resulting encoded sequence to an output stream. The accompanying header file (i_rle.h) defines the external interface. The encoded sequence should be GIF-compatible, even though the compression technique is not LZW. This module encapsulates the miGIF compression routines, originally written by der Mouse and ivo. Their copyright notice is reproduced below. */ /*----------------------------------------------------------------------- * * miGIF Compression - mouse and ivo's GIF-compatible compression * * -run length encoding compression routines- * * Copyright (C) 1998 Hutchison Avenue Software Corporation * http://www.hasc.com * info@hasc.com * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation. This software is provided "AS IS." The Hutchison Avenue * Software Corporation disclaims all warranties, either express or implied, * including but not limited to implied warranties of merchantability and * fitness for a particular purpose, with respect to this code and accompanying * documentation. * * The miGIF compression routines do not, strictly speaking, generate files * conforming to the GIF spec, since the image data is not LZW-compressed * (this is the point: in order to avoid transgression of the Unisys patent * on the LZW algorithm.) However, miGIF generates data streams that any * reasonably sane LZW decompresser will decompress to what we want. * * miGIF compression uses run length encoding. It compresses horizontal runs * of pixels of the same color. This type of compression gives good results * on images with many runs, for example images with lines, text and solid * shapes on a solid-colored background. It gives little or no compression * on images with few runs, for example digital or scanned photos. * * der Mouse * mouse@rodents.montreal.qc.ca * 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B * * ivo@hasc.com * * The Graphics Interchange Format(c) is the Copyright property of * CompuServe Incorporated. GIF(sm) is a Service Mark property of * CompuServe Incorporated. * */ #include "sys-defines.h" /* libplot-specific */ #include "extern.h" /* libplot-specific */ #include "i_rle.h" /* forward references */ static void _block_out (rle_out *rle, unsigned char c); static void _write_block (rle_out *rle) { if (rle->ofile) { fputc (rle->oblen, rle->ofile); fwrite ((void *) &(rle->oblock[0]), 1, rle->oblen, rle->ofile); } #ifdef LIBPLOTTER else if (rle->outstream) { rle->outstream->put ((unsigned char)(rle->oblen)); rle->outstream->write ((const char *)(&(rle->oblock[0])), rle->oblen); } #endif rle->oblen = 0; } static void _block_out (rle_out *rle, unsigned char c) { rle->oblock[(rle->oblen)++] = c; if (rle->oblen >= 255) _write_block (rle); } static void _block_flush (rle_out *rle) { if (rle->oblen > 0) _write_block (rle); } static void _output (rle_out *rle, int val) { rle->obuf |= val << rle->obits; rle->obits += rle->out_bits; while (rle->obits >= 8) { _block_out (rle, (unsigned char)(rle->obuf & 0xff)); rle->obuf >>= 8; rle->obits -= 8; } } static void _output_flush (rle_out *rle) { if (rle->obits > 0) _block_out (rle, (unsigned char)(rle->obuf)); _block_flush (rle); } static void _did_clear (rle_out *rle) { rle->out_bits = rle->out_bits_init; rle->out_bump = rle->out_bump_init; rle->out_clear = rle->out_clear_init; rle->out_count = 0; rle->rl_table_max = 0; rle->just_cleared = true; } static void _output_plain (rle_out *rle, int c) { rle->just_cleared = false; _output (rle, c); rle->out_count++; if (rle->out_count >= rle->out_bump) { rle->out_bits++; rle->out_bump += 1 << (rle->out_bits - 1); } if (rle->out_count >= rle->out_clear) { _output (rle, rle->code_clear); _did_clear (rle); } } static unsigned int _isqrt (unsigned int x) { unsigned int r; unsigned int v; if (x < 2) return x; for (v=x, r=1; v; v>>=2, r<<=1) ; for ( ; ; ) { v = ((x / r) + r) / 2; if ((v == r) || (v == r+1)) return r; r = v; } } static unsigned int _compute_triangle_count (unsigned int count, unsigned int nrepcodes) { unsigned int perrep, cost; cost = 0; perrep = (nrepcodes * (nrepcodes+1)) / 2; while (count >= perrep) { cost += nrepcodes; count -= perrep; } if (count > 0) { unsigned int n; n = _isqrt (count); while ((n*(n+1)) >= 2*count) n--; while ((n*(n+1)) < 2*count) n++; cost += n; } return cost; } static void _max_out_clear (rle_out *rle) { rle->out_clear = rle->max_ocodes; } static void _reset_out_clear (rle_out *rle) { rle->out_clear = rle->out_clear_init; if (rle->out_count >= rle->out_clear) { _output (rle, rle->code_clear); _did_clear (rle); } } static void _rl_flush_fromclear (rle_out *rle, int count) { int n; _max_out_clear (rle); rle->rl_table_pixel = rle->rl_pixel; n = 1; while (count > 0) { if (n == 1) { rle->rl_table_max = 1; _output_plain (rle, rle->rl_pixel); count--; } else if (count >= n) { rle->rl_table_max = n; _output_plain (rle, rle->rl_basecode + n - 2); count -= n; } else if (count == 1) { (rle->rl_table_max)++; _output_plain (rle, rle->rl_pixel); count = 0; } else { rle->rl_table_max++; _output_plain (rle, rle->rl_basecode+count-2); count = 0; } if (rle->out_count == 0) n = 1; else n++; } _reset_out_clear (rle); } static void _rl_flush_clearorrep (rle_out *rle, int count) { int withclr; withclr = 1 + _compute_triangle_count ((unsigned int)count, (unsigned int)(rle->max_ocodes)); if (withclr < count) { _output (rle, rle->code_clear); _did_clear (rle); _rl_flush_fromclear (rle, count); } else for ( ; count>0; count--) _output_plain (rle, rle->rl_pixel); } static void _rl_flush_withtable (rle_out *rle, int count) { int repmax; int repleft; int leftover; repmax = count / rle->rl_table_max; leftover = count % rle->rl_table_max; repleft = (leftover ? 1 : 0); if (rle->out_count + repmax + repleft > rle->max_ocodes) { repmax = rle->max_ocodes - rle->out_count; leftover = count - (repmax * rle->rl_table_max); repleft = 1 + _compute_triangle_count ((unsigned int)leftover, (unsigned int)(rle->max_ocodes)); } if (1 + _compute_triangle_count ((unsigned int)count, (unsigned int)(rle->max_ocodes)) < repmax + repleft) { _output (rle, rle->code_clear); _did_clear (rle); _rl_flush_fromclear (rle, count); return; } _max_out_clear (rle); for ( ; repmax>0; repmax--) _output_plain (rle, rle->rl_basecode + rle->rl_table_max - 2); if (leftover) { if (rle->just_cleared) _rl_flush_fromclear (rle, leftover); else if (leftover == 1) _output_plain (rle, rle->rl_pixel); else _output_plain (rle, rle->rl_basecode + leftover - 2); } _reset_out_clear (rle); } /* end a run in progress */ static void _rl_flush (rle_out *rle) { if (rle->rl_count == 1) /* not a real run, just output pixel */ _output_plain (rle, rle->rl_pixel); else { if (rle->just_cleared) _rl_flush_fromclear (rle, rle->rl_count); else if ((rle->rl_table_max < 2) || (rle->rl_table_pixel != rle->rl_pixel)) _rl_flush_clearorrep (rle, rle->rl_count); else _rl_flush_withtable (rle, rle->rl_count); } rle->rl_count = 0; } /***********************************************************************/ /* EXTERNAL INTERFACE */ /***********************************************************************/ /* create new RLE struct, which writes to a specified stream */ rle_out * #ifdef LIBPLOTTER _rle_init (FILE *fp, ostream *out, int bit_depth) #else _rle_init (FILE *fp, int bit_depth) #endif { int init_bits; rle_out *rle; /* Initial length for compression codes, one bit longer than the minimum number of bits needed to represent the set of pixel values. The IMAX() and the addition of 1 bit are "because of some algorithmic constraints". */ init_bits = IMAX(bit_depth, 2) + 1; rle = (rle_out *)_pl_xmalloc(sizeof(rle_out)); rle->ofile = fp; #ifdef LIBPLOTTER rle->outstream = out; #endif rle->obuf = 0; rle->obits = 0; rle->oblen = 0; rle->code_clear = 1 << (init_bits - 1); /* 100..000 */ rle->code_eof = rle->code_clear + 1; /* 100..001 */ rle->rl_basecode = rle->code_eof + 1; /* 100..010 */ rle->out_bump_init = (1 << (init_bits - 1)) - 1; /* 011..111 */ /* for images with a lot of runs, making out_clear_init larger will give better compression. */ /* 011..110 */ rle->out_clear_init = (init_bits <= 3) ? 9 : (rle->out_bump_init - 1); rle->out_bits_init = init_bits; rle->max_ocodes = (1 << GIFBITS) - ((1 << (rle->out_bits_init - 1)) + 3); _did_clear (rle); _output (rle, rle->code_clear); rle->rl_count = 0; return rle; } /* send one pixel to the RLE */ void _rle_do_pixel (rle_out *rle, int c) { /* if a run needs to be terminated by being written out, do so */ if ((rle->rl_count > 0) && (c != rle->rl_pixel)) _rl_flush (rle); /* if current run can be continued, do so (internally) */ if (rle->rl_pixel == c) rle->rl_count++; /* otherwise start a new one */ else { rle->rl_pixel = c; rle->rl_count = 1; } } /* flush out any data remaining in RLE; write EOF and deallocate RLE */ void _rle_terminate (rle_out *rle) { /* if a run in progress, end it */ if (rle->rl_count > 0) _rl_flush (rle); _output (rle, rle->code_eof); _output_flush (rle); /* deallocate */ free (rle); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/n_defplot.c�������������������������������������������������������������������0000644�0001750�0001750�00000012506�11037243261�014127� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any PNM Plotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a PNMPlotter struct. It is the same as for a BitmapPlotter, except for the routines _pl_n_initialize and _pl_n_terminate. */ const Plotter _pl_n_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_n_initialize, _pl_n_terminate, /* page manipulation */ _pl_b_begin_page, _pl_b_erase_page, _pl_b_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_b_paint_path, _pl_b_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_b_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_n_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_b_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_PNM; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES; /* initialize data members specific to this derived class */ _plotter->n_portable_output = false; /* initialize certain data members from device driver parameters */ /* determine version of PBM/PGM/PPM format (binary or ascii) */ { const char *portable_s; portable_s = (const char *)_get_plot_param (_plotter->data, "PNM_PORTABLE"); if (strcasecmp (portable_s, "yes") == 0) _plotter->n_portable_output = true; else _plotter->n_portable_output = false; /* default value */ } } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points (temporarily) to the Plotter that is about to be deleted. */ void _pl_n_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_b_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER PNMPlotter::PNMPlotter (FILE *infile, FILE *outfile, FILE *errfile) : BitmapPlotter (infile, outfile, errfile) { _pl_n_initialize (); } PNMPlotter::PNMPlotter (FILE *outfile) : BitmapPlotter (outfile) { _pl_n_initialize (); } PNMPlotter::PNMPlotter (istream& in, ostream& out, ostream& err) : BitmapPlotter (in, out, err) { _pl_n_initialize (); } PNMPlotter::PNMPlotter (ostream& out) : BitmapPlotter (out) { _pl_n_initialize (); } PNMPlotter::PNMPlotter () { _pl_n_initialize (); } PNMPlotter::PNMPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) : BitmapPlotter (infile, outfile, errfile, parameters) { _pl_n_initialize (); } PNMPlotter::PNMPlotter (FILE *outfile, PlotterParams ¶meters) : BitmapPlotter (outfile, parameters) { _pl_n_initialize (); } PNMPlotter::PNMPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : BitmapPlotter (in, out, err, parameters) { _pl_n_initialize (); } PNMPlotter::PNMPlotter (ostream& out, PlotterParams ¶meters) : BitmapPlotter (out, parameters) { _pl_n_initialize (); } PNMPlotter::PNMPlotter (PlotterParams ¶meters) : BitmapPlotter (parameters) { _pl_n_initialize (); } PNMPlotter::~PNMPlotter () { _pl_n_terminate (); } #endif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/n_write.c���������������������������������������������������������������������0000644�0001750�0001750�00000035510�11037243261�013624� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains a special version of the function _maybe_output_image, which is called by the BitmapPlotter closepl method (see b_closepl.c). Provided that the current page is the first, this version writes out a PNM (i.e., PBM/PGM/PPM) file for it. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" /* line lengths in ASCII PBM/PGM/PPM formats (max. no of pixels per line) */ #define MAX_PBM_PIXELS_PER_LINE 70 #define MAX_PGM_PIXELS_PER_LINE 16 #define MAX_PPM_PIXELS_PER_LINE 5 /* forward references */ static int best_image_type (miPixel **pixmap, int width, int height); /* do a rapid decimal printf of a nonnegative integer, in range 0..999 to a character buffer */ #define FAST_PRINT(integer_to_print, linebuf, pos) \ { \ int k, hundreds, tens, ones; \ bool force_tens; \ \ k = (integer_to_print); \ hundreds = k / 100; \ k -= (100 * hundreds); \ tens = k / 10; \ ones = k - (10 * tens); \ \ force_tens = false; \ if (hundreds) \ { \ linebuf[pos++] = hundreds + '0'; \ force_tens = true; \ } \ if (force_tens || tens) \ linebuf[pos++] = tens + '0'; \ linebuf[pos++] = ones + '0'; \ } int _pl_n_maybe_output_image (S___(Plotter *_plotter)) { /* Output the page as a PBM/PGM/PPM file, but only if it's page #1, since PBM/PGM/PPM format supports only a single page of graphics. */ if (_plotter->data->page_number == 1) /* emit PBM/PGM/PPM file */ _pl_n_write_pnm (S___(_plotter)); return true; } /* determine which sort of PNM (i.e. PBM/PGM/PPM) file should be output, and output it */ void _pl_n_write_pnm (S___(Plotter *_plotter)) { int type; /* 0,1,2 = PBM/PGM/PPM */ int width, height; miPixel **pixmap; width = _plotter->b_xn; height = _plotter->b_yn; pixmap = ((miCanvas *)(_plotter->b_canvas))->drawable->pixmap; type = best_image_type (pixmap, width, height); switch (type) { case 0: /* PBM */ _pl_n_write_pbm (S___(_plotter)); break; case 1: /* PGM */ _pl_n_write_pgm (S___(_plotter)); break; case 2: /* PPM */ default: _pl_n_write_ppm (S___(_plotter)); break; } } /* write output (header plus RGB values) in PBM format */ void _pl_n_write_pbm (S___(Plotter *_plotter)) { int i, j; bool portable = _plotter->n_portable_output; miPixel **pixmap = ((miCanvas *)(_plotter->b_canvas))->drawable->pixmap; int width = _plotter->b_xn; int height = _plotter->b_yn; FILE *fp = _plotter->data->outfp; #ifdef LIBPLOTTER ostream *stream = _plotter->data->outstream; #endif #ifdef LIBPLOTTER if (fp == NULL && stream == NULL) return; #else if (fp == NULL) return; #endif if (fp) { if (portable) /* emit ascii format */ { unsigned char linebuf[MAX_PBM_PIXELS_PER_LINE]; int pos = 0; /* position in line buffer */ fprintf (fp, "\ P1\n\ # CREATOR: GNU libplot drawing library, version %s\n\ %d %d\n", PL_LIBPLOT_VER_STRING, width, height); for (j = 0; j < height; j++) for (i = 0; i < width; i++) { if (pixmap[j][i].u.rgb[0] == 0) linebuf[pos++] = '1'; /* 1 = black */ else linebuf[pos++] = '0'; if (pos >= MAX_PBM_PIXELS_PER_LINE || i == (width - 1)) { fwrite ((void *)linebuf, sizeof(unsigned char), pos, fp); putc ('\n', fp); pos = 0; } } } else /* emit binary format */ { int bitcount, bytecount; unsigned char outbyte, set; unsigned char *rowbuf; fprintf (fp, "\ P4\n\ # CREATOR: GNU libplot drawing library, version %s\n\ %d %d\n", PL_LIBPLOT_VER_STRING, width, height); /* row buffer contains bytes, each representing up to 8 pixels */ rowbuf = (unsigned char *)_pl_xmalloc (((width + 7) / 8) * sizeof (unsigned char)); for (j = 0; j < height; j++) { bitcount = 0; bytecount = 0; outbyte = 0; for (i = 0; i < width; i++) { set = (pixmap[j][i].u.rgb[0] == 0 ? 1 : 0); /* 1 = black */ outbyte = (outbyte << 1) | set; bitcount++; if (bitcount == 8) /* write byte to row (8 bits) */ { rowbuf[bytecount++] = outbyte; outbyte = 0; bitcount = 0; } } if (bitcount) /* write final byte (not completely filled) */ { outbyte = (outbyte << (8 - bitcount)); rowbuf[bytecount++] = outbyte; } /* emit row of bytes */ fwrite ((void *)rowbuf, sizeof(unsigned char), bytecount, fp); } free (rowbuf); } } #ifdef LIBPLOTTER else if (stream) { if (portable) /* emit ascii format */ { unsigned char linebuf[MAX_PBM_PIXELS_PER_LINE]; int pos = 0; /* position in line buffer */ (*stream) << "\ P1\n\ # CREATOR: GNU libplot drawing library, version " << PL_LIBPLOT_VER_STRING << '\n' << width << ' ' << height << '\n'; for (j = 0; j < height; j++) for (i = 0; i < width; i++) { if (pixmap[j][i].u.rgb[0] == 0) linebuf[pos++] = '1'; /* 1 = black */ else linebuf[pos++] = '0'; if (pos >= MAX_PBM_PIXELS_PER_LINE || i == (width - 1)) { stream->write ((const char *)linebuf, pos); stream->put ('\n'); pos = 0; } } } else /* emit binary format */ { int bitcount, bytecount; unsigned char outbyte, set; unsigned char *rowbuf; (*stream) << "\ P4\n\ # CREATOR: GNU libplot drawing library, version " << PL_LIBPLOT_VER_STRING << '\n' << width << ' ' << height << '\n'; /* row buffer contains bytes, each representing up to 8 pixels */ rowbuf = (unsigned char *)_pl_xmalloc (((width + 7) / 8) * sizeof (unsigned char)); for (j = 0; j < height; j++) { bitcount = 0; bytecount = 0; outbyte = 0; for (i = 0; i < width; i++) { set = (pixmap[j][i].u.rgb[0] == 0 ? 1 : 0); /* 1 = black */ outbyte = (outbyte << 1) | set; bitcount++; if (bitcount == 8) /* write byte to row (8 bits) */ { rowbuf[bytecount++] = outbyte; outbyte = 0; bitcount = 0; } } if (bitcount) /* write final byte (not completely filled) */ { outbyte = (outbyte << (8 - bitcount)); rowbuf[bytecount++] = outbyte; } /* emit row of bytes */ stream->write ((const char *)rowbuf, bytecount); } free (rowbuf); } } #endif } /* write output (header plus RGB values) in PGM format */ void _pl_n_write_pgm (S___(Plotter *_plotter)) { int i, j; bool portable = _plotter->n_portable_output; miPixel **pixmap = ((miCanvas *)(_plotter->b_canvas))->drawable->pixmap; int width = _plotter->b_xn; int height = _plotter->b_yn; FILE *fp = _plotter->data->outfp; #ifdef LIBPLOTTER ostream *stream = _plotter->data->outstream; #endif #ifdef LIBPLOTTER if (fp == NULL && stream == NULL) return; #else if (fp == NULL) return; #endif if (fp) { if (portable) /* emit ascii format */ { /* allow room for 3 decimal digits, plus a space, per pixel */ unsigned char linebuf[4 * MAX_PGM_PIXELS_PER_LINE]; int pos = 0; int num_pixels = 0; fprintf (fp, "\ P2\n\ # CREATOR: GNU libplot drawing library, version %s\n\ %d %d\n\ 255\n", PL_LIBPLOT_VER_STRING, width, height); for (j = 0; j < height; j++) for (i = 0; i < width; i++) { /* emit <=3 decimal digits per grayscale pixel */ FAST_PRINT (pixmap[j][i].u.rgb[0], linebuf, pos) num_pixels++; if (num_pixels >= MAX_PGM_PIXELS_PER_LINE || i == (width - 1)) { fwrite ((void *)linebuf, sizeof(unsigned char), pos, fp); putc ('\n', fp); num_pixels = 0; pos = 0; } else linebuf[pos++] = ' '; } } else /* emit binary format */ { unsigned char *rowbuf; rowbuf = (unsigned char *)_pl_xmalloc (width * sizeof (unsigned char)); fprintf (fp, "\ P5\n\ # CREATOR: GNU libplot drawing library, version %s\n\ %d %d\n\ 255\n", PL_LIBPLOT_VER_STRING, width, height); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) rowbuf[i] = pixmap[j][i].u.rgb[0]; fwrite ((void *)rowbuf, sizeof(unsigned char), width, fp); } free (rowbuf); } } #ifdef LIBPLOTTER else if (stream) { if (portable) /* emit ascii format */ { /* allow room for 3 decimal digits, plus a space, per pixel */ unsigned char linebuf[4 * MAX_PGM_PIXELS_PER_LINE]; int pos = 0; int num_pixels = 0; (*stream) << "\ P2\n\ # CREATOR: GNU libplot drawing library, version " << PL_LIBPLOT_VER_STRING << '\n' << width << ' ' << height << '\n' << "255" << '\n'; for (j = 0; j < height; j++) for (i = 0; i < width; i++) { /* emit <=3 decimal digits per grayscale pixel */ FAST_PRINT (pixmap[j][i].u.rgb[0], linebuf, pos) num_pixels++; if (num_pixels >= MAX_PGM_PIXELS_PER_LINE || i == (width - 1)) { stream->write ((const char *)linebuf, pos); stream->put ('\n'); num_pixels = 0; pos = 0; } else linebuf[pos++] = ' '; } } else /* emit binary format */ { unsigned char *rowbuf; (*stream) << "\ P5\n\ # CREATOR: GNU libplot drawing library, version " << PL_LIBPLOT_VER_STRING << '\n' << width << ' ' << height << '\n' << "255" << '\n'; rowbuf = (unsigned char *)_pl_xmalloc (width * sizeof (unsigned char)); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) rowbuf[i] = pixmap[j][i].u.rgb[0]; stream->write ((const char *)rowbuf, width); } free (rowbuf); } } #endif } /* write output (header plus RGB values) in PPM format */ void _pl_n_write_ppm (S___(Plotter *_plotter)) { int i, j; bool portable = _plotter->n_portable_output; miPixel **pixmap = ((miCanvas *)(_plotter->b_canvas))->drawable->pixmap; int width = _plotter->b_xn; int height = _plotter->b_yn; FILE *fp = _plotter->data->outfp; #ifdef LIBPLOTTER ostream *stream = _plotter->data->outstream; #endif #ifdef LIBPLOTTER if (fp == NULL && stream == NULL) return; #else if (fp == NULL) return; #endif if (fp) { if (portable) /* emit ascii format */ { /* allow room for 3 decimal digits, plus a space, per pixel */ unsigned char linebuf[4 * MAX_PGM_PIXELS_PER_LINE]; int pos = 0; int num_pixels = 0; fprintf (fp, "\ P3\n\ # CREATOR: GNU libplot drawing library, version %s\n\ %d %d\n\ 255\n", PL_LIBPLOT_VER_STRING, width, height); for (j = 0; j < height; j++) for (i = 0; i < width; i++) { /* emit <=3 decimal digits per RGB component */ FAST_PRINT (pixmap[j][i].u.rgb[0], linebuf, pos) linebuf[pos++] = ' '; FAST_PRINT (pixmap[j][i].u.rgb[1], linebuf, pos) linebuf[pos++] = ' '; FAST_PRINT (pixmap[j][i].u.rgb[2], linebuf, pos) num_pixels++; if (num_pixels >= MAX_PPM_PIXELS_PER_LINE || i == (width - 1)) { fwrite ((void *)linebuf, sizeof(unsigned char), pos, fp); putc ('\n', fp); num_pixels = 0; pos = 0; } else linebuf[pos++] = ' '; } } else /* emit binary format */ { unsigned char *rowbuf; int component; fprintf (fp, "\ P6\n\ # CREATOR: GNU libplot drawing library, version %s\n\ %d %d\n\ 255\n", PL_LIBPLOT_VER_STRING, width, height); rowbuf = (unsigned char *)_pl_xmalloc (3 * width * sizeof (unsigned char)); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) for (component = 0; component < 3; component++) rowbuf[3 * i + component] = pixmap[j][i].u.rgb[component]; fwrite ((void *)rowbuf, sizeof(unsigned char), 3 * width, fp); } free (rowbuf); } } #ifdef LIBPLOTTER else if (stream) { if (portable) /* emit ascii format */ { /* allow room for 3 decimal digits, plus a space, per pixel */ unsigned char linebuf[4 * MAX_PGM_PIXELS_PER_LINE]; int pos = 0; int num_pixels = 0; (*stream) << "\ P3\n\ # CREATOR: GNU libplot drawing library, version " << PL_LIBPLOT_VER_STRING << '\n' << width << ' ' << height << '\n' << "255" << '\n'; for (j = 0; j < height; j++) for (i = 0; i < width; i++) { /* emit <=3 decimal digits per RGB component */ FAST_PRINT (pixmap[j][i].u.rgb[0], linebuf, pos) linebuf[pos++] = ' '; FAST_PRINT (pixmap[j][i].u.rgb[1], linebuf, pos) linebuf[pos++] = ' '; FAST_PRINT (pixmap[j][i].u.rgb[2], linebuf, pos) num_pixels++; if (num_pixels >= MAX_PPM_PIXELS_PER_LINE || i == (width - 1)) { stream->write ((const char *)linebuf, pos); stream->put ('\n'); num_pixels = 0; pos = 0; } else linebuf[pos++] = ' '; } } else /* emit binary format */ { unsigned char *rowbuf; int component; (*stream) << "\ P6\n\ # CREATOR: GNU libplot drawing library, version " << PL_LIBPLOT_VER_STRING << '\n' << width << ' ' << height << '\n' << "255" << '\n'; rowbuf = (unsigned char *)_pl_xmalloc (3 * width * sizeof (unsigned char)); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) for (component = 0; component < 3; component++) rowbuf[3 * i + component] = pixmap[j][i].u.rgb[component]; stream->write ((const char *)rowbuf, 3 * width); } free (rowbuf); } } #endif } /* return best type for writing an image (0=mono, 1=grey, 2=color) */ static int best_image_type (miPixel **pixmap, int width, int height) { int i, j; int type = 0; /* default is mono */ for (j = 0; j < height; j++) for (i = 0; i < width; i++) { unsigned char red, green, blue; red = pixmap[j][i].u.rgb[0]; green = pixmap[j][i].u.rgb[1]; blue = pixmap[j][i].u.rgb[2]; if (type == 0) /* up to now, all pixels are black or white */ { if (! ((red == (unsigned char)0 && green == (unsigned char)0 && blue == (unsigned char)0) || (red == (unsigned char)255 && green == (unsigned char)255 && blue == (unsigned char)255))) { if (red == green && red == blue) type = 1; /* need grey */ else { type = 2; /* need color */ return type; } } } else if (type == 1) { if (red != green || red != blue) { type = 2; /* need color */ return type; } } } return type; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/z_defplot.c�������������������������������������������������������������������0000644�0001750�0001750�00000013551�11037243262�014145� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any PNG Plotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of a PNGPlotter struct. It is the same as for a BitmapPlotter, except for the routines _pl_z_initialize and _pl_z_terminate. */ const Plotter _pl_z_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_z_initialize, _pl_z_terminate, /* page manipulation */ _pl_b_begin_page, _pl_b_erase_page, _pl_b_end_page, /* drawing state manipulation */ _pl_g_push_state, _pl_g_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_b_paint_path, _pl_b_paint_paths, _pl_g_path_is_flushable, _pl_g_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_b_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_g_paint_text_string, _pl_g_get_text_width, /* private low-level `retrieve font' method */ _pl_g_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_g_flush_output, /* error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_z_initialize (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_b_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_PNG; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES; /* initialize data members specific to this derived class */ /* parameters */ _plotter->z_interlace = false; _plotter->z_transparent = false; _plotter->z_transparent_color.red = 255; /* dummy */ _plotter->z_transparent_color.green = 255; /* dummy */ _plotter->z_transparent_color.blue = 255; /* dummy */ /* initialize certain data members from device driver parameters */ /* produce an interlaced PNG? */ { const char *interlace_s; interlace_s = (const char *)_get_plot_param (_plotter->data, "INTERLACE" ); if (strcasecmp (interlace_s, "yes") == 0) _plotter->z_interlace = true; } /* is there a user-specified transparent color? */ { const char *transparent_name_s; plColor color; transparent_name_s = (const char *)_get_plot_param (_plotter->data, "TRANSPARENT_COLOR"); if (transparent_name_s && _string_to_color (transparent_name_s, &color, _plotter->data->color_name_cache)) /* have 24-bit RGB */ { _plotter->z_transparent = true; _plotter->z_transparent_color = color; } } } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points (temporarily) to the Plotter that is about to be deleted. */ void _pl_z_terminate (S___(Plotter *_plotter)) { #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_b_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER PNGPlotter::PNGPlotter (FILE *infile, FILE *outfile, FILE *errfile) : BitmapPlotter (infile, outfile, errfile) { _pl_z_initialize (); } PNGPlotter::PNGPlotter (FILE *outfile) : BitmapPlotter (outfile) { _pl_z_initialize (); } PNGPlotter::PNGPlotter (istream& in, ostream& out, ostream& err) : BitmapPlotter (in, out, err) { _pl_z_initialize (); } PNGPlotter::PNGPlotter (ostream& out) : BitmapPlotter (out) { _pl_z_initialize (); } PNGPlotter::PNGPlotter () { _pl_z_initialize (); } PNGPlotter::PNGPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) : BitmapPlotter (infile, outfile, errfile, parameters) { _pl_z_initialize (); } PNGPlotter::PNGPlotter (FILE *outfile, PlotterParams ¶meters) : BitmapPlotter (outfile, parameters) { _pl_z_initialize (); } PNGPlotter::PNGPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : BitmapPlotter (in, out, err, parameters) { _pl_z_initialize (); } PNGPlotter::PNGPlotter (ostream& out, PlotterParams ¶meters) : BitmapPlotter (out, parameters) { _pl_z_initialize (); } PNGPlotter::PNGPlotter (PlotterParams ¶meters) : BitmapPlotter (parameters) { _pl_z_initialize (); } PNGPlotter::~PNGPlotter () { _pl_z_terminate (); } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/z_write.c���������������������������������������������������������������������0000644�0001750�0001750�00000037064�11037243262�013647� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains a special version of the function _maybe_output_image, which is called by the BitmapPlotter closepl method (see b_closepl.c). This version is for the PNGPlotter subclass: provided that the current page of graphics is the first, it writes out a PNG file. */ /* Note: this calls gmtime(), which is not reentrant. For thread-safety we should use gmtime_r() instead, but declaring it portably is a hard problem (cf. comments at head of p_defplot.c and c_defplot.c). */ /* Other than this egregious problem, this code is thread-safe (the warning and error handlers which we pass to libpng lock and unlock the `message mutex' defined in g_error.c). Since libpng uses callbacks, warning and error messages aren't produced simply by calling the functions _plotter->warning() and _plotter->error() defined in g_error.c. */ /* Note: we should improve this code to support the use of user-specified warning and error handlers for libplot; cf. the code in g_error.c. But their use isn't documented yet. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include /* song and dance to define time_t, and declare both time() and gmtime() */ #ifdef HAVE_SYS_TYPES_H #include /* for time_t on some pre-ANSI Unix systems */ #endif #ifdef TIME_WITH_SYS_TIME #include /* for time() on some pre-ANSI Unix systems */ #include /* for gmtime() */ #else /* not TIME_WITH_SYS_TIME, include only one (prefer ) */ #ifdef HAVE_SYS_TIME_H #include #else /* not HAVE_SYS_TIME_H */ #include #endif /* not HAVE_SYS_TIME_H */ #endif /* not TIME_WITH_SYS_TIME */ /* Mutex for locking the warning/error message subsystem. Defined in g_error.c */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H extern pthread_mutex_t _message_mutex; #endif #endif static const char _short_months[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; /* forward references */ static int _image_type (miPixel **pixmap, int width, int height); static void _our_error_fn_stdio (png_struct *png_ptr, const char *data); static void _our_warn_fn_stdio (png_struct *png_ptr, const char *data); #ifdef LIBPLOTTER static void _our_IO_flush_fn (png_struct *png_ptr); static void _our_error_fn_stream (png_struct *png_ptr, const char *data); static void _our_warn_fn_stream (png_struct *png_ptr, const char *data); static void _our_write_fn (png_struct *png_ptr, png_byte *data, png_size_t length); #endif /* LIBPLOTTER */ int _pl_z_maybe_output_image (S___(Plotter *_plotter)) { miPixel **pixmap; /* pixmap in miCanvas */ int width, height; int image_type, bit_depth, color_type; png_struct *png_ptr; png_info *info_ptr; char time_buf[32], software_buf[64]; png_text text_ptr[10]; time_t clock; struct tm *tmsp; FILE *fp = _plotter->data->outfp; FILE *errorfp = _plotter->data->errfp; void *error_ptr; png_error_ptr error_fn_ptr, warn_fn_ptr; #ifdef LIBPLOTTER ostream *stream = _plotter->data->outstream; ostream *errorstream = _plotter->data->errstream; #endif #ifdef LIBPLOTTER if (fp == (FILE *)NULL && stream == (ostream *)NULL) return 0; #else if (fp == (FILE *)NULL) return 0; #endif /* Output the page as a PNG file, but only if it's page #1, since PNG format supports only a single page of graphics. */ if (_plotter->data->page_number != 1) return 0; /* work out libpng error handling (i.e. callback functions and data) */ #ifdef LIBPLOTTER if (errorstream) { error_fn_ptr = _our_error_fn_stream; warn_fn_ptr = _our_warn_fn_stream; error_ptr = (void *)errorstream; } else if (errorfp) { error_fn_ptr = _our_error_fn_stdio; warn_fn_ptr = _our_warn_fn_stdio; error_ptr = (void *)errorfp; } else { error_fn_ptr = NULL; warn_fn_ptr = NULL; error_ptr = (void *)NULL; } #else /* not LIBPLOTTER */ if (errorfp) { error_fn_ptr = _our_error_fn_stdio; warn_fn_ptr = _our_warn_fn_stdio; error_ptr = (void *)errorfp; } else { error_fn_ptr = NULL; warn_fn_ptr = NULL; error_ptr = (void *)NULL; } #endif /* not LIBPLOTTER */ /* create png_struct, install error/warning handlers */ png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, error_ptr, error_fn_ptr, warn_fn_ptr); if (png_ptr == (png_struct *)NULL) return -1; /* allocate/initialize image information data */ info_ptr = png_create_info_struct (png_ptr); if (info_ptr == (png_info *)NULL) { png_destroy_write_struct (&png_ptr, (png_info **)NULL); return -1; } /* cleanup after libpng errors (error handler does a longjmp) */ if (setjmp (png_ptr->jmpbuf)) { png_destroy_write_struct (&png_ptr, (png_info **)NULL); return -1; } #ifdef LIBPLOTTER if (stream) { /* use custom write and flush functions, defined below */ png_set_write_fn (png_ptr, (void *)stream, (png_rw_ptr)_our_write_fn, (png_flush_ptr)_our_IO_flush_fn); } else /* must have fp!=NULL, so use default stdio-based output */ png_init_io (png_ptr, fp); #else /* not LIBPLOTTER */ /* use default stdio-based output */ png_init_io (png_ptr, fp); #endif /* not LIBPLOTTER */ /* extract pixmap (2D array of miPixels) from miCanvas */ pixmap = ((miCanvas *)(_plotter->b_canvas))->drawable->pixmap; /* what is best image type that can be used? 0/1/2 = mono/gray/rgb */ width = _plotter->b_xn; height = _plotter->b_yn; image_type = _image_type (pixmap, width, height); switch (image_type) { case 0: /* mono */ bit_depth = 1; color_type = PNG_COLOR_TYPE_GRAY; break; case 1: /* gray */ bit_depth = 8; color_type = PNG_COLOR_TYPE_GRAY; break; case 2: /* rgb */ default: bit_depth = 8; color_type = PNG_COLOR_TYPE_RGB; break; } /* Set image information in file header. Width and height are up to 2^31, bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or PNG_INTERLACE_ADAM7. compression_type and filter_type MUST currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. */ png_set_IHDR (png_ptr, info_ptr, (unsigned int)width, (unsigned int)height, bit_depth, color_type, _plotter->z_interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); /* set transparent color (if user specified one) */ if (_plotter->z_transparent) { plColor transparent_color = _plotter->z_transparent_color; bool transparent_color_ok = true; png_color_16 trans_value; switch (image_type) { case 0: /* mono */ if ((transparent_color.red != 0 && transparent_color.red != 0xffff) || (transparent_color.green != 0 && transparent_color.green != 0xffff) || (transparent_color.blue != 0 && transparent_color.blue != 0xffff) || (transparent_color.red != transparent_color.green || transparent_color.red != transparent_color.blue)) /* user-specified transparent color isn't monochrome */ transparent_color_ok = false; else trans_value.gray = (png_uint_16)transparent_color.red; break; case 1: /* gray */ if (transparent_color.red != transparent_color.green || transparent_color.red != transparent_color.blue) /* user-specified transparent color isn't grayscale */ transparent_color_ok = false; else trans_value.gray = (png_uint_16)transparent_color.red; break; case 2: /* rgb */ default: trans_value.red = (png_uint_16)transparent_color.red; trans_value.green = (png_uint_16)transparent_color.green; trans_value.blue = (png_uint_16)transparent_color.blue; break; } if (transparent_color_ok) png_set_tRNS (png_ptr, info_ptr, (png_byte *)NULL, 1, &trans_value); } /* add some comments to file header */ text_ptr[0].key = (char *)"Title"; text_ptr[0].text = (char *)"PNG plot"; text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; text_ptr[1].key = (char *)"Creation Time"; time (&clock); tmsp = gmtime (&clock); sprintf (time_buf, "%d %s %d %02d:%02d:%02d +0000", /* RFC 1123 date */ (tmsp->tm_mday) % 31, _short_months[(tmsp->tm_mon) % 12], 1900 + tmsp->tm_year, (tmsp->tm_hour) % 24, (tmsp->tm_min) % 60, (tmsp->tm_sec) % 61); text_ptr[1].text = time_buf; text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; text_ptr[2].key = (char *)"Software"; sprintf (software_buf, "GNU libplot drawing library %s", PL_LIBPLOT_VER_STRING); text_ptr[2].text = software_buf; text_ptr[2].compression = PNG_TEXT_COMPRESSION_NONE; png_set_text(png_ptr, info_ptr, text_ptr, 3); /* write out PNG file header */ png_write_info (png_ptr, info_ptr); /* Write out image data, a row at a time; support multiple passes over image if interlacing. We don't simply call png_write_image() because the image in the miCanvas's pixmap is a 2-D array of miPixels, and sizeof(miPixel) > 4 is possible. Instead we copy each miPixel in a row into a local row buffer, and write out the row buffer. */ { png_byte *rowbuf; int num_passes, pass; switch (image_type) { case 0: /* mono */ rowbuf = (png_byte *)_pl_xmalloc(((width + 7)/8) * sizeof(png_byte)); break; case 1: /* gray */ rowbuf = (png_byte *)_pl_xmalloc(width * sizeof(png_byte)); break; case 2: /* rgb */ default: rowbuf = (png_byte *)_pl_xmalloc(3 * width * sizeof(png_byte)); break; } if (_plotter->z_interlace) /* turn on interlace handling; if interlacing, need >1 pass over image */ num_passes = png_set_interlace_handling (png_ptr); else num_passes = 1; for (pass = 0; pass < num_passes; pass++) { int i, j; for (j = 0; j < height; j++) { png_byte *ptr; /* fill row buffer with 3 bytes per miPixel (RGB), or 1 byte (gray), or 1 bit (mono) */ ptr = rowbuf; for (i = 0; i < width; i++) { switch (image_type) { case 0: /* mono */ if (i % 8 == 0) { if (i != 0) ptr++; *ptr = (png_byte)0; } if (pixmap[j][i].u.rgb[0]) /* white pixel */ *ptr |= (1 << (7 - (i % 8))); break; case 1: /* gray */ *ptr++ = (png_byte)pixmap[j][i].u.rgb[0]; break; case 2: /* rgb */ default: *ptr++ = (png_byte)pixmap[j][i].u.rgb[0]; *ptr++ = (png_byte)pixmap[j][i].u.rgb[1]; *ptr++ = (png_byte)pixmap[j][i].u.rgb[2]; break; } } /* write out row buffer */ png_write_rows (png_ptr, &rowbuf, 1); } } free (rowbuf); } /* write out PNG file trailer (could add more comments here) */ png_write_end (png_ptr, (png_info *)NULL); /* tear down */ png_destroy_write_struct (&png_ptr, (png_info **)NULL); return true; } /* return best type for writing an image (0=mono, 1=grey, 2=color) */ static int _image_type (miPixel **pixmap, int width, int height) { int i, j; int type = 0; /* default is mono */ for (j = 0; j < height; j++) for (i = 0; i < width; i++) { unsigned char red, green, blue; red = pixmap[j][i].u.rgb[0]; green = pixmap[j][i].u.rgb[1]; blue = pixmap[j][i].u.rgb[2]; if (type == 0) /* up to now, all pixels are black or white */ { if (! ((red == (unsigned char)0 && green == (unsigned char)0 && blue == (unsigned char)0) || (red == (unsigned char)255 && green == (unsigned char)255 && blue == (unsigned char)255))) { if (red == green && red == blue) type = 1; /* need grey */ else { type = 2; /* need color */ return type; } } } else if (type == 1) { if (red != green || red != blue) { type = 2; /* need color */ return type; } } } return type; } /* custom error and warning handlers (for stdio) */ static void _our_error_fn_stdio (png_struct *png_ptr, const char *data) { FILE *errfp; errfp = (FILE *)png_get_error_ptr (png_ptr); if (errfp) { #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the message subsystem */ pthread_mutex_lock (&_message_mutex); #endif #endif fprintf (errfp, "libplot: libpng error: %s\n", data); #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the message subsystem */ pthread_mutex_unlock (&_message_mutex); #endif #endif } longjmp (png_ptr->jmpbuf, 1); } static void _our_warn_fn_stdio (png_struct *png_ptr, const char *data) { FILE *errfp; errfp = (FILE *)png_get_error_ptr (png_ptr); if (errfp) { #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the message subsystem */ pthread_mutex_lock (&_message_mutex); #endif #endif fprintf (errfp, "libplot: libpng: %s\n", data); #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the message subsystem */ pthread_mutex_unlock (&_message_mutex); #endif #endif } } #ifdef LIBPLOTTER /* custom write and flush functions (for streams) */ static void _our_write_fn (png_struct *png_ptr, png_byte *data, png_size_t length) { ostream *stream; stream = (ostream *)png_get_io_ptr (png_ptr); stream->write ((const char *)data, length); } static void _our_IO_flush_fn (png_struct *png_ptr) { ostream *stream; stream = (ostream *)png_get_io_ptr (png_ptr); stream->flush (); } /* custom error and warning handlers (for streams) */ static void _our_error_fn_stream (png_struct *png_ptr, const char *data) { ostream *errstream; errstream = (ostream *)png_get_error_ptr (png_ptr); if (errstream) { #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the message subsystem */ pthread_mutex_lock (&_message_mutex); #endif #endif (*errstream) << "libplot: libpng error: " << data << 'n'; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the message subsystem */ pthread_mutex_unlock (&_message_mutex); #endif #endif } longjmp (png_ptr->jmpbuf, 1); } static void _our_warn_fn_stream (png_struct *png_ptr, const char *data) { ostream *errstream; errstream = (ostream *)png_get_error_ptr (png_ptr); if (errstream) { #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the message subsystem */ pthread_mutex_lock (&_message_mutex); #endif #endif (*errstream) << "libplot: libpng: " << data << 'n'; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the message subsystem */ pthread_mutex_unlock (&_message_mutex); #endif #endif } } #endif /* LIBPLOTTER */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_afftext.c�������������������������������������������������������������������0000644�0001750�0001750�00000042056�11037243262�014151� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This is the XAffText module, which was originally independent of libplot. The header file that accompanies it is x_afftext.h. To use the module independently of libplot, simply do not specify "-DLIBPLOT" at compile time. The module supplies two external functions, which are generalizations of the core X11 function XDrawString: XAffDrawRotString and XAffDrawAffString. They draw, respectively, a rotated text string and (more generally) a matrix-transformed text string. In both cases a specified core X font is used. The rotation angle and transformation matrix are specified by the user. The matrix is passed as a 4-element array, with the element ordering convention and sign convention being those of the Matrix Extension to the XLFD (X Logical Font Description). `XAffText' is an abbreviation of `X11 affinely transformed text'. The module was inspired by Alan Richardson's xvertext module for displaying rotated text strings in X11, using the core X fonts. It works in a similar way. (It retrieves a bitmap from the X server into an XImage, transforms the XImage, monochrome pixel by pixel, and sends it back to a bitmap on the server, for use as a stipple.) But it supports arbitrary transformation matrices, and pays extra attention to pixel-level accuracy. It uses integer arithmetic when possible. */ #include "x_afftext.h" #ifdef DEBUG #ifdef __cplusplus #include #else /* not __cplusplus */ #include #endif /* not __cplusplus */ #endif /* DEBUG */ #ifdef LIBPLOT #include "sys-defines.h" /* plotutils-specific */ #include "extern.h" /* libplot-specific */ #else /* not LIBPLOT */ #include #include #include #include #ifndef M_PI #define M_PI 3.14159265358979323846264 #endif #define IMAX(a,b) ((a) > (b) ? (a) : (b)) #define IMIN(a,b) ((a) < (b) ? (a) : (b)) #define IROUND(x) ((int) ((x) > 0 ? (x) + 0.5 : (x) - 0.5)) #define _pl_xmalloc malloc #define _pl_xcalloc calloc #endif /* not LIBPLOT */ #define XAFF_XPROD(v,a) ((v).x * (a)[0] + (v).y * (a)[2]) #define XAFF_YPROD(v,a) ((v).x * (a)[1] + (v).y * (a)[3]) typedef struct XAffVectorStruct { int x, y; } XAffVector; typedef struct XAffRealVectorStruct { double x, y; } XAffRealVector; typedef struct XAffSizeStruct { unsigned int x, y; } XAffSize; typedef struct XAffAffinedTextStruct { Pixmap bitmap; /* depth-1 Pixmap, i.e., bitmap */ XAffSize size; /* bitmap size */ XAffVector origin; /* location of text origin within bitmap */ } XAffAffinedText; /* forward decls of internal ctors/dtors */ static XImage * XAffCreateXImage (Display *dpy, XAffSize size); static void XAffFreeXImage (XImage *im); static XAffAffinedText *XAffCreateAffinedText (Display *dpy, XFontStruct *font, double a[4], const char *text); static void XAffFreeAffinedText (Display *dpy, XAffAffinedText *afftext); /* other internal functions */ static int can_use_XDrawString (XFontStruct *font, double a[4], const char *text); #ifdef DEBUG static void print_image (const XImage *im_in, XAffSize size); #endif /* DEBUG */ /**************************************************************************/ /* Create/destroy a depth-1 XImage object */ /**************************************************************************/ static XImage * XAffCreateXImage (Display *dpy, XAffSize size) { XImage *im; char *data; if (size.x == 0 || size.y == 0) return NULL; data = (char *)_pl_xcalloc(size.y * ((size.x + 7) / 8), 1); if (data == NULL) return NULL; im = XCreateImage (dpy, DefaultVisual(dpy, DefaultScreen(dpy)), (unsigned int)1, /* depth = 1 */ XYBitmap, 0, /* origin = 0 */ data, size.x, size.y, 8, /* pad: quantum of each scanline */ 0); /* scanlines contigous in memory */ if (im == NULL) return NULL; im->bitmap_bit_order = MSBFirst; im->byte_order = MSBFirst; return im; } static void XAffFreeXImage (XImage *im) { free (im->data); XFree (im); } /**************************************************************************/ /* Create/destroy an affinely transformed text string */ /**************************************************************************/ static XAffAffinedText * XAffCreateAffinedText (Display *dpy, XFontStruct *font, double a[4], const char *text) { XAffAffinedText *afftext = NULL; GC gc; XCharStruct bounds; int direction, font_ascent, font_descent; XAffSize size_in, size_out; XAffRealVector corner_in[4]; XAffVector origin_in, origin_out; XAffVector mincorner, maxcorner; Pixmap bitmap_in, bitmap_out; XImage *im_in, *im_out; int scanline_len_in, scanline_len_out; double aa[4], a_inverse[4], det; int i, j; /* allocate memory for new instance */ afftext = (XAffAffinedText *)_pl_xmalloc(sizeof(XAffAffinedText)); if (!afftext) return NULL; /* as passed, a[] is in the format used in the matrix LFD enhancement, which assumes a right-handed coordinate system; so convert it to X11's left-hand coordinate system (y grows downward) */ aa[0] = a[0]; aa[1] = -a[1]; aa[2] = -a[2]; aa[3] = a[3]; /* invert transformation matrix */ det = aa[0] * aa[3] - aa[1] * aa[2]; if (det == 0.0) return NULL; /* don't support singular matrices */ a_inverse[0] = aa[3] / det; a_inverse[1] = - aa[1] / det; a_inverse[2] = - aa[2] / det; a_inverse[3] = aa[0] / det; /* to include all pixels in text, how large should bitmap be? */ XTextExtents (font, text, strlen (text), &direction, &font_ascent, &font_descent, &bounds); /* bitmap size, number-of-pixels by number-of-pixels */ size_in.x = - bounds.lbearing + bounds.rbearing; size_in.y = bounds.ascent + bounds.descent; /* within this bitmap, where is `origin' of text string? */ origin_in.x = - bounds.lbearing; origin_in.y = bounds.ascent; /* paranoia */ if (size_in.x == 0 || size_in.y == 0) return NULL; /* work around a possible bug: some X displays can't create pixmaps that are only one pixel wide or high */ if (size_in.x == 1) size_in.x = 2; if (size_in.y == 1) size_in.y = 2; #ifdef DEBUG fprintf (stderr, "string \"%s\": lbearing=%hd, rbearing=%hd, ascent=%hd, descent=%hd\n", text, bounds.lbearing, bounds.rbearing, bounds.ascent, bounds.descent); fprintf (stderr, "\tsize=(%u,%u), origin=(%d,%d)\n", size_in.x, size_in.y, origin_in.x, origin_in.y); #endif /* create bitmap for text, and lightweight gc */ bitmap_in = XCreatePixmap (dpy, DefaultRootWindow (dpy), size_in.x, size_in.y, (unsigned int)1); gc = XCreateGC (dpy, bitmap_in, (unsigned long)0, (XGCValues *)NULL); XSetBackground (dpy, gc, (unsigned long)0); XSetFont (dpy, gc, font->fid); /* clear the bitmap */ XSetForeground (dpy, gc, (unsigned long)0); XFillRectangle (dpy, bitmap_in, gc, 0, 0, size_in.x, size_in.y); XSetForeground (dpy, gc, (unsigned long)1); /* draw text onto bitmap */ XDrawString (dpy, bitmap_in, gc, origin_in.x, origin_in.y, text, strlen (text)); /* create local image */ im_in = XAffCreateXImage (dpy, size_in); if (im_in == NULL) return NULL; /* copy bitmap to it */ XGetSubImage (dpy, bitmap_in, 0, 0, size_in.x, size_in.y, (unsigned long)1, XYPixmap, im_in, 0, 0); im_in->format = XYBitmap; #ifdef DEBUG print_image (im_in, size_in); #endif /* DEBUG */ /* free now-unneeded bitmap */ XFreePixmap (dpy, bitmap_in); /* vertices of image, in real coordinates, if each pixel is taken to be a unit square */ corner_in[0].x = -0.5; corner_in[0].y = -0.5; corner_in[1].x = (int)size_in.x - 0.5; corner_in[1].y = -0.5; corner_in[2].x = (int)size_in.x - 0.5; corner_in[2].y = (int)size_in.y - 0.5; corner_in[3].x = -0.5; corner_in[3].y = (int)size_in.y - 0.5; /* compute vertices (in integer coordinates) of a rectangular array of pixels that will snugly hold the affinely transformed image */ mincorner.x = mincorner.y = INT_MAX; maxcorner.x = maxcorner.y = INT_MIN; for (i = 0; i < 4; i++) { XAffRealVector v_shifted_in; XAffVector corner_out[4]; v_shifted_in.x = corner_in[i].x - origin_in.x; v_shifted_in.y = corner_in[i].y - origin_in.y; corner_out[i].x = IROUND(XAFF_XPROD(v_shifted_in, aa)) + origin_in.x; corner_out[i].y = IROUND(XAFF_YPROD(v_shifted_in, aa)) + origin_in.y; mincorner.x = IMIN(mincorner.x, corner_out[i].x); mincorner.y = IMIN(mincorner.y, corner_out[i].y); maxcorner.x = IMAX(maxcorner.x, corner_out[i].x); maxcorner.y = IMAX(maxcorner.y, corner_out[i].y); } size_out.x = maxcorner.x - mincorner.x + 1; size_out.y = maxcorner.y - mincorner.y + 1; origin_out.x = origin_in.x - mincorner.x; origin_out.y = origin_in.y - mincorner.y; /* work around a possible bug: some X displays can't create pixmaps that are only one pixel wide or high */ if (size_out.x == 1) size_out.x = 2; if (size_out.y == 1) size_out.y = 2; #ifdef DEBUG fprintf (stderr, "size_in = (%u,%u)\n", size_in.x, size_in.y); fprintf (stderr, "size_out = (%u,%u)\n", size_out.x, size_out.y); fprintf (stderr, "origin_in = (%d,%d)\n", origin_in.x, origin_in.y); fprintf (stderr, "origin_out = (%d,%d)\n", origin_out.x, origin_out.y); #endif /* create 2nd image, to hold affinely transformed text */ im_out = XAffCreateXImage (dpy, size_out); if (im_out == NULL) return NULL; /* copy from 1st image to this new one */ scanline_len_in = (size_in.x + 7) / 8; scanline_len_out = (size_out.x + 7) / 8; for (j = 0; j < (int)size_out.y; j++) { int scanline_hit; XAffVector v_in, v_out, v_shifted_out; scanline_hit = 0; v_out.y = j; v_shifted_out.y = v_out.y + mincorner.y - origin_in.y; for (i = 0; i < (int)size_out.x; i++) { v_out.x = i; v_shifted_out.x = v_out.x + mincorner.x - origin_in.x; v_in.x = IROUND(XAFF_XPROD(v_shifted_out, a_inverse)) + origin_in.x; v_in.y = IROUND(XAFF_YPROD(v_shifted_out, a_inverse)) + origin_in.y; if ((!(v_in.x >= 0)) || (!(v_in.x < (int)size_in.x)) || (!(v_in.y >= 0)) || (!(v_in.y < (int)size_in.y))) { if (scanline_hit) /* will be no more hits; so move to next scanline */ break; else /* move to next position on this scanline */ continue; } else scanline_hit = 1; if (im_in->data[v_in.y * scanline_len_in + v_in.x / 8] & (128 >> (v_in.x % 8))) { im_out->data[v_out.y * scanline_len_out + v_out.x / 8] |= (128 >> (v_out.x % 8)); } } } /* free now-unneeded 1st image */ XAffFreeXImage (im_in); /* create bitmap to hold transformed text */ bitmap_out = XCreatePixmap (dpy, DefaultRootWindow (dpy), size_out.x, size_out.y, (unsigned int)1); /* copy transformed text from 2nd image */ XPutImage (dpy, bitmap_out, gc, im_out, 0, 0, 0, 0, size_out.x, size_out.y); #ifdef DEBUG print_image (im_out, size_out); #endif /* free 2nd image and GC */ XAffFreeXImage (im_out); XFreeGC (dpy, gc); /* fill in data members of instance */ afftext->bitmap = bitmap_out; afftext->size = size_out; afftext->origin = origin_out; return afftext; } static void XAffFreeAffinedText (Display *dpy, XAffAffinedText *afftext) { XFreePixmap (dpy, afftext->bitmap); free (afftext); } /**************************************************************************/ /* Draw an affinely transformed text string */ /**************************************************************************/ int XAffDrawAffString (Display *dpy, Drawable drawable, GC gc, XFontStruct *font, int x, int y, double a[4], const char *text) { XAffAffinedText *afftext; GC our_gc; if (text == NULL || strlen (text) == 0) return 0; if (can_use_XDrawString (font, a, text)) /* a[] must be equal to, or near the identity matrix */ return XDrawString (dpy, drawable, gc, x, y, text, strlen (text)); /* construct annotated bitmap, containing affinely transformed text */ afftext = XAffCreateAffinedText (dpy, font, a, text); if (afftext == NULL) return 0; /* copy gc from user's gc */ our_gc = XCreateGC (dpy, drawable, (unsigned long)0, (XGCValues *)NULL); XCopyGC (dpy, gc, GCForeground|GCFunction|GCPlaneMask, our_gc); /* use stipple drawing technique (screen-door patterning) */ XSetFillStyle (dpy, our_gc, FillStippled); XSetStipple (dpy, our_gc, afftext->bitmap); XSetTSOrigin (dpy, our_gc, x - afftext->origin.x, y - afftext->origin.y); XFillRectangle (dpy, drawable, our_gc, x - afftext->origin.x, y - afftext->origin.y, afftext->size.x, afftext->size.y); /* free resources */ XFreeGC (dpy, our_gc); XAffFreeAffinedText (dpy, afftext); return 0; } /**************************************************************************/ /* Special case: draw a rotated text string */ /**************************************************************************/ int XAffDrawRotString (Display *dpy, Drawable drawable, GC gc, XFontStruct *font, int x, int y, double angle, const char *text) { double a[4]; /* convert rotation angle to radians */ angle *= (M_PI / 180.0); /* construct transformation matrix (using the XLFD-matrix-extension sign convention for the off-diagonal elements) */ a[0] = + cos (angle); a[1] = + sin (angle); a[2] = - sin (angle); a[3] = + cos (angle); return XAffDrawAffString (dpy, drawable, gc, font, x, y, a, text); } /**************************************************************************/ /* Can simply use core XDrawString function rather than transforming the */ /* resulting bitmap? (Yes, if the matrix a[] is near the identity.) */ /**************************************************************************/ static int can_use_XDrawString (XFontStruct *font, double a[4], const char *text) { int direction, font_ascent, font_descent; XCharStruct bounds; XAffVector corner_in[4], corner_out[4]; XAffSize size_in; XAffVector origin_in; int i, can_do_it = 1; double aa[4]; /* as passed, a[] is in the format used in the matrix LFD enhancement, which assumes a right-handed coordinate system; so convert it to X11's left-hand coordinate system (y grows downward) */ aa[0] = a[0]; aa[1] = -a[1]; aa[2] = -a[2]; aa[3] = a[3]; /* to include all pixels in text, how large should bitmap be? */ XTextExtents (font, text, strlen (text), &direction, &font_ascent, &font_descent, &bounds); /* bitmap size, number-of-pixels by number-of-pixels */ size_in.x = - bounds.lbearing + bounds.rbearing; size_in.y = bounds.ascent + bounds.descent; /* within this bitmap, where is `origin' of text string? */ origin_in.x = - bounds.lbearing; origin_in.y = bounds.ascent; /* corners in integer coordinates, relative to origin */ corner_in[0].x = 0; corner_in[0].y = 0; corner_in[1].x = size_in.x - 1; corner_in[1].y = 0; corner_in[2].x = size_in.x - 1; corner_in[2].y = size_in.y - 1; corner_in[3].x = 0; corner_in[3].y = size_in.y - 1; /* compute how corners are transformed by a[] */ for (i = 0; i < 4; i++) { XAffVector v_shifted_in; v_shifted_in.x = corner_in[i].x - origin_in.x; v_shifted_in.y = corner_in[i].y - origin_in.y; corner_out[i].x = IROUND(XAFF_XPROD(v_shifted_in, aa)) + origin_in.x; corner_out[i].y = IROUND(XAFF_YPROD(v_shifted_in, aa)) + origin_in.y; if (corner_out[i].x != corner_in[i].x || corner_out[i].y != corner_in[i].y) /* at least one corner moves, no good, alas */ { can_do_it = 0; break; } } return can_do_it; } /**************************************************************************/ /* Print an image to stderr (used for debugging, if -DDEBUG is specified)*/ /**************************************************************************/ #ifdef DEBUG static void print_image (const XImage *im, XAffSize size) { int scanline_len; int i, j; scanline_len = (size.x + 7) / 8; for (j = 0; j < (int)size.y; j++) { for (i = 0; i < (int)size.x; i++) { if (im->data[j * scanline_len + i / 8] & (128 >> (i % 8))) fprintf (stderr, "*"); else fprintf (stderr, " "); } fprintf (stderr, "\n"); } } #endif /* DEBUG */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_attribs.c�������������������������������������������������������������������0000644�0001750�0001750�00000022563�11037243262�014161� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This internal method is invoked by an XDrawablePlotter (or XPlotter) before drawing any polyline. It sets the relevant attributes in our X11 graphics contexts (the one used for drawing, and the one used for filling) to what they should be. This includes line type, cap type, join type, line width, and fill rule. The GC's are elements of the X11-specific part of any libplot drawing state. The X11-specific part also includes `non-opaque' representations of the attributes, which can be easily queried. They are updated too. Any invoker should pass an argument to this method, indicating which of the two graphics contexts (the one used for drawing, and the one used for filling) should be updated. The only attribute we set in the latter is the fill rule; all the other attributes listed above are set in the former. */ #include "sys-defines.h" #include "extern.h" /* The length of each dash must fit in an unsigned char (X11 convention) */ #define MAX_DASH_LENGTH 255 /* ARGS: x_gc_type specifies which of our X GC's to modify */ void _pl_x_set_attributes (R___(Plotter *_plotter) int x_gc_type) { int i; if (_plotter->x_drawable1 == (Drawable)NULL && _plotter->x_drawable2 == (Drawable)NULL) /* no drawables, so GC's must not have been created (see x_savestate.c); do nothing */ return; if (x_gc_type == X_GC_FOR_DRAWING) /* update attributes in GC used for drawing */ { XGCValues gcv; bool have_dash_list = false; unsigned char *dash_list = (unsigned char *)NULL; int dash_list_len = 0, dash_offset = 0; if (_plotter->drawstate->dash_array_in_effect) /* have user-specified dash array */ { dash_list_len = _plotter->drawstate->dash_array_len; if (dash_list_len > 0) { bool odd_length; double min_sing_val, max_sing_val; int i, dash_cycle_length; /* compute minimum singular value of user->device coordinate map, which we use as a multiplicative factor to convert line widths (cf. g_linewidth.c), dash lengths, etc. */ _matrix_sing_vals (_plotter->drawstate->transform.m, &min_sing_val, &max_sing_val); odd_length = (dash_list_len & 1 ? true : false); dash_list = (unsigned char *)_pl_xmalloc ((odd_length ? 2 : 1) * dash_list_len * sizeof(unsigned char)); have_dash_list = true; /* will free.. */ dash_cycle_length = 0; for (i = 0; i < dash_list_len; i++) { double unrounded_dashlen; int dashlen; unrounded_dashlen = min_sing_val * _plotter->drawstate->dash_array[i]; dashlen = IROUND(unrounded_dashlen); dashlen = IMAX(dashlen, 1); dashlen = IMIN(dashlen, MAX_DASH_LENGTH); /* convert dash length, int -> unsigned char */ dash_list[i] = (unsigned int)dashlen; dash_cycle_length += dashlen; if (odd_length) { dash_list[dash_list_len + i] = (unsigned int)dashlen; dash_cycle_length += dashlen; } } if (odd_length) dash_list_len *= 2; dash_offset = IROUND(min_sing_val * _plotter->drawstate->dash_offset); if (dash_cycle_length > 0) /* choose an offset in range 0..dash_cycle_length-1 */ { while (dash_offset < 0) dash_offset += dash_cycle_length; dash_offset %= dash_cycle_length; } gcv.line_style = LineOnOffDash; } else /* no dashes, will draw as solid line */ gcv.line_style = LineSolid; } else /* have one of the canonical line types */ { if (_plotter->drawstate->line_type != PL_L_SOLID) { const int *dash_array; int i, scale; dash_list_len = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array_len; dash_array = _pl_g_line_styles[_plotter->drawstate->line_type].dash_array; /* scale by line width in terms of pixels, if nonzero */ scale = _plotter->drawstate->quantized_device_line_width; if (scale <= 0) scale = 1; dash_list = (unsigned char *)_pl_xmalloc (PL_MAX_DASH_ARRAY_LEN * sizeof(unsigned char)); have_dash_list = true; /* will free.. */ for (i = 0; i < dash_list_len; i++) { int dashlen; dashlen = scale * dash_array[i]; dashlen = IMAX(dashlen, 1); dashlen = IMIN(dashlen, MAX_DASH_LENGTH); dash_list[i] = (unsigned int)dashlen; /* int->unsigned char*/ } /* use a non-solid line style */ gcv.line_style = LineOnOffDash; dash_offset = 0; } else /* no dash list */ { /* use a solid line style */ gcv.line_style = LineSolid; } } /* update dash style attributes (dash offset and dash list) */ if (have_dash_list) { bool do_it = false; if (_plotter->drawstate->x_gc_dash_offset != dash_offset || _plotter->drawstate->x_gc_dash_list_len != dash_list_len) do_it = true; if (do_it == false) { for (i = 0; i < dash_list_len; i++) { if ((unsigned char)_plotter->drawstate->x_gc_dash_list[i] != dash_list[i]) { do_it = true; break; } } } if (do_it) { /* change the GC used for drawing */ XSetDashes (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, dash_offset, (char *)dash_list, dash_list_len); /* update non-opaque information on dash style, by installing dash_list as our `non-opaque dash list' */ /* free former non-opaque dash list if any */ if (_plotter->drawstate->x_gc_dash_list_len > 0) free ((char *)_plotter->drawstate->x_gc_dash_list); _plotter->drawstate->x_gc_dash_list = (char *)dash_list; _plotter->drawstate->x_gc_dash_list_len = dash_list_len; _plotter->drawstate->x_gc_dash_offset = dash_offset; } else free (dash_list); } /* update line style attribute */ if (_plotter->drawstate->x_gc_line_style != gcv.line_style) { /* change the GC used for drawing */ XChangeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, GCLineStyle, &gcv); /* update non-opaque line-style element */ _plotter->drawstate->x_gc_line_style = gcv.line_style; } /* update cap style attribute */ switch (_plotter->drawstate->cap_type) { case PL_CAP_BUTT: default: gcv.cap_style = CapButt; break; case PL_CAP_ROUND: gcv.cap_style = CapRound; break; case PL_CAP_PROJECT: gcv.cap_style = CapProjecting; break; case PL_CAP_TRIANGULAR: /* not supported by X11 */ gcv.cap_style = CapRound; break; } if (_plotter->drawstate->x_gc_cap_style != gcv.cap_style) { /* change the GC used for drawing */ XChangeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, GCCapStyle, &gcv); /* update non-opaque cap style element */ _plotter->drawstate->x_gc_cap_style = gcv.cap_style; } /* update join style attribute */ switch (_plotter->drawstate->join_type) { case PL_JOIN_MITER: default: gcv.join_style = JoinMiter; break; case PL_JOIN_ROUND: gcv.join_style = JoinRound; break; case PL_JOIN_BEVEL: gcv.join_style = JoinBevel; break; case PL_JOIN_TRIANGULAR: /* not supported by X11 */ gcv.join_style = JoinRound; break; } if (_plotter->drawstate->x_gc_join_style != gcv.join_style) { /* change the GC used for drawing */ XChangeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, GCJoinStyle, &gcv); /* update non-opaque join style element */ _plotter->drawstate->x_gc_join_style = gcv.join_style; } /* update line width attribute */ gcv.line_width = _plotter->drawstate->quantized_device_line_width; if (_plotter->drawstate->x_gc_line_width != gcv.line_width) { /* change the GC used for drawing */ XChangeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, GCLineWidth, &gcv); /* update non-opaque line-width element */ _plotter->drawstate->x_gc_line_width = gcv.line_width; } } else if (x_gc_type == X_GC_FOR_FILLING) /* update attributes in GC used for filling */ { XGCValues gcv; /* update fill rule attribute */ switch (_plotter->drawstate->fill_rule_type) { case PL_FILL_ODD_WINDING: default: gcv.fill_rule = EvenOddRule; break; case PL_FILL_NONZERO_WINDING: gcv.fill_rule = WindingRule; break; } if (_plotter->drawstate->x_gc_fill_rule != gcv.fill_rule) { /* change the GC used for filling */ XChangeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fill, GCFillRule, &gcv); /* update non-opaque fill-rule element */ _plotter->drawstate->x_gc_fill_rule = gcv.fill_rule; } } return; } ���������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_closepl.c�������������������������������������������������������������������0000644�0001750�0001750�00000005337�11037243262�014152� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" bool _pl_x_end_page (S___(Plotter *_plotter)) { /* Xdrawable Plotters support double buffering `by hand', so check for it */ if (_plotter->x_double_buffering == X_DBL_BUF_BY_HAND) /* copy final frame of buffered graphics from pixmap serving as graphics buffer, to window */ { /* compute rectangle size; note flipped-y convention */ int window_width = (_plotter->data->imax - _plotter->data->imin) + 1; int window_height = (_plotter->data->jmin - _plotter->data->jmax) + 1; if (_plotter->x_drawable1) XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, _plotter->x_drawable1, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); if (_plotter->x_drawable2) XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, _plotter->x_drawable2, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); /* no more need for pixmap, so free it (if there is one) */ if (_plotter->x_drawable1 || _plotter->x_drawable2) XFreePixmap (_plotter->x_dpy, _plotter->x_drawable3); } /* do teardown of X-specific elements of the first drawing state on the drawing state stack */ _pl_x_delete_gcs_from_first_drawing_state (S___(_plotter)); return true; } void _pl_x_delete_gcs_from_first_drawing_state (S___(Plotter *_plotter)) { /* free graphics contexts, if we have them -- and to have them, must have at least one drawable (see x_savestate.c) */ if (_plotter->x_drawable1 || _plotter->x_drawable2) { XFreeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fg); XFreeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fill); XFreeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_bg); } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_color.c���������������������������������������������������������������������0000644�0001750�0001750�00000030523�11037243262�013622� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains device-specific color computation routines. These routines are called by various XDrawablePlotter (and XPlotter) methods. */ #include "sys-defines.h" #include "extern.h" /* we call this routine to set the foreground color in the X GC used for drawing, only when needed (just before an object is written out) */ void _pl_x_set_pen_color(S___(Plotter *_plotter)) { plColor old, new1; XColor rgb; new1 = _plotter->drawstate->fgcolor; old = _plotter->drawstate->x_current_fgcolor; /* i.e. as stored in gc */ if (new1.red == old.red && new1.green == old.green && new1.blue == old.blue && _plotter->drawstate->x_gc_fgcolor_status) /* can use current color cell */ return; rgb.red = new1.red; rgb.green = new1.green; rgb.blue = new1.blue; /* retrieve matching color cell, if possible */ if (_pl_x_retrieve_color (R___(_plotter) &rgb) == false) return; /* select pen color as foreground color in GC used for drawing */ XSetForeground (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, rgb.pixel); /* save the new pixel value */ _plotter->drawstate->x_gc_fgcolor = rgb.pixel; /* flag this as a genuine pixel value */ _plotter->drawstate->x_gc_fgcolor_status = true; /* update non-opaque representation of stored foreground color */ _plotter->drawstate->x_current_fgcolor = new1; } /* we call this routine to set the foreground color in the X GC used for filling, only when needed (just before an object is written out) */ void _pl_x_set_fill_color(S___(Plotter *_plotter)) { plColor old, new1; XColor rgb; if (_plotter->drawstate->fill_type == 0) /* transparent */ /* don't do anything, fill color will be ignored when writing objects*/ return; new1 = _plotter->drawstate->fillcolor; old = _plotter->drawstate->x_current_fillcolor; /* as used in GC */ if (new1.red == old.red && new1.green == old.green && new1.blue == old.blue && _plotter->drawstate->x_gc_fillcolor_status) /* can use current color cell */ return; rgb.red = (short)_plotter->drawstate->fillcolor.red; rgb.green = (short)_plotter->drawstate->fillcolor.green; rgb.blue = (short)_plotter->drawstate->fillcolor.blue; /* retrieve matching color cell, if possible */ if (_pl_x_retrieve_color (R___(_plotter) &rgb) == false) return; /* select fill color as foreground color in GC used for filling */ XSetForeground (_plotter->x_dpy, _plotter->drawstate->x_gc_fill, rgb.pixel); /* save the new pixel value */ _plotter->drawstate->x_gc_fillcolor = rgb.pixel; /* flag this as a genuine pixel value */ _plotter->drawstate->x_gc_fillcolor_status = true; /* update non-opaque representation of stored fill color */ _plotter->drawstate->x_current_fillcolor = new1; } /* we call this routine to set the foreground color in the X GC used for erasing, only when needed (just before an erasure takes place) */ void _pl_x_set_bg_color(S___(Plotter *_plotter)) { plColor old, new1; XColor rgb; new1 = _plotter->drawstate->bgcolor; old = _plotter->drawstate->x_current_bgcolor; /* i.e. as stored in gc */ if (new1.red == old.red && new1.green == old.green && new1.blue == old.blue && _plotter->drawstate->x_gc_bgcolor_status) /* can use current color cell */ return; rgb.red = new1.red; rgb.green = new1.green; rgb.blue = new1.blue; /* retrieve matching color cell, if possible */ if (_pl_x_retrieve_color (R___(_plotter) &rgb) == false) return; /* select background color as foreground color in GC used for erasing */ XSetForeground (_plotter->x_dpy, _plotter->drawstate->x_gc_bg, rgb.pixel); /* save the new pixel value */ _plotter->drawstate->x_gc_bgcolor = rgb.pixel; /* flag this as a genuine pixel value */ _plotter->drawstate->x_gc_bgcolor_status = true; /* update non-opaque representation of stored background color */ _plotter->drawstate->x_current_bgcolor = new1; } /* This is the internal X color retrieval routine. If the visual class is known and is TrueColor, it computes the X pixel value from a 48-bit RGB without invoking XAllocColor(), which would require a round trip to the server. Otherwise, it first searches for a specified RGB in a cache of previously retrieved color cells, and if that fails, tries to allocate a new color cell by calling XAllocColor(). If that fails, and a new colormap can be switched to, it switches to a new colormap and tries again. If that attempt also fails, it searches the cache for the colorcell with an RGB that's closest to the specified RGB. Only if that fails as well (i.e. the cache is empty), does it return false. Cache is maintained as a linked list (not optimal, but it facilitates color cell management; see comment in x_erase.c). */ bool _pl_x_retrieve_color (R___(Plotter *_plotter) XColor *rgb_ptr) { plColorRecord *cptr; int rgb_red = rgb_ptr->red; int rgb_green = rgb_ptr->green; int rgb_blue = rgb_ptr->blue; int xretval; #ifdef LIBPLOTTER if (_plotter->x_visual && _plotter->x_visual->c_class == TrueColor) #else #ifdef __cplusplus if (_plotter->x_visual && _plotter->x_visual->c_class == TrueColor) #else if (_plotter->x_visual && _plotter->x_visual->class == TrueColor) #endif #endif /* can compute pixel value from RGB without calling XAllocColor(), by bit-twiddling */ { unsigned long red_mask, green_mask, blue_mask; int red_shift, green_shift, blue_shift; int red_bits, green_bits, blue_bits; /* first, compute {R,G,B}_bits and {R,G,B}_shift (should be precomputed) */ red_mask = _plotter->x_visual->red_mask; red_shift = red_bits = 0; while (!(red_mask & 1)) { red_mask >>= 1; red_shift++; } while (red_mask & 1) { red_mask >>= 1; red_bits++; } green_mask = _plotter->x_visual->green_mask; green_shift = green_bits = 0; while (!(green_mask & 1)) { green_mask >>= 1; green_shift++; } while (green_mask & 1) { green_mask >>= 1; green_bits++; } blue_mask = _plotter->x_visual->blue_mask; blue_shift = blue_bits = 0; while (!(blue_mask & 1)) { blue_mask >>= 1; blue_shift++; } while (blue_mask & 1) { blue_mask >>= 1; blue_bits++; } /* compute and pass back pixel, as a 32-bit unsigned long */ rgb_red = rgb_red >> (16 - red_bits); rgb_green = rgb_green >> (16 - green_bits); rgb_blue = rgb_blue >> (16 - blue_bits); rgb_ptr->pixel = ((rgb_red << red_shift) & _plotter->x_visual->red_mask) | ((rgb_green << green_shift) & _plotter->x_visual->green_mask) | ((rgb_blue << blue_shift) & _plotter->x_visual->blue_mask); #if 0 fprintf (stderr, "pixel=0x%lx, R=0x%hx, G=0x%hx, B=0x%hx\n", rgb_ptr->pixel, rgb_ptr->red, rgb_ptr->green, rgb_ptr->blue); #endif return true; } /* If we got here, we weren't able to compute the pixel value from the RGB without calling XAllocColor(). So may have to do that, but first we consult a list of previously allocated color cells. */ /* search cache list */ for (cptr = _plotter->x_colorlist; cptr; cptr = cptr->next) { XColor cached_rgb; cached_rgb = cptr->rgb; if (cached_rgb.red == rgb_red && cached_rgb.green == rgb_green && cached_rgb.blue == rgb_blue) /* found in cache */ { /* keep track of page, frame number in which cell was most recently accessed */ cptr->page_number = _plotter->data->page_number; cptr->frame_number = _plotter->data->frame_number; /* return stored pixel value */ *rgb_ptr = cached_rgb; return true; } } /* not in cache, so try to allocate a new color cell, if colormap hasn't been flagged as bad (i.e. full) */ if (_plotter->x_cmap_type != X_CMAP_BAD) { xretval = XAllocColor (_plotter->x_dpy, _plotter->x_cmap, rgb_ptr); if (xretval == 0) /* failure */ { if (_plotter->x_cmap_type == X_CMAP_ORIG) /* colormap is the one we started with, so try switching and reallocating */ { /* Which method is invoked here depends on the type of Plotter. If this is an X Plotter, replace its colormap by a copied, private colormap if we can; otherwise we flag the colormap as bad (i.e. filled up). If this is an XDrawable Plotter, this method doesn't do anything, so colormap just gets flagged as bad. */ _maybe_get_new_colormap (S___(_plotter)); if (_plotter->x_cmap_type != X_CMAP_NEW) _plotter->x_cmap_type = X_CMAP_BAD; if (_plotter->x_cmap_type != X_CMAP_BAD) /* got a new colormap; try again to allocate color cell */ xretval = XAllocColor (_plotter->x_dpy, _plotter->x_cmap, rgb_ptr); } } } else /* colormap is bad, i.e. full; no hope of allocating a new colorcell */ xretval = 0; if (xretval == 0) /* allocation failed, and no switching or further switching of colormaps is possible; so simply search cache list for closest color, among previously allocated cells */ { XColor cached_rgb; plColorRecord *best_cptr = NULL; double distance = DBL_MAX; /* flag colormap as bad, i.e. full; no further color cell allocations will be attempted */ _plotter->x_cmap_type = X_CMAP_BAD; if (_plotter->x_colormap_warning_issued == false) { _plotter->warning(R___(_plotter) "color supply exhausted, can't create new colors"); _plotter->x_colormap_warning_issued = true; } for (cptr = _plotter->x_colorlist; cptr; cptr = cptr->next) { double newdistance; cached_rgb = cptr->rgb; newdistance = (((rgb_red - cached_rgb.red) * (rgb_red - cached_rgb.red)) + ((rgb_green - cached_rgb.green) * (rgb_green - cached_rgb.green)) + ((rgb_blue - cached_rgb.blue) * (rgb_blue - cached_rgb.blue))); if (newdistance < distance) { distance = newdistance; best_cptr = cptr; } } if (best_cptr != (plColorRecord *)NULL) { /* keep track of page, frame number in which cell was most recently accessed */ best_cptr->page_number = _plotter->data->page_number; best_cptr->frame_number = _plotter->data->frame_number; /* return pixel value via pointer */ *rgb_ptr = best_cptr->rgb; return true; } else /* cache must be empty; bad news */ return false; } else /* allocation succeeded, add new color cell to head of cache list */ { cptr = (plColorRecord *)_pl_xmalloc (sizeof (plColorRecord)); cptr->rgb = *rgb_ptr; /* include unquantized RGB values */ cptr->rgb.red = rgb_red; cptr->rgb.green = rgb_green; cptr->rgb.blue = rgb_blue; cptr->allocated = true; /* vestigial field */ /* keep track of page, frame number in which cell was allocated */ cptr->page_number = _plotter->data->page_number; cptr->frame_number = _plotter->data->frame_number; cptr->next = _plotter->x_colorlist; _plotter->x_colorlist = cptr; #if 0 fprintf (stderr, "pixel=0x%lx, R=0x%hx, G=0x%hx, B=0x%hx\n", cptr->rgb.pixel, cptr->rgb.red, cptr->rgb.green, cptr->rgb.blue); #endif return true; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_defplot.c�������������������������������������������������������������������0000644�0001750�0001750�00000030136�11037243262�014141� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any XDrawablePlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include "extern.h" #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of an XDrawablePlotter struct. */ const Plotter _pl_x_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_x_initialize, _pl_x_terminate, /* page manipulation */ _pl_x_begin_page, _pl_x_erase_page, _pl_x_end_page, /* drawing state manipulation */ _pl_x_push_state, _pl_x_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_x_paint_path, _pl_x_paint_paths, _pl_x_path_is_flushable, _pl_x_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_x_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_x_paint_text_string, _pl_x_get_text_width, /* private low-level `retrieve font' method */ _pl_x_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_x_flush_output, /* internal error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_x_initialize (S___(Plotter *_plotter)) { Colormap *x_cmap_ptr; Drawable *drawable_p1, *drawable_p2; #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_g_initialize (S___(_plotter)); #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_X11_DRAWABLE; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM; /* user-queryable capabilities: 0/1/2 = no/yes/maybe */ _plotter->data->have_wide_lines = 1; _plotter->data->have_dash_array = 1; _plotter->data->have_solid_fill = 1; _plotter->data->have_odd_winding_fill = 1; _plotter->data->have_nonzero_winding_fill = 1; _plotter->data->have_settable_bg = 1; _plotter->data->have_escaped_string_support = 0; _plotter->data->have_ps_fonts = 1; #ifdef USE_LJ_FONTS_IN_X _plotter->data->have_pcl_fonts = 1; #else _plotter->data->have_pcl_fonts = 0; #endif _plotter->data->have_stick_fonts = 0; _plotter->data->have_extra_stick_fonts = 0; _plotter->data->have_other_fonts = 1; /* text and font-related parameters (internal, not queryable by user); note that we don't set kern_stick_fonts, because it was set by the superclass initialization (and it's irrelevant for this Plotter type, anyway) */ _plotter->data->default_font_type = PL_F_POSTSCRIPT; _plotter->data->pcl_before_ps = false; _plotter->data->have_horizontal_justification = false; _plotter->data->have_vertical_justification = false; _plotter->data->issue_font_warning = true; /* path-related parameters (also internal); note that we don't set max_unfilled_path_length, because it was set by the superclass initialization */ _plotter->data->have_mixed_paths = false; _plotter->data->allowed_arc_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_ellarc_scaling = AS_AXES_PRESERVED; _plotter->data->allowed_quad_scaling = AS_NONE; _plotter->data->allowed_cubic_scaling = AS_NONE; _plotter->data->allowed_box_scaling = AS_NONE; _plotter->data->allowed_circle_scaling = AS_NONE; _plotter->data->allowed_ellipse_scaling = AS_AXES_PRESERVED; /* dimensions */ _plotter->data->display_model_type = (int)DISP_MODEL_VIRTUAL; _plotter->data->display_coors_type = (int)DISP_DEVICE_COORS_INTEGER_LIBXMI; /* X != NeWS, alas */ _plotter->data->flipped_y = true; _plotter->data->imin = 0; _plotter->data->imax = 569; _plotter->data->jmin = 569; _plotter->data->jmax = 0; /* flipped y */ _plotter->data->xmin = 0.0; _plotter->data->xmax = 0.0; _plotter->data->ymin = 0.0; _plotter->data->ymax = 0.0; _plotter->data->page_data = (plPageData *)NULL; /* initialize data members specific to this derived class */ _plotter->x_dpy = (Display *)NULL; _plotter->x_visual = (Visual *)NULL; _plotter->x_drawable1 = (Drawable)0; _plotter->x_drawable2 = (Drawable)0; _plotter->x_drawable3 = (Drawable)0; _plotter->x_double_buffering = X_DBL_BUF_NONE; _plotter->x_max_polyline_len = INT_MAX; /* reduced in openpl() */ _plotter->x_fontlist = (plXFontRecord *)NULL; _plotter->x_colorlist = (plColorRecord *)NULL; _plotter->x_cmap = (Colormap)0; _plotter->x_cmap_type = X_CMAP_ORIG; _plotter->x_colormap_warning_issued = false; _plotter->x_bg_color_warning_issued = false; _plotter->x_paint_pixel_count = 0; /* initialize certain data members from device driver parameters */ /* if this is NULL, won't be able to open Plotter */ _plotter->x_dpy = (Display *)_get_plot_param (_plotter->data, "XDRAWABLE_DISPLAY"); /* we allow the visual to be NULL, i.e., not set, since we use it only for determining the visual class of the colormap (see below); since if it's Truecolor, that means we can avoid calling XAllocColor() */ _plotter->x_visual = (Visual *)_get_plot_param (_plotter->data, "XDRAWABLE_VISUAL"); /* we allow either or both of the drawables to be NULL, i.e. not set */ drawable_p1 = (Drawable *)_get_plot_param (_plotter->data, "XDRAWABLE_DRAWABLE1"); drawable_p2 = (Drawable *)_get_plot_param (_plotter->data, "XDRAWABLE_DRAWABLE2"); _plotter->x_drawable1 = drawable_p1 ? *drawable_p1 : 0; _plotter->x_drawable2 = drawable_p2 ? *drawable_p2 : 0; /* allow user to specify a non-default colormap */ x_cmap_ptr = (Colormap *)_get_plot_param (_plotter->data, "XDRAWABLE_COLORMAP"); if (x_cmap_ptr != NULL) /* user-specified colormap */ { _plotter->x_cmap = *x_cmap_ptr; if (_plotter->x_dpy) /* have a display, so is this the default colormap? */ { int screen; /* screen number */ Screen *screen_struct; /* screen structure */ screen = DefaultScreen (_plotter->x_dpy); screen_struct = ScreenOfDisplay (_plotter->x_dpy, screen); if (_plotter->x_cmap == DefaultColormapOfScreen (screen_struct)) /* it is, so as visual, use visual of default screen */ _plotter->x_visual = DefaultVisualOfScreen (screen_struct); } } else /* default colormap */ { if (_plotter->x_dpy) /* have a display, so as default, use colormap of its default screen */ { int screen; /* screen number */ Screen *screen_struct; /* screen structure */ screen = DefaultScreen (_plotter->x_dpy); screen_struct = ScreenOfDisplay (_plotter->x_dpy, screen); _plotter->x_cmap = DefaultColormapOfScreen (screen_struct); /* also, as visual, use visual of its default screen */ _plotter->x_visual = DefaultVisualOfScreen (screen_struct); } } /* colormap type will always be `original' (unlike XPlotters, XDrawable Plotters never switch to a private colormap) */ _plotter->x_cmap_type = X_CMAP_ORIG; } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_x_terminate (S___(Plotter *_plotter)) { plXFontRecord *fptr = _plotter->x_fontlist, *fptr_next; /* Free entire cache of retrieved core X fonts (a linked list). One of these is the `current font', i.e., _plotter->x_font_struct, so we don't free that data member separately. */ while (fptr) { fptr_next = fptr->next; free (fptr->x_font_name); if (fptr->x_font_struct) /* non-NULL, indicating a successful font retrieval */ XFreeFont (_plotter->x_dpy, fptr->x_font_struct); fptr = fptr->next; } #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_g_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER XDrawablePlotter::XDrawablePlotter (FILE *infile, FILE *outfile, FILE *errfile) :Plotter (infile, outfile, errfile) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (FILE *outfile) :Plotter (outfile) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (istream& in, ostream& out, ostream& err) : Plotter (in, out, err) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (ostream& out) : Plotter (out) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter () { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :Plotter (infile, outfile, errfile, parameters) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (FILE *outfile, PlotterParams ¶meters) :Plotter (outfile, parameters) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : Plotter (in, out, err, parameters) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (ostream& out, PlotterParams ¶meters) : Plotter (out, parameters) { _pl_x_initialize (); } XDrawablePlotter::XDrawablePlotter (PlotterParams ¶meters) : Plotter (parameters) { _pl_x_initialize (); } XDrawablePlotter::~XDrawablePlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_x_terminate (); } #endif #ifndef LIBPLOTTER /* The following forwarding functions provide special support in libplot for deriving the XPlotter class from the XDrawablePlotter class. In libplotter, forwarding is implemented by a virtual function; see plotter.h. */ /* Forwarding function called by any XDrawablePlotter/XPlotter in x_color.c, if the original colormap fills up. See x_openpl.c and y_openpl.c for the two forwarded-to functions _pl_x_maybe_get_new_colormap() and _pl_y_maybe_get_new_colormap(), respectively. The former is a no-op, but the latter tries to switch to a new colormap. */ void _maybe_get_new_colormap (Plotter *_plotter) { switch ((int)_plotter->data->type) { case (int)PL_X11_DRAWABLE: default: _pl_x_maybe_get_new_colormap (_plotter); /* no-op */ break; case (int)PL_X11: _pl_y_maybe_get_new_colormap (_plotter); break; } } /* Forwarding function called by any XDrawablePlotter at the conclusion of most drawing operations. See x_openpl.c and y_openpl.c for the two forwarded-to functions _pl_x_maybe_handle_x_events() and _pl_y_maybe_handle_x_events(), respectively. The former is a no-op, but the latter is processes pending X events. */ void _maybe_handle_x_events (Plotter *_plotter) { switch ((int)_plotter->data->type) { case (int)PL_X11_DRAWABLE: default: _pl_x_maybe_handle_x_events (_plotter); /* no-op */ break; case (int)PL_X11: _pl_y_maybe_handle_x_events (_plotter); break; } } #endif /* not LIBPLOTTER */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_erase.c���������������������������������������������������������������������0000644�0001750�0001750�00000023315�11037243262�013604� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This version is for XDrawablePlotters, and should be identical to y_erase.c (the version for XPlotters) except that XPlotter-specific lines are commented out. (Search for #if 0...#endif.) The function y_erase() is of course renamed x_erase() here. */ #include "sys-defines.h" #include "extern.h" /* If we aren't double buffering, this is the number of most-recently-allocated color cells that we _don't_ deallocate when we do an erase(). This is a heuristic. This quantity must be >= 0. */ #define NUM_KEPT_COLORS 256 /* If we're doing double buffering, when we do an erase() we of course don't deallocate the color cells that were used in the current frame. We also don't deallocate the cells used in the previous NUM_KEPT_FRAMES frames. This is a heuristic. This quantity must be >= 0. */ #define NUM_KEPT_FRAMES 16 bool _pl_x_erase_page (S___(Plotter *_plotter)) { bool head_found; int window_width, window_height; int i, current_frame_number, current_page_number; plColorRecord *cptr, **link = NULL; plDrawState *stateptr; /* set the foreground color in the GC we use for erasing, to be the background color in the drawing state */ _pl_x_set_bg_color (S___(_plotter)); /* compute rectangle size; note flipped-y convention */ window_width = (_plotter->data->imax - _plotter->data->imin) + 1; window_height = (_plotter->data->jmin - _plotter->data->jmax) + 1; if (_plotter->x_double_buffering != X_DBL_BUF_NONE) { /* Following two sorts of server-supported double buffering (X_DBL_BUF_DBE, X_DBL_BUF_MBX) are possible only for X Plotters, not X Drawable Plotters. `By hand' double buffering is possible for both. */ #if 0 #ifdef HAVE_X11_EXTENSIONS_XDBE_H #ifdef HAVE_DBE_SUPPORT if (_plotter->x_double_buffering == X_DBL_BUF_DBE) /* we're using the X double buffering extension */ { XdbeSwapInfo info; /* Copy current frame of buffered graphics to window. Implement this by swapping the front and back buffers for widget's window. Former front buffer will become graphics buffer. Currently, the buffers are `x_drawable2' (front) and `x_drawable3' (back, into which we draw). */ info.swap_window = _plotter->x_drawable2; info.swap_action = XdbeUndefined; XdbeSwapBuffers (_plotter->x_dpy, &info, 1); } else #endif /* HAVE_DBE_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_XDBE_H */ #ifdef HAVE_X11_EXTENSIONS_MULTIBUF_H #ifdef HAVE_MBX_SUPPORT if (_plotter->x_double_buffering == X_DBL_BUF_MBX) /* we're using the X multibuffering extension */ { Multibuffer multibuf; /* Copy current frame of buffered graphics to window. Implement this by making multibuffer into which we've been drawing the current multibuffer. */ XmbufDisplayBuffers (_plotter->x_dpy, 1, &(_plotter->x_drawable3), 0, 0); /* swap the two multibuffers, making the other one the off-screen graphics buffer into which we draw (`x_drawable3') */ multibuf = _plotter->x_drawable3; _plotter->x_drawable3 = _plotter->y_drawable4; _plotter->y_drawable4 = multibuf; } else #endif /* HAVE_MBX_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_MULTIBUF_H */ #endif /* 0 */ /* we must be doing double buffering `by hand', rather than using an X protocol extension */ if (_plotter->x_double_buffering == X_DBL_BUF_BY_HAND) { /* copy current frame of buffered graphics to drawable(s) */ if (_plotter->x_drawable1) XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, _plotter->x_drawable1, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); if (_plotter->x_drawable2) XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, _plotter->x_drawable2, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); } /* irrespective of which of the three sorts of double buffering is being performed, clear the (new) graphics buffer, by filling it with background color */ XFillRectangle (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_bg, /* upper left corner */ 0, 0, (unsigned int)window_width, (unsigned int)window_height); } else /* not double buffering at all */ { /* erase drawable(s) by filling with background color */ if (_plotter->x_drawable1) XFillRectangle (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_bg, /* upper left corner */ 0, 0, (unsigned int)window_width, (unsigned int)window_height); if (_plotter->x_drawable2) XFillRectangle (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_bg, /* upper left corner */ 0, 0, (unsigned int)window_width, (unsigned int)window_height); } #if 0 /* If an X Plotter, update background color of y_canvas widget, irrespective of whether or not we're double buffering. This fixes things so that if the window is resized to a larger size, the new portions of the window will be filled with the correct color. */ { Arg wargs[1]; /* werewolves */ #ifdef USE_MOTIF XtSetArg (wargs[0], XmNbackground, _plotter->drawstate->x_gc_bgcolor); #else XtSetArg (wargs[0], XtNbackground, _plotter->drawstate->x_gc_bgcolor); #endif XtSetValues (_plotter->y_toplevel, wargs, (Cardinal)1); XtSetValues (_plotter->y_canvas, wargs, (Cardinal)1); } #endif /* 0 */ /* Flush the color cell cache, to the extent we can. But heuristically, keep in the cache a certain number of cells that aren't strictly needed, but which may be needed in the following frames. There are two cases. 1. If we're not double buffering, preserve some maximum number (NUM_KEPT_COLORS) of the most recently allocated cells. Implementing the cache as a list, though suboptimal from the point of view of speed, makes it easy to implement this heuristic. 2. If we're double buffering, preserve all cells that were used in the present frame (which was just transferred to the drawable(s), e.g., to an on-screen window). This is mandatory. But also use a heuristic: preserve all cells used in the preceding NUM_KEPT_FRAMES frames. In both cases, if a cached cell is to be preserved, it must contain a genuine pixel value (the `allocated' flag must be set). We also insist that for a cell to be preserved, it have a `page number stamp' equal to the current page number. That's because XDrawable Plotters, unlike X Plotters, don't free the color cell cache in end_page(), i.e., when closepl() is called. That's because X Drawable Plotters are `persistent' in the sense the graphics remain visible until the next reopening, and beyond. So the cache may include cells left over from previous pages, which get freed only here, when erase() is called. */ cptr = _plotter->x_colorlist; _plotter->x_colorlist = NULL; i = 0; head_found = false; current_frame_number = _plotter->data->frame_number; current_page_number = _plotter->data->page_number; while (cptr) { plColorRecord *cptrnext; cptrnext = cptr->next; if (cptr->allocated) { if ((_plotter->x_double_buffering == X_DBL_BUF_NONE && cptr->page_number == current_page_number && i < NUM_KEPT_COLORS) || (_plotter->x_double_buffering != X_DBL_BUF_NONE && cptr->page_number == current_page_number && cptr->frame_number >= current_frame_number - NUM_KEPT_FRAMES)) /* cached cell contains a genuine pixel value, and it meets our criteria, so preserve it */ { if (head_found) *link = cptr; else { _plotter->x_colorlist = cptr; head_found = true; } cptr->next = NULL; link = &(cptr->next); i++; } else /* cached cell contains a genuine pixel value, but it doesn't meet our criteria, so deallocate it */ { XFreeColors (_plotter->x_dpy, _plotter->x_cmap, &(cptr->rgb.pixel), 1, (unsigned long)0); free (cptr); } } else /* cached cell doesn't include a genuine pixel value, so free it */ free (cptr); cptr = cptrnext; } /* flag status of all colors in GC's in the drawing state stack as false (on account of flushing, may need to be searched for or reallocated) */ for (stateptr = _plotter->drawstate; stateptr; stateptr = stateptr->previous) { stateptr->x_gc_fgcolor_status = false; stateptr->x_gc_fillcolor_status = false; stateptr->x_gc_bgcolor_status = false; } /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); return true; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_flushpl.c�������������������������������������������������������������������0000644�0001750�0001750�00000002702�11037243262�014157� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the flushpl method, which is a GNU extension to libplot. It flushes (i.e. pushes onward) all plot commands sent to the graphics device. */ /* This version is for XDrawablePlotters (and XPlotters). */ #include "sys-defines.h" #include "extern.h" bool _pl_x_flush_output (S___(Plotter *_plotter)) { XSync (_plotter->x_dpy, (Bool)false); /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); return true; } ��������������������������������������������������������������plotutils-2.6/libplot/x_openpl.c��������������������������������������������������������������������0000644�0001750�0001750�00000025635�11037267516�014021� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This implementation is for XDrawablePlotters. It supports one or two drawables, which must be associated with the same display and have the same dimensions (width, height, depth). A `drawable' is either a window or a pixmap. */ /* This file also contains the internal functions _pl_x_maybe_get_new_colormap and _pl_x_maybe_handle_x_events, which are no-ops. However, they are virtual and are overridden in the derived XPlotter class, which both attempts to switch to a private colormap when color cells run out, and processes its own X events. */ #include "sys-defines.h" #include "extern.h" bool _pl_x_begin_page (S___(Plotter *_plotter)) { Window root1, root2; int x, y; unsigned int border_width, depth1, depth2; unsigned int width1, height1, width2, height2; unsigned int width, height, depth; const char *double_buffer_s; if (_plotter->x_dpy == (Display *)NULL) /* pathological: user didn't set XDRAWABLE_DISPLAY parameter */ { _plotter->error (R___(_plotter) "the Plotter cannot be opened, as the XDRAWABLE_DISPLAY parameter is null"); return false; } /* find out how long polylines can get on this X display */ _plotter->x_max_polyline_len = XMaxRequestSize(_plotter->x_dpy) / 2; /* determine dimensions of drawable(s) */ if (_plotter->x_drawable1) XGetGeometry (_plotter->x_dpy, _plotter->x_drawable1, &root1, &x, &y, &width1, &height1, &border_width, &depth1); if (_plotter->x_drawable2) XGetGeometry (_plotter->x_dpy, _plotter->x_drawable2, &root2, &x, &y, &width2, &height2, &border_width, &depth2); if (_plotter->x_drawable1 && _plotter->x_drawable2) /* sanity check */ { if (width1 != width2 || height1 != height2 || depth1 != depth2 || root1 != root2) { _plotter->error(R___(_plotter) "the Plotter cannot be opened, as the X drawables have unequal parameters"); return false; } } if (_plotter->x_drawable1) { width = width1; height = height1; depth = depth1; } else if (_plotter->x_drawable2) { width = width2; height = height2; depth = depth1; } else /* both are NULL, and we won't really be drawing, so these are irrelevant */ { width = 1; height = 1; depth = 1; } _plotter->data->imin = 0; _plotter->data->imax = width - 1; /* note flipped-y convention for this device: for j, min > max */ _plotter->data->jmin = height - 1; _plotter->data->jmax = 0; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* add X GC's to drawing state (which was constructed by openpl() before begin_page() was called), so we can at least fill with solid color */ _pl_x_add_gcs_to_first_drawing_state (S___(_plotter)); /* At this point, we don't clear the drawable(s) by filling them with the background color, which is what we would do here for an X Plotter (see y_openpl.c). For an X DrawablePlotter, unlike an X Plotter, initial clearing is not appropriate. However, if we're double buffering, we create an off-screen buffer and fill it with the color. */ if (_plotter->x_drawable1 || _plotter->x_drawable2) { double_buffer_s = (const char *)_get_plot_param (_plotter->data, "USE_DOUBLE_BUFFERING"); if (strcmp (double_buffer_s, "yes") == 0 /* backward compatibility: "fast" now means the same as "yes" */ || strcmp (double_buffer_s, "fast") == 0) /* user requested double buffering, so do so `by hand': allocate additional pixmap to serve as off-screen graphics buffer */ { _plotter->x_double_buffering = X_DBL_BUF_BY_HAND; _plotter->x_drawable3 = XCreatePixmap(_plotter->x_dpy, /* this 2nd arg merely determines the screen*/ _plotter->x_drawable1 ? _plotter->x_drawable1 : _plotter->x_drawable2, (unsigned int)width, (unsigned int)height, (unsigned int)depth); /* erase buffer by filling it with background color */ XFillRectangle (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_bg, /* upper left corner */ 0, 0, (unsigned int)width, (unsigned int)height); } } /* Note: at this point the drawing state, which we added X GC's to, a few lines above, won't be ready for drawing graphics, since it won't contain an X font or meaningful line width. To retrieve an X font and set the line width, user will need to invoke space() after openpl(). */ return true; } /* Flesh out an XDrawable or X Plotter's first drawing state, by adding X11-specific elements: GC's or lists. This is invoked by the corresponding begin_page() routines, and hence by openpl(). As supplemented, the drawing state won't be fully ready for drawing graphics, since it won't contain a X font. However, the the API function alabel(), before drawing a text string, invokes _set_font(), which in turns invokes the Plotter-specific function retrieve_font(). And x_retrieve_font() does the job of retrieving an X font from the server and placing it in the drawing state. */ void _pl_x_add_gcs_to_first_drawing_state (S___(Plotter *_plotter)) { Drawable drawable; /* determine which if either drawable we'll construct the GC's for */ if (_plotter->x_drawable1) drawable = _plotter->x_drawable1; else if (_plotter->x_drawable2) drawable = _plotter->x_drawable2; else drawable = (Drawable)NULL; if (drawable != (Drawable)NULL) /* prepare GC's for new drawing state, by copying attributes we use */ { unsigned long gcmask_fg, gcmask_fill, gcmask_bg; gcmask_fg = /* constant attributes (never altered) */ GCPlaneMask | GCFunction /* drawing attributes set by _pl_x_set_attributes() */ /* NOTE: we also use GCDashOffset and GCDashList, but Xlib does not support retrieving the dash list from a GC, so we'll copy the dashing style in another (painful) way */ | GCLineStyle | GCLineWidth | GCJoinStyle | GCCapStyle /* other GC elements set by the X Drawable driver */ | GCForeground | GCFont; gcmask_fill = /* constant attributes (never altered) */ GCPlaneMask | GCFunction | GCArcMode /* filling attributes set by _pl_x_set_attributes() */ | GCFillRule /* other GC elements set by the X Drawable driver */ | GCForeground; gcmask_bg = /* constant attributes (never altered) */ GCPlaneMask | GCFunction /* other GC elements set by the X Drawable driver */ | GCForeground; /* build new GC's from scratch */ { XGCValues gcv_fg, gcv_fill, gcv_bg; /* Initialize GC used for drawing. (Always initialize the line style to LineSolid, irrespective of what the default drawing state contains; it would be silly for the default drawing state to include a non-solid value for the line style.) */ gcv_fg.plane_mask = AllPlanes; gcv_fg.function = GXcopy; gcv_fg.line_width = _default_drawstate.x_gc_line_width; gcv_fg.line_style = LineSolid; gcv_fg.join_style = _default_drawstate.x_gc_join_style; gcv_fg.cap_style = _default_drawstate.x_gc_cap_style; gcmask_fg &= ~(GCFont); /* initialized much later; see below */ gcmask_fg &= ~(GCForeground); /* color is initialized separately */ /* initialize GC used for filling */ gcv_fill.plane_mask = AllPlanes; gcv_fill.function = GXcopy; gcv_fill.arc_mode = ArcChord; /* libplot convention */ gcv_fill.fill_rule = _default_drawstate.x_gc_fill_rule; gcmask_fill &= ~(GCForeground); /* color is initialized separately */ /* initialize GC used for erasing */ gcv_bg.plane_mask = AllPlanes; gcv_bg.function = GXcopy; gcmask_bg &= ~(GCForeground); /* color is initialized separately */ /* create the 3 GC's */ _plotter->drawstate->x_gc_fg = XCreateGC (_plotter->x_dpy, drawable, gcmask_fg, &gcv_fg); _plotter->drawstate->x_gc_fill = XCreateGC (_plotter->x_dpy, drawable, gcmask_fill, &gcv_fill); _plotter->drawstate->x_gc_bg = XCreateGC (_plotter->x_dpy, drawable, gcmask_bg, &gcv_bg); /* set X-specific elements in the drawing state, specifying (non-opaquely) what the 3 GC's contain */ _plotter->drawstate->x_gc_line_width = gcv_fg.line_width; _plotter->drawstate->x_gc_line_style = gcv_fg.line_style; _plotter->drawstate->x_gc_join_style = gcv_fg.join_style; _plotter->drawstate->x_gc_cap_style = gcv_fg.cap_style; _plotter->drawstate->x_gc_dash_list = (char *)NULL; _plotter->drawstate->x_gc_dash_list_len = 0; _plotter->drawstate->x_gc_dash_offset = 0; _plotter->drawstate->x_gc_fill_rule = gcv_fill.fill_rule; /* do the separate initialization of color (i.e. GCForeground element) in each GC */ _pl_x_set_pen_color (S___(_plotter)); _pl_x_set_fill_color (S___(_plotter)); _pl_x_set_bg_color (S___(_plotter)); /* At this point, all 3 GC's are functional, except the GC used for drawing lacks a GCFont element. We do not retrieve a font from the X server here; not even a default font. fsetmatrix() or space(), when invoked (which we require after each invocation of openpl()), will select a default size for the font. A font will be retrieved from the X server only when fontname/fontsize/textangle is invoked to select a different font, or when alabel/labelwidth is invoked (see g_alabel.c). The invocation of fsetmatrix() or space() will also set the line width in the drawing state. Any changed attributes, such as line width, will be written to the GC's just before drawing; see g_attribs.c. */ } } } /* This is the XDrawablePlotter-specific version of the _maybe_get_new_colormap() method, which is invoked when a Plotter's original colormap fills up. It's a no-op; in XPlotters, it's overridden by a version that actually does something. */ void _pl_x_maybe_get_new_colormap (S___(Plotter *_plotter)) { return; } /* This is the XDrawablePlotter-specific version of the _maybe_handle_x_events() method, which is invoked after most drawing operations. It's a no-op; in XPlotters, it's overridden by a version that actually does something. */ void _pl_x_maybe_handle_x_events(S___(Plotter *_plotter)) { return; } ���������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_path.c����������������������������������������������������������������������0000644�0001750�0001750�00000117155�11037243262�013447� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the internal paint_path() and paint_paths() methods, which the public method endpath() is a wrapper around. */ /* This file also contains the internal path_is_flushable() method, which is invoked after any path segment is added to the segment list, provided (0) the segment list has become greater than or equal to the `max_unfilled_path_length' Plotter parameter, (1) the path isn't to be filled. In most Plotters, this operation simply returns true. */ /* This file also contains the internal maybe_prepaint_segments() method. It is called immediately after any segment is added to a path. Some Plotters, at least under some circumstances, treat endpath() as a no-op. Instead, they plot the segments of a path in real time. */ /**********************************************************************/ /* This version of paint_path() is for XDrawablePlotters (and XPlotters). By construction, for such Plotters our path buffer always contains either a segment list, or an ellipse object. If it's a segment list, it contains either (1) a sequence of line segments, or (2) a single circular or elliptic arc segment. Those are all sorts of path that X11 can handle. (For an ellipse or circular/elliptic arc segment to have been added to the path buffer, the map from user to device coordinates must preserve axes.) */ /* If the line style is "solid" and the path has zero width, it's actually drawn in real time, before endpath() and paint_path() are called; see the maybe_prepaint_segments() method further below in this file. So if the path doesn't need to be filled, we don't do anything in paint_path(). If it does, we fill it, and then redraw it. */ /* Note that when filling a polyline, we look at _plotter->drawstate->path->primitive to determine which X11 rendering algorithm to use. Our default algorithm is "Complex" (i.e. generic), but when drawing polygonal approximations to ellipse and rectangle primitives, which we know must be convex, we specify "Convex" instead, to speed up rendering. */ #include "sys-defines.h" #include "extern.h" /* number of XPoint structs we can store on the stack, for speed, without invoking malloc */ #define MAX_NUM_POINTS_ON_STACK 128 #define DIST(p1, p2) sqrt( ((p1).x - (p2).x) * ((p1).x - (p2).x) \ + ((p1).y - (p2).y) * ((p1).y - (p2).y)) void _pl_x_paint_path (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type == 0 && _plotter->drawstate->fill_type == 0) /* nothing to draw */ return; switch ((int)_plotter->drawstate->path->type) { case (int)PATH_SEGMENT_LIST: { bool closed; /* not currently used */ int is_a_rectangle; int i, polyline_len; plPoint p0, p1, pc; XPoint *xarray, local_xarray[MAX_NUM_POINTS_ON_STACK]; bool heap_storage; double xu_last, yu_last; bool identical_user_coordinates; /* sanity checks */ if (_plotter->drawstate->path->num_segments == 0)/* nothing to do */ break; if (_plotter->drawstate->path->num_segments == 1) /*shouldn't happen */ break; if (_plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[1].type == S_ARC) /* segment buffer contains a single circular arc, not a polyline */ { p0 = _plotter->drawstate->path->segments[0].p; p1 = _plotter->drawstate->path->segments[1].p; pc = _plotter->drawstate->path->segments[1].pc; /* use native X rendering to draw the (transformed) circular arc */ _pl_x_draw_elliptic_arc (R___(_plotter) p0, p1, pc); break; } if (_plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[1].type == S_ELLARC) /* segment buffer contains a single elliptic arc, not a polyline */ { p0 = _plotter->drawstate->path->segments[0].p; p1 = _plotter->drawstate->path->segments[1].p; pc = _plotter->drawstate->path->segments[1].pc; /* use native X rendering to draw the (transformed) elliptic arc */ _pl_x_draw_elliptic_arc_2 (R___(_plotter) p0, p1, pc); break; } /* neither of above applied, so segment buffer contains a polyline, not an arc */ if ((_plotter->drawstate->path->num_segments >= 3)/*check for closure*/ && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.x == _plotter->drawstate->path->segments[0].p.x) && (_plotter->drawstate->path->segments[_plotter->drawstate->path->num_segments - 1].p.y == _plotter->drawstate->path->segments[0].p.y)) closed = true; else closed = false; /* 2-point ones should be open */ /* Check whether we `pre-drew' the polyline, i.e., drew every line segment in real time. (See the maybe_prepaint_segments() method further below, which is invoked to do that.) Our convention: we pre-draw only if pen width is zero, and line style is "solid". Also, we don't do it if we're drawing a polygonalized built-in object (i.e. a rectangle or ellipse). If we pre-drew, we don't do anything here unless there's filling to be done. If so, we'll fill the polyline and re-edge it. */ if ((_plotter->drawstate->pen_type != 0 /* pen is present */ && _plotter->drawstate->line_type == PL_L_SOLID && !_plotter->drawstate->dash_array_in_effect /* really solid */ && _plotter->drawstate->points_are_connected /* really, really */ && _plotter->drawstate->quantized_device_line_width == 0 && !_plotter->drawstate->path->primitive) /* not builtin object */ /* we pre-drew */ && _plotter->drawstate->fill_type == 0) /* there's no filling to be done, so we're out of here */ break; /* At this point we know that we didn't pre-draw, or we did, but the polyline was drawn unfilled and it'll need to be re-drawn as filled. */ /* prepare an array of XPoint structures (X11 uses short ints for these) */ if (_plotter->drawstate->path->num_segments <= MAX_NUM_POINTS_ON_STACK) /* store XPoints on stack, for speed */ { xarray = local_xarray; heap_storage = false; } else /* store XPoints in heap */ { xarray = (XPoint *)_pl_xmalloc (_plotter->drawstate->path->num_segments * sizeof(XPoint)); heap_storage = true; } /* convert vertices to device coordinates, removing runs; also keep track of whether or not all points in user space are the same */ polyline_len = 0; xu_last = 0.0; yu_last = 0.0; identical_user_coordinates = true; for (i = 0; i < _plotter->drawstate->path->num_segments; i++) { plPathSegment datapoint; double xu, yu, xd, yd; int device_x, device_y; datapoint = _plotter->drawstate->path->segments[i]; xu = datapoint.p.x; yu = datapoint.p.y; xd = XD(xu, yu); yd = YD(xu, yu); device_x = IROUND(xd); device_y = IROUND(yd); if (X_OOB_INT(device_x) || X_OOB_INT(device_y)) /* point position can't be represented using X11's 2-byte ints, so truncate the polyline right here */ { _plotter->warning (R___(_plotter) "truncating a polyline that extends too far for X11"); break; } if (i > 0 && (xu != xu_last || yu != yu_last)) /* in user space, not all points are the same */ identical_user_coordinates = false; if ((polyline_len == 0) || (device_x != xarray[polyline_len-1].x) || (device_y != xarray[polyline_len-1].y)) /* add point, in integer X coordinates, to the array */ { xarray[polyline_len].x = device_x; xarray[polyline_len].y = device_y; polyline_len++; if (polyline_len >= _plotter->x_max_polyline_len) /* polyline is getting too long for the X server to handle (we determined the maximum X request size when openpl() was invoked), so truncate it right here */ { _plotter->warning (R___(_plotter) "truncating a polyline that's too long for the X display"); break; } } xu_last = xu; yu_last = yu; } /* Is this path a rectangle in device space? We check this because by calling XFillRectangle (and XDrawRectangle too, if the edging is solid), we can save a bit of time, or at least network bandwidth. */ /* N.B. This checks only for rectangles traced counterclockwise from the lower left corner. Should improve this. */ #define IS_A_RECTANGLE(len,q) \ ((len) == 5 && (q)[0].x == (q)[4].x && (q)[0].y == (q)[4].y && \ (q)[0].x == (q)[3].x && (q)[1].x == (q)[2].x && \ (q)[0].y == (q)[1].y && (q)[2].y == (q)[3].y && \ (q)[0].x < (q)[1].x && (q)[0].y > (q)[2].y) /* note flipped-y convention */ is_a_rectangle = IS_A_RECTANGLE(polyline_len, xarray); /* N.B. If a rectangle, upper left corner = q[3], and also, width = q[1].x - q[0].x and height = q[0].y - q[2].y (note flipped-y convention). */ /* compute the square size, and offset of upper left vertex from center of square, that we'll use when handling the notorious special case: all user-space points in the polyline get mapped to a single integer X pixel */ /* FIRST TASK: fill the polygon (if necessary). */ if (_plotter->drawstate->fill_type) /* not transparent, so fill the path */ { int x_polygon_type = (_plotter->drawstate->path->primitive ? Convex : Complex); /* update GC used for filling */ _pl_x_set_attributes (R___(_plotter) X_GC_FOR_FILLING); /* select fill color as foreground color in GC used for filling */ _pl_x_set_fill_color (S___(_plotter)); if (_plotter->x_double_buffering != X_DBL_BUF_NONE) { if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* special case: all user-space points in the polyline were mapped to a single integer X pixel */ XDrawPoint (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fill, (int)(xarray[0].x), (int)(xarray[0].y)); else /* general case */ { if (is_a_rectangle) /* call XFillRectangle, for speed */ XFillRectangle (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fill, (int)(xarray[3].x), (int)(xarray[3].y), (unsigned int)(xarray[1].x - xarray[0].x), /* flipped y */ (unsigned int)(xarray[0].y - xarray[2].y)); else /* not a rectangle, call XFillPolygon */ XFillPolygon (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fill, xarray, polyline_len, x_polygon_type, CoordModeOrigin); } } else /* not double buffering, no `x_drawable3' */ { if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* special case: all user-space points in the polyline were mapped to a single integer X pixel. */ { if (_plotter->x_drawable1) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fill, (int)(xarray[0].x), (int)(xarray[0].y)); if (_plotter->x_drawable2) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fill, (int)(xarray[0].x), (int)(xarray[0].y)); } else /* general case */ { if (is_a_rectangle) /* call XFillRectangle, for speed */ { if (_plotter->x_drawable1) XFillRectangle (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fill, (int)(xarray[3].x), (int)(xarray[3].y), (unsigned int)(xarray[1].x - xarray[0].x), /* flipped y */ (unsigned int)(xarray[0].y - xarray[2].y)); if (_plotter->x_drawable2) XFillRectangle (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fill, (int)(xarray[3].x), (int)(xarray[3].y), (unsigned int)(xarray[1].x - xarray[0].x), /* flipped y */ (unsigned int)(xarray[0].y - xarray[2].y)); } else /* not a rectangle, call XFillPolygon */ { if (_plotter->x_drawable1) XFillPolygon (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fill, xarray, polyline_len, x_polygon_type, CoordModeOrigin); if (_plotter->x_drawable2) XFillPolygon (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fill, xarray, polyline_len, x_polygon_type, CoordModeOrigin); } } } } /* SECOND TASK: edge the polygon (if necessary). */ if (_plotter->drawstate->pen_type) /* pen is present, so edge the path */ { int xloc = 0, yloc = 0; unsigned int sp_size = 1; /* update GC used for drawing */ _pl_x_set_attributes (R___(_plotter) X_GC_FOR_DRAWING); /* select pen color as foreground color in GC used for drawing */ _pl_x_set_pen_color (S___(_plotter)); /* Check first for the special case: all points in the polyline were mapped to a single integer X pixel. If (1) they weren't all the same to begin with, or (2) they were all the same to begin with and the cap mode is "round", then draw as a filled circle of diameter equal to the line width; otherwise draw nothing. (If the circle would have diameter 1 or less, we draw a point instead.) */ if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* this is the special case, so compute quantities needed for drawing the filled circle */ { int sp_offset; sp_size = (unsigned int)_plotter->drawstate->quantized_device_line_width; if (sp_size == 0) sp_size = 1; sp_offset = (_plotter->drawstate->quantized_device_line_width + 1) / 2; xloc = xarray[0].x - sp_offset; yloc = xarray[0].y - sp_offset; } if (_plotter->x_double_buffering != X_DBL_BUF_NONE) /* double buffering, have a `x_drawable3' to draw into */ { if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* special case */ { if (identical_user_coordinates == false || _plotter->drawstate->cap_type == PL_CAP_ROUND) { if (sp_size == 1) /* subcase: just draw a point */ XDrawPoint (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, (int)(xarray[0].x), (int)(xarray[0].y)); else /* draw filled circle */ XFillArc(_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, xloc, yloc, sp_size, sp_size, 0, 64 * 360); } } else /* general case */ /* NOTE: this code is what libplot uses to draw nearly all polylines, in the case when double buffering is used */ { if (is_a_rectangle && _plotter->drawstate->dash_array_in_effect == false && _plotter->drawstate->line_type == PL_L_SOLID) /* call XDrawRectangle, for speed */ XDrawRectangle (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, (int)(xarray[3].x), (int)(xarray[3].y), (unsigned int)(xarray[1].x - xarray[0].x), /* flipped y */ (unsigned int)(xarray[0].y - xarray[2].y)); else /* can't call XDrawRectangle */ XDrawLines (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, xarray, polyline_len, CoordModeOrigin); } } else /* not double buffering, have no `x_drawable3' */ { if (_plotter->drawstate->path->num_segments > 1 && polyline_len == 1) /* special case */ { if (identical_user_coordinates == false || _plotter->drawstate->cap_type == PL_CAP_ROUND) { if (sp_size == 1) /* subcase: just draw a point */ { if (_plotter->x_drawable1) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, (int)(xarray[0].x), (int)(xarray[0].y)); if (_plotter->x_drawable2) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, (int)(xarray[0].x), (int)(xarray[0].y)); } else /* draw filled circle */ { if (_plotter->x_drawable1) XFillArc(_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, xloc, yloc, sp_size, sp_size, 0, 64 * 360); if (_plotter->x_drawable2) XFillArc(_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, xloc, yloc, sp_size, sp_size, 0, 64 * 360); } } } else /* general case */ /* NOTE: this code is what libplot uses to draw nearly all polylines; at least, if double buffering is not used */ { if (is_a_rectangle && _plotter->drawstate->dash_array_in_effect == false && _plotter->drawstate->line_type == PL_L_SOLID) /* call XDrawRectangle, for speed */ { if (_plotter->x_drawable1) XDrawRectangle (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, (int)(xarray[3].x), (int)(xarray[3].y), (unsigned int)(xarray[1].x - xarray[0].x), /* flipped y */ (unsigned int)(xarray[0].y - xarray[2].y)); if (_plotter->x_drawable2) XDrawRectangle (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, (int)(xarray[3].x), (int)(xarray[3].y), (unsigned int)(xarray[1].x - xarray[0].x), /* flipped y */ (unsigned int)(xarray[0].y - xarray[2].y)); } else /* can't use XDrawRectangle() */ { if (_plotter->x_drawable1) XDrawLines (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, xarray, polyline_len, CoordModeOrigin); if (_plotter->x_drawable2) XDrawLines (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, xarray, polyline_len, CoordModeOrigin); } } } } /* reset buffer used for array of XPoint structs */ if (_plotter->drawstate->path->num_segments > 0) { if (heap_storage) free (xarray); /* free malloc'd array of XPoints */ } } break; case (int)PATH_ELLIPSE: { int ninetymult; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; plPoint pc; double rx, ry, angle; pc = _plotter->drawstate->path->pc; rx = _plotter->drawstate->path->rx; ry = _plotter->drawstate->path->ry; angle = _plotter->drawstate->path->angle; /* if angle is multiple of 90 degrees, modify to permit use of X11 arc rendering */ ninetymult = IROUND(angle / 90.0); if (angle == (double) (90 * ninetymult)) { angle = 0.0; if (ninetymult % 2) { double temp; temp = rx; rx = ry; ry = temp; } } rx = (rx < 0.0 ? -rx : rx); /* avoid obscure libxmi problems */ ry = (ry < 0.0 ? -ry : ry); /* axes flipped? (by default y-axis is, due to libxmi's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); /* location of `origin' (upper left corner of bounding rect. for ellipse) and width and height; X11's flipped-y convention affects these values */ xorigin = IROUND(XD(pc.x - x_orientation * rx, pc.y - y_orientation * ry)); yorigin = IROUND(YD(pc.x - x_orientation * rx, pc.y - y_orientation * ry)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * rx, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * ry)); /* Because this ellipse object was added to the path buffer, we already know that (1) the user->device frame map preserves coordinate axes, (2) effectively, angle == 0. These are necessary for the libxmi scan-conversion module to do the drawing. */ /* draw ellipse (elliptic arc aligned with the coordinate axes, arc range = 64*360 64'ths of a degree) */ _pl_x_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, 0, 64 * 360); } break; default: /* shouldn't happen */ break; } /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); } /* Use native X rendering to draw what would be a circular arc in the user frame on an X display. If this is called, the map from user to device coordinates is assumed to preserve coordinate axes (it may be anisotropic [x and y directions scaled differently], and it may include a reflection through either or both axes). So it will be a circular or elliptic arc in the device frame, of the sort that X11 supports. */ void _pl_x_draw_elliptic_arc (R___(Plotter *_plotter) plPoint p0, plPoint p1, plPoint pc) { double radius; double theta0, theta1; int startangle, anglerange; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; /* axes flipped? (by default y-axis is, due to X's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); /* radius of circular arc in user frame is distance to p0, and also to p1 */ radius = DIST(pc, p0); /* location of `origin' (upper left corner of bounding rect. on display) and width and height; X's flipped-y convention affects these values */ xorigin = IROUND(XD(pc.x - x_orientation * radius, pc.y - y_orientation * radius)); yorigin = IROUND(YD(pc.x - x_orientation * radius, pc.y - y_orientation * radius)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * radius, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * radius)); theta0 = _xatan2 (-y_orientation * (p0.y - pc.y), x_orientation * (p0.x - pc.x)) / M_PI; theta1 = _xatan2 (-y_orientation * (p1.y - pc.y), x_orientation * (p1.x - pc.x)) / M_PI; if (theta1 < theta0) theta1 += 2.0; /* adjust so that difference > 0 */ if (theta0 < 0.0) { theta0 += 2.0; /* adjust so that startangle > 0 */ theta1 += 2.0; } if (theta1 - theta0 > 1.0) /* swap if angle appear to be > 180 degrees */ { double tmp; tmp = theta0; theta0 = theta1; theta1 = tmp; theta1 += 2.0; /* adjust so that difference > 0 */ } if (theta0 >= 2.0 && theta1 >= 2.0) /* avoid obscure X bug */ { theta0 -= 2.0; theta1 -= 2.0; } startangle = IROUND(64 * theta0 * 180.0); /* in 64'ths of a degree */ anglerange = IROUND(64 * (theta1 - theta0) * 180.0); /* likewise */ _pl_x_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } /* Use native X rendering to draw what would be a quarter-ellipse in the user frame on an X display. If this is called, the map from user to device coordinates is assumed to preserve coordinate axes (it may be anisotropic [x and y directions scaled differently], and it may include a reflection through either or both axes). So it will be a quarter-ellipse in the device frame, of the sort that the X11 drawing protocol supports. */ void _pl_x_draw_elliptic_arc_2 (R___(Plotter *_plotter) plPoint p0, plPoint p1, plPoint pc) { double rx, ry; double x0, y0, x1, y1, xc, yc; int startangle, endangle, anglerange; int x_orientation, y_orientation; int xorigin, yorigin; unsigned int squaresize_x, squaresize_y; /* axes flipped? (by default y-axis is, due to X's flipped-y convention) */ x_orientation = (_plotter->drawstate->transform.m[0] >= 0 ? 1 : -1); y_orientation = (_plotter->drawstate->transform.m[3] >= 0 ? 1 : -1); xc = pc.x, yc = pc.y; x0 = p0.x, y0 = p0.y; x1 = p1.x, y1 = p1.y; if (y0 == yc && x1 == xc) /* initial pt. on x-axis, final pt. on y-axis */ { /* semi-axes in user frame */ rx = (x0 > xc) ? x0 - xc : xc - x0; ry = (y1 > yc) ? y1 - yc : yc - y1; /* starting and ending angles; note flipped-y convention */ startangle = ((x0 > xc ? 1 : -1) * x_orientation == 1) ? 0 : 180; endangle = ((y1 > yc ? 1 : -1) * y_orientation == -1) ? 90 : 270; } else /* initial pt. on y-axis, final pt. on x-axis */ { /* semi-axes in user frame */ rx = (x1 > xc) ? x1 - xc : xc - x1; ry = (y0 > yc) ? y0 - yc : yc - y0; /* starting and ending angles; note flipped-y convention */ startangle = ((y0 > yc ? 1 : -1) * y_orientation == -1) ? 90 : 270; endangle = ((x1 > xc ? 1 : -1) * x_orientation == 1) ? 0 : 180; } if (endangle < startangle) endangle += 360; anglerange = endangle - startangle; /* always 90 or 270 */ /* our convention: a quarter-ellipse can only be 90 degrees of an X ellipse, not 270 degrees, so interchange points */ if (anglerange == 270) { int tmp; tmp = startangle; startangle = endangle; endangle = tmp; anglerange = 90; } if (startangle >= 360) /* avoid obscure X bug */ startangle -= 360; /* endangle no longer relevant */ /* location of `origin' (upper left corner of bounding rect. on display) and width and height; X's flipped-y convention affects these values */ xorigin = IROUND(XD(xc - x_orientation * rx, yc - y_orientation * ry)); yorigin = IROUND(YD(xc - x_orientation * rx, yc - y_orientation * ry)); squaresize_x = (unsigned int)IROUND(XDV(2 * x_orientation * rx, 0.0)); squaresize_y = (unsigned int)IROUND(YDV(0.0, 2 * y_orientation * ry)); /* reexpress in 64'ths of a degree (X11 convention) */ startangle *= 64; anglerange *= 64; _pl_x_draw_elliptic_arc_internal (R___(_plotter) xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } /* Use native X rendering to draw an elliptic arc on an X display. Takes account of the possible presence of more than one drawable, and the possible need for filling. The cases squaresize_{x,y} <= 1 are handled specially, since XFillArc() and XDrawArc() don't support them in the way we wish. More accurately, they don't support squaresize_{x,y} = 0 (documented), and don't support squaresize_{x,y} = 1 in the way we'd like (undocumented). */ void _pl_x_draw_elliptic_arc_internal (R___(Plotter *_plotter) int xorigin, int yorigin, unsigned int squaresize_x, unsigned int squaresize_y, int startangle, int anglerange) { if (X_OOB_INT(xorigin) || X_OOB_INT(yorigin) || X_OOB_UNSIGNED(squaresize_x) || X_OOB_UNSIGNED(squaresize_y)) /* dimensions can't be represented using X11's 2-byte ints, so punt */ { _plotter->warning (R___(_plotter) "not drawing an arc that extends too far for X11"); return; } if (_plotter->drawstate->fill_type) /* not transparent, so fill the arc */ { /* update GC used for filling */ _pl_x_set_attributes (R___(_plotter) X_GC_FOR_FILLING); /* select fill color as foreground color in GC used for filling */ _pl_x_set_fill_color (S___(_plotter)); if (squaresize_x <= 1 || squaresize_y <= 1) /* a special case, which XFillArc() doesn't handle in the way we'd like; just paint a single pixel, irrespective of angle range */ { if (_plotter->x_double_buffering != X_DBL_BUF_NONE) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fill, xorigin, yorigin); else { if (_plotter->x_drawable1) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fill, xorigin, yorigin); if (_plotter->x_drawable2) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fill, xorigin, yorigin); } } else /* default case, almost always used */ { if (_plotter->x_double_buffering != X_DBL_BUF_NONE) XFillArc(_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fill, xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); else { if (_plotter->x_drawable1) XFillArc(_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fill, xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); if (_plotter->x_drawable2) XFillArc(_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fill, xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } } } if (_plotter->drawstate->pen_type) /* pen is present, so edge the arc */ { unsigned int sp_size = 0; /* keep compiler happy */ /* update GC used for drawing */ _pl_x_set_attributes (R___(_plotter) X_GC_FOR_DRAWING); /* select pen color as foreground color in GC used for drawing */ _pl_x_set_pen_color (S___(_plotter)); if (squaresize_x <= 1 || squaresize_y <= 1) /* Won't call XDrawArc in the usual way, because it performs poorly when one of these two is zero, at least. Irrespective of angle range, will fill a disk of diameter equal to line width */ { int sp_offset; sp_size = (unsigned int)_plotter->drawstate->quantized_device_line_width; sp_offset = (int)(_plotter->drawstate->quantized_device_line_width + 1) / 2; if (sp_size == 0) sp_size = 1; xorigin -= sp_offset; yorigin -= sp_offset; } if (squaresize_x <= 1 || squaresize_y <= 1) /* special case */ { if (sp_size == 1) /* special subcase: line width is small too, so just paint a single pixel rather than filling abovementioned disk */ { if (_plotter->x_double_buffering != X_DBL_BUF_NONE) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, xorigin, yorigin); else { if (_plotter->x_drawable1) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, xorigin, yorigin); if (_plotter->x_drawable2) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, xorigin, yorigin); } } else /* normal version of special case: fill a disk of diameter equal to line width */ { if (_plotter->x_double_buffering != X_DBL_BUF_NONE) XFillArc(_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, xorigin, yorigin, sp_size, sp_size, 0, 64 * 360); else { if (_plotter->x_drawable1) XFillArc(_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, xorigin, yorigin, sp_size, sp_size, 0, 64 * 360); if (_plotter->x_drawable2) XFillArc(_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, xorigin, yorigin, sp_size, sp_size, 0, 64 * 360); } } } else /* default case, which is what is almost always used */ { if (_plotter->x_double_buffering != X_DBL_BUF_NONE) XDrawArc(_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); else { if (_plotter->x_drawable1) XDrawArc(_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); if (_plotter->x_drawable2) XDrawArc(_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, xorigin, yorigin, squaresize_x, squaresize_y, startangle, anglerange); } } } } /**********************************************************************/ /* This version of the internal method path_is_flushable() is for XDrawable and X Plotters, which will under some circumstances `pre-draw', i.e., draw line segments in real time. (This requires a zero line width and a "solid" line style.). In that case, this returns false; otherwise it will return true. */ bool _pl_x_path_is_flushable (S___(Plotter *_plotter)) { if (_plotter->drawstate->pen_type != 0 /* pen is present */ && _plotter->drawstate->line_type == PL_L_SOLID && !_plotter->drawstate->dash_array_in_effect /* really solid */ && _plotter->drawstate->points_are_connected /* really, really */ && _plotter->drawstate->quantized_device_line_width == 0 && !_plotter->drawstate->path->primitive) /* not a builtin */ /* we're pre-drawing rather than drawing when endpath() is finally invoked, so flushing out a partially drawn path by invoking endpath() early would be absurd */ return false; else /* endpath() will be invoked */ return true; } /**********************************************************************/ /* This version of the internal method maybe_prepaint_segments() is for XDrawable and X Plotters. It will draw line segments in real time if the line width is zero, the line style is "solid", and there's no filling to be done. Also, it requires that the polyline being drawn be unfilled, and not be one one of the polygonalized convex closed primitives (box/circle/ellipse). This hack makes it possible, after doing `graph -TX' (which has a default line width of zero), to type in points manually, and see the corresponding polyline drawn in real time. The `-x' and `-y' options must of course be specified too, to set the axis limits in advance. */ void _pl_x_maybe_prepaint_segments (R___(Plotter *_plotter) int prev_num_segments) { int i; bool something_drawn = false; /* sanity check */ if (_plotter->drawstate->path->num_segments < 2) return; if (_plotter->drawstate->path->num_segments == prev_num_segments) /* nothing to paint */ return; /* Our criteria for pre-drawing line segments: zero-width solid line, and we're not drawing this line segment as part of a polygonalized built-in object (i.e. a rectangles or ellipse). If the criteria aren't met, we wait until endpath() is invoked, or in general until the path is flushed out, before painting it. If we pre-draw, we don't also draw when endpath() is invoked. One exception: if the polyline is to be filled. In that case, at endpath time, we'll fill it and re-edge it. */ if (!(_plotter->drawstate->pen_type != 0 /* pen is present */ && _plotter->drawstate->line_type == PL_L_SOLID && !_plotter->drawstate->dash_array_in_effect /* really solid */ && _plotter->drawstate->points_are_connected /* really, really */ && _plotter->drawstate->quantized_device_line_width == 0 && !_plotter->drawstate->path->primitive)) /* not a built-in object */ /* we're not pre-drawing */ return; /* An X/XDrawable Plotter's segment list, at painting time, will only contain a polyline (i.e. a sequence of line segments) or a single circular or elliptic arc. That's because X/XDrawable Plotters can't handle `mixed paths'. Since they can't handle mixed paths, any single arc that's placed in a previously empty segment list will need to be replaced by a polygonal approximation, when and if additional segments need to be added. The maybe_replace_arc() function, which is invoked in the base Plotter code in several places, takes care of that. Because of this replacement procedure, maybe_prepaint_segments() may be invoked on a segment list that consists of a single moveto-arc or moveto-ellarc pair. We don't prepaint such things. Of course if the arc is subsequently replaced by a polygonal approximation, then we'll prepaint the polygonal approximation, at that time. */ if (prev_num_segments == 0 && _plotter->drawstate->path->num_segments == 2 && _plotter->drawstate->path->segments[0].type == S_MOVETO && (_plotter->drawstate->path->segments[1].type == S_ARC || _plotter->drawstate->path->segments[1].type == S_ELLARC)) return; if (prev_num_segments == 0) /* first segment of path; this must be a `moveto' */ { /* update GC used for drawing */ _pl_x_set_attributes (R___(_plotter) X_GC_FOR_DRAWING); /* select pen color as foreground color in GC used for drawing */ _pl_x_set_pen_color (S___(_plotter)); } /* Iterate over all segments to be painted. Because X/XDrawable Plotters can't handle `mixed paths', this function ends up being called only on sequences of line segments. */ for (i = IMAX(1, prev_num_segments); i < _plotter->drawstate->path->num_segments; i++) { /* use same variables for points #1 and #2, since reusing them works around an obscure bug in gcc 2.7.2.3 that rears its head if -O2 is used */ double xu, yu, xd, yd; double x, y; int x1, y1, x2, y2; /* starting and ending points for zero-width line segment: (xu,yu) and (x,y) respectively */ xu = _plotter->drawstate->path->segments[i-1].p.x; yu = _plotter->drawstate->path->segments[i-1].p.y; x = _plotter->drawstate->path->segments[i].p.x; y = _plotter->drawstate->path->segments[i].p.y; /* convert to integer X11 coordinates */ xd = XD(xu, yu); yd = YD(xu, yu); x1 = IROUND(xd); y1 = IROUND(yd); xd = XD(x,y); yd = YD(x,y); x2 = IROUND(xd); y2 = IROUND(yd); if (x1 != x2 || y1 != y2) /* line segment has nonzero length, so draw it */ { if (_plotter->x_double_buffering != X_DBL_BUF_NONE) /* double buffering, have a `x_drawable3' to draw into */ XDrawLine (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, x1, y1, x2, y2); else { if (_plotter->x_drawable1) XDrawLine (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, x1, y1, x2, y2); if (_plotter->x_drawable2) XDrawLine (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, x1, y1, x2, y2); } something_drawn = true; } else /* line segment in terms of integer device coordinates has zero length; but if it has nonzero length in user coordinates, draw it as a single pixel unless cap type is "butt" */ if (!(_plotter->drawstate->cap_type == PL_CAP_BUTT && xu == x && yu == y)) { if (_plotter->x_double_buffering != X_DBL_BUF_NONE) /* double buffering, have a `x_drawable3' to draw into */ XDrawPoint (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, x1, y1); else /* not double buffering */ { if (_plotter->x_drawable1) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, x1, y1); if (_plotter->x_drawable2) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, x1, y1); } something_drawn = true; } } if (something_drawn) /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); } bool _pl_x_paint_paths (S___(Plotter *_plotter)) { return false; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_point.c���������������������������������������������������������������������0000644�0001750�0001750�00000006466�11037243262�013646� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* The internal point-drawing function, which point() is a wrapper around. It draws a point at the current location. There is no standard definition of `point', so any Plotter is free to implement this as it sees fit. */ /* This version is for XDrawablePlotters and XPlotters. It calls _maybe_handle_x_events(), which is a no-op for the former but not the latter (it flushes the X output buffer and may also check for events). Since point() is used mostly by people drawing images, it may be invoked a great many times. To speed things up, the call to _maybe_handle_x_events() is performed only once per X_POINT_FLUSH_PERIOD invocations of this function. */ #define X_POINT_FLUSH_PERIOD 8 #include "sys-defines.h" #include "extern.h" void _pl_x_paint_point (S___(Plotter *_plotter)) { double xx, yy; int ix, iy; plColor oldcolor, newcolor; if (_plotter->drawstate->pen_type != 0) /* have a pen to draw with */ { /* set pen color as foreground color in GC used for drawing (but first, check whether we can avoid a function call) */ newcolor = _plotter->drawstate->fgcolor; oldcolor = _plotter->drawstate->x_current_fgcolor; /* as stored in gc */ if (newcolor.red != oldcolor.red || newcolor.green != oldcolor.green || newcolor.blue != oldcolor.blue || ! _plotter->drawstate->x_gc_fgcolor_status) _pl_x_set_pen_color (S___(_plotter)); xx = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); yy = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); ix = IROUND(xx); iy = IROUND(yy); if (_plotter->x_double_buffering != X_DBL_BUF_NONE) /* double buffering, have a `x_drawable3' to draw into */ XDrawPoint (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, ix, iy); else /* not double buffering, have no `x_drawable3' */ { if (_plotter->x_drawable1) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, ix, iy); if (_plotter->x_drawable2) XDrawPoint (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, ix, iy); } } /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ if (_plotter->x_paint_pixel_count % X_POINT_FLUSH_PERIOD == 0) _maybe_handle_x_events (S___(_plotter)); _plotter->x_paint_pixel_count++; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_retrieve.c������������������������������������������������������������������0000644�0001750�0001750�00000134072�11037243262�014335� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the Plotter-specific _retrieve_font method, which is called by the _pl_g_set_font() function, which in turn is invoked by the API functions alabel() and flabelwidth(). It is called when the font_name, font_size, and textangle fields of the current drawing state have been filled in. It retrieves the specified font, and fills in the font_type, typeface_index, font_index, font_is_iso8858, true_font_size, and font_ascent, and font_descent fields of the drawing state. */ /* This version is for XDrawablePlotters (and XPlotters). It also fills in the x_font_struct and x_font_pixel_size fields of the drawing state, which are X-specific. This version operates by retrieving an 8-bit core X font from the X display, as follows. First, it looks at the x_label field of the drawing state, which may contain a "hint": a string passed down from a higher level, containing the characters that will eventually be rendered in the font. This is for efficiency. If possible, only a subset of the font will be retrieved (most X displays support this). Nearly all core X fonts have XLFD (X Logical Font Description) names. So we run through various possibilities: first we try to interpret the font_name parameter as the name of a PS font in libplot's hardcoded font database (e.g. "Times-Roman"), in which case the database will supply a corresponding base XLFD name (e.g., "times-medium-r-normal"); then we try to interpret font_name as a base XLFD name which is not in the hardcoded database (e.g. "charter-medium-r-normal"); then finally we try to interpret it as a non-XLFD font name (e.g., "fixed" or "9x15"). In each of these cases, we try to retrieve only a subset of the font (as specified by the x_label field, just mentioned); if that fails, an attempt is made to retrieve the entire font. Text strings, including rotated and affinely transformed text strings, will eventually be rendered in x_text.c, using the XAffText module in x_afftext.c. So here, all we do is retrieve a reasonable pixel size for the font, which will be scaled, etc., as needed. (Note that the choice we make for the pixel size does not depend on the `textangle' drawing parameter, which is the rotation angle of the text in the user frame; though the XAffText module will pay attention to that parameter.) The XAffText module will take care of scaling, so we set the true_font_size parameter to be the same as the user-specified font_size. Note: For speed, we maintain a linked-list cache of previously rasterized-and-retrieved fonts. The linked list is accessible via the x_font_list member of the XDrawablePlotter (or XPlotter). An ever-growing linked list is probably good enough if there aren't huge numbers of font or font size changes. It's deallocated when the Plotter is destroyed; see x_defplot.c. */ #include "sys-defines.h" #include "extern.h" #include "g_her_metr.h" /* max length user-level font name we'll accept; this may be either an XLFD base name (a string with exactly three hyphens in it), or something else (an alias, a pre-XLFD font name, etc.). */ #define MAX_USER_FONT_NAME_LENGTH 200 /* length of buffer for constructing an X font name; must be large enough to handle XFLD template, user-level font name */ #define MAX_FONT_NAME_LENGTH 255 /* XLFD templates, with holes into which we can punch the base XLFD name (a string with exactly three hyphens in it) and the integer size in terms of pixels. We need a Latin-1 one and a generic one, since e.g. the Symbol font, which we support, has "adobe-fontspecific" as its last two fields. */ static const char * const xlfd_template_latin_1 = "-*-%s-*-%d-*-*-*-*-*-iso8859-1"; static const char * const xlfd_template_generic = "-*-%s-*-%d-*-*-*-*-*-*-*"; /* length of buffer for constructing an X11R6-style list-of-charset-ranges string, e.g. "[32 48_57 65_90]" would represent the non-contiguous set of characters [ 0-9A-Z]. */ #define MAX_CHARSET_SUBSET_LIST_LENGTH 767 #define PL_NUM_XLFD_FIELDS 14 #define XLFD_FIELD_FOUNDRY 0 #define XLFD_FIELD_FAMILY 1 #define XLFD_FIELD_WEIGHT 2 #define XLFD_FIELD_SLANT 3 #define XLFD_FIELD_SET_WIDTH 4 #define XLFD_FIELD_ADDITIONAL_STYLE 5 #define XLFD_FIELD_PIXELS 6 #define XLFD_FIELD_POINTS 7 #define XLFD_FIELD_HORIZONTAL_RESOLUTION 8 #define XLFD_FIELD_VERTICAL_RESOLUTION 9 #define XLFD_FIELD_SPACING 10 #define XLFD_FIELD_AVERAGE_WIDTH 11 #define XLFD_FIELD_CHARACTER_SET_MAJOR 12 #define XLFD_FIELD_CHARACTER_SET_MINOR 13 /* in X11R6 may include char subset */ /* forward references */ static bool is_a_subset (unsigned char set1[32], unsigned char set2[32]); static char *xlfd_field (const char *name, int field); static double min_sing_val (double m[4]); static void print_bitvector (unsigned char v[32], char *s); static void set_font_dimensions (Display *dpy, plXFontRecord *fptr); static void string_to_bitvector (const unsigned char *s, unsigned char v[8]); static plXFontRecord *select_x_font (Display *dpy, plXFontRecord **x_fontlist_ptr, const char *name, const unsigned char *s, bool subsetting); /* _pl_x_retrieve_font() attempts to retrieve a core X font specified by a triple, namely {name, size, rotation}. The rotation parameter is ignored, since the XAffText module will be used to rotate or transform any rendered string (see x_text.c, and x_afftext.c for the module). Four possible font retrievals are attempted, in order. 1. `name' is taken to be an alias for an XLFD base name, as listed in libplot's hardcoded font database in g_fontdb.c. (Aliases for the 35 standard font names appear there. E.g., name="times-roman" or "Times-Roman" is an alias for the three-hyphen XLFD base name "times-roman-r-normal".) 2. `name' is taken to be an XLFD base name, of the form foundry-family-weight-slant-width, with exactly four hyphens. E.g., name="adobe-times-roman-r-normal" or name="bitstream-courier-medium-r-normal". NOT YET IMPLEMENTED. 3. `name' is taken to be an XLFD base name, of the form family-weight-slant-width, with exactly three hyphens. E.g., name="grotesk-bold-r-normal", or "times-medium-r-normal". 4. `name' is taken to be a full font name, in which case `size' is ignored. E.g., name="fixed" or name="9x15" or name="-dec-terminal-bold-r-normal--14-140-75-75-c-80-iso8859-1". This option is mostly to support ancient core X fonts without proper XLFD names, such as "9x15". If a core X font is successfully retrieved (which will set the fields true_font_size, font_ascent, font_descent, and font_is_iso8859_1 of the drawing state, and the X-specific fields x_font_struct, x_font_pixel_size), then this function fills in the font_type field (PL_F_POSTSCRIPT [or PL_F_PCL] in case 1, PL_F_OTHER in cases 2, 3 and 4), and returns true. If a font is not successfully retrieved, this function returns false. The typeface_index and font_index fields are also filled in, in case 1. In the other cases (PL_F_OTHER) it's hardly worth it to fill them in, since switching to other fonts in the middle of a text string, except for a symbol font (`font #0') won't be supported. See g_cntrlify.c. */ bool _pl_x_retrieve_font (S___(Plotter *_plotter)) { const char *name, *true_name = ""; /* keep compiler happy */ bool matched_builtin = false; /* font name matches name of a font in db? */ bool success; /* font retrieved from cache or server? */ const char *name_p; const char *x_name = NULL, *x_name_alt = NULL; /* from db */ const char *x_name_alt2 = NULL, *x_name_alt3 = NULL; /* from db */ int typeface_index = 0, font_index = 0; /* from db */ int font_type = PL_F_POSTSCRIPT; /* from db */ int i, hyphen_count; name = _plotter->drawstate->font_name; #ifdef DEBUG fprintf (stderr, "----------------------------------------------------------------------\n"); fprintf (stderr, "_pl_x_retrieve_font(): name=\"%s\", size=%g, x_label=%s\n", name, _plotter->drawstate->font_size, _plotter->drawstate->x_label); #endif if (strlen (name) > MAX_USER_FONT_NAME_LENGTH) /* avoid buffer overflow */ return false; if (_plotter->drawstate->font_size == 0.0) /* don't try to retrieve zero-size fonts */ return false; /* Search null-terminated table of recognized PS fonts, in g_fontdb.c, for a name matching the passed name. We support either PS-style names (e.g. "Times-Roman") or shortened XLFD-style names (e.g. "times-medium-r-normal"). Alternative versions of latter are supported because some X servers use "zapfdingbats" instead of "itc zapf dingbats", etc. */ i = -1; while (_pl_g_ps_font_info[++i].ps_name) /* array ends in NULL */ { if ((strcasecmp (_pl_g_ps_font_info[i].ps_name, name) == 0) /* check alternative ps font name if any */ || (_pl_g_ps_font_info[i].ps_name_alt && strcasecmp (_pl_g_ps_font_info[i].ps_name_alt, name) == 0) /* check 2nd alternative ps font name if any */ || (_pl_g_ps_font_info[i].ps_name_alt2 && strcasecmp (_pl_g_ps_font_info[i].ps_name_alt2, name) == 0) /* check X font name */ || (strcasecmp (_pl_g_ps_font_info[i].x_name, name) == 0) /* check alternative X font name if any */ || (_pl_g_ps_font_info[i].x_name_alt && strcasecmp (_pl_g_ps_font_info[i].x_name_alt, name) == 0) /* check 2nd alternative X font name if any */ || (_pl_g_ps_font_info[i].x_name_alt2 && strcasecmp (_pl_g_ps_font_info[i].x_name_alt2, name) == 0) /* check 3rd alternative X font name if any */ || (_pl_g_ps_font_info[i].x_name_alt3 && strcasecmp (_pl_g_ps_font_info[i].x_name_alt3, name) == 0)) break; } if (_pl_g_ps_font_info[i].ps_name) /* matched name of a PS font in database */ { matched_builtin = true; true_name = _pl_g_ps_font_info[i].ps_name; x_name = _pl_g_ps_font_info[i].x_name; x_name_alt = _pl_g_ps_font_info[i].x_name_alt; x_name_alt2 = _pl_g_ps_font_info[i].x_name_alt2; x_name_alt3 = _pl_g_ps_font_info[i].x_name_alt3; font_type = PL_F_POSTSCRIPT; typeface_index = _pl_g_ps_font_info[i].typeface_index; font_index = _pl_g_ps_font_info[i].font_index; } #ifdef USE_LJ_FONTS_IN_X if (matched_builtin == false) /* PS match failed, so try PCL fonts too */ { i = -1; while (_pl_g_pcl_font_info[++i].ps_name) /* array ends in NULL */ { if ((strcasecmp (_pl_g_pcl_font_info[i].ps_name, name) == 0) /* check alternative ps font name if any */ || (_pl_g_pcl_font_info[i].ps_name_alt && strcasecmp (_pl_g_pcl_font_info[i].ps_name_alt, name) == 0) /* check X font name */ || (strcasecmp (_pl_g_pcl_font_info[i].x_name, name) == 0)) break; } if (_pl_g_pcl_font_info[i].ps_name) /* matched name of a PCL font in db */ { matched_builtin = true; true_name = _pl_g_pcl_font_info[i].ps_name; x_name = _pl_g_pcl_font_info[i].x_name; x_name_alt = NULL; font_type = PL_F_PCL; typeface_index = _pl_g_pcl_font_info[i].typeface_index; font_index = _pl_g_pcl_font_info[i].font_index; } } #endif /* USE_LJ_FONTS_IN_X */ #ifdef DEBUG fprintf (stderr, "Matched database font %s = %s = %s = %s\n", x_name, x_name_alt, x_name_alt2, x_name_alt3); #endif if (matched_builtin) { /* user passed the name of a PS or PCL font in libplot's database */ success = _pl_x_select_xlfd_font_carefully (R___(_plotter) x_name, x_name_alt, x_name_alt2, x_name_alt3); if (success) /* RETRIEVAL TYPE #1: we've retrieved a core X font, the XLFD name of which was listed in libplot's hardcoded database; and have filled in X-specific fields */ { free ((char *)_plotter->drawstate->true_font_name); _plotter->drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (true_name) + 1); strcpy ((char *)_plotter->drawstate->true_font_name, true_name); _plotter->drawstate->font_type = font_type; _plotter->drawstate->typeface_index = typeface_index; _plotter->drawstate->font_index = font_index; #ifdef DEBUG fprintf (stderr, "_pl_x_retrieve_font(): retrieved \"%s\" as \"%s\", type=%d\n", name, _plotter->drawstate->true_font_name, _plotter->drawstate->font_type); fprintf (stderr, "_pl_x_retrieve_font(): font_size=%g, true_font_size=%g, font_ascent=%g, font_descent=%g, font_is_iso8859_1=%d, x_font_pixel_size=%d\n", _plotter->drawstate->font_size, _plotter->drawstate->true_font_size, _plotter->drawstate->font_ascent, _plotter->drawstate->font_descent, _plotter->drawstate->font_is_iso8859_1, _plotter->drawstate->x_font_pixel_size); #endif return true; } } /* User-specified font name didn't match either of the names of any PS [or PCL] font in libplot's database, so first handle the possibility that it's an XLFD base name for some other core X font (e.g. "charter-medium-r-normal"), with exactly three hyphens. */ name_p = name; hyphen_count = 0; while (*name_p) hyphen_count += (*name_p++ == '-' ? 1 : 0); if (hyphen_count == 3) /* treat as base of an XLFD name */ { success = _pl_x_select_xlfd_font_carefully (R___(_plotter) name, NULL, NULL, NULL); if (success) /* RETRIEVAL TYPE #3: we've retrieved a core X font, the base XLFD name of which was passed by the user, that isn't one of the fonts in libplot's hardcoded database; and have filled in X-specific fields */ { free ((char *)_plotter->drawstate->true_font_name); _plotter->drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (name) + 1); strcpy ((char *)_plotter->drawstate->true_font_name, name); _plotter->drawstate->font_type = PL_F_OTHER; /* these two fields are irrelevant because we don't support switching among fonts not in libplot's internal database */ _plotter->drawstate->typeface_index = 0; _plotter->drawstate->font_index = 1; #ifdef DEBUG fprintf (stderr, "_pl_x_retrieve_font(): retrieved \"%s\" as \"%s\", type=%d\n", name, _plotter->drawstate->true_font_name, _plotter->drawstate->font_type); fprintf (stderr, "_pl_x_retrieve_font(): font_size=%g, true_font_size=%g, font_ascent=%g, font_descent=%g, font_is_iso8859_1=%d, x_font_pixel_size=%d\n", _plotter->drawstate->font_size, _plotter->drawstate->true_font_size, _plotter->drawstate->font_ascent, _plotter->drawstate->font_descent, _plotter->drawstate->font_is_iso8859_1, _plotter->drawstate->x_font_pixel_size); #endif return true; } } /* User-passed name didn't have exactly 3 hyphens, so try treating it as the full name of a core X font; ignore size. This a kludge, included partly to support pre-XLFD fonts, e.g. "9x15", and aliases for XLFD fonts, e.g. "fixed". Most of the latter are really pre-XLFD names. */ { double det; det = _plotter->drawstate->transform.m[0] * _plotter->drawstate->transform.m[3] - _plotter->drawstate->transform.m[1] * _plotter->drawstate->transform.m[2]; if (det == 0.0) /* singular user-space -> device-space map; bail */ return false; /* Try to retrieve font from server or cache list, given its full name; and for the moment, ignore the preferred pixel size we just computed. 3rd argument `false' requests entire font. A GOOD IDEA? */ success = _pl_x_select_font_carefully (R___(_plotter) name, _plotter->drawstate->x_label, false); if (success) /* RETRIEVAL TYPE #4: we've retrieved a core X font, the full name of which was passed by the user, that isn't one of the fonts in libplot's hardcoded database */ { free ((char *)_plotter->drawstate->true_font_name); _plotter->drawstate->true_font_name = (const char *)_pl_xmalloc (strlen (name) + 1); strcpy ((char *)_plotter->drawstate->true_font_name, name); _plotter->drawstate->font_type = PL_F_OTHER; /* these two fields are irrelevant because we don't support switching among `other' fonts */ _plotter->drawstate->typeface_index = 0; _plotter->drawstate->font_index = 1; if (_plotter->drawstate->x_font_pixel_size == 0) /* paranoia */ return false; #ifdef DEBUG fprintf (stderr, "_pl_x_retrieve_font(): retrieved \"%s\" as \"%s\", type=%d\n", name, _plotter->drawstate->true_font_name, _plotter->drawstate->font_type); #endif return true; } } /* couldn't retrieve a matching X font, so declare failure; this will lead (at a higher level; see g_retrieve.c) either to the retrieval of a default substitute X font, or a builtin Hershey font */ #ifdef DEBUG fprintf (stderr, "_pl_x_retrieve_font(): FAILURE, couldn't retrieve \"%s\"\n", name); #endif return false; } /* _pl_x_select_xlfd_font_carefully() is a helper function that x_retrieve_font() above uses. It constructs a full XLFD name of a core X11 font from each of several specified base XLFD names, such as "helvetica-medium-r-normal", and attempts to retrieve them in order, until a successful retrieval occurs. The inclusion of several alternatives is useful, since each of the built-in fonts in libplot's database (see g_fontdb.c) is associated with several possible base XLFD names. That's because there is no standardization of names across vendors, even for the commonly used `Adobe 35' fonts, i.e., libplot's supported `Postscript fonts'. For each alternative, a fontname ending in -iso8859-1 (indicating the ISO-Latin-1 encoding) is tried, and if that doesn't work, a fontname ending in -*-* (the encoding being left up to the server). The lower-level function _pl_x_select_font_carefully() does the retrieval. It is passed the `x_label' field of the drawing state, which is a hint indicating which characters are needed. A proper subset of the font will be retrieved, if possible, to save time. The proper subset is indicated to the server, as usual, by a suffix on the font name. E.g., ....-iso8859-1[88 89] consists only of the letters `X' and `Y' (characters 88 and 89). This code, when requesting the retrieval, must place an integer pixel size in the XLFD name. The pixel size it chooses is based on (1) the font_size in user coordinates and (2) the transformation matrix, which takes user-space to device-space, i.e., to X11 pixel space. When any label is drawn, the retrieved font will in general be scaled, by XAffDrawString(); see the code in x_text.c. So this code cleverly chooses an integer pixel size which, if it weren't for rounding to the closest integer, wouldn't require any scaling of the glyph bitmaps at all, provided that the user-space -> device-space is uniform (not "anamorphic"), and doesn't involve a rotation. */ bool _pl_x_select_xlfd_font_carefully (R___(Plotter *_plotter) const char *x_name, const char *x_name_alt, const char *x_name_alt2, const char *x_name_alt3) { char *x_name_buf; /* buffer for creating font name */ bool success = false; int integer_font_size_in_pixels; double det, font_size_in_pixels; det = _plotter->drawstate->transform.m[0] * _plotter->drawstate->transform.m[3] - _plotter->drawstate->transform.m[1] * _plotter->drawstate->transform.m[2]; if (det == 0.0) /* singular user-space -> device-space map; bail */ return false; /* Compute preferred pixel size for the core X font: the user-space font size, multiplied by a measure of the size of the user-space to device-space transformation matrix. The "measure" we choose is the minimum of the matrix's two singular values. (There are other possible choices for this measure.) */ font_size_in_pixels = min_sing_val (_plotter->drawstate->transform.m) *_plotter->drawstate->font_size; if (font_size_in_pixels == 0.0) /* preferred device-space font size, in terms of pixels, is zero; bail */ return false; /* quantize to an integer pixel size: round downward */ integer_font_size_in_pixels = (int)font_size_in_pixels; if (font_size_in_pixels == 0) /* integer device-space size, in terms of pixels, is zero; bail */ return false; /* prepare buffer for font name assemblage */ x_name_buf = (char *)_pl_xmalloc ((MAX_FONT_NAME_LENGTH + 1) * sizeof (char)); /* try to retrieve font from server or cache list, after punching the pixel size into the appropriate XLFD fontname template */ /* try Latin-1 fontname, i.e. fontname ending in -iso8859-1 */ sprintf (x_name_buf, xlfd_template_latin_1, x_name, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); #ifdef DEBUG fprintf (stderr, "_pl_x_select_xlfd_font_carefully(): retrieval begins with %s\n", x_name_buf); #endif if (success == false) /* try fontname ending in -*-* */ { sprintf (x_name_buf, xlfd_template_generic, x_name, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); } if (x_name_alt) /* alternative base XLFD name was supplied, so try it too */ { if (success == false) /* try Latin-1 fontname, i.e. fontname ending in -iso8859-1 */ { sprintf (x_name_buf, xlfd_template_latin_1, x_name_alt, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); } if (success == false) /* try fontname ending in -*-* */ { sprintf (x_name_buf, xlfd_template_generic, x_name_alt, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); } } if (x_name_alt2) /* 2nd alternative base XLFD name was supplied, so try it too */ { if (success == false) /* try Latin-1 fontname, i.e. fontname ending in -iso8859-1 */ { sprintf (x_name_buf, xlfd_template_latin_1, x_name_alt2, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); } if (success == false) /* try fontname ending in -*-* */ { sprintf (x_name_buf, xlfd_template_generic, x_name_alt2, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); } } if (x_name_alt3) /* 3rd alternative base XLFD name was supplied, so try it too */ { if (success == false) /* try Latin-1 fontname, i.e. fontname ending in -iso8859-1 */ { sprintf (x_name_buf, xlfd_template_latin_1, x_name_alt3, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); } if (success == false) /* try fontname ending in -*-* */ { sprintf (x_name_buf, xlfd_template_generic, x_name_alt3, integer_font_size_in_pixels); success = _pl_x_select_font_carefully (R___(_plotter) x_name_buf, _plotter->drawstate->x_label, true); } } if (success) /* A clever hack. Slightly alter the true_font_size field (and font_ascent/font_descent/font_cap_height for consistency), in a way that will permit any text string to be rendered in this font by XDrawString(), rather than by our bitmap-scaling code in x_afftext.c. Provided, that is, the text string isn't rotated, and the user-space -> device-space transformation is a uniform scaling that respects coordinate axes. The reason this works is that the rendering code in x_text.c calls our bitmap-scaling function XAffDrawString() with a certain transformation matrix a[] as an argument. Under the above circumstances, this matrix will turn out to be the identity matrix, due to the slight modification performed below. That being the case, XAffDrawString() will simply call XDrawString rather than performing any bitmap scaling. The result: in the above circumstances, which are very common, the glyphs in the text string won't undergo a slight scaling traceable to the integer quantization of font pixel size, and will look better. */ { double factor = integer_font_size_in_pixels / font_size_in_pixels; /* scale by this factor, quite close to unity */ _plotter->drawstate->true_font_size *= factor; _plotter->drawstate->font_ascent *= factor; _plotter->drawstate->font_descent *= factor; _plotter->drawstate->font_cap_height *= factor; } return success; } /* _pl_x_select_font_carefully() is a wrapper around select_x_font() below. It attempts to retrieve the font NAME from the X server or from the per-Plotter font cache of already-retrieved fonts. The character subset desired (if any) is specified by the string S, and whether an attempt should actually be made to retrieve a subset rather than the entire is specified by the parameter SUBSETTING. The return value indicates whether the retrieval succeeded. A NULL value for S means the font is being retrieved only to look at its metrics; in which case select_x_font() will attempt to retrieve the character 'X' only, to permit the cap-height metric to be determined; and the space character, for good measure. This is arranged in the low-level function string_to_bitvector() below; we _always_ include the characters 'X' and ' ' among those we ask the server to rasterize. The inclusion of 'X' incidentally works around a bug reported by Georgy Salnikov , in XFree86-3.2. (We previously tried to retrieve not 'X', but rather the space character. But if an XLFD font name ends in *-*[32], i.e. font contains only a single space, XFree86 reports an error retrieving the font, and any executable linked with this code client will terminate.) If the font is successfully retrieved (either from the X server or from the cache), this function fills in most font-related fields of the drawing state. That includes the generic fields true_font_size, font_ascent, font_descent, font_cap_height, font_is_iso8859_1, and the X-specific fields x_font_struct and x_font_pixel_size. The true_font_size is simply set equal to font_size (which is whatever the user passed to libplot by invoking the fontname() function in the libplot API). That is because in principle, libplot's X driver can match exactly any user-specified font size, by scaling bitmaps. See x_text.c and x_afftext.c for the code that renders text strings. */ bool _pl_x_select_font_carefully (R___(Plotter *_plotter) const char *name, const unsigned char *s, bool subsetting) { plXFontRecord *fptr; if (s == (unsigned char *)NULL) s = (unsigned char *)""; /* "" is effectively "X " */ /* attempt to retrieve the specified (subset of the) font */ fptr = select_x_font (_plotter->x_dpy, &(_plotter->x_fontlist), name, s, subsetting); #ifdef DEBUG fprintf (stderr, "_pl_x_select_font_carefully(): select_x_font() returns %p\n", fptr); #endif if (subsetting && (fptr == (plXFontRecord *)NULL)) /* failure; so try to retrieve entire font instead of a subset, ignoring the passed hint string S (perhaps server doesn't support subsetting?) */ fptr = select_x_font (_plotter->x_dpy, &(_plotter->x_fontlist), name, s, false); if (fptr == (plXFontRecord *)NULL) /* couldn't retrieve font from cache or from server */ return false; else /* Success, so fill in fields of the drawing state from the returned font record. Most are generic rather than X-specific. Ascent, descent and cap_height are user-space quantities; so are scaled by the font_size, which is expressed in user-space units. */ { if (fptr->x_font_pixel_size <= 0) /* paranoia */ return false; #ifdef DEBUG fprintf (stderr, "fontname = %s, min_char_or_byte2 = %u, max_char_or_byte2 = %u, ascent = %d, descent = %d, default_char = %u\n", name, fptr->x_font_struct->min_char_or_byte2, fptr->x_font_struct->max_char_or_byte2, fptr->x_font_struct->ascent, fptr->x_font_struct->descent, fptr->x_font_struct->default_char); #endif /* set generic fields */ _plotter->drawstate->true_font_size = _plotter->drawstate->font_size; _plotter->drawstate->font_ascent = ((fptr->x_font_struct->ascent * _plotter->drawstate->font_size) / fptr->x_font_pixel_size); _plotter->drawstate->font_descent = ((fptr->x_font_struct->descent * _plotter->drawstate->font_size) / fptr->x_font_pixel_size); _plotter->drawstate->font_cap_height = ((fptr->x_font_cap_height * _plotter->drawstate->font_size) / fptr->x_font_pixel_size); _plotter->drawstate->font_is_iso8859_1 = fptr->x_font_is_iso8859_1; /* set X-specific fields */ _plotter->drawstate->x_font_struct = fptr->x_font_struct; _plotter->drawstate->x_font_pixel_size = fptr->x_font_pixel_size; return true; } } /* Attempt to retrieve a core X font, as a plXFontRecord. The font is specified by NAME, and a hint as to which characters will need to be rendered is passed as the non-null string S. This permits the retrieval of a proper subset of the font, if desired. The SUBSETTING parameter indicates whether the retrieval of an appropriate subset of the font should first be attempted, before retrieval of the entire font. The X_FONTLIST_PTR argument passes [by reference!] a pointer to a font cache, a linked list of plXFontRecords that will be searched. If the font isn't found in the cache but can be successfully retrieved from the X display server instead, a new record is added to the head of this list; and if it can't be, a null (invalid) record is added to the head of the list; in both cases, to speed up later retrieval attempts. Return value: a pointer to the font record, if a font was found in the cache or newly added to it; otherwise NULL. */ static plXFontRecord * select_x_font (Display *dpy, plXFontRecord **x_fontlist_ptr, const char *name, const unsigned char *s, bool subsetting) { bool found = false; unsigned char bitvec[32]; plXFontRecord *x_fontlist, *fptr; #ifdef DEBUG fprintf (stderr, "select_x_font (name=\"%s\", subset=\"%s\", subsetting=%d)\n", name, (const char *)s, subsetting); #endif if (subsetting) /* construct 256-bit vector specifying charset subset */ string_to_bitvector (s, bitvec); /* get head of linked-list cache */ x_fontlist = *x_fontlist_ptr; /* attempt to find font in cache */ for (fptr = x_fontlist; fptr; fptr = fptr->next) { #ifdef DEBUG fprintf (stderr, "select_x_font(): cache entry: name=\"%s\", subset=%d\n", fptr->x_font_name, fptr->subset); #endif if (strcmp (name, fptr->x_font_name) == 0) { if ((subsetting && fptr->subset && is_a_subset (bitvec, fptr->subset_vector)) || (subsetting && (fptr->subset == false)) || (subsetting == false && fptr->subset == false)) { found = true; break; } } } if (found) { if (fptr->x_font_struct) /* found record was a genuine one */ { #ifdef DEBUG fprintf (stderr, "select_x_font(): font cache HIT on name=%s, s=\"%s\"\n", name, s); #endif return fptr; } else { #ifdef DEBUG fprintf (stderr, "select_x_font(): font cache HIT (fake) on name=\"%s\", s=\"%s\"\n", name, s); #endif /* invalid record: an earlier retrieval attempt must have failed */ return (plXFontRecord *)NULL; } } #ifdef DEBUG fprintf (stderr, "select_x_font(): font cache miss on name=\"%s\", s=\"%s\"\n", name, s); #endif /* no record in cache, so try to retrieve font from X server */ { char *tmpname, *tmpname_perm, *_charset_subset_list = NULL; int extra = 0; /* allocate space for new record, update pointer to cache to include it */ fptr = (plXFontRecord *)_pl_xmalloc (sizeof (plXFontRecord)); fptr->next = *x_fontlist_ptr; *x_fontlist_ptr = fptr; if (subsetting) { _charset_subset_list = (char *)_pl_xmalloc ((MAX_CHARSET_SUBSET_LIST_LENGTH + 1) * sizeof (char)); print_bitvector (bitvec, _charset_subset_list); extra = strlen (_charset_subset_list); } tmpname_perm = (char *)_pl_xmalloc (1 + strlen (name)); strcpy (tmpname_perm, name); tmpname = (char *)_pl_xmalloc (1 + strlen (name) + extra); strcpy (tmpname, name); if (subsetting) { /* append X11R6 list-of-ranges to name to be sent to server */ strcat (tmpname, _charset_subset_list); free (_charset_subset_list); } #ifdef DEBUG fprintf (stderr, "select_x_font(): trying to invoke XLoadQueryFont on \"%s\", subsetting=%d\n", tmpname, subsetting); #endif /* attempt to retrieve font from server; return value from XLoadQueryFont() equalling NULL indicates failure */ fptr->x_font_struct = XLoadQueryFont (dpy, tmpname); free (tmpname); /* whether or not there was success, fill in some add'l fields of record */ fptr->x_font_name = tmpname_perm; /* don't include subset in stored name */ fptr->subset = subsetting; if (subsetting) memcpy (fptr->subset_vector, bitvec, 32 * sizeof (unsigned char)); /* handle a special case: retrieval from server succeeded, but the retrieved font wasn't an 8-bit font, so we can't use it */ if (fptr->x_font_struct && (fptr->x_font_struct->min_byte1 != 0 || fptr->x_font_struct->max_byte1 != 0)) /* treat as if retrieval failed */ { XFreeFont (dpy, fptr->x_font_struct); fptr->x_font_struct = (XFontStruct *)NULL; } if (fptr->x_font_struct) /* retrieval succeeded */ { #ifdef DEBUG fprintf (stderr, "select_x_font(): loaded font \"%s\"\n", name); #endif /* fill in, as well, the x_font_pixel_size, x_font_cap_height, x_font_iso_8859_1 fields of the font record */ set_font_dimensions (dpy, fptr); return fptr; /* X font selected */ } else /* retrieval failed */ { #ifdef DEBUG fprintf (stderr, "select_x_font(): failed to load font \"%s\"\n", name); #endif return (plXFontRecord *)NULL; } } } /* Complete the filling in of an plXFontRecord, by filling in the fields x_font_pixel_size, x_font_cap_height, and x_font_is_iso8859_1, on the basis of the x_font_struct field. Called by preceding function. */ static void set_font_dimensions (Display *dpy, plXFontRecord *fptr) { unsigned long retval; char *name, *pixel_field; char *charset_major_field, *charset_minor_field; #ifdef DEBUG2 { int i; for (i = 0; i < fptr->x_font_struct->n_properties; i++) fprintf (stderr, "\tproperty %s [atom %lu] is %ld\n", XGetAtomName(dpy, fptr->x_font_struct->properties[i].name), fptr->x_font_struct->properties[i].name, fptr->x_font_struct->properties[i].card32); } #endif if (XGetFontProperty (fptr->x_font_struct, XA_FONT, &retval)) /* this font has a FONT property, as any well behaved font should */ { /* Extract relevant fields from this property (i.e. from X server's idea of the font name). This will work if it's an XLFD name. */ name = XGetAtomName (dpy, retval); #ifdef DEBUG fprintf (stderr, "set_font_dimensions(): FONT property is \"%s\"\n", name); #endif pixel_field = xlfd_field (name, XLFD_FIELD_PIXELS); charset_major_field = xlfd_field (name, XLFD_FIELD_CHARACTER_SET_MAJOR); charset_minor_field = xlfd_field (name, XLFD_FIELD_CHARACTER_SET_MINOR); XFree (name); /* determine whether font encoding is ISO-Latin-1 */ if ((charset_major_field != NULL) && (charset_minor_field != NULL) && strcasecmp (charset_major_field, "iso8859") == 0 && (charset_minor_field[0] == (char)'1' && (charset_minor_field[1] == (char)0 /* string terminator */ || charset_minor_field[1] == (char)'['))) fptr->x_font_is_iso8859_1 = true; else fptr->x_font_is_iso8859_1 = false; if (charset_major_field) free (charset_major_field); if (charset_minor_field) free (charset_minor_field); if (pixel_field != NULL) /* font presumably has an XLFD name, since it has a pixel field */ { /* extract x_font_pixel_size from the pixel field */ unsigned int size; sscanf (pixel_field, "%u", &size); fptr->x_font_pixel_size = size; free (pixel_field); /* fill in the font_{cap_height} field; we get it from the ascent of the `X' character, if it exists */ if ('X' >= fptr->x_font_struct->min_char_or_byte2 && 'X' <= fptr->x_font_struct->max_char_or_byte2 && fptr->x_font_struct->per_char) /* have `X' char in the font, and have per-char data */ { int X = 'X' - fptr->x_font_struct->min_char_or_byte2; fptr->x_font_cap_height = fptr->x_font_struct->per_char[X].ascent; } else /* do our best */ fptr->x_font_cap_height = fptr->x_font_struct->min_bounds.ascent; /* we've set all fields, so we can return */ return; } #ifdef DEBUG2 fprintf (stderr, "FONT property does not exist\n"); #endif } else /* font doesn't have an XLFD name (so no pixel size field), or there's no FONT property at all (a bad situation) */ { Atom pixel_size_atom, resolution_y_atom; unsigned long point_size, resolution_y; fptr->x_font_is_iso8859_1 = false; /* assumed (worst case) */ pixel_size_atom = XInternAtom (dpy, "PIXEL_SIZE", (Bool)false); if (XGetFontProperty (fptr->x_font_struct, pixel_size_atom, &retval)) /* there's a PIXEL_SIZE property, so use it to compute font size */ { #ifdef DEBUG2 fprintf (stderr, "PIXEL_SIZE property is \"%lu\"\n", retval); #endif fptr->x_font_pixel_size = retval; } else /* no PIXEL_SIZE, so try to compute pixel size from POINT_SIZE and RESOLUTION_Y properties */ { #ifdef DEBUG2 fprintf (stderr, "PIXEL_SIZE property does not exist\n"); #endif resolution_y_atom = XInternAtom (dpy, "RESOLUTION_Y", (Bool)false); if (XGetFontProperty (fptr->x_font_struct, XA_POINT_SIZE, &point_size) && (XGetFontProperty (fptr->x_font_struct, resolution_y_atom, &resolution_y))) { #ifdef DEBUG2 fprintf (stderr, "POINT_SIZE property is \"%lu\"\n", point_size); fprintf (stderr, "RESOLUTION_Y property is \"%lu\"\n", resolution_y); #endif fptr->x_font_pixel_size = IROUND(((double)point_size * (double)resolution_y / 722.7)); } else /* we can't compute the font size legitimately, so estimate it from the XFontStruct (may not be reliable) */ { #ifdef DEBUG2 fprintf (stderr, "POINT_SIZE and/or RESOLUTION_Y properties do not exist\n"); #endif fptr->x_font_pixel_size = fptr->x_font_struct->ascent + fptr->x_font_struct->descent; } } fptr->x_font_cap_height = fptr->x_font_struct->per_char['X' - fptr->x_font_struct->min_char_or_byte2].ascent; } } /* Extract a field from an XLFD name string, by number, and return it, via a call to malloc. If `name' doesn't appear to be an XLFD name, NULL is returned. */ static char * xlfd_field(const char *name, int field) { const char *p; const char *fields[PL_NUM_XLFD_FIELDS]; char *retstring; int len[PL_NUM_XLFD_FIELDS]; int i, n, m; /* split into fields at hyphens */ for (p = name, i = 0, n = 0, m = 0; *p && (i < PL_NUM_XLFD_FIELDS); p++, n++, m++) { if (*p == '-') { if (i > 0) len[i-1] = n; n = 0; fields[i++] = p; } } if (i < PL_NUM_XLFD_FIELDS) return NULL; len[PL_NUM_XLFD_FIELDS - 1] = strlen (name) - (m - 1); /* final field exhausts string */ /* for len[] and fields[], each field includes initial hyphen */ retstring = (char *)_pl_xmalloc (len[field] * sizeof(char)); strncpy (retstring, fields[field] + 1, (unsigned int)(len[field] - 1)); /* skip initial - */ retstring[len[field] - 1] = '\0'; return retstring; } /* Prepare a bit vector (length 256 bits, i.e. 32 bytes) indicating which characters in the range 1..255 are used in string S. We always include the character 'X', even if it isn't present in the string. `X' is special because we can subsequently use it to retrieve the cap height. For backward compatibility (not necessary?) we also include the space character. */ static void string_to_bitvector (const unsigned char *s, unsigned char v[32]) { unsigned char c; unsigned int i, j; int k; for (k = 0; k < 32; k++) v[k] = 0; /* include the X character */ c = 'X'; i = c / 8; j = c % 8; v[i] |= (1 << j); /* include the space character too */ c = ' '; i = c / 8; j = c % 8; v[i] |= (1 << j); /* include all characters in the passed string */ while ((c = *s) != (unsigned char)'\0') { i = c / 8; j = c % 8; #ifdef DEBUG2 fprintf (stderr, "saw char %d (i.e. %c), stored as %d,%d\n", c, c, i, j); #endif v[i] |= (1 << j); s++; } } /* This writes a bitvector as a string, in the form used in X11R6-style charset subsetting. Each range of chars may require the writing of up to 8 bytes, e.g. " 160_180". The list of ranges is contained within brackets. */ static void print_bitvector (unsigned char v[32], char *s) { int i, num_ranges_output = 0, num_chars_output = 0; int start_of_range = 0; bool used; bool in_range = false; *s++ = '['; for (i = 0; i <= 256; i++) { if (i == 256) used = false; else used = (v[i / 8] & (1 << (i % 8))) ? true : false; #ifdef DEBUG2 if (used) fprintf (stderr, "stored char %d (i.e. %c), from %d,%d\n", i, i, i/8, i%8); #endif if (used && in_range == false) /* begin new range */ { start_of_range = i; in_range = true; } else if (used == false && in_range) /* end of range, so output the range */ { int hundreds, tens, ones; bool hundreds_output; if (num_chars_output > MAX_CHARSET_SUBSET_LIST_LENGTH - 8) break; /* abort to avoid buffer overrun */ if (num_ranges_output > 0) /* use space as separator */ { *s++ = ' '; num_chars_output++; } #ifdef DEBUG2 fprintf (stderr, "outputting character range %d..%d, i.e. %c..%c\n", start_of_range, i-1, start_of_range, i-1); #endif if (start_of_range < (i - 1)) /* have a genuine range, start..(i-1), not a singleton */ { /* output start of range, followed by underscore */ hundreds = start_of_range / 100; tens = (start_of_range - hundreds * 100) / 10; ones = start_of_range % 10; hundreds_output = false; if (hundreds > 0) { *s++ = (char)'0' + hundreds; hundreds_output = true; num_chars_output++; } if (hundreds_output || tens > 0) { *s++ = (char)'0' + tens; num_chars_output++; } *s++ = (char)'0' + ones; num_chars_output++; *s++ = (char)'_'; num_chars_output++; } /* output end of range, which is i-1 */ hundreds = (i-1) / 100; tens = ((i-1) - hundreds * 100) / 10; ones = (i-1) % 10; hundreds_output = false; if (hundreds > 0) { *s++ = (char)'0' + hundreds; hundreds_output = true; num_chars_output++; } if (hundreds_output || tens > 0) { *s++ = (char)'0' + tens; num_chars_output++; } *s++ = (char)'0' + ones; num_chars_output++; /* no longer in range */ in_range = false; num_ranges_output++; } } *s++ = ']'; /* add final null */ *s = '\0'; } static bool is_a_subset (unsigned char set1[32], unsigned char set2[32]) { int i; bool retval = true; for (i = 0; i < 32; i++) if (set1[i] & ~(set2[i])) { retval = false; break; } return retval; } /* Compute the minimum of the two singular values of a 2x2 matrix. Used for computing our favored pixel size, at which to retrieve a font; the matrix is the user-space -> device-space transformation matrix. */ static double min_sing_val (double m[4]) { double mm[4], mprod[4]; double mag, max_mag = 0.0; double trace, det, b2_4ac, min_sing_val_squared, min_sing_val; int i; /* scale the elements of m so that the largest has magnitude unity, to reduce the chance of floating point roundoff error; this scaling will be undone at the end */ for (i = 0; i < 4; i++) { mag = fabs (m[i]); if (mag > max_mag) max_mag = mag; } if (max_mag <= 0.0) return 0.0; for (i = 0; i < 4; i++) mm[i] = m[i] / max_mag; /* Compute M times the transpose of M. In the absence of floating-point rounding error, this product matrix, which is symmetric, will be "non-negative", i.e., its eigenvalues will be non-negative. The singular values of M are (square roots of) its eigenvalues. */ mprod[0] = mm[0]*mm[0] + mm[1]*mm[1]; mprod[1] = mm[0]*mm[2] + mm[1]*mm[3]; mprod[2] = mm[2]*mm[0] + mm[3]*mm[1]; mprod[3] = mm[2]*mm[2] + mm[3]*mm[3]; trace = mprod[0] + mprod[3]; det = mprod[0] * mprod[3] - mprod[1] * mprod[2]; if (det < 0.0) /* rare rounding error problem */ return 0.0; /* sing vals are (square roots of) solns of x^2 - trace * x + det = 0 */ b2_4ac = trace * trace - 4 * det; if (b2_4ac < 0.0) /* a common, innocuous rounding error problem */ b2_4ac = 0.0; min_sing_val_squared = 0.5 * (trace - sqrt (b2_4ac)); if (min_sing_val_squared < 0.0) /* rare rounding error problem */ return 0.0; min_sing_val = sqrt (min_sing_val_squared); /* return minimum singular value, not forgetting to undo the useful scaling with which we began */ return min_sing_val * max_mag; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_savestate.c�����������������������������������������������������������������0000644�0001750�0001750�00000013206�11037243262�014502� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains push_state() and pop_state() for XDrawablePlotters (and XPlotters). They supplement the generic behavior of savestate() and restorestate(), which create and destroy drawing states on the stack. push_state() constructs X11 GC's (i.e. graphics contexts) for a new drawing state. We copy into them, from each of the current GC's, all attributes we're interested in. pop_state() tears down the GC's. */ #include "sys-defines.h" #include "extern.h" void _pl_x_push_state (S___(Plotter *_plotter)) { Drawable drawable; XGCValues gcv; /* create the X-specified drawing state elements that are pointers (e.g., GC's or lists) */ /* determine which if either drawable we'll construct the GC's for */ if (_plotter->x_drawable1) drawable = _plotter->x_drawable1; else if (_plotter->x_drawable2) drawable = _plotter->x_drawable2; else drawable = (Drawable)NULL; if (drawable != (Drawable)NULL) /* prepare GC's for new drawing state, by copying attributes we use */ { unsigned long gcmask_fg, gcmask_fill, gcmask_bg; gcmask_fg = /* constant attributes (never altered) */ GCPlaneMask | GCFunction /* drawing attributes set by _pl_x_set_attributes() */ /* NOTE: we also use GCDashOffset and GCDashList, but Xlib does not support retrieving the dash list from a GC, so we'll copy the dashing style in another (painful) way */ | GCLineStyle | GCLineWidth | GCJoinStyle | GCCapStyle /* other GC elements set by the X Drawable driver */ | GCForeground | GCFont; gcmask_fill = /* constant attributes (never altered) */ GCPlaneMask | GCFunction | GCArcMode /* filling attributes set by _pl_x_set_attributes() */ | GCFillRule /* other GC elements set by the X Drawable driver */ | GCForeground; gcmask_bg = /* constant attributes (never altered) */ GCPlaneMask | GCFunction /* other GC elements set by the X Drawable driver */ | GCForeground; /* copy from previous drawing state */ /* copy GC used for drawing */ XGetGCValues (_plotter->x_dpy, _plotter->drawstate->previous->x_gc_fg, gcmask_fg, &gcv); _plotter->drawstate->x_gc_fg = XCreateGC (_plotter->x_dpy, drawable, gcmask_fg, &gcv); if (gcv.line_style != LineSolid) /* copy dash style info from previous state */ { int i, dash_list_len; char *dash_list; /* add dash style elements to GC used for drawing */ XSetDashes (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, _plotter->drawstate->previous->x_gc_dash_offset, _plotter->drawstate->previous->x_gc_dash_list, _plotter->drawstate->previous->x_gc_dash_list_len); /* add non-opaque dash style elements */ dash_list_len = _plotter->drawstate->previous->x_gc_dash_list_len; dash_list = (char *)_pl_xmalloc (dash_list_len * sizeof(char)); for (i = 0; i < dash_list_len; i++) dash_list[i] = _plotter->drawstate->previous->x_gc_dash_list[i]; _plotter->drawstate->x_gc_dash_list = dash_list; /* these two were already added by the copy operation that took place in _g_savestate(), but we'll add them again */ _plotter->drawstate->x_gc_dash_list_len = dash_list_len; _plotter->drawstate->x_gc_dash_offset = _plotter->drawstate->previous->x_gc_dash_offset; } else { _plotter->drawstate->x_gc_dash_list = (char *)NULL; _plotter->drawstate->x_gc_dash_list_len = 0; _plotter->drawstate->x_gc_dash_offset = 0; } /* copy GC used for filling */ XGetGCValues (_plotter->x_dpy, _plotter->drawstate->previous->x_gc_fill, gcmask_fill, &gcv); _plotter->drawstate->x_gc_fill = XCreateGC (_plotter->x_dpy, drawable, gcmask_fill, &gcv); /* copy GC used for erasing */ XGetGCValues (_plotter->x_dpy, _plotter->drawstate->previous->x_gc_bg, gcmask_bg, &gcv); _plotter->drawstate->x_gc_bg = XCreateGC (_plotter->x_dpy, drawable, gcmask_bg, &gcv); } } void _pl_x_pop_state (S___(Plotter *_plotter)) { /* N.B. we do _not_ free _plotter->drawstate->x_font_struct anywhere, when restorestate() is invoked on an X Drawable or X Plotter */ /* Free graphics contexts, if we have them -- and to have them, must have at least one drawable (see _pl_x_push_state()). */ if (_plotter->x_drawable1 || _plotter->x_drawable2) { /* free the dash list in the X11-specific part of the drawing state */ if (_plotter->drawstate->x_gc_dash_list_len > 0 && _plotter->drawstate->x_gc_dash_list != (char *)NULL) free ((char *)_plotter->drawstate->x_gc_dash_list); XFreeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fg); XFreeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_fill); XFreeGC (_plotter->x_dpy, _plotter->drawstate->x_gc_bg); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/x_text.c����������������������������������������������������������������������0000644�0001750�0001750�00000026316�11037243262�013475� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the XDrawablePlotter (and XPlotter) version of the low-level paint_text_string() method, which is called to plot a label in the current (non-Hershey) font, at the current fontsize and textangle. The label is just a string: no control codes (font switching or sub/superscripts). The width of the string in user units is returned. This version not does support center-justification and right justification; only the default left-justification. That is all right, since justification is handled at a higher level. */ /* This file also contains the XDrawablePlotter (and XPlotter) version of the flabelwidth_other() method, which is called to compute the width, in user coordinates, of a label. */ #include "sys-defines.h" #include "extern.h" /* When this is called in g_alabel.c, the X font has already been retrieved, in whole or in part (by calling "_set_font()", which in turn calls "_plotter->retrieve_font()", which is bound to the _pl_x_retrieve_font() routine in x_retrieve.c). I.e., whatever portion of the X font was required to be retrieved in order to return font metrics, has previously been retrieved. To retrieve a larger part, we call _pl_x_retrieve_font() again. But this time, we pass the label to be rendered to _pl_x_retrieve_font() as a "hint", i.e., as the x_label data member of (the driver-specific part of) the drawing state. That tells _pl_x_retrieve_font how much more of the font to retrieve. This scheme is a hack, but it works (and doesn't violate layering). */ #include "x_afftext.h" double _pl_x_paint_text_string (R___(Plotter *_plotter) const unsigned char *s, int h_just, int v_just) { const char *saved_font_name; char *temp_font_name; bool ok; double x, y; double width = 0.0; /* width of string in user units */ double rot[4]; /* user-frame rotation matrix */ double a[4]; /* transformation matrix for XAffDrawString() */ int i, ix, iy; /* sanity check; this routine supports only baseline positioning */ if (v_just != PL_JUST_BASE) return 0.0; /* similarly for horizontal justification */ if (h_just != PL_JUST_LEFT) return 0.0; if (*s == (unsigned char)'\0') return 0.0; /* Do retrieval, fill in the X-specific field x_font_struct of the drawing state. (We've previously retrieved a small subset of the font, to obtain metrics used for text positioning, as mentioned above; so retrieving a larger portion should go smoothly.) We retrieve not `font_name' but rather `true_font_name', because the latter may have been what was retrieved, if a default X font had to be substituted; see g_retrieve.c. */ if (_plotter->drawstate->true_font_name == NULL) /* shouldn't happen */ return 0.0; saved_font_name = _plotter->drawstate->font_name; temp_font_name = (char *)_pl_xmalloc (strlen (_plotter->drawstate->true_font_name) + 1); strcpy (temp_font_name, _plotter->drawstate->true_font_name); _plotter->drawstate->font_name = temp_font_name; _plotter->drawstate->x_label = s; /* pass label hint */ ok = _pl_x_retrieve_font (S___(_plotter)); _plotter->drawstate->x_label = NULL; /* restore label hint to default */ _plotter->drawstate->font_name = saved_font_name; free (temp_font_name); if (!ok) /* shouldn't happen */ return 0.0; /* set font in GC used for drawing (the other GC, used for filling, is left alone) */ XSetFont (_plotter->x_dpy, _plotter->drawstate->x_gc_fg, _plotter->drawstate->x_font_struct->fid); /* select our pen color as foreground color in X GC used for drawing */ _pl_x_set_pen_color (S___(_plotter)); /* compute position in device coordinates */ x = XD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); y = YD(_plotter->drawstate->pos.x, _plotter->drawstate->pos.y); /* X11 protocol OOB check */ ix = IROUND(x); iy = IROUND(y); if (X_OOB_INT(ix) || X_OOB_INT(iy)) { _plotter->warning (R___(_plotter) "not drawing a text string that is positioned too far for X11"); return 0.0; } /* Draw the text string by calling XAffDrawString() in x_afftext.c, which operates by affinely transform a bitmap generated by XDrawString() in the following way: it pulls it back from the server as an image, transforms the image, and then sends the image back to the server. */ /* First, compute a 2x2 matrix a[] that would, in the jargon of the matrix extension to the XLFD (X Logical Font Description) scheme, be called a `pixel matrix'. It specifies how XAffDrawAffString should `anamorphically transform' the text bitmap produced by XDrawString(), to yield the bitmap we want. It's essentially the product of (i) the user-frame text rotation matrix, and (ii) the user_space->device_space transformation matrix. But see additional comments below. */ /* user-frame rotation matrix */ rot[0] = cos (M_PI * _plotter->drawstate->text_rotation / 180.0); rot[1] = sin (M_PI * _plotter->drawstate->text_rotation / 180.0); rot[2] = - sin (M_PI * _plotter->drawstate->text_rotation / 180.0); rot[3] = cos (M_PI * _plotter->drawstate->text_rotation / 180.0); /* Compute matrix product. But note flipped-y convention affecting a[1] and a[3]. Sign flipping is because the pixel matrix (as used in the XLFD matrix extension and hence, for consistency, by our code by XAffDrawAffString()) is expressed with respect to a right-handed coordinate system, in which y grows upward, rather than X11's default left-handed coordinate system, in which y grows downward. */ a[0] = (rot[0] * _plotter->drawstate->transform.m[0] + rot[1] * _plotter->drawstate->transform.m[2]); a[1] = - (rot[0] * _plotter->drawstate->transform.m[1] + rot[1] * _plotter->drawstate->transform.m[3]); a[2] = (rot[2] * _plotter->drawstate->transform.m[0] + rot[3] * _plotter->drawstate->transform.m[2]); a[3] = - (rot[2] * _plotter->drawstate->transform.m[1] + rot[3] * _plotter->drawstate->transform.m[3]); /* Apply an overall scaling. We want the text string to appear at a certain font size in the user frame; and the font that XDrawString will use was retrieved at a certain pixel size in the device frame. So we compensate on both sides, so to speak. We multiply by true_font_size / x_font_pixel_size, where the numerator refers to the user frame, and the denominator to the device frame. */ for (i = 0; i < 4; i++) a[i] = a[i] * (_plotter->drawstate->true_font_size / _plotter->drawstate->x_font_pixel_size); if (_plotter->x_double_buffering != X_DBL_BUF_NONE) /* double buffering, have a `x_drawable3' to draw into */ XAffDrawAffString (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_fg, _plotter->drawstate->x_font_struct, ix, iy, a, (char *)s); else { /* not double buffering, have no `x_drawable3' */ if (_plotter->x_drawable1) XAffDrawAffString (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_fg, _plotter->drawstate->x_font_struct, ix, iy, a, (char *)s); if (_plotter->x_drawable2) XAffDrawAffString (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_fg, _plotter->drawstate->x_font_struct, ix, iy, a, (char *)s); } /* compute width of just-drawn string in user units */ width = (((XTextWidth (_plotter->drawstate->x_font_struct, (char *)s, (int)(strlen((char *)s))) *_plotter->drawstate->true_font_size)) / _plotter->drawstate->x_font_pixel_size); /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); return width; } /* Compute width, in user coordinates, of label in the currently selected font (no escape sequences!). Current font is assumed to be a non-Hershey font (so we have an X font structure for it). This is installed as an internal class method, invoked if the current font is non-Hershey (which means Postscript, PCL, or `other' [i.e. any non-PS, non-PCL, retrievable X font]. */ /* When this is called in g_alabel.c, the X font has already been retrieved, in whole or in part (by calling "_set_font()", which in turn calls "_plotter->retrieve_font()", i.e., which calls the _pl_x_retrieve_font() routine in x_retrieve.c). I.e., whatever portion of the X font was required to be retrieved in order to return font metrics, has previously been retrieved. To retrieve a larger part, we call _pl_x_retrieve_font() again. But this time, we pass the label to be rendered to _pl_x_retrieve_font() as a "hint", i.e., as a data member of (the driver-specific part of) the drawing state. That tells _pl_x_retrieve_font how much more of the font to retrieve. This scheme is an ugly hack, but it works (and doesn't violate layering). */ double _pl_x_get_text_width (R___(Plotter *_plotter) const unsigned char *s) { const char *saved_font_name; char *temp_font_name; bool ok; double width; /* Do retrieval, but use current `true_font_name' as our font name (see above; we've previously retrieved a subset of it). */ if (_plotter->drawstate->true_font_name == NULL) /* shouldn't happen */ return 0.0; saved_font_name = _plotter->drawstate->font_name; temp_font_name = (char *)_pl_xmalloc (strlen (_plotter->drawstate->true_font_name) + 1); strcpy (temp_font_name, _plotter->drawstate->true_font_name); _plotter->drawstate->font_name = temp_font_name; _plotter->drawstate->x_label = s; /* pass label hint */ ok = _pl_x_retrieve_font (S___(_plotter)); _plotter->drawstate->x_label = NULL; /* restore label hint to default */ _plotter->drawstate->font_name = saved_font_name; free (temp_font_name); if (!ok) /* shouldn't happen */ return 0.0; /* compute width of string in user units; see above comments on `compensating on both sides' */ width = ((XTextWidth (_plotter->drawstate->x_font_struct, (char *)s, (int)(strlen((char *)s))) *_plotter->drawstate->true_font_size) / _plotter->drawstate->x_font_pixel_size); /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); return width; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/y_closepl.c�������������������������������������������������������������������0000644�0001750�0001750�00000032315�11037267621�014154� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_WAITPID #ifdef HAVE_SYS_WAIT_H #define _POSIX_SOURCE /* for waitpid() */ #endif #endif #include "sys-defines.h" #include "extern.h" #ifdef HAVE_UNISTD_H #ifdef HAVE_SYS_TYPES_H #include /* always include before unistd.h */ #endif #include /* for fork() */ #endif /* song and dance to declare waitpid() and define WNOHANG */ #ifdef HAVE_WAITPID #ifdef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_TYPES_H #include #endif /* HAVE_SYS_TYPES_H */ #include /* for waitpid() */ #endif /* HAVE_SYS_WAIT_H */ #endif /* HAVE_WAITPID */ bool _pl_y_end_page (S___(Plotter *_plotter)) { plColorRecord *cptr; plXFontRecord *fptr; Pixmap bg_pixmap = (Pixmap)0; int window_width, window_height; pid_t forkval; /* compute rectangle size; note flipped-y convention */ window_width = (_plotter->data->imax - _plotter->data->imin) + 1; window_height = (_plotter->data->jmin - _plotter->data->jmax) + 1; /* if either sort of server-supported double buffering is being used, create background pixmap for Label widget (it doesn't yet have one) */ if (_plotter->x_double_buffering == X_DBL_BUF_MBX || _plotter->x_double_buffering == X_DBL_BUF_DBE) { int screen; /* screen number */ Screen *screen_struct; /* screen structure */ screen = DefaultScreen (_plotter->x_dpy); screen_struct = ScreenOfDisplay (_plotter->x_dpy, screen); bg_pixmap = XCreatePixmap(_plotter->x_dpy, _plotter->x_drawable2, (unsigned int)window_width, (unsigned int)window_height, (unsigned int)PlanesOfScreen(screen_struct)); /* copy from off-screen graphics buffer to pixmap */ XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, bg_pixmap, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); /* pixmap is installed below as background pixmap for Label widget */ } /* If double buffering, must make final frame of graphics visible, by copying it from our off-screen graphics buffer `x_drawable3' to window. There are several types of double buffering: the two server-supported types, and the `by hand' type. */ #ifdef HAVE_X11_EXTENSIONS_XDBE_H #ifdef HAVE_DBE_SUPPORT if (_plotter->x_double_buffering == X_DBL_BUF_DBE) /* we're using the X double buffering extension; off-screen graphics buffer `x_drawable3' is a back buffer */ { XdbeSwapInfo info; /* make final frame of graphics visible by interchanging front and back buffers one last time */ info.swap_window = _plotter->x_drawable2; info.swap_action = XdbeUndefined; XdbeSwapBuffers (_plotter->x_dpy, &info, 1); /* free the back buffer */ XdbeDeallocateBackBufferName (_plotter->x_dpy, _plotter->x_drawable3); } #endif /* HAVE_DBE_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_XDBE_H */ #ifdef HAVE_X11_EXTENSIONS_MULTIBUF_H #ifdef HAVE_MBX_SUPPORT if (_plotter->x_double_buffering == X_DBL_BUF_MBX) /* we're using the X multibuffering extension; off-screen graphics buffer `x_drawable3' is a non-displayed multibuffer */ { /* make final frame of graphics visible by making the multibuffer into which we're currently drawing the on-screen multibuffer */ XmbufDisplayBuffers (_plotter->x_dpy, 1, &(_plotter->x_drawable3), 0, 0); } #endif /* HAVE_MBX_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_MULTIBUF_H */ /* if either sort of server-supported double buffering is being used, install the above-created pixmap as background pixmap for the Label widget to use, once the window has been spun off */ if (_plotter->x_double_buffering == X_DBL_BUF_MBX || _plotter->x_double_buffering == X_DBL_BUF_DBE) { Arg wargs[2]; /* werewolves */ /* install pixmap as Label widget's background pixmap */ #ifdef USE_MOTIF XtSetArg (wargs[0], XmNlabelPixmap, (Pixmap)bg_pixmap); XtSetArg (wargs[1], XmNlabelType, XmPIXMAP); XtSetValues (_plotter->y_canvas, wargs, (Cardinal)2); #else XtSetArg (wargs[0], XtNbitmap, (Pixmap)bg_pixmap); XtSetValues (_plotter->y_canvas, wargs, (Cardinal)1); #endif } if (_plotter->x_double_buffering == X_DBL_BUF_BY_HAND) /* we're double buffering _manually_, rather than using either X11 protocol extension, so our off-screen graphics buffer `x_drawable3' is an ordinary pixmap */ { /* make final frame of graphics visible by copying from pixmap to window */ XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, _plotter->x_drawable2, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); } /* Finally: if we're not double buffering at all, we copy our off-screen graphics buffer to the window. The off-screen graphics buffer is just the Label widget's background pixmap, `x_drawable1'. */ if (_plotter->x_double_buffering == X_DBL_BUF_NONE) XCopyArea (_plotter->x_dpy, _plotter->x_drawable1, _plotter->x_drawable2, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); /* following two deallocations (of font records and color cell records) arrange things so that when drawing the next page of graphics, which will require another connection to the X server, the Plotter will start with a clean slate */ /* Free font records from Plotter's cache list. This involves deallocating the font name and also the XFontStruct contained in each record, if non-NULL. (NULL indicates that the font could not be retrieved.) */ fptr = _plotter->x_fontlist; _plotter->x_fontlist = NULL; while (fptr) { plXFontRecord *fptrnext; fptrnext = fptr->next; free (fptr->x_font_name); if (fptr->x_font_struct) XFreeFont (_plotter->x_dpy, fptr->x_font_struct); free (fptr); fptr = fptrnext; } /* Free cached color cells from Plotter's cache list. Do _not_ ask the server to deallocate the cells themselves, because the child process will need them; just free local storage. */ cptr = _plotter->x_colorlist; _plotter->x_colorlist = NULL; while (cptr) { plColorRecord *cptrnext; cptrnext = cptr->next; free (cptr); cptr = cptrnext; } /* A bit of last-minute cleanup (could be done elsewhere): call waitpid() to reclaim resources used by zombie child processes resulting from previous closepl()'s, if any. If this isn't done, the controlling process of any previously popped-up window won't fully exit (e.g. when `q' is typed in the window): it'll remain in the process table as a zombie until the parent process executes. */ #ifdef HAVE_WAITPID #ifdef HAVE_SYS_WAIT_H #ifdef WNOHANG { int i; /* iterate over all previously forked-off children (should really keep track of which have exited, since once a child has exited, invoking waitpid() on it is pointless) */ for (i = 0; i < _plotter->y_num_pids; i++) waitpid (_plotter->y_pids[i], (int *)NULL, WNOHANG); } #endif #endif #endif /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); /* flush out the X output buffer; wait till all requests have been received and processed by server (see x_flushpl.c) */ _pl_x_flush_output (S___(_plotter)); /* flush output streams for all Plotters before forking */ _pl_g_flush_plotter_outstreams (S___(_plotter)); /* DO IT, MAN! */ forkval = fork (); if ((int)forkval > 0 /* fork succeeded, and we're the parent */ || (int)forkval < 0) /* fork failed */ { bool retval = true; if ((int)forkval < 0) _plotter->error (R___(_plotter) "the process could not be forked"); /* Close connection to X display associated with window that the child process should manage, i.e. with the last openpl() invoked on this Plotter. */ if (close (ConnectionNumber (_plotter->x_dpy)) < 0 && errno != EINTR) /* emphatically shouldn't happen */ { _plotter->error (R___(_plotter) "the connection to the X display could not be closed"); retval = false; } if ((int)forkval > 0) /* there's a child process, so save its pid */ { if (_plotter->y_num_pids == 0) _plotter->y_pids = (pid_t *)_pl_xmalloc (sizeof (pid_t)); else _plotter->y_pids = (pid_t *)_pl_xrealloc (_plotter->y_pids, ((_plotter->y_num_pids + 1) * sizeof (pid_t))); _plotter->y_pids[_plotter->y_num_pids] = forkval; _plotter->y_num_pids++; } /* do teardown of X-specific elements of the first drawing state on the drawing state stack */ _pl_x_delete_gcs_from_first_drawing_state (S___(_plotter)); return retval; } else /* forkval = 0; fork succeeded, and we're the child */ { bool need_redisplay = false; int i; /* Alter canvas widget's translation table, so that exit will occur when `q' is typed (or mouse is clicked). See y_openpl.c. */ _pl_y_set_data_for_quitting (S___(_plotter)); /* Close all connections to X display other than our own, i.e., close all connections that other XPlotters may have been using. No need to lock the global variables _xplotters and _xplotters_len; since we've forked and we're the child process, we're the only thread left. :-) We'll never be accessing those variables again (the only way we could would be if we were to call _maybe_handle_x_events(), and we aren't going to do that). So we don't need to worry that they may actually be locked. I.e. there was no need for us to register a handler to unlock them immediately after forking, by invoking pthread_atfork(). Which is why we didn't do that. */ for (i = 0; i < _xplotters_len; i++) if (_xplotters[i] != NULL && _xplotters[i] != _plotter && _xplotters[i]->data->opened && _xplotters[i]->data->open && close (ConnectionNumber (_xplotters[i]->x_dpy)) < 0 && errno != EINTR) /* shouldn't happen */ _plotter->error (R___(_plotter) "the connection to the X display could not be closed"); /* Repaint by sending an expose event to ourselves, copying the Label widget's background pixmap into its window. This is a good idea because the window could have been resized during the openpl..closepl. We don't do this if not double buffering (and presumably animating), unless the window size has changed since openpl was invoked (repainting makes the window flash, possibly irritating users). */ if (_plotter->x_double_buffering != X_DBL_BUF_NONE) need_redisplay = true; else { Arg wargs[2]; /* werewolves */ Dimension our_window_height, our_window_width; #ifdef USE_MOTIF XtSetArg (wargs[0], XmNwidth, &our_window_width); XtSetArg (wargs[1], XmNheight, &our_window_height); #else XtSetArg (wargs[0], XtNwidth, &our_window_width); XtSetArg (wargs[1], XtNheight, &our_window_height); #endif XtGetValues (_plotter->y_canvas, wargs, (Cardinal)2); if ((_plotter->data->imax + 1 != (int)our_window_width) || (_plotter->data->jmin + 1 != (int)our_window_height)) /* window changed size */ need_redisplay = true; } /* turn off backing store (if used); when we send the expose event to ourselves we want to repaint from the background pixmap, NOT from the server's backing store */ { XSetWindowAttributes attributes; unsigned long value_mask; attributes.backing_store = NotUseful; value_mask = CWBackingStore; XChangeWindowAttributes (_plotter->x_dpy, (Window)_plotter->x_drawable2, value_mask, &attributes); } if (need_redisplay) /* send expose event to ourselves */ XClearArea (_plotter->x_dpy, (Window)_plotter->x_drawable2, 0, 0, (unsigned int)0, (unsigned int)0, True); _plotter->data->open = false; /* flag Plotter as closed (is this useful, or just pedantic?) */ /* Manage the window. We won't get any events associated with other windows i.e. with previous invocations of openpl..closepl on this Plotter, or with other Plotters, since there's a distinct application context for every openpl..closepl. */ XtAppMainLoop (_plotter->y_app_con); /* shouldn't return */ /* NOTREACHED */ exit (EXIT_FAILURE); } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/y_defplot.c�������������������������������������������������������������������0000644�0001750�0001750�00000023375�11037243262�014151� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the initialization for any XPlotter object, including both private data and public methods. There is a one-to-one correspondence between public methods and user-callable functions in the C API. */ #include "sys-defines.h" #include /* for kill() */ #include "extern.h" /* Sparse array of pointers to XPlotter instances, and its size. Should be initialized to a NULL pointer, and 0, respectively. In libplotter these are not global variables: in extern.h, they are #define'd to be static data members of the XPlotter class. Accessed by _pl_y_initialize() and _pl_y_terminate() in this file, by _pl_y_maybe_handle_x_events() in y_openpl.c, and by _pl_y_closepl() in y_closepl.c. */ XPlotter **_xplotters = NULL; int _xplotters_len = 0; /* initial size for "_xplotters", the sparse array of XPlotter instances */ #define INITIAL_XPLOTTERS_LEN 4 /* Mutex for locking _xplotters[] and _xplotters_len. */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H pthread_mutex_t _xplotters_mutex = PTHREAD_MUTEX_INITIALIZER; #endif #endif #ifndef LIBPLOTTER /* In libplot, this is the initialization for the function-pointer part of an XPlotter struct. */ const Plotter _pl_y_default_plotter = { /* initialization (after creation) and termination (before deletion) */ _pl_y_initialize, _pl_y_terminate, /* page manipulation */ _pl_y_begin_page, _pl_y_erase_page, _pl_y_end_page, /* drawing state manipulation */ _pl_x_push_state, _pl_x_pop_state, /* internal path-painting methods (endpath() is a wrapper for the first) */ _pl_x_paint_path, _pl_x_paint_paths, _pl_x_path_is_flushable, _pl_x_maybe_prepaint_segments, /* internal methods for drawing of markers and points */ _pl_g_paint_marker, _pl_x_paint_point, /* internal methods that plot strings in Hershey, non-Hershey fonts */ _pl_g_paint_text_string_with_escapes, _pl_x_paint_text_string, _pl_x_get_text_width, /* private low-level `retrieve font' method */ _pl_x_retrieve_font, /* `flush output' method, called only if Plotter handles its own output */ _pl_x_flush_output, /* internal error handlers */ _pl_g_warning, _pl_g_error, }; #endif /* not LIBPLOTTER */ /* The private `initialize' method, which is invoked when a Plotter is created. It is used for such things as initializing capability flags from the values of class variables, allocating storage, etc. When this is invoked, _plotter points to the Plotter that has just been created. */ void _pl_y_initialize (S___(Plotter *_plotter)) { bool open_slot = false; int i, j; #ifndef LIBPLOTTER /* in libplot, manually invoke superclass initialization method */ _pl_x_initialize (S___(_plotter)); #endif #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the global variables _xplotters[] and _xplotters_len */ pthread_mutex_lock (&_xplotters_mutex); #endif #endif /* If this is the first XPlotter to be created, initialize Xt library. At least in X11R6, it's OK to initialize it more than once, but we're careful. */ if (_xplotters_len == 0) { /* first initialize Xlib and Xt thread support if any */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H #ifdef X_THREAD_SUPPORT XInitThreads (); XtToolkitThreadInitialize (); #endif #endif #endif /* initialize Xt library itself */ XtToolkitInitialize (); } /* ensure XPlotter array is set up */ if (_xplotters_len == 0) { _xplotters = (XPlotter **)_pl_xmalloc (INITIAL_XPLOTTERS_LEN * sizeof(XPlotter *)); for (i = 0; i < INITIAL_XPLOTTERS_LEN; i++) _xplotters[i] = (XPlotter *)NULL; _xplotters_len = INITIAL_XPLOTTERS_LEN; } /* be sure there is an open slot (slot i) */ for (i = 0; i < _xplotters_len; i++) if (_xplotters[i] == NULL) { open_slot = true; break; } if (!open_slot) /* expand array, clearing upper half */ { i = _xplotters_len; _xplotters = (XPlotter **)_pl_xrealloc (_xplotters, 2 * _xplotters_len * sizeof (XPlotter *)); for (j = _xplotters_len; j < 2 * _xplotters_len; j++) _xplotters[j] = (XPlotter *)NULL; _xplotters_len *= 2; } /* place just-created Plotter in open slot */ _xplotters[i] = _plotter; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the global variables _xplotters[] and _xplotters_len */ pthread_mutex_unlock (&_xplotters_mutex); #endif #endif /* override superclass initializations, as necessary */ #ifndef LIBPLOTTER /* tag field, differs in derived classes */ _plotter->data->type = PL_X11; #endif /* output model */ _plotter->data->output_model = PL_OUTPUT_VIA_CUSTOM_ROUTINES_TO_NON_STREAM; /* initialize data members specific to this derived class */ _plotter->y_app_con = (XtAppContext)NULL; _plotter->y_toplevel = (Widget)NULL; _plotter->y_canvas = (Widget)NULL; _plotter->y_drawable4 = (Drawable)0; _plotter->y_auto_flush = true; _plotter->y_vanish_on_delete = false; _plotter->y_pids = (pid_t *)NULL; _plotter->y_num_pids = 0; _plotter->y_event_handler_count = 0; /* initialize certain data members from device driver parameters */ /* determine whether to do an XFlush() after each drawing operation */ { const char *vanish_s; vanish_s = (const char *)_get_plot_param (_plotter->data, "X_AUTO_FLUSH"); if (strcasecmp (vanish_s, "no") == 0) _plotter->y_auto_flush = false; else _plotter->y_auto_flush = true; } /* determine whether windows vanish on Plotter deletion */ { const char *vanish_s; vanish_s = (const char *)_get_plot_param (_plotter->data, "VANISH_ON_DELETE"); if (strcasecmp (vanish_s, "yes") == 0) _plotter->y_vanish_on_delete = true; else _plotter->y_vanish_on_delete = false; } } /* The private `terminate' method, which is invoked when a Plotter is deleted. It may do such things as write to an output stream from internal storage, deallocate storage, etc. When this is invoked, _plotter points to the Plotter that is about to be deleted. */ void _pl_y_terminate (S___(Plotter *_plotter)) { int i, j; /* kill forked-off processes that are maintaining XPlotter's popped-up windows, provided that the VANISH_ON_DELETE parameter was set to "yes" at creation time */ if (_plotter->y_vanish_on_delete) { for (j = 0; j < _plotter->y_num_pids; j++) kill (_plotter->y_pids[j], SIGKILL); if (_plotter->y_num_pids > 0) { free (_plotter->y_pids); _plotter->y_pids = (pid_t *)NULL; } } /* remove XPlotter from sparse XPlotter array */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the global variables _xplotters[] and _xplotters_len */ pthread_mutex_lock (&_xplotters_mutex); #endif #endif for (i = 0; i < _xplotters_len; i++) if (_xplotters[i] == _plotter) { _xplotters[i] = (XPlotter *)NULL; break; } #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the global variables _xplotters[] and _xplotters_len */ pthread_mutex_unlock (&_xplotters_mutex); #endif #endif #ifndef LIBPLOTTER /* in libplot, manually invoke superclass termination method */ _pl_x_terminate (S___(_plotter)); #endif } #ifdef LIBPLOTTER XPlotter::XPlotter (FILE *infile, FILE *outfile, FILE *errfile) :XDrawablePlotter (infile, outfile, errfile) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (FILE *outfile) :XDrawablePlotter (outfile) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (istream& in, ostream& out, ostream& err) : XDrawablePlotter (in, out, err) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (ostream& out) : XDrawablePlotter (out) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter () { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (FILE *infile, FILE *outfile, FILE *errfile, PlotterParams ¶meters) :XDrawablePlotter (infile, outfile, errfile, parameters) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (FILE *outfile, PlotterParams ¶meters) :XDrawablePlotter (outfile, parameters) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (istream& in, ostream& out, ostream& err, PlotterParams ¶meters) : XDrawablePlotter (in, out, err, parameters) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (ostream& out, PlotterParams ¶meters) : XDrawablePlotter (out, parameters) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::XPlotter (PlotterParams ¶meters) : XDrawablePlotter (parameters) { _pl_y_initialize (); /* add to _xplotters sparse array */ } XPlotter::~XPlotter () { /* if luser left the Plotter open, close it */ if (_plotter->data->open) _API_closepl (); _pl_y_terminate (); /* remove from _xplotters sparse array */ } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/y_erase.c���������������������������������������������������������������������0000644�0001750�0001750�00000023227�11037243262�013607� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This version is for XPlotters, and should be exactly the same as x_erase.c (the version for XDrawablePlotters) except XPlotter-specific lines are NOT commented out. (Search for #if 1...#endif.) */ #include "sys-defines.h" #include "extern.h" /* If we aren't double buffering, this is the number of most-recently-allocated color cells that we _don't_ deallocate when we do an erase(). This is a heuristic. This quantity must be >= 0. */ #define NUM_KEPT_COLORS 256 /* If we're doing double buffering, when we do an erase() we of course don't deallocate the color cells that were used in the current frame. We also don't deallocate the cells used in the previous NUM_KEPT_FRAMES frames. This is a heuristic. This quantity must be >= 0. */ #define NUM_KEPT_FRAMES 16 bool _pl_y_erase_page (S___(Plotter *_plotter)) { bool head_found; int window_width, window_height; int i, current_frame_number, current_page_number; plColorRecord *cptr, **link = NULL; plDrawState *stateptr; /* set the foreground color in the GC we use for erasing, to be the background color in the drawing state */ _pl_x_set_bg_color (S___(_plotter)); /* compute rectangle size; note flipped-y convention */ window_width = (_plotter->data->imax - _plotter->data->imin) + 1; window_height = (_plotter->data->jmin - _plotter->data->jmax) + 1; if (_plotter->x_double_buffering != X_DBL_BUF_NONE) { /* Following two sorts of server-supported double buffering (X_DBL_BUF_DBE, X_DBL_BUF_MBX) are possible only for X Plotters, not X Drawable Plotters. `By hand' double buffering is possible for both. */ #if 1 #ifdef HAVE_X11_EXTENSIONS_XDBE_H #ifdef HAVE_DBE_SUPPORT if (_plotter->x_double_buffering == X_DBL_BUF_DBE) /* we're using the X double buffering extension */ { XdbeSwapInfo info; /* Copy current frame of buffered graphics to window. Implement this by swapping the front and back buffers for widget's window. Former front buffer will become graphics buffer. Currently, the buffers are `x_drawable2' (front) and `x_drawable3' (back, into which we draw). */ info.swap_window = _plotter->x_drawable2; info.swap_action = XdbeUndefined; XdbeSwapBuffers (_plotter->x_dpy, &info, 1); } else #endif /* HAVE_DBE_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_XDBE_H */ #ifdef HAVE_X11_EXTENSIONS_MULTIBUF_H #ifdef HAVE_MBX_SUPPORT if (_plotter->x_double_buffering == X_DBL_BUF_MBX) /* we're using the X multibuffering extension */ { Multibuffer multibuf; /* Copy current frame of buffered graphics to window. Implement this by making multibuffer into which we've been drawing the current multibuffer. */ XmbufDisplayBuffers (_plotter->x_dpy, 1, &(_plotter->x_drawable3), 0, 0); /* swap the two multibuffers, making the other one the off-screen graphics buffer into which we draw (`x_drawable3') */ multibuf = _plotter->x_drawable3; _plotter->x_drawable3 = _plotter->y_drawable4; _plotter->y_drawable4 = multibuf; } else #endif /* HAVE_MBX_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_MULTIBUF_H */ #endif /* 1 */ /* we must be doing double buffering `by hand', rather than using an X protocol extension */ if (_plotter->x_double_buffering == X_DBL_BUF_BY_HAND) { /* copy current frame of buffered graphics to drawable(s) */ if (_plotter->x_drawable1) XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, _plotter->x_drawable1, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); if (_plotter->x_drawable2) XCopyArea (_plotter->x_dpy, _plotter->x_drawable3, _plotter->x_drawable2, _plotter->drawstate->x_gc_bg, 0, 0, (unsigned int)window_width, (unsigned int)window_height, 0, 0); } /* irrespective of which of the three sorts of double buffering is being performed, clear the (new) graphics buffer, by filling it with background color */ XFillRectangle (_plotter->x_dpy, _plotter->x_drawable3, _plotter->drawstate->x_gc_bg, /* upper left corner */ 0, 0, (unsigned int)window_width, (unsigned int)window_height); } else /* not double buffering at all */ { /* erase drawable(s) by filling with background color */ if (_plotter->x_drawable1) XFillRectangle (_plotter->x_dpy, _plotter->x_drawable1, _plotter->drawstate->x_gc_bg, /* upper left corner */ 0, 0, (unsigned int)window_width, (unsigned int)window_height); if (_plotter->x_drawable2) XFillRectangle (_plotter->x_dpy, _plotter->x_drawable2, _plotter->drawstate->x_gc_bg, /* upper left corner */ 0, 0, (unsigned int)window_width, (unsigned int)window_height); } #if 1 /* If an X Plotter, update background color of y_canvas widget, irrespective of whether or not we're double buffering. This fixes things so that if the window is resized to a larger size, the new portions of the window will be filled with the correct color. */ { Arg wargs[1]; /* werewolves */ #ifdef USE_MOTIF XtSetArg (wargs[0], XmNbackground, _plotter->drawstate->x_gc_bgcolor); #else XtSetArg (wargs[0], XtNbackground, _plotter->drawstate->x_gc_bgcolor); #endif XtSetValues (_plotter->y_toplevel, wargs, (Cardinal)1); XtSetValues (_plotter->y_canvas, wargs, (Cardinal)1); } #endif /* 1 */ /* Flush the color cell cache, to the extent we can. But heuristically, keep in the cache a certain number of cells that aren't strictly needed, but which may be needed in the following frames. There are two cases. 1. If we're not double buffering, preserve some maximum number (NUM_KEPT_COLORS) of the most recently allocated cells. Implementing the cache as a list, though suboptimal from the point of view of speed, makes it easy to implement this heuristic. 2. If we're double buffering, preserve all cells that were used in the present frame (which was just transferred to the drawable(s), e.g., to an on-screen window). This is mandatory. But also use a heuristic: preserve all cells used in the preceding NUM_KEPT_FRAMES frames. In both cases, if a cached cell is to be preserved, it must contain a genuine pixel value (the `allocated' flag must be set). We also insist that for a cell to be preserved, it have a `page number stamp' equal to the current page number. That's because XDrawable Plotters, unlike X Plotters, don't free the color cell cache in end_page(), i.e., when closepl() is called. That's because X Drawable Plotters are `persistent' in the sense the graphics remain visible until the next reopening, and beyond. So the cache may include cells left over from previous pages, which get freed only here, when erase() is called. */ cptr = _plotter->x_colorlist; _plotter->x_colorlist = NULL; i = 0; head_found = false; current_frame_number = _plotter->data->frame_number; current_page_number = _plotter->data->page_number; while (cptr) { plColorRecord *cptrnext; cptrnext = cptr->next; if (cptr->allocated) { if ((_plotter->x_double_buffering == X_DBL_BUF_NONE && cptr->page_number == current_page_number && i < NUM_KEPT_COLORS) || (_plotter->x_double_buffering != X_DBL_BUF_NONE && cptr->page_number == current_page_number && cptr->frame_number >= current_frame_number - NUM_KEPT_FRAMES)) /* cached cell contains a genuine pixel value, and it meets our criteria, so preserve it */ { if (head_found) *link = cptr; else { _plotter->x_colorlist = cptr; head_found = true; } cptr->next = NULL; link = &(cptr->next); i++; } else /* cached cell contains a genuine pixel value, but it doesn't meet our criteria, so deallocate it */ { XFreeColors (_plotter->x_dpy, _plotter->x_cmap, &(cptr->rgb.pixel), 1, (unsigned long)0); free (cptr); } } else /* cached cell doesn't include a genuine pixel value, so free it */ free (cptr); cptr = cptrnext; } /* flag status of all colors in GC's in the drawing state stack as false (on account of flushing, may need to be searched for or reallocated) */ for (stateptr = _plotter->drawstate; stateptr; stateptr = stateptr->previous) { stateptr->x_gc_fgcolor_status = false; stateptr->x_gc_fillcolor_status = false; stateptr->x_gc_bgcolor_status = false; } /* maybe flush X output buffer and handle X events (a no-op for XDrawablePlotters, which is overridden for XPlotters) */ _maybe_handle_x_events (S___(_plotter)); return true; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/y_openpl.c��������������������������������������������������������������������0000644�0001750�0001750�00000076221�11037267571�014020� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This implementation is for XPlotters. When invoked, it pops up a plotting window on the default screen of the specified X display. When the corresponding closepl method is invoked, the window is `spun off', i.e., is managed thenceforth by a forked-off child process. */ /* This file also contains the internal functions _pl_y_maybe_get_new_colormap and _pl_y_maybe_handle_x_events. They override the corresponding functions in the XDrawablePlotter superclass, which are no-ops. The function _pl_y_maybe_handle_x_events is very important: it contains our hand-crafted loop for processing X events, which is called by an XPlotter after any libplot drawing operation is invoked on it. */ #include "sys-defines.h" #include "extern.h" /* song and dance to define struct timeval, and declare select() */ #ifdef HAVE_SYS_TIME_H #include /* for struct timeval */ #endif #ifdef HAVE_SYS_SELECT_H #include /* AIX needs this */ #endif #ifdef HAVE_SYS_TYPES_H #include /* for struct fdset, FD_ZERO, FD_SET */ #endif #ifdef HAVE_UNISTD_H #include /* for select() */ #endif /* Mutex for locking _xplotters[] and _xplotters_len. Defined in y_defplot.c. */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H extern pthread_mutex_t _xplotters_mutex; #endif #endif /* fake app name, effectively our argv[0] */ #define XPLOT_APP_NAME "xplot" /* app class, use for specifying resources */ #define XPLOT_APP_CLASS "Xplot" /* Fallback resources for the preceding X11 class. There are no user-specifiable X resources, except for the geometry. The default size of the plotting window is set here, as a default X resource, rather than in y_defplot.c. Users may override the default by specifying a geometry in their .Xdefaults files (by specifying the Xplot.geometry or xplot.geometry resource). This is equivalent to specifying the Plotter parameter BITMAPSIZE. */ static const String _xplot_fallback_resources[] = { (String)"Xplot*geometry: 570x570", (String)NULL }; /* Support for command-line mimicry. Our fake argument vector, _fake_argv[], needs space for our fake application name, i.e. XPLOT_APP_NAME, the three options "-display", "-geometry", "-bg", each with an argument, and a final NULL. */ #define MAX_FAKE_ARGV_LENGTH 8 /* Translations for the canvas widget, before and after the Plotter is closed, i.e. before and after forking. (After forking, translate any pressing of the `q' key, and any mouse click, to `Foldup'.) */ static const String _xplot_translations_before_forking = #ifdef USE_MOTIF (String)": ProcessDrag()"; #else (String)""; #endif static const String _xplot_translations_after_forking = #ifdef USE_MOTIF (String)": Foldup()\n\ : ProcessDrag()\n\ : Foldup()\n\ Q: Foldup()\n\ q: Foldup()"; #else (String)": Foldup()\n\ : Foldup()\n\ Q: Foldup()\n\ q: Foldup()"; #endif /* forward references */ static bool _bitmap_size_ok (const char *bitmap_size_s); static void Foldup (Widget widget, XEvent *event, String *params, Cardinal *num_params); #ifndef HAVE_STRERROR static char * _plot_strerror (int errnum); #define strerror _plot_strerror #endif /* This is called by the child process produced in y_closepl.c, immediately after forking takes place. It alters the translation table for the canvas widget so that Foldup() will be invoked when `q' is pressed or a mouse click is seen. */ void _pl_y_set_data_for_quitting (S___(Plotter *_plotter)) { Arg wargs[1]; /* a lone werewolf */ #ifdef USE_MOTIF XtSetArg (wargs[0], XmNtranslations, XtParseTranslationTable(_xplot_translations_after_forking)); #else XtSetArg (wargs[0], XtNtranslations, XtParseTranslationTable(_xplot_translations_after_forking)); #endif XtSetValues (_plotter->y_canvas, wargs, (Cardinal)1); } /* Foldup() is called by the Label widget when `q' is pressed or a mouse click is seen, provided that closepl() has previously been invoked. In that case the spun-off window disappears (we destroy the parent widget, and being a forked-off child process managing it, we exit). */ static void Foldup (Widget widget, XEvent *event, String *params, Cardinal *num_params) { Display *dpy; dpy = XtDisplay (widget); XtDestroyWidget (XtParent (widget)); /* destroy toplevel widget */ XFlush (dpy); /* flush X output buffer */ exit (EXIT_SUCCESS); } /* Application context-specific action table. */ static const XtActionsRec _xplot_actions[] = { {(String)"Foldup", Foldup}, }; bool _pl_y_begin_page (S___(Plotter *_plotter)) { Arg wargs[10]; /* werewolves */ Dimension window_height, window_width; Screen *screen_struct; /* screen structure */ String fake_argv[MAX_FAKE_ARGV_LENGTH]; const char *double_buffer_s; int fake_argc; int screen; /* screen number */ /* To permit openpl..closepl to be invoked repeatedly, we don't use the convenience routine XtAppInitialize(), since that function starts out by calling XtToolkitInitialize(), which shouldn't be called more than once. (At least, in early versions of X11; in X11R6 calling it more than once is OK.) Instead, we call XtToolkitInitialize() when the first XPlotter is created; see y_defplot.c. On every invocation of openpl() we call the other four functions that XtAppInitialize would call: XtCreateApplicationContext, XtAppSetFallbackResources, XtOpenDisplay, and XtAppCreateShell. That sets up a new application context each time openpl() is called, which looks wasteful. But since each openpl..closepl will yield a window managed by a forked-off process, it's appropriate. */ /* create new application context for this Plotter page */ _plotter->y_app_con = XtCreateApplicationContext(); if (_plotter->y_app_con == (XtAppContext)NULL) { _plotter->error (R___(_plotter) "an X application context could not be created"); return false; } /* set fallback resources to be used by canvas widget (currently, only the window size); specific to application context */ XtAppSetFallbackResources (_plotter->y_app_con, (String *)_xplot_fallback_resources); /* register an action table [currently containing only "Foldup"->Foldup(), see above]; specific to application context */ XtAppAddActions (_plotter->y_app_con, (XtActionsRec *)_xplot_actions, XtNumber (_xplot_actions)); /* punch options and parameters into our fake command line, beginning with the fake app name */ fake_argc = 0; fake_argv[fake_argc++] = (String)XPLOT_APP_NAME; /* take argument of the "-display" option from the DISPLAY parameter */ { const char *display_s; display_s = (char *)_get_plot_param (_plotter->data, "DISPLAY"); if (display_s == NULL || *display_s == '\0') { _plotter->error (R___(_plotter) "the Plotter could not be opened, as the DISPLAY parameter is null"); return false; } fake_argv[fake_argc++] = (String)"-display"; fake_argv[fake_argc++] = (String)display_s; } /* Take argument of "-geometry" option from BITMAPSIZE parameter, if set; otherwise size will be taken from Xplot.geometry. Fallback size is specified at head of this file. */ { char *bitmap_size_s; bitmap_size_s = (char *)_get_plot_param (_plotter->data, "BITMAPSIZE"); if (bitmap_size_s && _bitmap_size_ok (bitmap_size_s)) { fake_argv[fake_argc++] = (String)"-geometry"; fake_argv[fake_argc++] = (String)bitmap_size_s; } } /* Take argument of "-bg" option from BG_COLOR parameter, if set; otherwise use default color (white). */ { const char *bg_color_s; bg_color_s = (char *)_get_plot_param (_plotter->data, "BG_COLOR"); if (bg_color_s) { plColor color; char rgb[8]; /* enough room for "#FFFFFF", incl. NUL */ if (_string_to_color (bg_color_s, &color, _plotter->data->color_name_cache)) /* color is in our database */ { if (_plotter->data->emulate_color) /* replace by grayscale approximation */ { int gray; gray = _grayscale_approx (color.red, color.green, color.blue); sprintf (rgb, "#%02X%02X%02X", gray, gray, gray); } else sprintf (rgb, "#%02X%02X%02X", color.red, color.green, color.blue); bg_color_s = rgb; } else /* color is not in our database */ { if (_plotter->x_bg_color_warning_issued == false) { char *buf; buf = (char *)_pl_xmalloc (strlen (bg_color_s) + 100); sprintf (buf, "substituting \"white\" for undefined background color \"%s\"", bg_color_s); _plotter->warning (R___(_plotter) buf); free (buf); _plotter->x_bg_color_warning_issued = true; bg_color_s = "white"; } } fake_argv[fake_argc++] = (String)"-bg"; fake_argv[fake_argc++] = (String)bg_color_s; } } /* append final NULL (some X implementations need this) */ fake_argv[fake_argc] = (String)NULL; /* open new connection to the X display, using fake argv */ _plotter->x_dpy = XtOpenDisplay (_plotter->y_app_con, /* display_string = NULL, so take from fake commandline */ (String)NULL, /* application name = NULL, so take from fake commandline */ (String)NULL, /* application class */ (String)XPLOT_APP_CLASS, /* application-specific commandline parsetable (for XrmParseCommand), used in setting display resources */ NULL, (Cardinal)0, /* pass fake command-line (contains a fake argv[0] to specify app name, and besides "-display", options may include "-geometry", "-bg") */ &fake_argc, fake_argv); if (_plotter->x_dpy == (Display *)NULL) { char *display_s; display_s = (char *)_get_plot_param (_plotter->data, "DISPLAY"); if (display_s == NULL) /* shouldn't happen */ _plotter->error (R___(_plotter) "the X Window System display could not be opened, as it is null"); else { char *buf; buf = (char *)_pl_xmalloc(strlen(display_s) + 1 + 50); sprintf (buf, "the X Window System display \"%s\" could not be opened", display_s); _plotter->error (R___(_plotter) buf); free (buf); } return false; } /* display was opened, so determine its default screen, visual, colormap */ screen = DefaultScreen (_plotter->x_dpy); screen_struct = ScreenOfDisplay (_plotter->x_dpy, screen); _plotter->x_visual = DefaultVisualOfScreen (screen_struct); _plotter->x_cmap = DefaultColormapOfScreen (screen_struct); _plotter->x_cmap_type = X_CMAP_ORIG; /* original cmap (not a private one) */ /* find out how long polylines can get on this X display */ _plotter->x_max_polyline_len = XMaxRequestSize(_plotter->x_dpy) / 2; /* For every invocation of openpl(), we create a toplevel Shell widget, associated with default screen of the opened display. (N.B. could vary name of app instance; also select a non-default colormap by setting a value for XtNcolormap.) */ XtSetArg(wargs[0], XtNscreen, screen_struct); XtSetArg(wargs[1], XtNargc, fake_argc); XtSetArg(wargs[2], XtNargv, fake_argv); _plotter->y_toplevel = XtAppCreateShell(NULL, /* name of app instance */ (String)XPLOT_APP_CLASS, /* app class */ applicationShellWidgetClass, _plotter->x_dpy, /* x_dpy to get resources from */ /* pass XtNscreen resource, and also fake command-line, to get resources from (options may include "-display" [redundant], and "-geometry", "-bg") */ wargs, (Cardinal)3); /* Create drawing canvas (a Label widget) as child of toplevel Shell widget. Set many obscure spacing parameters to zero, so that origin of bitmap will coincide with upper left corner of window. */ #ifdef USE_MOTIF XtSetArg(wargs[0], XmNmarginHeight, (Dimension)0); XtSetArg(wargs[1], XmNmarginWidth, (Dimension)0); XtSetArg(wargs[2], XmNmarginLeft, (Dimension)0); XtSetArg(wargs[3], XmNmarginRight, (Dimension)0); XtSetArg(wargs[4], XmNmarginTop, (Dimension)0); XtSetArg(wargs[5], XmNmarginBottom, (Dimension)0); XtSetArg(wargs[6], XmNshadowThickness, (Dimension)0); XtSetArg(wargs[7], XmNhighlightThickness, (Dimension)0); _plotter->y_canvas = XtCreateManagedWidget ((String)"", xmLabelWidgetClass, _plotter->y_toplevel, wargs, (Cardinal)8); #else XtSetArg(wargs[0], XtNinternalHeight, (Dimension)0); XtSetArg(wargs[1], XtNinternalWidth, (Dimension)0); _plotter->y_canvas = XtCreateManagedWidget ((String)"", labelWidgetClass, _plotter->y_toplevel, wargs, (Cardinal)2); #endif /* realize both widgets */ XtRealizeWidget (_plotter->y_toplevel); /* replace the Label widget's default translations by ours [see above; our default is no translations at all, with a nod to Motif] */ #ifdef USE_MOTIF XtSetArg (wargs[0], XmNtranslations, XtParseTranslationTable(_xplot_translations_before_forking)); #else XtSetArg (wargs[0], XtNtranslations, XtParseTranslationTable(_xplot_translations_before_forking)); #endif XtSetValues (_plotter->y_canvas, wargs, (Cardinal)1); /* get Label widget's window; store it in Plotter struct as `drawable #2' */ _plotter->x_drawable2 = (Drawable)XtWindow(_plotter->y_canvas); /* get the window size that was actually chosen, store it */ #ifdef USE_MOTIF XtSetArg (wargs[0], XmNwidth, &window_width); XtSetArg (wargs[1], XmNheight, &window_height); #else XtSetArg (wargs[0], XtNwidth, &window_width); XtSetArg (wargs[1], XtNheight, &window_height); #endif XtGetValues (_plotter->y_canvas, wargs, (Cardinal)2); _plotter->data->imin = 0; _plotter->data->imax = (int)window_width - 1; /* note flipped-y convention for this device: min > max */ _plotter->data->jmin = (int)window_height - 1; _plotter->data->jmax = 0; /* compute the NDC to device-frame affine map, set it in Plotter */ _compute_ndc_to_device_map (_plotter->data); /* request backing store for Label widget's window */ if (DoesBackingStore(screen_struct)) { XSetWindowAttributes attributes; unsigned long value_mask; attributes.backing_store = Always; value_mask = CWBackingStore; XChangeWindowAttributes (_plotter->x_dpy, (Window)_plotter->x_drawable2, value_mask, &attributes); } /* determine whether to use double buffering */ _plotter->x_double_buffering = X_DBL_BUF_NONE; double_buffer_s = (const char *)_get_plot_param (_plotter->data, "USE_DOUBLE_BUFFERING"); /* backward compatibility: "fast" now means the same as "yes" */ if (strcmp (double_buffer_s, "fast") == 0) double_buffer_s = "yes"; #ifdef HAVE_X11_EXTENSIONS_XDBE_H #ifdef HAVE_DBE_SUPPORT if (strcmp (double_buffer_s, "yes") == 0) /* check whether X server supports DBE extension */ { int major_version, minor_version; int one = 1; /* number of screens to look at */ XdbeScreenVisualInfo *sv_info; if (XdbeQueryExtension (_plotter->x_dpy, &major_version, &minor_version) && (sv_info = XdbeGetVisualInfo (_plotter->x_dpy, /* 2nd arg specifies screen */ &_plotter->x_drawable2, &one)) != NULL) /* server supports DBE extension; for screen, a list of visuals / depths / performance hints was returned */ { bool ok = false; int i, num_visuals = sv_info->count; XdbeVisualInfo *vis_info = sv_info->visinfo; VisualID visual_id = XVisualIDFromVisual (_plotter->x_visual); /* See whether default visual supports double buffering. If not, could invoke XGetVisualInfo() to check the depth and perflevel of each visual that does, and select the `best' one. (Would also need to call XCreateColormap() to create a colormap of that visual type. When using the default visual we can use the default colormap, but when not, we don't have that luxury.) Maybe someday... That enhancement would be important for Xsgi, which typically has a default 8-plane PseudoColor visual that does _not_ support double buffering, and various other visuals, including some 8-plane and 12-plane ones that do (and some 15-plane and 24-plane ones that don't). */ for (i = 0; i < num_visuals; i++) /* check visual ID for each visual in list */ if (vis_info[i].visual == visual_id) /* matches the default */ { ok = true; /* default visual is OK */ break; } XdbeFreeVisualInfo (sv_info); if (ok) /* allocate back buffer, to serve as our graphics buffer; save it as `x_drawable3' */ { _plotter->x_drawable3 = XdbeAllocateBackBufferName (_plotter->x_dpy, _plotter->x_drawable2, (XdbeSwapAction)XdbeUndefined); /* set double buffering type in Plotter structure */ _plotter->x_double_buffering = X_DBL_BUF_DBE; } } } #endif /* HAVE_DBE_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_XDBE_H */ #ifdef HAVE_X11_EXTENSIONS_MULTIBUF_H #ifdef HAVE_MBX_SUPPORT if (_plotter->x_double_buffering == X_DBL_BUF_NONE && strcmp (double_buffer_s, "yes") == 0) /* check whether X server supports the (obsolete) MBX extension, as a substitute for DBE */ { int event_base, error_base; int major_version, minor_version; if (XmbufQueryExtension (_plotter->x_dpy, &event_base, &error_base) && XmbufGetVersion (_plotter->x_dpy, &major_version, &minor_version)) /* server supports MBX extension */ { Multibuffer multibuf[2]; int num; num = XmbufCreateBuffers (_plotter->x_dpy, (Window)_plotter->x_drawable2, 2, MultibufferUpdateActionUndefined, MultibufferUpdateHintFrequent, multibuf); if (num == 2) /* Yow, got a pair of multibuffers. We'll write graphics to the first (`x_drawable3'), and interchange them on each erase(). See y_erase.c. */ { _plotter->x_drawable3 = multibuf[0]; _plotter->y_drawable4 = multibuf[1]; /* set double buffering type in Plotter structure */ _plotter->x_double_buffering = X_DBL_BUF_MBX; } else _plotter->warning (R___(_plotter) "X server refuses to support multibuffering"); } } #endif /* HAVE_MBX_SUPPORT */ #endif /* HAVE_X11_EXTENSIONS_MULTIBUF_H */ if (_plotter->x_double_buffering == X_DBL_BUF_NONE) /* user didn't request double buffering, or did but special support for double buffering isn't contained in the X server */ { Pixmap bg_pixmap; /* create background pixmap for Label widget; 2nd arg (window) is only used for determining the screen */ bg_pixmap = XCreatePixmap(_plotter->x_dpy, _plotter->x_drawable2, (unsigned int)window_width, (unsigned int)window_height, (unsigned int)PlanesOfScreen(screen_struct)); /* If user requested double buffering but the server doesn't support it, we'll double buffer `by hand', and this pixmap will be the one (of two) into which we'll draw. If user didn't request double buffering, we'll use it as the 2nd of two drawables into which we'll draw, the other being the window. */ if (strcmp (double_buffer_s, "yes") == 0) { _plotter->x_drawable3 = (Drawable)bg_pixmap; _plotter->x_double_buffering = X_DBL_BUF_BY_HAND; } else { _plotter->x_drawable1 = (Drawable)bg_pixmap; _plotter->x_double_buffering = X_DBL_BUF_NONE; } } /* add X GC's to drawing state (which was constructed by openpl() before begin_page() was called), so we can at least fill with solid color */ _pl_x_add_gcs_to_first_drawing_state (S___(_plotter)); /* If not double-buffering, clear both pixmap and window by filling them with the drawing state's background color, via XFillRectangle. If double buffering, do something similar (see y_erase.c). */ _pl_y_erase_page (S___(_plotter)); /* If double buffering, must invoke `erase' one more time to clear both graphics buffer and window, since what `erase' does in that case is (1) copy the graphics buffer to window, and (2) clear the graphics buffer. */ if (_plotter->x_double_buffering != X_DBL_BUF_NONE) _pl_y_erase_page (S___(_plotter)); if (_plotter->x_double_buffering == X_DBL_BUF_NONE || _plotter->x_double_buffering == X_DBL_BUF_BY_HAND) /* have a pixmap, so install it as Label widget's background pixmap */ { Pixmap bg_pixmap; bg_pixmap = ((_plotter->x_double_buffering == X_DBL_BUF_BY_HAND) ? _plotter->x_drawable3 : _plotter->x_drawable1); #ifdef USE_MOTIF XtSetArg (wargs[0], XmNlabelPixmap, bg_pixmap); XtSetArg (wargs[1], XmNlabelType, XmPIXMAP); XtSetValues (_plotter->y_canvas, wargs, (Cardinal)2); #else XtSetArg (wargs[0], XtNbitmap, bg_pixmap); XtSetValues (_plotter->y_canvas, wargs, (Cardinal)1); #endif } /* do an XSync on the display (this will cause the background color to show up if it hasn't already) */ _pl_x_flush_output (S___(_plotter)); /* Note: at this point the drawing state, which we added X GC's to, a few lines above, won't be ready for drawing graphics, since it won't contain an X font or meaningful line width. To retrieve an X font and set the line width, user will need to invoke space() after openpl(). */ return true; } static bool _bitmap_size_ok (const char *bitmap_size_s) { int width, height; if (bitmap_size_s /* should parse this better */ && (sscanf (bitmap_size_s, "%dx%d", &width, &height) == 2) && (width > 0) && (height > 0)) return true; else return false; } /* This is the XPlotter-specific version of the _maybe_get_new_colormap() method, which is invoked when a Plotter's original colormap fills up. It overrides the XDrawable-specific version, which is a no-op. */ void _pl_y_maybe_get_new_colormap (S___(Plotter *_plotter)) { Colormap new_pl_x_cmap; /* sanity check */ if (_plotter->x_cmap_type != X_CMAP_ORIG) return; _plotter->warning (R___(_plotter) "color supply low, switching to private colormap"); new_pl_x_cmap = XCopyColormapAndFree (_plotter->x_dpy, _plotter->x_cmap); if (new_pl_x_cmap == 0) /* couldn't create colormap */ { _plotter->warning (R___(_plotter) "unable to create private colormap"); _plotter->warning (R___(_plotter) "color supply exhausted, can't create new colors"); _plotter->x_colormap_warning_issued = true; } else /* got a new colormap */ { Arg wargs[1]; /* a lone werewolf */ /* place in Plotter, flag as new */ _plotter->x_cmap = new_pl_x_cmap; _plotter->x_cmap_type = X_CMAP_NEW; /* switch to it: install in y_toplevel shell widget */ XtSetArg (wargs[0], XtNcolormap, _plotter->x_cmap); XtSetValues (_plotter->y_toplevel, wargs, (Cardinal)1); } return; } /* This is the XPlotter-specific version of the _maybe_handle_x_events() method, which is invoked at the end of most XDrawablePlotter drawing operations. It overrides the XDrawablePlotter-specific version, which is a no-op. It does two things. 1. Provided an XPlotter's X_AUTO_FLUSH parameter is "yes" (the default), it invokes XFlush() to flush the X output buffer. This makes most drawing operations more or less unbuffered: as the libplot functions are invoked, the graphics are sent to the X display. 2. It scans through the _xplotters[] sparse array, which contains pointers to all currently existing XPlotters, and processes pending X events associated with any of their application contexts. Why do we do #2? Once closepl() has been invoked on an XPlotter, the window popped up by openpl() is managed by a forked-off process via XtAppMainLoop(). But until that time, we must process events manually. (To speed up drawing, we perform #2 only once per X_EVENT_HANDLING_PERIOD invocations of this function.) #2 is accomplished by an hand-crafted event loop, the heart of which is the line if (XtAppPending (_xplotters[i]->y_app_con)) XtAppProcessEvent (_xplotters[i]->y_app_con, XtIMAll); which, for Plotter number i, flushes the X output buffer, checks for events and processes them. This line is executed as many times as we think safe. Thereby hangs a tale. Nathan Salwen has discovered that before invoking XtAppPending(), we should really check, using Xlib calls and select(), whether there are events waiting (either in the libX11 input buffer, or on the network socket). The reason is that if no events are available, XtAppPending() may block, at least on some systems. This does not agree with Xt documentation, but happens nonetheless. And it is not what we want. The reason for XtAppPending's unfortunate behavior is apparently the following. XtAppPending() invokes the Xlib function XEventsQueued(), first with mode=QueuedAfterReading [which returns the number of events in the input queue if nonempty; if empty, tries to extract more events from the socket] and then with mode=QueuedAfterFlush [which flushes the output buffer with XFlush() and checks if there is anything in the input queue; if not, it tries to extract more events from the socket]. (N.B. If, alternatively, it used mode=QueuedAlready, it would look only at the number of events in the input queue.) And sadly, when trying to extract events from the socket, XEventsQueued() calls select() in such a way that it can block. So before invoking XtAppPending() we call select() ourselves to check whether data is available on the network socket, and we don't allow it to block. We invoke XtAppPending and XtAppProcessEvent only if we're absolutely sure they won't block. Thanks also to Massimo Santini for helping to clear up the problem. */ #define X_EVENT_HANDLING_PERIOD 4 void _pl_y_maybe_handle_x_events(S___(Plotter *_plotter)) { if (_plotter->y_auto_flush) /* Flush output buffer if we're *not* in the middle of constructing a path, or if we are, but the path will be drawn with a solid, zero-width pen. Latter is for consistency with our convention that solid, zero-width paths should appear on the display as they're drawn (see x_cont.c). */ { if (_plotter->drawstate->path == (plPath *)NULL || (_plotter->drawstate->line_type == PL_L_SOLID && !_plotter->drawstate->dash_array_in_effect && _plotter->drawstate->points_are_connected && _plotter->drawstate->quantized_device_line_width == 0)) XFlush (_plotter->x_dpy); } if (_plotter->y_event_handler_count % X_EVENT_HANDLING_PERIOD == 0) /* process all XPlotters' events, if any are available */ { int i; #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* lock the global variables _xplotters[] and _xplotters_len */ pthread_mutex_lock (&_xplotters_mutex); #endif #endif /* loop over XPlotters */ for (i = 0; i < _xplotters_len; i++) { if (_xplotters[i] != NULL && _xplotters[i]->data->opened /* paranoia */ && _xplotters[i]->data->open && _xplotters[i]->y_app_con != NULL) /* paranoia */ /* XPlotter is open */ { /* Our handcrafted event handling loop. Check for pending X events, either in the libX11 input queue or on the network socket itself, and pull them off and process them one by one, trying very hard not to generate a call to select() that would block. We loop until no more events are available. */ for ( ; ; ) { bool have_data; have_data = false; /* default */ if (QLength(_xplotters[i]->x_dpy) > 0) /* one or more events has already been pulled off the socket and are in the libX11 input queue; so we can safely invoke XtAppPending(), and it will return `true' */ have_data = true; else /* libX11 input queue is empty, so check whether data is available on the socket by doing a non-blocking select() */ { int connection_number; int maxfds, select_return; fd_set readfds; struct timeval timeout; timeout.tv_sec = 0; /* make select() non-blocking! */ timeout.tv_usec = 0; connection_number = ConnectionNumber(_xplotters[i]->x_dpy); maxfds = 1 + connection_number; FD_ZERO (&readfds); FD_SET (connection_number, &readfds); select_return = select (maxfds, &readfds, NULL, NULL, &timeout); if (select_return < 0 && errno != EINTR) { _plotter->error (R___(_plotter) strerror (errno)); break; /* on to next Plotter */ } if (select_return > 0) /* have data waiting on the socket, waiting to be pulled off, so we'll invoke XtAppPending() to move it into the libX11 input queue */ have_data = true; } if (have_data == false) /* no data, so on to next XPlotter */ break; /* Since we got here, we have waiting input data: at least one event is either already in the libX11 queue or still on the socket. So we can safely call XtAppPending() to read event(s) from the queue, if nonempty, or from the socket. In the latter case (the case of an empty queue), XtAppPending() will call XEventsQueued(), which will, in turn, do a [potentially blocking!] select(). But the way we've done things, we should get an event without blocking. After invoking XtAppPending, we invoke XtAppProcessEvent, which could also potentially block, except that if an event is pending, it won't. So all should be well. (Possibly irrelevant side comment. XtAppPending will flush the output buffer if no events are pending.) */ if (XtAppPending (_xplotters[i]->y_app_con)) /* XtAppPending should always return true, but we invoke it anyway to be on the safe side. Note: it also checks for timer and other types of event, besides X events. */ XtAppProcessEvent (_xplotters[i]->y_app_con, XtIMAll); } /* end of for() loop, i.e. of our hand-crafted event loop */ } /* end of if() test for a open XPlotter */ } /* end of loop over XPlotters */ #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H /* unlock the global variables _xplotters[] and _xplotters_len */ pthread_mutex_unlock (&_xplotters_mutex); #endif #endif } _plotter->y_event_handler_count++; } #ifndef HAVE_STRERROR /* A libplot-specific version of strerror(), for very old systems that don't have one. */ extern char *sys_errlist[]; extern int sys_nerr; static char * _plot_strerror (int errnum) { if (errnum < 0 || errnum >= sys_nerr) return "unknown error"; return sys_errlist[errnum]; } #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/DEDICATION��������������������������������������������������������������������0000644�0001750�0001750�00000001006�06452756213�013343� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������GNU libplot is dedicated to Allen V. Hershey, whose Fortran system for integrated cartographic plotting and scientific typography, with full support for affine coordinate transformations, served as an inspiration. @Article{Hershey72, author = {Allen V. Hershey}, title = {A Computer System for Scientific Typography}, journal = {Computer Graphics and Image Processing}, year = {1972}, volume = {1}, number = {4}, pages = {373--385}}. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/HUMOR�������������������������������������������������������������������������0000644�0001750�0001750�00000000634�06452756213�012640� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������"The digitalizations in the present investigation are limited to those with a nominal height of 21 raster units... [T]his size is believed to be adequate for all characters in Nelson's dictionary except No. 5444. Inasmuch as this character represents dragons in motion, it is of doubtful utility." Allen V. Hershey, "Calligraphy for Computers", U.S. Naval Weapons Laboratory Report #2101, August 1967. ����������������������������������������������������������������������������������������������������plotutils-2.6/libplot/README-cgm��������������������������������������������������������������������0000644�0001750�0001750�00000006464�07125461324�013450� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������By default, libplot's CGM driver emits version 3 CGM format, conforming to the WebCGM profile. The output may include the following CGM primitives. For their semantics, see "The CGM Handbook" (cited below). Many of the names should be self-explanatory. By setting the libplot parameter or environment variable CGM_MAX_VERSION to "2" or "1", you can produce a CGM file whose version is less than 3. This is often desirable, because many CGM viewers can handle only version 1 CGM files. If the CGM version is 2 or 1, the primitives below that are not allowed to appear in version 2 or 1 CGM files will be emulated using allowed primitives, or simply dropped (if appropriate). The table indicates which primitives may appear only in version 2 and higher, and 3 and higher. CGM Delimiter Elements: BEGMF BEGPIC BEGPICBODY ENDPIC ENDMF CGM Metafile Descriptor Elements: MFVERSION MFELEMLIST MFDESC VDCTYPE INTEGERPREC REALPREC COLRPREC COLRVALUEEXT FONTLIST CHARSETLIST CHARCODING FONTPROP (version 3 or higher) CGM Picture Descriptor Elements: SCALEMODE COLRMODE LINEWIDTHMODE EDGEWIDTHMODE MARKERSIZEMODE VDCEXT BACKCOLR LINEEDGETYPEDEF (version 3 or higher) CGM Control Elements: VDCINTEGERPREC MITRELIMIT (version 3 or higher) CGM Graphical Primitive Elements: LINE MARKER RESTRTEXT POLYGON RECT CIRCLE ARCCTR ELLIPSE ELLIPARC ARCCTRREV (version 2 or higher) POLYBEZIER (version 3 or higher) CGM Attribute Elements: LINETYPE LINEWIDTH LINECOLR MARKERTYPE MARKERSIZE MARKERCOLR TEXTFONTINDEX TEXTPREC TEXTCOLR CHARHEIGHT CHARORI TEXTALIGN CHARSETINDEX ALTCHARSETINDEX INTSTYLE FILLCOLR EDGETYPE EDGEWIDTH EDGECOLR EDGEVIS LINECAP (version 3 or higher) LINEJOIN (version 3 or higher) LINETYPEINITOFFSET (version 3 or higher) EDGECAP (version 3 or higher) EDGEJOIN (version 3 or higher) EDGETYPEINITOFFSET (version 3 or higher) RESTRTEXTTYPE (version 3 or higher) ---------------------------------------------------------------------- References used when writing the CGM driver include: The WebCGM profile, available at http://www.w3.org/TR/REC-WebCGM as an official recommendation of the World Wide Web Consortium. "The CGM Handbook", L. R. Henderson and A. Mumford (Academic, 1992). "CGM and CGI", D. B. Arnold and P. R. Bono (Springer-Verlag, 1988). Sourcecode for cd-1.3, also called CD, cgmdraw 1.3, and CGM Draw 1.3, a freely available C function library for generating version-1 CGM files. cd-1.3 was developed at NIST (the U.S. National Institute for Standards and Technology) by G. Edward Johnson (formerly, lorax@nist.gov). However, it no longer seems to be available through NIST Web pages. Sourcecode for RALCGM, a free viewer for version-1 CGM files developed at Rutherford Appleton Laboratory in the U.K. Available at ftp://ftp.cc.rl.ac.uk/pub/graphics/ralcgm/unix/ . http://www.posc.org/Epicentre.2_2/GraphicsMetafile/SeismicExtensions/ . Contains a GIF image of the section from the CGM specification dealing with the format of SDR's (structured data records, used in specifying font properties in version-3 CGM files). http://www.nist.gov/itl/div897/ctg/cgm_form.htm . Sample CGM files, forming test suites, distributed by the US NIST (National Institute of Standards and Technology). ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/README-gif��������������������������������������������������������������������0000644�0001750�0001750�00000002303�06621404210�013422� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The following copyright notice and permission notice apply to the miGIF module, which is optionally incorporated in libplot as a GIF driver (see i_migif.c). miGIF contains non-LZW-based GIF compression code written by der Mouse and ivo . ---------------------------------------------------------------------- The miGIF code is copyright 1998 by Hutchison Avenue Software Corporation (http://www.hasc.com, mailto:info@hasc.com). -------------------------------------------------------------------------- Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "AS IS." The Hutchison Avenue Software Corporation disclaims all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to this code and accompanying documentation. -------------------------------------------------------------------------- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/README-hpgl�������������������������������������������������������������������0000644�0001750�0001750�00000002307�06626777242�013642� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������References used when writing the HP-GL/2 (and HP-GL and PCL 5) driver include: "The HP-GL/2 and HP RTL Reference Guide", 3e (Addison-Wesley, 1997). "HP LaserJet Programming", A. Binstock, B. P. Babcock, and M. Luse (Addison-Wesley, 1991). "The Product Comparison Guide for HP-GL/2 and HP RTL Peripherals", HP Manual Part No. 5959-9734. "The HP 7550A Interfacing and Programming Manual", HP Manual Part No. 07550-90001. Second edition, 11/86. "The HP 7475A Interfacing and Programming Manual", HP Manual Part No. 07475-90001. Fourth edition, 7/86. "Firmware Determines Plotter Personality", by L. W. Hennessee, A. K. Frankel, M. A. Overton, and R. B. Smith, Hewlett-Packard Journal, Nov. 1981, pp. 16-25. "Firmware Provides Simple and Powerful Plotter Operation", T. J. Halpenny, Hewlett-Packard Journal, April 1985, pp. 34-36. "PCL 5 Comparison Guide", HP Manual Part No. 5021-0329. "PCL 5 Printer Language Technical Reference Manual", HP Manual Part No. 5961-0509. As of this writing, the last two manuals are only available from HP as part of a larger `technical reference bundle' ("The PCL Documentation Package", Part No. 5021-0330). �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/README-tek��������������������������������������������������������������������0000644�0001750�0001750�00000003313�07115631023�013445� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������These are some comments on the interface provided by GNU libplot to Tektronix emulators. The Tektronix device driver included in libplot produces output for several types of Tektronix-compatible display. This includes the Tektronix emulators built into `xterm' (the X Window System terminal emulator) and the MS-DOS version of `kermit'. They are recognized by the environment variable TERM equalling "xterm" (or "xterms" or "kterm"), and "kermit" (or "ansi.sys, "ansi.sysk", "ansisys", or "ansisysk"), respectively. Some historical comments on the Tektronix 4010/4014 follow. A Tektronix 4010 had what was effectively a 1024x780 display, as did the first Tektronix 4014 models. Effective coordinate space was [0..1023]x[0..779]. Extended resolution, available for Tektronix 4014's equipped with the Enhanced Graphics Module [EGM], yielded [0..4095]x[0..3119] as coordinate space. Actually the range of the two position registers was always [0..4095], even before the EGM was introduced. (On displays without EGM, the low two bits in each coordinate were dropped.) So the upgrade path to the 4014-with-EGM was smooth. In pre-EGM days a Tekpoint increment (display measurement unit) equalled four increments of the x or y position register. `Home cursor position' was (0,767) in terms of Tekpoints, since the character matrix was 7x9. After the introduction of the EGM, a Tekpoint increment equalled one increment of the x or y position register, not four. Home position became (0,3071). There were approximately 70 Tekpoints/inch in pre-EGM days, 280/inch with EGM. In other words, the resolution was better than that of high-end workstation displays today. Who says raster graphics is an improvement over vector graphics? ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libplot/VERSION�����������������������������������������������������������������������0000644�0001750�0001750�00000001256�11257236364�013073� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Libplot has its own versioning scheme, independent of the scheme used for numbering the releases of the plotutils package. The version of libplot in this directory is 4.4, age=2. That means interface number = 4 revision = 4 Support for interfaces extending backward by 2 unit from current interface number, i.e., support for the interfaces supplied by libplot 2.x and libplot 3.x. The libplot 1.x interface is not supported, because its function names did not use the "pl_" prefix. However, if you add a `#include ' directive to code written for libplot 1.x or for the ancient pre-GNU (Unix) libplot, it should be possible to link it with the current version. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/�������������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257510�011716� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/README�������������������������������������������������������������������������0000644�0001750�0001750�00000004444�10346061317�012514� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This directory contains libxmi, a machine-independent vector graphics rasterization library, and the sample program ./drawing.c. The source code for libxmi is distributed under the GNU GPL (see the file ./COPYING). The Web page for the package is: http://www.gnu.org/software/libxmi/libxmi.html . The file ./INSTALL explains how to install libxmi, and the file ./CUSTOMIZE explains how to customize it. Please read this file first, though. libxmi is based on the vector graphics code in the sample X server that is a part of the X Window System distribution. This code has been converted to ANSI C, extensively rearranged and commented, and somewhat extended. (In particular, by adding support for multicolored dashing.) The original X11 vector graphics code was written in the mid-to-late 1980's by Brian Kelleher, Joel McCormack, Todd Newman, Keith Packard, Robert Scheifler and Ken Whaley, who worked for Digital Equipment Corp., MIT, and/or the X Consortium. See ./README-X for an X Consortium permission notice. GNU extensions by Robert S. Maier . The public header file for libxmi is ./xmi.h. It declares the eight functions in libxmi's core API, e.g. miDrawPoints(), miDrawLines(), miFillPolygon(), miDrawRectangles(), miFillRectangles(), miDrawArcs(), and miFillArcs(). These functions have the same semantics as the corresponding X11 functions (XDrawPoints, XDrawLines, etc.). The libxmi API contains a reentrant function miDrawArcs_r() too, since miDrawArcs() is not reentrant. Each function in the core API adds painted points to an opaque miPaintedSet object, a pointer to which is passed as its first argument. The core API includes functions for creating, manipulating, and destroying miPaintSet objects. It also includes functions for creating, manipulating, and destroying miCanvas objects. The function miCopyPaintedSetToCanvas() moves the points in a miPaintedSet to the next stage of the graphics pipeline: it merges them onto a miCanvas. There is support in this second stage for sophisticated pixel-merging algorithms. In general, it should be easy to install libxmi as a standalone library, or incorporate libxmi bodily into another package's source tree. libxmi is written in `strict C', so it may be compiled with either an ANSI C compiler or a C++ compiler. See ./INSTALL. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/xmi.h��������������������������������������������������������������������������0000644�0001750�0001750�00000046545�10346061444�012613� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This is xmi.h, the public header file for the machine-independent libxmi rasterization library, which is based on source files in the X Window System distribution. Written by Robert S. Maier. The eight painting functions in libxmi's core API, namely the 5 drawing functions: miDrawPoints, miDrawLines, miDrawRectangles, miDrawArcs, miDrawArcs_r the 3 filling functions: miFillPolygon, miFillRectangles, miFillArcs are declared below. The first argument of each of these is a pointer to a miPaintedSet. Conceptually, a miPaintedSet is a set of points with integer coordinates, each of which is painted some color (a miPixel). The coordinates of the points are unconstrained, i.e., the core painting functions perform no clipping. Each of the core painting functions takes as second argument a pointer to a graphics context: a miGC. A miGC is an opaque type that contains high-level drawing parameters that determine which points will be added to the miPaintedSet. (For example, the line width, line style, and dash pattern, all of which are relevant to the drawing functions, though not to the filling functions.) It also specifies the colors (miPixels) that will be used when painting the points. The core painting functions use the Painter's Algorithm, so that if a point in an miPaintedSet is painted a second time, the new color will replace the old. (By default, the painting performed by the core painting functions, i.e. by both the drawing functions and the filling functions, is `solid', i.e., non-interpolated. In `solid' painting, the color used is taken from the pixel array in the miGC. Any miGC contains an array of pixel colors, of length n>=2. Color #1 is the default color for painting, and colors 0,2,3,..,n-1 are used only by the drawing functions, when drawing in a dashed mode. In normal (on/off) dashing, the colors of the `on' dashes will cycle through 1,2,..,n-1. In so-called double dashing, the `off' dashes will be drawn too, in color #0.) After a miPaintedSet is built up by invoking one or more core painting functions, the next stage of the graphics pipeline is performed by calling miCopyPaintedSetToCanvas(). This transfers the pixels in the miPaintedSet onto a canvas structure called a miCanvas, which contains a bounded, fixed-size drawable. In the transfer, more sophisticated algorithms than the Painter's Algorithm may be used. Besides the drawable, a miCanvas may contain additional members, such as a stipple bitmap, a texture pixmap, and binary and ternary pixel-merging functions. These will affect how the pixels from the miPaintedSet are combined with the ones that already exist on the drawable. */ #ifndef _XMI_H_ #define _XMI_H_ 1 /***********************************************************************/ /* Version of GNU libxmi which this header file accompanies. This information is included beginning with version 1.2. The MI_LIBXMI_VER_STRING macro is compiled into the library, as `mi_libxmi_ver'. The MI_LIBXMI_VER macro is not compiled into it. Both are available to applications that include this header file. */ #define MI_LIBXMI_VER_STRING "1.3" #define MI_LIBXMI_VER 130 extern const char mi_libxmi_ver[8]; /* need room for 99.99aa */ /**********************************************************************/ /* support C++ */ #ifdef ___BEGIN_DECLS #undef ___BEGIN_DECLS #endif #ifdef ___END_DECLS #undef ___END_DECLS #endif #ifdef __cplusplus # define ___BEGIN_DECLS extern "C" { # define ___END_DECLS } #else # define ___BEGIN_DECLS /* empty */ # define ___END_DECLS /* empty */ #endif /**********************************************************************/ /* Structure that defines a point with integer coordinates. */ typedef struct { int x, y; /* integer coordinates, y goes downward */ } miPoint; /* Definition of miPixel, the pixel value datatype. By default, a miPixel is an unsigned int. The libxmi installer may alter the definition by defining the symbol MI_PIXEL_TYPE at installation time. The macro MI_SAME_PIXEL(), which tests for equality, may need to be redefined too (e.g., if MI_PIXEL_TYPE is a struct or a union). */ #ifdef MI_PIXEL_TYPE typedef MI_PIXEL_TYPE miPixel; #else typedef unsigned int miPixel; #endif #ifndef MI_SAME_PIXEL #define MI_SAME_PIXEL(pixel1,pixel2) \ ((pixel1) == (pixel2)) #endif /**********************************************************************/ /* A miPaintedSet is an opaque structure that contains a set of painted points, i.e., a set of points partitioned according to the pixel color used for painting. When any public drawing function is invoked, a pointer to a miPaintedSet is passed as its first argument. */ typedef struct lib_miPaintedSet miPaintedSet; /* Constructor and destructor for the miPaintedSet class. */ extern miPaintedSet * miNewPaintedSet (void); extern void miDeletePaintedSet (miPaintedSet *paintedSet); /* A function that clears any miPaintedSet (i.e. makes it the empty set). */ extern void miClearPaintedSet (miPaintedSet *paintedSet); /**********************************************************************/ /* A miGC is an opaque structure that contains high-level drawing parameters. When any public drawing function is invoked, a pointer to a miGC is passed as its second argument. */ typedef struct lib_miGC miGC; /* Constructor, destructor, and copy constructor for the miGC class. */ extern miGC * miNewGC (int npixels, const miPixel *pixels); /* npixels >= 2 */ extern void miDeleteGC (miGC *pGC); extern miGC * miCopyGC (const miGC *pGC); /* Values for an miGC's miGCLineStyle attribute (default=MI_LINE_SOLID). */ enum { MI_LINE_SOLID, MI_LINE_ON_OFF_DASH, MI_LINE_DOUBLE_DASH }; /* Values for an miGC's miGCJoinStyle attribute (default=MI_JOIN_MITER). */ enum { MI_JOIN_MITER, MI_JOIN_ROUND, MI_JOIN_BEVEL, MI_JOIN_TRIANGULAR }; /* Values for an miGC's miGCCapStyle attribute (default=MI_CAP_BUTT). MI_CAP_NOT_LAST is the same as MI_CAP_BUTT except when drawing zero-width (Bresenham) polylines; it causes the final pixel not to be drawn. A polyline drawn in this way is called `continuable'. */ enum { MI_CAP_NOT_LAST, MI_CAP_BUTT, MI_CAP_ROUND, MI_CAP_PROJECTING, MI_CAP_TRIANGULAR }; /* Values for an miGC's miGCFillRule attribute (default=MI_EVEN_ODD_RULE). */ enum { MI_EVEN_ODD_RULE, MI_WINDING_RULE }; /* Values for an miGC's miGCArcMode attribute (default=MI_ARC_PIE_SLICE). */ enum { MI_ARC_CHORD, MI_ARC_PIE_SLICE }; /* Possibilities for the `attribute' argument of miSetGCAttrib. (All the preceding, plus MI_GC_LINE_WIDTH.) */ typedef enum { MI_GC_FILL_RULE, MI_GC_JOIN_STYLE, MI_GC_CAP_STYLE, MI_GC_LINE_STYLE, MI_GC_ARC_MODE, MI_GC_LINE_WIDTH } miGCAttribute; /* A function that sets a single integer-valued miGC attribute. `value' must be one of the preceding enum's, except when attribute=MI_GC_LINE_WIDTH, in which case value>=0 is required. */ extern void miSetGCAttrib (miGC *pGC, miGCAttribute attribute, int value); /* A function that sets a list of integer-value miGC attributes. */ extern void miSetGCAttribs (miGC *pGC, int nattributes, const miGCAttribute *attributes, const int *values); /* Functions that set miGC attributes that are not integer-valued. Note: currently, `offset' must be nonnegative. */ extern void miSetGCDashes (miGC *pGC, int ndashes, const unsigned int *dashes, int offset); extern void miSetGCMiterLimit (miGC *pGC, double miter_limit); extern void miSetGCPixels (miGC *pGC, int npixels, const miPixel *pixels); /* npixels >=2 */ /* Additional functions that set miGC attributes: in particular, functions that set the paint style that will be used. Only in the case of `solid' painting (the default) is the above pixel array relevant. */ extern void miSetGCPaintSolid (void); extern void miSetGCPaintInterpParallel (miPoint pts[2], miPixel pixels[2]); extern void miSetGCPaintInterpTriangular (miPoint pts[3], miPixel pixels[3]); extern void miSetGCPaintInterpElliptical (void); /*********** DECLARATIONS OF PUBLIC DRAWING FUNCTIONS ******************/ /* The semantics of these drawing functions is similar to that of the corresponding X11 drawing functions. Wide polylines (polylines with line width >= 1) are treated as polygons to be rendered by filling. Zero-width polylines are not invisible: instead, they are single-pixel polylines, specially rendered by the Bresenham midpoint line algorithm. Also, adjoining polygons (those with an edge in common) are drawn without gaps. To arrange this, the `right' and `bottom' edges of any polygon are not drawn when the polygon is filled. The filling of rectangles is similar. Wide arcs and polyarcs are drawn with a circular brush, of diameter equal to the line width. Every brushed pixel is painted. Zero-width arcs and polyarcs are not invisible: instead, they are single-pixel arcs, specially rendered by the Bresenham `midpoint arc' algorithm. */ /* For consistency, the first three arguments of each drawing function are (1) a pointer to a miPaintedSet, and (2) a pointer to an miGC. */ /* 1. Drawing functions for points, polylines, and polygons. The final three arguments of each are a `coordinate mode' (see below), a specified number of points, and an array that contains the points. miDrawPoints draws a cloud of points, miDrawLines draws a polyline, and miFillPolygon draws a filled polygon. */ /* Possible values for the `coordinate mode' argument (specifying whether the points in the points array, after the first point, are given in absolute or relative coordinates). */ typedef enum { MI_COORD_MODE_ORIGIN, MI_COORD_MODE_PREVIOUS } miCoordMode; /* Possible values for the `shape' argument of miFillPolygon(). Two possibilities: (1) general (i.e., not necessarily convex, with self-intersections allowed), or (2) convex and not self-intersecting. Latter case can be drawn more rapidly. */ typedef enum { MI_SHAPE_GENERAL, MI_SHAPE_CONVEX } miPolygonShape; ___BEGIN_DECLS extern void miDrawPoints (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miDrawLines (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miFillPolygon (miPaintedSet *paintedSet, const miGC *pGC, miPolygonShape shape, miCoordMode mode, int npts, const miPoint *pPts); /* 2. Rectangle-related drawing functions. These draw and fill a specified number of rectangles, supplied as an array of miRectangles. */ /* Structure that defines a rectangle. Upper left corner is [x,y] and lower right corner is [x+width,y+height]. */ typedef struct { int x, y; /* upper left corner */ unsigned int width, height; /* width >= 1 and height >= 1 */ } miRectangle; extern void miDrawRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); extern void miFillRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); /* 3. Arc-related drawing functions. Each of these takes as argument a multi-arc, i.e. an array of elliptic arcs. Here, an `elliptic arc' is a piece of an ellipse whose axes are aligned with the coordinate axes. The arcs are not required to be contiguous. miDrawArcs draws a multi-arc. If the arcs are contiguous, they will be joined as specified in the miGC. Note that miDrawArcs is not reentrant, i.e., not thread-safe (for a thread-safe variant, see below). miFillArcs draws a sequence of filled arcs. They are filled either as chords or as pie slices, as specified by the graphics context. */ /* Structure that defines an `arc' (i.e. a segment of an ellipse whose principal axes are aligned with the coordinate axes). The upper left corner of the bounding box is [x,y], and the lower right corner is [x+width,y+height]. By convention, angle1 and angle2 are the starting polar angle and angle range that the arc would have if it were scaled into a circular arc. */ typedef struct { int x, y; /* upper left corner of ellipse's bounding box */ unsigned int width, height; /* dimensions; width, height >= 1 */ int angle1, angle2; /* starting angle and angle range, in 1/64 degrees */ } miArc; extern void miDrawArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); extern void miFillArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); /* 4. A reentrant (thread-safe) arc-drawing function. A special function is necessary because the normal arc-drawing function miDrawArcs maintains an internal, fixed-size cache of rasterized ellipses, one for each arc that is drawn. The presence of this persistent data (internal to libxmi) prevents miDrawArcs from being reentrant. miDrawArcs_r is a reentrant substitute. The caller of miDrawArcs_r must supply a pointer to an miEllipseCache object as the final argument. A pointer to such an object, which is opaque, is returned by miNewEllipseCache. After zero or more calls to miDrawArcs_r, the object may be deleted by calling miDeleteEllipseCache. */ typedef struct lib_miEllipseCache miEllipseCache; extern miEllipseCache * miNewEllipseCache (void); extern void miDeleteEllipseCache (miEllipseCache *ellipseCache); extern void miDrawArcs_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache); ___END_DECLS /***************** LIBXMI's Canvas-Painting ***********************/ /* A miCanvas encapsulates (i) a drawable, which is a miCanvasPixmap, and (ii) parameters that specify how pixels should be painted. By default, a miCanvasPixmap is a miPixmap, i.e., basically a 2-D array of miPixels (an array of pointers to rows of miPixels). That is a low-level implementation decision that may easily be changed by the libxmi installer. */ /* Binary pixel-merging function type. Such a function maps a source pixel and a destination pixel to a new, merged pixel. */ typedef miPixel (*miPixelMerge2) (miPixel source, miPixel destination); /* Ternary pixel-merging function type. Such a function maps a texture pixel, a source pixel, and a destination pixel, to a new, merged pixel. */ typedef miPixel (*miPixelMerge3) (miPixel texture, miPixel source, miPixel destination); /* Definitions of miBitmap and miPixmap. By convention, (0,0) is upper left hand corner. */ typedef struct { int **bitmap; /* each element is 0 or 1 */ unsigned int width; unsigned int height; } miBitmap; typedef struct { miPixel **pixmap; /* each element is a miPixel */ unsigned int width; unsigned int height; } miPixmap; /* Definition of miCanvasPixmap, the datatype of the drawable encapsulated within a miCanvas. By default, a miCanvasPixmap is a miPixmap. The libxmi installer may alter the definition by defining the symbol MI_CANVAS_DRAWABLE_TYPE at installation time. */ #ifdef MI_CANVAS_DRAWABLE_TYPE typedef MI_CANVAS_DRAWABLE_TYPE miCanvasPixmap; #else typedef miPixmap miCanvasPixmap; #endif /* Definition of the miCanvas structure. */ typedef struct { /* Drawable. */ miCanvasPixmap *drawable; /* A stipple. (Default is NULL, which means no stipping. If non-NULL, the canvas will be tiled with the stipple, and painting will be allowed to take place only at points where the stipple is nonzero.) */ miBitmap *stipple; miPoint stippleOrigin; /* upper left corner of mask is mapped to this */ /* A texture. (Default is NULL, which means no texturing. If non-NULL, the canvas will be tiled with the texture, and painting of a pixel at any point will be affected by the value of the texture pixel there.) */ miPixmap *texture; miPoint textureOrigin; /* upper left corner of texture is mapped to this */ /* User-specified binary pixel-merging function, if any. (Default is NULL, which means the Painter's Algorithm is used: source pixel will replace destination pixel.) */ miPixelMerge2 pixelMerge2; /* User-specified ternary pixel-merging function, if any. Used when a texture has been specified. (Default is NULL, which means the Painter's Algorithm is used: texture pixel will replace destination pixel, and source pixel will be ignored.) */ miPixelMerge3 pixelMerge3; } miCanvas; /* The public function that merges pixels from a miPaintedSet onto a miCanvas. `origin' is the point on the miCanvas to which the point (0,0) in the miPaintedSet is mapped. (It could be called `offset'.) */ extern void miCopyPaintedSetToCanvas (const miPaintedSet *paintedSet, miCanvas *canvas, miPoint origin); /* If MI_CANVAS_DRAWABLE_TYPE is defined by the libxmi installer (see above), then the accessor macros MI_GET_CANVAS_DRAWABLE_PIXEL() and MI_SET_CANVAS_DRAWABLE_PIXEL() will also need to be defined. The default accessor macros simply access the 2-D miPixel array within a miPixmap. MI_GET_CANVAS_DRAWABLE_BOUNDS() should be defined too. */ #ifndef MI_GET_CANVAS_DRAWABLE_PIXEL #define MI_GET_CANVAS_DRAWABLE_PIXEL(pCanvas, x, y, pixel) \ (pixel) = (pCanvas)->drawable->pixmap[(y)][(x)]; #endif #ifndef MI_SET_CANVAS_DRAWABLE_PIXEL #define MI_SET_CANVAS_DRAWABLE_PIXEL(pCanvas, x, y, pixel) \ (pCanvas)->drawable->pixmap[(y)][(x)] = (pixel); #endif #ifndef MI_GET_CANVAS_DRAWABLE_BOUNDS #define MI_GET_CANVAS_DRAWABLE_BOUNDS(pCanvas, xleft, ytop, xright, ybottom) \ { (xleft) = 0; (ytop) = 0; \ (xright) = (pCanvas)->drawable->width - 1; \ (ybottom) = (pCanvas)->drawable->height - 1; \ } #endif /* Functions that set data elements of a miCanvas. */ extern void miSetCanvasStipple (miCanvas *pCanvas, const miBitmap *pStipple, miPoint stippleOrigin); extern void miSetCanvasTexture (miCanvas *pCanvas, const miPixmap *pTexture, miPoint textureOrigin); /* Functions that set the binary and ternary pixel-merging functions to be used when pixels from a miPaintedSet are applied to a miCanvas. The defaults are NULL; for the meaning of NULL, see above. */ extern void miSetPixelMerge2 (miCanvas *pCanvas, miPixelMerge2 pixelMerge2); extern void miSetPixelMerge3 (miCanvas *pCanvas, miPixelMerge3 pixelMerge3); /* The libxmi installer may request that the default algorithm used when applying pixels to a miPaintCanvas be something other than the Painter's Algorithm, by defining MI_DEFAULT_MERGE2_PIXEL at installation time. */ #ifndef MI_DEFAULT_MERGE2_PIXEL /* use painter's algorithm */ #define MI_DEFAULT_MERGE2_PIXEL(new, source, dest) { (new) = (source); } #endif /* Likewise, the libxmi installer may request that the default algorithm used when applying pixels to a miPaintCanvas, when a texture pixel is available, be something other than the `replace canvas pixel by texture pixel' algorithm. */ #ifndef MI_DEFAULT_MERGE3_PIXEL /* use painter's algorithm */ #define MI_DEFAULT_MERGE3_PIXEL(new, texture, source, dest) { (new) = (texture); } #endif #ifndef MI_CANVAS_DRAWABLE_TYPE /* Constructor, destructor, and copy constructor for the miCanvas class. These are declared (and defined) only if the libxmi installer doesn't redefine the type of the drawable encapsulated within a miCanvas. */ extern miCanvas * miNewCanvas (unsigned int width, unsigned int height, miPixel initPixel); extern void miDeleteCanvas (miCanvas *pCanvas); extern miCanvas * miCopyCanvas (const miCanvas *pCanvas); #endif /* not MI_CANVAS_DRAWABLE_TYPE */ /**********************************************************************/ #endif /* not _XMI_H_ */ �����������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_api.h�����������������������������������������������������������������������0000644�0001750�0001750�00000007207�10346061026�013240� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Internal counterparts of libxmi's core functions, each of which takes a (miPaintedSet *) as first argument. */ extern void miDrawPoints_internal (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miDrawLines_internal (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miFillPolygon_internal (miPaintedSet *paintedSet, const miGC *pGC, miPolygonShape shape, miCoordMode mode, int npts, const miPoint *pPts); extern void miDrawRectangles_internal (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); extern void miFillRectangles_internal (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); extern void miDrawArcs_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); extern void miFillArcs_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); extern void miDrawArcs_r_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipse_cache); /* Internal functions, which are called by wrapper functions defined in mi_api.c. */ extern void miWideDash (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miZeroDash (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miWideLine (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miZeroLine (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); extern void miPolyArc (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); extern void miZeroPolyArc (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); extern void miPolyArc_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipse_cache); extern void miZeroPolyArc_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipse_cache); /* Declarations of other internal functions, which should really be moved elsewhere. */ /* wrappers for storage allocation functions, see mi_alloc.c */ extern void * mi_xmalloc (size_t size); extern void * mi_xcalloc (size_t nmemb, size_t size); extern void * mi_xrealloc (void * p, size_t size); /* other misc. internal functions */ extern void miFillConvexPoly (miPaintedSet *paintedSet, const miGC *pGC, int count, const miPoint *ptsIn); extern void miFillGeneralPoly (miPaintedSet *paintedSet, const miGC *pGC, int count, const miPoint *ptsIn); extern void miStepDash (int dist, int *pDashNum, int *pDashIndex, const unsigned int *pDash, int numInDashList, int *pDashOffset); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_arc.h�����������������������������������������������������������������������0000644�0001750�0001750�00000002372�10346061034�013231� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef NO_NONREENTRANT_POLYARC_SUPPORT /* The reentrant functions miPolyArc_r() and miZeroPolyArc_r() take a pointer to a user-supplied cache of rasterized elliptical arcs as an argument. Their non-reentrant counterparts miPolyArc() and miZeroPolyArc() use a pointer to an in-library cache. */ extern miEllipseCache * _mi_ellipseCache; #endif /* NO_NONREENTRANT_POLYARC_SUPPORT */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_fllarc.h��������������������������������������������������������������������0000644�0001750�0001750�00000011771�10346060140�013727� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file is included by mi_fllarc.c (which contains code for filling a poly-arc) and mi_arc.c (which contains code for drawing a wide poly-arc). */ #define FULLCIRCLE (360 * 64) /*----------------------------------------------------------------------*/ /* Structures and macros used by arc-filling code in mi_arc.c */ /*----------------------------------------------------------------------*/ /* Structure containing variables that are updated during a scan through a filled arc. */ typedef struct { int xorg, yorg; int y; int dx, dy; int e; int ym, yk, xm, xk; } miFillArc; /* A floating-point version, used for non-circular arcs one of whose dimensions (width or height) is greater than 800 pixels. Could use 64-bit integers. */ typedef struct { int xorg, yorg; /* upper left corner */ int y; /* vertical semi-axis */ int dx, dy; double e; double ym, yk, xm, xk; } miFillArcD; /* Which to use? */ #define MI_CAN_FILL_ARC(arc) (((arc)->width == (arc)->height) || \ (((arc)->width <= 800) && ((arc)->height <= 800))) /* Nothing to draw? */ #define MI_FILLED_ARC_IS_EMPTY(arc) (!(arc)->angle2 || \ !(arc)->width || !(arc)->height || \ (((arc)->width == 1) && ((arc)->height & 1))) /* used for setup only */ #define MIFILLARCSETUP(info, x, y, e, xk, xm, yk, ym, dx, dy, xorg, yorg) \ x = 0; \ y = info.y; \ e = info.e; \ xk = info.xk; \ xm = info.xm; \ yk = info.yk; \ ym = info.ym; \ dx = info.dx; \ dy = info.dy; \ xorg = info.xorg; \ yorg = info.yorg #define MIFILLARCSTEP(x, y, e, xk, xm, yk, ym, dx, slw) \ e += yk; \ while (e >= 0) \ { \ x++; \ xk -= xm; \ e += xk; \ } \ y--; \ yk -= ym; \ slw = (x << 1) + dx; \ if ((e == xk) && (slw > 1)) \ slw-- #define MIFILLARCLOWER(e, xk, y, dy, slw) (((y + dy) != 0) && ((slw > 1) || (e != xk))) /* pie-slice related things */ typedef struct { int x; int stepx; int deltax; int e; int dy; int dx; } miSliceEdge; typedef struct { miSliceEdge edge1, edge2; int min_top_y, max_top_y; int min_bot_y, max_bot_y; bool edge1_top, edge2_top; bool flip_top, flip_bot; } miArcSlice; #define MIARCSLICESTEP(edge) \ edge.x -= edge.stepx; \ edge.e -= edge.dx; \ if (edge.e <= 0) \ { \ edge.x -= edge.deltax; \ edge.e += edge.dy; \ } #define MIFILLSLICEUPPER(y, slice) \ ((y >= slice.min_top_y) && (y <= slice.max_top_y)) #define MIFILLSLICELOWER(y, slice) \ ((y >= slice.min_bot_y) && (y <= slice.max_bot_y)) #define MIARCSLICEUPPER(xl,xr,slice,slw) \ xl = xorg - x; \ xr = xl + slw - 1; \ if (slice.edge1_top && (slice.edge1.x < xr)) \ xr = slice.edge1.x; \ if (slice.edge2_top && (slice.edge2.x > xl)) \ xl = slice.edge2.x; #define MIARCSLICELOWER(xl,xr,slice,slw) \ xl = xorg - x; \ xr = xl + slw - 1; \ if (!slice.edge1_top && (slice.edge1.x > xl)) \ xl = slice.edge1.x; \ if (!slice.edge2_top && (slice.edge2.x < xr)) \ xr = slice.edge2.x; /*----------------------------------------------------------------------*/ /* Macros used by wide-arc-drawing code in mi_arc.c */ /*----------------------------------------------------------------------*/ /* used for setup only */ #define MIWIDEARCSETUP(x,y,dy,slw,e,xk,xm,yk,ym) \ x = 0; \ y = slw >> 1; \ yk = y << 3; \ xm = 8; \ ym = 8; \ if (dy) \ { \ xk = 0; \ if (slw & 1) \ e = -1; \ else \ e = -(y << 2) - 2; \ } \ else \ { \ y++; \ yk += 4; \ xk = -4; \ if (slw & 1) \ e = -(y << 2) - 3; \ else \ e = - (y << 3); \ } #define MIFILLINARCSTEP(inx, iny, ine, inxk, inxm, inyk, inym, dx, slw) \ ine += inyk; \ while (ine >= 0) \ { \ inx++; \ inxk -= inxm; \ ine += inxk; \ } \ iny--; \ inyk -= inym; \ slw = (inx << 1) + dx; \ if ((ine == inxk) && (slw > 1)) \ slw-- /*----------------------------------------------------------------------*/ �������plotutils-2.6/libxmi/mi_fply.h����������������������������������������������������������������������0000644�0001750�0001750�00000003217�10346060174�013441� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #define EPSILON 0.000001 #define ISEQUAL(a,b) (FABS((a) - (b)) <= EPSILON) #define UNEQUAL(a,b) (FABS((a) - (b)) > EPSILON) #define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y)) /* Point with sub-pixel positioning. In this case we use doubles, but * see mi_fplycon.c for other possibilities. */ typedef struct { double x, y; } SppPoint; /* Arc with sub-pixel positioning. */ typedef struct { double x, y, width, height; double angle1, angle2; } SppArc; extern void miFillSppPoly (miPaintedSet *paintedSet, miPixel pixel, int count, const SppPoint *ptsIn, int xTrans, int yTrans, double xFtrans, double yFtrans); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_gc.h������������������������������������������������������������������������0000644�0001750�0001750�00000005777�10346061063�013073� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* A miGC structure contains high-level drawing parameters. Such structures are created, modified, and destroyed by functions in mi_gc.c. miGC is typedef'd as lib_miGC in xmi.h. lib_miGC is defined here, privately, so that an miGC will be opaque. The chief difference between libxmi and X11 is that libxmi supports painting with interpolated colors (e.g., `gradient fill'). Several types of interpolation are supported. Other significant differences from X11 are (1) the dash array is an array of unsigned int's rather than char's, so that much longer dashes may be drawn, and (2) the miter limit is a GC attribute like any other (in X11, it is fixed at 10.43, and may not be altered). */ /* Values for an miGC's miGCPaintStyle attribute (default=MI_PAINT_SOLID). */ enum { MI_PAINT_SOLID, MI_PAINT_INTERPOLATED_PARALLEL, MI_PAINT_INTERPOLATED_TRIANGULAR, MI_PAINT_INTERPOLATED_ELLIPTICAL, MI_PAINT_CUSTOM }; struct lib_miGC { /* paint style (either solid or an interpolated [`gradient'] style) */ int paintStyle; /* default = miPaintSolid */ /* array of pixel types, used if paintStyle = miPaintSolid */ miPixel *pixels; /* array of pixel types */ int numPixels; /* number of pixel types (must be >=2) */ /* arrays of pixel types, used if paintStyle is an interpolated style */ miPixel triangularInterpPixels[3]; miPixel parallelInterpPixels[2]; miPixel ellipticalInterpPixels[3]; /* parameters for libxmi's core drawing functions (dash-related) */ unsigned int *dash; /* dash array (lengths of dashes in pixels) */ int numInDashList; /* length of dash array */ int dashOffset; /* pixel offset of first dash (nonnegative) */ /* parameters for libxmi's core drawing functions (not dash-related) */ int lineStyle; /* default = miLineSolid */ unsigned int lineWidth; /* line thickness in pixels (default = 0) */ int joinStyle; /* default = miJoinMiter */ int capStyle; /* default = miCapButt */ double miterLimit; /* default = 10.43, as in X11 */ /* parameters for libxmi's core filling functions */ int fillRule; /* default = miEvenOddRule */ int arcMode; /* default = miArcPieSlice */ }; �plotutils-2.6/libxmi/mi_line.h����������������������������������������������������������������������0000644�0001750�0001750�00000004203�10346061077�013415� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Stuff needed for drawing thin (zero width) lines */ #define X_AXIS 0 #define Y_AXIS 1 #define OUT_LEFT 0x08 #define OUT_RIGHT 0x04 #define OUT_ABOVE 0x02 #define OUT_BELOW 0x01 #define MI_OUTCODES(outcode, x, y, xmin, ymin, xmax, ymax) \ {\ if (x < xmin) outcode |= OUT_LEFT;\ if (x > xmax) outcode |= OUT_RIGHT;\ if (y < ymin) outcode |= OUT_ABOVE;\ if (y > ymax) outcode |= OUT_BELOW;\ } #define round(dividend, divisor) \ ( (((dividend)<<1) + (divisor)) / ((divisor)<<1) ) #define ceiling(m,n) (((m)-1)/(n) + 1) #define SWAPINT(i, j) \ { int _t = i; i = j; j = _t; } #define SWAPINT_PAIR(x1, y1, x2, y2)\ { int t = x1; x1 = x2; x2 = t;\ t = y1; y1 = y2; y2 = t;\ } #define AbsDeltaAndSign(_p2, _p1, _absdelta, _sign) \ (_sign) = 1; \ (_absdelta) = (_p2) - (_p1); \ if ( (_absdelta) < 0) { (_absdelta) = -(_absdelta); (_sign) = -1; } #ifndef FIXUP_X_MAJOR_ERROR #define FIXUP_X_MAJOR_ERROR(_e, _signdx, _signdy) \ (_e) -= ( (_signdx) < 0) #endif #ifndef FIXUP_Y_MAJOR_ERROR #define FIXUP_Y_MAJOR_ERROR(_e, _signdx, _signdy) \ (_e) -= ( (_signdy) < 0) #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_ply.h�����������������������������������������������������������������������0000644�0001750�0001750�00000014440�10346060252�013270� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* * Created by Brian Kelleher; Oct 1985 * * Include file for filled polygon routines. * * These are the data structures needed to scan convert regions. Two * different scan conversion methods are available: the even-odd method, * and the winding number method. The even-odd rule states that a point is * inside the polygon if a ray drawn from that point in any direction will * pass through an odd number of path segments. By the winding number * rule, a point is decided to be inside the polygon if a ray drawn from * that point in any direction will pass through a different number of * clockwise and counter-clockwise path segments. * * These data structures are adapted somewhat from the algorithm in * (Foley/Van Dam) for scan converting polygons. The basic algorithm is to * start at the top (smallest y) of the polygon, stepping down to the * bottom of the polygon by incrementing the y coordinate. We keep a list * of edges which the current scanline crosses, sorted by x. This list is * called the Active Edge Table (AET). As we increment the y-coordinate, * we update each entry in the AET to reflect the edges' new xcoords. This * list must be sorted at each scanline in case two edges intersect. We * also keep a data structure known as the Edge Table (ET), which keeps * track of all edges that the current scanline has not yet reached. The * ET is basically a list of ScanLineList structures containing a list of * edges which are entered at a given scanline. There is one ScanLineList * per scanline at which an edge is entered. When we enter a new edge, we * move it from the ET to the AET. * * From the AET, we can implement the even-odd rule as in (Foley/Van Dam). * The winding number rule is a little trickier. We also keep the * EdgeTableEntries in the AET linked by the nextWETE (winding * EdgeTableEntry) link. This allows the edges to be linked just as before * for updating purposes, but only uses the edges linked by the nextWETE * link as edges representing spans of the polygon to drawn (as with the * even-odd rule). */ typedef struct _EdgeTableEntry { int ymax; /* ycoord at which we exit this edge. */ BRESINFO bres; /* Bresenham info to run the edge */ struct _EdgeTableEntry *next; /* next in the list */ struct _EdgeTableEntry *back; /* for insertion sort */ struct _EdgeTableEntry *nextWETE; /* for winding num rule */ bool ClockWise; /* flag for winding number rule */ } EdgeTableEntry; typedef struct _ScanLineList{ int scanline; /* the scanline represented */ EdgeTableEntry *edgelist; /* header node */ struct _ScanLineList *next; /* next in the list */ } ScanLineList; typedef struct { int ymax; /* ymax for the polygon */ int ymin; /* ymin for the polygon */ ScanLineList scanlines; /* header node */ } EdgeTable; /* * Here is a struct to help with storage allocation * so we can allocate a big chunk at a time, and then take * pieces from this heap when we need to. */ #define SLLSPERBLOCK 25 typedef struct _ScanLineListBlock { ScanLineList SLLs[SLLSPERBLOCK]; struct _ScanLineListBlock *next; } ScanLineListBlock; /* * number of points to buffer before sending them off * to scanlines() : Must be an even number */ #define NUMPTSTOBUFFER 200 /* * * A few macros for the inner loops of the fill code where * performance considerations don't allow a procedure call. * * Evaluate the given edge at the given scanline. * If the edge has expired, then we leave it and fix up * the active edge table; otherwise, we increment the * x value to be ready for the next scanline. * The winding number rule is in effect, so we must notify * the caller when the edge has been removed so he * can reorder the Winding Active Edge Table. */ #define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \ if (pAET->ymax == y) { /* leaving this edge */ \ pPrevAET->next = pAET->next; \ pAET = pPrevAET->next; \ fixWAET = true; \ if (pAET) \ pAET->back = pPrevAET; \ } \ else { \ BRESINCRPGONSTRUCT(pAET->bres); \ pPrevAET = pAET; \ pAET = pAET->next; \ } \ } /* * Evaluate the given edge at the given scanline. * If the edge has expired, then we leave it and fix up * the active edge table; otherwise, we increment the * x value to be ready for the next scanline. * The even-odd rule is in effect. */ #define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \ if (pAET->ymax == y) { /* leaving this edge */ \ pPrevAET->next = pAET->next; \ pAET = pPrevAET->next; \ if (pAET) \ pAET->back = pPrevAET; \ } \ else { \ BRESINCRPGONSTRUCT(pAET->bres); \ pPrevAET = pAET; \ pAET = pAET->next; \ } \ } extern bool miInsertionSort (EdgeTableEntry *AET); extern void miCreateETandAET (int count, const miPoint *pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock); extern void miloadAET (EdgeTableEntry *AET, EdgeTableEntry *ETEs); extern void micomputeWAET (EdgeTableEntry *AET); extern void miFreeStorage (ScanLineListBlock *pSLLBlock); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_scanfill.h������������������������������������������������������������������0000644�0001750�0001750�00000011176�10346060325�014263� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SCANFILLINCLUDED #define SCANFILLINCLUDED /* * miscanfill.h * * Written by Brian Kelleher; Jan 1985 * * This file contains a few macros to help track * the edge of a filled object. The object is assumed * to be filled in scanline order, and thus the * algorithm used is an extension of Bresenham's line * drawing algorithm which assumes that y is always the * major axis. * Since these pieces of code are the same for any filled shape, * it is more convenient to gather the library in one * place, but since these pieces of code are also in * the inner loops of output primitives, procedure call * overhead is out of the question. * See the author for a derivation if needed. */ /* * In scan converting polygons, we want to choose those pixels * which are inside the polygon. Thus, we add .5 to the starting * x coordinate for both left and right edges. Now we choose the * first pixel which is inside the polygon for the left edge and the * first pixel which is outside the polygon for the right edge. * Draw the left pixel, but not the right. * * How to add .5 to the starting x coordinate: * If the edge is moving to the right, then subtract dy from the * error term from the general form of the algorithm. * If the edge is moving to the left, then add dy to the error term. * * The reason for the difference between edges moving to the left * and edges moving to the right is simple: If an edge is moving * to the right, then we want the algorithm to flip immediately. * If it is moving to the left, then we don't want it to flip until * we traverse an entire pixel. */ #define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \ int dx; /* local storage */ \ \ /* \ * if the edge is horizontal, then it is ignored \ * and assumed not to be processed. Otherwise, do this stuff. \ */ \ if ((dy) != 0) { \ xStart = (x1); \ dx = (x2) - xStart; \ if (dx < 0) { \ m = dx / (dy); \ m1 = m - 1; \ incr1 = -2 * dx + 2 * (dy) * m1; \ incr2 = -2 * dx + 2 * (dy) * m; \ d = 2 * m * (dy) - 2 * dx - 2 * (dy); \ } else { \ m = dx / (dy); \ m1 = m + 1; \ incr1 = 2 * dx - 2 * (dy) * m1; \ incr2 = 2 * dx - 2 * (dy) * m; \ d = -2 * m * (dy) + 2 * dx; \ } \ } \ } #define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \ if (m1 > 0) { \ if (d > 0) { \ minval += m1; \ d += incr1; \ } \ else { \ minval += m; \ d += incr2; \ } \ } else {\ if (d >= 0) { \ minval += m1; \ d += incr1; \ } \ else { \ minval += m; \ d += incr2; \ } \ } \ } /* * This structure contains all of the information needed * to run the bresenham algorithm. * The variables may be hardcoded into the declarations * instead of using this structure to make use of * register declarations. */ typedef struct { int minor_axis; /* minor axis */ int d; /* decision variable */ int m, m1; /* slope and slope+1 */ int incr1, incr2; /* error increments */ } BRESINFO; #define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \ BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \ bres.m, bres.m1, bres.incr1, bres.incr2) #define BRESINCRPGONSTRUCT(bres) \ BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2) #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_spans.h���������������������������������������������������������������������0000644�0001750�0001750�00000010546�10346060365�013620� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This is the public include file for the miPaintedSet module, contained in mi_spans.c. */ /* A Spans structure is a sorted list of spans, i.e. a list of point ranges [xmin,xmax], sorted in increasing y order. There may be more than one span at a given y. */ typedef struct { int count; /* number of spans */ miPoint *points; /* pointer to list of start points */ unsigned int *widths; /* pointer to list of widths */ } Spans; /* A SpanGroup is an unsorted list of Spans's, associated with a particular pixel value. A SpanGroup is allowed to include more than a single Spans because most libxmi drawing functions write out multiple Spans's. */ typedef struct { miPixel pixel; /* pixel value */ Spans *group; /* Spans slots */ int size; /* number of Spans slots allocated */ int count; /* number of Spans slots filled */ int ymin, ymax; /* min, max y values over all Spans's */ } SpanGroup; /* A miPaintedSet structure is an array of SpanGroups, specifying the partition into differently painted subsets. There is at most one SpanGroup for any pixel. */ typedef struct lib_miPaintedSet { SpanGroup **groups; /* SpanGroup slots */ int size; /* number of SpanGroup slots allocated */ int ngroups; /* number of SpanGroup slots filled */ } _miPaintedSet; /* libxmi's low-level painting macro. It `paints' a Spans, i.e. a list of spans assumed to be in y-increasing order, to a miPaintedSet with a specified pixel value. To do this, it invokes the lower-level function miAddSpansToPaintedSet() in mi_spans.c. The passed point and width arrays should have been allocated on the heap, since they will be eventually freed; e.g., when the miPaintedSet is cleared or deallocated. */ #define MI_PAINT_SPANS(paintedSet, pixel, numSpans, ppts, pwidths) \ {\ Spans spanRec;\ if (numSpans > 0) \ { \ spanRec.points = (ppts);\ spanRec.widths = (pwidths);\ spanRec.count = (numSpans);\ miAddSpansToPaintedSet (&spanRec, (paintedSet), (pixel));\ } \ else \ { \ free (ppts); \ free (pwidths); \ } \ } /* A wrapper for MI_PAINT_SPANS() that can be applied to a span array (i.e. to a point and width array) that can't be freed, so must be copied. We try not to use this. */ #define MI_COPY_AND_PAINT_SPANS(paintedSet, pixel, nPts, FirstPoint, FirstWidth) \ {\ if ((nPts) > 0) \ { \ miPoint *ppt, *pptInit, *oldppt; \ unsigned int *pwidth, *pwidthInit, *oldpwidth; \ int ptsCounter; \ ppt = pptInit = (miPoint *) mi_xmalloc ((nPts) * sizeof (miPoint));\ pwidth = pwidthInit = (unsigned int *) mi_xmalloc ((nPts) * sizeof (unsigned int));\ oldppt = FirstPoint;\ oldpwidth = FirstWidth;\ for (ptsCounter = (nPts); --ptsCounter >= 0; )\ {\ *ppt++ = *oldppt++;\ *pwidth++ = *oldpwidth++;\ }\ MI_PAINT_SPANS(paintedSet, pixel, (nPts), pptInit, pwidthInit)\ } \ } /* miPaintedSet manipulation routines (other than public) */ extern void miAddSpansToPaintedSet (const Spans *spans, miPaintedSet *paintedSet, miPixel pixel); extern void miQuickSortSpansY (miPoint *points, unsigned int *widths, int numSpans); extern void miUniquifyPaintedSet (miPaintedSet *paintedSet); ����������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_widelin.h�������������������������������������������������������������������0000644�0001750�0001750�00000010177�10346060445�014126� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Author: Keith Packard, MIT X Consortium */ /* definitions related to filling of convex polygons, used in code for * drawing of wide lines (with caps/joins) via span merging */ /* Structure used for moving along left and right edges of polygons via the midpoint line algorithm. The algorithm: increment y, (height-1) times. At each step, increment e by dx. If this makes e positive, also subtract dy. Corresponding change to x: add stepx to x, and (if dy needed to be subtracted from e), also add signdx to x. */ typedef struct { unsigned int height; /* number of scanlines in edge */ int x; /* starting x coordinate of edge */ int stepx; /* fixed integer dx (usually 0) */ int signdx; /* additional (optional) integer dx */ int e; /* initial value for decision variable */ int dy; /* dy/dx is (rational) slope of edge */ int dx; } PolyEdge; /* * types for general polygon routines */ typedef struct { double x, y; } PolyVertex; typedef struct { int dx, dy; /* dy/dx is (rational) slope */ double k; /* x0 * dy - y0 * dx */ } PolySlope; /* * Line face, used in constructing additional cap/join polygons */ typedef struct { double xa, ya; /* endpoint of line face (rel. to (x,y)) */ int dx, dy; /* (dx,dy) points into line (a convention) */ int x, y; /* line end, i.e. center of face */ double k; /* xa * dy - ya * dx */ } LineFace; /* Macros for stepping around a convex polygon (i.e. downward from top, along the sequence of `left edges' and `right edges') */ /* load fields from next left edge in list */ #define MIPOLYRELOADLEFT if (!left_height && left_count) { \ left_height = left->height; \ left_x = left->x; \ left_stepx = left->stepx; \ left_signdx = left->signdx; \ left_e = left->e; \ left_dy = left->dy; \ left_dx = left->dx; \ --left_count; \ ++left; \ } /* load fields from next right edge in list */ #define MIPOLYRELOADRIGHT if (!right_height && right_count) { \ right_height = right->height; \ right_x = right->x; \ right_stepx = right->stepx; \ right_signdx = right->signdx; \ right_e = right->e; \ right_dy = right->dy; \ right_dx = right->dx; \ --right_count; \ ++right; \ } /* Update steps in edge traversal via midpoint line algorithm */ /* step along left edge (modify x appropriately as y is incremented by 1) */ #define MIPOLYSTEPLEFT left_x += left_stepx; \ left_e += left_dx; \ if (left_e > 0) \ { \ left_x += left_signdx; \ left_e -= left_dy; \ } /* step along right edge (modify x appropriately as y is incremented by 1) */ #define MIPOLYSTEPRIGHT right_x += right_stepx; \ right_e += right_dx; \ if (right_e > 0) \ { \ right_x += right_signdx; \ right_e -= right_dy; \ } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_zerarc.h��������������������������������������������������������������������0000644�0001750�0001750�00000005773�10346060466�013772� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This header file is included by mi_zerarc.c, which draws a single-pixel (i.e. Bresenham) poly-arc using a fast integer algorithm. It defines structures and macros used in the algorithm. */ typedef struct { int x; int y; unsigned int mask; } miZeroArcPt; typedef struct { int x, y, k1, k3, a, b, d, dx, dy; int alpha, beta; int xorg, yorg; /* upper left corner */ int xorgo, yorgo; unsigned int w, h; unsigned int initialMask; miZeroArcPt start, altstart, end, altend; int firstx, firsty; int startAngle, endAngle; /* in 1/64 degrees */ } miZeroArc; /* miZeroPolyArc() draws an arc only if it satisfies the following size constraint. If it doesn't, miZeroPolyArc() hands it off to miPolyArc(), which uses a floating point algorithm. */ #define MI_CAN_ZERO_ARC(arc) (((arc)->width == (arc)->height) || \ (((arc)->width <= 800) && ((arc)->height <= 800))) /* used for setup only */ #define MIARCSETUP(info, x, y, k1, k3, a, b, d, dx, dy) \ x = info.x; \ y = info.y; \ k1 = info.k1; \ k3 = info.k3; \ a = info.a; \ b = info.b; \ d = info.d; \ dx = info.dx; \ dy = info.dy #define MIARCOCTANTSHIFT(info, x, y, dx, dy, a, b, d, k1, k3, clause) \ if (a < 0) \ { \ if (y == (int)info.h) \ { \ d = -1; \ a = b = k1 = 0; \ } \ else \ { \ dx = (k1 << 1) - k3; \ k1 = dx - k1; \ k3 = -k3; \ b = b + a - (k1 >> 1); \ d = b + ((-a) >> 1) - d + (k3 >> 3); \ if (dx < 0) \ a = -((-dx) >> 1) - a; \ else \ a = (dx >> 1) - a; \ dx = 0; \ dy = 1; \ clause \ } \ } #define MIARCSTEP(x, y, dx, dy, a, b, d, k1, k3, move1, move2) \ b -= k1; \ if (d < 0) \ { \ x += dx; \ y += dy; \ a += k1; \ d += b; \ move1 \ } \ else \ { \ x++; \ y++; \ a += k3; \ d -= a; \ move2 \ } #define MIARCCIRCLESTEP(x, y, a, b, d, k1, k3, clause) \ b -= k1; \ x++; \ if (d < 0) \ { \ a += k1; \ d += b; \ } \ else \ { \ y++; \ a += k3; \ d -= a; \ clause \ } �����plotutils-2.6/libxmi/extern.h�����������������������������������������������������������������������0000644�0001750�0001750�00000005215�10346061000�013274� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* If libxmi is compiled standalone, this header file is #included. It renames the global symbols by prepending each name with an underscore, to avoid polluting the user-level namespace. */ /* Note: if libxmi is compiled as part of libplot/libplotter, the extern.h that is #included is a different file. That file renames each global symbol by prepending two underscores, rather than a single underscore. That alteration will permit an application to link with both libplot/libplotter and libxmi, if desired. */ #define mi_xmalloc _mi_xmalloc #define mi_xcalloc _mi_xcalloc #define mi_xrealloc _mi_xrealloc #define miAddSpansToPaintedSet _miAddSpansToPaintedSet #define miDrawArcs_r_internal _miDrawArcs_r_internal #define miDrawArcs_internal _miDrawArcs_internal #define miDrawLines_internal _miDrawLines_internal #define miDrawRectangles_internal _miDrawRectangles_internal #define miPolyArc_r _miPolyArc_r #define miPolyArc _miPolyArc #define miFillArcs_internal _miFillArcs_internal #define miFillRectangles_internal _miFillRectangles_internal #define miFillSppPoly _miFillSppPoly #define miFillPolygon_internal _miFillPolygon_internal #define miFillConvexPoly _miFillConvexPoly #define miFillGeneralPoly _miFillGeneralPoly #define miDrawPoints_internal _miDrawPoints_internal #define miCreateETandAET _miCreateETandAET #define miloadAET _miloadAET #define micomputeWAET _micomputeWAET #define miInsertionSort _miInsertionSort #define miFreeStorage _miFreeStorage #define miQuickSortSpansY _miQuickSortSpansY #define miUniquifyPaintedSet _miUniquifyPaintedSet #define miWideDash _miWideDash #define miStepDash _miStepDash #define miWideLine _miWideLine #define miZeroPolyArc_r _miZeroPolyArc_r #define miZeroPolyArc _miZeroPolyArc #define miZeroLine _miZeroLine #define miZeroDash _miZeroDash �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/sys-defines.h������������������������������������������������������������������0000644�0001750�0001750�00000017460�10342427712�014241� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#include /* built by autoconf */ #ifndef NULL #define NULL 0 #endif /**********************************************************************/ /* SUPPORT COMPILATION WITH A C++ COMPILER (IF DESIRED) */ /**********************************************************************/ /* Support declarations of C linkage in C++, for functions not declared in C headers the way they should be. */ #ifdef __cplusplus # define __C_LINKAGE "C" #else # define __C_LINKAGE /* empty */ #endif /**********************************************************************/ /* Include all the C headers we'll need. Because many platforms lack one or more standard headers or function declarations, there are numerous tests and substitutions here. */ /**********************************************************************/ /**********************************************************************/ /* If libxmi is being compiling as part of the libplot/libplotter package, add support for multithreading, provided that libc includes pthread functions and pthread.h is present. (This comes first, because defining _REENTRANT may alter system header files.) */ /**********************************************************************/ #ifdef LIBPLOT #ifdef PTHREAD_SUPPORT #ifdef HAVE_PTHREAD_H #define _REENTRANT #include #endif #endif #endif /**********************************************************************/ /* INCLUDE stdio.h, ctype.h, errno.h. (SUBSTITUTE AS NECESSARY.) */ /**********************************************************************/ #include #include /* why is this needed? */ #include /***************************************************************************/ /* INCLUDE math.h, limits.h. (SUBSTITUTE AS NECESSARY.) */ /***************************************************************************/ #ifdef __DJGPP__ /* for DJGPP math.h, must specify that -lm will be used; thanks mdruiter@cs.vu.nl */ #define _USE_LIBM_MATH_H #endif /* Include math.h, and whichever other math-related header files we have */ #include #ifdef HAVE_LIMITS_H #include /* for INT_MAX */ #endif #ifdef HAVE_VALUES_H #include /* for MAXINT (backup) */ #endif /* Bounds on integer datatypes (should be in limits.h, but may not be). */ #ifndef UINT_MAX #ifdef __STDC__ #define UINT_MAX ((unsigned int)(~(0U))) #else #define UINT_MAX ((unsigned int)(~((unsigned int)0))) #endif #endif /* not UINT_MAX */ #ifndef INT_MAX #ifdef MAXINT #define INT_MAX MAXINT #else #define INT_MAX ((int)(~(1U << (8 * (int)sizeof(int) - 1)))) #endif #endif /* not INT_MAX */ /* IBM's definition of INT_MAX is bizarre, in AIX 4.1 at least, and using IROUND() below will yield a warning message unless we repair it */ #ifdef _AIX #ifdef __GNUC__ #undef INT_MAX #define INT_MAX ((int)(~(1U << (8 * (int)sizeof(int) - 1)))) #endif #endif /**********************************************************************/ /* INCLUDE stdlib.h, string.h. (SUBSTITUTE AS NECESSARY; if STDC_HEADERS is defined then they're both present, and stdarg.h and float.h too.) */ /**********************************************************************/ #ifdef STDC_HEADERS #include /* for getenv, atoi, atof, etc. */ #include /* for memcpy, memmove, strchr, malloc, etc. */ #else /* not STDC_HEADERS, must do a LOT of declarations by hand */ #ifdef HAVE_SYS_STDTYPES_H #include /* SunOS needs this for size_t */ #endif /* supply declarations for functions declared in stdlib.h */ extern __C_LINKAGE char *getenv (const char *name); extern __C_LINKAGE int atoi (const char *nptr); extern __C_LINKAGE double atof (const char *nptr); /* supply definitions in stdlib.h */ #define EXIT_FAILURE 1 /* Failing exit status. */ #define EXIT_SUCCESS 0 /* Successful exit status. */ /* determine how to declare (or define) functions declared in string.h */ #ifdef HAVE_STRCHR #ifdef HAVE_STRING_H #include #else #ifdef HAVE_STRINGS_H #include #endif #endif #else /* don't have strchr, prefer strings.h */ #ifdef HAVE_STRINGS_H #include #else #ifdef HAVE_STRING_H #include #endif #endif #define strchr index #define strrchr rindex #endif /* not HAVE_STRCHR */ #ifndef HAVE_MEMCPY #define memcpy(d, s, n) bcopy ((s), (d), (n)) #endif /* not HAVE_MEMCPY */ #ifndef HAVE_MEMMOVE #define memmove(d, s, n) bcopy ((s), (d), (n)) #endif /* not HAVE_MEMMOVE */ #ifndef HAVE_STRCASECMP /* will use local version */ extern __C_LINKAGE int strcasecmp (const char *s1, const char *s2); #endif /* not HAVE_STRCASECMP */ /* supply declarations for more functions declared in stdlib.h */ #ifdef HAVE_MALLOC_H #include #else extern __C_LINKAGE void * malloc (size_t size); extern __C_LINKAGE void * realloc (void * ptr, size_t size); extern __C_LINKAGE void * calloc (size_t nmemb, size_t size); extern __C_LINKAGE void free (void * ptr); #endif /* not HAVE_MALLOC_H */ #endif /* not STDC_HEADERS */ /**************************************************************************/ /* Support the `bool' datatype, which our code uses extensively. */ /**************************************************************************/ #ifndef __cplusplus #ifndef HAVE_BOOL_IN_CC #ifdef __STDC__ typedef enum { false = 0, true = 1 } bool; #else /* not __STDC__, do things the old-fashioned way */ typedef int bool; #define false 0 #define true 1 #endif #endif /* not HAVE_BOOL_IN_CC */ #endif /* not __cplusplus */ /**************************************************************************/ /* Define numerical constants (unofficial, so may not be in math.h). */ /**************************************************************************/ #ifndef M_PI #define M_PI 3.14159265358979323846264 #endif #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 #endif #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 #endif #ifndef M_SQRT3 #define M_SQRT3 1.73205080756887719 #endif /**************************************************************************/ /* Define misc. math macros (in GCC, can be evaluated more rapidly). */ /**************************************************************************/ #ifdef __GNUC__ #define DMAX(a,b) ({double _a = (a), _b = (b); _a > _b ? _a : _b; }) #define DMIN(a,b) ({double _a = (a), _b = (b); _a < _b ? _a : _b; }) #define IMAX(a,b) ({int _a = (a), _b = (b); _a > _b ? _a : _b; }) #define IMIN(a,b) ({int _a = (a), _b = (b); _a < _b ? _a : _b; }) #define UMAX(a,b) ({unsigned int _a = (a), _b = (b); _a > _b ? _a : _b; }) #define UMIN(a,b) ({unsigned int _a = (a), _b = (b); _a < _b ? _a : _b; }) #define IROUND(x) ({double _x = (x); int _i; \ if (_x >= INT_MAX) _i = INT_MAX; \ else if (_x <= -(INT_MAX)) _i = -(INT_MAX); \ else _i = (_x > 0.0 ? (int)(_x + 0.5) : (int)(_x - 0.5)); \ _i;}) #define FROUND(x) ({double _x = (x); float _f; \ if (_x >= FLT_MAX) _f = FLT_MAX; \ else if (_x <= -(FLT_MAX)) _f = -(FLT_MAX); \ else _f = _x; \ _f;}) #define FABS(x) ((x) >= 0.0 ? (x) : -(x)) #define ICEIL(x) ({double _x = (x); int _i = (int)_x; \ ((_x == _i) || (_x < 0.0)) ? _i : _i + 1;}) #define IFLOOR(x) ({double _x = (x); int _i = (int)_x; \ ((_x == _i) || (_x > 0.0)) ? _i : _i - 1;}) #else #define DMAX(a,b) ((a) > (b) ? (a) : (b)) #define DMIN(a,b) ((a) < (b) ? (a) : (b)) #define IMAX(a,b) ((a) > (b) ? (a) : (b)) #define IMIN(a,b) ((a) < (b) ? (a) : (b)) #define UMAX(a,b) ((a) > (b) ? (a) : (b)) #define UMIN(a,b) ((a) < (b) ? (a) : (b)) #define IROUND(x) ((int) ((x) > 0 ? (x) + 0.5 : (x) - 0.5)) #define FROUND(x) ((float)(x)) #define FABS(x) ((x) >= 0.0 ? (x) : -(x)) #define ICEIL(x) ((int)ceil(x)) #define IFLOOR(x) ((int)floor(x)) #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/Makefile.am��������������������������������������������������������������������0000644�0001750�0001750�00000001117�10342430615�013657� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Makefile.am for libxmi. lib_LTLIBRARIES = libxmi.la include_HEADERS = xmi.h noinst_HEADERS = mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \ mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h extern.h \ sys-defines.h libxmi_la_LDFLAGS = -version-info 1:3:1 libxmi_la_SOURCES = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c \ mi_fllrct.c mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c \ mi_plypnt.c mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c \ mi_version.c EXTRA_DIST = CUSTOMIZE README-X VERSION drawing.c SUBDIRS = info ##EOF �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/Makefile.in��������������������������������������������������������������������0000644�0001750�0001750�00000052237�11234210074�013675� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libxmi DIST_COMMON = README $(include_HEADERS) $(noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in AUTHORS COPYING \ ChangeLog INSTALL NEWS TODO config.guess config.sub install-sh \ ltconfig ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libxmi_la_LIBADD = am_libxmi_la_OBJECTS = mi_alloc.lo mi_api.lo mi_arc.lo mi_canvas.lo \ mi_fllarc.lo mi_fllrct.lo mi_fplycon.lo mi_gc.lo mi_ply.lo \ mi_plycon.lo mi_plygen.lo mi_plypnt.lo mi_plyutil.lo \ mi_spans.lo mi_widelin.lo mi_zerarc.lo mi_zerolin.lo \ mi_version.lo libxmi_la_OBJECTS = $(am_libxmi_la_OBJECTS) libxmi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libxmi_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libxmi_la_SOURCES) DIST_SOURCES = $(libxmi_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive includeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libxmi.la include_HEADERS = xmi.h noinst_HEADERS = mi_api.h mi_arc.h mi_fllarc.h mi_fply.h mi_gc.h mi_line.h \ mi_ply.h mi_scanfill.h mi_spans.h mi_widelin.h mi_zerarc.h extern.h \ sys-defines.h libxmi_la_LDFLAGS = -version-info 1:3:1 libxmi_la_SOURCES = mi_alloc.c mi_api.c mi_arc.c mi_canvas.c mi_fllarc.c \ mi_fllrct.c mi_fplycon.c mi_gc.c mi_ply.c mi_plycon.c mi_plygen.c \ mi_plypnt.c mi_plyutil.c mi_spans.c mi_widelin.c mi_zerarc.c mi_zerolin.c \ mi_version.c EXTRA_DIST = CUSTOMIZE README-X VERSION drawing.c SUBDIRS = info all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libxmi/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libxmi/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libxmi.la: $(libxmi_la_OBJECTS) $(libxmi_la_DEPENDENCIES) $(libxmi_la_LINK) -rpath $(libdir) $(libxmi_la_OBJECTS) $(libxmi_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_arc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_canvas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_fllarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_fllrct.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_fplycon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_gc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_ply.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plycon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plygen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plypnt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_plyutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_spans.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_widelin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_zerarc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mi_zerolin.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-recursive install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-includeHEADERS uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/AUTHORS������������������������������������������������������������������������0000644�0001750�0001750�00000001544�06773666652�012730� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������libxmi originated with the vector graphics code in the X11 sample server, which was written in the mid-to-late 1980's by Brian Kelleher, Joel McCormack, Todd Newman, Keith Packard, Robert Scheifler and Ken Whaley, who worked for Digital Equipment Corp., MIT, and/or the X Consortium. In 1998-99, Robert S. Maier extracted the vector graphics code and merged it into the GNU plotutils package. He later broke it out again, as libxmi. The code needed to be ANSI-ized, rearranged, and extensively commented. Also, basic data structures were changed, so that a two-stage graphics pipeline could be set up. All painting of pixels was changed to go through a miPaintedSet object, and a single method (miAddSpansToPaintedSet). That eliminated all double-painting of pixels. Also, some rendering extensions were added (e.g., multicolored dashes). ������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/COPYING������������������������������������������������������������������������0000644�0001750�0001750�00000043110�10201333263�012650� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/ChangeLog����������������������������������������������������������������������0000644�0001750�0001750�00000000000�06731502573�013375� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/INSTALL������������������������������������������������������������������������0000644�0001750�0001750�00000022104�10170101017�012641� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. 0.1 Basic Installation ====================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 0.2 Compilers and Options ========================= Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. 0.3 Compiling For Multiple Architectures ======================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. 0.4 Installation Names ====================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 0.5 Optional Features ===================== Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. 0.6 Specifying the System Type ============================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. 0.7 Sharing Defaults ==================== If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. 0.8 Defining Variables ====================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). 0.9 `configure' Invocation ========================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/NEWS���������������������������������������������������������������������������0000644�0001750�0001750�00000006574�10346061562�012343� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Version 1.3 of package released, 12/05. (Library version is now 1.3.) Fixed a minor bug in miFillRectangles that rendered it ineffective (thanks to several people for pointing this out). The package may now be compiled with a C++ compiler; if desired, request this by doing e.g. `CC=g++ ./configure'. Support for pre-ANSI C compilers has been largely dropped. Non-working `const' is still checked for, but support for prototypes and void is now assumed. Removal of the preprocessor macros that supported pre-ANSI C, from many source files, has considerably improved maintainability. Updated GNU autotools have been used to prepare this release (autoconf-2.59, libtool-1.5.6; and automake-1.4-p6 for safety's sake). Copyright and license notices have been added to all source files. ---------------------------------------------------------------------- Version 1.2 of package released, 6/00. (Library version is now 1.2.) Fixed bugs in mi_spans.c (in miUniquifySpanGroup, especially) dealing with empty SpanGroups. They were causing memory allocation problems, and even segfaulting, whenever a region in one pixel color was completely covered by a region in another pixel color. libxmi now contains a version string, `mi_libxmi_ver'. The xmi.h header file now contains both the version string and a numeric variant of it, as macros. Cf. libpng. Fixed a bug in miDrawArcs[_r] that was affecting the drawing of solid arcs. (Sometimes they were incorrectly drawn in the background color, i.e., in pixel color #0 rather than pixel color #1.) The internal function `miAddSpansToPaintedSet' now has an underscore prepended to its name, so that it won't pollute the user-level namespace. Our policy: only the API functions should have external names that begin with a letter. This is arranged via #defines in extern.h. At installation time, if CFLAGS is set, it will not be ignored. ---------------------------------------------------------------------- Version 1.1.1 of package released, 9/99. (First official GNU release of package; library version is now 1.1.) No changes to source code; minor changes to packaging. ---------------------------------------------------------------------- Version 1.1 of package released, 7/99. (Library version is now 1.1.) Changed first argument of miCopyPaintedSetToCanvas from (miPaintedSet *) to (const miPaintedSet *). Fixed a bug that caused miDrawPoints() to segfault from when called on a set consisting of only one point. Fixed a bug in miCopyPaintedSetToCanvas() that was leading to intermittent null pointer dereferencing. ---------------------------------------------------------------------- Version 1.0 released, 6/99. (Library version is now 1.0.) Wrote a texinfo manual. Added support for triangular joins, of both polylines and polyarcs. Triangular caps are now supported too, but only for polyarcs. Triangular joins and caps are defined as in HP-GL/2. Added miGCSetAttribs() function, to set multiple GC attributes with a single function call. Changed names of values of enumerated variables defined in xmi.h to modern style (e.g. changed miJoinMiter to MI_JOIN_MITER). In declarations of miSetPixelMerge{2|3}, changed typedef'd datatype of second argument (miPixelMerge{2|3}) from a function to a pointer to a function, for compatibility with very old C compilers. ---------------------------------------------------------------------- Version 0.0 released, 6/99. ������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/TODO���������������������������������������������������������������������������0000644�0001750�0001750�00000001421�07124057043�012315� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Add miDrawPolylines and miFillPolylines. Need a new Boolean attribute in the graphics context, indicating whether polylines and polyarcs that repeat the initial point as the final point should be regarded as closed. The default value should be `true', which is the way we now do it (and X11 does it). But there should be support for `false' too, since a modern Postscript-style path that repeats the initial point as the final point is not necessarily closed. Add support for computation of a bounding box? Add support for clipping; to user-specified rectangular regions at least, or perhaps to a user-specified union of rectangles? Or clipping path / polygon? Add support for triangular line caps to miDrawLines(). Right now, triangular line caps are supported for arcs only. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/config.guess�������������������������������������������������������������������0000755�0001750�0001750�00000125466�10232775425�014172� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit 0 ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms && exit 0 ;; I*) echo ia64-dec-vms && exit 0 ;; V*) echo vax-dec-vms && exit 0 ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/config.sub���������������������������������������������������������������������0000755�0001750�0001750�00000075470�10232775425�013634� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-04-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/install-sh���������������������������������������������������������������������0000755�0001750�0001750�00000014406�10201333265�013631� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/ltconfig�����������������������������������������������������������������������0000755�0001750�0001750�00000276660�07123716100�013376� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; *) PATH_SEPARATOR=':' ;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf "%s\n"' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.3.5 TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). enable_static=yes enable_fast_install=yes enable_dlopen=unknown enable_win32_dll=no ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes ac_ext=c objext=o libext=a exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" . $cache_file fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # Set a sane default for `OBJDUMP'. test -z "$OBJDUMP" && OBJDUMP=objdump # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:603: checking for object suffix" >& 5 if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for executable suffix... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_exeext="no" $rm conftest* echo 'main () { return 0; }' > conftest.c echo "$progname:629: checking for executable suffix" >& 5 if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c | *.err | *.$objext ) ;; *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* fi if test "X$ac_cv_exeext" = Xno; then exeext="" else exeext="$ac_cv_exeext" fi echo "$ac_t$ac_cv_exeext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. link_static_flag="$link_static_flag ${wl}-lC" ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then pic_flag=-Kconform_pic fi ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then pic_flag='-Kconform_pic' link_static_flag='-Bstatic' fi ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi ;; *) echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" ;; esac else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.o" echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftest.dat if ln -s X conftest.dat 2>/dev/null; then $rm conftest.dat LN_S="ln -s" else LN_S=ln fi if test "$LN_S" = "ln -s"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. case "$host_os" in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$with_gcc" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left by newer dlltools. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' # can we support soname and/or expsyms with a.out? -oliva fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$with_gcc" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF fi hardcode_libdir_flag_spec='${wl}-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # As osf3* with the addition of the -msym flag if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; rhapsody*) archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flags_spec='-L$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; unixware7*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" break else NM=${NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' cat <> conftest.c #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else global_symbol_pipe= fi done if test "$pipe_works" = yes; then echo "${ac_t}ok" 1>&6 else echo "${ac_t}failed" 1>&6 fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= fi # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" file_magic_cmd= file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [regex]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH deplibs_check_method=pass_all ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows need_version=no need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) deplibs_check_method=unknown library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' case "$host_os" in hpux10.20*) # TODO: Does this work for hpux-11 too? deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so.$major' library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method=pass_all if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rhapsody*) version_type=sunos library_names_spec='${libname}.so' soname_spec='${libname}.so' shlibpath_var=DYLD_LIBRARY_PATH deplibs_check_method=pass_all ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" file_magic_cmd=/usr/bin/file file_magic_test_file=/lib/libc.so ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in sequent) file_magic_cmd='/bin/file' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; ncr) deplibs_check_method='pass_all' ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. case "$host_os" in cygwin* | mingw* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no echo "checking if package supports dlls... $can_build_shared" 1>&6 fi ;; esac if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "$progname:2248: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "$progname:2288: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "$progname:2335: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "$progname:2375: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "$progname:2423: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes fi case "$lt_cv_dlopen" in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "$progname:2488: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile >/dev/null 2>conftest.out" { (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi done if test "x$ac_cv_header_dlfcn_h" = xyes; then CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" fi eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2526: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self_static=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self_static=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$LTCONFIG_VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms # Symbols that must always be exported. include_expsyms=$include_expsyms EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac test -n "$cache_file" || exit 0 # AC_CACHE_SAVE trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: ��������������������������������������������������������������������������������plotutils-2.6/libxmi/ltmain.sh����������������������������������������������������������������������0000644�0001750�0001750�00000547372�10223115012�013452� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.6 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 224 $" # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2003 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $EXIT_SUCCESS ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $EXIT_SUCCESS ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $EXIT_SUCCESS ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit $EXIT_FAILURE fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # gcc -m* arguments should be passed to the linker via $compiler_flags # in order to pass architecture information to the linker # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo # but this is not reliable with gcc because gcc may use -mfoo to # select a different linker, different libraries, etc, while # -Wl,-mfoo simply passes -mfoo to the linker. -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$save_output-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$save_output-${k}.$objext k=`expr $k + 1` output=$output_objdir/$save_output-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadale object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${output}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "$mkdir $xdir" $run $mkdir "$xdir" status=$? if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi # We will extract separately just the conflicting names and we will no # longer touch any unique names. It is faster to leave these extract # automatically by $AR in one run. $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 $AR t "$xabs" | sort | uniq -cd | while read -r count name do i=1 while test "$i" -le "$count" do # Put our $i before any first dot (extension) # Never overwrite any file name_to="$name" while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" do name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` done $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? i=`expr $i + 1` done done fi oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # GNU ar 2.10+ was changed to match POSIX; thus no paths are # encoded into archives. This makes 'ar r' malfunction in # this piecewise linking case whenever conflicting object # names appear in distinct ar calls; check, warn and compensate. if (for obj in $save_oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 AR_FLAGS=cq fi # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $EXIT_SUCCESS # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/missing������������������������������������������������������������������������0000755�0001750�0001750�00000014520�10201333265�013221� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.in; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`$configure_ac'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`$configure_ac'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`$configure_ac'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mkinstalldirs������������������������������������������������������������������0000755�0001750�0001750�00000001322�10201333265�014424� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_alloc.c���������������������������������������������������������������������0000644�0001750�0001750�00000004165�10346061011�013546� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Wrappers for standard storage allocation functions. The tests for zero size, etc., are necessitated by the way in which the original X11 scan-conversion code was written. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_api.h" /* wrapper for malloc() */ void * mi_xmalloc (size_t size) { void * p; if (size == 0) return (void *)NULL; p = (void *) malloc (size); if (p == (void *)NULL) { fprintf (stderr, "libxmi: "); perror ("out of memory"); exit (EXIT_FAILURE); } return p; } /* wrapper for calloc() */ void * mi_xcalloc (size_t nmemb, size_t size) { void * p; if (size == 0) return (void *)NULL; p = (void *) calloc (nmemb, size); if (p == (void *)NULL) { fprintf (stderr, "libxmi: "); perror ("out of memory"); exit (EXIT_FAILURE); } return p; } /* wrapper for realloc() */ void * mi_xrealloc (void * p, size_t size) { if (!p) return mi_xmalloc (size); else { if (size == 0) { free (p); return (void *)NULL; } p = (void *) realloc (p, size); if (p == (void *)NULL) { fprintf (stderr, "libxmi: "); perror ("out of memory"); exit (EXIT_FAILURE); } return p; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_api.c�����������������������������������������������������������������������0000644�0001750�0001750�00000014217�10346061017�013232� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the core libxmi API, consisting of: 1. miDrawPoints, miDrawLines, miFillPolygon. 2. miDrawRectangles, miFillRectangles. 3. miDrawArcs, miFillArcs. Also the reentrant miDrawArcs_r. Each of these is a wrapper around an internal function that takes as first argument a (miPaintedSet *). A miPaintedSet struct is a structure that is used by Joel McCormack's span-merging module to implement the `touch-each-pixel-once' rule. See mi_spans.c and mi_spans.h. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #define MI_SETUP_PAINTED_SET(paintedSet, pGC) \ {\ } #define MI_TEAR_DOWN_PAINTED_SET(paintedSet) \ {\ miUniquifyPaintedSet (paintedSet); \ } /* ARGS: mode = Origin or Previous */ void miDrawPoints (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { MI_SETUP_PAINTED_SET(paintedSet, pGC) miDrawPoints_internal (paintedSet, pGC, mode, npt, pPts); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } /* ARGS: mode = Origin or Previous */ void miDrawLines (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { MI_SETUP_PAINTED_SET(paintedSet, pGC) miDrawLines_internal (paintedSet, pGC, mode, npt, pPts); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } /* ARGS: mode = Origin or Previous */ void miFillPolygon (miPaintedSet *paintedSet, const miGC *pGC, miPolygonShape shape, miCoordMode mode, int count, const miPoint *pPts) { MI_SETUP_PAINTED_SET(paintedSet, pGC) miFillPolygon_internal (paintedSet, pGC, shape, mode, count, pPts); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } void miDrawRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *prectInit) { MI_SETUP_PAINTED_SET(paintedSet, pGC); miDrawRectangles_internal (paintedSet, pGC, nrects, prectInit); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } void miFillRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrectFill, const miRectangle *prectInit) { fprintf (stderr, "miFillRectangles()\n"); MI_SETUP_PAINTED_SET(paintedSet, pGC); miFillRectangles_internal (paintedSet, pGC, nrectFill, prectInit); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } #ifndef NO_NONREENTRANT_POLYARC_SUPPORT void miDrawArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs) { MI_SETUP_PAINTED_SET(paintedSet, pGC) miDrawArcs_internal (paintedSet, pGC, narcs, parcs); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } #endif /* not NO_NONREENTRANT_POLYARC_SUPPORT */ void miFillArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs) { MI_SETUP_PAINTED_SET(paintedSet, pGC) miFillArcs_internal (paintedSet, pGC, narcs, parcs); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } /* ARGS: ellipseCache = pointer to ellipse data cache */ void miDrawArcs_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache) { MI_SETUP_PAINTED_SET(paintedSet, pGC) miDrawArcs_r_internal (paintedSet, pGC, narcs, parcs, ellipseCache); MI_TEAR_DOWN_PAINTED_SET(paintedSet) } /**********************************************************************/ /* Further wrappers that should really be moved to other file(s). */ /**********************************************************************/ /* ARGS: ellipseCache = pointer to ellipse data cache */ void miDrawArcs_r_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache) { if (pGC->lineWidth == 0) /* use Bresenham algorithm */ miZeroPolyArc_r (paintedSet, pGC, narcs, parcs, ellipseCache); else miPolyArc_r (paintedSet, pGC, narcs, parcs, ellipseCache); } #ifndef NO_NONREENTRANT_POLYARC_SUPPORT void miDrawArcs_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs) { if (pGC->lineWidth == 0) /* use Bresenham algorithm */ miZeroPolyArc (paintedSet, pGC, narcs, parcs); else miPolyArc (paintedSet, pGC, narcs, parcs); } #endif /* not NO_NONREENTRANT_POLYARC_SUPPORT */ /* ARGS: mode = Origin or Previous */ void miDrawLines_internal (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { if (pGC->lineWidth == 0) { /* use Bresenham algorithm */ if (pGC->lineStyle == (int)MI_LINE_SOLID) miZeroLine (paintedSet, pGC, mode, npt, pPts); else miZeroDash (paintedSet, pGC, mode, npt, pPts); } else { if (pGC->lineStyle == (int)MI_LINE_SOLID) miWideLine (paintedSet, pGC, mode, npt, pPts); else miWideDash (paintedSet, pGC, mode, npt, pPts); } } void miDrawRectangles_internal (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *prectInit) { const miRectangle *pR = prectInit; miPoint rect[5]; int i; fprintf (stderr, "miDrawRectangles_internal()\n"); for (i = 0; i < nrects; i++) { rect[0].x = pR->x; rect[0].y = pR->y; rect[1].x = pR->x + (int) pR->width; rect[1].y = rect[0].y; rect[2].x = rect[1].x; rect[2].y = pR->y + (int) pR->height; rect[3].x = rect[0].x; rect[3].y = rect[2].y; /* close the polyline */ rect[4].x = rect[0].x; rect[4].y = rect[0].y; miDrawLines_internal (paintedSet, pGC, MI_COORD_MODE_ORIGIN, 5, rect); pR++; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_arc.c�����������������������������������������������������������������������0000644�0001750�0001750�00000361427�10346060063�013236� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* Authors: Keith Packard and Bob Scheifler, mid to late 1980s. Hacked by Robert S. Maier , 1998-2000. */ /* This module exports the miPolyArc() function and its reentrant counterpart miPolyArc_r. They scan-convert wide polyarcs, either solid or dashed. A polyarc is a list of arcs, which may or may not be contiguous. Here, an `arc' is an elliptic arc, i.e., a segment of an ellipse. The principal axes of the ellipse must be aligned with the coordinate axes. Each arc is drawn with a circular brush, of width equal to the line width. All pixels within the brushed area are painted. All painting goes through the low-level fillSpans() function and the MI_PAINT_SPANS() macro that it invokes, except that the miFillSppPoly() routine in mi_fplycon.c is used to paint polygonal arc caps and arc joins, if any. That routine, in turn, invokes MI_PAINT_SPANS(). */ /* Warning: this code is toxic, do not dally very long here. */ #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #include "mi_arc.h" #include "mi_fply.h" /* for miFillSppPoly() */ #include "mi_fllarc.h" /* for MIWIDEARCSETUP, MIFILLINARCSTEP etc. */ /* undefine if cbrt(), a fast cube root function for non-negative arguments, is available */ #define cbrt(x) pow((x), 1.0/3.0) /* undefine if hypot is available (it's X_OPEN, but not ANSI or POSIX) */ #define hypot(x, y) sqrt((x)*(x) + (y)*(y)) /**********************************************************************/ /* To facilitate speedy drawing of elliptic arcs, we cache scan-converted wide ellipses so that we can retrieve them later, by keying on ellipse width, ellipse height, and line width. Any such cache is an miEllipseCache object; equivalently, a lib_miEllipseCache structure, which is basically an array of (cachedEllipse *)'s. Each cachedEllipse is a record, the `value' field of which is an (miArcSpanData *), i.e. basically a list of spans, computed and returned by miComputeWideEllipse(). The currently used miEllipseCache structure is accessed via the ellipseCache argument of miPolyArc_r(). */ /* one or two spans (any rasterized ellipse contains a list of these, indexed by y) */ typedef struct { int lx, rx; /* starting points of left, right spans */ int lw, rw; /* widths of left, right spans */ } miArcSpan; /* `Value' part of each cache record, storing a rasterized ellipse. A rasterized ellipse is a list of ArcSpans, extending in order from the top of the ellipse down to and including the centerline, if present. It consists primarily of count1 single-occupied ArcSpans (containing only a single span), followed by count2 doubly-occupied ArcSpans (containing two spans). In all, the list contains (top ? 1 : 0) + count1 + count2 + (bot ? 1 : 0) ArcSpans. The x-coordinates (lx,rx) in the ArcSpans are relative to x = xorg = xorg_arc + width_arc/2, i.e. halfway across the ellipse. The count1 single-occupied ArcSpans are drawn downward (i.e. at successively increasing values of y), beginning at y = yorgu = yorg_arc + height_arc/2 - k, and also upward beginning at y = yorgl = yorg_arc + height_arc/2 + k. They are followed by the count2 doubly occupied ArcSpans. (Here k = height_arc/2 + (linewidth-1)/2, always.) If top=true (which is the case iff width_arc is even and linewidth is even), the first ArcSpan in the array is bogus, and should be replaced by a single pixel at x=xorg, y = yorgu-1. If bot=true, which is the case iff height_arc is even, then the ellipse must be completed by drawing the 2 or 1 spans contained in the final ArcSpan of the array on the vertical centerline. (rw<0 is a signal that this ArcSpan atypically contains only a single span.) `hole' is a kludge flag. If it is set, then after the count1 singly occupied ArcSpans are drawn upward, a single additional pixel must be drawn at (xorg,y), where y is the current (updated, i.e. decremented) value of y. y is not further decremented before the drawing of the count2 doubly occupied ArcSpans begins. */ typedef struct { int k; /* height/2 + (linewidth-1)/2, always */ miArcSpan *spans; /* array of up to k+2 miArcSpan structures */ bool top; /* have initial (bogus) ArcSpan? */ int count1; /* number of single-occupancy ArcSpans */ int count2; /* number of double-occupancy ArcSpans */ bool bot; /* have final (special) ArcSpan? */ bool hole; /* add a certain pixel when drawing? */ } miArcSpanData; /* Cache record type (key/value); key consists of width,height,linewidth. Also includes a timestamp. */ typedef struct { unsigned long lrustamp; /* timestamp (time of most recent retrieval) */ unsigned int width, height; /* ellipse width, height */ unsigned int lw; /* line width used when rasterizing */ miArcSpanData *spdata; /* `value' part of record */ } cachedEllipse; /* The cache of scan-converted ellipses, including continually updated timestamp. */ struct lib_miEllipseCache { cachedEllipse *ellipses; /* beginning of array of records */ int size; /* number of records in array */ cachedEllipse *lastCacheHit; /* pointer to last-accessed record */ unsigned long lrustamp; /* clock, for timestamping records */ }; /* Size of cache (i.e. number of (cachedEllipse *)'s the array contains) */ #define ELLIPSECACHE_SIZE 25 /* Maximum height an ellipse can have, for its spans to be stored in the cache. */ #define MAX_CACHEABLE_ELLIPSE_HEIGHT 1500 #ifndef NO_NONREENTRANT_POLYARC_SUPPORT /* An in-library cache, used by the non-reentrant functions miPolyArc() and miZeroPolyArc(). */ miEllipseCache *_mi_ellipseCache = (miEllipseCache *)NULL; #endif /* NO_NONREENTRANT_POLYARC_SUPPORT */ /**********************************************************************/ /* We must scan-convert poly-arcs, which consist of one or more wide elliptic arcs, which may or may not be contiguous, and which may or may not be dashed. In this, the function miComputeArcs() plays a key role. It doesn't do scan conversion. Instead, it chops an ellipse into arcs or small arcs representing dashes, determines whether joins or caps are called for, etc. What it returns is a list of miPolyArcs structures, indexed by paint type. A miPolyArcs structure comprises a list of miArcData structs, a list of joins, and a list of caps. */ /* Note that self intersecting arcs (i.e. those spanning 360 degrees) never join with other arcs, and are drawn without caps (unless on/off dashed, in which case each dash segment is capped, except when the last segment meets the first segment, when no caps are drawn). */ #define RIGHT_END 0 #define LEFT_END 1 typedef struct { int arcIndex0, arcIndex1; /* arcs to either side of the join */ int paintType0, paintType1; /* their paint types */ int end0, end1; /* either RIGHT_END or LEFT_END */ } miArcJoinStruct; typedef struct { int arcIndex; /* arc to be capped */ int end; /* either RIGHT_END or LEFT_END */ } miArcCapStruct; typedef struct { SppPoint clock; SppPoint center; SppPoint counterClock; } miArcFace; typedef struct { miArc arc; bool render; /* directive to render this arc (and all previously non-rendered ones) */ int join; /* related join */ int cap; /* related cap */ bool selfJoin; /* arc is self-joining? */ miArcFace bounds[2]; /* left face and right face (3 points each) */ double x0, y0; /* starting point (sub-pixel placement) */ double x1, y1; /* end point (sub-pixel placement) */ } miArcData; /* * The miPolyArcs struct. This is a sequence of arcs (e.g., dashes), * computed and categorized according to operation. miComputeArcs() * returns a list of these, indexed by paint type. */ typedef struct { miArcData *arcs; int narcs; int arcSize; /* number of slots allocated */ miArcCapStruct *caps; int ncaps; int capSize; /* number of slots allocated */ miArcJoinStruct *joins; int njoins; int joinSize; /* number of slots allocated */ } miPolyArcs; /**********************************************************************/ /* In a sub-module below, with public functions initAccumSpans(), newFinalSpan(), and fillSpans(), we initialize an miAccumSpans structure, add spans to it, and finally paint and deallocate them. The miAccumSpans struct includes an array, indexed by y-value, each element of which is a list of spans. The y range, i.e. the range of the index variable of the array, is expanded as needed. To facilitate rapid addition of spans to the structure, we maintain as part of the miAccumSpans structure a list of unused span structures, previously allocated in "chunks". */ struct finalSpan { int min, max; /* x values */ struct finalSpan *next; /* pointer to next span at this value of y */ }; #define SPAN_CHUNK_SIZE 128 /* spans are malloc'd in chunks of this size */ struct finalSpanChunk { struct finalSpan data[SPAN_CHUNK_SIZE]; struct finalSpanChunk *next; /* pointer to previously malloc'd chunk */ }; typedef struct { struct finalSpan **finalSpans; /* array, indexed by y - finalMiny */ int finalMiny, finalMaxy; /* y range */ int finalSize; int nspans; /* total number of spans, not just y coors */ struct finalSpanChunk *chunks; /* head of chunk list */ struct finalSpan *freeFinalSpans; /* next free span in chunk at list head */ } miAccumSpans; /**********************************************************************/ /* Structure used by a sub-module that computes arc lengths via a polygonal approximation to the arc. The sub-module's external functions are computeDashMap() and computeAngleFromPath(). */ #define DASH_MAP_SIZE 91 typedef struct { double map[DASH_MAP_SIZE]; } dashMap; /**********************************************************************/ /* internal functions that do painting of pixels */ static void fillSpans (miPaintedSet *paintedSet, miPixel pixel, miAccumSpans *accumSpans); static void miArcCap (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const miArcFace *pFace, int end, int xOrg, int yOrg, double xFtrans, double yFtrans); static void miArcJoin (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const miArcFace *pLeft, const miArcFace *pRight, int xOrgLeft, int yOrgLeft, double xFtransLeft, double yFtransLeft, int xOrgRight, int yOrgRight, double xFtransRight, double yFtransRight); static void miFillWideEllipse (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const miArc *parc, miEllipseCache *ellipseCache); static void miRoundCap (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, SppPoint pCenter, SppPoint pEnd, SppPoint pCorner, SppPoint pOtherCorner, int fLineEnd, int xOrg, int yOrg, double xFtrans, double yFtrans); /* internal functions that don't do painting of pixels */ static double angleBetween (SppPoint center, SppPoint point1, SppPoint point2); static double miDasin (double v); static double miDatan2 (double dy, double dx); static double miDcos (double a); static double miDsin (double a); static int computeAngleFromPath (int startAngle, int endAngle, const dashMap *map, int *lenp, bool backwards); static int miGetArcPts (const SppArc *parc, int cpt, SppPoint **ppPts); static miArcData * addArc (miPolyArcs *polyArcs, const miArc *xarc); static miArcSpanData * miComputeWideEllipse (unsigned int lw, const miArc *parc, bool *mustFree, miEllipseCache *ellipseCache); static miPolyArcs * miComputeArcs (const miGC *pGC, const miArc *parcs, int narcs); static void addCap (miPolyArcs *polyArcs, int end, int arcIndex); static void addJoin (miPolyArcs *polyArcs, int end0, int index0, int paintType0, int end1, int index1, int paintType1); static void computeDashMap (const miArc *arcp, dashMap *map); static void drawArc (miAccumSpans *accumSpans, const miArc *tarc, unsigned int l, int a0, int a1, miArcFace *right, miArcFace *left, miEllipseCache *ellipseCache); static void drawZeroArc (miAccumSpans *accumSpans, const miArc *tarc, unsigned int lw, miArcFace *left, miArcFace *right); static void initAccumSpans (miAccumSpans *accumSpans); static void miArcSegment (const miGC *pGC, miAccumSpans *accumSpans, miArc tarc, miArcFace *right, miArcFace *left, miEllipseCache *ellipseCache); static void miComputeCircleSpans (unsigned int lw, const miArc *parc, miArcSpanData *spdata); static void miComputeEllipseSpans (unsigned int lw, const miArc *parc, miArcSpanData *spdata); static void miFreeArcs (const miGC *pGC, miPolyArcs *arcs); static void translateBounds (miArcFace *b, int x, int y, double fx, double fy); /* * Comments on overall miPolyArc/miPolyArc_r strategy: * * If the arc is zero width and solid, we don't worry about the join style. * To scan-convert wide solid circles, we use a fast integer algorithm. To * scan-convert wide solid ellipses, we use special case floating point * code. * * The scan-conversion of wide circles and ellipse is comparatively * trivial, though the latter involves some polynomial algebra. The * greater part of the code deals with chopping circles and ellipses, * rasterized or not, into segments. This includes dashing. * * This function is the reentrant version, miPolyArc_r. The non-reentrant * version, miPolyArc, maintains its own `rasterized ellipse' cache as * static data, and simply calls this one. */ /* ARGS: ellipseCache = pointer to ellipse data cache */ void miPolyArc_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache) { int i; const miArc *parc; int width; miPixel pixel; miPolyArcs *polyArcs; int *cap, *join; int paintType; miAccumSpans accumSpans_struct; /* in-core accumulation of spans */ /* ensure we have >=1 arcs */ if (narcs <= 0) return; /* Initialize miAccumSpans structure (painted to by the low-level drawArc function). N.B. After drawArc() is repeatedly called to fill up the miAccumSpans struct with spans of a single paint type, fillSpans() is called with the desired paint type as one of its arguments. It will `paint' from the miAccumSpans struct to the miPaintedSet. */ initAccumSpans (&accumSpans_struct); pixel = pGC->pixels[1]; /* default single pixel color to use */ width = pGC->lineWidth; if (width == 0 && pGC->lineStyle == (int)MI_LINE_SOLID) /* zero-width solid arcs, only */ { for (i = narcs, parc = parcs; --i >= 0; parc++) /* Draw zero-width arc segment to the miAccumSpans struct, as a set of spans, by invoking the low-level drawArc() function. This updates the ellipse span data cache. */ miArcSegment (pGC, &accumSpans_struct, *parc, (miArcFace *)NULL, (miArcFace *)NULL, ellipseCache); /* `paint' the arc segments in the miAccumSpans struct (i.e. add them to the miPaintedSet struct), in the current pixel color */ fillSpans (paintedSet, pixel, &accumSpans_struct); } else /* nonzero width, or dashing */ { if ((pGC->lineStyle == (int)MI_LINE_SOLID) && narcs) { /* first, paint any initial complete ellipses (for speed) */ while (parcs->width && parcs->height && (parcs->angle2 >= FULLCIRCLE || parcs->angle2 <= -FULLCIRCLE)) { /* paint complete ellipse without going through the miAccumSpans struct, also update ellipse span data cache */ miFillWideEllipse (paintedSet, pixel, pGC, parcs, ellipseCache); if (--narcs == 0) return; parcs++; } } /* have one or more elliptic arcs that are incomplete ellipses (possibly dashed, possibly contiguous) to draw */ /* compute arc segments (i.e. dashes) in the incomplete ellipses, indexed by color; will need to be freed with miFreeArcs() */ polyArcs = miComputeArcs (pGC, parcs, narcs); cap = (int *) mi_xmalloc (pGC->numPixels * sizeof(int)); join = (int *) mi_xmalloc (pGC->numPixels * sizeof(int)); for (i = 0; i < pGC->numPixels; i++) cap[i] = join[i] = 0; /* iterate over colors, drawing arc segments in each color */ for (paintType = 0; paintType < pGC->numPixels; paintType++) { pixel = pGC->pixels[paintType]; for (i = 0; i < polyArcs[paintType].narcs; i++) { miArcData *arcData; /* Draw an arc segment to the miAccumSpans struct, via drawArc() */ arcData = &polyArcs[paintType].arcs[i]; miArcSegment (pGC, &accumSpans_struct, arcData->arc, &arcData->bounds[RIGHT_END], &arcData->bounds[LEFT_END], ellipseCache); if (polyArcs[paintType].arcs[i].render) { /* `paint' the arc, and any arcs previously drawn to the miAccumSpans struct but not painted, to the miPaintedSet struct, in the current pixel color */ fillSpans (paintedSet, pixel, &accumSpans_struct); /* `paint' all undrawn caps to the miPaintedSet struct */ /* test for self-joining arcs (won't be capped) */ if (polyArcs[paintType].arcs[i].selfJoin && cap[paintType] < polyArcs[paintType].arcs[i].cap) cap[paintType]++; while (cap[paintType] < polyArcs[paintType].arcs[i].cap) { int arcIndex, end; miArcData *arcData0; arcIndex = polyArcs[paintType].caps[cap[paintType]].arcIndex; end = polyArcs[paintType].caps[cap[paintType]].end; arcData0 = &polyArcs[paintType].arcs[arcIndex]; /* `paint' cap to the miPaintedSet struct by invoking miFillSppPoly() */ miArcCap (paintedSet, pixel, pGC, &arcData0->bounds[end], end, arcData0->arc.x, arcData0->arc.y, (double)(0.5 * arcData0->arc.width), (double)(0.5 * arcData0->arc.height)); ++cap[paintType]; } /* `paint' all undrawn joins to the miPaintedSet struct */ while (join[paintType] < polyArcs[paintType].arcs[i].join) { int arcIndex0, arcIndex1, end0, end1; int paintType0, paintType1; miArcData *arcData0, *arcData1; miArcJoinStruct *joinp; joinp = &polyArcs[paintType].joins[join[paintType]]; arcIndex0 = joinp->arcIndex0; end0 = joinp->end0; arcIndex1 = joinp->arcIndex1; end1 = joinp->end1; paintType0 = joinp->paintType0; paintType1 = joinp->paintType1; arcData0 = &polyArcs[paintType0].arcs[arcIndex0]; arcData1 = &polyArcs[paintType1].arcs[arcIndex1]; /* `paint' join to the miPaintedSet struct by invoking miFillSppPoly() */ miArcJoin (paintedSet, pixel, pGC, &arcData0->bounds[end0], &arcData1->bounds[end1], arcData0->arc.x, arcData0->arc.y, (double) (0.5 * arcData0->arc.width), (double) (0.5 * arcData0->arc.height), arcData1->arc.x, arcData1->arc.y, (double) (0.5 * arcData1->arc.width), (double) (0.5 * arcData1->arc.height)); ++join[paintType]; } } } } free (cap); free (join); /* free arc segments computed by miComputeArcs() */ miFreeArcs (pGC, polyArcs); } } #ifndef NO_NONREENTRANT_POLYARC_SUPPORT /* The non-reentrant version of miPolyArc, which unlike miPolyArc_r maintains its own ellipse spans cache as static (persistent) data. */ void miPolyArc (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs) { if (_mi_ellipseCache == (miEllipseCache *)NULL) _mi_ellipseCache = miNewEllipseCache (); miPolyArc_r (paintedSet, pGC, narcs, parcs, _mi_ellipseCache); } #endif /* not NO_NONREENTRANT_POLYARC_SUPPORT */ /* Initialize a cache of rasterized elliptic arcs. (A pointer to such an object is passed to miPolyArc_r.) Such a cache comprises an array of records (i.e. cachedEllipse's), a pointer to one of them (the most recently used), and a timestamp variable that is incremented when any record is cached. `Replace least recently used' is the policy. */ miEllipseCache * miNewEllipseCache (void) { int k; cachedEllipse *chead, *cent; miEllipseCache *ellipseCache; ellipseCache = (miEllipseCache *)mi_xmalloc (sizeof(miEllipseCache)); /* pointer to beginning of array of records */ ellipseCache->ellipses = (cachedEllipse *)mi_xmalloc (ELLIPSECACHE_SIZE * sizeof(cachedEllipse)); /* length of array */ ellipseCache->size = ELLIPSECACHE_SIZE; /* pointer to beginning of last-accessed record (a dummy value) */ ellipseCache->lastCacheHit = ellipseCache->ellipses; /* clock for timestamping */ ellipseCache->lrustamp = 0; /* initialize elements of each record with null/bogus values */ chead = ellipseCache->ellipses; for (k = ELLIPSECACHE_SIZE, cent = chead; --k >= 0; cent++) { cent->lrustamp = 0; cent->lw = 0; cent->width = cent->height = 0; cent->spdata = (miArcSpanData *)NULL; } return ellipseCache; } /* Free a cache of rasterized ellipses, which must previously have been allocated by invoking miNewEllipseCache. */ void miDeleteEllipseCache (miEllipseCache *ellipseCache) { int k, cache_size; cachedEllipse *chead, *cent; /* free span data in all records */ chead = ellipseCache->ellipses; cache_size = ellipseCache->size; for (k = cache_size, cent = chead; --k >= 0; cent++) { miArcSpanData *spdata; spdata = cent->spdata; if (spdata) { free (spdata->spans); free (spdata); } } /* free the record array itself */ free (chead); /* free pointer */ free (ellipseCache); } /* Draw a single arc segment to an miAccumSpans struct, via drawArc() or * drawZeroArc(). Right and left faces may be specified, for mirroring * purposes (they're usually computed by miComputeArcs()). The * accumulation of spans in the miAccumSpans struct will need to be painted * by a later invocation of fillSpans(). This function updates the ellipse * span cache. */ static void miArcSegment (const miGC *pGC, miAccumSpans *accumSpans, miArc tarc, miArcFace *right, miArcFace *left, miEllipseCache *ellipseCache) { unsigned int l = pGC->lineWidth; int a0, a1, startAngle, endAngle; miArcFace *temp; if (l == 0) /* map zero width to unit width */ l = 1; if (tarc.width == 0 || tarc.height == 0) { /* degenerate case, either horizontal or vertical arc */ drawZeroArc (accumSpans, &tarc, l, left, right); return; } a0 = tarc.angle1; a1 = tarc.angle2; if (a1 > FULLCIRCLE) a1 = FULLCIRCLE; else if (a1 < -FULLCIRCLE) a1 = -FULLCIRCLE; if (a1 < 0) { startAngle = a0 + a1; endAngle = a0; temp = right; right = left; left = temp; } else { startAngle = a0; endAngle = a0 + a1; } /* * bounds check the two angles */ if (startAngle < 0) startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE; if (startAngle >= FULLCIRCLE) startAngle = startAngle % FULLCIRCLE; if (endAngle < 0) endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE; if (endAngle > FULLCIRCLE) endAngle = (endAngle-1) % FULLCIRCLE + 1; if ((startAngle == endAngle) && a1) { startAngle = 0; endAngle = FULLCIRCLE; } /* Draw the arc to memory, as a set of spans (accumulated spans must later be painted and deallocated by invoking fillSpans()). This updates the ellipse span cache. */ drawArc (accumSpans, &tarc, l, startAngle, endAngle, right, left, ellipseCache); } /* Paint a wide, complete [i.e. undashed] ellipse, immediately. I.e., paint it to a miPaintedSet, not to an in-core miAccumSpans struct. Called by miPolyArc if angle is at least 360 degrees. Calls miComputeWideEllipse(), and updates the ellipse span cache. */ static void miFillWideEllipse (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const miArc *parc, miEllipseCache *ellipseCache) { miArcSpanData *spdata; bool mustFree; miArcSpan *arcSpan, *finalArcSpan; int xorg, yorgu, yorgl; int numArcSpans, n; int numSpans_downward, numSpans_upward, numSpans, botSpans; miPoint *pptInit, *ppt_downward, *ppt_upward; unsigned int *pwidthInit, *pwidth_downward, *pwidth_upward; /* Compute span data for whole wide ellipse, updating the ellipse cache. Return value will be a pointer to a miArcSpanData struct, which is basically an array of miArcSpan's indexed by y. A miArcSpan comprises one or two spans. */ spdata = miComputeWideEllipse (pGC->lineWidth, parc, &mustFree, ellipseCache); if (!spdata) /* unknown failure, so punt */ return; arcSpan = spdata->spans; /* first ArcSpan in array */ /* initialize upper and lower y values for span generation; note spdata->k = height/2 + (linewidth-1)/2, always */ xorg = parc->x + (int)(parc->width >> 1); yorgu = parc->y + (int)(parc->height >> 1); yorgl = yorgu + (parc->height & 1); yorgu -= spdata->k; yorgl += spdata->k; /* Add spans both from top of the ellipse (growing downward from y=yorgu) and from bottom (growing upward from y=yorgl), computed from the (top ? 1 : 0) + count1 + count2 + (bottom ? 1 : 0) ArcSpans contained in spdata->spans. Number of `downward' spans = (top ? 1 : 0) + count1 + 2*count2 + (bot ? [1or2] : 0) Number of `upward' spans = count1 + (hole ? 1 : 0) + 2*count2 Here [1or2] = (finalArcSpan->rw <= 0 ? 1 : 2), where `finalArcSpan' is the final ArcSpan in the array spdata->spans. These final 1 or 2 spans, if present, are on the horizontal centerline of the ellipse. N.B. Presumably (top ? 1 : 0) + count1 + count2 + (bottom ? 1 : 0) <= k+2, since the ArcSpans array spdata->spans can contain at most k+2 ArcSpans, as allocated (see miComputeWideEllipse()). */ numArcSpans = ((spdata->top ? 1 : 0) + spdata->count1 + spdata->count2 + (spdata->bot ? 1 : 0)); finalArcSpan = &(spdata->spans[numArcSpans - 1]); botSpans = (finalArcSpan->rw <= 0 ? 1 : 2); numSpans_downward = ((spdata->top ? 1 : 0) + spdata->count1 + 2 * spdata->count2 + (spdata->bot ? botSpans : 0)); numSpans_upward = (spdata->count1 + (spdata->hole ? 1 : 0) + 2 * spdata->count2); numSpans = numSpans_downward + numSpans_upward; /* allocate span array; will fill it from both ends, so that it will be sorted (i.e. in y-increasing order) */ pptInit = (miPoint *)mi_xmalloc (numSpans * sizeof(miPoint)); pwidthInit = (unsigned int *)mi_xmalloc (numSpans * sizeof(unsigned int)); ppt_downward = pptInit; pwidth_downward = pwidthInit; ppt_upward = pptInit + (numSpans - 1); pwidth_upward = pwidthInit + (numSpans - 1); if (spdata->top) /* true if width is even and lw is even */ /* begin with a special `top point' at y=yorgu-1, rather than at y=yorgu; skip first ArcSpan (it may be bogus) */ { ppt_downward->x = xorg; ppt_downward->y = yorgu - 1; ppt_downward++; *pwidth_downward++ = 1; arcSpan++; } for (n = spdata->count1; --n >= 0; ) /* Add successive pairs of spans, one upper [beginning at y=yorgu], one lower [beginning at y=yorgl]. Each pair is taken from one of the next count1 ArcSpans in spdata; these ArcSpans are singly occupied. */ { ppt_downward->x = xorg + arcSpan->lx; ppt_downward->y = yorgu; *pwidth_downward = arcSpan->lw; ppt_downward++; pwidth_downward++; ppt_upward->x = xorg + arcSpan->lx; ppt_upward->y = yorgl; *pwidth_upward = arcSpan->lw; ppt_upward--; pwidth_upward--; yorgu++; yorgl--; arcSpan++; } if (spdata->hole) /* Kludge: add a single additional lower point, at x=xorg, y=yorgl (now decremented), i.e. on the vertical center line. Do not decrement yorgl further, i.e. do not move upward. (So this extra point will fit between the two spans of the next `upward' ArcSpan to be drawn.) */ { ppt_upward->x = xorg; ppt_upward->y = yorgl; *pwidth_upward = 1; ppt_upward--; pwidth_upward--; } for (n = spdata->count2; --n >= 0; ) /* add four spans, two above, two below (each quad taken from one of the next count2 ArcSpans in spdata; these ArcSpans are doubly occupied, containing both a left and a right span) */ { /* left downward span */ ppt_downward->x = xorg + arcSpan->lx; ppt_downward->y = yorgu; *pwidth_downward = arcSpan->lw; ppt_downward++; pwidth_downward++; /* right downward span */ ppt_downward->x = xorg + arcSpan->rx; ppt_downward->y = yorgu; *pwidth_downward = arcSpan->rw; ppt_downward++; pwidth_downward++; /* left upward span */ ppt_upward->x = xorg + arcSpan->lx; ppt_upward->y = yorgl; *pwidth_upward = arcSpan->lw; ppt_upward--; pwidth_upward--; /* right upward span */ ppt_upward->x = xorg + arcSpan->rx; ppt_upward->y = yorgl; *pwidth_upward = arcSpan->rw; ppt_upward--; pwidth_upward--; yorgu++; yorgl--; arcSpan++; } if (spdata->bot) /* true if height is even */ /* To complete the ellipse, add 1 or 2 additional `upper' spans, at y=yorgu (incremented, i.e. it is now at the horizontal center line, which is at y = yorg_arc + height_arc/2). The number of spans will be 2 rather than 1, unless the ellipse is not hollow. */ { ppt_downward->x = xorg + arcSpan->lx; ppt_downward->y = yorgu; *pwidth_downward = arcSpan->lw; ppt_downward++; pwidth_downward++; if (arcSpan->rw > 0) /* have a second span too */ { ppt_downward->x = xorg + arcSpan->rx; ppt_downward->y = yorgu; *pwidth_downward = arcSpan->rw; ppt_downward++; pwidth_downward++; } } if (mustFree) /* free the ArcSpans */ { free (spdata->spans); free (spdata); } MI_PAINT_SPANS(paintedSet, pixel, numSpans, pptInit, pwidthInit) } /* Compute the spans that make up a wide complete ellipse, this way: (1) search the cache of rasterized ellipses; if no success, (2) scan-convert the ellipse, and place the spans in the cache for later retrieval, in case another ellipse of the same size and width needs to be drawn. Return value will be a pointer to a miArcSpanData struct, which is basically an array of miArcSpan's indexed by y. A miArcSpan comprises lx, lwidth, rx, rwidth, i.e., a pair of spans at a given y. `mustFree' will be set to true if the miArcSpanData struct is a one-shot creation, not stored in the cache. (This is the case if the ellipse is too large to be stored in the cache -- a policy issue.) Called by the low-level draw-to-memory function drawArc(), and also by miFillWideEllipse(), which paints an entire wide ellipse. This function calls either miComputeEllipseSpans() or miComputeCircleSpans() to do the actual computation of spans, i.e. to do scan conversion. */ static miArcSpanData * miComputeWideEllipse (unsigned int lw, const miArc *parc, bool *mustFree, miEllipseCache *ellipseCache) { miArcSpanData *spdata; cachedEllipse *cent, *lruent; int k, cache_size; cachedEllipse fakeent; /* map zero line width to width unity */ if (lw == 0) lw = 1; /* first, attempt to retrieve span data from cache */ if (parc->height <= MAX_CACHEABLE_ELLIPSE_HEIGHT) { *mustFree = false; cent = ellipseCache->lastCacheHit; if (cent->lw == lw && cent->width == parc->width && cent->height == parc->height) /* last hit is still valid; won't need to search */ { /* hit again; do timestamp, bumping time */ cent->lrustamp = ++(ellipseCache->lrustamp); return cent->spdata; } /* search cache (an array), beginning at 0'th element */ lruent = ellipseCache->ellipses; cache_size = ellipseCache->size; for (k = cache_size, cent = lruent; --k >= 0; cent++) { /* key on width, height, linewidth */ if (cent->lw == lw && cent->width == parc->width && cent->height == parc->height) /* already in cache: a hit */ { /* do timestamp, bumping time */ cent->lrustamp = ++(ellipseCache->lrustamp); ellipseCache->lastCacheHit = cent; return cent->spdata; } /* keep track of least recently used record */ if (cent->lrustamp < lruent->lrustamp) lruent = cent; } } else /* height is huge, ellipse wouldn't be stored in cache */ { lruent = &fakeent; /* _very_ fake; automatic variable */ lruent->spdata = (miArcSpanData *)NULL; *mustFree = true; } /* data not found in cache, so boot least-recently used record out of cache, make new one; unless ellipse is too large, that is */ spdata = lruent->spdata; /* will allocate space for k+2 spans */ k = (int)(parc->height >> 1) + (int)((lw - 1) >> 1); if (spdata == (miArcSpanData *)NULL || spdata->k != k) { if (spdata) { free (spdata->spans); free (spdata); } spdata = (miArcSpanData *)mi_xmalloc (sizeof(miArcSpanData)); spdata->spans = (miArcSpan *)mi_xmalloc ((k + 2) * sizeof (miArcSpan)); spdata->k = k; /* k+2 is size of empty span array */ lruent->spdata = spdata; } lruent->lrustamp = ++(ellipseCache->lrustamp); /* set timestamp, bump clock */ lruent->lw = lw; lruent->width = parc->width; lruent->height = parc->height; if (lruent != &fakeent) /* non-huge ellipse; store in cache */ ellipseCache->lastCacheHit = lruent; /* compute spans, place them in the new cache record */ if (parc->width == parc->height) miComputeCircleSpans (lw, parc, spdata); else miComputeEllipseSpans (lw, parc, spdata); return spdata; } /* Compute the spans that make up a complete wide circle, via a fast integer algorithm. On entry, lw>=1, and `spdata' is a pointer to an miArcSpanData struct, which is a slot in a record in the ellipse span cache. It includes spdata->spans, an array of k+2 ArcSpans, which will be filled in. Here k=height/2 + (lw-1)/2. */ static void miComputeCircleSpans (unsigned int lw, const miArc *parc, miArcSpanData *spdata) { miArcSpan *span; int doinner; int x, y, e; int xk, yk, xm, ym, dx, dy; int slw, inslw; int inx = 0, iny, ine = 0; int inxk = 0, inyk = 0, inxm = 0, inym = 0; /* compute flags */ /* top=true iff ellipse width is even and line width is even */ spdata->top = !(lw & 1) && !(parc->width & 1) ? true : false; /* bot=true iff ellipse height is even, so there will be an _odd_ number of spans, from top to bottom */ spdata->bot = !(parc->height & 1) ? true : false; doinner = -(int)lw; slw = (int)parc->width - doinner; y = (int)(parc->height >> 1); dy = parc->height & 1; /* dy=1 if height is odd */ dx = 1 - dy; /* dx=1 if height is even */ MIWIDEARCSETUP(x, y, dy, slw, e, xk, xm, yk, ym); inslw = (int)parc->width + doinner; if (inslw > 0) { /* if top=true, will need to add an extra pixel (not included in the generated list of ArcSpans) in the `hole'; this is a kludge */ spdata->hole = spdata->top; MIWIDEARCSETUP(inx, iny, dy, inslw, ine, inxk, inxm, inyk, inym); } else { spdata->hole = false; doinner = -y; } /* Generate the ArcSpans at successive values of y, beginning at the top of the circle and extending down to its horizontal bisector. Also, fill in the count1/count2/top/bottom elements of the miArcSpanData struct pointed to by spdata. There will be (top ? 1 : 0) + count1 + count2 + (bottom ? 1 : 0) ArcSpans in all. The first ones [(top ? 1 : 0) + count1 in number] will be single-occupied, i.e., they will include only one span. The latter ones [count2 + (bottom ? 1 : 0) in number] will be doubly-occupied, i.e., they will include two spans. For the special role of the very first and very last ArcSpans in the list, to fix which the `top' and `bottom' kludge flags were introduced, see following comments. */ /* If top=true, first ArcSpan generated by the following `while' loop will be bogus, and will need to be replaced, when drawing, by a single point. So decrement count1 to compensate. */ spdata->count1 = -doinner - (spdata->top ? 1 : 0); spdata->count2 = y + doinner; span = spdata->spans; /* initial value of y is (width+lw)/2 + (1 if height is even) */ while (y) { MIFILLARCSTEP(x, y, e, xk, xm, yk, ym, dx, slw); /* y-- */ span->lx = dy - x; if (++doinner <= 0) { span->lw = slw; span->rx = 0; span->rw = span->lx + slw; } else { MIFILLINARCSTEP(inx, iny, ine, inxk, inxm, inyk, inym, dx, inslw); span->lw = x - inx; span->rx = dy - inx + inslw; span->rw = inx - x + slw - inslw; } span++; } if (spdata->bot) /* last-generated ArcSpan, on the horizontal center line, is special, so modify it and decrement count2 (or count1) to compensate */ { if (spdata->count2 > 0) spdata->count2--; else /* no two-span ArcSpans at all; ellipse isn't hollow */ { if (lw > parc->height) span[-1].rx = span[-1].rw = -(((int)lw - (int)parc->height) >> 1); else span[-1].rw = 0; spdata->count1--; } } } /* The following mathematics is the background for the algorithm used in miComputeEllipseSpans() below, which scan-converts a wide ellipse. The following three equations combine to describe the boundaries of a wide ellipse, if it is drawn with a circular brush. x^2/w^2 + y^2/h^2 = 1 ellipse itself (X-x)^2 + (Y-y)^2 = r^2 circle at (x, y) on the ellipse (Y-y) = (X-x)*w^2*y/(h^2*x) normal at (x, y) on the ellipse These lead to a quartic relating Y and y y^4 - (2Y)y^3 + (Y^2 + (h^4 - w^2*r^2)/(w^2 - h^2))y^2 - (2Y*h^4/(w^2 - h^2))y + (Y^2*h^4)/(w^2 - h^2) = 0 The reducible cubic obtained from this quartic is z^3 - (3N)z^2 - 2V = 0 where N = (Y^2 + (h^4 - w^2*r^2/(w^2 - h^2)))/6 V = w^2*r^2*Y^2*h^4/(4 *(w^2 - h^2)^2) Let t = z - N p = -N^2 q = -N^3 - V Then we get t^3 + 3pt + 2q = 0 The discriminant of this cubic is D = q^2 + p^3 When D > 0, a real root is obtained as z = N + cbrt(-q+sqrt(D)) + cbrt(-q-sqrt(D)) When D < 0, a real root is obtained as z = N - 2m*cos(acos(-q/m^3)/3) where m = sqrt(|p|) * sign(q) Given a real root Z of the cubic, the roots of the quartic are the roots of the two quadratics y^2 + ((b+A)/2)y + (Z + (bZ - d)/A) = 0 where A = +/- sqrt(8Z + b^2 - 4c) b, c, d are the cubic, quadratic, and linear coefficients of the quartic Some experimentation is then required to determine which solutions correspond to the inner and outer boundaries of the wide ellipse. */ /* Compute the spans that make up a complete wide ellipse, via a floating point algorithm motivated by the above math. On entry, lw>=1, and `spdata' is a pointer to an miArcSpanData struct, which is a slot in a record in the ellipse span cache. It includes spdata->spans, an array of k+2 ArcSpans, which will be filled in. Here k=height/2 + (lw-1)/2. */ static void miComputeEllipseSpans (unsigned int lw, const miArc *parc, miArcSpanData *spdata) { miArcSpan *span; double w, h, r, xorg; double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs; double A, T, b, d, x, y, t, inx, outx = 0, hepp, hepm; int flip; bool solution; /* compute flags */ /* top=true iff ellipse width is even and line width is even */ spdata->top = !(lw & 1) && !(parc->width & 1) ? true : false; /* bot=true iff ellipse height is even, so there will be an _odd_ number of spans, from top to bottom */ spdata->bot = !(parc->height & 1) ? true : false; /* a kludge */ spdata->hole = ((spdata->top && parc->height * lw <= parc->width * parc->width && lw < parc->height) ? true : false); w = 0.5 * parc->width; h = 0.5 * parc->height; r = 0.5 * lw; rs = r * r; Hs = h * h; WH = w * w - Hs; Nk = w * r; Vk = (Nk * Hs) / (WH + WH); Hf = Hs * Hs; Nk = (Hf - Nk * Nk) / WH; Fk = Hf / WH; hepp = h + EPSILON; hepm = h - EPSILON; K = h + ((lw - 1) >> 1); if (parc->width & 1) xorg = .5; else xorg = 0.0; spdata->count1 = 0; spdata->count2 = 0; /* Generate list of spans, going downward from top of ellipse, i.e. more or less at y = yorgu = yorg_arc + height_arc/2 - k. Most of these will be mirrored, going upward from the bottom of the ellipse, starting at y = yorgu = yorg_arc + height_arc/2 + k. */ span = spdata->spans; if (spdata->top) /* top=true if ellipse width is even and line width is even; if so, begin with a special (non-mirrored) ArcSpan containing a single `top point', at y=yorgu-1 */ { span->lx = 0; span->lw = 1; span++; } /* generate count1 + count2 ArcSpans, at y=yorgu, y=yorgu+1,...; count1 one-span ArcSpans come first, then count2 two-span ArcSpans */ for (; K > 0.0; K -= 1.0) { N = (K * K + Nk) / 6.0; Nc = N * N * N; Vr = Vk * K; t = Nc + Vr * Vr; d = Nc + t; if (d < 0.0) { d = Nc; b = N; if ( (b < 0.0) == (t < 0.0) ) { b = -b; d = -d; } Z = N - 2.0 * b * cos(acos(-t / d) / 3.0); if ( (Z < 0.0) == (Vr < 0.0) ) flip = 2; else flip = 1; } else { d = Vr * sqrt(d); Z = N + cbrt(t + d) + cbrt(t - d); flip = 0; } A = sqrt((Z + Z) - Nk); T = (Fk - Z) * K / A; inx = 0.0; solution = false; b = -A + K; d = b * b - 4 * (Z + T); if (d >= 0) { d = sqrt(d); y = 0.5 * (b + d); if ((y >= 0.0) && (y < hepp)) { solution = true; if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; t = sqrt(rs - (t * t)); if (flip == 2) inx = x - t; else outx = x + t; } } b = A + K; d = b * b - 4 * (Z - T); /* Because of the large magnitudes involved, we lose enough precision * that sometimes we end up with a negative value near the axis, when * it should be positive. This is a workaround. */ if (d < 0 && !solution) d = 0.0; if (d >= 0) { d = sqrt(d); y = 0.5 * (b + d); if (y < hepp) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; inx = x - sqrt(rs - (t * t)); } y = 0.5 * (b - d); if (y >= 0.0) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; t = sqrt(rs - (t * t)); if (flip == 1) inx = x - t; else outx = x + t; } } span->lx = ICEIL(xorg - outx); if (inx <= 0.0) { /* a one-span ArcSpan (they come first) */ spdata->count1++; span->lw = ICEIL(xorg + outx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = -ICEIL(xorg - inx); } else { /* a two-span ArcSpan (they come second) */ spdata->count2++; span->lw = ICEIL(xorg - inx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = ICEIL(xorg + outx) - span->rx; } span++; } if (spdata->bot) /* bot=true if ellipse height is even; if so, complete the ellipse by adding a final ArcSpan at the horizontal center line, containing either two spans or one span (if the ellipse isn't hollow) */ { outx = w + r; if (r >= h && r <= w) inx = 0.0; else if (Nk < 0.0 && -Nk < Hs) { inx = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk); if (inx > w - r) inx = w - r; } else inx = w - r; span->lx = ICEIL(xorg - outx); if (inx <= 0.0) { span->lw = ICEIL(xorg + outx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = -ICEIL(xorg - inx); } else { span->lw = ICEIL(xorg - inx) - span->lx; span->rx = ICEIL(xorg + inx); span->rw = ICEIL(xorg + outx) - span->rx; } } if (spdata->hole) /* convert the final one-span ArcSpan to the initial two-span ArcSpan, so that there will be a one-pixel `hole' to be filled */ { span = &spdata->spans[spdata->count1]; span->lw = -span->lx; span->rx = 1; span->rw = span->lw; spdata->count1--; spdata->count2++; } } /**********************************************************************/ /* miComputeArcs() and miFreeArcs(), called by miPolyArc(). */ /**********************************************************************/ /* Compute arc segments, caps, and joins in a polyarc, taking account of dashing. Return value is a list of miPolyArcs structs, indexed by pixel paint type, which will need to be freed with miFreeArcs(). If dashing, sub-pixel placement of arc segment endpoints will normally occur. */ static miPolyArcs * miComputeArcs (const miGC *pGC, const miArc *parcs, int narcs) { bool isDashed, isDoubleDash; miPolyArcs *arcs; int i, start, k, nextk; miArcData *data; int numPixels; int paintType, paintTypeStart, prevPaintType; int dashNum, dashIndex, dashRemaining; int dashNumStart, dashIndexStart, dashRemainingStart; isDashed = (pGC->lineStyle == (int)MI_LINE_SOLID ? false : true); isDoubleDash = (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH ? true : false); numPixels = pGC->numPixels; /* allocate and initialize list of miPolyArcs that will be returned */ arcs = (miPolyArcs *) mi_xmalloc (numPixels * sizeof(miPolyArcs)); for (paintType = 0; paintType < numPixels; paintType++) { arcs[paintType].arcs = (miArcData *)NULL; arcs[paintType].narcs = 0; arcs[paintType].arcSize = 0; /* slots allocated */ arcs[paintType].caps = (miArcCapStruct *)NULL; arcs[paintType].ncaps = 0; arcs[paintType].capSize = 0; /* slots allocated */ arcs[paintType].joins = (miArcJoinStruct *)NULL; arcs[paintType].njoins = 0; arcs[paintType].joinSize = 0; /* slots allocated */ } /* allocate and fill temporary struct with starting point, ending point, self-join status of each elliptic arc */ #define todeg(xAngle) (((double) (xAngle)) / 64.0) data = (miArcData *) mi_xmalloc (narcs * sizeof (miArcData)); for (i = 0; i < narcs; i++) { double a0, a1; int angle2; a0 = todeg (parcs[i].angle1); angle2 = parcs[i].angle2; if (angle2 > FULLCIRCLE) angle2 = FULLCIRCLE; else if (angle2 < -FULLCIRCLE) angle2 = -FULLCIRCLE; data[i].selfJoin = ((angle2 == FULLCIRCLE) || (angle2 == -FULLCIRCLE) ? true : false); a1 = todeg (parcs[i].angle1 + angle2); data[i].x0 = parcs[i].x + (double) parcs[i].width / 2*(1 + miDcos (a0)); data[i].y0 = parcs[i].y + (double) parcs[i].height / 2*(1 - miDsin (a0)); data[i].x1 = parcs[i].x + (double) parcs[i].width / 2*(1 + miDcos (a1)); data[i].y1 = parcs[i].y + (double) parcs[i].height / 2*(1 - miDsin (a1)); } /* initialize paint type and dashing state (latter is not used in `solid' case) */ paintType = 1; dashNum = 0; dashIndex = 0; dashRemaining = 0; if (isDashed) /* take offsetting into account */ { int dashOffset = 0; /* alter paint type (for first dash) and dashing state */ miStepDash (pGC->dashOffset, &dashNum, &dashIndex, pGC->dash, pGC->numInDashList, &dashOffset); paintType = (dashNum & 1) ? 0 : 1 + ((dashNum / 2) % (numPixels - 1)); dashRemaining = (int)(pGC->dash[dashIndex]) - dashOffset; } /* save paint type and dashing state (will reset at each unjoined arc) */ paintTypeStart = paintType; dashNumStart = dashNum; dashIndexStart = dashIndex; dashRemainingStart = dashRemaining; /* iterate backward over arcs; determine whether cap will be required after each arc, and stop when first such is seen */ for (i = narcs - 1; i >= 0; i--) { int j; j = i + 1; if (j == narcs) j = 0; if (data[i].selfJoin || i == j || (UNEQUAL (data[i].x1, data[j].x0) || UNEQUAL (data[i].y1, data[j].y0))) { /* if starting in `on' phase, add a cap at right end */ if (paintType != 0 || isDoubleDash) addCap (&arcs[paintType], RIGHT_END, 0); break; } } /* iterate forward over all successive pairs of arcs (wrap if necessary) */ start = i + 1; if (start == narcs) start = 0; i = start; k = nextk = 0; /* keep compiler happy by initting prevPaintType too; actually unnecessary because first thing drawn won't be a join */ prevPaintType = paintType; for (;;) { int j, nexti; miArcData *arc; bool arcsJoin; j = i + 1; if (j == narcs) j = 0; nexti = i + 1; if (nexti == narcs) nexti = 0; if (isDashed) { int startAngle, spanAngle, endAngle; int dashAngle, prevDashAngle; bool backwards, selfJoin; dashMap map; miArc xarc; /* * precompute an approximation map for use in dashing */ computeDashMap (&parcs[i], &map); /* * compute each individual dash segment using the path * length function */ startAngle = parcs[i].angle1; spanAngle = parcs[i].angle2; if (spanAngle > FULLCIRCLE) spanAngle = FULLCIRCLE; else if (spanAngle < -FULLCIRCLE) spanAngle = -FULLCIRCLE; if (startAngle < 0) startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE; if (startAngle >= FULLCIRCLE) startAngle = startAngle % FULLCIRCLE; endAngle = startAngle + spanAngle; backwards = (spanAngle < 0 ? true : false); dashAngle = startAngle; selfJoin = (data[i].selfJoin && (paintType != 0 || isDoubleDash) ? true : false); /* * add dashed arcs to each bucket */ arc = (miArcData *)NULL; while (dashAngle != endAngle) { prevDashAngle = dashAngle; dashAngle = computeAngleFromPath (prevDashAngle, endAngle, &map, &dashRemaining, backwards); /* avoid troubles with huge arcs and small dashes */ if (dashAngle == prevDashAngle) { if (backwards) dashAngle--; else dashAngle++; } if (paintType != 0 || isDoubleDash) { xarc = parcs[i]; spanAngle = prevDashAngle; if (spanAngle < 0) spanAngle = FULLCIRCLE - (-spanAngle) % FULLCIRCLE; if (spanAngle >= FULLCIRCLE) spanAngle = spanAngle % FULLCIRCLE; xarc.angle1 = spanAngle; spanAngle = dashAngle - prevDashAngle; if (backwards) { if (dashAngle > prevDashAngle) spanAngle = - FULLCIRCLE + spanAngle; } else { if (dashAngle < prevDashAngle) spanAngle = FULLCIRCLE + spanAngle; } if (spanAngle > FULLCIRCLE) spanAngle = FULLCIRCLE; if (spanAngle < -FULLCIRCLE) spanAngle = -FULLCIRCLE; xarc.angle2 = spanAngle; arc = addArc (&arcs[paintType], &xarc); /* * cap each end of an on/off dash */ if (!isDoubleDash) { if (prevDashAngle != startAngle) addCap (&arcs[paintType], RIGHT_END, arc - arcs[paintType].arcs); if (dashAngle != endAngle) addCap (&arcs[paintType], LEFT_END, arc - arcs[paintType].arcs); } arc->cap = arcs[paintType].ncaps; arc->join = arcs[paintType].njoins; arc->render = false; arc->selfJoin = false; if (dashAngle == endAngle) arc->selfJoin = selfJoin; } prevPaintType = paintType; if (dashRemaining <= 0) /* on to next dash (negative means overshoot due to rounding; positive means undershoot due to rounding, in which case we don't bump dashNum or dashIndex, or toggle the dash phase: next dash will have same paint type */ { dashNum++; dashIndex++; if (dashIndex == pGC->numInDashList) /* wrap */ dashIndex = 0; /* recompute paintType, dashRemaining for next dash */ paintType = (dashNum & 1) ? 0 : 1 + ((dashNum / 2) % (numPixels - 1)); dashRemaining = (int)(pGC->dash[dashIndex]); } } /* * make sure a place exists for the position data if * we drew (i.e. didn't draw) a zero-length arc */ if (startAngle == endAngle) /* zero-length */ { prevPaintType = paintType; if (isDoubleDash == false && paintType == 0) /* use color of most recent `on' dash */ { if (dashNum == 0) prevPaintType = numPixels - 1; else /* can use infix % operator */ prevPaintType = ((dashNum - 1) & 1) ? 0 : 1 + (((dashNum - 1)/ 2) % (numPixels - 1)); } arc = addArc (&arcs[prevPaintType], &parcs[i]); arc->join = arcs[prevPaintType].njoins; arc->cap = arcs[prevPaintType].ncaps; arc->selfJoin = data[i].selfJoin; } } else /* not dashing; just add whole (solid) arc */ { arc = addArc (&arcs[paintType], &parcs[i]); arc->join = arcs[paintType].njoins; arc->cap = arcs[paintType].ncaps; arc->selfJoin = data[i].selfJoin; prevPaintType = paintType; } if (prevPaintType != 0 || isDoubleDash) k = arcs[prevPaintType].narcs - 1; if (paintType != 0 || isDoubleDash) nextk = arcs[paintType].narcs; if (nexti == start) { nextk = 0; if (isDashed) /* re-initialize paint type and dashing state */ { paintType = paintTypeStart; dashNum = dashNumStart; dashIndex = dashIndexStart; dashRemaining = dashRemainingStart; } } /* does the successive pair of arcs join? */ arcsJoin = (narcs > 1 && i != j && ISEQUAL (data[i].x1, data[j].x0) && ISEQUAL (data[i].y1, data[j].y0) && data[i].selfJoin == false && data[j].selfJoin == false) ? true : false; if (arc != (miArcData *)NULL) { if (arcsJoin) arc->render = false; else /* no join; so add directive to render first arc */ arc->render = true; } if (arcsJoin && (prevPaintType != 0 || isDoubleDash) && (paintType != 0 || isDoubleDash)) /* arcs join, and both are `on' */ { int joinPaintType; joinPaintType = paintType; if (isDoubleDash) { if (nexti == start) joinPaintType = paintTypeStart; /* if join is right at the dash and there are two colors to choose from, draw join in a foreground color */ if (joinPaintType == 0) { if (prevPaintType != 0) joinPaintType = prevPaintType; else /* shouldn't happen; just use next dash's color */ joinPaintType = ((dashNum + 1) & 1) ? 0 : 1 + (((dashNum + 1)/ 2) % (numPixels - 1)); } } if (joinPaintType != 0 || isDoubleDash) { addJoin (&arcs[joinPaintType], LEFT_END, k, prevPaintType, RIGHT_END, nextk, paintType); arc->join = arcs[prevPaintType].njoins; } } else /* arcs don't join (or if they do, at least one is `off') */ { /* * cap the left end of this arc * unless it joins itself */ if ((prevPaintType != 0 || isDoubleDash) && arc->selfJoin == false) { addCap (&arcs[prevPaintType], LEFT_END, k); arc->cap = arcs[prevPaintType].ncaps; } if (isDashed && arcsJoin == false) /* re-initialize paint type and dashing state */ { paintType = paintTypeStart; dashNum = dashNumStart; dashIndex = dashIndexStart; dashRemaining = dashRemainingStart; } nextk = arcs[paintType].narcs; if (nexti == start) { nextk = 0; /* re-initialize paint type and dashing state */ paintType = paintTypeStart; dashNum = dashNumStart; dashIndex = dashIndexStart; dashRemaining = dashRemainingStart; } /* * cap the right end of the next arc. If the * next arc is actually the first arc, only * cap it if it joins with this arc. This * case will occur when the final dash segment * of an on/off dash is off. Of course, this * cap will be drawn at a strange time, but that * hardly matters... */ if ((paintType != 0 || isDoubleDash) && (nexti != start || (arcsJoin && isDashed))) addCap (&arcs[paintType], RIGHT_END, nextk); } i = nexti; if (i == start) /* have now iterated over all successive pairs (cyclically) */ break; } /* make sure the last arc if any (i.e. miArcData struct) in each paint-type-specific miPolyArcs struct includes a `render' directive */ for (paintType = 0; paintType < numPixels; paintType++) if (arcs[paintType].narcs > 0) { arcs[paintType].arcs[arcs[paintType].narcs-1].render = true; arcs[paintType].arcs[arcs[paintType].narcs-1].join = arcs[paintType].njoins; arcs[paintType].arcs[arcs[paintType].narcs-1].cap = arcs[paintType].ncaps; } free (data); /* return the array of paint-type-specific miPolyArcs structs */ return arcs; } /* Free a list of arc segments (i.e. dashes) for an incomplete ellipse, indexed by pixel paint type, that was computed by miComputeArcs(). */ static void miFreeArcs(const miGC *pGC, miPolyArcs *arcs) { int paintType; for (paintType = 0; paintType < pGC->numPixels; paintType++) { if (arcs[paintType].narcs > 0) free (arcs[paintType].arcs); if (arcs[paintType].njoins > 0) free (arcs[paintType].joins); if (arcs[paintType].ncaps > 0) free (arcs[paintType].caps); } free (arcs); } /**********************************************************************/ /* addCap(), addJoin(), addArc(). These three helper functions are used by miComputeArcs(). */ /**********************************************************************/ #define ADD_REALLOC_STEP 20 /* helper function called by miComputeArcs(); add a cap to the array of miArcCapStructs in a miPolyArcs struct */ static void addCap (miPolyArcs *polyArcs, int end, int arcIndex) { miArcCapStruct *cap; if (polyArcs->ncaps == polyArcs->capSize) /* expand array */ { int newsize = polyArcs->capSize + ADD_REALLOC_STEP; miArcCapStruct *newcaps; newcaps = (miArcCapStruct *) mi_xrealloc (polyArcs->caps, newsize * sizeof(miArcCapStruct)); polyArcs->caps = newcaps; polyArcs->capSize = newsize; } cap = &(polyArcs->caps[polyArcs->ncaps]); cap->end = end; cap->arcIndex = arcIndex; ++(polyArcs->ncaps); } /* helper function called by miComputeArcs(); add a join to the array of miArcJoinStructs in a miPolyArcs struct */ static void addJoin (miPolyArcs *polyArcs, int end0, int index0, int paintType0, int end1, int index1, int paintType1) { miArcJoinStruct *join; if (polyArcs->njoins == polyArcs->joinSize) /* expand array */ { int newsize = polyArcs->joinSize + ADD_REALLOC_STEP; miArcJoinStruct *newjoins; newjoins = (miArcJoinStruct *) mi_xrealloc (polyArcs->joins, newsize * sizeof(miArcJoinStruct)); polyArcs->joins = newjoins; polyArcs->joinSize = newsize; } join = &(polyArcs->joins[polyArcs->njoins]); join->end0 = end0; join->arcIndex0 = index0; join->paintType0 = paintType0; join->end1 = end1; join->arcIndex1 = index1; join->paintType1 = paintType1; ++(polyArcs->njoins); } /* helper function called by miComputeArcs(); add a arc (i.e. an miArc) to the array of miArcData structs in a miPolyArcs struct, and return a pointer to the new miArcData struct */ static miArcData * addArc (miPolyArcs *polyArcs, const miArc *xarc) { miArcData *arc; if (polyArcs->narcs == polyArcs->arcSize) /* expand array */ { int newsize = polyArcs->arcSize + ADD_REALLOC_STEP; miArcData *newarcs; newarcs = (miArcData *) mi_xrealloc (polyArcs->arcs, newsize * sizeof(miArcData)); polyArcs->arcs = newarcs; polyArcs->arcSize = newsize; } arc = &(polyArcs->arcs[polyArcs->narcs]); arc->arc = *xarc; ++(polyArcs->narcs); return arc; } /**********************************************************************/ /* miArcJoin() and miArcCap(). These two low-level functions are called by miPolyArc(). They draw joins and caps by calling miFillSppPoly(), which calls the low-level paint function. */ /**********************************************************************/ /* Draw a join between two contiguous arcs, by calling miFillSppPoly(). */ static void miArcJoin (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const miArcFace *pLeft, const miArcFace *pRight, int xOrgLeft, int yOrgLeft, double xFtransLeft, double yFtransLeft, int xOrgRight, int yOrgRight, double xFtransRight, double yFtransRight) { SppPoint center, corner, otherCorner; SppPoint poly[5]; SppPoint *pArcPts; int cpt; SppArc arc; miArcFace Right, Left; int polyLen = 0; int xOrg, yOrg; double xFtrans, yFtrans; double a; double width; double halftheta; xOrg = (xOrgRight + xOrgLeft) / 2; yOrg = (yOrgRight + yOrgLeft) / 2; xFtrans = (xFtransLeft + xFtransRight) / 2; yFtrans = (yFtransLeft + yFtransRight) / 2; Right = *pRight; translateBounds (&Right, xOrg - xOrgRight, yOrg - yOrgRight, xFtrans - xFtransRight, yFtrans - yFtransRight); Left = *pLeft; translateBounds (&Left, xOrg - xOrgLeft, yOrg - yOrgLeft, xFtrans - xFtransLeft, yFtrans - yFtransLeft); pRight = &Right; pLeft = &Left; if (pRight->clock.x == pLeft->counterClock.x && pRight->clock.y == pLeft->counterClock.y) return; /* determine corners of cap */ center = pRight->center; if (0 <= (a = angleBetween (center, pRight->clock, pLeft->counterClock)) && a <= 180.0) { corner = pRight->clock; otherCorner = pLeft->counterClock; } else /* interchange to make a <= 180, we hope */ { a = angleBetween (center, pLeft->clock, pRight->counterClock); corner = pLeft->clock; otherCorner = pRight->counterClock; } width = (pGC->lineWidth ? pGC->lineWidth : 1); switch (pGC->joinStyle) { case MI_JOIN_MITER: default: /* miter only if MITERLIMIT * sin(theta/2) >= 1.0, where theta = 180-a is the join angle */ if ((halftheta = 0.5 * (180.0 - a)) > 0.0 && miDsin (halftheta) * pGC->miterLimit >= 1.0) /* miter limit not exceeded */ { double ae, ac2, ec2, bc2, de; SppPoint e; /* miter, i.e. add quadrilateral */ poly[0] = corner; poly[1] = center; poly[2] = otherCorner; bc2 = ((corner.x - otherCorner.x) * (corner.x - otherCorner.x) + (corner.y - otherCorner.y) * (corner.y - otherCorner.y)); ec2 = 0.25 * bc2; ac2 = ((corner.x - center.x) * (corner.x - center.x) + (corner.y - center.y) * (corner.y - center.y)); ae = sqrt (ac2 - ec2); de = ec2 / ae; e.x = 0.5 * (corner.x + otherCorner.x); e.y = 0.5 * (corner.y + otherCorner.y); poly[3].x = e.x + de * (e.x - center.x) / ae; poly[3].y = e.y + de * (e.y - center.y) / ae; poly[4] = corner; polyLen = 5; } else /* miter limit exceeded */ { /* bevel, i.e. add triangle */ poly[0] = corner; poly[1] = center; poly[2] = otherCorner; poly[3] = corner; polyLen = 4; } miFillSppPoly (paintedSet, pixel, polyLen, poly, xOrg, yOrg, xFtrans, yFtrans); break; case MI_JOIN_BEVEL: /* add triangle */ poly[0] = corner; poly[1] = center; poly[2] = otherCorner; poly[3] = corner; polyLen = 4; miFillSppPoly (paintedSet, pixel, polyLen, poly, xOrg, yOrg, xFtrans, yFtrans); break; case MI_JOIN_TRIANGULAR: /* add stubby quadrilateral */ { double mid2, mid; SppPoint e; e.x = 0.5 * (corner.x + otherCorner.x); e.y = 0.5 * (corner.y + otherCorner.y); mid2 = ((e.x - center.x) * (e.x - center.x) + (e.y - center.y) * (e.y - center.y)); mid = sqrt (mid2); poly[0] = corner; poly[1] = center; poly[2] = otherCorner; poly[3].x = e.x + 0.5 * width * (e.x - center.x) / mid; poly[3].y = e.y + 0.5 * width * (e.y - center.y) / mid; poly[4] = corner; polyLen = 5; miFillSppPoly (paintedSet, pixel, polyLen, poly, xOrg, yOrg, xFtrans, yFtrans); } break; case MI_JOIN_ROUND: /* add round cap */ arc.x = center.x - width/2; arc.y = center.y - width/2; arc.width = width; arc.height = width; arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x); arc.angle2 = a; pArcPts = (SppPoint *) mi_xmalloc (3 * sizeof (SppPoint)); pArcPts[0] = otherCorner; pArcPts[1] = center; pArcPts[2] = corner; /* convert semicircle to a polyline, and fill */ if ((cpt = miGetArcPts (&arc, 3, &pArcPts))) /* by drawing with miFillSppPoly and setting the endpoints of the arc to be the corners, we ensure that the cap will meet up with the rest of the line */ miFillSppPoly (paintedSet, pixel, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans); free (pArcPts); break; } } /* helper function, used by miArcJoin() above */ static double angleBetween (SppPoint center, SppPoint point1, SppPoint point2) { double a1, a2, a; /* * reflect from X coordinates back to ellipse * coordinates -- y increasing upwards */ a1 = miDatan2 (- (point1.y - center.y), point1.x - center.x); a2 = miDatan2 (- (point2.y - center.y), point2.x - center.x); a = a2 - a1; if (a <= -180.0) a += 360.0; else if (a > 180.0) a -= 360.0; return a; } /* helper function, used by miArcJoin() above */ static void translateBounds (miArcFace *b, int x, int y, double fx, double fy) { fx += x; fy += y; b->clock.x -= fx; b->clock.y -= fy; b->center.x -= fx; b->center.y -= fy; b->counterClock.x -= fx; b->counterClock.y -= fy; } /* Draw a cap on an arc segment, by calling miFillSppPoly(). */ /*ARGSUSED*/ static void miArcCap (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const miArcFace *pFace, int end, int xOrg, int yOrg, double xFtrans, double yFtrans) { SppPoint corner, otherCorner, center, endPoint, poly[5]; corner = pFace->clock; otherCorner = pFace->counterClock; center = pFace->center; switch (pGC->capStyle) { case MI_CAP_BUTT: case MI_CAP_NOT_LAST: default: break; /* do nothing */ case MI_CAP_PROJECTING: poly[0].x = otherCorner.x; poly[0].y = otherCorner.y; poly[1].x = corner.x; poly[1].y = corner.y; poly[2].x = corner.x - (center.y - corner.y); poly[2].y = corner.y + (center.x - corner.x); poly[3].x = otherCorner.x - (otherCorner.y - center.y); poly[3].y = otherCorner.y + (otherCorner.x - center.x); poly[4].x = otherCorner.x; poly[4].y = otherCorner.y; miFillSppPoly (paintedSet, pixel, 5, poly, xOrg, yOrg, xFtrans, yFtrans); break; case MI_CAP_TRIANGULAR: poly[0].x = otherCorner.x; poly[0].y = otherCorner.y; poly[1].x = corner.x; poly[1].y = corner.y; poly[2].x = center.x - 0.5 * (otherCorner.y - corner.y); poly[2].y = center.y + 0.5 * (otherCorner.x - corner.x); poly[3].x = otherCorner.x; poly[3].y = otherCorner.y; miFillSppPoly (paintedSet, pixel, 4, poly, xOrg, yOrg, xFtrans, yFtrans); break; case MI_CAP_ROUND: /* * miRoundCap() just needs these to be unequal. */ endPoint = center; endPoint.x = endPoint.x + 100; miRoundCap (paintedSet, pixel, pGC, center, endPoint, corner, otherCorner, 0, -xOrg, -yOrg, xFtrans, yFtrans); break; } } /* MIROUNDCAP -- a helper function used by miArcCap() above. * Put Rounded cap on end. pCenter is the center of this end of the line * pEnd is the center of the other end of the line. pCorner is one of the * two corners at this end of the line. * NOTE: pOtherCorner must be counter-clockwise from pCorner. */ /*ARGSUSED*/ static void miRoundCap (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, SppPoint pCenter, SppPoint pEnd, SppPoint pCorner, SppPoint pOtherCorner, int fLineEnd, int xOrg, int yOrg, double xFtrans, double yFtrans) { int cpt; double width; SppArc arc; SppPoint *pArcPts; width = (pGC->lineWidth ? pGC->lineWidth : 1); arc.x = pCenter.x - width/2; arc.y = pCenter.y - width/2; arc.width = width; arc.height = width; arc.angle1 = -miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x); if (PTISEQUAL(pCenter, pEnd)) arc.angle2 = - 180.0; else { arc.angle2 = -miDatan2 (pOtherCorner.y - pCenter.y, pOtherCorner.x - pCenter.x) - arc.angle1; if (arc.angle2 < 0) arc.angle2 += 360.0; } /* convert semicircle to a polyline, and fill */ pArcPts = (SppPoint *)NULL; if ((cpt = miGetArcPts (&arc, 0, &pArcPts))) /* by drawing with miFillSppPoly and setting the endpoints of the arc * to be the corners, we assure that the cap will meet up with the * rest of the line */ miFillSppPoly (paintedSet, pixel, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans); free (pArcPts); } /* MIGETARCPTS -- Converts an arc into a set of line segments, so the * resulting polygon can be filled -- a helper routine for drawing round * joins and caps. Returns the number of points in the arc. Note that it * takes a pointer to a pointer to where it should put the points and an * index (cpt). This procedure allocates the space necessary to fit the * arc points. Sometimes it's convenient for those points to be at the end * of an existing array. (For example, if we want to leave a spare point to * make sectors instead of segments.) So we pass in the malloc'ed chunk * that contains the array, and an index saying where we should start * stashing the points. If there isn't an array already, we just pass in a * null pointer and count on mi_xrealloc() to handle the null pointer * correctly. */ /* ARGS: cpt = number of points already in arc list ppPts = ptr to ptr to arc-list -- modified */ static int miGetArcPts (const SppArc *parc, int cpt, SppPoint **ppPts) { double st; /* Start Theta, start angle */ double et; /* End Theta, offset from start theta */ double dt; /* Delta Theta, angle to sweep ellipse */ double cdt; /* Cos Delta Theta, actually 2 cos(dt) */ double x0, y0; /* recurrence formula needs 2 points to start*/ double x1, y1; double x2, y2; /* this will be the new point generated */ double xc, yc; /* the center point */ int count, i; SppPoint *poly; miPoint last; /* last point on integer boundaries */ /* The spec says that positive angles indicate counterclockwise motion. Given our coordinate system (with 0,0 in the upper left corner), the screen appears flipped in Y. The easiest fix is to negate the angles given. */ st = - parc->angle1; et = - parc->angle2; /* Try to get a delta theta that is within 1/2 pixel. Then adjust it * so that it divides evenly into the total. * I'm just using cdt 'cause I'm lazy. */ cdt = parc->width; if (parc->height > cdt) cdt = parc->height; cdt *= 0.5; if (cdt <= 0) return 0; if (cdt < 1.0) cdt = 1.0; dt = miDasin (1.0 / cdt); /* minimum step necessary */ count = (int)(et/dt); count = abs(count) + 1; dt = et/count; count++; cdt = 2 * miDcos(dt); poly = (SppPoint *) mi_xrealloc(*ppPts, (cpt + count) * sizeof(SppPoint)); *ppPts = poly; xc = 0.5 * parc->width; /* store half width and half height */ yc = 0.5 * parc->height; x0 = xc * miDcos(st); y0 = yc * miDsin(st); x1 = xc * miDcos(st + dt); y1 = yc * miDsin(st + dt); xc += parc->x; /* by adding initial point, these become */ yc += parc->y; /* the center point */ poly[cpt].x = (xc + x0); poly[cpt].y = (yc + y0); poly[cpt + 1].x = (xc + x1); poly[cpt + 1].y = (yc + y1); last.x = IROUND(xc + x1); last.y = IROUND(yc + y1); for (i = 2; i < count; i++) { x2 = cdt * x1 - x0; y2 = cdt * y1 - y0; poly[cpt + i].x = (xc + x2); poly[cpt + i].y = (yc + y2); x0 = x1; y0 = y1; x1 = x2; y1 = y2; } /* adjust the last point */ if (FABS(parc->angle2) >= 360.0) poly[cpt +i -1] = poly[0]; else { poly[cpt +i -1].x = (miDcos(st + et) * 0.5 * parc->width + xc); poly[cpt +i -1].y = (miDsin(st + et) * 0.5 * parc->height + yc); } return count; } /**********************************************************************/ /* Specially defined trig functions. At the cardinal points, they are exact. */ /**********************************************************************/ #define Dsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0))) #define Dcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0))) #define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-a) % (b)) static double miDcos (double a) { int i; if (floor (a/90) == a/90) { i = (int) (a/90.0); switch (mod (i, 4)) { case 0: return 1; case 1: return 0; case 2: return -1; case 3: return 0; } } return cos (a * M_PI / 180.0); } static double miDsin (double a) { int i; if (floor (a/90) == a/90) { i = (int) (a/90.0); switch (mod (i, 4)) { case 0: return 0; case 1: return 1; case 2: return 0; case 3: return -1; } } return sin (a * M_PI / 180.0); } static double miDasin (double v) { if (v == 0) return 0.0; if (v == 1.0) return 90.0; if (v == -1.0) return -90.0; return asin(v) * (180.0 / M_PI); } static double miDatan2 (double dy, double dx) { if (dy == 0) { if (dx >= 0) return 0.0; return 180.0; } else if (dx == 0) { if (dy > 0) return 90.0; return -90.0; } else if (FABS(dy) == FABS(dx)) { if (dy > 0) { if (dx > 0) return 45.0; return 135.0; } else { if (dx > 0) return 315.0; return 225.0; } } else return atan2 (dy, dx) * (180.0 / M_PI); } /***********************************************************************/ /* A sub-module that computes arc lengths via a polygonal approximation to * the arc. External functions are computeDashMap(), which should be * called first, and the primary function computeAngleFromPath(). They are * called by miComputeArcs() above. */ /***********************************************************************/ #define dashIndexToAngle(di) ((((double) (di)) * 90.0) / ((double) DASH_MAP_SIZE - 1)) #define xAngleToDashIndex(xa) ((((long) (xa)) * (DASH_MAP_SIZE - 1)) / (90 * 64)) #define dashIndexToXAngle(di) ((((long) (di)) * (90 * 64)) / (DASH_MAP_SIZE - 1)) #define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1))) /* forward references (functions in this sub-module) */ static double angleToLength (int angle, const dashMap *map); static int lengthToAngle (double len, const dashMap *map); static void computeDashMap (const miArc *arcp, dashMap *map) { int di; double a, x, y, prevx = 0.0, prevy = 0.0, dist; for (di = 0; di < DASH_MAP_SIZE; di++) { a = dashIndexToAngle (di); x = (double)(0.5 * arcp->width) * miDcos (a); y = (double)(0.5 * arcp->height) * miDsin (a); if (di == 0) map->map[di] = 0.0; else { dist = hypot (x - prevx, y - prevy); map->map[di] = map->map[di - 1] + dist; } prevx = x; prevy = y; } } static double angleToLength (int angle, const dashMap *map) { double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen; int di; int excess; bool oddSide = false; totallen = 0; if (angle >= 0) { while (angle >= 90 * 64) { angle -= 90 * 64; totallen += sidelen; oddSide = (oddSide ? false : true); } } else { while (angle < 0) { angle += 90 * 64; totallen -= sidelen; oddSide = (oddSide ? false : true); } } if (oddSide) angle = 90 * 64 - angle; di = xAngleToDashIndex (angle); excess = angle - dashIndexToXAngle (di); len = map->map[di]; /* * linearly interpolate between this point and the next */ if (excess > 0) { excesslen = (map->map[di + 1] - map->map[di]) * ((double) excess) / dashXAngleStep; len += excesslen; } if (oddSide) totallen += (sidelen - len); else totallen += len; return totallen; } /* * len is along the arc, but may be more than one rotation */ static int lengthToAngle (double len, const dashMap *map) { double sidelen = map->map[DASH_MAP_SIZE - 1]; int angle, angleexcess; bool oddSide = false; int a0, a1, a; angle = 0; /* * step around the ellipse, subtracting sidelens and * adding 90 degrees. oddSide will tell if the * map should be interpolated in reverse */ if (len >= 0) { if (sidelen == 0) return 2 * FULLCIRCLE; /* infinity */ while (len >= sidelen) { angle += 90 * 64; len -= sidelen; oddSide = (oddSide ? false : true); } } else { if (sidelen == 0) return -2 * FULLCIRCLE; /* infinity */ while (len < 0) { angle -= 90 * 64; len += sidelen; oddSide = (oddSide ? false : true); } } if (oddSide) len = sidelen - len; a0 = 0; a1 = DASH_MAP_SIZE - 1; /* * binary search for the closest pre-computed length */ while (a1 - a0 > 1) { a = (a0 + a1) / 2; if (len > map->map[a]) a0 = a; else a1 = a; } angleexcess = dashIndexToXAngle (a0); /* * linearly interpolate to the next point */ angleexcess += (int)((len - map->map[a0]) / (map->map[a0+1] - map->map[a0]) * dashXAngleStep); if (oddSide) angle += (90 * 64) - angleexcess; else angle += angleexcess; return angle; } /* Compute the subtended angle, in 1/64 degree units, of an elliptic arc * that corresponds to a specified dash length. The correct solution to * this problem involves an elliptic integral, so we punt by approximating * (it's only for dashes anyway...). The approximation uses a polygon. * * The specified dash length `len' is updated, to equal the amount of the * dash that will remain after drawing the arc. This may be nonzero due to * rounding. The new value will be negative if the arc extends beyond the * specified dash length, and positive if the specified dash length extends * beyond the arc. */ static int computeAngleFromPath (int startAngle, int endAngle, const dashMap *map, int *lenp, bool backwards) /* start, endAngle are angles in 1/64 degree units */ { int a0, a1, a; double len0; int len; a0 = startAngle; a1 = endAngle; len = *lenp; if (backwards) /* flip the problem around to be forwards */ { a0 = FULLCIRCLE - a0; a1 = FULLCIRCLE - a1; } if (a1 < a0) a1 += FULLCIRCLE; len0 = angleToLength (a0, map); a = lengthToAngle (len0 + len, map); if (a > a1) { a = a1; len = (int)(len - angleToLength (a1, map) - len0); } else len = 0; if (backwards) a = FULLCIRCLE - a; *lenp = len; return a; } /***********************************************************************/ /* Geometry computations related to wide ellipses, e.g., computeAcc(), which computes `accelerators' (frequently used quantities), and computeBounds(). */ /***********************************************************************/ /* definition of a wide arc */ struct arc_def { double w, h; /* half-width, half-height */ double l; /* half of line width */ double a0, a1; /* start angle, and angle range */ }; struct bound { double min, max; }; struct ibound { int min, max; }; /* * These are all y value bounds; computed by computeBounds(). */ struct arc_bound { struct bound ellipse; struct bound inner, outer; struct bound right, left; struct ibound inneri, outeri; }; struct line { double m, b; /* for y = mx + b */ bool valid; }; /* Quantities frequently used when drawn an ellipse or elliptic arc; computed by computeAcc(). */ struct accelerators { double tail_y; /* "y value associated with bottom of tail" */ double h2; /* half-height squared */ double w2; /* half-width squared */ double h4; /* half-height raised to 4th power */ double w4; /* half-width raised to 4th power */ double h2mw2; /* h2 minus w2 */ double h2l; /* h2 times l (i.e. half the line width) */ double w2l; /* w2 times l (i.e. half the line width) */ double fromIntX; /* 0.5 if width is odd, otherwise 0.0 */ double fromIntY; /* 0.5 if height is oddd, otherwise 0.0 */ struct line left, right; int yorgu; int yorgl; int xorg; }; #define boundedLe(value, bounds)\ ((bounds).min <= (value) && (value) <= (bounds).max) #define intersectLine(y,line) (line.m * (y) + line.b) /* forward references */ static double hookEllipseY (double scan_y, const struct arc_bound *bound, const struct accelerators *acc, bool left); static double hookX (double scan_y, const struct arc_def *def, const struct arc_bound *bound, const struct accelerators *acc, bool left); static double innerXfromXY (double x, double y, const struct accelerators *acc); static double innerYfromXY (double x, double y, const struct accelerators *acc); static double innerYfromY (double y, const struct arc_def *def, const struct accelerators *acc); static double outerXfromXY (double x, double y, const struct accelerators *acc); static double outerYfromXY (double x, double y, const struct accelerators *acc); static double tailX (double K, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc); static void computeAcc (const miArc *tarc, unsigned int lw, struct arc_def *def, struct accelerators *acc); static void computeBound (const struct arc_def *def, struct arc_bound *bound, struct accelerators *acc, miArcFace *right, miArcFace *left); static void computeLine (double x1, double y1, double x2, double y2, struct line *line); static void tailEllipseY (const struct arc_def *def, struct accelerators *acc); static double tailX (double K, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc) { double w, h, r; double Hs, Hf, WH, Vk, Nk, Fk, Vr, N, Nc, Z, rs; double A, T, b, d, x, y, t, hepp, hepm; int flip, solution; double xs[2]; double *xp; w = def->w; h = def->h; r = def->l; rs = r * r; Hs = acc->h2; WH = -acc->h2mw2; Nk = def->w * r; Vk = (Nk * Hs) / (WH + WH); Hf = acc->h4; Nk = (Hf - Nk * Nk) / WH; if (K == 0.0) { if (Nk < 0.0 && -Nk < Hs) { xs[0] = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk); xs[1] = w - r; if (acc->left.valid && boundedLe(K, bounds->left) && !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0) return xs[1]; if (acc->right.valid && boundedLe(K, bounds->right) && !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0) return xs[1]; return xs[0]; } return w - r; } Fk = Hf / WH; hepp = h + EPSILON; hepm = h - EPSILON; N = (K * K + Nk) / 6.0; Nc = N * N * N; Vr = Vk * K; xp = xs; xs[0] = 0.0; t = Nc + Vr * Vr; d = Nc + t; if (d < 0.0) { d = Nc; b = N; if ( (b < 0.0) == (t < 0.0) ) { b = -b; d = -d; } Z = N - 2.0 * b * cos (acos (-t / d) / 3.0); if ( (Z < 0.0) == (Vr < 0.0) ) flip = 2; else flip = 1; } else { d = Vr * sqrt (d); Z = N + cbrt (t + d) + cbrt (t - d); flip = 0; } A = sqrt ((Z + Z) - Nk); T = (Fk - Z) * K / A; solution = false; b = -A + K; d = b * b - 4 * (Z + T); if (d >= 0 && flip == 2) { d = sqrt(d); y = 0.5 * (b + d); if ((y >= 0.0) && (y < hepp)) { solution = true; if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; t = sqrt(rs - (t * t)); *xp++ = x - t; } } b = A + K; d = b * b - 4 * (Z - T); /* Because of the large magnitudes involved, we lose enough precision * that sometimes we end up with a negative value near the axis, when * it should be positive. This is a workaround. */ if (d < 0 && !solution) d = 0.0; if (d >= 0) { d = sqrt(d); y = 0.5 * (b + d); if (y < hepp) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; *xp++ = x - sqrt(rs - (t * t)); } y = 0.5 * (b - d); if (y >= 0.0 && flip == 1) { if (y > hepm) y = h; t = y / h; x = w * sqrt(1 - (t * t)); t = K - y; t = sqrt(rs - (t * t)); *xp++ = x - t; } } if (xp > &xs[1]) { if (acc->left.valid && boundedLe(K, bounds->left) && !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0) return xs[1]; if (acc->right.valid && boundedLe(K, bounds->right) && !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0) return xs[1]; } return xs[0]; } /* * This computes the ellipse y value associated with the * bottom of the tail. */ #define CUBE_ROOT_2 1.2599210498948732038115849718451499938964 #define CUBE_ROOT_4 1.5874010519681993173435330390930175781250 static void tailEllipseY (const struct arc_def *def, struct accelerators *acc) { double t; acc->tail_y = 0.0; if (def->w == def->h) return; t = def->l * def->w; if (def->w > def->h) { if (t < acc->h2) return; } else { if (t > acc->h2) return; } t = 2.0 * def->h * t; t = (CUBE_ROOT_4 * acc->h2 - cbrt(t * t)) / acc->h2mw2; if (t > 0.0) acc->tail_y = def->h / CUBE_ROOT_2 * sqrt(t); } /* * inverse functions -- compute edge coordinates * from the ellipse (actually, from its precomputed accelerators) */ static double outerXfromXY (double x, double y, const struct accelerators *acc) { return x + (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double outerYfromXY (double x, double y, const struct accelerators *acc) { return y + (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double innerXfromXY (double x, double y, const struct accelerators *acc) { return x - (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double innerYfromXY (double x, double y, const struct accelerators *acc) { return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } static double innerYfromY (double y, const struct arc_def *def, const struct accelerators *acc) { double x; x = (def->w / def->h) * sqrt (acc->h2 - y*y); return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4); } /* compute a line through two points */ static void computeLine (double x1, double y1, double x2, double y2, struct line *line) { if (y1 == y2) line->valid = false; else { line->m = (x1 - x2) / (y1 - y2); line->b = x1 - y1 * line->m; line->valid = true; } } /* Compute accelerators for an ellipse. These are simply values that are used repeatedly in the computations. Also begin filling in the arc_def structure too. */ static void computeAcc (const miArc *tarc, unsigned int lw, struct arc_def *def, struct accelerators *acc) { def->w = 0.5 * (double)tarc->width; def->h = 0.5 * (double)tarc->height; def->l = 0.5 * (double)lw; acc->h2 = def->h * def->h; acc->w2 = def->w * def->w; acc->h4 = acc->h2 * acc->h2; acc->w4 = acc->w2 * acc->w2; acc->h2l = acc->h2 * def->l; acc->w2l = acc->w2 * def->l; acc->h2mw2 = acc->h2 - acc->w2; acc->fromIntX = (tarc->width & 1) ? 0.5 : 0.0; acc->fromIntY = (tarc->height & 1) ? 0.5 : 0.0; acc->xorg = tarc->x + (int)(tarc->width >> 1); acc->yorgu = tarc->y + (int)(tarc->height >> 1); acc->yorgl = acc->yorgu + (tarc->height & 1); tailEllipseY (def, acc); /* fill in tail_y element of acc */ } /* Compute y value bounds of various portions of the arc, the outer edge, the ellipse and the inner edge. Also invoke computeLine to compute left and right lines (stored in accelerator structure). */ static void computeBound (const struct arc_def *def, struct arc_bound *bound, struct accelerators *acc, miArcFace *right, miArcFace *left) { double t; double innerTaily; double tail_y; struct bound innerx, outerx; struct bound ellipsex; bound->ellipse.min = Dsin (def->a0) * def->h; bound->ellipse.max = Dsin (def->a1) * def->h; if (def->a0 == 45 && def->w == def->h) ellipsex.min = bound->ellipse.min; else ellipsex.min = Dcos (def->a0) * def->w; if (def->a1 == 45 && def->w == def->h) ellipsex.max = bound->ellipse.max; else ellipsex.max = Dcos (def->a1) * def->w; bound->outer.min = outerYfromXY (ellipsex.min, bound->ellipse.min, acc); bound->outer.max = outerYfromXY (ellipsex.max, bound->ellipse.max, acc); bound->inner.min = innerYfromXY (ellipsex.min, bound->ellipse.min, acc); bound->inner.max = innerYfromXY (ellipsex.max, bound->ellipse.max, acc); outerx.min = outerXfromXY (ellipsex.min, bound->ellipse.min, acc); outerx.max = outerXfromXY (ellipsex.max, bound->ellipse.max, acc); innerx.min = innerXfromXY (ellipsex.min, bound->ellipse.min, acc); innerx.max = innerXfromXY (ellipsex.max, bound->ellipse.max, acc); /* Save the line end points for the cap code to use. Careful here, these * are in Cartesian coordinates (y increasing upwards) while the cap code * uses inverted coordinates (y increasing downwards). */ if (right) { right->counterClock.y = bound->outer.min; right->counterClock.x = outerx.min; right->center.y = bound->ellipse.min; right->center.x = ellipsex.min; right->clock.y = bound->inner.min; right->clock.x = innerx.min; } if (left) { left->clock.y = bound->outer.max; left->clock.x = outerx.max; left->center.y = bound->ellipse.max; left->center.x = ellipsex.max; left->counterClock.y = bound->inner.max; left->counterClock.x = innerx.max; } bound->left.min = bound->inner.max; bound->left.max = bound->outer.max; bound->right.min = bound->inner.min; bound->right.max = bound->outer.min; computeLine (innerx.min, bound->inner.min, outerx.min, bound->outer.min, &acc->right); computeLine (innerx.max, bound->inner.max, outerx.max, bound->outer.max, &acc->left); if (bound->inner.min > bound->inner.max) { t = bound->inner.min; bound->inner.min = bound->inner.max; bound->inner.max = t; } tail_y = acc->tail_y; if (tail_y > bound->ellipse.max) tail_y = bound->ellipse.max; else if (tail_y < bound->ellipse.min) tail_y = bound->ellipse.min; innerTaily = innerYfromY (tail_y, def, acc); if (bound->inner.min > innerTaily) bound->inner.min = innerTaily; if (bound->inner.max < innerTaily) bound->inner.max = innerTaily; bound->inneri.min = ICEIL(bound->inner.min - acc->fromIntY); bound->inneri.max = IFLOOR(bound->inner.max - acc->fromIntY); bound->outeri.min = ICEIL(bound->outer.min - acc->fromIntY); bound->outeri.max = IFLOOR(bound->outer.max - acc->fromIntY); } /* * this section computes the x value of the span at y * intersected with the specified face of the ellipse. * * this is the min/max X value over the set of normal * lines to the entire ellipse, the equation of the * normal lines is: * * ellipse_x h^2 h^2 * x = ------------ y + ellipse_x (1 - --- ) * ellipse_y w^2 w^2 * * compute the derivative with-respect-to ellipse_y and solve * for zero: * * (w^2 - h^2) ellipse_y^3 + h^4 y * 0 = - ---------------------------------- * h w ellipse_y^2 sqrt (h^2 - ellipse_y^2) * * ( h^4 y ) * ellipse_y = ( ---------- ) ^ (1/3) * ( (h^2 - w^2) ) * * The other two solutions to the equation are imaginary. * * This gives the position on the ellipse which generates * the normal with the largest/smallest x intersection point. * * Now compute the second derivative to check whether * the intersection is a minimum or maximum: * * h (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2)) * - ------------------------------------------- * w y0^3 (sqrt (h^2 - y^2)) ^ 3 * * as we only care about the sign, * * - (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2)) * * or (to use accelerators), * * y0^3 (h^2 - w^2) - h^2 y (3y0^2 - 2h^2) * */ /* Compute the position on the ellipse whose normal line intersects the given scan line maximally. */ static double hookEllipseY (double scan_y, const struct arc_bound *bound, const struct accelerators *acc, bool left) { double ret; if (acc->h2mw2 == 0) { if ( (scan_y > 0 && (left ? false : true)) || (scan_y < 0 && left) ) return bound->ellipse.min; return bound->ellipse.max; } ret = (acc->h4 * scan_y) / (acc->h2mw2); if (ret >= 0) return cbrt (ret); else return -cbrt (-ret); } /* Compute the X value of the intersection of the given scan line with the right side of the lower hook. */ static double hookX (double scan_y, const struct arc_def *def, const struct arc_bound *bound, const struct accelerators *acc, bool left) { double ellipse_y, x; double maxMin; if (def->w != def->h) { ellipse_y = hookEllipseY (scan_y, bound, acc, left); if (boundedLe (ellipse_y, bound->ellipse)) { /* * compute the value of the second * derivative */ maxMin = ellipse_y*ellipse_y*ellipse_y * acc->h2mw2 - acc->h2 * scan_y * (3 * ellipse_y*ellipse_y - 2*acc->h2); if ((left && maxMin > 0) || ((left ? false : true) && maxMin < 0)) { if (ellipse_y == 0) return def->w + left ? -def->l : def->l; x = (acc->h2 * scan_y - ellipse_y * acc->h2mw2) * sqrt (acc->h2 - ellipse_y * ellipse_y) / (def->h * def->w * ellipse_y); return x; } } } if (left) { if (acc->left.valid && boundedLe (scan_y, bound->left)) x = intersectLine (scan_y, acc->left); else { if (acc->right.valid) x = intersectLine (scan_y, acc->right); else x = def->w - def->l; } } else { if (acc->right.valid && boundedLe (scan_y, bound->right)) x = intersectLine (scan_y, acc->right); else { if (acc->left.valid) x = intersectLine (scan_y, acc->left); else x = def->w - def->l; } } return x; } /**********************************************************************/ /* The following three sub-modules, taken together, provide only five public functions: initAccumSpans(), which initializes an miAccumSpans structure, newFinalSpan(), which draws a single span to a miAccumSpans structure, drawArc(), which draws a single arc to a miAccumSpans structure as a collection of spans, drawZeroArc(), which draws a single degenerate (horizontal or vertical) arc, and finally fillSpans(), which paints the miAccumSpans structure, deallocates the spans, and resets the structure. */ /**********************************************************************/ /**********************************************************************/ /* A sub-module that accumulates an in-core cache of spans and on request, paints them. Only two public functions are newFinalSpan() and fillSpans(). Former is invoked by the succeeding sub-module, which draws arcs as spans and in turn is invoked by the drawArc() sub-module. Latter is invoked above, in miPolyArc(), to clean things up. */ /**********************************************************************/ /* ???!!! a ceiling on amount by which finalSpans array is expanded !!!??? */ #define SPAN_REALLOC 100 /* forward references */ static struct finalSpan * realAllocSpan (miAccumSpans *accumSpans); static struct finalSpan ** realFindSpan (miAccumSpans *accumSpans, int y); static void disposeFinalSpans (miAccumSpans *accumSpans); static void newFinalSpan (miAccumSpans *accumSpans, int y, int xmin, int xmax); /*** allocation-related functions ***/ /* A public function for this module: initialize an miAccumSpans structure (an in-core accumulation of spans, which is added to by newFinalSpan(), and painted and deallocated by fillSpans()). */ static void initAccumSpans (miAccumSpans *accumSpans) { accumSpans->finalSpans = (struct finalSpan **)NULL; accumSpans->finalMiny = 0; accumSpans->finalMaxy = -1; accumSpans->finalSize = 0; accumSpans->nspans = 0; accumSpans->chunks = (struct finalSpanChunk *)NULL; accumSpans->freeFinalSpans = (struct finalSpan *)NULL; } /* A public function for this module: add a span to an miAccumSpans structure. By convention, span is [xmin, xmax-1] in terms of pixels. This agrees with the libxmi convention that `right edges' (as well as bottom edges) of polygons should be omitted, so that adjacent polygons can abut with no overlaps or gaps. */ static void newFinalSpan (miAccumSpans *accumSpans, int y, int xmin, int xmax) { struct finalSpan *x, *oldx, *prev, **f; /* find list of spans at this value of y in finalSpans array; if y isn't in the range finalMiny..finalMaxy, invoke realFindSpan() to expand finalSpans array */ if (accumSpans->finalMiny <= y && y <= accumSpans->finalMaxy) f = &((accumSpans->finalSpans)[(y) - (accumSpans->finalMiny)]); else f = realFindSpan (accumSpans, y); /* loop through spans at y, trying to expand an existing one */ if (f == (struct finalSpan **)NULL) return; oldx = (struct finalSpan *)NULL; for (;;) { prev = (struct finalSpan *)NULL; for (x = *f; x; x = x->next) { if (x == oldx) { prev = x; continue; } if (x->min <= xmax && xmin <= x->max) /* expand span */ { if (oldx) { oldx->min = IMIN (x->min, xmin); oldx->max = IMAX (x->max, xmax); if (prev) prev->next = x->next; else *f = x->next; --(accumSpans->nspans); } else { x->min = IMIN (x->min, xmin); x->max = IMAX (x->max, xmax); oldx = x; } xmin = oldx->min; xmax = oldx->max; break; } prev = x; } if (!x) break; } if (!oldx) /* couldn't expand an existing span at this value of y, so create a new one and add it to the list */ { /* obtain new span from current chunk; if chunk is exhausted, invoke realAllocSpan() to allocate a new one */ if (accumSpans->freeFinalSpans != (struct finalSpan *)NULL) { x = accumSpans->freeFinalSpans; accumSpans->freeFinalSpans = accumSpans->freeFinalSpans->next; x->next = (struct finalSpan *)NULL; } else x = realAllocSpan (accumSpans); if (x) { x->min = xmin; x->max = xmax; x->next = *f; *f = x; ++(accumSpans->nspans); } } } /* Reallocate the finalSpans array in an miAccumSpans structure to include the specified value y. This is called only if y is outside the range finalMiny..finalMaxy, which indexes the array. Returns the address, in the finalSpans array, of the pointer to the head of the list of spans at the new value of y. */ static struct finalSpan ** realFindSpan (miAccumSpans *accumSpans, int y) { struct finalSpan **newSpans, **t; int newSize, newMiny, newMaxy; int change; int i, k; if (y < accumSpans->finalMiny || y > accumSpans->finalMaxy) /* need to expand... */ { if (accumSpans->finalSize == 0) { accumSpans->finalMiny = y; accumSpans->finalMaxy = y - 1; } if (y < accumSpans->finalMiny) change = accumSpans->finalMiny - y; else change = y - accumSpans->finalMaxy; /* ???!!! a ceiling on amount by which finalSpans is expanded !!!??? */ if (change >= SPAN_REALLOC) change += SPAN_REALLOC; else change = SPAN_REALLOC; newSize = accumSpans->finalSize + change; newSpans = (struct finalSpan **)mi_xmalloc (newSize * sizeof (struct finalSpan *)); newMiny = accumSpans->finalMiny; newMaxy = accumSpans->finalMaxy; if (y < accumSpans->finalMiny) newMiny = accumSpans->finalMiny - change; else newMaxy = accumSpans->finalMaxy + change; if (accumSpans->finalSpans) { memmove ((void *)(newSpans + (accumSpans->finalMiny - newMiny)), (void *)(accumSpans->finalSpans), accumSpans->finalSize * sizeof(struct finalSpan *)); free (accumSpans->finalSpans); } if ((i = accumSpans->finalMiny - newMiny) > 0) for (k = 0, t = newSpans; k < i; k++, t++) *t = (struct finalSpan *)NULL; if ((i = newMaxy - accumSpans->finalMaxy) > 0) for (k = 0, t = newSpans + newSize - i; k < i; k++, t++) *t = (struct finalSpan *)NULL; accumSpans->finalSpans = newSpans; accumSpans->finalMaxy = newMaxy; accumSpans->finalMiny = newMiny; accumSpans->finalSize = newSize; } return &((accumSpans->finalSpans)[(y) - (accumSpans->finalMiny)]); } /* Return an unused span, by allocating a new chunk of spans and returning the first span in the chunk. Called only if freeFinalSpans pointer in the miAccumSpans structure is NULL, i.e., previously allocated chunk (if any) is exhausted. The freeFinalSpans and chunks pointers are updated. */ static struct finalSpan * realAllocSpan (miAccumSpans *accumSpans) { struct finalSpanChunk *newChunk; struct finalSpan *span; int i; /* allocate new chunk, add to head of chunk list */ newChunk = (struct finalSpanChunk *) mi_xmalloc (sizeof (struct finalSpanChunk)); newChunk->next = accumSpans->chunks; accumSpans->chunks = newChunk; /* point freeFinalSpans to the second span in the new chunk */ accumSpans->freeFinalSpans = newChunk->data + 1; /* be sure `next' pointer of each span in the new chunk is NULL */ span = newChunk->data + 1; for (i = 1; i < SPAN_CHUNK_SIZE - 1; i++) { span->next = span + 1; span++; } span->next = (struct finalSpan *)NULL; span = newChunk->data; span->next = (struct finalSpan *)NULL; return span; } /*** deallocation-related functions ***/ /* A public function for this module: paint spans that have been accumulated in an miAccumSpans structure, in a specified pixel color; also reset the structure, as if initAccumSpans() had been called. Painting takes place to the specified miPaintedSet structure, by invoking MI_PAINT_SPANS(). */ /* All painting done in this file goes through this function. */ static void fillSpans (miPaintedSet *paintedSet, miPixel pixel, miAccumSpans *accumSpans) { struct finalSpan *span; struct finalSpan **f; int spany; miPoint *ppt, *pptInit; unsigned int *pwidth, *pwidthInit; if (accumSpans->nspans == 0) return; /* from the miAccumSpans struct, construct an array of spans */ ppt = pptInit = (miPoint *) mi_xmalloc (accumSpans->nspans * sizeof (miPoint)); pwidth = pwidthInit = (unsigned int *) mi_xmalloc (accumSpans->nspans * sizeof (unsigned int)); for (spany = accumSpans->finalMiny, f = accumSpans->finalSpans; spany <= accumSpans->finalMaxy; spany++, f++) { for (span = *f; span; span = span->next) { if (span->max <= span->min) continue; ppt->x = span->min; ppt->y = spany; ++ppt; *pwidth++ = (unsigned int)(span->max - span->min); } } /* paint the spans to the miPaintedSet */ MI_PAINT_SPANS(paintedSet, pixel, ppt - pptInit, pptInit, pwidthInit) /* free all spans in the miAccumSpans struct, reset it */ disposeFinalSpans (accumSpans); accumSpans->finalMiny = 0; accumSpans->finalMaxy = -1; accumSpans->finalSize = 0; accumSpans->nspans = 0; } static void disposeFinalSpans (miAccumSpans *accumSpans) { struct finalSpanChunk *chunk, *next; for (chunk = accumSpans->chunks; chunk; chunk = next) { next = chunk->next; free (chunk); } accumSpans->chunks = (struct finalSpanChunk *)NULL; accumSpans->freeFinalSpans = (struct finalSpan *)NULL; free (accumSpans->finalSpans); accumSpans->finalSpans = (struct finalSpan **)NULL; } /**********************************************************************/ /* A sub-module, used by drawArc(), that generates the spans associated with an arc, and writes them to an in-core span accumulation by calling newFinalSpan(). When this is used, computeAcc() and computeBounds() have already been called, to compute `accelerators' (frequently used quantities associated with the ellipse). hookX() and tailX() are called to do additional geometry computations. */ /**********************************************************************/ /* forward references */ static void arcSpan (miAccumSpans *accumSpans, int y, int lx, int lw, int rx, int rw, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc, unsigned int mask); static void arcSpan0 (miAccumSpans *accumSpans, int lx, int lw, int rx, int rw, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc, unsigned int mask); static void tailSpan (miAccumSpans *accumSpans, int y, int lw, int rw, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc, unsigned int mask); /* Generate the set of spans with the given y coordinate. */ static void arcSpan (miAccumSpans *accumSpans, int y, int lx, int lw, int rx, int rw, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc, unsigned int mask) { int linx, loutx, rinx, routx; double x, altx; if (boundedLe (y, bounds->inneri)) { linx = -(lx + lw); rinx = rx; } else { /* * intersection with left face */ x = hookX (y + acc->fromIntY, def, bounds, acc, true); if (acc->right.valid && boundedLe (y + acc->fromIntY, bounds->right)) { altx = intersectLine (y + acc->fromIntY, acc->right); if (altx < x) x = altx; } linx = -ICEIL(acc->fromIntX - x); rinx = ICEIL(acc->fromIntX + x); } if (boundedLe (y, bounds->outeri)) { loutx = -lx; routx = rx + rw; } else { /* * intersection with right face */ x = hookX (y + acc->fromIntY, def, bounds, acc, false); if (acc->left.valid && boundedLe (y + acc->fromIntY, bounds->left)) { altx = x; x = intersectLine (y + acc->fromIntY, acc->left); if (x < altx) x = altx; } loutx = -ICEIL(acc->fromIntX - x); routx = ICEIL(acc->fromIntX + x); } if (routx > rinx) { if (mask & 1) newFinalSpan (accumSpans, acc->yorgu - y, acc->xorg + rinx, acc->xorg + routx); if (mask & 8) newFinalSpan (accumSpans, acc->yorgl + y, acc->xorg + rinx, acc->xorg + routx); } if (loutx > linx) { if (mask & 2) newFinalSpan (accumSpans, acc->yorgu - y, acc->xorg - loutx, acc->xorg - linx); if (mask & 4) newFinalSpan (accumSpans, acc->yorgl + y, acc->xorg - loutx, acc->xorg - linx); } } static void arcSpan0 (miAccumSpans *accumSpans, int lx, int lw, int rx, int rw, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc, unsigned int mask) { double x; if (boundedLe (0, bounds->inneri) && acc->left.valid && boundedLe (0, bounds->left) && acc->left.b > 0) { x = def->w - def->l; if (acc->left.b < x) x = acc->left.b; lw = ICEIL(acc->fromIntX - x) - lx; rw += rx; rx = ICEIL(acc->fromIntX + x); rw -= rx; } arcSpan (accumSpans, 0, lx, lw, rx, rw, def, bounds, acc, mask); } static void tailSpan (miAccumSpans *accumSpans, int y, int lw, int rw, const struct arc_def *def, const struct arc_bound *bounds, const struct accelerators *acc, unsigned int mask) { double yy, xalt, x, lx, rx; int n; if (boundedLe(y, bounds->outeri)) arcSpan (accumSpans, y, 0, lw, -rw, rw, def, bounds, acc, mask); else if (def->w != def->h) { yy = y + acc->fromIntY; x = tailX(yy, def, bounds, acc); if (yy == 0.0 && x == -rw - acc->fromIntX) return; if (acc->right.valid && boundedLe (yy, bounds->right)) { rx = x; lx = -x; xalt = intersectLine (yy, acc->right); if (xalt >= -rw - acc->fromIntX && xalt <= rx) rx = xalt; n = ICEIL(acc->fromIntX + lx); if (lw > n) { if (mask & 2) newFinalSpan (accumSpans, acc->yorgu - y, acc->xorg + n, acc->xorg + lw); if (mask & 4) newFinalSpan (accumSpans, acc->yorgl + y, acc->xorg + n, acc->xorg + lw); } n = ICEIL(acc->fromIntX + rx); if (n > -rw) { if (mask & 1) newFinalSpan (accumSpans, acc->yorgu - y, acc->xorg - rw, acc->xorg + n); if (mask & 8) newFinalSpan (accumSpans, acc->yorgl + y, acc->xorg - rw, acc->xorg + n); } } arcSpan (accumSpans, y, ICEIL(acc->fromIntX - x), 0, ICEIL(acc->fromIntX + x), 0, def, bounds, acc, mask); } } /**********************************************************************/ /* The drawArc() function, which draws an arc to an in-core span accumulation by invoking the functions in the previous sub-module. This calls miComputeWideEllipse() to rasterize the ellipse of which the arc is a part, and the helper functions computeAcc() and computeBounds(). It is the low-level `draw to memory' function invoked by miArcSegment(). drawZeroArc(), which follows, is simpler; it draws a degenerate (horizontal or vertical) arc. */ /**********************************************************************/ /* forward references */ static void drawQuadrant (miAccumSpans *accumSpans, struct arc_def *def, struct accelerators *acc, int a0, int a1, unsigned int mask, miArcFace *right, miArcFace *left, miArcSpanData *spdata); static void mirrorSppPoint (int quadrant, SppPoint *sppPoint); /* Split an arc into pieces which are scan-converted in the first quadrant * and mirrored into position. This is necessary as the scan-conversion * code can only deal with arcs completely contained in the first quadrant. */ /* ARGS: right,left save arc endpoints */ static void drawArc (miAccumSpans *accumSpans, const miArc *tarc, unsigned int l, int a0, int a1, miArcFace *right, miArcFace *left, miEllipseCache *ellipseCache) { struct arc_def def; struct accelerators acc; int startq, endq, curq; int rightq, leftq = 0, righta = 0, lefta = 0; miArcFace *passRight, *passLeft; int q0 = 0, q1 = 0; unsigned int mask; struct band { int a0, a1; unsigned int mask; } band[5], sweep[20]; int bandno, sweepno; int i, j; bool flipRight = false, flipLeft = false; bool copyEnd = false; miArcSpanData *spdata; bool mustFree; /* compute span data for the whole wide ellipse, also caching it for speedy later retrieval */ spdata = miComputeWideEllipse (l, tarc, &mustFree, ellipseCache); if (!spdata) /* unknown failure, so punt */ return; if (a1 < a0) a1 += 360 * 64; startq = a0 / (90 * 64); if (a0 == a1) endq = startq; else endq = (a1-1) / (90 * 64); bandno = 0; curq = startq; rightq = -1; for (;;) { switch (curq) { case 0: if (a0 > 90 * 64) q0 = 0; else q0 = a0; if (a1 < 360 * 64) q1 = IMIN (a1, 90 * 64); else q1 = 90 * 64; if (curq == startq && a0 == q0 && rightq < 0) { righta = q0; rightq = curq; } if (curq == endq && a1 == q1) { lefta = q1; leftq = curq; } break; case 1: if (a1 < 90 * 64) q0 = 0; else q0 = 180 * 64 - IMIN (a1, 180 * 64); if (a0 > 180 * 64) q1 = 90 * 64; else q1 = 180 * 64 - IMAX (a0, 90 * 64); if (curq == startq && 180 * 64 - a0 == q1) { righta = q1; rightq = curq; } if (curq == endq && 180 * 64 - a1 == q0) { lefta = q0; leftq = curq; } break; case 2: if (a0 > 270 * 64) q0 = 0; else q0 = IMAX (a0, 180 * 64) - 180 * 64; if (a1 < 180 * 64) q1 = 90 * 64; else q1 = IMIN (a1, 270 * 64) - 180 * 64; if (curq == startq && a0 - 180*64 == q0) { righta = q0; rightq = curq; } if (curq == endq && a1 - 180 * 64 == q1) { lefta = q1; leftq = curq; } break; case 3: if (a1 < 270 * 64) q0 = 0; else q0 = 360 * 64 - IMIN (a1, 360 * 64); q1 = 360 * 64 - IMAX (a0, 270 * 64); if (curq == startq && 360 * 64 - a0 == q1) { righta = q1; rightq = curq; } if (curq == endq && 360 * 64 - a1 == q0) { lefta = q0; leftq = curq; } break; } band[bandno].a0 = q0; band[bandno].a1 = q1; band[bandno].mask = 1 << curq; bandno++; if (curq == endq) break; curq++; if (curq == 4) { a0 = 0; a1 -= 360 * 64; curq = 0; endq -= 4; } } sweepno = 0; for (;;) { q0 = 90 * 64; mask = 0; /* * find left-most point */ for (i = 0; i < bandno; i++) if (band[i].a0 <= q0) { q0 = band[i].a0; q1 = band[i].a1; mask = band[i].mask; } if (mask == 0) break; /* * locate next point of change */ for (i = 0; i < bandno; i++) if (!(mask & band[i].mask)) { if (band[i].a0 == q0) { if (band[i].a1 < q1) q1 = band[i].a1; mask |= band[i].mask; } else if (band[i].a0 < q1) q1 = band[i].a0; } /* * create a new sweep */ sweep[sweepno].a0 = q0; sweep[sweepno].a1 = q1; sweep[sweepno].mask = mask; sweepno++; /* * subtract the sweep from the affected bands */ for (i = 0; i < bandno; i++) if (band[i].a0 == q0) { band[i].a0 = q1; /* * check if this band is empty */ if (band[i].a0 == band[i].a1) band[i].a1 = band[i].a0 = 90 * 64 + 1; } } computeAcc (tarc, l, &def, &acc); for (j = 0; j < sweepno; j++) { mask = sweep[j].mask; passRight = passLeft = (miArcFace *)NULL; if (mask & (1 << rightq)) { if (sweep[j].a0 == righta) passRight = right; else if (sweep[j].a1 == righta) { passLeft = right; flipRight = true; } } if (mask & (1 << leftq)) { if (sweep[j].a1 == lefta) { if (passLeft) copyEnd = true; passLeft = left; } else if (sweep[j].a0 == lefta) { if (passRight) copyEnd = true; passRight = left; flipLeft = true; } } drawQuadrant (accumSpans, &def, &acc, sweep[j].a0, sweep[j].a1, mask, passRight, passLeft, spdata); } /* when copyEnd is true, both ends of the arc were computed at the same * time; drawQuadrant only takes one end though, so the left end will be * the only one holding the data. Copy it from there. */ if (copyEnd) *right = *left; /* * mirror the coordinates generated for the * faces of the arc */ if (right) { mirrorSppPoint (rightq, &right->clock); mirrorSppPoint (rightq, &right->center); mirrorSppPoint (rightq, &right->counterClock); if (flipRight) { SppPoint temp; temp = right->clock; right->clock = right->counterClock; right->counterClock = temp; } } if (left) { mirrorSppPoint (leftq, &left->counterClock); mirrorSppPoint (leftq, &left->center); mirrorSppPoint (leftq, &left->clock); if (flipLeft) { SppPoint temp; temp = left->clock; left->clock = left->counterClock; left->counterClock = temp; } } if (mustFree) { free (spdata->spans); free (spdata); } } /* ARGS: spdata = rasterized wide ellipse */ static void drawQuadrant (miAccumSpans *accumSpans, struct arc_def *def, struct accelerators *acc, int a0, int a1, unsigned int mask, miArcFace *right, miArcFace *left, miArcSpanData *spdata) { struct arc_bound bound; double yy, x, xalt; int y, miny, maxy; int n; miArcSpan *span; def->a0 = ((double) a0) / 64.0; def->a1 = ((double) a1) / 64.0; computeBound (def, &bound, acc, right, left); yy = bound.inner.min; if (bound.outer.min < yy) yy = bound.outer.min; miny = ICEIL(yy - acc->fromIntY); yy = bound.inner.max; if (bound.outer.max > yy) yy = bound.outer.max; maxy = (int)floor(yy - acc->fromIntY); y = spdata->k; span = spdata->spans; if (spdata->top) /* rasterized ellipse contains a `top point' */ { if (a1 == 90 * 64 && (mask & 1)) newFinalSpan (accumSpans, acc->yorgu - y - 1, acc->xorg, acc->xorg + 1); span++; } /* loop through one-span ArcSpans, at successive values of y */ for (n = spdata->count1; --n >= 0; ) { if (y < miny) return; if (y <= maxy) { /* generate spans at this y value */ arcSpan (accumSpans, y, span->lx, -span->lx, 0, span->lx + span->lw, def, &bound, acc, mask); if (span->rw + span->rx) tailSpan (accumSpans, y, -span->rw, -span->rx, def, &bound, acc, mask); } y--; span++; } if (y < miny) return; if (spdata->hole) /* have a one-pixel hole to fill in */ { if (y <= maxy) /* generate a one-point span at this y value */ arcSpan (accumSpans, y, 0, 0, 0, 1, def, &bound, acc, mask & 0xc); } /* loop through two-span ArcSpans, at successive values of y */ for (n = spdata->count2; --n >= 0; ) { if (y < miny) return; if (y <= maxy) /* generate the two spans at this y value */ arcSpan (accumSpans, y, span->lx, span->lw, span->rx, span->rw, def, &bound, acc, mask); y--; span++; } if (spdata->bot && miny <= y && y <= maxy) /* have a `horizontal centerline' ArcSpan; treat it specially */ { unsigned int m = mask; if (y == miny) m &= 0xc; if (span->rw <= 0) { arcSpan0 (accumSpans, span->lx, -span->lx, 0, span->lx + span->lw, def, &bound, acc, m); if (span->rw + span->rx) tailSpan (accumSpans, y, -span->rw, -span->rx, def, &bound, acc, m); } else arcSpan0 (accumSpans, span->lx, span->lw, span->rx, span->rw, def, &bound, acc, m); y--; } while (y >= miny) { yy = y + acc->fromIntY; if (def->w == def->h) { xalt = def->w - def->l; x = -sqrt(xalt * xalt - yy * yy); } else { x = tailX(yy, def, &bound, acc); if (acc->left.valid && boundedLe (yy, bound.left)) { xalt = intersectLine (yy, acc->left); if (xalt < x) x = xalt; } if (acc->right.valid && boundedLe (yy, bound.right)) { xalt = intersectLine (yy, acc->right); if (xalt < x) x = xalt; } } /* generate span at this y value */ arcSpan (accumSpans, y, ICEIL(acc->fromIntX - x), 0, ICEIL(acc->fromIntX + x), 0, def, &bound, acc, mask); y--; } } static void mirrorSppPoint (int quadrant, SppPoint *sppPoint) { switch (quadrant) { case 0: break; case 1: sppPoint->x = -sppPoint->x; break; case 2: sppPoint->x = -sppPoint->x; sppPoint->y = -sppPoint->y; break; case 3: sppPoint->y = -sppPoint->y; break; } /* * and translate to X coordinate system */ sppPoint->y = -sppPoint->y; } /***********************************************************************/ /* Draw a degenerate (zero width/height) arc. Left and right faces are * computed. Called by miArcSegment() to handle the degenerate case: * tarc->width = 0 or tarc->height = 0. */ /***********************************************************************/ /* ARGS: left,right save arc endpoints */ static void drawZeroArc (miAccumSpans *accumSpans, const miArc *tarc, unsigned int lw, miArcFace *left, miArcFace *right) { double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0; double w, h, x, y; double xmax, ymax, xmin, ymin; int a0, a1; double a, startAngle, endAngle; double l, lx, ly; l = 0.5 * lw; a0 = tarc->angle1; a1 = tarc->angle2; if (a1 > FULLCIRCLE) a1 = FULLCIRCLE; else if (a1 < -FULLCIRCLE) a1 = -FULLCIRCLE; w = 0.5 * tarc->width; h = 0.5 * tarc->height; /* * play in X coordinates right away */ startAngle = - ((double) a0 / 64.0); endAngle = - ((double) (a0 + a1) / 64.0); xmax = -w; xmin = w; ymax = -h; ymin = h; a = startAngle; for (;;) { x = w * miDcos(a); y = h * miDsin(a); if (a == startAngle) { x0 = x; y0 = y; } if (a == endAngle) { x1 = x; y1 = y; } if (x > xmax) xmax = x; if (x < xmin) xmin = x; if (y > ymax) ymax = y; if (y < ymin) ymin = y; if (a == endAngle) break; if (a1 < 0) /* clockwise */ { if (floor (a / 90.0) == floor (endAngle / 90.0)) a = endAngle; else a = 90 * (floor (a/90.0) + 1); } else { if (ceil (a / 90.0) == ceil (endAngle / 90.0)) a = endAngle; else a = 90 * (ceil (a/90.0) - 1); } } lx = ly = l; if ((x1 - x0) + (y1 - y0) < 0) lx = ly = -l; if (h) ly = 0.0; else lx = 0.0; if (right) { right->center.x = x0; right->center.y = y0; right->clock.x = x0 - lx; right->clock.y = y0 - ly; right->counterClock.x = x0 + lx; right->counterClock.y = y0 + ly; } if (left) { left->center.x = x1; left->center.y = y1; left->clock.x = x1 + lx; left->clock.y = y1 + ly; left->counterClock.x = x1 - lx; left->counterClock.y = y1 - ly; } x0 = xmin; x1 = xmax; y0 = ymin; y1 = ymax; if (ymin != y1) { xmin = -l; xmax = l; } else { ymin = -l; ymax = l; } if (xmax != xmin && ymax != ymin) /* construct a rectangle and `paint' it */ { int minx, maxx, miny, maxy; int xorg, yorg, width, height; minx = ICEIL(xmin + w) + tarc->x; maxx = ICEIL(xmax + w) + tarc->x; miny = ICEIL(ymin + h) + tarc->y; maxy = ICEIL(ymax + h) + tarc->y; xorg = minx; yorg = miny; width = maxx - minx; height = maxy - miny; /* paint rectangle to the in-core miAccumSpans struct, except for its right and bottom edges */ while (height--) newFinalSpan (accumSpans, yorg, xorg, xorg + width); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_canvas.c��������������������������������������������������������������������0000644�0001750�0001750�00000032511�10342373667�013746� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file defines libxmi's miCanvas class. An miCanvas is an object that includes a drawable (a miCanvasPixmap, which by default is a miPixmap [essentially a 2-D array of miPixels]) and various data members that indicate how any specified set of pixels should be painted. These may include a stipple miBitmap and a texture miPixmap; if they are non-NULL, they will tile the canvas. This file supports a good deal of customization, which would probably be needed if libxmi is installed as a rendering module in other software. The following preprocessor symbols may be defined: MI_PIXEL_TYPE MI_CANVAS_DRAWABLE_TYPE MI_GET_CANVAS_DRAWABLE_PIXEL() MI_SET_CANVAS_DRAWABLE_PIXEL() MI_GET_CANVAS_DRAWABLE_BOUNDS() MI_DEFAULT_MERGE2_PIXEL() MI_DEFAULT_MERGE3_PIXEL() See xmi.h for details on what they do. Ideally you should be able to #define those symbols appropriately, and never modify this file. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_api.h" /* forward references (these are currently used only in this file) */ static miPixmap * miNewPixmap (unsigned int width, unsigned int height, miPixel initPixel); static miPixmap * miCopyPixmap (const miPixmap *pPixmap); static void miDeletePixmap (miPixmap *pPixmap); #if 0 /* not currently used, so commented out */ static miBitmap * miNewBitmap (unsigned int width, unsigned int height, int initBit); #endif static miBitmap * miCopyBitmap (const miBitmap *pBitmap); static void miDeleteBitmap (miBitmap *pBitmap); static void miPaintCanvas (miCanvas *canvas, miPixel pixel, int n, const miPoint *ppt, const unsigned int *pwidth, miPoint offset); /* Ctor/dtor/copy ctor for the miCanvas class. These are defined only if the symbol MI_CANVAS_DRAWABLE_TYPE hasn't been defined by the libxmi installer. If it's defined, the drawable encapsulated within an miCanvas is presumably something other than a miPixmap, and we won't know how to create/destroy/copy miCanvas's. */ #ifndef MI_CANVAS_DRAWABLE_TYPE /* create (allocate) a new miCanvas */ miCanvas * miNewCanvas (unsigned int width, unsigned int height, miPixel initPixel) { miCanvas *new_pCanvas; if (width < 1 || height < 1) return (miCanvas *)NULL; new_pCanvas = (miCanvas *)mi_xmalloc (sizeof (miCanvas)); new_pCanvas->drawable = miNewPixmap (width, height, initPixel); /* default values */ new_pCanvas->texture = (miPixmap *)NULL; new_pCanvas->stipple = (miBitmap *)NULL; new_pCanvas->pixelMerge2 = (miPixelMerge2)NULL; new_pCanvas->pixelMerge3 = (miPixelMerge3)NULL; return new_pCanvas; } /* copy a miCanvas */ miCanvas * miCopyCanvas (const miCanvas *pCanvas) { miCanvas *new_pCanvas; if (pCanvas == (const miCanvas *)NULL) return (miCanvas *)NULL; new_pCanvas = (miCanvas *)mi_xmalloc (sizeof (miCanvas)); new_pCanvas->drawable = miCopyPixmap (pCanvas->drawable); new_pCanvas->pixelMerge2 = pCanvas->pixelMerge2; new_pCanvas->pixelMerge3 = pCanvas->pixelMerge3; new_pCanvas->texture = miCopyPixmap (pCanvas->texture); new_pCanvas->stipple = miCopyBitmap (pCanvas->stipple); return new_pCanvas; } /* destroy (deallocate) an miCanvas */ void miDeleteCanvas (miCanvas *pCanvas) { if (pCanvas == (miCanvas *)NULL) return; miDeletePixmap (pCanvas->drawable); miDeletePixmap (pCanvas->texture); miDeleteBitmap (pCanvas->stipple); free (pCanvas); } #endif /* not MI_CANVAS_DRAWABLE_TYPE */ /* create a new miPixmap, and fill it with a specified miPixel */ static miPixmap * miNewPixmap (unsigned int width, unsigned int height, miPixel initPixel) { miPixmap *new_pPixmap; miPixel **pixmap; int i, j; new_pPixmap = (miPixmap *)mi_xmalloc (sizeof(miPixmap)); /* create a pixmap (an array of pointers to rows of miPixels) */ pixmap = (miPixel **)mi_xmalloc (height * sizeof(miPixel *)); for (j = 0; j < (int)height; j++) { pixmap[j] = (miPixel *)mi_xmalloc (width * sizeof(miPixel)); for (i = 0; i < (int)width; i++) pixmap[j][i] = initPixel; } new_pPixmap->pixmap = pixmap; new_pPixmap->width = width; new_pPixmap->height = height; return new_pPixmap; } /* copy a miPixmap */ static miPixmap * miCopyPixmap (const miPixmap *pPixmap) { miPixmap *new_pPixmap; miPixel **pixmap; miPixel * const *old_pixmap; int i, j; if (pPixmap == (const miPixmap *)NULL) return (miPixmap *)NULL; new_pPixmap = (miPixmap *)mi_xmalloc (sizeof(miPixmap)); /* create a pixmap (an array of pointers to rows of miPixels) */ pixmap = (miPixel **)mi_xmalloc (pPixmap->height * sizeof(miPixel *)); old_pixmap = pPixmap->pixmap; for (j = 0; j < (int)(pPixmap->height); j++) { pixmap[j] = (miPixel *)mi_xmalloc (pPixmap->width * sizeof(miPixel)); for (i = 0; i < (int)(pPixmap->width); i++) pixmap[j][i] = old_pixmap[j][i]; } new_pPixmap->pixmap = pixmap; new_pPixmap->width = pPixmap->width; new_pPixmap->height = pPixmap->height; return new_pPixmap; } /* destroy (deallocate) an miPixmap */ static void miDeletePixmap (miPixmap *pPixmap) { int j; if (pPixmap == (miPixmap *)NULL) return; /* free pixmap (an array of pointers to rows of miPixels) */ for (j = 0; j < (int)(pPixmap->height); j++) free (pPixmap->pixmap[j]); free (pPixmap->pixmap); free (pPixmap); } #if 0 /* not currently used, so commented out */ /* create a new miBitmap, and fill it with a specified value (only 0 and 1 are meaningful) */ static miBitmap * miNewBitmap (unsigned int width, unsigned int height, int initBit) { miBitmap *new_pBitmap; int **bitmap; int i, j; new_pBitmap = (miBitmap *)mi_xmalloc (sizeof(miBitmap)); /* create a bitmap (an array of pointers to rows of ints) */ bitmap = (int **)mi_xmalloc (height * sizeof(int *)); for (j = 0; j < (int)height; j++) { bitmap[j] = (int *)mi_xmalloc (width * sizeof(int)); for (i = 0; i < (int)width; i++) bitmap[j][i] = initBit; } new_pBitmap->bitmap = bitmap; new_pBitmap->width = width; new_pBitmap->height = height; return new_pBitmap; } #endif /* copy a miBitmap */ static miBitmap * miCopyBitmap (const miBitmap *pBitmap) { miBitmap *new_pBitmap; int **bitmap; int * const *old_bitmap; int i, j; if (pBitmap == (const miBitmap *)NULL) return (miBitmap *)NULL; new_pBitmap = (miBitmap *)mi_xmalloc (sizeof(miBitmap)); /* create a bitmap (an array of pointers to rows of ints) */ bitmap = (int **)mi_xmalloc (pBitmap->height * sizeof(int *)); old_bitmap = pBitmap->bitmap; for (j = 0; j < (int)(pBitmap->height); j++) { bitmap[j] = (int *)mi_xmalloc (pBitmap->width * sizeof(int)); for (i = 0; i < (int)(pBitmap->width); i++) bitmap[j][i] = old_bitmap[j][i]; } new_pBitmap->bitmap = bitmap; new_pBitmap->width = pBitmap->width; new_pBitmap->height = pBitmap->height; return new_pBitmap; } /* destroy (deallocate) an miBitmap */ static void miDeleteBitmap (miBitmap *pBitmap) { int j; if (pBitmap == (miBitmap *)NULL) return; /* free bitmap (an array of pointers to rows of ints) */ for (j = 0; j < (int)(pBitmap->height); j++) free (pBitmap->bitmap[j]); free (pBitmap->bitmap); free (pBitmap); } /* set the binary pixel-merging function in an miCanvas */ void miSetPixelMerge2 (miCanvas *pCanvas, miPixelMerge2 pixelMerge2) { if (pCanvas == (miCanvas *)NULL) return; pCanvas->pixelMerge2 = pixelMerge2; } /* set the ternary pixel-merging function in an miCanvas */ void miSetPixelMerge3 (miCanvas *pCanvas, miPixelMerge3 pixelMerge3) { if (pCanvas == (miCanvas *)NULL) return; pCanvas->pixelMerge3 = pixelMerge3; } /* Copy a stipple miBitmap into an miCanvas. The old stipple, if any, is deallocated. */ void miSetCanvasStipple (miCanvas *pCanvas, const miBitmap *pstipple, miPoint stippleOrigin) { if (pCanvas == (miCanvas *)NULL) return; miDeleteBitmap (pCanvas->stipple); pCanvas->stipple = miCopyBitmap (pstipple); pCanvas->stippleOrigin = stippleOrigin; } /* Copy a texture miPixmap into an miCanvas. The old texture, if any, is deallocated. */ void miSetCanvasTexture (miCanvas *pCanvas, const miPixmap *pTexture, miPoint textureOrigin) { if (pCanvas == (miCanvas *)NULL) return; miDeletePixmap (pCanvas->texture); pCanvas->texture = miCopyPixmap (pTexture); pCanvas->textureOrigin = textureOrigin; } /* Paint a list of spans, in a specified miPixel color, to a canvas. The spans must be in y-increasing order. */ /* ARGS: canvas = canvas pixel = source pixel color n = number of spans to be painted ppt = array of starting points of spans pwidth = array of widths of spans offset = point that (0,0) gets mapped to */ static void miPaintCanvas (miCanvas *canvas, miPixel pixel, int n, const miPoint *ppt, const unsigned int *pwidth, miPoint offset) { int i; int xleft, xright, ybottom, ytop; unsigned int stippleWidth = 0, stippleHeight = 0; /* keep lint happy */ unsigned int textureWidth = 0, textureHeight = 0; /* keep lint happy */ int stippleXOrigin = 0, stippleYOrigin = 0; /* keep lint happy */ int textureXOrigin = 0, textureYOrigin = 0; /* keep lint happy */ int xstart, xend, xstart_clip, xend_clip, xoffset, yoffset, x, y; unsigned int width; const miCanvas *pCanvas; /* `const' should be OK here */ miPixelMerge2 pixelMerge2; miPixelMerge3 pixelMerge3; pCanvas = canvas; xoffset = offset.x; yoffset = offset.y; /* compute bounds of destination drawable */ MI_GET_CANVAS_DRAWABLE_BOUNDS(pCanvas, xleft, ytop, xright, ybottom) /* if source doesn't overlap with destination drawable, do nothing */ if (ppt[0].y + yoffset > ybottom || ppt[n-1].y + yoffset < ytop) return; /* determine user-specified merging functions (if any) */ pixelMerge2 = pCanvas->pixelMerge2; pixelMerge3 = pCanvas->pixelMerge3; #define MI_MERGE_CANVAS_PIXEL(pCanvas, x, y, sourcePixel, texturePixel, have_texturePixel) \ { \ miPixel destinationPixel, newPixel; \ MI_GET_CANVAS_DRAWABLE_PIXEL((pCanvas), (x), (y), destinationPixel); \ if (!have_texturePixel) \ { \ if (pixelMerge2 != (miPixelMerge2)NULL) \ newPixel = (*pixelMerge2)((sourcePixel), destinationPixel); \ else \ MI_DEFAULT_MERGE2_PIXEL(newPixel, (sourcePixel), destinationPixel); \ } \ else \ { \ if (pixelMerge3 != (miPixelMerge3)NULL) \ newPixel = (*pixelMerge3)((texturePixel), (sourcePixel), destinationPixel); \ else \ MI_DEFAULT_MERGE3_PIXEL(newPixel, (texturePixel), (sourcePixel), destinationPixel); \ } \ MI_SET_CANVAS_DRAWABLE_PIXEL((pCanvas), (x), (y), newPixel); \ } if (pCanvas->stipple) { stippleWidth = pCanvas->stipple->width; stippleHeight = pCanvas->stipple->height; stippleXOrigin = pCanvas->stippleOrigin.x; stippleYOrigin = pCanvas->stippleOrigin.y; while (stippleXOrigin > 0) stippleXOrigin -= stippleWidth; while (stippleYOrigin > 0) stippleYOrigin -= stippleHeight; } if (pCanvas->texture) { textureWidth = pCanvas->texture->width; textureHeight = pCanvas->texture->height; textureXOrigin = pCanvas->textureOrigin.x; textureYOrigin = pCanvas->textureOrigin.y; while (textureXOrigin > 0) textureXOrigin -= textureWidth; while (textureYOrigin > 0) textureYOrigin -= textureHeight; } for (i = 0; i < n; i++) { y = ppt[i].y + yoffset; if (y > ybottom) return; /* no more spans will be painted */ if (y >= ytop) { width = pwidth[i]; xstart = ppt[i].x + xoffset; xend = xstart + (int)width - 1; xstart_clip = IMAX(xstart,xleft); xend_clip = IMIN(xend,xright); for (x = xstart_clip; x <= xend_clip; x++) /* may be empty */ /* merge pixel onto canvas */ { miPixel texturePixel, sourcePixel; bool have_texturePixel = false; if (pCanvas->texture) { texturePixel = pCanvas->texture->pixmap[(y-textureYOrigin) % textureHeight][(x-textureXOrigin) % textureWidth]; have_texturePixel = true; } else texturePixel = pixel; /* dummy; keep lint happy */ sourcePixel = pixel; if (pCanvas->stipple == (miBitmap *)NULL || pCanvas->stipple->bitmap[(y-stippleYOrigin) % stippleHeight][(x-stippleXOrigin) % stippleWidth] != 0) MI_MERGE_CANVAS_PIXEL(pCanvas, x, y, sourcePixel, texturePixel, have_texturePixel) } /* end for x in ... */ } /* end if */ } /* end for y in ... */ } /* Copy a miPaintedSet to an miCanvas. The miPaintedSet is assumed to have been uniquified (see mi_spans.c), which is the case after any of the eight core drawing functions in the libxmi API has been invoked. So there is at most one Spans per SpanGroup (i.e., Spans #0), and copying pixels out of it trivial. */ /* ARGS: offset = point that (0,0) is mapped to */ void miCopyPaintedSetToCanvas (const miPaintedSet *paintedSet, miCanvas *canvas, miPoint offset) { int i; /* For each pixel color, the initial Spans in the corresponding SpanGroup is effectively a list of spans, in y-increasing order. That is, it's a list of starting points and a corresponding list of widths; both are of length `count'. */ for (i = 0; i < paintedSet->ngroups; i++) if (paintedSet->groups[i]->group[0].count > 0) miPaintCanvas (canvas, paintedSet->groups[i]->pixel, paintedSet->groups[i]->group[0].count, paintedSet->groups[i]->group[0].points, paintedSet->groups[i]->group[0].widths, offset); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_fllarc.c��������������������������������������������������������������������0000644�0001750�0001750�00000053504�10346060125�013725� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Original author unknown (Bob Scheifler?). Hacked by Robert S. Maier, 1998-1999. */ /* This module provides the function miFillArcs_internal(), which fills a poly-arc. All painting goes through the low-level MI_PAINT_SPANS() macro. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #include "mi_fllarc.h" #define QUADRANT (90 * 64) #define HALFCIRCLE (180 * 64) #define QUADRANT3 (270 * 64) /* trig functions, angle specified in 1/64 degrees */ #define Dsin(d) sin((double)d*(M_PI/11520.0)) #define Dcos(d) cos((double)d*(M_PI/11520.0)) /* internal functions that do painting of pixels */ static void miFillArcSliceD (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc); static void miFillArcSliceI (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc); static void miFillEllipseD (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc); static void miFillEllipseI (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc); /* internal functions that don't do painting of pixels */ static void miEllipseAngleToSlope (int angle, unsigned int width, unsigned int height, int *dxp, int *dyp, double *d_dxp, double *d_dyp); static void miFillArcDSetup (const miArc *arc, miFillArcD *info); static void miFillArcSetup (const miArc *arc, miFillArc *info); static void miFillArcSliceSetup (const miGC *pGC, const miArc *arc, miArcSlice *slice); static void miGetArcEdge (const miArc *arc, miSliceEdge *edge, int k, bool top, bool left); static void miGetPieEdge (const miArc *arc, int angle, miSliceEdge *edge, bool top, bool left); static void miFillArcSetup (const miArc *arc, miFillArc *info) { info->y = arc->height >> 1; info->dy = arc->height & 1; info->yorg = arc->y + info->y; info->dx = arc->width & 1; info->xorg = arc->x + (int)(arc->width >> 1) + info->dx; info->dx = 1 - info->dx; if (arc->width == arc->height) /* circular arc */ { /* (2x - 2xorg)^2 = d^2 - (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ info->ym = 8; info->xm = 8; info->yk = info->y << 3; if (!info->dx) { info->xk = 0; info->e = -1; } else { info->y++; info->yk += 4; info->xk = -4; info->e = - (info->y << 3); } } else /* non-circular arc */ { /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ info->ym = (arc->width * arc->width) << 3; info->xm = (arc->height * arc->height) << 3; info->yk = info->y * info->ym; if (!info->dy) info->yk -= info->ym >> 1; if (!info->dx) { info->xk = 0; info->e = - (info->xm >> 3); } else { info->y++; info->yk += info->ym; info->xk = -(info->xm >> 1); info->e = info->xk - info->yk; } } } static void miFillArcDSetup (const miArc *arc, miFillArcD *info) { /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ info->y = arc->height >> 1; info->dy = arc->height & 1; info->yorg = arc->y + info->y; info->dx = arc->width & 1; info->xorg = arc->x + (int)(arc->width >> 1) + info->dx; info->dx = 1 - info->dx; info->ym = ((double)arc->width) * (arc->width * 8); info->xm = ((double)arc->height) * (arc->height * 8); info->yk = info->y * info->ym; if (!info->dy) info->yk -= (0.5 * info->ym); if (!info->dx) { info->xk = 0; info->e = - (0.125 * info->xm); } else { info->y++; info->yk += info->ym; info->xk = -0.5 * info->xm; info->e = info->xk - info->yk; } } static void miGetArcEdge (const miArc *arc, miSliceEdge *edge, int k, bool top, bool left) { int xady, y; y = arc->height >> 1; if ((arc->width & 1) == 0) y++; if (!top) { y = -y; if (arc->height & 1) y--; } xady = k + y * edge->dx; if (xady <= 0) edge->x = - ((-xady) / edge->dy + 1); else edge->x = (xady - 1) / edge->dy; edge->e = xady - edge->x * edge->dy; if ((top && (edge->dx < 0)) || (!top && (edge->dx > 0))) edge->e = edge->dy - edge->e + 1; if (left) edge->x++; edge->x += arc->x + (int)(arc->width >> 1); if (edge->dx > 0) { edge->deltax = 1; edge->stepx = edge->dx / edge->dy; edge->dx = edge->dx % edge->dy; } else { edge->deltax = -1; edge->stepx = - ((-edge->dx) / edge->dy); edge->dx = (-edge->dx) % edge->dy; } if (!top) { edge->deltax = -edge->deltax; edge->stepx = -edge->stepx; } } static void miEllipseAngleToSlope (int angle, unsigned int width, unsigned int height, int *dxp, int *dyp, double *d_dxp, double *d_dyp) { int dx, dy; double d_dx, d_dy, scale; bool negative_dx, negative_dy; switch (angle) { case 0: *dxp = -1; *dyp = 0; if (d_dxp) { *d_dxp = 0.5 * (int)width; *d_dyp = 0; } break; case QUADRANT: *dxp = 0; *dyp = 1; if (d_dxp) { *d_dxp = 0; *d_dyp = -0.5 * (int)height; } break; case HALFCIRCLE: *dxp = 1; *dyp = 0; if (d_dxp) { *d_dxp = -0.5 * (int)width; *d_dyp = 0; } break; case QUADRANT3: *dxp = 0; *dyp = -1; if (d_dxp) { *d_dxp = 0; *d_dyp = 0.5 * (int)height; } break; default: /* angle is not 0, 90, 180, or 270 */ d_dx = Dcos(angle) * (int)width; d_dy = Dsin(angle) * (int)height; if (d_dxp) { *d_dxp = 0.5 * d_dx; *d_dyp = -0.5 * d_dy; } negative_dx = false; if (d_dx < 0.0) { d_dx = -d_dx; negative_dx = true; } negative_dy = false; if (d_dy < 0.0) { d_dy = -d_dy; negative_dy = true; } scale = d_dx; if (d_dy > d_dx) scale = d_dy; dx = IFLOOR((d_dx * 32768) / scale + 0.5); if (negative_dx) dx = -dx; *dxp = dx; dy = IFLOOR((d_dy * 32768) / scale + 0.5); if (negative_dy) dy = -dy; *dyp = dy; break; } } static void miGetPieEdge (const miArc *arc, int angle, miSliceEdge *edge, bool top, bool left) { int k; int dx, dy; /* why no signdx, signdy? */ miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, NULL, NULL); if (dy == 0) { edge->x = left ? INT_MIN : INT_MAX; edge->stepx = 0; edge->e = 0; edge->dx = -1; return; } if (dx == 0) { edge->x = arc->x + (int)(arc->width >> 1); if (left && (arc->width & 1)) edge->x++; else if (!left && !(arc->width & 1)) edge->x--; edge->stepx = 0; edge->e = 0; edge->dx = -1; return; } if (dy < 0) { dx = -dx; dy = -dy; } k = (arc->height & 1) ? dx : 0; if (arc->width & 1) k += dy; edge->dx = dx << 1; edge->dy = dy << 1; miGetArcEdge (arc, edge, k, top, left); } static void miFillArcSliceSetup (const miGC *pGC, const miArc *arc, miArcSlice *slice) { int angle1, angle2; angle1 = arc->angle1; if (arc->angle2 < 0) { angle2 = angle1; angle1 += arc->angle2; } else angle2 = angle1 + arc->angle2; while (angle1 < 0) angle1 += FULLCIRCLE; while (angle1 >= FULLCIRCLE) angle1 -= FULLCIRCLE; while (angle2 < 0) angle2 += FULLCIRCLE; while (angle2 >= FULLCIRCLE) angle2 -= FULLCIRCLE; slice->min_top_y = 0; slice->max_top_y = arc->height >> 1; slice->min_bot_y = 1 - (arc->height & 1); slice->max_bot_y = slice->max_top_y - 1; slice->flip_top = false; slice->flip_bot = false; switch (pGC->arcMode) { case MI_ARC_CHORD: /* chord filling, not pie slice */ default: { double w2, h2, x1, y1, x2, y2, dx, dy, scale; int signdx, signdy, y, k; bool isInt1 = true, isInt2 = true; w2 = 0.5 * (double)arc->width; h2 = 0.5 * (double)arc->height; if ((angle1 == 0) || (angle1 == HALFCIRCLE)) { x1 = angle1 ? -w2 : w2; y1 = 0.0; } else if ((angle1 == QUADRANT) || (angle1 == QUADRANT3)) { x1 = 0.0; y1 = (angle1 == QUADRANT) ? h2 : -h2; } else { isInt1 = false; x1 = Dcos(angle1) * w2; y1 = Dsin(angle1) * h2; } if ((angle2 == 0) || (angle2 == HALFCIRCLE)) { x2 = angle2 ? -w2 : w2; y2 = 0.0; } else if ((angle2 == QUADRANT) || (angle2 == QUADRANT3)) { x2 = 0.0; y2 = (angle2 == QUADRANT) ? h2 : -h2; } else { isInt2 = false; x2 = Dcos(angle2) * w2; y2 = Dsin(angle2) * h2; } dx = x2 - x1; dy = y2 - y1; if (arc->height & 1) { y1 -= 0.5; y2 -= 0.5; } if (arc->width & 1) { x1 += 0.5; x2 += 0.5; } if (dy < 0.0) { dy = -dy; signdy = -1; } else signdy = 1; if (dx < 0.0) { dx = -dx; signdx = -1; } else signdx = 1; if (isInt1 && isInt2) { slice->edge1.dx = (int)(dx * 2); slice->edge1.dy = (int)(dy * 2); } else { scale = (dx > dy) ? dx : dy; slice->edge1.dx = IFLOOR((dx * 32768) / scale + .5); slice->edge1.dy = IFLOOR((dy * 32768) / scale + .5); } if (!slice->edge1.dy) { if (signdx < 0) { y = IFLOOR(y1 + 1.0); if (y >= 0) { slice->min_top_y = y; slice->min_bot_y = arc->height; } else { slice->max_bot_y = -y - (arc->height & 1); } } else { y = IFLOOR(y1); if (y >= 0) slice->max_top_y = y; else { slice->min_top_y = arc->height; slice->min_bot_y = -y - (arc->height & 1); } } slice->edge1_top = true; slice->edge1.x = INT_MAX; slice->edge1.stepx = 0; slice->edge1.e = 0; slice->edge1.dx = -1; slice->edge2 = slice->edge1; slice->edge2_top = false; } else if (!slice->edge1.dx) { if (signdy < 0) x1 -= 1.0; slice->edge1.x = ICEIL(x1); slice->edge1_top = (signdy < 0 ? true : false); slice->edge1.x += arc->x + (int)(arc->width >> 1); slice->edge1.stepx = 0; slice->edge1.e = 0; slice->edge1.dx = -1; slice->edge2_top = (slice->edge1_top ? false : true); slice->edge2 = slice->edge1; } else { if (signdx < 0) slice->edge1.dx = -slice->edge1.dx; if (signdy < 0) slice->edge1.dx = -slice->edge1.dx; k = ICEIL(((x1 + x2) * slice->edge1.dy - (y1 + y2) * slice->edge1.dx) / 2.0); slice->edge2.dx = slice->edge1.dx; slice->edge2.dy = slice->edge1.dy; slice->edge1_top = (signdy < 0 ? true : false); slice->edge2_top = (slice->edge1_top ? false : true); miGetArcEdge(arc, &slice->edge1, k, slice->edge1_top, (slice->edge1_top ? false : true)); miGetArcEdge(arc, &slice->edge2, k, slice->edge2_top, slice->edge2_top); } } break; case MI_ARC_PIE_SLICE: /* pie slice filling, not chord */ slice->edge1_top = (angle1 < HALFCIRCLE ? true : false); slice->edge2_top = (angle2 <= HALFCIRCLE ? true : false); if ((angle2 == 0) || (angle1 == HALFCIRCLE)) { if (angle2 ? slice->edge2_top : slice->edge1_top) slice->min_top_y = slice->min_bot_y; else slice->min_top_y = arc->height; slice->min_bot_y = 0; } else if ((angle1 == 0) || (angle2 == HALFCIRCLE)) { slice->min_top_y = slice->min_bot_y; if (angle1 ? slice->edge1_top : slice->edge2_top) slice->min_bot_y = (int)arc->height; else slice->min_bot_y = 0; } else if (slice->edge1_top == slice->edge2_top) { if (angle2 < angle1) { slice->flip_top = slice->edge1_top; slice->flip_bot = (slice->edge1_top ? false : true); } else if (slice->edge1_top) { slice->min_top_y = 1; slice->min_bot_y = (int)arc->height; } else { slice->min_bot_y = 0; slice->min_top_y = (int)arc->height; } } miGetPieEdge(arc, angle1, &slice->edge1, slice->edge1_top, (slice->edge1_top ? false : true)); miGetPieEdge(arc, angle2, &slice->edge2, slice->edge2_top, slice->edge2_top); break; } } #define ADDSPANS(pts_upper, pts_lower, wids_upper, wids_lower, x, y, slw, e, xk, xorg, yorg, dy) \ pts_upper->x = xorg - x; \ pts_upper->y = yorg - y; \ *wids_upper = (unsigned int)slw; \ pts_upper++; \ wids_upper++; \ if (MIFILLARCLOWER(e, xk, y, dy, slw)) \ { \ pts_lower->x = xorg - x; \ pts_lower->y = yorg + y + dy; \ pts_lower--; \ *wids_lower-- = (unsigned int)slw; \ } static void miFillEllipseI (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc) { int x, y, e; int yk, xk, ym, xm, dx, dy, xorg, yorg; int slw; miFillArc info; miPoint *points_upper, *points_lower, *pts_upper, *pts_lower; unsigned int *widths_upper, *widths_lower, *wids_upper, *wids_lower; int numUpperSpans, numLowerSpans; points_upper = (miPoint *)mi_xmalloc (sizeof(miPoint) * arc->height); widths_upper = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * arc->height); pts_upper = points_upper; wids_upper = widths_upper; points_lower = (miPoint *)mi_xmalloc (sizeof(miPoint) * arc->height); widths_lower = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * arc->height); pts_lower = points_lower + (arc->height - 1); /* begin at end, will decr */ wids_lower = widths_lower + (arc->height - 1); miFillArcSetup(arc, &info); MIFILLARCSETUP(info, x, y, e, xk, xm, yk, ym, dx, dy, xorg, yorg); while (y > 0) /* add an upper and maybe a lower span (resp. growing downward, upward) */ { MIFILLARCSTEP(x, y, e, xk, xm, yk, ym, dx, slw); /* y-- */ ADDSPANS(pts_upper, pts_lower, wids_upper, wids_lower, x, y, slw, e, xk, xorg, yorg, dy); } numUpperSpans = pts_upper - points_upper; numLowerSpans = points_lower + (arc->height - 1) - pts_lower; if (numUpperSpans > 0) MI_PAINT_SPANS(paintedSet, pGC->pixels[1], numUpperSpans, points_upper, widths_upper) if (numLowerSpans > 0) MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[1], numLowerSpans, pts_lower + 1, wids_lower + 1) free (points_lower); free (widths_lower); } static void miFillEllipseD (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc) { int x, y; int xorg, yorg, dx, dy, slw; double e, yk, xk, ym, xm; miFillArcD info; miPoint *points_upper, *points_lower, *pts_upper, *pts_lower; unsigned int *widths_upper, *widths_lower, *wids_upper, *wids_lower; int numUpperSpans, numLowerSpans; points_upper = (miPoint *)mi_xmalloc (sizeof(miPoint) * arc->height); widths_upper = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * arc->height); pts_upper = points_upper; wids_upper = widths_upper; points_lower = (miPoint *)mi_xmalloc (sizeof(miPoint) * arc->height); widths_lower = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * arc->height); pts_lower = points_lower + (arc->height - 1); /* begin at end, will decr */ wids_lower = widths_lower + (arc->height - 1); miFillArcDSetup(arc, &info); MIFILLARCSETUP(info, x, y, e, xk, xm, yk, ym, dx, dy, xorg, yorg); while (y > 0) /* add an upper and maybe a lower span (resp. growing downward, upward) */ { MIFILLARCSTEP(x, y, e, xk, xm, yk, ym, dx, slw); /* y-- */ ADDSPANS(pts_upper, pts_lower, wids_upper, wids_lower, x, y, slw, e, xk, xorg, yorg, dy); } numUpperSpans = pts_upper - points_upper; numLowerSpans = points_lower + (arc->height - 1) - pts_lower; if (numUpperSpans > 0) MI_PAINT_SPANS(paintedSet, pGC->pixels[1], numUpperSpans, points_upper, widths_upper) if (numLowerSpans > 0) MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[1], numLowerSpans, pts_lower + 1, wids_lower + 1) free (points_lower); free (widths_lower); } #define ADDSPAN(pts, wids, lower, l, r, ya) \ if (r >= l) \ { \ pts->x = l; \ pts->y = ya; \ *wids = (unsigned int)(r - l + 1); \ if (lower) \ { pts--; wids--; } \ else \ { pts++; wids++; } \ } #define ADDSLICESPANS(pts, wids, lower, xl, xr, xorg, ya, flip) \ if (!flip) \ { \ ADDSPAN(pts, wids, lower, xl, xr, ya) \ } \ else \ { \ int xc; \ xc = xorg - x; \ ADDSPAN(pts, wids, lower, xc, xr, ya) \ xc += (slw - 1); \ ADDSPAN(pts, wids, lower, xl, xc, ya) \ } static void miFillArcSliceI (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc) { int yk, xk, ym, xm, dx, dy, xorg, yorg, slw, orig_slw; int x, y, e; miFillArc info; miArcSlice slice; int ya, xl, xr; miPoint *points_upper, *points_lower, *pts_upper, *pts_lower; unsigned int *widths_upper, *widths_lower, *wids_upper, *wids_lower; int numUpperSpans, numLowerSpans; miFillArcSetup (arc, &info); miFillArcSliceSetup (pGC, arc, &slice); MIFILLARCSETUP(info, x, y, e, xk, xm, yk, ym, dx, dy, xorg, yorg); slw = (int)arc->height; if (slice.flip_top || slice.flip_bot) slw += (int)(arc->height >> 1) + 1; orig_slw = slw; points_upper = (miPoint *)mi_xmalloc (sizeof(miPoint) * slw); widths_upper = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * slw); pts_upper = points_upper; wids_upper = widths_upper; points_lower = (miPoint *)mi_xmalloc (sizeof(miPoint) * slw); widths_lower = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * slw); pts_lower = points_lower + (slw - 1); /* begin at end, will decrement */ wids_lower = widths_lower + (slw - 1); while (y > 0) { MIFILLARCSTEP(x, y, e, xk, xm, yk, ym, dx, slw); /* y-- */ MIARCSLICESTEP(slice.edge1); MIARCSLICESTEP(slice.edge2); if (MIFILLSLICEUPPER(y, slice)) /* add an `upper' span (growing downward) */ { bool lower = false; ya = yorg - y; MIARCSLICEUPPER(xl, xr, slice, slw) ADDSLICESPANS(pts_upper, wids_upper, lower, xl, xr, xorg, ya, slice.flip_top) } if (MIFILLSLICELOWER(y, slice)) /* add a `lower' span (growing upward) */ { bool lower = true; ya = yorg + y + dy; MIARCSLICELOWER(xl, xr, slice, slw) ADDSLICESPANS(pts_lower, wids_lower, lower, xl, xr, xorg, ya, slice.flip_bot) } } numUpperSpans = pts_upper - points_upper; numLowerSpans = points_lower + (orig_slw - 1) - pts_lower; if (numUpperSpans > 0) MI_PAINT_SPANS(paintedSet, pGC->pixels[1], numUpperSpans, points_upper, widths_upper) if (numLowerSpans > 0) MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[1], numLowerSpans, pts_lower + 1, wids_lower + 1) free (points_lower); free (widths_lower); } static void miFillArcSliceD (miPaintedSet *paintedSet, const miGC *pGC, const miArc *arc) { int x, y; int dx, dy, xorg, yorg, slw, orig_slw; double e, yk, xk, ym, xm; miFillArcD info; miArcSlice slice; int ya, xl, xr; miPoint *points_upper, *points_lower, *pts_upper, *pts_lower; unsigned int *widths_upper, *widths_lower, *wids_upper, *wids_lower; int numUpperSpans, numLowerSpans; miFillArcDSetup (arc, &info); miFillArcSliceSetup (pGC, arc, &slice); MIFILLARCSETUP(info, x, y, e, xk, xm, yk, ym, dx, dy, xorg, yorg); slw = (int)arc->height; if (slice.flip_top || slice.flip_bot) slw += (int)(arc->height >> 1) + 1; orig_slw = slw; points_upper = (miPoint *)mi_xmalloc (sizeof(miPoint) * slw); widths_upper = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * slw); pts_upper = points_upper; wids_upper = widths_upper; points_lower = (miPoint *)mi_xmalloc (sizeof(miPoint) * slw); widths_lower = (unsigned int *)mi_xmalloc (sizeof(unsigned int) * slw); pts_lower = points_lower + (slw - 1); /* begin at end, will decrement */ wids_lower = widths_lower + (slw - 1); while (y > 0) { MIFILLARCSTEP(x, y, e, xk, xm, yk, ym, dx, slw); /* y-- */ MIARCSLICESTEP(slice.edge1); MIARCSLICESTEP(slice.edge2); if (MIFILLSLICEUPPER(y, slice)) /* add an `upper' span (growing downward) */ { bool lower = false; ya = yorg - y; MIARCSLICEUPPER(xl, xr, slice, slw) ADDSLICESPANS(pts_upper, wids_upper, lower, xl, xr, xorg, ya, slice.flip_top) } if (MIFILLSLICELOWER(y, slice)) /* add a `lower' span (growing upward) */ { bool lower = true; ya = yorg + y + dy; MIARCSLICELOWER(xl, xr, slice, slw) ADDSLICESPANS(pts_lower, wids_lower, lower, xl, xr, xorg, ya, slice.flip_bot) } } numUpperSpans = pts_upper - points_upper; numLowerSpans = points_lower + (orig_slw - 1) - pts_lower; if (numUpperSpans > 0) MI_PAINT_SPANS(paintedSet, pGC->pixels[1], numUpperSpans, points_upper, widths_upper) if (numLowerSpans > 0) MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[1], numLowerSpans, pts_lower + 1, wids_lower + 1) free (points_lower); free (widths_lower); } void miFillArcs_internal (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs) { int i; const miArc *arc; for (i = narcs, arc = parcs; --i >= 0; arc++) { if (MI_FILLED_ARC_IS_EMPTY(arc)) continue; if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE)) { if (MI_CAN_FILL_ARC(arc)) /* circle; or width, height <= 800 */ miFillEllipseI (paintedSet, pGC, arc); else miFillEllipseD (paintedSet, pGC, arc); } else { if (MI_CAN_FILL_ARC(arc)) /* circle; or width, height <= 800 */ miFillArcSliceI (paintedSet, pGC, arc); else miFillArcSliceD (paintedSet, pGC, arc); } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_fllrct.c��������������������������������������������������������������������0000644�0001750�0001750�00000005025�10346060154�013745� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" /* mi rectangles written by Todd Newman, with debts to all and sundry */ /* Very straightforward. We let the low-level paint function invoked by * MI_PAINT_SPANS() worry about clipping to the destination. * * Note libxmi's convention: right edges and bottom edges of filled * polygons (including rectangles) are unpainted, so that adjacent polygons * will abut with no overlaps or gaps. */ void miFillRectangles_internal (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *prectInit) { const miRectangle *prect; /* ensure we have >=1 rects to fill */ if (nrects <= 0) return; prect = prectInit; while (nrects--) { miPoint *ppt; miPoint *pptFirst; int xorg, yorg; unsigned int *pw, *pwFirst; unsigned int height, width, countdown; height = prect->height; width = prect->width; pptFirst = (miPoint *)mi_xmalloc (height * sizeof(miPoint)); pwFirst = (unsigned int *)mi_xmalloc (height * sizeof(unsigned int)); ppt = pptFirst; pw = pwFirst; xorg = prect->x; yorg = prect->y; countdown = height; while (countdown--) { *pw++ = width; ppt->x = xorg; ppt->y = yorg; ppt++; yorg++; } /* paint to paintedSet, or if that's NULL, to canvas */ MI_PAINT_SPANS(paintedSet, pGC->pixels[1], (int)height, pptFirst, pwFirst) prect++; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_fplycon.c�������������������������������������������������������������������0000644�0001750�0001750�00000014753�10346060163�014141� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_api.h" #include "mi_fply.h" /* forward references */ static int GetFPolyYBounds (const SppPoint *pts, int n, double yFtrans, int *by, int *ty); /* * Written by Todd Newman; April 1987. * Hacked by Robert S. Maier, 1998-1999. * * Fill a convex polygon, with SPP (subpixel placement) of vertices. If * the given polygon is not convex, then the result is undefined. All * painting goes through the low-level MI_PAINT_SPANS() macro. * * In libxmi, this is used to draw polygonal line caps and line joins for * poly-arcs. See mi_arc.c. * * The algorithm is to order the edges from smallest y to largest y, by * partitioning the array into a left edge list and a right edge list. The * algorithm used to traverse each edge is the digital differencing * analyzer line algorithm, with y as the major axis. There's some funny * linear interpolation involved because of the subpixel postioning. */ /* ARGS: count = # points, ptsIn = points, xTrans,yTrans = translation for each point, xFtrans,yFtrans = translation before conversion, which provides a mechanism to match rounding errors with any shape that meets the polygon exactly. */ void miFillSppPoly (miPaintedSet *paintedSet, miPixel pixel, int count, const SppPoint *ptsIn, int xTrans, int yTrans, double xFtrans, double yFtrans) { double xl = 0.0, /* x vals of left and right edges */ xr = 0.0, ml = 0.0, /* left edge slope */ mr = 0.0, /* right edge slope */ dy, /* delta y */ i; /* loop counter */ int y, /* current scanline */ j, imin, /* index of vertex with smallest y */ ymin, /* y-extents of polygon */ ymax; int left, right, /* indices to first endpoints */ nextleft, nextright; /* indices to second endpoints */ int *Marked; /* set if this vertex has been used */ unsigned int *width, *FirstWidth; /* output buffer */ miPoint *ptsOut, *FirstPoint; /* output buffer */ imin = GetFPolyYBounds (ptsIn, count, yFtrans, &ymin, &ymax); y = ymax - ymin + 1; if ((count < 3) || (y <= 0)) return; ptsOut = FirstPoint = (miPoint *)mi_xmalloc(sizeof(miPoint) * y); width = FirstWidth = (unsigned int *)mi_xmalloc(sizeof(unsigned int) * y); Marked = (int *) mi_xmalloc(sizeof(int) * count); for (j = 0; j < count; j++) Marked[j] = 0; nextleft = nextright = imin; Marked[imin] = -1; y = ICEIL(ptsIn[nextleft].y + yFtrans); /* * loop through all edges of the polygon */ do { /* add a left edge if we need to */ if ((y > (ptsIn[nextleft].y + yFtrans) || ISEQUAL(y, ptsIn[nextleft].y + yFtrans)) && Marked[nextleft] != 1) { Marked[nextleft]++; left = nextleft++; /* find the next edge, considering the end conditions */ if (nextleft >= count) nextleft = 0; /* now compute the starting point and slope */ dy = ptsIn[nextleft].y - ptsIn[left].y; if (dy != 0.0) { ml = (ptsIn[nextleft].x - ptsIn[left].x) / dy; dy = y - (ptsIn[left].y + yFtrans); xl = (ptsIn[left].x + xFtrans) + ml * DMAX(dy, 0); } } /* add a right edge if we need to */ if ((y > ptsIn[nextright].y + yFtrans) || (ISEQUAL(y, ptsIn[nextright].y + yFtrans) && Marked[nextright] != 1)) { Marked[nextright]++; right = nextright--; /* find the next edge, considering the end conditions */ if (nextright < 0) nextright = count - 1; /* now compute the starting point and slope */ dy = ptsIn[nextright].y - ptsIn[right].y; if (dy != 0.0) { mr = (ptsIn[nextright].x - ptsIn[right].x) / dy; dy = y - (ptsIn[right].y + yFtrans); xr = (ptsIn[right].x + xFtrans) + mr * DMAX(dy, 0); } } /* * generate scans to fill while we still have * a right edge as well as a left edge. */ i = (DMIN(ptsIn[nextleft].y, ptsIn[nextright].y) + yFtrans) - y; if (i < EPSILON) { if(Marked[nextleft] && Marked[nextright]) { /* Arrgh, we're trapped! (no more points) * Out, we've got to get out of here before this decadence saps * our will completely! */ break; } continue; } else { j = (int) i; if (!j) j++; } while (j > 0) { int cxl, cxr; ptsOut->y = (y) + yTrans; cxl = ICEIL(xl); cxr = ICEIL(xr); /* reverse the edges if necessary */ if (xl < xr) { *(width++) = (unsigned int)(cxr - cxl); (ptsOut++)->x = cxl + xTrans; } else { *(width++) = (unsigned int)(cxl - cxr); (ptsOut++)->x = cxr + xTrans; } y++; /* increment down the edges */ xl += ml; xr += mr; j--; } } while (y <= ymax); free (Marked); /* paint the spans (to miPaintedSet, or if NULL, to the canvas) */ MI_PAINT_SPANS(paintedSet, pixel, ptsOut - FirstPoint, FirstPoint, FirstWidth) } /* Find the index of the point with the smallest y. Also return the smallest and largest y. */ static int GetFPolyYBounds (const SppPoint *pts, int n, double yFtrans, int *by, int *ty) { const SppPoint *ptsStart = pts; const SppPoint *ptMin; double ymin, ymax; ptMin = pts; ymin = ymax = (pts++)->y; while (--n > 0) { if (pts->y < ymin) { ptMin = pts; ymin = pts->y; } if(pts->y > ymax) ymax = pts->y; pts++; } *by = ICEIL(ymin + yFtrans); *ty = ICEIL(ymax + yFtrans - 1); return (ptMin - ptsStart); } ���������������������plotutils-2.6/libxmi/mi_gc.c������������������������������������������������������������������������0000644�0001750�0001750�00000014004�10346061056�013047� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* These functions create, manipulate and destroy miGC structures. A pointer to an miGC is passed as the third argument to each of libxmi's public drawing functions. It comprises high-level drawing parameters. The miGC structure is defined in mi_gc.h. */ #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" /* create a new miGC, with elements initialized to default values (the same default values that are used by X11) */ miGC * miNewGC (int npixels, const miPixel *pixels) { miGC *new_gc; int i; new_gc = (miGC *)mi_xmalloc (sizeof (miGC)); new_gc->fillRule = MI_EVEN_ODD_RULE; new_gc->joinStyle = MI_JOIN_MITER; new_gc->capStyle = MI_CAP_BUTT; new_gc->lineStyle = MI_LINE_SOLID; new_gc->arcMode = MI_ARC_PIE_SLICE; new_gc->lineWidth = (unsigned int)0; new_gc->miterLimit = 10.43; /* same as hardcoded in X11 */ new_gc->dashOffset = 0; new_gc->numInDashList = 2; new_gc->dash = (unsigned int *)mi_xmalloc (2 * sizeof(unsigned int)); for (i = 0; i < 2; i++) new_gc->dash[i] = 4; /* { 4, 4 }; same as in X11? */ new_gc->numPixels = npixels; new_gc->pixels = (miPixel *)mi_xmalloc (npixels * sizeof (miPixel)); for (i = 0; i < npixels; i++) new_gc->pixels[i] = pixels[i]; return new_gc; } /* destroy (deallocate) an miGC */ void miDeleteGC (miGC *pGC) { if (pGC == (miGC *)NULL) return; if (pGC->dash) free (pGC->dash); free (pGC->pixels); free (pGC); } /* copy an miGC */ miGC * miCopyGC (const miGC *pGC) { miGC *new_gc; int i; if (pGC == (const miGC *)pGC) return (miGC *)NULL; new_gc = (miGC *)mi_xmalloc (sizeof (miGC)); new_gc->fillRule = pGC->fillRule; new_gc->joinStyle = pGC->joinStyle; new_gc->capStyle = pGC->capStyle; new_gc->lineStyle = pGC->lineStyle; new_gc->arcMode = pGC->arcMode; new_gc->lineWidth = pGC->lineWidth; new_gc->miterLimit = pGC->miterLimit; new_gc->dashOffset = pGC->dashOffset; new_gc->numInDashList = pGC->numInDashList; if (pGC->numInDashList == 0) new_gc->dash = (unsigned int *)NULL; else { new_gc->dash = (unsigned int *)mi_xmalloc (pGC->numInDashList * sizeof(unsigned int)); for (i = 0; i < pGC->numInDashList; i++) new_gc->dash[i] = pGC->dash[i]; } new_gc->pixels = (miPixel *)mi_xmalloc (pGC->numPixels * sizeof(miPixel)); for (i = 0; i < pGC->numPixels; i++) new_gc->pixels[i] = pGC->pixels[i]; return new_gc; } /* set a single integer-valued miGC attribute */ void miSetGCAttrib (miGC *pGC, miGCAttribute attribute, int value) { if (pGC == (miGC *)NULL || value < 0) return; switch ((int)attribute) { case (int)MI_GC_FILL_RULE: pGC->fillRule = value; break; case (int)MI_GC_JOIN_STYLE: pGC->joinStyle = value; break; case (int)MI_GC_CAP_STYLE: pGC->capStyle = value; break; case (int)MI_GC_LINE_STYLE: pGC->lineStyle = value; break; case (int)MI_GC_ARC_MODE: pGC->arcMode = value; break; case (int)MI_GC_LINE_WIDTH: if (value >= 0) pGC->lineWidth = (unsigned int)value; break; default: /* unknown attribute type */ break; } } /* set many integer-valued miGC attributes, at a single time */ void miSetGCAttribs (miGC *pGC, int nattributes, const miGCAttribute *attributes, const int *values) { int i; miGCAttribute attribute; int value; if (nattributes <= 0 || pGC == (miGC *)NULL) return; for (i = 0; i < nattributes; i++) { attribute = *attributes++; value = *values++; if (value < 0) /* invalid; be tolerant */ continue; switch ((int)attribute) { case (int)MI_GC_FILL_RULE: pGC->fillRule = value; break; case (int)MI_GC_JOIN_STYLE: pGC->joinStyle = value; break; case (int)MI_GC_CAP_STYLE: pGC->capStyle = value; break; case (int)MI_GC_LINE_STYLE: pGC->lineStyle = value; break; case (int)MI_GC_ARC_MODE: pGC->arcMode = value; break; case (int)MI_GC_LINE_WIDTH: if (value >= 0) pGC->lineWidth = (unsigned int)value; break; default: /* unknown attribute type */ break; } } } /* set the only float-valued miGC attribute (the miter limit) */ void miSetGCMiterLimit (miGC *pGC, double value) { if (pGC == (miGC *)NULL) return; pGC->miterLimit = value; } /* set the dash-related attributes in an miGC */ void miSetGCDashes (miGC *pGC, int ndashes, const unsigned int *dashes, int offset) { int i; if (pGC == (miGC *)NULL || ndashes < 0) return; if (pGC->dash) free (pGC->dash); pGC->dashOffset = offset; pGC->numInDashList = ndashes; if (ndashes == 0) pGC->dash = (unsigned int *)NULL; else { pGC->dash = (unsigned int *)mi_xmalloc (ndashes * sizeof(unsigned int)); for (i = 0; i < ndashes; i++) pGC->dash[i] = dashes[i]; } } /* set the pixel array in a miGC */ void miSetGCPixels (miGC *pGC, int npixels, const miPixel *pixels) { int i; if (pGC == (miGC *)NULL || npixels < 2) return; free (pGC->pixels); pGC->numPixels = npixels; pGC->pixels = (miPixel *)mi_xmalloc (npixels * sizeof (miPixel)); for (i = 0; i < npixels; i++) pGC->pixels[i] = pixels[i]; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_ply.c�����������������������������������������������������������������������0000644�0001750�0001750�00000004463�10346060220�013262� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" /* * Written by Brian Kelleher; June 1986 * * Draw a polygon (supplied as a polyline, i.e. an array of points), via * one of two scan conversion routines. */ void miFillPolygon_internal (miPaintedSet *paintedSet, const miGC *pGC, miPolygonShape shape, miCoordMode mode, int count, const miPoint *pPts) { miPoint *ppt = (miPoint *)NULL; const miPoint *q; /* ensure we have >=1 points */ if (count <= 0) return; if (mode == MI_COORD_MODE_PREVIOUS) /* convert from relative to absolute coordinates */ { int i; ppt = (miPoint *)mi_xmalloc (count * sizeof(miPoint)); ppt[0] = pPts[0]; for (i = 1; i < count; i++) { ppt[i].x = ppt[i-1].x + pPts[i].x; ppt[i].y = ppt[i-1].y + pPts[i].y; } q = ppt; } else q = pPts; switch ((int)shape) { case (int)MI_SHAPE_GENERAL: default: /* use general scan conversion routine */ miFillGeneralPoly (paintedSet, pGC, count, q); break; case (int)MI_SHAPE_CONVEX: /* use special (faster) routine */ miFillConvexPoly (paintedSet, pGC, count, q); break; } if (mode == MI_COORD_MODE_PREVIOUS) free (ppt); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_plycon.c��������������������������������������������������������������������0000644�0001750�0001750�00000013440�10346060232�013760� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #include "mi_scanfill.h" /* forward references */ static int getPolyYBounds (const miPoint *pts, int n, int *by, int *ty); /* * Written by Brian Kelleher; Dec. 1985. * Hacked by Robert S. Maier, 1998-99. * * Fill a convex polygon (if the polygon is not convex then the result is * undefined). The algorithm is to order the edges from smallest y to * largest y, by partitioning the array into a left edge list and a right * edge list. The algorithm used to traverse each edge is an extension of * Bresenham's midpoint line algorithm, with y as the major axis. * * All painting goes through the low-level MI_PAINT_SPANS() macro. * * See mi_plygen.c for miFillGeneralPoly(), a slower routine that can fill * general polygons (i.e. polygons that may be non-convex or * self-intersecting). */ /* ARGS: pGC = unused */ void miFillConvexPoly (miPaintedSet *paintedSet, const miGC *pGC, int count, const miPoint *ptsIn) /* count = num of points, ptsIn = the points */ { int xl = 0, xr = 0; /* x vals of left and right edges */ int dl = 0, dr = 0; /* decision variables */ int ml = 0, m1l = 0; /* left edge slope and slope+1 */ int mr = 0, m1r = 0; /* right edge slope and slope+1 */ int incr1l = 0, incr2l = 0; /* left edge error increments */ int incr1r = 0, incr2r = 0; /* right edge error increments */ int dy; /* delta y */ int y; /* current scanline */ int left, right; /* indices to first endpoints */ int i; /* loop counter */ int nextleft, nextright; /* indices to second endpoints */ miPoint *ptsOut, *FirstPoint; /* output buffer */ unsigned int *width, *FirstWidth; /* output buffer */ int imin; /* index of smallest vertex (in y) */ int ymin; /* y-extents of polygon */ int ymax; /* * find leftx, bottomy, rightx, topy, and the index * of bottomy. Also translate the points. */ imin = getPolyYBounds(ptsIn, count, &ymin, &ymax); dy = ymax - ymin + 1; if ((count < 3) || (dy < 0)) return; ptsOut = FirstPoint = (miPoint *)mi_xmalloc(sizeof(miPoint) * dy); width = FirstWidth = (unsigned int *)mi_xmalloc(sizeof(unsigned int) * dy); nextleft = nextright = imin; y = ptsIn[nextleft].y; /* * loop through all edges of the polygon */ do { /* * add a left edge if we need to */ if (ptsIn[nextleft].y == y) { left = nextleft; /* * find the next edge, considering the end * conditions of the array. */ nextleft++; if (nextleft >= count) nextleft = 0; /* * now compute all of the random information * needed to run the iterative algorithm. */ BRESINITPGON(ptsIn[nextleft].y-ptsIn[left].y, ptsIn[left].x,ptsIn[nextleft].x, xl, dl, ml, m1l, incr1l, incr2l); } /* * add a right edge if we need to */ if (ptsIn[nextright].y == y) { right = nextright; /* * find the next edge, considering the end * conditions of the array. */ nextright--; if (nextright < 0) nextright = count-1; /* * now compute all of the random information * needed to run the iterative algorithm. */ BRESINITPGON(ptsIn[nextright].y-ptsIn[right].y, ptsIn[right].x,ptsIn[nextright].x, xr, dr, mr, m1r, incr1r, incr2r); } /* * generate scans to fill while we still have * a right edge as well as a left edge. */ i = IMIN(ptsIn[nextleft].y, ptsIn[nextright].y) - y; /* in case we're called with non-convex polygon */ if(i < 0) { free (FirstWidth); free (FirstPoint); return; } while (i-- > 0) { ptsOut->y = y; /* * reverse the edges if necessary */ if (xl < xr) { *(width++) = (unsigned int)(xr - xl); (ptsOut++)->x = xl; } else { *(width++) = (unsigned int)(xl - xr); (ptsOut++)->x = xr; } y++; /* increment down the edges */ BRESINCRPGON(dl, xl, ml, m1l, incr1l, incr2l); BRESINCRPGON(dr, xr, mr, m1r, incr1r, incr2r); } } while (y != ymax); /* * Finally, paint the spans */ MI_PAINT_SPANS(paintedSet, pGC->pixels[1], ptsOut - FirstPoint, FirstPoint, FirstWidth) } /* * Find the index of the point with the smallest y. */ static int getPolyYBounds (const miPoint *pts, int n, int *by, int *ty) { const miPoint *ptsStart = pts; const miPoint *ptMin; int ymin, ymax; ptMin = pts; ymin = ymax = (pts++)->y; while (--n > 0) { if (pts->y < ymin) { ptMin = pts; ymin = pts->y; } if(pts->y > ymax) ymax = pts->y; pts++; } *by = ymin; *ty = ymax; return (ptMin - ptsStart); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_plygen.c��������������������������������������������������������������������0000644�0001750�0001750�00000013151�10346060245�013755� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #include "mi_scanfill.h" #include "mi_ply.h" /* * * Original author: Brian Kelleher, Oct. 1985. * Hacked by Robert S. Maier, 1998-9. * * Routine to fill a general (i.e., possibly non-convex or * self-intersecting) polygon. Two fill rules are supported: WINDING and * EVENODD. All painting goes through the low-level MI_PAINT_SPANS() * macro. * * This calls utility routines in mi_plyutil.c. See mi_scanfill.h for a * complete description of the algorithm. */ /* ARGS: count = number of points, ptsIn = the points */ void miFillGeneralPoly (miPaintedSet *paintedSet, const miGC *pGC, int count, const miPoint *ptsIn) { EdgeTableEntry *pAET; /* the Active Edge Table */ int y; /* the current scanline */ int nPts = 0; /* number of pts in buffer */ EdgeTableEntry *pWETE; /* Winding Edge Table */ ScanLineList *pSLL; /* Current ScanLineList */ miPoint *ptsOut; /* ptr to output buffers */ unsigned int *width; miPoint FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */ unsigned int FirstWidth[NUMPTSTOBUFFER]; EdgeTableEntry *pPrevAET; /* previous AET entry */ EdgeTable ET; /* Edge Table header node */ EdgeTableEntry AET; /* Active ET header node */ EdgeTableEntry *pETEs; /* Edge Table Entries buff */ ScanLineListBlock SLLBlock; /* header for ScanLineList */ bool fixWAET = false; if (count <= 2) return; pETEs = (EdgeTableEntry *) mi_xmalloc(sizeof(EdgeTableEntry) * count); ptsOut = FirstPoint; width = FirstWidth; miCreateETandAET (count, ptsIn, &ET, &AET, pETEs, &SLLBlock); pSLL = ET.scanlines.next; if (pGC->fillRule == (int)MI_EVEN_ODD_RULE) { /* * for each scanline */ for (y = ET.ymin; y < ET.ymax; y++) { /* * Add a new edge to the active edge table when we * get to the next edge. */ if (pSLL && y == pSLL->scanline) { miloadAET(&AET, pSLL->edgelist); pSLL = pSLL->next; } pPrevAET = &AET; pAET = AET.next; /* * for each active edge */ while (pAET) { ptsOut->x = pAET->bres.minor_axis; ptsOut++->y = y; *width++ = (unsigned int)(pAET->next->bres.minor_axis - pAET->bres.minor_axis); nPts++; /* * send out the buffer when its full */ if (nPts == NUMPTSTOBUFFER) { MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[1], nPts, FirstPoint, FirstWidth) ptsOut = FirstPoint; width = FirstWidth; nPts = 0; } EVALUATEEDGEEVENODD(pAET, pPrevAET, y) EVALUATEEDGEEVENODD(pAET, pPrevAET, y); } miInsertionSort(&AET); } } else /* default to WindingNumber */ { /* * for each scanline */ for (y = ET.ymin; y < ET.ymax; y++) { /* * Add a new edge to the active edge table when we * get to the next edge. */ if (pSLL && y == pSLL->scanline) { miloadAET(&AET, pSLL->edgelist); micomputeWAET(&AET); pSLL = pSLL->next; } pPrevAET = &AET; pAET = AET.next; pWETE = pAET; /* * for each active edge */ while (pAET) { /* * if the next edge in the active edge table is * also the next edge in the winding active edge * table. */ if (pWETE == pAET) { ptsOut->x = pAET->bres.minor_axis; ptsOut++->y = y; *width++ = (unsigned int)(pAET->nextWETE->bres.minor_axis - pAET->bres.minor_axis); nPts++; /* * send out the buffer */ if (nPts == NUMPTSTOBUFFER) { MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[1], nPts, FirstPoint, FirstWidth) ptsOut = FirstPoint; width = FirstWidth; nPts = 0; } pWETE = pWETE->nextWETE; while (pWETE != pAET) EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); pWETE = pWETE->nextWETE; } EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); } /* * reevaluate the Winding active edge table if we * just had to resort it or if we just exited an edge. */ if (miInsertionSort(&AET) || fixWAET) { micomputeWAET(&AET); fixWAET = false; } } } /* * Get any spans that we missed by buffering */ MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[1], nPts, FirstPoint, FirstWidth) free (pETEs); miFreeStorage(SLLBlock.next); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_plypnt.c��������������������������������������������������������������������0000644�0001750�0001750�00000004317�10346060311�014003� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" /* This routine paints a set of points. All painting goes through the low-level MI_PAINT_SPANS() macro. */ /* ARGS: mode = Origin or Previous */ void miDrawPoints_internal (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { unsigned int *pwidthInit, *pwidth; int i; miPoint *ppt = (miPoint *)NULL; /* ensure we have >=1 points */ if (npt <= 0) return; ppt = (miPoint *)mi_xmalloc (npt * sizeof(miPoint)); if (mode == MI_COORD_MODE_PREVIOUS) /* convert from relative to absolute coordinates */ { ppt[0] = pPts[0]; for (i = 1; i < npt; i++) { ppt[i].x = ppt[i-1].x + pPts[i].x; ppt[i].y = ppt[i-1].y + pPts[i].y; } } else /* just copy */ { for (i = 0; i < npt; i++) ppt[i] = pPts[i]; } pwidthInit = (unsigned int *)mi_xmalloc (npt * sizeof(unsigned int)); pwidth = pwidthInit; for (i = 0; i < npt; i++) *pwidth++ = 1; if (npt > 1) miQuickSortSpansY (ppt, pwidthInit, npt); MI_PAINT_SPANS(paintedSet, pGC->pixels[1], npt, ppt, pwidthInit) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_plyutil.c�������������������������������������������������������������������0000644�0001750�0001750�00000021364�10346060316�014165� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_api.h" #include "mi_scanfill.h" #include "mi_ply.h" /* * Written by Brian Kelleher; Oct. 1985 * * This module contains all of the utility functions * needed to scan-convert a polygon. The driver subroutine, * miFillGeneralPoly(), is in mi_plygen.c. */ /* * InsertEdgeInET * * Insert the given edge into the edge table. * First we must find the correct bucket in the * Edge table, then find the right slot in the * bucket. Finally, we can insert it. * */ static void miInsertEdgeInET (EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock) { EdgeTableEntry *start, *prev; ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; /* * find the right bucket to put the edge into */ pPrevSLL = &ET->scanlines; pSLL = pPrevSLL->next; while (pSLL && (pSLL->scanline < scanline)) { pPrevSLL = pSLL; pSLL = pSLL->next; } /* * reassign pSLL (pointer to ScanLineList) if necessary */ if ((!pSLL) || (pSLL->scanline > scanline)) { if (*iSLLBlock > SLLSPERBLOCK-1) { tmpSLLBlock = (ScanLineListBlock *)mi_xmalloc(sizeof(ScanLineListBlock)); (*SLLBlock)->next = tmpSLLBlock; tmpSLLBlock->next = (ScanLineListBlock *)NULL; *SLLBlock = tmpSLLBlock; *iSLLBlock = 0; } pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]); pSLL->next = pPrevSLL->next; pSLL->edgelist = (EdgeTableEntry *)NULL; pPrevSLL->next = pSLL; } pSLL->scanline = scanline; /* * now insert the edge in the right bucket */ prev = (EdgeTableEntry *)NULL; start = pSLL->edgelist; while (start && (start->bres.minor_axis < ETE->bres.minor_axis)) { prev = start; start = start->next; } ETE->next = start; if (prev) prev->next = ETE; else pSLL->edgelist = ETE; } /* * CreateEdgeTable * * This routine creates the edge table for * scan converting polygons. * The Edge Table (ET) looks like: * * EdgeTable * -------- * | ymax | ScanLineLists * |scanline|-->------------>-------------->... * -------- |scanline| |scanline| * |edgelist| |edgelist| * --------- --------- * | | * | | * V V * list of ETEs list of ETEs * * where ETE is an EdgeTableEntry data structure, * and there is one ScanLineList per scanline at * which an edge is initially entered. * */ void miCreateETandAET(int count, const miPoint *pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) { const miPoint *top, *bottom; const miPoint *PrevPt, *CurrPt; int iSLLBlock = 0; int dy; if (count < 2) return; /* * initialize the Active Edge Table */ AET->next = (EdgeTableEntry *)NULL; AET->back = (EdgeTableEntry *)NULL; AET->nextWETE = (EdgeTableEntry *)NULL; AET->bres.minor_axis = INT_MIN; /* * initialize the Edge Table. */ ET->scanlines.next = (ScanLineList *)NULL; ET->ymax = INT_MIN; ET->ymin = INT_MAX; pSLLBlock->next = (ScanLineListBlock *)NULL; PrevPt = &pts[count-1]; /* * for each vertex in the array of points. * In this loop we are dealing with two vertices at * a time -- these make up one edge of the polygon. */ while (count--) { CurrPt = pts++; /* * find out which point is above and which is below. */ if (PrevPt->y > CurrPt->y) { bottom = PrevPt, top = CurrPt; pETEs->ClockWise = false; } else { bottom = CurrPt, top = PrevPt; pETEs->ClockWise = true; } /* * don't add horizontal edges to the Edge table. */ if (bottom->y != top->y) { pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */ /* * initialize integer edge algorithm */ dy = bottom->y - top->y; BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres); miInsertEdgeInET (ET, pETEs, top->y, &pSLLBlock, &iSLLBlock); ET->ymax = IMAX(ET->ymax, PrevPt->y); ET->ymin = IMIN(ET->ymin, PrevPt->y); pETEs++; } PrevPt = CurrPt; } } /* * loadAET * * This routine moves EdgeTableEntries from the * EdgeTable into the Active Edge Table, * leaving them sorted by smaller x coordinate. * */ void miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) { EdgeTableEntry *pPrevAET; EdgeTableEntry *tmp; pPrevAET = AET; AET = AET->next; while (ETEs) { while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis)) { pPrevAET = AET; AET = AET->next; } tmp = ETEs->next; ETEs->next = AET; if (AET) AET->back = ETEs; ETEs->back = pPrevAET; pPrevAET->next = ETEs; pPrevAET = ETEs; ETEs = tmp; } } /* * computeWAET * * This routine links the AET by the * nextWETE (winding EdgeTableEntry) link for * use by the winding number rule. The final * Active Edge Table (AET) might look something * like: * * AET * ---------- --------- --------- * |ymax | |ymax | |ymax | * | ... | |... | |... | * |next |->|next |->|next |->... * |nextWETE| |nextWETE| |nextWETE| * --------- --------- ^-------- * | | | * V-------------------> V---> ... * */ void micomputeWAET(EdgeTableEntry *AET) { EdgeTableEntry *pWETE; int inside = 1; int isInside = 0; AET->nextWETE = (EdgeTableEntry *)NULL; pWETE = AET; AET = AET->next; while (AET) { if (AET->ClockWise) isInside++; else isInside--; if ((!inside && !isInside) || ( inside && isInside)) { pWETE->nextWETE = AET; pWETE = AET; inside = !inside; } AET = AET->next; } pWETE->nextWETE = (EdgeTableEntry *)NULL; } /* * InsertionSort * * Just a simple insertion sort using * pointers and back pointers to sort the Active * Edge Table. * */ bool miInsertionSort(EdgeTableEntry *AET) { EdgeTableEntry *pETEchase; EdgeTableEntry *pETEinsert; EdgeTableEntry *pETEchaseBackTMP; bool changed = false; AET = AET->next; while (AET) { pETEinsert = AET; pETEchase = AET; while (pETEchase->back->bres.minor_axis > AET->bres.minor_axis) pETEchase = pETEchase->back; AET = AET->next; if (pETEchase != pETEinsert) { pETEchaseBackTMP = pETEchase->back; pETEinsert->back->next = AET; if (AET) AET->back = pETEinsert->back; pETEinsert->next = pETEchase; pETEchase->back->next = pETEinsert; pETEchase->back = pETEinsert; pETEinsert->back = pETEchaseBackTMP; changed = true; } } return changed; } /* * Clean up our act. */ void miFreeStorage(ScanLineListBlock *pSLLBlock) { ScanLineListBlock *tmpSLLBlock; while (pSLLBlock) { tmpSLLBlock = pSLLBlock->next; free(pSLLBlock); pSLLBlock = tmpSLLBlock; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_spans.c���������������������������������������������������������������������0000644�0001750�0001750�00000055071�10346060346�013614� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This module provides several public functions: miNewPaintedSet(), miAddSpansToPaintedSet(), miUniquifyPaintedSet(), miClearPaintedSet(), miDeletePaintedSet(). They maintain a structure called a miPaintedSet, which is essentially an array of SpanGroup structures, one per pixel value. A SpanGroup is essentially an unsorted list of Spans's. A Spans is a list of spans (i.e. horizontal ranges) of miPoints, sorted so that the starting points have increasing y-values. See mi_spans.h. Internally, each libxmi drawing function paints to a miPaintedSet by calling miAddSpansToPaintedSet() on one or more Spans's. This function adds a Spans to a miPaintedSet, being careful first to remove each from the miPaintedSet each pixel in the Spans, if it has previously been painted another color. However, for efficiency it does not check whether a pixel in the Spans has been previously painted the same color. So while the drawing function is being called, the Spans in any one of the PaintedSet's SpanGroups may overlap. But different SpanGroups do not overlap. That is an invariant. After all calls to miAddSpansToPaintedSet() are completed, duplicate pixels are resolved by invoking miUniquifyPaintedSet(). That takes place in the API wrappers in mi_api.c, just before the drawing function returns. The function miCopyPaintedSetToCanvas(), in mi_canvas.c, can copy the contents of a miPaintedSet, i.e. its spans of painted miPoints, to a miCanvas structure. Sophisticated pixel merging is supported. It would be easy to write other functions that copy pixels out of a miPaintedSet. */ /* Original version written by Joel McCormack, Summer 1989. Hacked by Robert S. Maier, 1998-1999. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_api.h" /* spans in a Spans are sorted by y, so these give ymin, ymax for a nonempty Spans */ #define YMIN(spans) (spans->points[0].y) #define YMAX(spans) (spans->points[spans->count-1].y) /* internal functions */ static SpanGroup * miNewSpanGroup (miPixel pixel); static int miUniquifySpansX (const Spans *spans, miPoint *newPoints, unsigned int *newWidths); static void miAddSpansToSpanGroup (const Spans *spans, SpanGroup *spanGroup); static void miDeleteSpanGroup (SpanGroup *spanGroup); static void miQuickSortSpansX (miPoint *points, unsigned int *widths, int numSpans); static void miSubtractSpans (SpanGroup *spanGroup, const Spans *sub); static void miUniquifySpanGroup (SpanGroup *spanGroup); /* The following functions are the public functions of this module. */ miPaintedSet * miNewPaintedSet (void) { miPaintedSet *paintedSet; paintedSet = (miPaintedSet *)mi_xmalloc (sizeof(miPaintedSet)); paintedSet->groups = (SpanGroup **)NULL; /* pointer-to-SpanGroup slots */ paintedSet->size = 0; /* slots allocated */ paintedSet->ngroups = 0; /* slots filled */ return paintedSet; } /* Add a Spans to a miPaintedSet's SpanGroup for a specified pixel values, and also subtract it from the SpanGroups for all other pixel values. */ void miAddSpansToPaintedSet (const Spans *spans, miPaintedSet *paintedSet, miPixel pixel) { bool found = false; int i; SpanGroup *spanGroup; if (spans->count == 0) return; for (i = 0; i < paintedSet->ngroups; i++) { miPixel stored_pixel; stored_pixel = paintedSet->groups[i]->pixel; if (MI_SAME_PIXEL(pixel, stored_pixel)) { found = true; /* have a spanGroup for this pixel value */ break; } } if (!found) { if (paintedSet->ngroups == paintedSet->size) /* expand array of SpanGroups */ { int old_size = paintedSet->size; int new_size = 2 * (old_size + 8); if (old_size == 0) paintedSet->groups = (SpanGroup **) mi_xmalloc(new_size * sizeof(SpanGroup *)); else paintedSet->groups = (SpanGroup **) mi_xrealloc(paintedSet->groups, new_size * sizeof(SpanGroup *)); paintedSet->size = new_size; } /* create a SpanGroup for this pixel value */ i = paintedSet->ngroups; paintedSet->groups[i] = miNewSpanGroup (pixel); paintedSet->ngroups++; } spanGroup = paintedSet->groups[i]; miAddSpansToSpanGroup (spans, spanGroup); /* subtract Spans from all other SpanGroups */ for (i = 0; i < paintedSet->ngroups; i++) { SpanGroup *otherGroup; otherGroup = paintedSet->groups[i]; if (otherGroup == spanGroup) continue; miSubtractSpans (otherGroup, spans); } } /* Deallocate all of a miPaintedSet's SpanGroups, including the points and width arrays that are part of its component Spans's. So it will effectively become the empty set, as if it had been newly created. */ void miClearPaintedSet (miPaintedSet *paintedSet) { int i; if (paintedSet == (miPaintedSet *)NULL) return; for (i = 0; i < paintedSet->ngroups; i++) miDeleteSpanGroup (paintedSet->groups[i]); if (paintedSet->size > 0) free (paintedSet->groups); paintedSet->size = 0; /* slots allocated */ paintedSet->ngroups = 0; /* slots filled */ } /* Deallocate a miPaintedSet, including the points and width arrays that are part of its component Spans's. */ void miDeletePaintedSet (miPaintedSet *paintedSet) { int i; if (paintedSet == (miPaintedSet *)NULL) return; for (i = 0; i < paintedSet->ngroups; i++) miDeleteSpanGroup (paintedSet->groups[i]); if (paintedSet->size > 0) free (paintedSet->groups); free (paintedSet); } /* `Uniquify' a miPaintedSet, i.e. uniquify each of its SpanGroups (see below). */ void miUniquifyPaintedSet (miPaintedSet *paintedSet) { int i; if (paintedSet == (miPaintedSet *)NULL) return; for (i = 0; i < paintedSet->ngroups; i++) { if (paintedSet->groups[i]->count > 0) { miUniquifySpanGroup (paintedSet->groups[i]); } } } /* Create and initialize a SpanGroup, i.e. an unsorted list of Spans's. */ static SpanGroup * miNewSpanGroup (miPixel pixel) { SpanGroup *spanGroup; spanGroup = (SpanGroup *)mi_xmalloc (sizeof(SpanGroup)); spanGroup->pixel = pixel; /* pixel to be used */ spanGroup->size = 0; /* slots allocated */ spanGroup->count = 0; /* slots filled */ spanGroup->group = (Spans *)NULL; /* slots for Spans's */ spanGroup->ymin = INT_MAX; /* min over slots */ spanGroup->ymax = INT_MIN; /* max over slots */ return spanGroup; } /* Add a Spans to a SpanGroup, by tacking it on the end; update SpanGroup's ymin, ymax. */ static void miAddSpansToSpanGroup (const Spans *spans, SpanGroup *spanGroup) { int ymin, ymax; if (spans->count == 0) return; if (spanGroup->size == spanGroup->count) /* expand SpanGroup */ { spanGroup->size = (spanGroup->size + 8) * 2; spanGroup->group = (Spans *) mi_xrealloc(spanGroup->group, sizeof(Spans) * spanGroup->size); } /* tack Spans onto end of SpanGroup, update SpanGroup's ymin and ymax */ spanGroup->group[spanGroup->count] = *spans; (spanGroup->count)++; ymin = YMIN(spans); if (ymin < spanGroup->ymin) spanGroup->ymin = ymin; ymax = YMAX(spans); if (ymax > spanGroup->ymax) spanGroup->ymax = ymax; } /* Delete a SpanGroup, including the point and width arrays that are part of each Spans. */ static void miDeleteSpanGroup (SpanGroup *spanGroup) { int i; if (spanGroup == (SpanGroup *)NULL) return; for (i = 0; i < spanGroup->count; i++) { /* free spanGroup->group[i], which is a Spans */ free (spanGroup->group[i].points); free (spanGroup->group[i].widths); } if (spanGroup->group) free (spanGroup->group); free (spanGroup); } /* Subtract a Spans from a SpanGroup, i.e. from each of its Spans's; update SpanGroup's ymin, ymax. */ static void miSubtractSpans (SpanGroup *spanGroup, const Spans *sub) { int i, subCount, spansCount; int ymin, ymax, xmin, xmax; Spans *spans; miPoint *subPt, *spansPt; unsigned int *subWid, *spansWid; int extra; bool gross_change = false; if (sub->count == 0) /* nothing to do */ return; /* y range of Spans to be subtracted */ ymin = YMIN(sub); ymax = YMAX(sub); /* loop through all Spans's in SpanGroup */ spans = spanGroup->group; for (i = spanGroup->count; i > 0; i--, spans++) { if (spans->count == 0) continue; /* look only at Spans's with y ranges that overlap with `sub' */ if (YMIN(spans) <= ymax && ymin <= YMAX(spans)) { /* count, start points, and widths for `sub' */ subCount = sub->count; subPt = sub->points; subWid = sub->widths; /* count, start points, and widths for current Spans */ spansCount = spans->count; spansPt = spans->points; spansWid = spans->widths; extra = 0; /* extra span slots available in Spans */ for (;;) /* look at pairs of spans, one from each Spans, that have the same value for y (break out when one or the other Spans is exhausted) */ { while (spansCount && spansPt->y < subPt->y) { spansPt++; spansWid++; spansCount--; } if (!spansCount) break; while (subCount && subPt->y < spansPt->y) { subPt++; subWid++; subCount--; } if (!subCount) break; if (subPt->y == spansPt->y) /* the two spans are at same y value, analyse in detail */ { xmin = subPt->x; xmax = xmin + (int)(*subWid); /* just right of sub span */ if (xmin >= spansPt->x + (int)(*spansWid) || spansPt->x >= xmax) /* non-overlapping, do nothing */ { ; } else if (xmin <= spansPt->x) /* span to be subtracted begins at the same point, or to the left */ { if (xmax >= spansPt->x + (int)(*spansWid)) /* span to be subtracted ends at the same point, or to the right; delete this span by downshifting */ { memmove (spansPt, spansPt + 1, sizeof(miPoint) * (spansCount - 1)); memmove (spansWid, spansWid + 1, sizeof(unsigned int) * (spansCount - 1)); spansPt--; spansWid--; spans->count--; extra++; gross_change = true; /* span vanished */ } else /* span to be subtracted ends to the left of this one's ending point; alter ending point and width */ { *spansWid = *spansWid - (unsigned int)(xmax - spansPt->x); spansPt->x = xmax; } } else /* span to be subtracted overlaps with this one, and begins to the right of this one */ { if (xmax >= spansPt->x + (int)*spansWid) /* span to be subtracted ends at the same point, or to the right; just update width */ *spansWid = (unsigned int)(xmin - spansPt->x); else /* hard case: must split the span */ { #define EXTRA 8 if (extra == 0) /* reallocate; create EXTRA new span slots */ { miPoint *newPt; unsigned int *newwid; newPt = (miPoint *)mi_xrealloc (spans->points, (spans->count + EXTRA)*sizeof(miPoint)); spansPt = newPt + (spansPt - spans->points); spans->points = newPt; newwid = (unsigned int *)mi_xrealloc (spans->widths, (spans->count + EXTRA)*sizeof(unsigned int)); spansWid = newwid + (spansWid - spans->widths); spans->widths = newwid; extra = EXTRA; } /* downshift; create two new spans as replacement */ memmove (spansPt + 1, spansPt, sizeof(miPoint) * spansCount); memmove (spansWid + 1, spansWid, sizeof(unsigned int) * spansCount); spans->count++; extra--; /* first new span */ *spansWid = (unsigned int)(xmin - spansPt->x); spansWid++; spansPt++; /* second new span */ *spansWid = *spansWid - (unsigned int)(xmax - spansPt->x); spansPt->x = xmax; } } } /* end of same-value-of-y computations */ /* on to next span in the Spans */ spansPt++; spansWid++; spansCount--; } } } if (gross_change) /* at least one span vanished; recompute SpanGroup's ymin, ymax */ { ymax = INT_MIN; ymin = INT_MAX; /* loop through all Spans's in SpanGroup */ spans = spanGroup->group; for (i = spanGroup->count; i > 0; i--, spans++) { int ymin_spans, ymax_spans; if (spans->count == 0) continue; ymin_spans = YMIN(spans); ymax_spans = YMAX(spans); if (ymin_spans < ymin) ymin = ymin_spans; if (ymax_spans > ymax) ymax = ymax_spans; } spanGroup->ymin = ymin; spanGroup->ymax = ymax; } } /* `Uniquify' a SpanGroup: merge all its Spans's into a single Spans, which will be sorted on x as well as on y. */ static void miUniquifySpanGroup (SpanGroup *spanGroup) { int i; Spans *spans; Spans *yspans; int *ysizes; int ymin, ylength; /* the new single Spans */ miPoint *points; unsigned int *widths; int count; if (spanGroup->count == 0) return; /* Special case : ymin > ymax, so the Spans's in the SpanGroup, no matter how numerous, must be empty (and can't contain point or width arrays). */ if (spanGroup->ymin > spanGroup->ymax) { spanGroup->count = 0; return; } /* Yuck. Gross. Radix sort into y buckets, then sort x and uniquify */ /* This seems to be the fastest thing to do. I've tried sorting on both x and y at the same time rather than creating into all those y buckets, but it was somewhat slower. */ ymin = spanGroup->ymin; ylength = spanGroup->ymax - ymin + 1; /* allocate Spans's for y buckets (one Spans for every scanline); ysizes[] is number of allocated Span slots in each bucket */ yspans = (Spans *)mi_xmalloc (ylength * sizeof(Spans)); ysizes = (int *)mi_xmalloc (ylength * sizeof(int)); for (i = 0; i < ylength; i++) { ysizes[i] = 0; yspans[i].count = 0; yspans[i].points = (miPoint *)NULL; yspans[i].widths = (unsigned int *)NULL; } /* go through every single span and put it into the correct y bucket */ count = 0; for (i = 0, spans = spanGroup->group; i < spanGroup->count; i++, spans++) { int j, index; for (j = 0, points = spans->points, widths = spans->widths; j < spans->count; j++, points++, widths++) { index = points->y - ymin; if (index >= 0 && index < ylength) /* paranoia */ { Spans *newspans = &(yspans[index]); if (newspans->count == ysizes[index]) /* expand bucket arrays by reallocating */ { ysizes[index] = (ysizes[index] + 8) * 2; newspans->points = (miPoint *)mi_xrealloc (newspans->points, ysizes[index] * sizeof(miPoint)); newspans->widths = (unsigned int *)mi_xrealloc (newspans->widths, ysizes[index] * sizeof(unsigned int)); } newspans->points[newspans->count] = *points; newspans->widths[newspans->count] = *widths; (newspans->count)++; } /* if y value of span in range */ } /* for j through spans */ count += spans->count; } /* for i through Spans */ free (ysizes); /* now sort each bucket by x and uniquify it into new Spans */ points = (miPoint *)mi_xmalloc (count * sizeof(miPoint)); widths = (unsigned int *)mi_xmalloc (count * sizeof(unsigned int)); count = 0; for (i = 0; i < ylength; i++) { int ycount = yspans[i].count; if (ycount > 0) { if (ycount > 1) /* sort the >1 spans at this value of y */ { miQuickSortSpansX (yspans[i].points, yspans[i].widths, ycount); count += miUniquifySpansX (&(yspans[i]), &(points[count]), &(widths[count])); } else /* just a single span at this value of y */ { points[count] = yspans[i].points[0]; widths[count] = yspans[i].widths[0]; count++; } free (yspans[i].points); free (yspans[i].widths); } } free (yspans); /* free SpanGroup's original Spans's, including Span arrays */ for (i = 0; i < spanGroup->count; i++) { free (spanGroup->group[i].points); free (spanGroup->group[i].widths); } /* SpanGroup now has only a single Spans */ spanGroup->count = 1; spanGroup->group[0].points = points; spanGroup->group[0].widths = widths; spanGroup->group[0].count = count; } /* Sort each span in a Spans by x. Called only if numSpans > 1. */ static void miQuickSortSpansX (miPoint *points, unsigned int *widths, int numSpans) { int x; int i, j, m; miPoint *r; #define ExchangeSpans(a, b) \ { \ miPoint tpt; \ unsigned int tw; \ \ tpt = points[a]; points[a] = points[b]; points[b] = tpt; \ tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ } do { if (numSpans < 9) /* do insertion sort */ { int xprev; xprev = points[0].x; i = 1; do /* while i != numSpans */ { x = points[i].x; if (xprev > x) { /* points[i] is out of order. Move into proper location. */ miPoint tpt; unsigned int tw; int k; for (j = 0; x >= points[j].x; j++) { } tpt = points[i]; tw = widths[i]; for (k = i; k != j; k--) { points[k] = points[k-1]; widths[k] = widths[k-1]; } points[j] = tpt; widths[j] = tw; x = points[i].x; } /* if out of order */ xprev = x; i++; } while (i != numSpans); /* end of insertion sort */ return; } /* Choose partition element, stick in location 0 */ m = numSpans / 2; if (points[m].x > points[0].x) ExchangeSpans(m, 0); if (points[m].x > points[numSpans-1].x) ExchangeSpans(m, numSpans-1); if (points[m].x > points[0].x) ExchangeSpans(m, 0); x = points[0].x; /* Partition array */ i = 0; j = numSpans; do { r = &(points[i]); do { r++; i++; } while (i != numSpans && r->x < x) ; r = &(points[j]); do { r--; j--; } while (x < r->x); if (i < j) ExchangeSpans(i, j); } while (i < j); /* Move partition element back to middle */ ExchangeSpans(0, j); /* Recurse */ if (numSpans-j-1 > 1) miQuickSortSpansX (&points[j+1], &widths[j+1], numSpans-j-1); numSpans = j; } while (numSpans > 1); } /* Sort an unordered list of spans by y, so that it becomes a Spans. */ void miQuickSortSpansY (miPoint *points, unsigned int *widths, int numSpans) { int y; int i, j, m; miPoint *r; if (numSpans <= 1) /* nothing to do */ return; #define ExchangeSpans(a, b) \ { \ miPoint tpt; \ unsigned int tw; \ \ tpt = points[a]; points[a] = points[b]; points[b] = tpt; \ tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ } do { if (numSpans < 9) /* do insertion sort */ { int yprev; yprev = points[0].y; i = 1; do /* while i != numSpans */ { y = points[i].y; if (yprev > y) { /* points[i] is out of order. Move into proper location. */ miPoint tpt; unsigned int tw; int k; for (j = 0; y >= points[j].y; j++) { } tpt = points[i]; tw = widths[i]; for (k = i; k != j; k--) { points[k] = points[k-1]; widths[k] = widths[k-1]; } points[j] = tpt; widths[j] = tw; y = points[i].y; } /* if out of order */ yprev = y; i++; } while (i != numSpans); /* end of insertion sort */ return; } /* Choose partition element, stick in location 0 */ m = numSpans / 2; if (points[m].y > points[0].y) ExchangeSpans(m, 0); if (points[m].y > points[numSpans-1].y) ExchangeSpans(m, numSpans-1); if (points[m].y > points[0].y) ExchangeSpans(m, 0); y = points[0].y; /* Partition array */ i = 0; j = numSpans; do { r = &(points[i]); do { r++; i++; } while (i != numSpans && r->y < y) ; r = &(points[j]); do { r--; j--; } while (y < r->y); if (i < j) ExchangeSpans(i, j); } while (i < j); /* Move partition element back to middle */ ExchangeSpans(0, j); /* Recurse */ if (numSpans-j-1 > 1) miQuickSortSpansY (&points[j+1], &widths[j+1], numSpans-j-1); numSpans = j; } while (numSpans > 1); } /* Uniquify the spans in a Spans. (Spans at each y value are assumed to have been sorted on x, perhaps by calling miQuickSortSpansX() above.) Also, create a new Spans: stash the uniquified spans into the previously allocated arrays newPoints and newWidths. Returns the number of unique spans. Called only if numSpans > 1. */ static int miUniquifySpansX (const Spans *spans, miPoint *newPoints, unsigned int *newWidths) { int newx1, newx2, oldpt, i, y; miPoint *oldPoints; unsigned int *oldWidths, *startNewWidths; startNewWidths = newWidths; oldPoints = spans->points; oldWidths = spans->widths; y = oldPoints->y; newx1 = oldPoints->x; newx2 = newx1 + (int)(*oldWidths); for (i = spans->count - 1; i > 0; i--) { oldPoints++; oldWidths++; oldpt = oldPoints->x; if (oldpt > newx2) { /* write current span, start a new one */ newPoints->x = newx1; newPoints->y = y; *newWidths = (unsigned int)(newx2 - newx1); newPoints++; newWidths++; newx1 = oldpt; newx2 = oldpt + (int)(*oldWidths); } else { /* extend current span, if old extends beyond new */ oldpt = oldpt + (int)(*oldWidths); if (oldpt > newx2) newx2 = oldpt; } } /* write final span */ newPoints->x = newx1; *newWidths = (unsigned int)(newx2 - newx1); newPoints->y = y; return (int)((newWidths - startNewWidths) + 1); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_widelin.c�������������������������������������������������������������������0000644�0001750�0001750�00000177014�10346060433�014122� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sys-defines.h" #include "extern.h" /* Original author: Keith Packard, MIT X Consortium. Hacked by Robert S. Maier, 1998-99. */ /* This module contains the miWideLine() and miWideDash() functions. They rasterize wide polylines (usually just called `wide lines'), either solid or dashed. Any wide line is treated as a polygon to be painted. (If it is dashed, each dash is treated as a polygon.) The painting follows libxmi's policy on painting of `edge' pixels, i.e., pixels that lie exactly on a boundary. A pixel is not painted if it lies on a `right' or `bottom' edge of a polygon. All painting goes through the low-level MI_PAINT_SPANS() macro. */ #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #include "mi_widelin.h" /* undefine if hypot is available (it's X_OPEN, but not ANSI or POSIX) */ #define hypot(x, y) sqrt((x)*(x) + (y)*(y)) /* internal functions that do painting of pixels */ static void miFillPolyHelper (miPaintedSet *paintedSet, miPixel pixel, int y, unsigned int overall_height, PolyEdge *left, PolyEdge *right, int left_count, int right_count); static void miFillRectPolyHelper (miPaintedSet *paintedSet, miPixel pixel, int x, int y, unsigned int w, unsigned int h); static void miLineArc (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, LineFace *leftFace, LineFace *rightFace, double xorg, double yorg, bool isInt); static void miLineJoin (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, LineFace *pLeft, LineFace *pRight); static void miLineProjectingCap (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const LineFace *face, bool isLeft, bool isInt); static void miWideDashSegment (miPaintedSet *paintedSet, const miGC *pGC, int *pDashNum, int *pDashIndex, int *pDashOffset, int x1, int y1, int x2, int y2, bool projectLeft, bool projectRight, LineFace *leftFace, LineFace *rightFace); static void miWideSegment (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, int x1, int y1, int x2, int y2, bool projectLeft, bool projectRight, LineFace *leftFace, LineFace *rightFace); /* internal functions that don't do painting of pixels */ static int miLineArcD (const miGC *pGC, double xorg, double yorg, miPoint *points, unsigned int *widths, PolyEdge *edge1, int edgey1, bool edgeleft1, PolyEdge *edge2, int edgey2, bool edgeleft2); static int miLineArcI (const miGC *pGC, int xorg, int yorg, miPoint *points, unsigned int *widths); static int miPolyBuildEdge (double x0, double y0, double k, int dx, int dy, int xi, int yi, bool left, PolyEdge *edge); static int miPolyBuildPoly (const PolyVertex *vertices, const PolySlope *slopes, int count, int xi, int yi, PolyEdge *left, PolyEdge *right, int *pnleft, int *pnright, unsigned int *h); static int miRoundCapClip (const LineFace *face, bool isInt, PolyEdge *edge, bool *leftEdge); static int miRoundJoinFace (const LineFace *face, PolyEdge *edge, bool *leftEdge); static void miRoundJoinClip (LineFace *pLeft, LineFace *pRight, PolyEdge *edge1, PolyEdge *edge2, int *y1, int *y2, bool *left1, bool *left2); /* Spans-based convex polygon filler. Paints a convex polygon, supplied as lists of `left' and `right' edges. Used for painting polygonal line caps and line joins. This implements libxmi's policy on painting `edge' pixels, i.e., pixels that lie exactly on the boundary of a polygon. A pixel is not painted if it lies on a `right' or `bottom' edge of the polygon. */ /* ARGS: y = starting y coor, overall_height = height of entire segment */ static void miFillPolyHelper (miPaintedSet *paintedSet, miPixel pixel, int y, unsigned int overall_height, PolyEdge *left, PolyEdge *right, int left_count, int right_count) { int left_x = 0, left_e = 0; int left_stepx = 0; int left_signdx = 0; int left_dy = 0, left_dx = 0; int right_x = 0, right_e = 0; int right_stepx = 0; int right_signdx = 0; int right_dy = 0, right_dx = 0; unsigned int left_height = 0, right_height = 0; miPoint *ppt; miPoint *pptInit = (miPoint *)NULL; unsigned int *pwidth; unsigned int *pwidthInit = (unsigned int *)NULL; pptInit = (miPoint *)mi_xmalloc(overall_height * sizeof(miPoint)); pwidthInit = (unsigned int *)mi_xmalloc(overall_height * sizeof(unsigned int)); ppt = pptInit; pwidth = pwidthInit; while ((left_count || left_height) && (right_count || right_height)) { unsigned int height; /* load fields from next left edge, right edge */ MIPOLYRELOADLEFT MIPOLYRELOADRIGHT height = UMIN (left_height, right_height); left_height -= height; right_height -= height; /* walk down to end of left or right edge, whichever comes first */ while (height--) { if (right_x >= left_x) /* generate a span (omitting point on right end, see above) */ { ppt->x = left_x; ppt->y = y; ppt++; *pwidth++ = (unsigned int)(right_x - left_x + 1); } y++; /* update left_x, right_x by stepping along left and right edges, using midpoint line algorithm */ MIPOLYSTEPLEFT MIPOLYSTEPRIGHT } } MI_PAINT_SPANS(paintedSet, pixel, ppt - pptInit, pptInit, pwidthInit) } /* Rectangle filler. Policy mentioned above (no painting of right or bottom edges) is followed. */ static void miFillRectPolyHelper (miPaintedSet *paintedSet, miPixel pixel, int x, int y, unsigned int w, unsigned int h) { miPoint *ppt, *pptInit; unsigned int *pwidth, *pwidthInit; pptInit = (miPoint *)mi_xmalloc (h * sizeof(miPoint)); pwidthInit = (unsigned int *)mi_xmalloc (h * sizeof(unsigned int)); ppt = pptInit; pwidth = pwidthInit; while (h--) { *pwidth++ = w; ppt->x = x; ppt->y = y; ppt++; y++; } MI_PAINT_SPANS(paintedSet, pixel, ppt - pptInit, pptInit, pwidthInit) } /* Build a single polygon edge (either a left edge or a right edge). I.e. compute integer edge data that can be used by the midpoint line algorithm. The edge will be traversed downward (on entry, dy != 0 is assumed). Returns starting value for y, i.e. integer y-value for top of edge. */ /* Supplied: an integer offset (xi,yi), the exact floating-point edge start (x0,y0), its (rational) slope dy/dx, and the quantity k = x0*dy-y0*dx, which is a measure of distance of (x0,y0) from the parallel line segment that passes through (0,0). k will be transformed into the initial value for e, the integer decision variable for the midpoint line algorithm. */ /* The integer edge data that are computed do not include the `height' field, i.e. the number of scanlines to process. */ /* ARGS: x0,y0 = starting point of edge (rel. to x1,y1) k = x0 * dy - y0 * dx dx,dy specify rational slope dy/dx xi,yi = integer offsets for coor system left = left edge, not right edge? edge = integer edge data, to be filled in */ /*ARGSUSED*/ static int miPolyBuildEdge (double x0, double y0, double k, int dx, int dy, int xi, int yi, bool left, PolyEdge *edge) { int x, y, e; int xady; /* make dy positive, since edge will be traversed downward */ if (dy < 0) { dy = -dy; dx = -dx; k = -k; } #if 0 { double realk, kerror; realk = x0 * dy - y0 * dx; kerror = fabs (realk - k); if (kerror > .1) printf ("realk: %g\t k: %g\n", realk, k); } #endif /* integer starting value for y: round up the floating-point value */ y = ICEIL (y0); /* work out integer starting value for x */ xady = ICEIL (k) + y * dx; if (xady <= 0) x = - (-xady / dy) - 1; else x = (xady - 1) / dy; /* start working out initial value of decision variable */ e = xady - x * dy; /* i.e. ICEIL(k) - (x * dy - y * dx) */ /* work out optional and non-optional x increment, for algorithm */ if (dx >= 0) { edge->signdx = 1; /* optional step */ edge->stepx = dx / dy; /* non-optional step, 0 if dxdx = dx % dy; } else { edge->signdx = -1; /* optional step */ edge->stepx = - (-dx / dy); /* non-optional step, 0 if dxdx = -dx % dy; e = dy - e + 1; } edge->dy = dy; edge->x = x + (left == true ? 1 : 0) + xi; /* starting value for x */ edge->e = e - dy; /* bias: initial value for e */ /* return integer starting value for y, i.e. top of edge */ return y + yi; } /* add incr to v, cyclically; always stay in range 0..max */ #define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr))) /* Build lists of right and left polygon edges, from an array of vertex coordinates (floating-point), a precomputed array of PolySlopes (including a `k' value for each edge), and an integer offset vector. Also return overall vertical range and top (starting) y value. */ /* ARGS: xi,yi = integer offset for polygon */ static int miPolyBuildPoly (const PolyVertex *vertices, const PolySlope *slopes, int count, int xi, int yi, PolyEdge *left, PolyEdge *right, int *pnleft, int *pnright, unsigned int *h) { int top, bottom; double miny, maxy; int i; int j; int clockwise; int slopeoff; int s; int nright, nleft; int y, lasty = 0, bottomy, topy = 0; /* compute min, max y values for polygon (floating-point); also location of corresponding vertices in vertex array */ maxy = miny = vertices[0].y; bottom = top = 0; for (i = 1; i < count; i++) { if (vertices[i].y < miny) { top = i; miny = vertices[i].y; } if (vertices[i].y >= maxy) { bottom = i; maxy = vertices[i].y; } } /* compute integer y-value for bottom of polygon (round up) */ bottomy = ICEIL (maxy) + yi; /* determine whether should go `clockwise' or `counterclockwise' to move down the right side of the polygon */ i = top; j = StepAround (top, -1, count); clockwise = 1; slopeoff = 0; if (slopes[j].dy * slopes[i].dx > slopes[i].dy * slopes[j].dx) { clockwise = -1; slopeoff = -1; } /* step around right side of polygon from top to bottom, building array of `right' edges (horizontal edges are ignored) */ i = top; s = StepAround (top, slopeoff, count); nright = 0; while (i != bottom) { if (slopes[s].dy != 0) { y = miPolyBuildEdge (vertices[i].x, vertices[i].y, slopes[s].k, slopes[s].dx, slopes[s].dy, xi, yi, false, &right[nright]); if (nright != 0) right[nright-1].height = y - lasty; else /* y is top of first edge */ topy = y; nright++; lasty = y; } i = StepAround (i, clockwise, count); s = StepAround (s, clockwise, count); } if (nright != 0) right[nright-1].height = bottomy - lasty; /* step around left side of polygon from top to bottom, building array of `left' edges (horizontal edges are ignored) */ if (slopeoff == 0) slopeoff = -1; else slopeoff = 0; i = top; s = StepAround (top, slopeoff, count); nleft = 0; while (i != bottom) { if (slopes[s].dy != 0) { y = miPolyBuildEdge (vertices[i].x, vertices[i].y, slopes[s].k, slopes[s].dx, slopes[s].dy, xi, yi, true, &left[nleft]); if (nleft != 0) left[nleft-1].height = y - lasty; nleft++; lasty = y; } i = StepAround (i, -clockwise, count); s = StepAround (s, -clockwise, count); } if (nleft != 0) left[nleft-1].height = bottomy - lasty; /* return number of left-side and right-side edges; also height (vertical range, an unsigned int) and the vertical location of the top vertex (an integer) */ *pnleft = nleft; *pnright = nright; *h = bottomy - topy; return topy; } /* Paint all types of line join: round/miter/bevel/triangular. Called by both miWideLine() and miWideDash(). Left and right line faces are supplied, each with its own value of k. They may be modified. */ static void miLineJoin (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, LineFace *pLeft, LineFace *pRight) { double mx = 0.0, my = 0.0; int denom = 0; /* avoid compiler warnings */ PolyVertex vertices[4]; PolySlope slopes[4]; int edgecount; PolyEdge left[4], right[4]; int nleft, nright; int y; unsigned int height; bool swapslopes; int joinStyle = (int)pGC->joinStyle; int lw = (int)(pGC->lineWidth); if (joinStyle == (int)MI_JOIN_ROUND) { /* invoke miLineArc to fill the round join, isInt = true */ miLineArc (paintedSet, pixel, pGC, pLeft, pRight, (double)0.0, (double)0.0, true); return; } denom = - pLeft->dx * pRight->dy + pRight->dx * pLeft->dy; if (denom == 0) return; /* no join to draw */ /* Now must handle cases where line join is a small polygon to be filled; specify its vertices clockwise. */ /* swap slopes if cross product of line faces has wrong sign */ if (denom > 0) { swapslopes = false; pLeft->xa = -pLeft->xa; pLeft->ya = -pLeft->ya; pLeft->dx = -pLeft->dx; pLeft->dy = -pLeft->dy; } else { swapslopes = true; pRight->xa = -pRight->xa; pRight->ya = -pRight->ya; pRight->dx = -pRight->dx; pRight->dy = -pRight->dy; } /* vertex #0 is at the right end of the right face */ vertices[0].x = pRight->xa; vertices[0].y = pRight->ya; slopes[0].dx = -pRight->dy; slopes[0].dy = pRight->dx; slopes[0].k = 0; /* vertex #1 is the nominal join point (i.e. halfway across both the right face and the left face) */ vertices[1].x = 0; vertices[1].y = 0; slopes[1].dx = pLeft->dy; slopes[1].dy = -pLeft->dx; slopes[1].k = 0; /* vertex #2 is at the left end of the left face */ vertices[2].x = pLeft->xa; vertices[2].y = pLeft->ya; if (joinStyle == (int)MI_JOIN_MITER) { double miterlimit = pGC->miterLimit; /* compute vertex (mx,my) of miter quadrilateral */ my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) - pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx )) / (double) denom; if (pLeft->dy != 0) mx = pLeft->xa + (my - pLeft->ya) * (double) pLeft->dx / (double) pLeft->dy; else mx = pRight->xa + (my - pRight->ya) * (double) pRight->dx / (double) pRight->dy; /* if miter limit violated, switch to bevelled join */ if ((mx * mx + my * my) * 4 > miterlimit * miterlimit * lw * lw) joinStyle = (int)MI_JOIN_BEVEL; } switch ((int)joinStyle) { double scale, dx, dy, adx, ady; case (int)MI_JOIN_MITER: default: /* join by adding a quadrilateral */ edgecount = 4; slopes[2].dx = pLeft->dx; slopes[2].dy = pLeft->dy; slopes[2].k = pLeft->k; if (swapslopes) { slopes[2].dx = -slopes[2].dx; slopes[2].dy = -slopes[2].dy; slopes[2].k = -slopes[2].k; } /* vertex #3 is miter vertex (mx,my) */ vertices[3].x = mx; vertices[3].y = my; slopes[3].dx = pRight->dx; slopes[3].dy = pRight->dy; slopes[3].k = pRight->k; if (swapslopes) { slopes[3].dx = -slopes[3].dx; slopes[3].dy = -slopes[3].dy; slopes[3].k = -slopes[3].k; } break; case (int)MI_JOIN_BEVEL: /* join by adding a triangle */ { PolyVertex midpoint; edgecount = 3; /* third edge of triangle will pass through midpoint */ midpoint.x = 0.5 * (pLeft->xa + pRight->xa); midpoint.y = 0.5 * (pLeft->ya + pRight->ya); /* vector along third edge of triangle */ dx = pRight->xa - pLeft->xa; dy = pRight->ya - pLeft->ya; /* compute scale = max(|dx|,|dy|) */ adx = dx; ady = dy; if (adx < 0) adx = -adx; if (ady < 0) ady = -ady; scale = ady; if (adx > ady) scale = adx; /* use integer dx, dy in range -65536..65536 */ slopes[2].dx = (int)((dx * 65536) / scale); slopes[2].dy = (int)((dy * 65536) / scale); slopes[2].k = midpoint.x * slopes[2].dy - midpoint.y * slopes[2].dx; } break; case (int)MI_JOIN_TRIANGULAR: /* join by adding a stubby quadrilateral */ { PolyVertex midpoint, newpoint; double mid2, mid, dx2, dy2, dx3, dy3; edgecount = 4; /* compute additional vertex, offset by linewidth/2 */ midpoint.x = 0.5 * (pLeft->xa + pRight->xa); midpoint.y = 0.5 * (pLeft->ya + pRight->ya); mid2 = midpoint.x * midpoint.x + midpoint.y * midpoint.y; mid = sqrt (mid2); newpoint.x = 0.5 * lw * midpoint.x / mid; newpoint.y = 0.5 * lw * midpoint.y / mid; vertices[3] = newpoint; /* offset from vertices[2] to vertices[3] */ dx2 = vertices[3].x - vertices[2].x; dy2 = vertices[3].y - vertices[2].y; /* offset from vertices[3] back to vertices[0] */ dx3 = vertices[0].x - vertices[3].x; dy3 = vertices[0].y - vertices[3].y; /* compute scale = max(|dx|,|dy|), where (dx,dy) is offset between the two corners, i.e. vertices[0] and vertices[2] */ dx = pRight->xa - pLeft->xa; dy = pRight->ya - pLeft->ya; adx = dx; ady = dy; if (adx < 0) adx = -adx; if (ady < 0) ady = -ady; scale = ady; if (adx > ady) scale = adx; /* use integer dx, dy in range -65536..65536 */ slopes[2].dx = (int)((dx2 * 65536) / scale); slopes[2].dy = (int)((dy2 * 65536) / scale); slopes[2].k = newpoint.x * slopes[2].dy - newpoint.y * slopes[2].dx; /* use integer dx, dy in range -65536..65536 */ slopes[3].dx = (int)((dx3 * 65536) / scale); slopes[3].dy = (int)((dy3 * 65536) / scale); slopes[3].k = newpoint.x * slopes[3].dy - newpoint.y * slopes[3].dx; } break; } /* end of switch */ /* compute lists of left and right edges for the small polygon, using the just-computed slopes array */ y = miPolyBuildPoly (vertices, slopes, edgecount, pLeft->x, pLeft->y, left, right, &nleft, &nright, &height); /* fill the small polygon */ miFillPolyHelper (paintedSet, pixel, y, height, left, right, nleft, nright); } /* Paint either (1) a round cap on a line face or (2) a pie-wedge between two line faces. Used for round capping and round joining respectively. One or two line faces are supplied. They may be modified. */ static void miLineArc (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, LineFace *leftFace, LineFace *rightFace, double xorg, double yorg, bool isInt) { miPoint *points; unsigned int *widths; int xorgi = 0, yorgi = 0; int n; PolyEdge edge1, edge2; int edgey1, edgey2; bool edgeleft1, edgeleft2; if (isInt) /* in integer case, take (xorgi,yorgi) from face; otherwise (0,0) */ { xorgi = leftFace ? leftFace->x : rightFace->x; yorgi = leftFace ? leftFace->y : rightFace->y; } edgey1 = INT_MAX; edgey2 = INT_MAX; edge1.x = 0; /* not used, keep memory checkers happy */ edge1.dy = -1; edge2.x = 0; /* not used, keep memory checkers happy */ edge2.dy = -1; edgeleft1 = false; edgeleft2 = false; if ((pGC->lineStyle != (int)MI_LINE_SOLID || pGC->lineWidth > 2) && ((pGC->capStyle == (int)MI_CAP_ROUND && pGC->joinStyle != (int)MI_JOIN_ROUND) || (pGC->joinStyle == (int)MI_JOIN_ROUND && pGC->capStyle == (int)MI_CAP_BUTT))) /* construct clipping edges from the passed line faces (otherwise, ignore them; will just draw a disk) */ { if (isInt) { xorg = (double) xorgi; yorg = (double) yorgi; } if (leftFace && rightFace) /* have two faces, so construct clipping edges for pie wedge */ miRoundJoinClip (leftFace, rightFace, &edge1, &edge2, &edgey1, &edgey2, &edgeleft1, &edgeleft2); else if (leftFace) /* will draw half-disk on left face, so construct clipping edge */ edgey1 = miRoundCapClip (leftFace, isInt, &edge1, &edgeleft1); else if (rightFace) /* will draw half-disk on right face, so construct clipping edge */ edgey2 = miRoundCapClip (rightFace, isInt, &edge2, &edgeleft2); /* due to clipping, switch to using floating-point coordinates */ isInt = false; } points = (miPoint *)mi_xmalloc(sizeof(miPoint) * pGC->lineWidth); widths = (unsigned int *)mi_xmalloc(sizeof(unsigned int) * pGC->lineWidth); /* construct a Spans by calling integer or floating point routine */ if (isInt) /* integer routine, no clipping: just draw a disk */ n = miLineArcI (pGC, xorgi, yorgi, points, widths); else /* call floating point routine, supporting clipping by edge(s) */ n = miLineArcD (pGC, xorg, yorg, points, widths, &edge1, edgey1, edgeleft1, &edge2, edgey2, edgeleft2); MI_PAINT_SPANS(paintedSet, pixel, n, points, widths) } /* Draw a filled disk, of diameter equal to the linewidth, as a Spans. This is used for round caps or round joins, if the clipping by one or two edges can be ignored. Integer coordinates only are used. Returns number of spans in the Spans. */ static int miLineArcI (const miGC *pGC, int xorg, int yorg, miPoint *points, unsigned int *widths) { miPoint *tpts, *bpts; unsigned int *twids, *bwids; int x, y, e, ex; int slw; tpts = points; twids = widths; slw = (int)(pGC->lineWidth); if (slw == 1) /* `disk' is a single pixel */ { tpts->x = xorg; tpts->y = yorg; *twids = 1; return 1; } /* otherwise, draw the disk scanline by scanline */ bpts = tpts + slw; bwids = twids + slw; y = (slw >> 1) + 1; if (slw & 1) e = - ((y << 2) + 3); else e = - (y << 3); ex = -4; x = 0; while (y) { e += (y << 3) - 4; while (e >= 0) { x++; e += (ex = -((x << 3) + 4)); } y--; slw = (x << 1) + 1; if ((e == ex) && (slw > 1)) slw--; tpts->x = xorg - x; tpts->y = yorg - y; tpts++; *twids++ = slw; if ((y != 0) && ((slw > 1) || (e != ex))) { bpts--; bpts->x = xorg - x; bpts->y = yorg + y; *--bwids = slw; } } /* return linewidth (no. of spans in the Spans) */ return (int)(pGC->lineWidth); } #define CLIPSTEPEDGE(edgey,edge,edgeleft) \ if (ybase == edgey) \ { \ if (edgeleft) \ { \ if (edge->x > xcl) \ xcl = edge->x; \ } \ else \ { \ if (edge->x < xcr) \ xcr = edge->x; \ } \ edgey++; \ edge->x += edge->stepx; \ edge->e += edge->dx; \ if (edge->e > 0) \ { \ edge->x += edge->signdx; \ edge->e -= edge->dy; \ } \ } /* Draw as a Spans a filled disk of diameter equal to the linewidth, paying attention to one or two clipping edges. This is used for round caps and round joins, respectively (it respectively yields a half-disk or a pie wedge). Floating point coordinates are used. Returns number of spans in the Spans. The clipping edges may be modified. */ static int miLineArcD (const miGC *pGC, double xorg, double yorg, miPoint *points, unsigned int *widths, PolyEdge *edge1, int edgey1, bool edgeleft1, PolyEdge *edge2, int edgey2, bool edgeleft2) { miPoint *pts; unsigned int *wids; double radius, x0, y0, el, er, yk, xlk, xrk, k; int xbase, ybase, y, boty, xl, xr, xcl, xcr; int ymin, ymax; bool edge1IsMin, edge2IsMin; int ymin1, ymin2; pts = points; wids = widths; xbase = (int)(floor(xorg)); x0 = xorg - xbase; ybase = ICEIL (yorg); y0 = yorg - ybase; xlk = x0 + x0 + 1.0; xrk = x0 + x0 - 1.0; yk = y0 + y0 - 1.0; radius = 0.5 * ((double)pGC->lineWidth); y = (int)(floor(radius - y0 + 1.0)); ybase -= y; ymin = ybase; ymax = INT_MAX; edge1IsMin = false; ymin1 = edgey1; if (edge1->dy >= 0) { if (!edge1->dy) { if (edgeleft1) edge1IsMin = true; else ymax = edgey1; edgey1 = INT_MAX; } else { if ((edge1->signdx < 0) == edgeleft1) edge1IsMin = true; } } edge2IsMin = false; ymin2 = edgey2; if (edge2->dy >= 0) { if (!edge2->dy) { if (edgeleft2) edge2IsMin = true; else ymax = edgey2; edgey2 = INT_MAX; } else { if ((edge2->signdx < 0) == edgeleft2) edge2IsMin = true; } } if (edge1IsMin) { ymin = ymin1; if (edge2IsMin && ymin1 > ymin2) ymin = ymin2; } else if (edge2IsMin) ymin = ymin2; el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0); er = el + xrk; xl = 1; xr = 0; if (x0 < 0.5) { xl = 0; el -= xlk; } boty = (y0 < -0.5) ? 1 : 0; if (ybase + y - boty > ymax) boty = ymax - ybase - y; while (y > boty) { k = (y << 1) + yk; er += k; while (er > 0.0) { xr++; er += xrk - (xr << 1); } el += k; while (el >= 0.0) { xl--; el += (xl << 1) - xlk; } y--; ybase++; if (ybase < ymin) continue; xcl = xl + xbase; xcr = xr + xbase; CLIPSTEPEDGE(edgey1, edge1, edgeleft1); CLIPSTEPEDGE(edgey2, edge2, edgeleft2); if (xcr >= xcl) { pts->x = xcl; pts->y = ybase; pts++; *wids++ = (unsigned int)(xcr - xcl + 1); } } er = xrk - (xr << 1) - er; el = (xl << 1) - xlk - el; boty = (int)(floor(-y0 - radius + 1.0)); if (ybase + y - boty > ymax) boty = ymax - ybase - y; while (y > boty) { k = (y << 1) + yk; er -= k; while ((er >= 0.0) && (xr >= 0)) { xr--; er += xrk - (xr << 1); } el -= k; while ((el > 0.0) && (xl <= 0)) { xl++; el += (xl << 1) - xlk; } y--; ybase++; if (ybase < ymin) continue; xcl = xl + xbase; xcr = xr + xbase; CLIPSTEPEDGE(edgey1, edge1, edgeleft1); CLIPSTEPEDGE(edgey2, edge2, edgeleft2); if (xcr >= xcl) { pts->x = xcl; pts->y = ybase; pts++; *wids++ = (unsigned int)(xcr - xcl + 1); } } /* return number of spans in the Spans */ return (pts - points); } /* From two line faces, construct clipping edges that will be used by miLineArcD when drawing a pie wedge. The line faces may be modified. */ static void miRoundJoinClip (LineFace *pLeft, LineFace *pRight, PolyEdge *edge1, PolyEdge *edge2, int *y1, int *y2, bool *left1, bool *left2) { int denom; denom = - pLeft->dx * pRight->dy + pRight->dx * pLeft->dy; if (denom >= 0) { pLeft->xa = -pLeft->xa; pLeft->ya = -pLeft->ya; } else { pRight->xa = -pRight->xa; pRight->ya = -pRight->ya; } *y1 = miRoundJoinFace (pLeft, edge1, left1); *y2 = miRoundJoinFace (pRight, edge2, left2); } /* helper function called by the preceding */ static int miRoundJoinFace (const LineFace *face, PolyEdge *edge, bool *leftEdge) { int y; int dx, dy; double xa, ya; bool left; dx = -face->dy; dy = face->dx; xa = face->xa; ya = face->ya; left = true; if (ya > 0) { ya = 0.0; xa = 0.0; } if (dy < 0 || (dy == 0 && dx > 0)) { dx = -dx; dy = -dy; left = (left ? false : true); } if (dx == 0 && dy == 0) dy = 1; if (dy == 0) { y = ICEIL (face->ya) + face->y; edge->x = INT_MIN; edge->stepx = 0; edge->signdx = 0; edge->e = -1; edge->dy = 0; edge->dx = 0; edge->height = 0; } else { y = miPolyBuildEdge (xa, ya, 0.0, dx, dy, face->x, face->y, (left ? false : true), edge); edge->height = UINT_MAX; /* number of scanlines to process */ } *leftEdge = (left ? false : true); return y; } /* From a line face, construct a clipping edge that will be used by miLineArcD when drawing a half-disk. */ static int miRoundCapClip (const LineFace *face, bool isInt, PolyEdge *edge, bool *leftEdge) { int y; int dx, dy; double xa, ya, k; bool left; dx = -face->dy; dy = face->dx; xa = face->xa; ya = face->ya; k = 0.0; if (!isInt) k = face->k; left = true; if (dy < 0 || (dy == 0 && dx > 0)) { dx = -dx; dy = -dy; xa = -xa; ya = -ya; left = (left ? false : true); } if (dx == 0 && dy == 0) dy = 1; if (dy == 0) { y = ICEIL (face->ya) + face->y; edge->x = INT_MIN; edge->stepx = 0; edge->signdx = 0; edge->e = -1; edge->dy = 0; edge->dx = 0; edge->height = 0; } else { y = miPolyBuildEdge (xa, ya, k, dx, dy, face->x, face->y, (left ? false : true), edge); edge->height = UINT_MAX; /* number of scanlines to process */ } *leftEdge = (left ? false : true); return y; } /* Paint a projecting rectangular cap on a line face. Called only by miWideDash (with isInt = true); not by miWideLine. */ static void miLineProjectingCap (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, const LineFace *face, bool isLeft, bool isInt) { int dx, dy; int topy, bottomy; int xorgi = 0, yorgi = 0; int lw = (int)(pGC->lineWidth); PolyEdge lefts[2], rights[2]; if (isInt) /* in integer case, take (xorgi,yorgi) from face; otherwise (0,0) */ { xorgi = face->x; yorgi = face->y; } dx = face->dx; dy = face->dy; if (dy == 0) /* special case: line face is horizontal */ { lefts[0].height = (unsigned int)lw; lefts[0].x = xorgi; if (isLeft) lefts[0].x -= (lw >> 1); lefts[0].stepx = 0; lefts[0].signdx = 1; lefts[0].e = -lw; lefts[0].dx = 0; lefts[0].dy = lw; rights[0].height = (unsigned int)lw; rights[0].x = xorgi; if (!isLeft) rights[0].x += ((lw + 1) >> 1); rights[0].stepx = 0; rights[0].signdx = 1; rights[0].e = -lw; rights[0].dx = 0; rights[0].dy = lw; /* fill the rectangle (1 left edge, 1 right edge) */ miFillPolyHelper (paintedSet, pixel, yorgi - (lw >> 1), (unsigned int)lw, lefts, rights, 1, 1); } else if (dx == 0) /* special case: line face is vertical */ { topy = yorgi; bottomy = yorgi + dy; if (isLeft) topy -= (lw >> 1); else bottomy += (lw >> 1); lefts[0].height = (unsigned int)(bottomy - topy); lefts[0].x = xorgi - (lw >> 1); lefts[0].stepx = 0; lefts[0].signdx = 1; lefts[0].e = -dy; lefts[0].dx = dx; lefts[0].dy = dy; rights[0].height = (unsigned int)(bottomy - topy); rights[0].x = lefts[0].x + (lw - 1); rights[0].stepx = 0; rights[0].signdx = 1; rights[0].e = -dy; rights[0].dx = dx; rights[0].dy = dy; /* fill the rectangle (1 left edge, 1 right edge) */ miFillPolyHelper (paintedSet, pixel, topy, (unsigned int)(bottomy - topy), lefts, rights, 1, 1); } else /* general case: line face is neither horizontal nor vertical */ { int lefty, righty; int finaly; double xa,ya; double xap, yap; double maxy; double projectXoff, projectYoff; double k; PolyEdge *left, *right; PolyEdge *top, *bottom; k = face->k; xa = face->xa; ya = face->ya; projectXoff = -ya; projectYoff = xa; if (dx < 0) { right = &rights[1]; left = &lefts[0]; top = &rights[0]; bottom = &lefts[1]; } else { right = &rights[0]; left = &lefts[1]; top = &lefts[0]; bottom = &rights[1]; } if (isLeft) /* cap goes left; build four edges */ { righty = miPolyBuildEdge (xa, ya, k, dx, dy, xorgi, yorgi, false, right); xa = -xa; ya = -ya; k = -k; lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff, k, dx, dy, xorgi, yorgi, true, left); if (dx > 0) { ya = -ya; xa = -xa; } xap = xa - projectXoff; yap = ya - projectYoff; topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy, -dy, dx, xorgi, yorgi, (dx > 0 ? true : false), top); bottomy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, xorgi, yorgi, (dx < 0 ? true : false), bottom); maxy = -ya; } else /* cap goes right; build four edges */ { righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff, k, dx, dy, xorgi, yorgi, false, right); xa = -xa; ya = -ya; k = -k; lefty = miPolyBuildEdge (xa, ya, k, dx, dy, xorgi, yorgi, true, left); if (dx > 0) { ya = -ya; xa = -xa; } xap = xa - projectXoff; yap = ya - projectYoff; topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, xorgi, xorgi, (dx > 0 ? true : false), top); bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy, -dy, dx, xorgi, xorgi, (dx < 0 ? true : false), bottom); maxy = -ya + projectYoff; } finaly = ICEIL(maxy) + yorgi; if (dx < 0) { left->height = (unsigned int)(bottomy - lefty); right->height = (unsigned int)(finaly - righty); top->height = (unsigned int)(righty - topy); } else { right->height = (unsigned int)(bottomy - righty); left->height = (unsigned int)(finaly - lefty); top->height = (unsigned int)(lefty - topy); } bottom->height = (unsigned int)(finaly - bottomy); /* fill the rectangle (2 left edges, 2 right edges) */ miFillPolyHelper (paintedSet, pixel, topy, (unsigned int)(bottom->height + bottomy - topy), lefts, rights, 2, 2); } } /* Draw a wide, dashed polyline, by dashing each line segment and joining appropriately. miWideDashSegment() is called to dash each line segment. */ void miWideDash (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { int x1, y1, x2, y2; int dashNum; /* absolute number of dash, starts with 0 */ int dashIndex; /* index into array (i.e. dashNum % length) */ int dashOffset; /* offset into selected dash */ int startPaintType, endPaintType = 0, prevEndPaintType = 0; int firstPaintType = 0; /* used only for closed polylines; will be 1 */ int numPixels; bool selfJoin; /* polyline is closed? */ bool first; /* first line segment of polyline */ bool somethingDrawn = false; bool projectLeft, projectRight; LineFace leftFace, rightFace, prevRightFace; LineFace firstFace; miPixel pixel; /* ensure we have >=1 points */ if (npt <= 0) return; /* width 0 lines are handled specially; invoke Bresenham routine in mi_zerolin.c */ if (pGC->lineWidth == 0) { miZeroDash (paintedSet, pGC, mode, npt, pPts); return; } x2 = pPts->x; y2 = pPts->y; first = true; /* first line segment of polyline */ /* determine whether polyline is closed */ selfJoin = false; if (mode == MI_COORD_MODE_PREVIOUS) { int nptTmp; const miPoint *pPtsTmp; x1 = x2; y1 = y2; nptTmp = npt; pPtsTmp = pPts + 1; while (--nptTmp) { x1 += pPtsTmp->x; y1 += pPtsTmp->y; ++pPtsTmp; } if (x2 == x1 && y2 == y1) selfJoin = true; } else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y) selfJoin = true; /* dash segments (except for the last) will not project right; and (except for the first) will not project left */ projectLeft = (pGC->capStyle == (int)MI_CAP_PROJECTING && !selfJoin) ? true : false; projectRight = false; /* perform initial offsetting into the dash sequence */ dashNum = 0; /* absolute number of dash */ dashIndex = 0; /* index into dash array */ dashOffset = 0; /* index into selected dash */ miStepDash (pGC->dashOffset, &dashNum, &dashIndex, pGC->dash, pGC->numInDashList, &dashOffset); /* How many paint types? (Will cycle through 0..numPixels-1, beginning with 1, with `off' dashes defined as those with paint type #0.) */ numPixels = pGC->numPixels; /* iterate through points, drawing a dashed segment for each line segment of nonzero length */ while (--npt) { x1 = x2; y1 = y2; ++pPts; x2 = pPts->x; y2 = pPts->y; if (mode == MI_COORD_MODE_PREVIOUS) { x2 += x1; y2 += y1; } if (x1 != x2 || y1 != y2) /* have a line segment of nonzero length */ { int prevDashNum, lastPaintedDashNum; if (npt == 1 && pGC->capStyle == (int)MI_CAP_PROJECTING && (!selfJoin || (firstPaintType == 0))) /* final point; and need a projecting cap here */ projectRight = true; prevDashNum = dashNum; /* draw dashed segment, updating dashNum, dashIndex and dashOffset, returning faces */ miWideDashSegment (paintedSet, pGC, &dashNum, &dashIndex, &dashOffset, x1, y1, x2, y2, projectLeft, projectRight, &leftFace, &rightFace); /* determine paint types used at start and end of just-drawn segment */ startPaintType = ((dashNum & 1) ? 0 : 1 + ((dashNum / 2) % (numPixels - 1))); lastPaintedDashNum = (dashOffset != 0 ? dashNum : dashNum - 1); endPaintType = ((lastPaintedDashNum & 1) ? 0 : 1 + ((dashNum / 2) % (numPixels - 1))); /* add round cap or line join at left end of just-drawn segment; if OnOffDash, do so only if segment began with an `on' dash */ if (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH || (startPaintType != 0)) { pixel = pGC->pixels[startPaintType]; if (first || (pGC->lineStyle == (int)MI_LINE_ON_OFF_DASH && prevEndPaintType == 0)) /* draw cap at left end, unless this is first segment of a closed polyline */ { if (first && selfJoin) { firstFace = leftFace; firstPaintType = startPaintType; } else if (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR) /* invoke miLineArc to draw round cap, isInt = true */ miLineArc (paintedSet, pixel, pGC, &leftFace, (LineFace *)NULL, (double)0.0, (double)0.0, true); } else /* draw join at left end */ miLineJoin (paintedSet, pixel, pGC, &leftFace, &prevRightFace); } somethingDrawn = true; first = false; prevRightFace = rightFace; prevEndPaintType = endPaintType; projectLeft = false; } if (npt == 1 && somethingDrawn) /* last point of a nonempty polyline, so add line join or round cap if appropriate, i.e. if we're doing OnOffDash and ended on an `on' dash, or if we're doing DoubleDash */ { if (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH || (endPaintType != 0)) { pixel = pGC->pixels[endPaintType]; if (selfJoin && (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH || (firstPaintType != 0))) /* closed, so draw a join */ miLineJoin (paintedSet, pixel, pGC, &firstFace, &rightFace); else { if (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR) /* invoke miLineArc, isInt = true, to draw a round cap */ miLineArc (paintedSet, pixel, pGC, (LineFace *)NULL, &rightFace, (double)0.0, (double)0.0, true); } } else /* we're doing OnOffDash, and final segment of polyline ended with an (undrawn) `off' dash */ { if (selfJoin && (firstPaintType != 0)) /* closed; if projecting or round caps are being used, draw one on the first face */ { pixel = pGC->pixels[firstPaintType]; if (pGC->capStyle == (int)MI_CAP_PROJECTING) miLineProjectingCap (paintedSet, pixel, pGC, &firstFace, true, true); else if (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR) /* invoke miLineArc, isInt = true, to draw a round cap */ miLineArc (paintedSet, pixel, pGC, &firstFace, (LineFace *)NULL, (double)0.0, (double)0.0, true); } } } } /* handle `all points coincident' crock, nothing yet drawn */ if (!somethingDrawn && (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH || !(dashNum & 1))) { unsigned int w1; pixel = (dashNum & 1) ? pGC->pixels[0] : pGC->pixels[1]; switch ((int)pGC->capStyle) { case (int)MI_CAP_ROUND: case (int)MI_CAP_TRIANGULAR: /* invoke miLineArc, isInt = false, to draw a round disk */ miLineArc (paintedSet, pixel, pGC, (LineFace *)NULL, (LineFace *)NULL, (double)x2, (double)y2, false); break; case (int)MI_CAP_PROJECTING: /* draw a square box with edge size equal to line width */ w1 = pGC->lineWidth; miFillRectPolyHelper (paintedSet, pixel, (int)(x2 - (w1 >> 1)), (int)(y2 - (w1 >> 1)), w1, w1); break; case (int)MI_CAP_BUTT: default: break; } } } #define V_TOP 0 #define V_RIGHT 1 #define V_BOTTOM 2 #define V_LEFT 3 /* Helper function, called by miWideDash(). Draw a single dashed line segment, i.e. a sequence of dashes including a possible final incomplete dash, and step DashNum, DashIndex and DashOffset appropriately. Also pass back left and right faces for the line segment, for possible use in adding caps or joins. If the LineOnOffDash line style is used, each dash will be given a round cap if lines are drawn in the rounded cap style, and a projecting cap if lines are drawn in the projecting cap style. */ /* ARGS: pDashNum = absolute number of dash pDashIndex = index into array (i.e. dashNum % length) pDashOffset = offset into selected dash */ static void miWideDashSegment (miPaintedSet *paintedSet, const miGC *pGC, int *pDashNum, int *pDashIndex, int *pDashOffset, int x1, int y1, int x2, int y2, bool projectLeft, bool projectRight, LineFace *leftFace, LineFace *rightFace) { int dashNum, dashIndex, dashRemain; unsigned int *pDash; double L, l; double k; PolyVertex vertices[4]; PolyVertex saveRight, saveBottom; PolySlope slopes[4]; PolyEdge left[2], right[2]; LineFace lcapFace, rcapFace; int nleft, nright; unsigned int h; int y; int dy, dx; double LRemain; double r; double rdx, rdy; double dashDx, dashDy; double saveK = 0.0; bool first = true; double lcenterx, lcentery, rcenterx = 0.0, rcentery = 0.0; miPixel pixel; int numPixels, paintType; dx = x2 - x1; dy = y2 - y1; dashNum = *pDashNum; dashIndex = *pDashIndex; pDash = pGC->dash; /* determine portion of current dash remaining (i.e. the portion after the current offset */ dashRemain = (int)(pDash[dashIndex]) - *pDashOffset; /* compute color of current dash */ numPixels = pGC->numPixels; paintType = (dashNum & 1) ? 0 : 1 + ((dashNum / 2) % (numPixels - 1)); pixel = pGC->pixels[paintType]; /* compute e.g. L, the distance to go (for dashing) */ l = 0.5 * ((double) pGC->lineWidth); if (dx == 0) /* vertical segment */ { L = dy; rdx = 0; rdy = l; if (dy < 0) { L = -dy; rdy = -l; } } else if (dy == 0) /* horizontal segment */ { L = dx; rdx = l; rdy = 0; if (dx < 0) { L = -dx; rdx = -l; } } else /* neither horizontal nor vertical */ { L = hypot ((double) dx, (double) dy); r = l / L; /* this is ell / L, not 1 / L */ rdx = r * dx; rdy = r * dy; } k = l * L; /* this is ell * L, not 1 * L */ /* All position comments are relative to a line with dx and dy > 0, * but the code does not depend on this. */ /* top */ slopes[V_TOP].dx = dx; slopes[V_TOP].dy = dy; slopes[V_TOP].k = k; /* right */ slopes[V_RIGHT].dx = -dy; slopes[V_RIGHT].dy = dx; slopes[V_RIGHT].k = 0; /* bottom */ slopes[V_BOTTOM].dx = -dx; slopes[V_BOTTOM].dy = -dy; slopes[V_BOTTOM].k = k; /* left */ slopes[V_LEFT].dx = dy; slopes[V_LEFT].dy = -dx; slopes[V_LEFT].k = 0; /* preload the start coordinates */ vertices[V_RIGHT].x = vertices[V_TOP].x = rdy; vertices[V_RIGHT].y = vertices[V_TOP].y = -rdx; vertices[V_BOTTOM].x = vertices[V_LEFT].x = -rdy; vertices[V_BOTTOM].y = vertices[V_LEFT].y = rdx; if (projectLeft) /* offset the vertices appropriately */ { vertices[V_TOP].x -= rdx; vertices[V_TOP].y -= rdy; vertices[V_LEFT].x -= rdx; vertices[V_LEFT].y -= rdy; slopes[V_LEFT].k = rdx * dx + rdy * dy; } /* starting point for first dash (floating point) */ lcenterx = x1; lcentery = y1; if (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR) /* keep track of starting face (need only in OnOff case) */ { lcapFace.dx = dx; lcapFace.dy = dy; lcapFace.x = x1; lcapFace.y = y1; rcapFace.dx = -dx; rcapFace.dy = -dy; rcapFace.x = x1; rcapFace.y = y1; } /* draw dashes until end of line segment is reached, and no additional (complete) dash can be drawn */ LRemain = L; while (LRemain > dashRemain) { dashDx = (dashRemain * dx) / L; dashDy = (dashRemain * dy) / L; /* ending point for dash */ rcenterx = lcenterx + dashDx; rcentery = lcentery + dashDy; vertices[V_RIGHT].x += dashDx; vertices[V_RIGHT].y += dashDy; vertices[V_BOTTOM].x += dashDx; vertices[V_BOTTOM].y += dashDy; slopes[V_RIGHT].k = vertices[V_RIGHT].x * dx + vertices[V_RIGHT].y * dy; /* draw dash (if OnOffDash, don't draw `off' dashes) */ if (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH || !(paintType == 0)) { if (pGC->lineStyle == (int)MI_LINE_ON_OFF_DASH && pGC->capStyle == (int)MI_CAP_PROJECTING) /* will draw projecting caps, so save vertices for later use */ { saveRight = vertices[V_RIGHT]; saveBottom = vertices[V_BOTTOM]; saveK = slopes[V_RIGHT].k; if (!first) { vertices[V_TOP].x -= rdx; vertices[V_TOP].y -= rdy; vertices[V_LEFT].x -= rdx; vertices[V_LEFT].y -= rdy; slopes[V_LEFT].k = vertices[V_LEFT].x * slopes[V_LEFT].dy - vertices[V_LEFT].y * slopes[V_LEFT].dx; } vertices[V_RIGHT].x += rdx; vertices[V_RIGHT].y += rdy; vertices[V_BOTTOM].x += rdx; vertices[V_BOTTOM].y += rdy; slopes[V_RIGHT].k = vertices[V_RIGHT].x * slopes[V_RIGHT].dy - vertices[V_RIGHT].y * slopes[V_RIGHT].dx; } /* build lists of left and right edges for the dash, using the just-computed array of slopes */ y = miPolyBuildPoly (vertices, slopes, 4, x1, y1, left, right, &nleft, &nright, &h); /* fill the dash, with either fg or bg color (alternates) */ miFillPolyHelper (paintedSet, pixel, y, h, left, right, nleft, nright); if (pGC->lineStyle == (int)MI_LINE_ON_OFF_DASH) /* if doing OnOffDash, add caps if any */ { switch ((int)pGC->capStyle) { case (int)MI_CAP_BUTT: default: break; case (int)MI_CAP_PROJECTING: /* use saved vertices */ vertices[V_BOTTOM] = saveBottom; vertices[V_RIGHT] = saveRight; slopes[V_RIGHT].k = saveK; break; case (int)MI_CAP_ROUND: case (int)MI_CAP_TRIANGULAR: if (!first) { if (dx < 0) { lcapFace.xa = -vertices[V_LEFT].x; lcapFace.ya = -vertices[V_LEFT].y; lcapFace.k = slopes[V_LEFT].k; } else { lcapFace.xa = vertices[V_TOP].x; lcapFace.ya = vertices[V_TOP].y; lcapFace.k = -slopes[V_LEFT].k; } /* invoke miLineArc, isInt = false, to draw half-disk on left end of dash (only if dash is not first) */ miLineArc (paintedSet, pixel, pGC, &lcapFace, (LineFace *) NULL, lcenterx, lcentery, false); } if (dx < 0) { rcapFace.xa = vertices[V_BOTTOM].x; rcapFace.ya = vertices[V_BOTTOM].y; rcapFace.k = slopes[V_RIGHT].k; } else { rcapFace.xa = -vertices[V_RIGHT].x; rcapFace.ya = -vertices[V_RIGHT].y; rcapFace.k = -slopes[V_RIGHT].k; } /* invoke miLineArc, isInt = false, to draw half-disk on right end of dash */ miLineArc (paintedSet, pixel, pGC, (LineFace *)NULL, &rcapFace, rcenterx, rcentery, false); break; } } } /* we just drew a dash, or (in the OnOff case) we either drew a dash or we didn't */ LRemain -= dashRemain; /* decrement float by int (distance over which we just drew, i.e. the remainder of current dash) */ /* bump absolute dash number, and index of dash in array (cyclically) */ ++dashNum; ++dashIndex; if (dashIndex == pGC->numInDashList) dashIndex = 0; dashRemain = (int)(pDash[dashIndex]); /* whole new dash now `remains' */ /* compute color of next dash */ paintType = (dashNum & 1) ? 0 : 1 + ((dashNum / 2) % (numPixels - 1)); pixel = pGC->pixels[paintType]; /* next dash will start where previous one ended */ lcenterx = rcenterx; lcentery = rcentery; vertices[V_TOP] = vertices[V_RIGHT]; vertices[V_LEFT] = vertices[V_BOTTOM]; slopes[V_LEFT].k = -slopes[V_RIGHT].k; first = false; /* no longer first dash of line segment */ } /* final portion of segment is dashed specially, with an incomplete dash */ if (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH || !(paintType == 0)) { vertices[V_TOP].x -= dx; vertices[V_TOP].y -= dy; vertices[V_LEFT].x -= dx; vertices[V_LEFT].y -= dy; vertices[V_RIGHT].x = rdy; vertices[V_RIGHT].y = -rdx; vertices[V_BOTTOM].x = -rdy; vertices[V_BOTTOM].y = rdx; if (projectRight) /* offset appropriately */ { vertices[V_RIGHT].x += rdx; vertices[V_RIGHT].y += rdy; vertices[V_BOTTOM].x += rdx; vertices[V_BOTTOM].y += rdy; slopes[V_RIGHT].k = vertices[V_RIGHT].x * slopes[V_RIGHT].dy - vertices[V_RIGHT].y * slopes[V_RIGHT].dx; } else slopes[V_RIGHT].k = 0; /* if OnOffDash line style and cap mode is projecting, offset the face, so as to draw a projecting cap */ if (!first && pGC->lineStyle == (int)MI_LINE_ON_OFF_DASH && pGC->capStyle == (int)MI_CAP_PROJECTING) { vertices[V_TOP].x -= rdx; vertices[V_TOP].y -= rdy; vertices[V_LEFT].x -= rdx; vertices[V_LEFT].y -= rdy; slopes[V_LEFT].k = vertices[V_LEFT].x * slopes[V_LEFT].dy - vertices[V_LEFT].y * slopes[V_LEFT].dx; } else slopes[V_LEFT].k += dx * dx + dy * dy; /* build lists of left and right edges for the final incomplete dash, using the just-computed vertices and slopes */ y = miPolyBuildPoly (vertices, slopes, 4, x2, y2, left, right, &nleft, &nright, &h); /* fill the final dash */ miFillPolyHelper (paintedSet, pixel, y, h, left, right, nleft, nright); /* if OnOffDash line style and cap mode is round, draw a round cap */ if (!first && pGC->lineStyle == (int)MI_LINE_ON_OFF_DASH && (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR)) { lcapFace.x = x2; lcapFace.y = y2; if (dx < 0) { lcapFace.xa = -vertices[V_LEFT].x; lcapFace.ya = -vertices[V_LEFT].y; lcapFace.k = slopes[V_LEFT].k; } else { lcapFace.xa = vertices[V_TOP].x; lcapFace.ya = vertices[V_TOP].y; lcapFace.k = -slopes[V_LEFT].k; } /* invoke miLineArc, isInt = false, to draw disk on end */ miLineArc (paintedSet, pixel, pGC, &lcapFace, (LineFace *) NULL, rcenterx, rcentery, false); } } /* work out left and right faces of the dashed segment, to pass back */ leftFace->x = x1; leftFace->y = y1; leftFace->dx = dx; leftFace->dy = dy; leftFace->xa = rdy; leftFace->ya = -rdx; leftFace->k = k; rightFace->x = x2; rightFace->y = y2; rightFace->dx = -dx; rightFace->dy = -dy; rightFace->xa = -rdy; rightFace->ya = rdx; rightFace->k = k; /* update absolute dash number, dash index, dash offset */ dashRemain = (int)(((double) dashRemain) - LRemain); if (dashRemain == 0) /* on to next dash in array */ { dashNum++; /* bump absolute dash number */ dashIndex++; if (dashIndex == pGC->numInDashList) /* wrap */ dashIndex = 0; dashRemain = (int)(pDash[dashIndex]); } *pDashNum = dashNum; *pDashIndex = dashIndex; *pDashOffset = (int)(pDash[dashIndex]) - dashRemain; } /* Helper function, called by miWideDash() above and also by miZeroPolyArc (in mi_zerarc.c) and miZeroDash (in mi_zerolin.c) to perform initial offsetting into the dash array, before dash #0 is drawn. In all cases, dashNum=0, dashIndex=0 and dashOffset=0. */ /* FIXME: a negative offset is not supported, and if it is, then some places elsewhere in the code, which assume dashNum>=0, may need to be fixed too. */ /* ARGS: dist = add'l offset (assumed >= 0) pDashNum = dash number pDashIndex = current dash pDash = dash list numInDashList = dashlist length pDashOffset = offset into current dash */ void miStepDash (int dist, int *pDashNum, int *pDashIndex, const unsigned int *pDash, int numInDashList, int *pDashOffset) { int dashNum, dashIndex, dashOffset; int totallen; int i; dashNum = *pDashNum; dashIndex = *pDashIndex; dashOffset = *pDashOffset; if (dashOffset + dist < (int)(pDash[dashIndex])) /* offset won't take us beyond end of present dash */ { *pDashOffset = dashOffset + dist; return; } /* move to next dash */ dist -= (int)(pDash[dashIndex]) - dashOffset; dashNum++; dashIndex++; if (dashIndex == numInDashList) /* wrap to beginning of dash list */ dashIndex = 0; /* make it easy on ourselves: work modulo iteration interval */ totallen = 0; for (i = 0; i < numInDashList; i++) totallen += (int)(pDash[i]); if (totallen <= dist) dist = dist % totallen; while (dist >= (int)(pDash[dashIndex])) { dist -= (int)(pDash[dashIndex]); dashNum++; dashIndex++; if (dashIndex == numInDashList) /* wrap to beginning of dash list */ dashIndex = 0; } *pDashNum = dashNum; *pDashIndex = dashIndex; *pDashOffset = dist; } /* Draw a wide polyline, undashed (if width=0, this simply calls miZeroLine) */ void miWideLine (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { int x1, y1, x2, y2; bool projectLeft, projectRight; LineFace leftFace, rightFace, prevRightFace; LineFace firstFace; int first; bool somethingDrawn = false; bool selfJoin; /* ensure we have >=1 points */ if (npt <= 0) return; /* width 0 lines are handled specially */ if (pGC->lineWidth == 0) { miZeroLine (paintedSet, pGC, mode, npt, pPts); return; } x2 = pPts->x; y2 = pPts->y; first = true; /* determine whether polyline is closed */ selfJoin = false; if (npt > 1) { if (mode == MI_COORD_MODE_PREVIOUS) { int nptTmp; const miPoint *pPtsTmp; x1 = x2; y1 = y2; nptTmp = npt; pPtsTmp = pPts + 1; while (--nptTmp) { x1 += pPtsTmp->x; y1 += pPtsTmp->y; ++pPtsTmp; } if (x2 == x1 && y2 == y1) selfJoin = true; } else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y) selfJoin = true; } /* line segments (except for the last) will not project right; they'll project left if the cap mode is "projecting" */ projectLeft = (pGC->capStyle == (int)MI_CAP_PROJECTING && !selfJoin) ? true : false; projectRight = false; /* iterate through points, drawing all line segments of nonzero length */ while (--npt) { x1 = x2; y1 = y2; ++pPts; x2 = pPts->x; y2 = pPts->y; if (mode == MI_COORD_MODE_PREVIOUS) { x2 += x1; y2 += y1; } if (x1 != x2 || y1 != y2) /* nonzero length */ { somethingDrawn = true; if (npt == 1 && pGC->capStyle == (int)MI_CAP_PROJECTING && !selfJoin) /* last point; and need a projecting cap here */ projectRight = true; /* draw segment (pixel=1), returning faces */ miWideSegment (paintedSet, pGC->pixels[1], pGC, x1, y1, x2, y2, projectLeft, projectRight, &leftFace, &rightFace); if (first) /* first line segment, draw round cap if needed */ { if (selfJoin) firstFace = leftFace; else if (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR) /* invoke miLineArc, isInt = true, to draw a round cap on left face in paint type #1 */ miLineArc (paintedSet, pGC->pixels[1], pGC, &leftFace, (LineFace *)NULL, (double)0.0, (double)0.0, true); } else /* general case: draw join at beginning of segment (pixel=1) */ miLineJoin (paintedSet, pGC->pixels[1], pGC, &leftFace, &prevRightFace); prevRightFace = rightFace; first = false; projectLeft = false; } /* final point of polyline */ if (npt == 1 && somethingDrawn) { if (selfJoin) /* add line join to close the polyline, pixel=1 */ miLineJoin (paintedSet, pGC->pixels[1], pGC, &firstFace, &rightFace); else if (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR) /* invoke miLineArc, isInt = true, to draw round cap on right face, pixel=1 */ miLineArc (paintedSet, pGC->pixels[1], pGC, (LineFace *)NULL, &rightFace, (double)0.0, (double)0.0, true); } } /* handle crock where all points are coincident */ if (!somethingDrawn) { projectLeft = (pGC->capStyle == (int)MI_CAP_PROJECTING) ? true : false; miWideSegment (paintedSet, pGC->pixels[1], pGC, /* pixel=1 */ x2, y2, x2, y2, projectLeft, projectLeft, &leftFace, &rightFace); if (pGC->capStyle == (int)MI_CAP_ROUND || pGC->capStyle == (int)MI_CAP_TRIANGULAR) { /* invoke miLineArc, isInt = true, to draw round cap in paint type #1 */ miLineArc (paintedSet, pGC->pixels[1], pGC, &leftFace, (LineFace *)NULL, (double)0.0, (double)0.0, true); /* invoke miLineArc, isInt = true, to draw other round cap in paint type #1 */ rightFace.dx = -1; /* sleazy hack to make it work */ miLineArc (paintedSet, pGC->pixels[1], pGC, (LineFace *) NULL, &rightFace, (double)0.0, (double)0.0, true); } } } /* Helper function, called by miWideLine() with pixel=1. Draw a single segment of a wide polyline, taking into account projecting caps, but not round caps. Also pass back left and right faces for the line segment, for possible use in adding caps or joins. */ static void miWideSegment (miPaintedSet *paintedSet, miPixel pixel, const miGC *pGC, int x1, int y1, int x2, int y2, bool projectLeft, bool projectRight, LineFace *leftFace, LineFace *rightFace) { int dx, dy; int x, y; int signdx; int lw = (int)(pGC->lineWidth); if (y2 < y1 || (y2 == y1 && x2 < x1)) /* interchange, so as always to draw top-to-bottom, or left-to-right if horizontal */ { int tx, ty; bool tbool; LineFace *tface; tx = x1; x1 = x2; x2 = tx; ty = y1; y1 = y2; y2 = ty; tbool = projectLeft; projectLeft = projectRight; projectRight = tbool; tface = leftFace; leftFace = rightFace; rightFace = tface; } dy = y2 - y1; signdx = 1; dx = x2 - x1; if (dx < 0) signdx = -1; leftFace->x = x1; leftFace->y = y1; leftFace->dx = dx; leftFace->dy = dy; rightFace->x = x2; rightFace->y = y2; rightFace->dx = -dx; /* for faces, (dx,dy) points _into_ line */ rightFace->dy = -dy; if (dy == 0) /* segment is horizontal */ { rightFace->xa = 0; rightFace->ya = 0.5 * (double)lw; rightFace->k = -0.5 * (double)(lw * dx); /* k = xa * dy - ya * dx */ leftFace->xa = 0; leftFace->ya = -rightFace->ya; leftFace->k = rightFace->k; /* k = xa * dy - ya * dx */ x = x1; if (projectLeft) x -= (lw >> 1); y = y1 - (lw >> 1); dx = x2 - x; if (projectRight) dx += ((lw + 1) >> 1); dy = lw; miFillRectPolyHelper (paintedSet, pixel, x, y, (unsigned int)dx, (unsigned int)dy); } else if (dx == 0) /* segment is vertical */ { leftFace->xa = 0.5 * (double)lw; leftFace->ya = 0; leftFace->k = 0.5 * (double)(lw * dy); /* k = xa * dy - ya * dx */ rightFace->xa = -leftFace->xa; rightFace->ya = 0; rightFace->k = leftFace->k; /* k = xa * dy - ya * dx */ y = y1; if (projectLeft) y -= lw >> 1; x = x1 - (lw >> 1); dy = y2 - y; if (projectRight) dy += ((lw + 1) >> 1); dx = lw; miFillRectPolyHelper (paintedSet, pixel, x, y, (unsigned int)dx, (unsigned int)dy); } else /* general case: segment is neither horizontal nor vertical */ { double l, L, r; double xa, ya; double projectXoff = 0.0, projectYoff = 0.0; double k; double maxy; int finaly; int lefty, righty, topy, bottomy; PolyEdge lefts[2], rights[2]; PolyEdge *left, *right; PolyEdge *top, *bottom; l = 0.5 * ((double) lw); L = hypot ((double) dx, (double) dy); if (dx < 0) { right = &rights[1]; left = &lefts[0]; top = &rights[0]; bottom = &lefts[1]; } else { right = &rights[0]; left = &lefts[1]; top = &lefts[0]; bottom = &rights[1]; } r = l / L; /* this is ell / L, not 1 / L */ ya = -r * dx; xa = r * dy; if (projectLeft | projectRight) { projectXoff = -ya; projectYoff = xa; } /* build first long edge */ k = l * L; /* xa * dy - ya * dx */ leftFace->xa = xa; leftFace->ya = ya; leftFace->k = k; rightFace->xa = -xa; rightFace->ya = -ya; rightFace->k = k; if (projectLeft) righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff, k, dx, dy, x1, y1, false, right); else righty = miPolyBuildEdge (xa, ya, k, dx, dy, x1, y1, false, right); /* build second long edge */ ya = -ya; xa = -xa; k = -k; /* xa * dy - ya * dx */ if (projectLeft) lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff, k, dx, dy, x1, y1, true, left); else lefty = miPolyBuildEdge (xa, ya, k, dx, dy, x1, y1, true, left); /* build first short edge, on left end */ if (signdx > 0) { ya = -ya; xa = -xa; } if (projectLeft) { double xap = xa - projectXoff; double yap = ya - projectYoff; topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy, -dy, dx, x1, y1, (dx > 0 ? true : false), top); } else topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, x1, y1, (dx > 0 ? true : false), top); /* build second short edge, on right end */ if (projectRight) { double xap = xa + projectXoff; double yap = ya + projectYoff; bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy, -dy, dx, x2, y2, (dx < 0 ? true : false), bottom); maxy = -ya + projectYoff; } else { bottomy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, x2, y2, (dx < 0 ? true : false), bottom); maxy = -ya; } finaly = ICEIL (maxy) + y2; if (dx < 0) { left->height = (unsigned int)(bottomy - lefty); right->height = (unsigned int)(finaly - righty); top->height = (unsigned int)(righty - topy); } else { right->height = (unsigned int)(bottomy - righty); left->height = (unsigned int)(finaly - lefty); top->height = (unsigned int)(lefty - topy); } bottom->height = (unsigned int)(finaly - bottomy); /* fill the rectangle (2 left edges, 2 right edges) */ miFillPolyHelper (paintedSet, pixel, topy, (unsigned int)(bottom->height + bottomy - topy), lefts, rights, 2, 2); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_zerarc.c��������������������������������������������������������������������0000644�0001750�0001750�00000057530�10346060461�013756� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* Original author: Bob Scheifler, MIT X Consortium, mid 1980s. Hacked by Robert S. Maier , 1998-99 */ /* Derived from: * "Algorithm for drawing ellipses or hyperbolae with a digital plotter" * by M. L. V. Pitteway * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289 */ /* This module contains the miZeroPolyArc() function and its reentrant counterpart miZeroPolyArc_r. They draw single-pixel (Bresenham) polyarcs, either solid or dashed. A fast integer algorithm is used. A polyarc is a list of arcs, which may or may not be contiguous. An `arc' is an elliptic arc, i.e., a segment of an ellipse. The principal axes of the ellipse must be aligned with the coordinate axes. The cap mode and join mode in the graphics context are ignored. All painting goes through the low-level MI_COPY_AND_PAINT_SPANS() and MI_PAINT_SPANS() macros. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #include "mi_arc.h" #include "mi_zerarc.h" #define FULLCIRCLE (360 * 64) #define OCTANT (45 * 64) #define QUADRANT (90 * 64) #define HALFCIRCLE (180 * 64) #define QUADRANT3 (270 * 64) /* trig functions, angle specified in 1/64 degrees */ #define Dsin(d) ((d) == 0 ? 0.0 : ((d) == QUADRANT ? 1.0 : \ ((d) == HALFCIRCLE ? 0.0 : \ ((d) == QUADRANT3 ? -1.0 : sin((double)d*(M_PI/11520.0)))))) #define Dcos(d) ((d) == 0 ? 1.0 : ((d) == QUADRANT ? 0.0 : \ ((d) == HALFCIRCLE ? -1.0 : \ ((d) == QUADRANT3 ? 0.0 : cos((double)d*(M_PI/11520.0)))))) #define EPSILON45 64 typedef struct { bool skipStart; bool haveStart; miPoint startPt; bool haveLast; bool skipLast; miPoint endPt; int dashNum; int dashIndex; int dashOffset; int dashNumInit; int dashIndexInit; int dashOffsetInit; } miDashInfo; static const miZeroArcPt _oob_arc_pt = {INT_MAX, INT_MAX, 0}; /* forward references */ static bool miZeroArcSetup (const miArc *arc, miZeroArc *info, bool ok360); static miPoint * miZeroArcPts (const miArc *arc, miPoint *pts); static void miZeroArcDashPts (const miGC *pGC, const miArc *arc, miDashInfo *dinfo, int maxPts, miPoint **pts); /* * This is the reentrant version, miZeroPolyArc_r. The non-reentrant * version, miZeroPolyArc, simply calls this version, using an in-library * `rasterized ellipse' cache. */ void miZeroPolyArc_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache) { const miArc *arc; miDashInfo dinfo; int j; if (pGC->lineStyle != (int)MI_LINE_SOLID) /* initialize structure used in dashing */ { dinfo.haveStart = false; dinfo.skipStart = false; dinfo.haveLast = false; dinfo.dashIndexInit = 0; dinfo.dashNumInit = 0; dinfo.dashOffsetInit = 0; /* perform initial offsetting into the dash array */ miStepDash (pGC->dashOffset, &dinfo.dashNumInit, &dinfo.dashIndexInit, pGC->dash, pGC->numInDashList, &dinfo.dashOffsetInit); } for (arc = parcs, j = narcs; --j >= 0; arc++) { if (!MI_CAN_ZERO_ARC(arc)) /* Too large an arc for integer algorithm to perform properly, so hand it off to floating-point wide polyarc algorithm, which can do zero-width polyarcs too. */ /* N.B. This handoff is lame. If dashing, dash pattern won't be carried over from arc to contiguous arc. */ miPolyArc_r (paintedSet, pGC, 1, arc, ellipseCache); else /* not unusually large, use integer Bresenham algorithm */ { miPoint **ptsInit, **pts; int maxPts = 0, numPts, i, n; int numPixels = pGC->numPixels; if (arc->width > arc->height) maxPts = arc->width + (arc->height >> 1); else maxPts = arc->height + (arc->width >> 1); if (maxPts == 0) continue; /* max points produced by Bresenham algorithm (overestimate?) */ numPts = 4 * maxPts; /* generate points (note that if dashing, dash pattern will carry over from arc to contiguous arc) */ ptsInit = (miPoint **)mi_xmalloc(numPixels * sizeof(miPoint *)); pts = (miPoint **)mi_xmalloc(numPixels * sizeof(miPoint *)); if (pGC->lineStyle == (int)MI_LINE_SOLID) { for (i = 0; i < numPixels; i++) { if (i == 1) ptsInit[i] = (miPoint *)mi_xmalloc(numPts * sizeof(miPoint)); else /* `solid' uses paint type #1 only */ ptsInit[i] = (miPoint *)NULL; pts[i] = ptsInit[i]; } /* compute points, return pointer to slot after last-generated point */ pts[1] = miZeroArcPts (arc, ptsInit[1]); } else /* on/off dashed or double-dashed */ { for (i = 0; i < numPixels; i++) { ptsInit[i] = (miPoint *)mi_xmalloc(numPts * sizeof(miPoint)); pts[i] = ptsInit[i]; } /* compute points, return ptrs to ones after last-generated */ dinfo.skipLast = (i == 0 ? false : true); miZeroArcDashPts (pGC, arc, &dinfo, maxPts, pts); dinfo.skipStart = true; } /* paint all generated points (except if not double-dashing, don't paint points in paint type #0) */ for (i = 0; i < numPixels; i++) { if (ptsInit[i] == (miPoint *)NULL) continue; if (i == 0 && pGC->lineStyle != (int)MI_LINE_DOUBLE_DASH) { free (ptsInit[i]); continue; } n = pts[i] - ptsInit[i]; if (n > 0) { unsigned int *widths; int k; widths = (unsigned int *)mi_xmalloc(n * sizeof(unsigned int)); for (k = 0; k < n; k++) widths[k] = 1; miQuickSortSpansY (ptsInit[i], widths, n); MI_PAINT_SPANS(paintedSet, pGC->pixels[i], n, ptsInit[i], widths) } } /* end of drawing loop over paint types */ /* free arrays of pointers to storage */ free (pts); free (ptsInit); } /* end of integer Bresenham algorithm applied to a single arc */ } /* end of loop over arcs */ } #ifndef NO_NONREENTRANT_POLYARC_SUPPORT void miZeroPolyArc (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs) { if (_mi_ellipseCache == (miEllipseCache *)NULL) _mi_ellipseCache = miNewEllipseCache (); miZeroPolyArc_r (paintedSet, pGC, narcs, parcs, _mi_ellipseCache); } #endif /* not NO_NONREENTRANT_POLYARC_SUPPORT */ #define Pixelate(pts, xval, yval) \ { \ pts->x = xval; \ pts->y = yval; \ pts++; \ } #define DoPix(pts, mask, idx, xval, yval) \ if (mask & (1 << idx)) Pixelate(pts, xval, yval); /* Generate points that make up a solid zero-width arc, and write them to pre-allocated storage; return pointer to miPoint after last-generated point. Storage supplied by caller, should be sufficiently large. */ static miPoint * miZeroArcPts (const miArc *arc, miPoint *pts) { miZeroArc info; int x, y, a, b, d; unsigned int mask; int k1, k3, dx, dy; bool do360; do360 = miZeroArcSetup(arc, &info, true); MIARCSETUP(info, x, y, k1, k3, a, b, d, dx, dy); mask = info.initialMask; if (!(arc->width & 1)) /* even width */ { DoPix (pts, mask, 1, info.xorgo, info.yorg); DoPix (pts, mask, 3, info.xorgo, info.yorgo); } if (!info.end.x || !info.end.y) { mask = info.end.mask; info.end = info.altend; } if (do360 && (arc->width == arc->height) && !(arc->width & 1)) /* full circle, even diameter */ { int yorgh = info.yorg + info.h; int xorghp = info.xorg + info.h; int xorghn = info.xorg - info.h; for ( ; ; ) { Pixelate(pts, info.xorg + x, info.yorg + y); Pixelate(pts, info.xorg - x, info.yorg + y); Pixelate(pts, info.xorg - x, info.yorgo - y); Pixelate(pts, info.xorg + x, info.yorgo - y); if (a < 0) break; Pixelate(pts, xorghp - y, yorgh - x); Pixelate(pts, xorghn + y, yorgh - x); Pixelate(pts, xorghn + y, yorgh + x); Pixelate(pts, xorghp - y, yorgh + x); MIARCCIRCLESTEP(x, y, a, b, d, k1, k3, ;); } if (x > 1 && pts[-1].x == pts[-5].x && pts[-1].y == pts[-5].y) pts -= 4; x = info.w; y = info.h; } else if (do360) /* full ellipse */ { while (y < (int)info.h || x < (int)info.w) { MIARCOCTANTSHIFT(info, x, y, dx, dy, a, b, d, k1, k3, ;); Pixelate(pts, info.xorg + x, info.yorg + y); Pixelate(pts, info.xorgo - x, info.yorg + y); Pixelate(pts, info.xorgo - x, info.yorgo - y); Pixelate(pts, info.xorg + x, info.yorgo - y); MIARCSTEP(x, y, dx, dy, a, b, d, k1, k3, ;, ;); } } else /* hard case */ { while (y < (int)info.h || x < (int)info.w) { MIARCOCTANTSHIFT(info, x, y, dx, dy, a, b, d, k1, k3, ;); if ((x == info.start.x) || (y == info.start.y)) { mask = info.start.mask; info.start = info.altstart; } DoPix (pts, mask, 0, info.xorg + x, info.yorg + y); DoPix (pts, mask, 1, info.xorgo - x, info.yorg + y); DoPix (pts, mask, 2, info.xorgo - x, info.yorgo - y); DoPix (pts, mask, 3, info.xorg + x, info.yorgo - y); if ((x == info.end.x) || (y == info.end.y)) { mask = info.end.mask; info.end = info.altend; } MIARCSTEP(x, y, dx, dy, a, b, d, k1, k3, ;, ;); } } if ((x == info.start.x) || (y == info.start.y)) mask = info.start.mask; DoPix (pts, mask, 0, info.xorg + x, info.yorg + y); DoPix (pts, mask, 2, info.xorgo - x, info.yorgo - y); if (arc->height & 1) /* odd height */ { DoPix (pts, mask, 1, info.xorgo - x, info.yorg + y); DoPix (pts, mask, 3, info.xorg + x, info.yorgo - y); } return pts; } #undef DoPix #define DoPix(arcPts, mask, idx, xval, yval) \ if (mask & (1 << idx)) \ { \ arcPts[idx]->x = xval; \ arcPts[idx]->y = yval; \ arcPts[idx]++; \ } /* Generate the points that make up a dashed zero-width arc, possibly multicolored; write them to pre-allocated storage, indexed by paint type. */ /* ARGS: dinfo = updated vars (e.g. dashNum, dashIndex), pts[i] = storage for paint type #i */ static void miZeroArcDashPts (const miGC *pGC, const miArc *arc, miDashInfo *dinfo, int maxPts, miPoint **pts) { miZeroArc info; int x, y, a, b, d; unsigned int mask; int k1, k3, dx, dy; int dashRemaining, numPixels; miPoint *points, *arcPts[4]; miPoint *startPts[5], *endPts[5]; int deltas[5]; miPoint *pt, *startPt, *lastPt; int i, j, seg, startseg; /* allocate temp storage, split into four pieces */ points = (miPoint *)mi_xmalloc(sizeof(miPoint) * 4 * maxPts); for (i = 0; i < 4; i++) arcPts[i] = points + (i * maxPts); miZeroArcSetup (arc, &info, false); MIARCSETUP(info, x, y, k1, k3, a, b, d, dx, dy); mask = info.initialMask; startseg = info.startAngle / QUADRANT; startPt = arcPts[startseg]; if (!(arc->width & 1)) { DoPix (arcPts, mask, 1, info.xorgo, info.yorg); DoPix (arcPts, mask, 3, info.xorgo, info.yorgo); } if (!info.end.x || !info.end.y) { mask = info.end.mask; info.end = info.altend; } while (y < (int)info.h || x < (int)info.w) { MIARCOCTANTSHIFT(info, x, y, dx, dy, a, b, d, k1, k3, ;); if ((x == info.firstx) || (y == info.firsty)) startPt = arcPts[startseg]; if ((x == info.start.x) || (y == info.start.y)) { mask = info.start.mask; info.start = info.altstart; } DoPix (arcPts, mask, 0, info.xorg + x, info.yorg + y); DoPix (arcPts, mask, 1, info.xorgo - x, info.yorg + y); DoPix (arcPts, mask, 2, info.xorgo - x, info.yorgo - y); DoPix (arcPts, mask, 3, info.xorg + x, info.yorgo - y); if ((x == info.end.x) || (y == info.end.y)) { mask = info.end.mask; info.end = info.altend; } MIARCSTEP(x, y, dx, dy, a, b, d, k1, k3, ;, ;); } if ((x == info.firstx) || (y == info.firsty)) startPt = arcPts[startseg]; if ((x == info.start.x) || (y == info.start.y)) mask = info.start.mask; DoPix (arcPts, mask, 0, info.xorg + x, info.yorg + y); DoPix (arcPts, mask, 2, info.xorgo - x, info.yorgo - y); if (arc->height & 1) { DoPix (arcPts, mask, 1, info.xorgo - x, info.yorg + y); DoPix (arcPts, mask, 3, info.xorg + x, info.yorgo - y); } for (i = 0; i < 4; i++) { seg = (startseg + i) & 3; pt = points + (seg * maxPts); if (seg & 1) { startPts[i] = pt; endPts[i] = arcPts[seg]; deltas[i] = 1; } else { startPts[i] = arcPts[seg] - 1; endPts[i] = pt - 1; deltas[i] = -1; } } startPts[4] = startPts[0]; endPts[4] = startPt; startPts[0] = startPt; if (startseg & 1) { if (startPts[4] != endPts[4]) endPts[4]--; deltas[4] = 1; } else { if (startPts[0] > startPts[4]) startPts[0]--; if (startPts[4] < endPts[4]) endPts[4]--; deltas[4] = -1; } if (arc->angle2 < 0) { miPoint *tmps, *tmpe; int tmpd; tmpd = deltas[0]; tmps = startPts[0] - tmpd; tmpe = endPts[0] - tmpd; startPts[0] = endPts[4] - deltas[4]; endPts[0] = startPts[4] - deltas[4]; deltas[0] = -deltas[4]; startPts[4] = tmpe; endPts[4] = tmps; deltas[4] = -tmpd; tmpd = deltas[1]; tmps = startPts[1] - tmpd; tmpe = endPts[1] - tmpd; startPts[1] = endPts[3] - deltas[3]; endPts[1] = startPts[3] - deltas[3]; deltas[1] = -deltas[3]; startPts[3] = tmpe; endPts[3] = tmps; deltas[3] = -tmpd; tmps = startPts[2] - deltas[2]; startPts[2] = endPts[2] - deltas[2]; endPts[2] = tmps; deltas[2] = -deltas[2]; } for (i = 0; i < 5 && startPts[i] == endPts[i]; i++) ; if (i == 5) return; pt = startPts[i]; for (j = 4; startPts[j] == endPts[j]; j--) ; lastPt = endPts[j] - deltas[j]; if (dinfo->haveLast && (pt->x == dinfo->endPt.x) && (pt->y == dinfo->endPt.y)) startPts[i] += deltas[i]; else /* not contiguous; restart dash pattern */ { dinfo->dashNum = dinfo->dashNumInit; dinfo->dashIndex = dinfo->dashIndexInit; dinfo->dashOffset = dinfo->dashOffsetInit; } if (!dinfo->skipStart && (info.startAngle != info.endAngle)) { dinfo->startPt = *pt; dinfo->haveStart = true; } else if (!dinfo->skipLast && dinfo->haveStart && (lastPt->x == dinfo->startPt.x) && (lastPt->y == dinfo->startPt.y) && (lastPt != startPts[i])) endPts[j] = lastPt; if (info.startAngle != info.endAngle) { dinfo->haveLast = true; dinfo->endPt = *lastPt; } /* iterate through generated points, updating dash information (e.g., dashNum and paint type), writing points in paint type `i' into pre-allocated array pts[i] */ dashRemaining = (int)pGC->dash[dinfo->dashIndex] - dinfo->dashOffset; numPixels = pGC->numPixels; for (i = 0; i < 5; i++) { int delta; pt = startPts[i]; lastPt = endPts[i]; delta = deltas[i]; while (pt != lastPt) { int dashNum, paintType; /* use a paint type that cycles through 1..(numPixels-1) for even-numbered dashes, and is 0 for odd-numbered ones */ dashNum = dinfo->dashNum; paintType = (dashNum & 1) ? 0 : 1 + ((dashNum / 2) % (numPixels-1)); while ((pt != lastPt) && --dashRemaining >= 0) { *(pts[paintType]++) = *pt; pt += delta; } if (dashRemaining <= 0) /* on to next dash */ { ++(dinfo->dashNum); if (++(dinfo->dashIndex) == pGC->numInDashList) /* loop to beginning of dash array */ dinfo->dashIndex = 0; dashRemaining = (int)pGC->dash[dinfo->dashIndex]; } } } /* pass back amount left in now-current dash, so that dash pattern will continue from arc to contiguous arc */ dinfo->dashOffset = (int)pGC->dash[dinfo->dashIndex] - dashRemaining; /* free temp storage */ free (points); } /* * (x - l)^2 / (W/2)^2 + (y + H/2)^2 / (H/2)^2 = 1 * * where l is either 0 or .5 * * alpha = 4(W^2) * beta = 4(H^2) * gamma = 0 * u = 2(W^2)H * v = 4(H^2)l * k = -4(H^2)(l^2) * */ /* Helper function called by ZeroArcPts() and ZeroArcDashPts() above. Generates a miZeroArc struct for any specified arc. */ static bool miZeroArcSetup (const miArc *arc, miZeroArc *info, bool ok360) { int l, i; int angle1, angle2; int startseg, endseg; int startAngle, endAngle; miZeroArcPt start, end; bool overlap; l = arc->width & 1; if (arc->width == arc->height) /* circular arc */ { info->alpha = 4; info->beta = 4; info->k1 = -8; info->k3 = -16; info->b = 12; info->a = (arc->width << 2) - 12; info->d = 17 - (arc->width << 1); if (l) { info->b -= 4; info->a += 4; info->d -= 7; } } else if (arc->width == 0 || arc->height == 0) /* degenerate arc */ { info->alpha = 0; info->beta = 0; info->k1 = 0; info->k3 = 0; info->a = -(int)arc->height; info->b = 0; info->d = -1; } else /* non-degenerate non-circular arc */ { /* initial conditions */ info->alpha = (arc->width * arc->width) << 2; info->beta = (arc->height * arc->height) << 2; info->k1 = info->beta << 1; info->k3 = info->k1 + (info->alpha << 1); info->b = l ? 0 : -info->beta; info->a = info->alpha * arc->height; info->d = info->b - (info->a >> 1) - (info->alpha >> 2); if (l) info->d -= info->beta >> 2; info->a -= info->b; /* take first step, d < 0 always */ info->b -= info->k1; info->a += info->k1; info->d += info->b; /* octant change, b < 0 always */ info->k1 = -info->k1; info->k3 = -info->k3; info->b = -info->b; info->d = info->b - info->a - info->d; info->a = info->a - (info->b << 1); } info->dx = 1; info->dy = 0; info->w = (arc->width + 1) >> 1; info->h = arc->height >> 1; info->xorg = arc->x + (arc->width >> 1); info->yorg = arc->y; info->xorgo = info->xorg + l; info->yorgo = info->yorg + arc->height; if (arc->width == 0) { if (arc->height == 0) { info->x = 0; info->y = 0; info->initialMask = 0; info->startAngle = 0; info->endAngle = 0; info->start = _oob_arc_pt; info->end = _oob_arc_pt; return false; } info->x = 0; info->y = 1; } else { info->x = 1; info->y = 0; } angle1 = arc->angle1; angle2 = arc->angle2; if ((angle1 == 0) && (angle2 >= FULLCIRCLE)) { startAngle = 0; endAngle = 0; } else { if (angle2 > FULLCIRCLE) angle2 = FULLCIRCLE; else if (angle2 < -FULLCIRCLE) angle2 = -FULLCIRCLE; if (angle2 < 0) { startAngle = angle1 + angle2; endAngle = angle1; } else { startAngle = angle1; endAngle = angle1 + angle2; } if (startAngle < 0) startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE; if (startAngle >= FULLCIRCLE) startAngle = startAngle % FULLCIRCLE; if (endAngle < 0) endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE; if (endAngle >= FULLCIRCLE) endAngle = endAngle % FULLCIRCLE; } info->startAngle = startAngle; info->endAngle = endAngle; if (ok360 && (startAngle == endAngle) && arc->angle2 && arc->width && arc->height) { info->initialMask = 0xf; info->start = _oob_arc_pt; info->end = _oob_arc_pt; return true; } startseg = startAngle / OCTANT; if (!arc->height || (((startseg + 1) & 2) && arc->width)) { start.x = (int)(Dcos(startAngle) * ((arc->width + 1) / 2.0)); if (start.x < 0) start.x = -start.x; start.y = -1; } else { start.y = (int)(Dsin(startAngle) * (arc->height / 2.0)); if (start.y < 0) start.y = -start.y; start.y = info->h - start.y; start.x = INT_MAX; } endseg = endAngle / OCTANT; if (!arc->height || (((endseg + 1) & 2) && arc->width)) { end.x = (int)(Dcos(endAngle) * ((arc->width + 1) / 2.0)); if (end.x < 0) end.x = -end.x; end.y = -1; } else { end.y = (int)(Dsin(endAngle) * (arc->height / 2.0)); if (end.y < 0) end.y = -end.y; end.y = info->h - end.y; end.x = INT_MAX; } info->firstx = start.x; info->firsty = start.y; info->initialMask = 0; overlap = ((arc->angle2 != 0) && (endAngle <= startAngle)) ? true : false; for (i = 0; i < 4; i++) { if (overlap ? ((i * QUADRANT <= endAngle) || ((i + 1) * QUADRANT > startAngle)) : ((i * QUADRANT <= endAngle) && ((i + 1) * QUADRANT > startAngle))) info->initialMask |= (1 << i); } start.mask = info->initialMask; end.mask = info->initialMask; startseg >>= 1; endseg >>= 1; overlap = (overlap && (endseg == startseg)) ? true : false; if (start.x != end.x || start.y != end.y || !overlap) { if (startseg & 1) { if (!overlap) info->initialMask &= ~(1 << startseg); if (start.x > end.x || start.y > end.y) end.mask &= ~(1 << startseg); } else { start.mask &= ~(1 << startseg); if (((start.x < end.x || start.y < end.y) || (start.x == end.x && start.y == end.y && (endseg & 1))) && !overlap) end.mask &= ~(1 << startseg); } if (endseg & 1) { end.mask &= ~(1 << endseg); if (((start.x > end.x || start.y > end.y) || (start.x == end.x && start.y == end.y && !(startseg & 1))) && !overlap) start.mask &= ~(1 << endseg); } else { if (!overlap) info->initialMask &= ~(1 << endseg); if (start.x < end.x || start.y < end.y) start.mask &= ~(1 << endseg); } } /* take care of case when start and stop are both near 45 */ /* handle here rather than adding extra code to pixelization loops */ if (startAngle && ((start.y < 0 && end.y >= 0) || (start.y >= 0 && end.y < 0))) { i = (startAngle + OCTANT) % OCTANT; if (i < EPSILON45 || i > OCTANT - EPSILON45) { i = (endAngle + OCTANT) % OCTANT; if (i < EPSILON45 || i > OCTANT - EPSILON45) { if (start.y < 0) { i = (int)(Dsin(startAngle) * (arc->height / 2.0)); if (i < 0) i = -i; if ((int)info->h - i == end.y) start.mask = end.mask; } else { i = (int)(Dsin(endAngle) * (arc->height / 2.0)); if (i < 0) i = -i; if ((int)info->h - i == start.y) end.mask = start.mask; } } } } if (startseg & 1) { info->start = start; info->end = _oob_arc_pt; } else { info->end = start; info->start = _oob_arc_pt; } if (endseg & 1) { info->altend = end; if (info->altend.x < info->end.x || info->altend.y < info->end.y) { miZeroArcPt tmp; tmp = info->altend; info->altend = info->end; info->end = tmp; } info->altstart = _oob_arc_pt; } else { info->altstart = end; if (info->altstart.x < info->start.x || info->altstart.y < info->start.y) { miZeroArcPt tmp; tmp = info->altstart; info->altstart = info->start; info->start = tmp; } info->altend = _oob_arc_pt; } if (!info->start.x || !info->start.y) { info->initialMask = info->start.mask; info->start = info->altstart; } if (!arc->width && (arc->height == 1)) { /* kludge! */ info->initialMask |= info->end.mask; info->initialMask |= info->initialMask << 1; info->end.x = 0; info->end.mask = 0; } return false; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_zerolin.c�������������������������������������������������������������������0000644�0001750�0001750�00000050450�10346060500�014136� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1985, 1986, 1987, 1988, 1989, X Consortium. For an associated permission notice, see the accompanying file README-X. GNU enhancements Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This module contains the miZeroLine() and miZeroDash() functions. They a rasterize single-pixel (i.e., `zero-width') Bresenham polyline, either solid or dashed. The cap mode and join mode in the graphics context are ignored, except that if the cap mode is MI_CAP_NOT_LAST, the final pixel of the polyline is omitted. All painting goes through the low-level MI_PAINT_SPANS() and MI_COPY_AND_PAINT_SPANS() macros. */ /* Historical note: this is a merger of MI code from X11, written by Ken Whaley, with low-level X11 CFB (color frame-buffer) code, of unknown authorship. (I wrote Ken, and he remembers writing the monochrome frame buffer code, but not the color code.) That's because the X11 MI code included miZeroLine(), but not miZeroDash(). I based the latter on the CFB routines. I needed to hack them extensively so that they would generate a list of spans to paint. I also removed clipping code. --rsm */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" #include "mi_spans.h" #include "mi_gc.h" #include "mi_api.h" #include "mi_line.h" /* Comment on drawing solid lines (from Ken Whaley): NON-SLOPED LINES Horizontal lines are always drawn left to right; we have to move the endpoints right by one after they're swapped. Vertical lines are always drawn top to bottom (y-increasing). This requires adding one to the y-coordinate of each endpoint after swapping. */ /* forward references */ static void cfbBresD (miPaintedSet *paintedSet, const miGC *pGC, int *pdashNum, int *pdashIndex, const unsigned int *pDash, int numInDashList, int *pdashOffset, bool isDoubleDash, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e2, int len); static void cfbBresS (miPaintedSet *paintedSet, const miGC *pGC, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e2, int len); static void cfbHorzS (miPaintedSet *paintedSet, const miGC *pGC, int x1, int y1, int len); static void cfbVertS (miPaintedSet *paintedSet, const miGC *pGC, int x1, int y1, int len); /* Macro for painting a single point. Used for ending line segments. */ #define MI_PAINT_POINT(paintedSet, pixel, xx, yy) \ {\ miPoint *point;\ unsigned int *width;\ point = (miPoint *)mi_xmalloc(sizeof(miPoint));\ width = (unsigned int *)mi_xmalloc(sizeof(unsigned int));\ *width = 1;\ point->x = xx;\ point->y = yy;\ MI_PAINT_SPANS(paintedSet, pixel, 1, point, width)\ } /* Macro for generating a list of spans, used when the successive points on a Bresenham line are generated. Assumes the availability of working storage, accessed via pointers `ppt' and `pwidths', and also variables numSpans (initted to 0), firstspan (initted to true), and ycurr. The arrays should be at least as large as the longest generated Bresenham line segment. */ #define MI_ADD_POINT(xx, yy, ppt, pwidth, numSpans, ycurr, firstspan, signdy) \ {\ if (!firstspan && yy == ycurr)\ {\ int xdelta = xx - ppt->x;\ if (xdelta < 0)\ {\ (*pwidth) -= xdelta;\ ppt->x = xx;\ }\ else if (xdelta > 0)\ { \ unsigned int widthcurr = *pwidth; \ (*pwidth) = UMAX(widthcurr, (unsigned int)(1 + xdelta));\ } \ }\ else\ {\ if (!firstspan)\ {\ ppt += signdy;\ pwidth += signdy;\ }\ else\ firstspan = false;\ ppt->x = xx;\ ppt->y = yy;\ *pwidth = 1;\ ycurr = yy;\ ++numSpans;\ }\ } /* * Draw a solid Bresenham polyline, i.e. a `zero-width' solid polyline, * in paint type #1. */ /* ARGS: mode = Origin or Previous npt = number of points pPts = point array */ void miZeroLine (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { const miPoint *ppt; /* pointer to point within array */ /* temporaries */ int xstart, ystart; int x1, x2; int y1, y2; /* ensure we have >=1 points */ if (npt <= 0) return; /* loop through points, drawing a solid Bresenham segment for each line segment */ ppt = pPts; xstart = ppt->x; ystart = ppt->y; x2 = xstart; y2 = ystart; while (--npt) { x1 = x2; y1 = y2; ++ppt; x2 = ppt->x; y2 = ppt->y; if (mode == MI_COORD_MODE_PREVIOUS) /* convert from relative coordinates */ { x2 += x1; y2 += y1; } if (x1 == x2) /* vertical line */ { if (y1 > y2) /* make line go top to bottom, keeping endpoint semantics */ { int tmp; tmp = y2; y2 = y1 + 1; y1 = tmp + 1; } /* draw line */ if (y1 != y2) cfbVertS (paintedSet, pGC, x1, y1, y2 - y1); /* restore final point */ y2 = ppt->y; } else if (y1 == y2) /* horizontal line */ { if (x1 > x2) /* force line from left to right, keeping endpoint semantics */ { int tmp; tmp = x2; x2 = x1 + 1; x1 = tmp + 1; } /* draw line */ if (x1 != x2) cfbHorzS (paintedSet, pGC, x1, y1, x2 - x1); /* restore final point */ x2 = ppt->x; } else /* sloped line */ { int adx; /* abs values of dx and dy */ int ady; int signdx; /* sign of dx and dy */ int signdy; int e, e1, e2; /* Bresenham error and increments */ int axis; /* major axis */ int len; /* length of segment */ AbsDeltaAndSign(x2, x1, adx, signdx); AbsDeltaAndSign(y2, y1, ady, signdy); if (adx > ady) { axis = X_AXIS; e1 = ady << 1; e2 = e1 - (adx << 1); e = e1 - adx; FIXUP_X_MAJOR_ERROR(e, signdx, signdy); } else { axis = Y_AXIS; e1 = adx << 1; e2 = e1 - (ady << 1); e = e1 - ady; FIXUP_Y_MAJOR_ERROR(e, signdx, signdy); } /* we have Bresenham parameters and two points, so all we need to do now is draw */ if (axis == X_AXIS) len = adx; else len = ady; cfbBresS (paintedSet, pGC, signdx, signdy, axis, x1, y1, e, e1, e2, len); } /* sloped line */ } /* while (--npt) */ /* Paint the last point if the end style isn't CapNotLast. (I.e. assume that a round/butt/projecting/triangular cap that is one pixel wide is the same as the single pixel of the endpoint.) */ if (pGC->capStyle != (int)MI_CAP_NOT_LAST && (xstart != x2 || ystart != y2 || ppt == pPts + 1)) MI_PAINT_POINT(paintedSet, pGC->pixels[1], x2, y2) } /* * Draw a dashed Bresenham polyline, i.e. a `zero-width' dashed polyline. */ /* ARGS: mode = Origin or Previous npt = number of points pPts = point array */ void miZeroDash (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npt, const miPoint *pPts) { const miPoint *ppt; /* pointer to current point */ /* temporaries */ int xstart, ystart; int x1, x2, y1, y2; const unsigned int *pDash; int dashNum, dashIndex; int dashOffset; int numInDashList; bool isDoubleDash; /* ensure we have >=1 points */ if (npt <= 0) return; /* perform initial offsetting into the dash array; compute dash values */ pDash = pGC->dash; numInDashList = pGC->numInDashList; isDoubleDash = (pGC->lineStyle == (int)MI_LINE_DOUBLE_DASH ? true : false); dashNum = 0; dashIndex = 0; dashOffset = 0; miStepDash (pGC->dashOffset, &dashNum, &dashIndex, pDash, numInDashList, &dashOffset); /* loop through points, drawing a dashed Bresenham segment for each line segment of nonzero length */ ppt = pPts; xstart = ppt->x; ystart = ppt->y; x2 = xstart; y2 = ystart; while (--npt) { x1 = x2; y1 = y2; ++ppt; x2 = ppt->x; y2 = ppt->y; if (mode == MI_COORD_MODE_PREVIOUS) /* convert from relative coordinates */ { x2 += x1; y2 += y1; } /* use Bresenham algorithm for sloped lines (no special treatment for horizontal or vertical lines, unlike the undashed case) */ { int adx; /* abs values of dx and dy */ int ady; int signdx; /* sign of dx and dy */ int signdy; int e, e1, e2; /* Bresenham error and increments */ int axis; /* major axis */ int len; AbsDeltaAndSign(x2, x1, adx, signdx); AbsDeltaAndSign(y2, y1, ady, signdy); if (adx > ady) { axis = X_AXIS; e1 = ady << 1; e2 = e1 - (adx << 1); e = e1 - adx; len = adx; FIXUP_X_MAJOR_ERROR(e, signdx, signdy); } else { axis = Y_AXIS; e1 = adx << 1; e2 = e1 - (ady << 1); e = e1 - ady; len = ady; FIXUP_Y_MAJOR_ERROR(e, signdx, signdy); } /* we have Bresenham parameters and two points, so all we need to do now is draw (updating dashNum, dashIndex and dashOffset) */ cfbBresD (paintedSet, pGC, &dashNum, &dashIndex, pDash, numInDashList, &dashOffset, isDoubleDash, signdx, signdy, axis, x1, y1, e, e1, e2, len); } } /* while (nline--) */ /* paint the last point if the end style isn't CapNotLast. (Assume that a projecting, butt, or round cap that is one pixel wide is the same as the single pixel of the endpoint.) */ if (pGC->capStyle != (int)MI_CAP_NOT_LAST && (xstart != x2 || ystart != y2 || ppt == pPts + 1)) { if (dashNum & 1) { /* background dash */ if (isDoubleDash) /* paint, in paint type #0 */ MI_PAINT_POINT(paintedSet, pGC->pixels[0], x2, y2); } else /* foreground dash */ { /* use a paint type that cycles through 1..(numPixels-1) */ int numPixels = pGC->numPixels; int paintType = 1 + ((dashNum / 2) % (numPixels - 1)); MI_PAINT_POINT(paintedSet, pGC->pixels[paintType], x2, y2); } } } /* Internal: draw solid Bresenham line segment, in paint type #1. Called by miZeroLine(). Endpoint semantics are used, i.e. we paint only len pixels (i.e. |dx| or |dy| pixels), not including the endpoint. */ /* ARGS: signdx,signdy = signs of directions axis = major axis (Y_AXIS or X_AXIS) x1,y1 = initial point e = error accumulator e1,e2 = Bresenham increments len = length of line in pixels */ static void cfbBresS (miPaintedSet *paintedSet, const miGC *pGC, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e2, int len) { miPoint *pptInit, *pptLast; unsigned int *pwidthInit, *pwidthLast; int x, y; int e3; /* variables in span generation code, i.e. in MI_ADD_POINT() */ int numSpans; int ycurr; miPoint *ppt; unsigned int *pwidth; bool firstspan; if (len == 0) return; /* set up work arrays */ pptInit = (miPoint *)mi_xmalloc(len * sizeof(miPoint)); pwidthInit = (unsigned int *)mi_xmalloc(len * sizeof(unsigned int)); pptLast = pptInit + (len - 1); pwidthLast = pwidthInit + (len - 1); /* reset variables used in MI_ADD_POINT() */ numSpans = 0; ycurr = 0; firstspan = true; if (signdy >= 0) { ppt = pptInit; pwidth = pwidthInit; } else { ppt = pptLast; pwidth = pwidthLast; } e3 = e2 - e1; e = e - e1; /* make looping easier */ #define BresStep(minor,major) \ {if ((e += e1) >= 0) { e += e3; minor; } major;} #define Loop_x(counter,store) while (counter--) \ {store; BresStep(y+=signdy,x+=signdx) } #define Loop_y(counter,store) while (counter--) \ {store; BresStep(x+=signdx, y+=signdy) } /* point to first point, and generate len pixels */ x = x1; y = y1; switch (axis) { case X_AXIS: default: Loop_x(len, MI_ADD_POINT(x, y, ppt, pwidth, numSpans, ycurr, firstspan, signdy)) break; case Y_AXIS: Loop_y(len, MI_ADD_POINT(x, y, ppt, pwidth, numSpans, ycurr, firstspan, signdy)) break; } if (numSpans > 0) { if (signdy < 0) /* spans are offset, so shift downward */ { miPoint *ppt_src = pptLast - (numSpans - 1); miPoint *ppt_dst = pptInit; unsigned int *pwidth_src = pwidthLast - (numSpans - 1); unsigned int *pwidth_dst = pwidthInit; int count = numSpans; while (count--) { *ppt_dst++ = *ppt_src++; *pwidth_dst++ = *pwidth_src++; } } MI_PAINT_SPANS(paintedSet, pGC->pixels[1], numSpans, pptInit, pwidthInit) } } /* Internal: draw dashed Bresenham line segment. Called by miZeroDash(). Endpoint semantics are used. */ /* ARGS: pdashNum = absolute dash number pdashIndx = index into dash array pDash = dash array numInDashList = length of dash array pdashOffset = offset into current dash signdx,signdy = signs of directions axis = major axis (Y_AXIS or X_AXIS) x1,y1 = initial point e = error accumulator e1,e2 = Bresenham increments len = length of line in pixels */ static void cfbBresD (miPaintedSet *paintedSet, const miGC *pGC, int *pdashNum, int *pdashIndex, const unsigned int *pDash, int numInDashList, int *pdashOffset, bool isDoubleDash, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e2, int len) { miPoint *pptInit_fg, *pptInit_bg = (miPoint *)NULL; miPoint *pptLast_fg, *pptLast_bg = (miPoint *)NULL; unsigned int *pwidthInit_fg, *pwidthInit_bg = (unsigned int *)NULL; unsigned int *pwidthLast_fg, *pwidthLast_bg = (unsigned int *)NULL; int x, y; int e3; int dashNum, dashIndex; int dashOffset; int dashRemaining; int thisDash; /* variables in span generation code, i.e. in MI_ADD_POINT() */ int numSpans_fg, numSpans_bg = 0; int ycurr_fg, ycurr_bg = 0; miPoint *ppt_fg, *ppt_bg = (miPoint *)NULL; unsigned int *pwidth_fg, *pwidth_bg = (unsigned int *)NULL; bool firstspan_fg, firstspan_bg = false; /* set up work arrays */ pptInit_fg = (miPoint *)mi_xmalloc(len * sizeof(miPoint)); pwidthInit_fg = (unsigned int *)mi_xmalloc(len * sizeof(unsigned int)); pptLast_fg = pptInit_fg + (len - 1); pwidthLast_fg = pwidthInit_fg + (len - 1); if (isDoubleDash) { pptInit_bg = (miPoint *)mi_xmalloc(len * sizeof(miPoint)); pwidthInit_bg = (unsigned int *)mi_xmalloc(len * sizeof(unsigned int)); pptLast_bg = pptInit_bg + (len - 1); pwidthLast_bg = pwidthInit_bg + (len - 1); } dashNum = *pdashNum; /* absolute number of current dash */ dashIndex = *pdashIndex; /* index of current dash */ dashOffset = *pdashOffset; /* offset into current dash */ dashRemaining = (int)(pDash[dashIndex]) - dashOffset; /* how much is left */ if (len <= (thisDash = dashRemaining)) /* line segment will be solid, not dashed */ { thisDash = len; dashRemaining -= len; } #define NextDash {\ dashNum++; \ dashIndex++; \ if (dashIndex == numInDashList) \ dashIndex = 0; \ dashRemaining = (int)(pDash[dashIndex]); \ if ((thisDash = dashRemaining) >= len) \ { \ dashRemaining -= len; \ thisDash = len; \ } \ } e3 = e2-e1; e = e - e1; /* make looping easier */ /* point to first point */ x = x1; y = y1; /* loop, generating dashes (in the absence of dashing, would generate len pixels in all) */ for ( ; ; ) { len -= thisDash; /* reset variables used in MI_ADD_POINT() */ numSpans_fg = 0; ycurr_fg = 0; firstspan_fg = true; if (signdy >= 0) { ppt_fg = pptInit_fg; pwidth_fg = pwidthInit_fg; } else { ppt_fg = pptLast_fg; pwidth_fg = pwidthLast_fg; } if (isDoubleDash) { numSpans_bg = 0; ycurr_bg = 0; firstspan_bg = true; ppt_bg = pptInit_bg; pwidth_bg = pwidthInit_bg; if (signdy >= 0) { ppt_bg = pptInit_bg; pwidth_bg = pwidthInit_bg; } else { ppt_bg = pptLast_bg; pwidth_bg = pwidthLast_bg; } } switch (axis) { case X_AXIS: default: if (dashIndex & 1) { if (isDoubleDash) { /* create background dash */ Loop_x(thisDash, MI_ADD_POINT(x, y, ppt_bg, pwidth_bg, numSpans_bg, ycurr_bg, firstspan_bg, signdy)) } else /* not double dashing; no background dash */ Loop_x(thisDash, ;); } else /* create foreground dash */ Loop_x(thisDash, MI_ADD_POINT(x, y, ppt_fg, pwidth_fg, numSpans_fg, ycurr_fg, firstspan_fg, signdy)) break; case Y_AXIS: if (dashIndex & 1) { if (isDoubleDash) { /* create background dash */ Loop_y(thisDash, MI_ADD_POINT(x, y, ppt_bg, pwidth_bg, numSpans_bg, ycurr_bg, firstspan_bg, signdy)) } else /* not double dashing; no background dash */ Loop_y(thisDash, ;); } else /* create foreground dash */ Loop_y(thisDash, MI_ADD_POINT(x, y, ppt_fg, pwidth_fg, numSpans_fg, ycurr_fg, firstspan_fg, signdy)) break; } /* end switch */ if (numSpans_fg > 0) /* have a foreground dash to paint */ { miPoint *pptStart_fg; unsigned int *pwidthStart_fg; if (signdy >= 0) { pptStart_fg = pptInit_fg; pwidthStart_fg = pwidthInit_fg; } else { pptStart_fg = pptLast_fg - (numSpans_fg - 1); pwidthStart_fg = pwidthLast_fg - (numSpans_fg - 1); } /* for foreground dash, use a paint type that cycles through 1..(numPixels-1) */ { int numPixels = pGC->numPixels; int paintType = 1 + ((dashNum / 2) % (numPixels - 1)); MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[paintType], numSpans_fg, pptStart_fg, pwidthStart_fg) } } if (isDoubleDash && numSpans_bg > 0) /* have a background dash to paint */ { miPoint *pptStart_bg; unsigned int *pwidthStart_bg; if (signdy >= 0) { pptStart_bg = pptInit_bg; pwidthStart_bg = pwidthInit_bg; } else { pptStart_bg = pptLast_bg - (numSpans_bg - 1); pwidthStart_bg = pwidthLast_bg - (numSpans_bg - 1); } /* for background dash, use paint type #0 */ MI_COPY_AND_PAINT_SPANS(paintedSet, pGC->pixels[0], numSpans_bg, pptStart_bg, pwidthStart_bg) } if (len == 0) break; /* break out of dash-generating loop */ NextDash /* update dashNum, dashIndex, thisDash, dashRemaining */ } /* end infinite dash-generating loop */ *pdashNum = dashNum; *pdashIndex = dashIndex; *pdashOffset = (int)(pDash[dashIndex]) - dashRemaining; free (pwidthInit_fg); free (pptInit_fg); if (isDoubleDash) { free (pwidthInit_bg); free (pptInit_bg); } } /* Internal: draw horizontal zero-width solid line segment, in paint type #1. Called by miZeroLine(). Called with len >= 1, and len=x2-x1. Endpoint semantics are used, so we paint only len pixels, i.e. x1..x2-1. */ /* ARGS: x1,y1 = initial point, len = length of line */ static void cfbHorzS (miPaintedSet *paintedSet, const miGC *pGC, int x1, int y1, int len) { miPoint *ppt; unsigned int *pwidth; ppt = (miPoint *)mi_xmalloc(sizeof(miPoint)); pwidth = (unsigned int *)mi_xmalloc(sizeof(unsigned int)); ppt->x = x1; ppt->y = y1; *pwidth = (unsigned int)len; MI_PAINT_SPANS(paintedSet, pGC->pixels[1], 1, ppt, pwidth) } /* Internal: draw vertical zero-width solid line segment, in paint type #1. Called by miZeroLine(). Called with len >= 1, and len=y2-y1. Endpoint semantics are used, so we paint only len pixels, i.e. y1..y2-1. */ /* ARGS: x1,y1 = initial point, len = length of line */ static void cfbVertS (miPaintedSet *paintedSet, const miGC *pGC, int x1, int y1, int len) { miPoint *ppt, *pptInit; unsigned int *pwidth, *pwidthInit; int i; ppt = pptInit = (miPoint *)mi_xmalloc(len * sizeof(miPoint)); pwidth = pwidthInit = (unsigned int *)mi_xmalloc(len * sizeof(unsigned int)); for (i = 0; i < len; i++) { ppt->x = x1; ppt->y = y1 + i; ppt++; *pwidth++ = (unsigned int)1; } MI_PAINT_SPANS(paintedSet, pGC->pixels[1], len, pptInit, pwidthInit) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/mi_version.c�������������������������������������������������������������������0000644�0001750�0001750�00000002061�10346061136�014142� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU libxmi package. Copyright (C) 1998, 1999, 2000, 2005, Free Software Foundation, Inc. The GNU libxmi package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU libxmi package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file includes version information that is compiled into libxmi. */ #include "sys-defines.h" #include "extern.h" #include "xmi.h" const char mi_libxmi_ver[8] = MI_LIBXMI_VER_STRING; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/CUSTOMIZE����������������������������������������������������������������������0000644�0001750�0001750�00000005074�06773666756�013174� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This file describes possible customizations of the libxmi library. Please read the file README first; it describes what libxmi does. 1. If desired, modify the default definition of `miPixel' in ./xmi.h by defining the MI_PIXEL_TYPE preprocessor symbol at compile time. Each point in a miPaintedSet is painted with a miPixel, but what a miPixel is, is up to you. By default it is an `unsigned int', but it could be another integer type, a floating point type, a structure, a union... That would be arranged by defining MI_PIXEL_TYPE. If MI_PIXEL_TYPE is a structure or a union, the macro MI_SAME_PIXEL(), which tests two miPixels for equality, should be redefined too. 2. If desired, define the macro MI_DEFAULT_MERGE2_PIXEL() also. As explained in ./xmi.h, by default, miCopyPaintedSetToCanvas() uses the Painter's Algorithm (a source pixel replaces a destination pixel). That may be altered programatically by invoking miSetPixelMerge2(). But at installation time, the default behavior may be altered too, by defining the macro MI_DEFAULT_MERGE2_PIXEL(new, source, dest). For example, if the miPixel datatype is defined to include an alpha component as well as color components, a change would be called for. 3. The same, for the macro MI_DEFAULT_MERGE3_PIXEL(). This macro is used when a "texture" pixel is available as part of a miCanvas, and must be taken into account, besides the source pixel and the destination pixel already on the miCanvas. 4. If desired, customize the definition of the `drawable' contained within an miCanvas by defining the symbol MI_CANVAS_DRAWABLE_TYPE. If this is not defined, the drawable will be an miPixmap. If you define MI_CANVAS_DRAWABLE_TYPE, you will also need to define the accessor macros MI_GET_CANVAS_DRAWABLE_PIXEL(pCanvas, x, y, pixel) and MI_SET_CANVAS_DRAWABLE_PIXEL(pCanvas, x, y, pixel). The macro MI_GET_CANVAS_DRAWABLE_BOUNDS(pCanvas, xleft, ytop, xright, ybottom) should be defined too. See ./xmi.h. Actually, if you are interested only in the first stage of the graphics pipeline, i.e., the painting of pixels in a miPaintedSet by the eight drawing functions in the core API, only modification #1 above is relevant. A miPaintedSet is an opaque object, but by looking at the function miCopyPaintedSetToCanvas() in the file mi_canvas.c, you should be able to see how it is laid out. It would be trivial to write your own function that copies pixels out of a miPaintedSet, i.e., to rewrite the second stage of the graphics pipeline from scratch in a completely customized way. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/README-X�����������������������������������������������������������������������0000644�0001750�0001750�00000005515�10346057627�012732� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Many of the files ./mi_*.c and ./mi_*.h are based on the vector graphics code in the sample X server supplied in the X Window System distribution, version X11R6. This code was written in the mid-to-late 1980's by Brian Kelleher, Joel McCormack, Todd Newman, Keith Packard, Robert Scheifler and Ken Whaley, who worked for Digital Equipment Corp., MIT, and/or the X Consortium. Their contributions are Copyright (C) 1985, 1986, 1987, 1988, 1989 by the X Consortium. The following X Window System copyright and permission notice apply. /***********************************************************/ Copyright (c) 1985-1989 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/VERSION������������������������������������������������������������������������0000644�0001750�0001750�00000000443�10342362450�012675� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The version of libxmi in this directory is 1.3, age=1. (Age=1 means that its interfaces are backward compatible with libxmi 1.x and 0.x.) The library version number is not necessarily the same as the version number of the libxmi package. However, we are now trying to keep them the same. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/drawing.c����������������������������������������������������������������������0000644�0001750�0001750�00000011745�10342512553�013434� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This is a sample program that uses libxmi to draw on a 60x35 canvas, and writes the canvas to standard output. Actually, since libxmi uses a two-stage graphics pipeline, the program first constructs a `painted set' (a set of points with integer coordinates, partitioned by pixel value), and merges the painted set onto a 60x35 canvas. The painted set consists of a filled rectangle, a polyline, and an arc that subtends 270 degrees. The rectangle is filled with color 1. The polyline and the arc are dashed. Their line type is MI_LINE_ON_OFF_DASHED, and the `on' dashes are multicolored: they cycle through colors 1,2,3. (The `off' dashes are not drawn, but if they were [which would be the case if MI_LINE_DOUBLE_DASHED were the line type], they would all be in color 0.) The background color of the canvas onto which the painted set is merged is 0. All these color values are miPixel values, and may be chosen arbitrarily. By default, miPixel is typedef'd to `unsigned int'. You may interpret a miPixel however you choose. It could be a color index, an RGB value,... The line width for both the polyline and the arc is set to `0'. This is a special value: it requests that a so-called Bresenham algorithm be used. A Bresenham algorithm often yields better-looking lines than line width 1. If the line width is positive, the polyline and the arc will be drawn with a brush of that width, and all pixels touched by the brush will be painted. Dashing may be requested for positive line width, just as it is for line width 0. */ #include #include #include /* public libxmi header file */ int main () { miRectangle rect; /* 1 rectangle to be filled */ miPoint points[4]; /* 3 line segments in polyline to be drawn */ miArc arc; /* 1 arc to be drawn */ miPixel pixels[4]; /* pixel values for drawing and dashing */ unsigned int dashes[2]; /* length of `on' and `off' dashes */ miGC *pGC; /* graphics context */ miPaintedSet *paintedSet; /* opaque object to be painted */ miCanvas *canvas; /* drawing canvas (including pixmap) */ miPoint offset; /* for miPaintedSet -> miCanvas transfer */ int i, j; /* Define rectangle: upper left vertex = (40,0), lower right = (55,5). */ /* But note libxmi's convention: right and bottom edges of filled polygons (including rectangles) are never painted, in order that adjacent polygons will abut with no overlaps or gaps. This filled rectangle, when merged onto the canvas, will extend only to (54,4). */ rect.x = 40; rect.y = 0; rect.width = 15; rect.height = 5; /* define polyline: vertices are (25,5) (5,5), (5,25), (35,22) */ points[0].x = 25; points[0].y = 5; points[1].x = 5; points[1].y = 5; points[2].x = 5; points[2].y = 25; points[3].x = 35; points[3].y = 22; /* define elliptic arc */ arc.x = 20; arc.y = 15; /* upper left corner of bounding box */ arc.width = 30; /* x range of box: 20..50 */ arc.height = 16; /* y range of box: 15..31 */ arc.angle1 = 0 * 64; /* starting angle (1/64'ths of a degree) */ arc.angle2 = 270 * 64; /* angle range (1/64'ths of a degree) */ /* create and modify graphics context */ pixels[0] = 0; /* pixel value for `off' dashes, if drawn */ pixels[1] = 1; /* default pixel for drawing */ pixels[2] = 2; /* another pixel, for multicolored dashes */ pixels[3] = 3; /* another pixel, for multicolored dashes */ dashes[0] = 4; /* length of `on' dashes */ dashes[1] = 2; /* length of `off' dashes */ pGC = miNewGC (4, pixels); miSetGCAttrib (pGC, MI_GC_LINE_STYLE, MI_LINE_ON_OFF_DASH); miSetGCDashes (pGC, 2, dashes, 0); miSetGCAttrib (pGC, MI_GC_LINE_WIDTH, 0); /* Bresenham algorithm */ /* create empty painted set */ paintedSet = miNewPaintedSet (); /* Paint filled rectangle, dashed polyline and dashed arc onto painted set. Rectangle will be filled with the default pixel value for drawing, i.e., pixels[1], i.e., 2, and polyline and arc will be drawn rather than filled: they will be dashed as specified above. */ miFillRectangles (paintedSet, pGC, 1, &rect); miDrawLines (paintedSet, pGC, MI_COORD_MODE_ORIGIN, 4, points); miDrawArcs (paintedSet, pGC, 1, &arc); /* create 60x35 canvas (initPixel=0); merge painted set onto it */ canvas = miNewCanvas (60, 35, 0); offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas (paintedSet, canvas, offset); /* write canvas's pixmap (a 60x35 array of miPixels) to stdout */ for (j = 0; j < canvas->drawable->height; j++) { for (i = 0; i < canvas->drawable->width; i++) /* note: column index precedes row index */ printf ("%d", canvas->drawable->pixmap[j][i]); printf ("\n"); } /* clean up */ miDeleteCanvas (canvas); miDeleteGC (pGC); miClearPaintedSet (paintedSet); /* not necessary */ miDeletePaintedSet (paintedSet); return 0; } ���������������������������plotutils-2.6/libxmi/info/��������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257510�012651� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/info/Makefile.am���������������������������������������������������������������0000644�0001750�0001750�00000000205�06732771740�014626� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in info_TEXINFOS = libxmi.texi TEXINFO_TEX = $(top_srcdir)/info/texinfo.tex �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/info/Makefile.in���������������������������������������������������������������0000644�0001750�0001750�00000042735�11234210074�014632� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libxmi/info DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in mdate-sh \ texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = INFO_DEPS = $(srcdir)/libxmi.info am__TEXINFO_TEX_DIR = $(srcdir)/$(top_srcdir)/info DVIS = libxmi.dvi PDFS = libxmi.pdf PSS = libxmi.ps HTMLS = libxmi.html TEXINFOS = libxmi.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__installdirs = "$(DESTDIR)$(infodir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = libxmi.texi TEXINFO_TEX = $(top_srcdir)/info/texinfo.tex all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libxmi/info/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu libxmi/info/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs .texi.info: restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ cd $(srcdir); \ else \ rc=$$?; \ cd $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $< .texi.pdf: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $< .texi.html: rm -rf $(@:.html=.htp) if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@; \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ else \ if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ exit 1; \ fi $(srcdir)/libxmi.info: libxmi.texi libxmi.dvi: libxmi.texi libxmi.pdf: libxmi.texi libxmi.html: libxmi.texi .dvi.ps: TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && \ (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f $(distdir)/$$relfile || \ cp -p $$file $(distdir)/$$relfile; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf libxmi.aux libxmi.cp libxmi.cps libxmi.fn libxmi.fns libxmi.ky \ libxmi.kys libxmi.log libxmi.pg libxmi.pgs libxmi.tmp \ libxmi.toc libxmi.tp libxmi.tps libxmi.vr libxmi.vrs \ libxmi.dvi libxmi.pdf libxmi.ps libxmi.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" @list='$(DVIS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/$$f"; \ done install-exec-am: install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" @list='$(HTMLS)'; for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ if test -d "$$d$$p"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ else \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ fi; \ done install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" @list='$(PDFS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/$$f"; \ done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" @list='$(PSS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(psdir)/$$f'"; \ $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(psdir)/$$f"; \ done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ dist-info distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic mostlyclean mostlyclean-aminfo \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-dvi-am uninstall-html-am \ uninstall-info-am uninstall-pdf-am uninstall-ps-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������plotutils-2.6/libxmi/info/mdate-sh������������������������������������������������������������������0000755�0001750�0001750�00000005167�06451713117�014226� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # Get modification time of a file or directory and pretty-print it. # Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # Get the extended ls output of the file or directory. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. if ls -L /dev/null 1>/dev/null 2>&1; then set - x`ls -L -l -d $1` else set - x`ls -l -d $1` fi # The month is at least the fourth argument # (3 shifts here, the next inside the loop). shift shift shift # Find the month. Next argument is day, followed by the year or time. month= until test $month do shift case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done day=$2 # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/info/texinfo.tex���������������������������������������������������������������0000644�0001750�0001750�00000631715�10201333263�014764� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2002-06-04.06} % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, % 2000, 01, 02 Free Software Foundation, Inc. % % This texinfo.tex file is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 2, or (at % your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this texinfo.tex file; see the file COPYING. If not, write % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, % Boston, MA 02111-1307, USA. % % In other words, you are welcome to use, share and improve this program. % You are forbidden to forbid anyone else to use, share and improve % what you give them. Help stamp out software-hoarding! % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % ftp://ftp.gnu.org/gnu/texinfo.tex % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) % ftp://texinfo.org/texinfo/texinfo.tex % ftp://tug.org/tex/texinfo.tex % (and all CTAN mirrors, see http://www.ctan.org), % and /home/gd/gnu/doc/texinfo.tex on the GNU machines. % % The texinfo.tex in any given Texinfo distribution could well be out % of date, so if that's what you're using, please check. % % Texinfo has a small home page at http://texinfo.org/ and also % http://www.gnu.org/software/texinfo. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages. You can get % the existing language-specific files from the full Texinfo distribution. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} % Save some parts of plain tex whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexi=\i \let\ptexlbrace=\{ \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t % We never want plain's outer \+ definition in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax \message{Basics,} \chardef\other=12 % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi % Ignore a token. % \def\gobble#1{} \hyphenation{ap-pen-dix} \hyphenation{mini-buf-fer mini-buf-fers} \hyphenation{eshell} \hyphenation{white-space} % Margin to add to right of even pages, to left of odd pages. \newdimen \bindingoffset \newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \ifx\eTeXversion\undefined \def\loggingall{\tracingcommands2 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \else \def\loggingall{\tracingcommands3 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \tracingscantokens1 \tracingassigns1 \tracingifs1 \tracinggroups1 \tracingnesting2 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \fi % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % For @cropmarks command. % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \escapechar = `\\ % use backslash in output files. \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingxxx.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 2\baselineskip \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \turnoffactive \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1 \unvbox#1 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg#1{% \let\next = #1% \begingroup \obeylines \futurelet\temp\parseargx } % If the next token is an obeyed space (from an @example environment or % the like), remove it and recurse. Otherwise, we're done. \def\parseargx{% % \obeyedspace is defined far below, after the definition of \sepspaces. \ifx\obeyedspace\temp \expandafter\parseargdiscardspace \else \expandafter\parseargline \fi } % Remove a single space (as the delimiter token to the macro call). {\obeyspaces % \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. % % First remove any @c comment, then any @comment. % Result of each macro is put in \toks0. \argremovec #1\c\relax % \expandafter\argremovecomment \the\toks0 \comment\relax % % % Call the caller's macro, saved as \next in \parsearg. \expandafter\next\expandafter{\the\toks0}% }% } % Since all \c{,omment} does is throw away the argument, we can let TeX % do that for us. The \relax here is matched by the \relax in the call % in \parseargline; it could be more or less anything, its purpose is % just to delimit the argument to the \c. \def\argremovec#1\c#2\relax{\toks0 = {#1}} \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} % \argremovec{,omment} might leave us with trailing spaces, though; e.g., % @end itemize @c foo % will have two active spaces as part of the argument with the % `itemize'. Here we remove all active spaces from #1, and assign the % result to \toks0. % % This loses if there are any *other* active characters besides spaces % in the argument -- _ ^ +, for example -- since they get expanded. % Fortunately, Texinfo does not define any such commands. (If it ever % does, the catcode of the characters in questionwill have to be changed % here.) But this means we cannot call \removeactivespaces as part of % \argremovec{,omment}, since @c uses \parsearg, and thus the argument % that \parsearg gets might well have any character at all in it. % \def\removeactivespaces#1{% \begingroup \ignoreactivespaces \edef\temp{#1}% \global\toks0 = \expandafter{\temp}% \endgroup } % Change the active space to expand to nothing. % \begingroup \obeyspaces \gdef\ignoreactivespaces{\obeyspaces\let =\empty} \endgroup \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} %% These are used to keep @begin/@end levels from running away %% Call \inENV within environments (after a \begingroup) \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} \def\ENVcheck{% \ifENV\errmessage{Still within an environment; press RETURN to continue} \endgroup\fi} % This is not perfect, but it should reduce lossage % @begin foo is the same as @foo, for now. \newhelp\EMsimple{Press RETURN to continue.} \outer\def\begin{\parsearg\beginxxx} \def\beginxxx #1{% \expandafter\ifx\csname #1\endcsname\relax {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else \csname #1\endcsname\fi} % @end foo executes the definition of \Efoo. % \def\end{\parsearg\endxxx} \def\endxxx #1{% \removeactivespaces{#1}% \edef\endthing{\the\toks0}% % \expandafter\ifx\csname E\endthing\endcsname\relax \expandafter\ifx\csname \endthing\endcsname\relax % There's no \foo, i.e., no ``environment'' foo. \errhelp = \EMsimple \errmessage{Undefined command `@end \endthing'}% \else \unmatchedenderror\endthing \fi \else % Everything's ok; the right environment has been started. \csname E\endthing\endcsname \fi } % There is an environment #1, but it hasn't been started. Give an error. % \def\unmatchedenderror#1{% \errhelp = \EMsimple \errmessage{This `@end #1' doesn't have a matching `@#1'}% } % Define the control sequence \E#1 to give an unmatched @end error. % \def\defineunmatchedend#1{% \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% } % Single-spacing is done by various environments (specifically, in % \nonfillstart and \quotations). \newskip\singlespaceskip \singlespaceskip = 12.5pt \def\singlespace{% % Why was this kern here? It messes up equalizing space above and below % environments. --karl, 6may93 %{\advance \baselineskip by -\singlespaceskip %\kern \baselineskip}% \setleading\singlespaceskip } %% Simple single-character @ commands % @@ prints an @ % Kludge this until the fonts are right (grr). \def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. %% Define @` and @' to be the same as ` and ' %% but suppressing ligatures. %\def\`{{`}} %\def\'{{'}} % Used to generate quoted braces. \def\mylbrace {{\tt\char123}} \def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup % Definitions to produce actual \{ & \} command in an index. \catcode`\{ = 12 \catcode`\} = 12 \catcode`\[ = 1 \catcode`\] = 2 \catcode`\@ = 0 \catcode`\\ = 12 @gdef@lbracecmd[\{]% @gdef@rbracecmd[\}]% @endgroup % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \t \let\ubaraccent = \b \let\udotaccent = \d % Other special characters: @questiondown @exclamdown % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ptexi \else\ifx\temp\jmacro \j \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } % @! is an end-of-sentence bang. \def\!{!\spacefactor=3000 } % @? is an end-of-sentence query. \def\?{?\spacefactor=3000 } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % \def\group{\begingroup \ifnum\catcode13=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi % % The \vtop we start below produces a box with normal height and large % depth; thus, TeX puts \baselineskip glue before it, and (when the % next line of text is done) \lineskip glue after it. (See p.82 of % the TeXbook.) Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% \egroup % End the \vtop. \endgroup % End the \group. }% % \vtop\bgroup % We have to put a strut on the last line in case the @group is in % the midst of an example, rather than completely enclosing it. % Otherwise, the interline space between the last line of the group % and the first line afterwards is too small. But we can't put the % strut in \Egroup, since there it would be on a line by itself. % Hence this just inserts a strut at the beginning of each line. \everypar = {\strut}% % % Since we have a strut on every line, we don't need any of TeX's % normal interline spacing. \offinterlineskip % % OK, but now we have to do something about blank % lines in the input in @example-like environments, which normally % just turn into \lisppar, which will insert no space now that we've % turned off the interline space. Simplest is to make them be an % empty paragraph. \ifx\par\lisppar \edef\par{\leavevmode \par}% % % Reset ^^M's definition to new definition of \par. \obeylines \fi % % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \def\need{\parsearg\needx} % Old definition--didn't work. %\def\needx #1{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} \def\needx#1{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break \let\br = \par % @dots{} output an ellipsis using the current font. % We do .5em per period so that it has the same spacing in a typewriter % font as three actual period characters. % \def\dots{% \leavevmode \hbox to 1.5em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \leavevmode \hbox to 2em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% \spacefactor=3000 } % @page forces the start of a new page % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \def\exdent{\parsearg\exdentyyy} \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} % This defn is used inside nofill environments such as @example. \def\nofillexdent{\parsearg\nofillexdentyyy} \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @include file insert text of that file as input. % Allow normal characters that we make active in the argument (a file name). \def\include{\begingroup \catcode`\\=12 \catcode`~=12 \catcode`^=12 \catcode`_=12 \catcode`|=12 \catcode`<=12 \catcode`>=12 \catcode`+=12 \parsearg\includezzz} % Restore active chars for included file. \def\includezzz#1{\endgroup\begingroup % Read the included file in a group so nested @include's work. \def\thisfile{#1}% \input\thisfile \endgroup} \def\thisfile{} % @center line outputs that line, centered \def\center{\parsearg\centerzzz} \def\centerzzz #1{{\advance\hsize by -\leftskip \advance\hsize by -\rightskip \centerline{#1}}} % @sp n outputs n lines of vertical space \def\sp{\parsearg\spxxx} \def\spxxx #1{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % We cannot implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \def\paragraphindent{\parsearg\doparagraphindent} \def\doparagraphindent#1{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \def\exampleindent{\parsearg\doexampleindent} \def\doexampleindent#1{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % We don't use $'s directly in the definition of \math because we need % to set catcodes according to plain TeX first, to allow for subscripts, % superscripts, special math chars, etc. % % @math does not do math typesetting in section titles, index % entries, and other such contexts where the catcodes are set before % @math gets a chance to work. This could perhaps be fixed, but for now % at least we can have real math in the main text, where it's needed most. % \let\implicitmath = $%$ font-lock fix % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ within @math be active (mathcode "8000), and distinguish by seeing % if the current family is \slfam, which is what @var uses. % {\catcode95 = \active % 95 = _ \gdef\mathunderscore{% \catcode95=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% }} % % Another complication: we want \\ (and @\) to output a \ character. % FYI, plain.tex uses \\ as a temporary control sequence (why?), but % this is not advertised and we don't care. Texinfo does not % otherwise define @\. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathcode`\_="8000 \mathunderscore \let\\ = \mathbackslash \implicitmath\finishmath} \def\finishmath#1{#1\implicitmath\Etex} % @bullet and @minus need the same treatment as @math, just above. \def\bullet{\implicitmath\ptexbullet\implicitmath} \def\minus{\implicitmath-\implicitmath} % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \iflinks \readauxfile \fi % \openindices needs to do some work in any case. \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi \closein1 \temp % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest \ifx\pdfoutput\undefined \pdffalse \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\linkcolor = \relax \let\pdfmakeoutlines = \relax \else \pdftrue \pdfoutput = 1 \input pdfcolor \def\dopdfimage#1#2#3{% \def\imagewidth{#2}% \def\imageheight{#3}% % without \immediate, pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifx\empty\imagewidth\else width \imagewidth \fi \ifx\empty\imageheight\else height \imageheight \fi \ifnum\pdftexversion<13 #1.pdf% \else {#1.pdf}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} \def\pdfmkpgn#1{#1} \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} \def\pdfmakeoutlines{{% \openin 1 \jobname.toc \ifeof 1\else\begingroup \closein 1 \indexnofonts \def\tt{} \let\_ = \normalunderscore % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % \def\chapentry ##1##2##3{} \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{} \def\secentry ##1##2##3##4{\advancenumber{chap##2}} \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}} \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}} \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}} \input \jobname.toc \def\chapentry ##1##2##3{% \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{% \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} \def\secentry ##1##2##3##4{% \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} \def\unnumbsecentry ##1##2##3{% \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} \def\subsecentry ##1##2##3##4##5{% \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} \def\unnumbsubsecentry ##1##2##3##4{% \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} \def\subsubsecentry ##1##2##3##4##5##6{% \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} \def\unnumbsubsubsecentry ##1##2##3##4##5{% \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} \input \jobname.toc \endgroup\fi }} \def\makelinks #1,{% \def\params{#1}\def\E{END}% \ifx\params\E \let\nextmakelinks=\relax \else \let\nextmakelinks=\makelinks \ifnum\lnkcount>0,\fi \picknum{#1}% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{\the\pgn}}% \linkcolor #1% \advance\lnkcount by 1% \endlink \fi \nextmakelinks } \def\picknum#1{\expandafter\pn#1} \def\pn#1{% \def\p{#1}% \ifx\p\lbrace \let\nextpn=\ppn \else \let\nextpn=\ppnn \def\first{#1} \fi \nextpn } \def\ppn#1{\pgn=#1\gobble} \def\ppnn{\pgn=\first} \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \ifx\p\space\else\addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \fi \nextsp} \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi \def\pdfurl#1{% \begingroup \normalturnoffactive\def\@{@}% \let\value=\expandablevalue \leavevmode\Red \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% % #1 \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS| \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \linkcolor #1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \fi % \ifx\pdfoutput \message{fonts,} % Font-change commands. % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf analogous to plain's \rm, etc. \newfam\sffam \def\sf{\fam=\sffam \tensf} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this one. \def\ttsl{\tenttsl} % Default leading. \newdimen\textleading \textleading = 13.2pt % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % \def\setleading#1{% \normalbaselineskip = #1\relax \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). % #3 is the font's design size, #4 is a scale factor \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\undefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} \newcount\mainmagstep \ifx\bigger\relax % not really supported. \let\mainmagstep=\magstep1 \setfont\textrm\rmshape{12}{1000} \setfont\texttt\ttshape{12}{1000} \else \mainmagstep=\magstephalf \setfont\textrm\rmshape{10}{\mainmagstep} \setfont\texttt\ttshape{10}{\mainmagstep} \fi % Instead of cmb10, you many want to use cmbx10. % cmbx10 is a prettier font on its own, but cmb10 % looks better when embedded in a line with cmr10. \setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep} \setfont\textsf\sfshape{10}{\mainmagstep} \setfont\textsc\scshape{10}{\mainmagstep} \setfont\textttsl\ttslshape{10}{\mainmagstep} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep % A few fonts for @defun, etc. \setfont\defbf\bxshape{10}{\magstep1} %was 1314 \setfont\deftt\ttshape{10}{\magstep1} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} % Fonts for indices, footnotes, small examples (9pt). \setfont\smallrm\rmshape{9}{1000} \setfont\smalltt\ttshape{9}{1000} \setfont\smallbf\bfshape{10}{900} \setfont\smallit\itshape{9}{1000} \setfont\smallsl\slshape{9}{1000} \setfont\smallsf\sfshape{9}{1000} \setfont\smallsc\scshape{10}{900} \setfont\smallttsl\ttslshape{10}{900} \font\smalli=cmmi9 \font\smallsy=cmsy9 % Fonts for small examples (8pt). \setfont\smallerrm\rmshape{8}{1000} \setfont\smallertt\ttshape{8}{1000} \setfont\smallerbf\bfshape{10}{800} \setfont\smallerit\itshape{8}{1000} \setfont\smallersl\slshape{8}{1000} \setfont\smallersf\sfshape{8}{1000} \setfont\smallersc\scshape{10}{800} \setfont\smallerttsl\ttslshape{10}{800} \font\smalleri=cmmi8 \font\smallersy=cmsy8 % Fonts for title page: \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} \setfont\titlesl\slbshape{10}{\magstep4} \setfont\titlett\ttbshape{12}{\magstep3} \setfont\titlettsl\ttslshape{10}{\magstep4} \setfont\titlesf\sfbshape{17}{\magstep1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} % Chapter (and unnumbered) fonts (17.28pt). \setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chapit\itbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3} \setfont\chaptt\ttbshape{12}{\magstep2} \setfont\chapttsl\ttslshape{10}{\magstep3} \setfont\chapsf\sfbshape{17}{1000} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 % Section fonts (14.4pt). \setfont\secrm\rmbshape{12}{\magstep1} \setfont\secit\itbshape{10}{\magstep2} \setfont\secsl\slbshape{10}{\magstep2} \setfont\sectt\ttbshape{12}{\magstep1} \setfont\secttsl\ttslshape{10}{\magstep2} \setfont\secsf\sfbshape{12}{\magstep1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 % Subsection fonts (13.15pt). \setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecit\itbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315} \setfont\ssectt\ttbshape{12}{\magstephalf} \setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{\magstep1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, % but that is not a standard magnification. % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this so that font changes will continue to work % in math mode, where it is the current \fam that is relevant in most % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam % \tenbf}, for example. By redefining \tenbf, we obviate the need to % redefine \bf itself. \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \resetmathfonts \setleading{9.5pt}} \let\smallexamplefonts = \smallerfonts % Set up the default fonts, so we can use them for creating boxes. % \textfonts % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000} \setfont\shortcontbf\bxshape{12}{1000} \setfont\shortcontsl\slshape{12}{1000} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} \let\i=\smartitalic \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic \let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } \def\t#1{% {\tt \rawbackslash \frenchspacing #1}% \null } \let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} \setfont\keyrm\rmshape{8}{1000} \font\keysy=cmsy9 \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% \kern-.06em\raise0.4pt\hbox{\angleright}}}} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. \let\file=\samp \let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \frenchspacing #1% }% \null } % We *must* turn on hyphenation at `-' and `_' in \code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active % \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex } % % If we end up with any active - characters when handling the index, % just treat them as a normal -. \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } \def\codex #1{\tclose{#1}\endgroup} % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \def\kbdinputstyle{\parsearg\kbdinputstylexxx} \def\kbdinputstylexxx#1{% \def\arg{#1}% \ifx\arg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\arg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\arg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is kbdinputdistinct. (Too much of a hassle to call the macro, % the catcodes are wrong for parsearg to work.) \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} % For @url, @env, @command quotes seem unnecessary, so use \code. \let\url=\code \let\env=\code \let\command=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. Perhaps eventually put in % a hypertex \special here. % \def\uref#1{\douref #1,,,\finish} \def\douref#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @acronym downcases the argument and prints in smallcaps. \def\acronym#1{{\smallcaps \lowercase{#1}}} % @pounds{} is a sterling sign. \def\pounds{{\it\$}} \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% % \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% % % Leave some space at the very top of the page. \vglue\titlepagetopglue % % Now you can print the title using @title. \def\title{\parsearg\titlezzz}% \def\titlezzz##1{\leftline{\titlefonts\rm ##1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Now you can put text using @subtitle. \def\subtitle{\parsearg\subtitlezzz}% \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% % % @author should come last, but may come many times. \def\author{\parsearg\authorzzz}% \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi {\authorfont \leftline{##1}}}% % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \oldpage \let\page = \oldpage \hbox{}}% % \def\page{\oldpage \hbox{}} } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } %%% Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make Tex use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\oddheading{\parsearg\oddheadingxxx} \def\everyheading{\parsearg\everyheadingxxx} \def\evenfooting{\parsearg\evenfootingxxx} \def\oddfooting{\parsearg\oddfootingxxx} \def\everyfooting{\parsearg\everyfootingxxx} {\catcode`\@=0 % \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -\baselineskip \global\advance\vsize by -\baselineskip } \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} % }% unbind the catcode of @. % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\HEADINGSoff{ \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\undefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg\settitlezzz} \def\settitlezzz #1{\gdef\thistitle{#1}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @vtable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} \def\internalBkitem{\smallbreak \parsearg\kitemzzz} \def\internalBkitemx{\itemxpar \parsearg\kitemzzz} \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% \itemzzz {#1}} \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% \itemzzz {#1}} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemfont{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. Unfortunately % we can't prevent a possible page break at the following % \baselineskip glue. \nobreak \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a table}} \def\itemx{\errmessage{@itemx while not in a table}} \def\kitem{\errmessage{@kitem while not in a table}} \def\kitemx{\errmessage{@kitemx while not in a table}} \def\xitem{\errmessage{@xitem while not in a table}} \def\xitemx{\errmessage{@xitemx while not in a table}} % Contains a kludge to get @end[description] to work. \def\description{\tablez{\dontindex}{1}{}{}{}{}} % @table, @ftable, @vtable. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} {\obeylines\obeyspaces% \gdef\tablex #1^^M{% \tabley\dontindex#1 \endtabley}} \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} {\obeylines\obeyspaces% \gdef\ftablex #1^^M{% \tabley\fnitemindex#1 \endtabley \def\Eftable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} {\obeylines\obeyspaces% \gdef\vtablex #1^^M{% \tabley\vritemindex#1 \endtabley \def\Evtable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\dontindex #1{} \def\fnitemindex #1{\doind {fn}{\code{#1}}}% \def\vritemindex #1{\doind {vr}{\code{#1}}}% {\obeyspaces % \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} \def\tablez #1#2#3#4#5#6{% \aboveenvbreak % \begingroup % \def\Edescription{\Etable}% Necessary kludge. \let\itemindex=#1% \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % \ifnum 0#4>0 \tableindent=#4\mil \fi % \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % \def\itemfont{#2}% \itemmax=\tableindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \tableindent % \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi% \def\Etable{\endgraf\afterenvbreak\endgroup}% \let\item = \internalBitem % \let\itemx = \internalBitemx % \let\kitem = \internalBkitem % \let\kitemx = \internalBkitemx % \let\xitem = \internalBxitem % \let\xitemx = \internalBxitemx % } % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \def\itemize{\parsearg\itemizezzz} \def\itemizezzz #1{% \begingroup % ended by the @end itemize \itemizey {#1}{\Eitemize} } \def\itemizey #1#2{% \aboveenvbreak % \itemmax=\itemindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \itemindent % \exdentamount=\itemindent \parindent = 0pt % \parskip = \smallskipamount % \ifdim \parskip=0pt \parskip=2pt \fi% \def#2{\endgraf\afterenvbreak\endgroup}% \def\itemcontents{#1}% \let\item=\itemizeitem} % Set sfcode to normal for the chars that usually have another value. % These are `.?!:;,' \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \def\enumerate{\parsearg\enumeratezzz} \def\enumeratezzz #1{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% \begingroup % ended by the @end enumerate % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call itemizey, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \itemizey{#1.}\Eenumerate\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % Definition of @item while inside @itemize. \def\itemizeitem{% \advance\itemno by 1 {\let\par=\endgraf \smallbreak}% \ifhmode \errmessage{In hmode at itemizeitem}\fi {\parskip=0in \hskip 0pt \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% \vadjust{\penalty 1200}}% \flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % % For those who want to use more than one line's worth of words in % the preamble, break the line within one argument and it % will parse correctly, i.e., % % @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: % @multitable {Column 1 template} {Column 2 template} % {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab, @multitable or @end multitable do not need to be on their % own lines, but it will not hurt if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the part of the @columnfraction before the decimal point, which % is presumably either 0 or the empty string (but we don't check, we % just throw it away). #2 is the decimal part, which we use as the % percent of \hsize for this column. \def\pickupwholefraction#1.#2 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; % typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % This used to have \hskip1sp. But then the space in a template line is % not enough. That is bad. So let's go back to just & until we % encounter the problem it was intended to solve again. % --karl, nathan@acm.org, 20apr99. \def\tab{&} % @multitable ... @end multitable definitions: % \def\multitable{\parsearg\dotable} \def\dotable#1{\bgroup \vskip\parskip \let\item\crcr \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% % % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % \everycr will reset column counter, \colcount, at the end of % each line. Every column entry will cause \colcount to advance by one. % The table preamble % looks at the current \colcount to find the correct column width. \everycr{\noalign{% % % \filbreak%% keeps underfull box messages off when table breaks over pages. % Maybe so, but it also creates really weird page breaks when the table % breaks over pages. Wouldn't \vfil be better? Wait until the problem % manifests itself, so it can be fixed for real --karl. \global\colcount=0\relax}}% % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup&\global\advance\colcount by 1\relax \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively marking % characters. \noindent\ignorespaces##\unskip\multistrut}\cr } \def\setmultitablespacing{% test to see if user has set \multitablelinespace. % If so, do nothing. If not, give it an appropriate dimension based on % current baselineskip. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 %% strut to put in table in case some entry doesn't have descenders, %% to keep lines equally spaced \let\multistrut = \strut \else %% FIXME: what is \box0 supposed to be? \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 width0pt\relax} \fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi} \message{conditionals,} % Prevent errors for section commands. % Used in @ignore and in failing conditionals. \def\ignoresections{% \let\chapter=\relax \let\unnumbered=\relax \let\top=\relax \let\unnumberedsec=\relax \let\unnumberedsection=\relax \let\unnumberedsubsec=\relax \let\unnumberedsubsection=\relax \let\unnumberedsubsubsec=\relax \let\unnumberedsubsubsection=\relax \let\section=\relax \let\subsec=\relax \let\subsubsec=\relax \let\subsection=\relax \let\subsubsection=\relax \let\appendix=\relax \let\appendixsec=\relax \let\appendixsection=\relax \let\appendixsubsec=\relax \let\appendixsubsection=\relax \let\appendixsubsubsec=\relax \let\appendixsubsubsection=\relax \let\contents=\relax \let\smallbook=\relax \let\titlepage=\relax } % Used in nested conditionals, where we have to parse the Texinfo source % and so want to turn off most commands, in case they are used % incorrectly. % \def\ignoremorecommands{% \let\defcodeindex = \relax \let\defcv = \relax \let\deffn = \relax \let\deffnx = \relax \let\defindex = \relax \let\defivar = \relax \let\defmac = \relax \let\defmethod = \relax \let\defop = \relax \let\defopt = \relax \let\defspec = \relax \let\deftp = \relax \let\deftypefn = \relax \let\deftypefun = \relax \let\deftypeivar = \relax \let\deftypeop = \relax \let\deftypevar = \relax \let\deftypevr = \relax \let\defun = \relax \let\defvar = \relax \let\defvr = \relax \let\ref = \relax \let\xref = \relax \let\printindex = \relax \let\pxref = \relax \let\settitle = \relax \let\setchapternewpage = \relax \let\setchapterstyle = \relax \let\everyheading = \relax \let\evenheading = \relax \let\oddheading = \relax \let\everyfooting = \relax \let\evenfooting = \relax \let\oddfooting = \relax \let\headings = \relax \let\include = \relax \let\lowersections = \relax \let\down = \relax \let\raisesections = \relax \let\up = \relax \let\set = \relax \let\clear = \relax \let\item = \relax } % Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu, % @direntry, and @documentdescription. % \def\ignore{\doignore{ignore}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifnottex{\doignore{ifnottex}} \def\html{\doignore{html}} \def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\documentdescriptionword{documentdescription} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory = \comment % Ignore text until a line `@end #1'. % \def\doignore#1{\begingroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define a command to swallow text until we reach `@end #1'. % This @ is a catcode 12 token (that is the normal catcode of @ in % this texinfo.tex file). We change the catcode of @ below to match. \long\def\doignoretext##1@end #1{\enddoignore}% % % Make sure that spaces turn into tokens that match what \doignoretext wants. \catcode32 = 10 % % Ignore braces, too, so mismatched braces don't cause trouble. \catcode`\{ = 9 \catcode`\} = 9 % % We must not have @c interpreted as a control sequence. \catcode`\@ = 12 % \def\ignoreword{#1}% \ifx\ignoreword\documentdescriptionword % The c kludge breaks documentdescription, since % `documentdescription' contains a `c'. Means not everything will % be ignored inside @documentdescription, but oh well... \else % Make the letter c a comment character so that the rest of the line % will be ignored. This way, the document can have (for example) % @c @end ifinfo % and the @end ifinfo will be properly ignored. % (We've just changed @ to catcode 12.) \catcode`\c = 14 \fi % % And now expand the command defined above. \doignoretext } % What we do to finish off ignored text. % \def\enddoignore{\endgroup\ignorespaces}% \newif\ifwarnedobs\warnedobsfalse \def\obstexwarn{% \ifwarnedobs\relax\else % We need to warn folks that they may have trouble with TeX 3.0. % This uses \immediate\write16 rather than \message to get newlines. \immediate\write16{} \immediate\write16{WARNING: for users of Unix TeX 3.0!} \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} \immediate\write16{} \global\warnedobstrue \fi } % **In TeX 3.0, setting text in \nullfont hangs tex. For a % workaround (which requires the file ``dummy.tfm'' to be installed), % uncomment the following line: %%%%%\font\nullfont=dummy\let\obstexwarn=\relax % Ignore text, except that we keep track of conditional commands for % purposes of nesting, up to an `@end #1' command. % \def\nestedignore#1{% \obstexwarn % We must actually expand the ignored text to look for the @end % command, so that nested ignore constructs work. Thus, we put the % text into a \vbox and then do nothing with the result. To minimize % the change of memory overflow, we follow the approach outlined on % page 401 of the TeXbook: make the current font be a dummy font. % \setbox0 = \vbox\bgroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define `@end #1' to end the box, which will in turn undefine the % @end command again. \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% % % We are going to be parsing Texinfo commands. Most cause no % trouble when they are used incorrectly, but some commands do % complicated argument parsing or otherwise get confused, so we % undefine them. % % We can't do anything about stray @-signs, unfortunately; % they'll produce `undefined control sequence' errors. \ignoremorecommands % % Set the current font to be \nullfont, a TeX primitive, and define % all the font commands to also use \nullfont. We don't use % dummy.tfm, as suggested in the TeXbook, because not all sites % might have that installed. Therefore, math mode will still % produce output, but that should be an extremely small amount of % stuff compared to the main input. % \nullfont \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont \let\tensf=\nullfont % Similarly for index fonts. \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont \let\smallsf=\nullfont % Similarly for smallexample fonts. \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont \let\smallersf=\nullfont % % Don't complain when characters are missing from the fonts. \tracinglostchars = 0 % % Don't bother to do space factor calculations. \frenchspacing % % Don't report underfull hboxes. \hbadness = 10000 % % Do minimal line-breaking. \pretolerance = 10000 % % Do not execute instructions in @tex \def\tex{\doignore{tex}}% % Do not execute macro definitions. % `c' is a comment character, so the word `macro' will get cut off. \def\macro{\doignore{ma}}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % \def\set{\begingroup\catcode` =10 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. \fi \endgroup } % Can't use \xdef to pre-expand #2 and save some time, since \temp or % \next or other control sequences that we've defined might get us into % an infinite loop. Consider `@set foo @cite{bar}'. \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} % @clear VAR clears (i.e., unsets) the variable VAR. % \def\clear{\parsearg\clearxxx} \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} % @value{foo} gets the text saved in variable foo. { \catcode`\_ = \active % % We might end up with active _ or - characters in the argument if % we're called from @code, as @code{@value{foo-bar_}}. So \let any % such active characters to their normal equivalents. \gdef\value{\begingroup \catcode`\-=12 \catcode`\_=12 \indexbreaks \let_\normalunderscore \valuexxx} } \def\valuexxx#1{\expandablevalue{#1}\endgroup} % We have this subroutine so that we can handle at least some @value's % properly in indexes (we \let\value to this in \indexdummies). Ones % whose names contain - or _ still won't work, but we can't do anything % about that. The command has to be fully expandable, since the result % winds up in the index file. This means that if the variable's value % contains other Texinfo commands, it's almost certain it will fail % (although perhaps we could fix that with sufficient work to do a % one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % \def\ifset{\parsearg\ifsetxxx} \def\ifsetxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifsetfail \else \expandafter\ifsetsucceed \fi } \def\ifsetsucceed{\conditionalsucceed{ifset}} \def\ifsetfail{\nestedignore{ifset}} \defineunmatchedend{ifset} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % \def\ifclear{\parsearg\ifclearxxx} \def\ifclearxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifclearsucceed \else \expandafter\ifclearfail \fi } \def\ifclearsucceed{\conditionalsucceed{ifclear}} \def\ifclearfail{\nestedignore{ifclear}} \defineunmatchedend{ifclear} % @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we % read the text following, through the first @end iftex (etc.). Make % `@end iftex' (etc.) valid only after an @iftex. % \def\iftex{\conditionalsucceed{iftex}} \def\ifnothtml{\conditionalsucceed{ifnothtml}} \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} \def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} \defineunmatchedend{iftex} \defineunmatchedend{ifnothtml} \defineunmatchedend{ifnotinfo} \defineunmatchedend{ifnotplaintext} % We can't just want to start a group at @iftex (etc.) and end it at % @end iftex, since then @set commands inside the conditional have no % effect (they'd get reverted at the end of the group). So we must % define \Eiftex to redefine itself to be its previous value. (We can't % just define it to fail again with an ``unmatched end'' error, since % the @ifset might be nested.) % \def\conditionalsucceed#1{% \edef\temp{% % Remember the current value of \E#1. \let\nece{prevE#1} = \nece{E#1}% % % At the `@end #1', redefine \E#1 to be its previous value. \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% }% \temp } % We need to expand lots of \csname's, but we don't want to expand the % control sequences after we've constructed them. % \def\nece#1{\expandafter\noexpand\csname#1\endcsname} % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within \newindex. {\catcode`\@=11 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \undefined % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname\donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of texinfo commands likely to appear in an index entry. % (Must be a way to avoid doing expansion at all, and thus not have to % laboriously list every single command here.) % \def\indexdummies{% \def\ { }% \def\@{@}% change to @@ when we switch to @ as escape char in aux files. % Need these in case \tex is in effect and \{ is a \delimiter again. % But can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. \let\{ = \mylbrace \let\} = \myrbrace \def\_{{\realbackslash _}}% \normalturnoffactive % % Take care of the plain tex accent commands. \def\,##1{\realbackslash ,{##1}}% \def\"{\realbackslash "}% \def\`{\realbackslash `}% \def\'{\realbackslash '}% \def\^{\realbackslash ^}% \def\~{\realbackslash ~}% \def\={\realbackslash =}% \def\b{\realbackslash b}% \def\c{\realbackslash c}% \def\d{\realbackslash d}% \def\u{\realbackslash u}% \def\v{\realbackslash v}% \def\H{\realbackslash H}% \def\dotless##1{\realbackslash dotless {##1}}% % Take care of the plain tex special European modified letters. \def\AA{\realbackslash AA}% \def\AE{\realbackslash AE}% \def\L{\realbackslash L}% \def\OE{\realbackslash OE}% \def\O{\realbackslash O}% \def\aa{\realbackslash aa}% \def\ae{\realbackslash ae}% \def\l{\realbackslash l}% \def\oe{\realbackslash oe}% \def\o{\realbackslash o}% \def\ss{\realbackslash ss}% % % Although these internals commands shouldn't show up, sometimes they do. \def\bf{\realbackslash bf }% \def\gtr{\realbackslash gtr}% \def\hat{\realbackslash hat}% \def\less{\realbackslash less}% %\def\rm{\realbackslash rm }% \def\sf{\realbackslash sf}% \def\sl{\realbackslash sl }% \def\tclose##1{\realbackslash tclose {##1}}% \def\tt{\realbackslash tt}% % \def\b##1{\realbackslash b {##1}}% \def\i##1{\realbackslash i {##1}}% \def\sc##1{\realbackslash sc {##1}}% \def\t##1{\realbackslash t {##1}}% \def\r##1{\realbackslash r {##1}}% % \def\TeX{\realbackslash TeX}% \def\acronym##1{\realbackslash acronym {##1}}% \def\cite##1{\realbackslash cite {##1}}% \def\code##1{\realbackslash code {##1}}% \def\command##1{\realbackslash command {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\dots{\realbackslash dots }% \def\emph##1{\realbackslash emph {##1}}% \def\env##1{\realbackslash env {##1}}% \def\file##1{\realbackslash file {##1}}% \def\kbd##1{\realbackslash kbd {##1}}% \def\key##1{\realbackslash key {##1}}% \def\math##1{\realbackslash math {##1}}% \def\option##1{\realbackslash option {##1}}% \def\samp##1{\realbackslash samp {##1}}% \def\strong##1{\realbackslash strong {##1}}% \def\uref##1{\realbackslash uref {##1}}% \def\url##1{\realbackslash url {##1}}% \def\var##1{\realbackslash var {##1}}% \def\w{\realbackslash w }% % % These math commands don't seem likely to be used in index entries. \def\copyright{\realbackslash copyright}% \def\equiv{\realbackslash equiv}% \def\error{\realbackslash error}% \def\expansion{\realbackslash expansion}% \def\point{\realbackslash point}% \def\print{\realbackslash print}% \def\result{\realbackslash result}% % % Handle some cases of @value -- where the variable name does not % contain - or _, and the value does not contain any % (non-fully-expandable) commands. \let\value = \expandablevalue % \unsepspaces % Turn off macro expansion \turnoffmacros } % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). {\obeyspaces \gdef\unsepspaces{\obeyspaces\let =\space}} % \indexnofonts no-ops all font-change commands. % This is used when outputting the strings to sort the index by. \def\indexdummyfont#1{#1} \def\indexdummytex{TeX} \def\indexdummydots{...} \def\indexnofonts{% \def\@{@}% % how to handle braces? \def\_{\normalunderscore}% % \let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont \let\'=\indexdummyfont \let\^=\indexdummyfont \let\~=\indexdummyfont \let\==\indexdummyfont \let\b=\indexdummyfont \let\c=\indexdummyfont \let\d=\indexdummyfont \let\u=\indexdummyfont \let\v=\indexdummyfont \let\H=\indexdummyfont \let\dotless=\indexdummyfont % Take care of the plain tex special European modified letters. \def\AA{AA}% \def\AE{AE}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\aa{aa}% \def\ae{ae}% \def\l{l}% \def\oe{oe}% \def\o{o}% \def\ss{ss}% % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\indexdummyfont % \let\b=\indexdummyfont \let\i=\indexdummyfont \let\r=\indexdummyfont \let\sc=\indexdummyfont \let\t=\indexdummyfont % \let\TeX=\indexdummytex \let\acronym=\indexdummyfont \let\cite=\indexdummyfont \let\code=\indexdummyfont \let\command=\indexdummyfont \let\dfn=\indexdummyfont \let\dots=\indexdummydots \let\emph=\indexdummyfont \let\env=\indexdummyfont \let\file=\indexdummyfont \let\kbd=\indexdummyfont \let\key=\indexdummyfont \let\math=\indexdummyfont \let\option=\indexdummyfont \let\samp=\indexdummyfont \let\strong=\indexdummyfont \let\uref=\indexdummyfont \let\url=\indexdummyfont \let\var=\indexdummyfont \let\w=\indexdummyfont } % To define \realbackslash, we must make \ not be an escape. % We must first make another character (@) an escape % so we do not become unable to do a definition. {\catcode`\@=0 \catcode`\\=\other @gdef@realbackslash{\}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % For \ifx comparisons. \def\emptymacro{\empty} % Most index entries go through here, but \dosubind is the general case. % \def\doind#1#2{\dosubind{#1}{#2}\empty} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % \empty if called from \doind, as we usually are. The main exception % is with defuns, which call us directly. % \def\dosubind#1#2#3{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% \fi {% \count255=\lastpenalty {% \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% \let\folio = 0% We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % \def\thirdarg{#3}% % % If third arg is present, precede it with space in sort key. \ifx\thirdarg\emptymacro \let\subentry = \empty \else \def\subentry{ #3}% \fi % % First process the index entry with all font commands turned % off to get the string to sort by. {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% % % Now the real index entry with the fonts. \toks0 = {#2}% % % If the third (subentry) arg is present, add it to the index % line to write. \ifx\thirdarg\emptymacro \else \toks0 = \expandafter{\the\toks0{#3}}% \fi % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\csname#1indfile\endcsname{% \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% }% % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write will make \lastskip zero. The result is that sequences % like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % \iflinks \ifvmode \skip0 = \lastskip \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi \fi % \temp % do the write % % \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi \fi }% }% \penalty\count255 }% } % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \def\printindex{\parsearg\doprintindex} \def\doprintindex#1{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \indexbreaks % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\rawbackslashxx}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \penalty -300 % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% \vskip .33\baselineskip plus .1\baselineskip % % Do our best not to break after the initial. \nobreak }} % This typesets a paragraph consisting of #1, dot leaders, and then #2 % flush to the right margin. It is used for index and table of contents % entries. The paragraph is indented by \leftskip. % \def\entry#1#2{\begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing columns. \vskip 0pt plus1pt % % Start a ``paragraph'' for the index entry so the line breaking % parameters we've set above will have an effect. \noindent % % Insert the text of the index entry. TeX will do line-breaking on it. #1% % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \def\tempa{{\rm }}% \def\tempb{#2}% \edef\tempc{\tempa}% \edef\tempd{\tempb}% \ifx\tempc\tempd\ \else% % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else \ #2% The page number ends the paragraph. \fi \fi% \par \endgroup} % Like \dotfill except takes at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % \def\appendixletter{\char\the\appendixno} % We do the following for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise. \def\thischapter{} \def\thissection{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raise/lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % Choose a numbered-heading macro % #1 is heading level if unmodified by @raisesections or @lowersections % #2 is text for heading \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \chapterzzz{#2} \or \seczzz{#2} \or \numberedsubseczzz{#2} \or \numberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \chapterzzz{#2} \else \numberedsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses appendix heading levels \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \appendixzzz{#2} \or \appendixsectionzzz{#2} \or \appendixsubseczzz{#2} \or \appendixsubsubseczzz{#2} \else \ifnum \absseclevel<0 \appendixzzz{#2} \else \appendixsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses numberless heading levels \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \unnumberedzzz{#2} \or \unnumberedseczzz{#2} \or \unnumberedsubseczzz{#2} \or \unnumberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \unnumberedzzz{#2} \else \unnumberedsubsubseczzz{#2} \fi \fi } % @chapter, @appendix, @unnumbered. \def\thischaptername{No Chapter Title} \outer\def\chapter{\parsearg\chapteryyy} \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% \chapmacro {#1}{\the\chapno}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% % We don't substitute the actual chapter name into \thischapter % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% {\the\chapno}}}% \temp \donoderef \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\def\appendix{\parsearg\appendixyyy} \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz \def\appendixzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{\putwordAppendix\space \appendixletter}% \chapmacro {#1}{\putwordAppendix{} \appendixletter}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% {\appendixletter}}}% \temp \appendixnoderef \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\def\centerchap{\parsearg\centerchapyyy} \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} % @top is like @unnumbered. \outer\def\top{\parsearg\unnumberedyyy} \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz \def\unnumberedzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}\message{(\the\toks0)}% % \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% \temp \unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % Sections. \outer\def\numberedsec{\parsearg\secyyy} \def\secyyy #1{\numhead1{#1}} % normally calls seczzz \def\seczzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\the\chapno}{\the\secno}}}% \temp \donoderef \nobreak } \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz \def\appendixsectionzzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\appendixletter}{\the\secno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz \def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% {\the\toks0}{\the\chapno}}}% \temp \unnumbnoderef \nobreak } % Subsections. \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz \def\numberedsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz \def\appendixsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz #1{% \plainsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% {\the\toks0}{\the\chapno}{\the\secno}}}% \temp \unnumbnoderef \nobreak } % Subsubsections. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz \def\numberedsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz \def\appendixsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz #1{% \plainsubsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% \temp \unnumbnoderef \nobreak } % These are variants which are not "outer", so they can appear in @ifinfo. % Actually, they should now be obsolete; ordinary section commands should work. \def\infotop{\parsearg\unnumberedzzz} \def\infounnumbered{\parsearg\unnumberedzzz} \def\infounnumberedsec{\parsearg\unnumberedseczzz} \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} \def\infoappendix{\parsearg\appendixzzz} \def\infoappendixsec{\parsearg\appendixseczzz} \def\infoappendixsubsec{\parsearg\appendixsubseczzz} \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} \def\infochapter{\parsearg\chapterzzz} \def\infosection{\parsearg\sectionzzz} \def\infosubsection{\parsearg\subsectionzzz} \def\infosubsubsection{\parsearg\subsubsectionzzz} % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading % NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a % heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. \def\majorheading{\parsearg\majorheadingzzz} \def\majorheadingzzz #1{% {\advance\chapheadingskip by 10pt \chapbreak }% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} \def\chapheading{\parsearg\chapheadingzzz} \def\chapheadingzzz #1{\chapbreak % {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} % @heading, @subheading, @subsubheading. \def\heading{\parsearg\plainsecheading} \def\subheading{\parsearg\plainsubsecheading} \def\subsubheading{\parsearg\plainsubsubsecheading} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{ \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon \def\CHAPFplain{ \global\let\chapmacro=\chfplain \global\let\unnumbchapmacro=\unnchfplain \global\let\centerchapmacro=\centerchfplain} % Plain chapter opening. % #1 is the text, #2 the chapter number or empty if unnumbered. \def\chfplain#1#2{% \pchapsepmacro {% \chapfonts \rm \def\chapnum{#2}% \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % Plain opening for unnumbered. \def\unnchfplain#1{\chfplain{#1}{}} % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerchfplain#1{{% \def\centerparametersmaybe{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt }% \chfplain{#1}{}% }} \CHAPFplain % The default \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{ \global\let\chapmacro=\chfopen \global\let\unnumbchapmacro=\unnchfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip {-1000}} \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} \def\plainsecheading#1{\sectionheading{sec}{}{#1}} % Subsection titles. \newskip \subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} % Subsubsection titles. \let\subsubsecheadingskip = \subsecheadingskip \let\subsubsecheadingbreak = \subsecheadingbreak \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} % Print any size section title. % % #1 is the section type (sec/subsec/subsubsec), #2 is the section % number (maybe empty), #3 the text. \def\sectionheading#1#2#3{% {% \expandafter\advance\csname #1headingskip\endcsname by \parskip \csname #1headingbreak\endcsname }% {% % Switch to the right set of fonts. \csname #1fonts\endcsname \rm % % Only insert the separating space if we have a section number. \def\secnum{#2}% \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% % \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 % zero if no section number \unhbox0 #3}% }% \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. We supply {\folio} at the end of the % argument, which will end up as the last argument to the \...entry macro. % % We open the .toc file here instead of at @setfilename or any other % fixed time so that @contents can be put in the document anywhere. % \newif\iftocfileopened \def\writetocentry#1{% \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi \iflinks \write\tocfile{#1{\folio}}\fi % % Tell \shipout to create a page destination if we're doing pdf, which % will be the target of the links in the table of contents. We can't % just do it on every page because the title pages are numbered 1 and % 2 (the page numbers aren't printed), and so are the first two pages % of the document. Thus, we'd have two destinations named `1', and % two named `2'. \ifpdf \pdfmakepagedesttrue \fi } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Finish up the main text and prepare to read what we've written % to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% \savepageno = \pageno \begingroup % Set up to handle contents files properly. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 % We can't do this, because then an actual ^ in a section % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \pageno = \lastnegativepageno \fi } % Normal (long) toc. \def\contents{% \startcontents{\putwordTOC}% \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \pdfmakeoutlines \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\chapentry = \shortchapentry \let\appendixentry = \shortappendixentry \let\unnumbchapentry = \shortunnumberedentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} \def\unnumbsecentry ##1##2##3{} \def\subsecentry ##1##2##3##4##5{} \def\unnumbsubsecentry ##1##2##3##4{} \def\subsubsecentry ##1##2##3##4##5##6{} \def\unnumbsubsubsecentry ##1##2##3##4##5{} \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } \let\shortcontents = \summarycontents \ifpdf \pdfcatalog{/PageMode /UseOutlines}% \fi % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Chapters, in the main contents. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% } % Appendices, in the main contents. \def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}} % % Appendices, in the short toc. \let\shortappendixentry = \shortchapentry % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. % We could simplify the code here by writing out an \appendixentry % command in the toc file for appendices, instead of using \chapentry % for both, but it doesn't seem worth it. % \newdimen\shortappendixwidth % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) \dimen0 = 1em \hbox to \dimen0{#1\hss}% } % Unnumbered chapters. \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} % Sections. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} \def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}} % Subsections. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} \def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\subsubsecentry#1#2#3#4#5#6{% \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} \def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}} % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % Final typesetting of a toc entry; we use the same \entry macro as for % the index entries, but we want to suppress hyphenation here. (We % can't do that in the \entry macro, since index entries might consist % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) \def\tocentry#1#2{\begingroup \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks % Do not use \turnoffactive in these arguments. Since the toc is % typeset in cmr, characters such as _ would come out wrong; we % have to do the usual translation tricks. \entry{#1}{#2}% \endgroup} % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \let\subsecentryfonts = \textfonts \let\subsubsecentryfonts = \textfonts \message{environments,} % @foo ... @end foo. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} % \global\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{ \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. \def\tex{\begingroup \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie \catcode `\%=14 \catcode 43=12 % plus \catcode`\"=12 \catcode`\==12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \escapechar=`\\ % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\*=\ptexstar \let\t=\ptext % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% \let\Etex=\endgroup} % Define @lisp ... @end lisp. % @lisp does a \begingroup so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % {\obeyspaces % \gdef\sepspaces{\obeyspaces\let =\tie}} % Define \obeyedspace to be our active space, whatever it is. This is % for use in \parsearg. {\sepspaces% \global\let\obeyedspace= } % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip % \def\aboveenvbreak{{% \ifnum\lastpenalty < 10000 \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip \penalty-50 \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \long\def\cartouche{% \begingroup \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt %we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing=\comment \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \hsize=\cartinner \kern3pt \begingroup \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \def\Ecartouche{% \endgroup \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \endgroup }} % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \singlespace \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt \parindent = 0pt \emergencystretch = 0pt % don't try to avoid overfull boxes % @cartouche defines \nonarrowing to inhibit narrowing % at next level down. \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \let\exdent=\nofillexdent \let\nonarrowing=\relax \fi } % Define the \E... control sequence only if we are inside the particular % environment, so the error checking in \end will work. % % To end an @example-like environment, we first end the paragraph (via % \afterenvbreak's vertical glue), and then the group. That way we keep % the zero \parskip that the environments set -- \parskip glue will be % inserted at the beginning of the next paragraph in the document, after % the environment. % \def\nonfillfinish{\afterenvbreak\endgroup} % @lisp: indented, narrowed, typewriter font. \def\lisp{\begingroup \nonfillstart \let\Elisp = \nonfillfinish \tt \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @example: Same as @lisp. \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} % @small... is usually equivalent to the non-small (@smallbook % redefines). We must call \example (or whatever) last in the % definition, since it reads the return following the @example (or % whatever) command. % % This actually allows (for example) @end display inside an % @smalldisplay. Too bad, but makeinfo will catch the error anyway. % \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. % Originally contributed by Pavel@xerox. \def\smalllispx{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}% \def\Esmallexample{\nonfillfinish\endgroup}% \smallexamplefonts \lisp } % @display: same as @lisp except keep current font. % \def\display{\begingroup \nonfillstart \let\Edisplay = \nonfillfinish \gobble } % % @smalldisplay (when @smallbook): @display plus smaller fonts. % \def\smalldisplayx{\begingroup \def\Esmalldisplay{\nonfillfinish\endgroup}% \smallexamplefonts \rm \display } % @format: same as @display except don't narrow margins. % \def\format{\begingroup \let\nonarrowing = t \nonfillstart \let\Eformat = \nonfillfinish \gobble } % % @smallformat (when @smallbook): @format plus smaller fonts. % \def\smallformatx{\begingroup \def\Esmallformat{\nonfillfinish\endgroup}% \smallexamplefonts \rm \format } % @flushleft (same as @format). % \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} % @flushright. % \def\flushright{\begingroup \let\nonarrowing = t \nonfillstart \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. % \def\quotation{% \begingroup\inENV %This group ends at the end of the @quotation body {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \singlespace \parindent=0pt % We have retained a nonzero parskip for the environment, since we're % doing normal filling. So to avoid extra space below the environment... \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing \let\nonarrowing = \relax \fi } % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p. 344; only we need to do '@' too \def\dospecials{% \do\ \do\\\do\@\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~} % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=12}\dospecials} % % [Knuth] pp. 380,381,391 % Disable Spanish ligatures ?` and !` of \tt font \begingroup \catcode`\`=\active\gdef`{\relax\lq} \endgroup % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \catcode`\`=\active \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen0=\wd0 % the width so far, or since the previous tab \divide\dimen0 by\tabw \multiply\dimen0 by\tabw % compute previous multiple of \tabw \advance\dimen0 by\tabw % advance to next multiple of \tabw \wd0=\dimen0 \box0 \starttabbox }% } \endgroup \def\setupverbatim{% % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% \catcode`\`=\active \tabexpand % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}' % % Inspired by LaTeX's verbatim command set [latex.ltx] %% Include LaTeX hack for completeness -- never know %% \begingroup %% \catcode`|=0 \catcode`[=1 %% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active %% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ %% #1|endgroup|def|Everbatim[]|end[verbatim]] %% |endgroup \begingroup \catcode`\ =\active \gdef\doverbatim#1@end verbatim{#1\end{verbatim}} \endgroup % \def\verbatim{% \def\Everbatim{\nonfillfinish\endgroup}% \begingroup \nonfillstart \advance\leftskip by -\defbodyindent \begingroup\setupverbatim\doverbatim } % @verbatiminclude FILE - insert text of file in verbatim environment. % % Allow normal characters that we make active in the argument (a file name). \def\verbatiminclude{% \begingroup \catcode`\\=12 \catcode`~=12 \catcode`^=12 \catcode`_=12 \catcode`|=12 \catcode`<=12 \catcode`>=12 \catcode`+=12 \parsearg\doverbatiminclude } \def\setupverbatiminclude{% \begingroup \nonfillstart \advance\leftskip by -\defbodyindent \begingroup\setupverbatim } % \def\doverbatiminclude#1{% % Restore active chars for included file. \endgroup \begingroup \def\thisfile{#1}% \expandafter\expandafter\setupverbatiminclude\input\thisfile \endgroup\nonfillfinish\endgroup } % @copying ... @end copying. % Save the text away for @insertcopying later. % \newbox\copyingbox % \def\copying{\begingroup \parindent = 0pt % looks wrong on title page \def\Ecopying{\egroup\endgroup}% \global\setbox\copyingbox = \vbox\bgroup } % @insertcopying. % \def\insertcopying{\unvcopy\copyingbox} \message{defuns,} % @defun etc. % Allow user to change definition object font (\df) internally \def\setdeffont #1 {\csname DEF#1\endcsname} \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deftypemargin \deftypemargin=12pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\parencount % define \functionparens, which makes ( and ) and & do special things. % \functionparens affects the group it is contained in. \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active \catcode`\[=\active \catcode`\]=\active} % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) {\activeparens % Now, smart parens don't turn on until &foo (see \amprm) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} % This is used to turn on special parens % but make & act ordinary (given that it's active). \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} % Definitions of (, ) and & used in args for functions. % This is the definition of ( outside of all parentheses. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested \global\advance\parencount by 1 } % % This is the definition of ( when already inside a level of parens. \gdef\opnested{\char`\(\global\advance\parencount by 1 } % \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. % also in that case restore the outer-level definition of (. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi \global\advance \parencount by -1 } % If we encounter &foo, then turn on ()-hacking afterwards \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } % \gdef\normalparens{\boldbrax\let&=\ampnr} } % End of definition inside \activeparens %% These parens (in \boldbrax) actually are a little bolder than the %% contained text. This is especially needed for [ and ] \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } \let\ampnr = \& \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} % Active &'s sneak into the index arguments, so make sure it's defined. { \catcode`& = 13 \global\let& = \ampnr } % First, defname, which formats the header line itself. % #1 should be the function name. % #2 should be the type of definition, such as "Function". \def\defname #1#2{% % Get the values of \leftskip and \rightskip as they were % outside the @def... \dimen2=\leftskip \advance\dimen2 by -\defbodyindent \noindent \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations \parshape 2 0in \dimen0 \defargsindent \dimen1 % Now output arg 2 ("Function" or some such) % ending at \deftypemargin from the right margin, % but stuck inside a box of width 0 so it does not interfere with linebreaking {% Adjust \hsize to exclude the ambient margins, % so that \rightline will obey them. \advance \hsize by -\dimen2 \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% % Make all lines underfull and no complaints: \tolerance=10000 \hbadness=10000 \advance\leftskip by -\defbodyindent \exdentamount=\defbodyindent {\df #1}\enskip % Generate function name } % Common pieces to start any @def... % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence (which our caller defines). % #3 is the control sequence to process the header, such as \defunheader. % \def\parsebodycommon#1#2#3{% \begingroup\inENV % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we want to allow a % break after all. \ifnum\lastpenalty = 10000 \penalty0 \fi \medbreak % % Define the \E... end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } % Process body of @defun, @deffn, @defmac, etc. % \def\defparsebody#1#2#3{% \parsebodycommon{#1}{#2}{#3}% \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% \catcode61=\active % 61 is `=' \begingroup\obeylines\activeparens \spacesplit#3% } % #1, #2, #3 are the common arguments (see \defparsebody). % #4, delimited by the space, is the class name. % \def\defmethparsebody#1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% \begingroup\obeylines\activeparens \spacesplit{#3{#4}}% } % Used for @deftypemethod and @deftypeivar. % #1, #2, #3 are the common arguments (see \defparsebody). % #4, delimited by a space, is the class name. % #5 is the method's return type. % \def\deftypemethparsebody#1#2#3#4 #5 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% \begingroup\obeylines\activeparens \spacesplit{#3{#4}{#5}}% } % Used for @deftypeop. The change from \deftypemethparsebody is an % extra argument at the beginning which is the `category', instead of it % being the hardwired string `Method' or `Instance Variable'. We have % to account for this both in the \...x definition and in parsing the % input at hand. Thus also need a control sequence (passed as #5) for % the \E... definition to assign the category name to. % \def\deftypeopparsebody#1#2#3#4#5 #6 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 ##2 ##3 {% \def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% \begingroup\obeylines\activeparens \spacesplit{#3{#5}{#6}}% } % For @defop. \def\defopparsebody #1#2#3#4#5 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% \begingroup\obeylines\activeparens \spacesplit{#3{#5}}% } % These parsing functions are similar to the preceding ones % except that they do not make parens into active characters. % These are used for "variables" since they have no arguments. % \def\defvarparsebody #1#2#3{% \parsebodycommon{#1}{#2}{#3}% \def#2{\begingroup\obeylines\spacesplit#3}% \catcode61=\active % \begingroup\obeylines \spacesplit#3% } % @defopvar. \def\defopvarparsebody #1#2#3#4#5 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\spacesplit{#3{##2}}}% \begingroup\obeylines \spacesplit{#3{#5}}% } \def\defvrparsebody#1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \begingroup\obeylines \spacesplit{#3{#4}}% } % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the % type is just `struct', because we lose the braces in `{struct % termios}' when \spacesplit reads its undelimited argument. Sigh. % \let\deftpparsebody=\defvrparsebody % % So, to get around this, we put \empty in with the type name. That % way, TeX won't find exactly `{...}' as an undelimited argument, and % won't strip off the braces. % \def\deftpparsebody #1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \begingroup\obeylines \spacesplit{\parsetpheaderline{#3{#4}}}\empty } % Fine, but then we have to eventually remove the \empty *and* the % braces (if any). That's what this does. % \def\removeemptybraces\empty#1\relax{#1} % After \spacesplit has done its work, this is called -- #1 is the final % thing to call, #2 the type name (which starts with \empty), and #3 % (which might be empty) the arguments. % \def\parsetpheaderline#1#2#3{% #1{\removeemptybraces#2\relax}{#3}% }% % Split up #2 at the first space token. % call #1 with two arguments: % the first is all of #2 before the space token, % the second is all of #2 after that space token. % If #2 contains no space token, all of it is passed as the first arg % and the second is passed as empty. % {\obeylines \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% \ifx\relax #3% #1{#2}{}\else #1{#2}{#3#4}\fi}} % Define @defun. % First, define the processing that is wanted for arguments of \defun % Use this to expand the args and terminate the paragraph they make up \def\defunargs#1{\functionparens \sl % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. % Set the font temporarily and use \font in case \setfont made \tensl a macro. {\tensl\hyphenchar\font=0}% #1% {\tensl\hyphenchar\font=45}% \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } \def\deftypefunargs #1{% % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. % Use \boldbraxnoamp, not \functionparens, so that & is not special. \boldbraxnoamp \tclose{#1}% avoid \code because of side effects on active chars \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } % Do complete processing of one @defun or @defunx line already parsed. % @deffn Command forward-char nchars \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defun == @deffn Function \def\defun{\defparsebody\Edefun\defunx\defunheader} \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{\putwordDeffunc}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefun int foobar (int @var{foo}, float @var{bar}) \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} % #1 is the data type. #2 is the name and args. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} % #1 is the data type, #2 the name, #3 the args. \def\deftypefunheaderx #1#2 #3\relax{% \doind {fn}{\code{#2}}% Make entry in function index \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% \deftypefunargs {#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} % \defheaderxcond#1\relax$.$ % puts #1 in @code, followed by a space, but does nothing if #1 is null. \def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} % #1 is the classification. #2 is the data type. #3 is the name and args. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} % #1 is the classification, #2 the data type, #3 the name, #4 the args. \def\deftypefnheaderx #1#2#3 #4\relax{% \doind {fn}{\code{#3}}% Make entry in function index \begingroup \normalparens % notably, turn off `&' magic, which prevents % at least some C++ text from working \defname {\defheaderxcond#2\relax$.$#3}{#1}% \deftypefunargs {#4}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defmac == @deffn Macro \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{\putwordDefmac}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defspec == @deffn Special Form \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{\putwordDefspec}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defop CATEGORY CLASS OPERATION ARG... % \def\defop #1 {\def\defoptype{#1}% \defopparsebody\Edefop\defopx\defopheader\defoptype} % \def\defopheader#1#2#3{% \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index \begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% \defunargs {#3}\endgroup % } % @deftypeop CATEGORY CLASS TYPE OPERATION ARG... % \def\deftypeop #1 {\def\deftypeopcategory{#1}% \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader \deftypeopcategory} % % #1 is the class name, #2 the data type, #3 the operation name, #4 the args. \def\deftypeopheader#1#2#3#4{% \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{\defheaderxcond#2\relax$.$#3} {\deftypeopcategory\ \putwordon\ \code{#1}}% \deftypefunargs{#4}% \endgroup } % @deftypemethod CLASS TYPE METHOD ARG... % \def\deftypemethod{% \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} % % #1 is the class name, #2 the data type, #3 the method name, #4 the args. \def\deftypemethodheader#1#2#3#4{% \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% \deftypefunargs{#4}% \endgroup } % @deftypeivar CLASS TYPE VARNAME % \def\deftypeivar{% \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} % % #1 is the class name, #2 the data type, #3 the variable name. \def\deftypeivarheader#1#2#3{% \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index \begingroup \defname{\defheaderxcond#2\relax$.$#3} {\putwordInstanceVariableof\ \code{#1}}% \defvarargs{#3}% \endgroup } % @defmethod == @defop Method % \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} % % #1 is the class name, #2 the method name, #3 the args. \def\defmethodheader#1#2#3{% \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{#2}{\putwordMethodon\ \code{#1}}% \defunargs{#3}% \endgroup } % @defcv {Class Option} foo-class foo-flag \def\defcv #1 {\def\defcvtype{#1}% \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} \def\defcvarheader #1#2#3{% \dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index \begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% \defvarargs {#3}\endgroup % } % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME % \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} % \def\defivarheader#1#2#3{% \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index \begingroup \defname{#2}{\putwordInstanceVariableof\ #1}% \defvarargs{#3}% \endgroup } % @defvar % First, define the processing that is wanted for arguments of @defvar. % This is actually simple: just print them in roman. % This must expand the args and terminate the paragraph they make up \def\defvarargs #1{\normalparens #1% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak} % @defvr Counter foo-count \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} % @defvar == @defvr Variable \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{\putwordDefvar}% \defvarargs {#2}\endgroup % } % @defopt == @defvr {User Option} \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{\putwordDefopt}% \defvarargs {#2}\endgroup % } % @deftypevar int foobar \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} % #1 is the data type. #2 is the name, perhaps followed by text that % is actually part of the data type, which should not be put into the index. \def\deftypevarheader #1#2{% \dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} % @deftypevr {Global Flag} int enable \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} % Now define @deftp % Args are printed in bold, a slight difference from @defvar. \def\deftpargs #1{\bf \defvarargs{#1}} % @deftp Class window height width ... \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} % These definitions are used if you use @defunx (etc.) % anywhere other than immediately after a @defun or @defunx. % \def\defcvx#1 {\errmessage{@defcvx in invalid context}} \def\deffnx#1 {\errmessage{@deffnx in invalid context}} \def\defivarx#1 {\errmessage{@defivarx in invalid context}} \def\defmacx#1 {\errmessage{@defmacx in invalid context}} \def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} \def\defoptx #1 {\errmessage{@defoptx in invalid context}} \def\defopx#1 {\errmessage{@defopx in invalid context}} \def\defspecx#1 {\errmessage{@defspecx in invalid context}} \def\deftpx#1 {\errmessage{@deftpx in invalid context}} \def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} \def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} \def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} \def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} \def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} \def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} \def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} \def\defunx#1 {\errmessage{@defunx in invalid context}} \def\defvarx#1 {\errmessage{@defvarx in invalid context}} \def\defvrx#1 {\errmessage{@defvrx in invalid context}} \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined \newwrite\macscribble \def\scanmacro#1{% \begingroup \newlinechar`\^^M % Undo catcode changes of \startcontents and \doprintindex \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ % Append \endinput to make sure that TeX does not see the ending newline. \toks0={#1\endinput}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \let\xeatspaces\eatspaces \input \jobname.tmp \endgroup } \else \def\scanmacro#1{% \begingroup \newlinechar`\^^M % Undo catcode changes of \startcontents and \doprintindex \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} \fi \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? \def\macrolist{} % List of all defined macros in the form % \do\macro1\do\macro2... % Utility routines. % Thisdoes \let #1 = #2, except with \csnames. \def\cslet#1#2{% \expandafter\expandafter \expandafter\let \expandafter\expandafter \csname#1\endcsname \csname#2\endcsname} % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=12\catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. \def\macrobodyctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\{=12 \catcode`\}=12 \catcode`\@=12 \catcode`\^^M=12 \usembodybackslash} \def\macroargctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\@=12 \catcode`\\=12} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0% \else \expandafter\parsemargdef \argl;% \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% % Add the macroname to \macrolist \toks0 = \expandafter{\macrolist\do}% \xdef\macrolist{\the\toks0 \expandafter\noexpand\csname\the\macname\endcsname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \def\unmacro{\parsearg\unmacroxxx} \def\unmacroxxx#1{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist \begingroup \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% \def\do##1{% \def\tempb{##1}% \ifx\tempa\tempb % remove this \else \toks0 = \expandafter{\newmacrolist\do}% \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% \fi}% \def\newmacrolist{}% % Execute macro list to define \newmacrolist \macrolist \global\let\macrolist\newmacrolist \endgroup \else \errmessage{Macro #1 not defined}% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname #1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.blah for each blah % in the params list, to be ##N where N is the position in that list. % That gets used by \mbodybackslash (above). % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. \def\parsemargdef#1;{\paramno=0\def\paramlist{}% \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1% \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% % This defines the macro itself. There are six cases: recursive and % nonrecursive macros of zero, one, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \fi \fi} \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \next} % We mant to disable all macros during \shipout so that they are not % expanded by \write. \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% \edef\next{\macrolist}\expandafter\endgroup\next} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Just make them active and then expand them all to nothing. \def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{\ignoreactivespaces \edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% \expandafter\noexpand\csname#2\endcsname}% \expandafter\endgroup\next} \message{cross references,} % @xref etc. \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's job is to define \lastnode. \def\node{\ENVcheck\parsearg\nodezzz} \def\nodezzz#1{\nodexxx [#1,]} \def\nodexxx[#1,#2]{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\relax % The sectioning commands (@chapter, etc.) call these. \def\donoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Ysectionnumberandtype}% \global\let\lastnode=\relax \fi } \def\unnumbnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% \global\let\lastnode=\relax \fi } \def\appendixnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Yappendixletterandtype}% \global\let\lastnode=\relax \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister \gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME, namely % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have % to set \indexdummies so commands such as @code in a section title % aren't expanded. It would be nicer not to expand the titles in the % first place, but there's so many layers that that is hard to do. % \def\setref#1#2{{% \indexdummies \pdfmkdest{#1}% \dosetq{#1-title}{Ytitle}% \dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-snt}{#2}% }} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% \def\printednodename{\ignorespaces #3}% \setbox1=\hbox{\printedmanual}% \setbox0=\hbox{\printednodename}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. \def\printednodename{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printednodename{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. \def\printednodename{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printednodename{\ignorespaces #1}% \fi% \fi \fi \fi % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not % insert empty discretionaries after hyphens, which means that it will % not find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifpdf \leavevmode \getfilename{#4}% {\normalturnoffactive \ifnum\filenamelength>0 \startlink attr{/Border [0 0 0]}% goto file{\the\filename.pdf} name{#1}% \else \startlink attr{/Border [0 0 0]}% goto name{#1}% \fi }% \linkcolor \fi % \ifdim \wd1 > 0pt \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\normalturnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % [mynode], [\printednodename],\space % page 3 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \endlink \endgroup} % \dosetq is the interface for calls from other macros % Use \normalturnoffactive so that punctuation chars such as underscore % and backslash work in node names. (\turnoffactive doesn't do \.) \def\dosetq#1#2{% {\let\folio=0% \normalturnoffactive \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% \iflinks \next \fi }% } % \internalsetq {foo}{page} expands into % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} % When the aux file is read, ' is the escape character \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} % Things to be expanded by \internalsetq \def\Ypagenumber{\folio} \def\Ytitle{\thissection} \def\Ynothing{} \def\Ysectionnumberandtype{% \ifnum\secno=0 \putwordChapter\xreftie\the\chapno % \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \def\Yappendixletterandtype{% \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \gdef\xreftie{'tie} % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Non-3.0. \else \def\linenumber{\the\inputlineno:\space} \fi % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. \def\refx#1#2{% \expandafter\ifx\csname X#1\endcsname\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs \message{\linenumber Undefined cross reference `#1'.}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \csname X#1\endcsname \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. % \def\xrdef#1{\begingroup % Reenable \ as an escape while reading the second argument. \catcode`\\ = 0 \afterassignment\endgroup \expandafter\gdef\csname X#1\endcsname } % Read the last existing aux file, if any. No error if none exists. \def\readauxfile{\begingroup \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other \catcode`\@=\other \catcode`\^=\other % It was suggested to define this as 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % Make the characters 128-255 be printing characters {% \count 1=128 \def\loop{% \catcode\count 1=\other \advance\count 1 by 1 \ifnum \count 1<256 \loop \fi }% }% % The aux file uses ' as the escape (for now). % Turn off \ as an escape so we do not lose on % entries which were dumped with control sequences in their names. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ % Reference to such entries still does not work the way one would wish, % but at least they do not bomb out when the aux file is read in. \catcode`\{=1 \catcode`\}=2 \catcode`\%=\other \catcode`\'=0 \catcode`\\=\other % \openin 1 \jobname.aux \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue \global\warnedobstrue \fi % Open the new aux file. TeX will close it automatically at exit. \openout\auxfile=\jobname.aux \endgroup} % Footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment \let\ptexfootnote=\footnote {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \footnotezzz }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset and anything else that uses % \parseargline fail inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \long\gdef\footnotezzz{\insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut \futurelet\next\fo@t } \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t \else\let\next\f@t\fi \next} \def\f@@t{\bgroup\aftergroup\@foot\let\next} \def\f@t#1{#1\@foot} \def\@foot{\strut\par\egroup} }%end \catcode `\@=11 % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt} % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else \closein 1 % Do not bother showing banner with post-v2.7 epsf.tex (available in % doc/epsf.tex until it shows up on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\undefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing this stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \nobreak\bigskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \line\bgroup\hss \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \hss \egroup \bigbreak \fi % space after the image \endgroup} \message{localization,} % and i18n. % @documentlanguage is usually given very early, just after % @setfilename. If done too late, it may not override everything % properly. Single argument is the language abbreviation. % It would be nice if we could set up a hyphenation file here. % \def\documentlanguage{\parsearg\dodocumentlanguage} \def\dodocumentlanguage#1{% \tex % read txi-??.tex file in plain TeX. % Read the file if it exists. \openin 1 txi-#1.tex \ifeof1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \let\temp = \relax \else \def\temp{\input txi-#1.tex }% \fi \temp \endgroup } \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? In the current directory should work if nowhere else does.} % @documentencoding should change something in TeX eventually, most % likely, but for now just recognize it. \let\documentencoding = \comment % Page size parameters. % \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be so finicky about underfull hboxes, either. \hbadness = 2000 % Following George Bush, just get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; % 4) hoffset; 5) binding offset; 6) topskip. We also call % \setleading{\textleading}, so the caller should define \textleading. % The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % Use `small' versions. % \def\smallenvironments{% \let\smalldisplay = \smalldisplayx \let\smallexample = \smalllispx \let\smallformat = \smallformatx \let\smalllisp = \smalllispx } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% }} % Use @smallbook to reset parameters for 7x9.5 (or so) format. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \deftypemargin = 0pt \defbodyindent = .5cm \smallenvironments }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 12pt % \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% % \tolerance = 700 \hfuzz = 1pt }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0mm \deftypemargin = 0pt \defbodyindent = 2mm \tableindent = 12mm % \smallenvironments }} % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin % 29mm, hence bottom margin 28mm, nominal side margin 3cm. \def\afourlatex{{\globaldefs = 1 \textleading = 13.6pt % \afourpaper \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% % % Must explicitly reset to 0 because we call \afourpaper, apparently, % although this does not entirely make sense. \globaldefs = 0 }} % Use @afourwide to print on European A4 paper in wide format. \def\afourwide{% \afourpaper \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% } % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \def\pagesizes{\parsearg\pagesizesxxx} \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\+=\other \catcode`\$=\other \def\normaldoublequote{"} \def\normaltilde{~} \def\normalcaret{^} \def\normalunderscore{_} \def\normalverticalbar{|} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} \def\normaldollar{$}%$ font-lock fix % This macro is used to make a character print one way in ttfont % where it can probably just be output, and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} % Subroutine for the previous macro. \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix %\catcode 27=\active %\def^^[{$\diamondsuit$} % Set up an active definition for =, but don't enable it most of the time. {\catcode`\==\active \global\def={{\tt \char 61}}} \catcode`+=\active \catcode`\_=\active % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} \catcode`\@=0 % \rawbackslashxx output one backslash character in current font \global\chardef\rawbackslashxx=`\\ %{\catcode`\\=\other %@gdef@rawbackslashxx{\}} % \rawbackslash redefines \ as input to do \rawbackslashxx. {\catcode`\\=\active @gdef@rawbackslash{@let\=@rawbackslashxx }} % \normalbackslash outputs one backslash in fixed width font. \def\normalbackslash{{\tt\rawbackslashxx}} % \catcode 17=0 % Define control-q \catcode`\\=\active % Used sometimes to turn off (effectively) the active characters % even after parsing them. @def@turnoffactive{@let"=@normaldoublequote @let\=@realbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus @let$=@normaldollar}%$ font-lock fix @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus @let$=@normaldollar}%$ font-lock fix % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\{ in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also back turn on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other @c Set initial fonts. @textfonts @rm @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: ���������������������������������������������������plotutils-2.6/libxmi/info/libxmi.texi���������������������������������������������������������������0000644�0001750�0001750�00000103562�10342437377�014760� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename libxmi.info @settitle The GNU @code{libxmi} 2-D Rasterization Library @c For double-sided printing, uncomment: @c @setchapternewpage odd @c %**end of header @dircategory Libraries @direntry * Libxmi: (libxmi). The GNU libxmi 2-D rasterization library. @end direntry @ifinfo This file documents version 1.3 of the GNU libxmi 2-D rasterization library. Copyright @copyright{} 1998--2005 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation. @end ifinfo @titlepage @title The GNU @code{libxmi} 2-D Rasterization Library @subtitle Version 1.3 @author Robert S. Maier @page @vskip 0pt plus 1filll Copyright @copyright{} 1998--1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation. @end titlepage @page @node Top, libxmi Overview, (dir), (dir) @chapter The @code{libxmi} 2-D Rasterization Library This is the documentation for version 1.3 of the GNU @code{libxmi} 2-D rasterization library, which is used by @w{C and} C++ programmers. @w{It converts} 2-D geometrical objects, such as polylines, polygons, and arcs, to raster patterns. There is support for setting drawing attributes, including line width, join style, cap style, and a multicolored dash pattern. The objects may be unfilled or filled. @w{If the latter}, the filling may be a solid color, @w{a stipple} pattern, or a texture. There is support for sophisticated color-merging between separately drawn objects. @menu * libxmi Overview:: GNU libxmi and its features * libxmi Example:: A sample program that may be linked with libxmi * libxmi API:: The libxmi API * Acknowledgements:: The contributors @end menu @node libxmi Overview, libxmi Example, Top, Top @section An overview of @code{libxmi} With the aid of the GNU @code{libxmi} library, a C or C++ programmer may rasterize two-dimensional geometric objects; @w{that is}, draw them on a two-dimensional array of pixels. The supported objects are points, polylines, filled polylines (i.e., polygons), rectangles, filled rectangles, and `arcs': segments of ellipses whose principal axes are aligned with the coordinate axes. Like polylines and rectangles, arcs may be unfilled or filled. The corresponding rendering functions in the @code{libxmi} API (application programming interface) are @code{miDrawPoints}, @code{miDrawLines}, @code{miFillPolygon}, @code{miDrawRectangles}, @code{miFillRectangles}, @code{miDrawArcs}, and @code{miFillArcs}. Each of these takes an array, rather than a single object, as an argument. For example, one of the arguments of @code{miDrawLines} is an array of points, interpreted as the vertices of a polyline. The polygon filled by @code{miFillPolygon} is specified similarly. And the final four functions render lists of objects, rather than single objects. Actually, @code{libxmi} provides a two-stage graphics pipeline. In the first stage, an opaque object called a @code{miPaintedSet} is drawn onto. Each of the eight drawing functions takes a pointer to a @code{miPaintedSet} as its first argument. Conceptually, a @code{miPaintedSet} is an unordered set of points with integer coordinates, partitioned by pixel value. The datatype representing a pixel value is @code{miPixel}, which is normally typedef'd as @code{unsigned int}. Each of the drawing functions takes a pointer to a @code{miGC}, or graphics context, as its second argument. The @code{miGC} specifies such drawing attributes as line width, join style, cap style, and dashing style, and also the pixel value(s) to be used in the painting operation. In the first stage of the pipeline the Painter's Algorithm is used, so that a repeatedly-painted point in a @code{miPaintedSet} acquires the pixel value applied @w{to it} in the final drawing operation. In the second stage, more sophisticated pixel-merging algorithms may be applied. @w{In this} stage, a @code{miPaintedSet} is copied (`merged') onto a @code{miCanvas}, by invoking @code{miCopyPaintedSetToCanvas}. @w{A @code{miCanvas}} is a structure that includes a @code{miPixmap}: a two-dimensional array of @code{miPixel}s that may be initialized by the user, and read, pixel by pixel, after the merging is performed. By default, @code{miCopyPaintedSetToCanvas} uses the Painter's Algorithm too, so that the source pixel in the @code{miPaintedSet} replaces the destination pixel in the @code{miCanvas}. But the merging process may be controlled in much finer detail. @w{A stipple} bitmap and a texture pixmap, and binary and ternary pixel-merging functions, may be specified. The @emph{interpretation} of pixel values is left @w{up to} the user. @w{A @code{miPixel}} could be an index into a color table. @w{It could} also be an encoding of a color according to the RGB scheme, the RGBA scheme, or some other scheme. Even though a @code{miPixel} is normally an @code{unsigned int}, this may be altered, if desired, at the time @code{libxmi} is installed. Any scalar type or nonscalar type, including a structure or a union, could be substituted. @code{libxmi} is intended for use both as a standalone library and as a rendering module that may be incorporated in other packages. To facilitate its use in other packages, it may be extensively customized at installation time. Besides customizing the definition of @code{miPixel}, it is possible to customize the definition of the @code{miPixmap} datatype, which by default is an array of pointers to rows of @code{miPixel}s. The default merging algorithm used by @code{miCopyPaintedSetToCanvas} may also be altered: @w{it need} not be the Painter's Algorithm. For instructions on customization, see the comments in the @code{libxmi} header file @file{xmi.h}. @node libxmi Example, libxmi API, libxmi Overview, Top @section A sample @code{libxmi} program The following C program uses @code{libxmi} to create a @code{miPaintedSet}, draws a dashed polyline and a dashed elliptic arc on the @code{miPaintedSet}, and transfers the painted pixels to a @code{miCanvas} that includes a pixmap of specified size. Finally, it writes the pixmap to standard output. @example @group #include #include #include /* public libxmi header file */ @end group @group int main () @{ miPoint points[4]; /* 3 line segments in the polyline */ miArc arc; /* 1 arc to be drawn */ miPixel pixels[4]; /* pixel values for drawing and dashing */ unsigned int dashes[2]; /* length of `on' and `off' dashes */ miGC *pGC; /* graphics context */ miPaintedSet *paintedSet; /* opaque object to be painted */ miCanvas *canvas; /* drawing canvas (including pixmap) */ miPoint offset; /* for miPaintedSet -> miCanvas transfer */ int i, j; @end group @group /* define polyline: vertices are (25,5) (5,5), (5,25), (35,22) */ points[0].x = 25; points[0].y = 5; points[1].x = 5; points[1].y = 5; points[2].x = 5; points[2].y = 25; points[3].x = 35; points[3].y = 22; @end group @group /* define elliptic arc */ arc.x = 20; arc.y = 15; /* upper left corner of bounding box */ arc.width = 30; /* x range of box: 20..50 */ arc.height = 16; /* y range of box: 15..31 */ arc.angle1 = 0 * 64; /* starting angle (1/64'ths of a degree) */ arc.angle2 = 270 * 64; /* angle range (1/64'ths of a degree) */ @end group @group /* create and modify graphics context */ pixels[0] = 1; /* pixel value for `off' dashes, if drawn */ pixels[1] = 2; /* default pixel for drawing */ pixels[2] = 3; /* another pixel, for multicolored dashes */ pixels[3] = 4; /* another pixel, for multicolored dashes */ @end group @group dashes[0] = 4; /* length of `on' dashes */ dashes[1] = 2; /* length of `off' dashes */ @end group @group pGC = miNewGC (4, pixels); miSetGCAttrib (pGC, MI_GC_LINE_STYLE, MI_LINE_ON_OFF_DASH); miSetGCDashes (pGC, 2, dashes, 0); miSetGCAttrib (pGC, MI_GC_LINE_WIDTH, 0); /* Bresenham algorithm */ @end group @group /* create empty painted set */ paintedSet = miNewPaintedSet (); @end group @group /* paint dashed polyline and dashed arc onto painted set */ miDrawLines (paintedSet, pGC, MI_COORD_MODE_ORIGIN, 4, points); miDrawArcs (paintedSet, pGC, 1, &arc); @end group @group /* create 60x35 canvas (initPixel=0); merge painted set onto it */ canvas = miNewCanvas (60, 35, 0); offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas (paintedSet, canvas, offset); @end group @group /* write canvas's pixmap (a 60x35 array of miPixels) to stdout */ for (j = 0; j < canvas->drawable->height; j++) @{ for (i = 0; i < canvas->drawable->width; i++) /* note: column index precedes row index */ printf ("%d", canvas->drawable->pixmap[j][i]); printf ("\n"); @} @end group @group /* clean up */ miDeleteCanvas (canvas); miDeleteGC (pGC); miClearPaintedSet (paintedSet); /* not necessary */ miDeletePaintedSet (paintedSet); @end group @group return 0; @} @end group @end example This program illustrates how @code{miPaintedSet}, @code{miGC}, and @code{miCanvas} objects are created and destroyed, @w{as well} as manipulated. Each of these types has a constructor and a destructor, named @code{miNew}@dots{} and @code{miDelete}@dots{}, respectively. When creating a @code{miGC} with @code{miNewGC}, an array of @code{miPixel}s of length at @w{least 2} must be passed as the second argument. The first argument, @code{npixels}, is the length of the array. The default color for drawing operations will be pixel @w{number 1} in the array. The other pixel colors in the array will only be used when dashing. @w{In normal} (on/off) dashing, the colors of the `on' dashes will cycle through the colors numbered 1,2,@dots{},npixels-1 in the array. In so-called double dashing, the `off' dashes will be drawn too, in color @w{number 0}. In the program, the first call to @code{miGCSetAttrib} sets the line mode to @code{MI_LINE_ON_OFF_DASH} rather than @code{MI_DOUBLE_DASH}@. This replaces the default, which is @code{MI_LINE_SOLID}, meaning no dashing (only color @w{number 1} in the pixel array is used). @w{An array} of dash lengths is then specified by calling @code{miSetGCDashes}. (The default dash length array, which is replaced, is @code{@{4,4@}}). When dashing, the specified dash length array will be cyclically used. The first dash will be `on', the second `off', and @w{so forth}. The third argument to @code{miSetGCDashes} specifies an initial offset into this cyclic pattern. Currently, the offset must be nonnegative. The second call to @code{miGCSetAttrib} sets the line width in the graphics context. @w{If the} specified line width is positive, lines and arcs will be drawn with a circular brush whose diameter is equal to the line width. All pixels within the brushed region will be painted. @w{If the} line width is zero, as it is here, a so-called Bresenham algorithm will be used. Bresenham lines and arcs are drawn with fewer pixels than is the case for lines and arcs with @w{width 1}, and many people prefer them. @code{miDrawLines} and @code{miDrawArc} do the actual drawing. They are passed a polyline (i.e., an array of @code{miPoint}s) and a @code{miArc}, respectively. The definitions of the @code{miPoint} and @code{miArc} structures appear in the header file @file{xmi.h}, which is worth examining. The third argument of @code{miDrawLines}, @code{MI_COORD_MODE_ORIGIN}, specifies that the points of the polyline, after the first, are expressed in absolute rather than relative coordinates. Finally, the program transfers the painted pixels to a @code{miCanvas}, and copies the pixels from it to standard output. @w{A @code{miCanvas}}, unlike a @code{miPaintedSet} and a @code{miGC}, is not an opaque object, so its elements may be read (and written). @w{In fact}, a @code{miCanvas} may be constructed by hand and passed to the @code{miCopyPaintedSetToCanvas} function. However, it is usually easiest to use the constructor @code{miNewCanvas} and the destructor @code{miDeleteCanvas}. Any @code{miCanvas} created with @code{miNewCanvas} is allocated on the heap, with @code{malloc}. @w{It includes} a pixmap (@w{an array} of @code{miPixel}s, of specified size) that is itself allocated on the heap. It is only when the painted pixels are transferred from @code{miPaintedSet} to @code{miCanvas} that clipping to a pixmap takes place. Drawing to a @code{miPaintedSet} is entirely unclipped: @w{at least} in principle, the @code{miPaintedSet} is of potentially infinite extent. However, the pixmap in the @code{miCanvas} created by @code{miNewCanvas (60, 35, 0)} has upper left corner @code{(0,0)} and lower right corner @code{(59,34)}. Out-of-bound painted pixels, @w{if any}, will not be transferred. The third argument of @code{miNewCanvas} is its @code{initPixel} argument: the pixel value @w{to which} each @code{miPixel} in the pixmap is initialized. Since this value @w{is `0'}, the pixmap that is sent to standard output will display the dashed polyline and arc in the `2', `3', @w{and `4'} colors, on a background of zeroes. @node libxmi API, Acknowledgements, libxmi Example, Top @section The @code{libxmi} API @menu * Opaque Data Structures:: The miPaintedSet and miGC structures * First Stage:: Painting pixels in a miPaintedSet * Second Stage:: Merging a miPaintedSet onto a miCanvas @end menu @node Opaque Data Structures, First Stage, libxmi API, libxmi API @subsection Opaque data structures The drawing functions used in the first stage of the @code{libxmi} graphics pipeline paint pixels on a @code{miPaintedSet}. A @code{miPaintedSet} should be thought of as an unordered set of points with integer coordinates, partitioned according to pixel value. Any pixel value is a @code{miPixel}, which in most @code{libxmi} installations is typedef'd as an @code{unsigned int}. A @code{miPaintedSet} is an opaque object that must be accessed through a pointer. The functions @example @group miPaintedSet * miNewPaintedSet (void); void miDeletePaintedSet (miPaintedSet *paintedSet); @end group @end example @noindent are the constructor and destructor for the @code{miPaintedSet} type. The function @example void miClearPaintedSet (miPaintedSet *paintedSet); @end example @noindent clears all pixels from a @code{miPaintedSet}, i.e., makes it the empty set. All drawing functions that paint pixels on a @code{miPaintedSet} take a pointer to a graphics context as an argument. @w{A graphics} context is an opaque object, called a @code{miGC}, that contains drawing parameters. The functions @example @group miGC * miNewGC (int npixels, const miPixel *pixels); void miDeleteGC (miGC *pGC); miGC * miCopyGC (const miGC *pGC); @end group @end example @noindent are the constructor, destructor, and copy constructor for the @code{miGC} type. The arguments of @code{miNewGC} specify an array of @code{miPixel}s, which must have length at @w{least 2}. The default color for drawing operations will be pixel @w{number 1} in the array. The other pixel colors in the array will only be used when dashing. @w{In normal} (on/off) dashing, the colors of the `on' dashes will cycle through the colors numbered 1,2,@dots{},npixels-1. In so-called double dashing, the `off' dashes will be drawn too, in color @w{number 0}. The array of pixel colors may be modified at any later time, by invoking the function @code{miSetGCPixels}. @example void miSetGCPixels (miGC *pGC, int npixels, const miPixel *pixels); @end example @noindent is the declaration of this function. The lengths of dashes, when dashing, may be set by invoking @code{miSetGCDashes}. It has declaration @example void miSetGCDashes (miGC *pGC, int ndashes, const unsigned int *dashes, int offset); @end example @noindent Here @code{dashes} is an array of length @code{ndashes}. The array is cyclically used. The first dash in a polyline or arc will be an `on' dash of length @code{dashes[0]}; the next dash will be an `off' dash of length @code{dashes[1]}; and so forth. The default dash length array in any @code{miGC} is @code{@{4,4@}}. The dash length array need not have the same length as the pixel color array, and it need not have even length. @code{offset}, if nonzero, is an initial offset into the dash pattern. For example, if it equals @code{dashes[0]} then the first dash will be an `off' dash of length @code{dashes[1]}. Currently, @code{offset} must be nonnegative. Besides the array of pixel colors and the array of dash lengths, any @code{miGC} contains several attributes whose values are @code{enum}s, and an integer-valued line width attribute. Any one of these may be set by invoking @code{miSetGCAttrib}, and any list of them by invoking @code{miSetGCAttribs}. The declarations of these functions are: @example typedef enum @{ MI_GC_FILL_RULE, MI_GC_JOIN_STYLE, MI_GC_CAP_STYLE, MI_GC_LINE_STYLE, MI_GC_ARC_MODE, MI_GC_LINE_WIDTH @} miGCAttribute; @group void miSetGCAttrib (miGC *pGC, miGCAttribute attribute, int value); void miSetGCAttribs (miGC *pGC, int nattributes, const miGCAttribute *attributes, const int *values); @end group @end example @noindent These attributes are similar to the drawing attributes used in the @w{X Window} System. The allowed values for the attribute @code{MI_GC_FILL_RULE}, which specifies the rule used when filling polygons and arcs, are: @example enum @{ MI_EVEN_ODD_RULE, MI_WINDING_RULE @}; @end example @noindent The default is @code{MI_EVEN_ODD_RULE}@. The allowed values for the attribute @code{MI_GC_JOIN_STYLE}, which specifies the rule used when joining polylines and polyarcs, are: @example enum @{ MI_JOIN_MITER, MI_JOIN_ROUND, MI_JOIN_BEVEL, MI_JOIN_TRIANGULAR @}; @end example @noindent The default is @code{MI_JOIN_MITER}@. The allowed values for the attribute @code{MI_GC_CAP_STYLE}, which specifies the rule used when capping the ends of polylines and arcs, are: @example enum @{ MI_CAP_NOT_LAST, MI_CAP_BUTT, MI_CAP_ROUND, MI_CAP_PROJECTING, MI_CAP_TRIANGULAR @}; @end example @noindent The default is @code{MI_CAP_BUTT}@. The allowed values for the attribute @code{MI_GC_LINE_STYLE}, which specifies whether or not dashing should take place when drawing polylines and arcs, are: @example enum @{ MI_LINE_SOLID, MI_LINE_ON_OFF_DASH, MI_LINE_DOUBLE_DASH @}; @end example @noindent The default is @code{MI_LINE_SOLID}@. The allowed values for the attribute @code{MI_GC_ARC_MODE}, which specifies how arcs should be filled, are: @example enum @{ MI_ARC_CHORD, MI_ARC_PIE_SLICE @}; @end example @noindent The default is @code{MI_ARC_PIE_SLICE}@. Finally, the value for the line width, i.e., for the @code{MI_GC_LINE_WIDTH} attribute, may be any nonnegative integer. The default @w{is 0}, which has a special meaning. Zero-width lines and arcs are not invisible. Instead, they are drawn with a Bresenham algorithm, which paints fewer pixels than is the case for lines with @w{width 1}. Any @code{miGC} also contains a miter-limit attribute, which, if the join mode attribute has value @code{MI_JOIN_MITER} and the line width is at @w{least 1}, will affect the drawing of the joins in polylines and polyarcs. @w{At any} join point, the `miter length' is the distance between the inner corner and the outer corner. The miter limit is the maximum value that can be tolerated for the miter length divided by the line width. @w{If this} value is exceeded, the miter will be `@w{cut off}': the @code{MI_JOIN_BEVEL} join mode will be used instead. The function @example void miSetGCMiterLimit (miGC *pGC, double miter_limit); @end example @noindent sets the value of this attribute. The specified value must be greater than or equal @w{to 1.0}. That is because the miter limit is the cosecant of one-half of the minimum join angle for mitering, so values less @w{than 1.0} are meaningless. The default value for the miter limit is 10.43, as in the @w{X Window} System. @w{10.43 is} the cosecant of 5.5 degrees, so by default, miters will be @w{cut off} if the join angle is less than @w{11 degrees}. @node First Stage, Second Stage, Opaque Data Structures, libxmi API @subsection The first stage of the graphics pipeline In the first stage of the @code{libxmi} graphics pipeline, one or more of the core drawing functions is invoked. Each drawing function takes pointers to a @code{miPaintedSet} and a @code{miGC} (@w{a graphics} context) as its first and second arguments. @w{It will} paint pixels in the @code{miPaintedSet}, according to the drawing parameters in the graphics context. The drawing functions fall into three groups: (1) functions that draw points, polylines, and polygons, @w{(2) functions} that draw rectangles, and @w{(3) functions} that draw `arcs' (segments of ellipses whose principal axes are aligned with the coordinate axes). @w{We discuss} these three groups @w{in turn}. The point/polyline/polygon group includes: @example void miDrawPoints (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); void miDrawLines (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); void miFillPolygon (miPaintedSet *paintedSet, const miGC *pGC, miPolygonShape shape, miCoordMode mode, int npts, const miPoint *pPts); @end example @noindent The final three arguments of each are a coordinate mode, a specified number of points, and an array that contains that number of points. @code{miDrawPoints} draws the array as a cloud of points, @code{miDrawLines} draws a polyline defined by the array, and @code{miFillPolygon} fills a polygon defined by the array. The @code{mode} argument specifies whether the points in the array, after the first, are in absolute or relative coordinates. Its possible values are: @example typedef enum @{ MI_COORD_MODE_ORIGIN, MI_COORD_MODE_PREVIOUS @} miCoordMode; @end example @noindent The @code{miPoint} structure is defined by @example typedef struct @{ int x, y; /* integer coordinates, y goes downward */ @} miPoint; @end example @noindent The additional @code{shape} argument of @code{miFillPolygon} is advisory. Its possible values are: @example typedef enum @{ MI_SHAPE_GENERAL, MI_SHAPE_CONVEX @} miPolygonShape; @end example @noindent They indicate whether the polygon is (1) unconstrained (i.e., not necessarily convex, with self-intersections allowed), or @w{(2) convex} and not self-intersecting. The latter case can be drawn more rapidly. The rectangle group includes @example void miDrawRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); void miFillRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); @end example @noindent The final two arguments of each are a specified number of rectangles and an array that contains that number of rectangles. @code{miDrawRectangles} draws the outline of each rectangle, and @code{miFillRectangle} fills each rectangle. The @code{miRectangle} structure is defined by @example typedef struct @{ int x, y; /* upper left corner of rectangle */ unsigned int width, height; /* dimensions: width>=1, height>=1 */ @} miRectangle; @end example @noindent The rectangle group is redundant, since a rectangle is a special sort of polyline, defined by a five-point point array in which the last point is the same as the first. The arc group includes @example void miDrawArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); void miFillArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); @end example @noindent The final two arguments of each are a specified number of arcs and an array that contains that number of arcs. @code{miDrawArcs} draws each arc. @w{It will} join successive arcs, if they are contiguous, according to the `join mode' in the graphics context. Similarly, @code{miFillArcs} will fill each arc according to the `arc mode' in the graphics context. Either a pie slice or a chord will be filled. The @code{miArc} structure is defined by @example typedef struct @{ int x, y; /* upper left corner of ellipse's bounding box */ unsigned int width, height; /* dimensions: width>=1, height>=1 */ int angle1, angle2; /* initial angle, angle range (in 1/64 degrees) */ @} miArc; @end example @noindent @code{x}, @code{y}, @code{width}, @code{height} specify a rectangle aligned with the coordinate axes, and @code{angle1}, @code{angle2} specify an angular range (a `pie slice') of an ellipse inscribed in the rectangle. By convention, they are the starting polar angle and angle range of the circular arc that would be produced from the elliptic arc by squeezing the rectangle into a square. @code{miDrawArcs} maintains a cache of rasterized ellipses. This cache is persistent, and internal to @code{libxmi}; accordingly, @code{miDrawArcs} is not reentrant. For applications in which reentrancy is important, a reentrant counterpart is provided. @w{It is} @example void miDrawArcs_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache); @end example @noindent The caller of @code{miDrawArcs_r} must supply a pointer to a @code{miEllipseCache} object as the final argument. @w{A pointer} to such an object, which is opaque, is returned by @code{miNewEllipseCache}. After zero or more calls to @code{miDrawArcs_r}, the object would be deleted by a call to @code{miDeleteEllipseCache}. The declarations @example @group miEllipseCache * miNewEllipseCache (void); void miDeleteEllipseCache (miEllipseCache *ellipseCache); @end group @end example @noindent are supplied in the header file @file{xmi.h}. @node Second Stage, , First Stage, libxmi API @subsection The second stage of the graphics pipeline In the second state of the graphics pipeline, the pixels in a @code{miPaintedSet} are transferred (`merged') to a @code{miCanvas}, by invoking @code{miCopyPaintedSetToCanvas}. @w{It is} only when the painted pixels are transferred to a @code{miCanvas} that clipping to a pixmap takes place. @w{A @code{miCanvas}} is a structure that includes a pixmap and several parameters that control the transfer of pixels. Since it is not opaque, it may be constructed and modified @w{by hand}, if necessary. The @code{miCanvas} type has definition @example typedef struct @{ miCanvasPixmap *drawable; /* the pixmap */ @group miBitmap *stipple; /* a mask, if non-NULL */ miPoint stippleOrigin; /* placement of upper left corner */ @end group @group miPixmap *texture; /* a texture, if non-NULL */ miPoint textureOrigin; /* placement of upper left corner */ @end group @group miPixelMerge2 pixelMerge2; /* binary merging function, if non-NULL */ miPixelMerge3 pixelMerge3; /* ternary counterpart, if non-NULL */ @end group @} miCanvas; @end example @noindent Here, the @code{miBitmap} and @code{miPixmap} types are defined by @example typedef struct @{ int **bitmap; /* each element is 0 or 1 */ unsigned int width; unsigned int height; @} miBitmap; @end example @example typedef struct @{ miPixel **pixmap; /* each element is a miPixel */ unsigned int width; unsigned int height; @} miPixmap; @end example @noindent That is, each of them contains an array of pointers to rows (@w{of integers} or pixel values, as the case @w{may be}). @w{In most} installations of @code{libxmi}, @code{miCanvasPixmap} is typedef'd as @code{miPixmap}. The typedefs @example @group typedef miPixel (*miPixelMerge2) (miPixel source, miPixel destination); typedef miPixel (*miPixelMerge3) (miPixel texture, miPixel source, miPixel destination); @end group @end example @noindent define the datatypes of the binary and ternary pixel-merging function members. The functions @example @group miCanvas * miNewCanvas (unsigned int width, unsigned int height, miPixel initPixel); void miDeleteCanvas (miCanvas *pCanvas); miCanvas * miCopyCanvas (const miCanvas *pCanvas); @end group @end example @noindent are the constructor, destructor, and copy constructor for the @code{miCanvas} type. Rather than a @code{miCanvas} being created @w{by hand}, @code{miNewCanvas} is usually used instead. The @code{initPixel} argument is a @code{miPixel} value with which the newly allocated pixmap should be filled. The @code{stipple} and @code{texture} pointers in a newly created @code{miCanvas} are @code{NULL}, as are the pixel-merging function members. The four convenience functions @example @group void miSetCanvasStipple (miCanvas *pCanvas, const miBitmap *pStipple, miPoint stippleOrigin); void miSetCanvasTexture (miCanvas *pCanvas, const miPixmap *pTexture, miPoint textureOrigin); @end group @group void miSetPixelMerge2 (miCanvas *pCanvas, miPixelMerge2 pixelMerge2); void miSetPixelMerge3 (miCanvas *pCanvas, miPixelMerge3 pixelMerge3); @end group @end example @noindent may be used to set these members. The @code{miCopyPaintedSetToCanvas} function, which implements the second stage of the graphics pipeline, can now be discussed. @w{It has} declaration @example void miCopyPaintedSetToCanvas (const miPaintedSet *paintedSet, miCanvas *canvas, miPoint origin); @end example @noindent where @code{origin} is the point on the @code{miCanvas} to which the point @code{(0,0)} in the @code{miPaintedSet} is mapped. (@w{It could} equally well be called @code{offset}.) The semantics of @code{miCopyPaintedSet} boil down to a single issue: how a `source' pixel in a @code{miPaintedSet} is merged onto the corresponding `destination' pixel in a @code{miCanvas} to form a new pixel. The simplest case is when no texture is specified (the corresponding pointer in the @code{miCanvas} is @code{NULL})@. @w{In that} case, if the binary pixel-merging function member of the @code{miCanvas} is @code{NULL}, a default merging algorithm will be used. @w{In most} @code{libxmi} installations this is the Painter's Algorithm: the new pixel in the @code{miCanvas} will simply be the source pixel. @w{If, on} the other hand, the binary pixel-merging function in the @code{miCanvas} is non-@code{NULL}, @w{it will} be used to compute the new pixel. A texture pixmap may be specified. If so, it will be extended periodically so as to cover the @code{miCanvas}, and its value at the location of the destination pixel will affect the merging process. @w{If the} ternary pixel-merging function member of the @code{miCanvas} is @code{NULL}, a default merging algorithm, appropriate to the case when a texture is present, will be used. @w{In most} @code{libxmi} installations this is a variant of the Painter's Algorithm: the new pixel in the @code{miCanvas} will be the texture pixel, rather than the source pixel. @w{If, on} the other hand, the ternary pixel-merging function in the @code{miCanvas} is non-@code{NULL}, @w{it will} be used to compute the new pixel. Any @code{miCanvas} may also include a pointer to a stipple bitmap. @w{If so}, it will be extended periodically so as to cover the @code{miCanvas}, and its value at the location of the destination pixel will determine whether or not its replacement by a new pixel, according to one of the preceding rules, will take place. @w{If the} stipple value is zero, @w{it will} not; otherwise it will. Stipple bitmaps are useful for creating so-called screen door patterns, and more generally for protecting, or @w{masking off}, part of a @code{miCanvas}. @node Acknowledgements, , libxmi API, Top @unnumbered Acknowledgements @code{libxmi} is based on the machine-independent 2-D graphics routines in the X11 sample server code. Those routines fill polygons and draw wide polygonal lines and arcs. They were written by Brian Kelleher, Joel McCormack, Todd Newman, Keith Packard, Robert Scheifler and Ken Whaley, who worked for Digital Equipment Corp., MIT, and/or the @w{X Consortium}, and are copyright @copyright{} 1985--89 by the @w{X Consortium}. In 1998--99, @email{rsm@@math.arizona.edu, Robert Maier} extracted the graphics routines from the sample server code in the X11R6 distribution, converted them to @w{ANSI C}, and added extensive comments. @w{He also} introduced data structures appropriate for a two-stage graphics pipeline, and converted the graphics routines to use them. @w{He added} some new rendering features, such as support for multicolored dashing. The modified code was first released by being incorporated in version 2.2 of the GNU @code{plotutils} package, as a rendering module for export of PNM and pseudo-GIF files. See the @uref{http://www.gnu.org/software/plotutils/plotutils.html, @code{plotutils} home page}. After further modifications, the code was released as the standalone @code{libxmi} library. @bye ����������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/libxmi/info/libxmi.info���������������������������������������������������������������0000644�0001750�0001750�00000077137�10342437411�014737� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is libxmi.info, produced by makeinfo version 4.7 from libxmi.texi. INFO-DIR-SECTION Libraries START-INFO-DIR-ENTRY * Libxmi: (libxmi). The GNU libxmi 2-D rasterization library. END-INFO-DIR-ENTRY This file documents version 1.3 of the GNU libxmi 2-D rasterization library. Copyright (C) 1998-2005 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.  File: libxmi.info, Node: Top, Next: libxmi Overview, Prev: (dir), Up: (dir) 1 The `libxmi' 2-D Rasterization Library **************************************** This is the documentation for version 1.3 of the GNU `libxmi' 2-D rasterization library, which is used by C and C++ programmers. It converts 2-D geometrical objects, such as polylines, polygons, and arcs, to raster patterns. There is support for setting drawing attributes, including line width, join style, cap style, and a multicolored dash pattern. The objects may be unfilled or filled. If the latter, the filling may be a solid color, a stipple pattern, or a texture. There is support for sophisticated color-merging between separately drawn objects. * Menu: * libxmi Overview:: GNU libxmi and its features * libxmi Example:: A sample program that may be linked with libxmi * libxmi API:: The libxmi API * Acknowledgements:: The contributors  File: libxmi.info, Node: libxmi Overview, Next: libxmi Example, Prev: Top, Up: Top 1.1 An overview of `libxmi' =========================== With the aid of the GNU `libxmi' library, a C or C++ programmer may rasterize two-dimensional geometric objects; that is, draw them on a two-dimensional array of pixels. The supported objects are points, polylines, filled polylines (i.e., polygons), rectangles, filled rectangles, and `arcs': segments of ellipses whose principal axes are aligned with the coordinate axes. Like polylines and rectangles, arcs may be unfilled or filled. The corresponding rendering functions in the `libxmi' API (application programming interface) are `miDrawPoints', `miDrawLines', `miFillPolygon', `miDrawRectangles', `miFillRectangles', `miDrawArcs', and `miFillArcs'. Each of these takes an array, rather than a single object, as an argument. For example, one of the arguments of `miDrawLines' is an array of points, interpreted as the vertices of a polyline. The polygon filled by `miFillPolygon' is specified similarly. And the final four functions render lists of objects, rather than single objects. Actually, `libxmi' provides a two-stage graphics pipeline. In the first stage, an opaque object called a `miPaintedSet' is drawn onto. Each of the eight drawing functions takes a pointer to a `miPaintedSet' as its first argument. Conceptually, a `miPaintedSet' is an unordered set of points with integer coordinates, partitioned by pixel value. The datatype representing a pixel value is `miPixel', which is normally typedef'd as `unsigned int'. Each of the drawing functions takes a pointer to a `miGC', or graphics context, as its second argument. The `miGC' specifies such drawing attributes as line width, join style, cap style, and dashing style, and also the pixel value(s) to be used in the painting operation. In the first stage of the pipeline the Painter's Algorithm is used, so that a repeatedly-painted point in a `miPaintedSet' acquires the pixel value applied to it in the final drawing operation. In the second stage, more sophisticated pixel-merging algorithms may be applied. In this stage, a `miPaintedSet' is copied (`merged') onto a `miCanvas', by invoking `miCopyPaintedSetToCanvas'. A `miCanvas' is a structure that includes a `miPixmap': a two-dimensional array of `miPixel's that may be initialized by the user, and read, pixel by pixel, after the merging is performed. By default, `miCopyPaintedSetToCanvas' uses the Painter's Algorithm too, so that the source pixel in the `miPaintedSet' replaces the destination pixel in the `miCanvas'. But the merging process may be controlled in much finer detail. A stipple bitmap and a texture pixmap, and binary and ternary pixel-merging functions, may be specified. The _interpretation_ of pixel values is left up to the user. A `miPixel' could be an index into a color table. It could also be an encoding of a color according to the RGB scheme, the RGBA scheme, or some other scheme. Even though a `miPixel' is normally an `unsigned int', this may be altered, if desired, at the time `libxmi' is installed. Any scalar type or nonscalar type, including a structure or a union, could be substituted. `libxmi' is intended for use both as a standalone library and as a rendering module that may be incorporated in other packages. To facilitate its use in other packages, it may be extensively customized at installation time. Besides customizing the definition of `miPixel', it is possible to customize the definition of the `miPixmap' datatype, which by default is an array of pointers to rows of `miPixel's. The default merging algorithm used by `miCopyPaintedSetToCanvas' may also be altered: it need not be the Painter's Algorithm. For instructions on customization, see the comments in the `libxmi' header file `xmi.h'.  File: libxmi.info, Node: libxmi Example, Next: libxmi API, Prev: libxmi Overview, Up: Top 1.2 A sample `libxmi' program ============================= The following C program uses `libxmi' to create a `miPaintedSet', draws a dashed polyline and a dashed elliptic arc on the `miPaintedSet', and transfers the painted pixels to a `miCanvas' that includes a pixmap of specified size. Finally, it writes the pixmap to standard output. #include #include #include /* public libxmi header file */ int main () { miPoint points[4]; /* 3 line segments in the polyline */ miArc arc; /* 1 arc to be drawn */ miPixel pixels[4]; /* pixel values for drawing and dashing */ unsigned int dashes[2]; /* length of `on' and `off' dashes */ miGC *pGC; /* graphics context */ miPaintedSet *paintedSet; /* opaque object to be painted */ miCanvas *canvas; /* drawing canvas (including pixmap) */ miPoint offset; /* for miPaintedSet -> miCanvas transfer */ int i, j; /* define polyline: vertices are (25,5) (5,5), (5,25), (35,22) */ points[0].x = 25; points[0].y = 5; points[1].x = 5; points[1].y = 5; points[2].x = 5; points[2].y = 25; points[3].x = 35; points[3].y = 22; /* define elliptic arc */ arc.x = 20; arc.y = 15; /* upper left corner of bounding box */ arc.width = 30; /* x range of box: 20..50 */ arc.height = 16; /* y range of box: 15..31 */ arc.angle1 = 0 * 64; /* starting angle (1/64'ths of a degree) */ arc.angle2 = 270 * 64; /* angle range (1/64'ths of a degree) */ /* create and modify graphics context */ pixels[0] = 1; /* pixel value for `off' dashes, if drawn */ pixels[1] = 2; /* default pixel for drawing */ pixels[2] = 3; /* another pixel, for multicolored dashes */ pixels[3] = 4; /* another pixel, for multicolored dashes */ dashes[0] = 4; /* length of `on' dashes */ dashes[1] = 2; /* length of `off' dashes */ pGC = miNewGC (4, pixels); miSetGCAttrib (pGC, MI_GC_LINE_STYLE, MI_LINE_ON_OFF_DASH); miSetGCDashes (pGC, 2, dashes, 0); miSetGCAttrib (pGC, MI_GC_LINE_WIDTH, 0); /* Bresenham algorithm */ /* create empty painted set */ paintedSet = miNewPaintedSet (); /* paint dashed polyline and dashed arc onto painted set */ miDrawLines (paintedSet, pGC, MI_COORD_MODE_ORIGIN, 4, points); miDrawArcs (paintedSet, pGC, 1, &arc); /* create 60x35 canvas (initPixel=0); merge painted set onto it */ canvas = miNewCanvas (60, 35, 0); offset.x = 0; offset.y = 0; miCopyPaintedSetToCanvas (paintedSet, canvas, offset); /* write canvas's pixmap (a 60x35 array of miPixels) to stdout */ for (j = 0; j < canvas->drawable->height; j++) { for (i = 0; i < canvas->drawable->width; i++) /* note: column index precedes row index */ printf ("%d", canvas->drawable->pixmap[j][i]); printf ("\n"); } /* clean up */ miDeleteCanvas (canvas); miDeleteGC (pGC); miClearPaintedSet (paintedSet); /* not necessary */ miDeletePaintedSet (paintedSet); return 0; } This program illustrates how `miPaintedSet', `miGC', and `miCanvas' objects are created and destroyed, as well as manipulated. Each of these types has a constructor and a destructor, named `miNew'... and `miDelete'..., respectively. When creating a `miGC' with `miNewGC', an array of `miPixel's of length at least 2 must be passed as the second argument. The first argument, `npixels', is the length of the array. The default color for drawing operations will be pixel number 1 in the array. The other pixel colors in the array will only be used when dashing. In normal (on/off) dashing, the colors of the `on' dashes will cycle through the colors numbered 1,2,...,npixels-1 in the array. In so-called double dashing, the `off' dashes will be drawn too, in color number 0. In the program, the first call to `miGCSetAttrib' sets the line mode to `MI_LINE_ON_OFF_DASH' rather than `MI_DOUBLE_DASH'. This replaces the default, which is `MI_LINE_SOLID', meaning no dashing (only color number 1 in the pixel array is used). An array of dash lengths is then specified by calling `miSetGCDashes'. (The default dash length array, which is replaced, is `{4,4}'). When dashing, the specified dash length array will be cyclically used. The first dash will be `on', the second `off', and so forth. The third argument to `miSetGCDashes' specifies an initial offset into this cyclic pattern. Currently, the offset must be nonnegative. The second call to `miGCSetAttrib' sets the line width in the graphics context. If the specified line width is positive, lines and arcs will be drawn with a circular brush whose diameter is equal to the line width. All pixels within the brushed region will be painted. If the line width is zero, as it is here, a so-called Bresenham algorithm will be used. Bresenham lines and arcs are drawn with fewer pixels than is the case for lines and arcs with width 1, and many people prefer them. `miDrawLines' and `miDrawArc' do the actual drawing. They are passed a polyline (i.e., an array of `miPoint's) and a `miArc', respectively. The definitions of the `miPoint' and `miArc' structures appear in the header file `xmi.h', which is worth examining. The third argument of `miDrawLines', `MI_COORD_MODE_ORIGIN', specifies that the points of the polyline, after the first, are expressed in absolute rather than relative coordinates. Finally, the program transfers the painted pixels to a `miCanvas', and copies the pixels from it to standard output. A `miCanvas', unlike a `miPaintedSet' and a `miGC', is not an opaque object, so its elements may be read (and written). In fact, a `miCanvas' may be constructed by hand and passed to the `miCopyPaintedSetToCanvas' function. However, it is usually easiest to use the constructor `miNewCanvas' and the destructor `miDeleteCanvas'. Any `miCanvas' created with `miNewCanvas' is allocated on the heap, with `malloc'. It includes a pixmap (an array of `miPixel's, of specified size) that is itself allocated on the heap. It is only when the painted pixels are transferred from `miPaintedSet' to `miCanvas' that clipping to a pixmap takes place. Drawing to a `miPaintedSet' is entirely unclipped: at least in principle, the `miPaintedSet' is of potentially infinite extent. However, the pixmap in the `miCanvas' created by `miNewCanvas (60, 35, 0)' has upper left corner `(0,0)' and lower right corner `(59,34)'. Out-of-bound painted pixels, if any, will not be transferred. The third argument of `miNewCanvas' is its `initPixel' argument: the pixel value to which each `miPixel' in the pixmap is initialized. Since this value is `0', the pixmap that is sent to standard output will display the dashed polyline and arc in the `2', `3', and `4' colors, on a background of zeroes.  File: libxmi.info, Node: libxmi API, Next: Acknowledgements, Prev: libxmi Example, Up: Top 1.3 The `libxmi' API ==================== * Menu: * Opaque Data Structures:: The miPaintedSet and miGC structures * First Stage:: Painting pixels in a miPaintedSet * Second Stage:: Merging a miPaintedSet onto a miCanvas  File: libxmi.info, Node: Opaque Data Structures, Next: First Stage, Prev: libxmi API, Up: libxmi API 1.3.1 Opaque data structures ---------------------------- The drawing functions used in the first stage of the `libxmi' graphics pipeline paint pixels on a `miPaintedSet'. A `miPaintedSet' should be thought of as an unordered set of points with integer coordinates, partitioned according to pixel value. Any pixel value is a `miPixel', which in most `libxmi' installations is typedef'd as an `unsigned int'. A `miPaintedSet' is an opaque object that must be accessed through a pointer. The functions miPaintedSet * miNewPaintedSet (void); void miDeletePaintedSet (miPaintedSet *paintedSet); are the constructor and destructor for the `miPaintedSet' type. The function void miClearPaintedSet (miPaintedSet *paintedSet); clears all pixels from a `miPaintedSet', i.e., makes it the empty set. All drawing functions that paint pixels on a `miPaintedSet' take a pointer to a graphics context as an argument. A graphics context is an opaque object, called a `miGC', that contains drawing parameters. The functions miGC * miNewGC (int npixels, const miPixel *pixels); void miDeleteGC (miGC *pGC); miGC * miCopyGC (const miGC *pGC); are the constructor, destructor, and copy constructor for the `miGC' type. The arguments of `miNewGC' specify an array of `miPixel's, which must have length at least 2. The default color for drawing operations will be pixel number 1 in the array. The other pixel colors in the array will only be used when dashing. In normal (on/off) dashing, the colors of the `on' dashes will cycle through the colors numbered 1,2,...,npixels-1. In so-called double dashing, the `off' dashes will be drawn too, in color number 0. The array of pixel colors may be modified at any later time, by invoking the function `miSetGCPixels'. void miSetGCPixels (miGC *pGC, int npixels, const miPixel *pixels); is the declaration of this function. The lengths of dashes, when dashing, may be set by invoking `miSetGCDashes'. It has declaration void miSetGCDashes (miGC *pGC, int ndashes, const unsigned int *dashes, int offset); Here `dashes' is an array of length `ndashes'. The array is cyclically used. The first dash in a polyline or arc will be an `on' dash of length `dashes[0]'; the next dash will be an `off' dash of length `dashes[1]'; and so forth. The default dash length array in any `miGC' is `{4,4}'. The dash length array need not have the same length as the pixel color array, and it need not have even length. `offset', if nonzero, is an initial offset into the dash pattern. For example, if it equals `dashes[0]' then the first dash will be an `off' dash of length `dashes[1]'. Currently, `offset' must be nonnegative. Besides the array of pixel colors and the array of dash lengths, any `miGC' contains several attributes whose values are `enum's, and an integer-valued line width attribute. Any one of these may be set by invoking `miSetGCAttrib', and any list of them by invoking `miSetGCAttribs'. The declarations of these functions are: typedef enum { MI_GC_FILL_RULE, MI_GC_JOIN_STYLE, MI_GC_CAP_STYLE, MI_GC_LINE_STYLE, MI_GC_ARC_MODE, MI_GC_LINE_WIDTH } miGCAttribute; void miSetGCAttrib (miGC *pGC, miGCAttribute attribute, int value); void miSetGCAttribs (miGC *pGC, int nattributes, const miGCAttribute *attributes, const int *values); These attributes are similar to the drawing attributes used in the X Window System. The allowed values for the attribute `MI_GC_FILL_RULE', which specifies the rule used when filling polygons and arcs, are: enum { MI_EVEN_ODD_RULE, MI_WINDING_RULE }; The default is `MI_EVEN_ODD_RULE'. The allowed values for the attribute `MI_GC_JOIN_STYLE', which specifies the rule used when joining polylines and polyarcs, are: enum { MI_JOIN_MITER, MI_JOIN_ROUND, MI_JOIN_BEVEL, MI_JOIN_TRIANGULAR }; The default is `MI_JOIN_MITER'. The allowed values for the attribute `MI_GC_CAP_STYLE', which specifies the rule used when capping the ends of polylines and arcs, are: enum { MI_CAP_NOT_LAST, MI_CAP_BUTT, MI_CAP_ROUND, MI_CAP_PROJECTING, MI_CAP_TRIANGULAR }; The default is `MI_CAP_BUTT'. The allowed values for the attribute `MI_GC_LINE_STYLE', which specifies whether or not dashing should take place when drawing polylines and arcs, are: enum { MI_LINE_SOLID, MI_LINE_ON_OFF_DASH, MI_LINE_DOUBLE_DASH }; The default is `MI_LINE_SOLID'. The allowed values for the attribute `MI_GC_ARC_MODE', which specifies how arcs should be filled, are: enum { MI_ARC_CHORD, MI_ARC_PIE_SLICE }; The default is `MI_ARC_PIE_SLICE'. Finally, the value for the line width, i.e., for the `MI_GC_LINE_WIDTH' attribute, may be any nonnegative integer. The default is 0, which has a special meaning. Zero-width lines and arcs are not invisible. Instead, they are drawn with a Bresenham algorithm, which paints fewer pixels than is the case for lines with width 1. Any `miGC' also contains a miter-limit attribute, which, if the join mode attribute has value `MI_JOIN_MITER' and the line width is at least 1, will affect the drawing of the joins in polylines and polyarcs. At any join point, the `miter length' is the distance between the inner corner and the outer corner. The miter limit is the maximum value that can be tolerated for the miter length divided by the line width. If this value is exceeded, the miter will be `cut off': the `MI_JOIN_BEVEL' join mode will be used instead. The function void miSetGCMiterLimit (miGC *pGC, double miter_limit); sets the value of this attribute. The specified value must be greater than or equal to 1.0. That is because the miter limit is the cosecant of one-half of the minimum join angle for mitering, so values less than 1.0 are meaningless. The default value for the miter limit is 10.43, as in the X Window System. 10.43 is the cosecant of 5.5 degrees, so by default, miters will be cut off if the join angle is less than 11 degrees.  File: libxmi.info, Node: First Stage, Next: Second Stage, Prev: Opaque Data Structures, Up: libxmi API 1.3.2 The first stage of the graphics pipeline ---------------------------------------------- In the first stage of the `libxmi' graphics pipeline, one or more of the core drawing functions is invoked. Each drawing function takes pointers to a `miPaintedSet' and a `miGC' (a graphics context) as its first and second arguments. It will paint pixels in the `miPaintedSet', according to the drawing parameters in the graphics context. The drawing functions fall into three groups: (1) functions that draw points, polylines, and polygons, (2) functions that draw rectangles, and (3) functions that draw `arcs' (segments of ellipses whose principal axes are aligned with the coordinate axes). We discuss these three groups in turn. The point/polyline/polygon group includes: void miDrawPoints (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); void miDrawLines (miPaintedSet *paintedSet, const miGC *pGC, miCoordMode mode, int npts, const miPoint *pPts); void miFillPolygon (miPaintedSet *paintedSet, const miGC *pGC, miPolygonShape shape, miCoordMode mode, int npts, const miPoint *pPts); The final three arguments of each are a coordinate mode, a specified number of points, and an array that contains that number of points. `miDrawPoints' draws the array as a cloud of points, `miDrawLines' draws a polyline defined by the array, and `miFillPolygon' fills a polygon defined by the array. The `mode' argument specifies whether the points in the array, after the first, are in absolute or relative coordinates. Its possible values are: typedef enum { MI_COORD_MODE_ORIGIN, MI_COORD_MODE_PREVIOUS } miCoordMode; The `miPoint' structure is defined by typedef struct { int x, y; /* integer coordinates, y goes downward */ } miPoint; The additional `shape' argument of `miFillPolygon' is advisory. Its possible values are: typedef enum { MI_SHAPE_GENERAL, MI_SHAPE_CONVEX } miPolygonShape; They indicate whether the polygon is (1) unconstrained (i.e., not necessarily convex, with self-intersections allowed), or (2) convex and not self-intersecting. The latter case can be drawn more rapidly. The rectangle group includes void miDrawRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); void miFillRectangles (miPaintedSet *paintedSet, const miGC *pGC, int nrects, const miRectangle *pRects); The final two arguments of each are a specified number of rectangles and an array that contains that number of rectangles. `miDrawRectangles' draws the outline of each rectangle, and `miFillRectangle' fills each rectangle. The `miRectangle' structure is defined by typedef struct { int x, y; /* upper left corner of rectangle */ unsigned int width, height; /* dimensions: width>=1, height>=1 */ } miRectangle; The rectangle group is redundant, since a rectangle is a special sort of polyline, defined by a five-point point array in which the last point is the same as the first. The arc group includes void miDrawArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); void miFillArcs (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs); The final two arguments of each are a specified number of arcs and an array that contains that number of arcs. `miDrawArcs' draws each arc. It will join successive arcs, if they are contiguous, according to the `join mode' in the graphics context. Similarly, `miFillArcs' will fill each arc according to the `arc mode' in the graphics context. Either a pie slice or a chord will be filled. The `miArc' structure is defined by typedef struct { int x, y; /* upper left corner of ellipse's bounding box */ unsigned int width, height; /* dimensions: width>=1, height>=1 */ int angle1, angle2; /* initial angle, angle range (in 1/64 degrees) */ } miArc; `x', `y', `width', `height' specify a rectangle aligned with the coordinate axes, and `angle1', `angle2' specify an angular range (a `pie slice') of an ellipse inscribed in the rectangle. By convention, they are the starting polar angle and angle range of the circular arc that would be produced from the elliptic arc by squeezing the rectangle into a square. `miDrawArcs' maintains a cache of rasterized ellipses. This cache is persistent, and internal to `libxmi'; accordingly, `miDrawArcs' is not reentrant. For applications in which reentrancy is important, a reentrant counterpart is provided. It is void miDrawArcs_r (miPaintedSet *paintedSet, const miGC *pGC, int narcs, const miArc *parcs, miEllipseCache *ellipseCache); The caller of `miDrawArcs_r' must supply a pointer to a `miEllipseCache' object as the final argument. A pointer to such an object, which is opaque, is returned by `miNewEllipseCache'. After zero or more calls to `miDrawArcs_r', the object would be deleted by a call to `miDeleteEllipseCache'. The declarations miEllipseCache * miNewEllipseCache (void); void miDeleteEllipseCache (miEllipseCache *ellipseCache); are supplied in the header file `xmi.h'.  File: libxmi.info, Node: Second Stage, Prev: First Stage, Up: libxmi API 1.3.3 The second stage of the graphics pipeline ----------------------------------------------- In the second state of the graphics pipeline, the pixels in a `miPaintedSet' are transferred (`merged') to a `miCanvas', by invoking `miCopyPaintedSetToCanvas'. It is only when the painted pixels are transferred to a `miCanvas' that clipping to a pixmap takes place. A `miCanvas' is a structure that includes a pixmap and several parameters that control the transfer of pixels. Since it is not opaque, it may be constructed and modified by hand, if necessary. The `miCanvas' type has definition typedef struct { miCanvasPixmap *drawable; /* the pixmap */ miBitmap *stipple; /* a mask, if non-NULL */ miPoint stippleOrigin; /* placement of upper left corner */ miPixmap *texture; /* a texture, if non-NULL */ miPoint textureOrigin; /* placement of upper left corner */ miPixelMerge2 pixelMerge2; /* binary merging function, if non-NULL */ miPixelMerge3 pixelMerge3; /* ternary counterpart, if non-NULL */ } miCanvas; Here, the `miBitmap' and `miPixmap' types are defined by typedef struct { int **bitmap; /* each element is 0 or 1 */ unsigned int width; unsigned int height; } miBitmap; typedef struct { miPixel **pixmap; /* each element is a miPixel */ unsigned int width; unsigned int height; } miPixmap; That is, each of them contains an array of pointers to rows (of integers or pixel values, as the case may be). In most installations of `libxmi', `miCanvasPixmap' is typedef'd as `miPixmap'. The typedefs typedef miPixel (*miPixelMerge2) (miPixel source, miPixel destination); typedef miPixel (*miPixelMerge3) (miPixel texture, miPixel source, miPixel destination); define the datatypes of the binary and ternary pixel-merging function members. The functions miCanvas * miNewCanvas (unsigned int width, unsigned int height, miPixel initPixel); void miDeleteCanvas (miCanvas *pCanvas); miCanvas * miCopyCanvas (const miCanvas *pCanvas); are the constructor, destructor, and copy constructor for the `miCanvas' type. Rather than a `miCanvas' being created by hand, `miNewCanvas' is usually used instead. The `initPixel' argument is a `miPixel' value with which the newly allocated pixmap should be filled. The `stipple' and `texture' pointers in a newly created `miCanvas' are `NULL', as are the pixel-merging function members. The four convenience functions void miSetCanvasStipple (miCanvas *pCanvas, const miBitmap *pStipple, miPoint stippleOrigin); void miSetCanvasTexture (miCanvas *pCanvas, const miPixmap *pTexture, miPoint textureOrigin); void miSetPixelMerge2 (miCanvas *pCanvas, miPixelMerge2 pixelMerge2); void miSetPixelMerge3 (miCanvas *pCanvas, miPixelMerge3 pixelMerge3); may be used to set these members. The `miCopyPaintedSetToCanvas' function, which implements the second stage of the graphics pipeline, can now be discussed. It has declaration void miCopyPaintedSetToCanvas (const miPaintedSet *paintedSet, miCanvas *canvas, miPoint origin); where `origin' is the point on the `miCanvas' to which the point `(0,0)' in the `miPaintedSet' is mapped. (It could equally well be called `offset'.) The semantics of `miCopyPaintedSet' boil down to a single issue: how a `source' pixel in a `miPaintedSet' is merged onto the corresponding `destination' pixel in a `miCanvas' to form a new pixel. The simplest case is when no texture is specified (the corresponding pointer in the `miCanvas' is `NULL'). In that case, if the binary pixel-merging function member of the `miCanvas' is `NULL', a default merging algorithm will be used. In most `libxmi' installations this is the Painter's Algorithm: the new pixel in the `miCanvas' will simply be the source pixel. If, on the other hand, the binary pixel-merging function in the `miCanvas' is non-`NULL', it will be used to compute the new pixel. A texture pixmap may be specified. If so, it will be extended periodically so as to cover the `miCanvas', and its value at the location of the destination pixel will affect the merging process. If the ternary pixel-merging function member of the `miCanvas' is `NULL', a default merging algorithm, appropriate to the case when a texture is present, will be used. In most `libxmi' installations this is a variant of the Painter's Algorithm: the new pixel in the `miCanvas' will be the texture pixel, rather than the source pixel. If, on the other hand, the ternary pixel-merging function in the `miCanvas' is non-`NULL', it will be used to compute the new pixel. Any `miCanvas' may also include a pointer to a stipple bitmap. If so, it will be extended periodically so as to cover the `miCanvas', and its value at the location of the destination pixel will determine whether or not its replacement by a new pixel, according to one of the preceding rules, will take place. If the stipple value is zero, it will not; otherwise it will. Stipple bitmaps are useful for creating so-called screen door patterns, and more generally for protecting, or masking off, part of a `miCanvas'.  File: libxmi.info, Node: Acknowledgements, Prev: libxmi API, Up: Top Acknowledgements **************** `libxmi' is based on the machine-independent 2-D graphics routines in the X11 sample server code. Those routines fill polygons and draw wide polygonal lines and arcs. They were written by Brian Kelleher, Joel McCormack, Todd Newman, Keith Packard, Robert Scheifler and Ken Whaley, who worked for Digital Equipment Corp., MIT, and/or the X Consortium, and are copyright (C) 1985-89 by the X Consortium. In 1998-99, Robert Maier extracted the graphics routines from the sample server code in the X11R6 distribution, converted them to ANSI C, and added extensive comments. He also introduced data structures appropriate for a two-stage graphics pipeline, and converted the graphics routines to use them. He added some new rendering features, such as support for multicolored dashing. The modified code was first released by being incorporated in version 2.2 of the GNU `plotutils' package, as a rendering module for export of PNM and pseudo-GIF files. See the `plotutils' home page (http://www.gnu.org/software/plotutils/plotutils.html). After further modifications, the code was released as the standalone `libxmi' library.  Tag Table: Node: Top1013 Node: libxmi Overview1953 Node: libxmi Example5823 Node: libxmi API13111 Node: Opaque Data Structures13462 Node: First Stage19709 Node: Second Stage25313 Node: Acknowledgements30847  End Tag Table ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/plot/���������������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257513�011413� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/plot/Makefile.am����������������������������������������������������������������������0000644�0001750�0001750�00000001162�10341763455�013363� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in bin_PROGRAMS = plot plot_SOURCES = plot.c fontlist.c plot_LDADD = ../lib/libcommon.a ../libplot/libplot.la INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c # remove executables installed by previous versions of the package OBSOLETEBINS = plot2plot plot2tek plot2hpgl plot2fig plot2ps plot2X install-exec-hook: -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/plot/Makefile.in����������������������������������������������������������������������0000644�0001750�0001750�00000035130�11234210075�013361� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = plot$(EXEEXT) subdir = plot DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_plot_OBJECTS = plot.$(OBJEXT) fontlist.$(OBJEXT) plot_OBJECTS = $(am_plot_OBJECTS) plot_DEPENDENCIES = ../lib/libcommon.a ../libplot/libplot.la DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(plot_SOURCES) DIST_SOURCES = $(plot_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ plot_SOURCES = plot.c fontlist.c plot_LDADD = ../lib/libcommon.a ../libplot/libplot.la INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c # remove executables installed by previous versions of the package OBSOLETEBINS = plot2plot plot2tek plot2hpgl plot2fig plot2ps plot2X all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plot/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu plot/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done plot$(EXEEXT): $(plot_OBJECTS) $(plot_DEPENDENCIES) @rm -f plot$(EXEEXT) $(LINK) $(plot_OBJECTS) $(plot_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plot.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS install-exec-hook: -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/plot/plot.c���������������������������������������������������������������������������0000644�0001750�0001750�00000161672�11234220600�012444� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file is the driving routine for the GNU `plot' program. It includes code to read a stream of commands, in GNU metafile format, and call libplot functions to draw the graphics. */ #include "sys-defines.h" #include "libcommon.h" #include "getopt.h" #include "fontlist.h" #include "plot.h" /* Obsolete op codes (no longer listed in plot.h) */ #define O_COLOR 'C' #define O_FROTATE 'V' #define O_FSCALE 'X' #define O_FTRANSLATE 'Q' /* The six input formats we recognize */ typedef enum { /* There are two GNU metafile formats: binary and portable (ascii). */ GNU_BINARY, GNU_PORTABLE, /* PLOT5_HIGH and PLOT5_LOW are the two distinct versions of Unix plot(5) format (high/low byte first), which we also support. They are requested by the -h and -l options respectively. The user may not need to specify either of those options explicitly, since if sizeof(short int)=2 then plot(5) input format is subsumed by GNU_OLD_BINARY format (see below). */ PLOT5_HIGH, PLOT5_LOW, /* GNU_OLD_BINARY [obsolete] is the binary format used in pre-2.0 releases, with no initial magic string, short ints instead of ints, and no OPENPL or CLOSEPL directives. By default, we assume that the input format is GNU_OLD_BINARY, and we switch to GNU_BINARY or GNU_PORTABLE if we see the appropriate magic header string. GNU_OLD_PORTABLE [obsolete] is the ascii format used in pre-2.0 releases, with no initial magic string, and no OPENPL or CLOSEPL directives. It subsumes the ascii version of plot(5) format, found on some Unix systems. If the user wishes to parse GNU_OLD_PORTABLE format, he/she should use the -A option. */ GNU_OLD_BINARY, GNU_OLD_PORTABLE } plot_format; const char *progname = "plot"; /* name of this program */ const char *written = "Written by Robert S. Maier."; const char *copyright = "Copyright (C) 2009 Free Software Foundation, Inc."; const char *usage_appendage = " [FILE]...\n\ With no FILE, or when FILE is -, read standard input.\n"; bool single_page_is_requested = false; /* set if user uses -p option */ char *bg_color = NULL; /* initial bg color, can be spec'd by user */ char *font_name = NULL; /* initial font name, can be spec'd by user */ char *pen_color = NULL; /* initial pen color, can be spec'd by user */ double font_size = -1.0; /* initial fractional size, <0 means default */ double line_width = -1.0; /* initial line width, <0 means default */ int requested_page = 0; /* user sets this via -p option */ /* Default input file format (see list of supported formats above). Don't change this (GNU_OLD_BINARY is an obsolete format, but it subsumes plot(5) format on many operating systems). We'll switch to the appropriate modern format by peeking at the first line of the input file. */ plot_format user_specified_input_format = GNU_OLD_BINARY; plot_format input_format = GNU_OLD_BINARY; /* Whether to remove all page breaks and frame breaks (i.e. invocations of erase()) from the output */ bool merge_pages = false; /* options */ #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 const char *optstring = "shlAIOp:F:f:W:T:"; struct option long_options[] = { /* The most important option ("--display-type" is an obsolete variant) */ { "output-format", ARG_REQUIRED, NULL, 'T'}, { "display-type", ARG_REQUIRED, NULL, 'T' << 8 }, /* hidden */ /* Other frequently used options */ { "font-name", ARG_REQUIRED, NULL, 'F' }, { "font-size", ARG_REQUIRED, NULL, 'f' }, { "line-width", ARG_REQUIRED, NULL, 'W' }, /* Long options with (mostly) no equivalent short option alias */ { "bg-color", ARG_REQUIRED, NULL, 'q' << 8 }, { "bitmap-size", ARG_REQUIRED, NULL, 'B' << 8 }, { "emulate-color", ARG_REQUIRED, NULL, 'e' << 8}, { "max-line-length", ARG_REQUIRED, NULL, 'M' << 8 }, { "merge-pages", ARG_NONE, NULL, 's' }, { "page-number", ARG_REQUIRED, NULL, 'p' }, { "page-size", ARG_REQUIRED, NULL, 'P' << 8 }, { "pen-color", ARG_REQUIRED, NULL, 'C' << 8 }, { "rotation", ARG_REQUIRED, NULL, 'r' << 8}, /* Options relevant only to raw plot (refers to metafile output) */ { "portable-output", ARG_NONE, NULL, 'O' }, /* Old input formats, for backward compatibility */ { "high-byte-first-input", ARG_NONE, NULL, 'h' }, { "low-byte-first-input", ARG_NONE, NULL, 'l' }, { "ascii-input", ARG_NONE, NULL, 'A' }, /* obsolete hidden option [same as 'A'] */ { "ascii-input", ARG_NONE, NULL, 'I' }, /* Documentation options */ { "help-fonts", ARG_NONE, NULL, 'f' << 8 }, { "list-fonts", ARG_NONE, NULL, 'l' << 8 }, { "version", ARG_NONE, NULL, 'V' << 8 }, { "help", ARG_NONE, NULL, 'h' << 8 }, { NULL, 0, NULL, 0} }; /* null-terminated list of options, such as obsolete-but-still-maintained options or undocumented options, which we don't show to the user */ const int hidden_options[] = { (int)'I', (int)('T' << 8), 0 }; /* forward references */ bool read_plot (plPlotter *plotter, FILE *in_stream); char *read_string (FILE *input, bool *badstatus); double read_float (FILE *input, bool *badstatus); double read_int (FILE *input, bool *badstatus); int maybe_closepl (plPlotter *plotter); int maybe_openpl (plPlotter *plotter); int read_true_int (FILE *input, bool *badstatus); unsigned char read_byte_as_unsigned_char (FILE *input, bool *badstatus); unsigned int read_byte_as_unsigned_int (FILE *input, bool *badstatus); int main (int argc, char *argv[]) { plPlotter *plotter; plPlotterParams *plotter_params; bool do_list_fonts = false; /* show a list of fonts? */ bool show_fonts = false; /* supply help on fonts? */ bool show_usage = false; /* show usage message? */ bool show_version = false; /* show version message? */ char *output_format = (char *)"meta"; /* default libplot output format */ int errcnt = 0; /* errors encountered */ int local_page_number; /* temporary storage */ int opt_index; /* long option index */ int option; /* option character */ int retval; /* return value */ plotter_params = pl_newplparams (); while ((option = getopt_long (argc, argv, optstring, long_options, &opt_index)) != EOF) { if (option == 0) option = long_options[opt_index].val; switch (option) { case 'T': /* Output format, ARG REQUIRED */ case 'T' << 8: output_format = (char *)xmalloc (strlen (optarg) + 1); strcpy (output_format, optarg); break; case 'O': /* Ascii output */ pl_setplparam (plotter_params, "META_PORTABLE", (void *)"yes"); break; case 'F': /* set the initial font */ font_name = (char *)xmalloc (strlen (optarg) + 1); strcpy (font_name, optarg); break; case 'e' << 8: /* emulate color by grayscale */ pl_setplparam (plotter_params, "EMULATE_COLOR", (void *)optarg); break; case 'C' << 8: /* set the initial pen color */ pen_color = (char *)xmalloc (strlen (optarg) + 1); strcpy (pen_color, optarg); break; case 'q' << 8: /* set the initial background color */ bg_color = (char *)xmalloc (strlen (optarg) + 1); strcpy (bg_color, optarg); break; case 'B' << 8: /* Bitmap size */ pl_setplparam (plotter_params, "BITMAPSIZE", (void *)optarg); break; case 'P' << 8: /* Page size */ pl_setplparam (plotter_params, "PAGESIZE", (void *)optarg); break; case 'f': /* set the initial fontsize */ { double local_font_size; if (sscanf (optarg, "%lf", &local_font_size) <= 0) { fprintf (stderr, "%s: error: the initial font size `%s' is bad (it should be a number)\n", progname, optarg); errcnt++; break; } if (local_font_size > 1.0) fprintf (stderr, "%s: the too-large initial font size `%f' is disregarded (it should be less than 1.0)\n", progname, local_font_size); else if (local_font_size < 0.0) fprintf (stderr, "%s: the negative initial font size `%f' is disregarded\n", progname, local_font_size); else font_size = local_font_size; break; } case 'p': /* page number */ if (sscanf (optarg, "%d", &local_page_number) <= 0 || local_page_number < 1) { fprintf (stderr, "%s: error: the page number `%s' is bad (it should be a positive integer)\n", progname, optarg); errcnt++; } else { requested_page = local_page_number; single_page_is_requested = true; } break; case 'W': /* set the initial line width */ { double local_line_width; if (sscanf (optarg, "%lf", &local_line_width) <= 0) { fprintf (stderr, "%s: error: the initial line thickness `%s' is bad (it should be a number)\n", progname, optarg); errcnt++; break; } if (local_line_width < 0.0) fprintf (stderr, "%s: the negative initial line thickness `%f' is ignored\n", progname, local_line_width); else line_width = local_line_width; break; } case 'h': /* High-byte-first plot(5) metafile(s) */ user_specified_input_format = PLOT5_HIGH; break; case 'l': /* Low-byte-first plot(5) metafile(s) */ user_specified_input_format = PLOT5_LOW; break; case 'A': /* Old ascii metafile(s) */ case 'I': user_specified_input_format = GNU_OLD_PORTABLE; break; case 'r' << 8: /* Plot rotation angle, ARG REQUIRED */ pl_setplparam (plotter_params, "ROTATION", (void *)optarg); break; case 'M' << 8: /* Max line length */ pl_setplparam (plotter_params, "MAX_LINE_LENGTH", (void *)optarg); break; case 's': /* Merge pages */ merge_pages = true; break; case 'V' << 8: /* Version */ show_version = true; break; case 'f' << 8: /* Fonts */ show_fonts = true; break; case 'h' << 8: /* Help */ show_usage = true; break; case 'l' << 8: /* Fonts */ do_list_fonts = true; break; default: errcnt++; break; } } if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (do_list_fonts) { int success; success = list_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_fonts) { int success; success = display_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, 2); return EXIT_SUCCESS; } if (bg_color) /* select user-specified background color */ pl_setplparam (plotter_params, "BG_COLOR", (void *)bg_color); if ((plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params)) == NULL) { fprintf (stderr, "%s: error: the plot device could not be created\n", progname); return EXIT_FAILURE; } if (merge_pages) /* we do just one openpl..closepl, wrapped around everything */ if (pl_openpl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be opened\n", progname); return EXIT_FAILURE; } retval = EXIT_SUCCESS; if (optind < argc) /* input files (or stdin) named explicitly on the command line */ { for (; optind < argc; optind++) { FILE *data_file; if (strcmp (argv[optind], "-") == 0) data_file = stdin; else { data_file = fopen (argv[optind], "r"); if (data_file == NULL) { fprintf (stderr, "%s: %s: %s\n", progname, argv[optind], strerror(errno)); fprintf (stderr, "%s: ignoring this file\n", progname); errno = 0; /* not quite fatal */ retval = EXIT_FAILURE; continue; /* back to top of for loop */ } } if (read_plot (plotter, data_file) == false) { fprintf (stderr, "%s: the input file `%s' could not be parsed\n", progname, argv[optind]); retval = EXIT_FAILURE; break; /* break out of for loop */ } if (data_file != stdin) /* Don't close stdin */ if (fclose (data_file) < 0) { fprintf (stderr, "%s: the input file `%s' could not be closed\n", progname, argv[optind]); retval = EXIT_FAILURE; continue; /* back to top of for loop */ } } /* endfor */ } else /* no files/streams spec'd on the command line, just read stdin */ { if (read_plot (plotter, stdin) == false) { fprintf (stderr, "%s: the input could not be parsed\n", progname); retval = EXIT_FAILURE; } } if (merge_pages) /* we do just one openpl..closepl, wrapped around everything */ if (pl_closepl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); return EXIT_FAILURE; } if (pl_deletepl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be deleted\n", progname); retval = EXIT_FAILURE; } pl_deleteplparams (plotter_params); return retval; } /* read_plot() reads a file in GNU metafile format or plot(5) format from a stream, and calls a plot function according to each instruction found in the file. Return value indicates whether stream was parsed successfully. */ bool read_plot (plPlotter *plotter, FILE *in_stream) { bool argerr = false; /* error occurred while reading argument? */ bool display_open = false; /* display device open? */ bool first_command = true; /* first command of file? */ bool in_page = false; /* within an openpl..closepl? */ bool parameters_initted = false; /* user-specified parameters initted? */ bool unrec = false; /* unrecognized command seen? */ char *s; double x0, y0, x1, y1, x2, y2, x3, y3; int i0, i1, i2; int instruction; static int current_page = 1; /* page count is continued from file to file */ /* User may specify one of the formats PLOT5_HIGH, PLOT5_LOW, and GNU_OLD_PORTABLE on the command line. If user doesn't specify a format, this is by default set to GNU_OLD_BINARY [obsolete], and we'll figure out whether the file is in a modern format, and if so, which one. */ input_format = user_specified_input_format; /* peek at first instruction in file */ instruction = getc (in_stream); /* Switch away from GNU_OLD_BINARY to GNU_BINARY if a GNU metafile magic string, interpreted here as a comment, is seen at top of file. See also parsing of the COMMENT instruction below (we further switch to GNU_PORTABLE if the header line indicates we should). */ if (input_format == GNU_OLD_BINARY && instruction == (int)O_COMMENT) input_format = GNU_BINARY; /* Note: we use `input_format' as a way of working around a problem: absurdly large font size requests, which can crash X servers. (You used to be able to crash an X server by piping any EPS file to `plot -TX', since the `S' on the first line was interepreted as an op code for a font size request!) We no longer process the `S' op code unless we've seen a modern GNU metafile magic string at the beginning of the file. This is a kludge but adds a little safety. */ while (instruction != EOF) { /* If a pre-modern format, OPENPL directive is not supported. So open display device if it hasn't already been opened, and we're on the right page. */ if (input_format != GNU_BINARY && input_format != GNU_PORTABLE) if ((!single_page_is_requested || current_page == requested_page) && instruction != (int)O_COMMENT && display_open == false) { if (maybe_openpl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be opened\n", progname); exit (EXIT_FAILURE); } else display_open = true; } switch (instruction) { case (int)O_ALABEL: { char x_adjust, y_adjust; x_adjust = (char)read_byte_as_unsigned_char (in_stream, &argerr); y_adjust = (char)read_byte_as_unsigned_char (in_stream, &argerr); s = read_string (in_stream, &argerr); if (!argerr) { if (!single_page_is_requested || current_page == requested_page) pl_alabel_r (plotter, x_adjust, y_adjust, s); free (s); } } break; case (int)O_ARC: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_farc_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_ARCREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_farcrel_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_BEZIER2: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier2_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_BEZIER2REL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier2rel_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_BEZIER3: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); x3 = read_int (in_stream, &argerr); y3 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier3_r (plotter, x0, y0, x1, y1, x2, y2, x3, y3); break; case (int)O_BEZIER3REL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); x3 = read_int (in_stream, &argerr); y3 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier3rel_r (plotter, x0, y0, x1, y1, x2, y2, x3, y3); break; case (int)O_BGCOLOR: /* parse args as unsigned ints rather than ints */ i0 = read_true_int (in_stream, &argerr)&0xFFFF; i1 = read_true_int (in_stream, &argerr)&0xFFFF; i2 = read_true_int (in_stream, &argerr)&0xFFFF; if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_bgcolor_r (plotter, i0, i1, i2); break; case (int)O_BOX: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbox_r (plotter, x0, y0, x1, y1); break; case (int)O_BOXREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fboxrel_r (plotter, x0, y0, x1, y1); break; case (int)O_CAPMOD: s = read_string (in_stream, &argerr); if (!argerr) { if (!single_page_is_requested || current_page == requested_page) pl_capmod_r (plotter, s); free (s); } break; case (int)O_CIRCLE: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcircle_r (plotter, x0, y0, x1); break; case (int)O_CIRCLEREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcirclerel_r (plotter, x0, y0, x1); break; case (int)O_COLOR: /* obsolete op code, to be removed */ i0 = read_true_int (in_stream, &argerr)&0xFFFF; i1 = read_true_int (in_stream, &argerr)&0xFFFF; i2 = read_true_int (in_stream, &argerr)&0xFFFF; if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_color_r (plotter, i0, i1, i2); break; case (int)O_CLOSEPATH: if (!single_page_is_requested || current_page == requested_page) pl_closepath_r (plotter); break; case (int)O_CLOSEPL: if (input_format != GNU_BINARY && input_format != GNU_PORTABLE) /* shouldn't be seeing a CLOSEPL */ { if (display_open && maybe_closepl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); exit (EXIT_FAILURE); } current_page++; return false; /* signal a parse error */ } else /* GNU_BINARY or GNU_PORTABLE format, so this may be legitimate */ { if (in_page == false) /* shouldn't be seeing a CLOSEPL */ { current_page++; return false; /* signal a parse error */ } else /* the CLOSEPL is legitimate */ { if (!single_page_is_requested || current_page == requested_page) { if (maybe_closepl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); exit (EXIT_FAILURE); } display_open = false; } in_page = false; current_page++; /* `page' is an OPENPL..CLOSEPL */ } } break; case (int)O_COMMENT: s = read_string (in_stream, &argerr); if (!argerr) { /* if a header line, switch to appropriate modern format */ if (first_command && input_format != PLOT5_HIGH && input_format != PLOT5_LOW && (strlen (s) >= 6) /* check magic number */ && strncmp (s, "PLOT ", 5) == 0) switch (s[5]) { case '1': input_format = GNU_BINARY; break; case '2': input_format = GNU_PORTABLE; break; default: fprintf (stderr, "%s: the input file is of an unrecognized metafile type\n", progname); break; } free (s); } break; case (int)O_CONT: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcont_r (plotter, x0, y0); break; case (int)O_CONTREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcontrel_r (plotter, x0, y0); break; case (int)O_ELLARC: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellarc_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_ELLARCREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellarcrel_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_ELLIPSE: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellipse_r (plotter, x0, y0, x1, y1, x2); break; case (int)O_ELLIPSEREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellipserel_r (plotter, x0, y0, x1, y1, x2); break; case (int)O_ENDPATH: if (!single_page_is_requested || current_page == requested_page) pl_endpath_r (plotter); break; case (int)O_ENDSUBPATH: if (!single_page_is_requested || current_page == requested_page) pl_endsubpath_r (plotter); break; case (int)O_ERASE: if (!single_page_is_requested || current_page == requested_page) if (merge_pages == false) /* i.e. not merging frames */ pl_erase_r (plotter); break; case (int)O_FILLCOLOR: /* parse args as unsigned ints rather than ints */ i0 = read_true_int (in_stream, &argerr)&0xFFFF; i1 = read_true_int (in_stream, &argerr)&0xFFFF; i2 = read_true_int (in_stream, &argerr)&0xFFFF; if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fillcolor_r (plotter, i0, i1, i2); break; case (int)O_FILLMOD: s = read_string (in_stream, &argerr); if (!argerr) { if (!single_page_is_requested || current_page == requested_page) pl_fillmod_r (plotter, s); free (s); } break; case (int)O_FILLTYPE: /* parse args as unsigned ints rather than ints */ i0 = read_true_int (in_stream, &argerr)&0xFFFF; if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_filltype_r (plotter, i0); break; case (int)O_FONTNAME: s = read_string (in_stream, &argerr); if (!argerr) { if (!single_page_is_requested || current_page == requested_page) pl_fontname_r (plotter, s); free (s); } break; case (int)O_FONTSIZE: x0 = read_int (in_stream, &argerr); if (input_format == GNU_BINARY || input_format == GNU_PORTABLE) /* workaround, see comment above */ { if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_ffontsize_r (plotter, x0); } break; case (int)O_JOINMOD: s = read_string (in_stream, &argerr); if (!argerr) { if (!single_page_is_requested || current_page == requested_page) pl_joinmod_r (plotter, s); free (s); } break; case (int)O_LABEL: s = read_string (in_stream, &argerr); if (!argerr) { if (!single_page_is_requested || current_page == requested_page) pl_label_r (plotter, s); free (s); } break; case (int)O_LINE: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fline_r (plotter, x0, y0, x1, y1); break; case (int)O_LINEDASH: { int n, i; double *dash_array, phase; n = read_true_int (in_stream, &argerr); if (n > 0) dash_array = (double *)xmalloc((unsigned int)n * sizeof(double)); else dash_array = NULL; for (i = 0; i < n; i++) dash_array[i] = read_int (in_stream, &argerr); phase = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_flinedash_r (plotter, n, dash_array, phase); free (dash_array); break; } case (int)O_LINEREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_flinerel_r (plotter, x0, y0, x1, y1); break; case (int)O_LINEMOD: s = read_string (in_stream, &argerr); if (!argerr) { if (!single_page_is_requested || current_page == requested_page) pl_linemod_r (plotter, s); free (s); } break; case (int)O_LINEWIDTH: x0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_flinewidth_r (plotter, x0); break; case (int)O_MARKER: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); i0 = read_true_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmarker_r (plotter, x0, y0, i0, y1); break; case (int)O_MARKERREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); i0 = read_true_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmarkerrel_r (plotter, x0, y0, i0, y1); break; case (int)O_MOVE: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmove_r (plotter, x0, y0); break; case (int)O_MOVEREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmoverel_r (plotter, x0, y0); break; case (int)O_OPENPL: if (input_format != GNU_BINARY && input_format != GNU_PORTABLE) /* shouldn't be seeing an OPENPL */ { if (display_open && maybe_closepl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); exit (EXIT_FAILURE); } current_page++; return false; /* signal a parse error */ } else /* GNU_BINARY or GNU_PORTABLE format, so may be legitimate */ { if (in_page) /* shouldn't be seeing another OPENPL */ { if (display_open && maybe_closepl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); exit (EXIT_FAILURE); } current_page++; return false; /* signal a parse error */ } /* this OPENPL is legitimate */ if (!single_page_is_requested || current_page == requested_page) { if (maybe_openpl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be opened\n", progname); exit (EXIT_FAILURE); } else display_open = true; } /* we're now in an openpl..closepl pair */ in_page = true; } break; case (int)O_ORIENTATION: i0 = read_true_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_orientation_r (plotter, i0); break; case (int)O_PENCOLOR: /* parse args as unsigned ints rather than ints */ i0 = read_true_int (in_stream, &argerr)&0xFFFF; i1 = read_true_int (in_stream, &argerr)&0xFFFF; i2 = read_true_int (in_stream, &argerr)&0xFFFF; if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_pencolor_r (plotter, i0, i1, i2); break; case (int)O_PENTYPE: /* parse args as unsigned ints rather than ints */ i0 = read_true_int (in_stream, &argerr)&0xFFFF; if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_pentype_r (plotter, i0); break; case (int)O_POINT: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fpoint_r (plotter, x0, y0); break; case (int)O_POINTREL: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fpointrel_r (plotter, x0, y0); break; case (int)O_RESTORESTATE: if (!single_page_is_requested || current_page == requested_page) pl_restorestate_r (plotter); break; case (int)O_SAVESTATE: if (!single_page_is_requested || current_page == requested_page) pl_savestate_r (plotter); break; case (int)O_SPACE: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); if (argerr) break; if (!single_page_is_requested || current_page == requested_page) pl_fspace_r (plotter, x0, y0, x1, y1); if (parameters_initted == false && ((!single_page_is_requested && current_page == 1) || (single_page_is_requested && current_page == requested_page))) /* insert these after the call to space(), if user insists on including them (should estimate sizes better) */ { if (pen_color) pl_pencolorname_r (plotter, pen_color); if (font_name) pl_fontname_r (plotter, font_name); if (font_size >= 0.0) pl_ffontsize_r (plotter, font_size * fabs (x1 - x0)); if (line_width >= 0.0) pl_flinewidth_r (plotter, line_width * fabs (x1 - x0)); parameters_initted = true; } break; case (int)O_SPACE2: x0 = read_int (in_stream, &argerr); y0 = read_int (in_stream, &argerr); x1 = read_int (in_stream, &argerr); y1 = read_int (in_stream, &argerr); x2 = read_int (in_stream, &argerr); y2 = read_int (in_stream, &argerr); if (argerr) break; if (!single_page_is_requested || current_page == requested_page) pl_fspace2_r (plotter, x0, y0, x1, y1, x2, y2); if (parameters_initted == false && ((!single_page_is_requested && current_page == 1) || (single_page_is_requested && current_page == requested_page))) /* insert these after the call to space2(), if user insists on including them (should estimate sizes better) */ { if (bg_color) { pl_bgcolorname_r (plotter, bg_color); pl_erase_r (plotter); } if (pen_color) pl_pencolorname_r (plotter, pen_color); if (font_name) pl_fontname_r (plotter, font_name); if (font_size >= 0.0) pl_ffontsize_r (plotter, font_size * fabs (x1 - x0)); if (line_width >= 0.0) pl_flinewidth_r (plotter, line_width * fabs (x1 - x0)); parameters_initted = true; } break; case (int)O_TEXTANGLE: x0 = read_int (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_ftextangle_r (plotter, x0); break; /* floating point counterparts to some of the above */ case (int)O_FARC: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_farc_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_FARCREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_farcrel_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_FBEZIER2: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier2_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_FBEZIER2REL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier2rel_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_FBEZIER3: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); x3 = read_float (in_stream, &argerr); y3 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier3_r (plotter, x0, y0, x1, y1, x2, y2, x3, y3); break; case (int)O_FBEZIER3REL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); x3 = read_float (in_stream, &argerr); y3 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbezier3rel_r (plotter, x0, y0, x1, y1, x2, y2, x3, y3); break; case (int)O_FBOX: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fbox_r (plotter, x0, y0, x1, y1); break; case (int)O_FBOXREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fboxrel_r (plotter, x0, y0, x1, y1); break; case (int)O_FCIRCLE: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcircle_r (plotter, x0, y0, x1); break; case (int)O_FCIRCLEREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcirclerel_r (plotter, x0, y0, x1); break; case (int)O_FCONT: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcont_r (plotter, x0, y0); break; case (int)O_FCONTREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fcontrel_r (plotter, x0, y0); break; case (int)O_FELLARC: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellarc_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_FELLARCREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellarcrel_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_FELLIPSE: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellipse_r (plotter, x0, y0, x1, y1, x2); break; case (int)O_FELLIPSEREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fellipserel_r (plotter, x0, y0, x1, y1, x2); break; case (int)O_FFONTSIZE: x0 = read_float (in_stream, &argerr); if (input_format == GNU_BINARY || input_format == GNU_PORTABLE) /* workaround, see comment above */ { if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_ffontsize_r (plotter, x0); } break; case (int)O_FLINE: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fline_r (plotter, x0, y0, x1, y1); break; case (int)O_FLINEDASH: { int n, i; double *dash_array, phase; n = read_true_int (in_stream, &argerr); if (n > 0) dash_array = (double *)xmalloc((unsigned int)n * sizeof(double)); else dash_array = NULL; for (i = 0; i < n; i++) dash_array[i] = read_float (in_stream, &argerr); phase = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_flinedash_r (plotter, n, dash_array, phase); free (dash_array); break; } case (int)O_FLINEREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_flinerel_r (plotter, x0, y0, x1, y1); break; case (int)O_FLINEWIDTH: x0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_flinewidth_r (plotter, x0); break; case (int)O_FMARKER: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); i0 = read_true_int (in_stream, &argerr); y1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmarker_r (plotter, x0, y0, i0, y1); break; case (int)O_FMARKERREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); i0 = read_true_int (in_stream, &argerr); y1 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmarkerrel_r (plotter, x0, y0, i0, y1); break; case (int)O_FMOVE: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmove_r (plotter, x0, y0); break; case (int)O_FMOVEREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmoverel_r (plotter, x0, y0); break; case (int)O_FPOINT: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fpoint_r (plotter, x0, y0); break; case (int)O_FPOINTREL: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!single_page_is_requested || current_page == requested_page) pl_fpointrel_r (plotter, x0, y0); break; case (int)O_FSPACE: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); if (argerr) break; if (!single_page_is_requested || current_page == requested_page) pl_fspace_r (plotter, x0, y0, x1, y1); if (parameters_initted == false && ((!single_page_is_requested && current_page == 1) || (single_page_is_requested && current_page == requested_page))) /* insert these after the call to fspace(), if user insists on including them (should estimate sizes better) */ { if (bg_color) { pl_bgcolorname_r (plotter, bg_color); pl_erase_r (plotter); } if (pen_color) pl_pencolorname_r (plotter, pen_color); if (font_name) pl_fontname_r (plotter, font_name); if (font_size >= 0.0) pl_ffontsize_r (plotter, font_size * fabs (x1 - x0)); if (line_width >= 0.0) pl_flinewidth_r (plotter, line_width * fabs (x1 - x0)); parameters_initted = true; } break; case (int)O_FSPACE2: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (argerr) break; if (!single_page_is_requested || current_page == requested_page) pl_fspace2_r (plotter, x0, y0, x1, y1, x2, y2); if (parameters_initted == false && ((!single_page_is_requested && current_page == 1) || (single_page_is_requested && current_page == requested_page))) /* insert these after the call to fspace2(), if user insists on including them (should estimate sizes better) */ { if (bg_color) { pl_bgcolorname_r (plotter, bg_color); pl_erase_r (plotter); } if (pen_color) pl_pencolorname_r (plotter, pen_color); if (font_name) pl_fontname_r (plotter, font_name); if (font_size >= 0.0) pl_ffontsize_r (plotter, font_size * fabs (x1 - x0)); if (line_width >= 0.0) pl_flinewidth_r (plotter, line_width * fabs (x1 - x0)); parameters_initted = true; } break; case (int)O_FTEXTANGLE: x0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_ftextangle_r (plotter, x0); break; /* floating point routines with no integer counterpart */ case (int)O_FCONCAT: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fconcat_r (plotter, x0, y0, x1, y1, x2, y2); break; case (int)O_FMITERLIMIT: x0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fmiterlimit_r (plotter, x0); break; case (int)O_FSETMATRIX: x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); x1 = read_float (in_stream, &argerr); y1 = read_float (in_stream, &argerr); x2 = read_float (in_stream, &argerr); y2 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fsetmatrix_r (plotter, x0, y0, x1, y1, x2, y2); if (parameters_initted == false && ((!single_page_is_requested && current_page == 1) || (single_page_is_requested && current_page == requested_page))) /* insert these after the call to fsetmatrix(), if user insists on including them (should estimate sizes better) */ { if (pen_color) pl_pencolorname_r (plotter, pen_color); if (font_name) pl_fontname_r (plotter, font_name); if (x0 != 0.0) { if (font_size >= 0.0) pl_ffontsize_r (plotter, font_size / fabs (x0)); if (line_width >= 0.0) pl_flinewidth_r (plotter, line_width / fabs (x0)); } parameters_initted = true; } break; case (int)O_FROTATE: /* obsolete op code, to be removed */ x0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_frotate_r (plotter, x0); break; case (int)O_FSCALE: /* obsolete op code, to be removed */ x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_fscale_r (plotter, x0, y0); break; case (int)O_FTRANSLATE: /* obsolete op code, to be removed */ x0 = read_float (in_stream, &argerr); y0 = read_float (in_stream, &argerr); if (!argerr) if (!single_page_is_requested || current_page == requested_page) pl_ftranslate_r (plotter, x0, y0); break; case ' ': case '\n': case '\r': case '\t': case '\v': case '\f': /* extra whitespace is all right in portable formats */ if (input_format == GNU_PORTABLE || input_format == GNU_OLD_PORTABLE) break; else /* not harmless */ unrec = true; break; default: unrec = true; break; } /* end of switch() */ first_command = false; if (unrec) { fprintf (stderr, "%s: an unrecognized command `0x%x' was encountered in the input\n", progname, instruction); break; /* break out of while loop */ } if (argerr) { int eof = feof (in_stream); if (eof) fprintf (stderr, "%s: the input terminated prematurely\n", progname); else fprintf (stderr, "%s: the argument of the command `0x%x' in the input could not be parsed\n", progname, instruction); break; /* break out of while loop */ } instruction = getc (in_stream); /* get next instruction */ } /* end of while loop, EOF reached */ if (input_format != GNU_BINARY && input_format != GNU_PORTABLE) /* if a premodern format, this file contains only one page */ { /* close display device at EOF, if it was ever opened */ if (display_open && maybe_closepl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); exit (EXIT_FAILURE); } current_page++; /* bump page count at EOF */ } else /* file is in a modern format, should have closed display device (if it was ever opened) */ { if (in_page) /* shouldn't be the case; parse error */ { if (display_open && maybe_closepl (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); exit (EXIT_FAILURE); } current_page++; return false; /* signal parse error */ } } return ((argerr || unrec) ? false : true); /* file parsed successfully? */ } int maybe_openpl (plPlotter *plotter) { if (merge_pages) return 0; else return (pl_openpl_r (plotter)); } int maybe_closepl (plPlotter *plotter) { if (merge_pages) return 0; else return (pl_closepl_r (plotter)); } /* read a single byte from input stream, return as unsigned char (0..255) */ unsigned char read_byte_as_unsigned_char (FILE *input, bool *badstatus) { int newint; if (*badstatus == true) return 0; newint = getc (input); /* have an unsigned char cast to an int, in range 0..255 */ if (newint == EOF) { *badstatus = true; return 0; } else return (unsigned char)newint; } /* read a single byte from input stream, return as unsigned int (0..255) */ unsigned int read_byte_as_unsigned_int (FILE *input, bool *badstatus) { int newint; if (*badstatus == true) return 0; newint = getc (input); /* have an unsigned char cast to an int, in range 0..255 */ if (newint == EOF) { *badstatus = true; return 0; } else return (unsigned int)newint; } /* read an integer from input stream (can be in ascii format, system binary format for integers or short integers, or perhaps in crufty old 2-byte format) */ int read_true_int (FILE *input, bool *badstatus) { int x, zi, returnval; short zs; unsigned int u; if (*badstatus == true) return 0; switch (input_format) { case GNU_PORTABLE: case GNU_OLD_PORTABLE: returnval = fscanf (input, " %d", &x); if (returnval != 1) { x = 0; *badstatus = true; } break; case GNU_BINARY: /* system format for integers */ default: returnval = fread (&zi, sizeof(zi), 1, input); if (returnval == 1) x = zi; else { x = 0; *badstatus = true; } break; case GNU_OLD_BINARY: /* system format for short integers */ returnval = fread (&zs, sizeof(zs), 1, input); if (returnval == 1) x = (int)zs; else { x = 0; *badstatus = true; } break; case PLOT5_HIGH: /* two-byte format, high byte first */ u = ((read_byte_as_unsigned_int (input, badstatus)) << 8); u |= read_byte_as_unsigned_int (input, badstatus); if (u > 0x7fff) x = - (int)(0x10000 - u); else x = (int)u; break; case PLOT5_LOW: /* two-byte format, low byte first */ u = read_byte_as_unsigned_int (input, badstatus); u |= (read_byte_as_unsigned_int (input, badstatus) << 8); if (u > 0x7fff) x = - (int)(0x10000 - u); else x = (int)u; break; } return x; } /* a relaxed version of the preceding routine: if a portable (human-readable) format is used, a floating point number may substitute for the integer */ double read_int (FILE *input, bool *badstatus) { int x, zi, returnval; short zs; unsigned int u; if (*badstatus == true) return 0.0; switch (input_format) { case GNU_PORTABLE: case GNU_OLD_PORTABLE: { double r; returnval = fscanf (input, " %lf", &r); if (returnval != 1) { *badstatus = true; r = 0.0; } return r; } case GNU_BINARY: /* system format for integers */ default: returnval = fread (&zi, sizeof(zi), 1, input); if (returnval == 1) x = (int)zi; else { x = 0; *badstatus = true; } break; case GNU_OLD_BINARY: /* system format for short integers */ returnval = fread (&zs, sizeof(zs), 1, input); if (returnval == 1) x = (int)zs; else { x = 0; *badstatus = true; } break; case PLOT5_HIGH: /* two-byte format, high byte first */ u = ((read_byte_as_unsigned_int (input, badstatus)) << 8); u |= read_byte_as_unsigned_int (input, badstatus); if (u > 0x7fff) x = - (int)(0x10000 - u); else x = (int)u; break; case PLOT5_LOW: /* two-byte format, low byte first */ u = read_byte_as_unsigned_int (input, badstatus); u |= (read_byte_as_unsigned_int (input, badstatus) << 8); if (u > 0x7fff) x = - (int)(0x10000 - u); else x = (int)u; break; } return (double)x; } /* read a floating point quantity from input stream (may be in ascii format or system single-precision format) */ double read_float (FILE *input, bool *badstatus) { float f; int returnval; if (*badstatus == true) return 0; switch (input_format) { case GNU_PORTABLE: case GNU_OLD_PORTABLE: /* human-readable format */ returnval = fscanf (input, " %f", &f); break; case GNU_BINARY: case GNU_OLD_BINARY: default: /* system single-precision format */ returnval = fread (&f, sizeof(f), 1, input); break; case PLOT5_HIGH: case PLOT5_LOW: /* plot(5) didn't support floats */ returnval = 0; break; } if (returnval != 1 || f != f) /* failure, or NaN */ { *badstatus = true; return 0.0; } else return (double)f; } /* Read a newline-terminated string from input stream. As returned, the string, with \0 replacing \n, is allocated on the heap and may be freed. */ char * read_string (FILE *input, bool *badstatus) { int length = 0, buffer_length = 16; /* initial length */ char *buffer; char c; if (*badstatus == true) return 0; buffer = (char *)xmalloc (buffer_length * sizeof(char)); for ( ; ; ) { if (length >= buffer_length) { buffer_length *= 2; buffer = (char *)xrealloc (buffer, (unsigned int)(buffer_length)); } c = (char)read_byte_as_unsigned_char (input, badstatus); if ((*badstatus == true) || (c == '\n')) break; buffer [length++] = c; } if (*badstatus) { free (buffer); return NULL; } else { buffer [length] = '\0'; /* null-terminate string */ return buffer; } } ����������������������������������������������������������������������plotutils-2.6/tek2plot/�����������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257513�012201� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/README�����������������������������������������������������������������������0000644�0001750�0001750�00000000436�06455172532�013001� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This directory contains the source for the GNU tek2plot program, which translates Tektronix graphics commands to graphics commands for other display devices. The subdirectory ./teksamples contains a few Tektronix files, some of unknown provenance, which may be used to test tek2plot. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/Tekparse.h�������������������������������������������������������������������0000644�0001750�0001750�00000002676�06453472141�014055� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * $Source: /u1/X/xterm/RCS/Tekparse.h,v $ * $Header: Tekparse.h,v 10.100 86/12/01 14:39:07 jg Rel $ */ /* @(#)Tekparse.h X10/6.6B 12/26/86 */ #define CASE_REPORT 0 #define CASE_VT_MODE (CASE_REPORT + 1) #define CASE_SPT_STATE (CASE_VT_MODE + 1) #define CASE_GIN (CASE_SPT_STATE + 1) #define CASE_BEL (CASE_GIN + 1) #define CASE_BS (CASE_BEL + 1) #define CASE_PT_STATE (CASE_BS + 1) #define CASE_PLT_STATE (CASE_PT_STATE + 1) #define CASE_TAB (CASE_PLT_STATE + 1) #define CASE_IPL_STATE (CASE_TAB + 1) #define CASE_ALP_STATE (CASE_IPL_STATE + 1) #define CASE_UP (CASE_ALP_STATE + 1) #define CASE_COPY (CASE_UP + 1) #define CASE_PAGE (CASE_COPY + 1) #define CASE_BES_STATE (CASE_PAGE + 1) #define CASE_BYP_STATE (CASE_BES_STATE + 1) #define CASE_IGNORE (CASE_BYP_STATE + 1) #define CASE_ASCII (CASE_IGNORE + 1) #define CASE_APL (CASE_ASCII + 1) #define CASE_CHAR_SIZE (CASE_APL + 1) #define CASE_BEAM_VEC (CASE_CHAR_SIZE + 1) #define CASE_CURSTATE (CASE_BEAM_VEC + 1) #define CASE_PENUP (CASE_CURSTATE + 1) #define CASE_PENDOWN (CASE_PENUP + 1) #define CASE_IPL_POINT (CASE_PENDOWN + 1) #define CASE_PLT_VEC (CASE_IPL_POINT + 1) #define CASE_PT_POINT (CASE_PLT_VEC + 1) #define CASE_SPT_POINT (CASE_PT_POINT + 1) #define CASE_CR (CASE_SPT_POINT + 1) #define CASE_ESC_STATE (CASE_CR + 1) #define CASE_LF (CASE_ESC_STATE + 1) #define CASE_SP (CASE_LF + 1) #define CASE_PRINT (CASE_SP + 1) #define CASE_OSC (CASE_PRINT + 1) #define CASE_ANSI (CASE_OSC + 1) ������������������������������������������������������������������plotutils-2.6/tek2plot/Makefile.am������������������������������������������������������������������0000644�0001750�0001750�00000001260�10341763455�014150� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in bin_PROGRAMS = tek2plot tek2plot_SOURCES = tek2plot.c Tektable.c fontlist.c tek2plot_LDADD = ../lib/libcommon.a ../libplot/libplot.la noinst_HEADERS = Tekparse.h INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c SUBDIRS = teksamples # remove executables installed by previous versions of the package OBSOLETEBINS = tek2tek tek2hpgl tek2fig tek2ps tek2X install-exec-hook: -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/Makefile.in������������������������������������������������������������������0000644�0001750�0001750�00000045412�11234210076�014154� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = tek2plot$(EXEEXT) subdir = tek2plot DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_tek2plot_OBJECTS = tek2plot.$(OBJEXT) Tektable.$(OBJEXT) \ fontlist.$(OBJEXT) tek2plot_OBJECTS = $(am_tek2plot_OBJECTS) tek2plot_DEPENDENCIES = ../lib/libcommon.a ../libplot/libplot.la DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(tek2plot_SOURCES) DIST_SOURCES = $(tek2plot_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tek2plot_SOURCES = tek2plot.c Tektable.c fontlist.c tek2plot_LDADD = ../lib/libcommon.a ../libplot/libplot.la noinst_HEADERS = Tekparse.h INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c SUBDIRS = teksamples # remove executables installed by previous versions of the package OBSOLETEBINS = tek2tek tek2hpgl tek2fig tek2ps tek2X all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tek2plot/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tek2plot/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done tek2plot$(EXEEXT): $(tek2plot_OBJECTS) $(tek2plot_DEPENDENCIES) @rm -f tek2plot$(EXEEXT) $(LINK) $(tek2plot_OBJECTS) $(tek2plot_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Tektable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tek2plot.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-exec-am install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS install-exec-hook: -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/tek2plot.c�������������������������������������������������������������������0000644�0001750�0001750�00000117041�11234220632�014014� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file is the main routine for GNU tek2plot. It reads a stream of Tektronix commands and draws graphics in real time by calling the appropriate routines in GNU libplot. Written by Robert S. Maier . Based on earlier work by Rich Murphey and by Edward Moy . The table-driven parser is based on the one written by Ed at Berkeley in the mid-'80s. The parsing tables in Tektable.c are essentially the same as the ones he designed for his `tek2ps' utility and for the Tektronix emulator included in the X10 and X11 versions of xterm(1). */ /* The basic reference on the features of the Tektronix 4014 with extended graphics module (EGM), which is what we emulate, is the 4014 Service Manual (Tektronix Part #070-1648-00, dated 8/74; there is also a User Manual [Part #070-1647-00]). The code below emulates the non-interactive features of a Tektronix 4014 with EGM [Extended Graphics Module], though not the interactive ones such as GIN mode or status inquiry. It also doesn't support write-through mode or beam defocusing. It does support the ANSI color extensions (ISO-6429) recognized by the MS-DOS Kermit v2.31 Tektronix emulator. It also recognizes, and ignores, the VT340-style control sequences ESC [ ?38h (switch to Tektronix mode), ESC [ ?38l (switch to native mode), and ESC ^C (switch to native mode), which are used by some Tektronix emulators. */ #include "sys-defines.h" #include "libcommon.h" #include "getopt.h" #include "fontlist.h" #include "plot.h" #include "Tekparse.h" const char *progname = "tek2plot"; /* name of this program */ const char *written = "Written by Robert S. Maier."; const char *copyright = "Copyright (C) 2009 Free Software Foundation, Inc."; const char *usage_appendage = " [FILE]...\n\ With no FILE, or when FILE is -, read standard input.\n"; /* Default font, ideally monospaced. Each character in the font should ideally have a width equal to CHAR_WIDTH em, i.e. a width equal to CHAR_WIDTH times the font size. */ #define CHAR_WIDTH 0.6 /* valid for Courier family, at least */ #define DEFAULT_PS_FONT_NAME "Courier" #define DEFAULT_PCL_FONT_NAME "Courier" #define DEFAULT_HERSHEY_FONT_NAME "HersheySerif" /* not monospaced */ /* Coordinates in Tek file should be in range [0..4095]x[0..3119]. So to center points within a virtual graphics display of size [0..4095]x[0..4095], we add 488 to each y coordinate. */ #define TEK_WIDTH 4096 #define YOFFSET 488 /* Font size of the libplot marker symbol used to represent a `point', in Tek units. We represent a Tektronix point by marker symbol #1, i.e. a dot (filled circle), which by convention has diameter 3/32 times the font size. [See libplot/g_mark.c.] So to get a diameter of 1 Tek unit, we choose 10 here. */ #define DOT_SIZE 10 /* parse tables in Tektable.c */ extern int Talptable[]; extern int Tbestable[]; extern int Tbyptable[]; extern int Tesctable[]; extern int Tipltable[]; extern int Tplttable[]; extern int Tpttable[]; extern int Tspttable[]; /* maximum size ANSI escape sequence we can handle */ #define BUFFER_SIZE 128 /* metrics for the four Tektronix fonts */ struct Tek_Char { int hsize; /* in Tek units */ int vsize; /* in Tek units */ int charsperline; int nlines; }; static const struct Tek_Char TekChar[4] = { {56, 88, 74, 35}, /* large */ {51, 82, 81, 38}, /* #2 */ {34, 53, 121, 58}, /* #3 */ {31, 48, 133, 64}, /* small */ }; #define TEXT_BUFFER_SIZE 256 /* must be able to handle a full line */ /* Tektronix line types */ const char *linemodes[8] = { "solid", "dotted", "dotdashed", "shortdashed", "longdashed", "solid", "solid", "solid" /* final three treated as solid */ }; #define TEKHOME ((TekChar[fontsize].nlines - 1)\ * TekChar[fontsize].vsize) #define MARGIN1 0 /* i.e. left edge */ #define MARGIN2 1 /* i.e. half-way across page */ enum { PENDOWN, PENUP }; enum { NORTH = 04, SOUTH = 010, EAST = 01, WEST = 02 }; #define PRINTABLE_ASCII(c) ((c >= 0x20) && (c <= 0x7E)) #define BEL 07 /* masks for coordinate-reading DFA */ #define ONE_BIT (0x1) #define TWO_BITS (0x3) #define FOUR_BITS (0x0f) #define FIVE_BITS (0x1f) #define TEN_BITS (0x3ff) /* options */ #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 const char *optstring = "Op:F:W:T:"; struct option long_options[] = { /* The most important option ("--display-type" is an obsolete variant) */ { "output-format", ARG_REQUIRED, NULL, 'T'}, { "display-type", ARG_REQUIRED, NULL, 'T' << 8 }, /* hidden */ /* Other frequently used options */ { "bg-color", ARG_REQUIRED, NULL, 'q' << 8 }, { "bitmap-size", ARG_REQUIRED, NULL, 'B' << 8 }, { "emulate-color", ARG_REQUIRED, NULL, 'e' << 8 }, { "font-name", ARG_REQUIRED, NULL, 'F' }, { "line-width", ARG_REQUIRED, NULL, 'W' }, { "pen-color", ARG_REQUIRED, NULL, 'C' << 8 }, { "max-line-length", ARG_REQUIRED, NULL, 'M' << 8 }, { "page-number", ARG_REQUIRED, NULL, 'p' }, { "page-size", ARG_REQUIRED, NULL, 'P' << 8 }, { "position-chars", ARG_NONE, NULL, 'S' << 8 }, { "rotation", ARG_REQUIRED, NULL, 'r' << 8}, { "use-tek-fonts", ARG_NONE, NULL, 't' << 8 }, /* Options relevant only to raw tek2plot (refers to metafile output) */ { "portable-output", ARG_NONE, NULL, 'O' }, /* Documentation options */ { "help-fonts", ARG_NONE, NULL, 'f' << 8 }, { "list-fonts", ARG_NONE, NULL, 'l' << 8 }, { "version", ARG_NONE, NULL, 'V' << 8 }, { "help", ARG_NONE, NULL, 'h' << 8 }, { NULL, 0, NULL, 0} }; /* null-terminated list of options, such as obsolete-but-still-maintained options or undocumented options, which we don't show to the user */ const int hidden_options[] = { (int)('T' << 8), 0 }; typedef struct { int red; int green; int blue; } Color; /* ANSI (ISO-6429) color extensions. Scheme is essentially: 0 = normal, 1 = bright foreground color (30-37) = 30 + colors where colors are 1=red, 2=green, 4=blue background color is similar, with `40' replacing `30'. */ const Color ansi_color[16] = { {0x0000, 0x0000, 0x0000}, /* black, \033[0;30m */ {0x8b8b, 0x0000, 0x0000}, /* red4 \033[0;31m */ {0x0000, 0x8b8b, 0x0000}, /* green4 \033[0;32m */ {0x8b8b, 0x8b8b, 0x0000}, /* yellow4 \033[0;33m */ {0x0000, 0x0000, 0x8b8b}, /* blue4 \033[0;34m */ {0x8b8b, 0x0000, 0x8b8b}, /* magenta4 \033[0;35m */ {0x0000, 0x8b8b, 0x8b8b}, /* cyan4, \033[0;36m */ {0x8b8b, 0x8b8b, 0x8b8b}, /* gray55 \033[0;37m */ {0x4d4d, 0x4d4d, 0x4d4d}, /* gray30 \033[1;30m */ {0xffff, 0x0000, 0x0000}, /* red \033[1;31m */ {0x0000, 0xffff, 0x0000}, /* green \033[1;32m */ {0xffff, 0xffff, 0x0000}, /* yellow \033[1;33m */ {0x0000, 0x0000, 0xffff}, /* blue \033[1;34m */ {0xffff, 0x0000, 0xffff}, /* magenta \033[1;35m */ {0x0000, 0xffff, 0xffff}, /* cyan \033[1;36m */ {0xffff, 0xffff, 0xffff} /* white \033[1;37m */ }; /* global variables set on command line, used in Tek parsing routine */ bool position_indiv_chars = false; /* user may set this */ bool single_page_is_requested = false; /* set if user uses -p option */ bool use_tek_fonts = false; /* fonts tekfont0..tekfont3 available? */ bool force_hershey_default = false; /* default font sh'd be Hershey? [kludge]*/ char *font_name = NULL; /* initial font name, can be spec'd by user */ char *pen_color = NULL; /* initial pen color, can be spec'd by user */ double line_width = -1.0; /* initial line width, <0 means default */ int requested_page = 0; /* user sets this via -p option */ /* variables used in parser */ bool plotter_open = false; bool plotter_opened = false; int cur_X = 0, cur_Y = 0; /* graphics cursor position in Tek coors */ int current_page = 0; /* page count */ /* forward references */ bool getpoint (int *xcoor, int *ycoor, FILE *stream, int *badstatus, int *margin); bool read_plot (plPlotter *plotter, FILE *in_stream); int read_byte (FILE *stream, int *badstatus); void begin_page (plPlotter *plotter); void end_page (plPlotter *plotter); void set_font_size (plPlotter *plotter, int new_fontsize); void unread_byte (int byte, FILE *in_stream, int *badstatus); int main (int argc, char *argv[]) { plPlotter *plotter; plPlotterParams *plotter_params; bool do_list_fonts = false; /* show a list of fonts? */ bool show_fonts = false; /* supply help on fonts? */ bool show_usage = false; /* show usage message? */ bool show_version = false; /* show version message? */ char *output_format = (char *)"meta"; /* default libplot output format */ double local_line_width; /* temporary storage */ int errcnt = 0; /* errors encountered */ int local_page_number; /* temporary storage */ int opt_index; /* long option index */ int option; /* option character */ int retval; /* return value */ plotter_params = pl_newplparams (); while ((option = getopt_long (argc, argv, optstring, long_options, &opt_index)) != EOF) { if (option == 0) option = long_options[opt_index].val; switch (option) { case 'T': /* Output format, ARG REQUIRED */ case 'T' << 8: output_format = (char *)xmalloc (strlen (optarg) + 1); strcpy (output_format, optarg); /* Kludge: if HP-GL[/2] output is requested, be sure to use a Hershey font as the default font, even though the Plotter nominally supports PS fonts. Reason: nominal != real. */ if (strcasecmp (output_format, "hpgl") == 0) force_hershey_default = true; else force_hershey_default = false; break; case 'F': /* set the initial font */ font_name = (char *)xmalloc (strlen (optarg) + 1); strcpy (font_name, optarg); break; case 'p': /* page number */ if (sscanf (optarg, "%d", &local_page_number) <= 0 || local_page_number < 0) { fprintf (stderr, "%s: error: the page number `%s' is bad (it should be a nonnegative integer)\n", progname, optarg); errcnt++; } else { requested_page = local_page_number; single_page_is_requested = true; } break; case 'W': /* set the initial line width */ if (sscanf (optarg, "%lf", &local_line_width) <= 0) { fprintf (stderr, "%s: error: the line thickness `%s' is bad (it should be a number)\n", progname, optarg); errcnt++; break; } if (local_line_width < 0.0) fprintf (stderr, "%s: the request for a negative line thickness `%f' is disregarded\n", progname, local_line_width); else line_width = local_line_width; break; case 'O': /* Portable version of metafile output */ pl_setplparam (plotter_params, "META_PORTABLE", (void *)"yes"); break; /*---------------- Long options below here ----------------*/ case 'e' << 8: /* Emulate color via grayscale */ pl_setplparam (plotter_params, "EMULATE_COLOR", (void *)optarg); break; case 'q' << 8: /* Set the initial background color */ pl_setplparam (plotter_params, "BG_COLOR", (void *)optarg); break; case 'B' << 8: /* Bitmap size */ pl_setplparam (plotter_params, "BITMAPSIZE", (void *)optarg); break; case 'C' << 8: /* Set the initial pen color */ pen_color = (char *)xmalloc (strlen (optarg) + 1); strcpy (pen_color, optarg); break; case 'M' << 8: /* Max line length */ pl_setplparam (plotter_params, "MAX_LINE_LENGTH", (void *)optarg); break; case 'P' << 8: /* Page size */ pl_setplparam (plotter_params, "PAGESIZE", (void *)optarg); break; case 'S' << 8: /* Position chars in text strings individually */ position_indiv_chars = true; break; case 'r' << 8: /* Rotation angle */ pl_setplparam (plotter_params, "ROTATION", (void *)optarg); break; case 't' << 8: /* Use Tektronix fonts (must be installed) */ if (strcmp (output_format, "X") == 0) use_tek_fonts = true; break; case 'f' << 8: /* Fonts */ show_fonts = true; break; case 'l' << 8: /* Fonts */ do_list_fonts = true; break; case 'h' << 8: /* Help */ show_usage = true; break; case 'V' << 8: /* Version */ show_version = true; break; default: errcnt++; break; } } if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (do_list_fonts) { int success; success = list_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_fonts) { int success; success = display_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, 2); return EXIT_SUCCESS; } /* turn off special interpretation of `erase' in GIF Plotters */ pl_setplparam (plotter_params, "GIF_ANIMATION", (void *)"no"); if ((plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params)) == NULL) { fprintf (stderr, "%s: error: the plot device could not be created\n", progname); return EXIT_FAILURE; } retval = EXIT_SUCCESS; if (optind < argc) /* input files (or stdin) named explicitly on the command line */ { for (; optind < argc; optind++) { FILE *data_file; if (strcmp (argv[optind], "-") == 0) data_file = stdin; else { data_file = fopen (argv[optind], "r"); if (data_file == NULL) { fprintf (stderr, "%s: %s: %s\n", progname, argv[optind], strerror(errno)); fprintf (stderr, "%s: this file is ignored.\n", progname); errno = 0; /* not quite fatal */ retval = EXIT_FAILURE; continue; /* back to top of for loop */ } } if (read_plot (plotter, data_file) == false) { fprintf (stderr, "%s: the input file `%s' could not be parsed\n", progname, argv[optind]); retval = EXIT_FAILURE; continue; /* back to top of for loop */ } if (data_file != stdin) /* Don't close stdin */ if (fclose (data_file) < 0) { fprintf (stderr, "%s: error: the input file `%s' could not be closed\n", progname, argv[optind]); return EXIT_FAILURE; /* exit immediately */ } } } /* endfor */ else /* no files/streams spec'd on the command line, just read stdin */ { if (read_plot (plotter, stdin) == false) { fprintf (stderr, "%s: the input could not be parsed\n", progname); retval = EXIT_FAILURE; } } /* if nothing was emitted ... */ if (plotter_opened == false) { if (single_page_is_requested == false) /* output a blank page */ { begin_page (plotter); end_page (plotter); } else { if (requested_page >= current_page) { fprintf (stderr, "%s: the requested page does not exist\n", progname); retval = EXIT_FAILURE; } else /* page must have been seen, but was empty; output a blank page */ { begin_page (plotter); end_page (plotter); } } } if (pl_deletepl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be deleted\n", progname); retval = EXIT_FAILURE; } pl_deleteplparams (plotter_params); return retval; } void unread_byte (int c, FILE *in_stream, int *badstatus) { if (*badstatus == 0) { if (ungetc (c, in_stream) == EOF) /* means error, not EOF */ *badstatus = 2; /* treat as EOF anyway */ } } int read_byte (FILE *in_stream, int *badstatus) { int i; if (*badstatus == 1) /* status = parse error */ return 0; i = getc (in_stream); if (i == EOF) { *badstatus = 2; /* status = eof */ return 0; } return (i & 0x7f); /* high bit ignored */ } /* getpoint() reads a point (x,y) from the input stream, in Tektronix format, and returns it. A point is a pair of coordinates in the range 0..4095. Reading a point will normally require reading anywhere between 1 and 5 bytes from the input stream. This function contains internal state: several static variables. Return value indicates whether a point is successfully read. Failure to return a point may occur on account of a parsing problem or because of eof. In either of these two cases an error code is returned through `badstatus', signalling that parsing of the input stream should terminate. A point may also fail to be returned if the first byte that is read from the input stream is not a byte in the 0x20..0xff range. Normally, no byte in the range 0x00..0x1f range may be part of a point. So if such a byte is seen, it is pushed back on the stream and point-reading is aborted (no error code is returned through badstatus). Note that if the very first byte that is read is in this range, this function may return having read, in all, 0 bytes. An exception to the last rule: if any of the bytes CR, LF, or NUL is seen during the reading of a point, it is discarded and reading continues. So it is also possible that >5 bytes may be read in all. A possible side effect of calling getpoint(): if the MSB of the egm byte, which is one of the bytes that make up the point, is set, then the left-hand margin will be set to MARGIN2, i.e. to 2048. */ bool getpoint (int *xcoor, int *ycoor, FILE *in_stream, int *badstatus, int *margin) { /* variables for the point-reading DFA, initialized */ int status_one = 0, status_three = 0; /* 0=none, 1=seen one, 2=finished */ bool got_lo_y = false; bool got_hi_x = false, got_hi_y = false; int lo_x = 0, lo_y = 0, hi_x = 0, hi_y = 0; bool got_egm = false; int egm = 0; int temp_three = 0; /* following variables are saved from point to point */ static int saved_lo_y = 0, saved_hi_x = 0, saved_hi_y = 0; static bool margin_reset = false; int byte_read, type; if (*badstatus) return false; for ( ; ; ) { byte_read = read_byte (in_stream, badstatus); if (*badstatus) return false; /* Ignore high bit (bit 8); bit pattern of next two bits (bits 7/6) determines what sort of coordinate byte we have. 1 = Hi_X or Hi_Y, 2 = Lo_X, 3 = Lo_Y or EGM; 0 usually means abort point. Coordinate bytes appear in order [Hi_Y] [EGM] [Lo_Y] [Hi_X] Lo_X. 1 3 3 1 2 All save last are optional, except that if EGM or Hi_X is transmitted, also need need a Lo_Y. We remember old values of Hi_Y, Lo_Y, Hi_X, although not EGM or Lo_X, in our DFA. */ type = (byte_read>>5) & TWO_BITS; /* type of byte */ byte_read &= FIVE_BITS; /* mask off 5 relevant bits */ switch (type) { case 0: /* interruption of point-reading (parse error?) */ fprintf (stderr, "%s: an incomplete point in the input is ignored\n", progname); if (byte_read == '\n' || byte_read == '\r' || byte_read == '\0') continue; /* discard, on to next byte */ else /* put unread byte back on stream; hope we can parse it later */ unread_byte (byte_read, in_stream, badstatus); return false; case 1: /* Hi_Y or Hi_X */ switch (status_one) { case 0: if (status_three) { hi_x = byte_read; /* 2nd = Hi_X */ got_hi_x = true; if (status_three == 1) { lo_y = temp_three; /* Lo_Y */ got_lo_y = true; } status_one = 2; /* no more 1's */ status_three = 2; /* no more 3's */ } else { hi_y = byte_read; /* 1st = Hi_Y */ got_hi_y = true; status_one = 1; } break; case 1: if (status_three == 0) { fprintf (stderr, "%s: error: a point in the input has Hi_Y, Hi_X bytes with no Lo_Y between\n", progname); *badstatus = 1; /* parse error */ return false; } if (status_three == 1) { lo_y = temp_three; /* Lo_Y */ got_lo_y = true; } hi_x = byte_read; /* 2nd = Hi_X */ got_hi_x = true; status_one = 2; /* no more 1's */ status_three = 2; /* no more 3's */ break; case 2: fprintf (stderr, "%s: error: a point in the input contains too many Hi_Y/Hi_X bytes\n", progname); *badstatus = 1; /* parse error */ return false; } break; case 3: /* EGM or Lo_Y */ switch (status_three) { case 0: if (status_one == 2) { fprintf (stderr, "%s: error: a point in the input has an EGM/Lo_Y byte after 2 Hi_X/Hi_Y bytes\n", progname); *badstatus = 1; /* parse error */ return false; } else { temp_three = byte_read; status_three = 1; } break; case 1: if (status_one == 2) { fprintf (stderr, "%s: error: a point in the input has an EGM/Lo_Y byte after 2 Hi_X/Hi_Y bytes\n", progname); *badstatus = 1; /* parse error */ return false; } egm = temp_three; /* 1st = EGM */ got_egm = true; lo_y = byte_read; /* 2nd = Lo_Y */ got_lo_y = true; status_three = 2; break; case 2: fprintf (stderr, "%s: error: a point in the input has too many EGM/Lo_Y bytes\n", progname); *badstatus = 1; /* parse error */ return false; } break; case 2: /* Lo_X, final byte */ { int low_res_x, low_res_y; int x, y; if (status_three == 1) { lo_y = temp_three; /* Lo_Y */ got_lo_y = true; } lo_x = byte_read; /* Lo_X */ lo_y = got_lo_y ? lo_y : saved_lo_y; hi_x = got_hi_x ? hi_x : saved_hi_x; hi_y = got_hi_y ? hi_y : saved_hi_y; saved_lo_y = lo_y; saved_hi_x = hi_x; saved_hi_y = hi_y; /* On a genuine Tektronix 4014, the MSB of the 5-bit EGM byte sets the margin to equal Margin2 (2048) */ if ((egm >> 4) & ONE_BIT) { *margin = MARGIN2; if (margin_reset == false) fprintf (stderr, "%s: the left margin of the Tektronix was reset by the input\n", progname); margin_reset = true; } /* low_res is what we'd use on a pre-EGM Tektronix */ low_res_x = (hi_x << 5) | lo_x; low_res_y = (hi_y << 5) | lo_y; x = (low_res_x << 2) | (egm & TWO_BITS); y = (low_res_y << 2) | ((egm >> 2) & TWO_BITS); *xcoor = x; *ycoor = y; return true; /* end of `case 2' in switch: success */ } } /* end of switch */ } /* end of while loop */ /* NOTREACHED */ } /* Parse a Tektronix stream and make appropriate libplot calls, paying attention to several global variables. Will output at least one openpl()..closepl(). */ bool read_plot (plPlotter *plotter, FILE *in_stream) { /* variables for DFA */ int *Tparsestate = Talptable; /* start in ALPHA mode */ int *curstate = Talptable; /* for temporary storage (for `bypass' mode) */ int pen = PENUP; /* pen up or pen down */ int linetype = 0; /* in range 0..7, 0 means "solid" */ int fontsize = 0; /* in range 0..3, 0 means large */ int margin = MARGIN1; /* MARGIN1=left side, MARGIN2=halfway across */ char text[TEXT_BUFFER_SIZE]; /* for storage of text strings */ int badstatus = 0; /* 0=OK, 1=parse error, 2=eof */ while (!badstatus) /* exit from loop only on parse error or eof */ { int c; int x, y; c = read_byte (in_stream, &badstatus); if (badstatus) break; /* parse error or eof; exit from while loop */ switch (Tparsestate[c]) { /* Switch among 5 basic states: ALPHA, PLOT, POINT PLOT, SPECIAL POINT PLOT and INCREMENTAL PLOT. */ case CASE_ALP_STATE: /* Enter ALPHA mode */ Tparsestate = curstate = Talptable; break; case CASE_PLT_STATE: /* Enter PLOT mode */ Tparsestate = curstate = Tplttable; c = read_byte (in_stream, &badstatus); /* do lookahead */ if (c == BEL) /* no initial dark vector */ pen = PENDOWN; else { pen = PENUP; unread_byte (c, in_stream, &badstatus); } break; case CASE_PT_STATE: /* Enter POINT PLOT mode */ Tparsestate = curstate = Tpttable; break; case CASE_SPT_STATE: /* enter SPECIAL POINT PLOT mode */ Tparsestate = curstate = Tspttable; break; case CASE_IPL_STATE: /* enter INCREMENTAL PLOT mode */ Tparsestate = curstate = Tipltable; break; /*****************************************/ /* ALPHA mode commands */ case CASE_PRINT: /* printable character */ { char *cp = text; int x_here, y_here, n; x_here = cur_X, y_here = cur_Y; /* push back, so we can read string as a unit */ unread_byte (c, in_stream, &badstatus); if (badstatus) break; n = (position_indiv_chars ? 1 : TEXT_BUFFER_SIZE - 1); y = cur_Y; while (!badstatus && n-- > 0 && y == cur_Y) { c = read_byte (in_stream, &badstatus); if (badstatus) { break; /* end label on eof or read error */ } if (!PRINTABLE_ASCII (c)) { /* push back */ unread_byte (c, in_stream, &badstatus); break; /* end label on non-ascii character */ } *cp++ = c; /* following block is merely `cursor right' (cf. below) */ { const struct Tek_Char *t = &TekChar[fontsize]; int l; cur_X += t->hsize; if (cur_X > TEK_WIDTH) { l = cur_Y / t->vsize - 1; if (l < 0) { margin = !margin; l = t->nlines - 1; } cur_Y = l * t->vsize; cur_X = (margin == MARGIN1 ? 0 : TEK_WIDTH / 2); } } } /* end of string-reading while loop */ *cp = '\0'; /* null-terminate string, and output it */ if (current_page == requested_page || !single_page_is_requested) { if (plotter_open == false) begin_page (plotter); if (position_indiv_chars) /* string consists of a single char */ { int halfwidth = TekChar[fontsize].hsize / 2; pl_move_r (plotter, x_here + halfwidth, y_here + YOFFSET); pl_alabel_r (plotter, 'c', 'b', text); } else { pl_move_r (plotter, x_here, y_here + YOFFSET); pl_alabel_r (plotter, 'l', 'b', text); } pl_move_r (plotter, cur_X, cur_Y); } } /* end of CASE_PRINT */ break; /* PLOT mode commands */ case CASE_PLT_VEC: /* PLT: vector */ /* push back, so we can read vector as a unit */ unread_byte (c, in_stream, &badstatus); if (getpoint (&x, &y, in_stream, &badstatus, &margin) && !badstatus) /* N.B. getpoint returns w/o having read c only if c=0x00..0x1f, so there's no chance of a infinite loop (see parsetable) */ { if (current_page == requested_page || !single_page_is_requested) { if (pen == PENDOWN) { if (plotter_open == false) begin_page (plotter); pl_cont_r (plotter, x, y + YOFFSET); } else { /* N.B. Don't begin a new page just for a move() */ if (plotter_open == true) pl_move_r (plotter, x, y + YOFFSET); } } cur_X = x; cur_Y = y; pen = PENDOWN; } break; /* POINT PLOT mode commands */ case CASE_PT_POINT: /* PT: point */ /* push back, so we can read vector as a unit */ unread_byte (c, in_stream, &badstatus); if (getpoint (&x, &y, in_stream, &badstatus, &margin) && !badstatus) /* N.B. getpoint returns w/o having read c only if c=0x00..0x1f, so there's no chance of a infinite loop (see parsetable) */ { if (current_page == requested_page || !single_page_is_requested) { if (plotter_open == false) begin_page (plotter); pl_fmarker_r (plotter, (double)x, (double)(y + YOFFSET), M_DOT, (double)DOT_SIZE); } cur_X = x; cur_Y = y; } break; /* SPECIAL POINT PLOT mode commands */ case CASE_SPT_POINT: /* SPT: point */ /* don't push back c (ignore intensity byte) */ if (getpoint (&x, &y, in_stream, &badstatus, &margin) && !badstatus) /* N.B. getpoint returns w/o having read c only if c=0x00..0x1f, so there's no chance of a infinite loop (see parsetable) */ { /* assume intensity is > 0 */ if (current_page == requested_page || !single_page_is_requested) { if (plotter_open == false) begin_page (plotter); pl_fmarker_r (plotter, (double)x, (double)(y + YOFFSET), M_DOT, (double)(DOT_SIZE)); } cur_X = x; cur_Y = y; } break; /* INCREMENTAL PLOT mode commands */ case CASE_PENUP: /* IPL: penup */ pen = PENUP; break; case CASE_PENDOWN: /* IPL: pendown */ pen = PENDOWN; break; case CASE_IPL_POINT: /* IPL: point */ x = cur_X; y = cur_Y; if (c & NORTH) y++; else if (c & SOUTH) y--; if (c & EAST) x++; else if (c & WEST) x--; if (current_page == requested_page || !single_page_is_requested) { if (pen == PENDOWN) { if (plotter_open == false) begin_page (plotter); pl_cont_r (plotter, x, y + YOFFSET); } else { /* N.B. Don't begin a new page just for a move() */ if (plotter_open == true) pl_move_r (plotter, x, y + YOFFSET); } } cur_X = x; cur_Y = y; break; /****************************************/ /* These switch the parsetable temporarily to one of three pseudo-states, while stashing the current state. */ case CASE_BES_STATE: /* Byp: an escape char */ Tparsestate = Tbestable; break; case CASE_BYP_STATE: /* set bypass condition */ Tparsestate = Tbyptable; break; case CASE_ESC_STATE: /* ESC */ Tparsestate = Tesctable; break; /*****************************************/ /* Cursor motion, useful mostly in ALPHA mode. Some of these restore the stashed state (if any) and some do not. */ case CASE_CR: /* CR */ cur_X = (margin == MARGIN1 ? 0 : TEK_WIDTH / 2); Tparsestate = curstate = Talptable; /* switch to ALPHA mode */ break; case CASE_BS: /* BS, cursor left */ Tparsestate = curstate; /* clear bypass condition if any */ { const struct Tek_Char *t; int x, l; x = (cur_X -= (t = &TekChar[fontsize])->hsize); if ((margin == MARGIN1 && x < 0) || (margin == MARGIN2 && x < TEK_WIDTH / 2)) { if ((l = (cur_Y + (t->vsize - 1)) / t->vsize + 1) >= t->nlines) { margin = !margin; l = 0; } cur_Y = l * t->vsize; cur_X = (t->charsperline - 1) * t->hsize; } } break; case CASE_TAB: /* HT */ Tparsestate = curstate; /* clear bypass condition if any */ /* FALL THROUGH */ case CASE_SP: /* SP, cursor right */ { const struct Tek_Char *t = &TekChar[fontsize]; int l; cur_X += t->hsize; if (cur_X > TEK_WIDTH) { l = cur_Y / t->vsize - 1; if (l < 0) { margin = !margin; l = t->nlines - 1; } cur_Y = l * t->vsize; cur_X = (margin == MARGIN1 ? 0 : TEK_WIDTH / 2); } } break; case CASE_LF: /* LF, cursor down */ { const struct Tek_Char *t; int l; t = &TekChar[fontsize]; if ((l = cur_Y / t->vsize - 1) < 0) { l = t->nlines - 1; if ((margin = !margin) != MARGIN1) { if (cur_X < TEK_WIDTH / 2) cur_X += TEK_WIDTH / 2; } else if (cur_X >= TEK_WIDTH / 2) cur_X -= TEK_WIDTH / 2; } cur_Y = l * t->vsize; } break; case CASE_UP: /* cursor up */ Tparsestate = curstate; /* clear bypass condition if any */ { const struct Tek_Char *t; int l; t = &TekChar[fontsize]; if ((l = (cur_Y + (t->vsize - 1)) / t->vsize + 1) >= t->nlines) { l = 0; if ((margin = !margin) != MARGIN1) { if (cur_X < TEK_WIDTH / 2) cur_X += TEK_WIDTH / 2; } else if (cur_X >= TEK_WIDTH / 2) cur_X -= TEK_WIDTH / 2; } cur_Y = l * t->vsize; } break; /****************************************/ /* Miscellaneous: functions we interpret as `next page', `set font size', and `set line type'. */ case CASE_PAGE: /* page function, clears bypass cond. */ /* do closepl to flush out page (if nonempty) */ if (plotter_open == true) end_page (plotter); if (single_page_is_requested && current_page == requested_page) { badstatus = 2; /* requested page is finished, so signal eof */ break; /* exit from while loop */ } /* now beginning parse of a new Tektronix page */ current_page++; /* special case: if only a single page is requested, and line mode and font size have changed due to commands on previous Tek pages, output them */ if (single_page_is_requested && current_page == requested_page) { if (linetype != 0) { if (plotter_open == false) begin_page (plotter); pl_linemod_r (plotter, linemodes[linetype]); } if (fontsize != 0) { if (plotter_open == false) begin_page (plotter); set_font_size (plotter, fontsize); } } cur_X = 0; cur_Y = TEKHOME; /* home pos. depends on fontsize */ break; case CASE_CHAR_SIZE: /* select font size */ fontsize = c & 03; if (current_page == requested_page || !single_page_is_requested) { if (plotter_open == false) begin_page (plotter); set_font_size (plotter, fontsize); } Tparsestate = curstate; break; case CASE_BEAM_VEC: /* select beam and vector types */ /* disregard beam type */ c &= 07; if (c != linetype) if (current_page == requested_page || !single_page_is_requested) { if (plotter_open == false) begin_page (plotter); linetype = c; pl_linemod_r (plotter, linemodes[linetype]); } Tparsestate = curstate; break; /****************************************/ /* Things we ignore. */ case CASE_OSC: /* do osc escape */ /* ignore all bytes up to and including first non-ascii byte (presumably BEL) */ do c = read_byte (in_stream, &badstatus); while (!badstatus && PRINTABLE_ASCII(c)); Tparsestate = curstate; break; case CASE_ANSI: /* parse an ANSI-style escape sequence */ { char ansi[BUFFER_SIZE]; /* buffer for escape sequence */ char type = 0; /* `type' (i.e. final byte) */ int i; /* length of arg bytes, incl. separators */ i = 0; for ( ; ; ) { c = read_byte (in_stream, &badstatus); if (badstatus) break; if ((c >= '0' && c <= '9') || c == ';' || (i == 0 && c == '?')) /* an arg byte, or a separator byte */ ansi[i++] = c; else { type = c; if (!(PRINTABLE_ASCII(type))) badstatus = 1; /* parse error */ break; } if (i == BUFFER_SIZE) { fprintf (stderr, "%s: error: an overly long ANSI escape sequence was encountered\n", progname); badstatus = 1; /* parse error */ break; } } Tparsestate = curstate; if (badstatus) break; if (i == 3 && (type == 'h' || type == 'l') && (ansi[0] == '?' && ansi[1] == '3' && ansi[2] == '8')) /* switch to Tek or VT100 mode, ignore */ break; if (i == 4 && type == 'm' && (ansi[0] == '0' || ansi[0] == '1') && ansi[1] == ';' && ansi[2] == '3' && ansi[3] >= '0' && ansi[3] <= '7') /* set ANSI foreground color */ { int intensity, color_index; if (plotter_open == false) begin_page (plotter); intensity = ansi[0] - '0'; color_index = ansi[3] - '0'; pl_pencolor_r (plotter, ansi_color[8 * intensity + color_index].red, ansi_color[8 * intensity + color_index].green, ansi_color[8 * intensity + color_index].blue); break; } } break; case CASE_IGNORE: /* Esc: totally ignore CR, ESC, LF, ~ */ break; /****************************************/ /* We interpret these as just restoring the stashed state (if any). */ case CASE_REPORT: /* report address */ case CASE_VT_MODE: /* special return to vt102 mode */ case CASE_BEL: /* BEL */ case CASE_COPY: /* make copy */ case CASE_CURSTATE: Tparsestate = curstate; /* clear bypass condition */ break; case CASE_ASCII: /* select ASCII char set */ /* ignore for now */ Tparsestate = curstate; break; case CASE_APL: /* select APL char set */ /* ignore for now */ Tparsestate = curstate; break; case CASE_GIN: /* do Tek GIN mode */ Tparsestate = Tbyptable; /* Bypass mode */ break; } } /* end parsing of this Tektronix stream */ if (plotter_open == true) /* close plotter, i.e. end page if any */ end_page (plotter); current_page++; /* bump page count for next file if any */ return (badstatus == 2 ? true : false); /* OK to end parse at EOF */ } void set_font_size (plPlotter *plotter, int new_fontsize) { if (use_tek_fonts) /* switch among Tektronix fonts (may not be available on all X servers) */ { switch (new_fontsize) { case 0: default: pl_fontname_r (plotter, "tekfont0"); break; case 1: pl_fontname_r (plotter, "tekfont1"); break; case 2: pl_fontname_r (plotter, "tekfont2"); break; case 3: pl_fontname_r (plotter, "tekfont3"); break; } } else /* we presumably are using a scalable font */ pl_ffontsize_r (plotter, (double)(TekChar[new_fontsize].hsize) / CHAR_WIDTH); } void begin_page (plPlotter *plotter) { if (pl_openpl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be opened\n", progname); exit (EXIT_FAILURE); } plotter_open = true; plotter_opened = true; /* set background color, set affine map from user frame to device frame */ pl_erase_r (plotter); pl_space_r (plotter, 0, 0, TEK_WIDTH - 1, TEK_WIDTH - 1); /* improve smoothness of plotted curves */ pl_joinmod_r (plotter, "round"); /* may be necessary if zero-length lines are to display as points */ pl_capmod_r (plotter, "round"); /* optionally initialize pen color, font, fontsize, line width */ if (pen_color) pl_pencolorname_r (plotter, pen_color); if (use_tek_fonts) pl_fontname_r (plotter, "tekfont0"); else { if (font_name) pl_fontname_r (plotter, font_name); else { if (!force_hershey_default) /* normal case */ { if (pl_havecap_r (plotter, "PS_FONTS") == 1) pl_fontname_r (plotter, DEFAULT_PS_FONT_NAME); else if (pl_havecap_r (plotter, "PCL_FONTS") == 1) pl_fontname_r (plotter, DEFAULT_PCL_FONT_NAME); else /* use Hershey font as a default */ pl_fontname_r (plotter, DEFAULT_HERSHEY_FONT_NAME); } else /* forced to use Hershey font as a default, even if other fonts are available (this happens for `-T hpgl'; see above) */ pl_fontname_r (plotter, DEFAULT_HERSHEY_FONT_NAME); } /* `large' is default size */ pl_ffontsize_r (plotter, (double)(TekChar[0].hsize) / CHAR_WIDTH); } if (line_width >= 0.0) pl_flinewidth_r (plotter, line_width * TEK_WIDTH); /* move to current position on page */ pl_move_r (plotter, cur_X, cur_Y + YOFFSET); } void end_page (plPlotter *plotter) { if (pl_closepl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); exit (EXIT_FAILURE); } plotter_open = false; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/Tektable.c�������������������������������������������������������������������0000644�0001750�0001750�00000050371�06453472144�014023� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* These are parse tables for a Tektronix 4014, almost identical to the parse tables in the source to xterm(1), which are dated 86/12/01. They are used by tek2plot. The only difference between these tables and the 1986 version is the inclusion of a CASE_ANSI state, which is used for parsing the ANSI-style escape sequences which some Tektronix emulators support. */ /* States here that correspond to the five basic Tektronix 4014 plotting modes are: ALPHA (ALP) PLOT (PLT) POINT (PT) SPECIAL POINT PLOT (SPT) INCREMENTAL PLOT (IPT) Other states corresponding to internal Tektronix states are: BES BYP ESC Additional states, namely (in alphabetical order) ANSI APL ASCII BEAM_VEC BEL BS CHAR_SIZE COPY CR CURSTATE GIN IGNORE IPL_POINT LF OSC PAGE PENDOWN PENUP PLT_VEC PRINT PT_POINT REPORT SP SPT_POINT TAB UP VT_MODE are simply advisory to the parser. */ #include "Tekparse.h" /* States corresponding to the five basic Tektronix plotting modes */ /* transition table for ALPHA mode (CASE_ALP_STATE) */ int Talptable[] = { /* NUL SOH STX ETX */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* EOT ENQ ACK BEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_LF, CASE_UP, /* NP CR SO SI */ CASE_IGNORE, CASE_CR, CASE_IGNORE, CASE_IGNORE, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* DC4 NAK SYN ETB */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* CAN EM SUB ESC */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_ESC_STATE, /* FS GS RS US */ CASE_PT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_SP, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* $ % & ' */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* ( ) * + */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* , - . / */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* 0 1 2 3 */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* 4 5 6 7 */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* 8 9 : ; */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* < = > ? */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* @ A B C */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* D E F G */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* H I J K */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* L M N O */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* P Q R S */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* T U V W */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* X Y Z [ */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* \ ] ^ _ */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* ` a b c */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* d e f g */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* h i j k */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* l m n o */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* p q r s */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* t u v w */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* x y z { */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_PRINT, /* | } ~ DEL */ CASE_PRINT, CASE_PRINT, CASE_PRINT, CASE_IGNORE, }; /* transition table for PLOT mode (CASE_PLT_STATE) */ int Tplttable[] = { /* NUL SOH STX ETX */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* EOT ENQ ACK BEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_LF, CASE_UP, /* NP CR SO SI */ CASE_IGNORE, CASE_CR, CASE_IGNORE, CASE_IGNORE, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* DC4 NAK SYN ETB */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* CAN EM SUB ESC */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_ESC_STATE, /* FS GS RS US */ CASE_PT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* $ % & ' */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* ( ) * + */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* , - . / */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* 0 1 2 3 */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* 4 5 6 7 */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* 8 9 : ; */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* < = > ? */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* @ A B C */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* D E F G */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* H I J K */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* L M N O */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* P Q R S */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* T U V W */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* X Y Z [ */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* \ ] ^ _ */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* ` a b c */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* d e f g */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* h i j k */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* l m n o */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* p q r s */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* t u v w */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* x y z { */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, /* | } ~ DEL */ CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, CASE_PLT_VEC, }; /* transition table for POINT mode (CASE_PT_STATE) */ int Tpttable[] = { /* NUL SOH STX ETX */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* EOT ENQ ACK BEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_LF, CASE_UP, /* NP CR SO SI */ CASE_IGNORE, CASE_CR, CASE_IGNORE, CASE_IGNORE, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* DC4 NAK SYN ETB */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* CAN EM SUB ESC */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_ESC_STATE, /* FS GS RS US */ CASE_PT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* $ % & ' */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* ( ) * + */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* , - . / */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* 0 1 2 3 */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* 4 5 6 7 */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* 8 9 : ; */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* < = > ? */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* @ A B C */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* D E F G */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* H I J K */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* L M N O */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* P Q R S */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* T U V W */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* X Y Z [ */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* \ ] ^ _ */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* ` a b c */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* d e f g */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* h i j k */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* l m n o */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* p q r s */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* t u v w */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* x y z { */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, /* | } ~ DEL */ CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, CASE_PT_POINT, }; /* transition table for SPECIAL POINT PLOT mode (CASE_SPT_STATE) */ int Tspttable[] = { /* NUL SOH STX ETX */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* EOT ENQ ACK BEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_LF, CASE_UP, /* NP CR SO SI */ CASE_IGNORE, CASE_CR, CASE_IGNORE, CASE_IGNORE, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* DC4 NAK SYN ETB */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* CAN EM SUB ESC */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_ESC_STATE, /* FS GS RS US */ CASE_PT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* $ % & ' */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* ( ) * + */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* , - . / */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* 0 1 2 3 */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* 4 5 6 7 */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* 8 9 : ; */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* < = > ? */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* @ A B C */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* D E F G */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* H I J K */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* L M N O */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* P Q R S */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* T U V W */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* X Y Z [ */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* \ ] ^ _ */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* ` a b c */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* d e f g */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* h i j k */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* l m n o */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* p q r s */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* t u v w */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* x y z { */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, /* | } ~ DEL */ CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, CASE_SPT_POINT, }; /* transition table for INCREMENTAL PLOT mode (CASE_IPL_STATE) */ int Tipltable[] = { /* NUL SOH STX ETX */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* EOT ENQ ACK BEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_LF, CASE_UP, /* NP CR SO SI */ CASE_IGNORE, CASE_CR, CASE_IGNORE, CASE_IGNORE, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* DC4 NAK SYN ETB */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* CAN EM SUB ESC */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_ESC_STATE, /* FS GS RS US */ CASE_PT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_PENUP, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* $ % & ' */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* ( ) * + */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* , - . / */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* 0 1 2 3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* 4 5 6 7 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* 8 9 : ; */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* < = > ? */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* @ A B C */ CASE_IGNORE, CASE_IPL_POINT, CASE_IPL_POINT, CASE_IGNORE, /* D E F G */ CASE_IPL_POINT, CASE_IPL_POINT, CASE_IPL_POINT, CASE_IGNORE, /* H I J K */ CASE_IPL_POINT, CASE_IPL_POINT, CASE_IPL_POINT, CASE_IGNORE, /* L M N O */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* P Q R S */ CASE_PENDOWN, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* T U V W */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* X Y Z [ */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* \ ] ^ _ */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* ` a b c */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* d e f g */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* h i j k */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* l m n o */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* p q r s */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* t u v w */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* x y z { */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* | } ~ DEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, }; /* Other states */ /* transition table for CASE_BES_STATE */ int Tbestable[] = { /* NUL SOH STX ETX */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_VT_MODE, /* EOT ENQ ACK BEL */ CASE_BYP_STATE, CASE_REPORT, CASE_BYP_STATE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_IGNORE, CASE_UP, /* NP CR SO SI */ CASE_PAGE, CASE_IGNORE, CASE_BYP_STATE, CASE_BYP_STATE, /* DLE DC1 DC2 DC3 */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* DC4 NAK SYN ETB */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_COPY, /* CAN EM SUB ESC */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_GIN, CASE_IGNORE, /* FS GS RS US */ CASE_SPT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* $ % & ' */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* ( ) * + */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* , - . / */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* 0 1 2 3 */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* 4 5 6 7 */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* 8 9 : ; */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* < = > ? */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* @ A B C */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* D E F G */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* H I J K */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* L M N O */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* P Q R S */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* T U V W */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* X Y Z [ */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* \ ] ^ _ */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* ` a b c */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* d e f g */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* h i j k */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* l m n o */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* p q r s */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* t u v w */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* x y z { */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, CASE_BYP_STATE, /* | } ~ DEL */ CASE_BYP_STATE, CASE_BYP_STATE, CASE_IGNORE, CASE_BYP_STATE, }; /* transition table for CASE_BYP_STATE */ int Tbyptable[] = { /* NUL SOH STX ETX */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* EOT ENQ ACK BEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_LF, CASE_UP, /* NP CR SO SI */ CASE_IGNORE, CASE_CR, CASE_IGNORE, CASE_IGNORE, /* DLE DC1 DC2 DC3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* DC4 NAK SYN ETB */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* CAN EM SUB ESC */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_BES_STATE, /* FS GS RS US */ CASE_PT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* $ % & ' */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* ( ) * + */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* , - . / */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* 0 1 2 3 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* 4 5 6 7 */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* 8 9 : ; */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* < = > ? */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* @ A B C */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* D E F G */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* H I J K */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* L M N O */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* P Q R S */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* T U V W */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* X Y Z [ */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* \ ] ^ _ */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* ` a b c */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* d e f g */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* h i j k */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* l m n o */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* p q r s */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* t u v w */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* x y z { */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, /* | } ~ DEL */ CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, CASE_IGNORE, }; /* transition table for CASE_ESC_STATE */ int Tesctable[] = { /* NUL SOH STX ETX */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_VT_MODE, /* EOT ENQ ACK BEL */ CASE_CURSTATE, CASE_REPORT, CASE_CURSTATE, CASE_BEL, /* BS HT NL VT */ CASE_BS, CASE_TAB, CASE_IGNORE, CASE_UP, /* NP CR SO SI */ CASE_PAGE, CASE_IGNORE, CASE_APL, CASE_ASCII, /* DLE DC1 DC2 DC3 */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* DC4 NAK SYN ETB */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_COPY, /* CAN EM SUB ESC */ CASE_BYP_STATE, CASE_CURSTATE, CASE_GIN, CASE_IGNORE, /* FS GS RS US */ CASE_SPT_STATE, CASE_PLT_STATE, CASE_IPL_STATE, CASE_ALP_STATE, /* SP ! " # */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* $ % & ' */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* ( ) * + */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* , - . / */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* 0 1 2 3 */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* 4 5 6 7 */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* 8 9 : ; */ CASE_CHAR_SIZE, CASE_CHAR_SIZE, CASE_CHAR_SIZE, CASE_CHAR_SIZE, /* < = > ? */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* @ A B C */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* D E F G */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* H I J K */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* L M N O */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* P Q R S */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* T U V W */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* X Y Z [ */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_ANSI, /* \ ] ^ _ */ CASE_CURSTATE, CASE_OSC, CASE_CURSTATE, CASE_CURSTATE, /* ` a b c */ CASE_BEAM_VEC, CASE_BEAM_VEC, CASE_BEAM_VEC, CASE_BEAM_VEC, /* d e f g */ CASE_BEAM_VEC, CASE_CURSTATE, CASE_CURSTATE, CASE_BEAM_VEC, /* h i j k */ CASE_BEAM_VEC, CASE_BEAM_VEC, CASE_BEAM_VEC, CASE_BEAM_VEC, /* l m n o */ CASE_BEAM_VEC, CASE_CURSTATE, CASE_CURSTATE, CASE_BEAM_VEC, /* p q r s */ CASE_BEAM_VEC, CASE_BEAM_VEC, CASE_BEAM_VEC, CASE_BEAM_VEC, /* t u v w */ CASE_BEAM_VEC, CASE_CURSTATE, CASE_CURSTATE, CASE_BEAM_VEC, /* x y z { */ CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, CASE_CURSTATE, /* | } ~ DEL */ CASE_CURSTATE, CASE_CURSTATE, CASE_IGNORE, CASE_CURSTATE, }; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257510�014346� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/README������������������������������������������������������������0000644�0001750�0001750�00000002447�06767005577�015167� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This directory includes a few files in Tektronix format. You may use them to test the `tek2plot' utility, which translates Tektronix files to other formats, or displays them on an X Window System display. Another source of Tektronix files is the SKYMAP astronomical display program (see http://tdc-www.harvard.edu/software/skymap ). In this directory, the file ocpred.tek contains a chart showing an astronomical event of 1986, prepared in 1985 at the Harvard-Smithsonian Center for Astrophysics. You may do: tek2plot -Tps --font-name HersheyGothicEnglish ocpred.tek > ocpred.ps to translate it to Postscript. The text will be rendered in HersheyGothicEnglish, which is an Old English font. HersheyGothicEnglish is not a fixed-width font, unlike the original Tektronix font. But if you add the `--position-chars' option on the command line, each character will be positioned individually, so as to match the position of the corresponding character in the original font. Similarly, you may do: tek2plot -Tps usmap.tek > usmap.ps to prepare a Postscript version of the USA map. You would use the `-T X' option, instead of `-T ps', to display the specified Tektronix file in a popped-up X window. To get a list of additional output formats that are supported by `tek2plot', type `tek2plot --help'. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/Makefile.am�������������������������������������������������������0000644�0001750�0001750�00000000532�10341763455�016321� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������tek2plotdatadir = $(datadir)/tek2plot tek2plotdata_DATA = README aitest.tek dmerc.tek fotest.tek imtesth.tek karney.tek ocpred.tek scale.tek skymap.tek skymap2.tek usmap.tek # files with nonstandard names in this directory EXTRA_DIST = aitest.tek dmerc.tek fotest.tek imtesth.tek karney.tek ocpred.tek scale.tek skymap.tek skymap2.tek usmap.tek ����������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/Makefile.in�������������������������������������������������������0000644�0001750�0001750�00000024451�11234210076�016324� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tek2plot/teksamples DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(tek2plotdatadir)" tek2plotdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(tek2plotdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tek2plotdatadir = $(datadir)/tek2plot tek2plotdata_DATA = README aitest.tek dmerc.tek fotest.tek imtesth.tek karney.tek ocpred.tek scale.tek skymap.tek skymap2.tek usmap.tek # files with nonstandard names in this directory EXTRA_DIST = aitest.tek dmerc.tek fotest.tek imtesth.tek karney.tek ocpred.tek scale.tek skymap.tek skymap2.tek usmap.tek all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tek2plot/teksamples/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tek2plot/teksamples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-tek2plotdataDATA: $(tek2plotdata_DATA) @$(NORMAL_INSTALL) test -z "$(tek2plotdatadir)" || $(MKDIR_P) "$(DESTDIR)$(tek2plotdatadir)" @list='$(tek2plotdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(tek2plotdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(tek2plotdatadir)/$$f'"; \ $(tek2plotdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(tek2plotdatadir)/$$f"; \ done uninstall-tek2plotdataDATA: @$(NORMAL_UNINSTALL) @list='$(tek2plotdata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(tek2plotdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(tek2plotdatadir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(tek2plotdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-tek2plotdataDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-tek2plotdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-tek2plotdataDATA installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-tek2plotdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/aitest.tek��������������������������������������������������������0000644�0001750�0001750�00000040227�04737544113�016270� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ 1,`g ],`g?C3`t0@$`z0@,cg-F,cj-F,`m-G,lo-G,lr-G,lu-G,mx-G,m{-G,j~-G-ka-G-kd-G-hg-H-ej-H-fm-H-gp-H-as-I-bv-I-cy-I-m{-J-n~-J.la-K.id-K.kg-K.ej-L.gm-L.ep-M.cs-M.av-N.lx-O.j{-O.h~-P/ga-P/bd-Q/`g-R/oi-R/jl-S/eo-T/dr-U/cu-U/nw-V/jz-W/e}-X0``-Y0lb-Z0he-[0gh-[0ck-\0km-]0gp-^0cs-_0hu.A0dx.B0`{.C0i}.D1e`.E1nb.F1ge.G1`h.I1hj.J1bm.K1ko.L1`r.N1it.O1cw.P1hy.R1b|.S1h~.U2ba.V2gc.W2ne.Y2`h.[2jj.\2ll.^2go._2jq/A2ls/C2cv/D2fx/F2iz/H2l|/J2`/L3ga/M3gc/O3je/Q3ng/S3ni/U3nk/W3bn/Y3cp/[3cr/]3`t0@,cg-F,cd-F,`a-G+d~-G+d{-G+dx-G+eu-G+er-G+jo-G+kl-G+ki-G+hf-H+mc-H+n`-H*o}-H*a{-I*bx-I*cu-I*er-J*fo-J*dl-K*ii-K*kf-K*mc-L*o`-L)m}-M)c{-M)ax-N)du-O)jr-O)ho-P)ol-P)bj-Q)`g-R)gd-R)ja-S(m~-T(l{-U(cy-U(fv-V(js-W(mp-X(`n-Y(dk-Z(hh-[(oe-[(cc-\(k`-]'o}-^'c{-_'hx.A'lu.B'`s.C'ip.D'mm.E'fk.F'oh.G'`f.I'hc.J'ba.K&k~.L&`|.N&iy.O&cw.P&ht.R&br.S&ho.U&bm.V&oj.W&fh.Y&`f.[&jc.\&da.^%o~._%j|/A%dz/C%cx/D%nu/F%is/H%dq/J%`o/L%ol/M%oj/O%jh/Q%ff/S%fd/U%fb/W%b`/Y$c~/[$c|/]$`z0@,ag2Y,ad2Y,`a2Y+d~2Y+d{2Y+dx2Y+gu2X+gr2X+jo2X+il2X+ii2X+hf2X+oc2W+n`2W*m}2W*c{2V*bx2V*au2V*gr2U*fo2U*dl2U*ki2T*if2T*oc2S*m`2S)o}2R)a{2R)cx2Q)du2Q)jr2P)ho2P)ml2O)bj2N)`g2N)ed2M)ja2L(o~2K(l{2K(ay2J(fv2I(js2H(op2G(`n2G(dk2F(hh2E(me2D(ac2C(i`2B'm}2A'a{2@'hx1_'lu1^'`s1]'kp1['om1Z'fk1Y'mh1X'`f1W'hc1V'ba1T&i~1S&`|1R&ky1P&aw1O&ht1N&br1L&ho1K&bm1I&mj1H&fh1F&`f1E&jc1C&da1B%m~1@%j|0^%dz0]%ax0[%nu0Y%ks0W%dq0V%`o0T%ml0R%mj0P%jh0N%ff0L%fd0J%fb0H%b`0F$a~0D$a|0B$`z0@,ag2Y,aj2Y,`m2Y,lo2Y,lr2Y,lu2Y,ox2X,o{2X,j~2X-ia2X-id2X-hg2X-gj2W-fm2W-ep2W-cs2V-bv2V-ay2V-o{2U-n~2U.la2U.kd2T.ig2T.gj2S.em2S.gp2R.as2R.cv2Q.lx2Q.j{2P.h~2P/ea2O/bd2N/`g2N/mi2M/jl2L/go2K/dr2K/au2J/nw2I/jz2H/g}2G0``2G0lb2F0he2E0eh2D0ak2C0im2B0ep2A0as2@0hu1_0dx1^0`{1]0k}1[1g`1Z1nb1Y1ee1X1`h1W1hj1V1bm1T1io1S1`r1R1kt1P1aw1O1hy1N1b|1L1h~1K2ba1I2ec1H2ne1F2`h1E2jj1C2ll1B2eo1@2jq0^2ls0]2av0[2fx0Y2kz0W2l|0V2`0T3ea0R3ec0P3je0N3ng0L3ni0J3nk0H3bn0F3ap0D3ar0B3`t0@,ag*O,aj*O,am*O,bp*O,bs*O,gv*O,dy*P,e|*P,f*P-db*Q-ee*Q-gh*Q-ek*R-gn*R-eq*S-gt*S-fw*T-ez*U-d}*V.g`*V.fc*W.ef*X.ai*Y.al*Z.ao*[.ar*\.au*].mw*^.nz*_.o}+@/h`+B/ic+C/ff+D/gi+E/al+G/co+H/mq+J/ot+K/iw+M/dz+O/b}+P0a`+R0lb+T0ke+U0gh+W0bk+Y0nm+[0jp+]0fs+_0nu,A0jx,C0g{,E0l},H1i`,J1bc,L1oe,N1eh,Q1nj,S1hm,V1bp,X1ir,[1cu,]1jw-@1`z-C1g|-E1o~-H2fa-K2jc-N2bf-Q2fh-T2jj-W2bm-Z2go-]2hq.A2ms.D2bv.G2`x.K2ez.N2k|.Q2i~.U3h`.Y3nb.\3md/@3lf/D3oh/G3oj/K3kl/O3kn/S3gp/W3gr/[3`t0@,ag*O,ad*O,aa*O+b~*O+b{*O+ow*O+lt*P+mq*P+nn*P+lk*Q+mh*Q+oe*Q+mb*R*o*R*m|*S*oy*S*nv*T*ms*U*lp*V*om*V*nj*W*mg*X*ae*Y*ab*Z)a*[)a|*\)ay*])ev*^)fs*_)gp+@)hm+B)ij+C)ng+D)od+E)ab+G(c+H(e|+J(gy+K(iv+M(ls+O(bq+P(an+R(dk+T(kh+U(oe+W(bc+Y(f`+['j}+]'nz+_'fx,A'ju,C'or,E'dp,H'im,J'bk,L'gh,N'me,Q'fc,S'h`,V&b~,X&i{,[&cy,]&jv-@&`t-C&oq-E&go-H&nl-K&jj-N&bh-Q&ne-T&jc-W&ba-Z%o~-]%h|.A%ez.D%bx.G%`v.K%ms.N%kq.Q%io.U%hm.Y%fk.\%ei/@%dg/D%ge/G%gc/K%ka/O$k/S$o}/W$o{/[$`z0@,cg5P,cd5P,ca5P+b~5P+b{5P+mw5P+lt5P+oq5O+nn5O+lk5O+oh5N+me5N+ob5M*m5M*o|5L*my5L*nv5K*os5J*lp5J*mm5I*nj5H*og5G*ce5F*cb5E)c5D)c|5C)cy5B)gv5A)fs5@)ep4_)hm4^)kj4\)ng4[)md4Z)cb4X(a4W(g|4U(ey4T(kv4R(ls4Q(bq4O(cn4M(dk4L(ih4J(me4H(bc4F(f`4D'j}4B'nz4@'fx3^'ju3\'mr3Z'dp3X'km3U'bk3S'eh3Q'oe3N'fc3L'h`3J&b~3G&k{3D&ay3B&jv2_&`t2]&mq2Z&eo2W&nl2T&jj2Q&bh2N&ne2K&jc2H&ba2E%m~2B%h|1_%gz1[%bx1X%`v1U%os1Q%iq1N%ko1J%hm1G%fk1C%gi0_%dg0\%ee0X%ec0T%ia0P$i0L$m}0H$m{0D$`z0@,cg5P,cj5P,cm5P,bp5P,bs5P,ev5P,dy5P,g|5O,f5O-db5O-ge5N-eh5N-gk5M-en5M-gq5L-et5L-fw5K-gz5J-d}5J.e`5I.fc5H.gf5G.ci5F.cl5E.co5D.cr5C.cu5B.ow5A.nz5@.m}4_/h`4^/kc4\/ff4[/ei4Z/cl4X/ao4W/oq4U/mt4T/kw4R/dz4Q/b}4O0c`4M0lb4L0ie4J0eh4H0bk4F0nm4D0jp4B0fs4@0nu3^0jx3\0e{3Z0l}3X1k`3U1bc3S1me3Q1gh3N1nj3L1hm3J1bp3G1kr3D1au3B1jw2_1`z2]1e|2Z1m~2W2fa2T2jc2Q2bf2N2fh2K2jj2H2bm2E2eo2B2hq1_2os1[2bv1X2`x1U2gz1Q2i|1N2k~1J3h`1G3nb1C3od0_3lf0\3mh0X3mj0T3il0P3in0L3ep0H3er0D3`t0@,bg'Z,gj'Z,gm'Z,hp'[,ls'[,nv'[,cz'[,e}'\-f`'\-ic']-kf']-ni'^-am'_-`p(@-gs(@-gv(A-ky(B-k|(C-o(D.lb(F.me(G.bi(H.`l(J.ao(K.gr(L.eu(N.dx(P.g{(Q.f~(S/ea(U/dd(W/dg(Y/dj([/dm(]/ep(_/es)A/cv)C/`y)F/a|)H/o~)J0ma)M0kd)O0jg)R0ej)U0`m)X0oo)Z0kr)]0gu*@0cx*C0oz*F0h}*J1e`*M1bc*P1ke*S1eh*W1oj*Z1em*^1`p+B1kr+E1bu+I1iw+M1`z+Q1d|+U1l~+Y2aa+]2ic,A2ne,E2`h,J2ij,N2ol,R2mn,W2cq,[2fs-@2du-E2hw-J2ky-N2k{-S2k}-X2k-]3ka.B3dc.H3ae.M3cg.R3lh.X3jj.]3dl/C3om/H3jo/N3aq/T3hr/Z3`t0@,bg'Z,oc'Z,o`'Z+h}'[+dz'[+fw'[+ct'[+mp'\+nm'\+ij']+kg']+fd'^+aa'_*`~(@*oz(@*ow(A*kt(B*kq(C*gn(D*dk(F*eh(G*be(H*`b(J)a(K)o{(L)mx(N)lu(P)or(Q)no(S)ml(U)li(W)lf(Y)lc([)l`(](m}(_(mz)A(cx)C(`u)F(ar)H(go)J(el)M(ki)O(jf)R(mc)U(`a)X'g~)Z'k{)]'ox*@'cv*C'gs*F'hp*J'mm*M'bk*P'kh*S'me*W'gc*Z'm`*^&`~+B&k{+E&by+I&iv+M&`t+Q&lq+U&do+Y&am+]&ij,A&fh,E&`f,J&ic,N&ga,R%e,W%c},[%nz-@%lx-E%hv-J%kt-N%kr-S%kp-X%kn-]%kl.B%lj.H%ai.M%cg.R%de.X%jc.]%la/C%g`/H$j~/N$a}/T$h{/Z$`z0@,bg8E,mc8E,m`8E+h}8E+dz8E+fw8D+at8D+op8C+nm8C+kj8B+ig8B+fd8A+ca8@*`~8@*mz7_*mw7^*it7]*iq7\*en7[*dk7Z*gh7X*be7W*`b7V)c7T)m{7S)ox7Q)lu7P)mr7N)no7L)ol7J)li7I)lf7G)lc7E)l`7C(o}7@(oz6^(ax6\(`u6Z(cr6W(eo6U(gl6R(ii6P(jf6M(oc6J(`a6H'e~6E'i{6B'mx5_'av5\'es5Y'hp5V'om5R'bk5O'ih5L'oe5H'ec5E'o`5A&`~4^&i{4Z&by4V&kv4R&`t4O&lq4K&do4G&cm4B&kj3^&fh3Z&`f3V&kc3Q&ea3M%g3H%a}3D%nz2_%lx2[%hv2V%it2Q%ir2L%ip2G%in2B%il1]%lj1X%ci1R%ag1M%de1H%jc1B%la0]%e`0W$j~0Q$c}0K$h{0F$`z0@,bg8E,ej8E,em8E,hp8E,ls8E,nv8D,az8D,g}8C-f`8C-kc8B-if8B-ni8A-cm8@-`p8@-es7_-ev7^-iy7]-i|7\-m7[.lb7Z.oe7X.bi7W.`l7V.co7T.er7S.gu7Q.dx7P.e{7N.f~7L/ga7J/dd7I/dg7G/dj7E/dm7C/gp7@/gs6^/av6\/`y6Z/c|6W/m~6U0oa6R0id6P0jg6M0gj6J0`m6H0mo6E0ir6B0eu5_0ax5\0mz5Y0h}5V1g`5R1bc5O1ie5L1gh5H1mj5E1gm5A1`p4^1ir4Z1bu4V1kw4R1`z4O1d|4K1l~4G2ca4B2kc3^2ne3Z2`h3V2kj3Q2ml3M2on3H2aq3D2fs2_2du2[2hw2V2iy2Q2i{2L2i}2G2i2B3ia1]3dc1X3ce1R3ag1M3lh1H3jj1B3dl0]3mm0W3jo0Q3cq0K3hr0F3`t0@,bg%J,jj%J,om%J,gq%J,it%K,bx%K,d{%L,j~%L-ab%M-de%N-oh%N-cl%O-ko%P-or%Q-`v%S-ey%T-n|%U.``%W.fc%X.hf%Z.oi%[.fm%].jp%_.ms&A.nv&C.bz&E.g}&G/h`&J/nc&L/of&N/bj&Q/dm&T/gp&V/fs&Y/jv&\/jy&_/j|'B/j'E0kb'H0ie'L0jh'O0hk'S0jn'V0eq'Z0dt'^0cw(A0oy(E0o|(I0k(M1gb(Q1`e(V1ng(Z1gj(^1am)C1ko)G1fr)L1mt)Q1dw)V1ly)[1d|*@1h~*E2`a*J2ec*O2ne*T2`h*Z2fj*_2dl+E2jn+J2mp+P2lr+V2ot+[2ov,A2ox,G2oz,M2h|,T2i~,Z3f`-@3cb-F3mc-M3ge-S3ag-Z3hh.A3cj.G3jk.N3nl.U3an.\3io/C3np/J3nq/Q3cs/X3`t0@,bg%J,jc%J,g`%J+o|%J+iy%K+bv%K+lr%L+jo%L+al%M+lh%N+ge%N+cb%O*k~%P*g{%Q*`x%S*mt%T*fq%U*`n%W*nj%X*hg%Z*gd%[*n`%])j}%_)ez&A)fw&C)bt&E)op&G)hm&J)fj&L)gg&N)bd&Q)l`&T(o}&V(nz&Y(jw&\(jt&_(jq'B(jn'E(kk'H(ih'L(je'O(hb'S'j'V'm|'Z'ly'^'cw(A'gt(E'gq(I'kn(M'ok(Q'`i(V'ff(Z'oc(^'aa)C&k~)G&n{)L&ey)Q&lv)V&dt)[&lq*@&ho*E&`m*J&mj*O&fh*T&`f*Z&nc*_&la+E%j+J%e}+P%d{+V%gy+[%gw,A%gu,G%gs,M%hq,T%io,Z%nm-@%cl-F%ej-M%oh-S%ag-Z%he.A%cd.G%jb.N%fa.U%a`.\$i~/C$f}/J$f|/Q$c{/X$`z0@,bg:U,jc:U,e`:U+m|:U+ky:T+bv:T+lr:T+jo:S+cl:R+lh:R+ee:Q+ab:P*i~:O*e{:N*`x:M*ot:K*fq:J*`n:I*nj:G*hg:F*ed:D*n`:B)j}:@)gz9^)fw9\)bt9Z)mp9X)hm9V)fj9S)eg9Q)bd9N)l`9L(m}9I(nz9F(jw9C(jt9@(jq8](jn8Z(ik8W(kh8S(je8P(hb8M'j8I'o|8E'ly8B'aw7^'et7Z'eq7V'in7R'mk7N'`i7J'ff7E'mc7A'ca6\&i~6X&n{6S&gy6N&lv6J&dt6E&lq6@&ho5[&`m5V&oj5P&fh5K&`f5F&nc5@&la4[%j4U%g}4O%d{4J%ey4D%ew3^%eu3X%es3R%hq3L%ko3E%nm2_%al2Y%gj2R%mh2L%cg2E%he1_%ad1X%jb1Q%fa1J%c`1C$k~0\$f}0U$f|0N$a{0G$`z0@,bg:U,jj:U,mm:U,eq:U,kt:T,bx:T,d{:T,j~:S-cb:R-de:R-mh:Q-al:P-io:O-mr:N-`v:M-gy:K-n|:J.``:I.fc:G.hf:F.mi:D.fm:B.jp:@.os9^.nv9\.bz9Z.e}9X/h`9V/nc9S/mf9Q/bj9N/dm9L/ep9I/fs9F/jv9C/jy9@/j|8]/j8Z0ib8W0ke8S0jh8P0hk8M0jn8I0gq8E0dt8B0aw7^0my7Z0m|7V0i7R1eb7N1`e7J1ng7E1ej7A1cm6\1io6X1fr6S1ot6N1dw6J1ly6E1d|6@1h~5[2`a5V2gc5P2ne5K2`h5F2fj5@2dl4[2jn4U2op4O2lr4J2mt4D2mv3^2mx3X2mz3R2h|3L2k~3E3f`2_3ab2Y3oc2R3ee2L3cg2E3hh1_3aj1X3jk1Q3nl1J3cn1C3ko0\3np0U3nq0N3as0G3`t0@,ag#@,mj#@,fn#@,cr#@,lu#A,jy#A,a}#B-l`#C-kd#C-ch#D-ok#E-ho#G-as#H-ov#I-ez#K-l}#M.ka#N.be#P.jh#R.fl#T.oo#V.ds#Y.nv#[.dz#^.o}$@/fa$C/id$F/ah$I/ik$L/nn$O/cr$R/iu$V/ox$Y/a|$]/d%A0kb%D0oe%H0oh%L0`l%Q0ao%U0fr%Y0du%^0fx&B0d{&G0g~&K1ca&P1cd&U1of&Z1ki&_1hl'E1ao'J1oq'O1it'U1cw'Z1ny(@1e|(F1m~(L2`a(R2ic(X2me(^2fh)D2kj)J2il)Q2on)W2mp)^2cs*D2bu*K2aw*R2mx*Y2lz+@2h|+G2e~+N3a`+U3ja+\3cc,C3hd,K3bf,R3hg,Z3nh-A3`j-I3gk-P3jl-X3im.@3hn.H3ho.P3kp.W3gq._3cr/G3or/O3hs/X3`t0@,ag#@,ec#@+n#@+c|#@+dx#A+jt#A+aq#B+dm#C+ki#C+cf#D+gb#E*h~#G*a{#H*gw#I*ms#K*dp#M*kl#N*bi#P*je#R*na#T)g~#V)lz#Y)fw#[)ls#^)gp$@)nl$C)ii$F)af$I)ib$L(f$O(c|$R(ix$V(gu$Y(ar$](ln%A(kk%D(gh%H(ge%L(`b%Q'a%U'n{%Y'lx%^'nu&B'lr&G'oo&K'cm&P'cj&U'gg&Z'kd&_'ha'E&a'J&g|'O&iy'U&cw'Z&ft(@&mq(F&eo(L&`m(R&ij(X&eh(^&ne)D&kc)J&ia)Q%g)W%e})^%c{*D%by*K%aw*R%eu*Y%ds+@%hq+G%mo+N%an+U%jl+\%ck,C%hi,K%bh,R%hf,Z%fe-A%`d-I%ob-P%ja-X%i`.@$h.H$h~.P$k}.W$o|._$c|/G$g{/O$hz/X$`z0@,cg<_,gc<_+n<_+a|<_+dx<_+jt<^+cq<]+dm<]+ii<\+af<[+eb_+af>^+`b>]*o}>[*my>Z*nu>X*nq>V*om>T*ni>R*me>P*la>N)m}>K)oy>H)cv>E)`r>C)gn=_)jj=\)if=Y)ob=U(`=R(i{=N(nw=J(bt=F(ip=B(`m<^(ji_-ah>^-`l>]-gp>[-et>Z-fx>X-f|>V.g`>T.fd>R.eh>P.dl>N.ep>K.gt>H.cx>E.`|>C.o=_/jc=\/ig=Y/gk=U/`o=R/ir=N/fv=J/bz=F/i}=B0`a<^0jdY180*ji=Q7bd=Q7bg=B200*hi;[7`d;[7`g;L220*ji:D7bd:D7bg9U240*hi8N7`d8N7`g7_260*ki6W7cd6W7cg6H280*ii5A7ad5A7ag4R300*ki3J7cd3J7cg2[320*ii1T7ad1T7ag1E340*hi/^7`d/^7`g/O 0*ki.G7cd.G7cg-X20*ii,Q7ad,Q7ag,B40*ki*Z7cd*Z7cg*K60*ii)D7ad)D7ag(U80*hi'N7`d'N7`g&_100*ji%W7bd%W7bg%H120*hi$A7`d$A7`g#R140*ji"J7bd"J7bg![160*hi T7`d T7`g E1800d.BP0f|4@0fh1PP+200f|4@1ga4@1kf4@1kk4@1lp4A1cv4@1g{4@2j`4@2me4@2dk4@2kp3_2av3_2k{3^3da3^3bg3]3nl3\3or3[3ox3Z3n~3Y4ae3X4hk3W4ar3U4ox3S4k3Q5jf3O5mm3M5cu3J5o|3G6jd3D6kl3@6cu2\6i}2X6i})K6cu)F6kl)B6hd(_5o|([5`u(Y5mm(V5hf(T4h(R4lx(P4ar(N4kk(L4ae(K3l~(J3lx(I3lr(H3ll(G3ag(F3fa(E2h{(E2av(D2hp(D2fk(C2me(C2h`(C1g{(B1cv(B1op(B1kk(B1kf(B1da(C0e|(C0bw(C0gr(C0am(D0bh(D0lb(E/o}(E/ix(F/ds(G/gn(G/ci(H/kc(I.g~(J.cy(K.hs(M.bn(N.kh(O.mb(Q-d}(S-kw(T-kq(V-hk(Y-ie([,k(],ey)@,mr)C,jl)F,cf)I+f)M+jx)Q+lq)V+oj)Z+lc*@*o|*E*`v*L*co*R*co1P*bv1W*o|1]+nc2C+oj2H+oq2M+hx2R+d2V,cf2Y,il2],mr3@,ey3C,h3F-je3H-kk3J-kq3L-kw3N-f}3P.mb3R.kh3S.an3U.js3V.cy3W.d~3Y/hc3Z/ci3Z/gn3[/fs3\/ix3]/l}3^0nb3^0`h3_0bm3_0gr3_0aw4@0f|4@/gt7US0js>O/j;_S-100js>O0jx>N0m}>M1`c>L1gh>J1im>I1lr>H1bx>F1d}>E2nb>C2ch>A2im>@2bs=^2kx=\2c~=Z3kc=X3gi=V3bo=T3`u=R3b{=O4`a=M4ag=J4em=G4ls=D4cz=@5l`<]5eg_.hf>^.hl>].dr>\.ax>[.m}>Z/ec>Y/mh>X/en>W/ms>V/dy>U/h~>T0lc>S0ci>Q0gn>P0js>O+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+ge*C+mr*B,kb*K,ih*F,mv*Q,iy*M,e|*U-gd*T-fd*_-gk+C-js*_-cr+G-lr+K.fe+Y.`o+Z.gw,K/l`,R/at,U/o,^0oe,^0jh,]0ln,R0lp,I0ln,E0mr,D0ot+\0dr+X0er+S0or+X0dv+Z0gv+T0ft+P0az+U0i{+U0h+R1be+N1ef+F1oi*^1om*Z1gm*X1`p*X1ds*T1`t*V1at*O1mr*Q1es*K1es*D1dv*A1dx)_1dv)_1ot)\1fo)[1do)Z1gv)Z1kw)\1ay)\1fx)Y1nt)P1kl)M1kp)G1gq)E+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+i`*M+ob*E+ad*@+ma)^+ge)Z+lh)V+em)S+ls)R+fy)P,hb)P,hc)T,hg)T,jg)P,hj)R,ki)V,`v)X,lx)X,hy)V-m`)U-dd)V-ii)U-lm)X-j|)Y.be)[.jm)[.nu)].l{)_/ic)^/jh)Y/dl)R/jp)N/aq)M/c})I0fe)P0if)O0ek)O0`n)R0ho)R0ap)O0et)O0lx)R0oz)G0b~)H1f`)J1cg)K1hl)I1hn)G1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1gq)E1ap)D1hn)A1hn(_1nt(Y2b`([2cb(X2ob(T2bb(L2hj(P2dn(P2ip(Q2ir(Q2kr(I2kp(G2ll(G2bj']2jj'Y2fn'W2kr'T2lz'T2n}'U3fb'U3jg'Y3fi'[3nj'[3oj'\3cj'\3jk'_3lj(C3kk(C3oj(E3gi(E3fi(H3gi(K3nj(J3bm(H3am(M3ln(N3fl(N3am(Q3am(U3oj(V3gl(X3ei(\3kd(\3eb(^2n})A2l})C3ia)D3lj)A3ep)@3et)B3hw)G3gy)I3k{)K3k|)M3f})L3e})O3a)O4n`)L4n`)N4gb)M4gc)M4ae)M4oe)M4gh)K4ig)M4ol)M4gh)M4me)O4dc)P4hg)R4ak)S4ko)T4ko)X4dp)Z4gp)T4br)Y4cr)Z4bt)[4bs)]4bs)]4`s)_4lt)_4at)^4nu)]4iz)^4f~*H5ba*H5bd*N5cb*M5ab*Q5ca*M4g~*I4e{*K4e~*O5b`*W5ca*V5bd*[5cf*Z5bf*Y5bh*Y5bf*W5bb*W5`b*V5`c*V5`d*P5`e*P5ah*M5ch*K5bk*N5ak*M5cj*K5`l*I5bm*J5cl*K5`n*P5`p*P5aq*M5bp*H5an*D5`l*A5bf)[5bk)_5ao*B5`q*E5`q*G5du*I5fu*N5et*Q5eu*U5gt*V5gt*Z5ly+C5o{+E5e+F6ib+F6oc+G6od+C6nc+A6`f+C6bf*_6kb*\6kb*X6cf*\6fg*_6eh+B6nk*Y6dn*Z6lp*V6br*W6jt*W6ou*T6dx*V7ea*O7`d*P7lc*M7gc*L7cc*L7kb*L7gb*L7na*L7fa*L7ba*L7i`*L7e`*L6m*L6e*L6`*L6h~*L6d~*L6l}*L6g}*K6nz*H6m~*B6e*B6i*B7b`*B7j`*B7ba*B7ja*B7bb*B7jb*B7bc*B7gc*B7oc*B7bd)L7nc)L7jc)L7fc)L7bc)L7bc)L7nb)L7fb)N7fb)L7ga)I7c`)I6o~)G6ky)K6kt)M6io)M6gk)I6nj)H6dh)E6he)G6ha)G5b~)H5d{)G5ly)G5cz)E5oz)E5my)D5ly)C5m{)B5b}(_5b~)@6n`(]6ed(^6dk(_6hl(V6`m(V6ho(P6np(N6fs(J6kt(E6gs(A6iy(B6e~(@6f}']6m~']6m~'Z7a`'\7ad'\7bd!_7lb!_7mb"B7mb"B7ac"B7ac"B7ec"B7ec"B7jc"B7nc"B7nc"B7bd"B7cd"C7oc"C7nc"C7jc"C7fc"C7fc"C7bc"C7mb"C7mb"C7ib"C7eb"C7eb"C7ab"C7la"C7da"C6k"B6h}"C6`|"E6a|"F6e}"G6n~"I6j}"I6`}"K6e~"L6a}"L6e{"M6d{"N6b}"M6`"O6g}"N6i|"O6g~"R6iy"P6`v"P6es"M6fp"I6io"I6gn"I6`n"H6eo"G6km"C6`l"C6gk"@6gj"@6fk"D6`m"F6kl"F6fk"F6jl"I6cn"J6il"K6kn"L6ko"N6ip"O6op"N6as"R6et"T6iu"T6iu"S6kv"V6iy"Z6a{"Z6k|"\6k}"\6e"Z7l`"\7j`"\7ad"^7cd#A7nc#A7jc#A7jc#A7ec#A7ec#A7ac#A7lb#A7lb#A7hb#A7hb#A7ja#A7ha#C6e#@6a#B6o#C7l`#D7da#F7ic#H7kc#I7oc#I7oc#I7`d#J7cd#V7jc#Y7bd#[7ob#_7`d$C7kb$C7da$C7lb$B7c`$A6j$D6c}$G6i{$I6b{$J6j|$J6e}$I6n~$I6e}$J6d}$L6b{$L6mz$N6n{$N6f$M7``$L7e`$M6n~$N6b|$O6iz$O6hz$Q6i|$R6j}$R6m~$S6k~$S6c}$R6f}$R6bw$S6dx$R6ou$R6du$R6ds$T6mp$W6ap$V6mm$U6jm$V6bo$W6ko$X6dn$Z6il$Z6lk$Y6nj$Y6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6jb$W6ja$U5j}$W5o|$X5g}$Y5n}$Y5i~$X5g$X5h$X6ba$W6ia$X6jb$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6fg$W6mf$V6`d$U6nf$U6lf$S6ke$R6be$S6`c$S6hb$U6bb$U6fc$W6fg$W6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6on$X6kn$W6ml$W6al$X6fm$Y6on$X6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6`p$S6ho$R6cm$R6gi$T6di$V6lj$V6`n$T6`p$S6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6ds$R6gs$P6cq$P6aq$Q6ko$P6io$Q6hp$R6ds$R6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6bz$O6kt$O6aw$Q6nw$P6ex$Q6bz$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6mu$O6hv$N6mu$M6ht$N6es$M6`q$N6cp$O6ht$P6it$O6mu$O6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6`|"_6ky"\6dz#A6b{#@6nz"_6`|"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6dx"_6`y"]6bx"\6ix"[6ev"[6ew"Z6ou"X6gs"X6at"Z6hr"Z6iu"]6mu"]6nu"^6`w#@6aw"^6dx"_6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6`h!]6mg!^6fi!_6hh"A6oj!_6mj!^6`h!]6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6od!Y6`f!X6ke!V6jd!W6gb!T6fc!U6od!Y6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6`d!T6kc!T6`a!R6kc!R6`d!T6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P6k`!P5e~!O6a`!O6c`!P6k`!P6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6c`!N6d`!N5e!M5g!M6c`!N5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5f~!H5a~!G5i}!H5a~!I5f~!H5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5g}!F5k|!F5i|!E5b}!D5g}!F5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5f!D5g!C5k|!A5k|!C5f!D5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5h| ]5fz [5k{ ]5h| ]5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5m{ [5`{ Z5hz Z5j{ [5m{ [5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5m{ Y5e{ X5dz Y5m{ Y5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5oz?E5fz?E5oy?F5my?G5oz?E5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5c|?@5n{?@5k{>]5mz>_5j{?@5c|?@7ad!V7bd!V7nc!V7oc!V7lc!W7lc!W7ic!W7jc!W7jc!W7gc!W7gc!W7dc!X7ec!X7ac!X7bc!X7cc!X7cc!X7lb!Y7mb!Y7mb!Y7`d![6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6jy$N6gy$L6kz$L6gz$J6`y$K6cy$I6lv$K6`v$R6ex$L6mv$O6jy$N5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5lz+G5my+D5iv+B5er+@5an*\5an*^5ak*\5aj*\5`j+E5`i+E5ai+F5`j+G5bj+H5cg+E5`g+G5bj+J5cf+K5cf+M5ak+O5cm+M5`k+K5co+M5`o+K5er+M5fs+H5gr+E5dt+G5du+E5ds+C5lz+G5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5`h*P5af*O5ae*Q5be*R5`d*T5`f*V5af*Q5`h*P2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2ct(V2bt(Y2nt(Y2gv(\2iu(^2hr)G2bq)H2no)L2gn)I2`o)T2aq)O2mq)O2nw)A2nw([2ct(V2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2bg)H2ff)H2ie)K2je)N2ff)N2ng)L2ng)J2bg)H2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2cj*G2kh*G2og*I2ei*K2aj*K2jj*J2cj*G2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2gk)R2cj)R2kh)T2hh)Z2cg)Z2ih)\2aj)\2jj)]2ei)^2di*C2gk*C2gn)\2gn)V2ll)X2hj)X2kj)V2gk)R1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1hn)G1go)E1em)B1ck)C1jj)A1hl)A1nk(_1fm(]1kl(\1mm(\1gm(Z1mm(Z1in(Z1lr(V1gq(V1or(T1ct(T1`t(T1hu(T1jy(N1ez(O1n{(N1`{(N1l{(I1`}(G1h|(E2ic'^2nb']2ic'\2fd'[2nb'Y2lb'T2ke'K2ih'I2kh'G2kj'C2dk'C2`l'A2bo&]2fs&_2`t&_2dv&_2g|&X2d|&X2l}&X2j~&U2f&U2g&T3``&T3ka&T3ha&T3eb&S3cc&R3id&Q3af&O3nj&L3fp&J3bq&H3oq&G3oq&E3dl&G3ig&K3kd&K3`c&N3ha&N3ja&N2i~&O2o}&P2mz&Q2h{&R2ey&S2ow&R2lw&R2c}&K3o`&K3cc&I3eb&I3fe&D3de&G3bf&F3hg&G3gi&E3gi&E3ik&B3am&B3lr%_3av%^3dx%]3oz%X3lz%V3d}%V4o`%R4gb%R4ec%Q4oe%P4`e%R4hf%R4kg%R4ig%Q4kf%P4dh%N4ak%M4im%M4jn%L4fp%L4`r%N4iw%K4e}%M5`d%N5ae%M5bf%N5bi%L5`m%L5bm%N5bk%N5ak%O5ai%O5cj%P5ao%Q5ap%O5er%O5bq%N5bq%L5dr%N5du%N5eu%M5es%M5ds%L5du%L5jw%J5gu%I5jv%F5iw%I5kw%C5oy%C5m{%B5f%D5d%A6lc$_6jb$]6af$\6fg$]6gg$Z6eh$Z6bm$]6nj$Y5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5bn%N5an%M5bp%H5bq%F5fr%F5hv%A5hw%A5iw%B5fu%F5et%I5fr%J5ap%M5bn%N4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4fq&L4gp&K4fq&J4br&J4cs&I4ct&I4bs&J4ct&K4fq&L4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4d})P4jz)N4ky)I4hy)E4kz)E4f|)H4g|)I4e{)K4f})L4d~)P4d})P4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4cw)E4mt)B4bt)A4as)@4ar(\4as(\4bs([4ct(Z4mt(\4bt(]4nt(_4lv)A4`v)C4lv)C4cw)E5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5cg(I5lf(G5ch(G5hg(G5cg(E5gg(C5ci(E5bj(F5`k(I5al(J5cn(J5jn(L5cm(K5cn(L5am(M5hn(N5mo(M5`p(N5kn(P5ao(Q5bo(R5bl(S5kk(T5`l(V5bj(W5kf(V5ce(X5be(_5bd(_5bd)A5bb)A5`b)C4d~)C4f~)A5`a)@5`a(_4e~(_4ky(^4kx(\4g|(\4f|([4g{(Z4e{(Z4f~([5b`([5ba(Z5ia(Y5kb(V5ab(U5ca(U4h(T5h`(T4g}(R4lv(S4at(Q4`t(P4nv(N4d{(P4e|(O5aa(Q4h}(N5a`(O5jc(P5hc(R5hb(R5ad(S5ed(U5gc(V5ed(X5ke(V5ae(U5ef(U5if(S5`f(R5ff(O5eg(M5ii(O5ei(M5bh(K5cg(I5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5gu'V5hv'X5k{'W5b}'V6e`'U6kb'T6dc'T6ld'T6be'U6jf'U6af'S6bg'S6gg'T6fh'S6gg'R6ge'R6af'P6ia'O6da'R6f`'P6a`'Q5j{'S5i}'T5b{'U5oy'T5mz'V5oy'V5hx'V5gw'V5gu'V6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6cb'J6`a'K5k'K6i`'L5d~'M5e'N5j}'N5e}'M5a{'M5gz'O5jy'P5mw'P5`v'R5ot'Q5lt'S5mu'S5ow'R5nw'Q5kx'Q5mz'P5h}'P5e{'O5d}'O5f~'O6d`'O6ma'M6cb'J7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7m`&]7jb&W7fa&W7o`&U7hb&V7nb&T7a`&Q6c&P6`~&N6e}&R6i~&R6o&T6f&U6n&X7f`&X7g`&[6m&\7m`&]2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2ik"V2bl"W2cl"X2ao"W2`o"V2dn"V2im"U2bl"U2ik"V2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2mo"T2jp"S2bq"S2`q"T2kp"T2mo"U2mo"T2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2mq"R2jq"R2hq"T2lq"T2br"R2mq"R2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2`r"O2lr"O2nr"P2fr"P2`r"O2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2gt"J2lt"K2ht"L2ct"K2gt"J/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/hg?D/kg?C/`g?C/jg?B/eg?A/de?@/fd?@/ed?A/ed?C/me?D/bg?D/hg?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-bi?D-li?C-ji?A-kg>_-`h>_-ch>]-`l>]-ol>[-dj>\-mj>[-cl>Z-om>Y-fp>Y-`q>X-as>V-cs>T-op>U-oo>U-el>X-nl>Y-ok>Y-ek>Y-lh>Z-bg>Y-ad>Y-eb>W-ba>W-o`>X,c>Z,h{>Z,hz>[,f|>]-`a?@-fa>_-ac?@-mb?A-`d?B-nd?A-de?C-eg?D-ah?D-bi?D,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,cy>W,j{>W,k{>V,c}>V,c|>T,g}>T,j}>S,l~>T,c~>R,g|>R,iz>P,mx>P,gt>L,fr>I,mp>G,io>G,lm>F,il>D,kj>B,lh>C,mh>E,ji>E,fh>F,nh>G,bh>J,hi>N,en>P,mo>P,gq>Q,fr>T,cs>T,ds>T,`t>T,mv>V,cy>W,kwI+fi>I*f>I+fd>I+dd?H+di?H*d?H+dd?H+dd?H+gd5U,cc5U,cc5Z,cc5P,cc5U-ka5U-ka5Z-ka5P-ka5U.g`5U.g`5Z.g`5P.g`5U.o~5U.o~5Z.o~5P.o~5U/k}5U/k}5Z/k}5P/k}5U0c|5U0c|5Z0c|5P0c|5U1oz5U1oz5Z1oz5P1oz5U2gy5U2gy5Z2gy5P2gy5U3cx5U3cx5Z3cx5P3cx5U4kv5U4kv5Z4kv5P4kv5U4kv5U+gd5U+ed4W*e4W+ei4W+ed4W+fd3X*f3X+fi3X+fd3X+dd2Z*d2Z+di2Z+dd2Z+ed1[*e1[+ei1[+ed1[+gd0\*g0\+gi0\+gd0\+dd/^*d/^+di/^+dd/^+fd._*f._+fi._+fd._+gd.@*g.@+gi.@+gd.@+ed-B*e-B+ei-B+ed-B+fd,C*f,C+fi,C+fd,C+fd,C+gd5U*oe5U*oe5P*oe5Z*oe5U)cg5U)cg5P)cg5Z)cg5U(kh5U(kh5P(kh5Z(kh5U'oi5U'oi5P'oi5Z'oi5U&gk5U&gk5P&gk5Z&gk5U%kl5U%kl5P%kl5Z%kl5U$cn5U$cn5P$cn5Z$cn5U#go5U#go5P#go5Z#go5U"op5U"op5P"op5Z"op5U!cr5U!cr5P!cr5Z!cr5U!cr5U4kv5U4k{5PN+fd,C*hl,FE!cr5U cy5PS+dd?H*hl>YW%`o @,cc5U,nb5T,nb5S,mb5R,ib5Q,db5P,`b5O,oa5M,ka5L,fa5K,o`5J,k`5I,``5I+h5H+`5G+h~5F+a~5E+j}5D+c}5C+g|5B+h{5B+a{5A+fz5@+ky4_+lx4_+bx4^+gw4]+iv4]+ju4\+lt4\+bt4[+ds4[+fr4Z+dq4Z+fp4Y+eo4Y+kn4X+fm4X+el4X+`k4X+cj4W+nh4W+mg4W+if4W+ie4W+ed4W+ac4W+ab4W+m`4W*n4W*k~4W*h}4X*e|4X*f{4X*cz4X*ey4Y*fx4Y*hw4Z*jv4Z*hu4[*jt4[*ls4\*bs4\*dr4]*gq4]*jp4^*lo4_*co4_*fn5@*im5A*`m5B*gl5B*nk5C*bk5D*ij5E*`j5F*ki5F*ci5G*kh5H*ch5I*og5J*fg5K*cg5L*of5M*hf5O*df5P*af5Q*me5R*ne5S*ne5T*oe5U*le5W*le5X*me5Y*af5Z*ff5[*jf5\*of5]*cg5^*dg6@*og6@*og6@*ch6A*jh6B*bi6C*ji6D*bj6E*ij6F*`k6G*kk6G*gl6H*bm6I*im6J*dn6K*co6K*no6L*hp6M*gq6M*ar6N*`s6O*ns6O*ht6P*fu6P*dv6Q*fw6Q*dx6R*ey6R*cz6R*d{6S*e|6S*j}6S*k~6S*l6T+m`6T+ab6T+ac6T+fd6T+ie6T+if6T+mg6T+lh6T+cj6S+bk6S+el6S+dm6S+kn6R+eo6R+dp6R+bq6Q+`r6Q+bs6P+`t6P+nt6O+hu6O+fv6N+gw6M+`x6M+nx6L+ky6K+dz6K+a{6J+j{6I+g|6H+l|6H+h}6G+a~6F+j~6E+c6D+k6C,c`6B,k`6A,o`6@,da6@,ka5^,oa5],bb5\,fb5[,ib5Z,mb5Y,lb5X,lb5W,cc5U$`l?@$`l?J$`l?E%`u?E%`u?@%`u?J%`j9Y 0.1"$`t9Y 2148 km#`v9YStar position#``9Yin sky plane"`j9YFrom 2:40: 0!`t9YEach 0: 1: 0+fd,C+fi,RSUN->.ke7[.di7[.na7\.ke7[-k{8@SAA.ke7[.`b7L.me7K-g~7L.`b7L-h~6\.eb6[-oz6\-h~6\-lz6L-i~6K-cw6L-lz6L-dw5\-a{5[-ks5\-dw5\-ms5L-jw5K-`p5M-ms5L-ap4\-ns4[-dl4]-ap4\-il4L-fp4K-lh4M-il4L-ai3\-nl3[-de3]-ai3\-fe3L-ci3K-ia3M-fe3L-na2\-ke2[,a~2]-na2\,b~2L-oa2K,ez2M,b~2L,kz1\,d~1\,nv1],kz1\,cw1L,lz1L,fs1M,cw1L,ds0],aw0\,ko0],ds0],lo0M,is0L,cl0M,lo0M,dl/],ap/\,kh/],dl/],ih/M,fl/L,ld/N,ih/M,ae.],nh.\,da.^,ae.],fa.M,ce.L+i}.N,fa.M+n}-],ka-\+az-^+n}-]+gz-M+`~-M+jv-N+gz-M+kv,]+dz,]+nr,^+kv,]+`s,N+mv,M+go,N+`s,N7lv @May 4 1986 Occultation of nepklem 1026 by Triton (N1)7h` @Observed from SAAO Sutherland 74" Long= -20 48 44.3 Lat= -32 22 43.46dj @13.11-magnitude star at RA= 18h 24m 16.1231s Dec=-22d 13' 22.807" 5`t @ (1950) RA= 18h 22m 5.3070s Dec=-22d 14' 27.910" 4l} @Closest at 2:45:30 U.T. 4hg @ Radial= 4158.7 km = 0.19"3dq @ Planet= 1600.0 km = 0.07"2`{ @ ET - UT = 56.1709 sec DE-1182ld @ P.A.= 12.7 deg.1hn @ Phase = 1.5 deg = 100.0%0dx @ Alt= 75 d, Az= -36 d0`b @ Sun alt=-30 d, Az= 90 d/lk @ Sun:127.8 d, Moon: 11.9 d.hu @ V =0.0007 "/s = 14.22 km/s-d @ D = 29.619079 A.U.-`i @Doug Mink 16: 4 Nov 11 1985-`i @ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/scale.tek���������������������������������������������������������0000644�0001750�0001750�00000031457�05302021635�016057� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������84f`!X3bq!X4e`!Y3aq!Y4e`!T3n{!S4f`!S4e`!^3m{!^4f`!]3aq!V3bq![3nv"B3mv"K3ex"K3ny"J3kz"I3b{"H3a{"F3hz"D3by"B3lv"B3du"B3fs"B3lq"D3aq"F3cq"G3oq"I3es"K3nv"J3by"J3kz"I3a{"F3kz"D3ay"C3nv"B3fu"B3es"C3oq"D3aq"F4d`"Q3`q"Q4g`"Q3cq"Q3`{"Y3ct"Q3nv"U3cq"Y3ov"T3`q"Y4d`"O4g`"Q3c{"V3a{"[3`q"O3`q"T3cq"V3aq"[4e`#@3at#@3lq#A3bq#B3cq#C3mq#E3ds#F4d`#A3`t#A3oq#A3bq#B3`{"^3c{#C3`{#K3`q#K3c{#K3cq#K3ov#K3by#L3hz#N3b{#O3b{#Q3iz#R3my#R3by#Q3oy#P3jz#Q3`{#I3c{#K3`q#I3`q#N3a{#Z3hz#X3by#V3lv#V3du#V3fs#V3lq#X3aq#Z3cq#[3oq#]3es#_3du$@3lv$@3ay#_3kz#]3c{#[3a{#Z3a{#Z3kz#X3ay#W3nv#V3fu#V3es#W3oq#X3aq#Z3cq#[3lq#]3fs#^3eu#_3mv#_3by#^3hz#]3c{#[3c{$E3cq$E3b{$F3bq$F3by$F3hz$H3`{$J3b{$K3kz$M3by$N3bq$N3b{$K3hz$M3cy$M3cq$M3b{$C3b{$F3bq$C3cq$H3bq$K3bq$P4g`$U3h$U3o~$U3j$V4g`$U3c{$U3cq$U3b{$V3bq$V3b{$S3b{$V3bq$S3bq$X3`{$]3cq%D3b{$]3bq%E3b{%E3`q$]3b{$[3c{$_3c{%B3`{%G3bq$[3cq$_3cq%B3`q%G3`q%W4f`%Z3bq%Z4e`%[3aq%[3ay%[3kz%\3c{%^3a{&@3jz&B3ay&C3aq&C3a{&@3kz&A3by&B3bq&B4e`%X4e`%[3aq%X3bq%]3aq&@3aq&E3ny&J3by&J3cy&I3oy&I3jz&J3c{&K3c{&N3iz&P3ly&Q3fx&Q3fs&Q3mq&R3`q&S3ly&Q3ds&Q3nq&Q3`q&S3cq&S3dx&Q3iw&P3ov&K3cv&I3ht&I3ds&I3oq&I3cq&K3`q&N3nq&O3ds&Q3ov&K3bv&J3kt&I3gs&I3nq&J3cq&K3c{&X3cq&X3b{&Y3bq&Y3nv&Y3ay&Z3kz&[3a{&]3a{&_3hz'@3ly'@3ay&_3ny&^3iz&_3c{&V3b{&Y3cq&V3cq&[4e`'L3aq'L4d`'M3`q'M3ay'L3hz'K3b{'I3`{'H3kz'E3by'D3ov'C3gu'C3fs'D3oq'E3`q'H3bq'I3lq'K3es'L3`{'H3jz'F3`y'E3nv'D3fu'D3ds'E3nq'F3`q'H4e`'J4d`'M3aq'L3aq'O3`q'_3`y(J3ex(I3hw(J3gx(J3cy(J3iz(I3c{(G3b{(E3jz(C3`y(B3mv(A3eu(A3ds(B3nq(C3bq(E3`q(G3mq(I3gs(J3b{(E3iz(D3cy(B3lv(B3du(B3gs(B3mq(D3bq(E3a{(S3iz(Q3cy(O3lv(O3du(O3gs(O3mq(Q3aq(S3cq(T3lq(W3fs(X3du(Y3lv(Y3by(X3hz(W3c{(T3a{(S3a{(S3hz(R3by(P3ov(O3gu(O3fs(P3lq(R3aq(S3cq(T3mq(V3gs(W3fu(X3nv(X3cy(W3iz(V3c{(T3`{(_3`l(_3b{(_3bl(_3by(_3hz)A3b{)B3`{)D3hz)F3by)G3mv)H3eu)H3fs)G3lq)F3`q)D3bq)B3lq)A3fs(_3`{)D3jz)E3cy)F3nv)G3fu)G3gs)F3nq)E3`q)D3c{(\3b{(_3cl(\3cl)A3a{)M3cq)Q3`{)N3kr)Q3`{)V3cq)Q3an)P3ol)N3al)M3bl)L3ll)L3jm)L3ml)M3`{)L3a{)P3`{)S3b{)W3bq*F3ly*P3c{*P3gx*P3ly*P3iz*O3c{*M3`{*K3jz*I3oy*H3gx*H3jw*I3lv*K3fu*N3ht*P3ct*P3cy*H3fx*I3hw*K3bv*N3du*P3kt*P3kr*P3lq*P3bq*N3cq*K3mq*J3jr*I3ct*H3cq*H3jr*I3cy*]3dx*]3kw*]3fx*^3by*^3hz*]3b{*[3b{*Y3iz*W3cy*U3lv*U3du*U3gs*U3mq*W3bq*Y3cq*Z3lq*]3fs*^3b{*Y3hz*X3by*V3ov*U3gu*U3fs*V3lq*X3bq*Y3my+D3ay+D3by+C3ny+C3iz+D3c{+E3b{+H3hz+J3oy+J3fx+K3fs+K3mq+L3`q+M3oy+J3gs+J3nq+K3`q+M3bq+M3gx+J3hw+J3ov+E3bv+C3kt+B3gs+B3nq+C3cq+E3cq+G3mq+I3gs+J3ov+E3av+D3jt+C3fs+C3mq+D3cq+E4g`+R3cq+R4f`+S3bq+S4f`+P4f`+S3bq+P3bq+U4f`+Z3h+Z3n~+Z3i+[4f`+Z3b{+Z3bq+Z3a{+[3aq+[3b{+X3a{+[3bq+X3bq+]3b{,B3bq,B3a{,C3aq,C3ay,C3kz,D3`{,G3a{,H3jz,J3ay,K3aq,K3a{,H3kz,I3by,J3bq,J3b{,@3a{,C3bq,@3bq,E3aq,H3bq,M3b{,T3iz,S3ny,R3gx,Q3ov,Q3fu,R3it,S3bt,T3`t,V3jt,W3eu,X3lv,Y3dx,Y3my,X3jz,W3`{,V3b{,T3iz,S3by,R3bv,R3it,S3jt,W3av,X3ay,X3jz,W3my,X3hz,Y3b{,Z3jz,Z3hz,Y3fu,R3kt,Q3ds,Q3hr,Q3cq,Q3dp,T3fp,W3ko,Y3nn,Z3hr,Q3oq,Q3`q,T3bq,W3gp,Y3nn,Z3bn,Z3ol,Y3bl,W3al,S3ll,Q3an,P3mn,P3dp,Q3aq,S3`q-K4f`-N3bt-N3mq-O3cq-P3aq-R3oq-S3fs-T4e`-O3at-O3lq-P3cq-P3b{-L3a{-R3ov-X3nv.A3fx.A3oy.@3hz.@3b{-^3a{-\3iz-Z3cy-X3lv-X3du-X3gs-X3mq-Z3aq-\3cq-]3lq.@3fs.A3ov.@3cy.@3hz.@3a{-\3hz-[3by-Y3ov-X3gu-X3fs-Y3lq-[3aq-\3a{.G3aq.G3`{.H3`q.H3`y.H3iz.I3b{.K3`{.M3hz.O3cy.O3cq.O3`{.M3jz.N3`y.O3`q.O3cy.O3iz.Q3b{.S3`{.U3hz.W3cy.W3cq.W3`{.U3iz.V3`y.W3`q.W3`{.E3`{.H3`q.E3`q.J3`q.M3`q.R3`q.U3`q.Z3`{._3`l._3c{._3cl._3cy._3iz/A3b{/B3`{/D3iz/F3cy/G3nv/H3fu/H3gs/G3mq/F3`q/D3bq/B3mq/A3gs._3`{/D3jz/E3`y/G3ov/G3gu/G3ds/G3nq/E3`q/D3c{.\3c{._3cl.\3`l/B4e`/N3aq/N4d`/O3`q/O4d`/L4d`/O3`q/L3`q/Q3ly/V3`y/V3by/U3ny/U3hz/V3b{/W3b{/Z3hz/\3ny/\3ex/]3es/]3lq/^3cq/^3ny/\3fs/\3mq/]3cq/^3bq/_3fx/\3hw/\3nv/W3bv/U3kt/T3gs/T3nq/U3bq/W3cq/Y3mq/[3fs/\3nv/W3`v/V3jt/U3fs/U3lq/V3bq/W4f`0D3bt0D3mq0E3cq0F3aq0H3nq0I3es0J4e`0E3at0E3lq0F3cq0F3b{0B3a{0H3ov0N3mv0W3ex0W3ny0V3hz0V3b{0T3a{0R3hz0P3cy0N3lv0N3du0N3gs0N3lq0P3aq0R3cq0S3lq0V3es0W3nv0V3by0V3hz0V3a{0R3kz0P3by0O3ov0N3gu0N3fs0O3oq0P3aq0R: `` @ `` Y `y Y `y @ `` @!di!A!dh!@!lf _!ld ^!fb ]!f` ] l} ^ l{ _ dz!@ dy!A!dh!@!df _!nd ^!db ^!d` ^ n} ^ d| _ dz!@!fe!E!ne!F!dg!H l|!H!nf!G n|!G n|!E l|!J!dg!Q!nf!O!fe!N!lb!N!da!N n~!N f}!O l|!Q l|!R f}!S n~!T!da!U!lb!U!fe!T!nf!S!dg!R!dg!Q!dg!Q!lf!P!ff!O!de!O!nb!N!fa!N l~!O n}!O d}!P l|!Q l|!R d}!S n}!S l~!T!fa!T!nb!T!de!T!ff!S!lf!S!dg!R!dg![!nf!Y!fe!X!lb!X!da!X n~!X f}!Y l|![ l|!\ f}!] n~!^!da!_!lb!_!fe!^!nf!]!dg!\!dg![!dg![!lf!Z!ff!Y!de!Y!nb!X!fa!X l~!Y n}!Y d}!Z l|![ l|!\ d}!] n}!] l~!^!fa!^!nb!^!de!^!ff!]!lf!]!dg!\ l|"C f}"B l}"C f}"C f|"C d{"C nz"B!fe"H!ne"I!dg"K l|"K!nf"J n|"J n|"H l|"M!dg"T!nf"R!fe"Q!lb"Q!da"Q n~"Q f}"R l|"T l|"U f}"V n~"W!da"X!lb"X!fe"W!nf"V!dg"U!dg"T!dg"T!lf"S!ff"R!de"R!nb"Q!fa"Q l~"R n}"R d}"S l|"T l|"U d}"V n}"V l~"W!fa"W!nb"W!de"W!ff"V!lf"V!dg"U!dg"^!nf"\!fe"[!lb"[!da"[ n~"[ f}"\ l|"^ l|"_ f}#@ n~#A!da#B!lb#B!fe#A!nf#@!dg"_!dg"^!dg"^!lf"]!ff"\!de"\!nb"[!fa"[ l~"\ n}"\ d}"] l|"^ l|"_ d}#@ n}#@ l~#A!fa#A!nb#A!de#A!ff#@!lf#@!dg"_!di#E!dh#F!lf#G!ld#H!fb#H!f`#H l}#H l{#G dz#F dy#E!dh#F!df#G!nd#G!db#H!d`#H n}#G d|#G dz#F `` @ ``#]#`}#]#`} @ `` @$dm$E$dl$D$lj$C$lh$B$ff$A$fd$A$la$B#l$C#d~$D#d}$E$dl$D$dj$C$nh$B$df$B$dd$B$na$B$d`$C#d~$D$dk$I$df$H$df$H$dg$I$ng$J$lg$L$fg$M$ff$N$ld$O$lc$O$fb$N$fa$M$l`$L$n`$J$da$I$na$H$lb$H$dc$H$nc$H$dc$I$nb$H$lg$L$dg$M$df$N$nd$N$nc$N$db$N$da$M$l`$L$dk$I$dk$N$lj$I$nj$K$dk$N$dk$U$nj$S$fi$R$lf$R$de$R$nb$R$fa$S$l`$U$l`$V$fa$W$nb$X$de$Y$lf$Y$fi$X$nj$W$dk$V$dk$U$dk$U$lj$T$fj$S$di$S$nf$R$fe$R$lb$S$na$S$da$T$l`$U$l`$V$da$W$na$W$lb$X$fe$X$nf$X$di$X$fj$W$lj$W$dk$V$dk$_$nj$]$fi$\$lf$\$de$\$nb$\$fa$]$l`$_$l`%@$fa%A$nb%B$de%C$lf%C$fi%B$nj%A$dk%@$dk$_$dk$_$lj$^$fj$]$di$]$nf$\$fe$\$lb$]$na$]$da$^$l`$_$l`%@$da%A$na%A$lb%B$fe%B$nf%B$di%B$fj%A$lj%A$dk%@$l`%G$fa%F$la%G$fa%G$f`%G#d%G#n~%F$dk%L$df%K$df%K$dg%L$ng%M$lg%O$fg%P$ff%Q$ld%R$lc%R$fb%Q$fa%P$l`%O$n`%M$da%L$na%K$lb%K$dc%K$nc%K$dc%L$nb%K$lg%O$dg%P$df%Q$nd%Q$nc%Q$db%Q$da%P$l`%O$dk%L$dk%Q$lj%L$nj%N$dk%Q$dk%X$nj%V$fi%U$lf%U$de%U$nb%U$fa%V$l`%X$l`%Y$fa%Z$nb%[$de%\$lf%\$fi%[$nj%Z$dk%Y$dk%X$dk%X$lj%W$fj%V$di%V$nf%U$fe%U$lb%V$na%V$da%W$l`%X$l`%Y$da%Z$na%Z$lb%[$fe%[$nf%[$di%[$fj%Z$lj%Z$dk%Y$dk&B$nj&@$fi%_$lf%_$de%_$nb%_$fa&@$l`&B$l`&C$fa&D$nb&E$de&F$lf&F$fi&E$nj&D$dk&C$dk&B$dk&B$lj&A$fj&@$di&@$nf%_$fe%_$lb&@$na&@$da&A$l`&B$l`&C$da&D$na&D$lb&E$fe&E$nf&E$di&E$fj&D$lj&D$dk&C$dm&I$dl&J$lj&K$lh&L$ff&L$fd&L$la&L#l&K#d~&J#d}&I$dl&J$dj&K$nh&K$df&L$dd&L$na&K$d`&K#d~&J `` @ ``'Z'`z'Z'`z @ `` @(dj(B(di(A(lg(@(le'_(fc'^(fa'^'l~'_'l|(@'d{(A'dz(B(di(A(dg(@(ne'_(dc'_(da'_'n~'_'d}(@'d{(A(ff(F(nf(G(dh(I'l}(I(ng(H'n}(H'n}(F'l}(K(dh(R(ng(P(ff(O(lc(O(db(O'n(O'f~(P'l}(R'l}(S'f~(T'n(U(db(V(lc(V(ff(U(ng(T(dh(S(dh(R(dh(R(lg(Q(fg(P(df(P(nc(O(fb(O'l(P'n~(P'd~(Q'l}(R'l}(S'd~(T'n~(T'l(U(fb(U(nc(U(df(U(fg(T(lg(T(dh(S(dh(\(ng(Z(ff(Y(lc(Y(db(Y'n(Y'f~(Z'l}(\'l}(]'f~(^'n(_(db)@(lc)@(ff(_(ng(^(dh(](dh(\(dh(\(lg([(fg(Z(df(Z(nc(Y(fb(Y'l(Z'n~(Z'd~(['l}(\'l}(]'d~(^'n~(^'l(_(fb(_(nc(_(df(_(fg(^(lg(^(dh(](dh)F(ng)D(ff)C(lc)C(db)C'n)C'f~)D'l})F'l})G'f~)H'n)I(db)J(lc)J(ff)I(ng)H(dh)G(dh)F(dh)F(lg)E(fg)D(df)D(nc)C(fb)C'l)D'n~)D'd~)E'l})F'l})G'd~)H'n~)H'l)I(fb)I(nc)I(df)I(fg)H(lg)H(dh)G'l})N'f~)M'l~)N'f~)N'f})N'd|)N'n{)M(ff)S(nf)T(dh)V'l})V(ng)U'n})U'n})S'l})X(dh)_(ng)](ff)\(lc)\(db)\'n)\'f~)]'l})_'l}*@'f~*A'n*B(db*C(lc*C(ff*B(ng*A(dh*@(dh)_(dh)_(lg)^(fg)](df)](nc)\(fb)\'l)]'n~)]'d~)^'l})_'l}*@'d~*A'n~*A'l*B(fb*B(nc*B(df*B(fg*A(lg*A(dh*@(dh*I(ng*G(ff*F(lc*F(db*F'n*F'f~*G'l}*I'l}*J'f~*K'n*L(db*M(lc*M(ff*L(ng*K(dh*J(dh*I(dh*I(lg*H(fg*G(df*G(nc*F(fb*F'l*G'n~*G'd~*H'l}*I'l}*J'd~*K'n~*K'l*L(fb*L(nc*L(df*L(fg*K(lg*K(dh*J(dh*S(ng*Q(ff*P(lc*P(db*P'n*P'f~*Q'l}*S'l}*T'f~*U'n*V(db*W(lc*W(ff*V(ng*U(dh*T(dh*S(dh*S(lg*R(fg*Q(df*Q(nc*P(fb*P'l*Q'n~*Q'd~*R'l}*S'l}*T'd~*U'n~*U'l*V(fb*V(nc*V(df*V(fg*U(lg*U(dh*T(dj*Z(di*[(lg*\(le*](fc*](fa*]'l~*]'l|*\'d{*['dz*Z(di*[(dg*\(ne*\(dc*](da*]'n~*\'d}*\'d{*[ `` @ ``/T/`t/T/`t @ `` @0dd/\0dc/[0la/Z/l/Y/f}/X/f{/X/lx/Y/lv/Z/du/[/dt/\0dc/[0da/Z/n/Y/d}/Y/d{/Y/nx/Y/dw/Z/du/[0f`/_/l0@/f/_/l/_0d`/_0fa/_0la0@0fb0A0fb0C0la0E0fa0E0d`0F/d0F/f~0E/d}0D/f|0A/n{0@/nz/_/dy/_/lw/_0fb0C0na0D0da0E0f`0E/f0E/d~0E/f}0C/f|0A/lx/_/fy/_/fy0@/dx0C/fx0D/nx0E/dy0F/fy0@/lw0C/lw0E/fx0E/dy0F/dz0F0db0L0na0J0f`0I/l}0I/d|0I/ny0I/fx0J/lw0L/lw0M/fx0N/ny0O/d|0P/l}0P0f`0O0na0N0db0M0db0L0db0L0la0K0fa0J0d`0J/n}0I/f|0I/ly0J/nx0J/dx0K/lw0L/lw0M/dx0N/nx0N/ly0O/f|0O/n}0O0d`0O0fa0N0la0N0db0M0db0V0na0T0f`0S/l}0S/d|0S/ny0S/fx0T/lw0V/lw0W/fx0X/ny0Y/d|0Z/l}0Z0f`0Y0na0X0db0W0db0V0db0V0la0U0fa0T0d`0T/n}0S/f|0S/ly0T/nx0T/dx0U/lw0V/lw0W/dx0X/nx0X/ly0Y/f|0Y/n}0Y0d`0Y0fa0X0la0X0db0W0db1@0na0^0f`0]/l}0]/d|0]/ny0]/fx0^/lw1@/lw1A/fx1B/ny1C/d|1D/l}1D0f`1C0na1B0db1A0db1@0db1@0la0_0fa0^0d`0^/n}0]/f|0]/ly0^/nx0^/dx0_/lw1@/lw1A/dx1B/nx1B/ly1C/f|1C/n}1C0d`1C0fa1B0la1B0db1A/lw1H/fx1G/lx1H/fx1H/fw1H/dv1H/nu1G0f`1L/l1M/f1L/l1L0d`1L0fa1L0la1M0fb1N0fb1P0la1R0fa1R0d`1S/d1S/f~1R/d}1Q/f|1N/n{1M/nz1L/dy1L/lw1L0fb1P0na1Q0da1R0f`1R/f1R/d~1R/f}1P/f|1N/lx1L/fy1L/fy1M/dx1P/fx1Q/nx1R/dy1S/fy1M/lw1P/lw1R/fx1R/dy1S/dz1S0db1Y0na1W0f`1V/l}1V/d|1V/ny1V/fx1W/lw1Y/lw1Z/fx1[/ny1\/d|1]/l}1]0f`1\0na1[0db1Z0db1Y0db1Y0la1X0fa1W0d`1W/n}1V/f|1V/ly1W/nx1W/dx1X/lw1Y/lw1Z/dx1[/nx1[/ly1\/f|1\/n}1\0d`1\0fa1[0la1[0db1Z0db2C0na2A0f`2@/l}2@/d|2@/ny2@/fx2A/lw2C/lw2D/fx2E/ny2F/d|2G/l}2G0f`2F0na2E0db2D0db2C0db2C0la2B0fa2A0d`2A/n}2@/f|2@/ly2A/nx2A/dx2B/lw2C/lw2D/dx2E/nx2E/ly2F/f|2F/n}2F0d`2F0fa2E0la2E0db2D0db2M0na2K0f`2J/l}2J/d|2J/ny2J/fx2K/lw2M/lw2N/fx2O/ny2P/d|2Q/l}2Q0f`2P0na2O0db2N0db2M0db2M0la2L0fa2K0d`2K/n}2J/f|2J/ly2K/nx2K/dx2L/lw2M/lw2N/dx2O/nx2O/ly2P/f|2P/n}2P0d`2P0fa2O0la2O0db2N0dd2T0dc2U0la2V/l2W/f}2W/f{2W/lx2W/lv2V/du2U/dt2T0dc2U0da2V/n2V/d}2W/d{2W/nx2V/dw2V/du2U `` @ ``7N7`n7N7`n @ `` @7d~7V7d}7U7l{7T7ly7S7fw7R7fu7R7lr7S7lp7T7do7U7dn7V7d}7U7d{7T7ny7S7dw7S7du7S7nr7S7dq7T7do7U7fz7Y7ly7Z7fy7Y7ly7Y7dz7Y7f{7Y7l{7Z7f|7[7f|7]7l{7_7nz7_7fy7_7dx7_7nw7]7lw7\7f|7]7n{7^7lz7_7dy7_7fx7^7nw7]7nw7]7fw7^7fv7_7du8@7ls8@7nr7_7dr7_7nq7]7nq7[7dr7Z7nr7Y7ls7Y7dt7Y7nt7Y7dt7Z7ns7Y7lv7_7fu7_7ns7_7lr7_7fr7^7nq7]7d|8F7n{8D7fz8C7lw8C7dv8C7ns8C7fr8D7lq8F7lq8G7fr8H7ns8I7dv8J7lw8J7fz8I7n{8H7d|8G7d|8F7d|8F7l{8E7f{8D7dz8D7nw8C7fv8C7ls8D7nr8D7dr8E7lq8F7lq8G7dr8H7nr8H7ls8I7fv8I7nw8I7dz8I7f{8H7l{8H7d|8G7d|8P7n{8N7fz8M7lw8M7dv8M7ns8M7fr8N7lq8P7lq8Q7fr8R7ns8S7dv8T7lw8T7fz8S7n{8R7d|8Q7d|8P7d|8P7l{8O7f{8N7dz8N7nw8M7fv8M7ls8N7nr8N7dr8O7lq8P7lq8Q7dr8R7nr8R7ls8S7fv8S7nw8S7dz8S7f{8R7l{8R7d|8Q7d|8Z7n{8X7fz8W7lw8W7dv8W7ns8W7fr8X7lq8Z7lq8[7fr8\7ns8]7dv8^7lw8^7fz8]7n{8\7d|8[7d|8Z7d|8Z7l{8Y7f{8X7dz8X7nw8W7fv8W7ls8X7nr8X7dr8Y7lq8Z7lq8[7dr8\7nr8\7ls8]7fv8]7nw8]7dz8]7f{8\7l{8\7d|8[7lq9B7fr9A7lr9B7fr9B7fq9B7dp9B7no9A7fz9F7ly9G7fy9F7ly9F7dz9F7f{9F7l{9G7f|9H7f|9J7l{9L7nz9L7fy9L7dx9L7nw9J7lw9I7f|9J7n{9K7lz9L7dy9L7fx9K7nw9J7nw9J7fw9K7fv9L7du9M7ls9M7nr9L7dr9L7nq9J7nq9H7dr9G7nr9F7ls9F7dt9F7nt9F7dt9G7ns9F7lv9L7fu9L7ns9L7lr9L7fr9K7nq9J7d|9S7n{9Q7fz9P7lw9P7dv9P7ns9P7fr9Q7lq9S7lq9T7fr9U7ns9V7dv9W7lw9W7fz9V7n{9U7d|9T7d|9S7d|9S7l{9R7f{9Q7dz9Q7nw9P7fv9P7ls9Q7nr9Q7dr9R7lq9S7lq9T7dr9U7nr9U7ls9V7fv9V7nw9V7dz9V7f{9U7l{9U7d|9T7d|9]7n{9[7fz9Z7lw9Z7dv9Z7ns9Z7fr9[7lq9]7lq9^7fr9_7ns:@7dv:A7lw:A7fz:@7n{9_7d|9^7d|9]7d|9]7l{9\7f{9[7dz9[7nw9Z7fv9Z7ls9[7nr9[7dr9\7lq9]7lq9^7dr9_7nr9_7ls:@7fv:@7nw:@7dz:@7f{9_7l{9_7d|9^7d|:G7n{:E7fz:D7lw:D7dv:D7ns:D7fr:E7lq:G7lq:H7fr:I7ns:J7dv:K7lw:K7fz:J7n{:I7d|:H7d|:G7d|:G7l{:F7f{:E7dz:E7nw:D7fv:D7ls:E7nr:E7dr:F7lq:G7lq:H7dr:I7nr:I7ls:J7fv:J7nw:J7dz:J7f{:I7l{:I7d|:H7d~:N7d}:O7l{:P7ly:Q7fw:Q7fu:Q7lr:Q7lp:P7do:O7dn:N7d}:O7d{:P7ny:P7dw:Q7du:Q7nr:P7dq:P7do:O `` @ ``?H7`n?H7`n @ `` @7f~D7l{>C7dz>B7nw>A7fv>A7ls>B7dr>C7nq>D7nq>E7dr>G7ls>H7fv>H7nw>H7dz>H7l{>G7f|>E7f|>D7f|>D7n{>C7d{>C7fz>B7lw>B7dv>B7ns>B7lr>C7fr>C7nq>D7nq>E7fr>F7lr>G7ns>G7dv>H7lw>H7fz>G7d{>G7n{>F7f|>E7f|>N7l{>M7dz>L7nw>K7fv>K7ls>L7dr>M7nq>N7nq>O7dr>Q7ls>R7fv>R7nw>R7dz>R7l{>Q7f|>O7f|>N7f|>N7n{>M7d{>M7fz>L7lw>L7dv>L7ns>L7lr>M7fr>M7nq>N7nq>O7fr>P7lr>Q7ns>Q7dv>R7lw>R7fz>Q7d{>Q7n{>P7f|>O7f|>X7l{>W7dz>V7nw>U7fv>U7ls>V7dr>W7nq>X7nq>Y7dr>[7ls>\7fv>\7nw>\7dz>\7l{>[7f|>Y7f|>X7f|>X7n{>W7d{>W7fz>V7lw>V7dv>V7ns>V7lr>W7fr>W7nq>X7nq>Y7fr>Z7lr>[7ns>[7dv>\7lw>\7fz>[7d{>[7n{>Z7f|>Y7f~>_7f}?@7n{?A7ny?B7dw?C7du?C7nr?B7np?A7fo?@7fn>_7f}?@7f{?A7ly?B7fw?B7fu?B7lr?B7fq?A7fo?@�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/skymap.tek��������������������������������������������������������0000644�0001750�0001750�00000037457�06452756460�016324� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������99"`k)B"ck;T5cc;T5`c)B"`k)B8:"ck9S"oo9T5bc;T4f~;S"be9@!j{9@"`f9A!h{9A"`f9A!j~8[!j~9C!h{8_!j{9B"mh9F"m`9F"oh9F"o`9F"ce9F"ne9G"bf9H"af9I"ne9J"ce9J"o`9J"af9I"le9J"be9J"n`9J"mh9E"oh9F"m`9E"o`9G"m`9I"l`9L"ce9R!k{9R"af9S!i{9S"af9S!k~9M!k~9U!i{9Q!k{9T"af9["ke9Y"cd9X"ia9X"a`9X!k}9X!c|9Y!i{9[!i{9\!c|9]!k}9^"a`9_"ia9_"cd9^"ke9]"af9\"af9["af9["ie9Z"ce9Y"ad9Y"ka9X"c`9X!i}9Y!k|9Y!a|9Z!i{9[!i{9\!a|9]!k|9]!i}9^"c`9^"ka9^"ad9^"ce9]"ie9]"af9\"bf:B"n`:B"`f:C"l`:C"`e:C"oe:C"cf:D"bf:E"oe:F"`e:G"l`:G"bf:E"me:F"ce:F"o`:F"`e:G"oe:G"`f:I"cf:I"oe:J"ae:K"m`:K"cf:I"ne:J"ce:J"o`:J"bf:A"`f:C"n`:A"l`:D"n`:E"m`:H"o`:I"m`:L"ck6_"bp7@5ac8L4b~8K"af6Y"aa6X"aa6X"ab6Y"kb6Z"ib6\"cb6]"ca6^!i6_!i~6_!c}6^!c|6]!i{6\!k{6Z!a|6Y!k|6X!i}6X!a~6X!k~6X!a~6Y!k}6X"ib6\"ab6]"aa6^!k6^!k~6^!a}6^!a|6]!i{6\"af6Y"af6^"ie6Y"ke6["af6^"nh7B"n`7B"lh7C"l`7C"`e7C"oe7C"cf7D"bf7E"oe7F"`e7G"l`7G"bf7E"me7F"ce7F"o`7F"nh7A"lh7C"n`7A"l`7D"n`7E"m`7H"ck4L"dp4M5ac5A4l}5A"`f3V"`a3U"`a3U"`b3V"jb3W"hb3Y"bb3Z"ba3[!h3\!h~3\!b}3[!b|3Z!h{3Y!j{3W!`|3V!j|3U!h}3U!`~3U!j~3U!`~3V!j}3U"hb3Y"`b3Z"`a3[!j3[!j~3[!`}3[!`|3Z!h{3Y"`f3V"`f3["he3V"je3X"`f3["mh3_"m`3_"oh3_"o`3_"ce3_"ne4@"bf4A"af4B"ne4C"ce4C"o`4C"af4B"le4C"be4C"n`4C"mh3^"oh3_"m`3^"o`4@"m`4B"l`4E"cd4G"ic4H"cc4G"ic4G"ad4G"ce4G"ie4H"cf4I"cf4K"ie4M"ce4M"ad4N"ac4N"cb4M"aa4L"c`4I!k4H!k~4G!a}4G!i{4G"cf4K"ke4L"ae4M"cd4M"cc4M"ab4M"ca4K"c`4I!i|4G!c}4G!c}4H!a|4K!c|4L!k|4M!a}4N!c}4H!i{4K!i{4M!c|4M!a}4N!a~4N"af4T"ke4R"cd4Q"ia4Q"a`4Q!k}4Q!c|4R!i{4T!i{4U!c|4V!k}4W"a`4X"ia4X"cd4W"ke4V"af4U"af4T"af4T"ie4S"ce4R"ad4R"ka4Q"c`4Q!i}4R!k|4R!a|4S!i{4T!i{4U!a|4V!k|4V!i}4W"c`4W"ka4W"ad4W"ce4V"ie4V"af4U"bf4["n`4["`f4\"l`4\"`e4\"oe4\"cf4]"bf4^"oe4_"`e5@"l`5@"bf4^"me4_"ce4_"o`4_"`e5@"oe5@"`f5B"cf5B"oe5C"ae5D"m`5D"cf5B"ne5C"ce5C"o`5C"bf4Z"`f4\"n`4Z"l`4]"n`4^"m`5A"o`5B"m`5E"bk1Z"jp1Z5cc1T4k}1T"cf1C"ca1B"ca1B"cb1C"ib1E"kb1F"ab1H"aa1I!k1I!k~1I!a}1I!a|1H!k{1F!i{1E!c|1C!i|1C!k}1B!c~1B!i~1C!c~1C!i}1C"kb1F"cb1G"ca1H!i1I!i~1I!c}1H!c|1G!k{1F"cf1C"cf1H"ke1C"ie1F"cf1H"lh1M"l`1M"nh1M"n`1M"be1M"me1N"af1O"`f1P"me1Q"be1Q"n`1Q"`f1P"oe1P"ae1Q"m`1Q"lh1L"nh1M"l`1L"n`1N"l`1P"o`1R"be1Y!j{1Y"`f1Z!h{1Z"`f1Z!j~1T!j~1\!h{1X!j{1["`f2B"je2@"bd1_"ha1_"``1_!j}1_!b|2@!h{2B!h{2C!b|2D!j}2E"``2F"ha2F"bd2E"je2D"`f2C"`f2B"`f2B"he2A"be2@"`d2@"ja1_"b`1_!h}2@!j|2@!`|2A!h{2B!h{2C!`|2D!j|2D!h}2E"b`2E"ja2E"`d2E"be2D"he2D"`f2C"af2I"m`2I"cf2I"o`2I"ce2I"ne2J"bf2K"af2L"ne2M"ce2M"o`2M"af2L"le2M"be2M"n`2M"ce2M"ne2N"cf2O"bf2P"ne2Q"`e2R"l`2R"bf2P"me2Q"be2Q"n`2Q"af2H"cf2I"m`2H"o`2J"m`2L"l`2O"n`2P"l`2S"`k/I"jp/H5`c.H4j}.H"jd/G"`d/G"jc/G"`d/H"hd/H"je/G"bf/F"`f/E"je/C"jd/B"hc/B"ja/A!j~/A!`}/B!`|/C!j{/D!j{/E!`|/G!`}/H!j~/H!b/H"h`/H"ha/G"bb/E"`b/E"ja/C"j`/B!`/B"`f/E"he/D"hd/C"jc/B"ha/B!h~/B!b}/B!b|/C!j{/D!j{/E!b|/F!b}/G!h~/H!`/H"j`/G"ja/F"bb/E"oh/K"o`/K"mh/L"m`/L"ae/L"le/M"`f/N"cf/N"le/P"ae/P"m`/P"cf/N"ne/O"`e/P"l`/P"oh/J"mh/L"o`/J"m`/M"o`/N"n`/Q"ak,U"ep,T5cc*Z4o}*["jd,C"`d,C"jc,C"`d,D"hd,D"je,C"bf,B"`f,A"je+_"jd+^"hc+^"ja+]!j~+]!`}+^!`|+_!j{,@!j{,A!`|,C!`},D!j~,D!b,D"h`,D"ha,C"bb,A"`b,A"ja+_"j`+^!`+^"`f,A"he,@"hd+_"jc+^"ha+^!h~+^!b}+^!b|+_!j{,@!j{,A!b|,B!b},C!h~,D!`,D"j`,C"ja,B"bb,A"oh,G"o`,G"mh,H"m`,H"ae,H"le,I"`f,J"cf,J"le,L"ae,L"m`,L"cf,J"ne,K"`e,L"l`,L"oh,F"mh,H"o`,F"m`,I"o`,J"n`,M"ad,P"kc,P"ac,P"kc,O"cd,O"ae,P"ke,P"af,R"af,T"ke,U"ae,V"cd,V"cc,V"ab,V"ca,T"a`,R!i,Q!i~,P!c},O!k{,O"af,T"ie,U"ce,U"ad,V"ac,V"cb,U"aa,T"a`,R!k|,O!a},P!a},Q!c|,S!a|,U!i|,V!c},V!a},Q!k{,S!k{,U!a|,V!c},V!c~,V"cf,\"ie,["ad,Z"ka,Y"c`,Y!i},Z!a|,[!k{,\!k{,]!a|,_!i}-@"c`-@"ka-@"ad-@"ie,_"cf,]"cf,\"cf,\"ke,["ae,["cd,Z"ia,Z"a`,Z!k},Z!i|,[!c|,[!k{,\!k{,]!c|,^!i|,_!k},_"a`-@"ia-@"cd,_"ae,_"ke,^"cf,]"`f-D"l`-D"bf-D"n`-D"be-D"me-E"af-F"`f-G"me-H"be-H"n`-H"`f-G"oe-G"ae-H"m`-H"be-H"me-I"bf-J"af-K"me-L"ce-L"o`-L"af-K"le-L"ae-L"m`-L"`f-C"bf-D"l`-C"n`-E"l`-G"o`-I"m`-K"o`-M%ll)B%ll)L%cm;T%cm;J%`l'U%`l'^%br(A%bo(A%bp(A%`q(B%`r(C%`r(D%jp(F%jp(G%`q(H%br(H%`q(B%hq(C%hq(D%jp(F%br(H%jp(H%`o(H%hl(F%jk(E%`j(E%hg(E%`o(H%jl(E%hk(E%bj(D%jg(D%`p(L%jo(L%`o(L%jo(K%bp(K%`q(L%jq(L%`r(N%`r(P%jq(Q%`q(R%bp(R%bo(R%`n(R%bm(P%`l(N%hk(M%hj(L%bi(K%jg(K%`r(P%hq(Q%bq(Q%`p(R%`o(R%bn(Q%`m(P%`l(N%jh(K%`i(L%`i(M%bh(O%`h(Q%hh(R%bi(R%`i(M%jg(O%jg(Q%`h(R%bi(R%bj(R%br(W%mq(V%bq(U%mo(U%ao(U%bn(U%em(V%nl(W%ml(X%em(Y%`n(Z%bo(Z%no(Z%`q(Z%mq(Y%ar(X%br(W%br(W%oq(V%`q(V%no(U%bo(U%`n(V%gm(V%nl(W%ml(X%dm(Y%cn(Y%`o(Z%lo(Z%cq(Y%lq(Y%ar(X)hh)B)hh)L)ci;T)ci;J)mg'S)mg'\)om'_)oj'_)ok'_)ml(@)mm(A)mm(B)gl(D)gl(E)ml(F)om(F)ml(@)em(A)em(B)gl(D)om(F)gl(F)mj(F)eh(D)gg(C)me(C)ec(C)mj(F)gh(C)eg(C)oe(B)gc(B)om(L)em(K)mk(J)gi(I)og(I)ee(J)mc(K)gc(L)gc(M)mc(O)ee(P)og(P)gi(P)mk(P)em(O)om(M)om(L)om(L)gm(K)ml(K)ok(J)ei(J)mg(J)ge(J)ed(K)oc(K)gc(L)gc(M)oc(N)ed(O)ge(O)mg(P)ei(P)ok(O)ml(O)gm(N)om(M)om(U)jm(T)ol(S)jk(S)nj(S)oi(S)bi(T)kh(U)jh(V)bi(W)mi(X)oj(X)kk(X)ml(X)jm(W)nm(V)om(U)om(U)hm(U)ml(T)kk(S)oj(S)mi(T)`i(U)kh(U)jh(V)ai(W)li(X)mj(X)ik(X)ll(X)im(W)nm(V-lc)B-mc)L-cd;T-bd;J-`c'R-`c'[-jg(D-`g(D-jf(D-`g(E-hg(E-jh(D-bi(C-`i(B-jh(@-jg'_-hf'_-jd'^-ja'^-``'_,`(@,j~(A,j~(B,`(D-``(E-ja(E-bb(E-hc(E-hd(D-be(B-`e(B-jd(@-jc'_-`b'_-`i(B-hh(A-hg(@-jf'_-hd'_-ha'_-b`'_,b(@,j~(A,j~(B,b(C-b`(D-ha(E-`b(E-jc(D-jd(C-be(B-`i(K-jh(I-hg(I-`f(I-be(I-hd(K-hd(M-be(N-`f(O-hg(O-jh(N-`i(M-`i(K-`i(K-hh(J-jg(I-bf(I-`e(J-hd(K-hd(M-`e(N-bf(N-jg(N-hh(N-`i(M-hd(K-bd(I-hc(I-jb(H-j`(H,h(I,b(I,h~(K,h~(M,b(N,h(O-j`(O-jb(O-hc(O-bd(N-hd(M-hd(K-`d(J-jc(I-hb(I-h`(I,j(I,`(J,h~(K,h~(M,`(N,j(N-h`(O-hb(O-jc(N-`d(N-hd(M-bi(T-mh(S-bh(R-mf(R-af(R-be(R-ed(S-nc(T-mc(U-ed(V-`e(W-bf(W-nf(W-`h(W-mh(V-ai(U-bi(T-bi(T-oh(S-`h(S-nf(R-bf(R-`e(S-gd(S-nc(T-mc(U-dd(V-ce(V-`f(W-lf(W-ch(V-lh(V-ai(U0h)B0h)L0k~;T0k~;J0n~'U0n~'^1dc(H1nb(G1db(H1nb(H1fc(H1dd(H1ld(G1nd(E1dd(D1dc(C1fb(B1d`(B0d}(B0n{(B0nz(C0dz(E0dz(F0nz(G0n{(H0d}(I0l}(I0f(H1f`(G1l`(F1n`(E1d`(D0d(C0n}(B1nd(E1fd(D1fc(C1db(C1f`(B0f}(B0l{(C0lz(D0dz(E0dz(F0lz(G0l{(H0f}(H0n}(H0d(H1d`(G1l`(F1dc(R1nb(Q1db(R1nb(R1fc(R1dd(R1ld(Q1nd(O1dd(N1dc(M1fb(L1d`(L0d}(L0n{(L0nz(M0dz(O0dz(P0nz(Q0n{(R0d}(S0l}(S0f(R1f`(Q1l`(P1n`(O1d`(N0d(M0n}(L1nd(O1fd(N1fc(M1db(M1f`(L0f}(L0l{(M0lz(N0dz(O0dz(P0lz(Q0l{(R0f}(R0n}(R0d(R1d`(Q1l`(P1ld(X1kd(V1lc(V1kb(U1oa(U1l`(V1c`(V0h(X0k(X1c`(Y1n`(Z1la([1hb([1nc(Z1kd(Y1od(X1ld(X1ld(X1id(W1nc(V1hb(V1la(V1n`(V1a`(W0h(X0k(X1b`(Y1m`(Z1na(Z1jb(Z1mc(Z1jd(Y1od(X8+lc&B+jb&A+ba&A*l~&B*e}&D*n|&F*n|&H*d}&J*c~&J*j&K+ba&K+gc&J+jd&H+fe&F+ee&D+kd&B+ma%_+ca%]+aa%\+na%[+fc%[+id%\+cf%]+ba&A*h&B*a~&D*f}&F*e}&I*c~&J+ba&K+kb&J+nc&H+jd&F+jd&C+lc&B+hb&@+na%^+la%]+ib%\+mc%\+cf%]+hk&J+il&I+gn&G+dn&S+im&H+hm&S+hk&S+dp&S+n{&K+e{&M+az&N+kx&N+cx&N+ev&N+eu&M+nt&K+lt&K+eu&I+ev&H+cx&G+cy&G+iz&H+m{&I+d|&K+e|&N+n{&P+f{&Q+bz&R+hx&S+lv&S+nu&R+fu&Q+du&Q+nu&P+dv&Q+nu&Q+cx&N+mv&N+mu&M+fu&K+du&K+mu&I+mv&H+cx&G+cy&G+az&H+e{&I+l{&K+m{&N+f{&P+jz&Q+jy&R+hx&S,k`&G+i&M+i&M,h`&L,fb&K,nc&K,he&L,if&M,cg&N,cg&O,jf&Q,je&R,lc&S,db&S,j`&R,``&R+h&Q+j&P,c`&O,j`&P,``&Q,nc&K,`e&L,af&M,kf&N,kf&O,bf&Q,be&R,lc&S,k`&G,cf&G,i`&H,ec&H,cf&G,km&G,al&H,lj&J,fj&L,ej&N,lj&Q,bl&R,hm&S,ln&S,fp&R,dq&Q,ar&N,br&L,dq&J,ep&H,on&G,km&G,km&G,il&H,cl&H,hk&J,nj&L,mj&N,hk&Q,`l&R,jl&R,hm&S,ln&S,no&R,dp&R,lp&Q,eq&N,fq&L,lp&J,gp&H,mo&H,on&G!gl1T!nk1R!ej1Q!nh1P!kf1O!kd1O!bc1P!fb1R!db1T!bc1U!ge1W!dg1Y!fj1Z!el1[!gl1T!mk1S!gj1Q!mh1Q!jf1P!jd1P!ac1Q!fb1R!gl1T!el1V!ok1W!ej1X!kd1Y!bc1Z!eb1[!el1V!lk1W!gj1W!hd1Y!cc1Y!eb1[!db1\!bd2A!jd2B!`f2D lz2D!je2C nz2C nz2A mz2F!gb2Q!l`2Q h2P b2N c2M i2L!m`2K!fb2J!nb2J!id2K!ie2L!cf2M!`f2O!je2P!kd2Q!mb2R i2R k}2Q d|2Q d{2P nz2N oz2L g{2K e|2K m|2K k}2K m|2L g|2K c2M k2L!o`2K!eb2K!mb2K!kd2K!ke2L!cf2M!`f2O!he2P!hd2Q!ob2Q k2Q h}2Q f|2P f{2O nz2N!bf2V!n`2U!n`2U!na2V!eb2X!gb2Y!na2[!n`2\ `2] `~2] f|2\ f{2[ oz2Y mz2X f{2V l{2V n|2U j}2U `~2V j}2V l|2V!gb2Y!oa2Z!l`2\ b2\ b~2\ d|2\ g{2Z oz2Y!bf2V!`f2\!je2V!ie2Y!`f2\!bf3C!he3B!cd3@!ea3@ i3@ o|3@ d{3B nz3C nz3D e{3F m|3G k3G!ga3G!ad3G!ie3F!bf3D!bf3C!bf3C!je3B!`e3B!ad3A!ga3@ k3@ m|3A l{3B f{3B nz3C nz3D g{3E m{3F o|3F i3G!ea3G!cd3F!ae3F!ke3E!bf3D89:967dw @8`d.\7dw.\8bd.\7fw.\8i`/@7i{/@8ad.Z8`d/D8h`/D8ad/C7b~.\7a~/@7ew.Z7dw/D7`{/D7ew/C8bd/G7fw/O8ad/H7ew/P8ad/P7fw/G8ad/F8`d/J8cd/M8ad/Q7ew/F7dw/J7gw/M7ew/Q8`d/U7dw/U8cd/U7gw/U8ad/S8bd/W7ew/S7fw/W8ad/^7ew/^8cd/^7gw/^8bd/Z8h`/Z8`d/Z8`d0C8h`0C8bd0B7ew/\7gw0@8ad0G7ew0G8`d0H7dw0H8k`0K7k{0K8bd0E8ad0O8i`0O8cd0N7`~0H7c~0K7fw0E7ew0O7a{0O7gw0N7ew0]7i~1E7l1F7d}1F7i~1E7g1D7n1C7l1A7g0_7i~0_7e}0_7o|0_7d|1A7`{1D7ez1E7ly1F7a~0_7g}0_7l|1A7h{1D7a{1E7dz1F7hx1F7mw1E7dw1D7gw1A7nw1@7kx0_7my0_7ew0_7kx0_7m1M7f1K7a~1J7f|1I7b{1I7ay1J7nw1K7ew1M7fw1N7mw1P7by1Q7a{1R7e|1R7b~1Q7e1P7n1N7m1M7m1M7d1L7c~1J7e|1J7a{1J7cy1J7lw1L7ew1M7fw1N7ow1O7`y1Q7b{1Q7f|1Q7`~1Q7g1O7n1N7l1W7`y1W7ow1W7fw1Y7gw1Z7nw1\7cy1]7o1W7cy1W7mw1X7fw1Y7o1]7gw1]7m1^7ew1^7m1U7o1W7l1\7m1^7gw1]7ew2@7n2D7fw2D7l2E7dw2E7d|2E7c~2E7d2G7m2H7l2J7f2J7j~2J7`~2J7i~2I7d2J7o2B7l2E7gw2B7dw2G7`~2U7e}2T7l|2U7f}2U7b~2U7e2T7m2S7m2Q7f2O7a~2N7g|2M7c{2M7ay2N7nw2O7ew2Q7fw2R7mw2T7by2U7m2Q7d2P7c~2N7e|2N7a{2N7cy2N7lw2P7ew2Q7g|2Y7e|3A7e}3A7j~3@7d3@7o2^7l2]7d2[7c~2Y7e|2Y7a{2Y7cy2Y7lw2[7dw2]7ew2^7lw3@7ay3A7f|3@7b~3@7d3@7l2]7g2[7b~2Z7g|2Y7c{2Y7by2Z7ow2[7dw2]7h~3K7n3K7f}3K7h~3K7e3J7m3I7o3F7f3E7k~3D7g}3D7n|3E7g|3F7c{3I7dz3K7ny3K7c~3D7f}3E7o|3F7k{3I7`{3K7fz3K7jx3K7lw3K7gw3I7ew3G7lw3F7jx3E7oy3D7gw3D7jx3E7gw3Y8if4@8ee3_8hc3^8ca3\7`~3\7h{3\7kx3\7`v3^7et3_7as4@8ee3_8lb3^8aa3]7c~3\7k{3\7ix3]7lv3^7et3_7g|4D7d|4L7d}4L7i~4K7g4J7n4I7o4G7g4E7c~4D7d|4D7`{4D7cy4D7ow4E7gw4G7dw4I7ow4J7`y4L7e|4K7a~4K7g4J7o4G7f4F7a~4E7g|4D7c{4D7ay4E7nw4F7gw4G7m4P7dw4W7o4P7fw4W7n4W7ew4P7l4O7o4R7m4U7o4X7dw4O7gw4R7ew4U7gw4X8`d4]8jc4\8lb4]8kc4]8`d4]7l4]7dw4]7o4]7gw4]7m4[7o4]7ew4[7fw4_8cd5C7oy5C7nw5D7gw5E7gw5F7lw5H7cy5H8bd5D7ny5D7lw5E7gw5E7l5B7o5F7e|5L7g|5S7g}5S7h~5S7f5R7m5Q7n5O7f5M7a~5L7g|5K7c{5K7ay5L7nw5M7fw5O7gw5P7nw5R7cy5S7d|5S7`~5S7f5R7n5O7e5N7`~5M7e|5L7a{5L7`y5M7mw5N7fw5O8if5W8fe5X8kc5Y8`a5[7c~5[7k{5[7hx5[7cv5Y7ft5X7as5W8fe5X8ob5Y8ba5Z7`~5[7h{5[7jx5Z7ov5Y7ft5X47j}.L7h}.T7j}.L8be.L7j}.L7h}.E7j}.L7bv.L:+bw2K+`w2S+bw2K+j~2K+bw2K+`w2D+bw2K+jo2K+nu2T+nu2Z+nv2Z+lw2Z+fx2Y+nx2X+lx2W+dx2V+dw2U+nu2T+nt2T+ds2U+dr2V+lq2W+nq2X+fr2Y+fs2Z+nx2]+lq3C+lx3C+nq2]+d|3F+n{3F+d|3G+n|3F+d|3F+nx3F+nq3F+d|3K+ls3K+fr3K+nq3L+nq3M+nx3I+lx3M+lu3P+lu3V+lv3V+nw3U+dx3U+lx3T+nx3R+fx3Q+fw3P+lu3P+lt3P+fs3P+fr3Q+nq3R+lq3T+dr3U+ds3V+nq4A+fz4D+nz4E+d|4G+lq4G*mz1U*oz1\*mz1U+eb1U*mz1U*oz1M*mz1U*es1U*iy1^*iy2D*iz2D*k{2C*a|2C*i|2B*k|2@*c|1_*c{1^*iy1^*ix1^*cw1^*cv1_*ku2@*iu2B*av2C*aw2D*i|2G*ku2L*k|2L*iu2G+c`2O*i2P+c`2P+i`2P+c`2O*i|2P*iu2P+c`2T*kw2T*av2U*iu2V*iu2W*i|2S*k|2V*ky2Y*ky2_*kz2_*i{2_*c|2^*k|2]*i|2\*a|2[*a{2Z*ky2Y*kx2Y*aw2Z*av2[*iu2\*ku2]*cv2^*cw2_*iu3K*iu3U*i}3W*a~3W*c3W*i3X+a`3Y+a`3[*i3\*c3\*a~3]*a}3]*c|3\*kz3[*ku3V*ku3]967h` @7dm,W7h`,W7fm,W7j`,W7mi,[7md,[7dm,U7gm,^7oi,^7em,^7fg,W7eg,[7h`,U7k`,^7gd,^7i`,^7fm-B7j`-J7em-C7h`-K7dm-K7j`-B7em-A7dm-E7gm-H7em-L7i`-A7h`-E7k`-H7i`-L7dm-P7h`-P7fm-P7j`-P7em-N7fm-R7i`-N7j`-R7em-Y7i`-Y7gm-Y7k`-Y7fm-U7oi-T7gm-T7dm-^7li-^7fm-]7i`-W7j`-[7em.B7i`.B7dm.C7h`.C7ni.F7nd.F7fm.@7em.J7mi.J7gm.I7dg.C7fg.F7j`.@7i`.J7ed.J7k`.I7i`.X7mg/@7ci/@7kf/@7mg/@7kh._7bi.^7`i.\7kh.Z7mg.Z7if.Z7cf.Z7he.\7dd._7ic/@7cc/@7eg.Z7kf.Z7`f.\7ld._7ed/@7kc/@7oa/@7aa/@7h`._7j`.\7aa.[7oa.Z7ac.Z7i`.Z7oa.Z7ai/H7ih/F7eg/E7je/D7fd/D7eb/E7aa/F7i`/H7j`/I7aa/K7fb/L7dd/M7he/M7fg/L7ih/K7bi/I7ai/H7ai/H7hh/G7gg/E7ie/E7ed/E7gb/E7`a/G7i`/H7j`/I7ca/J7gb/K7fd/L7je/L7gg/K7kh/J7bi/I7`i/R7db/R7ba/R7j`/T7k`/U7ba/W7gb/X7bi/R7fb/R7aa/S7j`/T7ci/X7k`/X7ai/Y7i`/Y7ai/P7bi/R7ci/V7ai/Y7k`/X7i`/[7bi/_7j`/_7`i0@7h`0@7he0@7gg0@7kh0A7`i0C7`i0E7jh0E7ng0E7dg0E7mg0D7hh0E7bi/]7`i0@7j`/]7k`0A7dg0P7if0O7`f0P7jf0P7fg0P7ih0O7`i0N7ai0L7jh0J7eg0I7je0H7fd0H7eb0I7ba0J7i`0L7j`0M7aa0O7fb0P7ai0L7hh0K7gg0I7ie0I7ed0I7gb0I7`a0K7i`0L7ke0T7ie0\7if0\7ng0[7hh0[7ci0Y7ci0W7hh0V7gg0T7ie0T7ed0T7gb0T7`a0V7k`0W7h`0Y7`a0[7eb0\7je0[7fg0[7hh0[7ci0W7kh0V7fg0U7ke0T7gd0T7fb0U7ca0V7k`0W7i`1J7ke1L7he1T7hf1T7mg1S7kh1R7bi1Q7ci1O7kh1M7gg1L7he1L7dd1L7gb1L7ca1M7k`1O7h`1Q7ca1R7db1T7ie1S7eg1S7kh1R7ci1O7jh1N7eg1M7ke1L7gd1L7eb1M7ba1N7k`1O7ci1X7k`1X7bi1Y7j`1Y7je1Y7dg1Z7ih1[7bi1\7ai1^7hh1_7lg1_7eg1^7og1]7ih1^7`i1W7bi1Y7h`1W7i`1[7ai2C7i`2C7ci2C7k`2C7ke2C7fg2D7kh2E7`i2G7ci2H7ih2I7mg2I7gg2H7mg2H7kh2H7bi2A7ci2C7j`2A7k`2E7`i2P7ih2N7dg2M7je2L7fd2L7db2M7aa2N7h`2P7i`2Q7aa2S7eb2T7dd2U7he2U7eg2T7ih2S7ai2Q7`i2P7`i2P7kh2N7gg2M7he2M7dd2M7gb2M7ca2N7h`2P7i`2Q7ba2R7gb2S7ed2T7ie2T7gg2S7jh2R7ai2Q7ci2Y7k`2Y7bi2Z7j`2Z7je2Z7dg2[7ih2\7bi2]7ai2_7hh3@7lg3@7eg2_7og2^7ih2_7`i2X7bi2Z7h`2X7i`2\7j`3M7fg3V7hf3V7bf3V7if3W7eg3W7hh3V7ci3T7`i3S7hh3Q7gg3O7ie3O7ed3O7gb3O7`a3Q7h`3S7i`3T7`a3V7eb3W7`i3S7kh3Q7fg3P7ke3O7gd3O7fb3P7ca3Q7h`3S7dm3\7nl3[7`l3\7ol3\7dm3\7`i3\7h`3\7ci3\7k`3\7ai3Z7ci3\7i`3Z7j`3^7ci4B7k`4B7bi4C7j`4C7je4C7dg4D7ih4E7bi4F7ai4H7hh4I7lg4I7eg4H7og4G7ih4H7`i4A7bi4C7h`4A7i`4E7eg4S7kf4R7af4S7hf4T7dg4T7kh4R7bi4Q7ci4O7kh4M7fg4L7he4L7dd4L7fb4L7ca4M7k`4O7k`4P7ca4R7db4T7ci4O7jh4N7eg4M7je4L7fd4L7eb4M7ba4N7k`4O7gm4X7k`4X7fm4Y7j`4Y7dm4W7fm4Y7h`4W7i`4[7he4_7ie5F7if5F7og5E7hh5E7ci5C7`i5B7ih5@7dg4_7ie4^7ed4^7db4_7aa5@7h`5B7i`5C7`a5E7eb5F7ke5E7gg5E7hh5E7`i5B7kh5@7fg4_7he4_7dd4_7fb4_7ca5@7h`5B7lg5P7ci5P7kf5P7lg5P7jh5O7ai5N7ci5K7jh5J7lg5J7hf5J7bf5J7ke5K7gd5N7hc5P7cc5P7dg5J7jf5J7cf5K7od5N7dd5P7kc5P7oa5P7`a5P7k`5N7i`5L7aa5K7na5J7`c5J7h`5J7na5J7k`5^7no6E7in6D7ll6C7gj6A7eg6A7md6A7oa6A6d6C6i}6D6f|6E7in6D7`l6C7ej6B7gg6A7od6A7ma6B7``6C6i}6D7ke6I7he6Q7hf6Q7ng6P7kh6O7bi6N7ci6L7hh6K7gg6I7he6I7dd6I7gb6I7`a6K7k`6L7h`6N7ca6O7db6Q7je6P7fg6P7kh6O7ci6L7jh6K7eg6J7ke6I7gd6I7eb6J7ba6K7k`6L7ai6U7h`6\7`i6V7k`6\7ci6\7i`6U7`i6T7ci6W7ai6Z7ci6]7h`6T7k`6W7i`6Z7k`6]7em7B7nl7A7al7B7ol7B7em7B7ai7B7i`7B7ci7B7k`7B7ai7@7ci7B7i`7@7j`7D7gm7H7cc7H7ba7I7k`7J7h`7L7aa7M7gb7M7fm7I7bc7I7`a7J7k`7J7`i7G7`i7L7je7Q7ke7X7kf7X7mg7X7jh7W7ai7V7bi7T7kh7R7fg7Q7ke7P7gd7P7fb7Q7ca7R7j`7T7k`7U7ba7W7gb7X7ie7X7eg7X7jh7W7bi7T7ih7S7dg7R7je7Q7fd7Q7db7R7aa7S7j`7T7no7\7kn7]7ol7^7dj8@7gg8@7od8@7la8@6g7^6k}7]6f|7\7kn7]7cl7^7fj7_7dg8@7ld8@7na7_7c`7^6k}7]4+hn-V,da-U,bt-V-kf-Z-ex.A.ai.J.lx.V/of/C/nr/S/m|0E0id0X0mi1L0hl2A0hl2V0oi3J0kd3^/o|4Q/nr5C/mf5S.lx6A.ci6L-gx6U-if6\,bt7@,ga7A+hn7A*b|6]*`j6X)nx6P)mh6G(my5\(kl5O(i`5B'kv4S'fn4D'ch3T'mc3D'oa2S'ma2C'oc1R'ah1B'fn0R'iv0C(k`/T(il/G(oy.Z)oh.O)nx.F*`j-_*b|-Y+hn-V*io-@+gb,^+`u-@,kg-C,hy-J-kj-R-dz-^.jh.K.au.[.g/L/jg/_/bm0S/ap1H/ip1]/an2R/fi3F/na3Y.bx4K.bl4[-f~5I-ao5U,g~5^,jl6E+gz6I+kg6K*lt6K*`b6H)cp6B(n~5[(in5R'j5G'nq4['me4N&k{3_&cs3P&hl3A&ch2P&ie2@&ge1O&ag0_&`k0O&`q/_&by/O'ob/@'en.S'j{.F(ej-[(cz-Q)gk-I)`}-D*io-@: `m-P bn-O bo-N jo-M jo-K bo-J bn-I `m-I jk-H bi-H hg-I jf-I je-J be-K be-M je-N jf-O hg-P jo-V jo-U bo-T hm-T `e-T bl-R `l-V ho-\ `e-X ho-\ `e.@ jh-Y jh-^ be.J `n.S `o.R jo.P jo.N `o.M `n.L `m.L bl.L hk.M `k.N `j.Q hi.R bi.R `h.S hf.S he.R be.P be.N he.M hf.L jo.V be.V jo.] jh.V `k.Y be.] jo._ jj/C be/C jo/G jj/C ho/J `e/J ho/J `e/N ho/R `e/N ho/R `e/R jo/X be/T jo/X be/\ hh/V hh/[ ho/_ `e/_ ho/_ jo0C `o0E jn0E hm0F `l0F bk0E hj0E bj0C `j/_ be0Q ho0X hh0S jh0Z ho0X `e0X `f0^ je0] `e0^ je0^ `f0^ bm1B jm1B hn1C bo1C jo1D jo1F bo1G hn1H jm1H jl1H hk1H `j1G `e1B `e1I be1T bl1V be1V bi1V hj1W hk1X `l1Y bl1Z `l1] `g1] je1] be1^ `e2@ he2A bg2B bl2B be2B bl2F be2F bj2F hk2H `l2I bl2J jk2K `j2L `e2L `e2X jo2Z ho3@ hk2] jk2^ bk2_ hj3@ bi3@ bh3@ hf3@ he2_ be2] `e2\ je2Z `f2Z bg2Y `e3L ho3R hg3R bf3Q he3Q `e3P `e3O he3N bf3M hg3M hh3M `l3V `g3V je3V be3W `e3Y he3Z bg3[ bl3[ be3[ bl3_ be3_ bj3_ hk4A `l4B bl4C jk4D `j4E `e4E `e4Q hm4T `n4U jo4V be4V `l5C jj5B ji5A `i5@ bi4_ hi4^ hj4] bl4\ jl4\ `n4] `o4^ jo4_ ho5@ bo5A bn5B `l5C hi5C bg5B je5A `e5@ `e4_ je4] hf4] `l5M jj5L ji5K `i5J bi5I hi5H hj5G bl5F jl5F `n5G `o5H jo5I ho5J bo5K bn5L `l5M hi5M bg5L je5K `e5J `e5I je5G hf5G jo5W be5R jo5P jo5W `e6C hm6F `n6G jo6H be6H `n6U bo6T ho6S ho6R bo6P jm6O `k6O hh6O jf6O je6P `e6R be6R he6T hf6U bh6U jh6U `j6U `k6T jk6R hk6R bk6P bj6O hh6O bl6Y hk6Y bk6Y hk6Z bl6Y bf6Y he6Y be6Y he6Z bf6Y jo7C jo6^ `k6^ jk6^ `l7@ bl7A hk7C hj7D bi7D bh7D hf7D he7C be7A `e7@ je6^ `f6^ bg6] jo7H ho7N hk7K jk7L bk7M hj7N bi7N bh7N hf7N he7M be7K `e7J je7H `f7H bg7G86li @5`s @�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/skymap2.tek�������������������������������������������������������0000644�0001750�0001750�00000125655�07117071210�016362� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������88 867lt @8na(Z7i([8ad([8na(Z8dc(Y8`d(W8bd(U8ec(S8oa(Q8e`(Q7f~(P7jz(P7ex(Q7cw(Q7iu(S7nt(U7lt(W7hu(Y7bw(Z7ex([8bd(U8dc(T8na(R8g`(Q7e~(Q7iz(Q7gx(Q7bw(R7hu(T7nt(U7iz)@7hz)I7`|)I7i})H7f~)G7l~)F7l~)D7g~)A7m|)@7jz(_7by(_7aw)@7ku)A7lt)D7mt)E7ju)G7`w)I7iz)H7m|)H7f~)G7l~)D7f~)B7l|)A7iz)@7ay)@7`w)A7ju)B7lt)D7o~)N7ot)N7n~)O7nt)O7n|)O7d~)Q7l~)S7n~)T7g~)V7n|)W7nt)W7n~)T7d~)V7o|)V7ot)V7n~)L7n~)O7nt)L7ot)Q7nt)T7nt)Y8cd)^7ow)^7iu)_7ot*@7mt*B7ku*C7bw*D8ad)_7mw)_7hu*@7ot*@7n~)\7m~*B7kz*H7jz*Q7b|*Q7k}*P7d~*P7n~*N7m~*L7e~*J7o|*H7hz*H7`y*H7cw*H7iu*J7mt*L7ot*M7hu*P7bw*Q7kz*P7o|*P7d~*P7m~*L7d~*K7n|*I7kz*H7cy*H7bw*I7hu*K7mt*L7m~*W7mt*W7l~*X7lt*X7hz*X7o|*X7d~*Z7n~*[7o~*]7f~*^7j}*^7o|*]7h}*]7g~*]7l~*U7l~*X7lt*U7lt*Z7kz+B7jz+K7b|+K7k}+J7d~+J7n~+H7m~+F7e~+D7o|+B7hz+B7`y+B7cw+B7iu+D7mt+F7ot+G7hu+J7bw+K7kz+J7o|+J7d~+J7m~+F7d~+E7n|+C7kz+B7cy+B7bw+C7hu+E7mt+F8bd+X7nt+X8ad+Y7mt+Y7n|+X7d~+W7n~+U7l~+T7d~+R7n|+P7kz+O7cy+O7bw+P7hu+R7lt+T7nt+U7hu+W7bw+X7l~+T7g~+R7m|+Q7jz+P7by+P7aw+Q7ku+R7lt+T8ad+V8ad+Y7nt+X7mt+[7mt,K7o~,Q7f~,O7l|,N7iz,M7ay,M7`w,N7ju,O7ot,Q7mt,S7iu,U7cw,V7by,W7jz,W7o|,V7e~,U7m~,S7o~,Q7o~,Q7e~,P7o|,N7hz,N7`y,N7cw,N7iu,P7ot,Q7mt,S7ju,T7`w,V7cy,V7kz,V7l|,V7f~,T7m~,S7m~,]7mt,]7l~,^7lt,^7l|,^7f~,_7n~-A7l~-C7e~-E7l|-F7lt-F7l~-C7f~-D7m|-E7mt-E7l~,[7l~,^7lt,[7mt-@7lt-C7lt-H7lt-X8na.C8ad.D7i.D8na.C8dc.B8`d.@8cd-]8fc-[8ma-Z8e`-Z7o~-Z7f~-[7h}-]7a|.A7g{.B7my.D8e`-Z7n~-[7d~-]7m|.A7c|.B7f{.C7my.D7aw.D7ku.B7ot.@7nt-^7iu-\7cw-Z7ay-Z7mt-Z7cw-Z7l~.J7`w.J7ku.J7lt.M7mt.N7ju.P7`w.R7o~.J7cw.J7ju.K7lt.M7l~.R7lt.R7o~.R7ot.R7o~.G7o~.J7o~.O7o~.R7lt.R7ot.T7l~.Z7lo.Z7o~.Z7oo.Z7o|.Z7d~.\7n~.]7l~._7e~/A7n|/B7iz/C7ay/C7bw/B7iu/A7lt._7nt.]7hu.\7cw.Z7l~._7f~/@7o|/A7jz/B7by/B7cw/A7ju/@7lt._7o~.W7o~.Z7oo.W7oo.\7iz/H7hz/Q7`|/Q7i}/P7f~/O7m~/N7l~/L7g~/I7m|/H7kz/G7cy/G7aw/H7ku/I7lt/L7nt/M7ju/O7`w/Q7iz/P7m|/P7f~/O7l~/L7f~/J7l|/I7iz/H7ay/H7`w/I7ju/J7lt/L7o~/V7ot/V7n~/W7nt/W7jz/W7m|/X7g~/Y7m~/[7m~/]7d~/^7h}/^7m|/]7j}/\7e~/]7o~/T7n~/W7ot/T7ot/Y7l~0C7lt0C7o~0C7ot0C7o|0C7e~0E7n~0G7o~0H7d~0K7o|0K7ot0K7o~0H7e~0J7l|0K7lt0K7l~0A7o~0C7lt0A7lt0F7ot0H7lt0N7o~0U7g~0S7m|0R7jz0Q7by0Q7aw0R7ku0S7ot0U7mt0W7ju0Y7`w0[7cy0[7kz0[7l|0[7f~0Y7m~0W7o~0U7o~0U7f~0T7l|0S7iz0R7ay0R7`w0S7ju0T7ot0U7mt0W7ku0X7aw0Z7`y0[7hz0[7m|0Z7g~0X7m~0W7l~1@7mt1D7o~1@7ev1D7o~1H7mt1D7n~0^7o~1B7o~1E7l~1J7j}1N7n|1N7o|1M7k}1M7f~1N7o~1O7o~1R7e~1T7h}1U7c|1U7cw1U7iu1V7lt1W7h}1U7`w1U7ku1U7lt1W7ot1W7`|1U7e{1T7kz1O7oy1M7dx1M7`w1M7ku1M7ot1O7lt1R7ju1S7`w1U7kz1O7ny1N7gx1M7cw1M7ju1N7ot1O7ot2G8ad2K7mt2K8`d2L7lt2L7j2P7ny2P8ad2I8cd2T7k2T8`d2T7l|2L7n|2P7mt2I7mt2N8cd2Y8dc2Y8kb2Y8fc2Z8cd2Y7o~2Y7ot2Y7n~2Z7nt2Z7n~2W7n~2Z7nt2W7ot2\7hz3A7kz3I7c|3I7h}3I7e~3H7o~3F7n~3D7f~3B7l|3A7iz3@7ay3@7`w3A7ju3B7nt3D7lt3F7iu3H7cw3I7hz3I7l|3I7e~3H7n~3D7e~3C7o|3A7hz3A7`y3A7cw3A7iu3C7nt3D8bd3O7nt3O8ad3P7mt3P8ad3M8ad3P7mt3M7mt3R8bd3^7nt3^8ad3_7mt3_7n|3^7e~3]7o~3[7m~3Z7d~3X7o|3V7hz3V7`y3V7cw3V7hu3X7mt3Z7ot3[7iu3]7bw3^7m~3Z7g~3X7n|3W7kz3V7cy3V7bw3W7ku3X7mt3Z8bd3\8ad3_7nt3^7nt4A7i}4L7l~4M7`|4M7i}4L7f~4K7m~4J7m~4G7g~4E7h}4E7`|4E7g{4E7iz4G7`y4K7ex4L7lw4M7l|4E7c|4E7e{4G7ly4K7ay4L7dx4M7dv4M7iu4L7lt4K7lt4H7ju4F7gv4E7lw4E7lt4E7gv4E7ot4]8`a5B8na5C8bd5E7nt5E8dc5E7lt5E7lt5B7nt5H7nt5Z8`d6A8dc5_8ba5]7k}5\7g{5\7nw5]7hu5_7lt6A7nt6B7ku6D7lw6F7g{6F7k}6F8`a6F8gc6D8bd6B8`d6A8`d6A8fc5_8hb5_8aa5^7j}5]7f{5]7mw5^7dv5_7ju5_7lt6A7nt6B7hu6D7gv6D7nw6E7d{6F7h}6F8ba6E8kb6D8dc6D8bd6B8og6K7g|6K8mg6L7e|6L8eb6L8ic6M8`d6O8`d6P8kc6Q8eb6R7e|6R8`d6P8hc6Q8gb6Q7g|6Q8lg6J8mg6L7d|6J7g|6M7d|6P7g|6S7mt7C8aa7F8d`7G7i7F8f`7E8ba7E8ib7F8dc7G8ad7I8`d7L8ec7N8hb7O8ca7O7k7O7d~7O7o|7L7e{7I7kz7G7ay7F7bw7E7nt7E8`d7L8fc7M8ib7N8`a7O7h7O7e~7N7l|7L7e{7I7fv7E7aw7F7cw7G7iu7K7ju7M7dv7O7cw7O7cw7G7mt7K7mt7N7hu7O7cw7O7gx7O8ca7T8f`7U7k7T8d`7T8`a7T8kb7T8fc7U8bd7W8bd7Z8gc7\8ma7]7i7]7g~7\7j}7Z7i}7X8bd7Z8dc7\8oa7\7k7\7d~7\7j}7Z7j}7Z7l|7\7e{7]7ly7^7lw7^7ev7]7ku7\7nt7Z7nt7W7ju7U7gv7T7lw7T7dx7T7cy7T7fx7U7ow7T7c|7\7my7]7mw7]7gv7\7hu7\7nt7Z8`d8E8jc8C8fb8B8o`8A7k8A7b~8B7b}8C7d|8E7e|8F7c}8G7`~8I7j8I8n`8I8db8I8kc8G8ad8F8`d8E8`d8E8hc8D8db8C8n`8B7j8B7`~8C7`}8D7d|8E7e|8F7a}8G7a~8H7h8I8l`8I8eb8H8ic8G8ad8F8`a8N8g`8N7h8N8e`8M8aa8M8hb8N8gc8N8cd8P8cd8S8dc8V8oa8V7k8V7d~8V7k}8S7j}8Q8cd8S8ec8U8la8V7h8V7e~8U7k}8S7k}8S7m|8U7g{8V7my8W7mw8W7gv8V7hu8V7ot8S7ot8P7ku8N7dv8N7mw8M7ex8M7`y8N7gx8N7lw8N7`|8V7oy8V7ow8V7dv8V7iu8U7ot8S8`d9@8gc8]8ba8\7k}8[7g{8[7nw8\7ku8]7lt9@7nt9A7ku9C7lw9E7g{9E7k}9E8`a9E8gc9C8bd9A8`d9@8`d9@8fc8^8kb8]8aa8]7j}8\7f{8\7mw8]7gv8]7ju8^7lt9@7nt9A7hu9C7gv9C7mw9D7d{9E7h}9E8aa9D8kb9C8dc9C8bd9A8bd9N7o~9M8ad9O7o~9M7mt9\8`a9_8g`9_7h9_8e`9^8aa9^8hb9_8gc9_8`d:B8cd:D8dc:G8oa:G7k:G7d~:G7k}:D7k}:B8cd:D8ec:F8la:G7h:G7e~:F7k}:D7k}:D7m|:F7g{:G7ny:H7nw:H7gv:G7hu:G7ot:D7lt:B7ku9_7dv9_7mw9^7ex9^7`y9_7gx9_7lw9_7`|:G7oy:G7ow:G7dv:G7iu:F7ot:D8`a:O8na:P8bd:R7nt:R8gc:Q7ot:Q7lt:O7nt:U7gv:\7hu:\7ot:\7ju:]7gv:\8ma;K8ba;J8e`;K8ca;K8oa;K8ec;K8cd;I8bd;G8ec;E8la;D8e`;C7j};B7by;B7aw;C7ku;D7ot;F7mt;H7ju;J7cw;K7by;L7ny;L7c|;K7j};J7e~;H7f~;G7i};E7`|;D7my;C8bd;G8dc;F8oa;D8d`;D7i};C7ay;C7`w;D7iu;E7ot;F7mt;H7ku;I7aw;K7cy;K7oy;K7a|;K7k};I7e~;H8bd;T8ec;R8oa;Q7k;Q7e~;R7j};T7j};W7f~;Y7i;Z8ma;Z8fc;Y8bd;W8bd;T8bd;T8dc;S8ma;R7i;R7d~;S7j};T7j};W7g~;X7j;Y8na;Y8gc;X8bd;W7j};T7m|;R7c|;Q7hz;Q7lw;Q7gv;Q7iu;R7nt;T7nt;W7ju;Y7ev;Z7lw;[7hz;[7a|;Z7n|;Y7j};W7j};T7l|;S7a|;R7kz;Q7ow;Q7ev;R7hu;S7nt;T7nt;W7ku;X7fv;Y7mw;Z7iz;Z7b|;Y7o|;X7j};W8cd<@7l~<@8bdA$of>B$mi>C$ik>C$on>B$jp>A$cq=_$bq=^$bq=^$ip=]$no=\$ln=\$ik=[$mi=[$lf=\$je=\$md=]$fd=^$gd=_$od>@$je>A$lf>B$oi>B$kk>B$ln>B$no>A$kp>@$cq=_$dp>K$bq>K$fo>K$dp>K$op>J$cq>I$`q>H$lp>G$fp>F$fo>F$ln>G$dn>H$im>J$`m>K$jl>K$no>F$do>G$ln>H$an>J$hm>K$bm>K$jk>K$dk>K$mj>J$mj>H$fk>G$hk>G$jl>F$nj>F$hk>G$`v9I$l9I2mw9H2an9H$nn8F$`n8G$jm8F$cn8E$on8E$no8F$hp8G$cq8H$aq8K$hp8M$oo8M$mn8N$im8N$gl8M$`k8L$oi8H$fi8G$bh8F$cf8E$gd8E$aq8K$jp8L$lo8M$on8M$km8M$dl8M$ak8K$oi8H$ke8E$bf8F$bf8G$od8J$nd8L$ke8M$af8N$bf8G$gd8J$dd8M$od8M$af8N$eg8N$nn8R$an8S$jm8R$`n8R$ln8R$no8R$ip8S$`q8U$bq8W$ip8Y$do8Z$hm8Z$el8Y$jk8W$kk8U$bq8W$kp8X$eo8Y$im8Y$gl8X$jk8W$jk8W$ck8X$li8Z$jh8Z$nf8Z$he8Z$md8Y$fd8W$dd8U$md8S$je8R$lf8R$dg8R$bh8R$eg8S$nf8R$ej8Y$hh8Z$lf8Z$ie8Y$od8X$fd8W$gt8^$oj8^$et8_$mj8_$mo8_$lp9@$bq9A$aq9B$op9C$mo9D$mj9D$aq9B$mp9C$oo9C$oj9C$et8]$et8_$mj8]$nj9@$mj9B$nj9E$bq9I$ak9H$ak9H$fl9I$ml9K$ml9M$dl9O$ak9P$gi9P$ch9P$af9P$ld9O$ed9M$ed9K$nd9I$he9I$mf9H$eg9H$`h9I$fg9I$lf9I$ml9M$fl9N$ck9O$ei9P$ah9P$cf9O$nd9N$ed9M$bq9I$cq9O$jp9I$jp9L$cq9O$nl9\$ck9[$oi9Z$gi9X$ei9X$mi9V$ak9U$nl9T$jm9T$eo9U$ip9V$aq9X$bq9Y$ip9[$fo9\$hm9]$li9]$fg9\$cf9[$od9Z$gd9X$dd9W$od9U$af9U$mf9U$gg9U$mf9V$cf9U$ei9X$li9W$ck9U$ml9U$im9U$go9U$hp9W$aq9X$bq9Y$kp9Z$go9[$jm9\$ni9\$gg9[$af9[$ld9Z$gd9X$aq:A$mj:A$cq:A$oj:A$oo:A$np:B$`q:D$`q:E$mp:F$oo:F$oj:F$`q:E$op:E$mo:F$mj:F$oo:F$op:G$`q:I$`q:J$mp:K$oo:K$oj:K$`q:J$op:J$mo:K$mj:K$cq9_$cq:A$oj9_$lj:C$lj:E$lj:H$lj:J$mj:M$av5Z$m5Z2lw5Z2`n5Z$nn4G$an4H$jm4G$`n4G$ln4G$no4G$ip4H$`q4J$bq4L$ip4N$oo4N$nn4O$jm4O$gl4N$`k4M$li4J$gi4H$bh4G$`f4G$dd4G$bq4L$kp4M$mo4N$on4N$km4N$el4N$bk4L$li4J$he4G$bf4G$cf4H$od4K$od4M$ke4N$bf4O$cf4H$gd4K$ed4N$od4N$bf4O$fg4O$on4S$an4T$km4S$an4S$mn4S$oo4S$ip4T$aq4V$cq4X$jp4Z$do4[$hm4[$fl4Z$kk4X$kk4V$cq4X$kp4Y$fo4Z$jm4Z$gl4Y$kk4X$kk4X$ck4Y$li4[$kh4[$of4[$he4[$nd4Z$gd4X$ed4V$md4T$ke4S$mf4S$eg4S$ch4S$eg4T$of4S$fj4Z$hh4[$lf4[$je4Z$od4Y$gd4X$gt4_$oj4_$et5@$mj5@$mo5@$mp5A$bq5B$bq5C$op5D$mo5E$mj5E$bq5C$np5D$oo5D$oj5D$ft4^$et5@$nj4^$oj5A$nj5C$oj5F$cq5J$bk5I$bk5I$gl5J$nl5L$ml5N$el5P$bk5Q$di5R$`h5R$bf5Q$md5P$ed5N$fd5L$od5J$he5J$nf5I$fg5I$`h5J$gg5J$lf5J$ml5N$fl5O$ck5P$fi5Q$bh5Q$cf5P$nd5O$ed5N$cq5J$cq5P$kp5J$kp5M$cq5P$nl5]$`k5]$oi5[$di5Z$ei5Y$ni5W$ak5V$ol5U$km5U$eo5V$jp5W$aq5Y$bq5Z$jp5\$fo5]$im5^$mi5^$fg5]$`f5]$od5[$dd5Z$dd5X$ld5W$af5V$mf5V$dg5W$nf5W$`f5W$ei5Y$li5X$`k5W$ml5V$im5V$do5W$hp5X$aq5Y$bq5Z$kp5[$do5]$jm5]$ni5]$dg5]$bf5\$md5[$dd5Z$aq6B$mj6B$cq6B$oj6B$oo6B$op6C$`q6E$`q6F$np6G$oo6G$oj6G$`q6F$lp6G$no6G$nj6G$oo6G$op6H$aq6J$`q6K$np6L$lo6M$lj6M$`q6K$lp6L$no6L$nj6L$`q6A$cq6B$lj6A$mj6D$lj6F$mj6I$lj6K$mj6N$on6Q$an6R$km6Q$`n6Q$ln6Q$oo6Q$ip6R$`q6T$bq6V$ip6X$do6Y$hm6Y$el6X$jk6V$kk6T$bq6V$kp6W$eo6X$im6X$gl6W$jk6V$jk6V$ck6W$li6Y$jh6Y$nf6Y$he6Y$md6X$fd6V$dd6T$md6R$ke6Q$lf6Q$dg6Q$ch6Q$eg6R$of6Q$ej6X$hh6Y$lf6Y$ie6X$od6W$fd6V$`q7A$hp6_$on6]$ik6]$mi6]$of6]$ld6_$dd7A$ed7B$ld7D$mf7E$oi7E$kk7E$mn7E$hp7D$aq7B$`q7A$`q7A$kp6_$lo6_$nn6^$kk6]$oi6]$nf6^$he6_$od6_$dd7A$ed7B$md7C$he7D$nf7D$mi7E$ik7E$nn7D$lo7D$ip7C$aq7B$fp7M$`q7N$do7N$fp7M$mp7M$aq7L$bq7J$np7I$dp7I$do7I$nn7I$fn7J$km7L$bm7M$hl7N$lo7I$fo7I$nn7J$cn7L$jm7M$`m7N$hk7N$fk7M$oj7L$oj7J$dk7J$jk7I$hl7I$lj7I$jk7I$bv2K$n2K2nw2K2bn2K$cq2E$hp2D$on2B$ik2B$mi2B$of2B$ld2D$gd2E$dd2G$ld2I$mf2J$oi2J$kk2J$mn2J$hp2I$`q2G$cq2E$cq2E$kp2D$lo2D$nn2C$kk2B$oi2B$nf2C$he2D$od2D$gd2E$dd2G$md2H$he2I$nf2I$mi2J$ik2J$nn2I$lo2I$ip2H$`q2G$gt2N$oj2N$et2O$mj2O$mo2O$mp2P$bq2Q$bq2R$lp2T$mo2T$mj2T$bq2R$np2S$lo2T$lj2T$ft2M$et2O$nj2M$oj2P$nj2R$oj2U$`v.]$l.]2mw.]2an.]$bq-S$jp-Q$nn-P$kk-O$oi-O$nf-P$nd-Q$fd-S$gd-T$nd-V$of-W$mi-X$ik-X$on-W$jp-V$cq-T$bq-S$bq-S$ip-R$no-Q$ln-Q$jk-P$ni-P$lf-Q$je-Q$md-R$fd-S$gd-T$ld-V$je-V$lf-W$oi-W$kk-W$ln-W$no-V$hp-V$cq-T$ft-\$nj-\$dt-]$lj-]$lo-]$op-]$aq-_$aq.@$np.A$lo.B$lj.B$aq.@$lp.A$no.A$nj.A$dt-[$dt-]$lj-[$mj-^$mj.@$mj.C$cq.I$hp.H$on.F$hk.F$li.F$of.F$ld.H$gd.I$dd.K$od.L$lf.N$oi.N$kk.N$ln.N$kp.L$`q.K$cq.I$cq.I$jp.H$lo.H$mn.G$kk.F$oi.F$mf.G$he.H$nd.H$gd.I$dd.K$md.L$ke.L$nf.M$li.N$hk.N$nn.M$oo.L$ip.L$`q.K$`q.V$ip.T$ln.S$ik.R$mi.R$lf.S$md.T$dd.V$ed.W$ld.Y$mf.Z$oi.Z$kk.Z$mn.Z$hp.Y$aq.W$`q.V$`q.V$kp.T$mo.T$nn.S$hk.S$li.S$nf.S$ie.T$od.T$dd.V$ed.W$nd.X$he.Y$of.Y$mi.Z$ik.Z$on.Y$lo.Y$jp.X$aq.W$`q._$lj._$bq._$nj._$no._$mp/@$cq/A$cq/B$lp/D$no/D$nj/D$cq/B$np/C$lo/D$lj/D$no/D$np/E$cq/F$cq/G$lp/I$no/I$nj/I$cq/G$np/H$lo/I$lj/I$bq.]$bq._$nj.]$oj/@$oj/B$oj/E$oj/G$lj/K$mn/N$`n/O$im/N$cn/M$on/M$mo/N$hp/O$cq/P$aq/S$hp/U$fo/U$jm/U$dl/U$ik/S$ik/Q$aq/S$jp/T$do/U$hm/U$fl/T$ik/S$ik/S$bk/T$ni/U$ih/V$mf/V$je/U$ld/U$ed/S$gd/P$ld/O$ie/N$of/M$gg/M$ah/N$dg/O$mf/N$dj/U$jh/U$nf/U$he/U$nd/T$ed/S$bq/]$kp/[$nn/Z$hk/Z$li/Z$nf/Z$od/[$fd/]$gd/^$nd0@$of0A$ni0B$jk0B$on0A$jp0@$cq/^$bq/]$bq/]$ip/\$oo/[$ln/[$jk/Z$ni/Z$lf/[$ke/[$md/\$fd/]$gd/^$ld0@$je0@$mf0A$oi0A$kk0A$mn0A$no0@$hp0@$cq/^$ep0J$cq0J$go0J$ep0J$op0I$cq0H$`q0G$lp0F$gp0E$go0E$ln0F$dn0G$im0I$am0J$kl0J$oo0E$do0F$ln0G$an0I$im0J$cm0J$kk0J$ek0J$mj0I$nj0G$fk0F$hk0F$kl0E$oj0E$hk0F$av+N$m+N2lw+O2`n+O$cq*T$hp*S$on*Q$ik*Q$mi*Q$of*Q$ld*S$gd*T$dd*V$od*W$lf*Y$oi*Y$kk*Y$ln*Y$kp*W$`q*V$cq*T$cq*T$jp*S$lo*S$mn*R$kk*Q$oi*Q$mf*R$he*S$nd*S$gd*T$dd*V$md*W$ke*W$nf*X$li*Y$hk*Y$nn*X$oo*W$ip*W$`q*V$gt*]$oj*]$et*^$mj*^$mo*^$mp*_$bq+@$bq+A$op+B$mo+C$mj+C$bq+A$np+B$oo+B$oj+B$ft*\$et*^$nj*\$oj*_$nj+A$oj+D$`q+K$ip+I$ln+H$jk+G$ni+G$lf+H$md+I$dd+K$ed+L$md+N$nf+O$li+P$hk+P$nn+O$ip+N$aq+L$`q+K$`q+K$hp+J$mo+I$on+H$hk+H$li+H$of+H$ie+I$ld+J$dd+K$ed+L$nd+M$ie+N$of+N$ni+O$jk+O$on+N$mo+N$jp+M$aq+L$nn+U$go+V$bq+X$fd+X$hp+X$dd+X$fd+U$dd+[$aq,@$mj,@$cq,@$oj,@$oo,@$op,A$`q,C$`q,D$np,E$oo,E$oj,E$`q,D$lp,E$no,E$nj,E$oo,E$op,F$aq,H$`q,I$np,J$lo,K$lj,K$`q,I$lp,J$no,J$nj,J$`q+_$cq,@$lj+_$mj,B$lj,D$mj,G$lj,I$mj,L$bv'_$n'_2ow(@2cn(@$`q&V$hp&T$ln&S$ik&R$mi&R$lf&S$ld&T$dd&V$ed&W$ld&Y$mf&Z$oi&Z$kk&Z$mn&Z$hp&Y$aq&W$`q&V$`q&V$kp&T$lo&T$nn&S$hk&S$li&S$nf&S$he&T$od&T$dd&V$ed&W$nd&X$he&Y$nf&Y$mi&Z$ik&Z$nn&Y$lo&Y$jp&X$aq&W$dt&_$lj&_$ft&_$nj&_$no&_$mp'@$cq'A$cq'B$lp'D$no'D$nj'D$cq'B$np'C$lo'D$lj'D$ft&]$ft&_$nj&]$oj'@$oj'B$oj'E$aq'L$jp'J$mn'I$jk'H$ni'H$mf'I$nd'J$ed'L$fd'M$md'O$nf'P$mi'Q$ik'Q$nn'P$ip'O$bq'M$aq'L$aq'L$hp'K$no'J$on'I$ik'I$mi'I$of'I$je'J$ld'K$ed'L$fd'M$od'N$ie'O$lf'P$ni'P$jk'P$ln'P$mo'O$kp'N$bq'M$on'V$go'W$cq'Y$gd'Y$hp'Y$dd'Y$gd'V$ed'\$bq(A$nj(A$`q(B$lj(B$lo(B$op(B$aq(D$aq(E$np(F$lo(G$lj(G$aq(E$lp(F$no(F$nj(F$lo(G$lp(H$aq(I$aq(J$np(K$lo(L$lj(L$aq(J$lp(K$no(K$nj(K$`q(@$`q(B$lj(@$mj(C$mj(E$mj(H$mj(J$nj(M$on(P$bn(Q$km(P$an(P$mn(P$oo(P$jp(Q$aq(S$cq(U$jp(W$do(X$hm(X$fl(W$kk(U$kk(S$cq(U$hp(W$fo(W$jm(W$dl(W$kk(U$kk(U$`k(W$li(X$kh(X$of(X$he(X$nd(W$gd(U$ed(S$nd(Q$ke(P$mf(P$eg(P$ch(P$fg(Q$of(P$fj(W$hh(X$lf(X$je(W$ld(W$gd(U$`q)@$ip(^$ln(]$jk(\$ni(\$lf(]$md(^$dd)@$ed)A$ld)C$mf)D$li)E$hk)E$mn)D$hp)C$aq)A$`q)@$`q)@$kp(^$mo(^$nn(]$hk(]$li(]$nf(]$ie(^$od(^$dd)@$ed)A$nd)B$he)C$of)C$mi)D$ik)D$on)C$lo)C$jp)B$aq)A$gp)L$aq)M$eo)M$gp)L$mp)L$aq)K$bq)I$np)H$ep)H$eo)H$nn)H$fn)I$km)K$cm)L$il)M$mo)H$fo)H$nn)I$cn)K$km)L$am)M$ik)M$gk)L$oj)K$lj)J$dk)I$jk)H$il)H$mj)H$jk)H&hn%O&hn%Y&hn?H&hn>^&hr#M&nq#M&dq#M&mq#L&ir#L&ls#M&ft#M&bu#O&cu#Q>#S&ms#T&hr#U&dq#U&ap#T&nn#R&jm#O&am#N&lk#M&aj#L&ah#L&cu#Q&dt#S&os#S&ir#T&eq#T&cp#S&on#Q&jm#O&ei#L&`j#M&aj#N&mh#Q&lh#S&ei#T&`j#U&aj#N&ah#Q&ch#S&mh#T&`j#U&dk#U&ir#Y&oq#Y&eq#Y&nq#X&jr#X&ms#Y>#Y&bu#[&`u#^&dt$@&bs$@&fq$@&`p$@&ho#^&io#\&`u#^&et#_&`s$@&dq$@&ap#_&ho#^&ho#^&mn#_&jm$@&dl$A&hj$A&fi$@&lh$@&`h#^&bh#[&oh#Y&ei#Y&jj#X&fk#X&mk#Y&gk#Y&ij#Y&dn$@&fl$@&jj$@&di$@&mh#_&`h#^&`u$G&kt$E&ks$D&er$D&eq$D&cp$D&co$E&hn$G&hn$H&ao$I&ap$J&gq$J&gr$J&is$J&it$I&`u$H&`u$G&`u$G&it$F&is$E&gr$D&gq$D&ap$E&ao$F&hn$G&hn$H&`o$I&cp$I&eq$J&er$J&ks$I&ht$I&`u$H&jr$N&mq$O&fq$N&lq$N&hr$N&ns$N&et$O&`u$Q&bu$S&et$U&ls$V&jr$V&fq$V&`p$V&ln$T&hm$Q&cm$O&nk$N&`j$N&`h$N&bu$S>$T&ms$U&hr$V&dq$V&ap$U&nn$S&hm$Q&di$N&bj$N&cj$O&oh$R&oh$T&di$V&bj$V&cj$O&ch$R&ah$U&lh$V&bj$V&fk$V&cu$]&dt$\&kr$Z&io$Z&im$Z&kj$Z&lh$\&ch$]&`h$_&lh%A&hj%B&km%B&ko%B&hr%B&dt%A&`u$_&cu$]&cu$]&ft$\&ls$\&jr$[&ko$Z&km$Z&jj$[&di$\&nh$\&ch$]&`h$_&mh%@&di%A&jj%A&hm%B&ho%B&jr%A&ls%A&et%@&`u$_&`u%J&np%I&cu%J&np%I+do%O+do%Y+do?H+do>^+ds#J+jr#J+`r#J+ir#I+es#I+ht#J+bu#J+nu#L+ou#N+cu#P+it#Q+ds#R+`r#R+mp#Q+jo#O+fn#L+mm#K+hl#J+mj#I+mh#I+ou#N+`u#P+kt#P+es#Q+ar#Q+op#P+ko#N+fn#L+aj#I+lj#J+mj#K+ii#N+hi#P+aj#Q+lj#R+mj#K+mh#N+oh#P+ii#Q+lj#R+`l#R+es#V+kr#V+ar#V+jr#U+fs#U+it#V+cu#V+nu#X+lu#[+`u#]+ns#]+br#]+lp#]+dp#[+ep#Y+lu#[+au#\+ls#]+`r#]+mp#\+dp#[+dp#[+io#\+fn#]+`m#^+dk#^+bj#]+hi#]+lh#[+nh#X+ki#V+aj#V+fk#U+bl#U+il#V+cl#V+ek#V+`o#]+bm#]+fk#]+`j#]+ii#\+lh#[+lu$D+gu$B+gt$A+as$A+ar$A+op$A+oo$B+do$D+do$E+mo$F+mp$G+cr$G+cs$G+et$G+eu$F+lu$E+lu$D+lu$D+eu$C+et$B+cs$A+cr$A+mp$B+mo$C+do$D+do$E+lo$F+op$F+ar$G+as$G+gt$F+du$F+lu$E+fs$K+ir$L+br$K+hr$K+ds$K+jt$K+au$L+lu$N+nu$P+au$R+ls$S+`r$S+mp$R+fp$P+fp$N+nu$P+cu$Q+ms$R+ar$R+op$Q+fp$P+fp$P+ko$Q+dn$S+bm$S+fk$S+`j$S+ii$R+nh$P+lh$N+ii$L+bj$K+dk$K+`l$K+jl$K+al$L+fk$K+ao$R+`m$S+dk$S+aj$R+ki$Q+nh$P+ou$Z+`u$Y+gs$W+ep$W+en$W+gk$W+hi$Y+oh$Z+lh$\+hi$^+dk$_+gn$_+gp$_+ds$_+`u$^+lu$\+ou$Z+ou$Z+bu$Y+ht$Y+fs$X+gp$W+gn$W+fk$X+`j$Y+ji$Y+oh$Z+lh$\+ii$]+`j$^+fk$^+dn$_+dp$_+fs$^+ht$^+au$]+lu$\+lu%G+jq%F+ou%G+jq%F0lo%O0lo%Y0lo?H0lo>^0ns#J0`s#K0jr#J0cs#I0os#I0bu#J0hu#K0dv#M0ev#O0iu#Q0cu#Q0ns#R0jr#R0gq#Q0`p#P0ln#M0gn#K0bm#J0gk#I0gi#I0ev#O0ju#P0au#Q0os#Q0kr#Q0eq#Q0ap#O0ln#M0kj#I0fk#J0gk#K0cj#N0bj#P0kj#Q0fk#R0gk#K0gi#N0ei#Q0cj#Q0fk#R0jl#R0os#V0as#W0kr#V0`s#V0ls#V0cu#V0iu#W0dv#Y0fv#[0ju#]0dt#^0hr#^0fq#]0np#[0op#Y0fv#[0ku#\0ft#]0jr#]0gq#\0np#[0np#[0cp#\0ln#^0jm#^0nk#^0hj#^0bj#]0fi#[0di#Y0aj#W0kj#V0lk#V0hl#V0cm#V0il#W0ok#V0jo#]0hm#^0lk#^0jj#]0cj#\0fi#[0fv$D0mu$C0mt$B0ks$A0kr$A0eq$B0ep$C0no$D0no$E0gp$F0gq$G0ir$H0is$H0ot$G0ou$F0fv$E0fv$D0fv$D0ou$C0ot$B0is$B0ir$B0gq$B0gp$C0no$D0no$E0fp$F0eq$G0kr$G0ks$G0mt$G0nu$F0fv$E0`u$Q0di$Q0fv$Q0fi$Q0fv$Q0cm$J0bm$T0di$O0fi$S0ev$[0ju$Y0ms$X0op$W0on$W0mk$X0bj$Y0ei$[0fi$\0bj$^0nk$_0mn%@0mp%@0ns$_0ju$^0fv$\0ev$[0ev$[0hu$Z0bu$Y0ls$Y0mp$X0mn$X0lk$Y0jj$Y0`j$Z0ei$[0fi$\0cj$]0jj$^0lk$_0nn$_0np$_0ls$_0bu$^0ku$]0fv$\0fv%G0`r%G0ev%H0`r%G8+nc!T+hb!T+`a!T*n~!T*g}!V*l|!Y*l|![*f}!\*a~!]*h!^+`a!^+ec!]+hd![+de!Y+ge!V+id!U+oa!Q+aa!P+ca!N+la!N+dc!N+kd!N+af!P+`a!T*j!T*c~!V*d}!Y*g}![*a~!]+`a!^+ib!]+lc![+hd!Y+hd!V+nc!T+jb!R+la!Q+na!O+kb!N+oc!N+af!P+fj!\+`k!]+fj!]+li!]+ni!\+ej![+ck!Z+il!Z+mn!Z+gp!Z+mp![+jq!\+jq!]+np!^+go!_+kl"@+ik"A+ej"B+li"D+ni"E+mn!Z+oo!Z+ep![+np!\+np!]+fp!^+on!_+kl"@+ni"D+dj"D+hk"D+dn"E+lo"E+np"D+hq"D+hk"D+fn"E+fp"E+lp"E+hq"D+hq"C+ax!Z+gv!Z+fu!\+lt!_+ot"@+fu"C+dv"E+bx"E+by"E+hz"E+n{"C+g|"@+d|!_+n{!\+kz!Z+ay!Z+ax!Z+ax!Z+ov!Z+ev![+nu!\+du!_+gu"@+nu"C+fv"D+lv"E+bx"E+by"E+`z"E+jz"D+f{"C+o{"@+l{!_+f{!\+iz![+cz!Z+ay!Z,mb!Z,ca!Z,b`!\+h!_+k"@,b`"C,`a"E,nb"E,nc"E,he"E,jf"C,cg"@,`g!_,jf!\,ke!Z,mc!Z,mb!Z,mb!Z,oa!Z,aa![,j`!\,``!_,c`"@,j`"C,ba"D,la"E,nb"E,nc"E,`e"E,je"D,bf"C,kf"@,hf!_,bf!\,ie![,ce!Z,mc!Z,im!Z,cl!Z,nj!\,dj!_,gj"@,nj"C,`l"E,jm"E,nn"E,dp"E,fq"C,cr"@,`r!_,fq!\,gp!Z,mn!Z,im!Z,im!Z,kl!Z,al![,jk!\,lj!_,oj"@,jk"C,bl"D,hl"E,jm"E,nn"E,lo"E,fp"D,np"C,gq"@,dq!_,np!\,ep![,oo!Z,mn!Z#cu1T#jt1R#as1Q#jq1P#go1O#gm1O#nk1P#bk1R#`k1T#nk1U#cn1W#`p1Y#bs1Z#au1[#cu1T#it1S#cs1Q#iq1Q#fo1P#fm1P#mk1Q#bk1R#cu1T#au1V#kt1W#as1X#gm1Y#nk1Z#ak1[#au1V#ht1W#cs1W#dm1Y#ok1Y#ak1[#`k1\#ml2@#cl2@#ik2@#cl1_#ol1_#mm2@#gn2@#nn2B#on2D#en2F#om2F#ml2G#ik2G#kj2F#ii2E#fh2B#ng2A#mf2@#ce1_#kc1_#on2D#gn2E#mm2F#ol2F#kk2F#ij2F#ki2D#fh2B#kd1_#ae2@#be2A#`d2D#cd2E#kd2F#ae2G#be2A#hc2D#ic2F#cd2F#ae2G#ef2G#on2M#en2L#ml2K#bj2J#fh2J#ie2K#ad2L#kc2M#hc2O#bd2P#ke2Q#eh2R#aj2R#ol2Q#fn2P#ln2O#on2M#on2M#gn2L#mm2L#ol2K#aj2K#eh2K#ke2K#id2L#cd2L#kc2M#hc2O#`d2P#jd2P#he2Q#gh2Q#cj2Q#ll2Q#nm2P#dn2P#ln2O#on2X#dn2W#ll2V#bj2U#fh2U#he2V#`d2W#kc2X#kc2Y#bd2[#je2\#dh2]#`j2]#nl2\#fn2[#on2Y#on2X#on2X#fn2W#lm2W#nl2V#`j2V#dh2V#je2V#hd2W#bd2W#kc2X#kc2Y#cd2Z#jd2[#he2\#fh2\#bj2\#ll2\#nm2[#gn2Z#on2Y#nn3C#dn3B#ol3@#aj3@#eh3@#ke3@#`d3B#jc3C#jc3D#ad3F#ie3G#gh3G#cj3G#ml3G#en3F#nn3D#nn3C#nn3C#fn3B#lm3B#ml3A#cj3@#gh3@#ie3A#hd3B#bd3B#jc3C#jc3D#cd3E#id3F#ke3F#eh3G#aj3G#ol3F#mm3F#gn3E#nn3D8+cw;L1ba9U4`j5E4`j/R1ba+A+aw)J&bm+A#`d/R#`d5E&bm9U+cw;L8866h{ @7lj,P6h{,P7oj,P6k{,P7nj,Y6j{,Y7mj,Z6i{,Z7lj,N7lj,S7mj,W7mj,\7kc,P7jc,Y6h{,N6h{,S6i{,W6i{,\7ih-I7lj-J7df-J7ih-I7`j-H7oj-E7nj-C7bj-A7hh-@7`g-@7ke-@7be-A7gd-B7mb-G7cb-H7h`-J7`g-@7je-A7ce-B7ic-G7ob-H7ab-I7h`-J6l}-J6g|-H6j{-F6i{-D6e|-B6o}-@6l-@6h{-@6o}-@7oj-R6k{-R7nj-S6j{-S7nj-N7gf-M7oj-M7nj-X7ff-X7oj-W6j{-P6k{-U6j{.H7kh.T7ff.U7nj.U7kh.T7aj.S7lj.Q7oj.O7bj.M7hh.L7ag.K7be.J7fa.J6a.K6l}.L6f|.M6k{.O6h{.Q6e|.S6o}.T7oj.O7aj.N7kh.L7`g.L7ae.K7ea.K6`.L6o}.L6e|.N6k{.O7ga.T6k{.T7fa.U6j{.U7fa.R7fa.W7ke.\6o}.\6e|.]6j{._6h{/A6e|/C6n}/D7ie.]6m}.]6d|.^6j{._7je/D6j{/D7ie/E6i{/E7je.Z7ie.]7je/B7ie/E6j{/D6j{/G7nj/L7cj/K7fi/L7aj/M7nj/L7je/L6j{/L7ie/M6i{/M7ie/J7ie/M6i{/J6j{/O7oj/[6k{/[7nj/\6j{/\7kc/[7ae/Z7ke/X7ie/W7ae/U7kc/S7da/S6l/S6o}/S6e|/U6i{/W6k{/X6e|/Z6o}/[7ie/W7`e/V7jc/T7ga/S6o/S6n}/T6d|/V6i{/W7nj/Y7nj/\6k{/[6j{/^7da0C7fa0K7nb0K7gd0J7ae0J7ke0H7je0F7ae0D7hc0C7ea0B6m0B6l}0C6e|0D6j{0F6h{0H6e|0J6n}0K7ga0J7kc0J7ae0J7je0F7`e0E7kc0C7da0C6l0C6o}0C6d|0E6j{0F6i{0\7kh1G7nj1H7ff1H7kh1G7aj1F7mj1D7lj1B7cj0_7ih0^7ag0^7he0_7ce0_7ed1A7nb1E7`b1G7j`1H7ag0^7ke0_7ae1A7jc1E7lb1G7cb1G7j`1H6n}1H6d|1G6k{1D6k{1B6f|1@6l}0_6m0^6i{0^6l}0_7mj1N6i~1N6d|1O6j{1P6k{1Q6e|1S6l}1T7lj1O6h~1O6g|1O6j{1P7he1L7ke1Q7dd1Y7hc1Y7ic1X7ed1X7`e1Y7je1Z7je1]7ce1^7fd1_7mb2@6m}2@6d|2A6k{2A7fd1_6n}1_6e|2@6k{2A6j{2B7nb1_7cb1^7fa1Z7i`1X6c1W6o}1W6e|1X6j{1Z6k{1\6e|1^6n}1_7fa1Z7h`1Y6a1X6m}1X6d|1Y6j{1Z7je2G6j{2G7ie2H6i{2H7ea2H7hc2I7be2J7ke2K7he2N7ce2N7gd2N7hc2N7ed2M7`e2N7ie2E7ie2H6i{2E6j{2J6k{2^7hh3K7gf3K7oj3K7hh3K7bj3I7mj3G7oj3E7cj3C7ih3B7bg3A7ce3@7ga3@6b3A6m}3B6g|3C6k{3E6i{3G6f|3I6l}3K6c3K7oj3E7bj3D7hh3C7ag3B7be3A7fa3A6a3B6l}3C6f|3D6k{3E7fd3Q7jc3Q7kc3P7gd3P7be3Q7ke3R7ke3U7ae3W7dd3X7ob3X6o}3X6e|3Y6h{3Z7dd3X6l}3X6g|3X6h{3Z6k{3Z7lb3X7ab3W7ga3R7k`3P6`3P6l}3P6g|3P6k{3R6h{3U6f|3V6l}3X7ga3R7j`3Q6c3P6o}3P6f|3Q6k{3R7oj3_6k~3_6f|4@6h{4B6j{4C6d|4E6o}4E7nj4@6j~4@6e|4A6h{4B7ke3]7je4C7gd4J7kc4J7hc4J7dd4J7ce4J7ie4L7he4O7be4P7ed4Q7lb4R6l}4R6g|4R6i{4S7ed4Q6m}4Q6d|4R6i{4S6h{4T7mb4Q7bb4P7ea4L7h`4J6a4I6m}4I6d|4J6i{4L6i{4N6g|4O6m}4Q7ea4L7k`4J6`4J6l}4J6g|4J6i{4L7mj4Y6i{4Y7oj4Y6k{4Y7lj4W7oj4Y6h{4W6h{4\7he5D7ce5A7ic5@7ga4_6o4_6m}5@6g|5A6h{5D6j{5E6f|5G6l}5I6o5I7ga5I7hc5I7be5G7je5E7he5D7he5D7be5B7hc5A7ea5@6m5@6l}5A6f|5B6h{5D6j{5E6g|5F6m}5H6l5I7da5I7ic5H7ce5F7je5E7ke5Q7ae5P7fd5O7ob5N7ga5N6n5O6a5P6k~5Q6i~5S6b5T6m5U7da5V7lb5V7ed5U7be5T7ie5S7ke5Q7ae5P7jc5O7j`5O6a5P6b5T7i`5U7ic5U7be5T7ed5U7`e5V7je5W7be5W7`e5V6n5O6c5N6l}5N6`}5N6k{5N6lz5Q6nz5T6cz5V6fy5W6`}5N6g|5N6h{5Q6j{5T6oz5V6fy5W6jx5W6gw5V6jv5T6iv5P6dw5N6ix5M6ey5M6lz5N6i{5P6h{6H7hm6P7bl6N7aj6M7cg6K7hc6K7h`6K6c}6K6az6M6bx6N6hv6P7bl6N7ei6M7bg6L7kc6K7k`6K6b}6L6mz6M6bx6N7jh6^7ef6_7mj6_7jh6^7`j6]7oj6Z7nj6Y7aj6W7kh6U7`g6U7ae6T7ea6T6`6U6o}6U6e|6W6j{6Y6k{6Z6d|6]6n}6^7nj6Y7`j6X7jh6V7cg6U7`e6U7da6U6c6U6n}6V6d|6X6j{6Y7fa6^6j{6^7ea6_6i{6_7ea6\7ea7A7ih7N7lj7O7df7O7ih7N7`j7M7oj7J7nj7H7bj7F7hh7E7`g7E7ke7E7be7F7gd7G7mb7L7cb7M7h`7O7`g7E7je7F7ce7G7ic7L7ob7M7ab7N7h`7O6l}7O6g|7M6j{7K6i{7I6e|7G6o}7E6l7E6h{7E6o}7E7jh7]7ef7^7mj7^7jh7]7`j7\7lj7Z7nj7X7aj7V7kh7T7ag7T7be7S7fa7S6a7T6o}7T6e|7V6j{7X6h{7Z6d|7\6n}7]6a7^7nj7X7`j7W7jh7U7cg7T7ae7T7ea7T6c7T6n}7U6d|7W6j{7X7jm8B7`l8D7bj8E7`g8G7kc8G7k`8G6`}8G6bz8E6`x8D6jv8B7`l8D7fi8E7ag8F7hc8G7h`8G6a}8F6nz8E6`x8D47bc,A7ad,A7jd,@7jd+_7cd+^7bc+^7cb+^7ja+_7ja,@7ab,A7bc,A7hd,@7ha,@7bc+^7bc,A7`c,@1or+X1cs+X1fs+X1ds+X1cs+W1or+W1kr+W1dr+X1fr+X1kr+X1or+X1es+X1er+X1or+W1or+X1mr+X.dx&D.dy&E.dx&D.dw&E.dx&D.dy&C.dx&D.dw&C0mh1P0di1P0ki1O0ii1O0di1O0oh1N0dh1O0ah1O0ch1O0dh1P0mh1P0ji1O0bh1O0oh1N0mh1P0nh1O,c|,\,j|,\,`},\,b},[,h|,[,c|,Z,h{,[,b{,[,`{,\,j{,\,c|,\,c},[,c{,[,c|,Z,c|,\,c|,[2hv*V2lv*V2cw*U2aw*U2lv*U2hv*U2dv*U2av*U2cv*U2dv*V2hv*V2bw*U2bv*U2hv*U2hv*V2jv*U2fr-\2mr-\2`s-\2bs-[2mr-[2dr-[2mq-[2jq-[2hq-\2mq-\2fr-\2cs-[2kq-[2dr-[2fr-\2gr-[2hc.H2cd.G2id.G2kd.F2ad.F2hc.F2ac.F2kb.F2ib.G2cc.G2hc.H2hd.G2hb.G2hc.F2hc.H2hc.G1am1F1hm1F1om1E1mm1E1hm1E1cm1D1hl1E1el1E1gl1E1hl1F1am1F1nm1E1fl1E1cm1D1am1F1bm1E-lt(O-gu(N-ju(N-hu(N-gu(M-nt(M-gt(M-`t(N-bt(N-gt(N-lt(O-iu(N-at(N-nt(M-lt(O-mt(N+`})B+k})A+n})A+l})A+k})@+b})@+k|)@+d|)A+f|)A+k|)A+`})B+m})A+e|)A+b})@+`})B+a})A+jx,R+ay,R+dy,R+fy,Q+ay,Q+hx,Q+ax,Q+nw,Q+lw,R+ax,R+jx,R+gy,Q+ow,Q+hx,Q+jx,R+kx,Q0mw.[0dx.[0kx.Z0ix.Z0dx.Z0ow.Y0dw.Z0aw.Z0cw.Z0dw.[0mw.[0jx.Z0bw.Z0ow.Y0mw.[0nw.Z0bs0V0fs0V0is0V0ks0U0fs0U0bs0U0nr0U0kr0U0ir0V0nr0V0bs0V0hs0V0hr0V0bs0U0bs0V0`s0V,`}*G,d}*G,k}*F,i}*F,d}*F,`}*F,l|*F,i|*F,k|*F,l|*G,`}*G,j}*F,j|*F,`}*F,`}*G,b}*F,ks,[,au,],ks,[,ar,],ks,[,au,Z,ks,[,ar,Z.am(C.hm(C.om(B.mm(B.hm(B.cm(A.hl(B.el(B.gl(B.hl(C.am(C.nm(B.fl(B.cm(A.am(C.bm(B,mc,J,dd,J,kd,I,id,I,dd,I,oc,H,dc,I,ac,I,cc,I,dc,J,mc,J,jd,I,bc,I,oc,H,mc,J,nc,I+id1N+md1N+`e1N+be1M+md1M+id1M+ed1M+bd1M+`d1N+ed1N+id1N+ce1M+cd1M+id1M+id1N+kd1M/hr'M/cs'L/fs'L/ds'L/cs'K/jr'K/cr'K/lq'L/nq'L/cr'L/hr'M/es'L/mq'L/jr'K/hr'M/ir'L+es%U+ls%U+ft%T+dt%T+ns%S+es%S+nr%S+dr%T+fr%T+lr%U+es%U+et%T+er%T+es%S+es%U+es%T.da.C.oa.B.bb.B.`b.B.oa.A.fa.A.o`.A.h`.B.j`.B.o`.B.da.C.ab.B.i`.B.fa.A.da.C.ea.B)dw-F)ow-E)bx-E)`x-E)ow-D)fw-D)ov-D)hv-E)jv-E)ov-E)dw-F)ax-E)iv-E)fw-D)dw-F)ew-E+ej&S+ek&T+ej&S+ei&T+ej&S+ek&R+ej&S+ei&R)hd,H)ce,G)fe,G)de,G)ce,F)jd,F)cd,F)lc,G)nc,G)cd,G)hd,H)ee,G)mc,G)jd,F)hd,H)id,G2ml&Y2am&Y2dm&Y2fm&X2am&X2ml&X2il&X2fl&X2dl&Y2il&Y2ml&Y2gm&X2gl&X2ml&X2ml&Y2ol&X0di.T0oi.S0bj.S0`j.S0oi.R0fi.R0oh.R0hh.S0jh.S0oh.S0di.T0aj.S0ih.S0fi.R0di.T0ei.S.ko,I.bp,I.ep,I.gp,H.bp,H.io,H.bo,H.on,H.mn,I.bo,I.ko,I.dp,I.ln,I.io,H.ko,I.ho,I*i}/T*m}/T*`~/T*b~/S*m}/S*i}/S*e}/S*b}/S*`}/T*e}/T*i}/T*c~/S*c}/S*i}/S*i}/T*k}/S,mq'T,dr'T,kr'S,ir'S,dr'S,oq'R,dq'S,aq'S,cq'S,dq'T,mq'T,jr'S,bq'S,oq'R,mq'T,nq'S*kw-T*ow-T*bx-T*`x-T*ow-S*kw-S*gw-S*`w-T*bw-T*gw-T*kw-T*ax-T*aw-T*kw-S*kw-T*iw-T,nj0U,mk0U,fl0T,fl0S,ok0R,nj0R,oi0R,fi0S,fi0T,mi0U,nj0U,dl0T,di0T,nj0R,nj0U,lj0T*ki+G*bj+G*ej+G*gj+F*bj+F*ii+F*bi+F*oh+F*mh+G*bi+G*ki+G*dj+G*lh+G*ii+F*ki+G*hi+G(ou)S(fv)S(iv)S(kv)R(fv)R(mu)R(fu)R(cu)R(au)S(fu)S(ou)S(hv)S(`u)S(mu)R(ou)S(lu)S)e.^)l.^*f`.]*d`.])n.\)e.\)n~.\)d~.])f~.])l~.^)e.^*e`.])e~.])e.\)e.^)e.](fb*W(mb*W(`c*W(bc*V(mb*V(db*V(ma*V(ja*V(ha*W(ma*W(fb*W(cc*V(ka*V(db*V(fb*W(gb*V)bu(Y)iu(Y)cv(X)av(X)ku(W)bu(W)kt(W)at(X)ct(X)it(Y)bu(Y)bv(X)bt(X)bu(W)bu(Y)bu(X+fi)D+mi)D+`j)D+bj)C+mi)C+di)C+mh)C+jh)C+hh)D+mh)D+fi)D+cj)C+kh)C+di)C+fi)D+gi)C'fu+^'mu+^'`v+^'bv+]'mu+]'du+]'mt+]'jt+]'ht+^'mt+^'fu+^'cv+]'kt+]'du+]'fu+^'gu+]-ak)N-hk)N-bl)M-`l)M-jk)L-ak)L-jj)L-`j)M-bj)M-hj)N-ak)N-al)M-aj)M-ak)L-ak)N-ak)M0ee*B0le*B0cf*A0af*A0le*A0ge*@0ld*A0id*A0kd*A0ld*B0ee*B0bf*A0jd*A0ge*@0ee*B0fe*A+e(Q+l(Q,c`(P,a`(P+l(P+g(O+l~(P+i~(P+k~(P+l~(Q+e(Q,b`(P+j~(P+g(O+e(Q+f(P,ge-G,ne-G,af-G,cf-F,ne-F,ee-F,nd-F,kd-F,id-G,nd-G,ge-G,`f-G,hd-G,ee-F,ge-G,de-G+ej&S+ek&T+ej&S+ei&T+ej&S+ek&R+ej&S+ei&R'gy)N'ny)N'dz)N'fz)M'ly)M'gy)L'lx)M'fx)M'dx)N'nx)N'gy)N'gz)M'gx)M'gy)L'gy)N'gy)M'lh,Q'`i,Q'gi,P'ei,P'`i,P'lh,P'hh,P'eh,P'gh,P'hh,Q'lh,Q'fi,P'fh,P'lh,P'lh,Q'nh,P&`n._&kn.^&nn.^&ln.^&kn.]&bn.]&km.]&dm.^&fm.^&km.^&`n._&mn.^&em.^&bn.]&`n._&an.^%bk,N%ik,N%lk,N%nk,M%ik,M%`k,M%ij,M%fj,M%dj,N%ij,N%bk,N%ok,M%gj,M%`k,M%bk,N%ck,M*ih&X*`i&X*ji&W*hi&W*bi&V*ih&V*bh&V*hg&W*jg&W*`h&X*ih&X*ii&W*ig&W*ih&V*ih&X*ih&W*ke-G*bf-G*hf-G*jf-F*`f-F*ke-E*`e-F*jd-F*hd-G*be-G*ke-G*kf-F*kd-F*ke-E*ke-G*ke-F/`z*^/kz*]/nz*]/lz*]/kz*\/bz*\/ky*\/dy*]/fy*]/ky*]/`z*^/mz*]/ey*]/bz*\/`z*^/az*]$d&\$o&[%b`&[%``&[$o&Z$f&Z$o~&Z$h~&[$j~&[$o~&[$d&\%a`&[$i~&[$f&Z$d&\$e&[2ke,O2bf,O2ef,O2gf,N2bf,N2ie,N2be,N2od,N2md,O2be,O2ke,O2df,O2ld,O2ie,N2ke,O2he,O&kg*G&bh*G&eh*G&gh*F&bh*F&ig*F&bg*F&of*F&mf*G&bg*G&kg*G&dh*G&lf*G&ig*F&kg*G&hg*G)lc'K)kd'K)lc'K)cc'K)lc'K)id'J)lc'K)ac'J*je,H*af,H*kf,G*if,G*cf,F*je,F*ce,F*id,G*kd,G*ae,H*je,H*jf,G*jd,G*je,F*je,H*je,G,cs+N,js+N,ms+N,os+M,js+M,as+M,jr+M,gr+M,er+N,jr+N,cs+N,ls+N,dr+N,as+M,cs+N,`s+N%ii,A%mi,A%`j,A%bj,@%mi,@%ii,@%ei,@%bi,@%`i,A%ei,A%ii,A%cj,@%ci,@%ii,@%ii,A%ki,@(gy1M(ny1M(dz1M(fz1L(ly1L(gy1K(lx1L(fx1L(dx1M(nx1M(gy1M(gz1L(gx1L(gy1K(gy1M(gy1L%hf)R%cg)Q%fg)Q%dg)Q%cg)P%jf)P%cf)P%le)Q%ne)Q%cf)Q%hf)R%eg)Q%me)Q%jf)P%hf)R%if)Q/do(P/cp(P/do(P/kn(P/do(P/ap(O/do(P/in(O+fj+C+jj+C+mj+C+oj+B+jj+B+fj+B+bj+B+oi+B+mi+C+bj+C+fj+C+lj+C+li+C+fj+B+fj+C+dj+C)ew(\)lw(\)cx([)ax([)lw([)gw(Z)lv([)iv([)kv([)lv(\)ew(\)bx([)jv([)gw(Z)ew(\)fw(['kz/L'b{/L'h{/L'j{/K'`{/K'kz/J'`z/K'jy/K'hy/L'bz/L'kz/L'k{/K'ky/K'kz/J'kz/L'kz/K.cs-M.js-M.ms-M.os-L.js-L.as-L.jr-L.gr-L.er-M.jr-M.cs-M.ls-M.dr-M.as-L.cs-M.`s-M*o'A+o`'B*o'A*o~'B*o'A+o`'@*o'A*o~'@%h~0S%c0R%f0R%d0R%c0Q%j~0Q%c~0Q%l}0R%n}0R%c~0R%h~0S%e0R%m}0R%j~0Q%h~0S%i~0R*aw(B*hw(B*ow(A*mw(A*hw(A*cw(@*hv(A*ev(A*gv(A*hv(B*aw(B*nw(A*fv(A*cw(@*aw(B*bw(A+n}&F+e~&F+o~&E+m~&E+g~&D+n}&D+g}&D+m|&E+o|&E+e}&F+n}&F+n~&E+n|&E+n}&D+n}&F+n}&E)he0J)cf0I)ff0I)df0I)cf0H)je0H)ce0H)ld0I)nd0I)ce0I)he0J)ef0I)md0I)je0H)he0J)ie0I%em,J%im,J%lm,J%nm,I%im,I%em,I%am,I%nl,I%ll,J%am,J%em,J%om,I%ol,I%em,I%em,J%gm,I)f`)U)m`)U)`a)U)ba)T)m`)T)d`)T(m)T(j)T(h)U(m)U)f`)U)ca)T(k)T)d`)T)f`)U)g`)T0d}(G0o}(F0b~(F0`~(F0o}(E0f}(E0o|(E0h|(F0j|(F0o|(F0d}(G0a~(F0i|(F0f}(E0d}(G0e}(F,o|+U,f}+U,i}+U,k}+T,f}+T,m|+T,f|+T,c|+T,a|+U,f|+U,o|+U,h}+U,`|+U,m|+T,o|+U,l|+U2km2C2om2C2bn2C2`n2C2om2B2km2B2gm2B2`m2C2bm2C2gm2C2km2C2an2C2am2C2km2B2km2C2im2C+jf-W+ag-W+dg-W+fg-V+ag-V+hf-V+af-V+ne-V+le-W+af-W+jf-W+gg-V+oe-V+hf-V+jf-W+kf-V)hz'Z)lz'Z)c{'Y)a{'Y)lz'Y)hz'Y)dz'Y)az'Y)cz'Y)dz'Z)hz'Z)b{'Y)bz'Y)hz'Y)hz'Z)jz'Y-gs.M-ks.M-ns.M-ls.M-ks.L-gs.L-cs.L-lr.M-nr.M-cs.M-gs.M-ms.M-mr.M-gs.L-gs.M-es.M+lb.^+`c.^+gc.]+ec.]+`c.]+lb.]+hb.]+eb.]+gb.]+hb.^+lb.^+fc.]+fb.]+lb.]+lb.^+nb.])is)S)`t)S)gt)R)et)R)`t)R)ks)Q)`s)R)mr)R)or)R)`s)S)is)S)ft)R)nr)R)ks)Q)is)S)js)R+`j&S+ek&T+`j&S+mh&T+`j&S+gk&Q+`j&S+oh&Q/lm8D/gn8C/mn8C/on8B/en8B/lm8B/em8B/ol8B/ml8C/gm8C/lm8D/ln8C/ll8C/lm8B/lm8D/lm8C'ef8['lf8['cg8Z'ag8Z'lf8Z'gf8Y'le8Z'ie8Z'ke8Z'le8['ef8['bg8Z'je8Z'gf8Y'ef8['ff8Z1mg5B1dh5B1kh5A1ih5A1dh5A1og5@1dg5A1ag5A1cg5A1dg5B1mg5B1jh5A1bg5A1og5@1mg5B1ng5A-gf4Q-nf4Q-ag4Q-cg4P-nf4P-ef4P-ne4P-ke4P-ie4Q-ne4Q-gf4Q-`g4Q-he4Q-ef4P-gf4Q-df4Q0ff=N0mf=N0`g=N0bg=M0mf=M0df=M0me=M0je=M0he=N0me=N0ff=N0cg=M0ke=M0df=M0ff=N0gf=M0bk7Z0ik7Z0cl7Y0al7Y0kk7X0bk7X0kj7X0aj7Y0cj7Y0ij7Z0bk7Z0bl7Y0bj7Y0bk7X0bk7Z0bk7Y,d}5J,h}5J,o}5I,m}5I,h}5I,d}5I,`}5I,m|5I,o|5I,`}5J,d}5J,n}5I,n|5I,d}5I,d}5J,f}5I-o{=Z-f|=Z-i|=Z-k|=Y-f|=Y-m{=Y-f{=Y-c{=Y-a{=Z-f{=Z-o{=Z-h|=Z-`{=Z-m{=Y-o{=Z-l{=Z*ca3S*ja3S*`b3S*bb3R*ha3R*ca3Q*h`3R*b`3R*``3S*j`3S*ca3S*cb3R*c`3R*ca3Q*ca3S*ca3R1j}>D1a~>D1k~>C1i~>C1c~>B1j}>B1c}>B1i|>C1k|>C1a}>D1j}>D1j~>C1j|>C1j}>B1j}>D1j}>C-lz5H-g{5G-j{5G-h{5G-g{5F-nz5F-gz5F-`z5G-bz5G-gz5G-lz5H-i{5G-az5G-nz5F-lz5H-mz5G/dk=L/hk=L/ok=K/mk=K/hk=K/dk=K/`k=K/mj=K/oj=K/`k=L/dk=L/nk=K/nj=K/dk=K/dk=L/fk=K'gx7^'nx7^'ay7^'cy7]'nx7]'ex7]'nw7]'kw7]'iw7^'nw7^'gx7^'`y7^'hw7^'ex7]'gx7^'dx7^/cy8Z/jy8Z/my8Z/oy8Y/jy8Y/ay8Y/jx8Y/gx8Y/ex8Z/jx8Z/cy8Z/ly8Z/dx8Z/ay8Y/cy8Z/`y8Z1ch5J1gh5J1jh5J1hh5J1gh5I1ch5I1og5I1hg5J1jg5J1og5J1ch5J1ih5J1ig5J1ch5I1ch5J1ah5J+g~;S+n~;S+a;S+c;R+n~;R+e~;R+n};R+k};R+i};S+n};S+g~;S+`;S+h};S+e~;R+g~;S+d~;S(`g<](kg<\(ng<\(lg<\(kg<[(bg<[(kf<[(df<\(ff<\(kf<\(`g<](mg<\(ef<\(bg<[(`g<](ag<\+er9]+lr9]+cs9\+as9\+lr9\+gr9[+lq9\+iq9\+kq9\+lq9]+er9]+bs9\+jq9\+gr9[+er9]+fr9\.dw>O.cx>O.dw>O.kv>O.dw>O.ax>N.dw>O.iv>N,cn4S,jn4S,mn4S,on4R,jn4R,an4R,jm4R,gm4R,em4S,jm4S,cn4S,ln4S,dm4S,an4R,cn4S,`n4S$`x5E$kx5D$nx5D$lx5D$kx5C$bx5C$kw5C$dw5D$fw5D$kw5D$`x5E$mx5D$ew5D$bx5C$`x5E$ax5D(a~7](h~7](o~7\(m~7\(h~7\(c~7[(h}7\(e}7\(g}7\(h}7](a~7](n~7\(f}7\(c~7[(a~7](b~7\%hy7_%cz7^%fz7^%dz7^%cz7]%jy7]%cy7]%lx7^%nx7^%cy7^%hy7_%ez7^%mx7^%jy7]%hy7_%iy7^1gu:Y1nu:Y1av:Y1cv:X1nu:X1eu:X1nt:X1kt:X1it:Y1nt:Y1gu:Y1`v:Y1ht:Y1eu:X1gu:Y1du:Y,`o['lr>['cs>Z'as>Z'lr>Z'gr>Y'lq>Z'iq>Z'kq>Z'lq>['er>['bs>Z'jq>Z'gr>Y'er>['fr>Z+ag=J+hg=J+og=I+mg=I+hg=I+cg=H+hf=I+ef=I+gf=I+hf=J+ag=J+ng=I+ff=I+cg=H+ag=J+bg=I2iu9O2`v9O2gv9N2ev9N2`v9N2ku9M2`u9N2mt9N2ot9N2`u9O2iu9O2fv9N2nt9N2ku9M2iu9O2ju9N'gi8N'ni8N'aj8N'cj8M'ni8M'ei8M'nh8M'kh8M'ih8N'nh8N'gi8N'`j8N'hh8N'ei8M'gi8N'di8N(fj8T(mj8T(`k8T(bk8S(mj8S(dj8S(mi8S(ji8S(hi8T(mi8T(fj8T(ck8S(ki8S(dj8S(fj8T(gj8S,dg=O,og=N,bh=N,`h=N,og=M,fg=M,of=M,hf=N,jf=N,of=N,dg=O,ah=N,if=N,fg=M,dg=O,eg=N-`x5E-kx5D-nx5D-lx5D-kx5C-bx5C-kw5C-dw5D-fw5D-kw5D-`x5E-mx5D-ew5D-bx5C-`x5E-ax5D&a|3C&h|3C&o|3B&m|3B&h|3B&c|3A&h{3B&e{3B&g{3B&h{3C&a|3C&n|3B&f{3B&c|3A&a|3C&b|3B1cn7F1gn7F1jn7F1hn7F1gn7E1cn7E1om7E1hm7F1jm7F1om7F1cn7F1in7F1im7F1cn7E1cn7F1an7F%bvB+ar>B+dr>B+fr>A+ar>A+mq>A+iq>A+fq>A+dq>B+iq>B+mq>B+gr>A+gq>A+mq>A+mq>B+oq>A0m~;E0d;E0k;D0i;D0d;D0o~;C0d~;D0a~;D0c~;D0d~;E0m~;E0j;D0b~;D0o~;C0m~;E0n~;D%d}2W%o}2V%b~2V%`~2V%o}2U%f}2U%o|2U%h|2V%j|2V%o|2V%d}2W%a~2V%i|2V%f}2U%d}2W%e}2V'aj5_'ej5_'hj5_'jj5^'ej5^'aj5^'mi5^'ji5^'hi5_'mi5_'aj5_'kj5^'ki5^'aj5^'aj5_'cj5^0e}8R0l}8R0c~8Q0a~8Q0l}8Q0g}8P0l|8Q0i|8Q0k|8Q0l|8R0e}8R0b~8Q0j|8Q0g}8P0e}8R0f}8Q*oe4F*cf4F*ff4F*df4F*cf4E*oe4E*ke4E*de4F*fe4F*ke4F*oe4F*ef4F*ee4F*oe4E*oe4F*me4F:/j~ ]/bt Z/j~ ]/`t ^/h~ ^/bu ^/j~!D/`t ^/j~!D/bt!A/h~!E/`t!B/h~ \/h~ ^/j~!D/j~!F/`t Y/`t \/`t!@/bt!C/b{!N/jw!M/hu!M/ht!M/bt!M/`t!O/`u!P/bv!P/`{!O/hw!N/ju!M/jt!M/`t!N/jw!M/by!M/hz!M/`{!L/`{!K/jz!I/by!H/hw!H/`v!H/bu!H/ht!I/`t!J/`t!K/ht!L/`v!M/jw!M/`{!K/hz!J/`y!I/jw!H/ju!H/ht!I/b{!Y/bt!W/hr!W/`q!V/jp!T/hp!S/`q!R/jq!Q/br!Q/hr!R/br!R/hq!R/`{!Y/`t!W/jr!V/bq!U/jp!T/hw!X/`y!X/jz!W/b{!V/b{!U/hz!T/`y!S/jw!R/bv!R/`u!S/jt!S/bt!T/bt!U/jt!V/bv!W/hw!X/b{!U/jz!T/by!S/hw!S/hu!S/jt!S/by![/`z!\/`{!]/b{!^/hz!_/hy!_/jw!^/bt!]/`{!^/jz!^/jy!^/hw!^/`t!]/jw!^/jy!_/jz"@/b{"A/b{"B/jz"C/`z"D/`y"D/`v"C/ht"C/bt"C/b{"B/bz"C/by"C/bv"B/jt"B/`t"C/bt"D/bu"E/`v"F/h~"K/b~"J/h}"K/b~"K/h~"K/`y"G/bz"G/b{"H/`{"J/jz"J/by"J/bv"I/jt"I/`t"J/b{"I/hz"J/`y"J/`v"I/ht"I/bt"I/`t"K/`u"L/bv"L/j~"Q/jw"O/hu"O/ht"O/bt"O/`t"Q/`u"R/bv"R/h~"R/hw"P/ju"O/jt"O/`t"P/b{"N/`{"S/by"T/`z"U/`{"V/b{"W/hz"X/`y"X/`v"W/`u"W/`t"X/`{"W/jz"W/by"W/bv"V/bu"V/ht"W/`t"X/`t"Y/ht"Z/hu"[/hw"\/`{"]/hw"\/ju"[/jt"[/`t"\/bt"]/bu"^/`v"_/b{"]/jw"\/hu"\/ht"\/bt"\/j~#H/jw#F/hu#F/ht#F/bt#F/`t#H/`u#I/bv#I/h~#I/hw#G/ju#F/jt#F/`t#G/jw#F/by#F/hz#F/`{#E/`{#D/jz#B/by#A/hw#A/`v#A/bu#A/ht#B/`t#C/`t#D/ht#E/`v#F/jw#F/`{#D/hz#C/`y#B/jw#A/ju#A/ht#B/h~#G/h~#I/hv#L/`w#N/jw#O/hx#Q/jy#Q/hz#Q/`{#P/b{#N/hz#M/`y#L/jw#K/bv#K/`u#L/jt#L/bt#M/bt#N/ht#P/hu#Q/b{#N/jz#M/by#L/hw#L/hu#L/jt#L.` ^/j` ]/ia \/ka Z/j` Y.` Y.j} Y.k| Z.i| \.j} ].` ^/ja [.j| [.` Y.` ^.b [.my!N/ed!T/oc!R/ob!Q/ga!P.m!P.o}!O.g|!O.mz!P.gz!P.oy!Q.oy!R.ez!T.e{!U.m|!V.g~!V/e`!W/ma!W/gc!V/mc!V/ed!U/ed!T/ed!T/mc!S/mb!R/ea!Q.o!P.m}!P.e|!P.oz!P.oy!Q.oy!R.gz!S.g{!T.o|!U.e~!V/g`!V/oa!V/ec!V/ed!U.hg ^.bi ].aj \.cj Z.bi Y.hg Y.bf Y.ce Z.ae \.bf ].hg ^.bj [.be [.hg Y.hg ^.jg [.eb!N.mj!T.gb!Q.ml!U.eb!R.ml!U.gk!S.ej!R.mi!Q.gk!T.gj!R.mi!Q-cp ]-eq ]-er \-gr Z-gq Y-ap Y-on Y-om Z-mm \-mn ]-cp ]-fr [-nm [-ap Y-cp ]-bp [-mj!N-gs!Q-mr!R-gr!Q-mr!Q-es!Q-gt!Q-mt!R-gu!S-eu!U-ot!V-ms!W-mr!W-oq!V-op!U-mo!T-mn!R-om!P-ol!O-oj!N-eu!U-mt!V-os!V-or!V-mq!V-mp!U-mn!R-mk!O-gl!O-gl!P-ek!S-gk!T-ok!U-ml!V-gl!P-mj!S-oj!T-gk!U-ml!V,ox ],az ],a{ \,c{ Z,cz Y,mx Y,kw Y,kv Z,iv \,iw ],ox ],b{ [,jv [,mx Y,ox ],nx [,is!N,c|!Q,i{!R,c{!Q,i{!Q,a|!Q,c}!Q,i}!R,c~!S,a~!U,k}!V,i|!W,i{!W,kz!V,iy!U,cy!S,a~!U,i}!V,k|!V,k{!V,iz!V,iy!U,cy!R,cy!S,ix!U,cx!U,aw!V,iu!V,kt!U,at!U,ks!S,ks!Q,at!P,kt!O,iu!O,av!O,kv!O,av!P,ku!O,cy!S,kx!T,ax!U,cw!U,ku!U,it!U,ct!T,ks!S,ja ],lb ],hc \,hc [,lb Z,ja Y,d` Z+h [+h \,d` ],ja ],jc [+j [,ja Y,ja ],ja [+e|!N,ef!V+e|!S,of!V+g|!S,of!V+e!O+e!W+jj ]+lk ]+hl \+hl [+lk Z+jj Y+di Z+hh [+hh \+di ]+jj ]+jl [+jh [+jj Y+jj ]+jj [+ee!N+oo!R+mj!P+oo!R+oo!W+go!R+eo!U+oo!W+mj!P+gk!P+mk!R+ok!S+ek!U+oj!U+mi!V+eh!V+of!U+oe!T+ee!S+ge!Q+me!P+gf!O+eg!O+mg!O+gh!O+mg!P+gg!O+ok!S+gk!T+mj!U+oi!U+gh!U+mf!U+me!T+ee!S*is ]*ht ]*du \*du [*ht Z*ks Y*hr Z*lq [*lq \*hr ]*is ]*fu [*nq [*ks Y*is ]*js [*en!N*gw!V*mv!V*gv!V*mv!W*ew!W*gx!V*ox!U*mx!T*gx!R*gw!Q*ou!P*et!P*gr!O*gp!O*eo!P*on!P*gn!Q*en!S*on!T*oo!U*mp!V*er!V*gs!U*ms!U*et!T*gt!R*os!Q*or!P*mq!P*mx!T*ex!S*ew!R*mu!Q*gt!P*er!P*mo!P*on!P*en!S*mn!T*mo!U*op!U*or!U*ms!U)m| ])l} ])h~ \)h~ [)l} Z)o| Y)l{ Z)`{ [)`{ \)l{ ])m| ])j~ [)b{ [)o| Y)m| ])n| [)iw!N*ab!Q)a!P*cb!W*i`!W)a!V)c|!S)kz!R)iy!R)kw!Q)a!V)a|!S)iz!R)ky!Q)iw!Q*k`!P*ab!R*ab!S*k`!U*aa!Q*ia!R*ia!S*k`!U*k`!V*aa!W*cb!W)`f ])cg \)hg \)hg [)ag Z)`f Z)ae Z)hd [)hd \)ce \)`f ])jg [)jd [)`f Z)`f ])bf [)m`!N)gk!S)mj!R)gj!Q)ei!Q)mg!Q)of!Q)gf!R)ef!T)mf!V)gg!V)eh!W)mi!W)oj!V)ek!U)gk!S)gk!S)oj!R)ej!R)gi!Q)og!Q)mf!R)gf!R)ef!T)of!U)eg!V)gh!V)oi!V)mj!V)ek!U)gf!R)oe!P)od!O)mc!O)eb!O)ga!O)m`!Q)m`!S)ea!U)oa!U)mb!V)ed!V)ge!U)me!U)ef!T)gf!R)me!Q)md!P)oc!O)gb!O)ea!P)m`!Q)m`!S)ga!T)ma!U)ob!U)od!U)me!U(ho ](kp \(`q \(`q [(ip Z(ho Z(in Z(`n [(`n \(kn \(ho ](bq [(bn [(ho Z(ho ](jo [(ej!N(gq!V(ep!V(eo!U(mn!T(on!R(go!Q(mo!Q(op!P(gr!P(es!Q(et!R(ot!S(mt!U(et!V(os!V(mr!W(mp!W(on!V(em!V(mk!U(mj!T(gj!R(ej!Q(mj!P(ok!O(gl!O(ml!P(gl!P(mk!P(go!Q(ep!Q(er!Q(gs!Q(gt!R(ot!S(et!V(gs!V(op!V(mn!V(gm!U(ok!T(oj!S(gj!R'cy \'ny \'dz \'dz ['ny Z'ay Z'fx Z'lw ['lw \'fx \'cy \'fz ['nw ['ay Z'cy \'by ['e|!J'os!G'e~!K'ms!H'e~!K'o|!I'm{!H'e{!G'o|!J'o{!H'e{!G'g~!T'm}!S'm|!R'e{!Q'oy!P'mw!P'ev!P'ot!P'et!Q'ms!R'ms!S'gt!T'gu!U'ov!V'ex!W'gz!W'o{!W'e}!W'o}!V'g~!U'g~!T'g~!T'o}!S'o|!R'g{!Q'my!Q'ow!P'gv!P'mt!Q'ms!R'ms!S'et!T'eu!U'mv!V'gx!V'ez!W'm{!W'g}!V'g~!U'ob \'jc \'`d \'`d ['jc Z'mb Z'bb Z'ha ['ha \'bb \'ob \'bd ['ja ['mb Z'ob \'nb ['af!J&k}!G'ah!K&i}!H'ah!K'kf!I'ie!H'ae!G'kf!J'ke!H'ae!G'cf!T&i}!R'ch!U&k}!R'ch!U'if!T'ke!R'ce!Q'if!U'ie!S'ce!Q&jl \&am \&km [&im [&cm Z&jl Z&cl Z&ik [&kk [&al \&jl \&jm [&jk [&jl Z&jl \&jl [&mo!J&gg!G&mq!K&eg!H&mq!K&gp!I&eo!H&mn!G&gp!J&go!H&mn!G&mo!R&go!R&mn!R&go!Q&oo!Q&mp!R&gq!R&mq!T&oq!U&eq!W&gp!W&go!W&en!W&em!V&gl!T&gk!R&ej!Q&ei!P&eg!O&oq!U&gq!V&ep!W&eo!W&gn!V&gm!U&gk!R&gh!O&mh!P&mh!Q&og!S&mg!U&eh!V&gi!V&mh!Q&gg!S&eg!U&mg!V&gi!V%jv \%aw \%kw [%iw [%cw Z%jv Z%cv Z%iu [%ku [%av \%jv \%jw [%ju [%jv Z%jv \%jv [%my!J%gq!G%m{!K%eq!H%m{!K%gz!I%ey!H%mx!G%gz!J%gy!H%mx!G%my!R%gy!R%mx!R%gy!Q%oy!Q%mz!R%g{!R%m{!T%o{!U%e{!W%gz!W%gy!W%ex!W%gw!U%mv!T%o{!U%g{!V%ez!W%ey!W%gx!V%gw!U%mv!S%mv!T%gv!U%mu!V%ot!V%gs!V%er!V%oq!U%eq!T%eq!R%oq!P%er!P%gs!O%os!O%et!P%os!P%es!P%mv!T%ev!U%ou!U%mt!V%es!V%gr!U%mq!U%eq!T%i` \%`a \%ga [%ea [%`a [%k` Z%`` [$m [$o [%`` \%i` \%fa [$n [%k` Z%i` \%j` [%mc!J$g{!G%me!K$e{!H%me!K%gd!I%ec!H%mb!G%gd!J%gc!H%mb!G%ge!V$g{!S%me!W$e{!T%me!W$g~!O$g~!W$mj \$dk \$kk [$ik [$dk [$oj Z$dj [$aj [$cj [$dj \$mj \$jk [$bj [$oj Z$mj \$nj [$an!J$ke!G$ap!K$ie!H$ap!K$kn!I$im!H$am!G$kn!J$km!H$am!G$ap!S$ck!P$ap!S$ap!X$io!S$ko!U$ap!X$ck!P$ik!Q$cl!R$al!T$kk!U$ak!V$cj!V$kh!V$ag!V$af!U$ke!S$ie!R$cf!P$if!P$kg!O$ch!O$ih!P$ch!P$ig!P$al!T$ik!U$ck!U$aj!V$ih!V$cg!U$cf!T$ke!S#`u \#du \#ku [#iu [#du [#`u [#lt [#it [#kt [#lt \#`u \#ju [#jt [#`u [#`u \#bu [#ex!J#oo!G#ez!K#mo!H#ez!K#ox!I#mw!H#ew!G#ox!J#ow!H#ew!G#mx!W#gx!V#mw!W#gx!W#ox!W#my!W#ez!V#gz!T#my!S#mx!R#ew!Q#ou!P#ms!P#mq!P#op!P#ep!Q#mo!R#oo!S#ep!U#eq!V#gr!V#os!V#mt!V#gu!U#ou!T#mu!S#eu!R#et!Q#gs!P#gz!T#oy!S#ox!R#gw!Q#mu!Q#os!P#gq!P#ep!Q#oo!S#gp!T#gq!U#er!V#et!V#gu!U8: am-O cn-N co-M ko-L ko-J co-I cn-H am-H kk-G ci-G ig-H kf-H ke-I ce-J ce-L ke-M kf-N ig-O ko-U ko-T co-S im-S ae-S cl-Q al-U io-[ ae-W io-[ ae-_ kh-X kh-] ce.I an.R ao.Q ko.O ko.M ao.L an.K am.K cl.K ik.L ak.M aj.P ii.Q ci.Q ah.R if.R ie.Q ce.O ce.M ie.L if.K ko.U ce.U ko.\ kh.U ak.X ce.\ ko.^ kj/B ce/B ko/F kj/B io/I ae/I io/I ae/M io/Q ae/M io/Q ae/Q ko/W ce/S ko/W ce/[ ih/U ih/Z io/^ ae/^ io/^ ko0B ao0D kn0D im0E al0E ck0D ij0D cj0B aj/^ ce0P io0W ih0R kh0Y io0W ae0W af0] ke0\ ae0] ke0] af0] cn1G ao1G ko1E ko1D ao1C im1B ck1A kh1A if1B ie1C ce1D ae1E ke1F kf1G ah1H ih1H cj1G ck1F ik1E kk1D ak1C aj1B kh1A ce1S cl1U ce1U ci1U ij1V ik1W al1X cl1Y al1\ ag1\ ke1\ ce1] ae1_ ie2@ cg2A cl2A ce2A cl2E ce2E cj2E ik2G al2H cl2I kk2J aj2K ae2K ae2W ko2] kh2X ih3@ ko2] ce2] ae3K io3M ae3M io3M ae3T io3T ae3T al3Z ik3Y ij3X ci3W ch3W if3X ie3Y ae3Z ce3[ ke3\ kf3] ah3^ ai3^ kj3] kk3\ cl3[ al3Z cl4@ ce4C cl4F ce4C ce4Q km4T cn4U io4W ae4W cl5C ij5C ii5B ci5@ ai5@ ki4^ kj4] al4] il4] cn4] co4^ io5@ ko5@ ao5B an5C cl5C ki5C ag5C ie5B ce5@ ce4_ ie4^ kf4] cl5M ij5M ii5L ci5J ai5J ki5H kj5G al5G il5G cn5G co5H io5J ko5J ao5L an5M cl5M ki5M ag5M ie5L ce5J ce5I ie5H kf5G cl5W ij5W ii5V ci5T ai5T ki5R kj5Q al5Q il5Q cn5Q co5R io5T ko5T ao5V an5W cl5W ki5W ag5W ie5V ce5T ce5S ie5R kf5Q ce6C km6F cn6G io6I ae6I io6T ih6O kh6V io6T ae6T al6Z kk6Y ak6Z kk6Z al6Z af6Z ke6Y ae6Z ke6Z af6Z io6_ ko7D kk7A ik7C ak7D kj7D ai7E ah7E kf7D ke7C ae7B ce7@ ie6_ cf6^ ag6^ io7I ko7N kk7K ik7M ak7N kj7N ai7O ah7O kf7N ke7M ae7L ce7J ie7I cf7H ag7H86db @5`i @�����������������������������������������������������������������������������������plotutils-2.6/tek2plot/teksamples/usmap.tek���������������������������������������������������������0000644�0001750�0001750�00000015433�04737544113�016125� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ ;)f{+Z*kc)Y,cm*Eag+Ona,_)kxXf{+Z,g}2K`{QexScs3EKdoPcmPogPhhSieRnaT+l|P`yPd{SnTW,heYmg[lg\ad[+kwVcsVnmTajU*k}SlsVbq2OfuId{HbI+fdFiFikDeo1^cs\jtXlyQ,dcQffRiOknQdrWi|Vn~Xd}\n~2@-kbHmaJ,k|Hg}K)fp8DokF`hFgm7]ok]gg](XfVmwTQeyNlnLehHofIbcGn`BkaA'i~@c}6[i~Zk{Ul}R(iaQhaOlcLakFepFotJhxJ`}Lf|MazNk{Oh~O)cbOeRbeVlk[ow[m|Zj}\l_nn7M`eObkSckUlnXfm[io\lq8@fpD/ml%_`o&@ml%_`o&ChpCimB`oCdkCijBdkCmfElfCgbChaFe`EdbCmfBaiEmfE-et'_nm^isEhs&]arQksOmrHluFdw@nu%YlxU.aUcdRodOkhLjhJmiHboJkjIekKgqLfqJetKdtOkvLmuK/hdLniJhpLkpLgkRlf[]id_`c&@ge@cc@mcBf`A.m~%_/f`^.a{ZnxYhy]iyZ`{[i&BB/aB.`~Cc~@ez%_jy&Aau%_fw^et\`x]lu[jvYgtXdt[`r[et\or]lu&@hvCb~D/iaHnfGliFniDekEoiFblGnoG`oFisEdtFbc(I-et'_(jl7JemK`zOcwRhxU)a`W(gX)g]m]`h8FokFbkJnhJleRobR(c}OmzQb}SdyWgyZ`w]ku9@cq@q8]dvWhuWko]jo9Aan8_em9B`kChl@dj@ki@fj8^gmZdmZak\fh9AehBofCjdAnf8^gh]ZhiZfhXhgZ]ge]kd9@bcAocCgeCidH'~K(c`I'j~Jl}Iiu7\dn6Gol5[fs6EowG(iaQ'b}Si{W~Zb}\(c`7AkaAacEbcGofIehHjlJdy9InzLirKhoIaiHgjFlnFntGhuIdyIh{NixMh{N,ojN`sNjJ-ie:B,`~C{Cnv9^as_kh]+f{^`y:@nv9U,dfQjeOojN(g(H*k}Tcv)\kcY)n*T'huK(a(CgH$iy,Z'ac-@o`.L%i|KkyOmxTdzUaxWmuWgt]`u/@nrAgtCetHgqIcoIenKhpOkmRcoTkmTalVenVipYm\lo]km]ek0BgnFfnJipMaoPhpTnlXjj^di1@E$lEngIodH#kKd}NiwMhnKkhK`dHjbI"o|0Zn^cZ#ad\faXmaV"`Wf{XayVcyTjtRbjAnjAapKnpJmDcpCjnAcp@om@in/_eo\am\el_kk]lj0@mh/\hkZajYdgZceWggW`eWneSgdR!nS"i`N!nPb|P`|RovOfuMexNguLxIitKduOcsOfmMleO mQoRk}Rn|SM`IbD!k`@nb.^ob[ceXmeTanQiqNduOb|MmH"aeEkiA`mAit-]jt\e{ZbV#j`SmaTgaRmdQheOdfGmgCgfAef,]"bYo|XdxUoyPa|Om|Lg~JlG#ff+_ik]hq^kyYb~T$jhKnjHapFbrCuCp,YiyZ&fw5YhsX`rUhmUoi4Pcf2\i_hm_jm]`o_gn_lr3Bft@wC`xEd|Em}Do}EdE'ocEiaGmc[ig[mf4Abl5Yhp6X`lXofRO`cLkdJaG&gGaz@fw5Y*{-Vj},\,`s-Akn0@hh/]ec0B+aB`b@*l|@izBas/_nn0Aio/_`s]bvU`vOhtL`yFf{-V&eb6NnfKbiEdkDloGnuPax7EmuEgwFcrIetZbf8Me`H%`{FfzDlxFivEftAgn7]mo\al\kjXhhXmgTbdSgfOibQoaR$n~P%d`LffJkhFcoCip@ft6\jv\b{V`~R&ebN+jk:U`hWneUkfTdiTfiRedS`bNknK`pQikSjkU)`t8Ijl6_*`vXo|7AfxB+hc8]*m9Bg{CmyHhtFjqDfjDgjFjcL)i}He{EBhx@`t8I,dx'ZcsTdoTkkW+meMg~$O,i`NknOavTn{Y-am%@luDa{Ec{F.fcGldIhhIffJgfOodOlaU-xUmuZlu&FmrHcrThs]mr'BisEnm^ld(C,n{'[dxZ&oo0]%jj^nlXhpTjpRaoPipMfnJgnFfkAkm/]lo]dnZipYboXlUooThmRfqMenKcoIbrGetHgtCnrA`u@gt.]muWdzUmxTkyOm{Ni|K'o`L`c-AolA`i/]ni0[&oo](kr5[`tXkrUotM`zJgyD*ji4_fj5QokShXejZki[fgYnh\eg6@ckJepN`vX)j}\a|Zgv[ejZbeVcbO(h~Ok{OazN`}LhxJotJmqIepFgsAiu@kr5[,er-N`sA.fkEbg/X-axY`m],o{]`v0@kn@cp.Xer-N'nq9Rm}Ki~KnqRmq7Ciu\h~9Ij{Ji{KevMbzJcwKjxGcwIdvIcwFjuGiuEfsDjrAot@w@mw8_hu9@jrApAoqFgsIirKmoKgnKfnJnqL`tNmqPdnQmiMjjLkgKigHaiHkgF`iFdkFoiCjgDfh8^mf_lf9C`fCbfGocFmcEl`F&gC'ia8_m`_&j~9Ak~F'``F&fG'iaH&dI'jaJ&eKh{IozFd|Fgy@az8_`x9@jv8^hv]fy[iv\`u]ooWliWalVkgTbfMet7ZcrIgwFmuEaxEnu6PloGhm5U`rUgtXox[az6@gG'kdJbcMofOnfSclU`lXhpXmq7C*nn9RilSlkQnnRgpTcsWvZ]y:Ek}Hn|IgxEhwHf{Ik}No|NjqAaq9_cv:Eer9_mVkoWcnTgpT{7UfxBo|A+`hLjkJmmHiqHmsNguXns[gu]hw8F`|Ih}L,kbIecKieKgfI`dIagHkwRo{Wj9J`sNinMjeOkeQ+bvU*k}WizYexVrVfrUguT{C+a@ic8\*g{7U&ai*D'huKm,Uol-A`cA$bp,Ycu+BdqDet*JglHhn)\&ai*D)bt9RemPgmNcqNnqLaqK`tFcwCf{D*jcLgjFbkDjqDmyHguTosTlkQejSnkU`hW)W*icV)oyTlyTbtR,fl:OObdUcaTj`R+o|N`y@f{9^,kh]iw_`{:C~C-f`AbjAglE,flO'mt'E)hx%XkzX+do&F*k}(T'gs@kp']ctWjrUkgTgbT&eS'mtE*ae,Zj}\`y/FnsM`vOduWgr]io_an0BlhCobF)`FcFgyIonIjfLm`P`/Njc-SevTkx,X*aeZ,lg)_ie^agUngTjeRogNjeLmgJamJbpFdxEa~D-d`B,k|(\o~Z-ad\md^bj]mr)Ar(^ft]et\hW.bdR`gTcoQ/baU.`u*So,Afk-E,na,_la^ag+Ocm*EecDfi@lg)_(f0U)bbOoeNjfLmkKgm2BmhG(eGjxLotQgmSlnYjlZciYncWfbWc`Y'm}^hx3EjrFdqEllHclKkgKmcJgeHiaGncFccEn`F&o}Em}Dh{EfyCox2Y'a`^db\b`0[(q[nqXhxT~WfU$ei2PnjOojQfoRnpTfqTopQgqQdtVfwRkvSySoxQa{SjRl~Q%hbQjeRdfQjhRmgPdiQihPjjOimPjmRorQgtSmuSivUgwSdzVl{Y&d`Y%jZ&haYjd]cf\eh3[cf\$hn\#dr_grYnsWpQhqPjnNinLlvHj|Ic{2KkK$jbLhbNkeNagMeiP,hh/]om0@`v@o{/]-`m]axY.`aZbgXcg0QkmQmlVkbWca]d`1C-`~C.baI-hQe}PSkyTj|XezYdw_w2Ba{GcxHlxQkvSewXbmFefA,i|1VdrWlmQjhOffRdcQ+lyQjtXcs\eo^fi2FicGea0B,cBhh/]-dc4GheSe`R,hV-ca[,i|]cy5Aex@ay4XfuWxTcyMbvKduDfrCkn3_`p_ns4@bs3]eo[ms[cpYndTbdTieRhRhhPcmPdoPapLcsKosBfx2R`{Qo{N-laVib[je3@bjC`jEamGinJfoNnmNbjIheHjeFaaGheKfcIndNfcQ,a~Ul~Ye}[b~]e}^j4@-dcG+`5Md{MkzJeuIhtGmpFomG`mJapLfuNhwSlvUmsWce[*l|[bYh}XayWlvUdrUjlQi4_dgDhqJbyK+eaIcjDnmEdrD`yGi}F,jbHadLjhN`NldPi`OgcPiPikR`mVcpSasUjtWfr_`p5AmJihLlgJ+`Mh;HegDbhFgiE`hHch:_le\hf\fi]ch_lm\nm[bhXlhWjkUikS`pQbj9UnvUo|:N,j`RcaT+o|Wb|UhwTfuUavYbs[kqZjn]hn_bp;CsCfu@duBrEcmEomBcj:\lm\)aq7Whx9@cbFkcN({Nh{NeMnzLowFixEozFd|Fk{CgCc}CeBa}Bj~8^)c`]ab_kc]ob9@me8_ae\lh]kl]fm[`q]mq_lt9@ju8^lt]mq\gpZioYemYanVlkZbkX`hZbhXeXl`Z(h~]m}\)b`X(}[`}]jx^mz\bz[j{XozWe|Vj{Un}SmzQg|O)c`OjfSdgRhfOnhJbkJokFjoDbqDmq7_io\fm[cnXmnWckUbkS`eOnnMaqW-b~;Lc~QaxSjvTgwV`uYarXeq[lmYknVcmVbmTnjTojQgQihPePlgNbgLkeKndImaJjbFfcF`dHcgEecD,}Dh|EjyCezAa{Ajw@dx:_kw\os\bv[itYkqWapYdoWjeUheTmjP-glEHoHdoKgqHfzLl~K.jhLoxQlxT`uWox\ky\dz_ou;E-b~L#iw1Md}NhK$ecJodHdiHlEhE%d`2Q$l~QjRk|Qa{SoxQkvSjvRdtVbrTgqQapSeqUbpTfoRojQbjOdiQefMhbNjbLe`M#kKc{Kh|3Hn{IjtIlmMfoFopBfo@dl2_nj3@F`mHamJelJomKglKiHmgLkkMlmSmjRgiSbgQ`gPdcM"nNj}Qk}Sn|Tc|VhzVjzTfxTlySkwPjzQm|Oe~LJ#j`IF"o|Ea|GbyCl|Bf{@m|2^e{^byZizUnR#i`P"oN#naLadMgcHieGfcCgaE"lB#j`1]cdQjbI`dHglKdrKiwM'ci4SmfAig3[mc[dbHgeHhdKclKmlJkpKgqMfnTjpTntTgvYazXi~[^c}_(`_'g4B`}G(kaJ'gM(m`OidOjdQbfQebUncWdhYem]aq]fs5EntElwDfyE`zJjxKotMkrUes]hu6AepFakFlcLhaOiaQ'g|LowGfsEirCjpBbl5Yci4S(ev0VnqXbq['ni[`i/]li.Ucl-O)jcSm`/Nda0Q(h~TfUd|WhxTevV*d{2HfuIanSilSgjVceVj`T)h}Qo|KdyKmtMlnKjlFmhGgmBmk0KonIgyIcF`F*meElhCanBms/_iz0Bl|@+`b@ic2G*bId{H)ct5A(lwDfsEep@aq4]biZigXncWebUmcRbfQidO'gM(haJ'`}G(c`3_'`}_i~[e|[g|Ym}X(bcZfZ`f\cn_hr_ku\i~^*neZdd_g4Dfj_)ct5Aoe2EjlFlnKevMo|K*j`TceV`kVbqOls3VnVneZ(az^ku\cn_`f\kdY'~Ym}Xg|YeyXgvYntToqSjpTdnSgqMkpKalJkmHllHdqElwEzBf|2](jaWncWjlZlnYhoVgmSanSotQeG)oeE,i'_-mg(Bnm'^et_/bc(IaU.gnQldTbdR-oxZet\mr^ar)Aj(^bj]og\md^ad\,o~Zk|\-d`)B,a~DdxEmsGkqEinGamJmgJjeLogNjeRngTagUie^fi*@ecD*cv)\+me'M,keTkWmmVdoTcsTjwXby[i_#o~6Gc~5U$ffQmrO`xPezRo~P%mdL&gkAlo6GhjDmfInfK%`~Rb{VcxXjv\ft\ip7@boDkhFdcL$hLa~Qo{Ob{MezN`xLnuMetKgtLmpKopIcmImmHojIikKcjIjeJndGefCcdA#e}C@$f`6_#o~Ge}7C$jeBgfCmdK#l~LmsQlgXfc["c|]dg8ImeK!nMmnNfpM`kLggLedKcbFk`@ab7_ed_mb8B`eCne7^ilZanWemTonRvOgxLe~KlLmHo|Im|H"j`DfBeg@ohAjAknCmpCknAq6^do^in7@jk6_nm\s\`y^m]n\#da^ieZgfUfiSojOlmOdoLrJjtEit@kq5^bp_\dlXbmVkkU`jPflNinOljPglPeoOdrJkqMdrMasIhtJguGhtGjtHfrHnv4\v5BdxAfx4\ov[itRmvUfxTcvSfxQlsP`sMeuOkyM|Jo~J$dc5S#c~U$f`6_#d}7Ae}C)dg8RjfSddRjfPdgRaq9Bhx@e{BEctCbqGckIggNahMbeLkcNcbFaqB+mbVbjUkn:KobN*H+i`G*k}@d~@jz9^cyZovWexVizY+mbV'gq+Mhu*K)nTev-T'clOgq+M)fm$SpSjoVrShrR`nRfmPioNesLkrJevLgvLjxK*neE`hGfuH`|G+h`DgdDflKjnK`vOjzMg~Odo&F)hx%X&e'SftUnoXdkQncOfbL%h|L`xNluLez&Ea~Ef}D&acEciCis%\`uXeyW`}O'kdIeh$]`l[jp\ev]lw[g|[(ebWmkTioQltR`wUlzUo}O)daO`hOokOlkRmhQaeTceUokRfmS$j2Ch1E%diE@jj0^&bl^'`[gb2\a`^&f|]oxYfy3C`xEcuBft@lrBkm2_`o_jm]ll_hg_of\c\`aY%jZ&d`Y%`{YgwSmuUSrSorQhmQolQjmOjOlgQjhRdfQfcRhbQd`Q$jC'lc*H$hn)\mr(\%ar'HouI`xN{Nh|L&fbLeePclQjpXlzT'`TgbTkgTesVfsXjp^gs(@(haC'u*KlcH#gz4DfrC`s3_$hn\&cf\dh\gk5A%baN$o~P{PezRmrOffQdcS#o~4Jk|JyMeuOrLlpGnpEfrHitFgzDitF jd DnjDjdDkdJ7m}?Un}[jw[n}[4w ACD/2000����� :DAIPAC602:DAC ) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/plotfont/�����������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257513�012302� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/plotfont/Makefile.am������������������������������������������������������������������0000644�0001750�0001750�00000000653�10341763455�014256� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in bin_PROGRAMS = plotfont plotfont_SOURCES = plotfont.c fontlist.c plotfont_LDADD = ../lib/libcommon.a ../libplot/libplot.la INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi �������������������������������������������������������������������������������������plotutils-2.6/plotfont/Makefile.in������������������������������������������������������������������0000644�0001750�0001750�00000034565�11234210075�014263� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = plotfont$(EXEEXT) subdir = plotfont DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_plotfont_OBJECTS = plotfont.$(OBJEXT) fontlist.$(OBJEXT) plotfont_OBJECTS = $(am_plotfont_OBJECTS) plotfont_DEPENDENCIES = ../lib/libcommon.a ../libplot/libplot.la DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(plotfont_SOURCES) DIST_SOURCES = $(plotfont_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ plotfont_SOURCES = plotfont.c fontlist.c plotfont_LDADD = ../lib/libcommon.a ../libplot/libplot.la INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plotfont/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu plotfont/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done plotfont$(EXEEXT): $(plotfont_OBJECTS) $(plotfont_DEPENDENCIES) @rm -f plotfont$(EXEEXT) $(LINK) $(plotfont_OBJECTS) $(plotfont_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plotfont.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/plotfont/plotfont.c�������������������������������������������������������������������0000644�0001750�0001750�00000043103�11234220566�014221� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file is the driving routine for the GNU `plotfont' program. It includes code to plot all characters in a specified font. */ #include "sys-defines.h" #include "libcommon.h" #include "getopt.h" #include "fontlist.h" #include "plot.h" const char *progname = "plotfont"; /* name of this program */ const char *written = "Written by Robert S. Maier."; const char *copyright = "Copyright (C) 2009 Free Software Foundation, Inc."; const char *usage_appendage = " FONT...\n"; enum radix { DECIMAL, OCTAL, HEXADECIMAL }; /* options */ #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 const char *optstring = "12oxOj:J:F:T:"; struct option long_options[] = { /* The most important option ("--display-type" is an obsolete variant) */ { "output-format", ARG_REQUIRED, NULL, 'T'}, { "display-type", ARG_REQUIRED, NULL, 'T' << 8 }, /* hidden */ /* Other frequently used options */ { "box", ARG_NONE, NULL, 'b' << 8 }, { "octal", ARG_NONE, NULL, 'o'}, { "hexadecimal", ARG_NONE, NULL, 'x'}, { "jis-page", ARG_REQUIRED, NULL, 'J'}, { "jis-row", ARG_REQUIRED, NULL, 'j'}, { "lower-half", ARG_NONE, NULL, '1'}, { "upper-half", ARG_NONE, NULL, '2'}, { "font-name", ARG_REQUIRED, NULL, 'F' }, /* hidden */ /* Long options with no equivalent short option alias */ { "numbering-font-name", ARG_REQUIRED, NULL, 'N' << 8 }, { "title-font-name", ARG_REQUIRED, NULL, 'Z' << 8 }, { "pen-color", ARG_REQUIRED, NULL, 'C' << 8 }, { "bg-color", ARG_REQUIRED, NULL, 'q' << 8 }, { "bitmap-size", ARG_REQUIRED, NULL, 'B' << 8 }, { "emulate-color", ARG_REQUIRED, NULL, 'e' << 8 }, { "page-size", ARG_REQUIRED, NULL, 'P' << 8 }, { "rotation", ARG_REQUIRED, NULL, 'r' << 8 }, /* Options relevant only to raw plotfont (refers to metafile output) */ { "portable-output", ARG_NONE, NULL, 'O' }, /* Documentation options */ { "help-fonts", ARG_NONE, NULL, 'f' << 8 }, { "list-fonts", ARG_NONE, NULL, 'l' << 8 }, { "version", ARG_NONE, NULL, 'V' << 8 }, { "help", ARG_NONE, NULL, 'h' << 8 }, { NULL, 0, NULL, 0} }; /* null-terminated list of options, such as obsolete-but-still-maintained options or undocumented options, which we don't show to the user */ const int hidden_options[] = { (int)'J', (int)'F', (int)('T' << 8), 0 }; /* forward references */ bool do_font (plPlotter *plotter, const char *name, bool upper_half, char *pen_color_name, char *numbering_font_name, char *title_font_name, bool bearings, enum radix base, int jis_page, bool do_jis_page); void write_three_bytes (int charnum, char *numbuf, int radix); void write_two_bytes (int charnum, char *numbuf, int radix); int main (int argc, char *argv[]) { plPlotter *plotter; plPlotterParams *plotter_params; bool bearings = false; /* show sidebearings on characters? */ bool do_jis_page = false; /* show page of HersheyEUC in JIS encoding? */ bool do_list_fonts = false; /* show a list of fonts? */ bool show_fonts = false; /* supply help on fonts? */ bool show_usage = false; /* show usage message? */ bool show_version = false; /* show version message? */ bool upper_half = false; /* upper half of font, not lower? */ char *output_format = (char *)"meta"; /* default libplot output format */ char *numbering_font_name = NULL; /* numbering font name, NULL -> default */ char *option_font_name = NULL; /* allows user to use -F */ char *pen_color = NULL; /* initial pen color, can be spec'd by user */ char *title_font_name = NULL; /* title font name, NULL -> current font */ enum radix base = DECIMAL; int errcnt = 0; /* errors encountered */ int jis_page = 33; /* page of HersheyEUC in JIS encoding */ int opt_index; /* long option index */ int option; /* option character */ int retval; /* return value */ plotter_params = pl_newplparams (); while ((option = getopt_long (argc, argv, optstring, long_options, &opt_index)) != EOF) { if (option == 0) option = long_options[opt_index].val; switch (option) { case 'T': /* Output format, ARG REQUIRED */ case 'T' << 8: output_format = (char *)xmalloc (strlen (optarg) + 1); strcpy (output_format, optarg); break; case 'O': /* Ascii output */ pl_setplparam (plotter_params, "META_PORTABLE", (char *)"yes"); break; case '1': /* Lower half */ upper_half = false; break; case '2': /* Upper half */ upper_half = true; break; case 'o': /* Octal */ base = OCTAL; break; case 'x': /* Hexadecimal */ base = HEXADECIMAL; break; case 'F': /* set the initial font */ option_font_name = (char *)xmalloc (strlen (optarg) + 1); strcpy (option_font_name, optarg); break; case 'e' << 8: /* Emulate color via grayscale */ pl_setplparam (plotter_params, "EMULATE_COLOR", (char *)optarg); break; case 'N' << 8: /* Numbering Font name, ARG REQUIRED */ numbering_font_name = xstrdup (optarg); break; case 'Z' << 8: /* Title Font name, ARG REQUIRED */ title_font_name = xstrdup (optarg); break; case 'C' << 8: /* set the initial pen color */ pen_color = (char *)xmalloc (strlen (optarg) + 1); strcpy (pen_color, optarg); break; case 'q' << 8: /* set the initial background color */ pl_setplparam (plotter_params, "BG_COLOR", (void *)optarg); break; case 'B' << 8: /* Bitmap size */ pl_setplparam (plotter_params, "BITMAPSIZE", (void *)optarg); break; case 'P' << 8: /* Page size */ pl_setplparam (plotter_params, "PAGESIZE", (void *)optarg); break; case 'r' << 8: /* Rotation angle */ pl_setplparam (plotter_params, "ROTATION", (void *)optarg); break; case 'b' << 8: /* Bearings requested */ bearings = true; break; case 'V' << 8: /* Version */ show_version = true; break; case 'f' << 8: /* Fonts */ show_fonts = true; break; case 'l' << 8: /* Fonts */ do_list_fonts = true; break; case 'J': /* JIS page */ if (sscanf (optarg, "%d", &jis_page) <= 0 || (jis_page < 33) || (jis_page > 126)) { fprintf (stderr, "%s: the JIS page number is bad (it should be in the range 33..126)\n", progname); errcnt++; } else do_jis_page = true; break; case 'j': /* JIS row */ if (sscanf (optarg, "%d", &jis_page) <= 0 || (jis_page < 1) || (jis_page > 94)) { fprintf (stderr, "%s: the JIS row number is bad (it should be in the range 1..94)\n", progname); errcnt++; } else { jis_page += 32; do_jis_page = true; } break; case 'h' << 8: /* Help */ show_usage = true; break; default: errcnt++; break; } } if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (do_list_fonts) { int success; success = list_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_fonts) { int success; success = display_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, 2); return EXIT_SUCCESS; } if (option_font_name == NULL && optind >= argc) { fprintf (stderr, "%s: no font or fonts are specified\n", progname); return EXIT_FAILURE; } if (do_jis_page) { if ((!((option_font_name == NULL && optind == argc - 1) || (option_font_name && optind >= argc))) || (option_font_name && strcasecmp (option_font_name, "HersheyEUC") != 0) || (!option_font_name && strcasecmp (argv[optind], "HersheyEUC") != 0)) { fprintf (stderr, "%s: a JIS page can only be specified for the HersheyEUC font\n", progname); return EXIT_FAILURE; } } if ((plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params)) == NULL) { fprintf (stderr, "%s: error: the plot device could not be created\n", progname); return EXIT_FAILURE; } if (option_font_name) /* user specifed a font with -F */ { if (do_font (plotter, option_font_name, upper_half, pen_color, numbering_font_name, title_font_name, bearings, base, jis_page, do_jis_page) == false) return EXIT_FAILURE; } if (optind < argc) /* 1 or more fonts named explicitly on command line */ { for (; optind < argc; optind++) { char *font_name; font_name = argv[optind]; if (do_font (plotter, font_name, upper_half, pen_color, numbering_font_name, title_font_name, bearings, base, jis_page, do_jis_page) == false) return EXIT_FAILURE; } } /* clean up */ retval = EXIT_SUCCESS; if (pl_deletepl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be deleted\n", progname); retval = EXIT_FAILURE; } pl_deleteplparams (plotter_params); return retval; } #define NUM_ROWS 12 #define SIZE 1.0 #define MAX_TITLE_LENGTH 0.9 #define HSPACING 0.1 /* must have 8*HSPACING < SIZE */ #define VSPACING 0.06 /* must have 12*VSPACING < SIZE-LINE_VOFFSET */ #define LINE_HOFFSET (0.5 * ((SIZE) - 8 * (HSPACING))) #define LINE_VOFFSET 0.15 /* top line down from top of display by this */ #define CHAR_HOFFSET ((LINE_HOFFSET) + 0.5 * (HSPACING)) #define CHAR_VOFFSET ((LINE_VOFFSET) + 0.5 * (VSPACING)) #define TOP (SIZE - (LINE_VOFFSET)) #define BOTTOM ((SIZE - (LINE_VOFFSET)) - 12 * (VSPACING)) #define LEFT (LINE_HOFFSET) #define RIGHT (LINE_HOFFSET + 8 * HSPACING) #define FONT_SIZE 0.04 #define TITLE_FONT_SIZE 0.045 #define NUMBERING_FONT_SIZE 0.015 /* shifts of numbers in grid cells leftward and upward */ #define N_X_SHIFT 0.015 #define N_Y_SHIFT 0.05 bool do_font (plPlotter *plotter, const char *name, bool upper_half, char *pen_color_name, char *numbering_font_name, char *title_font_name, bool bearings, enum radix base, int jis_page, bool do_jis_page) { char buf[16]; char numbuf[16]; char suffixbuf[16]; char *titlebuf; const char *suffix; double title_width; int i, j, bottom_octet, top_octet; if (do_jis_page) { switch (base) { case DECIMAL: default: sprintf (suffixbuf, " (row %d)", jis_page - 32); break; case OCTAL: sprintf (suffixbuf, " (row 0%o)", jis_page - 32); break; case HEXADECIMAL: sprintf (suffixbuf, " (row 0x%X)", jis_page - 32); break; } suffix = suffixbuf; } else suffix = upper_half ? " (upper half)" : " (lower half)"; titlebuf = (char *)xmalloc (strlen (name) + strlen (suffix) + 1); strcpy (titlebuf, name); strcat (titlebuf, suffix); if (pl_openpl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be opened\n", progname); return false; } pl_fspace_r (plotter, 0.0, 0.0, (double)SIZE, (double)SIZE); pl_erase_r (plotter); if (pen_color_name) pl_pencolorname_r (plotter, pen_color_name); pl_fmove_r (plotter, 0.5 * SIZE, 0.5 * (SIZE + TOP)); if (title_font_name) pl_fontname_r (plotter, title_font_name); else pl_fontname_r (plotter, name); pl_ffontsize_r (plotter, (double)(TITLE_FONT_SIZE)); title_width = pl_flabelwidth_r (plotter, titlebuf); if (title_width > MAX_TITLE_LENGTH) /* squeeze title to fit */ pl_ffontsize_r (plotter, (double)(TITLE_FONT_SIZE) * (MAX_TITLE_LENGTH / title_width)); /* print title */ pl_alabel_r (plotter, 'c', 'c', titlebuf); if (do_jis_page) bottom_octet = 4; else /* ordinary map */ { if (upper_half) bottom_octet = 20; else bottom_octet = 4; } top_octet = bottom_octet + NUM_ROWS - 1; /* draw grid */ pl_linemod_r (plotter, "solid"); pl_fbox_r (plotter, LEFT, BOTTOM, RIGHT, TOP); for (i = 1; i <= 7; i++) /* boustrophedon */ { if (i % 2) pl_fline_r (plotter, LINE_HOFFSET + i * HSPACING, BOTTOM, LINE_HOFFSET + i * HSPACING, TOP); else pl_fline_r (plotter, LINE_HOFFSET + i * HSPACING, TOP, LINE_HOFFSET + i * HSPACING, BOTTOM); } for (j = 1; j <= 11; j++) /* boustrophedon */ { if (j % 2) pl_fline_r (plotter, RIGHT, TOP - j * VSPACING, LEFT, TOP - j * VSPACING); else pl_fline_r (plotter, LEFT, TOP - j * VSPACING, RIGHT, TOP - j * VSPACING); } /* number grid cells */ if (numbering_font_name) pl_fontname_r (plotter, numbering_font_name); else /* select default font */ pl_fontname_r (plotter, ""); pl_ffontsize_r (plotter, (double)(NUMBERING_FONT_SIZE)); if (bearings) pl_linemod_r (plotter, "dotted"); for (i = bottom_octet; i <= top_octet; i++) for (j = 0; j < 8; j++) { int row, column, charnum; row = i - bottom_octet; /* row, 0..11 */ column = j; /* column, 0..7 */ charnum = (unsigned char)(8 * i + j); if (charnum == 127) /* 0xff not a legitimate glyph */ continue; if (do_jis_page && charnum == 32) continue; /* 0x20 not legitimate for JIS */ switch (base) { case HEXADECIMAL: write_two_bytes (charnum - (do_jis_page ? 32 : 0), numbuf, 16); break; case DECIMAL: default: write_three_bytes (charnum - (do_jis_page ? 32 : 0), numbuf, 10); break; case OCTAL: write_three_bytes (charnum - (do_jis_page ? 32 : 0), numbuf, 8); break; } pl_fmove_r (plotter, (double)(LINE_HOFFSET + HSPACING * (column + 1 - N_X_SHIFT)), (double)(SIZE - (LINE_VOFFSET + VSPACING * (row + 1 - N_Y_SHIFT)))); pl_alabel_r (plotter, 'r', 'x', numbuf); } /* fill grid cells with characters */ pl_fontname_r (plotter, name); pl_ffontsize_r (plotter, (double)(FONT_SIZE)); for (i = bottom_octet; i <= top_octet; i++) for (j = 0; j < 8; j++) { int row, column, charnum; row = i - bottom_octet; /* row, 0..11 */ column = j; /* column, 0..7 */ charnum = (unsigned char)(8 * i + j); if (charnum == 127) /* 0xff not a legitimate glyph */ continue; if (do_jis_page && charnum == 32) continue; /* 0x20 not legitimate for JIS */ if (!do_jis_page) { buf[0] = charnum; buf[1] = '\0'; } else /* do JIS page */ { /* two bytes, set high bits on both page and character */ buf[0] = jis_page + 0x80; buf[1] = charnum + 0x80; buf[2] = '\0'; } pl_fmove_r (plotter, (double)(LINE_HOFFSET + HSPACING * (column + 0.5)), (double)(SIZE - (LINE_VOFFSET + VSPACING * (row + 0.5)))); /* place glyph on page */ pl_alabel_r (plotter, 'c', 'c', (char *)buf); if (bearings) { double halfwidth; /* compute glyph width */ halfwidth = 0.5 * pl_flabelwidth_r (plotter, (char *)buf); if (halfwidth == 0.0) /* empty glyph, draw only one vertical dotted line */ pl_fline_r (plotter, (double)(CHAR_HOFFSET + HSPACING * column), (double)(SIZE - (CHAR_VOFFSET + VSPACING * (row - 0.5))), (double)(CHAR_HOFFSET + HSPACING * column), (double)(SIZE - (CHAR_VOFFSET + VSPACING * (row + 0.5)))); else /* draw vertical dotted lines to either side of glyph */ { pl_fline_r (plotter, (double)(CHAR_HOFFSET + HSPACING * column - halfwidth), (double)(SIZE - (CHAR_VOFFSET + VSPACING * (row - 0.5))), (double)(CHAR_HOFFSET + HSPACING * column - halfwidth), (double)(SIZE - (CHAR_VOFFSET + VSPACING * (row + 0.5)))); pl_fline_r (plotter, (double)(CHAR_HOFFSET + HSPACING * column + halfwidth), (double)(SIZE - (CHAR_VOFFSET + VSPACING * (row - 0.5))), (double)(CHAR_HOFFSET + HSPACING * column + halfwidth), (double)(SIZE - (CHAR_VOFFSET + VSPACING * (row + 0.5)))); } } } if (pl_closepl_r (plotter) < 0) { fprintf (stderr, "%s: error: the plot device could not be closed\n", progname); return false; } return true; } /* Write an integer that is < (radix)**4 as three ascii bytes with respect to the specified radix. Initial zeroes are converted to spaces. */ void write_three_bytes (int charnum, char *numbuf, int radix) { int i; numbuf[0] = charnum / (radix * radix); numbuf[1] = (charnum - (radix * radix) * (charnum / (radix * radix))) / radix; numbuf[2] = charnum % radix; numbuf[3] = '\0'; for (i = 0 ; i <= 2 ; i++) { if (numbuf[i] >= 10) numbuf[i] += ('A' - 10); else numbuf[i] += '0'; } if (numbuf[0] == '0') { numbuf[0] = ' '; if (numbuf[1] == '0') numbuf[1] = ' '; } } /* Write an integer that is < (radix)**3 as two ascii bytes with respect to the specified radix. Initial zeroes are converted are not changed. */ void write_two_bytes (int charnum, char *numbuf, int radix) { int i; numbuf[0] = charnum / radix; numbuf[1] = charnum % radix; numbuf[2] = '\0'; for (i = 0 ; i <= 1 ; i++) { if (numbuf[i] >= 10) numbuf[i] += ('A' - 10); else numbuf[i] += '0'; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/��������������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257513�011536� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/extern.h������������������������������������������������������������������������0000644�0001750�0001750�00000014510�11037235120�013113� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ extern const char *progname; /* program name */ /* Definition of the Point structure. The point-reader (in reader.c) returns a list of these from a specified input stream, and the multigrapher (in plotter.c) interprets them as polyline vertices, and plots the resulting polyline(s). Each polyline comprises a run of points, each (except the first) connected to the previous point, provided that `pendown' is true. The final seven fields should be the same for each point in a polyline. */ typedef struct { double x, y; /* location of the point in user coordinates */ bool have_x_errorbar, have_y_errorbar; double xmin, xmax; /* meaningful only if have_x_errorbar field is set */ double ymin, ymax; /* meaningful only if have_y_errorbar field is set */ bool pendown; /* connect to previous point? (if false, polyline ends) */ /* following fields are polyline attributes: constant over a polyline */ int symbol; /* either a number indicating which standard marker symbol is to be plotted at the point (<0 means none) or an character to be plotted, depending on the value: 0-31: a marker number, or 32-up: a character. */ double symbol_size; /* symbol size, as frac. of size of plotting area */ const char *symbol_font_name; /* font from which symbols >= 32 are taken */ int linemode; /* linemode of polyline (<0 means no polyline) */ double line_width; /* line width as fraction of size of the display */ double fill_fraction; /* in interval [0,1], <0 means polyline isn't filled */ bool use_color; /* color/monochrome interpretation of linemode */ } Point; /* type of data in input stream */ typedef enum { T_ASCII, T_SINGLE, T_DOUBLE, T_INTEGER, T_GNUPLOT, T_ASCII_ERRORBAR } data_type; /* style of graph frame; the 1st four of these are increasingly fancy, but the last (AXES_AT_ORIGIN) is an altogether different style */ typedef enum { NO_AXES = 0, AXES = 1, AXES_AND_BOX = 2, AXES_AND_BOX_AND_GRID = 3, AXES_AT_ORIGIN = 4 } grid_type; #define NORMAL_AXES(grid_spec) \ ((grid_spec == AXES) || (grid_spec == AXES_AND_BOX) \ || (grid_spec == AXES_AND_BOX_AND_GRID)) /* bit fields in portmanteau variables */ enum { X_AXIS = 0x1, Y_AXIS = 0x2 }; #define NO_OF_LINEMODES 5 /* see linemode.c */ #define MAX_COLOR_NAME_LEN 32 /* long enough for all of libplot's colors */ /* types of line */ extern const char *linemodes[NO_OF_LINEMODES]; extern const char *colorstyle[NO_OF_LINEMODES]; /*----------------- prototypes for functions in plotter.h -------------------*/ typedef struct MultigrapherStruct Multigrapher; extern Multigrapher * new_multigrapher (const char *output_format, const char *bg_color, const char *bitmap_size, const char *emulate_color, const char *max_line_length, const char *meta_portable, const char *page_size, const char *rotation_angle, bool save_screen); extern int delete_multigrapher (Multigrapher *multigrapher); extern void begin_graph (Multigrapher *multigrapher, double scale, double trans_x, double trans_y); extern void end_graph (Multigrapher *multigrapher); extern void set_graph_parameters (Multigrapher *multigrapher, double frame_line_width, const char *frame_color, const char *title, const char *title_font_name, double title_font_size, double tick_size, grid_type grid_spec, double x_min, double x_max, double x_spacing, double y_min, double y_max, double y_spacing, bool spec_x_spacing, bool spec_y_spacing, double width, double height, double up, double right, const char *x_font_name, double x_font_size, const char *x_label, const char *y_font_name, double y_font_size, const char *y_label, bool no_rotate_y_label, int log_axis, int round_to_next_tick, int switch_axis_end, int omit_labels, int clip_mode, double blankout_fraction, bool transpose_axes); extern void draw_frame_of_graph (Multigrapher *multigrapher, bool draw_canvas); extern void plot_point (Multigrapher *multigrapher, const Point *point); extern void plot_point_array (Multigrapher *multigrapher, const Point *p, int length); extern void end_polyline_and_flush (Multigrapher *multigrapher); /*----------------- prototypes for functions in reader.h -------------------*/ typedef struct ReaderStruct Reader; extern Reader * new_reader (FILE *input, data_type input_type, bool auto_abscissa, double delta_x, double abscissa, bool transpose_axes, int log_axis, bool auto_bump, int symbol, double symbol_size, const char *symbol_font_name, int linemode, double line_width, double fill_fraction, bool use_color); extern void delete_reader (Reader *reader); extern void read_file (Reader *reader, Point **p, int *length, int *no_of_points); extern void read_and_plot_file (Reader *reader, Multigrapher *multigrapher); extern void alter_reader_parameters (Reader *reader, FILE *input, data_type input_type, bool auto_abscissa, double delta_x, double abscissa, int symbol, double symbol_size, const char *symbol_font_name, int linemode, double line_width, double fill_fraction, bool use_color, bool new_symbol, bool new_symbol_size, bool new_symbol_font_name, bool new_linemode, bool new_line_width, bool new_fill_fraction, bool new_use_color); /*----------------- prototypes for functions in misc.h -------------------*/ extern void array_bounds (const Point *p, int length, bool transpose_axes, int clip_mode, double *min_x, double *min_y, double *max_x, double *max_y, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y); /*------------------------------------------------------------------------*/ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/Makefile.am���������������������������������������������������������������������0000644�0001750�0001750�00000001544�10341763455�013512� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in bin_PROGRAMS = graph graph_SOURCES = graph.c misc.c linemode.c reader.c plotter.c fontlist.c graph_LDADD = ../lib/libcommon.a ../libplot/libplot.la noinst_HEADERS = extern.h INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c # remove executables installed by previous versions of the package, and # remove obsolete library versions too OBSOLETEBINS = graph-tek graph-hpgl graph-fig graph-ps graph-X OBSOLETELIBS = libplottek.a libplothpgl.a libplotfig.a libplotps.a libplotX.a install-exec-hook: -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done -for f in $(OBSOLETELIBS) ; do rm -f $(libdir)/$$f; done fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi ������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/Makefile.in���������������������������������������������������������������������0000644�0001750�0001750�00000036371�11234210072�013511� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = graph$(EXEEXT) subdir = graph DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_graph_OBJECTS = graph.$(OBJEXT) misc.$(OBJEXT) linemode.$(OBJEXT) \ reader.$(OBJEXT) plotter.$(OBJEXT) fontlist.$(OBJEXT) graph_OBJECTS = $(am_graph_OBJECTS) graph_DEPENDENCIES = ../lib/libcommon.a ../libplot/libplot.la DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(graph_SOURCES) DIST_SOURCES = $(graph_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ graph_SOURCES = graph.c misc.c linemode.c reader.c plotter.c fontlist.c graph_LDADD = ../lib/libcommon.a ../libplot/libplot.la noinst_HEADERS = extern.h INCLUDES = -I$(srcdir)/../include CLEANFILES = fontlist.c # remove executables installed by previous versions of the package, and # remove obsolete library versions too OBSOLETEBINS = graph-tek graph-hpgl graph-fig graph-ps graph-X OBSOLETELIBS = libplottek.a libplothpgl.a libplotfig.a libplotps.a libplotX.a all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu graph/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu graph/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done graph$(EXEEXT): $(graph_OBJECTS) $(graph_DEPENDENCIES) @rm -f graph$(EXEEXT) $(LINK) $(graph_OBJECTS) $(graph_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linemode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plotter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reader.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS install-exec-hook: -for f in $(OBSOLETEBINS) ; do rm -f $(bindir)/$$f; done -for f in $(OBSOLETELIBS) ; do rm -f $(libdir)/$$f; done fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/graph.c�������������������������������������������������������������������������0000644�0001750�0001750�00000146577�11234220441�012724� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the main routine, and a few support subroutines, for GNU graph. */ #include "sys-defines.h" #include "extern.h" #include "libcommon.h" #include "getopt.h" #include "fontlist.h" /* options */ #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 const char *optstring = "-BCHOQVstE:F:f:g:h:k:K:I:l:L:m:N:q:R:r:T:u:w:W:X:Y:a::x::y::S::"; /* initial hyphen requests no reordering */ struct option long_options[] = { /* The most important option ("--display-type" is an obsolete variant) */ { "output-format", ARG_REQUIRED, NULL, 'T'}, { "display-type", ARG_REQUIRED, NULL, 'T' << 8 }, /* hidden */ /* Other frequently used options */ {"auto-abscissa", ARG_OPTIONAL, NULL, 'a'}, /* 0 or 1 or 2 */ {"clip-mode", ARG_REQUIRED, NULL, 'K'}, {"fill-fraction", ARG_REQUIRED, NULL, 'q'}, {"font-name", ARG_REQUIRED, NULL, 'F'}, {"font-size", ARG_REQUIRED, NULL, 'f'}, {"grid-style", ARG_REQUIRED, NULL, 'g'}, {"height-of-plot", ARG_REQUIRED, NULL, 'h'}, {"input-format", ARG_REQUIRED, NULL, 'I'}, {"line-mode", ARG_REQUIRED, NULL, 'm'}, {"line-width", ARG_REQUIRED, NULL, 'W'}, {"right-shift", ARG_REQUIRED, NULL, 'r'}, {"save-screen", ARG_NONE, NULL, 's'}, {"symbol", ARG_OPTIONAL, NULL, 'S'}, /* 0 or 1 or 2 */ {"tick-size", ARG_REQUIRED, NULL, 'k'}, {"toggle-auto-bump", ARG_NONE, NULL, 'B'}, {"toggle-axis-end", ARG_REQUIRED, NULL, 'E'}, {"toggle-frame-on-top", ARG_NONE, NULL, 'H'}, {"toggle-log-axis", ARG_REQUIRED, NULL, 'l'}, {"toggle-no-ticks", ARG_REQUIRED, NULL, 'N'}, {"toggle-rotate-y-label", ARG_NONE, NULL, 'Q'}, {"toggle-round-to-next-tick", ARG_REQUIRED, NULL, 'R'}, {"toggle-transpose-axes", ARG_NONE, NULL, 't'}, {"toggle-use-color", ARG_NONE, NULL, 'C'}, {"top-label", ARG_REQUIRED, NULL, 'L'}, {"upward-shift", ARG_REQUIRED, NULL, 'u'}, {"width-of-plot", ARG_REQUIRED, NULL, 'w'}, {"x-label", ARG_REQUIRED, NULL, 'X'}, {"x-limits", ARG_OPTIONAL, NULL, 'x'}, /* 0, 1, 2, or 3 */ {"y-label", ARG_REQUIRED, NULL, 'Y'}, {"y-limits", ARG_OPTIONAL, NULL, 'y'}, /* 0, 1, 2, or 3 */ /* Long options with no equivalent short option alias */ {"bg-color", ARG_REQUIRED, NULL, 'q' << 8}, {"bitmap-size", ARG_REQUIRED, NULL, 'B' << 8}, {"blankout", ARG_REQUIRED, NULL, 'b' << 8}, {"emulate-color", ARG_REQUIRED, NULL, 'e' << 8}, {"frame-line-width", ARG_REQUIRED, NULL, 'W' << 8}, {"frame-color", ARG_REQUIRED, NULL, 'C' << 8}, {"max-line-length", ARG_REQUIRED, NULL, 'M' << 8}, {"pen-colors", ARG_REQUIRED, NULL, 'p' << 8}, {"reposition", ARG_REQUIRED, NULL, 'R' << 8}, /* 3 */ {"rotation", ARG_REQUIRED, NULL, 'r' << 8}, {"symbol-font-name", ARG_REQUIRED, NULL, 'G' << 8}, {"title-font-name", ARG_REQUIRED, NULL, 'Z' << 8}, {"title-font-size", ARG_REQUIRED, NULL, 'F' << 8}, {"page-size", ARG_REQUIRED, NULL, 'P' << 8}, /* Options relevant only to raw graph (refers to plot(5) output) */ {"portable-output", ARG_NONE, NULL, 'O'}, /* Documentation options */ {"help-fonts", ARG_NONE, NULL, 'f' << 8}, {"list-fonts", ARG_NONE, NULL, 'l' << 8}, {"version", ARG_NONE, NULL, 'V' << 8}, {"help", ARG_NONE, NULL, 'h' << 8}, {NULL, 0, 0, 0} }; /* null-terminated list of options, such as obsolete-but-still-maintained options or undocumented options, which we don't show to the user */ const int hidden_options[] = { (int)('T' << 8), 0 }; const char *progname = "graph"; /* name of this program */ const char *written = "Written by Robert S. Maier."; const char *copyright = "Copyright (C) 2009 Free Software Foundation, Inc."; const char *usage_appendage = " [FILE]...\n\ With no FILE, or when FILE is -, read standard input.\n"; /* forward references */ static void close_file (char *filename, FILE *stream); static void open_file_for_reading (char *filename, FILE **input); static bool parse_pen_string (const char *pen_s); int main (int argc, char *argv[]) { /* Variables related to getopt parsing */ int option; int opt_index; int errcnt = 0; /* errors encountered in getopt parsing */ int matched; bool using_getopt = true; /* true until end of command-line options */ bool continue_parse = true; /* reset e.g. when --help or --version seen */ bool show_version = false; /* show version message? */ bool show_usage = false; /* show usage message? */ bool show_fonts = false; /* supply help on fonts? */ bool do_list_fonts = false; /* show a list of fonts? */ bool filter = false; /* will we act as a filter? */ bool new_symbol = false; bool new_symbol_size = false; bool new_symbol_font_name = false; bool new_linemode = false; bool new_plot_line_width = false; bool new_fill_fraction = false; bool new_use_color = false; bool first_file_of_graph = true; bool first_graph_of_multigraph = true; FILE *data_file = NULL; /* Variables related to the point reader */ Reader *reader = NULL; data_type input_type = T_ASCII; /* by default we read ascii data */ bool auto_bump = true; /* auto-bump linemode between polylines? */ bool auto_abscissa = false; /* generate abscissa values automatically? */ double x_start = 0.; /* start and increment, for auto-abscissa */ double delta_x = 1.; /* polyline attributes */ int linemode_index = 1; /* linemode for polylines, 1=solid, etc. */ double plot_line_width = -0.001; /* polyline width (as frac. of display width), negative means default provided by libplot) */ int symbol_index = 0; /* 0=none, 1=dot, 2=plus, 3=asterisk, etc. */ double symbol_size = .03; /* symbol size (frac. of plotting box size) */ double fill_fraction = -1.0; /* negative means regions aren't filled */ bool use_color = false; /* color / monochrome */ /* Variables related to both the point reader and the point plotter */ bool transpose_axes = false; /* true means -x applies to y axis, etc. */ /* Variables related to the multigrapher, i.e. point plotter */ Multigrapher *multigrapher = NULL; /* command-line parameters (constant over multigrapher operation) */ const char *output_format = "meta";/* libplot output format */ const char *bg_color = NULL; /* color of background, if non-NULL */ const char *bitmap_size = NULL; const char *emulate_color = NULL; const char *max_line_length = NULL; const char *meta_portable = NULL; const char *page_size = NULL; const char *rotation_angle = NULL; bool save_screen = false; /* save screen, i.e. no erase before plot? */ /* graph-specific parameters (may change from graph to graph) */ grid_type grid_spec = AXES_AND_BOX; /* frame type for current graph */ bool no_rotate_y_label = false; /* used for pre-X11R6 servers */ const char *frame_color = "black"; /* color of frame (and graph, if no -C)*/ int clip_mode = 1; /* clipping mode (cf. gnuplot) */ /* following variables are portmanteau: x and y are included as bitfields*/ int log_axis = 0; /* log axes or linear axes? */ int round_to_next_tick = 0; /* round axis limits to nearest tick? */ int switch_axis_end = 0; /* axis at top/right instead of bottom/left? */ int omit_ticks = 0; /* omit ticks and tick labels from an axis? */ /* graph dimensions, expressed as fractions of the width of the libplot graphics display [by convention square]; <0.0 means use libplot default */ double frame_line_width = -0.001; /* width of lines in the graph frame */ /* dimensions of graphing area, expressed as fractions of the width of the libplot graphics display [by convention square] */ double margin_below = .2; /* margin below the plot */ double margin_left = .2; /* margin left of the plot */ double plot_height = .6; /* height of the plot */ double plot_width = .6; /* width of the plot */ /* dimensions, expressed as fractions of the size of the plotting area */ double tick_size = .02; /* size of tick marks (< 0.0 allowed) */ double font_size = 0.0525; /* fontsize */ double title_font_size = 0.07; /* title fontsize */ double blankout_fraction = 1.3; /* this fraction of size of plotting box is erased before the plot is drawn */ /* text-related */ const char *font_name = NULL; /* font name, NULL -> device default */ const char *title_font_name = NULL; /* title font name, NULL -> default */ const char *symbol_font_name = "ZapfDingbats"; /* symbol font name, NULL -> default */ const char *x_label = NULL; /* label for the x axis, NULL -> no label */ const char *y_label = NULL; /* label for the y axis, NULL -> no label */ const char *top_label = NULL; /* title above the plot, NULL -> no title */ /* user-specified limits on the axes */ double min_x = 0.0, min_y = 0.0, max_x = 0.0, max_y = 0.0; double spacing_x = 0.0, spacing_y = 0.0; /* flags indicating which axis limits the user has specified */ bool spec_min_x = false, spec_min_y = false; bool spec_max_x = false, spec_max_y = false; bool spec_spacing_x = false, spec_spacing_y = false; /* misc. local variables used in getopt parsing, counterparts to the above */ double local_x_start, local_delta_x; int local_grid_style; int local_symbol_index; int local_clip_mode; double local_symbol_size, local_font_size, local_title_font_size; double local_frame_line_width, local_plot_line_width; double local_min_x, local_min_y; double local_max_x, local_max_y; double local_spacing_x, local_spacing_y; double local_fill_fraction; /* `finalized' arguments to set_graph_parameters() (computed at the time the first file of a graph is seen, and continuing in effect over the duration of the graph) */ int final_log_axis = 0; int final_round_to_next_tick = 0; double final_min_x = 0.0, final_max_x = 0.0, final_spacing_x = 0.0; double final_min_y = 0.0, final_max_y = 0.0, final_spacing_y = 0.0; bool final_spec_min_x = false, final_spec_min_y = false; bool final_spec_max_x = false, final_spec_max_y = false; bool final_spec_spacing_x = false, final_spec_spacing_y = false; bool final_transpose_axes = false; /* for storage of data points (if we're not acting as a filter) */ Point *p; /* points array */ int points_length = 1024; /* length of the points array, in points */ int no_of_points = 0; /* number of points stored in it */ /* support for multigraphing */ double reposition_trans_x = 0.0, reposition_trans_y = 0.0; double reposition_scale = 1.0; double old_reposition_trans_x, old_reposition_trans_y; double old_reposition_scale; /* sui generis */ bool frame_on_top = false; /* The main command-line parsing loop, which uses getopt to scan argv[] without reordering, i.e. to process command-line arguments (options and filenames) sequentially. From a logical point of view, a multigraph consists of a sequence of graphs, with a `--reposition' flag serving as a separator between graphs. A graph is drawn from one or more files. So this parsing loop invokes Multigrapher methods (1) when a file name is seen, (2) when a `--reposition' directive is seen, and (3) at the end of the scan over argv[]. If at the end of the scan no file names have been seen, stdin is used instead as an input stream. (As a file name, `-' means stdin.) */ while (continue_parse) { if (using_getopt) /* end of options not reached yet */ { option = getopt_long (argc, argv, /* initial hyphen requests no reordering */ optstring, long_options, &opt_index); if (option == EOF) /* end of options */ { using_getopt = false; continue; /* back to top of while loop */ } if (option == 1) /* filename embedded among options */ { if (strcmp (optarg, "-") == 0) data_file = stdin; /* interpret "-" as stdin */ else open_file_for_reading (optarg, &data_file); } } else /* end of options reached, processing filenames manually */ { if (optind >= argc) /* all files processed */ { if (first_graph_of_multigraph && first_file_of_graph) /* no file appeared on command line, read stdin instead */ { data_file = stdin; option = 1; /* code for pseudo-option */ } else break; /* all files done, break out of while loop */ } else /* have files yet to process */ { if (strcmp (argv[optind], "-") == 0) data_file = stdin; else open_file_for_reading (argv[optind], &data_file); optarg = argv[optind]; /* keep track of name of opened file */ optind++; option = 1; /* code for pseudo-option */ } } /* Parse an option flag, which may be a genuine option flag obtained from getopt, or a fake (a `1', indicating that a filename has been seen by getopt, or that filename has been seen on the command line after all genuine options have been processed, or that stdin must be read because no filenames have been seen). */ switch (option) { /* ----------- options with no argument --------------*/ case 's': /* Don't erase display before plot, ARG NONE */ save_screen = true; break; case 't': /* Toggle transposition of axes, ARG NONE */ transpose_axes = (transpose_axes == true ? false : true); break; case 'B': /* Toggle linemode auto-bumping, ARG NONE */ auto_bump = (auto_bump == true ? false : true); break; case 'C': /* Toggle color/monochrome, ARG NONE */ new_use_color = true; use_color = (use_color == true ? false : true); break; case 'H': /* Toggle frame-on-top, ARG NONE */ frame_on_top = (frame_on_top == true ? false : true); break; case 'O': /* portable format, ARG NONE */ meta_portable = "yes"; break; case 'e' << 8: /* emulate color, ARG NONE */ emulate_color = xstrdup (optarg); break; case 'V' << 8: /* Version, ARG NONE */ show_version = true; continue_parse = false; break; case 'h' << 8: /* Help, ARG NONE */ show_usage = true; continue_parse = false; break; case 'f' << 8: /* Help on fonts, ARG NONE */ show_fonts = true; continue_parse = false; break; case 'l' << 8: /* List fonts, ARG NONE */ do_list_fonts = true; continue_parse = false; break; case 'Q': /* Toggle rotation of y-label, ARG NONE */ no_rotate_y_label = (no_rotate_y_label == true ? false : true); break; /*----------- options with a single argument --------------*/ case 'I': /* Input format, ARG REQUIRED */ switch (*optarg) { case 'a': case 'A': /* ASCII format, records and fields within records are separated by whitespace, and datasets are separated by a pair of newlines. Record length = 2. */ input_type = T_ASCII; break; case 'f': case 'F': /* Binary single precision, records and fields within records are contiguous, and datasets are separated by a FLT_MAX. Record length = 2. */ input_type = T_SINGLE; break; case 'd': case 'D': /* Binary double precision, records and fields within records are contiguous, and datasets are separated by a DBL_MAX. Record length = 2. */ input_type = T_DOUBLE; break; case 'i': case 'I': /* Binary integer, records and fields within records are contiguous, and datasets are separated by an occurrence of INT_MAX. Record length = 2. */ input_type = T_INTEGER; break; case 'e': case 'E': /* Same as T_ASCII, but record length = 3. */ input_type = T_ASCII_ERRORBAR; break; case 'g': case 'G': /* Sui generis. */ input_type = T_GNUPLOT; /* gnuplot `table' format */ break; default: fprintf (stderr, "%s: error: `%s' is an unrecognized data option\n", progname, optarg); errcnt++; } break; case 'f': /* Font size, ARG REQUIRED */ if (sscanf (optarg, "%lf", &local_font_size) <= 0) { fprintf (stderr, "%s: error: the font size should be a number, but it was `%s'\n", progname, optarg); errcnt++; } else { if (local_font_size >= 1.0) fprintf (stderr, "%s: the too-large font size `%f' is disregarded (it should be less than 1.0)\n", progname, local_font_size); else if (local_font_size < 0.0) fprintf (stderr, "%s: the negative font size `%f' is disregarded\n", progname, local_font_size); else font_size = local_font_size; } break; case 'g': /* Grid style, ARG REQUIRED */ if (sscanf (optarg, "%d", &local_grid_style) <= 0) { fprintf (stderr, "%s: error: the grid style should be a (small) integer, but it was `%s'\n", progname, optarg); errcnt++; break; } switch (local_grid_style) /* the subset ordering is: 0 < 1 < 2 < 3; 4 is different */ { case 0: /* no frame at all; just the plot */ grid_spec = NO_AXES; break; case 1: /* box, ticks, gridlines, labels */ grid_spec = AXES; break; case 2: /* box, ticks, no gridlines, labels */ grid_spec = AXES_AND_BOX; break; case 3: /* `half-box', partial ticks, no gridlines, labels */ grid_spec = AXES_AND_BOX_AND_GRID; break; case 4: /* no box, no gridlines; specially positioned axes, labels */ grid_spec = AXES_AT_ORIGIN; break; default: fprintf (stderr, "%s: error: the grid style number `%s' is out of bounds\n", progname, optarg); errcnt++; } break; case 'h': /* Height of plot, ARG REQUIRED */ if (sscanf (optarg, "%lf", &plot_height) <= 0) { fprintf (stderr, "%s: error: the plot height should be a number, but it was `%s'\n", progname, optarg); errcnt++; } break; case 'K': /* Clip mode, ARG REQUIRED */ if ((sscanf (optarg, "%d", &local_clip_mode) <= 0) || local_clip_mode < 0 || local_clip_mode > 2) fprintf (stderr, "%s: the bad clip mode `%s' is disregarded (it should be 0, 1, or 2)\n", progname, optarg); else clip_mode = local_clip_mode; break; case 'l': /* Toggle log/linear axis, ARG REQUIRED */ switch (*optarg) { case 'x': case 'X': log_axis ^= X_AXIS; break; case 'y': case 'Y': log_axis ^= Y_AXIS; break; default: fprintf (stderr, "%s: the unrecognized axis specification `%s' is disregarded\n", progname, optarg); break; } break; case 'N': /* Toggle omission of labels, ARG REQUIRED */ switch (*optarg) { case 'x': case 'X': omit_ticks ^= X_AXIS; break; case 'y': case 'Y': omit_ticks ^= Y_AXIS; break; default: fprintf (stderr, "%s: the unrecognized axis specification `%s' is disregarded\n", progname, optarg); break; } break; case 'm': /* Linemode, ARG REQUIRED */ new_linemode = true; if (sscanf (optarg, "%d", &linemode_index) <= 0) { fprintf (stderr, "%s: error: the linemode should be a (small) integer, but it was `%s'\n", progname, optarg); errcnt++; } break; case 'q': /* Fill fraction, ARG REQUIRED */ if (sscanf (optarg, "%lf", &local_fill_fraction) <= 0) { fprintf (stderr, "%s: error: the fill fraction should be a number, but it was `%s'\n", progname, optarg); errcnt++; } else { if (local_fill_fraction > 1.0) fprintf (stderr, "%s: the region fill fraction `%f' was disregarded (it should be less than or equal to 1.0)\n", progname, local_fill_fraction); else { fill_fraction = local_fill_fraction; new_fill_fraction = true; } } break; case 'r': /* Right shift, ARG REQUIRED */ if (sscanf (optarg, "%lf", &margin_left) <= 0) { fprintf (stderr, "%s: error: the rightward displacement for the plot should be a number, but it was `%s'\n", progname, optarg); errcnt++; } break; case 'u': /* Upward shift, ARG REQUIRED */ if (sscanf (optarg, "%lf", &margin_below) <= 0) { fprintf (stderr, "%s: error: the upward displacement for the plot should be a number, but it was `%s'\n", progname, optarg); errcnt++; } break; case 'w': /* Width of plot, ARG REQUIRED */ if (sscanf (optarg, "%lf", &plot_width) <= 0) { fprintf (stderr, "%s: error: the plot width should be a number, but it was `%s'\n", progname, optarg); errcnt++; } break; case 'T': /* Output format, ARG REQUIRED */ case 'T' << 8: output_format = xstrdup (optarg); break; case 'F': /* Font name, ARG REQUIRED */ font_name = xstrdup (optarg); break; case 'r' << 8: /* Rotation angle, ARG REQUIRED */ rotation_angle = xstrdup (optarg); break; case 'Z' << 8: /* Title Font name, ARG REQUIRED */ title_font_name = xstrdup (optarg); break; case 'G' << 8: /* Symbol Font name, ARG REQUIRED */ symbol_font_name = xstrdup (optarg); new_symbol_font_name = true; break; case 'R': /* Toggle rounding to next tick, ARG REQUIRED*/ switch (*optarg) { case 'x': case 'X': round_to_next_tick ^= X_AXIS; break; case 'y': case 'Y': round_to_next_tick ^= Y_AXIS; break; default: fprintf (stderr, "%s: the unrecognized axis specification `%s' is disregarded\n", progname, optarg); break; } break; case 'L': /* Top title, ARG REQUIRED */ top_label = xstrdup (optarg); break; case 'k': /* Tick size, ARG REQUIRED */ if (sscanf (optarg, "%lf", &tick_size) <= 0) { fprintf (stderr, "%s: error: the tick size should be a number, but it was `%s'\n", progname, optarg); errcnt++; } break; case 'W': /* Line width, ARG REQUIRED */ if (sscanf (optarg, "%lf", &local_plot_line_width) <= 0) { fprintf (stderr, "%s: error: the line thickness for the plot should be a number, but it was `%s'\n", progname, optarg); errcnt++; } if (local_plot_line_width < 0.0) fprintf (stderr, "%s: the negative plot line thickness `%f' is disregarded\n", progname, local_plot_line_width); else { plot_line_width = local_plot_line_width; new_plot_line_width = true; } break; case 'X': /* X axis title, ARG REQUIRED */ x_label = xstrdup (optarg); break; case 'Y': /* Y axis title, ARG REQUIRED */ y_label = xstrdup (optarg); break; case 'E': /* Toggle switching of axis to other end, ARG REQUIRED */ switch (*optarg) { case 'x': case 'X': switch_axis_end ^= Y_AXIS; break; case 'y': case 'Y': switch_axis_end ^= X_AXIS; break; default: fprintf (stderr, "%s: the unrecognized axis specification `%s' is disregarded\n", progname, optarg); break; } break; case 'b' << 8: /* Blankout fraction, ARG REQUIRED */ if (sscanf (optarg, "%lf", &blankout_fraction) <= 0) { fprintf (stderr, "%s: error: the fractional blankout should be a number, but it was `%s'\n", progname, optarg); errcnt++; } break; case 'B' << 8: /* Bitmap size, ARG REQUIRED */ bitmap_size = xstrdup (optarg); break; case 'F' << 8: /* Title font size, ARG REQUIRED */ if (sscanf (optarg, "%lf", &local_title_font_size) <= 0) { fprintf (stderr, "%s: error: the font size for the title should be a number, but it was `%s'\n", progname, optarg); errcnt++; } else if (local_title_font_size >= 1.0) fprintf (stderr, "%s: the too-large title font size `%f' is disregarded (it should be less than 1.0)\n", progname, local_title_font_size); else if (local_title_font_size < 0.0) fprintf (stderr, "%s: the negative title font size `%f' is disregarded\n", progname, local_title_font_size); if (local_title_font_size == 0.0) fprintf (stderr, "%s: the request for a zero title font size is disregarded\n", progname); else title_font_size = local_title_font_size; break; case 'W' << 8: /* Frame line width, ARG REQUIRED */ if (sscanf (optarg, "%lf", &local_frame_line_width) <= 0) { fprintf (stderr, "%s: error: the line thickness for the frame should be a number, but it was `%s'\n", progname, optarg); errcnt++; } if (local_frame_line_width < 0.0) fprintf (stderr, "%s: the negative frame line thickness `%f' is disregarded\n", progname, local_frame_line_width); else frame_line_width = local_frame_line_width; break; case 'M' << 8: /* Max line length, ARG REQUIRED */ max_line_length = xstrdup (optarg); break; case 'P' << 8: /* Page size, ARG REQUIRED */ page_size = xstrdup (optarg); break; case 'p' << 8: /* Pen color string, ARG REQUIRED */ if (parse_pen_string (optarg) == false) { fprintf (stderr, "%s: the unparseable pen string `%s' is disregarded\n", progname, optarg); } break; case 'q' << 8: /* Background color, ARG REQUIRED */ bg_color = xstrdup (optarg); break; case 'C' << 8: /* Frame color, ARG REQUIRED */ frame_color = xstrdup (optarg); break; /*------ options with zero or more arguments ---------*/ case 'a': /* Auto-abscissa, ARG OPTIONAL [0,1,2] */ auto_abscissa = true; if (optind >= argc) break; if (sscanf (argv[optind], "%lf", &local_delta_x) <= 0) break; optind++; /* tell getopt we recognized delta_x */ if (local_delta_x == 0.0) /* "-a 0" turns off auto-abscissa for next file */ { auto_abscissa = false; break; } delta_x = local_delta_x; if (optind >= argc) break; if (sscanf (argv[optind], "%lf", &local_x_start) <= 0) break; x_start = local_x_start; optind++; /* tell getopt we recognized x_start */ break; case 'x': /* X limits, ARG OPTIONAL [0,1,2,3] */ matched = 0; if (optind >= argc || ((strcmp (argv[optind], "-") != 0) && (matched = sscanf (argv[optind], "%lf", &local_min_x)) <= 0)) { spec_min_x = spec_max_x = spec_spacing_x = false; break; } if (matched > 0) { spec_min_x = true; min_x = local_min_x; } else spec_min_x = false; optind++; /* tell getopt we recognized min_x */ matched = 0; if (optind >= argc || ((strcmp (argv[optind], "-") != 0) && (matched = sscanf (argv[optind], "%lf", &local_max_x)) <= 0)) { spec_max_x = spec_spacing_x = false; break; } if (matched > 0) { spec_max_x = true; max_x = local_max_x; } else spec_max_x = false; optind++; /* tell getopt we recognized max_x */ matched = 0; if (optind >= argc || ((strcmp (argv[optind], "-") != 0) && (matched = sscanf (argv[optind], "%lf", &local_spacing_x)) <= 0)) { spec_spacing_x = false; break; } if (matched > 0) { spec_spacing_x = true; spacing_x = local_spacing_x; } else spec_spacing_x = false; optind++; /* tell getopt we recognized spacing_x */ break; case 'y': /* Y limits, ARG OPTIONAL [0,1,2,3] */ matched = 0; if (optind >= argc || ((strcmp (argv[optind], "-") != 0) && (matched = sscanf (argv[optind], "%lf", &local_min_y)) <= 0)) { spec_min_y = spec_max_y = spec_spacing_y = false; break; } if (matched > 0) { spec_min_y = true; min_y = local_min_y; } else spec_min_y = false; optind++; /* tell getopt we recognized min_y */ matched = 0; if (optind >= argc || ((strcmp (argv[optind], "-") != 0) && (matched = sscanf (argv[optind], "%lf", &local_max_y)) <= 0)) { spec_max_y = spec_spacing_y = false; break; } if (matched > 0) { spec_max_y = true; max_y = local_max_y; } else spec_max_y = false; optind++; /* tell getopt we recognized max_y */ matched = 0; if (optind >= argc || ((strcmp (argv[optind], "-") != 0) && (matched = sscanf (argv[optind], "%lf", &local_spacing_y)) <= 0)) { spec_spacing_y = false; break; } if (matched > 0) { spec_spacing_y = true; spacing_y = local_spacing_y; } else spec_spacing_y = false; optind++; /* tell getopt we recognized spacing_y */ break; case 'S': /* Symbol, ARG OPTIONAL [0,1,2] */ new_symbol = true; symbol_index = 1; /* symbol # 1 is switched to by -S alone */ if (optind >= argc) break; if (sscanf (argv[optind], "%d", &local_symbol_index) <= 0) break; if (local_symbol_index < 0 || local_symbol_index > 255) fprintf (stderr, "%s: the symbol type `%d' is disregarded (it should be in the range 0..255)\n", progname, local_symbol_index); else symbol_index = local_symbol_index; optind++; /* tell getopt we recognized symbol_index */ if (optind >= argc) break; if (sscanf (argv[optind], "%lf", &local_symbol_size) <= 0) break; if (local_symbol_size < 0.0) fprintf (stderr, "%s: the negative symbol size `%f' is disregarded\n", progname, local_symbol_size); else if (local_symbol_size == 0.0) fprintf (stderr, "%s: the request for a zero symbol size is disregarded\n", progname); else { symbol_size = local_symbol_size; new_symbol_size = true; } optind++; /* tell getopt we recognized symbol_size */ break; /* ---------- options with one or more arguments ---------- */ case 'R' << 8: /* End graph and reposition, ARG REQUIRED [3]*/ old_reposition_trans_x = reposition_trans_x; old_reposition_trans_y = reposition_trans_y; old_reposition_scale = reposition_scale; if (sscanf (optarg, "%lf", &reposition_trans_x) <= 0) { fprintf (stderr, "%s: error: the x repositioning should be a number, but it was `%s'\n", progname, optarg); return EXIT_FAILURE; } if (optind >= argc) { fprintf (stderr, "%s: error: one or more arguments to the --reposition option were missing\n", progname); return EXIT_FAILURE; } if (sscanf (argv[optind], "%lf", &reposition_trans_y) <= 0) { fprintf (stderr, "%s: error: the y repositioning should be a number, but it was `%s'\n", progname, argv[optind]); return EXIT_FAILURE; } optind++; /* tell getopt we recognized trans_y */ if (optind >= argc) { fprintf (stderr, "%s: error: one or more arguments to the --reposition option were missing\n", progname); return EXIT_FAILURE; } if (sscanf (argv[optind], "%lf", &reposition_scale) <= 0) { fprintf (stderr, "%s: error: the reposition scale factor should be a number, but it was `%s'\n", progname, optarg); return EXIT_FAILURE; } if (reposition_scale == 0.0) { fprintf (stderr, "%s: error: the reposition scale factor should not be zero\n", progname); return EXIT_FAILURE; } optind++; /* tell getopt we recognized trans_x */ if (!first_file_of_graph) /* a graph is in progress (at least one file has been read), so it must be ended before we begin the next one */ { if (!filter) /* We haven't been acting as a real-time filter for the duration of this graph, so the graph isn't already drawn on the display. Instead, we have a points array and we need to plot it, after computing bounds. */ { /* fill in any of min_? and max_? that user didn't specify (the prefix "final_" means these arguments were finalized at the time the first file of the plot was processed) */ array_bounds (p, no_of_points, final_transpose_axes, clip_mode, &final_min_x, &final_min_y, &final_max_x, &final_max_y, final_spec_min_x, final_spec_min_y, final_spec_max_x, final_spec_max_y); if (first_graph_of_multigraph) /* haven't created multigrapher yet, do so now */ { if ((multigrapher = new_multigrapher (output_format, bg_color, bitmap_size, emulate_color, max_line_length, meta_portable, page_size, rotation_angle, save_screen)) == NULL) { fprintf (stderr, "%s: error: the graphing device could not be opened\n", progname); return EXIT_FAILURE; } } /* begin graph: push new libplot drawing state onto stack of states; also concatenate the current transformation matrix with a matrix formed from the repositioning parameters (this will be in effect for duration of the graph) */ begin_graph (multigrapher, old_reposition_scale, old_reposition_trans_x, old_reposition_trans_y); /* font selection, saves typing */ if ((title_font_name == NULL) && (font_name != NULL)) title_font_name = font_name; /* initialize, using (in part) finalized arguments */ set_graph_parameters (multigrapher, frame_line_width, frame_color, top_label, title_font_name, title_font_size, /* for title */ tick_size, grid_spec, final_min_x, final_max_x, final_spacing_x, final_min_y, final_max_y, final_spacing_y, final_spec_spacing_x, final_spec_spacing_y, plot_width, plot_height, margin_below, margin_left, font_name, font_size, /* for abs. label */ x_label, font_name, font_size, /* for ord. label */ y_label, no_rotate_y_label, /* these args are portmanteaux */ final_log_axis, final_round_to_next_tick, switch_axis_end, omit_ticks, /* more args */ clip_mode, blankout_fraction, final_transpose_axes); /* draw the graph frame (grid, ticks, etc.); draw a `canvas' (a background opaque white rectangle) only if this isn't the first graph */ draw_frame_of_graph (multigrapher, (first_graph_of_multigraph ? false : true)); /* plot the laboriously read-in array */ plot_point_array (multigrapher, p, no_of_points); /* free points array */ free (p); no_of_points = 0; first_file_of_graph = false; } /* end of not-filter case */ /* draw graph frame on top of graph, if user requested it */ if (frame_on_top) { end_polyline_and_flush (multigrapher); draw_frame_of_graph (multigrapher, false); } /* end graph: pop the graph-specific libplot drawing state off the stack of drawing states */ end_graph (multigrapher); /* on to next graph */ first_graph_of_multigraph = false; first_file_of_graph = true; } /* end of not first-file-of-plot case */ break; /* end of `--reposition' option */ /* ---------------- pseudo-options -------------- */ /* File specified on command line, returned in order (along with command-line options). The first time we reach this point in any plot, we perform special initializations and in particular determine whether or not, for the duration of this plot, we'll be acting as a filter. We can do so if xmin, xmax, ymin, ymax have all been specified, by this point, on the command line. A plot may consist of many files. A plot in progress is terminated if a --reposition option (which moves us to the next plot of a multiplot) is seen, or when the last command-line option is processed. */ case 1: if (first_file_of_graph) { /* For plots with a logarithmic axis, compute logs of axis limits, since coordinates along the axis, as obtained from the reader, are stored in logarithmic form. */ if (log_axis & X_AXIS) { if (spec_min_x) { if (min_x > 0.0) min_x = log10(min_x); else { fprintf(stderr, "%s: error: the limit %g on a logarithmic axis is nonpositive\n", progname, min_x); return EXIT_FAILURE; } } if (spec_max_x) { if (max_x > 0.0) max_x = log10(max_x); else { fprintf(stderr, "%s: error: the limit %g on a logarithmic axis is nonpositive\n", progname, max_x); return EXIT_FAILURE; } } } if (log_axis & Y_AXIS) { if (spec_min_y) { if (min_y > 0.0) min_y = log10(min_y); else { fprintf(stderr, "%s: error: the limit %g on a logarithmic axis is nonpositive\n", progname, min_y); return EXIT_FAILURE; } } if (spec_max_y) { if (max_y > 0.0) max_y = log10(max_y); else { fprintf(stderr, "%s: error: the limit %g on a logarithmic axis is nonpositive\n", progname, max_y); return EXIT_FAILURE; } } } /* We now finalize the following parameters (arguments to set_graph_parameters()), even though we won't call set_graph_parameters() for a while yet, if it turns out we need to act as a real-time filter. */ /* portmanteaux */ final_log_axis = log_axis; final_round_to_next_tick = round_to_next_tick; /* bool */ final_transpose_axes = transpose_axes; /* x-axis specific */ final_min_x = min_x; final_max_x = max_x; final_spacing_x = spacing_x; final_spec_min_x = spec_min_x; final_spec_max_x = spec_max_x; final_spec_spacing_x = spec_spacing_x; /* y-axis specific */ final_min_y = min_y; final_max_y = max_y; final_spec_min_y = spec_min_y; final_spec_max_y = spec_max_y; final_spacing_y = spacing_y; final_spec_spacing_y = spec_spacing_y; /* If user didn't specify either the lower limit or the upper limit for an axis, by default we'll round the axis limits to the nearest tick, after computing them. (If either limit was specified by the user, to request rounding the user must specify the -R option as well.) */ if (!final_spec_min_x && !final_spec_max_x) final_round_to_next_tick |= X_AXIS; if (!final_spec_min_y && !final_spec_max_y) final_round_to_next_tick |= Y_AXIS; /* The case when x_min, x_max, y_min, y_max are all specified by the luser is special: we set the `filter' flag for the duration of this plot, to indicate that we can function as a real-time filter, calling read_and_plot_file() on each file, rather than calling read_file() on each one separately to create an array of points, and then calling plot_point_array(). */ filter = ((final_spec_min_x && final_spec_max_x && final_spec_min_y && final_spec_max_y) ? true : false); } /* end of first-file-of-plot case */ if (filter) /* filter flag is set, will call read_and_plot() on this file */ { if (first_file_of_graph) { if (first_graph_of_multigraph) /* need to create the multigrapher */ { if ((multigrapher = new_multigrapher (output_format, bg_color, bitmap_size, emulate_color, max_line_length, meta_portable, page_size, rotation_angle, save_screen)) == NULL) { fprintf (stderr, "%s: error: the graphing device could not be opened\n", progname); return EXIT_FAILURE; } } /* begin graph: push a graph-specific drawing state onto libplot's stack of drawing states; also concatenate the current transformation matrix with a matrix formed from the repositioning parameters (this will take effect for the duration of the graph) */ begin_graph (multigrapher, reposition_scale, reposition_trans_x, reposition_trans_y); /* font selection, saves typing */ if ((title_font_name == NULL) && (font_name != NULL)) title_font_name = font_name; /* following will be in effect for the entire plot */ set_graph_parameters (multigrapher, frame_line_width, frame_color, top_label, title_font_name, title_font_size, /* for title */ tick_size, grid_spec, final_min_x, final_max_x, final_spacing_x, final_min_y, final_max_y, final_spacing_y, final_spec_spacing_x, final_spec_spacing_y, plot_width, plot_height, margin_below, margin_left, font_name, font_size, /* on abscissa */ x_label, font_name, font_size, /* on ordinate */ y_label, no_rotate_y_label, /* these args are portmanteaux */ final_log_axis, final_round_to_next_tick, switch_axis_end, omit_ticks, /* more args */ clip_mode, blankout_fraction, final_transpose_axes); /* draw the graph frame (grid, ticks, etc.); draw a `canvas' (a background opaque white rectangle) only if this isn't the first graph */ draw_frame_of_graph (multigrapher, first_graph_of_multigraph ? false : true); reader = new_reader (data_file, input_type, auto_abscissa, delta_x, x_start, /* following three are graph-specific */ final_transpose_axes, final_log_axis, auto_bump, /* following args are file-specific (they set dataset attributes) */ symbol_index, symbol_size, symbol_font_name, linemode_index, plot_line_width, fill_fraction, use_color); new_symbol = new_symbol_size = new_symbol_font_name = false; new_linemode = new_plot_line_width = false; new_fill_fraction = new_use_color = false; } else /* not first file of plot; do some things anyway */ { /* set reader parameters that may change when we move from file to file within a plot */ alter_reader_parameters (reader, data_file, input_type, auto_abscissa, delta_x, x_start, /* following args set dataset attributes */ symbol_index, symbol_size, symbol_font_name, linemode_index, plot_line_width, fill_fraction, use_color, /* following bools make up a mask*/ new_symbol, new_symbol_size, new_symbol_font_name, new_linemode, new_plot_line_width, new_fill_fraction, new_use_color); new_symbol = new_symbol_size = new_symbol_font_name = false; new_linemode = new_plot_line_width = false; new_fill_fraction = new_use_color = false; } /* call read_and_plot_file() on the file; each dataset in the file yields a polyline */ read_and_plot_file (reader, multigrapher); } /* end of filter case */ else /* filter flag is set, will read and plot this file separately */ /* Luser didn't specify enough information for us to act as a filter, so we do things the hard way: we call read_file() on each file to create a points array, and at the end of the plot we'll call plot_point_array() on the array. For now, we don't even call set_graph_parameters(). */ { if (first_file_of_graph) /* some additional initializations */ { p = (Point *)xmalloc (points_length * sizeof (Point)); reader = new_reader (data_file, input_type, auto_abscissa, delta_x, x_start, /* following are graph-specific */ final_transpose_axes, final_log_axis, auto_bump, /* following args are file-specific (they set dataset attributes) */ symbol_index, symbol_size, symbol_font_name, linemode_index, plot_line_width, fill_fraction, use_color); new_symbol = new_symbol_size = new_symbol_font_name = false; new_linemode = new_plot_line_width = false; new_fill_fraction = new_use_color = false; } else /* not first file of plot, but do some things anyway */ { /* set reader parameters that may change when we move from file to file within a plot */ alter_reader_parameters (reader, data_file, input_type, auto_abscissa, delta_x, x_start, /* following args set dataset attributes */ symbol_index, symbol_size, symbol_font_name, linemode_index, plot_line_width, fill_fraction, use_color, /* following bools make up a mask*/ new_symbol, new_symbol_size, new_symbol_font_name, new_linemode, new_plot_line_width, new_fill_fraction, new_use_color); new_symbol = new_symbol_size = new_symbol_font_name = false; new_linemode = new_plot_line_width = false; new_fill_fraction = new_use_color = false; } /* add points to points array by calling read_file() on file */ read_file (reader, &p, &points_length, &no_of_points); } /* end of not-filter case */ /* close file */ if (data_file != stdin) close_file (optarg, data_file); first_file_of_graph = false; break; /* end of `case 1' in switch() [i.e., filename seen] */ /*---------------- End of options ----------------*/ default: /* Default, unknown option */ errcnt++; continue_parse = false; break; } /* end of switch() */ if (errcnt > 0) continue_parse = false; } /* end of while loop */ if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (do_list_fonts) { int success; success = list_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_fonts) { int success; success = display_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, 2); return EXIT_SUCCESS; } /* End of command-line parse. At this point, we need to terminate the graph currently in progress, if it's nonempty (i.e. if one or more files have been read). */ if (first_file_of_graph == false) { /* At least one file was read. If we're acting as a real-time filter, then the graph is already drawn on the display and there's nothing for us to do. Instead, we have a points array and we need to plot it, after computing bounds. */ if (!filter) { /* fill in any of min_? and max_? that user didn't specify (the prefix "final_" means these arguments were finalized at the time the first file of the plot was processed) */ array_bounds (p, no_of_points, final_transpose_axes, clip_mode, &final_min_x, &final_min_y, &final_max_x, &final_max_y, final_spec_min_x, final_spec_min_y, final_spec_max_x, final_spec_max_y); if (first_graph_of_multigraph) /* still haven't created multigrapher, do so now */ { if ((multigrapher = new_multigrapher (output_format, bg_color, bitmap_size, emulate_color, max_line_length, meta_portable, page_size, rotation_angle, save_screen)) == NULL) { fprintf (stderr, "%s: error: the graphing device could not be opened\n", progname); return EXIT_FAILURE; } } /* begin graph: push new libplot drawing state onto stack of states; also concatenate the current transformation matrix with a matrix formed from the repositioning parameters (this will take effect for the duration of the graph) */ begin_graph (multigrapher, reposition_scale, reposition_trans_x, reposition_trans_y); /* font selection, saves typing */ if ((title_font_name == NULL) && (font_name != NULL)) title_font_name = font_name; set_graph_parameters (multigrapher, frame_line_width, frame_color, top_label, title_font_name, title_font_size, /*for title*/ tick_size, grid_spec, final_min_x, final_max_x, final_spacing_x, final_min_y, final_max_y, final_spacing_y, final_spec_spacing_x, final_spec_spacing_y, plot_width, plot_height, margin_below, margin_left, font_name, font_size, /* for abscissa label */ x_label, font_name, font_size, /* for ordinate label */ y_label, no_rotate_y_label, /* these args are portmanteaux */ final_log_axis, final_round_to_next_tick, switch_axis_end, omit_ticks, /* more args */ clip_mode, blankout_fraction, final_transpose_axes); /* draw the graph frame (grid, ticks, etc.); draw a `canvas' (a background opaque white rectangle) only if this isn't the first graph */ draw_frame_of_graph (multigrapher, first_graph_of_multigraph ? false : true); /* plot the laboriously read-in array */ plot_point_array (multigrapher, p, no_of_points); /* free points array */ free (p); no_of_points = 0; } /* end of not-filter case */ /* draw graph frame on top of graph, if user requested it */ if (frame_on_top) { end_polyline_and_flush (multigrapher); draw_frame_of_graph (multigrapher, false); } /* end graph: pop drawing state off the stack of drawing states */ end_graph (multigrapher); } /* end of nonempty-graph case */ /* finish up by deleting our multigrapher (one must have been created, since we always read at least stdin) */ if (delete_multigrapher (multigrapher) < 0) { fprintf (stderr, "%s: error: the graphing device could not be closed\n", progname); return EXIT_FAILURE; } return EXIT_SUCCESS; } static void open_file_for_reading (char *filename, FILE **input) { FILE *data_file; data_file = fopen (filename, "r"); if (data_file == NULL) { fprintf (stderr, "%s: %s: %s\n", progname, filename, strerror(errno)); exit (EXIT_FAILURE); } else *input = data_file; } static void close_file (char *filename, FILE *stream) { if (fclose (stream) < 0) fprintf (stderr, "%s: the input file `%s' could not be closed\n", progname, filename); } static bool parse_pen_string (const char *pen_s) { const char *charp; char name[MAX_COLOR_NAME_LEN]; int i; charp = pen_s; while (*charp) { int pen_num; bool got_digit; const char *tmp; if (*charp == ':') /* skip any ':' */ { charp++; continue; /* back to top of while loop */ } pen_num = 0; got_digit = false; while (*charp >= '0' && *charp <= '9') { pen_num = 10 * pen_num + (int)*charp - (int)'0'; got_digit = true; charp++; } if (!got_digit || pen_num < 1 || pen_num > NO_OF_LINEMODES) return false; if (*charp != '=') return false; charp++; for (tmp = charp, i = 0; i < MAX_COLOR_NAME_LEN; tmp++, i++) { if (*tmp == ':') /* end of color name string */ { name[i] = '\0'; charp = tmp + 1; break; } else if (*tmp == '\0') /* end of name string */ { name[i] = '\0'; charp = tmp; break; } else name[i] = *tmp; } /* replace pen color name by user-specified color name */ colorstyle[pen_num - 1] = xstrdup (name); } return true; } ���������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/misc.c��������������������������������������������������������������������������0000644�0001750�0001750�00000027052�11037235161�012546� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains miscellaneous subroutines for GNU graph. Currently, it contains only array_bounds(), which is called if the user fails to specify at least one of the bounds xmin,xmax,ymin,ymax. array_bounds() returns the unspecified bounds via pointers. I.e., it finishes the job of specifying a bounding box for the data points that will be plotted. The box may later be expanded so that its bounds are multiples of the tick spacing (see plotter.c). array_bounds() is called in graph.c, just before a graph is begun. */ #include "sys-defines.h" #include "extern.h" /* bit fields for return value from Cohen-Sutherland clipper */ enum { ACCEPTED = 0x1, CLIPPED_FIRST = 0x2, CLIPPED_SECOND = 0x4 }; /* for internal clipper use */ enum { TOP = 0x1, BOTTOM = 0x2, RIGHT = 0x4, LEFT = 0x8 }; /* forward references */ static int clip_line (double *x0_p, double *y0_p, double *x1_p, double *y1_p, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y); static int compute_relevant_points (double xx, double yy, double oldxx, double oldyy, int clip_mode, double user_min_x, double user_min_y, double user_max_x, double user_max_y, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y, double xxr[2], double yyr[2]); static int compute_outcode (double x, double y, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y); void array_bounds (const Point *p, int length, bool transpose_axes, int clip_mode, double *min_x, double *min_y, double *max_x, double *max_y, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y) { /* keep compilers happy */ double user_min_x = 0.0, user_min_y = 0.0; double user_max_x = 0.0, user_max_y = 0.0; double local_min_x = 0.0, local_min_y = 0.0; double local_max_x = 0.0, local_max_y = 0.0; double xx, yy, oldxx, oldyy; bool point_seen = false; int i; if (length == 0) /* adopt a convention */ { if (!spec_min_x) *min_x = 0.0; if (!spec_min_y) *min_y = 0.0; if (!spec_max_x) *max_x = *min_x; if (!spec_max_y) *max_y = *min_y; return; } if (spec_min_x) user_min_x = *min_x; else /* won't use user_min_x */ local_min_x = DBL_MAX; if (spec_max_x) user_max_x = *max_x; else /* won't use user_max_x */ local_max_x = -(DBL_MAX); /* special case: user specified both bounds, but min > max (reversed axis) */ if (spec_min_x && spec_max_x && user_min_x > user_max_x) { double tmp; tmp = user_min_x; user_min_x = user_max_x; user_max_x = tmp; } if (spec_min_y) user_min_y = *min_y; else local_min_y = DBL_MAX; /* won't use user_min_y */ if (spec_max_y) user_max_y = *max_y; else /* won't use user_max_y */ local_max_y = -(DBL_MAX); /* special case: user specified both bounds, but min > max (reversed axis) */ if (spec_min_y && spec_max_y && user_min_y > user_max_y) { double tmp; tmp = user_min_y; user_min_y = user_max_y; user_max_y = tmp; } /* loop through points in array; examine each line segment */ oldxx = oldyy = 0.0; /* previous point */ for (i = 0; i < length; i++) { double xxr[2], yyr[2]; /* storage for `relevant points' */ int n, j; int effective_clip_mode; /* get new point */ xx = (transpose_axes ? p[i].y : p[i].x); yy = (transpose_axes ? p[i].x : p[i].y); /* determine clipping mode (see compute_relevant_points() below) */ if (i == 0 || p[i].pendown == false || (p[i].linemode <= 0 && p[i].fill_fraction < 0.0)) /* no polyline or filling, each point is isolated */ effective_clip_mode = 0; else if (p[i].fill_fraction >= 0.0) effective_clip_mode = 2; else effective_clip_mode = clip_mode; n = compute_relevant_points (xx, yy, oldxx, oldyy, effective_clip_mode, user_min_x, user_min_y, user_max_x, user_max_y, spec_min_x, spec_min_y, spec_max_x, spec_max_y, xxr, yyr); /* loop through relevant points, updating bounding box */ for (j = 0; j < n; j++) { point_seen = true; if (!spec_min_x) local_min_x = DMIN(local_min_x, xxr[j]); if (!spec_min_y) local_min_y = DMIN(local_min_y, yyr[j]); if (!spec_max_x) local_max_x = DMAX(local_max_x, xxr[j]); if (!spec_max_y) local_max_y = DMAX(local_max_y, yyr[j]); } oldxx = xx; oldyy = yy; } if (!point_seen) /* a convention */ local_min_x = local_min_y = local_max_x = local_max_y = 0.0; /* pass back bounds that user didn't specify */ if (!spec_min_x) *min_x = local_min_x; if (!spec_min_y) *min_y = local_min_y; if (!spec_max_x) *max_x = local_max_x; if (!spec_max_y) *max_y = local_max_y; return; } /* For a new data point (xx,yy), compute the `relevant points', i.e. the ones that should be used in updating the bounding box. There may be 0, 1, or 2 of them. The number of relevant points is returned, and the relevant points themselves are returned via pointers. The relevant points are computed from the line segment extending from (oldxx,oldyy) to (xx,yy), via an algorithm parametrized by a gnuplot-style clip mode (0, 1, or 2). If clip mode=0 then the simplest algorithm is used: (xx,yy) is a relevant point iff it satisfies the user-specified bound(s), and there are no other relevant points, i.e., (oldxx,oldyy) is ignored. If clip mode=1 then if the line segment from (oldxx, oldyy) from (xx,yy) has at least one endpoint that satisfies the user-specified bounds, it generates two relevant points: the endpoints of the line segment, clipped to the bounds. If on the other hand neither endpoint of the line segment from (oldxx,oldyy) to (xx,yy) satisfies the user-specified bounds, no relevant points are generated even if the line segment contains points that satisfy the bounds. If clip mode=2 then the line segment, if it intersects the bounding box, is clipped on both ends, and both resulting endpoints are relevant. */ static int compute_relevant_points (double xx, double yy, double oldxx, double oldyy, int clip_mode, double user_min_x, double user_min_y, double user_max_x, double user_max_y, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y, double xxr[2], double yyr[2]) { int clipval; switch (clip_mode) { case 0: if ((!spec_min_x || xx >= user_min_x) && (!spec_max_x || xx <= user_max_x) && (!spec_min_y || yy >= user_min_y) && (!spec_max_y || yy <= user_max_y)) { xxr[0] = xx; yyr[0] = yy; return 1; } else return 0; break; case 1: default: clipval = clip_line (&oldxx, &oldyy, &xx, &yy, user_min_x, user_max_x, user_min_y, user_max_y, spec_min_x, spec_min_y, spec_max_x, spec_max_y); if ((clipval & ACCEPTED) && !((clipval & CLIPPED_FIRST) && (clipval & CLIPPED_SECOND))) { xxr[0] = oldxx; yyr[0] = oldyy; xxr[1] = xx; yyr[1] = yy; return 2; } else return 0; break; case 2: clipval = clip_line (&oldxx, &oldyy, &xx, &yy, user_min_x, user_max_x, user_min_y, user_max_y, spec_min_x, spec_min_y, spec_max_x, spec_max_y); if (clipval & ACCEPTED) { xxr[0] = oldxx; yyr[0] = oldyy; xxr[1] = xx; yyr[1] = yy; return 2; } else return 0; break; } } /* clip_line() takes two points, the endpoints of a line segment in the * device frame (expressed in terms of floating-point device coordinates), * and destructively passes back two points: the endpoints of the line * segment clipped by Cohen-Sutherland to the rectangular clipping area. * The return value contains bitfields ACCEPTED, CLIPPED_FIRST, and * CLIPPED_SECOND. * * This is a modified C-S clipper: the flags spec_{min,max}_{x,y} indicate * whether or not clipping is to be performed on each edge. */ static int clip_line (double *x0_p, double *y0_p, double *x1_p, double *y1_p, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y) { double x0 = *x0_p; double y0 = *y0_p; double x1 = *x1_p; double y1 = *y1_p; int outcode0, outcode1; bool accepted; int clipval = 0; outcode0 = compute_outcode (x0, y0, x_min_clip, x_max_clip, y_min_clip, y_max_clip, spec_min_x, spec_min_y, spec_max_x, spec_max_y); outcode1 = compute_outcode (x1, y1, x_min_clip, x_max_clip, y_min_clip, y_max_clip, spec_min_x, spec_min_y, spec_max_x, spec_max_y); for ( ; ; ) { if (!(outcode0 | outcode1)) /* accept */ { accepted = true; break; } else if (outcode0 & outcode1) /* reject */ { accepted = false; break; } else { /* at least one endpoint is outside; choose one that is */ int outcode_out = (outcode0 ? outcode0 : outcode1); double x, y; /* intersection with clip edge */ if (outcode_out & RIGHT) { x = x_max_clip; y = y0 + (y1 - y0) * (x_max_clip - x0) / (x1 - x0); } else if (outcode_out & LEFT) { x = x_min_clip; y = y0 + (y1 - y0) * (x_min_clip - x0) / (x1 - x0); } else if (outcode_out & TOP) { x = x0 + (x1 - x0) * (y_max_clip - y0) / (y1 - y0); y = y_max_clip; } else /* BOTTOM bit must be set */ { x = x0 + (x1 - x0) * (y_min_clip - y0) / (y1 - y0); y = y_min_clip; } if (outcode_out == outcode0) { x0 = x; y0 = y; outcode0 = compute_outcode (x0, y0, x_min_clip, x_max_clip, y_min_clip, y_max_clip, spec_min_x, spec_min_y, spec_max_x, spec_max_y); } else { x1 = x; y1 = y; outcode1 = compute_outcode (x1, y1, x_min_clip, x_max_clip, y_min_clip, y_max_clip, spec_min_x, spec_min_y, spec_max_x, spec_max_y); } } } if (accepted) { clipval |= ACCEPTED; if ((x0 != *x0_p) || (y0 != *y0_p)) clipval |= CLIPPED_FIRST; if ((x1 != *x1_p) || (y1 != *y1_p)) clipval |= CLIPPED_SECOND; *x0_p = x0; *y0_p = y0; *x1_p = x1; *y1_p = y1; } return clipval; } static int compute_outcode (double x, double y, double x_min_clip, double x_max_clip, double y_min_clip, double y_max_clip, bool spec_min_x, bool spec_min_y, bool spec_max_x, bool spec_max_y) { int code = 0; if (spec_max_x && x > x_max_clip) code |= RIGHT; else if (spec_min_x && x < x_min_clip) code |= LEFT; if (spec_max_y && y > y_max_clip) code |= TOP; else if (spec_min_y && y < y_min_clip) code |= BOTTOM; return code; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/linemode.c����������������������������������������������������������������������0000644�0001750�0001750�00000003254�11037235152�013405� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file defines the default mapping from `virtual' linemodes (the linemodes reported by the point-reader) to physical linemodes. On monochrome displays, a physical linemode is simply a linemode, in the traditional libplot sense. On color displays, it involves a choice of color as well; see explanation at head of plotter.c. NO_OF_LINEMODES is defined in extern.h. */ #include "sys-defines.h" #include "plot.h" #include "extern.h" /* following line types are the five used by Unix graph(1) */ const char *linemodes[NO_OF_LINEMODES] = { "solid", "dotted", "dotdashed", "shortdashed", "longdashed" }; /* following colors are the first five used by the gnuplot X11 driver */ const char *colorstyle[NO_OF_LINEMODES] = { "red", "green", "blue", "magenta", "cyan" }; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/graph/reader.c������������������������������������������������������������������������0000644�0001750�0001750�00000071751�11037267044�013067� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file is the point-reader half of GNU graph. Included here are routines that will read data points from an input stream. The input file may be in ascii format (a sequence of floating-point numbers, separated by whitespace), or in binary format (e.g., a sequence of doubles). Gnuplot table format is also supported. A `point' is a structure. Each point structure contains the following fields: x and y coordinates of the point a `have_x_errorbar' flag (true or false) a `have_y_errorbar' flag (true or false) xmin and xmax (meaningful only if have_x_errorbar is set) ymin and ymax (meaningful only if have_y_errorbar is set) a `pendown' flag a symbol type (a small integer, interpreted as a marker type) a symbol size (a fraction of the size of the plotting area) a symbol font name (relevant only for symbol types >= 32, see plotter.c) a linemode (a small integer) a linewidth (a fraction of the size of the display device) a polyline fill-fraction (in the interval [0,1], <0 means no fill) a use_color flag (true or false) An array of points defines a polyline, or a sequence of polylines. pendown=true means that a polyline is being drawn; pendown=false means that a polyline has just ended, and that the point (x,y), which begins a new polyline, should be moved to without drawing a line segment. By convention, the final seven fields, and have_?_errorbar, are the same for each point in a polyline. We use the term `dataset' to refer to the sequence of points in an input file that gives rise to a single polyline. If the input stream is in ascii format, two \n's in succession serves as a separator between datasets. If, instead, the input stream is in binary format (e.g., a sequence of doubles), then a single infinite quantity, such as DBL_MAX, serves as a dataset separator. If the input stream is in gnuplot `table' format, then two \n's in succession serves as a separator. But there are always two \n's before EOF in gnuplot format; this is different from ascii format. This file exports four functions (point-reader methods, basically). They are declared in extern.h. They are: new_reader () read_file () alter_reader_parameters () delete_reader () Before any points are read, the point-reader must first be created and initialized by a call to the constructor new_reader(). It takes as arguments certain reader parameters: e.g., the initial linemode and symbol type, the input stream, and the format of the input stream. read_file() reads datasets in succession from the input stream, until EOF is reached. After each dataset, besides breaking the polyline, it increments the linemode by unity (provided the reader's `autobump' flag is set). After finishing with an input stream, and before switching to another input stream as a source of points, alter_reader_parameters() should be called. It allows parameters of the reader that may differ from stream to stream to be changed. Directives in the input stream, specifying a change of linemode / symbol type, are supported. Any such directive automatically terminates a dataset and begins a new one. This is in agreement with the convention that every point in a polyline has the same linemode and the same plotting symbol. During the reading of an ascii-format input stream, a string of the form "#m=%d,S=%d" will be interpreted as a directive to change to a specified linemode / symbol type. Here the two %d's are the new linemode and symbol type, respectively. There is currently no way of changing to a specific linemode / symbol type during the reading of a input stream that is in binary format. The function `read_and_plot_file' is also exported. It is the same as `read_file', but it uses the plot_point() method of a Multigrapher (see plotter.c) to plot each point as it is read. */ #include "sys-defines.h" #include "libcommon.h" #include "extern.h" /* New (larger) length of a Point array, as function of the old; used when reallocating due to exhaustion of storage. */ #define NEW_POINT_ARRAY_LENGTH(old_len) \ ((old_len)*sizeof(Point) < 10000000 ? 2 * (old_len) : (old_len) + 10000000/sizeof(Point)) struct ReaderStruct /* point reader datatype */ { /* parameters which are constant over the lifetime of a Reader, and which affect the computation of the returned point structures */ bool transpose_axes; /* x <-> y ? */ int log_axis; /* x,y axes are logarithmic? (portmanteau) */ /* Reader parameters that are constant for the duration of each file */ FILE *input; /* input stream */ data_type format_type; /* stream format (T_ASCII, T_DOUBLE, etc.) */ bool auto_abscissa; /* auto-generate x values? */ double delta_x; /* increment for x value, if auto-generated */ double initial_abscissa; /* initial value for x, if auto-generated */ bool auto_bump; /* bump linemode when starting next polyline?*/ /* Reader parameters that are constant for the duration of each dataset */ int symbol; /* symbol type */ double symbol_size; /* symbol size (in `box coordinates') */ const char *symbol_font_name; /* font used for marker types >= 32 */ int linemode; /* linemode */ double line_width; /* line width (as frac. of display size) */ double fill_fraction; /* in interval [0,1], <0 means no filling */ bool use_color; /* color/monochrome interp. of linemode */ /* state variables, updated during Reader operation */ bool need_break; /* draw next point with pen up ? */ double abscissa; /* x value, if auto-generated */ }; /* Internal status codes: return values for read_dataset() and read_and_plot_dataset(), and also for the lower-level functions read_point() and read_point_{ascii,ascii_errorbar,binary,gnuplot}(). IN_PROGRESS means the dataset being read is still in progress. ENDED_BY_EOF means it terminated with an EOF, and ENDED_BY_DATASET_TERMINATOR means it terminated with an explicit end-of-dataset marker. An end-of-dataset marker is two newlines in succession for an ascii stream, and a DBL_MAX for a stream of doubles. ENDED_BY_MODE_CHANGE signals that a `set linemode / symbol type' directive was seen. By convention, we interpret such a directive as ending a dataset. */ typedef enum { IN_PROGRESS, ENDED_BY_EOF, ENDED_BY_DATASET_TERMINATOR, ENDED_BY_MODE_CHANGE } dataset_status_t; /* forward references */ static bool skip_some_whitespace (FILE *stream); static dataset_status_t read_and_plot_dataset (Reader *reader, Multigrapher *multigrapher); static dataset_status_t read_dataset (Reader *reader, Point **p, int *length, int *no_of_points); static dataset_status_t read_point (Reader *reader, Point *point); static dataset_status_t read_point_ascii (Reader *reader, Point *point); static dataset_status_t read_point_ascii_errorbar (Reader *reader, Point *point); static dataset_status_t read_point_binary (Reader *reader, Point *point); static dataset_status_t read_point_gnuplot (Reader *reader, Point *point); static void reset_reader (Reader *reader); static void skip_all_whitespace (FILE *stream); /* ARGS: format_type = double, or ascii, etc. symbol_size = symbol size for markers symbol_font_name = name for markers >= 32 line_width = fraction of display size fill_fraction = number in range [0,1], <0 means unfilled (transparent)*/ Reader * new_reader (FILE *input, data_type format_type, bool auto_abscissa, double delta_x, double abscissa, bool transpose_axes, int log_axis, bool auto_bump, int symbol, double symbol_size, const char *symbol_font_name, int linemode, double line_width, double fill_fraction, bool use_color) { Reader *reader; reader = (Reader *)xmalloc (sizeof (Reader)); reader->need_break = true; /* next point will have pen up */ reader->input = input; reader->format_type = format_type; reader->auto_abscissa = auto_abscissa; reader->delta_x = delta_x; reader->initial_abscissa = abscissa; reader->abscissa = reader->initial_abscissa; reader->transpose_axes = transpose_axes; reader->log_axis = log_axis; reader->auto_bump = auto_bump; reader->symbol = symbol; reader->symbol_size = symbol_size; reader->symbol_font_name = symbol_font_name; reader->linemode = linemode; reader->line_width = line_width; reader->fill_fraction = fill_fraction; reader->use_color = use_color; return reader; } void delete_reader (Reader *reader) { free (reader); return; } /* alter_reader_parameters() would be called just before reading datapoints from the second stream, the third stream,... It breaks the polyline under construction, if any. It also sets the stream and stream format, resets the abscissa (if auto-abscissa is in effect), and updates the linemode, symbol type, etc., if requested. (In GNU graph, we use the last feature to permit command-line specification of linemode/symbol type on a per-file basis.) */ /* ARGS: note that the final new_* args make up a mask */ void alter_reader_parameters (Reader *reader, FILE *input, data_type format_type, bool auto_abscissa, double delta_x, double abscissa, int symbol, double symbol_size, const char *symbol_font_name, int linemode, double line_width, double fill_fraction, bool use_color, bool new_symbol, bool new_symbol_size, bool new_symbol_font_name, bool new_linemode, bool new_line_width, bool new_fill_fraction, bool new_use_color) { reader->need_break = true; /* force break in polyline */ reader->input = input; reader->format_type = format_type; reader->auto_abscissa = auto_abscissa; reader->delta_x = delta_x; reader->initial_abscissa = abscissa; reader->abscissa = reader->initial_abscissa; /* test bits in mask to determine which polyline attributes need updating */ if (new_symbol) reader->symbol = symbol; if (new_symbol_size) reader->symbol_size = symbol_size; if (new_symbol_font_name) reader->symbol_font_name = symbol_font_name; if (new_linemode) reader->linemode = linemode; if (new_line_width) reader->line_width = line_width; if (new_fill_fraction) reader->fill_fraction = fill_fraction; if (new_use_color) reader->use_color = use_color; return; } /* read_point() calls read_point_ascii(), read_point_ascii_errorbar(), read_point_binary(), or read_point_gnuplot() to do the actual reading. It returns a status code (either IN_PROGRESS or ENDED_*, describing how the dataset in progress ended, if it did). */ static dataset_status_t read_point (Reader *reader, Point *point) { dataset_status_t status; /* following fields are constant throughout each polyline */ point->symbol = reader->symbol; point->symbol_size = reader->symbol_size; point->symbol_font_name = reader->symbol_font_name; point->linemode = reader->linemode; point->line_width = reader->line_width; point->fill_fraction = reader->fill_fraction; point->use_color = reader->use_color; point->have_x_errorbar = false; /* not supported yet */ point->have_y_errorbar = (reader->format_type == T_ASCII_ERRORBAR ? true : false); head: switch (reader->format_type) { case T_ASCII: default: status = read_point_ascii (reader, point); break; case T_SINGLE: case T_DOUBLE: case T_INTEGER: status = read_point_binary (reader, point); break; case T_ASCII_ERRORBAR: status = read_point_ascii_errorbar (reader, point); break; case T_GNUPLOT: /* gnuplot `table' format */ status = read_point_gnuplot (reader, point); break; } if (status == IN_PROGRESS) /* got a point; if not, we just pass back the return code */ { bool bad_point = false; /* If we have log axes, the values we work with ALL refer to the log10 values of the data. A nonpositive value generates a warning, and a break in the polyline. */ if (reader->log_axis & X_AXIS) { if (point->x > 0.0) point->x = log10 (point->x); else bad_point = true; if (point->have_x_errorbar) { if (point->xmin > 0.0) point->xmin = log10 (point->xmin); else bad_point = true; if (point->xmax > 0.0) point->xmax = log10 (point->xmax); else bad_point = true; } if (bad_point) { fprintf (stderr, "%s: the inappropriate point (%g,%g) is dropped, as this is a log plot\n", progname, point->x, point->y); reader->need_break = true; goto head; /* on to next point */ } } if (reader->log_axis & Y_AXIS) { if (point->y > 0.0) point->y = log10 (point->y); else bad_point = true; if (point->have_y_errorbar) { if (point->ymin > 0.0) point->ymin = log10 (point->ymin); else bad_point = true; if (point->ymax > 0.0) point->ymax = log10 (point->ymax); else bad_point = true; } if (bad_point) { fprintf (stderr, "%s: the inappropriate point (%g,%g) is dropped, as this is a log plot\n", progname, point->x, point->y); reader->need_break = true; goto head; /* on to next point */ } } if (reader->transpose_axes) { double tmp; bool tmp_bool; tmp = point->x; point->x = point->y; point->y = tmp; tmp = point->xmin; point->xmin = point->ymin; point->ymin = tmp; tmp = point->xmax; point->xmax = point->ymax; point->ymax = tmp; tmp_bool = point->have_x_errorbar; point->have_x_errorbar = point->have_y_errorbar; point->have_y_errorbar = tmp_bool; } /* we have a point, but we may need to break the polyline before it */ if (reader->need_break) point->pendown = false; else point->pendown = true; /* reset break-polyline flag */ reader->need_break = false; } return status; } static dataset_status_t read_point_ascii (Reader *reader, Point *point) { int items_read, lookahead; bool two_newlines; FILE *input = reader->input; head: /* skip whitespace, up to but not including 2nd newline if any */ two_newlines = skip_some_whitespace (input); if (two_newlines) return ENDED_BY_DATASET_TERMINATOR; if (feof (input)) return ENDED_BY_EOF; /* process linemode / symbol type directive */ lookahead = getc (input); ungetc (lookahead, input); if (lookahead == (int)'#') { int new_symbol, new_linemode; int items_read; items_read = fscanf (input, "# m = %d, S = %d", &new_linemode, &new_symbol); if (items_read == 2) /* insist on matching both */ { reader->linemode = new_linemode; reader->symbol = new_symbol; return ENDED_BY_MODE_CHANGE; } else /* unknown comment line, ignore it */ { char c; do { items_read = fread (&c, sizeof (c), 1, input); if (items_read <= 0) return ENDED_BY_EOF; } while (c != '\n'); ungetc ((int)'\n', input); /* push back \n at the end of # line */ goto head; } } /* read coordinate(s) */ if (reader->auto_abscissa) { point->x = reader->abscissa; reader->abscissa += reader->delta_x; } else { items_read = fscanf (input, "%lf", &(point->x)); if (items_read != 1) return ENDED_BY_EOF; /* presumably */ } items_read = fscanf (input, "%lf", &(point->y)); if (items_read == 1) return IN_PROGRESS; /* got a pair of floats */ else { if (!reader->auto_abscissa) fprintf (stderr, "%s: an input file terminated prematurely\n", progname); return ENDED_BY_EOF; /* couldn't get y coor, effectively EOF */ } } static dataset_status_t read_point_ascii_errorbar (Reader *reader, Point *point) { int items_read, lookahead; bool two_newlines; double error_size; FILE *input = reader->input; head: /* skip whitespace, up to but not including 2nd newline if any */ two_newlines = skip_some_whitespace (input); if (two_newlines) return ENDED_BY_DATASET_TERMINATOR; if (feof (input)) return ENDED_BY_EOF; /* process linemode / symbol type directive */ lookahead = getc (input); ungetc (lookahead, input); if (lookahead == (int)'#') { int new_symbol, new_linemode; int items_read; items_read = fscanf (input, "# m = %d, S = %d", &new_linemode, &new_symbol); if (items_read == 2) /* insist on matching both */ { reader->linemode = new_linemode; reader->symbol = new_symbol; return ENDED_BY_MODE_CHANGE; } else /* unknown comment line, ignore it */ { char c; do { items_read = fread (&c, sizeof (c), 1, input); if (items_read <= 0) return ENDED_BY_EOF; } while (c != '\n'); ungetc ((int)'\n', input); /* push back \n at the end of # line */ goto head; } } /* read coordinate(s) */ if (reader->auto_abscissa) { point->x = reader->abscissa; reader->abscissa += reader->delta_x; } else { items_read = fscanf (input, "%lf", &(point->x)); if (items_read != 1) return ENDED_BY_EOF; /* presumably */ } items_read = fscanf (input, "%lf", &(point->y)); if (items_read != 1) { if (!reader->auto_abscissa) fprintf (stderr, "%s: an input file (in errorbar format) terminated prematurely\n", progname); return ENDED_BY_EOF; /* couldn't get y coor, effectively EOF */ } items_read = fscanf (input, "%lf", &error_size); if (items_read != 1) { fprintf (stderr, "%s: an input file (in errorbar format) terminated prematurely\n", progname); return ENDED_BY_EOF; /* couldn't get y coor, effectively EOF */ } point->ymin = point->y - error_size; point->ymax = point->y + error_size; /* don't support reading of x errorbars yet */ point->xmin = 0.0; point->xmax = 0.0; return IN_PROGRESS; } static dataset_status_t read_point_binary (Reader *reader, Point *point) { int items_read; data_type format_type = reader->format_type; FILE *input = reader->input; /* read coordinate(s) */ if (reader->auto_abscissa) { point->x = reader->abscissa; reader->abscissa += reader->delta_x; } else { switch (format_type) { case T_DOUBLE: default: items_read = fread ((void *) &(point->x), sizeof (double), 1, input); break; case T_SINGLE: { float fx; items_read = fread ((void *) &fx, sizeof (fx), 1, input); point->x = fx; } break; case T_INTEGER: { int ix; items_read = fread ((void *) &ix, sizeof (ix), 1, input); point->x = ix; } break; } if (items_read <= 0) return ENDED_BY_EOF; /* presumably */ } if ((format_type == T_DOUBLE && point->x == DBL_MAX) || (format_type == T_SINGLE && point->x == (double)FLT_MAX) || (format_type == T_INTEGER && point->x == (double)INT_MAX)) return ENDED_BY_DATASET_TERMINATOR; switch (format_type) { case T_DOUBLE: default: items_read = fread ((void *) &(point->y), sizeof (double), 1, input); break; case T_SINGLE: { float fy; items_read = fread ((void *) &fy, sizeof (fy), 1, input); point->y = fy; } break; case T_INTEGER: { int iy; items_read = fread ((void *) &iy, sizeof (iy), 1, input); point->y = iy; } break; } if (items_read != 1) /* didn't get a pair of floats */ { if (!reader->auto_abscissa) fprintf (stderr, "%s: an input file (in binary format) terminated prematurely\n", progname); return ENDED_BY_EOF; /* effectively */ } else if (point->x != point->x || point->y != point->y) { fprintf (stderr, "%s: a NaN (not-a-number) was encountered in a binary input file\n", progname); return ENDED_BY_EOF; /* effectively */ } else return IN_PROGRESS; /* got a pair of floats */ } /* Read a point from a file in gnuplot `table' format. There are two kinds of table format we can read: the old style (from early gnuplot 3.5 and before) and a more modern style (from later gnuplot 3.5, circa 1997). */ static dataset_status_t read_point_gnuplot (Reader *reader, Point *point) { int lookahead, items_read; char directive, c; bool two_newlines; double x, y; FILE *input = reader->input; head: /* skip whitespace, up to but not including 2nd newline */ two_newlines = skip_some_whitespace (input); if (two_newlines) /* end of dataset */ { skip_all_whitespace (input); if (feof (input)) return ENDED_BY_EOF; /* no dataset follows */ else return ENDED_BY_DATASET_TERMINATOR; /* dataset presumably follows */ } lookahead = getc (input); ungetc (lookahead, input); switch (lookahead) { case 'C': /* old-style `Curve' line, discard it */ case '#': /* modern-style comment line, discard it */ do { items_read = fread (&c, sizeof (c), 1, input); if (items_read <= 0) return ENDED_BY_EOF; /* effectively */ } while (c != '\n'); ungetc ((int)'\n', input); /* push back \n at the end of line */ goto head; case 'i': /* old-style directive-first line (in-range) */ case 'o': /* old-style directive-first line (out-of-range) */ /* read coordinates */ items_read = fscanf (input, "%c x=%lf y=%lf", &directive, &x, &y); if (items_read == 3) /* must match all */ { point->x = x; point->y = y; return IN_PROGRESS; /* got a pair of floats */ } else { fprintf (stderr, "%s: an input file in gnuplot format could not be parsed\n", progname); return ENDED_BY_EOF; /* effectively */ } case 'u': /* old-style directive-first line */ /* `undefined', next point begins new polyline (same line mode) */ do { items_read = fread (&c, sizeof (c), 1, input); if (items_read <= 0) { fprintf (stderr, "%s: an input file in gnuplot format could not be parsed\n", progname); return ENDED_BY_EOF; /* effectively */ } } while (c != '\n'); /* break the polyline here in a soft way (i.e. don't bump line mode) */ reader->need_break = true; goto head; default: /* parse as a new-style directive-last line */ items_read = fscanf (input, "%lf %lf %c", &x, &y, &directive); if (items_read == 3 && (directive == 'i' || directive == 'o' || directive == 'u')) { if (directive == 'u') { /* drop point; break the polyline here in a soft way (i.e. don't bump line mode) */ reader->need_break = true; goto head; } else { point->x = x; point->y = y; return IN_PROGRESS; } } else { fprintf (stderr, "%s: an input file in gnuplot format could not be parsed\n", progname); return ENDED_BY_EOF; /* effectively */ } } } /* read_dataset() reads an entire dataset (a sequence of points) from an input file, and stores the resulting array of points in a block that has been allocated on the heap. The length of the block in which the points are stored, and the number of points, are passed back. */ /* ARGS: length = buffer length in bytes, should begin >0 */ static dataset_status_t read_dataset (Reader *reader, Point **p_addr, int *length, int *no_of_points) { Point *p = *p_addr; dataset_status_t status; for ( ; ; ) { /* * Grow the buffer if needed */ if (*no_of_points >= *length) { int old_length, new_length; old_length = *length; new_length = NEW_POINT_ARRAY_LENGTH(old_length); p = (Point *)xrealloc (p, new_length * sizeof (Point)); *length = new_length; } status = read_point (reader, &(p[*no_of_points])); if (status != IN_PROGRESS) /* we didn't get a point, i.e. dataset ended */ break; (*no_of_points)++; } *p_addr = p; /* update beginning of array if needed */ return status; } /* read_file() reads all datasets from an input file, and stores the resulting array of points in a block that has been allocated on the heap. The length of the block in which the data points are stored, and the number of points, are passed back. */ /* ARGS: length = buffer length in bytes, should begin >0 */ void read_file (Reader *reader, Point **p_addr, int *length, int *no_of_points) { dataset_status_t status; do { status = read_dataset (reader, p_addr, length, no_of_points); /* After each dataset, reset reader: force break in polyline, bump linemode (if auto-bump is in effect), and reset abscissa (if auto-abscissa is in effect). But if dataset ended with an explicit set linemode / symbol style directive, don't bump the linemode. */ if (status == ENDED_BY_MODE_CHANGE) { bool saved_auto_bump; saved_auto_bump = reader->auto_bump; reader->auto_bump = false; reset_reader (reader); reader->auto_bump = saved_auto_bump; } else reset_reader (reader); } while (status != ENDED_BY_EOF); } /* reset_reader() is called after each dataset. A new polyline will be begun, the linemode will be bumped if auto-bumping is in effect, and the abscissa will be reset if auto-abscissa is in effect. */ static void reset_reader (Reader *reader) { reader->need_break = true; /* force break in polyline */ /* bump linemode if appropriate */ if (reader->auto_bump) reader->linemode += ((reader->linemode > 0) ? 1 : -1); /* reset abscissa if auto-abscissa is in effect */ if (reader->auto_abscissa) reader->abscissa = reader->initial_abscissa; return; } /* Skip whitespace in an ascii-format or gnuplot-format input file, up to but not including a second newline. Return value indicates whether or not two newlines were in fact seen. (Two newlines signals end-of-dataset.) */ static bool skip_some_whitespace (FILE *stream) { int lookahead; int nlcount = 0; do { lookahead = getc (stream); if (lookahead == (int)'\n') nlcount++; } while (lookahead != EOF && isspace((unsigned char)lookahead) && nlcount < 2); if (lookahead == EOF) return false; ungetc (lookahead, stream); return (nlcount == 2 ? true : false); } /* Skip all whitespace; used for discarding whitespace in gnuplot-format input files. Old-style gnuplot table format follows each dataset by two newlines, but new-style format uses three newlines. */ static void skip_all_whitespace (FILE *stream) { int lookahead; do lookahead = getc (stream); while (lookahead != EOF && isspace((unsigned char)lookahead)); if (lookahead == EOF) return; else ungetc (lookahead, stream); } /**********************************************************************/ /* read_and_plot_dataset() reads an entire dataset (a sequence of points) from an input file, and calls a Multigrapher's plot_point() method on each point as it is read. So plotting is accomplished in real time (the points are not stored). */ static dataset_status_t read_and_plot_dataset (Reader *reader, Multigrapher *multigrapher) { dataset_status_t status; for ( ; ; ) { Point point; status = read_point (reader, &point); if (status != IN_PROGRESS) /* we didn't get a point, i.e. dataset ended */ break; else plot_point (multigrapher, &point); } return status; } /* read_and_plot_file() reads a sequence of datasets from a stream, and calls a Multigrapher's plot_point() method on them as they are read. So plotting is accomplished in real time (the points are not stored). */ void read_and_plot_file (Reader *reader, Multigrapher *multigrapher) { dataset_status_t status; do { status = read_and_plot_dataset (reader, multigrapher); /* After each dataset, reset reader: force break in polyline, bump linemode (if auto-bump is in effect), and reset abscissa (if auto-abscissa is in effect). If dataset ended with an explicit set linemode / symbol style directive, don't bump the linemode. */ if (status == ENDED_BY_MODE_CHANGE) { bool saved_auto_bump; saved_auto_bump = reader->auto_bump; reader->auto_bump = false; reset_reader (reader); reader->auto_bump = saved_auto_bump; } else reset_reader (reader); /* after each dataset, flush the constructed polyline to the display device by invoking a special Multigrapher method; this ensures real-time performance */ end_polyline_and_flush (multigrapher); } while (status != ENDED_BY_EOF); } �����������������������plotutils-2.6/graph/plotter.c�����������������������������������������������������������������������0000644�0001750�0001750�00000276104�11037266761�013322� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989, 1990, 1991, 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file contains the point plotter half of GNU graph. The point plotter could easily be linked with other software. It translates a sequence of points, regarded as defining a polyline or a sequence of polylines, to a sequence of libplot calls. There is support for multigraphing, i.e. producing a plot consisting of more than a single graph. Each graph may be drawn from more than one file, i.e., input stream, and each input stream may provide more than a single polyline. A `point' is a structure. Each point structure contains the following fields: x and y coordinates of the point a `have_x_errorbar' flag (true or false) a `have_y_errorbar' flag (true or false) xmin and xmax (meaningful only if have_x_errorbar is set) ymin and ymax (meaningful only if have_y_errorbar is set) a `pendown' flag a symbol type (a small integer, interpreted as a marker type) a symbol size (a fraction of the size of the plotting box) a symbol font name (relevant only for symbol types >= 32) a linemode (a small integer) a linewidth (a fraction of the size of the display device) a polyline fill-fraction (in the interval [0,1], <0 means no fill) a use_color flag (true or false) The point plotter constructs a polyline from each successive run of points that have the pendown flag set. It assumes that the final seven fields are assumed to be the same for each point in such a run, i.e., it takes their values from the first point of the run. At the location of each point on the polyline, the appropriate marker symbol, if any, will be plotted. Symbol types greater than or equal to 32 are interpreted as single characters to be plotted, rather than symbols. Points without the pendown flag set cause the polyline to be broken, and a new one to begin, before the symbol (if any) is plotted. The plotter supports five basic linemodes: 1 through 5. The interpretation of `linemode' depends on the polyline's use_color flag. linemode If monochrome If color 1 solid red 2 dotted green 3 dotdashed blue 4 shortdashed magenta 5 longdashed cyan In the monochrome case, the pattern simply repeats: 6,7,8,9,10 are equivalent to 1,2,3,4,5, etc. In the colored case, the sequence of colors also repeats. But linemodes 1,2,3,4,5 are drawn solid, while 6,7,8,9,10 are drawn dotted, 11,12,13,14,15 are drawn dotdashed, etc. So there are 25 distinct colored linemodes, and 5 distinct monochrome (black) ones. The color of a symbol will be the same as the color of the polyline on which it is plotted. linemodes -1, -2, etc. have a special interpretation. They are `disconnected' linemodes: no polyline will appear, but if color is being used, the color of the plotted symbols (if any) will be linemode-dependent. -1,-2,-3,-4,5 signify red,green,blue,magenta,cyan (the same sequence as for 1,2,3,4,5); thereafter the sequence repeats. linemode 0 is special (for backward compatibility). No line is drawn; symbol #1 (a point) will be used. So using linemode 0 is the same as using linemode -1, symbol 1. The point plotter is invoked by calling the following, in order. new_multigrapher() creates a new point plotter. begin_graph() set_graph_parameters() initializes global structures used by the draw_frame_of_graph() and plot_point() routines. These include the structures that specify the linear transformation from user coordinates to the coordinates used by libplot, and structures that specify the style of the plot frame. draw_frame_of_graph() plots the graph frame. [Optional.] plot_point() uses libplot routines to plot a single point, together with (possibly) a line extending to it from the last point, and a symbol. [Alternatively, plot_point_array() can be used, to plot an array of points.] end_graph() .. [The begin_graph()..end_graph() block can be repeated indefinitely if desired, to create a multigraph. set_graph_parameters() allows for repositioning of later graphs.] .. delete_multigrapher() deletes the point plotter. There is also a function end_polyline_and_flush(), which is useful for real-time display. */ #include "sys-defines.h" #include "libcommon.h" #include "plot.h" #include "extern.h" /* we use floating point libplot coordinates in the range [0,PLOT_SIZE] */ #define PLOT_SIZE 4096.0 #define FUZZ 0.000001 /* bd. on floating pt. roundoff error */ #define NEAR_EQUALITY(a, b, scale) (fabs((a) - (b)) < (FUZZ * fabs(scale))) typedef unsigned int outcode; /* for Cohen-Sutherland clipper */ enum { TOP = 0x1, BOTTOM = 0x2, RIGHT = 0x4, LEFT = 0x8 }; enum { ACCEPTED = 0x1, CLIPPED_FIRST = 0x2, CLIPPED_SECOND = 0x4 }; #define TRIAL_NUMBER_OF_TICK_INTERVALS 5 #define MAX_NUM_SUBTICKS 29 /* max num. of linearly spaced subticks */ #define RELATIVE_SUBTICK_SIZE 0.4 /* subtick_size / tick_size */ /* if a log axis spans >5.0 orders of magnitude, don't plot log subsubticks */ #define MAX_DECADES_WITH_LOG_SUBSUBTICKS 5.0 /* inter-tick spacing types, returned by scale1() and spacing_type() */ #define S_ONE 0 #define S_TWO 1 #define S_FIVE 2 #define S_TWO_FIVE 3 /* we don't use this one, but user may request it */ #define S_UNKNOWN -2 /* valid graph axis layout types; A_LOG2, anyone? */ #define A_LINEAR 0 #define A_LOG10 1 /* The x_trans and y_trans elements of a Multigrapher specify the current linear transformation from user coordinates to device coordinates. They are used both in the plotting of a graph frame, and in the plotting of data points within a graph. */ typedef struct { /* Input (user) coordinates, all floating point. These are the coordinates used in the original data points (or their base-10 logs, for an axis of log type). We'll map them to the unit interval [0.0,1.0]. */ double input_min, input_max; /* min, max */ double input_range; /* max - min, precomputed for speed */ /* If we're reversing axes, we'll then map [0.0,1.0] to [1.0,0.0] */ bool reverse; /* We'll map [0.0,1.0] to another (smaller) interval, linearly */ double squeezed_min, squeezed_max; /* min, max */ double squeezed_range; /* max - min */ /* Output [i.e., libplot] coordinates. The interval [0.0,1.0] will be mapped to this range, and the squeezed interval to a sub-range. This is so that the box within which points are plotted will be smaller than the full area of the graphics display. */ double output_min, output_max; /* min */ double output_range; /* max - min */ } Transform; /* Affine transformation macros */ /* X Scale: convert from user x value to normalized x coordinate (floating point, 0.0 to 1.0). */ #define XS(x) (((x) - multigrapher->x_trans.input_min)/multigrapher->x_trans.input_range) /* X Reflect: map [0,1] to [1,0], if that's called for */ #define XR(x) (multigrapher->x_trans.reverse ? 1.0 - (x) : (x)) /* X Squeeze: map [0,1] range for normalized x coordinate into a smaller interval, the x range for the plotting area within the graphics display */ #define XSQ(x) (multigrapher->x_trans.squeezed_min + (x) * multigrapher->x_trans.squeezed_range) /* X Plot: convert from normalized x coordinate to floating point libplot coordinate. */ #define XP(x) (multigrapher->x_trans.output_min + (x) * multigrapher->x_trans.output_range) /* X Value: convert from user x value (floating point) to floating point libplot coordinate. */ #define XV(x) XP(XSQ(XR(XS(x)))) /* X Normalize: the same, but do not perform reflection if any. (We use this for plotting of axes and their labels.) */ #define XN(y) XP(XSQ(XS(y))) /* Y Scale: convert from user y value to normalized y coordinate (floating point, 0.0 to 1.0). */ #define YS(y) (((y) - multigrapher->y_trans.input_min)/multigrapher->y_trans.input_range) /* Y Reflect: map [0,1] to [1,0], if that's called for */ #define YR(y) (multigrapher->y_trans.reverse ? 1.0 - (y) : (y)) /* Y Squeeze: map [0,1] range for normalized y coordinate into a smaller interval, the y range for the plotting area within the graphics display */ #define YSQ(y) (multigrapher->y_trans.squeezed_min + (y) * multigrapher->y_trans.squeezed_range) /* Y Plot: convert from normalized y coordinate to floating point libplot coordinate. */ #define YP(y) (multigrapher->y_trans.output_min + (y) * multigrapher->y_trans.output_range) /* Y Value: convert from user y value (floating point) to floating point libplot coordinate. (We use this for plotting of points.) */ #define YV(y) YP(YSQ(YR(YS(y)))) /* Y Normalize: the same, but do not perform reflection if any. (We use this for plotting of axes and their labels.) */ #define YN(y) YP(YSQ(YS(y))) /* Size Scale: convert distances, or sizes, from normalized coors to libplot coordinates. (Used for tick, symbol, and font sizes.) The min should really be precomputed. */ #define SS(x) \ (DMIN(multigrapher->x_trans.output_range * multigrapher->x_trans.squeezed_range, \ multigrapher->y_trans.output_range * multigrapher->y_trans.squeezed_range) * (x)) /* The `x_axis' and `y_axis' elements of a Multigrapher, which are of type `Axis', specify the layout of the two axes of a graph. They are used in the drawing of a graph frame. All elements that are doubles are expressed in user coordinates (unless the axis is logarithmic, in which case logs are taken before this structure is filled in). */ /* The `x_axis' and `y_axis' elements are filled in by calls to prepare_axis() when set_graph_parameters() is called. The only exceptions to this are the elements `max_width' and `non_user_ticks', which are filled in by draw_frame_of_graph(), as the frame for a graph is being drawn. */ typedef struct { const char *font_name; /* fontname for axis label and tick labels */ double font_size; /* font size for axis label and tick labels */ const char *label; /* axis label (a string) */ int type; /* axis layout type (A_LINEAR or A_LOG10) */ double tick_spacing; /* distance between ticks */ int min_tick_count, max_tick_count; /* tick location = count * spacing */ bool have_lin_subticks; /* does axis have linearly spaced subticks? */ double lin_subtick_spacing; /* distance between linearly spaced subticks */ int min_lin_subtick_count, max_lin_subtick_count; bool have_normal_subsubticks; /* does axis have logarithmic subsubticks?*/ bool user_specified_subsubticks; /* axis has user-spec'd subsubticks? */ double subsubtick_spacing; /* spacing for user-specified ones */ double other_axis_loc; /* location of intersection w/ other axis */ double alt_other_axis_loc; /* alternative loc. (e.g. right end vs. left)*/ bool switch_axis_end; /* other axis at right/top, not left/bottom? */ bool omit_ticks; /* just plain omit them (and their labels) ? */ double max_label_width; /* max width of labels placed on axis, in libplot coors (we update this during plotting, for y axis only) */ int labelled_ticks; /* number of labelled ticks, subticks, and subsubticks drawn on the axis (we update this during plotting, so we can advise the user to specify a tick spacing by hand if labelled_ticks <= 2) */ } Axis; /* The Multigrapher structure. A pointer to one of these is passed as the first argument to each Multigrapher method (e.g., plot_point()). */ struct MultigrapherStruct { /* multigrapher parameters (not updated over a multigrapher's lifetime) */ plPlotter *plotter; /* GNU libplot Plotter handle */ const char *output_format; /* type of libplot device driver [unused] */ const char *bg_color; /* color of background, if non-NULL */ bool save_screen; /* erase display when opening plotter? */ /* graph parameters (constant over any single graph) */ Transform x_trans, y_trans; /* user->device coor transformations */ Axis x_axis, y_axis; /* information on each axis */ grid_type grid_spec; /* frame specification */ double blankout_fraction; /* 1.0 means blank whole box before drawing */ bool no_rotate_y_label; /* useful for pre-X11R6 X servers */ double tick_size; /* fractional tick size */ double subtick_size; /* fractional subtick size (for linear axes) */ double frame_line_width; /* fractional width of lines in the frame */ double half_line_width; /* approx. half of this, in libplot coors */ const char *frame_color; /* color for frame (and graph, if no -C) */ const char *title; /* graph title */ const char *title_font_name; /* font for graph title */ double title_font_size; /* fractional height of graph title */ int clip_mode; /* 0, 1, or 2 (cf. clipping in gnuplot) */ /* following elements are updated during plotting of points; they're the chief repository for internal state */ bool first_point_of_polyline; /* true only at beginning of each polyline */ double oldpoint_x, oldpoint_y; /* last-plotted point */ int symbol; /* symbol being plotted at each point */ int linemode; /* linemode used for polyline */ }; /* forward references */ static int clip_line (Multigrapher *multigrapher, double *x0_p, double *y0_p, double *x1_p, double *y1_p); static int spacing_type (double spacing); static outcode compute_outcode (Multigrapher *multigrapher, double x, double y, bool tolerant); static void plot_abscissa_log_subsubtick (Multigrapher *multigrapher, double xval); static void plot_errorbar (Multigrapher *multigrapher, const Point *p); static void plot_ordinate_log_subsubtick (Multigrapher *multigrapher, double xval); static void prepare_axis (Axis *axisp, Transform *trans, double min, double max, double spacing, const char *font_name, double font_size, const char *label, double subsubtick_spacing, bool user_specified_subsubticks, bool round_to_next_tick, bool log_axis, bool reverse_axis, bool switch_axis_end, bool omit_ticks); static void print_tick_label (char *labelbuf, const Axis *axis, const Transform *transform, double val); static void scale1 (double min, double max, double *tick_spacing, int *tick_spacing_type); static void set_line_style (Multigrapher *multigrapher, int style, bool use_color); static void transpose_portmanteau (int *val); /* print_tick_label() prints a label on an axis tick. The format depends * on whether the axis is a log axis or a linear axis; also, the magnitude * of the axis labels. */ static void print_tick_label (char *labelbuf, const Axis *axis, const Transform *transform, double val) { int prec; char *eloc, *ptr; char labelbuf_tmp[64], incrbuf[64]; double spacing; bool big_exponents; double min, max; /* two possibilities: large/small exponent magnitudes */ min = (axis->type == A_LOG10 ? pow (10.0, transform->input_min) : transform->input_min); max = (axis->type == A_LOG10 ? pow (10.0, transform->input_max) : transform->input_max); big_exponents = (((min != 0.0 && fabs (log10 (fabs (min))) >= 4.0) || (max != 0.0 && fabs (log10 (fabs (max))) >= 4.0)) ? true : false); if (big_exponents) /* large exponents, rewrite as foo x 10^bar, using escape sequences */ { char *src = labelbuf_tmp, *dst = labelbuf; int exponent; char floatbuf[64]; char *fptr = floatbuf; double prefactor; sprintf (labelbuf_tmp, "%e", val); if ((eloc = strchr (labelbuf_tmp, (int)'e')) == NULL) return; if (axis->type == A_LOG10 && !axis->user_specified_subsubticks) /* a hack: this must be a power of 10, so just print "10^bar" */ { sscanf (++eloc, "%d", &exponent); sprintf (dst, "10\\sp%d\\ep", exponent); return; } /* special case: zero prints as `0', not 0.0x10^whatever */ if (val == 0.0) { *dst++ = '0'; *dst = '\0'; return; } while (src < eloc) *fptr++ = *src++; *fptr = '\0'; sscanf (floatbuf, "%lf", &prefactor); /* get foo */ sscanf (++src, "%d", &exponent); /* get bar */ spacing = (axis->type == A_LINEAR ? axis->tick_spacing : axis->subsubtick_spacing); /* user-specified, for log axis*/ sprintf (incrbuf, "%f", spacing / pow (10.0, (double)exponent)); ptr = strchr (incrbuf, (int)'.'); prec = 0; if (ptr != NULL) { int count = 0; while (*(++ptr)) { count++; if (*ptr != '0') prec = count; } } /* \sp ... \ep is start_superscript ... end_superscript, and \r6 is right-shift by 1/6 em. \mu is the `times' character. */ sprintf (dst, "%.*f\\r6\\mu10\\sp%d\\ep", prec, prefactor, exponent); return; } else /* small-size exponent magnitudes */ { if (axis->type == A_LOG10 && !axis->user_specified_subsubticks) /* a hack: this must be a (small) power of 10, so we'll just use %g format (same as %f, no trailing zeroes) */ { sprintf (labelbuf, "%.9g", val); return; } /* always use no. of digits of precision present in increment */ spacing = (axis->type == A_LINEAR ? axis->tick_spacing : axis->subsubtick_spacing); /* user-specified, for log axis*/ sprintf (incrbuf, "%.9f", spacing); ptr = strchr (incrbuf, (int)'.'); prec = 0; if (ptr != NULL) { int count = 0; while (*(++ptr)) { count++; if (*ptr != '0') prec = count; } } sprintf (labelbuf, "%.*f", prec, val); return; } } /* Algorithm SCALE1, for selecting an inter-tick spacing that will yield a * good-looking linear-format axis. The spacing is always 1.0, 2.0, or 5.0 * times a power of ten. * * Reference: Lewart, C. R., "Algorithms SCALE1, SCALE2, and * SCALE3 for Determination of Scales on Computer Generated * Plots", Communications of the ACM, 10 (1973), 639-640. * Also cited as ACM Algorithm 463. * * We call this routine even when the axis is logarithmic rather than * linear. In that case the arguments are the logs of the actual * arguments, so that it computes an optimal inter-tick factor rather than * an optimal inter-tick spacing. */ /* ARGS: min,max = data min, max tick_spacing = inter-tick spacing tick_spacing_type = 0,1,2 i.e. S_ONE,S_TWO,S_FIVE */ static void scale1 (double min, double max, double *tick_spacing, int *tick_spacing_type) { int k; double nal; double a, b; /* valid interval lengths */ static const double vint[] = { 1.0, 2.0, 5.0, 10.0 }; /* Corresponding breakpoints. The published algorithm uses geometric means, i.e. sqrt(2), sqrt(10), sqrt(50), but using sqrt(10)=3.16... will (if nticks=5, as we choose it to be) cause intervals of length 1.5 to yield an inter-tick distance of 0.2 rather than 0.5. So we could reduce it to 2.95. Similarly we could reduce sqrt(50) to 6.95 so that intervals of length 3.5 will yield an inter-tick distance of 1.0 rather than 0.5. */ static const double sqr[] = { M_SQRT2, 3.16228, 7.07107 }; /* compute trial inter-tick interval length */ a = (max - min) / TRIAL_NUMBER_OF_TICK_INTERVALS; a *= (max > min) ? 1.0 : -1.0; /* paranoia, max>min always */ if (a <= 0.0) { fprintf(stderr, "%s: error: the trial inter-tick spacing '%g' is bad\n", progname, a); exit (EXIT_FAILURE); } nal = floor(log10(a)); b = a * pow (10.0, -nal); /* 1.0 <= b < 10.0 */ /* round to closest permissible inter-tick interval length */ k = 0; do { if (b < sqr[k]) break; k++; } while (k < 3); *tick_spacing = (max > min ? 1.0 : -1.0) * vint[k] * pow (10.0, nal); /* for increment type, 0,1,2 means 1,2,5 times a power of 10 */ *tick_spacing_type = (k == 3 ? 0 : k); return; } /* Determine whether an inter-tick spacing (in practice, one specified by the user) is 1.0, 2.0, or 5.0 times a power of 10. */ static int spacing_type (double incr) { int i; int i_tenpower = (int)(floor(log10(incr))); double tenpower = 1.0; bool neg_power = false; if (i_tenpower < 0) { neg_power = true; i_tenpower = -i_tenpower; } for (i = 0; i < i_tenpower; i++) tenpower *= 10; if (neg_power) tenpower = 1.0 / tenpower; if (NEAR_EQUALITY(incr, tenpower, tenpower)) return S_ONE; else if (NEAR_EQUALITY(incr, 2 * tenpower, tenpower)) return S_TWO; else if (NEAR_EQUALITY(incr, 2.5 * tenpower, tenpower)) return S_TWO_FIVE; else if (NEAR_EQUALITY(incr, 5 * tenpower, tenpower)) return S_FIVE; else return S_UNKNOWN; } /* prepare_axis() fills in the Axis structure for an axis, and some of * the linear transformation variables in the Transform structure also. */ /* ARGS: user_specified_subticks = linear ticks on a log axis? round_to_next_tick = round limits to next tick mark? log_axis = log axis? reverse_axis = reverse min, max? switch_axis_end = intersection w/ other axis in alt. pos.? omit_ticks = suppress all ticks and tick labels? */ static void prepare_axis (Axis *axisp, Transform *trans, double min, double max, double spacing, const char *font_name, double font_size, const char *label, double subsubtick_spacing, bool user_specified_subsubticks, bool round_to_next_tick, bool log_axis, bool reverse_axis, bool switch_axis_end, bool omit_ticks) { double range; int tick_spacing_type = 0; double tick_spacing, lin_subtick_spacing; int min_tick_count, max_tick_count; int min_lin_subtick_count, max_lin_subtick_count; bool have_lin_subticks; if (min > max) /* paranoia, max < min is swapped at top level */ { fprintf(stderr, "%s: error: min > max for an axis, which is not allowed\n", progname); exit (EXIT_FAILURE); } if (min == max) /* expand in a clever way */ { max = floor (max + 1.0); min = ceil (min - 1.0); } if (log_axis) /* log axis, data are stored in logarithmic form */ /* compute a tick spacing; user can't specify it */ { scale1 (min, max, &tick_spacing, &tick_spacing_type); if (tick_spacing <= 1.0) { tick_spacing = 1.0; tick_spacing_type = S_ONE; } } else /* linear axis */ { if (spacing == 0.0) /* i.e., not specified by user */ scale1 (min, max, &tick_spacing, &tick_spacing_type); else /* luser is boss, don't use SCALE1 */ { tick_spacing = spacing; tick_spacing_type = spacing_type (spacing); } } range = max - min; /* range is not negative */ if (round_to_next_tick) /* expand both limits to next tick */ { if (user_specified_subsubticks) /* Special Case. If user specified the `spacing' argument to -x or -y on a logarithmic axis, our usual tick-generating and tick-plotting algorithms are disabled. So we don't bother with min_tick_count or several other fields of the axis struct; instead we just compute a new (rounded) max, min, and range. Since most data are stored as logs, this is complicated. */ { double true_min = pow (10.0, min), true_max = pow (10.0, max); double true_range = true_max - true_min; int min_count, max_count; min_count = (int)(floor ((true_min + FUZZ * true_range) / subsubtick_spacing)); max_count = (int)(ceil ((true_max - FUZZ * true_range) / subsubtick_spacing)); /* avoid core dump, do *not* reduce minimum to zero! */ if (min_count > 0) min = log10 (min_count * subsubtick_spacing); max = log10 (max_count * subsubtick_spacing); range = max - min; min_tick_count = max_tick_count = 0; /* keep gcc happy */ } else /* normal `expand limits to next tick' case */ { min_tick_count = (int)(floor((min + FUZZ * range)/ tick_spacing)); max_tick_count = (int)(ceil((max - FUZZ * range)/ tick_spacing)); /* max_tick_count > min_tick_count always */ /* tickval = tick_spacing * count, for all count in [min_count,max_count]; must have >=2 ticks */ min = tick_spacing * min_tick_count; max = tick_spacing * max_tick_count; range = max - min; } } else /* don't expand limits to next tick */ { min_tick_count = (int)(ceil((min - FUZZ * range)/ tick_spacing)); max_tick_count = (int)(floor((max + FUZZ * range)/ tick_spacing)); /* max_tick_count <= min_tick_count is possible */ /* tickval = incr * count, for all count in [min_count,max_count]; can have 0,1,2,3... ticks */ } /* Allow 5 subticks per tick if S_FIVE or S_TWO_FIVE, 2 if S_TWO. Case S_ONE is special; we try 10, 5, and 2 in succession */ switch (tick_spacing_type) { case S_FIVE: case S_TWO_FIVE: lin_subtick_spacing = tick_spacing / 5; break; case S_TWO: lin_subtick_spacing = tick_spacing / 2; break; case S_ONE: lin_subtick_spacing = tick_spacing / 10; min_lin_subtick_count = (int)(ceil((min - FUZZ * range)/ lin_subtick_spacing)); max_lin_subtick_count = (int)(floor((max + FUZZ * range)/ lin_subtick_spacing)); if (max_lin_subtick_count - min_lin_subtick_count > MAX_NUM_SUBTICKS) { lin_subtick_spacing = tick_spacing / 5; min_lin_subtick_count = (int)(ceil((min - FUZZ * range)/ lin_subtick_spacing)); max_lin_subtick_count = (int)(floor((max + FUZZ * range)/ lin_subtick_spacing)); if (max_lin_subtick_count - min_lin_subtick_count > MAX_NUM_SUBTICKS) lin_subtick_spacing = tick_spacing / 2; } break; default: /* in default case, i.e. S_UNKNOWN, we won't plot linear subticks */ lin_subtick_spacing = tick_spacing; /* not actually needed, since not plotted */ break; } /* smallest possible inter-subtick factor for a log axis is 10.0 */ if (log_axis && lin_subtick_spacing <= 1.0) lin_subtick_spacing = 1.0; min_lin_subtick_count = (int)(ceil((min - FUZZ * range)/ lin_subtick_spacing)); max_lin_subtick_count = (int)(floor((max + FUZZ * range)/ lin_subtick_spacing)); have_lin_subticks = ((tick_spacing_type != S_UNKNOWN /* S_UNKNOWN -> no subticks */ && (max_lin_subtick_count - min_lin_subtick_count) <= MAX_NUM_SUBTICKS) ? true : false); /* fill in parameters for axis-specific affine transformation */ trans->input_min = min; trans->input_max = max; trans->input_range = range; /* precomputed for speed */ trans->reverse = reverse_axis; /* fill in axis-specific plot frame variables */ axisp->switch_axis_end = switch_axis_end; axisp->omit_ticks = omit_ticks; axisp->label = label; axisp->font_name = font_name; axisp->font_size = font_size; axisp->max_label_width = 0.0; axisp->type = log_axis ? A_LOG10 : A_LINEAR; axisp->tick_spacing = tick_spacing; axisp->min_tick_count = min_tick_count; axisp->max_tick_count = max_tick_count; axisp->have_lin_subticks = have_lin_subticks; axisp->lin_subtick_spacing = lin_subtick_spacing; axisp->min_lin_subtick_count = min_lin_subtick_count; axisp->max_lin_subtick_count = max_lin_subtick_count; axisp->user_specified_subsubticks = user_specified_subsubticks; axisp->subsubtick_spacing = subsubtick_spacing; axisp->labelled_ticks = 0; /* updated during drawing of frame */ if (log_axis) /* logarithmic axis */ /* do we have special logarithmic subsubticks, and should we label them? */ { if (max - min <= MAX_DECADES_WITH_LOG_SUBSUBTICKS + FUZZ) /* not too many orders of magnitude, so plot normal log subsubticks */ axisp->have_normal_subsubticks = true; else /* too many orders of magnitude, don't plot log subsubticks */ axisp->have_normal_subsubticks = false; } else /* linear axes don't have log subsubticks */ axisp->have_normal_subsubticks = false; } /* The following routines [new_multigrapher(), begin_graph(), * set_graph_parameters(), draw_frame_of_graph(), plot_point(), * end_graph(), delete_multigrapher()] are the basic routines of the * point-plotter . See descriptions at the head of this file. */ /* Create a new Multigrapher. The arguments, after the first, are the libplot Plotter parameters that the `graph' user can set on the command line. */ Multigrapher * new_multigrapher (const char *output_format, const char *bg_color, const char *bitmap_size, const char *emulate_color, const char *max_line_length, const char *meta_portable, const char *page_size, const char *rotation_angle, bool save_screen) { plPlotterParams *plotter_params; plPlotter *plotter; Multigrapher *multigrapher; multigrapher = (Multigrapher *)xmalloc (sizeof (Multigrapher)); /* set Plotter parameters */ plotter_params = pl_newplparams (); pl_setplparam (plotter_params, "BG_COLOR", (void *)bg_color); pl_setplparam (plotter_params, "BITMAPSIZE", (void *)bitmap_size); pl_setplparam (plotter_params, "EMULATE_COLOR", (void *)emulate_color); pl_setplparam (plotter_params, "MAX_LINE_LENGTH", (void *)max_line_length); pl_setplparam (plotter_params, "META_PORTABLE", (void *)meta_portable); pl_setplparam (plotter_params, "PAGESIZE", (void *)page_size); pl_setplparam (plotter_params, "ROTATION", (void *)rotation_angle); /* create Plotter and open it */ plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params); if (plotter == (plPlotter *)NULL) return (Multigrapher *)NULL; pl_deleteplparams (plotter_params); multigrapher->plotter = plotter; if (pl_openpl_r (plotter) < 0) return (Multigrapher *)NULL; multigrapher->bg_color = bg_color; /* if called for, erase it; set up the user->device coor map */ if (!save_screen || bg_color) pl_erase_r (plotter); pl_fspace_r (plotter, 0.0, 0.0, (double)PLOT_SIZE, (double)PLOT_SIZE); return multigrapher; } int delete_multigrapher (Multigrapher *multigrapher) { int retval; retval = pl_closepl_r (multigrapher->plotter); if (retval >= 0) retval = pl_deletepl_r (multigrapher->plotter); free (multigrapher); return retval; } void begin_graph (Multigrapher *multigrapher, double scale, double trans_x, double trans_y) { pl_savestate_r (multigrapher->plotter); pl_fconcat_r (multigrapher->plotter, scale, 0.0, 0.0, scale, trans_x * PLOT_SIZE, trans_y * PLOT_SIZE); } void end_graph (Multigrapher *multigrapher) { pl_restorestate_r (multigrapher->plotter); } /* ARGS: Multigrapher *multigrapher double frame_line_width = fractional width of lines in the frame const char *frame_color = color for frame (and plot if no -C option) const char *title = graph title const char *title_font_name = font for graph title (string) double title_font_size = font size for graph title double tick_size = fractional size of ticks grid_type grid_spec = gridstyle (and tickstyle) spec double x_min, x_max, x_spacing double y_min, y_max, y_spacing bool spec_x_spacing bool spec_y_spacing double width, height, up, right const char *x_font_name double x_font_size const char *x_label const char *y_font_name double y_font_size const char *y_label bool no_rotate_y_label -- portmanteaux args -- int log_axis = whether axes should be logarithmic int round_to_next_tick = round limits to the next tick mark int switch_axis_end = put axes at right/top, not left/bottom? int omit_ticks = omit all ticks, tick labels from an axis? -- other args -- int clip_mode = 0, 1, or 2 double blankout_fraction = 1.0 means blank out whole box before plot bool transpose_axes */ void set_graph_parameters (Multigrapher *multigrapher, double frame_line_width, const char *frame_color, const char *title, const char *title_font_name, double title_font_size, double tick_size, grid_type grid_spec, double x_min, double x_max, double x_spacing, double y_min, double y_max, double y_spacing, bool spec_x_spacing, bool spec_y_spacing, double width, double height, double up, double right, const char *x_font_name, double x_font_size, const char *x_label, const char *y_font_name, double y_font_size, const char *y_label, bool no_rotate_y_label, int log_axis, int round_to_next_tick, int switch_axis_end, int omit_ticks, int clip_mode, double blankout_fraction, bool transpose_axes) { double x_subsubtick_spacing = 0.0, y_subsubtick_spacing = 0.0; /* local portmanteau variables */ int reverse_axis = 0; /* min > max on an axis? */ int user_specified_subsubticks = 0; /* i.e. linear ticks on a log axis? */ if (log_axis & X_AXIS) { if (spec_x_spacing) /* spacing is handled specially for log axes */ { spec_x_spacing = false; user_specified_subsubticks |= X_AXIS; x_subsubtick_spacing = x_spacing; } } if (log_axis & Y_AXIS) { if (spec_y_spacing) { /* spacing is handled specially for log axes */ spec_y_spacing = false; user_specified_subsubticks |= Y_AXIS; y_subsubtick_spacing = y_spacing; } } /* check for reversed axes (min > max) */ if (x_max < x_min) { reverse_axis |= X_AXIS; { double temp; temp = x_min; x_min = x_max; x_max = temp; } } if (x_max == x_min) { fprintf (stderr, "%s: identical upper and lower x limits are separated\n", progname); /* separate them */ x_max += 1.0; x_min -= 1.0; } /* check for reversed axes (min > max) */ if (y_max < y_min) { reverse_axis |= Y_AXIS; { double temp; temp = y_min; y_min = y_max; y_max = temp; } } if (y_max == y_min) { fprintf (stderr, "%s: identical upper and lower y limits are separated\n", progname); /* separate them */ y_max += 1.0; y_min -= 1.0; } /* At this point, min < max for each axis, if the user specified the two limits on an axis; reverse_axis portmanteau variable keeps track of whether either axis was discovered to be reversed. */ /* silently accept negative spacing as equivalent as positive */ if (spec_x_spacing) { if (x_spacing == 0.0) { fprintf (stderr, "%s: error: the spacing between ticks on an axis is zero\n", progname); exit (EXIT_FAILURE); } x_spacing = fabs (x_spacing); } if (spec_y_spacing) { if (y_spacing == 0.0) { fprintf (stderr, "%s: error: the spacing between ticks on an axis is zero\n", progname); exit (EXIT_FAILURE); } y_spacing = fabs (y_spacing); } /* now transpose the two axes (i.e. their portmanteau variables, labels, limits etc.) if transpose_axes was set */ if (transpose_axes) { const char *temp_string; double temp_double; transpose_portmanteau (&log_axis); transpose_portmanteau (&round_to_next_tick); transpose_portmanteau (&switch_axis_end); transpose_portmanteau (&omit_ticks); transpose_portmanteau (&reverse_axis); transpose_portmanteau (&user_specified_subsubticks); temp_string = x_label; x_label = y_label; y_label = temp_string; temp_double = x_min; x_min = y_min; y_min = temp_double; temp_double = x_max; x_max = y_max; y_max = temp_double; temp_double = x_spacing; x_spacing = y_spacing; y_spacing = temp_double; temp_double = x_subsubtick_spacing; x_subsubtick_spacing = y_subsubtick_spacing; y_subsubtick_spacing = temp_double; } /* fill in the Multigrapher struct */ multigrapher->frame_line_width = frame_line_width; multigrapher->frame_color = frame_color; multigrapher->no_rotate_y_label = no_rotate_y_label; multigrapher->blankout_fraction = blankout_fraction; if (title != NULL) multigrapher->title = xstrdup (title); else multigrapher->title = NULL; if (title_font_name != NULL) multigrapher->title_font_name = xstrdup (title_font_name); else multigrapher->title_font_name = NULL; multigrapher->title_font_size = title_font_size; multigrapher->tick_size = tick_size; multigrapher->subtick_size = RELATIVE_SUBTICK_SIZE * tick_size; multigrapher->grid_spec = grid_spec; multigrapher->clip_mode = clip_mode; /* fill in the Transform and Axis elements for each coordinate */ prepare_axis (&multigrapher->x_axis, &multigrapher->x_trans, x_min, x_max, x_spacing, x_font_name, x_font_size, x_label, x_subsubtick_spacing, (bool)(user_specified_subsubticks & X_AXIS), (bool)(round_to_next_tick & X_AXIS), (bool)(log_axis & X_AXIS), (bool)(reverse_axis & X_AXIS), (bool)(switch_axis_end & X_AXIS), (bool)(omit_ticks & X_AXIS)); prepare_axis (&multigrapher->y_axis, &multigrapher->y_trans, y_min, y_max, y_spacing, y_font_name, y_font_size, y_label, y_subsubtick_spacing, (bool)(user_specified_subsubticks & Y_AXIS), (bool)(round_to_next_tick & Y_AXIS), (bool)(log_axis & Y_AXIS), (bool)(reverse_axis & Y_AXIS), (bool)(switch_axis_end & Y_AXIS), (bool)(omit_ticks & Y_AXIS)); /* fill in additional parameters in the two Transform structures */ multigrapher->x_trans.squeezed_min = right; multigrapher->x_trans.squeezed_max = right + width; multigrapher->x_trans.squeezed_range = width; multigrapher->y_trans.squeezed_min = up; multigrapher->y_trans.squeezed_max = up + height; multigrapher->y_trans.squeezed_range = height; /* specify interval range for each coordinate, in libplot units */ multigrapher->x_trans.output_min = 0.0; multigrapher->x_trans.output_max = (double)PLOT_SIZE; multigrapher->x_trans.output_range = multigrapher->x_trans.output_max - multigrapher->x_trans.output_min; multigrapher->x_trans.output_min = 0.0; multigrapher->y_trans.output_max = (double)PLOT_SIZE; multigrapher->y_trans.output_range = multigrapher->y_trans.output_max - multigrapher->y_trans.output_min; /* fill in fields in Axis structs dealing with location of other axis */ if (multigrapher->grid_spec != AXES_AT_ORIGIN) /* Normal case */ { /* axes are at left/bottom */ multigrapher->x_axis.other_axis_loc = multigrapher->x_trans.input_min; multigrapher->y_axis.other_axis_loc = multigrapher->y_trans.input_min; /* secondary axes (used only if --switch-axis-end is specified) */ multigrapher->x_axis.alt_other_axis_loc = multigrapher->x_trans.input_max; multigrapher->y_axis.alt_other_axis_loc = multigrapher->y_trans.input_max; } else /* Special case: grid type #4, AXES_AT_ORIGIN */ { /* In this case (grid type #4), we don't allow the user to move the axis position by using the --switch-axis-end option. Each axis is at the value 0 (the origin) if the value 0 is between the limits of the opposing axis. Otherwise, the position is at the end closer to the value of 0. */ multigrapher->x_axis.other_axis_loc = (multigrapher->x_trans.input_min * multigrapher->x_trans.input_max <= 0.0) ? 0.0 : (multigrapher->x_trans.input_min > 0.0 ? multigrapher->x_trans.input_min : multigrapher->x_trans.input_max); multigrapher->y_axis.other_axis_loc = (multigrapher->y_trans.input_min * multigrapher->y_trans.input_max <= 0.0) ? 0.0 : (multigrapher->y_trans.input_min > 0.0 ? multigrapher->y_trans.input_min : multigrapher->y_trans.input_max); /* secondary axes are the same */ multigrapher->x_axis.alt_other_axis_loc = multigrapher->x_axis.other_axis_loc; multigrapher->y_axis.alt_other_axis_loc = multigrapher->y_axis.other_axis_loc; multigrapher->x_axis.switch_axis_end = (((multigrapher->x_trans.input_max - multigrapher->x_axis.other_axis_loc) < (multigrapher->x_axis.other_axis_loc - multigrapher->x_trans.input_min)) ? true : false); multigrapher->y_axis.switch_axis_end = (((multigrapher->y_trans.input_max - multigrapher->y_axis.other_axis_loc) < (multigrapher->y_axis.other_axis_loc - multigrapher->y_trans.input_min)) ? true : false); } /* The following is a version of (multigrapher->frame_line_width)/2 (expressed in terms of libplot coordinates) which the plotter uses as an offset, to get highly accurate positioning of ticks and labels. */ if (frame_line_width < 0.0 || pl_havecap_r (multigrapher->plotter, "WIDE_LINES") == 0) multigrapher->half_line_width = 0.0;/* N.B. <0.0 -> default width, pres. small */ else multigrapher->half_line_width = 0.5 * frame_line_width * multigrapher->x_trans.output_range; /* initialize the plotter state variables */ multigrapher->first_point_of_polyline = true; multigrapher->oldpoint_x = 0.0; multigrapher->oldpoint_y = 0.0; } /* draw_frame_of_graph() plots the graph frame (grid plus axis labels and title), using the multigrapher's variables (the multigrapher->x_axis, multigrapher->y_axis, multigrapher->x_trans, multigrapher->y_trans structures). It comprises several almost-independent tasks: 0. draw opaque white rectangle (``canvas''), if requested 1. draw title, if any, above drawing box 2. draw axes, and a full drawing box if requested 3. draw ticks, grid lines, and tick labels on abscissa; also subticks, if abscissa is a linear axis 4. draw ticks, grid lines, and tick labels on ordinate, also subticks, if ordinate is a linear axis 5. draw sub-tick marks, sub-grid lines, and sub-labels, if abscissa is a logarithmic axis 6. draw sub-tick marks, sub-grid lines, and sub-labels, if ordinate is a logarithmic axis 7. draw axis label on abscissa 8. draw axis label on ordinate (normally rotated 90 degrees) A savestate()--restorestate() pair is wrapped around these nine tasks. They are not quite independent because in (4) and (6) we keep track of the maximum width of the tick labels on the ordinate, to position the rotated ordinate label properly in (8). At the conclusion of the eight tasks, we warn the user if (i) he/she didn't specify a tick spacing for a logarithmic axis by hand, and (ii) our default algorithm for drawing ticks on a logarithmic axis has drawn too few ticks (i.e. <= 2 ticks) on the axis. Task #0 (drawing a white canvas) isn't always performed; only if the argument draw_canvas is set. It isn't set when we call this function for the first time; see graph.c. */ void draw_frame_of_graph (Multigrapher *multigrapher, bool draw_canvas) { static bool tick_warning_printed = false; /* when too few labelled ticks */ /* wrap savestate()--restorestate() around all 9 tasks */ pl_savestate_r (multigrapher->plotter); /* set color for graph frame */ if (multigrapher->frame_color) pl_pencolorname_r (multigrapher->plotter, multigrapher->frame_color); /* set line width as a fraction of size of display, <0.0 means default */ pl_flinewidth_r (multigrapher->plotter, multigrapher->frame_line_width * (double)PLOT_SIZE); /* axes (or box) will be drawn in solid line style */ pl_linemod_r (multigrapher->plotter, "solid"); /* turn off filling */ pl_filltype_r (multigrapher->plotter, 0); /* 0. DRAW AN OPAQUE WHITE BOX */ if (draw_canvas) { pl_savestate_r (multigrapher->plotter); /* use user-specified background color (if any) instead of white */ if (pl_havecap_r (multigrapher->plotter, "SETTABLE_BACKGROUND") != 0 && multigrapher->bg_color) pl_colorname_r (multigrapher->plotter, multigrapher->bg_color); else pl_colorname_r (multigrapher->plotter, "white"); pl_filltype_r (multigrapher->plotter, 1); /* turn on filling */ pl_fbox_r (multigrapher->plotter, XP(XSQ(0.5 - 0.5 * multigrapher->blankout_fraction)), YP(YSQ(0.5 - 0.5 * multigrapher->blankout_fraction)), XP(XSQ(0.5 + 0.5 * multigrapher->blankout_fraction)), YP(YSQ(0.5 + 0.5 * multigrapher->blankout_fraction))); pl_restorestate_r (multigrapher->plotter); } /* 1. DRAW THE TITLE, I.E. THE TOP LABEL */ if (multigrapher->grid_spec != NO_AXES && !multigrapher->y_axis.switch_axis_end /* no title if x axis is at top of plot */ && multigrapher->title != NULL && *multigrapher->title != '\0') { double title_font_size; /* switch to our font for drawing title */ pl_fontname_r (multigrapher->plotter, multigrapher->title_font_name); title_font_size = pl_ffontsize_r (multigrapher->plotter, SS(multigrapher->title_font_size)); pl_fmove_r (multigrapher->plotter, XP(XSQ(0.5)), YP(YSQ(1.0 + (((multigrapher->grid_spec == AXES_AND_BOX || multigrapher->grid_spec == AXES) && (multigrapher->tick_size <= 0.0) ? 1.0 : 0.5) * fabs(multigrapher->tick_size)))) + 0.65 * title_font_size + multigrapher->half_line_width); /* title centered, bottom spec'd */ pl_alabel_r (multigrapher->plotter, 'c', 'b', multigrapher->title); } /* 2. DRAW AXES FOR THE PLOT */ switch (multigrapher->grid_spec) { case AXES_AND_BOX_AND_GRID: case AXES_AND_BOX: /* draw a box, not just a pair of axes */ pl_fbox_r (multigrapher->plotter, XP(XSQ(0.0)), YP(YSQ(0.0)), XP(XSQ(1.0)), YP(YSQ(1.0))); break; case AXES: { double xstart, ystart, xmid, ymid, xend, yend; xstart = (multigrapher->x_axis.switch_axis_end ? XN(multigrapher->x_axis.other_axis_loc) - multigrapher->half_line_width : XN(multigrapher->x_axis.alt_other_axis_loc) + multigrapher->half_line_width); ystart = (multigrapher->y_axis.switch_axis_end ? YN(multigrapher->y_axis.alt_other_axis_loc) : YN(multigrapher->y_axis.other_axis_loc)); xmid = (multigrapher->x_axis.switch_axis_end ? XN(multigrapher->x_axis.alt_other_axis_loc) : XN(multigrapher->x_axis.other_axis_loc)); ymid = ystart; xend = xmid; yend = (multigrapher->y_axis.switch_axis_end ? YN(multigrapher->y_axis.other_axis_loc) - multigrapher->half_line_width : YN(multigrapher->y_axis.alt_other_axis_loc) + multigrapher->half_line_width); pl_fmove_r (multigrapher->plotter, xstart, ystart); pl_fcont_r (multigrapher->plotter, xmid, ymid); pl_fcont_r (multigrapher->plotter, xend, yend); } break; case AXES_AT_ORIGIN: { double xpos, ypos; xpos = (multigrapher->x_axis.switch_axis_end ? XN(multigrapher->x_axis.other_axis_loc) : XN(multigrapher->x_axis.alt_other_axis_loc)); ypos = (multigrapher->y_axis.switch_axis_end ? YN(multigrapher->y_axis.alt_other_axis_loc) : YN(multigrapher->y_axis.other_axis_loc)); pl_fline_r (multigrapher->plotter, xpos, YP(YSQ(0.0)) - multigrapher->half_line_width, xpos, YP(YSQ(1.0)) + multigrapher->half_line_width); pl_fline_r (multigrapher->plotter, XP(XSQ(0.0)) - multigrapher->half_line_width, ypos, XP(XSQ(1.0)) + multigrapher->half_line_width, ypos); } break; case NO_AXES: default: break; } /* 3. PLOT TICK MARKS, GRID LINES, AND TICK LABELS ON ABSCISSA */ if (multigrapher->grid_spec != NO_AXES && !multigrapher->x_axis.omit_ticks && !multigrapher->x_axis.user_specified_subsubticks) { int i; double xval, xrange = multigrapher->x_trans.input_max - multigrapher->x_trans.input_min; /* there is no way you could use longer labels on tick marks! */ char labelbuf[2048]; /* switch to our font for drawing x axis label and tick labels */ pl_fontname_r (multigrapher->plotter, multigrapher->x_axis.font_name); pl_ffontsize_r (multigrapher->plotter, SS(multigrapher->x_axis.font_size)); for (i = multigrapher->x_axis.min_tick_count; i <= multigrapher->x_axis.max_tick_count; i++) /* tick range can be empty */ { xval = i * multigrapher->x_axis.tick_spacing; /* discard tick locations outside plotting area */ if (xval < multigrapher->x_trans.input_min - FUZZ * xrange || xval > multigrapher->x_trans.input_max + FUZZ * xrange) continue; /* Plot the abscissa tick labels. */ if (!multigrapher->y_axis.switch_axis_end && !(multigrapher->grid_spec == AXES_AT_ORIGIN /* don't plot label if it could run into an axis */ && NEAR_EQUALITY (xval, multigrapher->x_axis.other_axis_loc, multigrapher->x_trans.input_range) && (multigrapher->y_axis.other_axis_loc != multigrapher->y_trans.input_min) && (multigrapher->y_axis.other_axis_loc != multigrapher->y_trans.input_max))) /* print labels below bottom boundary */ { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) - (SS ((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) + multigrapher->half_line_width)); print_tick_label (labelbuf, &multigrapher->x_axis, &multigrapher->x_trans, (multigrapher->x_axis.type == A_LOG10) ? pow (10.0, xval) : xval); pl_alabel_r (multigrapher->plotter, 'c', 't', labelbuf); multigrapher->x_axis.labelled_ticks++; } else /* print labels above top boundary */ if (multigrapher->y_axis.switch_axis_end && !(multigrapher->grid_spec == AXES_AT_ORIGIN /* don't plot label if it could run into an axis */ && NEAR_EQUALITY (xval, multigrapher->x_axis.other_axis_loc, multigrapher->x_trans.input_range) && (multigrapher->y_axis.other_axis_loc != multigrapher->y_trans.input_min) && (multigrapher->y_axis.other_axis_loc != multigrapher->y_trans.input_max))) { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) + (SS ((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) + multigrapher->half_line_width)); print_tick_label (labelbuf, &multigrapher->x_axis, &multigrapher->x_trans, (multigrapher->x_axis.type == A_LOG10) ? pow (10.0, xval) : xval); pl_alabel_r (multigrapher->plotter, 'c', 'b', labelbuf); multigrapher->x_axis.labelled_ticks++; } /* Plot the abscissa tick marks, and vertical grid lines. */ switch (multigrapher->grid_spec) { case AXES_AND_BOX_AND_GRID: pl_linemod_r (multigrapher->plotter, "dotted"); pl_fmove_r (multigrapher->plotter, XV(xval), YP(YSQ(0.0))); pl_fcont_r (multigrapher->plotter, XV(xval), YP(YSQ(1.0))); pl_linemod_r (multigrapher->plotter, "solid"); /* fall through */ case AXES_AND_BOX: if (!multigrapher->y_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) - (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } else { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) + (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } /* fall through */ case AXES: case AXES_AT_ORIGIN: if (!multigrapher->y_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) + (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } else { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) - (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } break; default: /* shouldn't happen */ break; } } if (multigrapher->x_axis.have_lin_subticks) { double subtick_size; /* libplot coordinates */ /* linearly spaced subticks on log axes are as long as reg. ticks */ subtick_size = (multigrapher->x_axis.type == A_LOG10 ? SS(multigrapher->tick_size) : SS(multigrapher->subtick_size)); /* Plot the linearly spaced subtick marks on the abscissa */ for (i = multigrapher->x_axis.min_lin_subtick_count; i <= multigrapher->x_axis.max_lin_subtick_count; i++) /* tick range can be empty */ { xval = i * multigrapher->x_axis.lin_subtick_spacing; /* discard subtick locations outside plotting area */ if (xval < multigrapher->x_trans.input_min - FUZZ * xrange || xval > multigrapher->x_trans.input_max + FUZZ * xrange) continue; switch (multigrapher->grid_spec) { case AXES_AND_BOX_AND_GRID: case AXES_AND_BOX: /* draw on both sides */ if (!multigrapher->y_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) - (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } else { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) + (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } /* fall through */ case AXES: case AXES_AT_ORIGIN: if (!multigrapher->y_axis.switch_axis_end) /* draw on only one side */ { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) + (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } else { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) - (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } break; default: /* shouldn't happen */ break; } } } /* plot a vertical dotted line at x = 0 */ if (multigrapher->grid_spec != AXES_AT_ORIGIN && multigrapher->x_axis.type == A_LINEAR && multigrapher->x_trans.input_min * multigrapher->x_trans.input_max < 0.0) { pl_linemod_r (multigrapher->plotter, "dotted"); pl_fline_r (multigrapher->plotter, XV(0.0), YP(YSQ(0.0)), XV(0.0), YP(YSQ(1.0))); pl_linemod_r (multigrapher->plotter, "solid"); } } /* 4. PLOT TICK MARKS, GRID LINES, AND TICK LABELS ON ORDINATE */ if (multigrapher->grid_spec != NO_AXES && !multigrapher->y_axis.omit_ticks && !multigrapher->y_axis.user_specified_subsubticks) { int i; double yval, yrange = multigrapher->y_trans.input_max - multigrapher->y_trans.input_min; /* there is no way you could use longer labels on tick marks! */ char labelbuf[2048]; /* switch to our font for drawing y axis label and tick labels */ pl_fontname_r (multigrapher->plotter, multigrapher->y_axis.font_name); pl_ffontsize_r (multigrapher->plotter, SS(multigrapher->y_axis.font_size)); for (i = multigrapher->y_axis.min_tick_count; i <= multigrapher->y_axis.max_tick_count; i++) /* range can be empty */ { yval = i * multigrapher->y_axis.tick_spacing; /* discard tick locations outside plotting area */ if (yval < multigrapher->y_trans.input_min - FUZZ * yrange || yval > multigrapher->y_trans.input_max + FUZZ * yrange) continue; /* Plot the ordinate tick labels. */ if (!multigrapher->x_axis.switch_axis_end && !(multigrapher->grid_spec == AXES_AT_ORIGIN /* don't plot label if it could run into an axis */ && NEAR_EQUALITY (yval, multigrapher->y_axis.other_axis_loc, multigrapher->y_trans.input_range) && (multigrapher->x_axis.other_axis_loc != multigrapher->x_trans.input_min) && (multigrapher->x_axis.other_axis_loc != multigrapher->x_trans.input_max))) /* print labels to left of left boundary */ { double new_width; pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) - (SS((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) + multigrapher->half_line_width), YV (yval)); print_tick_label (labelbuf, &multigrapher->y_axis, &multigrapher->y_trans, (multigrapher->y_axis.type == A_LOG10) ? pow (10.0, yval) : yval); new_width = pl_flabelwidth_r (multigrapher->plotter, labelbuf); pl_alabel_r (multigrapher->plotter, 'r', 'c', labelbuf); multigrapher->y_axis.max_label_width = DMAX(multigrapher->y_axis.max_label_width, new_width); multigrapher->y_axis.labelled_ticks++; } else /* print labels to right of right boundary */ if (multigrapher->x_axis.switch_axis_end && !(multigrapher->grid_spec == AXES_AT_ORIGIN /* don't plot label if it could run into an axis */ && NEAR_EQUALITY (yval, multigrapher->y_axis.other_axis_loc, multigrapher->y_trans.input_range) && (multigrapher->x_axis.other_axis_loc != multigrapher->x_trans.input_min) && (multigrapher->x_axis.other_axis_loc != multigrapher->x_trans.input_max))) { double new_width; pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) + (SS((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) + multigrapher->half_line_width), YV (yval)); print_tick_label (labelbuf, &multigrapher->y_axis, &multigrapher->y_trans, (multigrapher->y_axis.type == A_LOG10) ? pow (10.0, yval) : yval); new_width = pl_flabelwidth_r (multigrapher->plotter, labelbuf); pl_alabel_r (multigrapher->plotter, 'l', 'c', labelbuf); multigrapher->y_axis.max_label_width = DMAX(multigrapher->y_axis.max_label_width, new_width); multigrapher->y_axis.labelled_ticks++; } /* Plot the tick marks on the y-axis, and horizontal grid lines. */ switch (multigrapher->grid_spec) { case AXES_AND_BOX_AND_GRID: pl_linemod_r (multigrapher->plotter, "dotted"); pl_fmove_r (multigrapher->plotter, XP(XSQ(0.0)), YV (yval)); pl_fcont_r (multigrapher->plotter, XP(XSQ(1.0)), YV (yval)); pl_linemod_r (multigrapher->plotter, "solid"); /* fall through */ case AXES_AND_BOX: if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) - (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } else { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) + (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } /* fall through */ case AXES: case AXES_AT_ORIGIN: if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) + (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } else { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) - (SS (multigrapher->tick_size) + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } break; default: /* shouldn't happen */ break; } } if (multigrapher->y_axis.have_lin_subticks) { double subtick_size; /* libplot coordinates */ /* linearly spaced subticks on a log axis are as long as regular ticks */ subtick_size = (multigrapher->y_axis.type == A_LOG10 ? SS(multigrapher->tick_size) : SS(multigrapher->subtick_size)); /* Plot the linearly spaced subtick marks on the ordinate */ for (i = multigrapher->y_axis.min_lin_subtick_count; i <= multigrapher->y_axis.max_lin_subtick_count; i++) /* range can be empty */ { yval = i * multigrapher->y_axis.lin_subtick_spacing; /* discard subtick locations outside plotting area */ if (yval < multigrapher->y_trans.input_min - FUZZ * yrange || yval > multigrapher->y_trans.input_max + FUZZ * yrange) continue; /* Plot the tick marks on the y-axis, and horizontal grid lines. */ switch (multigrapher->grid_spec) { case AXES_AND_BOX_AND_GRID: case AXES_AND_BOX: if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) - (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } else { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) + (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } /* fall through */ case AXES: case AXES_AT_ORIGIN: if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) + (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } else { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) - (subtick_size + (subtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } break; default: /* shouldn't happen */ break; } } } /* plot a horizontal dotted line at y = 0 */ if (multigrapher->grid_spec != AXES_AT_ORIGIN && multigrapher->y_axis.type == A_LINEAR && multigrapher->y_trans.input_min * multigrapher->y_trans.input_max < 0.0) { pl_linemod_r (multigrapher->plotter, "dotted"); pl_fline_r (multigrapher->plotter, XP(XSQ(0.0)), YV(0.0), XP(XSQ(1.0)), YV(0.0)); pl_linemod_r (multigrapher->plotter, "solid"); } } /* 5. DRAW LOGARITHMIC SUBSUBTICKS AND THEIR LABELS ON ABSCISSA */ /* first, draw normal logarithmic subsubticks if any */ if (multigrapher->grid_spec != NO_AXES && multigrapher->x_axis.have_normal_subsubticks && !multigrapher->x_axis.user_specified_subsubticks && !multigrapher->x_axis.omit_ticks) { int i, m, imin, imax; double xval, xrange = multigrapher->x_trans.input_max - multigrapher->x_trans.input_min; /* compute an integer range (of powers of 10) large enough to include the entire desired axis */ imin = (int)(floor (multigrapher->x_trans.input_min - FUZZ * xrange)); imax = (int)(ceil (multigrapher->x_trans.input_max + FUZZ * xrange)); for (i = imin; i < imax; i++) { for (m = 1; m <= 9 ; m++) { xval = i + log10 ((double)m); /* Plot subsubtick and label, if desired. */ /* N.B. if tick is outside axis range, nothing will be printed */ plot_abscissa_log_subsubtick (multigrapher, xval); } } } /* second, draw user-specified logarithmic subsubticks instead, if any */ if (multigrapher->grid_spec != NO_AXES && multigrapher->x_axis.user_specified_subsubticks && !multigrapher->x_axis.omit_ticks) { int i, imin, imax; double xval, xrange = multigrapher->x_trans.input_max - multigrapher->x_trans.input_min; /* compute an integer range large enough to include the entire desired axis */ imin = (int)(floor (pow (10.0, multigrapher->x_trans.input_min - FUZZ * xrange) / multigrapher->x_axis.subsubtick_spacing)); imax = (int)(ceil (pow (10.0, multigrapher->x_trans.input_max + FUZZ * xrange) / multigrapher->x_axis.subsubtick_spacing)); /* draw user-specified subsubticks */ for (i = imin; i <= imax; i++) { xval = log10 (i * multigrapher->x_axis.subsubtick_spacing); /* Plot subsubtick and label, if desired. */ /* N.B. if tick is outside axis range, nothing will be printed */ plot_abscissa_log_subsubtick (multigrapher, xval); } } /* 6. DRAW LOGARITHMIC SUBSUBTICKS AND THEIR LABELS ON ORDINATE */ /* first, draw normal logarithmic subsubticks if any */ if (multigrapher->grid_spec != NO_AXES && multigrapher->y_axis.have_normal_subsubticks && !multigrapher->y_axis.user_specified_subsubticks && !multigrapher->y_axis.omit_ticks) { int i, m, imin, imax; double yval, yrange = multigrapher->y_trans.input_max - multigrapher->y_trans.input_min; /* compute an integer range (of powers of 10) large enough to include the entire desired axis */ imin = (int)(floor (multigrapher->y_trans.input_min - FUZZ * yrange)); imax = (int)(ceil (multigrapher->y_trans.input_max + FUZZ * yrange)); /* draw normal subticks */ for (i = imin; i < imax; i++) { for (m = 1; m <= 9; m++) { yval = i + log10 ((double)m); /* Plot subsubtick and label, if desired. */ /* N.B. if tick is outside axis range, nothing will be printed */ plot_ordinate_log_subsubtick (multigrapher, yval); } } } /* second, draw user-specified logarithmic subsubticks instead, if any */ if (multigrapher->grid_spec != NO_AXES && multigrapher->y_axis.user_specified_subsubticks && !multigrapher->y_axis.omit_ticks) { int i, imin, imax; double yval, yrange = multigrapher->y_trans.input_max - multigrapher->y_trans.input_min; /* compute an integer range large enough to include the entire desired axis */ imin = (int)(floor (pow (10.0, multigrapher->y_trans.input_min - FUZZ * yrange) / multigrapher->y_axis.subsubtick_spacing)); imax = (int)(ceil (pow (10.0, multigrapher->y_trans.input_max + FUZZ * yrange) / multigrapher->y_axis.subsubtick_spacing)); /* draw user-specified subsubticks */ for (i = imin; i <= imax; i++) { yval = log10 (i * multigrapher->y_axis.subsubtick_spacing); /* Plot subsubtick and label, if desired. */ /* N.B. if tick is outside axis range, nothing will be printed */ plot_ordinate_log_subsubtick (multigrapher, yval); } } /* 7. DRAW THE ABSCISSA LABEL */ if ((multigrapher->grid_spec != NO_AXES) && multigrapher->x_axis.label != NULL && multigrapher->x_axis.label != '\0') { double x_axis_font_size; double xloc; /* switch to our font for drawing x axis label and tick labels */ pl_fontname_r (multigrapher->plotter, multigrapher->x_axis.font_name); x_axis_font_size = pl_ffontsize_r (multigrapher->plotter, SS(multigrapher->x_axis.font_size)); if (multigrapher->grid_spec != AXES_AT_ORIGIN) /* center the label on the axis */ xloc = 0.5 * (multigrapher->x_trans.input_max + multigrapher->x_trans.input_min); else { if ((multigrapher->y_axis.other_axis_loc == multigrapher->y_trans.input_min) || (multigrapher->y_axis.other_axis_loc == multigrapher->y_trans.input_max)) xloc = 0.5 * (multigrapher->x_trans.input_max + multigrapher->x_trans.input_min); else /* center label in the larger of the two halves */ xloc = multigrapher->x_trans.input_max-multigrapher->x_axis.other_axis_loc >= multigrapher->x_axis.other_axis_loc-multigrapher->x_trans.input_min ? 0.5 * (multigrapher->x_trans.input_max + multigrapher->x_axis.other_axis_loc) : 0.5 * (multigrapher->x_axis.other_axis_loc + multigrapher->x_trans.input_min); } if (!multigrapher->y_axis.switch_axis_end) /* axis on bottom, label below it */ { pl_fmove_r (multigrapher->plotter, XV (xloc), YN (multigrapher->y_axis.other_axis_loc) - (SS ((multigrapher->tick_size >= 0.0 ? 0.875 : 2.125) * fabs(multigrapher->tick_size)) + (6 * x_axis_font_size)/5 + multigrapher->half_line_width)); pl_alabel_r (multigrapher->plotter, 'c', 't', multigrapher->x_axis.label); } else /* axis on top, label above it */ { pl_fmove_r (multigrapher->plotter, XV (xloc), YN (multigrapher->y_axis.alt_other_axis_loc) + (SS ((multigrapher->tick_size >= 0.0 ? 0.875 : 2.125) * fabs(multigrapher->tick_size)) + (6 * x_axis_font_size)/5 + multigrapher->half_line_width)); pl_alabel_r (multigrapher->plotter, 'c', 'b', multigrapher->x_axis.label); } } /* 8. DRAW THE ORDINATE LABEL */ if ((multigrapher->grid_spec != NO_AXES) && (multigrapher->y_axis.label != NULL && *(multigrapher->y_axis.label) != '\0')) { double y_axis_font_size; double yloc; /* switch to our font for drawing y axis label and tick labels */ pl_fontname_r (multigrapher->plotter, multigrapher->y_axis.font_name); y_axis_font_size = pl_ffontsize_r (multigrapher->plotter, SS(multigrapher->y_axis.font_size)); if (multigrapher->grid_spec != AXES_AT_ORIGIN) /* center the label on the axis */ yloc = 0.5 * (multigrapher->y_trans.input_min + multigrapher->y_trans.input_max); else { if ((multigrapher->x_axis.other_axis_loc == multigrapher->x_trans.input_min) || (multigrapher->x_axis.other_axis_loc == multigrapher->x_trans.input_max)) yloc = 0.5 * (multigrapher->y_trans.input_min + multigrapher->y_trans.input_max); else /* center label in the larger of the two halves */ yloc = multigrapher->y_trans.input_max-multigrapher->y_axis.other_axis_loc >= multigrapher->y_axis.other_axis_loc-multigrapher->y_trans.input_min ? 0.5 * (multigrapher->y_trans.input_max + multigrapher->y_axis.other_axis_loc) : 0.5 * (multigrapher->y_axis.other_axis_loc + multigrapher->y_trans.input_min); } /* a relic of temps perdus */ #define libplot_has_font_metrics 1 if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) - (libplot_has_font_metrics ? (SS((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) + 1.15 * multigrapher->y_axis.max_label_width + 0.5 * y_axis_font_size + multigrapher->half_line_width) : (SS((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) /* backup */ + 1.0 * y_axis_font_size + multigrapher->half_line_width)), YV(yloc)); if (libplot_has_font_metrics && !multigrapher->no_rotate_y_label) /* can rotate label */ { pl_textangle_r (multigrapher->plotter, 90); pl_alabel_r (multigrapher->plotter, 'c', 'x', multigrapher->y_axis.label); pl_textangle_r (multigrapher->plotter, 0); } else /* non-rotated axis label, right justified */ pl_alabel_r (multigrapher->plotter, 'r', 'c', multigrapher->y_axis.label); } else { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) + (libplot_has_font_metrics ? (SS((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) + 1.15 * multigrapher->y_axis.max_label_width + 0.5 * y_axis_font_size + multigrapher->half_line_width) : (SS((multigrapher->tick_size >= 0.0 ? 0.75 : 1.75) * fabs(multigrapher->tick_size)) /* backup */ + 1.0 * y_axis_font_size + multigrapher->half_line_width)), YV(yloc)); if (libplot_has_font_metrics && !multigrapher->no_rotate_y_label) /* can rotate label */ { pl_textangle_r (multigrapher->plotter, 90); pl_alabel_r (multigrapher->plotter, 'c', 't', multigrapher->y_axis.label); pl_textangle_r (multigrapher->plotter, 0); } else /* non-rotated axis label, left justified */ pl_alabel_r (multigrapher->plotter, 'l', 'c', multigrapher->y_axis.label); } } /* END OF TASKS */ /* flush frame to device */ pl_flushpl_r (multigrapher->plotter); pl_restorestate_r (multigrapher->plotter); if (multigrapher->grid_spec != NO_AXES) { if (!tick_warning_printed && ((!multigrapher->x_axis.omit_ticks && multigrapher->x_axis.labelled_ticks <= 2) || (!multigrapher->y_axis.omit_ticks && multigrapher->y_axis.labelled_ticks <= 2))) { fprintf (stderr, "%s: the tick spacing is adjusted, as there were too few labelled axis ticks\n", progname); tick_warning_printed = true; } } } /* plot_abscissa_log_subsubtick() and plot_ordinate_log_subsubtick() are called to plot both normal log subticks and special (user-requested) ones */ /* ARGS: xval = log of location */ static void plot_abscissa_log_subsubtick (Multigrapher *multigrapher, double xval) { double xrange = multigrapher->x_trans.input_max - multigrapher->x_trans.input_min; /* there is no way you could use longer labels on tick marks! */ char labelbuf[2048]; double tick_size = SS(multigrapher->tick_size); /* for positioning labels */ double subsubtick_size = SS(multigrapher->subtick_size); /* switch to our font for drawing x axis label and tick labels */ pl_fontname_r (multigrapher->plotter, multigrapher->x_axis.font_name); pl_ffontsize_r (multigrapher->plotter, SS(multigrapher->x_axis.font_size)); /* discard subsubtick locations outside plotting area */ if (xval < multigrapher->x_trans.input_min - FUZZ * xrange || xval > multigrapher->x_trans.input_max + FUZZ * xrange) return; /* label subsubtick if it seems appropriate */ if (multigrapher->x_axis.user_specified_subsubticks) { print_tick_label (labelbuf, &multigrapher->x_axis, &multigrapher->x_trans, pow (10.0, xval)); if (!multigrapher->y_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) - ((tick_size >= 0 ? 0.75 : 1.75) * fabs((double)tick_size) + multigrapher->half_line_width)); pl_alabel_r (multigrapher->plotter, 'c', 't', labelbuf); multigrapher->x_axis.labelled_ticks++; } else { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) + ((tick_size >= 0 ? 0.75 : 1.75) * fabs((double)tick_size) + multigrapher->half_line_width)); pl_alabel_r (multigrapher->plotter, 'c', 'b', labelbuf); multigrapher->x_axis.labelled_ticks++; } } /* draw subsubtick */ switch (multigrapher->grid_spec) { case AXES_AND_BOX_AND_GRID: pl_linemod_r (multigrapher->plotter, "dotted"); pl_fmove_r (multigrapher->plotter, XV (xval), YP(YSQ(0.0))); pl_fcont_r (multigrapher->plotter, XV (xval), YP(YSQ(1.0))); pl_linemod_r (multigrapher->plotter, "solid"); /* fall through */ case AXES_AND_BOX: if (!multigrapher->y_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) - (subsubtick_size + (subsubtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } else { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) + (subsubtick_size + (subsubtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } /* fall through */ case AXES: case AXES_AT_ORIGIN: if (!multigrapher->y_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.other_axis_loc) + (subsubtick_size + (subsubtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } else { pl_fmove_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc)); pl_fcont_r (multigrapher->plotter, XV (xval), YN (multigrapher->y_axis.alt_other_axis_loc) - (subsubtick_size + (subsubtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width))); } break; default: /* shouldn't happen */ break; } } /* ARGS: yval = log of location */ static void plot_ordinate_log_subsubtick (Multigrapher *multigrapher, double yval) { double yrange = multigrapher->y_trans.input_max - multigrapher->y_trans.input_min; /* there is no way you could use longer labels on tick marks! */ char labelbuf[2048]; double tick_size = SS(multigrapher->tick_size); /* for positioning labels */ double subsubtick_size = SS(multigrapher->subtick_size); /* switch to our font for drawing y axis label and tick labels */ pl_fontname_r (multigrapher->plotter, multigrapher->y_axis.font_name); pl_ffontsize_r (multigrapher->plotter, SS(multigrapher->y_axis.font_size)); /* discard subsubtick locations outside plotting area */ if (yval < multigrapher->y_trans.input_min - FUZZ * yrange || yval > multigrapher->y_trans.input_max + FUZZ * yrange) return; /* label subsubtick if it seems appropriate */ if (multigrapher->y_axis.user_specified_subsubticks) { double new_width; print_tick_label (labelbuf, &multigrapher->y_axis, &multigrapher->y_trans, pow (10.0, yval)); if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN(multigrapher->x_axis.other_axis_loc) - ((tick_size >= 0 ? 0.75 : 1.75) * fabs((double)tick_size) + multigrapher->half_line_width), YV (yval)); new_width = pl_flabelwidth_r (multigrapher->plotter, labelbuf); pl_alabel_r (multigrapher->plotter, 'r', 'c', labelbuf); multigrapher->y_axis.max_label_width = DMAX(multigrapher->y_axis.max_label_width, new_width); multigrapher->y_axis.labelled_ticks++; } else { pl_fmove_r (multigrapher->plotter, XN(multigrapher->x_axis.alt_other_axis_loc) + ((tick_size >= 0 ? 0.75 : 1.75) * fabs((double)tick_size) + multigrapher->half_line_width), YV (yval)); new_width = pl_flabelwidth_r (multigrapher->plotter, labelbuf); pl_alabel_r (multigrapher->plotter, 'l', 'c', labelbuf); multigrapher->y_axis.max_label_width = DMAX(multigrapher->y_axis.max_label_width, new_width); multigrapher->y_axis.labelled_ticks++; } } /* draw subsubtick */ switch (multigrapher->grid_spec) { case AXES_AND_BOX_AND_GRID: pl_linemod_r (multigrapher->plotter, "dotted"); pl_fmove_r (multigrapher->plotter, XP(XSQ(0.0)), YV (yval)); pl_fcont_r (multigrapher->plotter, XP(XSQ(1.0)), YV (yval)); pl_linemod_r (multigrapher->plotter, "solid"); /* fall through */ case AXES_AND_BOX: if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) - (subsubtick_size + (subsubtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } else { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) + (subsubtick_size + (subsubtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } /* fall through */ case AXES: case AXES_AT_ORIGIN: if (!multigrapher->x_axis.switch_axis_end) { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.other_axis_loc) + (subsubtick_size + (subsubtick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } else { pl_fmove_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc), YV (yval)); pl_fcont_r (multigrapher->plotter, XN (multigrapher->x_axis.alt_other_axis_loc) - (subsubtick_size + (multigrapher->tick_size > 0.0 ? multigrapher->half_line_width : -multigrapher->half_line_width)), YV (yval)); } break; default: /* shouldn't happen */ break; } } /* set_line_style() maps from line modes to physical line modes. See * explanation at head of file. */ static void set_line_style (Multigrapher *multigrapher, int style, bool use_color) { if (!use_color) /* monochrome */ { if (style > 0) /* don't issue pl_linemod_r() if style<=0, since no polyline will be drawn */ { int i; i = (style - 1) % NO_OF_LINEMODES; pl_linemod_r (multigrapher->plotter, linemodes[i]); } /* use same color as used for plot frame */ pl_colorname_r (multigrapher->plotter, multigrapher->frame_color); } else /* color */ { int i, j; if (style > 0) /* solid lines, various colors */ { i = ((style - 1) / NO_OF_LINEMODES) % NO_OF_LINEMODES; j = (style - 1) % NO_OF_LINEMODES; pl_linemod_r (multigrapher->plotter, linemodes[i]); } else if (style == 0) /* use first color, as if -m 1 was spec'd */ /* (no line will be drawn) */ j = 0; else /* neg. pl_linemode_r (no line will be drawn)*/ j = (-style - 1) % (NO_OF_LINEMODES - 1); pl_colorname_r (multigrapher->plotter, colorstyle[j]); } } /* plot_point_array() calls plot_point() on each point in an array of * points. */ void plot_point_array (Multigrapher *multigrapher, const Point *p, int length) { int index; for (index = 0; index < length; index++) plot_point (multigrapher, &(p[index])); } /* plot_point() plots a single point, including the appropriate symbol and * errorbar(s) if any. It may call either pl_fcont_r() or pl_fmove_r(), * depending on whether the pendown flag is set or not. Gnuplot-style * clipping (clip mode = 0,1,2) is supported. * * plot_point() makes heavy use of the multigrapher->x_trans and * multigrapher->y_trans structures, which specify the linear * transformation from user coordinates to device coordinates. It also * updates the multigrapher's internal state variables. */ void plot_point (Multigrapher *multigrapher, const Point *point) { double local_x0, local_y0, local_x1, local_y1; int clipval; /* If new polyline is beginning, take its line style, color/monochrome attribute, and line width and fill fraction attributes from the first point of the polyline. We assume all such attribute fields are the same for all points in the polyline (our point reader arranges this for us). */ if (!(point->pendown) || multigrapher->first_point_of_polyline) { int intfill; set_line_style (multigrapher, point->linemode, point->use_color); /* N.B. linewidth < 0.0 means use libplot default */ pl_flinewidth_r (multigrapher->plotter, point->line_width * (double)PLOT_SIZE); if (point->fill_fraction < 0.0) intfill = 0; /* transparent */ else /* guaranteed to be <= 1.0 */ intfill = 1 + IROUND((1.0 - point->fill_fraction) * 0xfffe); pl_filltype_r (multigrapher->plotter, intfill); } /* determine endpoints of new line segment (for the first point of a polyline, use a zero-length line segment) */ if (multigrapher->first_point_of_polyline) { local_x0 = point->x; local_y0 = point->y; } else { local_x0 = multigrapher->oldpoint_x; local_y0 = multigrapher->oldpoint_y; } local_x1 = point->x; local_y1 = point->y; /* save current point for use as endpoint of next line segment */ multigrapher->oldpoint_x = point->x; multigrapher->oldpoint_y = point->y; /* apply Cohen-Sutherland clipper to new line segment */ clipval = clip_line (multigrapher, &local_x0, &local_y0, &local_x1, &local_y1); if (!(clipval & ACCEPTED)) /* rejected in toto */ { pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); /* move with pen up */ multigrapher->first_point_of_polyline = false; return; } /* not rejected, ideally move with pen down */ if (point->pendown && (point->linemode > 0)) { switch (multigrapher->clip_mode) /* gnuplot style clipping (0,1, or 2) */ { case 0: if ((clipval & CLIPPED_FIRST) || (clipval & CLIPPED_SECOND)) /* clipped on at least one end, so move with pen up */ pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); else /* line segment within box, so move with pen down */ { if (!multigrapher->first_point_of_polyline) pl_fcont_r (multigrapher->plotter, XV (point->x), YV (point->y)); else pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); } break; case 1: default: if ((clipval & CLIPPED_FIRST) && (clipval & CLIPPED_SECOND)) /* both OOB, so move with pen up */ pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); else /* at most one point is OOB */ { if (clipval & CLIPPED_FIRST) /*current pt. OOB, new pt. not OOB*/ { if (!multigrapher->first_point_of_polyline) { /* move to clipped current point, draw line segment */ pl_fmove_r (multigrapher->plotter, XV (local_x0), YV (local_y0)); pl_fcont_r (multigrapher->plotter, XV (point->x), YV (point->y)); } else pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); } else /* current point not OOB, new point OOB */ { if (!multigrapher->first_point_of_polyline) { /* draw line segment to clipped new point */ pl_fcont_r (multigrapher->plotter, XV (local_x1), YV (local_y1)); /* N.B. lib's notion of position now differs from ours */ } else pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); } } break; case 2: if ((clipval & CLIPPED_FIRST) || multigrapher->first_point_of_polyline) /* move to clipped current point if necc. */ pl_fmove_r (multigrapher->plotter, XV (local_x0), YV (local_y0)); /* draw line segment to clipped new point */ pl_fcont_r (multigrapher->plotter, XV (local_x1), YV (local_y1)); if (clipval & CLIPPED_SECOND) /* new point OOB, so move to new point, breaking polyline */ pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); break; } } else /* linemode=0 or pen up; so move with pen up */ pl_fmove_r (multigrapher->plotter, XV (point->x), YV (point->y)); multigrapher->first_point_of_polyline = false; /* if target point is OOB, return without plotting symbol or errorbar */ if (clipval & CLIPPED_SECOND) return; /* plot symbol and errorbar, doing a pl_savestate_r()--pl_restorestate() to keep from breaking the polyline under construction (if any) */ if (point->symbol >= 32) /* yow, a character */ { /* will do a font change, so save & restore state */ pl_savestate_r (multigrapher->plotter); plot_errorbar (multigrapher, point); pl_fontname_r (multigrapher->plotter, point->symbol_font_name); pl_fmarker_r (multigrapher->plotter, XV(point->x), YV(point->y), point->symbol, SS(point->symbol_size)); pl_restorestate_r (multigrapher->plotter); } else if (point->symbol > 0) /* a marker symbol */ { if (point->linemode > 0) /* drawing a line, so (to keep from breaking it) save & restore state*/ { pl_savestate_r (multigrapher->plotter); plot_errorbar (multigrapher, point); /* may or may not have one */ pl_fmarker_r (multigrapher->plotter, XV(point->x), YV(point->y), point->symbol, SS(point->symbol_size)); pl_restorestate_r (multigrapher->plotter); } else /* not drawing a line, so just place the marker */ { plot_errorbar (multigrapher, point); pl_fmarker_r (multigrapher->plotter, XV(point->x), YV(point->y), point->symbol, SS(point->symbol_size)); } } else if (point->symbol == 0 && point->linemode == 0) /* backward compatibility: -m 0 (even with -S 0) plots a dot */ { plot_errorbar (multigrapher, point); pl_fmarker_r (multigrapher->plotter, XV(point->x), YV(point->y), M_DOT, SS(point->symbol_size)); } else /* no symbol, but may be an errorbar */ plot_errorbar (multigrapher, point); return; } /* clip_line() takes two points, the endpoints of a line segment, and * destructively passes back two points: the endpoints of the line segment * clipped by Cohen-Sutherland to the rectangular plotting area. Return * value contains bitfields ACCEPTED, CLIPPED_FIRST, and CLIPPED_SECOND. */ static int clip_line (Multigrapher *multigrapher, double *x0_p, double *y0_p, double *x1_p, double *y1_p) { double x0 = *x0_p; double y0 = *y0_p; double x1 = *x1_p; double y1 = *y1_p; outcode outcode0 = compute_outcode (multigrapher, x0, y0, true); outcode outcode1 = compute_outcode (multigrapher, x1, y1, true); bool accepted; int clipval = 0; for ( ; ; ) { if (!(outcode0 | outcode1)) /* accept */ { accepted = true; break; } else if (outcode0 & outcode1) /* reject */ { accepted = false; break; } else { /* at least one endpoint is outside; choose one that is */ outcode outcode_out = (outcode0 ? outcode0 : outcode1); double x, y; /* intersection with clip edge */ if (outcode_out & RIGHT) { x = multigrapher->x_trans.input_max; y = y0 + (y1 - y0) * (multigrapher->x_trans.input_max - x0) / (x1 - x0); } else if (outcode_out & LEFT) { x = multigrapher->x_trans.input_min; y = y0 + (y1 - y0) * (multigrapher->x_trans.input_min - x0) / (x1 - x0); } else if (outcode_out & TOP) { x = x0 + (x1 - x0) * (multigrapher->y_trans.input_max - y0) / (y1 - y0); y = multigrapher->y_trans.input_max; } else { x = x0 + (x1 - x0) * (multigrapher->y_trans.input_min - y0) / (y1 - y0); y = multigrapher->y_trans.input_min; } if (outcode_out == outcode0) { x0 = x; y0 = y; outcode0 = compute_outcode (multigrapher, x0, y0, true); } else { x1 = x; y1 = y; outcode1 = compute_outcode (multigrapher, x1, y1, true); } } } if (accepted) { clipval |= ACCEPTED; if ((x0 != *x0_p) || (y0 != *y0_p)) clipval |= CLIPPED_FIRST; if ((x1 != *x1_p) || (y1 != *y1_p)) clipval |= CLIPPED_SECOND; *x0_p = x0; *y0_p = y0; *x1_p = x1; *y1_p = y1; } return clipval; } /* Compute usual Cohen-Sutherland outcode, containing bitfields LEFT, RIGHT, BOTTOM, TOP. Nine possibilities: {LEFT, interior, RIGHT} x {BOTTOM, interior, TOP}. The `tolerant' flag specifies how we handle points on the boundary. */ static outcode compute_outcode (Multigrapher *multigrapher, double x, double y, bool tolerant) { outcode code = 0; double xfuzz = FUZZ * multigrapher->x_trans.input_range; double yfuzz = FUZZ * multigrapher->y_trans.input_range; int sign = (tolerant == true ? 1 : -1); if (x > multigrapher->x_trans.input_max + sign * xfuzz) code |= RIGHT; else if (x < multigrapher->x_trans.input_min - sign * xfuzz) code |= LEFT; if (y > multigrapher->y_trans.input_max + sign * yfuzz) code |= TOP; else if (y < multigrapher->y_trans.input_min - sign * yfuzz) code |= BOTTOM; return code; } static void transpose_portmanteau (int *val) { bool xtrue, ytrue; int newval; xtrue = ((*val & X_AXIS) ? true : false); ytrue = ((*val & Y_AXIS) ? true : false); newval = (xtrue ? Y_AXIS : 0) | (ytrue ? X_AXIS : 0); *val = newval; } static void plot_errorbar (Multigrapher *multigrapher, const Point *p) { if (p->have_x_errorbar || p->have_y_errorbar) /* save & restore state, since we invoke pl_linemod_r() */ { pl_savestate_r (multigrapher->plotter); pl_linemod_r (multigrapher->plotter, "solid"); if (p->have_x_errorbar) { pl_fline_r (multigrapher->plotter, XV(p->xmin), YV(p->y) - 0.5 * SS(p->symbol_size), XV(p->xmin), YV(p->y) + 0.5 * SS(p->symbol_size)); pl_fline_r (multigrapher->plotter, XV(p->xmin), YV(p->y), XV(p->xmax), YV(p->y)); pl_fline_r (multigrapher->plotter, XV(p->xmax), YV(p->y) - 0.5 * SS(p->symbol_size), XV(p->xmax), YV(p->y) + 0.5 * SS(p->symbol_size)); } if (p->have_y_errorbar) { pl_fline_r (multigrapher->plotter, XV(p->x) - 0.5 * SS(p->symbol_size), YV(p->ymin), XV(p->x) + 0.5 * SS(p->symbol_size), YV(p->ymin)); pl_fline_r (multigrapher->plotter, XV(p->x), YV(p->ymin), XV(p->x), YV(p->ymax)); pl_fline_r (multigrapher->plotter, XV(p->x) - 0.5 * SS(p->symbol_size), YV(p->ymax), XV(p->x) + 0.5 * SS(p->symbol_size), YV(p->ymax)); } pl_restorestate_r (multigrapher->plotter); } } /* An alternative means of ending a polyline in progress. Rather than ending it by passing plot_point() a point with the `pendown' flag not set, one may call this function. This yields faster response in real-time work; e.g. in reader.c it is called by read_and_plot_file() after all dataset(s) have been read from the file and plotted. */ void end_polyline_and_flush (Multigrapher *multigrapher) { pl_endpath_r (multigrapher->plotter); pl_flushpl_r (multigrapher->plotter); multigrapher->first_point_of_polyline = true; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/hersheydemo/��������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257511�012747� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/hersheydemo/Makefile.am���������������������������������������������������������������0000644�0001750�0001750�00000000333�11234207752�014713� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in bin_PROGRAMS = hersheydemo hersheydemo_SOURCES = hersheydemo.c hersheydemo_LDADD = ../lib/libcommon.a ../libplot/libplot.la INCLUDES = -I$(srcdir)/../include �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/hersheydemo/Makefile.in���������������������������������������������������������������0000644�0001750�0001750�00000034115�11234210073�014717� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = hersheydemo$(EXEEXT) subdir = hersheydemo DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_hersheydemo_OBJECTS = hersheydemo.$(OBJEXT) hersheydemo_OBJECTS = $(am_hersheydemo_OBJECTS) hersheydemo_DEPENDENCIES = ../lib/libcommon.a ../libplot/libplot.la DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(hersheydemo_SOURCES) DIST_SOURCES = $(hersheydemo_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ hersheydemo_SOURCES = hersheydemo.c hersheydemo_LDADD = ../lib/libcommon.a ../libplot/libplot.la INCLUDES = -I$(srcdir)/../include all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu hersheydemo/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu hersheydemo/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done hersheydemo$(EXEEXT): $(hersheydemo_OBJECTS) $(hersheydemo_DEPENDENCIES) @rm -f hersheydemo$(EXEEXT) $(LINK) $(hersheydemo_OBJECTS) $(hersheydemo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hersheydemo.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/hersheydemo/hersheydemo.c�������������������������������������������������������������0000644�0001750�0001750�00000030663�11234471251�015345� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1989--2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ /* This program, hersheydemo, is a demo program for the Hershey vector fonts, as implemented in GNU libplot. It outputs a demo page, designed by Dr. Allen Hershey himself. The page is taken from his 1972 article "A computer system for scientific typography", published in Computer Graphics and Image Processing (vol. 1, no. 4, pp. 373-385). The demo page may be output in any of the vector or bitmap formats that GNU libplot supports. The output format is specified with the `-T' option. For instance, do hersheydemo -TX to pop up a window on an X Window System display, showing Dr. Hershey's demo page. Do hersheydemo -Tps > output.ps to obtain a Postscript output file, and hersheydemo -Tps | gv - to display the file immediately, using Ghostview. Do hersheydemo -Tsvg > output.svg to obtain an SVG (Scalable Vector Graphics) file, or hersheydemo -Tsvg | display to display it immediately, using the `display' program that is part of the ImageMagick package. Within a traditional `xterm' terminal emulator window (though not within any of the more recent terminal emulators), you can do hersheydemo -Ttek to display the demo page using the terminal window's Tektronix mode, which will pop up an auxiliary window. Additional formats are supported; do `hersheydemo --help' for a list. In most of the above output formats, you can use the `--pen-color option' to change then pen color; for instance, you can include `--pen-color blue' to draw with a blue pen instead of a black pen (the default). Also, in many of the above output formats you can use the `--bg-color' option to specify the background color. For instance, you can include `--bg-color yellow' to obtain a yellow background. In most output formats, you can use the `--rotation 90' option to rotate by 90 degrees, etc. */ #include "sys-defines.h" #include "libcommon.h" #include "getopt.h" #include "plot.h" #ifdef M_SQRT1_2 #undef M_SQRT1_2 #endif #define M_SQRT1_2 (0.70710678118654752440) /* 1/sqrt(2) */ #define NUM_DEMO_WORDS 34 struct hershey_word { const char *word; const char *fontname; /* Hershey font name, libplot-style */ double m[6]; /* PS-style transformation matrix */ char just; /* horizontal justification (left/center/right) */ }; /* Dr. Hershey's glyph database includes reduced-size (`indexical') and small-size (`cartographic') glyphs. Some of the strings on his demo page used them. By default, libplot does not use the indexical or cartographic glyphs (though they can be retrieved from the glyph database, which is incorporated bodily into libplot, if necessary). Hence we scale by an appropriate factor when rendering the strings that were originally indexical or cartographic, as the full-sized glyphs in the database will be used to render them. */ #define CART (9.0/21.0) /* `cartographic' size */ #define INDEXICAL (13.0/21.0) /* `indexical' size */ /* bounding box */ #define LLX -3800.0 #define LLY -3450.0 #define URX 3800.0 #define URY 4150.0 #define BASE_FONTSIZE 220.0 const struct hershey_word demo_word[NUM_DEMO_WORDS] = { {"Invitation", "HersheyScript-Bold", { 1., 0., 0., 1., -3125., 3980. }, 'l' }, {"ECONOMY", "HersheySans", { 1., 0., 0., 1., -3125., 3340. }, 'l'}, {"CARTOGRAPHY", "HersheySans", { CART, 0., 0., CART, -3125., 2700. }, 'l'}, {"Gramma", "HersheySerifSymbol", { 1., 0., 0., 1., -3125., 2060. }, 'l'}, {"\347\322\301\306\311\313\301", "HersheyCyrillic", { 1., 0., 0., 1., -3125., 1420. }, 'l'}, {"COMMUNICATION", "HersheySans-Bold", { 1., 0., 0., 1., 0., 3980. }, 'c'}, {"VERSATILITY", "HersheySerif-Italic", { 1., 0., 0., 1., 0., 3340. }, 'c'}, {"Standardization", "HersheySerif", { 1., 0., 0., 1., 0., 2700. }, 'c'}, {"Sumbolon", "HersheySerifSymbol", { INDEXICAL, 0., 0., INDEXICAL, 0., 2060. }, 'c'}, {"\363\354\357\366\356\357\363\364\370", "HersheyCyrillic", { 1., 0., 0., 1., 0., 1420. }, 'c'}, {"Publication", "HersheyScript-Bold", { 1., 0., 0., 1., 3125., 3980. }, 'r'}, {"Quality", "HersheyGothicEnglish", { 1., 0., 0., 1., 3125., 3340. }, 'r'}, {"TYPOGRAPHY", "HersheySans", { CART, 0., 0., CART, 3125., 2700. }, 'r'}, {"AriJmo\\s-", "HersheySerifSymbol", { 1., 0., 0., 1., 3125., 2060. }, 'r'}, {"\346\317\316\305\324\311\313\301", "HersheyCyrillic", { 1., 0., 0., 1., 3125., 1420. }, 'r'}, {"EXTENSION", "HersheySans", { 17./7., 0., 0., 2./7., 0., 780. }, 'c'}, {"CONDENSATION", "HersheySans", { 5./7., 0., 0., 17./7., 0., -20. }, 'c'}, {"Rotation", "HersheySans", { M_SQRT1_2, M_SQRT1_2, -M_SQRT1_2, M_SQRT1_2, -2880., -20. }, 'l'}, {"ROTATION", "HersheySans", { M_SQRT1_2, -M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, 2880., -20. }, 'r'}, {"Syllabary", "HersheySerif", { 1., 0., 0., 1., -3125., -780. }, 'l'}, {"Art", "HersheyGothicEnglish", { 1., 0., 0., 1., -3125., -1420. }, 'l'}, {"Meteorology", "HersheySerif-Italic", { INDEXICAL, 0., 0., INDEXICAL, -3125., -2060.}, 'l'}, {"CHEMISTRY", "HersheySerif", { 1., 0., 0., 1., -3125., -2700.}, 'l'}, {"Analysis", "HersheySerif-BoldItalic", { 1., 0., 0., 1., -3125., -3340.}, 'l'}, {"LEXIKON", "HersheySerifSymbol-Bold", { 1., 0., 0., 1., 0., -780.}, 'c'}, {"\\#J3d71\\#J463b", "HersheySerif", { 1./.7, 0., 0., 1./.7, 0., -1420.}, 'c'}, {"Wissenschaft", "HersheyGothicGerman", { 1., 0., 0., 1., 0., -2060.}, 'c'}, {"Electronics", "HersheySerif-Italic", { 1., 0., 0., 1., 0., -2700.}, 'c'}, {"COMPUTATION", "HersheySerif-Bold", { 1., 0., 0., 1., 0., -3340.}, 'c'}, {"Alphabet", "HersheySerif", { 1., 0., 0., 1., 3125., -780.}, 'r'}, {"Music", "HersheyGothicItalian", { 1., 0., 0., 1., 3125., -1420.}, 'r'}, {"Astronomy", "HersheySerif", { INDEXICAL, 0., 0., INDEXICAL, 3125., -2060.}, 'r'}, {"MATHEMATICS", "HersheySerif", { 1., 0., 0., 1., 3125., -2700.}, 'r'}, {"Program", "HersheySerif-BoldItalic", { 1., 0., 0., 1., 3125., -3340.}, 'r'}, }; const char *progname = "hersheydemo"; /* name of this program */ const char *written = "Written by Robert S. Maier."; const char *copyright = "Copyright (C) 2009 Free Software Foundation, Inc."; const char *usage_appendage = "\n"; char *bg_color = NULL; /* bg color */ char *pen_color = NULL; /* pen color */ char *bitmap_size = NULL; /* e.g. 500x500 (for bitmap output formats) */ char *page_size = NULL; /* e.g. a4 (certain vector output formats) */ /* options */ #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 const char *optstring = "T:"; struct option long_options[] = { /* The most important option ("--display-type" is an obsolete variant) */ { "output-format", ARG_REQUIRED, NULL, 'T'}, { "display-type", ARG_REQUIRED, NULL, 'T' << 8 }, /* obsolete */ /* Long options with (mostly) no equivalent short option alias */ { "bg-color", ARG_REQUIRED, NULL, 'q' << 8 }, { "pen-color", ARG_REQUIRED, NULL, 'C' << 8 }, { "rotation", ARG_REQUIRED, NULL, 'r' << 8}, { "bitmap-size", ARG_REQUIRED, NULL, 'B' << 8}, { "page-size", ARG_REQUIRED, NULL, 'P' << 8}, /* Documentation options */ { "version", ARG_NONE, NULL, 'V' << 8 }, { "help", ARG_NONE, NULL, 'h' << 8 }, { NULL, 0, NULL, 0} }; /* null-terminated list of options, such as obsolete-but-still-maintained options or undocumented options, which we don't show to the user */ const int hidden_options[] = {(int)('T' << 8), 0 }; int main (int argc, char *argv[]) { plPlotter *plotter; plPlotterParams *plotter_params; bool show_usage = false; /* show usage message? */ bool show_version = false; /* show version message? */ char *output_format = (char *)"meta"; /* default libplot output format */ int errcnt = 0; /* errors encountered */ int opt_index; /* long option index */ int option; /* option character */ int i; /* set Plotter parameters */ plotter_params = pl_newplparams (); while ((option = getopt_long (argc, argv, optstring, long_options, &opt_index)) != EOF) { if (option == 0) option = long_options[opt_index].val; switch (option) { case 'T': /* Output format, ARG REQUIRED */ case 'T' << 8: output_format = (char *)xmalloc (strlen (optarg) + 1); strcpy (output_format, optarg); break; case 'C' << 8: /* set the pen color, ARG REQUIRED */ pen_color = (char *)xmalloc (strlen (optarg) + 1); strcpy (pen_color, optarg); break; case 'q' << 8: /* set the background color, ARG REQUIRED */ bg_color = (char *)xmalloc (strlen (optarg) + 1); strcpy (bg_color, optarg); break; case 'r' << 8: /* Plot rotation angle, ARG REQUIRED */ pl_setplparam (plotter_params, "ROTATION", (void *)optarg); break; case 'B' << 8: /* Bitmap size, ARG REQUIRED */ pl_setplparam (plotter_params, "BITMAPSIZE", (void *)optarg); break; case 'P' << 8: /* Page size, ARG REQUIRED */ pl_setplparam (plotter_params, "PAGESIZE", (void *)optarg); break; case 'V' << 8: /* Version */ show_version = true; break; case 'h' << 8: /* Help */ show_usage = true; break; default: errcnt++; break; } } if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, 1); return EXIT_SUCCESS; } if (bg_color) /* select user-specified background color */ pl_setplparam (plotter_params, "BG_COLOR", (void *)bg_color); if ((plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params)) == NULL) { fprintf (stderr, "%s: error: the plot device could not be created\n", progname); return EXIT_FAILURE; } /* open the plot device, set up user coordinate system */ pl_openpl_r (plotter); pl_erase_r (plotter); pl_fspace_r (plotter, LLX, LLY, URX, URY); if (pen_color) pl_pencolorname_r (plotter, pen_color); /* loop through words, displaying each; and each time, saving and restoring the graphics state (which includes the current transformation matrix) */ for (i = 0; i < NUM_DEMO_WORDS; i++) { pl_savestate_r (plotter); pl_fontname_r (plotter, demo_word[i].fontname); /* insert a PS-style transformation matrix, including both repositioning and scaling, into the graphics pipeline */ pl_fconcat_r (plotter, demo_word[i].m[0], demo_word[i].m[1], demo_word[i].m[2], demo_word[i].m[3], demo_word[i].m[4], demo_word[i].m[5]); /* all words have the same font size in user coordinates (though not necessarily in device coordinates) */ pl_ffontsize_r (plotter, BASE_FONTSIZE); /* all words have the same location in user coordinates (though not, obviously, in device coordinates) */ pl_fmove_r (plotter, 0.0, 0.0); /* each word is drawn as an `alabel' (adjusted label), i.e., text string with specified horizontal justification and with vertical justification that is always `c', i.e., which is vertically centered */ pl_alabel_r (plotter, demo_word[i].just, 'c', demo_word[i].word); pl_restorestate_r (plotter); } /* close and delete Plotter */ pl_closepl_r (plotter); if (pl_deletepl_r (plotter) < 0) { fprintf (stderr, "Couldn't delete Plotter\n"); return EXIT_FAILURE; } return EXIT_SUCCESS; } �����������������������������������������������������������������������������plotutils-2.6/pic2plot/�����������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257513�012171� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/README�����������������������������������������������������������������������0000644�0001750�0001750�00000000410�06660434510�012754� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This directory contains the source for the GNU pic2plot program, which can translate a pic language script to a specified graphics file format, or display it on an X11 display. The subdirectory ./doc contains some supplementary documentation on the pic language. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/common.h���������������������������������������������������������������������0000644�0001750�0001750�00000010244�11037241011�013525� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ // The common_output class: subclassed from the output class, // providing support for dotting/dashing and for rounded boxes. // The output class is defined in output.h. class common_output : public output { public: // basic interface, implemented in concrete classes rather than here virtual void start_picture (double sc, const position &ll, const position &ur) = 0; virtual void finish_picture () = 0; // draw objects (not implemented here) virtual void arc (const position &start, const position ¢, const position &end, const line_type <) = 0; virtual void circle (const position ¢, double rad, const line_type <, double fill) = 0; virtual void ellipse (const position ¢, const distance &dim, const line_type <, double fill) = 0; virtual void line (const position &start, const position *v, int n, const line_type <) = 0; virtual void polygon (const position *v, int n, const line_type <, double fill) = 0; virtual void spline (const position &start, const position *v, int n, const line_type <) = 0; virtual void text (const position ¢er, text_piece *v, int n, double angle) = 0; // draw objects (implemented here) virtual void rounded_box (const position ¢, const distance &dim, double rad, const line_type <, double fill); protected: /* implemented in concrete classes (used for dotting lines by hand) */ virtual void dot (const position ¢, const line_type <) = 0; /* implemented in terms of arc (); can be overridden (e.g. in tex_output) */ virtual void solid_arc (const position ¢, double rad, double start_angle, double end_angle, const line_type <); /* dashing and dotting `by hand' (used by troff_output, not tex_output) */ void dashed_circle (const position ¢, double rad, const line_type <); void dotted_circle (const position ¢, double rad, const line_type <); void dashed_arc (const position &start, const position ¢, const position &end, const line_type <); void dotted_arc (const position &start, const position ¢, const position &end, const line_type <); void dashed_rounded_box (const position ¢, const distance &dim, double rad, const line_type <); void dotted_rounded_box (const position ¢, const distance &dim, double rad, const line_type <); void solid_rounded_box (const position ¢, const distance &dim, double rad, const line_type <); void filled_rounded_box (const position ¢, const distance &dim, double rad, double fill); private: void dash_line (const position &start, const position &end, const line_type <, double dash_width, double gap_width, double *offsetp); void dash_arc (const position ¢, double rad, double start_angle, double end_angle, const line_type <, double dash_width, double gap_width, double *offsetp); void dot_line (const position &start, const position &end, const line_type <, double gap_width, double *offsetp); void dot_arc (const position ¢, double rad, double start_angle, double end_angle, const line_type <, double gap_width, double *offsetp); }; // not private because TeX driver uses this int compute_arc_center (const position &start, const position ¢, const position &end, position *result); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/object.h���������������������������������������������������������������������0000644�0001750�0001750�00000013531�11037241140�013510� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ struct place; enum object_type { OTHER_OBJECT, BOX_OBJECT, CIRCLE_OBJECT, ELLIPSE_OBJECT, ARC_OBJECT, SPLINE_OBJECT, LINE_OBJECT, ARROW_OBJECT, MOVE_OBJECT, TEXT_OBJECT, BLOCK_OBJECT, MARK_OBJECT }; class bounding_box; class object { public: // ctor, dtor object(); virtual ~object(); // doubly linked list object *prev; object *next; // public functions (all virtual) // 1. functions returning positions and dimensions virtual position origin(); virtual double width(); virtual double radius(); virtual double height(); virtual position north(); virtual position south(); virtual position east(); virtual position west(); virtual position north_east(); virtual position north_west(); virtual position south_east(); virtual position south_west(); virtual position start(); virtual position end(); virtual position center(); virtual place *find_label(const char *); // lookup location by string // 2. other functions virtual void move_by(const position &); virtual int blank(); virtual void update_bounding_box(bounding_box *); virtual object_type type() = 0; virtual void print(); virtual void print_text(); }; typedef position (object::*corner)(); struct place { object *obj; double x, y; }; class string_list; class path { public: // ctors, dtor path(corner = 0); path(char *, corner = 0); ~path(); // public functions void append(corner); void append(char *); void set_ypath(path *); int follow(const place &, place *) const; private: corner crn; string_list *label_list; path *ypath; }; class object_list { public: // ctor object_list(); // public functions void append(object *); void wrap_up_block(object_list *); // public data object *head; object *tail; }; declare_ptable(place) // these go counterclockwise enum direction { RIGHT_DIRECTION, UP_DIRECTION, LEFT_DIRECTION, DOWN_DIRECTION }; struct graphics_state { double x, y; direction dir; }; struct saved_state : public graphics_state { saved_state *prev; PTABLE(place) *tbl; }; class text_item { public: // ctor, dtor text_item(char *, const char *, int); ~text_item(); // public data text_item *next; char *text; adjustment adj; const char *filename; int lineno; }; const unsigned long IS_DOTTED = 01; const unsigned long IS_DASHED = 02; const unsigned long IS_CLOCKWISE = 04; const unsigned long IS_INVISIBLE = 020; const unsigned long HAS_LEFT_ARROW_HEAD = 040; const unsigned long HAS_RIGHT_ARROW_HEAD = 0100; const unsigned long HAS_SEGMENT = 0200; const unsigned long IS_SAME = 0400; const unsigned long HAS_FROM = 01000; const unsigned long HAS_AT = 02000; const unsigned long HAS_WITH = 04000; const unsigned long HAS_HEIGHT = 010000; const unsigned long HAS_WIDTH = 020000; const unsigned long HAS_RADIUS = 040000; const unsigned long HAS_TO = 0100000; const unsigned long IS_CHOPPED = 0200000; const unsigned long IS_DEFAULT_CHOPPED = 0400000; const unsigned long HAS_THICKNESS = 01000000; const unsigned long IS_FILLED = 02000000; const unsigned long IS_DEFAULT_FILLED = 04000000; const unsigned long IS_ALIGNED = 010000000; class segment { public: // ctor segment(const position &, int, segment *); // public data int is_absolute; position pos; segment *next; }; class rectangle_object; class graphic_object; class linear_object; class object_spec { public: // ctor, dtor object_spec(object_type); ~object_spec(); // public functions (mostly for creating objects) object *make_object(position *, direction *); graphic_object *make_box(position *, direction *); graphic_object *make_block(position *, direction *); graphic_object *make_text(position *, direction *); graphic_object *make_ellipse(position *, direction *); graphic_object *make_circle(position *, direction *); linear_object *make_line(position *, direction *); linear_object *make_arc(position *, direction *); graphic_object *make_linear(position *, direction *); graphic_object *make_move(position *, direction *); int position_rectangle(rectangle_object *p, position *curpos, direction *dirp); // public data (mostly, object attributes) unsigned long flags; object_type type; object_list oblist; PTABLE(place) *tbl; double dash_width; position from; position to; position at; position by; path *with; text_item *text; double height; double radius; double width; double segment_width; double segment_height; double start_chop; double end_chop; double thickness; double fill; direction dir; segment *segment_list; position segment_pos; int segment_is_absolute; }; object *make_object(object_spec *, position *, direction *); object *make_mark_object(); object *make_command_object(char *, const char *, int); // interface to parser in gram.cc extern void define_variable (const char *name, double val); extern int lookup_variable (const char *name, double *val); // function in object.cc extern void print_picture (object *obj); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/output.h���������������������������������������������������������������������0000644�0001750�0001750�00000005477�10346614655�013635� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// The output class: almost pure virtual (a protocol class), but // see some definitions in object.cc. struct line_type { enum { invisible, solid, dotted, dashed } type; double dash_width; // or inter-dot spacing, for dotted lines double thickness; // line thickness in points // ctor line_type(); }; class output { public: // ctor, dtor output(); virtual ~output(); // interface: implemented in toto in each concrete output class virtual void start_picture (double sc, const position &ll, const position &ur) = 0; virtual void finish_picture (void) = 0; virtual void arc (const position &start, const position ¢, const position &end, const line_type <) = 0; virtual void circle (const position ¢, double rad, const line_type <, double fill) = 0; virtual void ellipse (const position ¢, const distance &dim, const line_type <, double fill) = 0; virtual void line (const position &start, const position *v, int n, const line_type <) = 0; virtual void polygon (const position *v, int n, const line_type <, double fill) = 0; virtual void spline (const position &start, const position *v, int n, const line_type <) = 0; virtual void text (const position ¢er, text_piece *v, int n, double angle) = 0; virtual void rounded_box (const position ¢, const distance &dim, double rad, const line_type <, double fill) = 0; // no-ops, can optionally be overridden virtual void command (const char *s, const char *filename, int lineno); virtual void set_location (const char *filename, int lineno); // returns 0 (false), can optionally be overridden virtual int supports_filled_polygons (void); // no-ops; can optionally be overridden virtual void begin_block (const position &ll, const position &ur); virtual void end_block (void); // not overridable; related to scaling void set_desired_width_height (double wid, double ht); void set_args (const char *); protected: char *args; double desired_height; // zero if no height specified double desired_width; // zero if no depth specified double compute_scale (double sc, const position &ll, const position &ur); }; // A global; we have only one of these. Its member function are what do // the output of objects of various kinds (they're invoked by the // objects' `print' operations). Defined in main.cc. extern output *out; #define TROFF_SUPPORT 0 #define TEX_SUPPORT 0 #define PLOT_SUPPORT 1 #ifdef TROFF_SUPPORT output *make_troff_output (void); #endif #ifdef TEX_SUPPORT output *make_tex_output (void); output *make_tpic_output (void); #endif #ifdef PLOT_SUPPORT output *make_plot_output (void); extern char *output_format; extern char *font_name; extern char *pen_color_name; extern double font_size; extern double line_width; extern int precision_dashing; #endif �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/pic.h������������������������������������������������������������������������0000644�0001750�0001750�00000006144�11037241152�013022� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ // include system headers: stdio, string, math (+ M_PI, M_SQRT2), stdlib, errno #include "sys-defines.h" // include all libgroff headers in ./include. #include "cset.h" #include "errarg.h" #include "error.h" #include "lib.h" #include "position.h" #include "ptable.h" #include "stringclass.h" #include "text.h" // declare input and file_input classes class input { public: // ctor, dtor input (); virtual ~input (); // public functions (all virtual) virtual int get (void) = 0; virtual int peek (void) = 0; virtual int get_location (const char **filenamep, int *linenop); // friend classes friend class input_stack; friend class copy_rest_thru_input; private: input *next; }; class file_input : public input { public: // ctor, dtor file_input (FILE *, const char *); ~file_input (); // public functions int get (void); int peek (void); int get_location(const char **filenamep, int *linenop); private: FILE *fp; const char *filename; int lineno; string line; const char *ptr; int read_line (void); }; // External functions // interface to lexer in lex.cc extern int yylex (void); extern void copy_file_thru (const char *filename, const char *body, const char *until); extern void copy_rest_thru (const char *body, const char *until); extern void do_copy (const char *filename); extern void do_for (char *var, double from, double to, int by_is_multiplicative, double by, char *body); extern void do_lookahead (void); extern void lex_cleanup (void); extern void lex_error (const char *message, const errarg &arg1 = empty_errarg, const errarg &arg2 = empty_errarg, const errarg &arg3 = empty_errarg); extern void lex_init (input *top); extern void lex_warning (const char *message, const errarg &arg1 = empty_errarg, const errarg &arg2 = empty_errarg, const errarg &arg3 = empty_errarg); extern void push_body (const char *s); extern void yyerror (const char *s); // interface to parser in gram.cc extern int yyparse(); extern void parse_init (void); extern void parse_cleanup (void); extern int delim_flag; // read-only variable // Command-line flags in main.cc, used by lexer, parser, or driver extern int command_char; extern int compatible_flag; extern int safer_flag; extern int no_centering_flag; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/Makefile.am������������������������������������������������������������������0000644�0001750�0001750�00000001165�11037241120�014123� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in bin_PROGRAMS = pic2plot pic2plot_SOURCES = common.cc lex.cc main.cc object.cc plot.cc gram.yy fontlist.c pic2plot_LDADD = ../lib/libcommon.a ./libgroff/libgroff.a ../libplot/libplot.la noinst_HEADERS = common.h object.h output.h pic.h AM_YFLAGS = -d INCLUDES = -I$(srcdir)/../include -I$(srcdir)/include CLEANFILES = fontlist.c EXTRA_DIST = gram.h SUBDIRS = doc include libgroff fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/Makefile.in������������������������������������������������������������������0000644�0001750�0001750�00000052036�11234210075�014143� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pic2plot$(EXEEXT) subdir = pic2plot DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in gram.cc gram.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_pic2plot_OBJECTS = common.$(OBJEXT) lex.$(OBJEXT) main.$(OBJEXT) \ object.$(OBJEXT) plot.$(OBJEXT) gram.$(OBJEXT) \ fontlist.$(OBJEXT) pic2plot_OBJECTS = $(am_pic2plot_OBJECTS) pic2plot_DEPENDENCIES = ../lib/libcommon.a ./libgroff/libgroff.a \ ../libplot/libplot.la DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS) YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(pic2plot_SOURCES) DIST_SOURCES = $(pic2plot_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pic2plot_SOURCES = common.cc lex.cc main.cc object.cc plot.cc gram.yy fontlist.c pic2plot_LDADD = ../lib/libcommon.a ./libgroff/libgroff.a ../libplot/libplot.la noinst_HEADERS = common.h object.h output.h pic.h AM_YFLAGS = -d INCLUDES = -I$(srcdir)/../include -I$(srcdir)/include CLEANFILES = fontlist.c EXTRA_DIST = gram.h SUBDIRS = doc include libgroff all: all-recursive .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj .yy $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pic2plot/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu pic2plot/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done gram.h: gram.cc @if test ! -f $@; then \ rm -f gram.cc; \ $(MAKE) $(AM_MAKEFLAGS) gram.cc; \ else :; fi pic2plot$(EXEEXT): $(pic2plot_OBJECTS) $(pic2plot_DEPENDENCIES) @rm -f pic2plot$(EXEEXT) $(CXXLINK) $(pic2plot_OBJECTS) $(pic2plot_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gram.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plot.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< .yy.cc: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f gram.cc -rm -f gram.h clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS fontlist.c: $(top_srcdir)/lib/fontlist.c @rm -f fontlist.c ; if $(LN_S) $(top_srcdir)/lib/fontlist.c fontlist.c ; then true ; else cp -p $(top_srcdir)/lib/fontlist.c fontlist.c ; fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/gram.cc����������������������������������������������������������������������0000644�0001750�0001750�00000352327�07126276671�013364� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ /* A Bison parser, made from gram.yy by GNU Bison version 1.28 */ #define YYBISON 1 /* Identify Bison output. */ #define LABEL 257 #define VARIABLE 258 #define NUMBER 259 #define TEXT 260 #define COMMAND_LINE 261 #define DELIMITED 262 #define ORDINAL 263 #define TH 264 #define LEFT_ARROW_HEAD 265 #define RIGHT_ARROW_HEAD 266 #define DOUBLE_ARROW_HEAD 267 #define LAST 268 #define UP 269 #define DOWN 270 #define LEFT 271 #define RIGHT 272 #define BOX 273 #define CIRCLE 274 #define ELLIPSE 275 #define ARC 276 #define LINE 277 #define ARROW 278 #define MOVE 279 #define SPLINE 280 #define HEIGHT 281 #define RADIUS 282 #define WIDTH 283 #define DIAMETER 284 #define FROM 285 #define TO 286 #define AT 287 #define WITH 288 #define BY 289 #define THEN 290 #define DOTTED 291 #define DASHED 292 #define CHOP 293 #define SAME 294 #define INVISIBLE 295 #define LJUST 296 #define RJUST 297 #define ABOVE 298 #define BELOW 299 #define OF 300 #define THE 301 #define WAY 302 #define BETWEEN 303 #define AND 304 #define HERE 305 #define DOT_N 306 #define DOT_E 307 #define DOT_W 308 #define DOT_S 309 #define DOT_NE 310 #define DOT_SE 311 #define DOT_NW 312 #define DOT_SW 313 #define DOT_C 314 #define DOT_START 315 #define DOT_END 316 #define DOT_X 317 #define DOT_Y 318 #define DOT_HT 319 #define DOT_WID 320 #define DOT_RAD 321 #define SIN 322 #define COS 323 #define ATAN2 324 #define LOG 325 #define EXP 326 #define SQRT 327 #define K_MAX 328 #define K_MIN 329 #define INT 330 #define RAND 331 #define SRAND 332 #define COPY 333 #define THRU 334 #define TOP 335 #define BOTTOM 336 #define UPPER 337 #define LOWER 338 #define SH 339 #define PRINT 340 #define CW 341 #define CCW 342 #define FOR 343 #define DO 344 #define IF 345 #define ELSE 346 #define ANDAND 347 #define OROR 348 #define NOTEQUAL 349 #define EQUALEQUAL 350 #define LESSEQUAL 351 #define GREATEREQUAL 352 #define LEFT_CORNER 353 #define RIGHT_CORNER 354 #define CENTER 355 #define END 356 #define START 357 #define RESET 358 #define UNTIL 359 #define PLOT 360 #define THICKNESS 361 #define FILL 362 #define ALIGNED 363 #define SPRINTF 364 #define COMMAND 365 #define DEFINE 366 #define UNDEF 367 #line 5 "gram.yy" #include "pic.h" #include "object.h" ////////////////////////////////////////////////////////////////////// // PIC PARSER // Public interface: // // parse_init() [should be called only once] // yyparse() // parse_cleanup() [should be called after each parse] // define_variable(), lookup_variable() [declared in object.h, // also used in lex.cc for `for' loops] // // delim_flag [state flag read by lexer in lex.cc] // // The parser makes heavy use of special functions provided by the lexer, // such as do_copy(), do_for(), copy_file_thru(), copy_rest_thru(), // push_body(), and especially do_lookahead(). It also calls lex_warning() // and lex_error(). ////////////////////////////////////////////////////////////////////// #undef fmod #undef rand #undef srand extern "C" { double fmod(double, double); int rand(); void srand(unsigned int); } // Maximum number of characters produced by printf("%g") #define GDIGITS 14 static char sprintf_buf[1024]; direction current_direction; position current_position; implement_ptable(place) PTABLE(place) top_table; PTABLE(place) *current_table = &top_table; saved_state *current_saved_state = 0; object_list olist; // external variable, used by lexer int delim_flag = 0; // forward references static place *lookup_label(const char *label); static void define_label(const char *label, const place *pl); static void reset (const char *nm); static void reset_all (void); static const char * ordinal_postfix(int n); static const char * object_type_name(object_type type); static char * format_number(const char *form, double n); static char * do_sprintf(const char *form, const double *v, int nv); #line 70 "gram.yy" typedef union { char *str; int n; double x; struct { double x, y; } pair; struct { double x; char *body; } if_data; struct { char *str; const char *filename; int lineno; } lstr; struct { double *v; int nv; int maxv; } dv; struct { double val; int is_multiplicative; } by; place pl; object *obj; corner crn; path *pth; object_spec *spec; saved_state *pstate; graphics_state state; object_type obtype; } YYSTYPE; #include #ifndef __cplusplus #ifndef __STDC__ #define const #endif #endif #define YYFINAL 413 #define YYFLAG -32768 #define YYNTBASE 135 #define YYTRANSLATE(x) ((unsigned)(x) <= 367 ? yytranslate[x] : 180) static const short yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 124, 2, 2, 2, 123, 2, 2, 114, 133, 121, 119, 116, 120, 134, 122, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128, 126, 117, 127, 118, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 131, 2, 132, 125, 2, 115, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 129, 2, 130, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, 0, 2, 4, 8, 10, 14, 15, 17, 19, 22, 26, 31, 33, 35, 37, 39, 41, 44, 47, 48, 52, 55, 56, 57, 65, 66, 67, 74, 75, 86, 88, 89, 94, 96, 98, 101, 104, 108, 110, 113, 115, 117, 119, 120, 126, 127, 130, 132, 134, 138, 142, 146, 150, 154, 158, 162, 166, 169, 170, 173, 177, 179, 184, 189, 194, 195, 196, 203, 205, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 229, 233, 234, 239, 243, 247, 251, 255, 258, 261, 265, 268, 272, 275, 279, 282, 286, 290, 294, 298, 302, 306, 309, 312, 316, 319, 323, 326, 330, 333, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, 367, 370, 373, 377, 380, 382, 388, 389, 393, 395, 397, 399, 403, 407, 413, 419, 426, 428, 433, 437, 441, 443, 446, 449, 453, 455, 457, 459, 463, 465, 469, 471, 474, 477, 480, 482, 484, 486, 488, 490, 492, 494, 497, 499, 502, 506, 508, 510, 513, 515, 521, 526, 530, 534, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 561, 563, 565, 567, 570, 573, 576, 579, 581, 583, 586, 589, 592, 595, 597, 599, 601, 603, 605, 608, 611, 614, 617, 620, 624, 628, 632, 636, 640, 644, 647, 651, 656, 661, 668, 673, 678, 683, 690, 697, 702, 707, 711, 716, 720, 724, 728, 732, 736, 740, 744, 748 }; static const short yyrhs[] = { 138, 0, 136, 0, 138, 137, 138, 0, 157, 0, 137, 139, 157, 0, 0, 139, 0, 126, 0, 139, 126, 0, 4, 127, 154, 0, 4, 128, 127, 154, 0, 15, 0, 16, 0, 17, 0, 18, 0, 7, 0, 111, 149, 0, 86, 149, 0, 0, 85, 141, 8, 0, 79, 6, 0, 0, 0, 79, 6, 80, 142, 8, 143, 153, 0, 0, 0, 79, 80, 144, 8, 145, 153, 0, 0, 89, 4, 127, 179, 32, 179, 156, 90, 146, 8, 0, 151, 0, 0, 151, 92, 147, 8, 0, 148, 0, 104, 0, 104, 4, 0, 148, 4, 0, 148, 116, 4, 0, 150, 0, 149, 150, 0, 179, 0, 163, 0, 165, 0, 0, 91, 154, 36, 152, 8, 0, 0, 105, 6, 0, 179, 0, 155, 0, 163, 96, 163, 0, 163, 95, 163, 0, 155, 93, 155, 0, 155, 93, 179, 0, 179, 93, 155, 0, 155, 94, 155, 0, 155, 94, 179, 0, 179, 94, 155, 0, 124, 155, 0, 0, 35, 179, 0, 35, 121, 179, 0, 161, 0, 3, 128, 138, 157, 0, 3, 128, 138, 166, 0, 3, 128, 138, 169, 0, 0, 0, 129, 158, 136, 130, 159, 160, 0, 140, 0, 0, 157, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, 163, 0, 106, 179, 0, 106, 179, 163, 0, 0, 131, 162, 136, 132, 0, 161, 27, 179, 0, 161, 28, 179, 0, 161, 29, 179, 0, 161, 30, 179, 0, 161, 179, 0, 161, 15, 0, 161, 15, 179, 0, 161, 16, 0, 161, 16, 179, 0, 161, 18, 0, 161, 18, 179, 0, 161, 17, 0, 161, 17, 179, 0, 161, 31, 165, 0, 161, 32, 165, 0, 161, 33, 165, 0, 161, 34, 177, 0, 161, 35, 168, 0, 161, 36, 0, 161, 37, 0, 161, 37, 179, 0, 161, 38, 0, 161, 38, 179, 0, 161, 108, 0, 161, 108, 179, 0, 161, 39, 0, 161, 39, 179, 0, 161, 40, 0, 161, 41, 0, 161, 11, 0, 161, 12, 0, 161, 13, 0, 161, 87, 0, 161, 88, 0, 161, 163, 0, 161, 42, 0, 161, 43, 0, 161, 44, 0, 161, 45, 0, 161, 107, 179, 0, 161, 109, 0, 6, 0, 110, 114, 6, 164, 133, 0, 0, 164, 116, 179, 0, 166, 0, 169, 0, 168, 0, 165, 119, 168, 0, 165, 120, 168, 0, 114, 165, 116, 165, 133, 0, 179, 167, 165, 50, 165, 0, 179, 117, 165, 116, 165, 118, 0, 49, 0, 46, 47, 48, 49, 0, 179, 116, 179, 0, 114, 168, 133, 0, 170, 0, 170, 178, 0, 178, 170, 0, 178, 46, 170, 0, 51, 0, 3, 0, 173, 0, 170, 134, 3, 0, 9, 0, 115, 154, 10, 0, 14, 0, 171, 14, 0, 171, 174, 0, 172, 174, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 26, 0, 131, 132, 0, 6, 0, 134, 3, 0, 175, 134, 3, 0, 178, 0, 175, 0, 175, 178, 0, 176, 0, 114, 176, 116, 176, 133, 0, 9, 14, 174, 176, 0, 14, 174, 176, 0, 9, 174, 176, 0, 3, 176, 0, 52, 0, 53, 0, 54, 0, 55, 0, 56, 0, 57, 0, 58, 0, 59, 0, 60, 0, 61, 0, 62, 0, 81, 0, 82, 0, 17, 0, 18, 0, 83, 17, 0, 84, 17, 0, 83, 18, 0, 84, 18, 0, 99, 0, 100, 0, 83, 99, 0, 84, 99, 0, 83, 100, 0, 84, 100, 0, 101, 0, 103, 0, 102, 0, 4, 0, 5, 0, 169, 63, 0, 169, 64, 0, 169, 65, 0, 169, 66, 0, 169, 67, 0, 179, 119, 179, 0, 179, 120, 179, 0, 179, 121, 179, 0, 179, 122, 179, 0, 179, 123, 179, 0, 179, 125, 179, 0, 120, 179, 0, 114, 154, 133, 0, 68, 114, 154, 133, 0, 69, 114, 154, 133, 0, 70, 114, 154, 116, 154, 133, 0, 71, 114, 154, 133, 0, 72, 114, 154, 133, 0, 73, 114, 154, 133, 0, 74, 114, 154, 116, 154, 133, 0, 75, 114, 154, 116, 154, 133, 0, 76, 114, 154, 133, 0, 77, 114, 154, 133, 0, 77, 114, 133, 0, 78, 114, 154, 133, 0, 179, 117, 179, 0, 179, 97, 179, 0, 179, 118, 179, 0, 179, 98, 179, 0, 179, 96, 179, 0, 179, 95, 179, 0, 179, 93, 179, 0, 179, 94, 179, 0, 124, 179, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, 264, 266, 274, 279, 282, 286, 288, 291, 293, 296, 302, 315, 317, 319, 321, 323, 328, 333, 339, 342, 350, 357, 360, 362, 370, 373, 375, 382, 385, 391, 399, 402, 413, 414, 418, 421, 423, 427, 430, 450, 458, 460, 468, 472, 475, 478, 482, 485, 489, 496, 502, 504, 506, 508, 510, 512, 514, 519, 522, 524, 528, 544, 546, 554, 560, 566, 573, 576, 584, 587, 591, 596, 600, 604, 609, 616, 623, 630, 637, 642, 647, 654, 669, 681, 687, 693, 699, 705, 725, 732, 739, 746, 753, 760, 767, 774, 781, 788, 803, 816, 822, 829, 842, 848, 854, 860, 866, 871, 877, 896, 916, 921, 926, 931, 936, 941, 946, 951, 959, 970, 981, 992, 1003, 1009, 1016, 1021, 1031, 1038, 1062, 1065, 1073, 1076, 1081, 1086, 1091, 1096, 1103, 1105, 1108, 1111, 1115, 1118, 1124, 1130, 1136, 1144, 1156, 1160, 1168, 1171, 1178, 1181, 1185, 1203, 1222, 1225, 1227, 1229, 1231, 1233, 1235, 1237, 1239, 1243, 1248, 1255, 1263, 1267, 1274, 1279, 1285, 1291, 1297, 1303, 1311, 1314, 1316, 1318, 1320, 1322, 1324, 1326, 1328, 1330, 1332, 1334, 1336, 1338, 1340, 1342, 1344, 1346, 1348, 1350, 1352, 1354, 1356, 1358, 1360, 1362, 1364, 1366, 1370, 1380, 1382, 1389, 1396, 1403, 1410, 1417, 1419, 1421, 1423, 1432, 1441, 1456, 1458, 1460, 1470, 1480, 1495, 1505, 1515, 1525, 1527, 1529, 1531, 1533, 1539, 1541, 1543, 1545, 1547, 1549, 1551, 1553, 1555, 1557 }; #endif #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) static const char * const yytname[] = { "$","error","$undefined.","LABEL", "VARIABLE","NUMBER","TEXT","COMMAND_LINE","DELIMITED","ORDINAL","TH","LEFT_ARROW_HEAD", "RIGHT_ARROW_HEAD","DOUBLE_ARROW_HEAD","LAST","UP","DOWN","LEFT","RIGHT","BOX", "CIRCLE","ELLIPSE","ARC","LINE","ARROW","MOVE","SPLINE","HEIGHT","RADIUS","WIDTH", "DIAMETER","FROM","TO","AT","WITH","BY","THEN","DOTTED","DASHED","CHOP","SAME", "INVISIBLE","LJUST","RJUST","ABOVE","BELOW","OF","THE","WAY","BETWEEN","AND", "HERE","DOT_N","DOT_E","DOT_W","DOT_S","DOT_NE","DOT_SE","DOT_NW","DOT_SW","DOT_C", "DOT_START","DOT_END","DOT_X","DOT_Y","DOT_HT","DOT_WID","DOT_RAD","SIN","COS", "ATAN2","LOG","EXP","SQRT","K_MAX","K_MIN","INT","RAND","SRAND","COPY","THRU", "TOP","BOTTOM","UPPER","LOWER","SH","PRINT","CW","CCW","FOR","DO","IF","ELSE", "ANDAND","OROR","NOTEQUAL","EQUALEQUAL","LESSEQUAL","GREATEREQUAL","LEFT_CORNER", "RIGHT_CORNER","CENTER","END","START","RESET","UNTIL","PLOT","THICKNESS","FILL", "ALIGNED","SPRINTF","COMMAND","DEFINE","UNDEF","'('","'`'","','","'<'","'>'", "'+'","'-'","'*'","'/'","'%'","'!'","'^'","';'","'='","':'","'{'","'}'","'['", "']'","')'","'.'","top","element_list","middle_element_list","optional_separator", "separator","placeless_element","@1","@2","@3","@4","@5","@6","@7","reset_variables", "print_args","print_arg","simple_if","@8","until","any_expr","text_expr","optional_by", "element","@9","@10","optional_element","object_spec","@11","text","sprintf_args", "position","position_not_place","between","expr_pair","place","label","ordinal", "optional_ordinal_last","nth_primitive","object_type","label_path","relative_path", "path","corner","expr", NULL }; #endif static const short yyr1[] = { 0, 135, 135, 136, 137, 137, 138, 138, 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 140, 141, 140, 140, 142, 143, 140, 144, 145, 140, 146, 140, 140, 147, 140, 140, 140, 148, 148, 148, 149, 149, 150, 150, 150, 152, 151, 153, 153, 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 156, 156, 156, 157, 157, 157, 157, 158, 159, 157, 157, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 163, 163, 164, 164, 165, 165, 166, 166, 166, 166, 166, 166, 167, 167, 168, 168, 169, 169, 169, 169, 169, 170, 170, 170, 171, 171, 172, 172, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 176, 176, 176, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179 }; static const short yyr2[] = { 0, 1, 1, 3, 1, 3, 0, 1, 1, 2, 3, 4, 1, 1, 1, 1, 1, 2, 2, 0, 3, 2, 0, 0, 7, 0, 0, 6, 0, 10, 1, 0, 4, 1, 1, 2, 2, 3, 1, 2, 1, 1, 1, 0, 5, 0, 2, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 2, 0, 2, 3, 1, 4, 4, 4, 0, 0, 6, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 0, 4, 3, 3, 3, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 5, 0, 3, 1, 1, 1, 3, 3, 5, 5, 6, 1, 4, 3, 3, 1, 2, 2, 3, 1, 1, 1, 3, 1, 3, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 5, 4, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 3, 4, 4, 6, 4, 4, 4, 6, 6, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2 }; static const short yydefact[] = { 6, 8, 2, 1, 7, 0, 0, 125, 16, 12, 13, 14, 15, 71, 72, 73, 74, 75, 76, 77, 78, 0, 19, 0, 0, 0, 34, 0, 0, 0, 65, 82, 6, 68, 33, 30, 4, 61, 79, 9, 6, 0, 0, 21, 25, 0, 146, 203, 204, 149, 151, 188, 189, 145, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, 187, 0, 0, 194, 195, 200, 202, 201, 0, 0, 0, 0, 18, 38, 41, 42, 129, 131, 130, 141, 0, 0, 147, 0, 40, 0, 0, 0, 0, 48, 0, 0, 47, 35, 80, 0, 17, 6, 6, 3, 7, 36, 0, 31, 113, 114, 115, 89, 91, 95, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 103, 105, 109, 111, 112, 119, 120, 121, 122, 116, 117, 0, 107, 124, 118, 88, 0, 10, 0, 22, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 190, 192, 196, 198, 191, 193, 197, 199, 0, 0, 131, 47, 0, 216, 238, 39, 0, 0, 205, 206, 207, 208, 209, 0, 142, 163, 152, 155, 156, 157, 158, 159, 160, 161, 0, 153, 154, 0, 143, 0, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 238, 43, 0, 0, 0, 0, 0, 0, 0, 81, 127, 0, 0, 0, 5, 37, 0, 90, 92, 96, 94, 84, 85, 86, 87, 97, 0, 98, 99, 0, 0, 0, 0, 0, 167, 169, 100, 166, 0, 101, 0, 104, 106, 110, 123, 108, 146, 203, 188, 189, 62, 0, 63, 64, 11, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 217, 0, 140, 150, 132, 133, 148, 162, 144, 0, 236, 237, 235, 234, 231, 233, 139, 0, 230, 232, 210, 211, 212, 213, 214, 215, 0, 0, 0, 51, 52, 54, 55, 50, 49, 53, 236, 56, 237, 230, 0, 66, 83, 32, 174, 0, 0, 0, 0, 164, 0, 168, 0, 47, 23, 45, 218, 219, 0, 221, 222, 223, 0, 0, 226, 227, 229, 0, 0, 0, 0, 0, 44, 0, 126, 69, 0, 173, 172, 0, 165, 45, 0, 27, 0, 0, 0, 134, 138, 0, 135, 58, 128, 70, 67, 171, 0, 24, 46, 220, 224, 225, 136, 0, 0, 170, 0, 59, 28, 60, 0, 29, 0, 0, 0 }; static const short yydefgoto[] = { 411, 2, 32, 242, 4, 33, 45, 285, 380, 158, 354, 409, 246, 34, 89, 90, 35, 327, 382, 179, 106, 403, 36, 114, 374, 393, 37, 115, 107, 339, 92, 93, 227, 94, 108, 96, 97, 98, 99, 206, 264, 265, 266, 100, 109 }; static const short yypact[] = { -114, -32768,-32768, 677, -100, -104, -120,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 3,-32768, 899, 29, 1012, 43, 1450, -61, 899,-32768, -32768, -114,-32768, 9, -33,-32768, 786,-32768,-32768, -114, 1012, -66, -13,-32768, 61,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, -35, -32, -30, -2, 0, 16, 30, 36, 40, 45, 49,-32768,-32768, 70, 80,-32768, -32768,-32768,-32768,-32768, 1125, 1012, 1450, 1450, 899,-32768, -32768, -64,-32768,-32768, 172, 2045, 54, 267,-32768, 8, 2037, -5, 1012, 1012, 126, 48, 4, 172, 2113,-32768, 629, 66, 899, -114, -114,-32768, 649,-32768, 173,-32768, -32768,-32768,-32768, 1904, 1904, 1740, 1822, 1450, 1450, 1450, 1450, 1554, 1554, 1554, 302, 1658,-32768, 1904, 1904, 1904, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1450, 1904, -32768,-32768, 2122, 530,-32768, 1012,-32768, 175,-32768, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 408, 1012, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 74, -74, 79, 2070, 196, 92, 92,-32768, 1658, 1658,-32768,-32768, -32768,-32768,-32768, 220,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, 95,-32768,-32768, 18, 90, 193, -32768, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1554, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1554, 1450,-32768, 92, -32768, 1012, 1012, 19, 19, 1012, 1012, 1450,-32768,-32768, 113, 677, 112,-32768,-32768, 245, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, -64, 2037, -64, -64, 1977, 152, 267, 1977, 251, 1991,-32768,-32768,-32768, 1238,-32768, 1353, 2122, 2122, 2122, 2122, 2122, -104, -120, 2, 23,-32768, -64, 37, 155,-32768, 247,-32768, 136, 137, 160, 138, 145, 146, 164, 165, 149,-32768, 159, 163,-32768, 1554, -32768,-32768,-32768,-32768,-32768,-32768, 90, 250, 312, 217, 376, 376, 109, 109, 2122, -27, 327, 109, 125, 125, 92, 92, 92, 92, -34, 272, 291,-32768, 312, 208, 2131,-32768,-32768,-32768, 312, 208, 2131, 109, -113,-32768, -32768,-32768,-32768, 267, 1977, 1977, 186,-32768, 300,-32768, 79, 2080,-32768, 202,-32768,-32768, 1012,-32768,-32768,-32768, 1012, 1012,-32768,-32768,-32768, -82, 259, 1554, 1554, 1450, -32768, 1450,-32768, 677, 1977,-32768,-32768, 1977,-32768, 202, 303,-32768, 184, 185, 188,-32768,-32768, -79, -64, 592, 2122,-32768,-32768,-32768, 189,-32768,-32768,-32768,-32768,-32768, -32768, 1342, 233,-32768, 1450, 2122,-32768, 2122, 317,-32768, 326, 328,-32768 }; static const short yypgoto[] = {-32768, 73,-32768, 31, 297,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768, 301, -55,-32768,-32768, -49, 96, -85, -32768, -102,-32768,-32768,-32768,-32768,-32768, 7,-32768, -84, 178,-32768, -42, 6, -72,-32768,-32768,-32768, -93,-32768, -51,-32768, -78, -23 }; #define YYLAST 2256 static const short yytable[] = { 101, 180, -14, 372, 111, 207, 101, 41, 42, 43, 38, 46, 1, 118, 153, 244, 369, 49, 195, 229, 373, 46, 50, -15, 40, 7, 39, 49, 209, 95, 91, 3, 50, 102, 186, 95, 91, 187, 188, 401, 187, 188, 300, 181, 152, 187, 188, 110, 255, 257, 258, 386, 280, 112, 208, 187, 188, 267, 186, 120, 196, 156, 182, 116, 184, 185, 101, 157, 197, 159, 281, 154, 240, 198, 199, 200, 201, 202, 203, 160, 204, 230, 161, 44, 162, 187, 188, 171, 172, 368, 101, 95, 187, 188, 269, 95, 91, 175, 176, 234, 235, 247, 248, 249, 250, 251, 252, 253, 254, 256, 256, 256, 163, 270, 164, 271, 272, 273, 239, 95, 91, 105, 228, 86, 38, 119, 274, 275, -14, 28, 165, 256, -14, 86, -14, 316, 307, 155, 95, 95, 95, 232, 233, 325, 166, 303, 304, 328, 330, -15, 167, 334, 336, -15, 168, -15, -129, -129, 196, 169, 283, 38, 231, 170, 270, 270, 344, 345, 346, 173, 174, 198, 199, 200, 201, 202, 203, 245, 204, 177, 178, 267, 183, 286, 267, 205, 350, 241, 243, 309, 310, 311, 312, 313, 314, 315, 317, 318, 319, 320, 321, 322, 323, 324, 256, 326, 302, 299, 343, 329, 331, 347, 301, 335, 337, 338, 366, 226, 189, 190, 191, 192, 193, 305, 194, 95, 351, 306, 221, 222, 223, 224, 225, 95, 226, 189, 190, 191, 192, 193, 308, 332, 333, 340, 341, 352, 223, 224, 225, 38, 226, 375, 284, 342, 348, 353, 287, 288, 289, 290, 291, 292, 293, 294, 295, 297, 298, 267, 267, 355, 356, 358, 392, 196, -130, -130, 357, 256, 359, 360, 361, 362, 363, 205, 388, 389, 198, 199, 200, 201, 202, 203, 364, 204, 376, 377, 365, 267, 367, 371, 267, 232, 378, 379, 370, 259, 95, 381, 387, 397, 212, 260, 214, 215, 216, 217, 261, 398, 399, 51, 52, 400, 404, 407, 394, 410, 412, 395, 413, 117, 113, 396, 282, 0, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 256, 256, 390, 0, 391, 0, 0, 0, 0, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 212, 213, 214, 215, 216, 217, 0, 0, 210, 95, 95, 211, 0, 0, 406, 0, 38, 408, 76, 77, 78, 79, 0, 0, 238, 220, 221, 222, 223, 224, 225, 0, 226, 205, 0, 0, 80, 81, 82, 83, 84, 0, 214, 215, 216, 217, 46, 47, 48, 7, 0, 262, 49, 0, 0, 0, 0, 50, 0, 0, 51, 52, 0, 0, 238, 220, 221, 222, 223, 224, 225, 263, 226, 0, 0, 0, 0, 0, 0, 0, 0, 221, 222, 223, 224, 225, 0, 226, 383, 0, 0, 0, 384, 385, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 216, 217, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 104, 276, 277, 48, 7, 8, 0, 49, 0, 296, 0, 0, 50, 9, 10, 278, 279, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 21, 0, 76, 77, 78, 79, 22, 23, 0, 0, 24, 0, 25, 0, 0, 0, 0, 0, 402, 0, 80, 81, 82, 83, 84, 26, 7, 27, 0, 0, 0, 28, 29, 0, 0, 85, 86, 0, 0, 0, 0, 87, 0, 5, 6, 88, 7, 8, 0, 0, 30, 0, 31, 0, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 5, 6, 0, 7, 8, 212, 213, 214, 215, 216, 217, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 0, 0, 212, 213, 214, 215, 216, 217, 21, 0, 0, 0, 0, 0, 22, 23, 0, 0, 24, 28, 25, 0, 0, 0, 0, 0, 238, 220, 221, 222, 223, 224, 225, 26, 226, 27, 21, 0, 0, 28, 29, 0, 22, 23, 0, 0, 24, 0, 25, 0, 0, 0, 0, 0, 0, 39, 0, 0, 30, 0, 31, 26, 0, 27, 0, 0, 0, 28, 29, 46, 47, 48, 7, 0, 0, 49, 0, 121, 122, 123, 50, 124, 125, 126, 127, 0, 30, 0, 31, 0, 0, 0, 0, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 147, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 149, 150, 151, 28, 0, 0, 0, 103, 86, 46, 47, 48, 7, 87, 0, 49, 0, 88, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 85, 86, 46, 47, 48, 7, 87, 0, 49, 0, 88, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 103, 86, 46, 47, 48, 7, 87, 0, 49, 0, 104, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 85, 86, 46, 47, 48, 7, 87, 0, 49, 0, 104, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 46, 47, 48, 28, 0, 0, 49, 268, 86, 0, 0, 50, 0, 87, 51, 52, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 212, 213, 214, 215, 216, 217, 0, 46, 47, 48, 103, 86, 0, 49, 0, 0, 87, 405, 50, 0, 88, 51, 52, 218, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 46, 47, 48, 0, 0, 0, 49, 103, 86, 0, 0, 50, 0, 87, 51, 52, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 46, 47, 48, 0, 0, 0, 49, 85, 86, 0, 0, 50, 0, 87, 51, 52, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 46, 47, 48, 0, 0, 0, 49, 0, 0, 0, 0, 50, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 268, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, -188, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 46, 47, 48, 0, 0, 0, 49, 0, 0, 0, 0, 50, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, -189, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 46, 47, 48, 0, 0, 0, 49, 0, 0, 0, 0, 50, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 81, 82, 83, 84, 0, 0, 210, 0, 0, 211, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 263, 0, 0, 0, 0, 210, 0, 0, 211, 0, 0, 0, 0, 0, 349, 76, 77, 78, 79, 212, 213, 214, 215, 216, 217, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 218, 219, 220, 221, 222, 223, 224, 225, 0, 226, 236, 237, 214, 215, 216, 217, 0, 0, 0, 0, 236, 237, 214, 215, 216, 217, 194, 0, 0, 0, 0, 0, 0, 218, 219, 220, 221, 222, 223, 224, 225, 0, 226, 218, 238, 220, 221, 222, 223, 224, 225, 0, 226, 236, 237, 214, 215, 216, 217, 0, 0, 0, 212, 213, 214, 215, 216, 217, 0, 0, 0, 236, 0, 214, 215, 216, 217, 238, 220, 221, 222, 223, 224, 225, 0, 226, 238, 220, 221, 222, 223, 224, 225, 0, 226, 238, 220, 221, 222, 223, 224, 225, 0, 226 }; static const short yycheck[] = { 23, 85, 0, 116, 27, 98, 29, 127, 128, 6, 3, 3, 126, 4, 37, 117, 50, 9, 96, 104, 133, 3, 14, 0, 128, 6, 126, 9, 100, 23, 23, 0, 14, 4, 89, 29, 29, 119, 120, 118, 119, 120, 116, 85, 37, 119, 120, 4, 132, 133, 134, 133, 154, 114, 46, 119, 120, 135, 113, 92, 6, 127, 85, 32, 87, 88, 89, 80, 14, 8, 154, 40, 6, 19, 20, 21, 22, 23, 24, 114, 26, 104, 114, 80, 114, 119, 120, 17, 18, 116, 113, 85, 119, 120, 136, 89, 89, 17, 18, 95, 96, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 114, 136, 114, 138, 139, 140, 111, 113, 113, 25, 127, 115, 117, 116, 149, 150, 126, 110, 114, 154, 130, 115, 132, 219, 208, 41, 132, 133, 134, 93, 94, 227, 114, 187, 188, 232, 233, 126, 114, 236, 237, 130, 114, 132, 119, 120, 6, 114, 154, 154, 36, 114, 187, 188, 14, 260, 261, 99, 100, 19, 20, 21, 22, 23, 24, 4, 26, 99, 100, 259, 86, 8, 262, 131, 264, 114, 115, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 10, 133, 259, 232, 233, 262, 133, 236, 237, 238, 300, 125, 63, 64, 65, 66, 67, 3, 134, 219, 268, 132, 119, 120, 121, 122, 123, 227, 125, 63, 64, 65, 66, 67, 47, 234, 235, 130, 132, 268, 121, 122, 123, 242, 125, 344, 156, 8, 3, 8, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 345, 346, 133, 133, 133, 374, 6, 119, 120, 116, 300, 133, 133, 116, 116, 133, 131, 368, 369, 19, 20, 21, 22, 23, 24, 133, 26, 345, 346, 133, 375, 48, 8, 378, 93, 116, 3, 32, 3, 300, 105, 49, 6, 93, 9, 95, 96, 97, 98, 14, 133, 133, 17, 18, 133, 133, 90, 375, 8, 0, 378, 0, 32, 29, 380, 154, -1, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, 368, 369, 370, -1, 372, -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 93, 94, 95, 96, 97, 98, -1, -1, 46, 368, 369, 49, -1, -1, 402, -1, 374, 405, 81, 82, 83, 84, -1, -1, 117, 118, 119, 120, 121, 122, 123, -1, 125, 131, -1, -1, 99, 100, 101, 102, 103, -1, 95, 96, 97, 98, 3, 4, 5, 6, -1, 114, 9, -1, -1, -1, -1, 14, -1, -1, 17, 18, -1, -1, 117, 118, 119, 120, 121, 122, 123, 134, 125, -1, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, -1, 125, 357, -1, -1, -1, 361, 362, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, 97, 98, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, 3, 4, 5, 6, 7, -1, 9, -1, 133, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, -1, -1, 89, -1, 91, -1, -1, -1, -1, -1, 35, -1, 99, 100, 101, 102, 103, 104, 6, 106, -1, -1, -1, 110, 111, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, 3, 4, 124, 6, 7, -1, -1, 129, -1, 131, -1, -1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, 3, 4, -1, 6, 7, 93, 94, 95, 96, 97, 98, -1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, -1, -1, 93, 94, 95, 96, 97, 98, 79, -1, -1, -1, -1, -1, 85, 86, -1, -1, 89, 110, 91, -1, -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, 123, 104, 125, 106, 79, -1, -1, 110, 111, -1, 85, 86, -1, -1, 89, -1, 91, -1, -1, -1, -1, -1, -1, 126, -1, -1, 129, -1, 131, 104, -1, 106, -1, -1, -1, 110, 111, 3, 4, 5, 6, -1, -1, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, -1, 129, -1, 131, -1, -1, -1, -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, 87, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 107, 108, 109, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 3, 4, 5, 110, -1, -1, 9, 114, 115, -1, -1, 14, -1, 120, 17, 18, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, 93, 94, 95, 96, 97, 98, -1, 3, 4, 5, 114, 115, -1, 9, -1, -1, 120, 121, 14, -1, 124, 17, 18, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 3, 4, 5, -1, -1, -1, 9, 114, 115, -1, -1, 14, -1, 120, 17, 18, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 3, 4, 5, -1, -1, -1, 9, 114, 115, -1, -1, 14, -1, 120, 17, 18, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 14, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, 46, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 14, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, 46, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 14, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, 82, 83, 84, 99, 100, 101, 102, 103, -1, -1, 46, -1, -1, 49, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, 134, -1, -1, -1, -1, 46, -1, -1, 49, -1, -1, -1, -1, -1, 134, 81, 82, 83, 84, 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, 93, 94, 95, 96, 97, 98, 134, -1, -1, -1, -1, -1, -1, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, 93, 94, 95, 96, 97, 98, -1, -1, -1, 93, 94, 95, 96, 97, 98, -1, -1, -1, 93, -1, 95, 96, 97, 98, 117, 118, 119, 120, 121, 122, 123, -1, 125, 117, 118, 119, 120, 121, 122, 123, -1, 125, 117, 118, 119, 120, 121, 122, 123, -1, 125 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/local/share/bison.simple" /* This file comes from bison-1.28. */ /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ #ifndef YYSTACK_USE_ALLOCA #ifdef alloca #define YYSTACK_USE_ALLOCA #else /* alloca not defined */ #ifdef __GNUC__ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #else /* not GNU C. */ #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) #define YYSTACK_USE_ALLOCA #include #else /* not sparc */ /* We think this test detects Watcom and Microsoft C. */ /* This used to test MSDOS, but that is a bad idea since that symbol is in the user namespace. */ #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) #if 0 /* No need for malloc.h, which pollutes the namespace; instead, just don't use alloca. */ #include #endif #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) /* I don't know what this was needed for, but it pollutes the namespace. So I turned it off. rms, 2 May 1997. */ /* #include */ #pragma alloca #define YYSTACK_USE_ALLOCA #else /* not MSDOS, or __TURBOC__, or _AIX */ #if 0 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, and on HPUX 10. Eventually we can turn this on. */ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #endif /* __hpux */ #endif #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ #endif /* not sparc */ #endif /* not GNU C */ #endif /* alloca not defined */ #endif /* YYSTACK_USE_ALLOCA not defined */ #ifdef YYSTACK_USE_ALLOCA #define YYSTACK_ALLOC alloca #else #define YYSTACK_ALLOC malloc #endif /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { yychar = (token), yylval = (value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 #ifndef YYPURE #define YYLEX yylex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else #define YYLEX yylex(&yylval, &yylloc) #endif #else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, YYLEX_PARAM) #else #define YYLEX yylex(&yylval) #endif #endif /* not YYLSP_NEEDED */ #endif /* If nonreentrant, generate the variables here */ #ifndef YYPURE int yychar; /* the lookahead symbol */ YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */ #ifdef YYLSP_NEEDED YYLTYPE yylloc; /* location data for the lookahead */ /* symbol */ #endif int yynerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 int yydebug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif /* YYINITDEPTH indicates the initial size of the parser's stacks */ #ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif /* YYMAXDEPTH is the maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */ #if YYMAXDEPTH == 0 #undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif /* Define __yy_memcpy. Note that the size argument should be passed with type unsigned int, because that is what the non-GCC definitions require. With GCC, __builtin_memcpy takes an arg of type size_t, but it can handle unsigned int. */ #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (to, from, count) char *to; char *from; unsigned int count; { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #else /* __cplusplus */ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (char *to, char *from, unsigned int count) { register char *t = to; register char *f = from; register int i = count; while (i-- > 0) *t++ = *f++; } #endif #endif #line 217 "/usr/local/share/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM #ifdef __cplusplus #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM #define YYPARSE_PARAM_DECL #else /* not __cplusplus */ #define YYPARSE_PARAM_ARG YYPARSE_PARAM #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; #endif /* not __cplusplus */ #else /* not YYPARSE_PARAM */ #define YYPARSE_PARAM_ARG #define YYPARSE_PARAM_DECL #endif /* not YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ #ifdef YYPARSE_PARAM int yyparse (void *); #else int yyparse (void); #endif #endif int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { register int yystate; register int yyn; register short *yyssp; register YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1 = 0; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else #define YYPOPSTACK (yyvsp--, yyssp--) #endif int yystacksize = YYINITDEPTH; int yyfree_stacks = 0; #ifdef YYPURE int yychar; YYSTYPE yylval; int yynerrs; #ifdef YYLSP_NEEDED YYLTYPE yylloc; #endif #endif YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ int yylen; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Starting parse\n"); #endif yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss - 1; yyvsp = yyvs; #ifdef YYLSP_NEEDED yylsp = yyls; #endif /* Push a new state, which is found in yystate . */ /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yynewstate: *++yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Give user a chance to reallocate the stack */ /* Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; #ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls; #endif /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1; #ifdef yyoverflow /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yyls1, size * sizeof (*yylsp), &yystacksize); #else yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; #ifdef YYLSP_NEEDED yyls = yyls1; #endif #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; #ifndef YYSTACK_USE_ALLOCA yyfree_stacks = 1; #endif yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss, (char *)yyss1, size * (unsigned int) sizeof (*yyssp)); yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls, (char *)yyls1, size * (unsigned int) sizeof (*yylsp)); #endif #endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1; #ifdef YYLSP_NEEDED yylsp = yyls + size - 1; #endif #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) YYABORT; } #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate); #endif goto yybackup; yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Reading a token: "); #endif yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Now at end of input.\n"); #endif } else { yychar1 = YYTRANSLATE(yychar); #if YYDEBUG != 0 if (yydebug) { fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ #ifdef YYPRINT YYPRINT (stderr, yychar, yylval); #endif fprintf (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif /* count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /* Do the default action for the current state. */ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; /* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: yylen = yyr2[yyn]; if (yylen > 0) yyval = yyvsp[1-yylen]; /* implement default value of the action */ #if YYDEBUG != 0 if (yydebug) { int i; fprintf (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 2: #line 267 "gram.yy" { if (olist.head) print_picture(olist.head); ; break;} case 3: #line 276 "gram.yy" { yyval.pl = yyvsp[-1].pl; ; break;} case 4: #line 281 "gram.yy" { yyval.pl = yyvsp[0].pl; ; break;} case 5: #line 283 "gram.yy" { yyval.pl = yyvsp[-2].pl; ; break;} case 10: #line 298 "gram.yy" { define_variable(yyvsp[-2].str, yyvsp[0].x); a_delete yyvsp[-2].str; ; break;} case 11: #line 303 "gram.yy" { place *p = lookup_label(yyvsp[-3].str); if (!p) { lex_error("variable `%1' not defined", yyvsp[-3].str); YYABORT; } p->obj = 0; p->x = yyvsp[0].x; p->y = 0.0; a_delete yyvsp[-3].str; ; break;} case 12: #line 316 "gram.yy" { current_direction = UP_DIRECTION; ; break;} case 13: #line 318 "gram.yy" { current_direction = DOWN_DIRECTION; ; break;} case 14: #line 320 "gram.yy" { current_direction = LEFT_DIRECTION; ; break;} case 15: #line 322 "gram.yy" { current_direction = RIGHT_DIRECTION; ; break;} case 16: #line 324 "gram.yy" { olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno)); ; break;} case 17: #line 329 "gram.yy" { olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno)); ; break;} case 18: #line 334 "gram.yy" { fprintf(stderr, "%s\n", yyvsp[0].lstr.str); a_delete yyvsp[0].lstr.str; fflush(stderr); ; break;} case 19: #line 340 "gram.yy" { delim_flag = 1; ; break;} case 20: #line 342 "gram.yy" { delim_flag = 0; if (safer_flag) lex_error("unsafe to run command `%1'", yyvsp[0].str); else system(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 21: #line 351 "gram.yy" { if (yychar < 0) do_lookahead(); do_copy(yyvsp[0].lstr.str); // do not delete the filename ; break;} case 22: #line 358 "gram.yy" { delim_flag = 2; ; break;} case 23: #line 360 "gram.yy" { delim_flag = 0; ; break;} case 24: #line 362 "gram.yy" { if (yychar < 0) do_lookahead(); copy_file_thru(yyvsp[-5].lstr.str, yyvsp[-2].str, yyvsp[0].str); // do not delete the filename a_delete yyvsp[-2].str; a_delete yyvsp[0].str; ; break;} case 25: #line 371 "gram.yy" { delim_flag = 2; ; break;} case 26: #line 373 "gram.yy" { delim_flag = 0; ; break;} case 27: #line 375 "gram.yy" { if (yychar < 0) do_lookahead(); copy_rest_thru(yyvsp[-2].str, yyvsp[0].str); a_delete yyvsp[-2].str; a_delete yyvsp[0].str; ; break;} case 28: #line 383 "gram.yy" { delim_flag = 1; ; break;} case 29: #line 385 "gram.yy" { delim_flag = 0; if (yychar < 0) do_lookahead(); do_for(yyvsp[-8].str, yyvsp[-6].x, yyvsp[-4].x, yyvsp[-3].by.is_multiplicative, yyvsp[-3].by.val, yyvsp[0].str); ; break;} case 30: #line 392 "gram.yy" { if (yychar < 0) do_lookahead(); if (yyvsp[0].if_data.x != 0.0) push_body(yyvsp[0].if_data.body); a_delete yyvsp[0].if_data.body; ; break;} case 31: #line 400 "gram.yy" { delim_flag = 1; ; break;} case 32: #line 402 "gram.yy" { delim_flag = 0; if (yychar < 0) do_lookahead(); if (yyvsp[-3].if_data.x != 0.0) push_body(yyvsp[-3].if_data.body); else push_body(yyvsp[0].str); a_delete yyvsp[-3].if_data.body; a_delete yyvsp[0].str; ; break;} case 34: #line 415 "gram.yy" { define_variable("scale", 1.0); ; break;} case 35: #line 420 "gram.yy" { reset(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 36: #line 422 "gram.yy" { reset(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 37: #line 424 "gram.yy" { reset(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 38: #line 429 "gram.yy" { yyval.lstr = yyvsp[0].lstr; ; break;} case 39: #line 431 "gram.yy" { yyval.lstr.str = new char[strlen(yyvsp[-1].lstr.str) + strlen(yyvsp[0].lstr.str) + 1]; strcpy(yyval.lstr.str, yyvsp[-1].lstr.str); strcat(yyval.lstr.str, yyvsp[0].lstr.str); a_delete yyvsp[-1].lstr.str; a_delete yyvsp[0].lstr.str; if (yyvsp[-1].lstr.filename) { yyval.lstr.filename = yyvsp[-1].lstr.filename; yyval.lstr.lineno = yyvsp[-1].lstr.lineno; } else if (yyvsp[0].lstr.filename) { yyval.lstr.filename = yyvsp[0].lstr.filename; yyval.lstr.lineno = yyvsp[0].lstr.lineno; } ; break;} case 40: #line 452 "gram.yy" { yyval.lstr.str = new char[GDIGITS + 1]; sprintf(yyval.lstr.str, "%g", yyvsp[0].x); yyval.lstr.filename = 0; yyval.lstr.lineno = 0; ; break;} case 41: #line 459 "gram.yy" { yyval.lstr = yyvsp[0].lstr; ; break;} case 42: #line 461 "gram.yy" { yyval.lstr.str = new char[GDIGITS + 2 + GDIGITS + 1]; sprintf(yyval.lstr.str, "%g, %g", yyvsp[0].pair.x, yyvsp[0].pair.y); yyval.lstr.filename = 0; yyval.lstr.lineno = 0; ; break;} case 43: #line 470 "gram.yy" { delim_flag = 1; ; break;} case 44: #line 472 "gram.yy" { delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; ; break;} case 45: #line 477 "gram.yy" { yyval.str = 0; ; break;} case 46: #line 479 "gram.yy" { yyval.str = yyvsp[0].lstr.str; ; break;} case 47: #line 484 "gram.yy" { yyval.x = yyvsp[0].x; ; break;} case 48: #line 486 "gram.yy" { yyval.x = yyvsp[0].x; ; break;} case 49: #line 491 "gram.yy" { yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) == 0; a_delete yyvsp[-2].lstr.str; a_delete yyvsp[0].lstr.str; ; break;} case 50: #line 497 "gram.yy" { yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) != 0; a_delete yyvsp[-2].lstr.str; a_delete yyvsp[0].lstr.str; ; break;} case 51: #line 503 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 52: #line 505 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 53: #line 507 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 54: #line 509 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 55: #line 511 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 56: #line 513 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 57: #line 515 "gram.yy" { yyval.x = (yyvsp[0].x == 0.0); ; break;} case 58: #line 521 "gram.yy" { yyval.by.val = 1.0; yyval.by.is_multiplicative = 0; ; break;} case 59: #line 523 "gram.yy" { yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 0; ; break;} case 60: #line 525 "gram.yy" { yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 1; ; break;} case 61: #line 530 "gram.yy" { yyval.pl.obj = yyvsp[0].spec->make_object(¤t_position, ¤t_direction); if (yyval.pl.obj == 0) YYABORT; delete yyvsp[0].spec; if (yyval.pl.obj) olist.append(yyval.pl.obj); else { yyval.pl.x = current_position.x; yyval.pl.y = current_position.y; } ; break;} case 62: #line 545 "gram.yy" { yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ; break;} case 63: #line 547 "gram.yy" { yyval.pl.obj = 0; yyval.pl.x = yyvsp[0].pair.x; yyval.pl.y = yyvsp[0].pair.y; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ; break;} case 64: #line 555 "gram.yy" { yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ; break;} case 65: #line 561 "gram.yy" { yyval.state.x = current_position.x; yyval.state.y = current_position.y; yyval.state.dir = current_direction; ; break;} case 66: #line 567 "gram.yy" { current_position.x = yyvsp[-2].state.x; current_position.y = yyvsp[-2].state.y; current_direction = yyvsp[-2].state.dir; ; break;} case 67: #line 573 "gram.yy" { yyval.pl = yyvsp[-3].pl; ; break;} case 68: #line 577 "gram.yy" { yyval.pl.obj = 0; yyval.pl.x = current_position.x; yyval.pl.y = current_position.y; ; break;} case 69: #line 586 "gram.yy" {; break;} case 70: #line 588 "gram.yy" {; break;} case 71: #line 593 "gram.yy" { yyval.spec = new object_spec(BOX_OBJECT); ; break;} case 72: #line 597 "gram.yy" { yyval.spec = new object_spec(CIRCLE_OBJECT); ; break;} case 73: #line 601 "gram.yy" { yyval.spec = new object_spec(ELLIPSE_OBJECT); ; break;} case 74: #line 605 "gram.yy" { yyval.spec = new object_spec(ARC_OBJECT); yyval.spec->dir = current_direction; ; break;} case 75: #line 610 "gram.yy" { yyval.spec = new object_spec(LINE_OBJECT); lookup_variable("lineht", & yyval.spec->segment_height); lookup_variable("linewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 76: #line 617 "gram.yy" { yyval.spec = new object_spec(ARROW_OBJECT); lookup_variable("lineht", & yyval.spec->segment_height); lookup_variable("linewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 77: #line 624 "gram.yy" { yyval.spec = new object_spec(MOVE_OBJECT); lookup_variable("moveht", & yyval.spec->segment_height); lookup_variable("movewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 78: #line 631 "gram.yy" { yyval.spec = new object_spec(SPLINE_OBJECT); lookup_variable("lineht", & yyval.spec->segment_height); lookup_variable("linewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 79: #line 638 "gram.yy" { yyval.spec = new object_spec(TEXT_OBJECT); yyval.spec->text = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno); ; break;} case 80: #line 643 "gram.yy" { yyval.spec = new object_spec(TEXT_OBJECT); yyval.spec->text = new text_item(format_number(0, yyvsp[0].x), 0, -1); ; break;} case 81: #line 648 "gram.yy" { yyval.spec = new object_spec(TEXT_OBJECT); yyval.spec->text = new text_item(format_number(yyvsp[0].lstr.str, yyvsp[-1].x), yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno); a_delete yyvsp[0].lstr.str; ; break;} case 82: #line 655 "gram.yy" { saved_state *p = new saved_state; yyval.pstate = p; p->x = current_position.x; p->y = current_position.y; p->dir = current_direction; p->tbl = current_table; p->prev = current_saved_state; current_position.x = 0.0; current_position.y = 0.0; current_table = new PTABLE(place); current_saved_state = p; olist.append(make_mark_object()); ; break;} case 83: #line 670 "gram.yy" { current_position.x = yyvsp[-2].pstate->x; current_position.y = yyvsp[-2].pstate->y; current_direction = yyvsp[-2].pstate->dir; yyval.spec = new object_spec(BLOCK_OBJECT); olist.wrap_up_block(& yyval.spec->oblist); yyval.spec->tbl = current_table; current_table = yyvsp[-2].pstate->tbl; current_saved_state = yyvsp[-2].pstate->prev; delete yyvsp[-2].pstate; ; break;} case 84: #line 682 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->height = yyvsp[0].x; yyval.spec->flags |= HAS_HEIGHT; ; break;} case 85: #line 688 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->radius = yyvsp[0].x; yyval.spec->flags |= HAS_RADIUS; ; break;} case 86: #line 694 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->width = yyvsp[0].x; yyval.spec->flags |= HAS_WIDTH; ; break;} case 87: #line 700 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->radius = yyvsp[0].x/2.0; yyval.spec->flags |= HAS_RADIUS; ; break;} case 88: #line 706 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= HAS_SEGMENT; switch (yyval.spec->dir) { case UP_DIRECTION: yyval.spec->segment_pos.y += yyvsp[0].x; break; case DOWN_DIRECTION: yyval.spec->segment_pos.y -= yyvsp[0].x; break; case RIGHT_DIRECTION: yyval.spec->segment_pos.x += yyvsp[0].x; break; case LEFT_DIRECTION: yyval.spec->segment_pos.x -= yyvsp[0].x; break; } ; break;} case 89: #line 726 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = UP_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y += yyval.spec->segment_height; ; break;} case 90: #line 733 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = UP_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y += yyvsp[0].x; ; break;} case 91: #line 740 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = DOWN_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y -= yyval.spec->segment_height; ; break;} case 92: #line 747 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = DOWN_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y -= yyvsp[0].x; ; break;} case 93: #line 754 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = RIGHT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x += yyval.spec->segment_width; ; break;} case 94: #line 761 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = RIGHT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x += yyvsp[0].x; ; break;} case 95: #line 768 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = LEFT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x -= yyval.spec->segment_width; ; break;} case 96: #line 775 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = LEFT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x -= yyvsp[0].x; ; break;} case 97: #line 782 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_FROM; yyval.spec->from.x = yyvsp[0].pair.x; yyval.spec->from.y = yyvsp[0].pair.y; ; break;} case 98: #line 789 "gram.yy" { yyval.spec = yyvsp[-2].spec; if (yyval.spec->flags & HAS_SEGMENT) yyval.spec->segment_list = new segment(yyval.spec->segment_pos, yyval.spec->segment_is_absolute, yyval.spec->segment_list); yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x = yyvsp[0].pair.x; yyval.spec->segment_pos.y = yyvsp[0].pair.y; yyval.spec->segment_is_absolute = 1; yyval.spec->flags |= HAS_TO; yyval.spec->to.x = yyvsp[0].pair.x; yyval.spec->to.y = yyvsp[0].pair.y; ; break;} case 99: #line 804 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_AT; yyval.spec->at.x = yyvsp[0].pair.x; yyval.spec->at.y = yyvsp[0].pair.y; if (yyval.spec->type != ARC_OBJECT) { yyval.spec->flags |= HAS_FROM; yyval.spec->from.x = yyvsp[0].pair.x; yyval.spec->from.y = yyvsp[0].pair.y; } ; break;} case 100: #line 817 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_WITH; yyval.spec->with = yyvsp[0].pth; ; break;} case 101: #line 823 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x += yyvsp[0].pair.x; yyval.spec->segment_pos.y += yyvsp[0].pair.y; ; break;} case 102: #line 830 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->flags & HAS_SEGMENT) { yyval.spec->segment_list = new segment(yyval.spec->segment_pos, yyval.spec->segment_is_absolute, yyval.spec->segment_list); yyval.spec->flags &= ~HAS_SEGMENT; yyval.spec->segment_pos.x = yyval.spec->segment_pos.y = 0.0; yyval.spec->segment_is_absolute = 0; } ; break;} case 103: #line 843 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_DOTTED; lookup_variable("dashwid", & yyval.spec->dash_width); ; break;} case 104: #line 849 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= IS_DOTTED; yyval.spec->dash_width = yyvsp[0].x; ; break;} case 105: #line 855 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_DASHED; lookup_variable("dashwid", & yyval.spec->dash_width); ; break;} case 106: #line 861 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= IS_DASHED; yyval.spec->dash_width = yyvsp[0].x; ; break;} case 107: #line 867 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_DEFAULT_FILLED; ; break;} case 108: #line 872 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= IS_FILLED; yyval.spec->fill = yyvsp[0].x; ; break;} case 109: #line 878 "gram.yy" { yyval.spec = yyvsp[-1].spec; // line chop chop means line chop 0 chop 0 if (yyval.spec->flags & IS_DEFAULT_CHOPPED) { yyval.spec->flags |= IS_CHOPPED; yyval.spec->flags &= ~IS_DEFAULT_CHOPPED; yyval.spec->start_chop = yyval.spec->end_chop = 0.0; } else if (yyval.spec->flags & IS_CHOPPED) { yyval.spec->end_chop = 0.0; } else { yyval.spec->flags |= IS_DEFAULT_CHOPPED; } ; break;} case 110: #line 897 "gram.yy" { yyval.spec = yyvsp[-2].spec; if (yyval.spec->flags & IS_DEFAULT_CHOPPED) { yyval.spec->flags |= IS_CHOPPED; yyval.spec->flags &= ~IS_DEFAULT_CHOPPED; yyval.spec->start_chop = 0.0; yyval.spec->end_chop = yyvsp[0].x; } else if (yyval.spec->flags & IS_CHOPPED) { yyval.spec->end_chop = yyvsp[0].x; } else { yyval.spec->start_chop = yyval.spec->end_chop = yyvsp[0].x; yyval.spec->flags |= IS_CHOPPED; } ; break;} case 111: #line 917 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_SAME; ; break;} case 112: #line 922 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_INVISIBLE; ; break;} case 113: #line 927 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= HAS_LEFT_ARROW_HEAD; ; break;} case 114: #line 932 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= HAS_RIGHT_ARROW_HEAD; ; break;} case 115: #line 937 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD); ; break;} case 116: #line 942 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_CLOCKWISE; ; break;} case 117: #line 947 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags &= ~IS_CLOCKWISE; ; break;} case 118: #line 952 "gram.yy" { yyval.spec = yyvsp[-1].spec; text_item **p; for (p = & yyval.spec->text; *p; p = &(*p)->next) ; *p = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno); ; break;} case 119: #line 960 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.h = LEFT_ADJUST; } ; break;} case 120: #line 971 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.h = RIGHT_ADJUST; } ; break;} case 121: #line 982 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.v = ABOVE_ADJUST; } ; break;} case 122: #line 993 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.v = BELOW_ADJUST; } ; break;} case 123: #line 1004 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_THICKNESS; yyval.spec->thickness = yyvsp[0].x; ; break;} case 124: #line 1010 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_ALIGNED; ; break;} case 125: #line 1018 "gram.yy" { yyval.lstr = yyvsp[0].lstr; ; break;} case 126: #line 1022 "gram.yy" { yyval.lstr.filename = yyvsp[-2].lstr.filename; yyval.lstr.lineno = yyvsp[-2].lstr.lineno; yyval.lstr.str = do_sprintf(yyvsp[-2].lstr.str, yyvsp[-1].dv.v, yyvsp[-1].dv.nv); a_delete yyvsp[-1].dv.v; a_delete yyvsp[-2].lstr.str; ; break;} case 127: #line 1033 "gram.yy" { yyval.dv.v = 0; yyval.dv.nv = 0; yyval.dv.maxv = 0; ; break;} case 128: #line 1039 "gram.yy" { yyval.dv = yyvsp[-2].dv; if (yyval.dv.nv >= yyval.dv.maxv) { if (yyval.dv.nv == 0) { yyval.dv.v = new double[4]; yyval.dv.maxv = 4; } else { double *oldv = yyval.dv.v; yyval.dv.maxv *= 2; yyval.dv.v = new double[yyval.dv.maxv]; memcpy(yyval.dv.v, oldv, yyval.dv.nv*sizeof(double)); a_delete oldv; } } yyval.dv.v[yyval.dv.nv] = yyvsp[0].x; yyval.dv.nv += 1; ; break;} case 129: #line 1064 "gram.yy" { yyval.pair = yyvsp[0].pair; ; break;} case 130: #line 1066 "gram.yy" { position pos = yyvsp[0].pl; yyval.pair.x = pos.x; yyval.pair.y = pos.y; ; break;} case 131: #line 1075 "gram.yy" { yyval.pair = yyvsp[0].pair; ; break;} case 132: #line 1077 "gram.yy" { yyval.pair.x = yyvsp[-2].pair.x + yyvsp[0].pair.x; yyval.pair.y = yyvsp[-2].pair.y + yyvsp[0].pair.y; ; break;} case 133: #line 1082 "gram.yy" { yyval.pair.x = yyvsp[-2].pair.x - yyvsp[0].pair.x; yyval.pair.y = yyvsp[-2].pair.y - yyvsp[0].pair.y; ; break;} case 134: #line 1087 "gram.yy" { yyval.pair.x = yyvsp[-3].pair.x; yyval.pair.y = yyvsp[-1].pair.y; ; break;} case 135: #line 1092 "gram.yy" { yyval.pair.x = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.x + yyvsp[-4].x*yyvsp[0].pair.x; yyval.pair.y = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.y + yyvsp[-4].x*yyvsp[0].pair.y; ; break;} case 136: #line 1097 "gram.yy" { yyval.pair.x = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.x + yyvsp[-5].x*yyvsp[-1].pair.x; yyval.pair.y = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.y + yyvsp[-5].x*yyvsp[-1].pair.y; ; break;} case 139: #line 1110 "gram.yy" { yyval.pair.x = yyvsp[-2].x; yyval.pair.y = yyvsp[0].x; ; break;} case 140: #line 1112 "gram.yy" { yyval.pair = yyvsp[-1].pair; ; break;} case 141: #line 1117 "gram.yy" { yyval.pl = yyvsp[0].pl; ; break;} case 142: #line 1119 "gram.yy" { path pth(yyvsp[0].crn); if (!pth.follow(yyvsp[-1].pl, & yyval.pl)) YYABORT; ; break;} case 143: #line 1125 "gram.yy" { path pth(yyvsp[-1].crn); if (!pth.follow(yyvsp[0].pl, & yyval.pl)) YYABORT; ; break;} case 144: #line 1131 "gram.yy" { path pth(yyvsp[-2].crn); if (!pth.follow(yyvsp[0].pl, & yyval.pl)) YYABORT; ; break;} case 145: #line 1137 "gram.yy" { yyval.pl.x = current_position.x; yyval.pl.y = current_position.y; yyval.pl.obj = 0; ; break;} case 146: #line 1146 "gram.yy" { place *p = lookup_label(yyvsp[0].str); if (!p) { lex_error("there is no place `%1'", yyvsp[0].str); YYABORT; } yyval.pl = *p; a_delete yyvsp[0].str; ; break;} case 147: #line 1157 "gram.yy" { yyval.pl.obj = yyvsp[0].obj; ; break;} case 148: #line 1161 "gram.yy" { path pth(yyvsp[0].str); if (!pth.follow(yyvsp[-2].pl, & yyval.pl)) YYABORT; ; break;} case 149: #line 1170 "gram.yy" { yyval.n = yyvsp[0].n; ; break;} case 150: #line 1172 "gram.yy" { // XXX Check for overflow (and non-integers?). yyval.n = (int)yyvsp[-1].x; ; break;} case 151: #line 1180 "gram.yy" { yyval.n = 1; ; break;} case 152: #line 1182 "gram.yy" { yyval.n = yyvsp[-1].n; ; break;} case 153: #line 1187 "gram.yy" { int count = 0; object *p; for (p = olist.head; p != 0; p = p->next) if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) { yyval.obj = p; break; } if (p == 0) { lex_error("there is no %1%2 %3", yyvsp[-1].n, ordinal_postfix(yyvsp[-1].n), object_type_name(yyvsp[0].obtype)); YYABORT; } ; break;} case 154: #line 1204 "gram.yy" { int count = 0; object *p; for (p = olist.tail; p != 0; p = p->prev) if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) { yyval.obj = p; break; } if (p == 0) { lex_error("there is no %1%2 last %3", yyvsp[-1].n, ordinal_postfix(yyvsp[-1].n), object_type_name(yyvsp[0].obtype)); YYABORT; } ; break;} case 155: #line 1224 "gram.yy" { yyval.obtype = BOX_OBJECT; ; break;} case 156: #line 1226 "gram.yy" { yyval.obtype = CIRCLE_OBJECT; ; break;} case 157: #line 1228 "gram.yy" { yyval.obtype = ELLIPSE_OBJECT; ; break;} case 158: #line 1230 "gram.yy" { yyval.obtype = ARC_OBJECT; ; break;} case 159: #line 1232 "gram.yy" { yyval.obtype = LINE_OBJECT; ; break;} case 160: #line 1234 "gram.yy" { yyval.obtype = ARROW_OBJECT; ; break;} case 161: #line 1236 "gram.yy" { yyval.obtype = SPLINE_OBJECT; ; break;} case 162: #line 1238 "gram.yy" { yyval.obtype = BLOCK_OBJECT; ; break;} case 163: #line 1240 "gram.yy" { yyval.obtype = TEXT_OBJECT; ; break;} case 164: #line 1245 "gram.yy" { yyval.pth = new path(yyvsp[0].str); ; break;} case 165: #line 1249 "gram.yy" { yyval.pth = yyvsp[-2].pth; yyval.pth->append(yyvsp[0].str); ; break;} case 166: #line 1257 "gram.yy" { yyval.pth = new path(yyvsp[0].crn); ; break;} case 167: #line 1264 "gram.yy" { yyval.pth = yyvsp[0].pth; ; break;} case 168: #line 1268 "gram.yy" { yyval.pth = yyvsp[-1].pth; yyval.pth->append(yyvsp[0].crn); ; break;} case 169: #line 1276 "gram.yy" { yyval.pth = yyvsp[0].pth; ; break;} case 170: #line 1280 "gram.yy" { yyval.pth = yyvsp[-3].pth; yyval.pth->set_ypath(yyvsp[-1].pth); ; break;} case 171: #line 1286 "gram.yy" { lex_warning("`%1%2 last %3' in `with' argument ignored", yyvsp[-3].n, ordinal_postfix(yyvsp[-3].n), object_type_name(yyvsp[-1].obtype)); yyval.pth = yyvsp[0].pth; ; break;} case 172: #line 1292 "gram.yy" { lex_warning("`last %1' in `with' argument ignored", object_type_name(yyvsp[-1].obtype)); yyval.pth = yyvsp[0].pth; ; break;} case 173: #line 1298 "gram.yy" { lex_warning("`%1%2 %3' in `with' argument ignored", yyvsp[-2].n, ordinal_postfix(yyvsp[-2].n), object_type_name(yyvsp[-1].obtype)); yyval.pth = yyvsp[0].pth; ; break;} case 174: #line 1304 "gram.yy" { lex_warning("initial `%1' in `with' argument ignored", yyvsp[-1].str); a_delete yyvsp[-1].str; yyval.pth = yyvsp[0].pth; ; break;} case 175: #line 1313 "gram.yy" { yyval.crn = &object::north; ; break;} case 176: #line 1315 "gram.yy" { yyval.crn = &object::east; ; break;} case 177: #line 1317 "gram.yy" { yyval.crn = &object::west; ; break;} case 178: #line 1319 "gram.yy" { yyval.crn = &object::south; ; break;} case 179: #line 1321 "gram.yy" { yyval.crn = &object::north_east; ; break;} case 180: #line 1323 "gram.yy" { yyval.crn = &object:: south_east; ; break;} case 181: #line 1325 "gram.yy" { yyval.crn = &object::north_west; ; break;} case 182: #line 1327 "gram.yy" { yyval.crn = &object::south_west; ; break;} case 183: #line 1329 "gram.yy" { yyval.crn = &object::center; ; break;} case 184: #line 1331 "gram.yy" { yyval.crn = &object::start; ; break;} case 185: #line 1333 "gram.yy" { yyval.crn = &object::end; ; break;} case 186: #line 1335 "gram.yy" { yyval.crn = &object::north; ; break;} case 187: #line 1337 "gram.yy" { yyval.crn = &object::south; ; break;} case 188: #line 1339 "gram.yy" { yyval.crn = &object::west; ; break;} case 189: #line 1341 "gram.yy" { yyval.crn = &object::east; ; break;} case 190: #line 1343 "gram.yy" { yyval.crn = &object::north_west; ; break;} case 191: #line 1345 "gram.yy" { yyval.crn = &object::south_west; ; break;} case 192: #line 1347 "gram.yy" { yyval.crn = &object::north_east; ; break;} case 193: #line 1349 "gram.yy" { yyval.crn = &object::south_east; ; break;} case 194: #line 1351 "gram.yy" { yyval.crn = &object::west; ; break;} case 195: #line 1353 "gram.yy" { yyval.crn = &object::east; ; break;} case 196: #line 1355 "gram.yy" { yyval.crn = &object::north_west; ; break;} case 197: #line 1357 "gram.yy" { yyval.crn = &object::south_west; ; break;} case 198: #line 1359 "gram.yy" { yyval.crn = &object::north_east; ; break;} case 199: #line 1361 "gram.yy" { yyval.crn = &object::south_east; ; break;} case 200: #line 1363 "gram.yy" { yyval.crn = &object::center; ; break;} case 201: #line 1365 "gram.yy" { yyval.crn = &object::start; ; break;} case 202: #line 1367 "gram.yy" { yyval.crn = &object::end; ; break;} case 203: #line 1372 "gram.yy" { if (!lookup_variable(yyvsp[0].str, & yyval.x)) { lex_error("there is no variable `%1'", yyvsp[0].str); YYABORT; } a_delete yyvsp[0].str; ; break;} case 204: #line 1381 "gram.yy" { yyval.x = yyvsp[0].x; ; break;} case 205: #line 1383 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->origin().x; else yyval.x = yyvsp[-1].pl.x; ; break;} case 206: #line 1390 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->origin().y; else yyval.x = yyvsp[-1].pl.y; ; break;} case 207: #line 1397 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->height(); else yyval.x = 0.0; ; break;} case 208: #line 1404 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->width(); else yyval.x = 0.0; ; break;} case 209: #line 1411 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->radius(); else yyval.x = 0.0; ; break;} case 210: #line 1418 "gram.yy" { yyval.x = yyvsp[-2].x + yyvsp[0].x; ; break;} case 211: #line 1420 "gram.yy" { yyval.x = yyvsp[-2].x - yyvsp[0].x; ; break;} case 212: #line 1422 "gram.yy" { yyval.x = yyvsp[-2].x * yyvsp[0].x; ; break;} case 213: #line 1424 "gram.yy" { if (yyvsp[0].x == 0.0) { lex_error("division by zero"); YYABORT; } yyval.x = yyvsp[-2].x/yyvsp[0].x; ; break;} case 214: #line 1433 "gram.yy" { if (yyvsp[0].x == 0.0) { lex_error("modulus by zero"); YYABORT; } yyval.x = fmod(yyvsp[-2].x, yyvsp[0].x); ; break;} case 215: #line 1442 "gram.yy" { errno = 0; yyval.x = pow(yyvsp[-2].x, yyvsp[0].x); if (errno == EDOM) { lex_error("arguments to `^' operator out of domain"); YYABORT; } if (errno == ERANGE) { lex_error("result of `^' operator out of range"); YYABORT; } ; break;} case 216: #line 1457 "gram.yy" { yyval.x = -yyvsp[0].x; ; break;} case 217: #line 1459 "gram.yy" { yyval.x = yyvsp[-1].x; ; break;} case 218: #line 1461 "gram.yy" { errno = 0; yyval.x = sin(yyvsp[-1].x); if (errno == ERANGE) { lex_error("sin result out of range"); YYABORT; } ; break;} case 219: #line 1471 "gram.yy" { errno = 0; yyval.x = cos(yyvsp[-1].x); if (errno == ERANGE) { lex_error("cos result out of range"); YYABORT; } ; break;} case 220: #line 1481 "gram.yy" { errno = 0; yyval.x = atan2(yyvsp[-3].x, yyvsp[-1].x); if (errno == EDOM) { lex_error("atan2 argument out of domain"); YYABORT; } if (errno == ERANGE) { lex_error("atan2 result out of range"); YYABORT; } ; break;} case 221: #line 1496 "gram.yy" { errno = 0; yyval.x = log10(yyvsp[-1].x); if (errno == ERANGE) { lex_error("log result out of range"); YYABORT; } ; break;} case 222: #line 1506 "gram.yy" { errno = 0; yyval.x = pow(10.0, yyvsp[-1].x); if (errno == ERANGE) { lex_error("exp result out of range"); YYABORT; } ; break;} case 223: #line 1516 "gram.yy" { errno = 0; yyval.x = sqrt(yyvsp[-1].x); if (errno == EDOM) { lex_error("sqrt argument out of domain"); YYABORT; } ; break;} case 224: #line 1526 "gram.yy" { yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ; break;} case 225: #line 1528 "gram.yy" { yyval.x = yyvsp[-3].x < yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ; break;} case 226: #line 1530 "gram.yy" { yyval.x = floor(yyvsp[-1].x); ; break;} case 227: #line 1532 "gram.yy" { yyval.x = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*yyvsp[-1].x); ; break;} case 228: #line 1534 "gram.yy" { // return a random number in the range [0,1) // portable, but not very random yyval.x = (rand() & 0x7fff) / double(0x8000); ; break;} case 229: #line 1540 "gram.yy" { yyval.x = 0; srand((unsigned int)yyvsp[-1].x); ; break;} case 230: #line 1542 "gram.yy" { yyval.x = (yyvsp[-2].x < yyvsp[0].x); ; break;} case 231: #line 1544 "gram.yy" { yyval.x = (yyvsp[-2].x <= yyvsp[0].x); ; break;} case 232: #line 1546 "gram.yy" { yyval.x = (yyvsp[-2].x > yyvsp[0].x); ; break;} case 233: #line 1548 "gram.yy" { yyval.x = (yyvsp[-2].x >= yyvsp[0].x); ; break;} case 234: #line 1550 "gram.yy" { yyval.x = (yyvsp[-2].x == yyvsp[0].x); ; break;} case 235: #line 1552 "gram.yy" { yyval.x = (yyvsp[-2].x != yyvsp[0].x); ; break;} case 236: #line 1554 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 237: #line 1556 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 238: #line 1558 "gram.yy" { yyval.x = (yyvsp[0].x == 0.0); ; break;} } /* the action file gets copied in in place of this dollarsign */ #line 543 "/usr/local/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; #ifdef YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif *++yyvsp = yyval; #ifdef YYLSP_NEEDED yylsp++; if (yylen == 0) { yylsp->first_line = yylloc.first_line; yylsp->first_column = yylloc.first_column; yylsp->last_line = (yylsp-1)->last_line; yylsp->last_column = (yylsp-1)->last_column; yylsp->text = 0; } else { yylsp->last_line = (yylsp+yylen-1)->last_line; yylsp->last_column = (yylsp+yylen-1)->last_column; } #endif /* Now "shift" the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; yyerrlab: /* here on detecting error */ if (! yyerrstatus) /* If not already recovering from an error, report this error. */ { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { int size = 0; char *msg; int x, count; count = 0; /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) size += strlen(yytname[x]) + 15, count++; msg = (char *) malloc(size + 15); if (msg != 0) { strcpy(msg, "parse error"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) { strcat(msg, count == 0 ? ", expecting `" : " or `"); strcat(msg, yytname[x]); strcat(msg, "'"); count++; } } yyerror(msg); free(msg); } else yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ yyerror("parse error"); } goto yyerrlab1; yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); #endif yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; yyerrdefault: /* current state does not do anything special for the error token. */ #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ if (yyn) goto yydefault; #endif yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #ifdef YYLSP_NEEDED yylsp--; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting error token, "); #endif *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; yyacceptlab: /* YYACCEPT comes here. */ if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 0; yyabortlab: /* YYABORT comes here. */ if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 1; } #line 1562 "gram.yy" // bison defines const to be empty unless __STDC__ is defined, which it // isn't under cfront #ifdef const #undef const #endif static struct { const char *name; double val; int scaled; // non-zero if val should be multiplied by scale } defaults_table[] = { { "arcrad", .25, 1 }, { "arrowht", .1, 1 }, { "arrowwid", .05, 1 }, { "circlerad", .25, 1 }, { "boxht", .5, 1 }, { "boxwid", .75, 1 }, { "boxrad", 0.0, 1 }, { "dashwid", .05, 1 }, { "ellipseht", .5, 1 }, { "ellipsewid", .75, 1 }, { "moveht", .5, 1 }, { "movewid", .5, 1 }, { "lineht", .5, 1 }, { "linewid", .5, 1 }, { "textht", 0.0, 1 }, { "textwid", 0.0, 1 }, { "scale", 1.0, 0 }, { "linethick", -1.0, 1 }, // in points (<0 is default); now scaled { "fillval", .5, 0 }, { "arrowhead", 1.0, 0 }, { "maxpswid", 8.5, 0 }, { "maxpsht", 11.0, 0 }, }; static place * lookup_label(const char *label) { saved_state *state = current_saved_state; PTABLE(place) *tbl = current_table; for (;;) { place *pl = tbl->lookup(label); if (pl) return pl; if (!state) return 0; tbl = state->tbl; state = state->prev; } } static void define_label(const char *label, const place *pl) { place *p = new place; *p = *pl; current_table->define(label, p); } int lookup_variable(const char *name, double *val) { place *pl = lookup_label(name); if (pl) { *val = pl->x; return 1; } return 0; } void define_variable(const char *name, double val) { place *p = new place; p->obj = 0; p->x = val; p->y = 0.0; current_table->define(name, p); if (strcmp(name, "scale") == 0) { // When the scale changes, reset all scaled pre-defined variables to // their default values. for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (defaults_table[i].scaled) define_variable(defaults_table[i].name, val*defaults_table[i].val); } } // called once only (not once per parse) void parse_init (void) { current_direction = RIGHT_DIRECTION; current_position.x = 0.0; current_position.y = 0.0; // This resets everything to its default value. reset_all(); } static void reset (const char *nm) { for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (strcmp(nm, defaults_table[i].name) == 0) { double val = defaults_table[i].val; if (defaults_table[i].scaled) { double scale; lookup_variable("scale", &scale); val *= scale; } define_variable(defaults_table[i].name, val); return; } lex_error("`%1' is not a predefined variable", nm); } static void reset_all (void) { // We only have to explicitly reset the pre-defined variables that // aren't scaled because `scale' is not scaled, and changing the // value of `scale' will reset all the pre-defined variables that // are scaled. for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (!defaults_table[i].scaled) define_variable(defaults_table[i].name, defaults_table[i].val); } // called after each parse void parse_cleanup (void) { while (current_saved_state != 0) { delete current_table; current_table = current_saved_state->tbl; saved_state *tem = current_saved_state; current_saved_state = current_saved_state->prev; delete tem; } assert(current_table == &top_table); PTABLE_ITERATOR(place) iter(current_table); const char *key; place *pl; while (iter.next(&key, &pl)) if (pl->obj != 0) { position pos = pl->obj->origin(); pl->obj = 0; pl->x = pos.x; pl->y = pos.y; } while (olist.head != 0) { object *tem = olist.head; olist.head = olist.head->next; delete tem; } olist.tail = 0; current_direction = RIGHT_DIRECTION; current_position.x = 0.0; current_position.y = 0.0; } static const char * ordinal_postfix(int n) { if (n < 10 || n > 20) switch (n % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; } return "th"; } static const char * object_type_name(object_type type) { switch (type) { case BOX_OBJECT: return "box"; case CIRCLE_OBJECT: return "circle"; case ELLIPSE_OBJECT: return "ellipse"; case ARC_OBJECT: return "arc"; case SPLINE_OBJECT: return "spline"; case LINE_OBJECT: return "line"; case ARROW_OBJECT: return "arrow"; case MOVE_OBJECT: return "move"; case TEXT_OBJECT: return "\"\""; case BLOCK_OBJECT: return "[]"; case OTHER_OBJECT: case MARK_OBJECT: default: break; } return "object"; } static char * format_number(const char *form, double n) { if (form == 0) form = "%g"; else { // this is a fairly feeble attempt at validation of the format int nspecs = 0; for (const char *p = form; *p != '\0'; p++) if (*p == '%') { if (p[1] == '%') p++; else nspecs++; } if (nspecs > 1) { lex_error("bad format `%1'", form); return strsave(form); } } sprintf(sprintf_buf, form, n); return strsave(sprintf_buf); } static char * do_sprintf(const char *form, const double *v, int nv) { string result; int i = 0; string one_format; while (*form) { if (*form == '%') { one_format += *form++; for (; *form != '\0' && strchr("#-+ 0123456789.", *form) != 0; form++) one_format += *form; if (*form == '\0' || strchr("eEfgG%", *form) == 0) { lex_error("bad sprintf format"); result += one_format; result += form; break; } if (*form == '%') { one_format += *form++; one_format += '\0'; sprintf(sprintf_buf, one_format.contents()); } else { if (i >= nv) { lex_error("too few arguments to sprintf"); result += one_format; result += form; break; } one_format += *form++; one_format += '\0'; sprintf(sprintf_buf, one_format.contents(), v[i++]); } one_format.clear(); result += sprintf_buf; } else result += *form++; } result += '\0'; return strsave(result.contents()); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/gram.h�����������������������������������������������������������������������0000644�0001750�0001750�00000004704�07126276671�013217� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������typedef union { char *str; int n; double x; struct { double x, y; } pair; struct { double x; char *body; } if_data; struct { char *str; const char *filename; int lineno; } lstr; struct { double *v; int nv; int maxv; } dv; struct { double val; int is_multiplicative; } by; place pl; object *obj; corner crn; path *pth; object_spec *spec; saved_state *pstate; graphics_state state; object_type obtype; } YYSTYPE; #define LABEL 257 #define VARIABLE 258 #define NUMBER 259 #define TEXT 260 #define COMMAND_LINE 261 #define DELIMITED 262 #define ORDINAL 263 #define TH 264 #define LEFT_ARROW_HEAD 265 #define RIGHT_ARROW_HEAD 266 #define DOUBLE_ARROW_HEAD 267 #define LAST 268 #define UP 269 #define DOWN 270 #define LEFT 271 #define RIGHT 272 #define BOX 273 #define CIRCLE 274 #define ELLIPSE 275 #define ARC 276 #define LINE 277 #define ARROW 278 #define MOVE 279 #define SPLINE 280 #define HEIGHT 281 #define RADIUS 282 #define WIDTH 283 #define DIAMETER 284 #define FROM 285 #define TO 286 #define AT 287 #define WITH 288 #define BY 289 #define THEN 290 #define DOTTED 291 #define DASHED 292 #define CHOP 293 #define SAME 294 #define INVISIBLE 295 #define LJUST 296 #define RJUST 297 #define ABOVE 298 #define BELOW 299 #define OF 300 #define THE 301 #define WAY 302 #define BETWEEN 303 #define AND 304 #define HERE 305 #define DOT_N 306 #define DOT_E 307 #define DOT_W 308 #define DOT_S 309 #define DOT_NE 310 #define DOT_SE 311 #define DOT_NW 312 #define DOT_SW 313 #define DOT_C 314 #define DOT_START 315 #define DOT_END 316 #define DOT_X 317 #define DOT_Y 318 #define DOT_HT 319 #define DOT_WID 320 #define DOT_RAD 321 #define SIN 322 #define COS 323 #define ATAN2 324 #define LOG 325 #define EXP 326 #define SQRT 327 #define K_MAX 328 #define K_MIN 329 #define INT 330 #define RAND 331 #define SRAND 332 #define COPY 333 #define THRU 334 #define TOP 335 #define BOTTOM 336 #define UPPER 337 #define LOWER 338 #define SH 339 #define PRINT 340 #define CW 341 #define CCW 342 #define FOR 343 #define DO 344 #define IF 345 #define ELSE 346 #define ANDAND 347 #define OROR 348 #define NOTEQUAL 349 #define EQUALEQUAL 350 #define LESSEQUAL 351 #define GREATEREQUAL 352 #define LEFT_CORNER 353 #define RIGHT_CORNER 354 #define CENTER 355 #define END 356 #define START 357 #define RESET 358 #define UNTIL 359 #define PLOT 360 #define THICKNESS 361 #define FILL 362 #define ALIGNED 363 #define SPRINTF 364 #define COMMAND 365 #define DEFINE 366 #define UNDEF 367 extern YYSTYPE yylval; ������������������������������������������������������������plotutils-2.6/pic2plot/common.cc��������������������������������������������������������������������0000644�0001750�0001750�00000040204�11037241020�013662� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ // The common_output class: subclassed from the output class, // providing support for dotted/dashed arcs and circles, and for // rounded boxes (possible dotted/dashed). #include "pic.h" #include "output.h" #include "common.h" // output a dashed circle as a series of arcs void common_output::dashed_circle(const position ¢, double rad, const line_type <) { assert (lt.type == line_type::dashed); line_type slt = lt; slt.type = line_type::solid; double dash_angle = lt.dash_width/rad; // dash angle in radians int ndashes; double gap_angle; if (dash_angle >= M_PI/4.0) { if (dash_angle < M_PI/2.0) { gap_angle = M_PI/2.0 - dash_angle; ndashes = 4; } else if (dash_angle < M_PI) { gap_angle = M_PI - dash_angle; ndashes = 2; } else { circle (cent, rad, slt, -1.0); return; } } else { ndashes = 4 * int(ceil(M_PI/(4.0*dash_angle))); gap_angle = (M_PI*2.0)/ndashes - dash_angle; } for (int i = 0; i < ndashes; i++) { double start_angle = i*(dash_angle+gap_angle) - 0.5 * dash_angle; solid_arc (cent, rad, start_angle, start_angle + dash_angle, lt); } } // output a dotted circle as a series of dots void common_output::dotted_circle(const position ¢, double rad, const line_type <) { double gap_angle = lt.dash_width/rad; // gap angle in radians int ndots; double ang = 0.0; assert (lt.type == line_type::dotted); if (gap_angle >= M_PI/2.0) { // always have at least 2 dots gap_angle = M_PI; ndots = 2; } else { ndots = 4*int(M_PI/(2.0*gap_angle)); gap_angle = (M_PI*2.0)/ndots; } for (int i = 0; i < ndots; i++, ang += gap_angle) dot (cent + position(cos(ang), sin(ang))*rad, lt); } // return non-zero iff we can compute a center int compute_arc_center(const position &start, const position ¢, const position &end, position *result) { // This finds the point along the vector from start to cent that // is equidistant between start and end. distance c = cent - start; distance e = end - start; double n = c*e; if (n == 0.0) return 0; else { *result = start + c*((e*e)/(2.0*n)); return 1; } } // output a dashed arc as a series of arcs void common_output::dashed_arc(const position &start, const position ¢, const position &end, const line_type <) { assert (lt.type == line_type::dashed); position c; if (!compute_arc_center(start, cent, end, &c)) { line(start, &end, 1, lt); return; } distance start_offset = start - c; distance end_offset = end - c; double start_angle = atan2(start_offset.y, start_offset.x); double end_angle = atan2(end_offset.y, end_offset.x); double rad = hypot(c - start); double dash_angle = lt.dash_width/rad; double total_angle = end_angle - start_angle; while (total_angle < 0) total_angle += M_PI + M_PI; if (total_angle <= dash_angle*2.0) { solid_arc(cent, rad, start_angle, end_angle, lt); return; } int ndashes = int((total_angle - dash_angle)/(dash_angle*2.0) + 0.5); double dash_and_gap_angle = (total_angle - dash_angle)/ndashes; for (int i = 0; i <= ndashes; i++) solid_arc(cent, rad, start_angle + i*dash_and_gap_angle, start_angle + i*dash_and_gap_angle + dash_angle, lt); } // output a dotted arc as a series of dots void common_output::dotted_arc(const position &start, const position ¢, const position &end, const line_type <) { assert (lt.type == line_type::dotted); position c; if (!compute_arc_center(start, cent, end, &c)) { line(start, &end, 1, lt); return; } distance start_offset = start - c; distance end_offset = end - c; double start_angle = atan2(start_offset.y, start_offset.x); double total_angle = atan2(end_offset.y, end_offset.x) - start_angle; while (total_angle < 0) total_angle += M_PI + M_PI; double rad = hypot(c - start); int ndots = int(total_angle/(lt.dash_width/rad) + .5); if (ndots == 0) dot (start, lt); else { for (int i = 0; i <= ndots; i++) { double a = start_angle + (total_angle*i)/ndots; dot (cent + position(cos(a), sin(a))*rad, lt); } } } // output a solid arc, of the sort used in dashing void common_output::solid_arc(const position ¢, double rad, double start_angle, double end_angle, const line_type <) { line_type slt = lt; slt.type = line_type::solid; arc (cent + position(cos(start_angle), sin(start_angle))*rad, cent, cent + position(cos(end_angle), sin(end_angle))*rad, slt); } // output a rounded box (of one of several line types) void common_output::rounded_box(const position ¢, const distance &dim, double rad, const line_type <, double fill) { if (fill >= 0.0) filled_rounded_box(cent, dim, rad, fill); switch (lt.type) { case line_type::invisible: break; case line_type::dashed: dashed_rounded_box(cent, dim, rad, lt); break; case line_type::dotted: dotted_rounded_box(cent, dim, rad, lt); break; case line_type::solid: solid_rounded_box(cent, dim, rad, lt); break; default: assert (0); } } // output a dashed rounded box as a series of arcs void common_output::dashed_rounded_box(const position ¢, const distance &dim, double rad, const line_type <) { line_type slt = lt; slt.type = line_type::solid; double hor_length = dim.x + (M_PI/2.0 - 2.0)*rad; int n_hor_dashes = int(hor_length/(lt.dash_width*2.0) + 0.5); double hor_gap_width = (n_hor_dashes != 0 ? hor_length/n_hor_dashes - lt.dash_width : 0.0); double vert_length = dim.y + (M_PI/2.0 - 2.0)*rad; int n_vert_dashes = int(vert_length/(lt.dash_width*2.0) + 0.5); double vert_gap_width = (n_vert_dashes != 0 ? vert_length/n_vert_dashes - lt.dash_width : 0.0); // Each corner arc must be split into two for dashing, // with one part dashed using vert_gap_width, and the other // using hor_gap_width. double offset = lt.dash_width/2.0; dash_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad, -M_PI/4.0, 0, slt, lt.dash_width, vert_gap_width, &offset); dash_line(cent + position(dim.x/2.0, -dim.y/2.0 + rad), cent + position(dim.x/2.0, dim.y/2.0 - rad), slt, lt.dash_width, vert_gap_width, &offset); dash_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad, 0, M_PI/4.0, slt, lt.dash_width, vert_gap_width, &offset); offset = lt.dash_width/2.0; dash_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad, M_PI/4.0, M_PI/2, slt, lt.dash_width, hor_gap_width, &offset); dash_line(cent + position(dim.x/2.0 - rad, dim.y/2.0), cent + position(-dim.x/2.0 + rad, dim.y/2.0), slt, lt.dash_width, hor_gap_width, &offset); dash_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad, M_PI/2, 3*M_PI/4.0, slt, lt.dash_width, hor_gap_width, &offset); offset = lt.dash_width/2.0; dash_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad, 3.0*M_PI/4.0, M_PI, slt, lt.dash_width, vert_gap_width, &offset); dash_line(cent + position(-dim.x/2.0, dim.y/2.0 - rad), cent + position(-dim.x/2.0, -dim.y/2.0 + rad), slt, lt.dash_width, vert_gap_width, &offset); dash_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad, M_PI, 5.0*M_PI/4.0, slt, lt.dash_width, vert_gap_width, &offset); offset = lt.dash_width/2.0; dash_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad, 5*M_PI/4.0, 3*M_PI/2.0, slt, lt.dash_width, hor_gap_width, &offset); dash_line(cent + position(-dim.x/2.0 + rad, -dim.y/2.0), cent + position(dim.x/2.0 - rad, -dim.y/2.0), slt, lt.dash_width, hor_gap_width, &offset); dash_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad, 3*M_PI/2, 7*M_PI/4, slt, lt.dash_width, hor_gap_width, &offset); } // Private, used by dashed_rounded_box. void common_output::dash_arc(const position ¢, double rad, double start_angle, double end_angle, const line_type <, double dash_width, double gap_width, double *offsetp) { double length = (end_angle - start_angle)*rad; double pos = 0.0; for (;;) { if (*offsetp >= dash_width) { double rem = dash_width + gap_width - *offsetp; if (pos + rem > length) { *offsetp += length - pos; break; } else { pos += rem; *offsetp = 0.0; } } else { double rem = dash_width - *offsetp; if (pos + rem > length) { solid_arc(cent, rad, start_angle + pos/rad, end_angle, lt); *offsetp += length - pos; break; } else { solid_arc(cent, rad, start_angle + pos/rad, start_angle + (pos + rem)/rad, lt); pos += rem; *offsetp = dash_width; } } } } // Private, used by dashed_rounded_box. void common_output::dash_line(const position &start, const position &end, const line_type <, double dash_width, double gap_width, double *offsetp) { distance dist = end - start; double length = hypot(dist); if (length == 0.0) return; double pos = 0.0; for (;;) { if (*offsetp >= dash_width) { double rem = dash_width + gap_width - *offsetp; if (pos + rem > length) { *offsetp += length - pos; break; } else { pos += rem; *offsetp = 0.0; } } else { double rem = dash_width - *offsetp; if (pos + rem > length) { line(start + dist*(pos/length), &end, 1, lt); *offsetp += length - pos; break; } else { position p(start + dist*((pos + rem)/length)); line(start + dist*(pos/length), &p, 1, lt); pos += rem; *offsetp = dash_width; } } } } // output a dotted rounded box as a series of dots void common_output::dotted_rounded_box(const position ¢, const distance &dim, double rad, const line_type <) { line_type slt = lt; slt.type = line_type::solid; double hor_length = dim.x + (M_PI/2.0 - 2.0)*rad; int n_hor_dots = int(hor_length/lt.dash_width + .5); double hor_gap_width = (n_hor_dots != 0 ? hor_length/n_hor_dots : lt.dash_width); double vert_length = dim.y + (M_PI/2.0 - 2.0)*rad; int n_vert_dots = int(vert_length/lt.dash_width + .5); double vert_gap_width = (n_vert_dots != 0 ? vert_length/n_vert_dots : lt.dash_width); double epsilon = lt.dash_width/(rad*100.0); double offset = 0.0; dot_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad, -M_PI/4.0, 0, slt, vert_gap_width, &offset); dot_line(cent + position(dim.x/2.0, -dim.y/2.0 + rad), cent + position(dim.x/2.0, dim.y/2.0 - rad), slt, vert_gap_width, &offset); dot_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad, 0, M_PI/4.0 - epsilon, slt, vert_gap_width, &offset); offset = 0.0; dot_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad, M_PI/4.0, M_PI/2, slt, hor_gap_width, &offset); dot_line(cent + position(dim.x/2.0 - rad, dim.y/2.0), cent + position(-dim.x/2.0 + rad, dim.y/2.0), slt, hor_gap_width, &offset); dot_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad, M_PI/2, 3*M_PI/4.0 - epsilon, slt, hor_gap_width, &offset); offset = 0.0; dot_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad, 3.0*M_PI/4.0, M_PI, slt, vert_gap_width, &offset); dot_line(cent + position(-dim.x/2.0, dim.y/2.0 - rad), cent + position(-dim.x/2.0, -dim.y/2.0 + rad), slt, vert_gap_width, &offset); dot_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad, M_PI, 5.0*M_PI/4.0 - epsilon, slt, vert_gap_width, &offset); offset = 0.0; dot_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad, 5*M_PI/4.0, 3*M_PI/2.0, slt, hor_gap_width, &offset); dot_line(cent + position(-dim.x/2.0 + rad, -dim.y/2.0), cent + position(dim.x/2.0 - rad, -dim.y/2.0), slt, hor_gap_width, &offset); dot_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad, 3*M_PI/2, 7*M_PI/4 - epsilon, slt, hor_gap_width, &offset); } // Private, used by dotted_rounded_box. void common_output::dot_arc(const position ¢, double rad, double start_angle, double end_angle, const line_type <, double gap_width, double *offsetp) { double length = (end_angle - start_angle)*rad; double pos = 0.0; for (;;) { if (*offsetp == 0.0) { double ang = start_angle + pos/rad; dot (cent + position(cos(ang), sin(ang))*rad, lt); } double rem = gap_width - *offsetp; if (pos + rem > length) { *offsetp += length - pos; break; } else { pos += rem; *offsetp = 0.0; } } } // Private, used by dotted_rounded_box. void common_output::dot_line(const position &start, const position &end, const line_type <, double gap_width, double *offsetp) { distance dist = end - start; double length = hypot(dist); if (length == 0.0) return; double pos = 0.0; for (;;) { if (*offsetp == 0.0) dot (start + dist*(pos/length), lt); double rem = gap_width - *offsetp; if (pos + rem > length) { *offsetp += length - pos; break; } else { pos += rem; *offsetp = 0.0; } } } // draw a solid rounded box, from arcs and lines void common_output::solid_rounded_box(const position ¢, const distance &dim, double rad, const line_type <) { position tem = cent - dim/2.0; arc(tem + position(0.0, rad), tem + position(rad, rad), tem + position(rad, 0.0), lt); tem = cent + position(-dim.x/2.0, dim.y/2.0); arc(tem + position(rad, 0.0), tem + position(rad, -rad), tem + position(0.0, -rad), lt); tem = cent + dim/2.0; arc(tem + position(0.0, -rad), tem + position(-rad, -rad), tem + position(-rad, 0.0), lt); tem = cent + position(dim.x/2.0, -dim.y/2.0); arc(tem + position(-rad, 0.0), tem + position(-rad, rad), tem + position(0.0, rad), lt); position end; end = cent + position(-dim.x/2.0, dim.y/2.0 - rad); line(cent - dim/2.0 + position(0.0, rad), &end, 1, lt); end = cent + position(dim.x/2.0 - rad, dim.y/2.0); line(cent + position(-dim.x/2.0 + rad, dim.y/2.0), &end, 1, lt); end = cent + position(dim.x/2.0, -dim.y/2.0 + rad); line(cent + position(dim.x/2.0, dim.y/2.0 - rad), &end, 1, lt); end = cent + position(-dim.x/2.0 + rad, -dim.y/2.0); line(cent + position(dim.x/2.0 - rad, -dim.y/2.0), &end, 1, lt); } // Draw a filled rounded box, by drawing filled circles etc. // Not used by libplot driver. void common_output::filled_rounded_box(const position ¢, const distance &dim, double rad, double fill) { line_type ilt; ilt.type = line_type::invisible; circle(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad, ilt, fill); circle(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad, ilt, fill); circle(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad, ilt, fill); circle(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad, ilt, fill); position vec[4]; vec[0] = cent + position(dim.x/2.0, dim.y/2.0 - rad); vec[1] = cent + position(-dim.x/2.0, dim.y/2.0 - rad); vec[2] = cent + position(-dim.x/2.0, -dim.y/2.0 + rad); vec[3] = cent + position(dim.x/2.0, -dim.y/2.0 + rad); polygon(vec, 4, ilt, fill); vec[0] = cent + position(dim.x/2.0 - rad, dim.y/2.0); vec[1] = cent + position(-dim.x/2.0 + rad, dim.y/2.0); vec[2] = cent + position(-dim.x/2.0 + rad, -dim.y/2.0); vec[3] = cent + position(dim.x/2.0 - rad, -dim.y/2.0); polygon(vec, 4, ilt, fill); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/lex.cc�����������������������������������������������������������������������0000644�0001750�0001750�00000126750�10357503171�013211� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// -*- C++ -*- /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) */ /* Comment by rsm: shortly after label got_dot, there is a line that looks bogus: if (!c == EOF || !csdigit(c)) break; */ #include "pic.h" #include "object.h" #include "gram.h" // Character representing $1. Must be illegal input character. #define ARG1 14 declare_ptable(char) implement_ptable(char) PTABLE(char) macro_table; ////////////////////////////////////////////////////////////////////// // Forward declarations for lexer ////////////////////////////////////////////////////////////////////// // forward references to internal lexer functions static char * process_body(const char *body); static char * get_thru_arg(void); static int docmp(const char *s1, int n1, const char *s2, int n2); static int get_delimited(void); static int get_token(int lookup_flag); static int get_token_after_dot(int c); static int lookup_keyword(const char *str, int len); static void do_define(void); static void do_undef(void); static void interpolate_macro_with_args(const char *body); // lexer global variables static double token_double; static int lookahead_token = -1; static int token_int; static string context_buffer; static string old_context_buffer; static string token_buffer; ////////////////////////////////////////////////////////////////////// // default function members for input classes ////////////////////////////////////////////////////////////////////// input::input() : next(0) { } input::~input() { } int input::get_location (const char **, int *) { return 0; } ////////////////////////////////////////////////////////////////////// // MACRO_INPUT class ////////////////////////////////////////////////////////////////////// class macro_input : public input { public: // ctor, dtor macro_input(const char *); ~macro_input(); // public functions int get (void); int peek (void); private: char *s; char *p; }; macro_input::macro_input(const char *str) { p = s = strsave(str); } macro_input::~macro_input() { a_delete s; } int macro_input::get(void) { if (p == 0 || *p == '\0') return EOF; else return (unsigned char)*p++; } int macro_input::peek(void) { if (p == 0 || *p == '\0') return EOF; else return (unsigned char)*p; } ////////////////////////////////////////////////////////////////////// // FILE_INPUT class ////////////////////////////////////////////////////////////////////// file_input::file_input(FILE *f, const char *fn) : filename(fn), lineno(0), ptr("") { fp = f; } file_input::~file_input() { fclose(fp); } int file_input::get(void) { if (*ptr != '\0' || read_line()) return (unsigned char)*ptr++; else return EOF; } int file_input::peek(void) { if (*ptr != '\0' || read_line()) return (unsigned char)*ptr; else return EOF; } int file_input::get_location (const char **fnp, int *lnp) { *fnp = filename; *lnp = lineno; return 1; } int file_input::read_line(void) { for (;;) { line.clear(); lineno++; for (;;) { int c = getc(fp); if (c == EOF) break; else if (illegal_input_char(c)) lex_error("illegal input character code %1", c); else { line += char(c); if (c == '\n') break; } } if (line.length() == 0) return 0; if (!(line.length() >= 3 && line[0] == '.' && line[1] == 'P' && (line[2] == 'S' || line[2] == 'E' || line[2] == 'F') && (line.length() == 3 || line[3] == ' ' || line[3] == '\n' || compatible_flag))) { line += '\0'; ptr = line.contents(); return 1; } } } ////////////////////////////////////////////////////////////////////// // ARGUMENT_MACRO_INPUT class ////////////////////////////////////////////////////////////////////// class argument_macro_input : public input { public: // ctor, dtor argument_macro_input(const char *, int, char **); ~argument_macro_input(); // public functions int get (void); int peek (void); private: char *s; char *p; char *ap; int argc; char *argv[9]; }; argument_macro_input::argument_macro_input(const char *body, int ac, char **av) : ap(0), argc(ac) { for (int i = 0; i < argc; i++) argv[i] = av[i]; p = s = process_body(body); } argument_macro_input::~argument_macro_input() { for (int i = 0; i < argc; i++) a_delete argv[i]; a_delete s; } int argument_macro_input::get(void) { if (ap) { if (*ap != '\0') return (unsigned char)*ap++; ap = 0; } if (p == 0) return EOF; while (*p >= ARG1 && *p <= ARG1 + 8) { int i = *p++ - ARG1; if (i < argc && argv[i] != 0 && argv[i][0] != '\0') { ap = argv[i]; return (unsigned char)*ap++; } } if (*p == '\0') return EOF; return (unsigned char)*p++; } int argument_macro_input::peek(void) { if (ap) { if (*ap != '\0') return (unsigned char)*ap; ap = 0; } if (p == 0) return EOF; while (*p >= ARG1 && *p <= ARG1 + 8) { int i = *p++ - ARG1; if (i < argc && argv[i] != 0 && argv[i][0] != '\0') { ap = argv[i]; return (unsigned char)*ap; } } if (*p == '\0') return EOF; return (unsigned char)*p; } ////////////////////////////////////////////////////////////////////// // CHAR_INPUT class ////////////////////////////////////////////////////////////////////// class char_input : public input { public: // ctor char_input (int n); // public functions int get (void); int peek (void); private: int c; }; char_input::char_input(int n) : c((unsigned char)n) { } int char_input::get (void) { int n = c; c = EOF; return n; } int char_input::peek (void) { return c; } ////////////////////////////////////////////////////////////////////// // FOR_INPUT class ////////////////////////////////////////////////////////////////////// class for_input : public input { public: //ctor, dtor for_input(char *, double, int, double, char *); ~for_input(); // public functions int get (void); int peek (void); private: char *var; char *body; double to; int by_is_multiplicative; double by; const char *p; int done_newline; }; for_input::for_input(char *vr, double t, int bim, double b, char *bd) : var(vr), body(bd), to(t), by_is_multiplicative(bim), by(b), p(body), done_newline(0) { } for_input::~for_input() { a_delete var; a_delete body; } int for_input::get(void) { if (p == 0) return EOF; for (;;) { if (*p != '\0') return (unsigned char)*p++; if (!done_newline) { done_newline = 1; return '\n'; } double val; if (!lookup_variable(var, &val)) { lex_error("body of `for' terminated enclosing block"); return EOF; } if (by_is_multiplicative) val *= by; else val += by; define_variable(var, val); if (val > to) { p = 0; return EOF; } p = body; done_newline = 0; } } int for_input::peek(void) { if (p == 0) return EOF; if (*p != '\0') return (unsigned char)*p; if (!done_newline) return '\n'; double val; if (!lookup_variable(var, &val)) return EOF; if (by_is_multiplicative) { if (val * by > to) return EOF; } else { if (val + by > to) return EOF; } if (*body == '\0') return EOF; return (unsigned char)*body; } ////////////////////////////////////////////////////////////////////// // COPY_THRU_INPUT class ////////////////////////////////////////////////////////////////////// class copy_thru_input : public input { public: // ctor, dtor copy_thru_input(const char *b, const char *u); ~copy_thru_input(); // public functions int get (void); int peek (void); private: int done; char *body; char *until; const char *p; const char *ap; int argv[9]; int argc; string line; int get_line(); virtual int inget() = 0; }; copy_thru_input::copy_thru_input(const char *b, const char *u) : done(0) { ap = 0; body = process_body(b); p = 0; until = strsave(u); } copy_thru_input::~copy_thru_input() { a_delete body; a_delete until; } int copy_thru_input::get(void) { if (ap) { if (*ap != '\0') return (unsigned char)*ap++; ap = 0; } for (;;) { if (p == 0) { if (!get_line()) break; p = body; } if (*p == '\0') { p = 0; return '\n'; } while (*p >= ARG1 && *p <= ARG1 + 8) { int i = *p++ - ARG1; if (i < argc && line[argv[i]] != '\0') { ap = line.contents() + argv[i]; return (unsigned char)*ap++; } } if (*p != '\0') return (unsigned char)*p++; } return EOF; } int copy_thru_input::peek(void) { if (ap) { if (*ap != '\0') return (unsigned char)*ap; ap = 0; } for (;;) { if (p == 0) { if (!get_line()) break; p = body; } if (*p == '\0') return '\n'; while (*p >= ARG1 && *p <= ARG1 + 8) { int i = *p++ - ARG1; if (i < argc && line[argv[i]] != '\0') { ap = line.contents() + argv[i]; return (unsigned char)*ap; } } if (*p != '\0') return (unsigned char)*p; } return EOF; } int copy_thru_input::get_line(void) { if (done) return 0; line.clear(); argc = 0; int c = inget(); for (;;) { while (c == ' ') c = inget(); if (c == EOF || c == '\n') break; if (argc == 9) { do { c = inget(); } while (c != '\n' && c != EOF); break; } argv[argc++] = line.length(); do { line += char(c); c = inget(); } while (c != ' ' && c != '\n'); line += '\0'; } if (until != 0 && argc > 0 && strcmp(&line[argv[0]], until) == 0) { done = 1; return 0; } return argc > 0 || c == '\n'; } ////////////////////////////////////////////////////////////////////// // COPY_FILE_THRU_INPUT class (subclassed from COPY_THRU_INPUT) ////////////////////////////////////////////////////////////////////// class copy_file_thru_input : public copy_thru_input { public: copy_file_thru_input(input *, const char *b, const char *u); ~copy_file_thru_input(); int inget(); private: input *in; }; copy_file_thru_input::copy_file_thru_input(input *i, const char *b, const char *u) : copy_thru_input(b, u), in(i) { } copy_file_thru_input::~copy_file_thru_input() { delete in; } int copy_file_thru_input::inget(void) { if (!in) return EOF; else return in->get(); } ////////////////////////////////////////////////////////////////////// // COPY_REST_THRU_INPUT class (subclassed from COPY_THRU_INPUT) ////////////////////////////////////////////////////////////////////// class copy_rest_thru_input : public copy_thru_input { public: // ctor copy_rest_thru_input (const char *, const char *u); // public functions int inget (void); }; copy_rest_thru_input::copy_rest_thru_input(const char *b, const char *u) : copy_thru_input(b, u) { } int copy_rest_thru_input::inget(void) { while (next != 0) { int c = next->get(); if (c != EOF) return c; if (next->next == 0) return EOF; input *tem = next; next = next->next; delete tem; } return EOF; } ////////////////////////////////////////////////////////////////////// // SIMPLE_FILE_INPUT class ////////////////////////////////////////////////////////////////////// class simple_file_input : public input { public: // ctor, dtor simple_file_input(FILE *, const char *); ~simple_file_input(); // public functions int get (void); int peek (void); int get_location (const char **, int *); private: const char *filename; int lineno; FILE *fp; }; simple_file_input::simple_file_input(FILE *p, const char *s) : filename(s), lineno(1), fp(p) { } simple_file_input::~simple_file_input(void) { // don't delete the filename fclose(fp); } int simple_file_input::get(void) { int c = getc(fp); while (illegal_input_char(c)) { error("illegal input character code %1", c); c = getc(fp); } if (c == '\n') lineno++; return c; } int simple_file_input::peek(void) { int c = getc(fp); while (illegal_input_char(c)) { error("illegal input character code %1", c); c = getc(fp); } if (c != EOF) ungetc(c, fp); return c; } int simple_file_input::get_location (const char **fnp, int *lnp) { *fnp = filename; *lnp = lineno; return 1; } ////////////////////////////////////////////////////////////////////// // INPUT_STACK class (not subclassed from INPUT) ////////////////////////////////////////////////////////////////////// class input_stack { public: static void push(input *); static void clear(); static int get_char(); static int peek_char(); static int get_location (const char **fnp, int *lnp); static void push_back(unsigned char c, int was_bol = 0); static int bol(); private: static input *current_input; static int bol_flag; }; void input_stack::push(input *in) { in->next = current_input; current_input = in; } void input_stack::clear(void) { while (current_input != 0) { input *tem = current_input; current_input = current_input->next; delete tem; } bol_flag = 1; } int input_stack::get_char(void) { while (current_input != 0) { int c = current_input->get(); if (c != EOF) { bol_flag = c == '\n'; return c; } // don't pop the top-level input off the stack if (current_input->next == 0) return EOF; input *tem = current_input; current_input = current_input->next; delete tem; } return EOF; } int input_stack::peek_char(void) { while (current_input != 0) { int c = current_input->peek(); if (c != EOF) return c; if (current_input->next == 0) return EOF; input *tem = current_input; current_input = current_input->next; delete tem; } return EOF; } int input_stack::get_location (const char **fnp, int *lnp) { for (input *p = current_input; p; p = p->next) if (p->get_location (fnp, lnp)) return 1; return 0; } void input_stack::push_back(unsigned char c, int was_bol) { push(new char_input(c)); bol_flag = was_bol; } inline int input_stack::bol(void) { return bol_flag; } input *input_stack::current_input = 0; int input_stack::bol_flag = 0; ////////////////////////////////////////////////////////////////////// // PIC LEXER // // Public interface (declared in pic.h): // // lex_init(), lex_cleanup() // yylex(), yyerror() // lex_error(), lex_warning(), // do_copy(), do_for(), copy_file_thru(), copy_rest_thru(), push_body() // do_lookahead() // // The lexer accesses a read-only variable of the parser, `delim_flag', // and also calls the parser's define_variable() and lookup_variable() // functions [they're used in for loops]. ////////////////////////////////////////////////////////////////////// void lex_init(input *top) { input_stack::clear(); input_stack::push(top); } void lex_cleanup(void) { while (input_stack::get_char() != EOF) ; } static void interpolate_macro_with_args(const char *body) { char *argv[9]; int argc = 0; int i; for (i = 0; i < 9; i++) argv[i] = 0; int level = 0; int c; enum { NORMAL, IN_STRING, IN_STRING_QUOTED } state = NORMAL; do { token_buffer.clear(); for (;;) { c = input_stack::get_char(); if (c == EOF) { lex_error("end of input while scanning macro arguments"); break; } if (state == NORMAL && level == 0 && (c == ',' || c == ')')) { if (token_buffer.length() > 0) { token_buffer += '\0'; argv[argc] = strsave(token_buffer.contents()); } // for `foo()', argc = 0 if (argc > 0 || c != ')' || i > 0) argc++; break; } token_buffer += char(c); switch (state) { case NORMAL: if (c == '"') state = IN_STRING; else if (c == '(') level++; else if (c == ')') level--; break; case IN_STRING: if (c == '"') state = NORMAL; else if (c == '\\') state = IN_STRING_QUOTED; break; case IN_STRING_QUOTED: state = IN_STRING; break; } } } while (c != ')' && c != EOF); input_stack::push(new argument_macro_input(body, argc, argv)); } static int docmp(const char *s1, int n1, const char *s2, int n2) { if (n1 < n2) { int r = memcmp(s1, s2, n1); return r ? r : -1; } else if (n1 > n2) { int r = memcmp(s1, s2, n2); return r ? r : 1; } else return memcmp(s1, s2, n1); } static int lookup_keyword(const char *str, int len) { static struct keyword { const char *name; int token; } table[] = { { "Here", HERE }, { "above", ABOVE }, { "aligned", ALIGNED }, { "and", AND }, { "arc", ARC }, { "arrow", ARROW }, { "at", AT }, { "atan2", ATAN2 }, { "below", BELOW }, { "between", BETWEEN }, { "bottom", BOTTOM }, { "box", BOX }, { "by", BY }, { "ccw", CCW }, { "center", CENTER }, { "chop", CHOP }, { "circle", CIRCLE }, { "command", COMMAND }, { "copy", COPY }, { "cos", COS }, { "cw", CW }, { "dashed", DASHED }, { "define", DEFINE }, { "diam", DIAMETER }, { "diameter", DIAMETER }, { "do", DO }, { "dotted", DOTTED }, { "down", DOWN }, { "ellipse", ELLIPSE }, { "else", ELSE }, { "end", END }, { "exp", EXP }, { "fill", FILL }, { "filled", FILL }, { "for", FOR }, { "from", FROM }, { "height", HEIGHT }, { "ht", HEIGHT }, { "if", IF }, { "int", INT }, { "invis", INVISIBLE }, { "invisible", INVISIBLE }, { "last", LAST }, { "left", LEFT }, { "line", LINE }, { "ljust", LJUST }, { "log", LOG }, { "lower", LOWER }, { "max", K_MAX }, { "min", K_MIN }, { "move", MOVE }, { "of", OF }, { "plot", PLOT }, { "print", PRINT }, { "rad", RADIUS }, { "radius", RADIUS }, { "rand", RAND }, { "reset", RESET }, { "right", RIGHT }, { "rjust", RJUST }, { "same", SAME }, { "sh", SH }, { "sin", SIN }, { "spline", SPLINE }, { "sprintf", SPRINTF }, { "sqrt", SQRT }, { "start", START }, { "the", THE }, { "then", THEN }, { "thick", THICKNESS }, { "thickness", THICKNESS }, { "thru", THRU }, { "to", TO }, { "top", TOP }, { "undef", UNDEF }, { "until", UNTIL }, { "up", UP }, { "upper", UPPER }, { "way", WAY }, { "wid", WIDTH }, { "width", WIDTH }, { "with", WITH }, }; const keyword *start = table; const keyword *end = table + sizeof(table)/sizeof(table[0]); while (start < end) { // start <= target < end const keyword *mid = start + (end - start)/2; int cmp = docmp(str, len, mid->name, strlen(mid->name)); if (cmp == 0) return mid->token; if (cmp < 0) end = mid; else start = mid + 1; } return 0; } static int get_token_after_dot(int c) { // get_token deals with the case where c is a digit switch (c) { case 'h': input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); context_buffer = ".ht"; return DOT_HT; } else if (c == 'e') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'i') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'g') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'h') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); context_buffer = ".height"; return DOT_HT; } input_stack::push_back('h'); } input_stack::push_back('g'); } input_stack::push_back('i'); } input_stack::push_back('e'); } input_stack::push_back('h'); return '.'; case 'x': input_stack::get_char(); context_buffer = ".x"; return DOT_X; case 'y': input_stack::get_char(); context_buffer = ".y"; return DOT_Y; case 'c': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'e') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'n') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'e') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'r') { input_stack::get_char(); context_buffer = ".center"; return DOT_C; } input_stack::push_back('e'); } input_stack::push_back('t'); } input_stack::push_back('n'); } input_stack::push_back('e'); } context_buffer = ".c"; return DOT_C; case 'n': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'e') { input_stack::get_char(); context_buffer = ".ne"; return DOT_NE; } else if (c == 'w') { input_stack::get_char(); context_buffer = ".nw"; return DOT_NW; } else { context_buffer = ".n"; return DOT_N; } break; case 'e': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'n') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'd') { input_stack::get_char(); context_buffer = ".end"; return DOT_END; } input_stack::push_back('n'); context_buffer = ".e"; return DOT_E; } context_buffer = ".e"; return DOT_E; case 'w': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'i') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'd') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'h') { input_stack::get_char(); context_buffer = ".width"; return DOT_WID; } input_stack::push_back('t'); } context_buffer = ".wid"; return DOT_WID; } input_stack::push_back('i'); } context_buffer = ".w"; return DOT_W; case 's': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'e') { input_stack::get_char(); context_buffer = ".se"; return DOT_SE; } else if (c == 'w') { input_stack::get_char(); context_buffer = ".sw"; return DOT_SW; } else { if (c == 't') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'a') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'r') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); context_buffer = ".start"; return DOT_START; } input_stack::push_back('r'); } input_stack::push_back('a'); } input_stack::push_back('t'); } context_buffer = ".s"; return DOT_S; } break; case 't': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'o') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'p') { input_stack::get_char(); context_buffer = ".top"; return DOT_N; } input_stack::push_back('o'); } context_buffer = ".t"; return DOT_N; case 'l': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'e') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'f') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); context_buffer = ".left"; return DOT_W; } input_stack::push_back('f'); } input_stack::push_back('e'); } context_buffer = ".l"; return DOT_W; case 'r': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'a') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'd') { input_stack::get_char(); context_buffer = ".rad"; return DOT_RAD; } input_stack::push_back('a'); } else if (c == 'i') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'g') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'h') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); context_buffer = ".right"; return DOT_E; } input_stack::push_back('h'); } input_stack::push_back('g'); } input_stack::push_back('i'); } context_buffer = ".r"; return DOT_E; case 'b': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'o') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'o') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'm') { input_stack::get_char(); context_buffer = ".bottom"; return DOT_S; } input_stack::push_back('o'); } input_stack::push_back('t'); } context_buffer = ".bot"; return DOT_S; } input_stack::push_back('o'); } context_buffer = ".b"; return DOT_S; default: context_buffer = '.'; return '.'; } } static int get_token(int lookup_flag) { context_buffer.clear(); for (;;) { int n = 0; int bol = input_stack::bol(); int c = input_stack::get_char(); if (bol && c == command_char) { token_buffer.clear(); token_buffer += c; // the newline is not part of the token for (;;) { c = input_stack::peek_char(); if (c == EOF || c == '\n') break; input_stack::get_char(); token_buffer += char(c); } context_buffer = token_buffer; return COMMAND_LINE; } switch (c) { case EOF: return EOF; case ' ': case '\t': break; case '\\': { int d = input_stack::peek_char(); if (d != '\n') { context_buffer = '\\'; return '\\'; } input_stack::get_char(); break; } case '#': do { c = input_stack::get_char(); } while (c != '\n' && c != EOF); if (c == '\n') context_buffer = '\n'; return c; case '"': context_buffer = '"'; token_buffer.clear(); for (;;) { c = input_stack::get_char(); if (c == '\\') { context_buffer += '\\'; c = input_stack::peek_char(); if (c == '"') { input_stack::get_char(); token_buffer += '"'; context_buffer += '"'; } else token_buffer += '\\'; } else if (c == '\n') { error("newline in string"); break; } else if (c == EOF) { error("missing `\"'"); break; } else if (c == '"') { context_buffer += '"'; break; } else { context_buffer += char(c); token_buffer += char(c); } } return TEXT; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { int overflow = 0; n = 0; for (;;) { if (n > (INT_MAX - 9)/10) { overflow = 1; break; } n *= 10; n += c - '0'; context_buffer += char(c); c = input_stack::peek_char(); if (c == EOF || !csdigit(c)) break; c = input_stack::get_char(); } token_double = n; if (overflow) { for (;;) { token_double *= 10.0; token_double += c - '0'; context_buffer += char(c); c = input_stack::peek_char(); if (c == EOF || !csdigit(c)) break; c = input_stack::get_char(); } // if somebody asks for 1000000000000th, we will silently // give them INT_MAXth double temp = token_double; // work around gas 1.34/sparc bug if (token_double > INT_MAX) n = INT_MAX; else n = int(temp); } } switch (c) { case 'i': case 'I': context_buffer += char(c); input_stack::get_char(); return NUMBER; case '.': { context_buffer += '.'; input_stack::get_char(); got_dot: double factor = 1.0; for (;;) { c = input_stack::peek_char(); if (!c == EOF || !csdigit(c)) break; input_stack::get_char(); context_buffer += char(c); factor /= 10.0; if (c != '0') token_double += factor*(c - '0'); } if (c != 'e' && c != 'E') { if (c == 'i' || c == 'I') { context_buffer += char(c); input_stack::get_char(); } return NUMBER; } } // fall through case 'e': case 'E': { int echar = c; input_stack::get_char(); c = input_stack::peek_char(); int sign = '+'; if (c == '+' || c == '-') { sign = c; input_stack::get_char(); c = input_stack::peek_char(); if (c == EOF || !csdigit(c)) { input_stack::push_back(sign); input_stack::push_back(echar); return NUMBER; } context_buffer += char(echar); context_buffer += char(sign); } else { if (c == EOF || !csdigit(c)) { input_stack::push_back(echar); return NUMBER; } context_buffer += char(echar); } input_stack::get_char(); context_buffer += char(c); n = c - '0'; for (;;) { c = input_stack::peek_char(); if (c == EOF || !csdigit(c)) break; input_stack::get_char(); context_buffer += char(c); n = n*10 + (c - '0'); } if (sign == '-') n = -n; if (c == 'i' || c == 'I') { context_buffer += char(c); input_stack::get_char(); } token_double *= pow(10.0, n); return NUMBER; } case 'n': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'd') { input_stack::get_char(); token_int = n; context_buffer += "nd"; return ORDINAL; } input_stack::push_back('n'); return NUMBER; case 'r': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'd') { input_stack::get_char(); token_int = n; context_buffer += "rd"; return ORDINAL; } input_stack::push_back('r'); return NUMBER; case 't': input_stack::get_char(); c = input_stack::peek_char(); if (c == 'h') { input_stack::get_char(); token_int = n; context_buffer += "th"; return ORDINAL; } input_stack::push_back('t'); return NUMBER; case 's': input_stack::get_char(); c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); token_int = n; context_buffer += "st"; return ORDINAL; } input_stack::push_back('s'); return NUMBER; default: return NUMBER; } break; case '\'': { c = input_stack::peek_char(); if (c == 't') { input_stack::get_char(); c = input_stack::peek_char(); if (c == 'h') { input_stack::get_char(); context_buffer = "'th"; return TH; } else input_stack::push_back('t'); } context_buffer = "'"; return '\''; } case '.': { c = input_stack::peek_char(); if (c != EOF && csdigit(c)) { n = 0; token_double = 0.0; context_buffer = '.'; goto got_dot; } return get_token_after_dot(c); } case '<': c = input_stack::peek_char(); if (c == '-') { input_stack::get_char(); c = input_stack::peek_char(); if (c == '>') { input_stack::get_char(); context_buffer = "<->"; return DOUBLE_ARROW_HEAD; } context_buffer = "<-"; return LEFT_ARROW_HEAD; } else if (c == '=') { input_stack::get_char(); context_buffer = "<="; return LESSEQUAL; } context_buffer = "<"; return '<'; case '-': c = input_stack::peek_char(); if (c == '>') { input_stack::get_char(); context_buffer = "->"; return RIGHT_ARROW_HEAD; } context_buffer = "-"; return '-'; case '!': c = input_stack::peek_char(); if (c == '=') { input_stack::get_char(); context_buffer = "!="; return NOTEQUAL; } context_buffer = "!"; return '!'; case '>': c = input_stack::peek_char(); if (c == '=') { input_stack::get_char(); context_buffer = ">="; return GREATEREQUAL; } context_buffer = ">"; return '>'; case '=': c = input_stack::peek_char(); if (c == '=') { input_stack::get_char(); context_buffer = "=="; return EQUALEQUAL; } context_buffer = "="; return '='; case '&': c = input_stack::peek_char(); if (c == '&') { input_stack::get_char(); context_buffer = "&&"; return ANDAND; } context_buffer = "&"; return '&'; case '|': c = input_stack::peek_char(); if (c == '|') { input_stack::get_char(); context_buffer = "||"; return OROR; } context_buffer = "|"; return '|'; default: if (c != EOF && csalpha(c)) { token_buffer.clear(); token_buffer = c; for (;;) { c = input_stack::peek_char(); if (c == EOF || (!csalnum(c) && c != '_')) break; input_stack::get_char(); token_buffer += char(c); } int tok = lookup_keyword(token_buffer.contents(), token_buffer.length()); if (tok != 0) { context_buffer = token_buffer; return tok; } char *def = 0; if (lookup_flag) { token_buffer += '\0'; def = macro_table.lookup(token_buffer.contents()); token_buffer.set_length(token_buffer.length() - 1); if (def) { if (c == '(') { input_stack::get_char(); interpolate_macro_with_args(def); } else input_stack::push(new macro_input(def)); } } if (!def) { context_buffer = token_buffer; if (csupper(token_buffer[0])) return LABEL; else return VARIABLE; } } else { context_buffer = char(c); return (unsigned char)c; } break; } } } static int get_delimited(void) { token_buffer.clear(); int c = input_stack::get_char(); while (c == ' ' || c == '\t' || c == '\n') c = input_stack::get_char(); if (c == EOF) { lex_error("missing delimiter"); return 0; } context_buffer = char(c); int had_newline = 0; int start = c; int level = 0; enum { NORMAL, IN_STRING, IN_STRING_QUOTED, DELIM_END } state = NORMAL; for (;;) { c = input_stack::get_char(); if (c == EOF) { lex_error("missing closing delimiter"); return 0; } if (c == '\n') had_newline = 1; else if (!had_newline) context_buffer += char(c); switch (state) { case NORMAL: if (start == '{') { if (c == '{') { level++; break; } if (c == '}') { if (--level < 0) state = DELIM_END; break; } } else { if (c == start) { state = DELIM_END; break; } } if (c == '"') state = IN_STRING; break; case IN_STRING_QUOTED: if (c == '\n') state = NORMAL; else state = IN_STRING; break; case IN_STRING: if (c == '"' || c == '\n') state = NORMAL; else if (c == '\\') state = IN_STRING_QUOTED; break; case DELIM_END: // This case is just to shut cfront 2.0 up. default: assert(0); } if (state == DELIM_END) break; token_buffer += c; } return 1; } static void do_define(void) { int t = get_token(0); // do not expand what we are defining if (t != VARIABLE && t != LABEL) { lex_error("can only define variable or placename"); return; } token_buffer += '\0'; string nm = token_buffer; const char *name = nm.contents(); if (!get_delimited()) return; token_buffer += '\0'; macro_table.define(name, strsave(token_buffer.contents())); } static void do_undef(void) { int t = get_token(0); // do not expand what we are undefining if (t != VARIABLE && t != LABEL) { lex_error("can only define variable or placename"); return; } token_buffer += '\0'; macro_table.define(token_buffer.contents(), 0); } void do_for(char *var, double from, double to, int by_is_multiplicative, double by, char *body) { define_variable(var, from); if (from <= to) input_stack::push(new for_input(var, to, by_is_multiplicative, by, body)); } void do_copy(const char *filename) { errno = 0; FILE *fp = fopen(filename, "r"); if (fp == 0) { lex_error("can't open `%1': %2", filename, strerror(errno)); return; } input_stack::push(new file_input(fp, filename)); } void copy_file_thru(const char *filename, const char *body, const char *until) { errno = 0; FILE *fp = fopen(filename, "r"); if (fp == 0) { lex_error("can't open `%1': %2", filename, strerror(errno)); return; } input *in = new copy_file_thru_input(new simple_file_input(fp, filename), body, until); input_stack::push(in); } void copy_rest_thru(const char *body, const char *until) { input_stack::push(new copy_rest_thru_input(body, until)); } void push_body(const char *s) { input_stack::push(new char_input('\n')); input_stack::push(new macro_input(s)); } static char * get_thru_arg(void) { int c = input_stack::peek_char(); while (c == ' ') { input_stack::get_char(); c = input_stack::peek_char(); } if (c != EOF && csalpha(c)) { // looks like a macro input_stack::get_char(); token_buffer = c; for (;;) { c = input_stack::peek_char(); if (c == EOF || (!csalnum(c) && c != '_')) break; input_stack::get_char(); token_buffer += char(c); } context_buffer = token_buffer; token_buffer += '\0'; char *def = macro_table.lookup(token_buffer.contents()); if (def) return strsave(def); // I guess it wasn't a macro after all; so push the macro name back. // -2 because we added a '\0' for (int i = token_buffer.length() - 2; i >= 0; i--) input_stack::push_back(token_buffer[i]); } if (get_delimited()) { token_buffer += '\0'; return strsave(token_buffer.contents()); } else return 0; } static char * process_body(const char *body) { char *s = strsave(body); int j = 0; for (int i = 0; s[i] != '\0'; i++) if (s[i] == '$' && s[i+1] >= '0' && s[i+1] <= '9') { if (s[i+1] != '0') s[j++] = ARG1 + s[++i] - '1'; } else s[j++] = s[i]; s[j] = '\0'; return s; } void do_lookahead(void) { if (lookahead_token == -1) { old_context_buffer = context_buffer; lookahead_token = get_token(1); } } int yylex(void) { if (delim_flag) { assert(lookahead_token == -1); if (delim_flag == 2) { if ((yylval.str = get_thru_arg()) != 0) return DELIMITED; else return 0; } else { if (get_delimited()) { token_buffer += '\0'; yylval.str = strsave(token_buffer.contents()); return DELIMITED; } else return 0; } } for (;;) { int t; if (lookahead_token >= 0) { t = lookahead_token; lookahead_token = -1; } else t = get_token(1); switch (t) { case '\n': return ';'; case EOF: return 0; case DEFINE: do_define(); break; case UNDEF: do_undef(); break; case ORDINAL: yylval.n = token_int; return t; case NUMBER: yylval.x = token_double; return t; case COMMAND_LINE: case TEXT: token_buffer += '\0'; if (!input_stack::get_location (&yylval.lstr.filename, &yylval.lstr.lineno)) { yylval.lstr.filename = 0; yylval.lstr.lineno = -1; } yylval.lstr.str = strsave(token_buffer.contents()); return t; case LABEL: case VARIABLE: token_buffer += '\0'; yylval.str = strsave(token_buffer.contents()); return t; case LEFT: // change LEFT to LEFT_CORNER when followed by OF old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token == OF) return LEFT_CORNER; else return t; case RIGHT: // change RIGHT to RIGHT_CORNER when followed by OF old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token == OF) return RIGHT_CORNER; else return t; case UPPER: // recognise UPPER only before LEFT or RIGHT old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token != LEFT && lookahead_token != RIGHT) { yylval.str = strsave("upper"); return VARIABLE; } else return t; case LOWER: // recognise LOWER only before LEFT or RIGHT old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token != LEFT && lookahead_token != RIGHT) { yylval.str = strsave("lower"); return VARIABLE; } else return t; case TOP: // recognise TOP only before OF old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token != OF) { yylval.str = strsave("top"); return VARIABLE; } else return t; case BOTTOM: // recognise BOTTOM only before OF old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token != OF) { yylval.str = strsave("bottom"); return VARIABLE; } else return t; case CENTER: // recognise CENTER only before OF old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token != OF) { yylval.str = strsave("center"); return VARIABLE; } else return t; case START: // recognise START only before OF old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token != OF) { yylval.str = strsave("start"); return VARIABLE; } else return t; case END: // recognise END only before OF old_context_buffer = context_buffer; lookahead_token = get_token(1); if (lookahead_token != OF) { yylval.str = strsave("end"); return VARIABLE; } else return t; default: return t; } } } void lex_error(const char *message, const errarg &arg1, const errarg &arg2, const errarg &arg3) { const char *filename; int lineno; if (!input_stack::get_location (&filename, &lineno)) error(message, arg1, arg2, arg3); else error_with_file_and_line(filename, lineno, message, arg1, arg2, arg3); } void lex_warning(const char *message, const errarg &arg1, const errarg &arg2, const errarg &arg3) { const char *filename; int lineno; if (!input_stack::get_location (&filename, &lineno)) warning(message, arg1, arg2, arg3); else warning_with_file_and_line(filename, lineno, message, arg1, arg2, arg3); } void yyerror(const char *s) { const char *filename; int lineno; const char *context = 0; if (lookahead_token == -1) { if (context_buffer.length() > 0) { context_buffer += '\0'; context = context_buffer.contents(); } } else { if (old_context_buffer.length() > 0) { old_context_buffer += '\0'; context = old_context_buffer.contents(); } } if (!input_stack::get_location (&filename, &lineno)) { if (context) { if (context[0] == '\n' && context[1] == '\0') error("%1 before newline", s); else error("%1 before `%2'", s, context); } else error("%1 at end of picture", s); } else { if (context) { if (context[0] == '\n' && context[1] == '\0') error_with_file_and_line(filename, lineno, "%1 before newline", s); else error_with_file_and_line(filename, lineno, "%1 before `%2'", s, context); } else error_with_file_and_line(filename, lineno, "%1 at end of picture", s); } } ������������������������plotutils-2.6/pic2plot/main.cc����������������������������������������������������������������������0000644�0001750�0001750�00000044067�11233726653�013353� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, 2009, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ #include "pic.h" #include "output.h" #include "common.h" #include "libcommon.h" #include "getopt.h" #include "fontlist.h" #include "plot.h" // libplot header file const char *progname = "pic2plot"; // name of this program const char *written = "Written by Robert S. Maier."; const char *copyright = "Copyright (C) 2009 Free Software Foundation, Inc."; const char *usage_appendage = " FILE...\n"; // A global; we have only one of these. Its member function are what do // the output of objects of various kinds (they're invoked by the // objects' `print' operations). output *out; // declared in output.h // `out' is a pointer to an instance of the plot_output class, which // is derived from the output class. Any instance of the plot_output // class looks at the following global variables, which the user // can set on the command line. char *output_format = (char *)"meta"; // libplot output format char *font_name = NULL; // initial font name (if set) char *pen_color_name = NULL; // initial pen color (if set) double font_size = 10.0/(8.0*72.); // font size as width of graphics display double line_width = -0.5/(8.0*72.); // line width as width of graphics display, // negative means use libplot default // any plot_output instance contains a plPlotter object; the following // PlotterParams object contains the parameters used when creating it plPlotterParams *plotter_params; // flags (used by lexer) int command_char = '.'; // char that introduces pass-thru lines int compatible_flag = 0; // recog. PS/PE even if not foll. by ' ', '\n'? // flags (used by parser) int safer_flag = 0; // forbid shell escapes? // flag (could be used by driver) int flyback_flag; int no_centering_flag = 0; // turn off auto-centering? int precision_dashing = 0; // position dashes/dots individually? // static variables static int had_parse_error = 0; // parse error? static int lf_flag = 1; // non-zero -> try to parse `.lf' lines // options #define ARG_NONE 0 #define ARG_REQUIRED 1 #define ARG_OPTIONAL 2 const char *optstring = "T:OndF:f:W:"; struct option long_options[] = { /* The most important option ("--display-type" is an obsolete variant) */ { "output-format", ARG_REQUIRED, NULL, 'T'}, { "display-type", ARG_REQUIRED, NULL, 'T' << 8 }, /* hidden */ /* Long options, most with no equivalent short option alias */ { "bg-color", ARG_REQUIRED, NULL, 'q' << 8 }, { "bitmap-size", ARG_REQUIRED, NULL, 'B' << 8 }, { "emulate-color", ARG_REQUIRED, NULL, 'e' << 8 }, { "font-name", ARG_REQUIRED, NULL, 'F' }, { "font-size", ARG_REQUIRED, NULL, 'f' }, { "line-width", ARG_REQUIRED, NULL, 'W' }, { "max-line-length", ARG_REQUIRED, NULL, 'M' << 8 }, { "no-centering", ARG_NONE, NULL, 'n' }, { "page-size", ARG_REQUIRED, NULL, 'P' << 8 }, { "pen-color", ARG_REQUIRED, NULL, 'C' << 8 }, { "precision-dashing",ARG_NONE, NULL, 'd' }, { "rotation", ARG_REQUIRED, NULL, 'r' << 8}, /* Options relevant only to raw pic2plot (refers to metafile output) */ { "portable-output", ARG_NONE, NULL, 'O' }, /* Documentation options */ { "help-fonts", ARG_NONE, NULL, 'f' << 8 }, { "list-fonts", ARG_NONE, NULL, 'l' << 8 }, { "version", ARG_NONE, NULL, 'V' << 8 }, { "help", ARG_NONE, NULL, 'h' << 8 }, { NULL, 0, NULL, 0} }; /* null-terminated list of options, such as obsolete-but-still-maintained options or undocumented options, which we don't show to the user */ const int hidden_options[] = { (int)('T' << 8), 0 }; // forward references void do_file (const char *filename); void do_picture (FILE *fp); ////////////////////////////////////////////////////////////////////// // TOP_INPUT class. ////////////////////////////////////////////////////////////////////// class top_input : public input { public: // ctor top_input (FILE *); // public functions int get (void); int peek (void); int get_location (const char **filenamep, int *linenop); private: FILE *fp; int bol; int eof; int push_back[3]; int start_lineno; }; top_input::top_input(FILE *p) : fp(p), bol(1), eof(0) { push_back[0] = push_back[1] = push_back[2] = EOF; start_lineno = current_lineno; } int top_input::get(void) { if (eof) return EOF; if (push_back[2] != EOF) { int c = push_back[2]; push_back[2] = EOF; return c; } else if (push_back[1] != EOF) { int c = push_back[1]; push_back[1] = EOF; return c; } else if (push_back[0] != EOF) { int c = push_back[0]; push_back[0] = EOF; return c; } int c = getc(fp); while (illegal_input_char(c)) { error("illegal input character code %1", int(c)); c = getc(fp); bol = 0; } if (bol && c == '.') { c = getc(fp); if (c == 'P') { c = getc(fp); if (c == 'F' || c == 'E') { int d = getc(fp); if (d != EOF) ungetc(d, fp); if (d == EOF || d == ' ' || d == '\n' || compatible_flag) { eof = 1; flyback_flag = (c == 'F'); return EOF; } push_back[0] = c; push_back[1] = 'P'; return '.'; } if (c == 'S') { c = getc(fp); if (c != EOF) ungetc(c, fp); if (c == EOF || c == ' ' || c == '\n' || compatible_flag) { error("nested .PS"); eof = 1; return EOF; } push_back[0] = 'S'; push_back[1] = 'P'; return '.'; } if (c != EOF) ungetc(c, fp); push_back[0] = 'P'; return '.'; } else { if (c != EOF) ungetc(c, fp); return '.'; } } if (c == '\n') { bol = 1; current_lineno++; return '\n'; } bol = 0; if (c == EOF) { eof = 1; error("end of file before .PE or .PF"); error_with_file_and_line(current_filename, start_lineno - 1, ".PS was here"); } return c; } int top_input::peek(void) { if (eof) return EOF; if (push_back[2] != EOF) return push_back[2]; if (push_back[1] != EOF) return push_back[1]; if (push_back[0] != EOF) return push_back[0]; int c = getc(fp); while (illegal_input_char(c)) { error("illegal input character code %1", int(c)); c = getc(fp); bol = 0; } if (bol && c == '.') { c = getc(fp); if (c == 'P') { c = getc(fp); if (c == 'F' || c == 'E') { int d = getc(fp); if (d != EOF) ungetc(d, fp); if (d == EOF || d == ' ' || d == '\n' || compatible_flag) { eof = 1; flyback_flag = (c == 'F'); return EOF; } push_back[0] = c; push_back[1] = 'P'; push_back[2] = '.'; return '.'; } if (c == 'S') { c = getc(fp); if (c != EOF) ungetc(c, fp); if (c == EOF || c == ' ' || c == '\n' || compatible_flag) { error("nested .PS"); eof = 1; return EOF; } push_back[0] = 'S'; push_back[1] = 'P'; push_back[2] = '.'; return '.'; } if (c != EOF) ungetc(c, fp); push_back[0] = 'P'; push_back[1] = '.'; return '.'; } else { if (c != EOF) ungetc(c, fp); push_back[0] = '.'; return '.'; } } if (c != EOF) ungetc(c, fp); if (c == '\n') return '\n'; return c; } int top_input::get_location(const char **filenamep, int *linenop) { *filenamep = current_filename; *linenop = current_lineno; return 1; } ////////////////////////////////////////////////////////////////////// // End of TOP_INPUT class, beginning of main(). ////////////////////////////////////////////////////////////////////// int main (int argc, char **argv) { bool do_list_fonts = false; /* show a list of fonts? */ bool show_fonts = false; /* supply help on fonts? */ bool show_usage = false; /* show usage message? */ bool show_version = false; /* show version message? */ int errcnt = 0; /* errors encountered */ int opt_index; /* long option index */ int option; /* option character */ static char stderr_buf[BUFSIZ]; setbuf(stderr, stderr_buf); /* set global */ program_name = progname; #if 0 /* could add -C, -S options to set these */ compatible_flag = 1; // allow non-' ', non-'\n' after .PS ? safer_flag = 1; // forbid shell escapes #endif plotter_params = pl_newplparams (); while ((option = getopt_long (argc, argv, optstring, long_options, &opt_index)) != EOF) { if (option == 0) option = long_options[opt_index].val; switch (option) { case 'T': /* Output format, ARG REQUIRED */ case 'T' << 8: output_format = (char *)xmalloc (strlen (optarg) + 1); strcpy (output_format, optarg); break; case 'O': /* Ascii output */ pl_setplparam (plotter_params, "META_PORTABLE", (void *)"yes"); break; case 'n': /* No centering */ no_centering_flag = 1; break; case 'd': /* Draw dots/dashes individually */ precision_dashing = 1; break; case 'F': /* set the initial font */ font_name = (char *)xmalloc (strlen (optarg) + 1); strcpy (font_name, optarg); break; case 'f': /* Font size, ARG REQUIRED */ { double local_font_size; char s[4]; if (sscanf (optarg, "%lf %3s", &local_font_size, s) == 2 && strcmp (s, "pt") == 0) local_font_size /= (8.0 * 72.0); // express as width of display else if (sscanf (optarg, "%lf", &local_font_size) <= 0) { fprintf (stderr, "%s: error: font size must be a number, e.g. `0.01736' or `10pt', was `%s'\n", progname, optarg); errcnt++; break; } if (local_font_size >= 1.0) fprintf (stderr, "%s: ignoring too-large font size\n", progname); else if (local_font_size < 0.0) fprintf (stderr, "%s: ignoring negative font size\n", progname); else font_size = local_font_size; break; } case 'W': /* Line width, ARG REQUIRED */ { double local_line_width; char s[4]; if (sscanf (optarg, "%lf %3s", &local_line_width, s) == 2 && strcmp (s, "pt") == 0) local_line_width /= (8.0 * 72.0); // express as width of display else if (sscanf (optarg, "%lf", &local_line_width) <= 0) { fprintf (stderr, "%s: error: line thickness must be a number, e.g. `0.00868' or `0.5pt', was `%s'\n", progname, optarg); errcnt++; break; } if (local_line_width >= 1.0) fprintf (stderr, "%s: ignoring too-large line thickness\n", progname); /* N.B. We don't rule out negative line thickness, because it's interpreted as a request to use libplot's default line thickness. (Which depends on output format; for example, with the `-T X' option it'll yield a zero-thickness X11 line, which means a Bresenham line.) */ else line_width = local_line_width; break; } case 'e' << 8: /* Emulate color via grayscale */ pl_setplparam (plotter_params, "EMULATE_COLOR", (void *)optarg); break; case 'C' << 8: /* set the initial pen color */ pen_color_name = (char *)xmalloc (strlen (optarg) + 1); strcpy (pen_color_name, optarg); break; case 'q' << 8: /* set the initial background color */ pl_setplparam (plotter_params, "BG_COLOR", (void *)optarg); break; case 'B' << 8: /* Bitmap size */ pl_setplparam (plotter_params, "BITMAPSIZE", (void *)optarg); break; case 'M' << 8: /* Max line length */ pl_setplparam (plotter_params, "MAX_LINE_LENGTH", (void *)optarg); break; case 'P' << 8: /* Page size */ pl_setplparam (plotter_params, "PAGESIZE", (void *)optarg); break; case 'r' << 8: /* Rotation angle */ pl_setplparam (plotter_params, "ROTATION", (void *)optarg); break; case 'V' << 8: /* Version */ show_version = true; break; case 'f' << 8: /* Fonts */ show_fonts = true; break; case 'l' << 8: /* Fonts */ do_list_fonts = true; break; case 'h' << 8: /* Help */ show_usage = true; break; default: errcnt++; break; } } if (errcnt > 0) { fprintf (stderr, "Try `%s --help' for more information\n", progname); return EXIT_FAILURE; } if (show_version) { display_version (progname, written, copyright); return EXIT_SUCCESS; } if (do_list_fonts) { int success = true; success = list_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_fonts) { int success = true; success = display_fonts (output_format, progname); if (success) return EXIT_SUCCESS; else return EXIT_FAILURE; } if (show_usage) { display_usage (progname, hidden_options, usage_appendage, true); return EXIT_SUCCESS; } /* at most, only file names remain, so initialize parser */ parse_init(); out = make_plot_output(); command_char = 014; // bogus to avoid seeing `commands' lf_flag = 0; /* invoke do_file() on stdin or on each remaining file */ if (optind >= argc) do_file ("-"); else for (int i = optind; i < argc; i++) do_file (argv[i]); delete out; if (ferror(stdout) || fflush(stdout) < 0) fatal ("output error"); /* clean up */ pl_deleteplparams (plotter_params); return had_parse_error ? EXIT_FAILURE : EXIT_SUCCESS; } void do_file (const char *filename) { FILE *fp; if (strcmp(filename, "-") == 0) fp = stdin; else { errno = 0; fp = fopen(filename, "r"); if (fp == 0) fatal ("can't open `%1': %2", filename, strerror(errno)); } out->set_location (filename, 1); current_filename = filename; current_lineno = 1; enum { START, MIDDLE, HAD_DOT, HAD_P, HAD_PS, HAD_l, HAD_lf } state = START; for (;;) { int c = getc(fp); if (c == EOF) // break out of for loop on EOF, only break; switch (state) { case START: if (c == '.') state = HAD_DOT; else { if (c == '\n') { current_lineno++; state = START; } else // dnl state = MIDDLE; } break; case MIDDLE: // discard chars until newline seen; switch back to START if (c == '\n') { current_lineno++; state = START; } break; case HAD_DOT: if (c == 'P') state = HAD_P; else if (lf_flag && c == 'l') state = HAD_l; else { if (c == '\n') { current_lineno++; state = START; } else // dnl state = MIDDLE; } break; case HAD_P: if (c == 'S') state = HAD_PS; else { if (c == '\n') { current_lineno++; state = START; } else // dnl state = MIDDLE; } break; case HAD_PS: if (c == ' ' || c == '\n' || compatible_flag) { ungetc(c, fp); do_picture(fp); // do the picture, incl. args of .PS if any state = START; } else // dnl state = MIDDLE; break; case HAD_l: if (c == 'f') state = HAD_lf; else { if (c == '\n') { current_lineno++; state = START; } else // dnl state = MIDDLE; } break; case HAD_lf: if (c == ' ' || c == '\n' || compatible_flag) { string line; while (c != EOF) { line += c; if (c == '\n') { current_lineno++; break; } c = getc(fp); } line += '\0'; interpret_lf_args(line.contents()); state = START; } else // dnl state = MIDDLE; break; default: assert(0); } } // exit gracefully when EOF seen if (fp != stdin) fclose(fp); } void do_picture(FILE *fp) { flyback_flag = 0; int c; while ((c = getc(fp)) == ' ') ; if (c == '<') /* first nonblank character after .PS is '<' */ { string filename; while ((c = getc(fp)) == ' ') ; while (c != EOF && c != ' ' && c != '\n') { filename += char(c); c = getc(fp); } if (c == ' ') { do { c = getc(fp); } while (c != EOF && c != '\n'); } if (c == '\n') current_lineno++; if (filename.length() == 0) error("missing filename after `<'"); else { filename += '\0'; const char *old_filename = current_filename; int old_lineno = current_lineno; // filenames must be permanent do_file (strsave(filename.contents())); // recursive call current_filename = old_filename; current_lineno = old_lineno; } out->set_location (current_filename, current_lineno); } else /* first nonblank character after .PS is not '<' */ { out->set_location (current_filename, current_lineno); /* get the starting line */ string start_line; while (c != EOF) { if (c == '\n') { current_lineno++; break; } start_line += c; c = getc(fp); } if (c == EOF) return; start_line += '\0'; /* parse starting line for height and width */ double wid, ht; switch (sscanf(&start_line[0], "%lf %lf", &wid, &ht)) { case 1: ht = 0.0; break; case 2: break; default: ht = wid = 0.0; break; } out->set_desired_width_height (wid, ht); out->set_args (start_line.contents()); // do the parse lex_init (new top_input(fp)); if (yyparse()) { had_parse_error = 1; lex_error ("giving up on this picture"); } parse_cleanup(); lex_cleanup(); // skip the rest of the .PF/.PE line while ((c = getc(fp)) != EOF && c != '\n') ; if (c == '\n') current_lineno++; out->set_location (current_filename, current_lineno); } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/object.cc��������������������������������������������������������������������0000644�0001750�0001750�00000120442�11037241133�013650� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ // This is almost the same as the object.cc file included in gpic, with // a lot of reformatting and commenting. // The only substantive change is to the arc_object::print method. // Previously, it distinguished clockwise arcs from counterclockwise simply // by interchanging the `start' and `end' points. This interfered with the // libplot driver, in particular with libplot's incremental path // constrution algorithm. Search for `PIC2PLOT' to see the alteration. #define PIC2PLOT #include "pic.h" #include "object.h" #include "output.h" // forward references static void print_object_list(object *p); line_type::line_type() : type(solid), thickness(1.0) { } ////////////////////////////////////////////////////////////////////// // The base OUTPUT class, declared in output.h ////////////////////////////////////////////////////////////////////// output::output() : args(0), desired_height(0.0), desired_width(0.0) { } output::~output() { a_delete args; } void output::command(const char *, const char *, int) { } void output::set_location(const char *, int) { } int output::supports_filled_polygons() { return 0; } void output::begin_block(const position &, const position &) { } void output::end_block() { } void output::set_desired_width_height(double wid, double ht) { desired_width = wid; desired_height = ht; } void output::set_args(const char *s) { a_delete args; if (s == 0 || *s == '\0') args = 0; else args = strsave(s); } double output::compute_scale(double sc, const position &ll, const position &ur) { distance dim = ur - ll; if (desired_width != 0.0 || desired_height != 0.0) { sc = 0.0; if (desired_width != 0.0) { if (dim.x == 0.0) error("width specified for picture with zero width"); else sc = dim.x/desired_width; } if (desired_height != 0.0) { if (dim.y == 0.0) error("height specified for picture with zero height"); else { double tem = dim.y/desired_height; if (tem > sc) sc = tem; } } return sc == 0.0 ? 1.0 : sc; } else // user didn't specify desired width or height on .PS line { if (sc <= 0.0) sc = 1.0; distance sdim = dim/sc; double max_width = 0.0; lookup_variable("maxpswid", &max_width); double max_height = 0.0; lookup_variable("maxpsht", &max_height); if ((max_width > 0.0 && sdim.x > max_width) || (max_height > 0.0 && sdim.y > max_height)) { double xscale = dim.x/max_width; double yscale = dim.y/max_height; return xscale > yscale ? xscale : yscale; } else return sc; } } ////////////////////////////////////////////////////////////////////// // The POSITION class, declared in libgroff/position.h ////////////////////////////////////////////////////////////////////// position::position(const place &pl) { if (pl.obj != 0) { // Use two statements to work around bug in SGI C++. object *tem = pl.obj; *this = tem->origin(); } else { x = pl.x; y = pl.y; } } position::position() : x(0.0), y(0.0) { } position::position(double a, double b) : x(a), y(b) { } int operator==(const position &a, const position &b) { return a.x == b.x && a.y == b.y; } int operator!=(const position &a, const position &b) { return a.x != b.x || a.y != b.y; } position &position::operator+=(const position &a) { x += a.x; y += a.y; return *this; } position &position::operator-=(const position &a) { x -= a.x; y -= a.y; return *this; } position &position::operator*=(double a) { x *= a; y *= a; return *this; } position &position::operator/=(double a) { x /= a; y /= a; return *this; } position operator-(const position &a) { return position(-a.x, -a.y); } position operator+(const position &a, const position &b) { return position(a.x + b.x, a.y + b.y); } position operator-(const position &a, const position &b) { return position(a.x - b.x, a.y - b.y); } position operator/(const position &a, double n) { return position(a.x/n, a.y/n); } position operator*(const position &a, double n) { return position(a.x*n, a.y*n); } // dot product double operator*(const position &a, const position &b) { return a.x*b.x + a.y*b.y; } double hypot(const position &a) { return hypot(a.x, a.y); } struct arrow_head_type { double height; double width; int solid; }; static void draw_arrow(const position &pos, const distance &dir, const arrow_head_type &aht, const line_type <) { double hyp = hypot(dir); if (hyp == 0.0) { error("cannot draw arrow on object with zero length"); return; } position base = -dir; base *= aht.height/hyp; position n(dir.y, -dir.x); n *= aht.width/(hyp*2.0); line_type slt = lt; slt.type = line_type::solid; if (aht.solid && out->supports_filled_polygons()) { position v[3]; v[0] = pos; v[1] = pos + base + n; v[2] = pos + base - n; // A value > 1 means fill with the current color. out->polygon(v, 3, slt, 2.0); } else { position v[2]; v[0] = pos; v[1] = pos + base + n; out->line(pos + base - n, v, 2, slt); } } ////////////////////////////////////////////////////////////////////// // The base OBJECT class, declared in object.h ////////////////////////////////////////////////////////////////////// object::object() : prev(0), next(0) { } object::~object() { } void object::move_by(const position &) { } void object::print() { } void object::print_text() { } int object::blank() { return 0; } class bounding_box { public: // ctor bounding_box(); // public functions void encompass(const position &); // public data int blank; position ll; position ur; }; bounding_box::bounding_box() : blank(1) { } void bounding_box::encompass(const position &pos) { if (blank) { ll = pos; ur = pos; blank = 0; } else { if (pos.x < ll.x) ll.x = pos.x; if (pos.y < ll.y) ll.y = pos.y; if (pos.x > ur.x) ur.x = pos.x; if (pos.y > ur.y) ur.y = pos.y; } } void object::update_bounding_box(bounding_box *) { } position object::origin() { return position(0.0,0.0); } position object::north() { return origin(); } position object::south() { return origin(); } position object::east() { return origin(); } position object::west() { return origin(); } position object::north_east() { return origin(); } position object::north_west() { return origin(); } position object::south_east() { return origin(); } position object::south_west() { return origin(); } position object::start() { return origin(); } position object::end() { return origin(); } position object::center() { return origin(); } double object::width() { return 0.0; } double object::radius() { return 0.0; } double object::height() { return 0.0; } place * object::find_label(const char *) { return 0; } ////////////////////////////////////////////////////////////////////// // Derived OBJECT classes, declared in object.h ////////////////////////////////////////////////////////////////////// segment::segment(const position &a, int n, segment *p) : is_absolute(n), pos(a), next(p) { } text_item::text_item(char *t, const char *fn, int ln) : next(0), text(t), filename(fn), lineno(ln) { adj.h = CENTER_ADJUST; adj.v = NONE_ADJUST; } text_item::~text_item() { a_delete text; } object_spec::object_spec(object_type t) : type(t) { flags = 0; tbl = 0; segment_list = 0; segment_width = segment_height = 0.0; segment_is_absolute = 0; text = 0; with = 0; dir = RIGHT_DIRECTION; } object_spec::~object_spec() { delete tbl; while (segment_list != 0) { segment *tem = segment_list; segment_list = segment_list->next; delete tem; } object *p = oblist.head; while (p != 0) { object *tem = p; p = p->next; delete tem; } while (text != 0) { text_item *tem = text; text = text->next; delete tem; } delete with; } class command_object : public object { public: // ctor, dtor command_object(char *, const char *, int); ~command_object(); // public functions object_type type() { return OTHER_OBJECT; } void print(); private: char *s; const char *filename; int lineno; }; command_object::command_object(char *p, const char *fn, int ln) : s(p), filename(fn), lineno(ln) { } command_object::~command_object() { a_delete s; } void command_object::print() { out->command(s, filename, lineno); } object *make_command_object(char *s, const char *fn, int ln) { return new command_object(s, fn, ln); } class mark_object : public object { public: mark_object(); object_type type(); }; object * make_mark_object() { return new mark_object(); } mark_object::mark_object() { } object_type mark_object::type() { return MARK_OBJECT; } object_list::object_list() : head(0), tail(0) { } void object_list::append(object *obj) { if (tail == 0) { obj->next = obj->prev = 0; head = tail = obj; } else { obj->prev = tail; obj->next = 0; tail->next = obj; tail = obj; } } void object_list::wrap_up_block(object_list *ol) { object *p; for (p = tail; p && p->type() != MARK_OBJECT; p = p->prev) ; assert(p != 0); ol->head = p->next; if (ol->head) { ol->tail = tail; ol->head->prev = 0; } else ol->tail = 0; tail = p->prev; if (tail) tail->next = 0; else head = 0; delete p; } text_piece::text_piece() : text(0), filename(0), lineno(-1) { adj.h = CENTER_ADJUST; adj.v = NONE_ADJUST; } text_piece::~text_piece() { a_delete text; } class graphic_object : public object { public: // ctor, dtor graphic_object(); ~graphic_object(); // public functions object_type type() = 0; void print_text(); void add_text(text_item *, int); void set_dotted(double); void set_dashed(double); void set_thickness(double); void set_invisible(); virtual void set_fill(double); protected: line_type lt; private: int ntext; text_piece *text; int aligned; }; graphic_object::graphic_object() : ntext(0), text(0), aligned(0) { } void graphic_object::set_dotted(double wid) { lt.type = line_type::dotted; lt.dash_width = wid; } void graphic_object::set_dashed(double wid) { lt.type = line_type::dashed; lt.dash_width = wid; } void graphic_object::set_thickness(double th) { lt.thickness = th; } void graphic_object::set_fill(double) { } void graphic_object::set_invisible() { lt.type = line_type::invisible; } void graphic_object::add_text(text_item *t, int a) { aligned = a; int len = 0; text_item *p; for (p = t; p; p = p->next) len++; if (len == 0) text = 0; else { text = new text_piece[len]; for (p = t, len = 0; p; p = p->next, len++) { text[len].text = p->text; p->text = 0; text[len].adj = p->adj; text[len].filename = p->filename; text[len].lineno = p->lineno; } } ntext = len; } void graphic_object::print_text() { double angle = 0.0; if (aligned) { position d(end() - start()); if (d.x != 0.0 || d.y != 0.0) angle = atan2(d.y, d.x); } if (text != 0) out->text(center(), text, ntext, angle); } graphic_object::~graphic_object() { if (text) ad_delete(ntext) text; } class rectangle_object : public graphic_object { public: rectangle_object(const position &); double width() { return dim.x; } double height() { return dim.y; } position origin() { return cent; } position center() { return cent; } position north() { return position(cent.x, cent.y + dim.y/2.0); } position south() { return position(cent.x, cent.y - dim.y/2.0); } position east() { return position(cent.x + dim.x/2.0, cent.y); } position west() { return position(cent.x - dim.x/2.0, cent.y); } position north_east() { return position(cent.x + dim.x/2.0, cent.y + dim.y/2.0); } position north_west() { return position(cent.x - dim.x/2.0, cent.y + dim.y/2.0); } position south_east() { return position(cent.x + dim.x/2.0, cent.y - dim.y/2.0); } position south_west() { return position(cent.x - dim.x/2.0, cent.y - dim.y/2.0); } object_type type() = 0; void update_bounding_box(bounding_box *); void move_by(const position &); protected: position cent; position dim; }; rectangle_object::rectangle_object(const position &d) : dim(d) { } void rectangle_object::update_bounding_box(bounding_box *p) { p->encompass(cent - dim/2.0); p->encompass(cent + dim/2.0); } void rectangle_object::move_by(const position &a) { cent += a; } class closed_object : public rectangle_object { public: closed_object(const position &); object_type type() = 0; void set_fill(double); protected: double fill; // < 0 if not filled }; closed_object::closed_object(const position &pos) : rectangle_object(pos), fill(-1.0) { } void closed_object::set_fill(double f) { assert(f >= 0.0); fill = f; } class box_object : public closed_object { public: box_object(const position &, double); object_type type() { return BOX_OBJECT; } void print(); position north_east(); position north_west(); position south_east(); position south_west(); private: double xrad; double yrad; }; box_object::box_object(const position &pos, double r) : closed_object(pos), xrad(dim.x > 0 ? r : -r), yrad(dim.y > 0 ? r : -r) { } const double CHOP_FACTOR = 1.0 - 1.0/M_SQRT2; position box_object::north_east() { return position(cent.x + dim.x/2.0 - CHOP_FACTOR*xrad, cent.y + dim.y/2.0 - CHOP_FACTOR*yrad); } position box_object::north_west() { return position(cent.x - dim.x/2.0 + CHOP_FACTOR*xrad, cent.y + dim.y/2.0 - CHOP_FACTOR*yrad); } position box_object::south_east() { return position(cent.x + dim.x/2.0 - CHOP_FACTOR*xrad, cent.y - dim.y/2.0 + CHOP_FACTOR*yrad); } position box_object::south_west() { return position(cent.x - dim.x/2.0 + CHOP_FACTOR*xrad, cent.y - dim.y/2.0 + CHOP_FACTOR*yrad); } void box_object::print() { if (lt.type == line_type::invisible && fill < 0.0) return; if (xrad == 0.0) { distance dim2 = dim/2.0; position vec[4]; vec[0] = cent + position(dim2.x, -dim2.y); vec[1] = cent + position(dim2.x, dim2.y); vec[2] = cent + position(-dim2.x, dim2.y); vec[3] = cent + position(-dim2.x, -dim2.y); out->polygon(vec, 4, lt, fill); } else { distance abs_dim(fabs(dim.x), fabs(dim.y)); out->rounded_box(cent, abs_dim, fabs(xrad), lt, fill); } } graphic_object * object_spec::make_box(position *curpos, direction *dirp) { static double last_box_height; static double last_box_width; static double last_box_radius; static int have_last_box = 0; if (!(flags & HAS_HEIGHT)) { if ((flags & IS_SAME) && have_last_box) height = last_box_height; else lookup_variable("boxht", &height); } if (!(flags & HAS_WIDTH)) { if ((flags & IS_SAME) && have_last_box) width = last_box_width; else lookup_variable("boxwid", &width); } if (!(flags & HAS_RADIUS)) { if ((flags & IS_SAME) && have_last_box) radius = last_box_radius; else lookup_variable("boxrad", &radius); } last_box_width = width; last_box_height = height; last_box_radius = radius; have_last_box = 1; radius = fabs(radius); if (radius*2.0 > fabs(width)) radius = fabs(width/2.0); if (radius*2.0 > fabs(height)) radius = fabs(height/2.0); box_object *p = new box_object(position(width, height), radius); if (!position_rectangle(p, curpos, dirp)) { delete p; p = 0; } return p; } // return non-zero for success int object_spec::position_rectangle(rectangle_object *p, position *curpos, direction *dirp) { position pos; dir = *dirp; // ignore any direction in attribute list position motion; switch (dir) { case UP_DIRECTION: motion.y = p->height()/2.0; break; case DOWN_DIRECTION: motion.y = -p->height()/2.0; break; case LEFT_DIRECTION: motion.x = -p->width()/2.0; break; case RIGHT_DIRECTION: motion.x = p->width()/2.0; break; default: assert(0); } if (flags & HAS_AT) { pos = at; if (flags & HAS_WITH) { place offset; place here; here.obj = p; if (!with->follow(here, &offset)) return 0; pos -= offset; } } else { pos = *curpos; pos += motion; } p->move_by(pos); pos += motion; *curpos = pos; return 1; } class block_object : public rectangle_object { public: // ctor, dtor block_object(const position &, const object_list &ol, PTABLE(place) *t); ~block_object(); // public functions place *find_label(const char *); object_type type(); void move_by(const position &); void print(); private: object_list oblist; PTABLE(place) *tbl; }; block_object::block_object(const position &d, const object_list &ol, PTABLE(place) *t) : oblist(ol), tbl(t), rectangle_object(d) { } block_object::~block_object() { delete tbl; object *p = oblist.head; while (p != 0) { object *tem = p; p = p->next; delete tem; } } void block_object::print() { out->begin_block(south_west(), north_east()); print_object_list(oblist.head); out->end_block(); } static void adjust_objectless_places(PTABLE(place) *tbl, const position &a) { // Adjust all the labels that aren't attached to objects. PTABLE_ITERATOR(place) iter(tbl); const char *key; place *pl; while (iter.next(&key, &pl)) if (key && csupper(key[0]) && pl->obj == 0) { pl->x += a.x; pl->y += a.y; } } void block_object::move_by(const position &a) { cent += a; for (object *p = oblist.head; p; p = p->next) p->move_by(a); adjust_objectless_places(tbl, a); } place * block_object::find_label(const char *name) { return tbl->lookup(name); } object_type block_object::type() { return BLOCK_OBJECT; } graphic_object * object_spec::make_block(position *curpos, direction *dirp) { bounding_box bb; for (object *p = oblist.head; p; p = p->next) p->update_bounding_box(&bb); position dim; if (!bb.blank) { position m = -(bb.ll + bb.ur)/2.0; for (object *p = oblist.head; p; p = p->next) p->move_by(m); adjust_objectless_places(tbl, m); dim = bb.ur - bb.ll; } if (flags & HAS_WIDTH) dim.x = width; if (flags & HAS_HEIGHT) dim.y = height; block_object *block = new block_object(dim, oblist, tbl); if (!position_rectangle(block, curpos, dirp)) { delete block; block = 0; } tbl = 0; oblist.head = oblist.tail = 0; return block; } class text_object : public rectangle_object { public: text_object(const position &); object_type type() { return TEXT_OBJECT; } }; text_object::text_object(const position &d) : rectangle_object(d) { } graphic_object * object_spec::make_text(position *curpos, direction *dirp) { if (!(flags & HAS_HEIGHT)) { lookup_variable("textht", &height); int nitems = 0; for (text_item *t = text; t; t = t->next) nitems++; height *= nitems; } if (!(flags & HAS_WIDTH)) lookup_variable("textwid", &width); text_object *p = new text_object(position(width, height)); if (!position_rectangle(p, curpos, dirp)) { delete p; p = 0; } return p; } class ellipse_object : public closed_object { public: ellipse_object(const position &); position north_east() { return position(cent.x + dim.x/(M_SQRT2*2.0), cent.y + dim.y/(M_SQRT2*2.0)); } position north_west() { return position(cent.x - dim.x/(M_SQRT2*2.0), cent.y + dim.y/(M_SQRT2*2.0)); } position south_east() { return position(cent.x + dim.x/(M_SQRT2*2.0), cent.y - dim.y/(M_SQRT2*2.0)); } position south_west() { return position(cent.x - dim.x/(M_SQRT2*2.0), cent.y - dim.y/(M_SQRT2*2.0)); } double radius() { return dim.x/2.0; } object_type type() { return ELLIPSE_OBJECT; } void print(); }; ellipse_object::ellipse_object(const position &d) : closed_object(d) { } void ellipse_object::print() { if (lt.type == line_type::invisible && fill < 0.0) return; out->ellipse(cent, dim, lt, fill); } graphic_object * object_spec::make_ellipse(position *curpos, direction *dirp) { static double last_ellipse_height; static double last_ellipse_width; static int have_last_ellipse = 0; if (!(flags & HAS_HEIGHT)) { if ((flags & IS_SAME) && have_last_ellipse) height = last_ellipse_height; else lookup_variable("ellipseht", &height); } if (!(flags & HAS_WIDTH)) { if ((flags & IS_SAME) && have_last_ellipse) width = last_ellipse_width; else lookup_variable("ellipsewid", &width); } last_ellipse_width = width; last_ellipse_height = height; have_last_ellipse = 1; ellipse_object *p = new ellipse_object(position(width, height)); if (!position_rectangle(p, curpos, dirp)) { delete p; return 0; } return p; } class circle_object : public ellipse_object { public: // ctor circle_object(double); // public functions object_type type() { return CIRCLE_OBJECT; } void print(); }; circle_object::circle_object(double diam) : ellipse_object(position(diam, diam)) { } void circle_object::print() { if (lt.type == line_type::invisible && fill < 0.0) return; out->circle(cent, dim.x/2.0, lt, fill); } graphic_object * object_spec::make_circle(position *curpos, direction *dirp) { static double last_circle_radius; static int have_last_circle = 0; if (!(flags & HAS_RADIUS)) { if ((flags & IS_SAME) && have_last_circle) radius = last_circle_radius; else lookup_variable("circlerad", &radius); } last_circle_radius = radius; have_last_circle = 1; circle_object *p = new circle_object(radius*2.0); if (!position_rectangle(p, curpos, dirp)) { delete p; return 0; } return p; } class move_object : public graphic_object { position strt; position en; public: move_object(const position &s, const position &e); position origin() { return en; } object_type type() { return MOVE_OBJECT; } void update_bounding_box(bounding_box *); void move_by(const position &); }; move_object::move_object(const position &s, const position &e) : strt(s), en(e) { } void move_object::update_bounding_box(bounding_box *p) { p->encompass(strt); p->encompass(en); } void move_object::move_by(const position &a) { strt += a; en += a; } graphic_object * object_spec::make_move(position *curpos, direction *dirp) { static position last_move; static int have_last_move = 0; *dirp = dir; // No need to look at at since `at' attribute sets `from' attribute. position startpos = (flags & HAS_FROM) ? from : *curpos; if (!(flags & HAS_SEGMENT)) { if ((flags && IS_SAME) && have_last_move) segment_pos = last_move; else { switch (dir) { case UP_DIRECTION: segment_pos.y = segment_height; break; case DOWN_DIRECTION: segment_pos.y = -segment_height; break; case LEFT_DIRECTION: segment_pos.x = -segment_width; break; case RIGHT_DIRECTION: segment_pos.x = segment_width; break; default: assert(0); } } } segment_list = new segment(segment_pos, segment_is_absolute, segment_list); // Reverse the segment_list so that it's in forward order. segment *old = segment_list; segment_list = 0; while (old != 0) { segment *tem = old->next; old->next = segment_list; segment_list = old; old = tem; } // Compute the end position. position endpos = startpos; for (segment *s = segment_list; s; s = s->next) if (s->is_absolute) endpos = s->pos; else endpos += s->pos; have_last_move = 1; last_move = endpos - startpos; move_object *p = new move_object(startpos, endpos); *curpos = endpos; return p; } class linear_object : public graphic_object { public: // ctor linear_object(const position &s, const position &e); // public functions position start() { return strt; } position end() { return en; } void move_by(const position &); void update_bounding_box(bounding_box *) = 0; object_type type() = 0; void add_arrows(int at_start, int at_end, const arrow_head_type &); protected: char arrow_at_start; char arrow_at_end; arrow_head_type aht; position strt; position en; }; class line_object : public linear_object { public: // ctor, dtor line_object(const position &s, const position &e, position *, int); ~line_object(); // public functions position origin() { return strt; } position center() { return (strt + en)/2.0; } position north() { return (en.y - strt.y) > 0 ? en : strt; } position south() { return (en.y - strt.y) < 0 ? en : strt; } position east() { return (en.x - strt.x) > 0 ? en : strt; } position west() { return (en.x - strt.x) < 0 ? en : strt; } object_type type() { return LINE_OBJECT; } void update_bounding_box(bounding_box *); void print(); void move_by(const position &); protected: position *v; int n; }; class arrow_object : public line_object { public: arrow_object(const position &, const position &, position *, int); object_type type() { return ARROW_OBJECT; } }; class spline_object : public line_object { public: spline_object(const position &, const position &, position *, int); object_type type() { return SPLINE_OBJECT; } void print(); void update_bounding_box(bounding_box *); }; linear_object::linear_object(const position &s, const position &e) : arrow_at_start(0), arrow_at_end(0), strt(s), en(e) { } void linear_object::move_by(const position &a) { strt += a; en += a; } void linear_object::add_arrows(int at_start, int at_end, const arrow_head_type &a) { arrow_at_start = at_start; arrow_at_end = at_end; aht = a; } line_object::line_object(const position &s, const position &e, position *p, int i) : v(p), n(i), linear_object(s, e) { } void line_object::print() { if (lt.type == line_type::invisible) return; out->line(strt, v, n, lt); if (arrow_at_start) draw_arrow(strt, strt-v[0], aht, lt); if (arrow_at_end) draw_arrow(en, v[n-1] - (n > 1 ? v[n - 2] : strt), aht, lt); } void line_object::update_bounding_box(bounding_box *p) { p->encompass(strt); for (int i = 0; i < n; i++) p->encompass(v[i]); } void line_object::move_by(const position &pos) { linear_object::move_by(pos); for (int i = 0; i < n; i++) v[i] += pos; } void spline_object::update_bounding_box(bounding_box *p) { p->encompass(strt); p->encompass(en); /* If p1 = q1/2 + q2/2 p2 = q1/6 + q2*5/6 p3 = q2*5/6 + q3/6 p4 = q2/2 + q3/2 [ the points for the Bezier cubic ] and t = .5 then (1-t)^3*p1 + 3*t*(t - 1)^2*p2 + 3*t^2*(1-t)*p3 + t^3*p4 [ the equation for the Bezier cubic ] = .125*q1 + .75*q2 + .125*q3 */ for (int i = 1; i < n; i++) p->encompass((i == 1 ? strt : v[i-2])*.125 + v[i-1]*.75 + v[i]*.125); } arrow_object::arrow_object(const position &s, const position &e, position *p, int i) : line_object(s, e, p, i) { } spline_object::spline_object(const position &s, const position &e, position *p, int i) : line_object(s, e, p, i) { } void spline_object::print() { if (lt.type == line_type::invisible) return; out->spline(strt, v, n, lt); if (arrow_at_start) draw_arrow(strt, strt-v[0], aht, lt); if (arrow_at_end) draw_arrow(en, v[n-1] - (n > 1 ? v[n - 2] : strt), aht, lt); } line_object::~line_object() { a_delete v; } linear_object * object_spec::make_line(position *curpos, direction *dirp) { static position last_line; static int have_last_line = 0; *dirp = dir; // No need to look at at since `at' attribute sets `from' attribute. position startpos = (flags & HAS_FROM) ? from : *curpos; if (!(flags & HAS_SEGMENT)) { if ((flags & IS_SAME) && (type == LINE_OBJECT || type == ARROW_OBJECT) && have_last_line) segment_pos = last_line; else switch (dir) { case UP_DIRECTION: segment_pos.y = segment_height; break; case DOWN_DIRECTION: segment_pos.y = -segment_height; break; case LEFT_DIRECTION: segment_pos.x = -segment_width; break; case RIGHT_DIRECTION: segment_pos.x = segment_width; break; default: assert(0); } } segment_list = new segment(segment_pos, segment_is_absolute, segment_list); // reverse the segment_list so that it's in forward order segment *old = segment_list; segment_list = 0; while (old != 0) { segment *tem = old->next; old->next = segment_list; segment_list = old; old = tem; } // Absolutise all movements position endpos = startpos; int nsegments = 0; segment *s; for (s = segment_list; s; s = s->next, nsegments++) if (s->is_absolute) endpos = s->pos; else { endpos += s->pos; s->pos = endpos; s->is_absolute = 1; // to avoid confusion } // handle chop line_object *p = 0; position *v = new position[nsegments]; int i = 0; for (s = segment_list; s; s = s->next, i++) v[i] = s->pos; if (flags & IS_DEFAULT_CHOPPED) { lookup_variable("circlerad", &start_chop); end_chop = start_chop; flags |= IS_CHOPPED; } if (flags & IS_CHOPPED) { position start_chop_vec, end_chop_vec; if (start_chop != 0.0) { start_chop_vec = v[0] - startpos; start_chop_vec *= start_chop / hypot(start_chop_vec); } if (end_chop != 0.0) { end_chop_vec = (v[nsegments - 1] - (nsegments > 1 ? v[nsegments - 2] : startpos)); end_chop_vec *= end_chop / hypot(end_chop_vec); } startpos += start_chop_vec; v[nsegments - 1] -= end_chop_vec; endpos -= end_chop_vec; } switch (type) { case SPLINE_OBJECT: p = new spline_object(startpos, endpos, v, nsegments); break; case ARROW_OBJECT: p = new arrow_object(startpos, endpos, v, nsegments); break; case LINE_OBJECT: p = new line_object(startpos, endpos, v, nsegments); break; default: assert(0); } have_last_line = 1; last_line = endpos - startpos; *curpos = endpos; return p; } class arc_object : public linear_object { public: arc_object(int, const position &, const position &, const position &); position origin() { return cent; } position center() { return cent; } double radius() { return rad; } position north(); position south(); position east(); position west(); position north_east(); position north_west(); position south_east(); position south_west(); void update_bounding_box(bounding_box *); object_type type() { return ARC_OBJECT; } void print(); void move_by(const position &pos); private: int clockwise; position cent; double rad; }; arc_object::arc_object(int cw, const position &s, const position &e, const position &c) : linear_object(s, e), clockwise(cw), cent(c) { rad = hypot(c - s); } void arc_object::move_by(const position &pos) { linear_object::move_by(pos); cent += pos; } // we get arc corners from the corresponding circle position arc_object::north() { position result(cent); result.y += rad; return result; } position arc_object::south() { position result(cent); result.y -= rad; return result; } position arc_object::east() { position result(cent); result.x += rad; return result; } position arc_object::west() { position result(cent); result.x -= rad; return result; } position arc_object::north_east() { position result(cent); result.x += rad/M_SQRT2; result.y += rad/M_SQRT2; return result; } position arc_object::north_west() { position result(cent); result.x -= rad/M_SQRT2; result.y += rad/M_SQRT2; return result; } position arc_object::south_east() { position result(cent); result.x += rad/M_SQRT2; result.y -= rad/M_SQRT2; return result; } position arc_object::south_west() { position result(cent); result.x -= rad/M_SQRT2; result.y -= rad/M_SQRT2; return result; } void arc_object::print() { if (lt.type == line_type::invisible) return; #ifndef PIC2PLOT if (clockwise) out->arc(en, cent, strt, lt); else out->arc(strt, cent, en, lt); #else out->arc(strt, cent, en, lt); #endif if (arrow_at_start) { position c = cent - strt; draw_arrow(strt, (clockwise ? position(c.y, -c.x) : position(-c.y, c.x)), aht, lt); } if (arrow_at_end) { position e = en - cent; draw_arrow(en, (clockwise ? position(e.y, -e.x) : position(-e.y, e.x)), aht, lt); } } inline double max(double a, double b) { return a > b ? a : b; } void arc_object::update_bounding_box(bounding_box *p) { p->encompass(strt); p->encompass(en); position start_offset = strt - cent; if (start_offset.x == 0.0 && start_offset.y == 0.0) return; position end_offset = en - cent; if (end_offset.x == 0.0 && end_offset.y == 0.0) return; double start_quad = atan2(start_offset.y, start_offset.x)/(M_PI/2.0); double end_quad = atan2(end_offset.y, end_offset.x)/(M_PI/2.0); if (clockwise) { double temp = start_quad; start_quad = end_quad; end_quad = temp; } if (start_quad < 0.0) start_quad += 4.0; while (end_quad <= start_quad) end_quad += 4.0; double radius = max(hypot(start_offset), hypot(end_offset)); for (int q = int(start_quad) + 1; q < end_quad; q++) { position offset; switch (q % 4) { case 0: offset.x = radius; break; case 1: offset.y = radius; break; case 2: offset.x = -radius; break; case 3: offset.y = -radius; break; } p->encompass(cent + offset); } } // We ignore the with attribute. The at attribute always refers to the center. linear_object * object_spec::make_arc(position *curpos, direction *dirp) { *dirp = dir; int cw = (flags & IS_CLOCKWISE) != 0; // compute the start position startpos; if (flags & HAS_FROM) startpos = from; else startpos = *curpos; if (!(flags & HAS_RADIUS)) lookup_variable("arcrad", &radius); // compute the end position endpos; if (flags & HAS_TO) endpos = to; else { position m(radius, radius); // Adjust the signs. if (cw) { if (dir == DOWN_DIRECTION || dir == LEFT_DIRECTION) m.x = -m.x; if (dir == DOWN_DIRECTION || dir == RIGHT_DIRECTION) m.y = -m.y; *dirp = direction((dir + 3) % 4); } else { if (dir == UP_DIRECTION || dir == LEFT_DIRECTION) m.x = -m.x; if (dir == DOWN_DIRECTION || dir == LEFT_DIRECTION) m.y = -m.y; *dirp = direction((dir + 1) % 4); } endpos = startpos + m; } // compute the center position centerpos; if (flags & HAS_AT) centerpos = at; else if (startpos == endpos) centerpos = startpos; else { position h = (endpos - startpos)/2.0; double d = hypot(h); if (radius <= 0) radius = .25; // make the radius big enough while (radius < d) radius *= 2.0; double alpha = acos(d/radius); double theta = atan2(h.y, h.x); if (cw) theta -= alpha; else theta += alpha; centerpos = position(cos(theta), sin(theta))*radius + startpos; } arc_object *p = new arc_object(cw, startpos, endpos, centerpos); *curpos = endpos; return p; } graphic_object * object_spec::make_linear(position *curpos, direction *dirp) { linear_object *obj; if (type == ARC_OBJECT) obj = make_arc(curpos, dirp); else obj = make_line(curpos, dirp); if (type == ARROW_OBJECT && (flags & (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD)) == 0) flags |= HAS_RIGHT_ARROW_HEAD; if (obj && (flags & (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD))) { arrow_head_type a; int at_start = (flags & HAS_LEFT_ARROW_HEAD) != 0; int at_end = (flags & HAS_RIGHT_ARROW_HEAD) != 0; if (flags & HAS_HEIGHT) a.height = height; else lookup_variable("arrowht", &a.height); if (flags & HAS_WIDTH) a.width = width; else lookup_variable("arrowwid", &a.width); double solid; lookup_variable("arrowhead", &solid); a.solid = solid != 0.0; obj->add_arrows(at_start, at_end, a); } return obj; } object * object_spec::make_object(position *curpos, direction *dirp) { graphic_object *obj = 0; switch (type) { case BLOCK_OBJECT: obj = make_block(curpos, dirp); break; case BOX_OBJECT: obj = make_box(curpos, dirp); break; case TEXT_OBJECT: obj = make_text(curpos, dirp); break; case ELLIPSE_OBJECT: obj = make_ellipse(curpos, dirp); break; case CIRCLE_OBJECT: obj = make_circle(curpos, dirp); break; case MOVE_OBJECT: obj = make_move(curpos, dirp); break; case ARC_OBJECT: case LINE_OBJECT: case SPLINE_OBJECT: case ARROW_OBJECT: obj = make_linear(curpos, dirp); break; case MARK_OBJECT: case OTHER_OBJECT: default: assert(0); break; } if (obj) { if (flags & IS_INVISIBLE) obj->set_invisible(); if (text != 0) obj->add_text(text, (flags & IS_ALIGNED) != 0); if (flags & IS_DOTTED) obj->set_dotted(dash_width); else if (flags & IS_DASHED) obj->set_dashed(dash_width); double th; if (flags & HAS_THICKNESS) th = thickness; else lookup_variable("linethick", &th); obj->set_thickness(th); if (flags & (IS_DEFAULT_FILLED|IS_FILLED)) { if (flags & IS_DEFAULT_FILLED) lookup_variable("fillval", &fill); if (fill < 0.0) error("bad fill value %1", fill); else obj->set_fill(fill); } } return obj; } class string_list { public: // ctor, dtor string_list(char *); ~string_list(); // public data string_list *next; char *str; }; string_list::string_list(char *s) : next(0), str(s) { } string_list::~string_list() { a_delete str; } ////////////////////////////////////////////////////////////////////// // The PATH class, declared in object.h ////////////////////////////////////////////////////////////////////// // A path is used to hold the argument to the `with' attribute. For example, // `.nw' or `.A.s' or `.A'. The major operation on a path is to take a // place and follow the path through the place to place within the place. // Note that `.A.B.C.sw' will work. path::path(corner c) : crn(c), label_list(0), ypath(0) { } path::path(char *l, corner c) : crn(c), ypath(0) { label_list = new string_list(l); } path::~path() { while (label_list) { string_list *tem = label_list; label_list = label_list->next; delete tem; } delete ypath; } void path::append(corner c) { assert(crn == 0); crn = c; } void path::append(char *s) { string_list **p; for (p = &label_list; *p; p = &(*p)->next) ; *p = new string_list(s); } void path::set_ypath(path *p) { ypath = p; } // return non-zero for success int path::follow(const place &pl, place *result) const { const place *p = &pl; for (string_list *lb = label_list; lb; lb = lb->next) if (p->obj == 0 || (p = p->obj->find_label(lb->str)) == 0) { lex_error("object does not contain a place `%1'", lb->str); return 0; } if (crn == 0 || p->obj == 0) *result = *p; else { position pos = ((p->obj)->*(crn))(); result->x = pos.x; result->y = pos.y; result->obj = 0; } if (ypath) { place tem; if (!ypath->follow(pl, &tem)) return 0; result->y = tem.y; if (result->obj != tem.obj) result->obj = 0; } return 1; } static void print_object_list(object *p) { for (; p; p = p->next) { p->print(); p->print_text(); } } void print_picture(object *obj) { bounding_box bb; double scale; for (object *p = obj; p; p = p->next) p->update_bounding_box (&bb); lookup_variable ("scale", &scale); out->start_picture (scale, bb.ll, bb.ur); print_object_list (obj); out->finish_picture (); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/plot.cc����������������������������������������������������������������������0000644�0001750�0001750�00000064666�11037241157�013405� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* This file is part of the GNU plotutils package. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc. The GNU plotutils package is free software. You may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software foundation; either version 2, or (at your option) any later version. The GNU plotutils package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GNU plotutils package; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor, Boston, MA 02110-1301, USA. */ // The `plot_output' class, subclassed from the `common_output' class. // In this class we invoke GNU libplot operations to draw objects. // If the `precision_dashing' flag is set, we draw some types of object // (arcs, polygons, circles, rounded boxes) in a special way. The object // boundary is drawn as a sequence of line segments (if it's to be // "dashed") or a sequence of filled circles (if it's to be "dotted"). // This is done by invoking e.g. the dashed_arc, dotted_arc, dashed_circle, // dotted_circle, and rounded_box operations in the `common_output' // superclass. // This is the only reason why we subclass from `common_output', rather // than directly from `output'. #include "pic.h" #include "output.h" #include "common.h" #include "plot.h" // libplot header file // Plotter parameter array, set from command line in main.cc extern plPlotterParams *plotter_params; // size of graphics display in `virtual inches' #define DISPLAY_SIZE_IN_INCHES 8.0 #define POINTS_PER_INCH 72.0 // color name array in libplot; undocumented but accessible to programmers typedef struct { const char *name; unsigned char red; unsigned char green; unsigned char blue; } Colornameinfo; extern const Colornameinfo _colornames[]; // our libplot driver class plot_output : public common_output { public: // ctor, dtor plot_output(); ~plot_output(); // basic interface void start_picture (double sc, const position &ll, const position &ur); void finish_picture (void); // draw objects void arc (const position &start, const position ¢, const position &end, const line_type <); void circle (const position ¢, double rad, const line_type <, double fill); void ellipse (const position ¢, const distance &dim, const line_type <, double fill); void line (const position &start, const position *v, int n, const line_type <); void polygon (const position *v, int n, const line_type <, double fill); void spline (const position &start, const position *v, int n, const line_type <); void text (const position ¢er, text_piece *v, int n, double angle); void rounded_box (const position ¢, const distance &dim, double rad, const line_type <, double fill); // attribute-querying function int supports_filled_polygons (void); private: // parameters plPlotter *plotter; // pointer to opaque libplot Plotter object double default_plotter_line_thickness; // line thickness in virtual points int pen_red, pen_green, pen_blue; // 48-bit pen color // dynamic variables, keep track of Plotter drawing state int plotter_line_type; // one of line_type::solid etc. int plotter_fill_fraction; // libplot fill fraction double plotter_line_thickness; // in virtual points bool plotter_visible_pen; // default is `yes' bool plotter_path_in_progress; // need to break? // internal functions, modify Plotter drawing state void set_line_type_and_thickness (const line_type <); void set_fill (double fill); void set_pen_visibility (bool visible); // invoked by common_output dotting methods void dot (const position &pos, const line_type <); }; output * make_plot_output() { return new plot_output; } plot_output::plot_output() { if ((plotter = pl_newpl_r (output_format, NULL, stdout, stderr, plotter_params)) == NULL) { fprintf (stderr, "%s: error: could not open plot device\n", program_name); exit (EXIT_FAILURE); } } plot_output::~plot_output() { pl_deletepl_r (plotter); } void plot_output::start_picture(double sc, const position &ll, const position &ur) { double xcen, ycen, xmin, xmax, ymin, ymax; double scale; // open Plotter; record Plotter drawing state defaults pl_openpl_r (plotter); plotter_line_type = line_type::solid; plotter_fill_fraction = 0; // i.e. unfilled plotter_visible_pen = true; plotter_path_in_progress = false; // Compute scale factor via compute_scale() method of output // class; see object.cc. .PS line may contain desired width/height // in virtual inches; if so, scale to it. If .PS line doesn't contain // desired width/height, scale according to the global `scale' variable // (normally set at top of pic file. But on no account violate // the bounds maxpswid/maxpsht. scale = compute_scale(sc, ll, ur); /* Initialize map from user space to device space, by specifying rectangle in user space that will be mapped to graphics display in device space. Possibly choose rectangle so that plot will be centered on the display. */ if (no_centering_flag) { xmin = 0.0; ymin = 0.0; } else // center { xcen = 0.5 * (ll.x + ur.x); ycen = 0.5 * (ll.y + ur.y); xmin = xcen - 0.5 * DISPLAY_SIZE_IN_INCHES * scale; ymin = ycen - 0.5 * DISPLAY_SIZE_IN_INCHES * scale; } xmax = xmin + DISPLAY_SIZE_IN_INCHES * scale; ymax = ymin + DISPLAY_SIZE_IN_INCHES * scale; pl_fspace_r (plotter, xmin, ymin, xmax, ymax); // clear Plotter of objects; initialize font name pl_erase_r (plotter); if (font_name) pl_fontname_r (plotter, font_name); // set pen/fill color (will modify later only by invoking pl_filltype_r) if (pen_color_name) pl_colorname_r (plotter, pen_color_name); // initialize font size and line thickness from values that can be set on // the command line (latter is dynamic, can be altered in pic file) font_size *= scale; line_width *= scale; if (font_size >= 0.0) // `font size', as set on command line, is in terms of display width, // but libplot, according to our scaling, uses virtual inches; so we // convert pl_ffontsize_r (plotter, DISPLAY_SIZE_IN_INCHES * font_size); else // use Plotter default; no need to issue a fontsize() instruction { } if (line_width >= 0.0) { // `line_width', as set on command line, is in terms of display // width, but libplot, according to our scaling, uses virtual inches; // pic2plot, uses virtual points both internally and in pic scripts pl_flinewidth_r (plotter, DISPLAY_SIZE_IN_INCHES * line_width); default_plotter_line_thickness = DISPLAY_SIZE_IN_INCHES * POINTS_PER_INCH * line_width; } else // use Plotter default, represented internally by pic2plot as -1; // no need to issue a linewidth() instruction default_plotter_line_thickness = -1.0; /* store initial line thickness as a default, for later use */ plotter_line_thickness = default_plotter_line_thickness; } void plot_output::finish_picture() { pl_closepl_r (plotter); } ////////////////////////////////////////////////////////////////////// // SET PLOTTER DRAWING ATTRIBUTES ////////////////////////////////////////////////////////////////////// // Manipulate fill color (idempotent, so may not actually do anything, // i.e. may not break the path in progress, if any). void plot_output::set_fill (double fill) { int fill_fraction; if (fill < 0.0) fill_fraction = 0; // unfilled else { if (fill > 1.0) fill = 1.0; /* fill=0.0 is white, fraction=0xffff; fill=1.0 is solid color, fraction = 1 */ fill_fraction = 0xffff - IROUND(0xfffe * fill); } if (fill_fraction != plotter_fill_fraction) { // manipulate fill color by setting the fill fraction pl_filltype_r (plotter, fill_fraction); plotter_fill_fraction = fill_fraction; plotter_path_in_progress = false; } } // Set line type (solid/dashed/dotted) and thickness. May not invoke a // libplot operation if neither needs to be changed, so may not break the // path in progress (if any). void plot_output::set_line_type_and_thickness (const line_type <) { switch (lt.type) { case line_type::solid: default: if (plotter_line_type != line_type::solid) { pl_linemod_r (plotter, "solid"); plotter_line_type = line_type::solid; plotter_path_in_progress = false; } break; case line_type::dotted: if (plotter_line_type != line_type::dotted) { double dashbuf[2]; pl_linemod_r (plotter, "dotted"); dashbuf[0] = 0.25 * lt.dash_width; dashbuf[1] = 0.75 * lt.dash_width; pl_flinedash_r (plotter, 2, dashbuf, 0.0); plotter_line_type = line_type::dotted; plotter_path_in_progress = false; } break; case line_type::dashed: if (plotter_line_type != line_type::dashed) { double dashbuf[2]; pl_linemod_r (plotter, "shortdashed"); dashbuf[0] = dashbuf[1] = lt.dash_width; pl_flinedash_r (plotter, 2, dashbuf, 0.0); plotter_line_type = line_type::dashed; plotter_path_in_progress = false; } break; } if (lt.thickness != plotter_line_thickness && !(lt.thickness < 0.0 && plotter_line_thickness < 0.0)) // need to change (recall negative thickness means `default') { if (lt.thickness < 0) pl_flinewidth_r (plotter, default_plotter_line_thickness / POINTS_PER_INCH); else pl_flinewidth_r (plotter, lt.thickness / POINTS_PER_INCH); plotter_line_thickness = lt.thickness; plotter_path_in_progress = false; } } // Set pen visibility (true/false). This is needed for precision dashing // around the boundary of any closed object; provided that it is filled, at // least. When first drawing the closed object itself, pen visibility // needs to be set to `false'. void plot_output::set_pen_visibility (bool visible) { if (visible != plotter_visible_pen) { if (visible) pl_pentype_r (plotter, 1); else pl_pentype_r (plotter, 0); plotter_visible_pen = visible; } } ////////////////////////////////////////////////////////////////////// // TEXT ////////////////////////////////////////////////////////////////////// // Draw a text object. void plot_output::text(const position ¢er, text_piece *v, int n, double angle) { int horizontal_adj, vertical_adj; double line_spacing; // convert from fraction of width of display, to virtual inches // also multiply by 1.2 (cf. 10pt with 12pt leading) line_spacing = 1.2 * (DISPLAY_SIZE_IN_INCHES * font_size); if (n > 0) { pl_ftextangle_r (plotter, 180 * angle / M_PI); plotter_path_in_progress = false; set_pen_visibility (true); // libplot may need this } for (int i = 0; i < n; i++) { pl_fmove_r (plotter, center.x - (0.5*(n-1) - i) * line_spacing * sin(angle), center.y + (0.5*(n-1) - i) * line_spacing * cos(angle)); plotter_path_in_progress = false; switch ((int)(v[i].adj.h)) { case (int)CENTER_ADJUST: default: horizontal_adj = 'c'; break; case (int)LEFT_ADJUST: horizontal_adj = 'l'; break; case (int)RIGHT_ADJUST: horizontal_adj = 'r'; break; } switch ((int)(v[i].adj.v)) { case (int)NONE_ADJUST: default: vertical_adj = 'c'; break; case (int)ABOVE_ADJUST: vertical_adj = 'b'; break; case (int)BELOW_ADJUST: vertical_adj = 't'; break; } pl_alabel_r (plotter, horizontal_adj, vertical_adj, v[i].text); plotter_path_in_progress = false; } } ////////////////////////////////////////////////////////////////////// // OPEN PIC OBJECTS ////////////////////////////////////////////////////////////////////// // Draw a polyline ("open" in pic's sense, i.e., unfilled, may be part of a // continuing path). void plot_output::line(const position &start, const position *v, int n, const line_type <) { if (n == 0) return; if (lt.type == line_type::invisible) { pl_fmove_r (plotter, v[n-1].x, v[n-1].y); plotter_path_in_progress = false; return; } set_fill (-1.0); // unfilled, pic convention set_pen_visibility (true); if (!precision_dashing || lt.type == line_type::solid) { set_line_type_and_thickness (lt); pl_fline_r (plotter, start.x, start.y, v[0].x, v[0].y); for (int i = 1; i < n; i++) pl_fcont_r (plotter, v[i].x, v[i].y); plotter_path_in_progress = true; } else { switch (lt.type) { case line_type::dashed: { // edge polyline, with dashes line_type slt = lt; slt.type = line_type::solid; set_line_type_and_thickness (slt); position from_point = start, to_point = v[0]; for (int i = 0; i < n; i++) { distance vec(to_point - from_point); double dist = hypot(vec); if (dist <= lt.dash_width*2.0) pl_fline_r (plotter, from_point.x, from_point.y, to_point.x, to_point.y); else { // round number of dashes to integer, along each segment int ndashes = int((dist - lt.dash_width)/(lt.dash_width*2.0) + .5); distance dash_vec = vec*(lt.dash_width/dist); double dash_gap = (dist - lt.dash_width)/ndashes; distance dash_gap_vec = vec*(dash_gap/dist); for (int j = 0; j <= ndashes; j++) { position s(from_point + dash_gap_vec*j); pl_fline_r (plotter, s.x, s.y, s.x + dash_vec.x, s.y + dash_vec.y); } } from_point = v[i]; to_point = v[i+1]; } pl_endpath_r (plotter); plotter_path_in_progress = false; } break; case line_type::dotted: { // edge polyline, with dots position from_point = start, to_point = v[0]; for (int i = 0; i < n; i++) { distance vec(to_point - from_point); double dist = hypot(vec); // round dot spacings to integer, along line segment int ndots = IROUND(dist/lt.dash_width); if (ndots == 0) dot (from_point, lt); else { vec /= double(ndots); for (int j = 0; j <= ndots; j++) dot (from_point + vec*j, lt); } from_point = v[i]; to_point = v[i+1]; } } break; default: break; } } } // Draw a spline ("open" in pic's sense, i.e. unfilled, may be part // of a continuing path). void plot_output::spline(const position &start, const position *v, int n, const line_type <) { if (n == 0) return; if (lt.type == line_type::invisible) { pl_fmove_r (plotter, v[n-1].x, v[n-1].y); plotter_path_in_progress = false; return; } set_fill (-1.0); // unfilled, pic convention set_pen_visibility (true); set_line_type_and_thickness (lt); if (n == 1) pl_fline_r (plotter, start.x, start.y, v[0].x, v[0].y); else if (n == 2) pl_fbezier2_r (plotter, start.x, start.y, v[0].x, v[0].y, v[1].x, v[1].y); else { pl_fbezier2_r (plotter, start.x, start.y, v[0].x, v[0].y, 0.5 * (v[0].x + v[1].x), 0.5 * (v[0].y + v[1].y)); for (int i = 0; i < n - 3; i++) pl_fbezier2_r (plotter, 0.5 * (v[i].x + v[i+1].x), 0.5 * (v[i].y + v[i+1].y), v[i+1].x, v[i+1].y, 0.5 * (v[i+1].x + v[i+2].x), 0.5 * (v[i+1].y + v[i+2].y)); pl_fbezier2_r (plotter, 0.5 * (v[n-3].x + v[n-2].x), 0.5 * (v[n-3].y + v[n-2].y), v[n-2].x, v[n-2].y, v[n-1].x, v[n-1].y); } plotter_path_in_progress = true; } // Draw an arc object ("open" in pic's sense, i.e., unfilled, may // be part of a continuing path). void plot_output::arc (const position &start, const position ¢, const position &end, const line_type <) // in libplot, arcs don't subtend >= 180 degrees, but that's OK // because they don't subtend >=180 degrees in pic either { if (lt.type == line_type::invisible) { pl_fmove_r (plotter, end.x, end.y); plotter_path_in_progress = false; return; } set_fill (-1.0); // unfilled (pic convention) set_pen_visibility (true); if (!precision_dashing || lt.type == line_type::solid) { set_line_type_and_thickness (lt); pl_farc_r (plotter, cent.x, cent.y, start.x, start.y, end.x, end.y); plotter_path_in_progress = true; } else { line_type slt; slt = lt; slt.type = line_type::solid; set_line_type_and_thickness (slt); switch (lt.type) { case line_type::dashed: // edge arc, with dashes if (plotter_path_in_progress) pl_endpath_r (plotter); dashed_arc (start, cent, end, lt); pl_endpath_r (plotter); plotter_path_in_progress = false; break; case line_type::dotted: // edge arc, with dots dotted_arc (start, cent, end, lt); plotter_path_in_progress = false; break; default: break; } } } ////////////////////////////////////////////////////////////////////// // CLOSED PIC OBJECTS // (some drawn differently if we do `precision dashing') ////////////////////////////////////////////////////////////////////// // Draw a polyline object ("closed" in pic's sense). void plot_output::polygon(const position *v, int n, const line_type <, double fill) { if (lt.type == line_type::invisible) { pl_fmove_r (plotter, v[n-1].x, v[n-1].y); plotter_path_in_progress = false; return; } if (!precision_dashing || lt.type == line_type::solid) { set_fill (fill); set_pen_visibility (true); set_line_type_and_thickness (lt); if (n == 4 && v[0].x == v[1].x && v[2].x == v[3].x && v[0].y == v[3].y && v[1].y == v[2].y) { pl_fbox_r (plotter, v[3].x, v[3].y, v[1].x, v[1].y); plotter_path_in_progress = false; } else { pl_fmove_r (plotter, v[n-1].x, v[n-1].y); for (int i = 0; i < n; i++) pl_fcont_r (plotter, v[i].x, v[i].y); pl_endpath_r (plotter); plotter_path_in_progress = false; } } else // precision dashing (or dotting) { line_type slt; if (fill >= 0.0) // fill polygon, but don't edge it { set_fill (fill); slt.type = line_type::solid; slt.thickness = 0.0; set_line_type_and_thickness (slt); set_pen_visibility (false); // edge will not be drawn pl_fmove_r (plotter, v[n-1].x, v[n-1].y); for (int i = 0; i < n; i++) pl_fcont_r (plotter, v[i].x, v[i].y); pl_endpath_r (plotter); plotter_path_in_progress = false; } // draw polygon boundary (unfilled) set_fill (-1.0); set_pen_visibility (true); switch (lt.type) { case line_type::dashed: { // edge polygon, with dashes slt = lt; slt.type = line_type::solid; set_line_type_and_thickness (slt); position from_point = v[n-1], to_point = v[0]; for (int i = 0; i < n; i++) { distance vec(to_point - from_point); double dist = hypot(vec); if (dist <= lt.dash_width*2.0) pl_fline_r (plotter, from_point.x, from_point.y, to_point.x, to_point.y); else { // round number of dashes to integer, along each segment int ndashes = int((dist - lt.dash_width)/(lt.dash_width*2.0) + .5); distance dash_vec = vec*(lt.dash_width/dist); double dash_gap = (dist - lt.dash_width)/ndashes; distance dash_gap_vec = vec*(dash_gap/dist); for (int j = 0; j <= ndashes; j++) { position s(from_point + dash_gap_vec*j); pl_fline_r (plotter, s.x, s.y, s.x + dash_vec.x, s.y + dash_vec.y); } } from_point = v[i]; to_point = v[i+1]; } pl_endpath_r (plotter); plotter_path_in_progress = false; } break; case line_type::dotted: { // edge polygon, with dots position from_point = v[n-1], to_point = v[0]; for (int i = 0; i < n; i++) { distance vec(to_point - from_point); double dist = hypot(vec); // round dot spacings to integer, along line segment int ndots = IROUND(dist/lt.dash_width); if (ndots == 0) dot (from_point, lt); else { vec /= double(ndots); for (int j = 0; j <= ndots; j++) dot (from_point + vec*j, lt); } from_point = v[i]; to_point = v[i+1]; } } break; default: // shouldn't happen break; } } } // Draw a circle object ("closed" in pic's sense). void plot_output::circle (const position ¢, double rad, const line_type <, double fill) { if (lt.type == line_type::invisible) { pl_fmove_r (plotter, cent.x, cent.y); plotter_path_in_progress = false; return; } if (!precision_dashing || lt.type == line_type::solid) { set_fill (fill); set_pen_visibility (true); set_line_type_and_thickness (lt); pl_fcircle_r (plotter, cent.x, cent.y, rad); plotter_path_in_progress = false; } else // precision dashing (or dotting) { line_type slt; if (fill >= 0.0) // fill circle, but don't edge it { set_fill (fill); set_pen_visibility (false); // edge will not be drawn slt = lt; slt.type = line_type::solid; slt.thickness = 0.0; set_line_type_and_thickness (slt); pl_fcircle_r (plotter, cent.x, cent.y, rad); plotter_path_in_progress = false; } // draw circle boundary (unfilled) set_fill (-1.0); set_pen_visibility (true); slt = lt; slt.type = line_type::solid; set_line_type_and_thickness (slt); switch (lt.type) { case line_type::dashed: // edge circle, with dashes if (plotter_path_in_progress) pl_endpath_r (plotter); dashed_circle(cent, rad, lt); pl_endpath_r (plotter); plotter_path_in_progress = false; break; case line_type::dotted: // edge circle, with dots dotted_circle (cent, rad, lt); break; default: // shouldn't happen break; } } } // Draw a rounded box object ("closed" in pic's sense). void plot_output::rounded_box(const position ¢, const distance &dim, double rad, const line_type <, double fill) { static bool recursive = false; position tem, arc_start, arc_cent, arc_end; position line_start, line_end; if (lt.type == line_type::invisible) { pl_fmove_r (plotter, cent.x, cent.y); plotter_path_in_progress = false; return; } if (plotter_path_in_progress) { pl_endpath_r (plotter); plotter_path_in_progress = false; } if (!precision_dashing || lt.type == line_type::solid) { set_fill (fill); if (!recursive) // _not_ invoked recursively on account of precision dashing { set_pen_visibility (true); set_line_type_and_thickness (lt); } tem = cent - dim/2.0; arc_start = tem + position(0.0, rad); arc_cent = tem + position(rad, rad); arc_end = tem + position(rad, 0.0); pl_farc_r (plotter, arc_cent.x, arc_cent.y, arc_start.x, arc_start.y, arc_end.x, arc_end.y); line_start = cent + position(-dim.x/2.0 + rad, -dim.y/2.0); line_end = cent + position(dim.x/2.0 - rad, -dim.y/2.0); pl_fline_r (plotter, arc_end.x, arc_end.y, line_end.x, line_end.y); tem = cent + position(dim.x/2.0, -dim.y/2.0); arc_start = tem + position(-rad, 0.0); arc_cent = tem + position(-rad, rad); arc_end = tem + position(0.0, rad); pl_farc_r (plotter, arc_cent.x, arc_cent.y, line_end.x, line_end.y, arc_end.x, arc_end.y); line_start = cent + position(dim.x/2.0, -dim.y/2.0 + rad); line_end = cent + position(dim.x/2.0, dim.y/2.0 - rad); pl_fline_r (plotter, arc_end.x, arc_end.y, line_end.x, line_end.y); tem = cent + dim/2.0; arc_start = tem + position(0.0, -rad); arc_cent = tem + position(-rad, -rad); arc_end = tem + position(-rad, 0.0); pl_farc_r (plotter, arc_cent.x, arc_cent.y, line_end.x, line_end.y, arc_end.x, arc_end.y); line_start = cent + position(dim.x/2.0 - rad, dim.y/2.0); line_end = cent + position(-dim.x/2.0 + rad, dim.y/2.0); pl_fline_r (plotter, arc_end.x, arc_end.y, line_end.x, line_end.y); tem = cent + position(-dim.x/2.0, dim.y/2.0); arc_start = tem + position(rad, 0.0); arc_cent = tem + position(rad, -rad); arc_end = tem + position(0.0, -rad); pl_farc_r (plotter, arc_cent.x, arc_cent.y, line_end.x, line_end.y, arc_end.x, arc_end.y); line_start = cent + position(-dim.x/2.0, dim.y/2.0 - rad); line_end = cent + position(-dim.x/2.0, -dim.y/2.0 + rad); pl_fline_r (plotter, arc_end.x, arc_end.y, line_end.x, line_end.y); pl_endpath_r (plotter); plotter_path_in_progress = false; } else // precision dashing (or dotting) { if (fill >= 0.0) { // fill rounded box (boundary solid, thickness 0) via recursive call set_fill (fill); set_pen_visibility (false); // edge will not be drawn line_type slt = lt; slt.type = line_type::solid; slt.thickness = 0.0; recursive = true; rounded_box(cent, dim, rad, slt, fill); recursive = false; plotter_path_in_progress = false; } // draw rounded box boundary, unfilled set_pen_visibility (true); set_line_type_and_thickness (lt); // only thickness is relevant common_output::rounded_box(cent, dim, rad, lt, -1.0); //-1 means unfilled if (plotter_path_in_progress) { pl_endpath_r (plotter); plotter_path_in_progress = false; } } } // Draw an ellipse object ("closed" in pic's sense). // No support for precision dashing, but there should be. void plot_output::ellipse(const position ¢, const distance &dim, const line_type <, double fill) { if (lt.type == line_type::invisible) { pl_fmove_r (plotter, cent.x, cent.y); plotter_path_in_progress = false; return; } set_fill (fill); set_pen_visibility (true); set_line_type_and_thickness (lt); pl_fellipse_r (plotter, cent.x, cent.y, 0.5 * dim.x, 0.5 * dim.y, 0.0); plotter_path_in_progress = false; } ////////////////////////////////////////////////////////////////////// // MISC. ////////////////////////////////////////////////////////////////////// // Internal function, used for precision dotting; also invoked by // precision dotting methods in the common_output superclass. void plot_output::dot (const position ¢, const line_type <) // lt arg determines diameter of dot { line_type slt; set_fill (1.0); set_pen_visibility (true); slt.type = line_type::solid; slt.thickness = 0.0; set_line_type_and_thickness (slt); pl_fcircle_r (plotter, cent.x, cent.y, 0.5 * lt.thickness / POINTS_PER_INCH); plotter_path_in_progress = false; } int plot_output::supports_filled_polygons() { return 1; } ��������������������������������������������������������������������������plotutils-2.6/pic2plot/gram.yy����������������������������������������������������������������������0000644�0001750�0001750�00000105352�07126276575�013435� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// -*- C++ -*- /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) */ %{ #include "pic.h" #include "object.h" ////////////////////////////////////////////////////////////////////// // PIC PARSER // Public interface: // // parse_init() [should be called only once] // yyparse() // parse_cleanup() [should be called after each parse] // define_variable(), lookup_variable() [declared in object.h, // also used in lex.cc for `for' loops] // // delim_flag [state flag read by lexer in lex.cc] // // The parser makes heavy use of special functions provided by the lexer, // such as do_copy(), do_for(), copy_file_thru(), copy_rest_thru(), // push_body(), and especially do_lookahead(). It also calls lex_warning() // and lex_error(). ////////////////////////////////////////////////////////////////////// #undef fmod #undef rand #undef srand extern "C" { double fmod(double, double); int rand(); void srand(unsigned int); } // Maximum number of characters produced by printf("%g") #define GDIGITS 14 static char sprintf_buf[1024]; direction current_direction; position current_position; implement_ptable(place) PTABLE(place) top_table; PTABLE(place) *current_table = &top_table; saved_state *current_saved_state = 0; object_list olist; // external variable, used by lexer int delim_flag = 0; // forward references static place *lookup_label(const char *label); static void define_label(const char *label, const place *pl); static void reset (const char *nm); static void reset_all (void); static const char * ordinal_postfix(int n); static const char * object_type_name(object_type type); static char * format_number(const char *form, double n); static char * do_sprintf(const char *form, const double *v, int nv); %} %union { char *str; int n; double x; struct { double x, y; } pair; struct { double x; char *body; } if_data; struct { char *str; const char *filename; int lineno; } lstr; struct { double *v; int nv; int maxv; } dv; struct { double val; int is_multiplicative; } by; place pl; object *obj; corner crn; path *pth; object_spec *spec; saved_state *pstate; graphics_state state; object_type obtype; } %token LABEL %token VARIABLE %token NUMBER %token TEXT %token COMMAND_LINE %token DELIMITED %token ORDINAL %token TH %token LEFT_ARROW_HEAD %token RIGHT_ARROW_HEAD %token DOUBLE_ARROW_HEAD %token LAST %token UP %token DOWN %token LEFT %token RIGHT %token BOX %token CIRCLE %token ELLIPSE %token ARC %token LINE %token ARROW %token MOVE %token SPLINE %token HEIGHT %token RADIUS %token WIDTH %token DIAMETER %token UP %token DOWN %token RIGHT %token LEFT %token FROM %token TO %token AT %token WITH %token BY %token THEN %token DOTTED %token DASHED %token CHOP %token SAME %token INVISIBLE %token LJUST %token RJUST %token ABOVE %token BELOW %token OF %token THE %token WAY %token BETWEEN %token AND %token HERE %token DOT_N %token DOT_E %token DOT_W %token DOT_S %token DOT_NE %token DOT_SE %token DOT_NW %token DOT_SW %token DOT_C %token DOT_START %token DOT_END %token DOT_X %token DOT_Y %token DOT_HT %token DOT_WID %token DOT_RAD %token SIN %token COS %token ATAN2 %token LOG %token EXP %token SQRT %token K_MAX %token K_MIN %token INT %token RAND %token SRAND %token COPY %token THRU %token TOP %token BOTTOM %token UPPER %token LOWER %token SH %token PRINT %token CW %token CCW %token FOR %token DO %token IF %token ELSE %token ANDAND %token OROR %token NOTEQUAL %token EQUALEQUAL %token LESSEQUAL %token GREATEREQUAL %token LEFT_CORNER %token RIGHT_CORNER %token CENTER %token END %token START %token RESET %token UNTIL %token PLOT %token THICKNESS %token FILL %token ALIGNED %token SPRINTF %token COMMAND %token DEFINE %token UNDEF // this ensures that plot 17 "%g" parses as (plot 17 "%g") %left PLOT %left TEXT SPRINTF // give text adjustments higher precedence than TEXT, so that // box "foo" above ljust == box ("foo" above ljust) %left LJUST RJUST ABOVE BELOW %left LEFT RIGHT // Give attributes that take an optional expression a higher precedence // than left and right, so that eg `line chop left' parses properly. %left CHOP DASHED DOTTED UP DOWN FILL %left LABEL %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST %left ORDINAL HERE '`' // these need to be lower than '-' %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS // these must have higher precedence than CHOP so that `label %prec CHOP' works %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER %left UPPER LOWER CENTER START END %left ',' %left OROR %left ANDAND %left EQUALEQUAL NOTEQUAL %left '<' '>' LESSEQUAL GREATEREQUAL %left BETWEEN OF %left AND %left '+' '-' %left '*' '/' '%' %right '!' %right '^' %type expr any_expr text_expr %type optional_by %type expr_pair position_not_place %type simple_if %type nth_primitive %type corner %type path label_path relative_path %type place label element element_list middle_element_list %type object_spec %type position %type object_type %type optional_ordinal_last ordinal %type until %type sprintf_args %type text print_args print_arg %% top: optional_separator | element_list { if (olist.head) print_picture(olist.head); } ; element_list: optional_separator middle_element_list optional_separator { $$ = $2; } ; middle_element_list: element { $$ = $1; } | middle_element_list separator element { $$ = $1; } ; optional_separator: // empty | separator ; separator: ';' | separator ';' ; placeless_element: VARIABLE '=' any_expr { define_variable($1, $3); a_delete $1; } | VARIABLE ':' '=' any_expr { place *p = lookup_label($1); if (!p) { lex_error("variable `%1' not defined", $1); YYABORT; } p->obj = 0; p->x = $4; p->y = 0.0; a_delete $1; } | UP { current_direction = UP_DIRECTION; } | DOWN { current_direction = DOWN_DIRECTION; } | LEFT { current_direction = LEFT_DIRECTION; } | RIGHT { current_direction = RIGHT_DIRECTION; } | COMMAND_LINE { olist.append(make_command_object($1.str, $1.filename, $1.lineno)); } | COMMAND print_args { olist.append(make_command_object($2.str, $2.filename, $2.lineno)); } | PRINT print_args { fprintf(stderr, "%s\n", $2.str); a_delete $2.str; fflush(stderr); } | SH { delim_flag = 1; } DELIMITED { delim_flag = 0; if (safer_flag) lex_error("unsafe to run command `%1'", $3); else system($3); a_delete $3; } | COPY TEXT { if (yychar < 0) do_lookahead(); do_copy($2.str); // do not delete the filename } | COPY TEXT THRU { delim_flag = 2; } DELIMITED { delim_flag = 0; } until { if (yychar < 0) do_lookahead(); copy_file_thru($2.str, $5, $7); // do not delete the filename a_delete $5; a_delete $7; } | COPY THRU { delim_flag = 2; } DELIMITED { delim_flag = 0; } until { if (yychar < 0) do_lookahead(); copy_rest_thru($4, $6); a_delete $4; a_delete $6; } | FOR VARIABLE '=' expr TO expr optional_by DO { delim_flag = 1; } DELIMITED { delim_flag = 0; if (yychar < 0) do_lookahead(); do_for($2, $4, $6, $7.is_multiplicative, $7.val, $10); } | simple_if { if (yychar < 0) do_lookahead(); if ($1.x != 0.0) push_body($1.body); a_delete $1.body; } | simple_if ELSE { delim_flag = 1; } DELIMITED { delim_flag = 0; if (yychar < 0) do_lookahead(); if ($1.x != 0.0) push_body($1.body); else push_body($4); a_delete $1.body; a_delete $4; } | reset_variables | RESET { define_variable("scale", 1.0); } ; reset_variables: RESET VARIABLE { reset($2); a_delete $2; } | reset_variables VARIABLE { reset($2); a_delete $2; } | reset_variables ',' VARIABLE { reset($3); a_delete $3; } ; print_args: print_arg { $$ = $1; } | print_args print_arg { $$.str = new char[strlen($1.str) + strlen($2.str) + 1]; strcpy($$.str, $1.str); strcat($$.str, $2.str); a_delete $1.str; a_delete $2.str; if ($1.filename) { $$.filename = $1.filename; $$.lineno = $1.lineno; } else if ($2.filename) { $$.filename = $2.filename; $$.lineno = $2.lineno; } } ; print_arg: expr %prec ',' { $$.str = new char[GDIGITS + 1]; sprintf($$.str, "%g", $1); $$.filename = 0; $$.lineno = 0; } | text { $$ = $1; } | position %prec ',' { $$.str = new char[GDIGITS + 2 + GDIGITS + 1]; sprintf($$.str, "%g, %g", $1.x, $1.y); $$.filename = 0; $$.lineno = 0; } simple_if: IF any_expr THEN { delim_flag = 1; } DELIMITED { delim_flag = 0; $$.x = $2; $$.body = $5; } ; until: // empty { $$ = 0; } | UNTIL TEXT { $$ = $2.str; } ; any_expr: expr { $$ = $1; } | text_expr { $$ = $1; } ; text_expr: text EQUALEQUAL text { $$ = strcmp($1.str, $3.str) == 0; a_delete $1.str; a_delete $3.str; } | text NOTEQUAL text { $$ = strcmp($1.str, $3.str) != 0; a_delete $1.str; a_delete $3.str; } | text_expr ANDAND text_expr { $$ = ($1 != 0.0 && $3 != 0.0); } | text_expr ANDAND expr { $$ = ($1 != 0.0 && $3 != 0.0); } | expr ANDAND text_expr { $$ = ($1 != 0.0 && $3 != 0.0); } | text_expr OROR text_expr { $$ = ($1 != 0.0 || $3 != 0.0); } | text_expr OROR expr { $$ = ($1 != 0.0 || $3 != 0.0); } | expr OROR text_expr { $$ = ($1 != 0.0 || $3 != 0.0); } | '!' text_expr { $$ = ($2 == 0.0); } ; optional_by: // empty { $$.val = 1.0; $$.is_multiplicative = 0; } | BY expr { $$.val = $2; $$.is_multiplicative = 0; } | BY '*' expr { $$.val = $3; $$.is_multiplicative = 1; } ; element: object_spec { $$.obj = $1->make_object(¤t_position, ¤t_direction); if ($$.obj == 0) YYABORT; delete $1; if ($$.obj) olist.append($$.obj); else { $$.x = current_position.x; $$.y = current_position.y; } } | LABEL ':' optional_separator element { $$ = $4; define_label($1, & $$); a_delete $1; } | LABEL ':' optional_separator position_not_place { $$.obj = 0; $$.x = $4.x; $$.y = $4.y; define_label($1, & $$); a_delete $1; } | LABEL ':' optional_separator place { $$ = $4; define_label($1, & $$); a_delete $1; } | '{' { $$.x = current_position.x; $$.y = current_position.y; $$.dir = current_direction; } element_list '}' { current_position.x = $2.x; current_position.y = $2.y; current_direction = $2.dir; } optional_element { $$ = $3; } | placeless_element { $$.obj = 0; $$.x = current_position.x; $$.y = current_position.y; } ; optional_element: // empty {} | element {} ; object_spec: BOX { $$ = new object_spec(BOX_OBJECT); } | CIRCLE { $$ = new object_spec(CIRCLE_OBJECT); } | ELLIPSE { $$ = new object_spec(ELLIPSE_OBJECT); } | ARC { $$ = new object_spec(ARC_OBJECT); $$->dir = current_direction; } | LINE { $$ = new object_spec(LINE_OBJECT); lookup_variable("lineht", & $$->segment_height); lookup_variable("linewid", & $$->segment_width); $$->dir = current_direction; } | ARROW { $$ = new object_spec(ARROW_OBJECT); lookup_variable("lineht", & $$->segment_height); lookup_variable("linewid", & $$->segment_width); $$->dir = current_direction; } | MOVE { $$ = new object_spec(MOVE_OBJECT); lookup_variable("moveht", & $$->segment_height); lookup_variable("movewid", & $$->segment_width); $$->dir = current_direction; } | SPLINE { $$ = new object_spec(SPLINE_OBJECT); lookup_variable("lineht", & $$->segment_height); lookup_variable("linewid", & $$->segment_width); $$->dir = current_direction; } | text %prec TEXT { $$ = new object_spec(TEXT_OBJECT); $$->text = new text_item($1.str, $1.filename, $1.lineno); } | PLOT expr { $$ = new object_spec(TEXT_OBJECT); $$->text = new text_item(format_number(0, $2), 0, -1); } | PLOT expr text { $$ = new object_spec(TEXT_OBJECT); $$->text = new text_item(format_number($3.str, $2), $3.filename, $3.lineno); a_delete $3.str; } | '[' { saved_state *p = new saved_state; $$ = p; p->x = current_position.x; p->y = current_position.y; p->dir = current_direction; p->tbl = current_table; p->prev = current_saved_state; current_position.x = 0.0; current_position.y = 0.0; current_table = new PTABLE(place); current_saved_state = p; olist.append(make_mark_object()); } element_list ']' { current_position.x = $2->x; current_position.y = $2->y; current_direction = $2->dir; $$ = new object_spec(BLOCK_OBJECT); olist.wrap_up_block(& $$->oblist); $$->tbl = current_table; current_table = $2->tbl; current_saved_state = $2->prev; delete $2; } | object_spec HEIGHT expr { $$ = $1; $$->height = $3; $$->flags |= HAS_HEIGHT; } | object_spec RADIUS expr { $$ = $1; $$->radius = $3; $$->flags |= HAS_RADIUS; } | object_spec WIDTH expr { $$ = $1; $$->width = $3; $$->flags |= HAS_WIDTH; } | object_spec DIAMETER expr { $$ = $1; $$->radius = $3/2.0; $$->flags |= HAS_RADIUS; } | object_spec expr %prec HEIGHT { $$ = $1; $$->flags |= HAS_SEGMENT; switch ($$->dir) { case UP_DIRECTION: $$->segment_pos.y += $2; break; case DOWN_DIRECTION: $$->segment_pos.y -= $2; break; case RIGHT_DIRECTION: $$->segment_pos.x += $2; break; case LEFT_DIRECTION: $$->segment_pos.x -= $2; break; } } | object_spec UP { $$ = $1; $$->dir = UP_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.y += $$->segment_height; } | object_spec UP expr { $$ = $1; $$->dir = UP_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.y += $3; } | object_spec DOWN { $$ = $1; $$->dir = DOWN_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.y -= $$->segment_height; } | object_spec DOWN expr { $$ = $1; $$->dir = DOWN_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.y -= $3; } | object_spec RIGHT { $$ = $1; $$->dir = RIGHT_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.x += $$->segment_width; } | object_spec RIGHT expr { $$ = $1; $$->dir = RIGHT_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.x += $3; } | object_spec LEFT { $$ = $1; $$->dir = LEFT_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.x -= $$->segment_width; } | object_spec LEFT expr { $$ = $1; $$->dir = LEFT_DIRECTION; $$->flags |= HAS_SEGMENT; $$->segment_pos.x -= $3; } | object_spec FROM position { $$ = $1; $$->flags |= HAS_FROM; $$->from.x = $3.x; $$->from.y = $3.y; } | object_spec TO position { $$ = $1; if ($$->flags & HAS_SEGMENT) $$->segment_list = new segment($$->segment_pos, $$->segment_is_absolute, $$->segment_list); $$->flags |= HAS_SEGMENT; $$->segment_pos.x = $3.x; $$->segment_pos.y = $3.y; $$->segment_is_absolute = 1; $$->flags |= HAS_TO; $$->to.x = $3.x; $$->to.y = $3.y; } | object_spec AT position { $$ = $1; $$->flags |= HAS_AT; $$->at.x = $3.x; $$->at.y = $3.y; if ($$->type != ARC_OBJECT) { $$->flags |= HAS_FROM; $$->from.x = $3.x; $$->from.y = $3.y; } } | object_spec WITH path { $$ = $1; $$->flags |= HAS_WITH; $$->with = $3; } | object_spec BY expr_pair { $$ = $1; $$->flags |= HAS_SEGMENT; $$->segment_pos.x += $3.x; $$->segment_pos.y += $3.y; } | object_spec THEN { $$ = $1; if ($$->flags & HAS_SEGMENT) { $$->segment_list = new segment($$->segment_pos, $$->segment_is_absolute, $$->segment_list); $$->flags &= ~HAS_SEGMENT; $$->segment_pos.x = $$->segment_pos.y = 0.0; $$->segment_is_absolute = 0; } } | object_spec DOTTED { $$ = $1; $$->flags |= IS_DOTTED; lookup_variable("dashwid", & $$->dash_width); } | object_spec DOTTED expr { $$ = $1; $$->flags |= IS_DOTTED; $$->dash_width = $3; } | object_spec DASHED { $$ = $1; $$->flags |= IS_DASHED; lookup_variable("dashwid", & $$->dash_width); } | object_spec DASHED expr { $$ = $1; $$->flags |= IS_DASHED; $$->dash_width = $3; } | object_spec FILL { $$ = $1; $$->flags |= IS_DEFAULT_FILLED; } | object_spec FILL expr { $$ = $1; $$->flags |= IS_FILLED; $$->fill = $3; } | object_spec CHOP { $$ = $1; // line chop chop means line chop 0 chop 0 if ($$->flags & IS_DEFAULT_CHOPPED) { $$->flags |= IS_CHOPPED; $$->flags &= ~IS_DEFAULT_CHOPPED; $$->start_chop = $$->end_chop = 0.0; } else if ($$->flags & IS_CHOPPED) { $$->end_chop = 0.0; } else { $$->flags |= IS_DEFAULT_CHOPPED; } } | object_spec CHOP expr { $$ = $1; if ($$->flags & IS_DEFAULT_CHOPPED) { $$->flags |= IS_CHOPPED; $$->flags &= ~IS_DEFAULT_CHOPPED; $$->start_chop = 0.0; $$->end_chop = $3; } else if ($$->flags & IS_CHOPPED) { $$->end_chop = $3; } else { $$->start_chop = $$->end_chop = $3; $$->flags |= IS_CHOPPED; } } | object_spec SAME { $$ = $1; $$->flags |= IS_SAME; } | object_spec INVISIBLE { $$ = $1; $$->flags |= IS_INVISIBLE; } | object_spec LEFT_ARROW_HEAD { $$ = $1; $$->flags |= HAS_LEFT_ARROW_HEAD; } | object_spec RIGHT_ARROW_HEAD { $$ = $1; $$->flags |= HAS_RIGHT_ARROW_HEAD; } | object_spec DOUBLE_ARROW_HEAD { $$ = $1; $$->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD); } | object_spec CW { $$ = $1; $$->flags |= IS_CLOCKWISE; } | object_spec CCW { $$ = $1; $$->flags &= ~IS_CLOCKWISE; } | object_spec text %prec TEXT { $$ = $1; text_item **p; for (p = & $$->text; *p; p = &(*p)->next) ; *p = new text_item($2.str, $2.filename, $2.lineno); } | object_spec LJUST { $$ = $1; if ($$->text) { text_item *p; for (p = $$->text; p->next; p = p->next) ; p->adj.h = LEFT_ADJUST; } } | object_spec RJUST { $$ = $1; if ($$->text) { text_item *p; for (p = $$->text; p->next; p = p->next) ; p->adj.h = RIGHT_ADJUST; } } | object_spec ABOVE { $$ = $1; if ($$->text) { text_item *p; for (p = $$->text; p->next; p = p->next) ; p->adj.v = ABOVE_ADJUST; } } | object_spec BELOW { $$ = $1; if ($$->text) { text_item *p; for (p = $$->text; p->next; p = p->next) ; p->adj.v = BELOW_ADJUST; } } | object_spec THICKNESS expr { $$ = $1; $$->flags |= HAS_THICKNESS; $$->thickness = $3; } | object_spec ALIGNED { $$ = $1; $$->flags |= IS_ALIGNED; } ; text: TEXT { $$ = $1; } | SPRINTF '(' TEXT sprintf_args ')' { $$.filename = $3.filename; $$.lineno = $3.lineno; $$.str = do_sprintf($3.str, $4.v, $4.nv); a_delete $4.v; a_delete $3.str; } ; sprintf_args: // empty { $$.v = 0; $$.nv = 0; $$.maxv = 0; } | sprintf_args ',' expr { $$ = $1; if ($$.nv >= $$.maxv) { if ($$.nv == 0) { $$.v = new double[4]; $$.maxv = 4; } else { double *oldv = $$.v; $$.maxv *= 2; $$.v = new double[$$.maxv]; memcpy($$.v, oldv, $$.nv*sizeof(double)); a_delete oldv; } } $$.v[$$.nv] = $3; $$.nv += 1; } ; position: position_not_place { $$ = $1; } | place { position pos = $1; $$.x = pos.x; $$.y = pos.y; } ; position_not_place: expr_pair { $$ = $1; } | position '+' expr_pair { $$.x = $1.x + $3.x; $$.y = $1.y + $3.y; } | position '-' expr_pair { $$.x = $1.x - $3.x; $$.y = $1.y - $3.y; } | '(' position ',' position ')' { $$.x = $2.x; $$.y = $4.y; } | expr between position AND position { $$.x = (1.0 - $1)*$3.x + $1*$5.x; $$.y = (1.0 - $1)*$3.y + $1*$5.y; } | expr '<' position ',' position '>' { $$.x = (1.0 - $1)*$3.x + $1*$5.x; $$.y = (1.0 - $1)*$3.y + $1*$5.y; } ; between: BETWEEN | OF THE WAY BETWEEN ; expr_pair: expr ',' expr { $$.x = $1; $$.y = $3; } | '(' expr_pair ')' { $$ = $2; } ; place: label %prec CHOP // line at A left == line (at A) left { $$ = $1; } | label corner { path pth($2); if (!pth.follow($1, & $$)) YYABORT; } | corner label { path pth($1); if (!pth.follow($2, & $$)) YYABORT; } | corner OF label { path pth($1); if (!pth.follow($3, & $$)) YYABORT; } | HERE { $$.x = current_position.x; $$.y = current_position.y; $$.obj = 0; } ; label: LABEL { place *p = lookup_label($1); if (!p) { lex_error("there is no place `%1'", $1); YYABORT; } $$ = *p; a_delete $1; } | nth_primitive { $$.obj = $1; } | label '.' LABEL { path pth($3); if (!pth.follow($1, & $$)) YYABORT; } ; ordinal: ORDINAL { $$ = $1; } | '`' any_expr TH { // XXX Check for overflow (and non-integers?). $$ = (int)$2; } ; optional_ordinal_last: LAST { $$ = 1; } | ordinal LAST { $$ = $1; } ; nth_primitive: ordinal object_type { int count = 0; object *p; for (p = olist.head; p != 0; p = p->next) if (p->type() == $2 && ++count == $1) { $$ = p; break; } if (p == 0) { lex_error("there is no %1%2 %3", $1, ordinal_postfix($1), object_type_name($2)); YYABORT; } } | optional_ordinal_last object_type { int count = 0; object *p; for (p = olist.tail; p != 0; p = p->prev) if (p->type() == $2 && ++count == $1) { $$ = p; break; } if (p == 0) { lex_error("there is no %1%2 last %3", $1, ordinal_postfix($1), object_type_name($2)); YYABORT; } } ; object_type: BOX { $$ = BOX_OBJECT; } | CIRCLE { $$ = CIRCLE_OBJECT; } | ELLIPSE { $$ = ELLIPSE_OBJECT; } | ARC { $$ = ARC_OBJECT; } | LINE { $$ = LINE_OBJECT; } | ARROW { $$ = ARROW_OBJECT; } | SPLINE { $$ = SPLINE_OBJECT; } | '[' ']' { $$ = BLOCK_OBJECT; } | TEXT { $$ = TEXT_OBJECT; } ; label_path: '.' LABEL { $$ = new path($2); } | label_path '.' LABEL { $$ = $1; $$->append($3); } ; relative_path: corner { $$ = new path($1); } // give this a lower precedence than LEFT and RIGHT so that // [A: box] with .A left == [A: box] with (.A left) | label_path %prec TEXT { $$ = $1; } | label_path corner { $$ = $1; $$->append($2); } ; path: relative_path { $$ = $1; } | '(' relative_path ',' relative_path ')' { $$ = $2; $$->set_ypath($4); } // The rest of these rules are a compatibility sop. | ORDINAL LAST object_type relative_path { lex_warning("`%1%2 last %3' in `with' argument ignored", $1, ordinal_postfix($1), object_type_name($3)); $$ = $4; } | LAST object_type relative_path { lex_warning("`last %1' in `with' argument ignored", object_type_name($2)); $$ = $3; } | ORDINAL object_type relative_path { lex_warning("`%1%2 %3' in `with' argument ignored", $1, ordinal_postfix($1), object_type_name($2)); $$ = $3; } | LABEL relative_path { lex_warning("initial `%1' in `with' argument ignored", $1); a_delete $1; $$ = $2; } ; corner: DOT_N { $$ = &object::north; } | DOT_E { $$ = &object::east; } | DOT_W { $$ = &object::west; } | DOT_S { $$ = &object::south; } | DOT_NE { $$ = &object::north_east; } | DOT_SE { $$ = &object:: south_east; } | DOT_NW { $$ = &object::north_west; } | DOT_SW { $$ = &object::south_west; } | DOT_C { $$ = &object::center; } | DOT_START { $$ = &object::start; } | DOT_END { $$ = &object::end; } | TOP { $$ = &object::north; } | BOTTOM { $$ = &object::south; } | LEFT { $$ = &object::west; } | RIGHT { $$ = &object::east; } | UPPER LEFT { $$ = &object::north_west; } | LOWER LEFT { $$ = &object::south_west; } | UPPER RIGHT { $$ = &object::north_east; } | LOWER RIGHT { $$ = &object::south_east; } | LEFT_CORNER { $$ = &object::west; } | RIGHT_CORNER { $$ = &object::east; } | UPPER LEFT_CORNER { $$ = &object::north_west; } | LOWER LEFT_CORNER { $$ = &object::south_west; } | UPPER RIGHT_CORNER { $$ = &object::north_east; } | LOWER RIGHT_CORNER { $$ = &object::south_east; } | CENTER { $$ = &object::center; } | START { $$ = &object::start; } | END { $$ = &object::end; } ; expr: VARIABLE { if (!lookup_variable($1, & $$)) { lex_error("there is no variable `%1'", $1); YYABORT; } a_delete $1; } | NUMBER { $$ = $1; } | place DOT_X { if ($1.obj != 0) $$ = $1.obj->origin().x; else $$ = $1.x; } | place DOT_Y { if ($1.obj != 0) $$ = $1.obj->origin().y; else $$ = $1.y; } | place DOT_HT { if ($1.obj != 0) $$ = $1.obj->height(); else $$ = 0.0; } | place DOT_WID { if ($1.obj != 0) $$ = $1.obj->width(); else $$ = 0.0; } | place DOT_RAD { if ($1.obj != 0) $$ = $1.obj->radius(); else $$ = 0.0; } | expr '+' expr { $$ = $1 + $3; } | expr '-' expr { $$ = $1 - $3; } | expr '*' expr { $$ = $1 * $3; } | expr '/' expr { if ($3 == 0.0) { lex_error("division by zero"); YYABORT; } $$ = $1/$3; } | expr '%' expr { if ($3 == 0.0) { lex_error("modulus by zero"); YYABORT; } $$ = fmod($1, $3); } | expr '^' expr { errno = 0; $$ = pow($1, $3); if (errno == EDOM) { lex_error("arguments to `^' operator out of domain"); YYABORT; } if (errno == ERANGE) { lex_error("result of `^' operator out of range"); YYABORT; } } | '-' expr %prec '!' { $$ = -$2; } | '(' any_expr ')' { $$ = $2; } | SIN '(' any_expr ')' { errno = 0; $$ = sin($3); if (errno == ERANGE) { lex_error("sin result out of range"); YYABORT; } } | COS '(' any_expr ')' { errno = 0; $$ = cos($3); if (errno == ERANGE) { lex_error("cos result out of range"); YYABORT; } } | ATAN2 '(' any_expr ',' any_expr ')' { errno = 0; $$ = atan2($3, $5); if (errno == EDOM) { lex_error("atan2 argument out of domain"); YYABORT; } if (errno == ERANGE) { lex_error("atan2 result out of range"); YYABORT; } } | LOG '(' any_expr ')' { errno = 0; $$ = log10($3); if (errno == ERANGE) { lex_error("log result out of range"); YYABORT; } } | EXP '(' any_expr ')' { errno = 0; $$ = pow(10.0, $3); if (errno == ERANGE) { lex_error("exp result out of range"); YYABORT; } } | SQRT '(' any_expr ')' { errno = 0; $$ = sqrt($3); if (errno == EDOM) { lex_error("sqrt argument out of domain"); YYABORT; } } | K_MAX '(' any_expr ',' any_expr ')' { $$ = $3 > $5 ? $3 : $5; } | K_MIN '(' any_expr ',' any_expr ')' { $$ = $3 < $5 ? $3 : $5; } | INT '(' any_expr ')' { $$ = floor($3); } | RAND '(' any_expr ')' { $$ = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*$3); } | RAND '(' ')' { // return a random number in the range [0,1) // portable, but not very random $$ = (rand() & 0x7fff) / double(0x8000); } | SRAND '(' any_expr ')' { $$ = 0; srand((unsigned int)$3); } | expr '<' expr { $$ = ($1 < $3); } | expr LESSEQUAL expr { $$ = ($1 <= $3); } | expr '>' expr { $$ = ($1 > $3); } | expr GREATEREQUAL expr { $$ = ($1 >= $3); } | expr EQUALEQUAL expr { $$ = ($1 == $3); } | expr NOTEQUAL expr { $$ = ($1 != $3); } | expr ANDAND expr { $$ = ($1 != 0.0 && $3 != 0.0); } | expr OROR expr { $$ = ($1 != 0.0 || $3 != 0.0); } | '!' expr { $$ = ($2 == 0.0); } ; %% // bison defines const to be empty unless __STDC__ is defined, which it // isn't under cfront #ifdef const #undef const #endif static struct { const char *name; double val; int scaled; // non-zero if val should be multiplied by scale } defaults_table[] = { { "arcrad", .25, 1 }, { "arrowht", .1, 1 }, { "arrowwid", .05, 1 }, { "circlerad", .25, 1 }, { "boxht", .5, 1 }, { "boxwid", .75, 1 }, { "boxrad", 0.0, 1 }, { "dashwid", .05, 1 }, { "ellipseht", .5, 1 }, { "ellipsewid", .75, 1 }, { "moveht", .5, 1 }, { "movewid", .5, 1 }, { "lineht", .5, 1 }, { "linewid", .5, 1 }, { "textht", 0.0, 1 }, { "textwid", 0.0, 1 }, { "scale", 1.0, 0 }, { "linethick", -1.0, 1 }, // in points (<0 is default); now scaled { "fillval", .5, 0 }, { "arrowhead", 1.0, 0 }, { "maxpswid", 8.5, 0 }, { "maxpsht", 11.0, 0 }, }; static place * lookup_label(const char *label) { saved_state *state = current_saved_state; PTABLE(place) *tbl = current_table; for (;;) { place *pl = tbl->lookup(label); if (pl) return pl; if (!state) return 0; tbl = state->tbl; state = state->prev; } } static void define_label(const char *label, const place *pl) { place *p = new place; *p = *pl; current_table->define(label, p); } int lookup_variable(const char *name, double *val) { place *pl = lookup_label(name); if (pl) { *val = pl->x; return 1; } return 0; } void define_variable(const char *name, double val) { place *p = new place; p->obj = 0; p->x = val; p->y = 0.0; current_table->define(name, p); if (strcmp(name, "scale") == 0) { // When the scale changes, reset all scaled pre-defined variables to // their default values. for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (defaults_table[i].scaled) define_variable(defaults_table[i].name, val*defaults_table[i].val); } } // called once only (not once per parse) void parse_init (void) { current_direction = RIGHT_DIRECTION; current_position.x = 0.0; current_position.y = 0.0; // This resets everything to its default value. reset_all(); } static void reset (const char *nm) { for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (strcmp(nm, defaults_table[i].name) == 0) { double val = defaults_table[i].val; if (defaults_table[i].scaled) { double scale; lookup_variable("scale", &scale); val *= scale; } define_variable(defaults_table[i].name, val); return; } lex_error("`%1' is not a predefined variable", nm); } static void reset_all (void) { // We only have to explicitly reset the pre-defined variables that // aren't scaled because `scale' is not scaled, and changing the // value of `scale' will reset all the pre-defined variables that // are scaled. for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (!defaults_table[i].scaled) define_variable(defaults_table[i].name, defaults_table[i].val); } // called after each parse void parse_cleanup (void) { while (current_saved_state != 0) { delete current_table; current_table = current_saved_state->tbl; saved_state *tem = current_saved_state; current_saved_state = current_saved_state->prev; delete tem; } assert(current_table == &top_table); PTABLE_ITERATOR(place) iter(current_table); const char *key; place *pl; while (iter.next(&key, &pl)) if (pl->obj != 0) { position pos = pl->obj->origin(); pl->obj = 0; pl->x = pos.x; pl->y = pos.y; } while (olist.head != 0) { object *tem = olist.head; olist.head = olist.head->next; delete tem; } olist.tail = 0; current_direction = RIGHT_DIRECTION; current_position.x = 0.0; current_position.y = 0.0; } static const char * ordinal_postfix(int n) { if (n < 10 || n > 20) switch (n % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; } return "th"; } static const char * object_type_name(object_type type) { switch (type) { case BOX_OBJECT: return "box"; case CIRCLE_OBJECT: return "circle"; case ELLIPSE_OBJECT: return "ellipse"; case ARC_OBJECT: return "arc"; case SPLINE_OBJECT: return "spline"; case LINE_OBJECT: return "line"; case ARROW_OBJECT: return "arrow"; case MOVE_OBJECT: return "move"; case TEXT_OBJECT: return "\"\""; case BLOCK_OBJECT: return "[]"; case OTHER_OBJECT: case MARK_OBJECT: default: break; } return "object"; } static char * format_number(const char *form, double n) { if (form == 0) form = "%g"; else { // this is a fairly feeble attempt at validation of the format int nspecs = 0; for (const char *p = form; *p != '\0'; p++) if (*p == '%') { if (p[1] == '%') p++; else nspecs++; } if (nspecs > 1) { lex_error("bad format `%1'", form); return strsave(form); } } sprintf(sprintf_buf, form, n); return strsave(sprintf_buf); } static char * do_sprintf(const char *form, const double *v, int nv) { string result; int i = 0; string one_format; while (*form) { if (*form == '%') { one_format += *form++; for (; *form != '\0' && strchr("#-+ 0123456789.", *form) != 0; form++) one_format += *form; if (*form == '\0' || strchr("eEfgG%", *form) == 0) { lex_error("bad sprintf format"); result += one_format; result += form; break; } if (*form == '%') { one_format += *form++; one_format += '\0'; sprintf(sprintf_buf, one_format.contents()); } else { if (i >= nv) { lex_error("too few arguments to sprintf"); result += one_format; result += form; break; } one_format += *form++; one_format += '\0'; sprintf(sprintf_buf, one_format.contents(), v[i++]); } one_format.clear(); result += sprintf_buf; } else result += *form++; } result += '\0'; return strsave(result.contents()); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/doc/�������������������������������������������������������������������������0000777�0001750�0001750�00000000000�11257257511�012734� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/doc/README�������������������������������������������������������������������0000644�0001750�0001750�00000003317�06764650512�013541� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This directory contains supplementary documentation on GNU pic2plot. `pic2plot' is a translator from the pic language to numerous graphics formats such as X11, PS/EPS, PCL 5, PNM, GIF, Tektronix, and to editable formats such as idraw, xfig, Illustrator, and CGM. The pic language makes it easy to create and modify box-and-arrow diagrams of the kind frequently found in technical papers and textbooks. It was originally designed to be translated to the troff text-processing language, so that diagrams could be interspersed with text. The utility program `pic', the GNU version of which is `gpic', can perform this translation. It is usually invoked on the command line by doing `groff -p', where `groff' is the GNU version of the troff text-processing utility. `gpic' can also translate pic diagrams to TeX macros, for inclusion in a TeX document. `pic2plot' provides a third alternative. By using `pic2plot', you may translate diagrams, written in the pic language, directly to graphics formats. In this directory, the file pic0.ps is Brian Kernighan's original Bell Labs technical report on the pic language. The file pic1.ps is Eric Raymond's report "Making Pictures with GNU pic", which contains additional details. Neither of these mentions `pic2plot', however. The documentation file picmacros.ps was kindly contributed by the late W. Richard Stevens, who died on Sept. 1, 1999. Rich Stevens wrote many fine books on programming and network programming, including `TCP/IP Illustrated' (Addison-Wesley, 1994). picmacros.ps shows how pic macros may be used to draw diagrams (the diagrams are taken from his books). The macros themselves are given in the file macros.pic. Rich asked me to describe them as "work in progress". �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/doc/Makefile.am��������������������������������������������������������������0000644�0001750�0001750�00000000320�10341763455�014701� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������pic2plotdatadir = $(datadir)/pic2plot pic2plotdata_DATA = README macros.pic pic0.ps pic1.ps picmacros.ps # files with nonstandard names in this directory EXTRA_DIST = macros.pic pic0.ps pic1.ps picmacros.ps ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/doc/Makefile.in��������������������������������������������������������������0000644�0001750�0001750�00000024212�11234210075�014703� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pic2plot/doc DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pic2plotdatadir)" pic2plotdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(pic2plotdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_BASIC_LIBS = @X_BASIC_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ X_TOOLKIT_LIBS = @X_TOOLKIT_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ ps_fonts_in_pcl = @ps_fonts_in_pcl@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pic2plotdatadir = $(datadir)/pic2plot pic2plotdata_DATA = README macros.pic pic0.ps pic1.ps picmacros.ps # files with nonstandard names in this directory EXTRA_DIST = macros.pic pic0.ps pic1.ps picmacros.ps all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pic2plot/doc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu pic2plot/doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pic2plotdataDATA: $(pic2plotdata_DATA) @$(NORMAL_INSTALL) test -z "$(pic2plotdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pic2plotdatadir)" @list='$(pic2plotdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pic2plotdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pic2plotdatadir)/$$f'"; \ $(pic2plotdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pic2plotdatadir)/$$f"; \ done uninstall-pic2plotdataDATA: @$(NORMAL_UNINSTALL) @list='$(pic2plotdata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pic2plotdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(pic2plotdatadir)/$$f"; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pic2plotdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-pic2plotdataDATA install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pic2plotdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pic2plotdataDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-pic2plotdataDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/doc/macros.pic���������������������������������������������������������������0000644�0001750�0001750�00000055637�06646736465�014671� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.PS # 02Mar97: Cleaned up this file. Removed a bunch of the tcpipiv2-only # macros, and deleted those that were never used. # # This file defines the handy macros used in the document. # arrowwid = 0.0625 # This divisible by 2 (0.03125) has to be a "perfect" # size for ditroff. This value is OK for TranScript on # on the LaserWriter (576 units/inch). #arrowht = 0.125 arrowht = 0.09375 #arrowht = 0.0625 dash_off = 0.2 # default gap_down = 0.12 # default downward distance in timeline gap gap_side = 0.04 # default sidewards distance in timeline gap basef = .375 maxwid = 5.416666 unusedfill = .1 # unused portions of structures cbase = .256 cindent = .275 v6_hash = 0.06 # Just remove "invis" to see the boxes define ibox { box invis } # Client double arrow (left to right on top, right to left below) define Carrow { arrow -> right 0.15 from $1 + (-0.15/2, 0.04) wid 0.03 ht 0.05 arrow <- right 0.15 from $1 + (-0.15/2, -0.04) wid 0.03 ht 0.05 } # Server double arrow (right to left on top, left to right below) define Sarrow { arrow <- right 0.15 from $1 + (-0.15/2, 0.04) wid 0.03 ht 0.05 arrow -> right 0.15 from $1 + (-0.15/2, -0.04) wid 0.03 ht 0.05 } # Right arrow define Rarrow { arrow -> right 0.15 from $1 + (-0.15/2, 0.00) wid 0.03 ht 0.05 } # Left arrow define Larrow { arrow <- right 0.15 from $1 + (-0.15/2, 0.00) wid 0.03 ht 0.05 } # # flowdef( ) # set up default for data flow pictures define flowdef X boxht = 0.2*$1 boxwid = 0.8*$1 ellipsewid = boxwid ellipseht = boxht*1.5 .ps 8 .vs 10 X # # memdef( , , ) # set up default for memory layout pictures define memdef X boxht = .3*$3 boxwid = (.95*maxwid)/$1*$2 boff = boxwid/(2*$1) poff = boxht*.25 arrowht = .09375*.8 arrowwid = 0.0625*.8 labelspace=.4 # used in by field2_a functions .ps 8 .vs 10 X # # dsdef # setup defaults for data structure pictures define dsdef X boxht = 0.15 boxwid = boxht*6 myboxrad = boxht/4 ellipsewid = boxwid ellipseht = boxht*1.5 arrowwid = 0.0625*.75 arrowht = 0.09375*.75 poff = .5*boxht # ellipse offset eoff = .5*poff .ps 8 .vs 9 X # # text_span ( , , , , # ) # # For normal text, should be 0.15. # define text_span X Lab001: $3 at 1/2 <$1, $2> + (0, $5) arrow from Lab001.c + (- $4/2, 0) to $1 + (0, $5) arrow from Lab001.c + ( $4/2, 0) to $2 + (0, $5) X # # solid_box ( , ) # # Draw a solid box, given 2 opposite corner positions. # Note - unlike the dash_box macro below, we draw the box exactly from # from the points specified - we don't offset the box by 0.2i from # the given coordinates. # The box is drawn in the order of the arguments, so that the command # "... at last line.c below" will be positioned at the line from the # se-posn to the sw-posn. # define solid_box X S0001: $1 S0002: $2 line from S0001 to (S0001.x, S0002.y) line from last line.end to S0002 line from last line.end to (S0002.x, S0001.y) line from last line.end to S0001 X # # dash_box ( , [ , ] ) # # Draw a dashed box, given the 2 opposite corner positions. # The box is drawn in the order of the arguments, so that the command # "... at last line.c below" will be positioned at the line from the # se-posn to the sw-posn. # # Caller can set "dash_off = " to change the default of 0.2 inches # from all sides. This has to be done before each call to the macro, # as we reset it after each call. # # The specifies the length of each dash and the # length of the space between each dash. The default is 0.05. # Note this feature uses pic's substitution of the null string for any # missing arguments in a macro call. # define dash_box X S001: $1 S002: $2 line dashed $3 from S001 + (-dash_off, -dash_off) to \ (S001.x, S002.y) + (-dash_off, dash_off) line dashed $3 from last line.end to \ S002 + (dash_off, dash_off) line dashed $3 from last line.end to \ (S002.x, S001.y) + (dash_off, -dash_off) line dashed $3 from last line.end to \ S001 + (-dash_off, -dash_off) dash_off = 0.2 # reset default X # # left_brace ( , ) # define left_brace X LB1: $1 LB2: $2 arc from LB1 + (-0.09375, 0.00) to LB1 + (-0.15625, -0.0625) rad 0.0625 line down (((LB1.y - LB2.y) - 0.125) / 2) - 0.03125 line down 0.03125 left 0.03125 Bracept:line right 0.03125 down 0.03125 line to LB2 + (-0.15625, 0.0625) arc from last line.end to LB2 + (-0.09375, 0.00) rad 0.0625 X # # right_brace ( , ) # define right_brace X RB1: $1 RB2: $2 arc cw from RB1 + (0.09375, 0.00) to RB1 + (0.15625, -0.0625) rad 0.0625 line down (((RB1.y - RB2.y) - 0.125) / 2) - 0.03125 line down 0.03125 right 0.03125 Bracept:line left 0.03125 down 0.03125 line to RB2 + (0.15625, 0.0625) arc cw from last line.end to RB2 + (0.09375, 0.00) rad 0.0625 X # # bottom_brace ( , ) # define bottom_brace X BB1: $1 BB2: $2 arc from BB1 + (0.00, -0.09375) to BB1 + (0.0625, - 0.15625) rad 0.0625 line right (((BB2.x - BB1.x) - 0.125) / 2) - 0.03125 line right 0.03125 down 0.03125 Bracept:line up 0.03125 right 0.03125 line to BB2 + (-0.0625, -0.15625) arc from last line.end to BB2 + (0, -0.09375) rad 0.0625 X # # top_brace ( , ) # define top_brace X TB1: $1 TB2: $2 arc cw from TB1 + (0.00, 0.09375) to TB1 + (0.0625, 0.15625) rad 0.0625 line right (((TB2.x - TB1.x) - 0.125) / 2) - 0.03125 line right 0.03125 up 0.03125 Bracept:line down 0.03125 right 0.03125 line to TB2 + (-0.0625, 0.15625) arc cw from last line.end to TB2 + (0, 0.09375) rad 0.0625 X # # line_gap_down ( , ) # define line_gap_down X Start: $1 End: $2 line down ((Start.y - End.y) - gap_down)/2 from Start line right gap_side line left gap_side*2 down gap_down line right gap_side line to End gap_down = 0.12 # reset default gap_side = 0.04 # reset default X # # line_gap_right ( , ) # define line_gap_right X Start: $1 End: $2 line right ((End.x - Start.x) - gap_down)/2 from Start line up gap_side line down gap_side*2 right gap_down line up gap_side line to End gap_down = 0.12 # reset default gap_side = 0.04 # reset default X # # label_above( , , , ) # define label_above X P001: $1 + (0, 0.1) P002: $2 + (0, 0.1) line up 0.2 from P001 line up 0.2 from P002 arrow <- right $3 from P001 + (0, 0.1) arrow <- left $3 from P002 + (0, 0.1) $4 at 1/2 <2nd last arrow.start, last arrow.start> X # # label_below( , , , ) # define label_below X P001: $1 + (0, -0.1) P002: $2 + (0, -0.1) line down 0.2 from P001 line down 0.2 from P002 arrow <- right $3 from P001 + (0, -0.1) arrow <- left $3 from P002 + (0, -0.1) $4 at 1/2 <2nd last arrow.start, last arrow.start> X # # text_spanv ( , , , , # ) # end points are in line with text # define text_spanv X Lab001: $3 at 1/2 <$1, $2> arrow from Lab001.c + (0, - $4/2) to $1 arrow from Lab001.c + (0, $4/2) to $2 X # # text_spanc ( , , , , # ) # end points are in line with text # define text_spanc X Lab001: $3 at 1/2 <$1, $2> arrow from Lab001.c + (- $4/2, 0) to $1 arrow from Lab001.c + ( $4/2, 0) to $2 X # # measureb ( sw-corner, se-corner, text, , ) # Show the measurement below the object define measureb X Mleft: line from $1 + (0, -0.05) to $1 + (0, -($5 * 1.5) ) Mright: line from $2 + (0, -0.05) to $2 + (0, -($5 * 1.5) ) text_spanc( Mleft.c, Mright.c, $3, $4, $5) X # # measurea ( sw-corner, se-corner, text, , ) # Show the measurement above the object define measurea X Mleft: line from $1 + (0, 0.05) to $1 + (0, ($5 * 1.5) ) Mright: line from $2 + (0, 0.05) to $2 + (0, ($5 * 1.5) ) text_spanc( Mleft.c, Mright.c, $3, $4, $5) X # # measurel ( nw-corner, sw-corner, text, , ) # Show the measurement above the object define measurel X Mtop: line from $1 - (0.05, 0) to $1 - (($5 * 1.5),0 ) Mbot: line from $2 - (0.05, 0) to $2 - (($5 * 1.5),0 ) text_spanv( Mtop.c, Mbot.c, $3, $4, $5) X # # measurer ( nw-corner, sw-corner, text, , ) # Show the measurement above the object define measurer X Mtop: line from $1 + (0.05, 0) to $1 + (($5 * 1.5),0 ) Mbot: line from $2 + (0.05, 0) to $2 + (($5 * 1.5),0 ) text_spanv( Mtop.c, Mbot.c, $3, $4, $5) X # # queue ( ) # define queue X $2: $1 - (.1,0) $2exit: $1 + (0,.1) box wid 0.20 ht 0.05 with .nw at $2 box wid 0.20 ht 0.05 with .nw at last box.sw box wid 0.20 ht 0.05 with .nw at last box.sw box wid 0.20 ht 0.05 with .nw at last box.sw line from last box.sw down 0.20 line from last box.se down 0.20 $2entry: last box.s - 0,0.1 move to $2 X # # pointer (from, to, sx, sy) # define pointer X # We want a 10% curve Start: $1 End: $2 dx = End.x - Start.x dy = End.y - Start.y incx = dx * $3; incy = dy * $4 spline -> from $1 \ to $1 + ( -incx, incy ) \ to $2 + ( incx, -incy ) \ to $2 X # # field_a( text, bytes, label, other) # draw a box but label it above the field # leave room for other labels that may be there define field_a X $3: box wid (boxwid*$2) sprintf("%.0f", $2) below at last box.s spline <- from $3.n up (2+$4)*.4*boxht then right .1 $1 at last spline.end ljust move to $3.e X # # field_s(text, bytes, label) # Draw a field with a slanted label # leave room for other labels that may be there define field_s X $3: box wid (boxwid*$2) sprintf("%.0f", $2) below at last box.s line invis $1 ljust above aligned \ from $3.ne + (-.75*boxwid,-.5*boxht) up boxht right boxwid move to $3.e X # # field2_ai( opts, text, sizetext, bytes, label, other) # draw an box with options but label it above the field # leave room for other labels that may be there # any text for the bottom is provided by sizetext # additional box options can be provided in opts define field2_ai X $5: box $1 wid (boxwid*$4) spline <- from $5.n up (1.25+$6)*labelspace*boxht then right .1 $2 at last spline.end ljust $3 below at $5.s move to $5.e X # # field2_al( text, sizetext, bytes, label, other) # draw a box but label it above the field but to the left # leave room for other labels that may be there # any text for the bottom is provided by sizetext define field2_al X $4: box wid (boxwid*$3) spline <- from $4.n up (1.25+$5)*labelspace*boxht then left .1 right $1 at last spline.end rjust $2 below at $4.s move to $4.e X # # field2_a( text, sizetext, bytes, label, other) # draw a box but label it above the field # leave room for other labels that may be there # any text for the bottom is provided by sizetext define field2_a X $4: box wid (boxwid*$3) spline <- from $4.n up (1.25+$5)*labelspace*boxht then right .1 $1 at last spline.end ljust $2 below at $4.s move to $4.e X # draw a box and label it as a field within a packet # field( boxtext, units, label ) define field X $3: box $1 wid (boxwid*$2) move to $3.e X # draw a box and label it as a field within a packet # the size in bytes appears below the box # field2( boxtext, sizetext, units, boxlabel) define field2 X $4: box $1 wid (boxwid*$3) $2 below at last box.s move to $4.e X # Show field with internal tick marks # fieldt( scale, text, units, label ) define fieldt X fw = basef * $1 fh = basef $4: box $2 wid (fw*$3) ht fh for t = fw to fw * ($3 - 1) by fw do { line from $4.nw + (t,0) to $4.sw + (t,0) dotted } move to $4.e # [ "$3" at $4.s below ] X define inetsw X Inetsw: box "-" with .c at $1; "0 " rjust at last box.w "\fCinetsw[]\fP" above at last box.n Iudp: box "UDP" with .n at last box.s; "1 " rjust at last box.w Itcp: box "TCP" with .n at last box.s; "2 " rjust at last box.w Iicmp: box "ICMP" with .n at last box.s; "3 " rjust at last box.w Irip: box "raw IP" with .n at last box.s; "4 " rjust at last box.w box "raw IP" with .n at last box.s; "5 " rjust at last box.w X # # array( count, text, center0) define array X A0: box with .nw at $3 ; $2 above at last box.n for i = 2 to $1 do { Al: box with .n at last box.s; } X # # lnullp( start ) # draw the grounding end of a null pointer but on the left define lnullp X spline from $1+(poff,0) left 2*poff+boxht/2 then down boxht Mid: Here line from Mid - (boxht/2, 0) right boxht line from Mid - (boxht/4,.02) right boxht/2 line from Mid - (boxht/8,.04) right boxht/4 line from Mid - (boxht/16,.06) right boxht/8 #pstart($1 + (poff,0)) X # # dnullp(start) # draw the grounding end of a null pointer define dnullp X line from $1 down boxht Mid: Here line from Mid - (boxht/2, 0) right boxht line from Mid - (boxht/4,.02) right boxht/2 line from Mid - (boxht/8,.04) right boxht/4 line from Mid - (boxht/16,.06) right boxht/8 X # # nullp( start, horiz ) # draw the grounding end of a null pointer define nullp X if ($2 == 0) then {horiz=boxht/2} else { horiz=$2 } #horiz=$2 spline from $1-(poff,0) right 2*poff+horiz then down boxht Mid: Here line from Mid - (boxht/2, 0) right boxht line from Mid - (boxht/4,.02) right boxht/2 line from Mid - (boxht/8,.04) right boxht/4 line from Mid - (boxht/16,.06) right boxht/8 #pstart($1-(poff,0)) X # # vv_spline(top, bottom, offset, gap, arrow ) # Draw a V shaped spline from top to bottom. define vv_spline X initspline($1, $2, .5, .5, .25) line from Spline1 right $3 spline from Spline1 then right $4 then to Spline2 $5 X # # vu_spline(top, bottom, off, off, gap, arrow, text) # Connect top and bottom on the left define vu_spline X initspline($1, $2+($5,0), .5, .5, .25) # then up yrad then up dy-2*yrad then up yrad spline from Spline1 then right dx-xrad then right xrad \ then up dy \ then left xrad then left dx-xrad $6 if ($3 != 0 ) then { line from Spline1 right $3 #circle fill 1 rad .015 with .c at last line.end } if ($4 != 0 ) then { line from Spline2 right $4 #circle fill 1 rad .015 with .c at last line.end } line invis from $1 + ($5,0) then up dy $7 X # # hu_spline(left, right, off, off, gap, arrow, text) # Connect left and right horizontally define hu_spline X Spline1: $1 Spline2: $2 dx = Spline2.x - Spline1.x spline from Spline1 then up $5 then right dx/2 \ then to Spline2 + (0,$5) then to Spline2 $6 if ($3 != 0 ) then { line from Spline1 up $3 } if ($4 != 0 ) then { line from Spline2 up $4 } line invis from $1 + (0,$5) then right dx $7 X # # initspline(p1, p2, scalex, scaley, scale_radius) define initspline X Spline1: $1 Spline2: $2 dx = Spline2.x - Spline1.x dy = Spline2.y - Spline1.y if (dx < 0 ) then { adx = -dx} else { adx = dx} if (dy < 0 ) then { ady = -dy} else { ady = dy } srad = max(min(adx*$3, ady*$4), boxht*$5) #srad = boxht/4 xrad = srad yrad = srad #xrad = adx*$3 #yrad = ady*$4 #sprintf("dx %f dy %f srad %fxrad %f yrad %f", dx, dy, srad, xrad, yrad) \ # above at Spline1 if (dx < 0 ) then { xrad = -srad } if (dy < 0 ) then { yrad = -srad } #if (dx < 0 ) then { xrad = -xrad } #if (dy < 0 ) then { yrad = -yrad } X # # lr_spline(start, end, off, off, arrow, text, rad) # Connect start and end in an l shape define lr_spline X initspline($1, $2, .2, .2, $7) spline from Spline1 \ then up dy-yrad \ then up yrad \ then right xrad \ then right dx-xrad $5 if ($3 != 0 ) then { line from Spline1 up $3 } if ($4 != 0 ) then { line from Spline2 right $4 } line invis from $1 + (0,dy) then right dx $6 X # # l_spline(start, end, off, off, arrow, text) # Connect start and end in an l shape define l_spline X initspline($1, $2, .2, .2, 1.25) spline from Spline1 \ then up dy-yrad \ then up yrad \ then right xrad \ then right dx-xrad $5 if ($3 != 0 ) then { line from Spline1 up $3 } if ($4 != 0 ) then { line from Spline2 right $4 } line invis from $1 + (0,dy) then right dx $6 X # # vertical spline # v_spline(p1, p2, off1, off2, arrow, turn) # define v_spline X vz_spline($1, $2, $3, $4, $5, $6, .05) # initspline($1, $2, .2, .2) # spline from Spline1 \ # then up (dy*$6)-yrad then up yrad \ # then right dx then up yrad \ # then up (dy*(1-$6))-yrad $5 # if ($3 != 0 ) then { line from Spline1 down $3 } # if ($4 != 0 ) then { line from Spline2 up $4 } X # # vertical Z spline # vz2_spline(p1, p2, off1, off2, arrow, turn, overrun) # same as hz_spline but with absolute measurement for turn # instead of a percentage # define vz2_spline X initspline($1, $2, .2, .2, .25) d1=$6 d2=dy-$6 overrun=$7 span=min(min(.9*max(d1, -d1), .9*max(d2, -d2)), max($7, -$7)) sign=dy/(max(dy,-dy)) if (overrun < 0 ) then { overrun = -.5*span } spline from Spline1 \ then up $6 - span*sign \ then up span*sign + overrun*sign \ then right dx up 2*overrun*sign \ then up overrun*sign + span*sign \ then to Spline2 $5 if ($3 != 0 ) then { line from Spline1 down $3 } if ($4 != 0 ) then { line from Spline2 up $4 } X # # vertical Z spline # vz_spline(p1, p2, off1, off2, arrow, turn, overrun) # define vz_spline X overrun=$7 if (overrun == 0 ) then { overrun = .2 } initspline($1, $2, .2, .05, .25) spline from Spline1 \ then up yrad then (dy*$6)+dy*overrun-yrad \ then right dx down 2*dy*overrun \ then up (dy*(1-$6))+dy*overrun-yrad then up yrad $5 if ($3 != 0 ) then { line from Spline1 down $3 } if ($4 != 0 ) then { line from Spline2 up $4 } X # # horizontal Z spline # hz_spline(p1, p2, off1, off2, arrow, turn, overrun) # define hz_spline X overrun=$7 if (overrun == 0 ) then { overrun = .2 } initspline($1, $2, .2, .2, .25) spline from Spline1 \ then right (dx*$6)+dx*overrun \ then up dy left 2*dx*overrun \ then right dx*(1-$6)+dx*overrun $5 if ($3 != 0 ) then { line from Spline1 left $3 } if ($4 != 0 ) then { line from Spline2 right $4 } X # # erase(center, fill, rad) # define erase X if ( $3 == 0 ) then { erad = boxht/8 } else { erad = $3 } circle invis rad erad fill $2 with .c at $1 X # # target(center) # define target X circle rad boxht/2 with .c at $1 X # spline down and on the left define spline_dl { Start: $1 Dest: $2 line from Start to Start + ($3, 0) spline $5 from Start \ then left $4 \ then down $4 \ then to Dest + (-$4, $4) \ then to Dest + (-$4, 0) \ then to Dest } # spline down and on the right define spline_dr { Start: $1 Dest: $2 line from Start to Start + ($3, 0) spline $5 from Start \ then right $4 \ then down $4 \ then to Dest + ( $4, $4) \ then to Dest + ( $4, 0) \ then to Dest } # spline up and on the left define spline_ul { Start: $1 Dest: $2 line from Start to Start + ($3, 0) spline $5 from Start \ then left $4 \ then up $4 \ then to Dest + (-$4, -$4) \ then to Dest + (-$4, 0) \ then to Dest } # spline up and on the right define spline_ur { Start: $1 Dest: $2 line from Start to Start + ($3, 0) spline $5 from Start \ then right $4 \ then up $4 \ then to Dest + ( $4, -$4) \ then to Dest + ( $4, 0) \ then to Dest } # Spline right/up/right define spline_rur { Start: $1 End: $2 if ($4 == 0) then { dx = (End.x - Start.x) / 2 } else { dx = $4 } if ("$6" != "") then { turn1rad = $6 } else { turn1rad = 0.2 } if ("$7" != "") then { turn2rad = $7 } else { turn2rad = 0.2 } Turn1: (Start.x + dx, Start.y) Turn2: (Start.x + dx, End.y) line from Start to Start + ($3, 0) spline $5 from Start \ to Turn1 + (-turn1rad, 0) \ to Turn1 \ to Turn1 + (0, turn1rad) \ to Turn2 + (0, -turn2rad) \ to Turn2 \ to Turn2 + ( turn2rad, 0) \ to End } # Spline right/down/right define spline_rdr { Start: $1 End: $2 if ($4 == 0) then { dx = (End.x - Start.x) / 2 } else { dx = $4 } if ("$6" != "") then { turn1rad = $6 } else { turn1rad = 0.2 } if ("$7" != "") then { turn2rad = $7 } else { turn2rad = 0.2 } Turn1: (Start.x + dx, Start.y) Turn2: (Start.x + dx, End.y) line from Start to Start + ($3, 0) spline $5 from Start \ to Turn1 + (-turn1rad, 0) \ to Turn1 \ to Turn1 + (0, -turn1rad) \ to Turn2 + (0, turn2rad) \ to Turn2 \ to Turn2 + ( turn2rad, 0) \ to End } # Spline left/up/left define spline_lul { Start: $1 End: $2 if ($4 == 0) then { dx = (Start.x - End.x) / 2 } else { dx = $4 } if ("$6" != "") then { turn1rad = $6 } else { turn1rad = 0.2 } if ("$7" != "") then { turn2rad = $7 } else { turn2rad = 0.2 } Turn1: (Start.x - dx, Start.y) Turn2: (Start.x - dx, End.y) line from Start to Start + ($3, 0) spline $5 from Start \ to Turn1 + ( turn1rad, 0) \ to Turn1 \ to Turn1 + (0, turn1rad) \ to Turn2 + (0, -turn2rad) \ to Turn2 \ to Turn2 + (-turn2rad, 0) \ to End $5 } # Spline left/down/left define spline_ldl { Start: $1 End: $2 if ($4 == 0) then { dx = (Start.x - End.x) / 2 } else { dx = $4 } if ("$6" != "") then { turn1rad = $6 } else { turn1rad = 0.2 } if ("$7" != "") then { turn2rad = $7 } else { turn2rad = 0.2 } Turn1: (Start.x - dx, Start.y) Turn2: (Start.x - dx, End.y) line from Start to Start + ($3, 0) spline $5 from Start \ to Turn1 + ( turn1rad, 0) \ to Turn1 \ to Turn1 + (0, -turn1rad) \ to Turn2 + (0, turn2rad) \ to Turn2 \ to Turn2 + (-turn2rad, 0) \ to End $5 } # Place hash marks at the 32-bit boundaries of an IPv6 16-byte address. define ipv6_hash { NW: $1.nw SE: $1.se mywid = SE.x - NW.x myht = NW.y - SE.y line right v6_hash from NW + (0, -1*myht/4) line right v6_hash from NW + (0, -2*myht/4) line right v6_hash from NW + (0, -3*myht/4) line left v6_hash from SE + (0, 1*myht/4) line left v6_hash from SE + (0, 2*myht/4) line left v6_hash from SE + (0, 3*myht/4) v6_hash = 0.06 # reset default } # Draw routers with rounded corners. # Problem with boxes with rounded corners: .ne, .ne, .se, .sw now refer to # the rounded portion, which screws things up. Make invisible box without # rounded corners for compass positions. define router { box invis $1 $2 box rad 0.1 with .n at last box.n } # small15_text2(box_name, top_string, bottom_string) # # Text within a box is often "too big". For example: box "top" "bottom" # can have the string "top" too high in the box (with ascenders # touching the top of the box) and the string "bottom" can be too low # (with descenders touching the bottom of the box. # But placing .ps and .vs commands within a picture is asking for trouble. # The "right" way to do this is to make the string smaller with an inline # \s-1 or \s-2, with a vertical motion before and after, then \s0. # # The "15" means the vertical motion is 0.15m and the "2" means two arguments. # # Note that when invoking this macro, do *not* put the arguments # top_string and bottom_string in double quotes. These two arguments # may contain spaces (but not commas). define small15_text2 { box invis ht $1.ht wid $1.wid with .n at $1.n \ "\v'0.15m'\s-1$2\s0\v'-0.15m'" "\v'-0.15m'\s-1$3\s0\v'0.15m'" } # Add invisible space to the right, normally to center picture. define right_space { box invis wid $2 with .w at $1 } # Add invisible space to the right, normally to center picture. define left_space { box invis wid $2 with .e at $1 } .PE �������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/doc/pic0.ps������������������������������������������������������������������0000644�0001750�0001750�00000374345�06235536173�014073� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������%!PS %%Version: 3.3 %%DocumentFonts: (atend) %%Pages: (atend) %%EndComments % % Version 3.3 prologue for troff files. % /#copies 1 store /aspectratio 1 def /formsperpage 1 def /landscape false def /linewidth .3 def /magnification 1 def /margin 0 def /orientation 0 def /resolution 720 def /rotation 1 def /xoffset 0 def /yoffset 0 def /roundpage true def /useclippath true def /pagebbox [0 0 612 792] def /R /Times-Roman def /I /Times-Italic def /B /Times-Bold def /BI /Times-BoldItalic def /H /Helvetica def /HI /Helvetica-Oblique def /HB /Helvetica-Bold def /HX /Helvetica-BoldOblique def /CW /Courier def /CO /Courier def /CI /Courier-Oblique def /CB /Courier-Bold def /CX /Courier-BoldOblique def /PA /Palatino-Roman def /PI /Palatino-Italic def /PB /Palatino-Bold def /PX /Palatino-BoldItalic def /Hr /Helvetica-Narrow def /Hi /Helvetica-Narrow-Oblique def /Hb /Helvetica-Narrow-Bold def /Hx /Helvetica-Narrow-BoldOblique def /KR /Bookman-Light def /KI /Bookman-LightItalic def /KB /Bookman-Demi def /KX /Bookman-DemiItalic def /AR /AvantGarde-Book def /AI /AvantGarde-BookOblique def /AB /AvantGarde-Demi def /AX /AvantGarde-DemiOblique def /NR /NewCenturySchlbk-Roman def /NI /NewCenturySchlbk-Italic def /NB /NewCenturySchlbk-Bold def /NX /NewCenturySchlbk-BoldItalic def /ZD /ZapfDingbats def /ZI /ZapfChancery-MediumItalic def /S /S def /S1 /S1 def /GR /Symbol def /inch {72 mul} bind def /min {2 copy gt {exch} if pop} bind def /setup { counttomark 2 idiv {def} repeat pop landscape {/orientation 90 orientation add def} if /scaling 72 resolution div def linewidth setlinewidth 1 setlinecap pagedimensions xcenter ycenter translate orientation rotation mul rotate width 2 div neg height 2 div translate xoffset inch yoffset inch neg translate margin 2 div dup neg translate magnification dup aspectratio mul scale scaling scaling scale /Symbol /S Sdefs cf /Times-Roman /S1 S1defs cf 0 0 moveto } def /pagedimensions { useclippath userdict /gotpagebbox known not and { /pagebbox [clippath pathbbox newpath] def roundpage currentdict /roundpagebbox known and {roundpagebbox} if } if pagebbox aload pop 4 -1 roll exch 4 1 roll 4 copy landscape {4 2 roll} if sub /width exch def sub /height exch def add 2 div /xcenter exch def add 2 div /ycenter exch def userdict /gotpagebbox true put } def /pagesetup { /page exch def currentdict /pagedict known currentdict page known and { page load pagedict exch get cvx exec } if } def /decodingdefs [ {counttomark 2 idiv {y moveto show} repeat} {neg /y exch def counttomark 2 idiv {y moveto show} repeat} {neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat} {neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat} {counttomark 2 idiv {y moveto show} repeat} {neg setfunnytext} ] def /setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def /w {neg moveto show} bind def /m {neg dup /y exch def moveto} bind def /done {/lastpage where {pop lastpage} if} def /f { dup /font exch def findfont exch dup /ptsize exch def scaling div dup /size exch def scalefont setfont linewidth ptsize mul scaling 10 mul div setlinewidth /spacewidth ( ) stringwidth pop def } bind def /changefont { /fontheight exch def /fontslant exch def currentfont [ 1 0 fontheight ptsize div fontslant sin mul fontslant cos div fontheight ptsize div 0 0 ] makefont setfont } bind def /sf {f} bind def /cf { dup length 2 idiv /entries exch def /chtab exch def /newfont exch def findfont dup length 1 add dict /newdict exch def {1 index /FID ne {newdict 3 1 roll put} {pop pop} ifelse} forall newdict /Metrics entries dict put newdict /Metrics get begin chtab aload pop 1 1 entries {pop def} for newfont newdict definefont pop end } bind def % % A few arrays used to adjust reference points and character widths in some % of the printer resident fonts. If square roots are too high try changing % the lines describing /radical and /radicalex to, % % /radical [0 -75 550 0] % /radicalex [-50 -75 500 0] % % Move braceleftbt a bit - default PostScript character is off a bit. % /Sdefs [ /bracketlefttp [201 500] /bracketleftbt [201 500] /bracketrighttp [-81 380] /bracketrightbt [-83 380] /braceleftbt [203 490] /bracketrightex [220 -125 500 0] /radical [0 0 550 0] /radicalex [-50 0 500 0] /parenleftex [-20 -170 0 0] /integral [100 -50 500 0] /infinity [10 -75 730 0] ] def /S1defs [ /underscore [0 80 500 0] /endash [7 90 650 0] ] def % % Tries to round clipping path dimensions, as stored in array pagebbox, so they % match one of the known sizes in the papersizes array. Lower left coordinates % are always set to 0. % /roundpagebbox { 7 dict begin /papersizes [8.5 inch 11 inch 14 inch 17 inch] def /mappapersize { /val exch def /slop .5 inch def /diff slop def /j 0 def 0 1 papersizes length 1 sub { /i exch def papersizes i get val sub abs dup diff le {/diff exch def /j i def} {pop} ifelse } for diff slop lt {papersizes j get} {val} ifelse } def pagebbox 0 0 put pagebbox 1 0 put pagebbox dup 2 get mappapersize 2 exch put pagebbox dup 3 get mappapersize 3 exch put end } bind def %%EndProlog %%BeginSetup mark /resolution 720 def setup 2 setdecoding %%EndSetup %%Page: 1 1 /saveobj save def mark 1 pagesetup 10 R f (AT&T Bell Laboratories)2 993 1 2563 1740 t (Murray Hill, New Jersey 07974)4 1267 1 2426 1860 t (Computing Science Technical Report No. 116)5 1848 1 2136 3000 t 12 B f (PIC \320 A Graphics Language for Typesetting)6 2328 1 1896 3270 t (User Manual\262)1 730 1 2695 3420 t 10 I f (Brian W. Kernighan)2 814 1 2653 3660 t 10 R f (Revised, May, 1991)2 805 1 720 6240 t cleartomark showpage saveobj restore %%EndPage: 1 1 %%Page: 0 2 /saveobj save def mark 2 pagesetup 12 B f (PIC \320 A Graphics Language for Typesetting)6 2328 1 1896 1230 t (User Manual\262)1 730 1 2695 1380 t 10 I f (Brian W. Kernighan)2 814 1 2653 1620 t 10 R f (AT&T Bell Laboratories)2 993 1 2563 1800 t (Murray Hill, New Jersey 07974)4 1267 1 2426 1920 t 10 I f (ABSTRACT)2823 2420 w (Pic)1360 2716 w 10 R f ( basic objects in)3 662( The)1 212(is a language for drawing simple figures on a typesetter.)9 2303 3 1525 2716 t 10 I f (pic)4734 2716 w 10 R f (are)4889 2716 w ( may be placed any-)4 851( These)1 301(boxes, circles, ellipses, lines, arrows, arcs, spline curves, and text.)9 2748 3 1110 2836 t ( below)1 287( example)1 380( The)1 222(where, at positions specified absolutely or in terms of previous objects.)10 3011 4 1110 2956 t (illustrates the style and basic capabilities of the language.)8 2294 1 1110 3076 t cleartomark saveobj restore %%BeginGlobal % % Version 3.3 drawing procedures for dpost. Automatically pulled in, but only % when needed. % /inpath false def /savematrix matrix def /Dl { inpath {pop pop neg lineto} {newpath neg moveto neg lineto stroke} ifelse } bind def /De { /y1 exch 2 div def /x1 exch 2 div def /savematrix savematrix currentmatrix def neg exch x1 add exch translate x1 y1 scale 0 0 1 0 360 inpath {1 0 moveto arc savematrix setmatrix} {newpath arc savematrix setmatrix stroke} ifelse } bind def /Da { /dy2 exch def /dx2 exch def /dy1 exch def /dx1 exch def dy1 add neg exch dx1 add exch dx1 dx1 mul dy1 dy1 mul add sqrt dy1 dx1 neg atan dy2 neg dx2 atan inpath {arc} {newpath arc stroke} ifelse } bind def /DA { /dy2 exch def /dx2 exch def /dy1 exch def /dx1 exch def dy1 add neg exch dx1 add exch dx1 dx1 mul dy1 dy1 mul add sqrt dy1 dx1 neg atan dy2 neg dx2 atan inpath {arcn} {newpath arcn stroke} ifelse } bind def /Ds { /y2 exch def /x2 exch def /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 5 x1 mul add 6 div y0 5 y1 mul add -6 div x2 5 x1 mul add 6 div y2 5 y1 mul add -6 div x1 x2 add 2 div y1 y2 add -2 div inpath {curveto} {newpath x0 x1 add 2 div y0 y1 add -2 div moveto curveto stroke} ifelse } bind def %%EndGlobal /saveobj save def mark 10 R f 795 3418 540 360 De (document)868 3438 w 1695 3418 1335 3418 Dl 1695 3418 1623 3436 Dl 1695 3418 1623 3400 Dl 1695 3238 1695 3598 Dl 2235 3238 1695 3238 Dl 2235 3598 2235 3238 Dl 1695 3598 2235 3598 Dl (PIC)1887 3438 w 2595 3418 2235 3418 Dl 2595 3418 2523 3436 Dl 2595 3418 2523 3400 Dl 2631 3598 2595 3598 Dl 2703 3598 2667 3598 Dl 2775 3598 2739 3598 Dl 2847 3598 2811 3598 Dl 2919 3598 2883 3598 Dl 2991 3598 2955 3598 Dl 3063 3598 3027 3598 Dl 3135 3598 3099 3598 Dl 3135 3562 3135 3598 Dl 3135 3481 3135 3517 Dl 3135 3400 3135 3436 Dl 3135 3319 3135 3355 Dl 3135 3238 3135 3274 Dl 3099 3238 3135 3238 Dl 3027 3238 3063 3238 Dl 2955 3238 2991 3238 Dl 2883 3238 2919 3238 Dl 2811 3238 2847 3238 Dl 2739 3238 2775 3238 Dl 2667 3238 2703 3238 Dl 2595 3238 2631 3238 Dl 2595 3274 2595 3238 Dl 2595 3354 2595 3318 Dl 2595 3436 2595 3400 Dl 2595 3516 2595 3480 Dl 2595 3598 2595 3562 Dl (TBL/EQN)2654 3378 w (\(optional\))2668 3498 w 3495 3418 3135 3418 Dl 3495 3418 3423 3436 Dl 3495 3418 3423 3400 Dl 3495 3238 3495 3598 Dl 4035 3238 3495 3238 Dl 4035 3598 4035 3238 Dl 3495 3598 4035 3598 Dl (TROFF)3609 3438 w 4395 3418 4035 3418 Dl 4395 3418 4323 3436 Dl 4395 3418 4323 3400 Dl 4395 3418 540 360 De (typesetter)4471 3438 w (This picture was created with the input)6 1553 1 1110 3796 t 9 CW f (.PS)1830 3966 w (ellipse "document")1 972 1 1830 4076 t (arrow)1830 4186 w (box "PIC")1 486 1 1830 4296 t (arrow)1830 4406 w (box "TBL/EQN" "\(optional\)" dashed)3 1782 1 1830 4516 t (arrow)1830 4626 w (box "TROFF")1 594 1 1830 4736 t (arrow)1830 4846 w (ellipse "typesetter")1 1080 1 1830 4956 t (.PE)1830 5066 w 10 I f (Pic)1360 5282 w 10 R f (is a)1 150 1 1532 5282 t 10 I f (troff)1721 5282 w 10 R f ( untouched, but translates)3 1066(preprocessor; it passes most of its input through)7 2011 2 1933 5282 t (commands between)1 790 1 1110 5402 t 10 CW f (.PS)1925 5402 w 10 R f (and)2130 5402 w 10 CW f (.PE)2299 5402 w 10 R f (into)2504 5402 w 10 I f (troff)2685 5402 w 10 R f (commands that draw the pictures.)4 1345 1 2883 5402 t (Revised, May, 1991)2 805 1 720 5882 t 10 S1 f (_ ______________)1 720 1 720 6600 t 8 R f (\262 This is a revised version of [5].)7 1051 1 720 6700 t cleartomark showpage saveobj restore %%EndPage: 0 2 %%Page: 1 3 /saveobj save def mark 3 pagesetup 12 B f (PIC \320 A Graphics Language for Typesetting)6 2328 1 1896 1230 t (User Manual\262)1 730 1 2695 1380 t 10 I f (Brian W. Kernighan)2 814 1 2653 1620 t 10 R f (AT&T Bell Laboratories)2 993 1 2563 1800 t (Murray Hill, New Jersey 07974)4 1267 1 2426 1920 t 10 B f (1. Introduction)1 670 1 720 2280 t 10 I f (Pic)970 2436 w 10 R f ( operates as yet another)4 964( It)1 118(is a language for drawing pictures.)5 1415 3 1135 2436 t 10 I f (troff)3664 2436 w 10 R f ( the same style as)4 731([8] preprocessor \(in)2 800 2 3869 2436 t 10 I f (eqn)720 2556 w 10 R f ([7] and)1 285 1 889 2556 t 10 I f (tbl)1199 2556 w 10 R f ([4]\), with pictures delimited by)4 1246 1 1330 2556 t 10 CW f (.PS)2601 2556 w 10 R f (and)2806 2556 w 10 CW f (.PE)2975 2556 w 10 R f (.)3155 2556 w 10 I f (Pic)970 2712 w 10 R f ( Van Wyk's early work on)5 1101(was inspired partly by Chris)4 1155 2 1135 2712 t 10 I f (ideal)3424 2712 w 10 R f ([9]; it has somewhat the same capabilities,)6 1743 1 3657 2712 t ( particular,)1 433( In)1 134(but quite a different flavor.)4 1082 3 720 2832 t 10 I f (pic)2394 2832 w 10 R f (is much more procedural\320a picture is drawn by specifying \(sometimes)9 2859 1 2541 2832 t ( PICTURE lan-)2 640( direct influences include the)4 1185( Other)1 285(in painful detail\) the motions that one goes through to draw it.)11 2570 4 720 2952 t (guage [2], the V viewgraph language [1], and, more recently, new features from the)13 3428 1 720 3072 t 10 I f (grap)4179 3072 w 10 R f (language [3] for typeset-)3 1001 1 4399 3072 t (ting graphs.)1 472 1 720 3192 t ( a user's manual for)4 848(This paper is primarily)3 952 2 970 3348 t 10 I f (pic)2809 3348 w 10 R f (; a discussion of design issues and user experience may be)10 2469 1 2931 3348 t ( next section shows how to use)6 1268( The)1 210(found in [6].)2 512 3 720 3468 t 10 I f (pic)2740 3468 w 10 R f ( sections describe how to)4 1020( Subsequent)1 515(in the most simple way.)4 973 3 2892 3468 t ( defaults are wrong, and how to change their positions when the standard posi-)13 3204(change the sizes of objects when the)6 1476 2 720 3588 t ( appendix describes the language succinctly and summarizes changes since the last man-)12 3549( An)1 173( are wrong.)2 453(tioning rules)1 505 4 720 3708 t (ual.)720 3828 w 10 B f (2. Basics)1 392 1 720 4068 t 10 I f (Pic)970 4224 w 10 R f (provides boxes, lines, arrows, circles, ellipses, arcs, and splines \(smooth curves\), plus facilities for posi-)14 4264 1 1136 4224 t ( shows all of the fundamental objects \(except for splines\) in their)11 2758( picture below)2 603( The)1 221(tioning and labeling them.)3 1098 4 720 4344 t (default sizes:)1 524 1 720 4464 t 990 4626 990 4986 Dl 1530 4626 990 4626 Dl 1530 4986 1530 4626 Dl 990 4986 1530 4986 Dl (box)1185 4826 w 2250 4806 1890 4806 Dl (line)1995 4766 w 2970 4806 2610 4806 Dl 2970 4806 2898 4824 Dl 2970 4806 2898 4788 Dl (arrow)2674 4766 w 3330 4806 360 360 De (circle)3400 4826 w 4050 4806 540 360 De (ellipse)4190 4826 w 4950 4986 0 -180 180 0 Da (arc)4890 4826 w (Each picture begins with)3 1002 1 720 5184 t 10 CW f (.PS)1751 5184 w 10 R f (and ends with)2 563 1 1960 5184 t 10 CW f (.PE)2552 5184 w 10 R f ( com-)1 235( Each)1 253(; between them are commands to describe the picture.)8 2180 3 2732 5184 t ( example)1 363( For)1 189(mand is typed on a line by itself.)7 1305 3 720 5304 t 9 CW f (.PS)1008 5474 w (box "this is" "a box")4 1134 1 1008 5584 t (.PE)1008 5694 w 10 R f (creates a standard box \()4 941 1 720 5874 t 10 S1 f ()1661 5874 w cleartomark saveobj restore %%BeginGlobal /build_34 { pop /optsize ptsize def /osize size def /ofont font def optsize 2 div dup R exch R f 0 size 2 mul 3 div dup neg exch 0 exch rmoveto (3) show rmoveto optsize R f (\244) show f (4) show optsize ofont f } def %%EndGlobal /saveobj save def mark 10 S1 f 1661 5874 m 75 build_34 1736 5874 m 10 R f (inch wide,)1 416 1 1761 5874 t 10 S1 f ()2202 5874 w cleartomark saveobj restore %%BeginGlobal /build_12 { pop /optsize ptsize def /osize size def /ofont font def optsize 2 div dup R exch R f 0 size 2 mul 3 div dup neg exch 0 exch rmoveto (1) show rmoveto optsize R f (\244) show f (2) show optsize ofont f } def %%EndGlobal /saveobj save def mark 10 S1 f 2202 5874 m 75 build_12 2277 5874 m 10 R f (inch high\) and centers the two pieces of text in it:)10 1975 1 2302 5874 t 2790 6036 2790 6396 Dl 3330 6036 2790 6036 Dl 3330 6396 3330 6036 Dl 2790 6396 3330 6396 Dl (this is)1 237 1 2942 6176 t (a box)1 219 1 2951 6296 t ( \(Of)1 195( are mandatory, even if the text contains no blanks.)9 2101( Quotes)1 340( quoted string.)2 589(Each line of text is a separate)6 1205 5 970 6630 t ( line will be printed in the current size and font, centered horizontally,)12 2843( Each)1 253( at all.\))2 288(course there needn't be any text)5 1296 4 720 6750 t (and separated vertically by the current)5 1571 1 720 6870 t 10 I f (troff)2325 6870 w 10 R f (line spacing.)1 515 1 2533 6870 t 10 I f (Pic)3108 6870 w 10 R f (does not center the complete drawing itself, but the)8 2124 1 3276 6870 t (default definitions of)2 838 1 720 6990 t 10 CW f (.PS)1583 6990 w 10 R f (and)1788 6990 w 10 CW f (.PE)1957 6990 w 10 R f (in the)1 225 1 2162 6990 t 10 CW f (-ms)2412 6990 w 10 R f (macro package do.)2 750 1 2617 6990 t 8 S1 f (__________________)720 7090 w 8 R f (\262 This is a revised version of [5].)7 1051 1 720 7190 t cleartomark showpage saveobj restore %%EndPage: 1 3 %%Page: 2 4 /saveobj save def mark 4 pagesetup 10 R f (- 2 -)2 166 1 2977 480 t (You can use)2 493 1 970 840 t 10 CW f (circle)1488 840 w 10 R f (or)1873 840 w 10 CW f (ellipse)1981 840 w 10 R f (in place of)2 421 1 2426 840 t 10 CW f (box)2872 840 w 10 R f (:)3052 840 w 2250 1182 360 360 De (this is)1 237 1 2312 1142 t (a box)1 219 1 2321 1262 t 3330 1182 540 360 De (this is)1 237 1 3482 1142 t (a box)1 219 1 3491 1262 t ( than one line of text, the lines are centered above and)11 2249(Text is centered on lines and arrows; if there is more)10 2181 2 970 1596 t (below:)720 1716 w 9 CW f (line "this is" "a line")4 1242 1 1008 1886 t 10 R f 3240 2066 2880 2066 Dl (this is)1 237 1 2942 2026 t (a line)1 219 1 2951 2146 t 9 CW f (arrow "this is" "an arrow")4 1404 1 1008 2236 t 10 R f 3240 2416 2880 2416 Dl 3240 2416 3168 2434 Dl 3240 2416 3168 2398 Dl (this is)1 237 1 2942 2376 t (an arrow)1 351 1 2885 2496 t (Boxes and lines may be dashed or dotted; just add the word)11 2378 1 970 2572 t 10 CW f (dashed)3373 2572 w 10 R f (or)3758 2572 w 10 CW f (dotted)3866 2572 w 10 R f (after)4251 2572 w 10 CW f (box)4458 2572 w 10 R f (or)4663 2572 w 10 CW f (line)4771 2572 w 10 R f (:)5011 2572 w 9 CW f (line dashed "dashed" "line")3 1458 1 1008 2742 t 10 R f 2916 2922 2880 2922 Dl 2996 2922 2960 2922 Dl 3078 2922 3042 2922 Dl 3158 2922 3122 2922 Dl 3240 2922 3204 2922 Dl (dashed)2922 2882 w (line)2985 3002 w ( counterclockwise from the current direction; you can make them turn clock-)11 3145(Arcs by default turn 90 degrees)5 1285 2 970 3078 t (wise by saying)2 594 1 720 3198 t 10 CW f (arc cw)1 325 1 1339 3198 t 10 R f (:)1664 3198 w 9 CW f (line; arc; arc cw; arrow)4 1296 1 1008 3368 t 10 R f 2880 3950 2520 3950 Dl 2880 3950 0 -180 180 0 Da 3240 3590 0 180 -180 0 Da 3600 3590 3240 3590 Dl 3600 3590 3528 3608 Dl 3600 3590 3528 3572 Dl (A spline might well do this job better; we will return to that shortly.)13 2711 1 720 4148 t (As you might guess,)3 817 1 970 4304 t 9 CW f (arc; arc; arc; arc)3 972 1 1008 4474 t 10 R f ( that several commands can be put on a single line if they are sep-)14 2656( Notice)1 318( though not very efficiently.)4 1126(draws a circle,)2 580 4 720 4654 t (arated by semicolons.)2 868 1 720 4774 t (Objects are normally drawn one after another, left to right, and connected at the obvious places:)15 3822 1 970 4930 t 9 CW f (arrow; box "input"; arrow; box "process"; arrow; box "output"; arrow)9 3672 1 1008 5100 t 10 R f 1890 5502 1530 5502 Dl 1890 5502 1818 5520 Dl 1890 5502 1818 5484 Dl 1890 5322 1890 5682 Dl 2430 5322 1890 5322 Dl 2430 5682 2430 5322 Dl 1890 5682 2430 5682 Dl (input)2057 5522 w 2790 5502 2430 5502 Dl 2790 5502 2718 5520 Dl 2790 5502 2718 5484 Dl 2790 5322 2790 5682 Dl 3330 5322 2790 5322 Dl 3330 5682 3330 5322 Dl 2790 5682 3330 5682 Dl (process)2911 5522 w 3690 5502 3330 5502 Dl 3690 5502 3618 5520 Dl 3690 5502 3618 5484 Dl 3690 5322 3690 5682 Dl 4230 5322 3690 5322 Dl 4230 5682 4230 5322 Dl 3690 5682 4230 5682 Dl (output)3832 5522 w 4590 5502 4230 5502 Dl 4590 5502 4518 5520 Dl 4590 5502 4518 5484 Dl (One way to leave a space is with)7 1305 1 720 5880 t 10 CW f (move)2050 5880 w 10 R f (:)2290 5880 w 9 CW f (box; move; box; move; box)4 1350 1 1008 6050 t 10 R f 1890 6272 1890 6632 Dl 2430 6272 1890 6272 Dl 2430 6632 2430 6272 Dl 1890 6632 2430 6632 Dl 2790 6272 2790 6632 Dl 3330 6272 2790 6272 Dl 3330 6632 3330 6272 Dl 2790 6632 3330 6632 Dl 3690 6272 3690 6632 Dl 4230 6272 3690 6272 Dl 4230 6632 4230 6272 Dl 3690 6632 4230 6632 Dl ( you specify a direction \(as a)6 1213( If)1 126(Although objects are normally connected left to right, this can be changed.)11 3091 3 970 6866 t (separate object\), subsequent objects will be joined in that direction:)9 2691 1 720 6986 t 9 CW f (down; box; arrow; ellipse; arrow; circle)5 2160 1 1008 7156 t cleartomark showpage saveobj restore %%EndPage: 2 4 %%Page: 3 5 /saveobj save def mark 5 pagesetup 10 R f (- 3 -)2 166 1 2977 480 t 2790 840 2790 1200 Dl 3330 840 2790 840 Dl 3330 1200 3330 840 Dl 2790 1200 3330 1200 Dl 3060 1560 3060 1200 Dl 3060 1560 3042 1488 Dl 3060 1560 3078 1488 Dl 2790 1740 540 360 De 3060 2280 3060 1920 Dl 3060 2280 3042 2208 Dl 3060 2280 3078 2208 Dl 2880 2460 360 360 De 9 CW f (left; box; arrow; ellipse; arrow; circle)5 2160 1 1008 2888 t 10 R f 3600 3110 3600 3470 Dl 4140 3110 3600 3110 Dl 4140 3470 4140 3110 Dl 3600 3470 4140 3470 Dl 3240 3290 3600 3290 Dl 3240 3290 3312 3272 Dl 3240 3290 3312 3308 Dl 2700 3290 540 360 De 2340 3290 2700 3290 Dl 2340 3290 2412 3272 Dl 2340 3290 2412 3308 Dl 1980 3290 360 360 De (Each new picture begins going to the right.)7 1720 1 720 3668 t ( is possible, however, to)4 1038( It)1 129( drawn at a fixed scale, with objects of a standard size.)11 2373(Normally, figures are)2 890 4 970 3824 t ( the)1 149( If)1 118( to fit a particular width.)5 981(arrange that a figure be expanded or shrunk)7 1757 4 720 3944 t 10 CW f (.PS)3752 3944 w 10 R f (line contains a number, the drawing)5 1441 1 3959 3944 t ( Thus)1 250(is forced to be that many inches wide, with the height scaled proportionately.)12 3079 2 720 4064 t 9 CW f (.PS 3.5)1 378 1 1008 4234 t 10 R f ( two dimensions are specified, the second is the height.)9 2200( If)1 116(causes the picture to be 3.5 inches wide.)7 1605 3 720 4414 t 10 I f (Pic)970 4570 w 10 R f ( is no way to)4 519( There)1 284(is pretty dumb about the size of text in relation to the size of boxes, circles, and so on.)18 3468 3 1129 4570 t ( text'' or ``make this text fit inside this circle'' or ``draw a line as long as)16 2986(say ``make a box that just fits around this)8 1694 2 720 4690 t ( fitting of text can generally only be done by trial and error.)12 2376( Tight)1 267(this text.'')1 411 3 720 4810 t ( you make a grammatical error in the way you describe a picture,)12 2656(Speaking of errors, if)3 860 2 970 4966 t 10 I f (pic)4516 4966 w 10 R f (will complain and)2 732 1 4668 4966 t ( example, the invalid input)4 1069( For)1 189(try to indicate where.)3 848 3 720 5086 t 9 CW f (box arrow box)2 702 1 1008 5256 t 10 R f (will draw the message)3 890 1 720 5436 t 9 CW f (pic: syntax error near line 5, file -)7 1998 1 1008 5606 t (context is)1 540 1 1062 5716 t ( box)1 270( <<<)1 216( arrow)1 378(box >>>)1 378 4 1440 5826 t 10 R f ( to the place where the error was first noted; it sometimes follows the word in error, although in)18 3927(The brackets point)2 753 2 720 6006 t ( filename `)2 432( The)1 205(this example it's right on target.)5 1277 3 720 6126 t 10 CW f (-)2634 6126 w 10 R f (' is the standard input.)4 891 1 2694 6126 t 10 B f ( Sizes)1 236(3. Controlling)1 620 2 720 6366 t 10 R f ( The)1 208( deals with how to control the sizes of objects when the default sizes are not what is wanted.)18 3734(This section)1 488 3 970 6522 t (next section deals with positioning them when the default positions are not right.)12 3229 1 720 6642 t (Each object that)2 661 1 970 6798 t 10 I f (pic)1665 6798 w 10 R f ( radius,)1 304(knows about \(boxes, circles, etc.\) has associated dimensions, like height, width,)10 3275 2 1821 6798 t ( default,)1 328( By)1 168(and so on.)2 410 3 720 6918 t 10 I f (pic)1652 6918 w 10 R f ( be)1 119(tries to choose sensible default values for these dimensions, so that simple pictures can)13 3481 2 1800 6918 t ( in their default)3 637( of the figures and motions shown so far have been)10 2105( All)1 185(drawn with a minimum of fuss and bother.)7 1753 4 720 7038 t (sizes:)720 7158 w cleartomark showpage saveobj restore %%EndPage: 3 5 %%Page: 4 6 /saveobj save def mark 6 pagesetup 10 R f (- 4 -)2 166 1 2977 480 t (box)1080 900 w 10 S1 f ()1800 900 w 1800 900 m 75 build_34 1875 900 m 10 R f (" wide)1 260 1 1875 900 t 10 S f (\264)2160 900 w 10 S1 f ()2240 900 w 2240 900 m 75 build_12 2315 900 m 10 R f (" high)1 244 1 2315 900 t (circle)1080 1020 w 10 S1 f ()1800 1020 w 1800 1020 m 75 build_12 1875 1020 m 10 R f (" diameter)1 415 1 1875 1020 t (ellipse)1080 1140 w 10 S1 f ()1800 1140 w 1800 1140 m 75 build_34 1875 1140 m 10 R f (" wide)1 260 1 1875 1140 t 10 S f (\264)2160 1140 w 10 S1 f ()2240 1140 w 2240 1140 m 75 build_12 2315 1140 m 10 R f (" high)1 244 1 2315 1140 t (arc)1080 1260 w 10 S1 f ()1800 1260 w 1800 1260 m 75 build_12 1875 1260 m 10 R f (" radius)1 310 1 1875 1260 t (line or arrow)2 515 1 1080 1380 t 10 S1 f ()1800 1380 w 1800 1380 m 75 build_12 1875 1380 m 10 R f (" long)1 244 1 1875 1380 t (move)1080 1500 w 10 S1 f ()1800 1500 w 1800 1500 m 75 build_12 1875 1500 m 10 R f (" in the current direction)4 978 1 1875 1500 t (When necessary, you can make any object any size you want:)10 2463 1 720 1716 t 9 CW f (box width 3 height 0.1; circle radius 0.1)7 2214 1 1008 1886 t 10 R f 1908 2144 1908 2216 Dl 4068 2144 1908 2144 Dl 4068 2216 4068 2144 Dl 1908 2216 4068 2216 Dl 4068 2180 144 144 De ( wide and 1/10 inch high and the circle has radius)10 2030(All positions and dimensions are in inches, so the box is 3 inches)12 2650 2 720 2450 t (1/10 inch.)1 400 1 720 2570 t (An attribute like)2 657 1 970 2726 t 10 CW f (width)1654 2726 w 10 R f ( can also change the default size for)7 1440( You)1 224(changes only the one instance of the object.)7 1755 3 1981 2726 t (all objects of a particular type by assigning values to)9 2100 1 720 2846 t 10 I f (pic)2845 2846 w 10 R f (variables; this will be discussed in Section 6.)7 1794 1 2992 2846 t (The attributes of)2 684 1 970 3002 t 10 CW f (height)1691 3002 w 10 R f (\(which you can abbreviate to)4 1206 1 2088 3002 t 10 CW f (ht)3331 3002 w 10 R f (\) and)1 214 1 3451 3002 t 10 CW f (width)3702 3002 w 10 R f (\(or)4039 3002 w 10 CW f (wid)4192 3002 w 10 R f (\) apply to boxes, circles,)4 1028 1 4372 3002 t ( attributes of)2 517( The)1 211(ellipses, and to the head on an arrow.)7 1525 3 720 3122 t 10 CW f (radius)3004 3122 w 10 R f (\(or)3395 3122 w 10 CW f (rad)3542 3122 w 10 R f (\) and)1 208 1 3722 3122 t 10 CW f (diameter)3961 3122 w 10 R f (\(or)4472 3122 w 10 CW f (diam)4619 3122 w 10 R f (\) can be used)3 541 1 4859 3122 t (for circles and arcs if they seem more natural.)8 1825 1 720 3242 t ( you are right now, in)5 875(Lines and arrows are most easily drawn by specifying the amount of motion from where)14 3555 2 970 3398 t ( the words)2 428( Accordingly)1 555(terms of directions.)2 786 3 720 3518 t 10 CW f (up)2519 3518 w 10 R f (,)2639 3518 w 10 CW f (down)2694 3518 w 10 R f (,)2934 3518 w 10 CW f (left)2989 3518 w 10 R f (and)3259 3518 w 10 CW f (right)3433 3518 w 10 R f (and an optional distance can be attached)6 1637 1 3763 3518 t (to)720 3638 w 10 CW f (line)823 3638 w 10 R f (,)1063 3638 w 10 CW f (arrow)1113 3638 w 10 R f (, and)1 194 1 1413 3638 t 10 CW f (move)1632 3638 w 10 R f (:)1872 3638 w 9 CW f (line up 1 right 2)4 918 1 1008 3808 t (arrow left 2)2 648 1 1008 3918 t (move left 0.1)2 702 1 1008 4028 t (line <-> down 1 "height " rjust)6 1674 1 1008 4138 t 10 R f 3816 4360 2376 5080 Dl 2376 4360 3816 4360 Dl 2376 4360 2448 4342 Dl 2376 4360 2448 4378 Dl 2304 4360 2322 4432 Dl 2304 4360 2286 4432 Dl 2304 5080 2304 4360 Dl 2304 5080 2286 5008 Dl 2304 5080 2322 5008 Dl (height)2029 4740 w (The notation)1 508 1 720 5278 t 10 CW f (<->)1253 5278 w 10 R f ( use)1 159(indicates a two-headed arrow;)3 1199 2 1458 5278 t 10 CW f (->)2842 5278 w 10 R f (for a head on the end and)6 1014 1 2988 5278 t 10 CW f (<-)4028 5278 w 10 R f ( and)1 170( Lines)1 273(for one on the start.)4 783 3 4174 5278 t (arrows are really the same thing; in fact,)7 1607 1 720 5398 t 10 CW f (arrow)2352 5398 w 10 R f (is a synonym for)3 669 1 2677 5398 t 10 CW f (line ->)1 385 1 3371 5398 t 10 R f (.)3756 5398 w (If you don't specify any distance after)6 1518 1 970 5554 t 10 CW f (up)2513 5554 w 10 R f (,)2633 5554 w 10 CW f (down)2683 5554 w 10 R f (, etc.,)1 216 1 2923 5554 t 10 I f (pic)3164 5554 w 10 R f (uses the standard distance:)3 1062 1 3311 5554 t 9 CW f (line up right; line down; line down left; line up)9 2646 1 1008 5724 t 10 R f 3240 5946 2880 6306 Dl 3240 6306 3240 5946 Dl 2880 6666 3240 6306 Dl 2880 6306 2880 6666 Dl (If you omit the direction associated with a distance, the current direction is used.)13 3220 1 720 6864 t (Boxes and lines may be dotted or dashed:)7 1662 1 970 7020 t 9 CW f (box dotted; line dotted; move; line dashed; box dashed)8 2916 1 1008 7190 t cleartomark showpage saveobj restore %%EndPage: 4 6 %%Page: 5 7 /saveobj save def mark 7 pagesetup 10 R f (- 5 -)2 166 1 2977 480 t 7 R f ( .)1 0(. . . . . . . . . . . . . . . .)15 558 2 1970 1203 t (.)2510 1167 w (.)2510 1131 w (.)2510 1095 w (.)2510 1059 w (.)2510 1023 w (.)2510 987 w (.)2510 951 w (.)2510 915 w (.)2510 879 w ( .)1 0( . . . . . . . . . . . . . . .)15 -540(. .)1 18 3 2510 843 t (.)1970 879 w (.)1970 915 w (.)1970 951 w (.)1970 987 w (.)1970 1023 w (.)1970 1059 w (.)1970 1095 w (.)1970 1131 w (.)1970 1167 w (.)1970 1203 w (. . . . . . . . . . .)10 378 1 2510 1023 t 10 R f 3276 1020 3240 1020 Dl 3356 1020 3320 1020 Dl 3438 1020 3402 1020 Dl 3518 1020 3482 1020 Dl 3600 1020 3564 1020 Dl 3636 1200 3600 1200 Dl 3708 1200 3672 1200 Dl 3780 1200 3744 1200 Dl 3852 1200 3816 1200 Dl 3924 1200 3888 1200 Dl 3996 1200 3960 1200 Dl 4068 1200 4032 1200 Dl 4140 1200 4104 1200 Dl 4140 1164 4140 1200 Dl 4140 1083 4140 1119 Dl 4140 1002 4140 1038 Dl 4140 921 4140 957 Dl 4140 840 4140 876 Dl 4104 840 4140 840 Dl 4032 840 4068 840 Dl 3960 840 3996 840 Dl 3888 840 3924 840 Dl 3816 840 3852 840 Dl 3744 840 3780 840 Dl 3672 840 3708 840 Dl 3600 840 3636 840 Dl 3600 876 3600 840 Dl 3600 956 3600 920 Dl 3600 1038 3600 1002 Dl 3600 1118 3600 1082 Dl 3600 1200 3600 1164 Dl (If there is a number after)5 1033 1 720 1398 t 10 CW f (dot)1787 1398 w 10 R f ( size of the)3 465( can also control the)4 840( You)1 231(, the dots will be approximately that far apart.)8 1897 4 1967 1398 t ( if there is a length after the word)8 1330(dashes \(at least somewhat\):)3 1098 2 720 1518 t 10 CW f (dashed)3173 1518 w 10 R f (, the dashes will be that long, and the interven-)9 1867 1 3533 1518 t (ing spaces will be as close as possible to that size:)10 1998 1 720 1638 t 9 CW f (line right 5 dashed; move left 5 down .25; right)9 2592 1 1008 1808 t (line right 5 dashed 0.25; move left 5 down .25; right)10 2862 1 1008 1918 t (line right 5 dashed 0.5; move left 5 down .25; right)10 2808 1 1008 2028 t (line right 5 dashed 1)4 1134 1 1008 2138 t 10 R f 1296 2360 1260 2360 Dl 1368 2360 1332 2360 Dl 1441 2360 1405 2360 Dl 1514 2360 1478 2360 Dl 1586 2360 1550 2360 Dl 1659 2360 1623 2360 Dl 1732 2360 1696 2360 Dl 1805 2360 1769 2360 Dl 1877 2360 1841 2360 Dl 1950 2360 1914 2360 Dl 2023 2360 1987 2360 Dl 2095 2360 2059 2360 Dl 2168 2360 2132 2360 Dl 2241 2360 2205 2360 Dl 2314 2360 2278 2360 Dl 2386 2360 2350 2360 Dl 2459 2360 2423 2360 Dl 2532 2360 2496 2360 Dl 2604 2360 2568 2360 Dl 2677 2360 2641 2360 Dl 2750 2360 2714 2360 Dl 2823 2360 2787 2360 Dl 2895 2360 2859 2360 Dl 2968 2360 2932 2360 Dl 3041 2360 3005 2360 Dl 3114 2360 3078 2360 Dl 3187 2360 3151 2360 Dl 3260 2360 3224 2360 Dl 3332 2360 3296 2360 Dl 3405 2360 3369 2360 Dl 3478 2360 3442 2360 Dl 3551 2360 3515 2360 Dl 3623 2360 3587 2360 Dl 3696 2360 3660 2360 Dl 3769 2360 3733 2360 Dl 3841 2360 3805 2360 Dl 3914 2360 3878 2360 Dl 3987 2360 3951 2360 Dl 4060 2360 4024 2360 Dl 4132 2360 4096 2360 Dl 4205 2360 4169 2360 Dl 4278 2360 4242 2360 Dl 4350 2360 4314 2360 Dl 4423 2360 4387 2360 Dl 4496 2360 4460 2360 Dl 4569 2360 4533 2360 Dl 4641 2360 4605 2360 Dl 4714 2360 4678 2360 Dl 4787 2360 4751 2360 Dl 4860 2360 4824 2360 Dl 1440 2540 1260 2540 Dl 1782 2540 1602 2540 Dl 2124 2540 1944 2540 Dl 2466 2540 2286 2540 Dl 2808 2540 2628 2540 Dl 3150 2540 2970 2540 Dl 3492 2540 3312 2540 Dl 3834 2540 3654 2540 Dl 4176 2540 3996 2540 Dl 4518 2540 4338 2540 Dl 4860 2540 4680 2540 Dl 1620 2720 1260 2720 Dl 2268 2720 1908 2720 Dl 2916 2720 2556 2720 Dl 3564 2720 3204 2720 Dl 4212 2720 3852 2720 Dl 4860 2720 4500 2720 Dl 1980 2900 1260 2900 Dl 3420 2900 2700 2900 Dl 4860 2900 4140 2900 Dl (Dotted or dashed attributes apply only to lines and boxes.)9 2298 1 720 3098 t ( by adding the word)4 803(You can make any object invisible)5 1384 2 970 3290 t 10 CW f (invis)3183 3290 w 10 R f ( is particularly useful for position-)5 1373( This)1 229(after it.)1 289 3 3509 3290 t (ing things correctly near text:)4 1176 1 720 3410 t 9 CW f (box invis "input"; arrow; box invis "output")6 2376 1 1008 3580 t 10 R f (input)2507 4002 w 3240 3982 2880 3982 Dl 3240 3982 3168 4000 Dl 3240 3982 3168 3964 Dl (output)3382 4002 w (Text may be positioned on lines and arrows:)7 1773 1 970 4396 t 9 CW f (arrow "on top of"; move)4 1242 1 1008 4566 t (arrow "above" "below"; move)3 1458 1 1008 4676 t (arrow "above" above; move)3 1350 1 1008 4786 t (arrow "below" below; move)3 1350 1 1008 4896 t (arrow "above" "on top of" "below")5 1782 1 1008 5006 t 10 R f 1800 5186 1440 5186 Dl 1800 5186 1728 5204 Dl 1800 5186 1728 5168 Dl (on top of)2 361 1 1440 5206 t 2520 5186 2160 5186 Dl 2520 5186 2448 5204 Dl 2520 5186 2448 5168 Dl (above)2221 5146 w (below)2218 5266 w 3240 5186 2880 5186 Dl 3240 5186 3168 5204 Dl 3240 5186 3168 5168 Dl (above)2941 5146 w 3960 5186 3600 5186 Dl 3960 5186 3888 5204 Dl 3960 5186 3888 5168 Dl (below)3658 5266 w 4680 5186 4320 5186 Dl 4680 5186 4608 5204 Dl 4680 5186 4608 5168 Dl (above)4381 5086 w (on top of)2 361 1 4320 5206 t (below)4378 5326 w ( The)1 209( is the distance along the shaft.)6 1253(The ``width'' of an arrowhead is the distance across its tail; the ``height'')12 2968 3 970 5378 t (arrowheads in this picture are default size and shape.)8 2108 1 720 5498 t (As we said earlier, arcs go 90 degrees counterclockwise from where you are right now, and)15 3717 1 970 5654 t 10 CW f (arc cw)1 331 1 4717 5654 t 10 R f (changes)5079 5654 w ( is the same as for circles, but you can change it with the)13 2348( default radius)2 587( The)1 213(this to clockwise.)2 713 4 720 5774 t 10 CW f (rad)4613 5774 w 10 R f ( is)1 99(attribute. It)1 476 2 4825 5774 t (also easy to draw arcs between specific places; this will be described in the next section.)15 3526 1 720 5894 t (To put an arrowhead on an arc, use one of)9 1678 1 970 6050 t 10 CW f (<-)2673 6050 w 10 R f (,)2793 6050 w 10 CW f (->)2843 6050 w 10 R f (or)2988 6050 w 10 CW f (<->)3096 6050 w 10 R f (, as with lines.)3 575 1 3276 6050 t ( you)1 186( If)1 127( explicit dimension for some object is specified, you will get the default size.)13 3215(In all cases, unless an)4 902 4 970 6242 t ( of that kind, add the word)6 1075(want an object to have the same size as the previous one)11 2292 2 720 6362 t 10 CW f (same)4115 6362 w 10 R f ( in the set of boxes)5 767(. Thus)1 278 2 4355 6362 t (given by)1 347 1 720 6482 t 9 CW f (down; box ht 0.2 wid 1.5; move down 0.15; box same; move same; box same)14 3834 1 1008 6652 t cleartomark showpage saveobj restore %%EndPage: 5 7 %%Page: 6 8 /saveobj save def mark 8 pagesetup 10 R f (- 6 -)2 166 1 2977 480 t 2520 840 2520 984 Dl 3600 840 2520 840 Dl 3600 984 3600 840 Dl 2520 984 3600 984 Dl 2520 1092 2520 1236 Dl 3600 1092 2520 1092 Dl 3600 1236 3600 1092 Dl 2520 1236 3600 1236 Dl 2520 1344 2520 1488 Dl 3600 1344 2520 1344 Dl 3600 1488 3600 1344 Dl 2520 1488 3600 1488 Dl (the dimensions set by the first)5 1222 1 720 1686 t 10 CW f (box)1972 1686 w 10 R f ( for the second)3 608(are used several times; similarly, the amount of motion)8 2241 2 2182 1686 t 10 CW f (move)5062 1686 w 10 R f (is)5333 1686 w (the same as for the first one.)6 1128 1 720 1806 t ( Here)1 247( values.)1 309(You can change the default sizes of objects by assigning values to the variables that define their)16 3874 3 970 1962 t (is the list, with their default values:)6 1408 1 720 2082 t 9 CW f ( = 0.5)2 324( boxht)1 954(boxwid = 0.75;)2 756 3 1008 2252 t ( = 0.5)2 324( lineht)1 954(linewid = 0.75;)2 810 3 1008 2362 t ( = 0.25)2 378( arcrad)1 846(circlerad = 0.25;)2 918 3 1008 2472 t ( = 0.5)2 324( ellipseht)1 954(ellipsewid = 0.75;)2 972 3 1008 2582 t ( = 0.5)2 324( moveht)1 954(movewid = 0.75;)2 810 3 1008 2692 t ( = 0)2 216( textht)1 1116(textwid = 0;)2 648 3 1008 2802 t ( = 0.1)2 324( arrowht)1 954(arrowwid = 0.05;)2 864 3 1008 2912 t 9 R f (\(These refer to the arrowhead.\))4 1120 1 3384 2912 t 9 CW f ( = 2)2 216( arrowhead)1 1116(dashwid = 0.05;)2 810 3 1008 3022 t 9 R f (\(Arrowhead fill style\))2 786 1 3384 3022 t 9 CW f ( = 11)2 270( maxpswid)1 1116(maxpsht = 8.5;)2 756 3 1008 3132 t 9 R f (\(Maximum picture dimensions\))2 1141 1 3384 3132 t 9 CW f ( = 1)2 216( scale)1 954(fillval = 0.3;)2 756 3 1008 3242 t 10 R f (So if you want all your boxes to be long and skinny, and relatively close together,)15 3266 1 720 3422 t 9 CW f (boxwid = 0.1; boxht = 1)5 1242 1 1008 3592 t (movewid = 0.2)2 702 1 1008 3702 t (box; move; box; move; box)4 1350 1 1008 3812 t 10 R f 2808 4034 2808 4754 Dl 2880 4034 2808 4034 Dl 2880 4754 2880 4034 Dl 2808 4754 2880 4754 Dl 3024 4034 3024 4754 Dl 3096 4034 3024 4034 Dl 3096 4754 3096 4034 Dl 3024 4754 3096 4754 Dl 3240 4034 3240 4754 Dl 3312 4034 3240 4034 Dl 3312 4754 3312 4034 Dl 3240 4754 3312 4754 Dl (Setting the variable)2 787 1 970 4988 t 10 CW f (arrowhead)1787 4988 w 10 R f ( overstriking; the default)3 1003(to a value like 7 causes arrowheads to be filled by)10 2040 2 2357 4988 t (is 2:)1 170 1 720 5108 t 9 CW f (arrowhead = 7; arrow; move; arrowhead = 2; arrow)8 2592 1 1008 5278 t 10 R f 2988 5458 2628 5458 Dl 2988 5458 2916 5476 Dl 2987 5458 2914 5470 Dl 2987 5458 2913 5463 Dl 2987 5458 2913 5458 Dl 2987 5458 2913 5453 Dl 2987 5458 2914 5446 Dl 2988 5458 2916 5440 Dl 3492 5458 3132 5458 Dl 3492 5458 3420 5476 Dl 3492 5458 3420 5440 Dl 10 I f (Pic)970 5614 w 10 R f ( the variable)2 503( Setting)1 339(works internally in inches.)3 1075 3 1133 5614 t 10 CW f (scale)3080 5614 w 10 R f (to some value causes all dimensions to be scaled)8 1990 1 3410 5614 t ( for example,)2 529( Thus,)1 275(down by that value.)3 788 3 720 5734 t 10 CW f (scale=2.54)2337 5734 w 10 R f (causes dimensions to be interpreted as centimeters.)6 2038 1 2962 5734 t (The numbers given in the)4 1037 1 970 5890 t 10 CW f (.PS)2037 5890 w 10 R f (line override the dimensions given in the picture; these can be used to force a)14 3153 1 2247 5890 t ( way to get a picture of the right size is to)11 1700( indicates that a good)4 869( Experience)1 503(picture to a particular width and height.)6 1608 4 720 6010 t (enter its dimensions in inches, then if necessary add a width and perhaps height to the)15 3423 1 720 6130 t 10 CW f (.PS)4168 6130 w 10 R f (line.)4373 6130 w (Once set, variables like)3 961 1 970 6286 t 10 CW f (boxht)1966 6286 w 10 R f ( can reset variables to)4 908( You)1 233( next.)1 233(retain their values from one picture to the)7 1725 4 2301 6286 t (their default values by listing them in a)7 1563 1 720 6406 t 10 CW f (reset)2308 6406 w 10 R f (statement:)2633 6406 w 9 CW f (reset boxht, boxwid)2 1026 1 1008 6576 t 10 R f (A bare)1 268 1 720 6756 t 10 CW f (reset)1013 6756 w 10 R f (resets all variables.)2 762 1 1338 6756 t ( attribute)1 362( The)1 209( filling or shading objects, intended for Postscript output devices.)9 2643(There is a minimal facility for)5 1216 4 970 6912 t 10 CW f (fill)720 7032 w 10 I f (expr)994 7032 w 10 R f (sets the gray scale value to)5 1112 1 1205 7032 t 10 I f (expr)2350 7032 w 10 R f (; the default, determined by the variable)6 1642 1 2527 7032 t 10 CW f (fillval)4202 7032 w 10 R f ( Following)1 470(, is 0.3.)2 308 2 4622 7032 t ( Thus:)1 278(Postscript, smaller values are darker.)4 1469 2 720 7152 t cleartomark showpage saveobj restore %%EndPage: 6 8 %%Page: 7 9 /saveobj save def mark 9 pagesetup 10 R f (- 7 -)2 166 1 2977 480 t 9 CW f (box fill)1 432 1 1008 830 t (box ht boxht/2 wid boxwid/2 "hello" at last box)8 2538 1 1008 940 t cleartomark saveobj restore %%BeginGlobal % % Color and reverse video support for dpost. A call made to setcolor with two % arguments implies reverse video printing. % /rgb {setrgbcolor} bind def /hsb {sethsbcolor} bind def /colordict 50 dict dup begin /red { 1 0 0 } def /green { 0 1 0 } def /blue { 0 0 1 } def /cyan { 0 1 1 } def /magenta { 1 0 1 } def /yellow { 1 1 0 } def /white { 1 1 1 } def /black { 0 0 0 } def end def /setcolor { counttomark 1 eq { dup colordict exch known not {pop /black} if colordict exch get exec setrgbcolor } if counttomark 2 eq { /backcolor exch def /textcolor exch def colordict backcolor known not colordict textcolor known not or { /backcolor colordict /black get def /textcolor colordict /white get def } if /backcolor colordict backcolor get def /textcolor colordict textcolor get def /dY1 0 def /dY2 0 def textcolor exec setrgbcolor } if } bind def /drawrvbox { /x2 exch def /x1 exch def currentpoint dup /y1 exch def /y2 exch def pop dY1 0 eq dY2 0 eq and { currentfont /FontBBox get aload pop currentfont /FontMatrix get dtransform /dY2 exch def pop currentfont /FontMatrix get dtransform /dY1 exch def pop } if /y1 y1 dY1 add def /y2 y2 dY2 add def backcolor exec setrgbcolor newpath x1 y1 moveto x2 y1 lineto x2 y2 lineto x1 y2 lineto closepath fill textcolor exec setrgbcolor } bind def %%EndGlobal /saveobj save def mark gsave newpath 2790 1522 m /inpath true def 0.3 setgray 10 R f 2790 1162 2790 1522 Dl 3330 1162 2790 1162 Dl 3330 1522 3330 1162 Dl 2790 1522 3330 1522 Dl gsave eofill grestore 0 setgray stroke grestore /inpath false def 10 R f 2925 1252 2925 1432 Dl 3195 1252 2925 1252 Dl 3195 1432 3195 1252 Dl 2925 1432 3195 1432 Dl (hello)2960 1362 w 10 CW f (fill)720 1720 w 10 R f (currently only applies to boxes, circles, and ellipses.)7 2086 1 985 1720 t 10 B f ( Positions)1 409(4. Controlling)1 620 2 720 1960 t 10 R f (You can place things anywhere you want;)6 1716 1 970 2116 t 10 I f (pic)2718 2116 w 10 R f (provides a variety of ways to talk about positions.)8 2054 1 2873 2116 t 10 I f (Pic)4985 2116 w 10 R f (uses a)1 249 1 5151 2116 t (standard Cartesian coordinate system with)4 1712 1 720 2236 t 10 I f (x)2462 2236 w 10 R f (increasing rightwards and)2 1041 1 2536 2236 t 10 I f (y)3607 2236 w 10 R f (increasing upwards, so any point or object)6 1719 1 3681 2236 t (has an)1 257 1 720 2356 t 10 I f (x)1007 2356 w 10 R f (and)1081 2356 w 10 I f (y)1255 2356 w 10 R f ( The)1 211( first object is placed with its start at position 0,0 by default.)12 2471( The)1 211(position, measured in inches.)3 1178 4 1329 2356 t 10 I f (x,y)720 2476 w 10 R f ( circle or ellipse is its geometric center; the position of a line or spline or motion is its begin-)19 3814(position of a box,)3 721 2 865 2476 t (ning; the position of an arc is the center of the corresponding circle.)12 2703 1 720 2596 t (Position modifiers like)2 924 1 970 2752 t 10 CW f (from)1925 2752 w 10 R f (,)2165 2752 w 10 CW f (to)2221 2752 w 10 R f (,)2341 2752 w 10 CW f (by)2397 2752 w 10 R f (and)2548 2752 w 10 CW f (at)2723 2752 w 10 R f (are followed by an)3 763 1 2874 2752 t 10 I f (x,y)3669 2752 w 10 R f (pair, and can be attached to boxes, cir-)7 1586 1 3814 2752 t (cles, lines, motions, and so on, to specify or modify a position.)11 2505 1 720 2872 t (You can also use)3 679 1 970 3028 t 10 CW f (up)1674 3028 w 10 R f (,)1794 3028 w 10 CW f (down)1844 3028 w 10 R f (,)2084 3028 w 10 CW f (right)2134 3028 w 10 R f (, and)1 194 1 2434 3028 t 10 CW f (left)2653 3028 w 10 R f (with)2918 3028 w 10 CW f (line)3121 3028 w 10 R f (and)3386 3028 w 10 CW f (move)3555 3028 w 10 R f (:)3795 3028 w 9 CW f (box ht 0.2 wid 0.2 at 0,0 "1")7 1566 1 1008 3198 t ( or "move to 0.5,0")4 1026( #)1 1026(move right 0.5)2 756 3 1008 3308 t (box ht 0.2 wid 0.2 "2")5 1188 1 1008 3418 t ( or "move 0.5" or "move same")6 1566( #)1 1026(move right 0.5)2 756 3 1008 3528 t (box ht 0.2 wid 0.2 "3")5 1188 1 1008 3638 t 10 R f 2340 3860 2340 4040 Dl 2520 3860 2340 3860 Dl 2520 4040 2520 3860 Dl 2340 4040 2520 4040 Dl (1)2405 3970 w 2970 3860 2970 4040 Dl 3150 3860 2970 3860 Dl 3150 4040 3150 3860 Dl 2970 4040 3150 4040 Dl (2)3035 3970 w 3600 3860 3600 4040 Dl 3780 3860 3600 3860 Dl 3780 4040 3780 3860 Dl 3600 4040 3780 4040 Dl (3)3665 3970 w (Comments can be used in pictures; they begin with a)9 2112 1 720 4238 t 10 CW f (#)2857 4238 w 10 R f (and end at the end of the line.)7 1181 1 2942 4238 t (Attributes like)1 575 1 970 4394 t 10 CW f (ht)1570 4394 w 10 R f (and)1715 4394 w 10 CW f (wid)1884 4394 w 10 R f (and positions like)2 706 1 2089 4394 t 10 CW f (at)2820 4394 w 10 R f ( So)1 156(can be written out in any order.)6 1250 2 2965 4394 t 9 CW f (box ht 0.2 wid 0.2 at 0,0)6 1350 1 1008 4564 t (box at 0,0 wid 0.2 ht 0.2)6 1350 1 1008 4674 t (box ht 0.2 at 0,0 wid 0.2)6 1350 1 1008 4784 t 10 R f (are all equivalent, though the last is harder to read and thus less desirable.)13 2942 1 720 4964 t (The)970 5120 w 10 CW f (from)1159 5120 w 10 R f (and)1433 5120 w 10 CW f (to)1611 5120 w 10 R f ( default, arcs are)3 688( By)1 177( the endpoints.)2 606(attributes are particularly useful with arcs, to specify)7 2164 4 1765 5120 t (drawn counterclockwise,)1 997 1 720 5240 t 9 CW f ("+" at 0,0)2 540 1 1008 5410 t (arc -> from 0.5,0 to 0,0.5)5 1404 1 1008 5520 t (arc -> cw from 0,0 to 1,0.5)6 1458 1 1008 5630 t 10 R f (+)2672 6237 w 3060 6217 -360 0 0 -360 Da 2700 5857 2773 5847 Dl 2700 5857 2769 5882 Dl 3419 5858 3346 5870 Dl 3419 5858 3349 5835 Dl 3420 5857 -92 714 -627 -354 Da (The radius can be made large to provide flat arcs:)9 1975 1 720 6415 t 9 CW f (arc -> cw from 0,0 to 2,0 rad 15)8 1728 1 1008 6585 t 10 R f 3779 6831 3707 6844 Dl 3779 6830 3709 6808 Dl 3780 6830 -720 10776 -720 -10776 Da (If the circle is under-specified,)4 1261 1 720 7028 t 10 I f (pic)2017 7028 w 10 R f (guesses a radius and/or center; you will have to provide them explicitly if the)13 3225 1 2175 7028 t (guess is wrong.)2 619 1 720 7148 t cleartomark showpage saveobj restore %%EndPage: 7 9 %%Page: 8 10 /saveobj save def mark 10 pagesetup 10 R f (- 8 -)2 166 1 2977 480 t ( truth is)2 320( The)1 212( is an over-simplification.)3 1048( This)1 235( that objects are normally connected left to right.)8 2000(We said earlier)2 615 6 970 840 t ( the direction specified by the most recent)7 1700(that objects are connected together in)5 1513 2 720 960 t 10 CW f (up)3962 960 w 10 R f (,)4082 960 w 10 CW f (down)4136 960 w 10 R f (,)4376 960 w 10 CW f (left)4430 960 w 10 R f (or)4699 960 w 10 CW f (right)4811 960 w 10 R f (\(either)5140 960 w ( in)1 103( Thus,)1 275(alone or as part of some object\).)6 1283 3 720 1080 t 9 CW f (arrow left; box; arrow; circle; arrow)5 1998 1 1008 1250 t 10 R f (the)720 1430 w 10 CW f (left)867 1430 w 10 R f (implies connection towards the left:)4 1432 1 1132 1430 t 3690 1772 4050 1772 Dl 3690 1772 3762 1754 Dl 3690 1772 3762 1790 Dl 3150 1592 3150 1952 Dl 3690 1592 3150 1592 Dl 3690 1952 3690 1592 Dl 3150 1952 3690 1952 Dl 2790 1772 3150 1772 Dl 2790 1772 2862 1754 Dl 2790 1772 2862 1790 Dl 2430 1772 360 360 De 2070 1772 2430 1772 Dl 2070 1772 2142 1754 Dl 2070 1772 2142 1790 Dl (This could also be written as)5 1146 1 720 2150 t 9 CW f (left; arrow; box; arrow; circle; arrow)5 2052 1 1008 2320 t 10 R f ( the last)2 327(Objects are joined in the direction determined by)7 2004 2 970 2536 t 10 CW f (up)3334 2536 w 10 R f (,)3454 2536 w 10 CW f (down)3512 2536 w 10 R f (, etc., with the entry point of the second)8 1648 1 3752 2536 t ( points for boxes, cir-)4 861( and exit)2 348( Entry)1 274(object attached to the exit point of the first \(which is fixed at the time of entry\).)16 3197 4 720 2656 t ( automatic connection and direction selection works well if the direction)10 2910( This)1 230(cles and ellipses are on opposite sides.)6 1540 3 720 2776 t (doesn't change but it will occasionally surprise you:)7 2084 1 720 2896 t 9 CW f (arrow; circle; down; arrow)3 1404 1 1008 3066 t 10 R f 3060 3468 2700 3468 Dl 3060 3468 2988 3486 Dl 3060 3468 2988 3450 Dl 3060 3468 360 360 De 3420 3828 3420 3468 Dl 3420 3828 3402 3756 Dl 3420 3828 3438 3756 Dl (The arrow comes out of the right side of the circle, not the bottom, as might be expected.)17 3550 1 720 4026 t (If a set of commands is enclosed in braces)8 1789 1 970 4182 t 10 CW f ({...})2797 4182 w 10 R f ( direction of motion when the)5 1255(, the current position and)4 1048 2 3097 4182 t ( is also a more general)5 915( There)1 286( else is restored.)3 655( Nothing)1 382( exactly where it was when entered.)6 1450(group is finished will be)4 992 6 720 4302 t (way to group objects, using)4 1102 1 720 4422 t 10 CW f ([)1847 4422 w 10 R f (and)1932 4422 w 10 CW f (])2101 4422 w 10 R f (, which is discussed in Section 9.)6 1322 1 2161 4422 t 10 B f ( and Corners)2 561(5. Labels)1 409 2 720 4662 t 10 R f ( example,)1 388( For)1 189(Objects can be labelled or named so that you can talk about them later.)13 2828 3 970 4818 t 9 CW f (Box1: box)1 594 1 1008 4988 t (# ... other stuff ...)4 1134 1 1440 5098 t (move to Box1)2 648 1 1440 5208 t 10 R f (Place names)1 499 1 720 5388 t 10 I f (must)1247 5388 w 10 R f ( with lower)2 463(begin with an upper case letter \(to distinguish them from variable names, which begin)13 3473 2 1464 5388 t ( name refers to the ``center'' of the object, which is the geometric center for most things.)16 3547( The)1 205(case letters\).)1 498 3 720 5508 t (Other combinations also work:)3 1235 1 970 5664 t 9 CW f (line from Box1 to Box2)4 1188 1 1008 5834 t (move to Box1 up 0.1 right 0.2)6 1566 1 1008 5944 t ( same as previous)3 918( #)1 162(move to Box1 + 0.2,0.1)4 1188 3 1008 6054 t (line to Box1 - 0.5,0)4 1080 1 1008 6164 t 10 R f (The reserved name)2 758 1 720 6344 t 10 CW f (Here)1503 6344 w 10 R f (may be used to refer to the current position.)8 1744 1 1768 6344 t (Labels can be reset several times in a single picture, so a statement like)13 2839 1 970 6500 t 9 CW f ( + 1,1)2 324(Box1: Box1)1 594 2 1008 6670 t 10 R f (is perfectly legal.)2 690 1 720 6850 t (You can also refer to previously drawn objects of each type, using the word)13 3125 1 970 7042 t 10 CW f (last)4128 7042 w 10 R f ( example, given the)3 809(. For)1 223 2 4368 7042 t (input)720 7162 w cleartomark showpage saveobj restore %%EndPage: 8 10 %%Page: 9 11 /saveobj save def mark 11 pagesetup 10 R f (- 9 -)2 166 1 2977 480 t 9 CW f (box "A"; circle "B"; box "C")5 1512 1 1008 830 t 10 R f (then `)1 233 1 720 1010 t 10 CW f (last box)1 448 1 953 1010 t 10 R f (' refers to box)3 571 1 1401 1010 t 10 CW f (C)2000 1010 w 10 R f (, `)1 86 1 2060 1010 t 10 CW f (last circle)1 628 1 2146 1010 t 10 R f ( to circle)2 357(' refers)1 287 2 2774 1010 t 10 CW f (B)3447 1010 w 10 R f (, and `)2 260 1 3507 1010 t 10 CW f (2nd last box)2 658 1 3767 1010 t 10 R f (' refers to box)3 574 1 4425 1010 t 10 CW f (A)5028 1010 w 10 R f (. Num-)1 312 1 5088 1010 t ( from the beginning, so boxes)5 1238(bering of objects can also be done)6 1424 2 720 1130 t 10 CW f (A)3417 1130 w 10 R f (and)3512 1130 w 10 CW f (C)3691 1130 w 10 R f (are `)1 189 1 3786 1130 t 10 CW f (1st box)1 395 1 3975 1130 t 10 R f (' and `)2 280 1 4370 1130 t 10 CW f (2nd box)1 395 1 4650 1130 t 10 R f (' respec-)1 355 1 5045 1130 t (tively.)720 1250 w (To cut down the need for explicit coordinates, objects have ``corners'' named by compass points:)14 3895 1 970 1406 t 9 CW f (B: box "B.c" ht 1 wid 1.5)6 1350 1 1008 1576 t (" B.e" at B.e ljust)4 1026 1 1440 1686 t (" B.ne" at B.ne ljust)4 1134 1 1440 1796 t (" B.se" at B.se ljust)4 1134 1 1440 1906 t ("B.s" at B.s below)3 972 1 1440 2016 t ("B.n" at B.n above)3 972 1 1440 2126 t ("B.sw " at B.sw rjust)4 1134 1 1440 2236 t ("B.w " at B.w rjust)4 1026 1 1440 2346 t ("B.nw " at B.nw rjust)4 1134 1 1440 2456 t 10 R f 2520 2678 2520 3398 Dl 3600 2678 2520 2678 Dl 3600 3398 3600 2678 Dl 2520 3398 3600 3398 Dl (B.c B.e)1 769 1 2992 3058 t (B.ne)3625 2698 w (B.se)3625 3418 w (B.s)2995 3478 w (B.n)2989 2638 w (B.sw)2292 3418 w (B.w)2331 3058 w (B.nw)2281 2698 w (Note the use of)3 622 1 720 3596 t 10 CW f (ljust)1373 3596 w 10 R f (,)1673 3596 w 10 CW f (rjust)1729 3596 w 10 R f (,)2029 3596 w 10 CW f (above)2085 3596 w 10 R f (, and)1 200 1 2385 3596 t 10 CW f (below)2616 3596 w 10 R f (to alter the default positioning of text, and of a blank within)11 2453 1 2947 3596 t (some strings to help space them away from a vertical line.)10 2321 1 720 3716 t ( arrows have a)3 584(Lines and)1 392 2 970 3872 t 10 CW f (start)1973 3872 w 10 R f (, an)1 146 1 2273 3872 t 10 CW f (end)2446 3872 w 10 R f (and a)1 215 1 2653 3872 t 10 CW f (center)2895 3872 w 10 R f ( and ellipses have cor-)4 900( Circles)1 335(in addition to corners.)3 883 3 3282 3872 t ( words)1 286( The)1 222( has the same corners as the circle of which it is a part.)13 2399(ners too; an arc)3 666 4 720 3992 t 10 CW f (left)4335 3992 w 10 R f (,)4575 3992 w 10 CW f (right)4642 3992 w 10 R f (,)4942 3992 w 10 CW f (top)5009 3992 w 10 R f (, and)1 211 1 5189 3992 t 10 CW f (bottom)720 4112 w 10 R f (are synonyms for)2 693 1 1105 4112 t 10 CW f (west)1823 4112 w 10 R f (,)2063 4112 w 10 CW f (east)2113 4112 w 10 R f (,)2353 4112 w 10 CW f (north)2403 4112 w 10 R f (and)2728 4112 w 10 CW f (south)2897 4112 w 10 R f (.)3197 4112 w ( example the)2 520(It is often easiest to position objects by positioning some part of one at some part of another, for)18 3910 2 970 4268 t ( The)1 205(southwest corner of one at the southeast corner of another.)9 2333 2 720 4388 t 10 CW f (with)3283 4388 w 10 R f (attribute permits this kind of positioning:)5 1643 1 3548 4388 t 9 CW f (box ht 0.75 wid 0.75)4 1080 1 1008 4558 t (box ht 0.5 wid 0.5 with .sw at last box.se)9 2268 1 1008 4668 t 10 R f 2610 4890 2610 5430 Dl 3150 4890 2610 4890 Dl 3150 5430 3150 4890 Dl 2610 5430 3150 5430 Dl 3150 5070 3150 5430 Dl 3510 5070 3150 5070 Dl 3510 5430 3510 5070 Dl 3150 5430 3510 5430 Dl (Notice that the corner after)4 1074 1 720 5628 t 10 CW f (with)1819 5628 w 10 R f (is written)1 375 1 2084 5628 t 10 CW f (.sw)2484 5628 w 10 R f (.)2664 5628 w (As another example, consider)3 1186 1 970 5784 t 9 CW f (ellipse)1008 5954 w (ellipse ht .2 wid .3 with .se at 1st ellipse.nw)9 2538 1 1008 6064 t (ellipse ht .2 wid .3 with .sw at 1st ellipse.ne)9 2538 1 1008 6174 t 10 R f 2790 6645 540 360 De 2685 6468 216 144 De 3219 6468 216 144 De ( which is not one of the eight compass)8 1636(Sometimes it is desirable to have a line intersect a circle at a point)13 2794 2 970 7095 t (points that)1 426 1 720 7215 t 10 I f (pic)1177 7215 w 10 R f ( the attribute)2 515( such cases, the proper visual effect can be obtained by using)11 2499( In)1 139(knows about.)1 539 4 1330 7215 t 10 CW f (chop)5052 7215 w 10 R f (to)5322 7215 w cleartomark showpage saveobj restore %%EndPage: 9 11 %%Page: 10 12 /saveobj save def mark 12 pagesetup 10 R f (- 10 -)2 216 1 2952 480 t (chop off part of the line:)5 973 1 720 840 t 9 CW f (circlerad = 0.15; arrowhead = 7)5 1674 1 1008 1010 t (circle "a")1 540 1 1008 1120 t (circle "b" at 1st circle - \(0.4, 0.6\))7 1998 1 1008 1230 t (circle "c" at 1st circle + \(0.4, -0.6\))7 2052 1 1008 1340 t (arrow from 1st circle to 2nd circle chop)7 2160 1 1008 1450 t (arrow from 1st circle to 3rd circle chop)7 2160 1 1008 1560 t 10 R f 2952 1890 216 216 De (a)3038 1910 w 2664 2322 216 216 De (b)2747 2342 w 3240 2322 216 216 De (c)3326 2342 w 2832 2232 3000 1980 Dl 2831 2231 2856 2162 Dl 2832 2231 2862 2164 Dl 2831 2231 2867 2167 Dl 2831 2231 2872 2170 Dl 2831 2231 2877 2173 Dl 2832 2232 2882 2178 Dl 2832 2231 2886 2182 Dl 3287 2232 3119 1980 Dl 3287 2231 3233 2182 Dl 3287 2232 3237 2178 Dl 3288 2231 3242 2173 Dl 3288 2231 3247 2170 Dl 3288 2231 3252 2167 Dl 3287 2231 3257 2164 Dl 3288 2231 3263 2162 Dl (By default the line is chopped by)6 1321 1 720 2628 t 10 CW f (circlerad)2066 2628 w 10 R f ( may be changed:)3 701( This)1 228(at each end.)2 473 3 2631 2628 t 9 CW f (line ... chop)2 702 1 1008 2798 t 9 I f (r)1764 2798 w 10 R f (chops both ends by)3 769 1 720 2978 t 10 I f (r)1514 2978 w 10 R f (, and)1 194 1 1553 2978 t 9 CW f (line ... chop)2 702 1 1008 3148 t 9 I f (r1)1764 3148 w 9 CW f (chop)1898 3148 w 9 I f (r2)2168 3148 w 10 R f (chops the beginning by)3 963 1 720 3328 t 10 I f (r1)1719 3328 w 10 R f (and the end by)3 618 1 1844 3328 t 10 I f (r2)2498 3328 w 10 R f ( complicated intersections can be computed with the built-in)8 2510(. More)1 303 2 2587 3328 t (trigonometric functions listed in the next section.)6 1963 1 720 3448 t ( positioning that is sometimes useful, to refer to a point some fraction of the way)15 3345(There is one other form of)5 1085 2 970 3604 t ( can be expressed in)4 803( This)1 228(between two other points.)3 1032 3 720 3724 t 10 I f (pic)2808 3724 w 10 R f (as)2955 3724 w 9 I f (fraction)1008 3894 w 9 CW f (of the way between)3 972 1 1347 3894 t 9 I f (position1)2373 3894 w 9 CW f (and)2762 3894 w 9 I f (position2)2978 3894 w 10 R f (where)720 4074 w 10 I f (fraction)1003 4074 w 10 R f (is any expression, and)3 927 1 1360 4074 t 10 I f (position1)2327 4074 w 10 R f (and)2740 4074 w 10 I f (position2)2924 4074 w 10 R f ( can abbreviate this rather)4 1094( You)1 237(are any positions.)2 732 3 3337 4074 t (windy phrase; ``of the way'' is optional, and the whole thing can be written instead as)15 3433 1 720 4194 t 9 I f (fraction)1008 4364 w 9 CW f (<)1347 4364 w 9 I f (position1)1455 4364 w 9 CW f (,)1844 4364 w 9 I f (position2)1952 4364 w 9 CW f (>)2341 4364 w 10 R f (As a pair of examples:)4 898 1 720 4544 t 9 CW f (box)1008 4714 w (arrow right from 1/3 of the way between last box.ne and last box.se)12 3618 1 1008 4824 t (arrow right from 2/3 )7 2538 1 1008 4934 t 10 R f 2610 5156 2610 5516 Dl 3150 5156 2610 5156 Dl 3150 5516 3150 5156 Dl 2610 5516 3150 5516 Dl 3510 5276 3150 5276 Dl 3510 5276 3438 5294 Dl 3510 5276 3438 5258 Dl 3510 5395 3150 5395 Dl 3510 5395 3438 5413 Dl 3510 5395 3438 5377 Dl 9 CW f (A: ellipse)1 594 1 1008 5764 t (ellipse ht .2 wid .3 with .se at 1st ellipse.nw)9 2538 1 1224 5874 t (ellipse ht .2 wid .3 with .sw at 1st ellipse.ne)9 2538 1 1224 5984 t (circle rad .05 at 0.5 )5 1728 1 1224 6094 t (circle rad .05 at 0.5 )5 1728 1 1224 6204 t (arc from 0.25 to 0.75 )6 2214 1 1224 6314 t 10 R f 2790 6785 540 360 De 2685 6608 216 144 De 3219 6608 216 144 De 2929 6722 72 72 De 3119 6722 72 72 De 2925 6785 135 -118 135 118 Da (Naturally, the distance given by)4 1273 1 720 7163 t 10 I f (fraction)2018 7163 w 10 R f (can be greater than 1 or less than 0.)8 1410 1 2360 7163 t ( placing them relative to previous)5 1390( suggests that the easiest way to position objects is by)10 2234(Advice: experience)1 806 3 970 7319 t cleartomark showpage saveobj restore %%EndPage: 10 12 %%Page: 11 13 /saveobj save def mark 13 pagesetup 10 R f (- 11 -)2 216 1 2952 480 t (objects and places, using)3 993 1 720 840 t 10 CW f (with)1738 840 w 10 R f (,)1978 840 w 10 CW f (at)2028 840 w 10 R f ( is better than using)4 783( This)1 228(, etc.)1 191 3 2148 840 t 10 CW f (move)3375 840 w 10 R f (; you should generally avoid)4 1138 1 3615 840 t 10 CW f (move)4778 840 w 10 R f (.)5018 840 w 10 B f ( Expressions and Built-in Functions)4 1526(6. Variables,)1 561 2 720 1080 t 10 R f ( write everything in absolute coordinates if you are likely to change things.)12 3125(It's generally a bad idea to)5 1111 2 970 1236 t 10 I f (Pic)5267 1236 w 10 R f (variables let you parameterize your picture:)5 1737 1 720 1356 t 9 CW f ( = 1)2 216( b)1 162(a = 0.5;)2 432 3 1008 1526 t (box wid a ht b)4 756 1 1008 1746 t (ellipse wid a/2 ht 1.5*b)4 1296 1 1008 1856 t ( - \(a/2, b/2\))3 702(Box2: Box1)1 594 2 1008 1966 t 10 R f (Expressions may use the standard operators)5 1744 1 720 2146 t 10 CW f (+)2489 2146 w 10 R f (,)2549 2146 w 10 CW f (-)2599 2146 w 10 R f (,)2659 2146 w 10 CW f (*)2709 2146 w 10 R f (,)2769 2146 w 10 CW f (/)2819 2146 w 10 R f (,)2879 2146 w 10 CW f (%)2929 2146 w 10 R f (,)2989 2146 w 10 CW f (\303)3039 2146 w 10 R f (\(exponentiation\), and parentheses for grouping.)4 1896 1 3124 2146 t ( controlling the default sizes of objects, listed in Sec-)9 2147(The most important variables are the predefined ones for)8 2283 2 970 2302 t ( may be set at any time in any picture, and retain their values from picture to picture until reset.)19 3802( These)1 288(tion 3.)1 256 3 720 2422 t (You can use the height, width, radius, and)7 1681 1 970 2578 t 10 I f (x)2676 2578 w 10 R f (and)2745 2578 w 10 I f (y)2914 2578 w 10 R f (coordinates of any object or corner in an expression:)8 2095 1 2983 2578 t 9 CW f ( the)1 216(Box1.x #)1 918 2 1008 2748 t 9 I f (x)2196 2748 w 9 CW f (coordinate of the center of Box1)5 1728 1 2290 2748 t ( the)1 216(Box1.ne.y #)1 918 2 1008 2858 t 9 I f (y)2196 2858 w 9 CW f (coordinate of the northeast corner of Box1)6 2268 1 2290 2858 t ( the width of Box1)4 972(Box1.wid #)1 918 2 1008 2968 t ( and its height)3 810(Box1.ht #)1 918 2 1008 3078 t ( the radius of the 2nd last circle)7 1836( #)1 324(2nd last circle.rad)2 1026 3 1008 3188 t 10 R f ( such positions can be added)5 1170( furthermore)1 532( expressions enclosed in parentheses defines a position;)7 2258(Any pair of)2 470 4 970 3404 t (or subtracted to yield new positions:)5 1452 1 720 3524 t 9 CW f (\()1008 3694 w 9 I f (x)1062 3694 w 9 CW f (,)1102 3694 w 9 I f (y)1210 3694 w 9 CW f (\))1250 3694 w (\()1008 3804 w 9 I f (x)1062 3804 w 6 R f (1)1112 3822 w 9 CW f (,)1149 3804 w 9 I f (y)1257 3804 w 6 R f (1)1307 3822 w 9 CW f (\) + \()2 270 1 1344 3804 t 9 I f (x)1614 3804 w 6 R f (2)1664 3822 w 9 CW f (,)1701 3804 w 9 I f (y)1809 3804 w 6 R f (2)1859 3822 w 9 CW f (\))1896 3804 w 10 R f (If)720 3984 w 10 I f (p)811 3984 w 7 R f (1)872 4004 w 10 R f (and)940 3984 w 10 I f (p)1109 3984 w 7 R f (2)1170 4004 w 10 R f (are positions, then \()3 788 1 1238 3984 t 10 I f (p)2034 3984 w 7 R f (1)2095 4004 w 10 R f (,)2146 3984 w 10 I f (p)2179 3984 w 7 R f (2)2240 4004 w 10 R f (\) refers to the point \()5 823 1 2291 3984 t 10 I f (p)3122 3984 w 7 R f (1)3183 4004 w 10 CW f (. x)1 128 1 3234 3984 t 10 R f (,)3370 3984 w 10 I f (p)3436 3984 w 7 R f (2)3497 4004 w 10 CW f (. y)1 128 1 3548 3984 t 10 R f (\).)3684 3984 w 10 I f (Pic)970 4140 w 10 R f (provides a small collection of standard functions:)6 1970 1 1128 4140 t 10 CW f (sin)1080 4320 w 10 R f (\()1268 4320 w 10 I f (expr)1309 4320 w 10 R f (\),)1494 4320 w 10 CW f (cos)1577 4320 w 10 R f (\()1765 4320 w 10 I f (expr)1806 4320 w 10 R f (\),)1991 4320 w 10 CW f (atan 2)1 308 1 2074 4320 t 10 R f (\()2390 4320 w 10 I f (y)2431 4320 w 10 R f (,)2483 4320 w 10 I f (x)2516 4320 w 10 R f ( in radians\))2 449(\) \(angle)1 921 2 2568 4320 t 10 CW f (log)1080 4440 w 10 R f (\()1268 4440 w 10 I f (expr)1309 4440 w 10 R f (\),)1494 4440 w 10 CW f (exp)1577 4440 w 10 R f (\()1765 4440 w 10 I f (expr)1806 4440 w 10 R f ( both base 10\))3 563(\) \(Beware:)1 1614 2 1991 4440 t 10 CW f (sqrt)1080 4560 w 10 R f (\()1328 4560 w 10 I f (expr)1369 4560 w 10 R f (\),)1554 4560 w 10 CW f (max)1637 4560 w 10 R f (\()1825 4560 w 10 I f (e)1866 4560 w 7 R f (1)1921 4580 w 10 R f (,)1972 4560 w 10 I f (e)2005 4560 w 7 R f (2)2060 4580 w 10 R f (\),)2111 4560 w 10 CW f (min)2194 4560 w 10 R f (\()2382 4560 w 10 I f (e)2423 4560 w 7 R f (1)2478 4580 w 10 R f (,)2529 4560 w 10 I f (e)2562 4560 w 7 R f (2)2617 4580 w 10 R f (\))2668 4560 w 10 CW f (int)1080 4680 w 10 R f (\()1268 4680 w 10 I f (expr)1309 4680 w 10 R f ( part of)2 288(\) \(integer)1 2056 2 1494 4680 t 10 I f (expr)3863 4680 w 10 R f (\))4040 4680 w 10 CW f (rand)1080 4800 w 10 R f ( number between 0 and 1\))5 1039( \(random)1 2168(\( \))1 82 3 1328 4800 t 10 B f ( on Text)2 350(7. More)1 357 2 720 5100 t 10 R f ( attribute)1 371( The)1 218( associated with.)2 689(Normally, text is centered at the geometric center of the object it is)12 2814 4 970 5256 t 10 CW f (ljust)5100 5256 w 10 R f ( and)1 169(causes the left end to be at the specified point \(which means that the text lies to the right of the specified place!\),)22 4511 2 720 5376 t 10 CW f (rjust)720 5496 w 10 R f (puts the right end at the place.)6 1201 1 1045 5496 t 10 CW f (above)2296 5496 w 10 R f (and)2621 5496 w 10 CW f (below)2790 5496 w 10 R f (center the text one half line space in the given direction.)10 2237 1 3115 5496 t (Text attributes can be compounded:)4 1431 1 970 5652 t 9 CW f (arrow 1 "ljust above" ljust above)5 1782 1 1008 5822 t 10 R f 3420 6002 2700 6002 Dl 3420 6002 3348 6020 Dl 3420 6002 3348 5984 Dl (ljust above)1 436 1 3060 5962 t (Text is most often an attribute of some other object, but you can also have self-standing text:)16 3704 1 970 6194 t 9 CW f ("origin" "\(0,0\)" at 0,0)3 1242 1 1008 6364 t ("this is" "\(1,1\)" at 1,1)4 1296 1 1008 6474 t (box ht 1 wid 1 dotted with .sw at 0,0)9 1998 1 1008 6584 t cleartomark showpage saveobj restore %%EndPage: 11 13 %%Page: 12 14 /saveobj save def mark 14 pagesetup 10 R f (- 12 -)2 216 1 2952 480 t (origin)2581 1520 w (\(0,0\))2605 1640 w (this is)1 237 1 3302 800 t (\(1,1\))3325 920 w 7 R f ( .)1 0(. . . . . . . . . . . . . . . . . . . . .)20 738 2 2690 1563 t (.)3410 1527 w (.)3410 1491 w (.)3410 1455 w (.)3410 1419 w (.)3410 1383 w (.)3410 1347 w (.)3410 1311 w (.)3410 1275 w (.)3410 1239 w (.)3410 1203 w (.)3410 1167 w (.)3410 1131 w (.)3410 1095 w (.)3410 1059 w (.)3410 1023 w (.)3410 987 w (.)3410 951 w (.)3410 915 w (.)3410 879 w ( .)1 0( . . . . . . . . . . . . . . . . . . . .)20 -720(. .)1 18 3 3410 843 t (.)2690 879 w (.)2690 915 w (.)2690 951 w (.)2690 987 w (.)2690 1023 w (.)2690 1059 w (.)2690 1095 w (.)2690 1131 w (.)2690 1167 w (.)2690 1203 w (.)2690 1239 w (.)2690 1275 w (.)2690 1311 w (.)2690 1347 w (.)2690 1383 w (.)2690 1419 w (.)2690 1455 w (.)2690 1491 w (.)2690 1527 w (.)2690 1563 w 10 R f (In effect,)1 361 1 720 1794 t 10 I f (n)1108 1794 w 10 R f (text strings are contained in an invisible box of width)9 2147 1 1185 1794 t 10 CW f (textwid)3360 1794 w 10 R f (and height)1 422 1 3808 1794 t 10 I f (n)4258 1794 w 10 S f (\264)4336 1794 w 10 CW f (textht)4419 1794 w 10 R f ( variables)1 388(. The)1 233 2 4779 1794 t 10 CW f (textwid)720 1914 w 10 R f (and)1165 1914 w 10 CW f (textht)1334 1914 w 10 R f (may be set to any values; they are normally zero.)9 1957 1 1719 1914 t (A list of numeric expressions can be converted to a formatted string with the)13 3202 1 970 2070 t 10 CW f (sprintf)4209 2070 w 10 R f (function and used)2 734 1 4666 2070 t (anywhere a quoted string can be:)5 1316 1 720 2190 t 9 CW f (B: box wid log\(20\))3 972 1 1008 2360 t (sprintf\("width = %g, height = %g ", B.wid, B.ht\) rjust at B.w)11 3294 1 1170 2470 t 10 R f 2592 2692 2592 3052 Dl 3528 2692 2592 2692 Dl 3528 3052 3528 2692 Dl 2592 3052 3528 3052 Dl (width = 1.30103, height = 0.5)5 1190 1 1377 2892 t 10 B f ( and Splines)2 519(8. Lines)1 359 2 720 3370 t 10 R f (A ``line'' may actually be a path, that is, it may consist of connected segments:)14 3162 1 970 3526 t 9 CW f (line right 1 then down .5 left 1 then right 1)10 2430 1 1008 3696 t 10 R f 3420 3918 2700 3918 Dl 2700 4278 3420 3918 Dl 3420 4278 2700 4278 Dl (The word)1 385 1 720 4476 t 10 CW f (then)1130 4476 w 10 R f (separates components of the path.)4 1350 1 1395 4476 t ( begins at the same place,)5 1025( It)1 112( above.)1 289(A spline is a smooth curve guided by a set of straight lines just like the line)16 3004 4 970 4632 t ( for a spline is)4 590( syntax)1 293( The)1 212(ends at the same place, and in between is tangent to the mid-point of each guiding line.)16 3585 4 720 4752 t (identical to a \(path\) line except for using)7 1622 1 720 4872 t 10 CW f (spline)2367 4872 w 10 R f (instead of)1 391 1 2752 4872 t 10 CW f (line)3168 4872 w 10 R f (:)3408 4872 w 9 CW f (line dashed right 1 then down .5 left 1 then right 1)11 2808 1 1008 5042 t (spline from start of last line \\)6 1728 1 1008 5152 t (right 1 then down .5 left 1 then right 1)9 2160 1 1116 5262 t 10 R f 2736 5484 2700 5484 Dl 2812 5484 2776 5484 Dl 2887 5484 2851 5484 Dl 2964 5484 2928 5484 Dl 3039 5484 3003 5484 Dl 3116 5484 3080 5484 Dl 3191 5484 3155 5484 Dl 3268 5484 3232 5484 Dl 3343 5484 3307 5484 Dl 3420 5484 3384 5484 Dl 3388 5499 3420 5484 Dl 3325 5529 3357 5514 Dl 3262 5561 3294 5546 Dl 3200 5592 3232 5577 Dl 3138 5624 3170 5609 Dl 3075 5655 3107 5640 Dl 3012 5686 3044 5671 Dl 2950 5717 2982 5702 Dl 2887 5748 2919 5733 Dl 2824 5780 2856 5765 Dl 2763 5811 2795 5796 Dl 2700 5843 2732 5828 Dl 2736 5844 2700 5844 Dl 2812 5844 2776 5844 Dl 2887 5844 2851 5844 Dl 2964 5844 2928 5844 Dl 3039 5844 3003 5844 Dl 3116 5844 3080 5844 Dl 3191 5844 3155 5844 Dl 3268 5844 3232 5844 Dl 3343 5844 3307 5844 Dl 3420 5844 3384 5844 Dl 2700 5484 2700 5484 3420 5484 Ds 2700 5484 3420 5484 2700 5844 Ds 3420 5484 2700 5844 3420 5844 Ds 2700 5844 3420 5844 3420 5844 Ds (\(Long input lines can be split by ending each piece with a backslash.\))12 2776 1 720 6042 t ( by)1 127(The elements of a path, whether line or spline, are specified as a series of points, either in absolute terms or)20 4303 2 970 6198 t 10 CW f (up)720 6318 w 10 R f (,)840 6318 w 10 CW f (down)890 6318 w 10 R f (, etc.)1 191 1 1130 6318 t 9 CW f (spline right then up then left then down ->)8 2322 1 1008 6488 t 10 R f 2902 7025 2902 7025 3262 7025 Ds 2902 7025 3262 7025 3262 6665 Ds 3262 7025 3262 6665 2902 6665 Ds 3262 6665 2902 6665 2902 7025 Ds 2902 6665 2902 7025 2902 7025 Ds 2902 7024 2884 6952 Dl 2902 7024 2920 6952 Dl cleartomark showpage saveobj restore %%EndPage: 12 14 %%Page: 13 15 /saveobj save def mark 15 pagesetup 10 R f (- 13 -)2 216 1 2952 480 t 9 CW f (spline right then up left then down ->)7 2052 1 1008 830 t 10 R f 2925 1322 2925 1322 3285 1322 Ds 2925 1322 3285 1322 2925 962 Ds 3285 1322 2925 962 2925 1322 Ds 2925 962 2925 1322 2925 1322 Ds 2925 1322 2907 1250 Dl 2925 1322 2943 1250 Dl (Notice that arrowheads may be put on the ends of a line or spline.)13 2623 1 970 1556 t 10 B f (9. Blocks)1 409 1 720 1796 t 10 R f (Any sequence of)2 696 1 970 1952 t 10 I f (pic)1704 1952 w 10 R f (statements may be enclosed in brackets)5 1637 1 1864 1952 t 10 CW f ([)3539 1952 w 10 R f (and)3637 1952 w 10 CW f (])3819 1952 w 10 R f ( a block, which can then be)6 1173(to form)1 310 2 3917 1952 t (treated as a single object, and manipulated rather like an ordinary box:)11 2811 1 720 2072 t 9 CW f (box "1")1 378 1 1008 2242 t ([ box "2"; arrow "3" above; box "4" ] with .n at last box.s - \(0,0.1\))15 3726 1 1008 2352 t ("Thing 2: " rjust at last [].w)6 1620 1 1008 2462 t 10 R f 2790 2684 2790 3044 Dl 3330 2684 2790 2684 Dl 3330 3044 3330 2684 Dl 2790 3044 3330 3044 Dl (1)3035 2884 w 2340 3116 2340 3476 Dl 2880 3116 2340 3116 Dl 2880 3476 2880 3116 Dl 2340 3476 2880 3476 Dl (2)2585 3316 w 3240 3296 2880 3296 Dl 3240 3296 3168 3314 Dl 3240 3296 3168 3278 Dl (3)3035 3256 w 3240 3116 3240 3476 Dl 3780 3116 3240 3116 Dl 3780 3476 3780 3116 Dl 3240 3476 3780 3476 Dl ( 2:)1 103(4 Thing)1 -1273 2 3485 3316 t (Notice that ``last''-type constructs treat blocks as a unit and don't look inside for objects: ``)15 3688 1 720 3674 t 10 CW f (last box.s)1 567 1 4408 3674 t 10 R f ( to)1 106('' refers)1 319 2 4975 3674 t ( can use)2 321( You)1 222(box 1, not box 2 or 4.)6 861 3 720 3794 t 10 CW f (last [])1 420 1 2149 3794 t 10 R f (, etc., just like)3 561 1 2569 3794 t 10 CW f (last box)1 480 1 3155 3794 t 10 R f (.)3635 3794 w ( is also possible to posi-)5 969( It)1 113(Blocks have the same compass corners as boxes \(determined by the bounding box\).)12 3348 3 970 3950 t ( absolute coordinate \(like)3 1027(tion a block by placing either an)6 1323 2 720 4070 t 10 CW f (0,0)3100 4070 w 10 R f (\) or an internal label \(like)5 1042 1 3280 4070 t 10 CW f (A)4352 4070 w 10 R f (\) at some external point,)4 988 1 4412 4070 t (as in)1 186 1 720 4190 t 9 CW f ([ ...; A: ...; ... ] with .A at ...)9 1890 1 1008 4360 t 10 R f (By default, blocks join with other things as boxes do, at the center of the appropriate side.)16 3587 1 720 4540 t ( a block are local to that block, and thus do not affect variables and)14 2871(Names of variables and places within)5 1559 2 970 4696 t ( particular, that includes the built-in variables like)7 2006( \(In)1 168( the same name outside.)4 965(places of)1 360 4 720 4816 t 10 CW f (boxwid)4246 4816 w 10 R f (, etc.; if they are set)5 794 1 4606 4816 t ( can get at the internal place names)7 1448( You)1 229( the block is left.\))4 730(within a block, they revert to their original values when)9 2273 4 720 4936 t (with constructs like)2 783 1 720 5056 t 9 CW f (last [].A)1 486 1 1008 5226 t 10 R f (or)720 5406 w 9 CW f (B.A)1008 5576 w 10 R f (where)720 5756 w 10 CW f (B)988 5756 w 10 R f (is a name attached to a block:)6 1181 1 1073 5756 t 9 CW f ( ])1 162( ...;)1 270( A:)1 216( ... ;)2 324(B: [)1 270 5 1008 5926 t 10 R f (When combined with)2 888 1 720 6106 t 10 CW f (define)1648 6106 w 10 R f (statements \(next section\), blocks provide a reasonable simulation of a procedure)10 3352 1 2048 6106 t (mechanism.)720 6226 w (Although blocks nest, it is currently possible to look only one level deep with constructs like)15 3734 1 970 6382 t 10 CW f (B.A)4731 6382 w 10 R f (, although)1 402 1 4911 6382 t 10 CW f (A)5340 6382 w 10 R f (may be further qualified by a corner name \(i.e.,)8 1886 1 720 6502 t 10 CW f (B.A.sw)2631 6502 w 10 R f (or)3016 6502 w 10 CW f (top of B.A)2 530 1 3124 6502 t 10 R f (are legal\).)1 398 1 3679 6502 t (The following example illustrates most of the points made above about how blocks work:)13 3583 1 970 6658 t cleartomark showpage saveobj restore %%EndPage: 13 15 %%Page: 14 16 /saveobj save def mark 16 pagesetup 10 R f (- 14 -)2 216 1 2952 480 t 9 CW f ( = .1)2 270( dw)1 216( = .02;)2 378( dh)1 216(h = .5;)2 378 5 1008 830 t ([)1008 940 w (Ptr: [)1 324 1 1440 1050 t (boxht = h; boxwid = dw)5 1188 1 1872 1160 t (A: box)1 324 1 1872 1270 t (B: box)1 324 1 1872 1380 t (C: box)1 324 1 1872 1490 t (box wid 2*boxwid "...")3 1188 1 1872 1600 t (D: box)1 324 1 1872 1710 t (])1440 1820 w (Block: [)1 432 1 1440 1930 t (boxht = 2*dw; boxwid = 2*dw)5 1458 1 1872 2040 t (movewid = 2*dh)2 756 1 1872 2150 t (A: box; move)2 648 1 1872 2260 t (B: box; move)2 648 1 1872 2370 t (C: box; move)2 648 1 1872 2480 t (box invis "..." wid 2*boxwid; move)5 1836 1 1872 2590 t (D: box)1 324 1 1872 2700 t (] with .t at Ptr.s - \(0,h/2\))6 1512 1 1440 2810 t (arrow from Ptr.A to Block.A.nw + \(dh,0\))6 2106 1 1440 2920 t (arrow from Ptr.B to Block.B.nw + \(dh,0\))6 2106 1 1440 3030 t (arrow from Ptr.C to Block.C.nw + \(dh,0\))6 2106 1 1440 3140 t (arrow from Ptr.D to Block.D.nw + \(dh,0\))6 2106 1 1440 3250 t (])1008 3360 w (box dashed ht last [].ht+dw wid last [].wid+dw at last [])10 3078 1 1008 3470 t 10 R f (This produces)1 563 1 720 3650 t 2843 3848 2843 4208 Dl 2915 3848 2843 3848 Dl 2915 4208 2915 3848 Dl 2843 4208 2915 4208 Dl 2915 3848 2915 4208 Dl 2987 3848 2915 3848 Dl 2987 4208 2987 3848 Dl 2915 4208 2987 4208 Dl 2987 3848 2987 4208 Dl 3059 3848 2987 3848 Dl 3059 4208 3059 3848 Dl 2987 4208 3059 4208 Dl 3059 3848 3059 4208 Dl 3203 3848 3059 3848 Dl 3203 4208 3203 3848 Dl 3059 4208 3203 4208 Dl (...)3094 4048 w 3203 3848 3203 4208 Dl 3275 3848 3203 3848 Dl 3275 4208 3275 3848 Dl 3203 4208 3275 4208 Dl 2570 4388 2570 4532 Dl 2714 4388 2570 4388 Dl 2714 4532 2714 4388 Dl 2570 4532 2714 4532 Dl 2742 4388 2742 4532 Dl 2886 4388 2742 4388 Dl 2886 4532 2886 4388 Dl 2742 4532 2886 4532 Dl 2915 4388 2915 4532 Dl 3059 4388 2915 4388 Dl 3059 4532 3059 4388 Dl 2915 4532 3059 4532 Dl (...)3195 4480 w 3405 4388 3405 4532 Dl 3549 4388 3405 4388 Dl 3549 4532 3549 4388 Dl 3405 4532 3549 4532 Dl 2584 4388 2879 4028 Dl 2585 4387 2616 4321 Dl 2585 4387 2644 4344 Dl 2757 4388 2951 4028 Dl 2757 4388 2775 4316 Dl 2757 4387 2807 4333 Dl 2930 4388 3023 4028 Dl 2930 4387 2930 4313 Dl 2930 4387 2965 4323 Dl 3419 4388 3239 4028 Dl 3419 4387 3371 4331 Dl 3418 4387 3403 4315 Dl 2570 4568 2534 4568 Dl 2642 4568 2606 4568 Dl 2714 4568 2678 4568 Dl 2787 4568 2751 4568 Dl 2860 4568 2824 4568 Dl 2932 4568 2896 4568 Dl 3004 4568 2968 4568 Dl 3077 4568 3041 4568 Dl 3150 4568 3114 4568 Dl 3222 4568 3186 4568 Dl 3295 4568 3259 4568 Dl 3367 4568 3331 4568 Dl 3440 4568 3404 4568 Dl 3512 4568 3476 4568 Dl 3585 4568 3549 4568 Dl 3585 4532 3585 4568 Dl 3585 4460 3585 4496 Dl 3585 4388 3585 4424 Dl 3585 4316 3585 4352 Dl 3585 4244 3585 4280 Dl 3585 4172 3585 4208 Dl 3585 4100 3585 4136 Dl 3585 4028 3585 4064 Dl 3585 3956 3585 3992 Dl 3585 3884 3585 3920 Dl 3585 3812 3585 3848 Dl 3549 3812 3585 3812 Dl 3476 3812 3512 3812 Dl 3404 3812 3440 3812 Dl 3331 3812 3367 3812 Dl 3259 3812 3295 3812 Dl 3186 3812 3222 3812 Dl 3114 3812 3150 3812 Dl 3041 3812 3077 3812 Dl 2968 3812 3004 3812 Dl 2896 3812 2932 3812 Dl 2824 3812 2860 3812 Dl 2751 3812 2787 3812 Dl 2678 3812 2714 3812 Dl 2606 3812 2642 3812 Dl 2534 3812 2570 3812 Dl 2534 3848 2534 3812 Dl 2534 3920 2534 3884 Dl 2534 3992 2534 3956 Dl 2534 4064 2534 4028 Dl 2534 4136 2534 4100 Dl 2534 4208 2534 4172 Dl 2534 4280 2534 4244 Dl 2534 4352 2534 4316 Dl 2534 4424 2534 4388 Dl 2534 4496 2534 4460 Dl 2534 4568 2534 4532 Dl 10 B f (10. Macros)1 496 1 720 4886 t 10 I f (Pic)970 5042 w 10 R f ( the simplest form,)3 750( In)1 133(provides a basic macro facility.)4 1250 3 1128 5042 t 9 CW f (define)1008 5212 w 9 I f (name)1440 5212 w 9 CW f ({)1743 5212 w 9 I f (replacement text)1 598 1 1851 5212 t 9 CW f (})2503 5212 w 10 R f (defines)720 5392 w 10 I f (name)1033 5392 w 10 R f (to be the)2 344 1 1274 5392 t 10 I f (replacement text)1 662 1 1643 5392 t 10 R f ( subsequent occurrence of)3 1038(. Any)1 247 2 2305 5392 t 10 I f (name)3615 5392 w 10 R f (will be replaced by)3 762 1 3856 5392 t 10 I f (replacement text)1 662 1 4643 5392 t 10 R f (.)5305 5392 w ( definition contains occurrences of)4 1416( the replacement text of a macro)6 1333( If)1 124(Macros may have arguments.)3 1199 4 970 5548 t 10 CW f ($1)5076 5548 w 10 R f (,)5196 5548 w 10 CW f ($2)5255 5548 w 10 R f (,)5375 5548 w ( invocation for a)3 666( The)1 208( arguments when the macro is invoked.)6 1585(etc., these will be replaced by the corresponding actual)8 2221 4 720 5668 t (macro with arguments is)3 985 1 720 5788 t 9 CW f (name\(arg1, arg2, ...\))2 1134 1 1008 5958 t 10 R f ( definitions last from picture to picture; a macro defini-)9 2250( Macro)1 315( by null strings.)3 638(Non-existent arguments are replaced)3 1477 4 720 6138 t (tion can be removed by)4 937 1 720 6258 t 9 CW f (undef)1008 6428 w 9 I f (macro-name)1332 6428 w 10 R f (As an example, one might define a)6 1389 1 970 6644 t 10 CW f (square)2384 6644 w 10 R f (by)2769 6644 w 9 CW f ( })1 108( $2)1 216(define square { box ht $1 wid $1)7 1728 3 1008 6814 t 10 R f (and use it as)3 491 1 720 6994 t cleartomark showpage saveobj restore %%EndPage: 14 16 %%Page: 15 17 /saveobj save def mark 17 pagesetup 10 R f (- 15 -)2 216 1 2952 480 t 9 CW f (square\(1, "one" "inch"\))2 1242 1 1008 830 t (square\(0.5\))1008 940 w (square\(0.25, "\\s-4tiny\\s+4" dashed\))2 1890 1 1008 1050 t 10 R f 2430 1272 2430 1992 Dl 3150 1272 2430 1272 Dl 3150 1992 3150 1272 Dl 2430 1992 3150 1992 Dl (one)2718 1592 w (inch)2704 1712 w 3150 1452 3150 1812 Dl 3510 1452 3150 1452 Dl 3510 1812 3510 1452 Dl 3150 1812 3510 1812 Dl 3546 1722 3510 1722 Dl 3618 1722 3582 1722 Dl 3690 1722 3654 1722 Dl 3690 1686 3690 1722 Dl 3690 1614 3690 1650 Dl 3690 1542 3690 1578 Dl 3654 1542 3690 1542 Dl 3582 1542 3618 1542 Dl 3510 1542 3546 1542 Dl 3510 1578 3510 1542 Dl 3510 1650 3510 1614 Dl 3510 1722 3510 1686 Dl 6 R f (tiny)3553 1652 w 10 R f (Notice how the second argument may be used to pass in arbitrary contents.)12 2992 1 720 2190 t (Coordinates like)1 658 1 970 2346 t 10 I f (x,y)1653 2346 w 10 R f (may be enclosed in parentheses, as in \()7 1552 1 1791 2346 t 10 I f (x,y)3343 2346 w 10 R f (\), so they can be included in a macro argument.)9 1893 1 3456 2346 t 10 B f ( Copy)1 253(11. File)1 336 2 720 2586 t 10 R f (The statement)1 563 1 970 2742 t 9 CW f (copy ")1 324 1 1008 2912 t 9 I f (filename)1332 2912 w 9 CW f (")1642 2912 w 10 R f ( Any)1 224(inserts the contents of the named file at that point in the input.)12 2503 2 720 3092 t 10 CW f (.PS)3474 3092 w 10 R f (or)3681 3092 w 10 CW f (.PE)3791 3092 w 10 R f (lines within the file are ignored, so)6 1402 1 3998 3092 t (previously prepared pictures can be used as parts of larger ones without editing.)12 3185 1 720 3212 t 10 I f (Pic)970 3368 w 10 R f (also provides the)2 677 1 1128 3368 t 10 CW f (copy thru)1 505 1 1830 3368 t 10 R f (mechanism found in)2 816 1 2360 3368 t 10 I f (grap)3201 3368 w 10 R f (:)3390 3368 w 9 CW f (copy ")1 324 1 1008 3538 t 9 I f (file)1332 3538 w 9 CW f (" thru)1 324 1 1447 3538 t 9 I f (macro-name)1825 3538 w 10 R f (copies)720 3718 w 10 I f (file)1005 3718 w 10 R f ( literal macro)2 544( A)1 128(, treating each line as an invocation of the named macro \(each field being an argument\).)15 3595 3 1133 3718 t (may be used instead of a name:)6 1253 1 720 3838 t 9 CW f (copy ")1 324 1 1008 4008 t 9 I f (file)1332 4008 w 9 CW f (" thru {)2 432 1 1447 4008 t 9 I f (macro replacement text)2 851 1 1933 4008 t 9 CW f (})2838 4008 w 10 R f (and if no file name is given, the remainder of the input until the next)14 2733 1 720 4188 t 10 CW f (.PE)3479 4188 w 10 R f ( to plot a set of circles at points)8 1257( So)1 157(is used.)1 301 3 3685 4188 t (whose coordinates and radii are included in-line:)6 1946 1 720 4308 t 9 CW f (copy thru { circle rad $3 at $1,$2 })8 1944 1 1008 4478 t (0 0 .05)2 378 1 1008 4588 t (1 1 .1)2 324 1 1008 4698 t (...)1008 4808 w 10 R f 2646 5822 72 72 De 3330 5102 144 144 De 2804 5606 43 43 De 2934 5318 72 72 De 2682 5246 144 144 De 2955 5174 28 28 De 3078 5462 216 216 De 3373 5534 57 57 De 3204 5822 108 108 De 3020 5642 43 43 De (The)970 6110 w 10 CW f (sh)1150 6110 w 10 R f (command executes an arbitrary commandline:)4 1846 1 1295 6110 t 9 CW f (sh {)1 216 1 1008 6280 t 9 I f (anything)1278 6280 w 9 CW f (})1647 6280 w 10 R f (Macros within)1 580 1 720 6460 t 10 I f (anything)1325 6460 w 10 R f (are expanded first.)2 739 1 1700 6460 t 10 B f ( and Conditionals)2 758(12. Loops)1 437 2 720 6700 t 10 I f (Pic)970 6856 w 10 R f (provides an)1 463 1 1128 6856 t 10 CW f (if)1616 6856 w 10 R f (statement and a)2 621 1 1761 6856 t 10 CW f (for)2407 6856 w 10 R f (loop.)2612 6856 w cleartomark showpage saveobj restore %%EndPage: 15 17 %%Page: 16 18 /saveobj save def mark 18 pagesetup 10 R f (- 16 -)2 216 1 2952 480 t 9 CW f (pi = atan2\(0,-1\))2 864 1 1008 830 t (for i = 0 to 2 * pi by 0.1 do {)11 1674 1 1008 940 t ("\261" at i/2, 0)3 702 1 1440 1050 t ("s" at i/2, sin\(i\)/2)3 1080 1 1440 1160 t ("c" at i/2, cos\(i\)/2)3 1080 1 1440 1270 t (})1008 1380 w 8 R f (\261 s)1 36 1 1924 1978 t (c)1927 1618 w (\261)1960 1978 w (s)1965 1942 w (c)1963 1619 w (\261)1996 1978 w (s)2001 1906 w (c)1999 1625 w (\261)2032 1978 w (s)2037 1871 w (c)2035 1633 w (\261)2068 1978 w (s)2073 1837 w (c)2071 1646 w (\261)2104 1978 w (s)2109 1805 w (c)2107 1661 w (\261)2140 1978 w (s)2145 1774 w (c)2143 1680 w (\261)2176 1978 w (s)2181 1746 w (c)2179 1702 w (\261)2212 1978 w (s)2217 1719 w (c)2215 1727 w (\261)2248 1978 w (s)2253 1695 w (c)2251 1754 w (\261)2284 1978 w (s)2289 1674 w (c)2287 1783 w (\261)2320 1978 w (s)2325 1656 w (c)2323 1814 w (\261)2356 1978 w (s)2361 1642 w (c)2359 1847 w (\261)2392 1978 w (s)2397 1630 w (c)2395 1881 w (\261)2428 1978 w (s)2433 1623 w (c)2431 1916 w (\261)2464 1978 w (s)2469 1618 w (c)2467 1952 w (\261)2500 1978 w (s)2505 1618 w (c)2503 1988 w (\261)2536 1978 w (s)2541 1620 w (c)2539 2024 w (\261)2572 1978 w (s)2577 1627 w (c)2575 2060 w (\261)2608 1978 w (s)2613 1637 w (c)2611 2094 w (\261)2644 1978 w (s)2649 1650 w (c)2647 2127 w (\261)2680 1978 w (s)2685 1666 w (c)2683 2159 w (\261)2716 1978 w (s)2721 1687 w (c)2719 2189 w (\261)2752 1978 w (s)2757 1709 w (c)2755 2217 w (\261)2788 1978 w (s)2793 1734 w (c)2791 2243 w (\261)2824 1978 w (s)2829 1762 w (c)2827 2266 w (\261)2860 1978 w (s)2865 1792 w (c)2863 2286 w (\261)2896 1978 w (s)2901 1823 w (c)2899 2303 w (\261)2932 1978 w (s)2937 1857 w (c)2935 2317 w (\261)2968 1978 w (s)2973 1891 w (c)2971 2327 w (\261)3004 1978 w (s)3009 1926 w (c)3007 2334 w (\261)3040 1978 w (s)3045 1962 w (c)3043 2338 w (\261)3076 1978 w (s)3081 1998 w (c)3079 2337 w (\261)3112 1978 w (s)3117 2034 w (c)3115 2333 w (\261)3148 1978 w (s)3153 2070 w (c)3151 2325 w (\261)3184 1978 w (s)3189 2104 w (c)3187 2314 w (\261)3220 1978 w (s)3225 2137 w (c)3223 2300 w (\261)3256 1978 w (s)3261 2168 w (c)3259 2283 w (\261)3292 1978 w (s)3297 2198 w (c)3295 2262 w (\261)3328 1978 w (s)3333 2225 w (c)3331 2239 w (\261)3364 1978 w (s)3369 2250 w (c)3367 2213 w (\261)3400 1978 w (s)3405 2272 w (c)3403 2184 w (\261)3436 1978 w (s)3441 2291 w (c)3439 2154 w (\261)3472 1978 w (s)3477 2307 w (c)3475 2122 w (\261)3508 1978 w (s)3513 2320 w (c)3511 2088 w (\261)3544 1978 w (s)3549 2330 w (c)3547 2053 w (\261)3580 1978 w (s)3585 2335 w (c)3583 2018 w (\261)3616 1978 w (s)3621 2338 w (c)3619 1982 w (\261)3652 1978 w (s)3657 2336 w (c)3655 1946 w (\261)3688 1978 w (s)3693 2331 w (c)3691 1911 w (\261)3724 1978 w (s)3729 2322 w (c)3727 1875 w (\261)3760 1978 w (s)3765 2311 w (c)3763 1841 w (\261)3796 1978 w (s)3801 2296 w (c)3799 1809 w (\261)3832 1978 w (s)3837 2277 w (c)3835 1778 w (\261)3868 1978 w (s)3873 2255 w (c)3871 1749 w (\261)3904 1978 w (s)3909 2232 w (c)3907 1723 w (\261)3940 1978 w (s)3945 2205 w (c)3943 1698 w (\261)3976 1978 w (s)3981 2176 w (c)3979 1677 w (\261)4012 1978 w (s)4017 2145 w (c)4015 1659 w (\261)4048 1978 w (s)4053 2112 w (c)4051 1643 w (\261)4084 1978 w (s)4089 2078 w (c)4087 1632 w (\261)4120 1978 w (s)4125 2043 w (c)4123 1623 w (\261)4156 1978 w (s)4161 2008 w (c)4159 1619 w 10 R f (The)720 2520 w 10 CW f (by)902 2520 w 10 R f (clause is optional; if the value is preceded by a)9 1884 1 1049 2520 t 10 CW f (*)2960 2520 w 10 R f ( the)1 150( body of)2 337( The)1 207(, the steps are multiplicative, not additive.)6 1686 4 3020 2520 t (loop is delimited by braces, which are also used for definitions,)10 2530 1 720 2640 t 10 CW f (copy)3275 2640 w 10 R f (,)3515 2640 w 10 CW f (sh)3565 2640 w 10 R f (and)3710 2640 w 10 CW f (if)3879 2640 w 10 R f (statements.)4024 2640 w (The)970 2796 w 10 CW f (if)1150 2796 w 10 R f (statement is)1 475 1 1295 2796 t 9 CW f (if)1008 2966 w 9 I f (expression)1170 2966 w 9 CW f (then {)1 324 1 1609 2966 t 9 I f (anything)1987 2966 w 9 CW f (} else {)2 432 1 2356 2966 t 9 I f (anything)2842 2966 w 9 CW f (})3211 2966 w 10 R f (where the)1 398 1 720 3146 t 10 CW f (else)1151 3146 w 10 R f ( The)1 213(clause is optional.)2 735 2 1424 3146 t 10 I f (expression)2405 3146 w 10 R f ( relational operators:)2 844(may use the usual)3 737 2 2865 3146 t 10 CW f (==)4480 3146 w 10 R f (,)4600 3146 w 10 CW f (!=)4659 3146 w 10 R f (,)4779 3146 w 10 CW f (>)4838 3146 w 10 R f (,)4898 3146 w 10 CW f (>=)4957 3146 w 10 R f (,)5077 3146 w 10 CW f (<)5136 3146 w 10 R f (,)5196 3146 w 10 CW f (<=)5255 3146 w 10 R f (,)5375 3146 w 10 CW f (&&)720 3266 w 10 R f (, and)1 194 1 840 3266 t 10 CW f (||)1059 3266 w 10 R f (.)1179 3266 w 9 CW f (pi = atan2\(0,-1\))2 864 1 1008 3436 t (for i = 0 to pi by 0.1 do {)9 1458 1 1008 3546 t (if \(s = sin\(i\)\) > 0.8 then { s = 0.8 })11 2052 1 1440 3656 t ("x" at i/2, s/2)3 810 1 1440 3766 t (})1008 3876 w 8 R f (x)2482 4402 w (x)2518 4366 w (x)2554 4330 w (x)2590 4295 w (x)2626 4261 w (x)2662 4229 w (x)2698 4198 w (x)2734 4170 w (x)2770 4143 w (x)2806 4119 w (x x x x x x x x x x x x x)12 472 1 2842 4114 t (x)3310 4133 w (x)3346 4158 w (x)3382 4186 w (x)3418 4216 w (x)3454 4247 w (x)3490 4281 w (x)3526 4315 w (x)3562 4350 w (x)3598 4386 w 10 R f (A string comparison using)3 1058 1 720 4584 t 10 CW f (==)1803 4584 w 10 R f (or)1948 4584 w 10 CW f (!=)2056 4584 w 10 R f (is also permitted, to compare quoted strings:)6 1774 1 2201 4584 t 9 CW f (if ")1 216 1 1008 4754 t 9 I f (string1)1224 4754 w 9 CW f (" == ")2 324 1 1479 4754 t 9 I f (string2)1803 4754 w 9 CW f (" then ...)2 540 1 2058 4754 t 10 B f (13.)720 5054 w 10 I f (Troff)895 5054 w 10 B f (Interface)1121 5054 w 10 I f (Pic)970 5210 w 10 R f (is usually run as a)4 716 1 1128 5210 t 10 I f (troff)1869 5210 w 10 R f (preprocessor:)2067 5210 w 9 CW f (pic file | troff -ms)4 1080 1 1008 5380 t 10 R f (Run it before)2 527 1 720 5560 t 10 I f (eqn)1272 5560 w 10 R f (if it is also present.)4 758 1 1441 5560 t (If the)1 213 1 970 5716 t 10 CW f (.PS)1208 5716 w 10 R f (line looks like)2 567 1 1413 5716 t 9 CW f (.PS right .2 from 3rd last box then to N1.sw + \(dx,0\))12 3186 1 1008 4180 t (spline -> right .3 from 2nd last box then to D1.sw + \(dx,0\))12 3186 1 1008 4280 t (arrow right from last box)4 1350 1 1008 4380 t (ndblock)1008 4480 w (spline -> right .2 from 3rd last box to N2.sw-\(dx,.2\) to N2.sw+\(dx,0\))11 3726 1 1008 4580 t (spline -> right .3 from 2nd last box to D2.sw-\(dx,.2\) to D2.sw+\(dx,0\))11 3726 1 1008 4680 t (arrow right 2*linewid from L)4 1512 1 1008 4780 t (ndblock)1008 4880 w (spline -> right .2 from 3rd last box to N3.sw + \(dx,0\))11 2916 1 1008 4980 t (spline -> right .3 from 2nd last box to D3.sw + \(dx,0\))11 2916 1 1008 5080 t (circlerad = .3)2 756 1 1008 5180 t ( last box.e + \(1.2,.2\))4 1188( at)1 216(circle invis "ndblock")2 1188 3 1008 5280 t (arrow dashed from last circle.w to last box chop 0 chop .3)11 3132 1 1008 5380 t (box invis wid 2*boxwid "ndtable:" with .e at Start.w)8 2808 1 1008 5480 t cleartomark showpage saveobj restore %%EndPage: 18 20 %%Page: 19 21 /saveobj save def mark 21 pagesetup 10 R f (- 19 -)2 216 1 2952 480 t 8 R f 1683 2787 1260 2787 Dl 1683 2788 1599 2808 Dl 1683 2786 1599 2766 Dl (source)1368 2743 w (code)1396 2863 w 1683 2576 1683 2999 Dl 2318 2576 1683 2576 Dl 2319 2999 2319 2576 Dl 1684 2999 2319 2999 Dl (lexical)1895 2743 w (analyzer)1866 2863 w 2742 2787 2319 2787 Dl 2741 2788 2657 2808 Dl 2741 2786 2657 2766 Dl (tokens)2426 2743 w 2742 2576 2742 2999 Dl 3377 2576 2742 2576 Dl 3377 2999 3377 2576 Dl 2742 2999 3377 2999 Dl (parser)2964 2803 w 3800 2787 3377 2787 Dl 3800 2788 3716 2808 Dl 3800 2786 3716 2766 Dl (intermediate)3391 2743 w (code)3514 2863 w 3800 2576 3800 2999 Dl 4435 2576 3800 2576 Dl 4436 2999 4436 2576 Dl 3801 2999 4436 2999 Dl (semantic)3978 2743 w (checker)3996 2863 w 4859 2787 4436 2787 Dl 4859 2788 4775 2808 Dl 4859 2786 4775 2766 Dl 2000 2575 1980 2491 Dl 2002 2575 2022 2491 Dl 2000 2153 2000 2576 Dl 2002 2153 2022 2237 Dl 2000 2153 1980 2237 Dl 1683 1729 1683 2152 Dl 2318 1728 1683 1728 Dl 2319 2151 2319 1728 Dl 1684 2152 2319 2152 Dl (lexical)1895 1897 w (corrector)1858 2017 w 3059 2575 3039 2491 Dl 3060 2575 3080 2491 Dl 3060 2153 3060 2576 Dl 3060 2153 3080 2237 Dl 3059 2153 3039 2237 Dl 2742 1729 2742 2152 Dl 3377 1728 2742 1728 Dl 3377 2151 3377 1728 Dl 2742 2152 3377 2152 Dl (syntactic)2919 1897 w (corrector)2918 2017 w 3060 1305 3060 1728 Dl 3060 1306 3080 1390 Dl 3059 1306 3039 1390 Dl 2742 882 2742 1305 Dl 3377 882 2742 882 Dl 3377 1305 3377 882 Dl 2742 1305 3377 1305 Dl (diagnostic)2897 989 w (message)2926 1109 w (printer)2955 1229 w 3378 1092 3462 1072 Dl 3378 1095 3462 1115 Dl 3800 1093 3377 1093 Dl 3800 1095 3716 1115 Dl 3800 1092 3716 1072 Dl 3800 882 3800 1305 Dl 4435 882 3800 882 Dl 4436 1305 4436 882 Dl 3801 1305 4436 1305 Dl (symbol)4002 1049 w (table)4042 1169 w 2742 1305 2319 1728 Dl 2741 1306 2697 1380 Dl 2741 1306 2667 1350 Dl 3377 1306 3800 2576 Dl 3378 1306 3424 1379 Dl 3378 1305 3384 1392 Dl 4117 2575 4097 2491 Dl 4120 2575 4140 2491 Dl 4119 1306 4119 2576 Dl 4120 1306 4140 1390 Dl 4117 1306 4097 1390 Dl 9 CW f (.PS 5)1 270 1 1008 3283 t (.ps 8)1 270 1 1008 3393 t (arrow "source" "code")2 1134 1 1440 3503 t ( "lexical" "analyzer")2 1134(LA: box)1 594 2 1008 3613 t (arrow "tokens" above)2 1080 1 1440 3723 t ( "parser")1 486(P: box)1 594 2 1008 3833 t (arrow "intermediate" "code")2 1458 1 1440 3943 t ( "semantic" "checker")2 1134(Sem: box)1 594 2 1008 4053 t (arrow)1440 4163 w (arrow <-> up from top of LA)6 1458 1 1440 4383 t ( "lexical" "corrector")2 1188(LC: box)1 594 2 1008 4493 t (arrow <-> up from top of P)6 1404 1 1440 4603 t ( "syntactic" "corrector")2 1296(Syn: box)1 594 2 1008 4713 t (arrow up)1 432 1 1440 4823 t ( "diagnostic" "message" "printer")3 1782(DMP: box)1 594 2 1008 4933 t ( right of DMP)3 702( from)1 324(arrow <-> right)2 810 3 1440 5043 t ( "symbol" "table")2 918(ST: box)1 594 2 1008 5153 t (arrow from LC.ne to DMP.sw)4 1404 1 1440 5263 t (arrow from Sem.nw to DMP.se)4 1458 1 1440 5373 t (arrow <-> from Sem.top to ST.bot)5 1728 1 1440 5483 t (.PE)1008 5593 w 10 R f (There are eighteen objects \(boxes and arrows\) in the picture, and one line of)13 3049 1 970 5809 t 10 I f (pic)4045 5809 w 10 R f (input for each; this seems like)5 1206 1 4194 5809 t (an acceptable level of verbosity.)4 1288 1 720 5929 t cleartomark showpage saveobj restore %%EndPage: 19 21 %%Page: 20 22 /saveobj save def mark 22 pagesetup 10 R f (- 20 -)2 216 1 2952 480 t 8 R f 1834 1422 360 360 De (DISK)1921 1438 w 2554 1422 2194 1422 Dl 2554 1422 2482 1440 Dl 2554 1422 2482 1404 Dl (character)2230 1378 w (defns)2288 1498 w 2554 1242 2554 1602 Dl 3094 1242 2554 1242 Dl 3094 1602 3094 1242 Dl 2554 1602 3094 1602 Dl (CPU)2746 1378 w (\(16-bit mini\))1 408 1 2620 1498 t 2824 1242 2806 1170 Dl 2824 1242 2842 1170 Dl 2824 882 2824 1242 Dl (input)2640 1078 w 3454 1422 3094 1422 Dl 3454 1422 3382 1440 Dl 3454 1422 3382 1404 Dl (CRT)3514 1438 w 3454 1368 3454 1476 Dl 3814 1368 3454 1368 Dl 4174 1188 3814 1368 Dl 4174 1656 4174 1188 Dl 3814 1476 4174 1656 Dl 3454 1476 3814 1476 Dl 4210 882 4228 954 Dl 4210 882 4192 954 Dl 4210 1962 4210 882 Dl (... paper)1 276 1 4230 1798 t 4134 1062 72 72 De 4213 1062 72 72 De (rollers)4342 1078 w 10 R f (Basic Digital Typesetter)2 971 1 2574 2160 t 9 CW f (.PS)1008 2476 w (.ps -2)1 324 1 1008 2576 t (circle "DISK")1 702 1 1440 2676 t (arrow "character" "defns")2 1350 1 1440 2776 t ( "CPU" "\(16-bit mini\)")3 1188(CPU: box)1 594 2 1008 2876 t ({ arrow <- from top of CPU up "input " rjust })11 2484 1 1440 2976 t (arrow)1440 3076 w ( ljust)1 324( CRT")1 378(CRT: ")1 486 3 1008 3176 t (line from CRT - 0,0.075 up 0.15 \\)7 1782 1 1440 3276 t (then right 0.5 \\)3 864 1 1872 3376 t (then right 0.5 up 0.25 \\)5 1296 1 1872 3476 t (then down 0.5+0.15 \\)3 1080 1 1872 3576 t (then left 0.5 up 0.25 \\)5 1242 1 1872 3676 t (then left 0.5)2 702 1 1872 3776 t ( + 1.05,0.75)2 648(Paper: CRT)1 594 2 1008 3876 t (arrow <- from Paper down 1.5)5 1512 1 1440 3976 t ( ljust at end of last arrow + 0, 0.25)9 1998( paper")1 432(" ...)1 270 3 1440 4076 t (circle rad 0.05 at Paper + \(-0.055, -0.25\))7 2268 1 1440 4176 t (circle rad 0.05 at Paper + \(0.055, -0.25\))7 2214 1 1440 4276 t ( ljust at Paper + \(0.1, -0.25\))6 1620(" rollers")1 648 2 1440 4376 t (.ps +2)1 324 1 1008 4476 t (.PE)1008 4576 w (.ce)1008 4676 w (Basic Digital Typesetter)2 1296 1 1008 4776 t 10 B f (Acknowledgements)720 5076 w 10 R f ( versions of)2 486(I am indebted to Chris Van Wyk for ideas from several)10 2291 2 970 5232 t 10 I f (ideal)3782 5232 w 10 R f ( and Doug McIlroy have also)5 1217(. He)1 201 2 3982 5232 t ( for line and circle drawing, and made useful suggestions on the design of)13 2984(contributed algorithms)1 912 2 720 5352 t 10 I f (pic)4644 5352 w 10 R f ( Pavlidis)1 351(. Theo)1 283 2 4766 5352 t ( Charles)1 362( of an arc.)3 419(contributed the basic spline algorithm; Eric Grosse provided code to compute the bounding box)13 3899 3 720 5472 t ( of the language and)4 809(Wetherell pointed out reference [2] to me, and made several valuable criticisms on an early draft)15 3871 2 720 5592 t ( improved by suggestions from Jim Blinn and Mark Miller.)9 2417( exposition in this manual has been greatly)7 1735(manual. The)1 528 3 720 5712 t ( cheer-)1 274(I am grateful to my early users \320 Brenda Baker, Dottie Luciani, and Paul Tukey \320 for their suggestions and)19 4406 2 720 5832 t (ful use of an often shaky and clumsy system.)8 1795 1 720 5952 t (More recent versions of)3 959 1 970 6108 t 10 I f (pic)1957 6108 w 10 R f ( Jon Bentley and Ravi Sethi; their)6 1374(have benefited greatly from adventurous use by)6 1919 2 2107 6108 t (comments on the manual are also much appreciated.)7 2090 1 720 6228 t 10 B f (References)720 6468 w 10 R f ( Laboratories internal memorandum, May 1979.)5 1922( Bell)1 217( \320 A viewgraph generating language.)5 1524( V)1 122(1. Anon.)1 347 5 820 6660 t ( Livermore)1 456( Lawrence)1 451( \320 A picture-drawing language for the Trix/Red Report Editor.)9 2621( PICTURE)1 476( J.C.)1 190(2. Beatty,)1 386 6 820 6816 t (Laboratory Report UCID-30156, April 1977.)4 1803 1 920 6936 t ( Language for Typesetting Graphs.)4 1394( GRAP\320A)1 489(3. Bentley, J.L. and Kernighan, B.W.)5 1487 3 820 7092 t 10 I f (CACM 29)1 403 1 4240 7092 t 10 R f ( \(August, 1986\),)2 657(, 8)1 100 2 4643 7092 t (782-792.)920 7212 w cleartomark showpage saveobj restore %%EndPage: 20 22 %%Page: 21 23 /saveobj save def mark 23 pagesetup 10 R f (- 21 -)2 216 1 2952 480 t ( In)1 136( \320 A Program to Format Tables.)6 1342( Tbl)1 192( L.L. and Lesk, M.E.)4 847(4. Cherry,)1 402 5 820 840 t 10 I f ( Manual, Tenth Edi-)3 823(Unix Programmer's)1 810 2 3767 840 t (tion)920 960 w 10 R f (, AT&T Bell Laboratories, 1989.)4 1318 1 1076 960 t ( Laboratories)1 545( Bell)1 233( for Typesetting \(Revised User Manual\).)5 1699( \320 A Graphics Language)4 1085( PIC)1 221( B.W.)1 251(5. Kernighan,)1 546 7 820 1116 t (Comp. Sci. Tech. Rep. No. 116, December 1984.)7 1964 1 920 1236 t ( language for typesetting graphics.)4 1378( PIC\320a)1 350(6. Kernighan, B.W.)2 782 3 820 1392 t 10 I f (Software Practice & Experience 12)4 1420 1 3380 1392 t 10 R f (\(1982\), 1-20.)1 524 1 4825 1392 t ( In)1 134( Mathematics \320 User's Guide.)4 1249( Typesetting)1 523( and Cherry, L.L.)3 696(7. Kernighan, B.W.)2 782 5 820 1548 t 10 I f (Unix Programmer's Manual,)2 1170 1 4230 1548 t (Tenth Edition)1 548 1 920 1668 t 10 R f (, AT&T Bell Laboratories, 1989.)4 1318 1 1468 1668 t ( In)1 152( User's Manual.)2 678( Troff)1 279( B.W. and Ossanna, J.F.)4 1039(8. Kernighan,)1 546 5 820 1824 t 10 I f (Unix Programmer's Manual, Tenth Edition)4 1817 1 3558 1824 t 10 R f (,)5375 1824 w (AT&T Bell Laboratories, 1989.)3 1268 1 920 1944 t ( high-level language for specifying pictures.)5 1823( A)1 134( Wyk, C.J.)2 449(9. Van)1 266 4 820 2100 t 10 I f (ACM Transactions on Graphics 1)4 1404 1 3554 2100 t 10 R f (, 2 \(1982\),)2 442 1 4958 2100 t (163-182.)920 2220 w 10 B f (Appendix A:)1 548 1 720 2460 t 10 I f (Pic)1318 2460 w 10 B f (Reference Manual)1 784 1 1476 2460 t (Pictures)720 2700 w 10 R f (The top-level object in)3 907 1 970 2856 t 10 I f (pic)1902 2856 w 10 R f (is the ``picture'':)2 676 1 2049 2856 t 9 I f (picture)1008 3026 w 9 CW f (:)1263 3026 w (.PS)1440 3136 w 9 I f (optional-width optional-height)1 1139 1 1656 3136 t (element-list)1440 3246 w 9 CW f (.PE)1440 3356 w 10 R f (If)720 3536 w 10 I f (optional-width)811 3536 w 10 R f ( picture is made that many inches wide, regardless of any dimensions used internally.)13 3422(is present, the)2 552 2 1426 3536 t (The height is scaled in the same proportion unless)8 1998 1 720 3656 t 10 I f (optional-height)2743 3656 w 10 R f ( instead the line is)4 722( If)1 116(is present.)1 405 3 3385 3656 t 9 CW f (.PS )1 385 1 1739 3248 t 10 R f (.)2124 3248 w 10 B f (Attributes)720 3488 w 10 R f (An)970 3644 w 10 I f (attribute-list)1127 3644 w 10 R f ( attribute consists of a keyword, perhaps fol-)7 1857(is a sequence of zero or more attributes; each)8 1880 2 1663 3644 t (lowed by a value.)3 704 1 720 3764 t 9 I f (attribute)1008 3934 w 9 CW f (:)1318 3934 w (h\(eigh\)t)1368 4044 w 9 I f (expr)1854 4044 w 9 CW f (wid\(th\))2808 4044 w 9 I f (expr)3240 4044 w 9 CW f (rad\(ius\))1368 4154 w 9 I f (expr)1854 4154 w 9 CW f (diam\(eter\))2808 4154 w 9 I f (expr)3402 4154 w 9 CW f (up)1368 4264 w 9 I f (opt-expr)1530 4264 w 9 CW f (down)2808 4264 w 9 I f (opt-expr)3078 4264 w 9 CW f (right)1368 4374 w 9 I f (opt-expr)1692 4374 w 9 CW f (left)2808 4374 w 9 I f (opt-expr)3078 4374 w 9 CW f (from)1368 4484 w 9 I f (position)1638 4484 w 9 CW f (to)2808 4484 w 9 I f (position)2970 4484 w 9 CW f (at)1368 4594 w 9 I f (position)1530 4594 w 9 CW f (with)2808 4594 w 9 I f (corner)3078 4594 w 9 CW f (by)1368 4704 w 9 I f (expr, expr)1 366 1 1530 4704 t 9 CW f (then)2808 4704 w (dotted)1368 4814 w 9 I f (opt-expr)1746 4814 w 9 CW f (dashed)2808 4814 w 9 I f (opt-expr)3186 4814 w 9 CW f (chop)1368 4924 w 9 I f (opt-expr)1638 4924 w 9 CW f (-> <- <->)2 594 1 2808 4924 t (invis solid)1 1710 1 1368 5034 t (fill)1368 5144 w 9 I f (opt-expr)1638 5144 w 9 CW f (same)2808 5144 w 9 I f (text-list expr)1 1600 1 1368 5254 t 10 R f ( all primitives; irrelevant)3 1012( all attributes make sense for)5 1175( Not)1 206(Missing attributes and values are filled in from defaults.)8 2287 4 720 5434 t ( attribute)1 372( The)1 219(ones are silently ignored.)3 1046 3 720 5554 t 10 CW f (at)2396 5554 w 10 R f (causes the geometrical center to be put at the specified place;)10 2568 1 2554 5554 t 10 CW f (with)5160 5554 w 10 R f ( lines, splines and arcs,)4 949( For)1 196( the specified place.)3 813(causes the position on the object to be put at)9 1822 4 720 5674 t 10 CW f (height)4532 5674 w 10 R f (and)4924 5674 w 10 CW f (width)5100 5674 w 10 R f ( bare)1 196( A)1 122(refer to arrowhead size.)3 940 3 720 5794 t 10 I f (expr)2003 5794 w 10 R f (implies motion in the current direction.)5 1566 1 2205 5794 t 10 B f (Text)720 6034 w 10 R f ( it is placed at the geometrical center of the object.)10 2065(Text is normally an attribute of some primitive; by default)9 2365 2 970 6190 t ( A)1 124(Stand-alone text is also permitted.)4 1371 2 720 6310 t 10 I f (text-list)2242 6310 w 10 R f ( string optionally followed)3 1067(is a list of text items; a text item is a quoted)11 1764 2 2569 6310 t (by positioning requests:)2 956 1 720 6430 t 9 I f (text-item)1008 6600 w 9 CW f (:)1323 6600 w ("...")1440 6710 w 9 I f (positioning ...)1 497 1 1764 6710 t 9 CW f (sprintf\(")1440 6820 w 9 I f (format)1926 6820 w 9 CW f (",)2166 6820 w 9 I f (expr)2328 6820 w 9 CW f (,)2488 6820 w 9 I f (...)2596 6820 w 9 CW f (\))2665 6820 w 9 I f (positioning ...)1 497 1 2773 6820 t (positioning)1008 6930 w 9 CW f (:)1413 6930 w (center ljust rjust above below)4 1836 1 1440 7040 t 10 R f ( Positioning)1 524( centered vertically except as qualified.)5 1647(If there are multiple text items for some primitive, they are)10 2509 3 720 7220 t cleartomark showpage saveobj restore %%EndPage: 22 24 %%Page: 23 25 /saveobj save def mark 25 pagesetup 10 R f (- 23 -)2 216 1 2952 480 t (requests apply to each item independently.)5 1703 1 720 840 t (Text items can contain)3 913 1 970 996 t 10 I f (troff)1910 996 w 10 R f ( and font changes, local motions, etc., but make sure that these)11 2532(commands for size)2 758 2 2110 996 t (are balanced so that the entering state is restored before exiting.)10 2541 1 720 1116 t 10 B f (Positions and places)2 857 1 720 1356 t 10 R f (A position is ultimately an)4 1062 1 970 1512 t 10 I f (x,y)2057 1512 w 10 R f (coordinate pair, but it may be specified in other ways.)9 2149 1 2195 1512 t 9 I f (position)1008 1682 w 9 CW f (:)1298 1682 w 9 I f (expr, expr)1 366 1 1440 1792 t (place)1440 1902 w 9 S f (\261)1689 1902 w 9 I f (expr, expr)1 366 1 1793 1902 t (place)1440 2012 w 9 S f (\261)1689 2012 w 9 CW f (\()1793 2012 w 9 I f (expr, expr)1 366 1 1901 2012 t 9 CW f (\))2321 2012 w (\()1440 2122 w 9 I f (position)1548 2122 w 9 CW f (,)1838 2122 w 9 I f (position)1915 2122 w 9 CW f (\))2259 2122 w 9 I f (expr [)1 249 1 1440 2232 t 9 CW f (of the way)2 540 1 1689 2232 t 9 I f (])2229 2232 w 9 CW f (between)2318 2232 w 9 I f (position)2750 2232 w 9 CW f (and)3094 2232 w 9 I f (position)3310 2232 w (expr)1440 2342 w 9 CW f (<)1654 2342 w 9 I f (position)1762 2342 w 9 CW f (,)2106 2342 w 9 I f (position)2214 2342 w 9 CW f (>)2558 2342 w (\()1440 2452 w 9 I f (position)1548 2452 w 9 CW f (\))1892 2452 w 9 I f (place)1008 2617 w 9 CW f (:)1203 2617 w 9 I f (placename optional-corner)1 1014 1 1440 2727 t (corner)1440 2837 w 9 CW f (of)1734 2837 w 9 I f (placename)1896 2837 w (nth primitive optional-corner)2 1118 1 1440 2947 t (corner)1440 3057 w 9 CW f (of)1734 3057 w 9 I f (nth primitive)1 494 1 1896 3057 t 9 CW f (Here)1440 3167 w 10 R f (An)720 3347 w 10 I f (optional-corner)867 3347 w 10 R f (is one of the eight compass points or the center or the start or end of a primitive.)17 3201 1 1525 3347 t 9 I f (optional-corner)1008 3517 w 9 CW f (:)1578 3517 w (.n .e .w .s .ne .se .nw .sw .c .start .end)10 2808 1 1440 3627 t 9 I f (corner)1008 3737 w 9 CW f (:)1248 3737 w (top bot left right start end)5 1782 1 1440 3847 t 10 R f (Each object in a picture has an ordinal number;)8 1885 1 720 4027 t 10 I f (nth)2630 4027 w 10 R f (refers to this.)2 524 1 2783 4027 t 9 I f (nth)1008 4197 w 9 CW f (:)1123 4197 w 9 I f (n)1440 4307 w 9 CW f (th)1485 4307 w 9 I f (n)1440 4417 w 9 CW f (th last)1 378 1 1485 4417 t 10 R f (Since barbarisms like)2 860 1 720 4597 t 10 CW f (1th)1605 4597 w 10 R f (and)1810 4597 w 10 CW f (3th)1979 4597 w 10 R f (are barbaric, synonyms like)3 1103 1 2184 4597 t 10 CW f (1st)3312 4597 w 10 R f (and)3517 4597 w 10 CW f (3rd)3686 4597 w 10 R f (are accepted as well.)3 824 1 3891 4597 t 10 B f (Variables)720 4837 w 10 R f (The built-in variables and their default values are:)7 1993 1 970 4993 t 9 CW f ( 0.5)1 216( boxht)1 1116(boxwid 0.75)1 594 3 1368 5163 t ( 0.25)1 270( arcrad)1 1008(circlerad 0.25)1 756 3 1368 5273 t ( 0.5)1 216( ellipseht)1 1116(ellipsewid 0.75)1 810 3 1368 5383 t ( 0.5)1 216( lineht)1 1170(linewid 0.5)1 594 3 1368 5493 t ( 0.5)1 216( moveht)1 1170(movewid 0.5)1 594 3 1368 5603 t ( 0)1 108( textht)1 1278(textwid 0)1 486 3 1368 5713 t ( 0.1)1 216( arrowht)1 1116(arrowwid 0.05)1 702 3 1368 5823 t ( 2)1 108( arrowhead)1 1332(dashwid 0.1)1 594 3 1368 5933 t ( 11)1 162( maxpswid)1 1278(maxpsht 8.5)1 594 3 1368 6043 t ( .3)1 162( fillval)1 1440(scale 1)1 378 3 1368 6153 t 10 R f ( new values remain in force from picture to picture until changed again or)13 2959(These may be changed at any time, and the)8 1721 2 720 6333 t (reset by a)2 402 1 720 6453 t 10 CW f (reset)1157 6453 w 10 R f ( changed within)2 658(statement. Variables)1 850 2 1492 6453 t 10 CW f ([)3035 6453 w 10 R f (and)3130 6453 w 10 CW f (])3309 6453 w 10 R f ( exit from the)3 568(revert to their previous value upon)5 1428 2 3404 6453 t ( are divided by)3 596(block. Dimensions)1 775 2 720 6573 t 10 CW f (scale)2116 6573 w 10 R f (during output.)1 567 1 2441 6573 t 10 B f (Expressions)720 6813 w 10 R f (Expressions in)1 597 1 970 6969 t 10 I f (pic)1604 6969 w 10 R f ( numbers representing dimensions are taken to be in)8 2176( All)1 190(are evaluated in floating point.)4 1271 3 1763 6969 t (inches.)720 7089 w cleartomark showpage saveobj restore %%EndPage: 23 25 %%Page: 24 26 /saveobj save def mark 26 pagesetup 10 R f (- 24 -)2 216 1 2952 480 t 9 I f (expr)1008 830 w 9 CW f (:)1168 830 w 9 I f (expr op expr)2 518 1 1440 940 t 9 CW f (-)1440 1050 w 9 I f (expr)1548 1050 w 9 CW f (!)1440 1160 w 9 I f (expr)1548 1160 w 9 CW f (\()1440 1270 w 9 I f (expr)1548 1270 w 9 CW f (\))1762 1270 w (variable)1440 1380 w (number)1440 1490 w 9 I f (place)1440 1600 w 9 CW f (.x)1689 1600 w 9 I f (place)1440 1710 w 9 CW f (.y)1689 1710 w 9 I f (place)1440 1820 w 9 CW f (.ht)1689 1820 w 9 I f (place)1440 1930 w 9 CW f (.wid)1689 1930 w 9 I f (place)1440 2040 w 9 CW f (.rad)1689 2040 w (sin\()1440 2150 w 9 I f (expr)1656 2150 w 9 CW f (\) cos\()1 378 1 1816 2150 t 9 I f (expr)2194 2150 w 9 CW f (\) atan2\()1 486 1 2354 2150 t 9 I f (expr)2840 2150 w 9 R f (,)3007 2150 w 9 I f (expr)3037 2150 w 9 CW f (\) log\()1 378 1 3197 2150 t 9 I f (expr)3575 2150 w 9 CW f (\) exp\()1 378 1 3735 2150 t 9 I f (expr)4113 2150 w 9 CW f (\))4273 2150 w (sqrt\()1440 2260 w 9 I f (expr)1710 2260 w 9 CW f (\) max\()1 378 1 1870 2260 t 9 I f (expr)2248 2260 w 9 R f (,)2415 2260 w 9 I f (expr)2445 2260 w 9 CW f (\) min\()1 378 1 2605 2260 t 9 I f (expr)2983 2260 w 9 R f (,)3150 2260 w 9 I f (expr)3180 2260 w 9 CW f (\) int\()1 378 1 3340 2260 t 9 I f (expr)3718 2260 w 9 CW f (\) rand\(\))1 486 1 3878 2260 t 9 I f (op)1008 2370 w 9 CW f (:)1098 2370 w ( % \303)2 432( /)1 162( *)1 216(+ -)1 216 4 1440 2480 t (< <= > >= == != && ||)7 1512 1 1440 2590 t 10 B f (Definitions)720 2890 w 10 R f (The)970 3046 w 10 CW f (define)1150 3046 w 10 R f (and)1535 3046 w 10 CW f (undef)1704 3046 w 10 R f (statements are not part of the grammar.)6 1566 1 2029 3046 t 9 I f (define)1008 3216 w 9 CW f (:)1228 3216 w (define)1440 3326 w 9 I f (name)1818 3326 w 9 CW f ({)2067 3326 w 9 I f (replacement text)1 598 1 2175 3326 t 9 CW f (})2827 3326 w 9 I f (undef)1008 3436 w 9 CW f (:)1208 3436 w (undef)1440 3546 w 9 I f (name)1764 3546 w 10 R f (Occurrences of)1 617 1 720 3726 t 10 CW f ($1)1374 3726 w 10 R f (,)1494 3726 w 10 CW f ($2)1556 3726 w 10 R f (, etc., in the replacement text will be replaced by the corresponding arguments if)13 3366 1 1676 3726 t 10 I f (name)5079 3726 w 10 R f (is)5333 3726 w (invoked as)1 430 1 720 3846 t 9 I f (name)1008 4016 w 9 CW f (\()1203 4016 w 9 I f (arg1)1257 4016 w 9 CW f (,)1427 4016 w 9 I f (arg2)1535 4016 w 9 CW f (, ...\))1 324 1 1705 4016 t 10 R f ( replaced by null strings.)4 1033(Non-existent arguments are)2 1125 2 720 4196 t 10 I f (Replacement text)1 696 1 2940 4196 t 10 R f ( The)1 217(may contain newlines.)2 920 2 3673 4196 t 10 CW f (undef)4847 4196 w 10 R f (state-)5184 4196 w (ment removes the definition of a macro.)6 1600 1 720 4316 t 10 B f (The .PS and .PE Macros)4 1045 1 720 4556 t 10 R f (This is the default definition of the)6 1388 1 970 4712 t 10 CW f (.PS)2383 4712 w 10 R f (and)2588 4712 w 10 CW f (.PE)2757 4712 w 10 R f (macros:)2962 4712 w 9 CW f (.de PS \\" start picture; $1 is height, $2 is width, in inches)12 3294 1 1062 4882 t (.sp .3)1 324 1 1062 4992 t (.in \(\\\\n\(.lu-\\\\$2\)/2u)1 1134 1 1062 5102 t (.ne \\\\$1)1 432 1 1062 5212 t (..)1062 5322 w (.de PE \\" end of picture)5 1296 1 1062 5432 t (.in)1062 5542 w (.sp .6)1 324 1 1062 5652 t (..)1062 5762 w 10 B f (Summary of Features Added Since Original Version)6 2233 1 720 6062 t 10 R f (The built-in functions)2 872 1 970 6218 t 10 CW f (sin)1867 6218 w 10 R f (,)2047 6218 w 10 CW f (cos)2097 6218 w 10 R f (,)2277 6218 w 10 CW f (atan2)2327 6218 w 10 R f (,)2627 6218 w 10 CW f (log)2677 6218 w 10 R f (,)2857 6218 w 10 CW f (exp)2907 6218 w 10 R f (,)3087 6218 w 10 CW f (sqrt)3137 6218 w 10 R f (,)3377 6218 w 10 CW f (max)3427 6218 w 10 R f (,)3607 6218 w 10 CW f (min)3657 6218 w 10 R f (,)3837 6218 w 10 CW f (int)3887 6218 w 10 R f (, and)1 194 1 4067 6218 t 10 CW f (rand)4286 6218 w 10 R f (are available.)1 531 1 4551 6218 t (The)970 6374 w 10 CW f (copy)1150 6374 w 10 R f (statement includes data from a file or that follows immediately:)9 2539 1 1415 6374 t 9 CW f (copy ")1 324 1 1008 6544 t 9 I f (filename)1332 6544 w 9 CW f (")1642 6544 w (copy thru)1 486 1 1008 6654 t 9 I f (macro)1548 6654 w 9 CW f (copy ")1 324 1 1008 6764 t 9 I f (filename)1332 6764 w 9 CW f (" thru)1 324 1 1642 6764 t 9 I f (macro)2020 6764 w 10 R f (The)720 6944 w 10 I f (macro)903 6944 w 10 R f ( is)1 96( no filename)2 505( If)1 119(may be either the name of a defined macro, or the body of a macro enclosed in braces.)17 3494 4 1186 6944 t (given,)720 7064 w 10 CW f (copy)992 7064 w 10 R f (copies the input until the next)5 1186 1 1257 7064 t 10 CW f (.PE)2468 7064 w 10 R f (.)2648 7064 w (The)970 7220 w 10 CW f (for)1150 7220 w 10 R f (and)1355 7220 w 10 CW f (if)1524 7220 w 10 R f (statements provide loops and decision-making:)4 1882 1 1669 7220 t cleartomark showpage saveobj restore %%EndPage: 24 26 %%Page: 25 27 /saveobj save def mark 27 pagesetup 10 R f (- 25 -)2 216 1 2952 480 t 9 CW f (for)1008 830 w 9 I f (var)1224 830 w 9 CW f (=)1344 830 w 9 I f (expr)1398 830 w 9 CW f (to)1612 830 w 9 I f (expr)1774 830 w 9 CW f (by)1988 830 w 9 I f (expr)2150 830 w 9 CW f (do {)1 216 1 2364 830 t 9 I f (anything)2634 830 w 9 CW f (})3003 830 w (if)1008 940 w 9 I f (expr)1170 940 w 9 CW f (then {)1 324 1 1384 940 t 9 I f (anything)1762 940 w 9 CW f (} else {)2 432 1 2131 940 t 9 I f (anything)2617 940 w 9 CW f (})2986 940 w 10 R f (The)720 1120 w 10 CW f (by)900 1120 w 10 R f (and)1045 1120 w 10 CW f (else)1214 1120 w 10 R f ( The)1 205(clauses are optional.)2 812 2 1479 1120 t 10 I f (expr)2522 1120 w 10 R f (in an)1 198 1 2725 1120 t 10 CW f (if)2949 1120 w 10 R f (may use the usual relational operators or the tests)8 1977 1 3095 1120 t 10 I f (str1)5098 1120 w 10 CW f (==)5280 1120 w 10 R f (\(or)720 1240 w 10 CW f (!=)861 1240 w 10 R f (\))981 1240 w 10 I f (str2)1039 1240 w 10 R f (for two quoted strings.)3 905 1 1220 1240 t (The)970 1396 w 10 CW f (sh)1150 1396 w 10 R f (command executes any sequence of commands, after expanding any defined names:)10 3361 1 1295 1396 t 9 CW f (sh {)1 216 1 1008 1566 t 9 I f (anything)1278 1566 w 9 CW f (})1647 1566 w 10 R f ( used to enclose a body,)5 994(In all of the above, any single character that does not occur within the body may be)16 3436 2 970 1782 t (instead of braces, as in)4 906 1 720 1902 t 9 CW f (define name X replacement text X)5 1728 1 1008 2072 t 10 R f ( as an invisi-)3 511(Text strings are first-class citizens: a statement beginning with a sequence of text strings is treated)15 3919 2 970 2288 t ( variable)1 353( The)1 212(ble box with the strings positioned at its center.)8 1947 3 720 2408 t 10 CW f (textht)3264 2408 w 10 R f (and)3656 2408 w 10 CW f (textwid)3831 2408 w 10 R f (may be set to any values to)6 1118 1 4282 2408 t ( height of)2 383( The)1 205(control positioning.)1 784 3 720 2528 t 10 I f (n)2117 2528 w 10 R f (such strings is)2 567 1 2192 2528 t 10 I f (n)2784 2528 w 10 S f (\264)2859 2528 w 10 CW f (textht)2939 2528 w 10 R f (.)3299 2528 w (It is possible to convert expressions to formatted strings:)8 2260 1 970 2684 t 9 CW f (sprintf\(")1008 2854 w 9 I f (format)1494 2854 w 9 CW f (",)1734 2854 w 9 I f (expr)1896 2854 w 9 CW f (,)2056 2854 w 9 I f (expr)2164 2854 w 9 CW f (, ...\))1 324 1 2324 2854 t 10 R f ( of)1 108( Variants)1 388(is equivalent to a quoted string in any context.)8 1846 3 720 3034 t 10 CW f (%f)3087 3034 w 10 R f (and)3232 3034 w 10 CW f (%g)3401 3034 w 10 R f (are the only sensible format conversions.)5 1636 1 3546 3034 t (Built-in variables may be reset to default values with)8 2114 1 970 3190 t 10 CW f (reset)3109 3190 w 10 R f (.)3409 3190 w (The)970 3346 w 10 CW f (undef)1150 3346 w 10 R f (statement removes a macro definition.)4 1528 1 1475 3346 t (Arrowheads may be filled with the)5 1389 1 970 3502 t 10 CW f (arrowhead)2384 3502 w 10 R f (variable; their positioning is improved on arcs.)6 1868 1 2949 3502 t ( may be set independently from the)6 1487(The width and height of the generated picture)7 1905 2 970 3658 t 10 CW f (.PS)4400 3658 w 10 R f (line; the maximum)2 782 1 4618 3658 t (height and width are set from)5 1173 1 720 3778 t 10 CW f (maxpsht)1918 3778 w 10 R f (and)2363 3778 w 10 CW f (maxpswid)2532 3778 w 10 R f (.)3012 3778 w (The state of)2 471 1 970 3934 t 10 I f (troff)1466 3934 w 10 R f ('s fill or no-fill mode is preserved around a picture.)9 2046 1 1639 3934 t (Input numbers may be expressed in)5 1417 1 970 4090 t 10 CW f (E)2412 4090 w 10 R f (notation.)2497 4090 w ( number of objects, text strings, etc., may be used;)9 2069( Any)1 229( well.)1 229(Numerous internal changes have been made as)6 1903 4 970 4246 t ( inches instead of units for a particular typeset-)8 1906( is now produced in)4 808( Output)1 333(the only limit is total available memory.)6 1633 4 720 4366 t (ter, so the)2 391 1 720 4486 t 10 CW f (-T)1136 4486 w 10 R f (option has gone away.)3 893 1 1281 4486 t cleartomark showpage saveobj restore %%EndPage: 25 27 %%Trailer done %%Pages: 27 %%DocumentFonts: Courier Times-Bold Times-Italic Times-Roman Times-Roman Symbol Helvetica-Bold �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������plotutils-2.6/pic2plot/doc/pic1.ps������������������������������������������������������������������0000644�0001750�0001750�00000540554�06660330376�014070� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������%!PS-Adobe-3.0 %%Creator: groff version 1.10 %%CreationDate: Wed Feb 10 09:17:02 1999 %%DocumentNeededResources: font Times-Bold %%+ font Times-Italic %%+ font Times-Roman %%+ font Courier %%+ font Symbol %%DocumentSuppliedResources: procset grops 1.10 0 %%+ font Symbol-Slanted %%Pages: 34 %%PageOrder: Ascend %%Orientation: Portrait %%EndComments %%BeginProlog %%BeginResource: procset grops 1.10 0 /setpacking where{ pop currentpacking true setpacking }if /grops 120 dict dup begin /SC 32 def /A/show load def /B{0 SC 3 -1 roll widthshow}bind def /C{0 exch ashow}bind def /D{0 exch 0 SC 5 2 roll awidthshow}bind def /E{0 rmoveto show}bind def /F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def /G{0 rmoveto 0 exch ashow}bind def /H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /I{0 exch rmoveto show}bind def /J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def /K{0 exch rmoveto 0 exch ashow}bind def /L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /M{rmoveto show}bind def /N{rmoveto 0 SC 3 -1 roll widthshow}bind def /O{rmoveto 0 exch ashow}bind def /P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /Q{moveto show}bind def /R{moveto 0 SC 3 -1 roll widthshow}bind def /S{moveto 0 exch ashow}bind def /T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def /SF{ findfont exch [exch dup 0 exch 0 exch neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /MF{ findfont [5 2 roll 0 3 1 roll neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /level0 0 def /RES 0 def /PL 0 def /LS 0 def /MANUAL{ statusdict begin/manualfeed true store end }bind def /PLG{ gsave newpath clippath pathbbox grestore exch pop add exch pop }bind def /BP{ /level0 save def 1 setlinecap 1 setlinejoin 72 RES div dup scale LS{ 90 rotate }{ 0 PL translate }ifelse 1 -1 scale }bind def /EP{ level0 restore showpage }bind def /DA{ newpath arcn stroke }bind def /SN{ transform .25 sub exch .25 sub exch round .25 add exch round .25 add exch itransform }bind def /DL{ SN moveto SN lineto stroke }bind def /DC{ newpath 0 360 arc closepath }bind def /TM matrix def /DE{ TM currentmatrix pop translate scale newpath 0 0 .5 0 360 arc closepath TM setmatrix }bind def /RC/rcurveto load def /RL/rlineto load def /ST/stroke load def /MT/moveto load def /CL/closepath load def /FL{ currentgray exch setgray fill setgray }bind def /BL/fill load def /LW/setlinewidth load def /RE{ findfont dup maxlength 1 index/FontName known not{1 add}if dict begin { 1 index/FID ne{def}{pop pop}ifelse }forall /Encoding exch def dup/FontName exch def currentdict end definefont pop }bind def /DEFS 0 def /EBEGIN{ moveto DEFS begin }bind def /EEND/end load def /CNT 0 def /level1 0 def /PBEGIN{ /level1 save def translate div 3 1 roll div exch scale neg exch neg exch translate 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit []0 setdash /setstrokeadjust where{ pop false setstrokeadjust }if /setoverprint where{ pop false setoverprint }if newpath /CNT countdictstack def userdict begin /showpage{}def }bind def /PEND{ clear countdictstack CNT sub{end}repeat level1 restore }bind def end def /setpacking where{ pop setpacking }if %%EndResource %%IncludeResource: font Symbol %%IncludeResource: font Times-Bold %%IncludeResource: font Times-Italic %%IncludeResource: font Times-Roman %%IncludeResource: font Courier %%BeginResource: font Symbol-Slanted %%DocumentNeededResources: font Symbol /MakeTransformedFont{ findfont dup maxlength dict begin { exch dup dup/FID ne exch/UniqueID ne and{ exch def }{ pop pop }ifelse }forall /FontBBox currentdict/FontBBox get 4 array copy def FontBBox aload pop 4 index transform 4 2 roll 4 index transform 4 2 roll FontBBox astore pop FontMatrix exch matrix concatmatrix /FontMatrix exch def dup/FontName exch def currentdict end definefont pop }bind def /Symbol-Slanted [.89 0.0 15.5 dup sin exch cos div .89 0.0 0.0] /Symbol MakeTransformedFont %%EndResource grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron /scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent /ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen /period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon /semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O /P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex /underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y /z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft /guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl /endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut /dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash /quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen /brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft /logicalnot/minus/registered/macron/degree/plusminus/twosuperior /threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior /ordmasculine/guilsinglright/onequarter/onehalf/threequarters /questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE /Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn /germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla /egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis /eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash /ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def /Courier@0 ENC0/Courier RE/Times-Roman@0 ENC0/Times-Roman RE /Times-Italic@0 ENC0/Times-Italic RE/Times-Bold@0 ENC0/Times-Bold RE %%EndProlog %%Page: 1 1 %%BeginPageSetup BP %%EndPageSetup /F0 12/Times-Bold@0 SF(Making Pictur)204.552 123 Q(es W)-.216 E (ith GNU PIC)-.216 E/F1 10/Times-Italic@0 SF(Eric S. Raymond)254.255 147 Q/F2 10/Times-Roman@0 SF()-.05 E F1(ABSTRA)264.535 201 Q(CT)-.3 E F2(The)133 228.6 Q/F3 10/Times-Bold@0 SF(pic)2.553 E F2 .053(language is a)2.553 F F3(tr)2.553 E(off)-.18 E F2 -.15(ex)2.553 G .053(tension that mak).15 F .052 (es it easy to create and alter box-and-)-.1 F(arro)108 240.6 Q 2.643 (wd)-.25 G .143 (iagrams of the kind frequently used in technical papers and te)-2.643 F 2.643(xtbooks. This)-.15 F(paper)2.644 E .19 (is both an introduction to and reference for)108 252.6 R F1(gpic)2.69 E F2 .19(\(1\), the implementation distrib)B .19(uted by the)-.2 F (Free Softw)108 264.6 Q(are F)-.1 E(oundation for use with)-.15 E F1(gr) 2.5 E(of)-.45 E(f)-.18 E F2(\(1\).)A F3 2.5(1. Intr)72 300.6 R (oduction to PIC)-.18 E 2.5(1.1. Wh)72 324.6 R 2.5(yP)-.15 G(IC?)-2.5 E F2(The)97 340.2 Q F3(pic)2.543 E F2 .043(language pro)2.543 F .043 (vides an easy w)-.15 F .043(ay to write procedural box-and-arro)-.1 F 2.544(wd)-.25 G .044(iagrams to be included in)-2.544 F F3(tr)72 352.2 Q (off)-.18 E F2 2.658(documents. The)2.658 F .158(language is suf)2.658 F .158(\214ciently \215e)-.25 F .158 (xible to be quite useful for state charts, Petri-net diagrams,)-.15 F <8d6f>72 364.2 Q 3.563(wc)-.25 G 1.064(harts, simple circuit schematics\ , jumper layouts, and other kinds of illustration in)-3.563 F -.2(vo)-.4 G 1.064(lving repetiti).2 F -.15(ve)-.25 G .93 (uses of simple geometric forms and splines.)72 376.2 R .93 (Because these descriptions are procedural and object-based,)5.93 F(the) 72 388.2 Q 2.5(ya)-.15 G(re both compact and easy to modify)-2.5 E(.) -.65 E(The)97 403.8 Q F1(gpic)3.128 E F2 .628(\(1\) implementation of)B F3(pic)3.128 E F2 .629(is distrib)3.128 F .629(uted by the Free Softw) -.2 F .629(are F)-.1 F .629(oundation for use with their)-.15 F F1(gr)72 415.8 Q(of)-.45 E(f)-.18 E F2 1.218(\(1\) implementation of)B F3(tr) 3.718 E(off)-.18 E F2 6.218(.B)C 1.218 (ecause both implementations are widely a)-6.218 F -.25(va)-.2 G 1.217 (ilable in source form for).25 F(free, the)72 427.8 Q 2.5(ya)-.15 G (re good bets for writing v)-2.5 E(ery portable documentation.)-.15 E F3 2.5(1.2. PIC)72 451.8 R -1(Ve)2.5 G(rsions)1 E F2 1.01 (The original 1984 pre-)97 467.4 R F1(ditr)A(of)-.45 E(f)-.18 E F2 1.01 (\(1\) v)B 1.01(ersion of)-.15 F F3(pic)3.51 E F2 1.01 (is long obsolete.)3.51 F 1.01(The re)6.01 F 1.01(written 1991 v)-.25 F 1.01(ersion is still)-.15 F -.2(av)72 479.4 S (ailable as part of the Documenter')-.05 E 2.5(sW)-.55 G (ork Bench module of System V)-3.3 E(.)-1.29 E 3.256(Where dif)97 495 R 3.256(ferences between Documenter')-.25 F 5.756(sW)-.55 G 3.256 (ork Bench \(1991\))-6.556 F F3(pic)5.755 E F2 3.255(and GNU)5.755 F F3 (pic)5.755 E F2 3.255(need to be)5.755 F .564(described, original)72 507 R F3(pic)3.064 E F2 .564(is referred to as "D)3.064 F .565(WB pic".)-.3 F .565(Details on the history of the program are gi)5.565 F -.15(ve)-.25 G 3.065(na).15 G 3.065(tt)-3.065 G(he)-3.065 E(end of this document.)72 519 Q(In this document, the)97 534.6 Q F1(gpic)2.5 E F2(\(1\) e)A (xtensions will be mark)-.15 E(ed as such.)-.1 E F3 2.5(2. In)72 558.6 R -.1(vo)-.4 G(king PIC).1 E F2(Ev)97 574.2 Q(ery)-.15 E F3(pic)3.244 E F2 .743(description is a little program, which gets compiled by)3.244 F F1 (pic)3.243 E F2 .743(\(1\) into)B F1(gtr)3.243 E(of)-.45 E(f)-.18 E F2 .743(\(1\) macros.)B(Pro-)5.743 E .018(grams that process or display)72 586.2 R F1(gtr)2.518 E(of)-.45 E(f)-.18 E F2 .018 (\(1\) output need not kno)B 2.518(wo)-.25 G 2.519(rc)-2.518 G .019 (are that parts of the image be)-2.519 F -.05(ga)-.15 G 2.519(nl).05 G .019(ife as)-2.519 F F3(pic)2.519 E F2(descriptions.)72 598.2 Q(The)97 613.8 Q F1(pic)4.075 E F2 1.575(\(1\) program tries to translate an)B 1.574(ything between)-.15 F F3(.PS)4.074 E F2(and)4.074 E F3(.PE)4.074 E F2(mark)4.074 E 1.574(ers, and passes through)-.1 F -2.15 -.25(ev e)72 625.8 T .622(rything else.).25 F .622(The normal de\214nitions of)5.622 F F3(.PS)3.122 E F2(and)3.122 E F3(.PE)3.122 E F2 .622(in the)3.122 F F1 (ms)3.122 E F2 .623(macro package and else)3.123 F .623(where ha)-.25 F .923 -.15(ve a)-.2 H(lso).15 E(the side-ef)72 637.8 Q (fect of centering the)-.25 E F3(pic)2.5 E F2(output on the page.)2.5 E (Other details of the)97 653.4 Q F1([gt]r)2.5 E(of)-.45 E(f)-.18 E F2 (\(1\) interf)A(ace)-.1 E F3 2.5(2.1. PIC)72 677.4 R(Err)2.5 E (or Messages)-.18 E F2 .175(If you mak)97 693 R 2.675(ea)-.1 G F3(pic)A F2 .175(syntax error)2.675 F(,)-.4 E F1(gpic)2.675 E F2 .175 (\(1\) will issue an error message in the standard)B F1(gcc)2.674 E F2 (\(1\)-lik)A 2.674(es)-.1 G(yntax.)-2.674 E 2.5(At)72 705 S (ypical error message looks lik)-2.5 E 2.5(et)-.1 G(his,)-2.5 E EP %%Page: 2 2 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-2-)282.17 48 Q/F1 10/Courier@0 SF (pic:pic.ms:: parse error before `')108 84 Q (pic:pic.ms:: giving up on this picture)108 96 Q F0 (where is a line number)72 117.6 Q 2.5(,a)-.4 G(nd is a tok)-.1 E(en near \(usually just after\) the error location.) -.1 E/F2 10/Times-Bold@0 SF 2.5(3. Basic)72 141.6 R(PIC Concepts)2.5 E F0 1.067(Pictures are described procedurally)97 157.2 R 3.567(,a)-.65 G 3.567(sc)-3.567 G 1.068(ollections of objects connected by motions.) -3.567 F(Normally)6.068 E(,)-.65 E F2(pic)3.568 E F0 .121 (tries to string together objects left-to-right in the sequence the)72 169.2 R 2.621(ya)-.15 G .12 (re described, joining them at visually natu-)-2.621 F(ral points.)72 181.2 Q(Here is an e)5 E(xample illustrating the \215o)-.15 E 2.5(wo) -.25 G 2.5(fd)-2.5 G(ata in)-2.5 E F2(pic)2.5 E F0(processing:)2.5 E 54 36 99 217.2 DE .4 LW ST(document)79.28 219.4 Q 162 217.2 126 217.2 DL 162 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL BL 162 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL ST 216 235.2 MT 0 -36 RL -54 0 RL 0 36 RL CL ST/F3 10 /Times-Italic@0 SF(gpic)174.56 219.4 Q F0(\(1\))A 252 217.2 216 217.2 DL 252 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL BL 252 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL ST 255.6 235.2 252 235.2 DL 262.512 235.2 258.912 235.2 DL 269.424 235.2 265.824 235.2 DL 276.336 235.2 272.736 235.2 DL 283.176 235.2 279.576 235.2 DL 290.088 235.2 286.488 235.2 DL 297 235.2 293.4 235.2 DL 303.912 235.2 300.312 235.2 DL 310.824 235.2 307.224 235.2 DL 317.664 235.2 314.064 235.2 DL 324.576 235.2 320.976 235.2 DL 331.488 235.2 327.888 235.2 DL 338.4 235.2 334.8 235.2 DL 338.4 231.6 338.4 235.2 DL 338.4 225.12 338.4 228.72 DL 338.4 218.64 338.4 222.24 DL 338.4 212.16 338.4 215.76 DL 338.4 205.68 338.4 209.28 DL 338.4 199.2 338.4 202.8 DL 334.8 199.2 338.4 199.2 DL 327.888 199.2 331.488 199.2 DL 320.976 199.2 324.576 199.2 DL 314.136 199.2 317.736 199.2 DL 307.224 199.2 310.824 199.2 DL 300.312 199.2 303.912 199.2 DL 293.4 199.2 297 199.2 DL 286.488 199.2 290.088 199.2 DL 279.576 199.2 283.176 199.2 DL 272.736 199.2 276.336 199.2 DL 265.824 199.2 269.424 199.2 DL 258.912 199.2 262.512 199.2 DL 252 199.2 255.6 199.2 DL 252 202.8 252 199.2 DL 252 209.28 252 205.68 DL 252 215.76 252 212.16 DL 252 222.24 252 218.64 DL 252 228.72 252 225.12 DL 252 235.2 252 231.6 DL F3(gtbl)259.425 213.4 Q F0 (\(1\) or)A F3 -.1(ge)2.5 G(qn).1 E F0(\(1\))A(\(optional\))275.48 225.4 Q 374.4 217.2 338.4 217.2 DL 374.4 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL BL 374.4 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL ST 428.4 235.2 MT 0 -36 RL -54 0 RL 0 36 RL CL ST F3(gtr)384.77 219.4 Q(of)-.45 E(f)-.18 E F0(\(1\))A 464.4 217.2 428.4 217.2 DL 464.4 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL BL 464.4 217.2 MT -7.2 1.8 RL 0 -3.6 RL CL ST 54 36 491.4 217.2 DE ST (PostScript)470.84 219.4 Q(Figure 3-1: Flo)231.6 258.2 Q 2.5(wo)-.25 G (f)-2.5 E F2(pic)2.5 E F0(data)2.5 E(This w)97 285.8 Q (as produced from the follo)-.1 E(wing)-.25 E F2(pic)2.5 E F0(program:) 2.5 E F1(.PS)108 303.8 Q(ellipse "document";)108 315.8 Q(arrow;)108 327.8 Q(box "\\fIpic\\fP\(1\)")108 339.8 Q(arrow;)108 351.8 Q(box width\ 1.2 "\\fIgtbl\\fP\(1\) or \\fIgeqn\\fP\(1\)" "\(optional\)" dashed;)108 363.8 Q(arrow;)108 375.8 Q(box "\\fIgtroff\\fP\(1\)";)108 387.8 Q (arrow;)108 399.8 Q(ellipse "PostScript")108 411.8 Q(.PE)108 423.8 Q F0 .53(This little program illustrates se)72 445.4 R -.15(ve)-.25 G(ral).15 E F2(pic)3.03 E F0 3.03(basics. Firstly)3.03 F 3.03(,w)-.65 G 3.03(es) -3.03 G .53(ee ho)-3.03 F 3.03(wt)-.25 G 3.03(oi)-3.03 G -1.9 -.4(nv o) -3.03 H .73 -.1(ke t).4 H .53(hree object types; ellipses,).1 F(arro)72 457.4 Q 1.168(ws, and box)-.25 F 3.668(es. W)-.15 F 3.668(es)-.8 G 1.168 (ee ho)-3.668 F 3.668(wt)-.25 G 3.668(od)-3.668 G 1.168(eclare te)-3.668 F 1.167(xt lines to go within an object \(and that te)-.15 F 1.167 (xt can ha)-.15 F 1.467 -.15(ve f)-.2 H(ont).15 E .697(changes in it\).) 72 469.4 R 2.297 -.8(We s)5.697 H .697(ee ho).8 F 3.197(wt)-.25 G 3.198 (oc)-3.197 G .698 (hange the line style of an object from solid to dashed.)-3.198 F .698 (And we see that a)5.698 F .001(box can be made wider than its def)72 481.4 R .001(ault size to accommodate more te)-.1 F(xt \(we')-.15 E (ll discuss this f)-.1 E(acility in detail in)-.1 E(the ne)72 493.4 Q (xt section\).)-.15 E 3.083 -.8(We a)97 509 T 1.483(lso get to see).8 F F2(pic)3.983 E F0 2.583 -.55('s s)D 1.483(imple syntax.).55 F 1.483 (Statements are ended by ne)6.483 F 1.484(wlines or semicolons.)-.25 F (String)6.484 E .496(quotes are required around all te)72 521 R .495 (xt ar)-.15 F .495(guments, whether or not the)-.18 F 2.995(yc)-.15 G .495(ontain spaces.)-2.995 F .495(In general, the order of)5.495 F .118 (command ar)72 533 R .118(guments and modi\214ers lik)-.18 F 2.619(e") -.1 G .119(width 1.2" or "dashed" doesn')-2.619 F 2.619(tm)-.18 G(atter) -2.619 E 2.619(,e)-.4 G .119(xcept that the order of te)-2.769 F(xt)-.15 E(ar)72 545 Q(guments is signi\214cant.)-.18 E(Here are all b)97 560.6 Q (ut one of the basic)-.2 E F2(pic)2.5 E F0(objects at their def)2.5 E (ault sizes:)-.1 E 135 614.6 MT 0 -36 RL -54 0 RL 0 36 RL CL ST(box) 100.5 598.8 Q 207 596.6 171 596.6 DL(line)181.5 592.8 Q 279 596.6 243 596.6 DL 279 596.6 MT -7.2 1.8 RL 0 -3.6 RL CL BL 279 596.6 MT -7.2 1.8 RL 0 -3.6 RL CL ST(arro)249.465 592.8 Q(w)-.25 E 333 596.6 18 DC ST (circle)321.895 598.8 Q 54 36 414 596.6 DE ST(ellipse)400.945 598.8 Q 477 578.6 18 90.0000 0.0000 DA(arc)488.895 616.8 Q(Figure 3-2: Basic) 230.225 637.6 Q F2(pic)2.5 E F0(objects)2.5 E .346 (The missing simple object type is a)97 665.2 R F3(spline)2.846 E F0 5.346(.T)C .346(here is also a w)-5.346 F .346 (ay to collect objects into)-.1 F F3(bloc)2.846 E 2.846(kc)-.2 G(ompos-) -2.846 E(ites)72 677.2 Q F0 1.047(which allo)3.547 F 1.047(ws you to tr\ eat the whole group as a single object \(resembling a box\) for man)-.25 F 3.548(yp)-.15 G(urposes.)-3.548 E -.8(We)72 689.2 S -.1('l).8 G 2.5 (ld).1 G(escribe both of these later on.)-2.5 E 1.008 (The box, ellipse, circle, and block composite objects are)97 704.8 R F3 (closed)3.507 E F0 3.507(;l)C 1.007(ines, arro)-3.507 F 1.007 (ws, arcs and splines are)-.25 F F3(open)72 716.8 Q F0 5(.T)C (his distinction will often be important in e)-5 E (xplaining command modi\214ers.)-.15 E EP %%Page: 3 3 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-3-)282.17 48 Q(Figure 3-2 w)97 84 Q (as produced by the follo)-.1 E(wing)-.25 E/F1 10/Times-Bold@0 SF(pic) 2.5 E F0(program, which introduces some more basic concepts:)2.5 E/F2 10 /Courier@0 SF(.PS)108 102 Q(box "box";)108 114 Q(move;)108 126 Q (line "line" "";)108 138 Q(move;)108 150 Q(arrow "arrow" "";)108 162 Q (move;)108 174 Q(circle "circle";)108 186 Q(move;)108 198 Q (ellipse "ellipse";)108 210 Q(move;)108 222 Q(arc; down; move; "arc")108 234 Q(.PE)108 246 Q F0 .477(The \214rst thing to notice is the)97 267.6 R/F3 10/Times-Italic@0 SF(mo)2.977 E(ve)-.1 E F0 .477(command, which mo) 2.977 F -.15(ve)-.15 G 2.977(sad).15 G(ef)-2.977 E .478 (ault distance \(1/2 inch\) in the cur)-.1 F(-)-.2 E(rent mo)72 279.6 Q -.15(ve)-.15 G(ment direction.).15 E(Secondly)97 295.2 Q 3.335(,s)-.65 G .835(ee ho)-3.335 F 3.335(ww)-.25 G 3.335(ec)-3.335 G .835 (an also decorate lines and arro)-3.335 F .835(ws with te)-.25 F 3.335 (xt. The)-.15 F .835(line and arro)3.335 F 3.335(wc)-.25 G(ommands) -3.335 E .817(each tak)72 307.2 R 3.317(et)-.1 G 1.017 -.1(wo a)-3.317 H -.18(rg).1 G .817(uments here, specifying te).18 F .817(xt to go abo) -.15 F 1.117 -.15(ve a)-.15 H .817(nd belo).15 F 3.317(wt)-.25 G .817 (he object.)-3.317 F .818(If you w)5.817 F .818(onder wh)-.1 F 3.318(yo) -.05 G(ne)-3.318 E(ar)72 319.2 Q(gument w)-.18 E (ould not do, contemplate the output of)-.1 E F1(arr)2.5 E .2 -.1(ow ") -.18 H -.1(ow).1 G(!").1 E F0(:)A .4 LW 306 337.2 270 337.2 DL 306 337.2 MT -7.2 1.8 RL 0 -3.6 RL CL BL 306 337.2 MT -7.2 1.8 RL 0 -3.6 RL CL ST -.25(ow)280.35 339.4 S(!).25 E(Figure 3-3: T)212.46 360.2 Q -.15(ex)-.7 G 2.5(tc).15 G(entered on an arro)-2.5 E(w)-.25 E .514 (When a command tak)97 387.8 R .514(es one te)-.1 F .514(xt string,)-.15 F F1(pic)3.014 E F0 .514(tries to place it at the object')3.014 F 3.014 (sg)-.55 G .514(eometric center)-3.014 F 5.513(.A)-.55 G 3.013(sy)-5.513 G(ou)-3.013 E(add more strings,)72 399.8 Q F1(pic)2.5 E F0 (treats them as a v)2.5 E(ertical block to be centered.)-.15 E (The program)5 E F2(line "1";)108 417.8 Q(line "1" "2";)108 429.8 Q (line "1" "2" "3";)108 441.8 Q(line "1" "2" "3" "4";)108 453.8 Q (line "1" "2" "3" "4" "5";)108 465.8 Q F0(for e)72 487.4 Q(xample, gi) -.15 E -.15(ve)-.25 G 2.5(sy).15 G(ou this:)-2.5 E 234 529.4 198 529.4 DL(1)213.5 531.6 Q 270 529.4 234 529.4 DL(1)249.5 525.6 Q(2)249.5 537.6 Q 306 529.4 270 529.4 DL(1)285.5 519.6 Q(2)285.5 531.6 Q(3)285.5 543.6 Q 342 529.4 306 529.4 DL(1)321.5 513.6 Q(2)321.5 525.6 Q(3)321.5 537.6 Q (4)321.5 549.6 Q 378 529.4 342 529.4 DL(1)357.5 507.6 Q(2)357.5 519.6 Q (3)357.5 531.6 Q(4)357.5 543.6 Q(5)357.5 555.6 Q(Figure 3-4: Ef)196.355 576.4 Q(fects of multiple te)-.25 E(xt ar)-.15 E(guments)-.18 E .128 (The last line of Figure 3.2')97 604 R 2.628(sp)-.55 G .128(rogram, `) -2.628 F F1(ar)A .128(c; do)-.18 F .128(wn; mo)-.1 F -.1(ve)-.1 G 2.628 (;").1 G(ar)-2.628 E(c")-.18 E F0 .128 (', describing the captioned arc, intro-)B .558(duces se)72 616 R -.15 (ve)-.25 G .558(ral ne).15 F 3.058(wi)-.25 G 3.058(deas. Firstly)-3.058 F 3.057(,w)-.65 G 3.057(es)-3.057 G .557(ee ho)-3.057 F 3.057(wt)-.25 G 3.057(oc)-3.057 G .557(hange the direction in which objects are joined.) -3.057 F .557(Had we)5.557 F(written)72 628 Q F1(ar)3.577 E 1.077(c; mo) -.18 F -.1(ve)-.1 G 3.577(;").1 G(ar)-3.577 E(c")-.18 E F0 3.577(,o)C (mitting)-3.577 E F1(do)3.577 E(wn)-.1 E F0 1.077(the caption w)3.577 F 1.077(ould ha)-.1 F 1.377 -.15(ve b)-.2 H 1.077 (een joined to the top of the arc, lik).15 F(e)-.1 E(this:)72 640 Q EP %%Page: 4 4 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-4-)282.17 48 Q .4 LW 279 120 18 90.0000 0.0000 DA(arc)290.895 86.2 Q(Figure 3-5: Result of)222.23 161 Q/F1 10 /Times-Bold@0 SF(ar)2.5 E(c; mo)-.18 E -.1(ve)-.1 G(;).1 E F0 .129 (This is because dra)97 188.6 R .129(wing an arc changes the def)-.15 F .128(ault direction to the one its e)-.1 F .128(xit end points at.)-.15 F 1.728 -.8(To r)5.128 H(ein-).8 E(force this point, consider:)72 200.6 Q 279 236.6 18 -0.0000 -90.0000 DA(arc)290.895 274.8 Q (Figure 3-6: Result of)215.15 295.6 Q F1(ar)2.5 E 2.5(cc)-.18 G(w; mo) -2.5 E -.1(ve)-.1 G(;).1 E F0 1.439(All we')97 323.2 R 1.739 -.15(ve d) -.5 H 1.439(one dif).15 F 1.439 (ferently here is specify "cw" for a clockwise arc.)-.25 F(Observ)6.44 E 3.94(eh)-.15 G 1.94 -.25(ow i)-3.94 H 3.94(tc).25 G 1.44(hanges the) -3.94 F(def)72 335.2 Q(ault direction to do)-.1 E(wn, rather than up.) -.25 E(Another good w)97 350.8 Q(ay to see this via with the follo)-.1 E (wing program:)-.25 E/F2 10/Courier@0 SF(line; arc; arc cw; line)108 368.8 Q F0(which yields:)72 390.4 Q 270 444.4 234 444.4 DL 270 426.4 18 90.0000 0.0000 DA 306 426.4 18 -90.0000 180.0000 DA 342 408.4 306 408.4 DL(Figure 3-7: Result of)199.86 467.4 Q F1(line; ar)2.5 E(c; ar)-.18 E 2.5(cc)-.18 G(w; line)-2.5 E F0(Notice that we did not ha)72 495 Q .3 -.15(ve t)-.2 H 2.5(os).15 G (pecify "up" for the second arc to be joined to the end of the \214rst.) -2.5 E(Finally)97 510.6 Q 3.206(,o)-.65 G(bserv)-3.206 E 3.206(et)-.15 G .705(hat a string, alone, is treated as te)-3.206 F .705 (xt to be surrounded by an in)-.15 F .705(visible box of a size)-.4 F .22(either speci\214ed by width and height attrib)72 522.6 R .221 (utes or by the def)-.2 F(aults)-.1 E F1(textwid)2.721 E F0(and)2.721 E F1(textht)2.721 E F0 5.221(.B)C .221(oth are initially zero)-5.221 F (\(because we don')72 534.6 Q 2.5(tk)-.18 G(no)-2.5 E 2.5(wt)-.25 G (he def)-2.5 E(ault font size\).)-.1 E F1 2.5(4. Sizes)72 558.6 R (and Spacing)2.5 E F0 .252(Sizes are speci\214ed in inches.)97 574.2 R .251(If you don')5.251 F 2.751(tl)-.18 G(ik)-2.751 E 2.751(ei)-.1 G .251 (nches, it')-2.751 F 2.751(sp)-.55 G .251 (ossible to set a global style v)-2.751 F(ariable)-.25 E F1(scale)2.751 E F0 .314(that changes the unit.)72 586.2 R(Setting)5.314 E F1 .314 (scale = 2.54)2.814 F F0 .314(will ef)2.814 F(fecti)-.25 E -.15(ve)-.25 G .314(ly change the internal unit to centimeters \(all other).15 F (size v)72 598.2 Q(ariable v)-.25 E (aluess will be scaled correspondingly\).)-.25 E F1(4.1.)72 622.2 Q F0 (Here are the def)97 637.8 Q(ault sizes for)-.1 E F1(pic)2.5 E F0 (objects:)2.5 E EP %%Page: 5 5 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-5-)282.17 48 Q/F1 10/Times-Bold@0 SF 12.5 (Object Default)97 84 R(Size)2.5 E .08 LW 236.26 90.5 97 90.5 DL F0 26.38(box 0.75")97 102 R(wide by 0.5" high)2.5 E 19.17(circle 0.5")97 114 R(diameter)2.5 E 15.27(ellipse 0.75")97 126 R(wide by 0.5" high)2.5 E 29.17(arc 0.5")97 138 R(radius)2.5 E 26.38(line 0.5")97 150 R(long)2.5 E(arro)97 162 Q 20.81(w0)-.25 G(.5" long)-20.81 E 236.26 171.5 97 171.5 DL 133.38 72.5 133.38 171.5 DL .076(The simplest w)97 190.6 R .076 (ay to think about these def)-.1 F .076(aults is that the)-.1 F 2.575 (ym)-.15 G(ak)-2.575 E 2.575(et)-.1 G .075 (he other basic objects \214t snugly into)-2.575 F 2.5(ad)72 202.6 S(ef) -2.5 E(ault-sized box.)-.1 E F1 2.5(4.2. Objects)72 226.6 R(Do Not Str) 2.5 E(etch!)-.18 E F0 -1.25 -.7(Te x)97 242.2 T 2.711(ti).7 G 2.711(sr) -2.711 G .211(endered in the current font with normal trof)-2.711 F 2.711(fl)-.25 G .211(ine spacing.)-2.711 F(Box)5.211 E .211 (es, circles, and ellipses do)-.15 F/F2 10/Times-Italic@0 SF(not)2.712 E F0(automatically resize to \214t enclosed te)72 254.2 Q 2.5(xt. Thus,) -.15 F(if you say)2.5 E F1(box "text far too long")2.5 E F0(you')2.5 E (ll get this:)-.1 E 315 308.2 MT 0 -36 RL -54 0 RL 0 36 RL CL .4 LW ST (this te)208.6 292.4 Q(xt is f)-.15 E(ar too long for a def)-.1 E (ault box)-.1 E(Figure 4-1: Box)196.695 331.2 Q (es do not automatically resize)-.15 E(which is probably not the ef)97 358.8 Q(fect you w)-.25 E(ant.)-.1 E F1 2.5(4.3. Resizing)72 382.8 R (Boxes)2.5 E F0 1.6 -.8(To c)97 398.4 T(hange the box size, you can spe\ cify a box width with the "width" modi\214er:).8 E 396 452.4 MT 0 -36 RL -216 0 RL 0 36 RL CL ST(this te)208.6 436.6 Q(xt is f)-.15 E (ar too long for a def)-.1 E(ault box)-.1 E(Figure 4-2: Result of)219.94 475.4 Q F1(box width 3)2.5 E F0 .316(This modi\214er tak)97 503 R .316 (es a dimension in inches.)-.1 F .315 (There is also a "height" modi\214er that will change a box')5.315 F(s) -.55 E 2.5(height. The)72 515 R F1(width)2.5 E F0 -.1(ke)2.5 G(yw)-.05 E (ord may be abbre)-.1 E(viated to)-.25 E F1(ewid)2.5 E F0 2.5(;t)C(he) -2.5 E F1(height)2.5 E F0 -.1(ke)2.5 G(yw)-.05 E(ord to)-.1 E F1(height) 2.5 E F0(.)A F1 2.5(4.4. Resizing)72 539 R(Other Object T)2.5 E(ypes) -.74 E F0 2.083 -.8(To c)97 554.6 T .483(hange the size of a circle, gi) .8 F .783 -.15(ve i)-.25 H 2.983(ta).15 G F1(rad)A F0(or)2.983 E F1 (diam)2.983 E F0 .483 (modi\214er; this changes the radius or diameter of)2.983 F (the circle, according to the numeric ar)72 566.6 Q(gument that follo) -.18 E(ws.)-.25 E 223.2 606.2 7.2 DC ST(0.1)216.95 630 Q 266.4 606.2 14.4 DC ST(0.2)260.15 608.4 Q 338.4 606.2 21.6 DC ST(0.3)332.15 608.4 Q (Figure 4-3: Circles with increasing radii)207.87 650.8 Q(The)97 678.4 Q F1(mo)3.271 E -.1(ve)-.1 G F0 .771(command can also tak)3.371 F 3.271 (ead)-.1 G .771(imension, which just tells it ho)-3.271 F 3.27(wm)-.25 G (an)-3.27 E 3.27(yi)-.15 G .77(nches to mo)-3.27 F 1.07 -.15(ve i)-.15 H 3.27(nt).15 G(he)-3.27 E(current direction.)72 690.4 Q .848(Ellipses ar\ e sized to \214t in the rectangular box de\214ned by their ax)97 706 R .849(es, and can be resized with)-.15 F F1(width)3.349 E F0(and)72 718 Q F1(height)2.5 E F0(lik)2.5 E 2.5(eb)-.1 G(ox)-2.5 E(es.)-.15 E EP %%Page: 6 6 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-6-)282.17 48 Q -1.1(Yo)97 84 S 2.854(uc)1.1 G .353(an also change the radius of curv)-2.854 F .353 (ature of an arc with)-.25 F/F1 10/Times-Bold@0 SF(rad)2.853 E F0 .353 (\(which speci\214es the radius of the cir)2.853 F(-)-.2 E (cle of which the arc is a se)72 96 Q 2.5(gnmment\). Lar)-.15 F(ger v) -.18 E(alues yield \215atter arcs.)-.25 E .4 LW 241.2 128.4 7.2 90.0000 0.0000 DA(0.1)234.95 152.2 Q 277.2 121.2 14.4 90.0000 0.0000 DA(0.2) 270.95 152.2 Q 313.2 114 21.6 90.0000 0.0000 DA(0.3)306.95 152.2 Q (Figure 4-4:)206.435 173 Q F1(ar)2.5 E 2.5(cr)-.18 G(ad)-2.5 E F0 (with increasing radii)2.5 E(Observ)97 200.6 Q 2.666(et)-.15 G .166(hat\ because an arc is de\214ned as a quarter circle, increasing the radius\ also increases the size)-2.666 F(of the arc')72 212.6 Q 2.5(sb)-.55 G (ounding box.)-2.5 E F1 2.5(4.5. The)72 236.6 R(`same' K)2.5 E(eyw)-.25 E(ord)-.1 E F0 .231 (In place of a dimension speci\214cation, you can use the k)97 252.2 R -.15(ey)-.1 G -.1(wo).15 G(rd).1 E F1(same)2.731 E F0 5.231(.T)C .231 (his gi)-5.231 F -.15(ve)-.25 G 2.731(st).15 G .231(he object the same) -2.731 F(size as the pre)72 264.2 Q(vious one of its type.)-.25 E (As an e)5 E(xample, the program)-.15 E/F2 10/Courier@0 SF(.PS)108 282.2 Q(box; box wid 1 ht 1; box same; box)108 294.2 Q(.PE)108 306.2 Q F0(gi) 72 327.8 Q -.15(ve)-.25 G 2.5(sy).15 G(ou)-2.5 E 216 399.8 MT 0 -36 RL -54 0 RL 0 36 RL CL ST 288 417.8 MT 0 -72 RL -72 0 RL 0 72 RL CL ST 360 417.8 MT 0 -72 RL -72 0 RL 0 72 RL CL ST 414 399.8 MT 0 -36 RL -54 0 RL 0 36 RL CL ST(Figure 4-5: The)225.965 440.8 Q F1(same)2.5 E F0 -.1(ke) 2.5 G(yw)-.05 E(ord)-.1 E F1 2.5(5. Generalized)72 488.8 R (Lines and Splines)2.5 E 2.5(5.1. Diagonal)72 512.8 R(Lines)2.5 E F0 .466(It is possible to specify diagonal lines or arro)97 528.4 R .466 (ws by adding multiple)-.25 F F1(up)2.966 E F0(,)A F1(do)2.966 E(wn)-.1 E F0(,)A F1(left)2.966 E F0 2.966(,a)C(nd)-2.966 E F1(right)2.966 E F0 (modi-)2.966 E .374(\214ers to the line object.)72 540.4 R(An)5.374 E 2.874(yo)-.15 G 2.874(ft)-2.874 G .374(hese can ha)-2.874 F .674 -.15 (ve a m)-.2 H(ultiplier).15 E 5.374(.T)-.55 G 2.874(ou)-6.174 G .373 (nderstand the ef)-2.874 F .373(fects, think of the dra)-.25 F(wing)-.15 E(area as being gridded with standard-sized box)72 552.4 Q(es.)-.15 E 72 570.4 108 606.4 DL 72 570.4 MT 6.336 3.816 RL -2.52 2.52 RL CL BL 72 570.4 MT 6.336 3.816 RL -2.52 2.52 RL CL ST 72 606.4 72 606.4 DL 75.6 606.4 75.6 606.4 DL 79.2 606.4 79.2 606.4 DL 82.8 606.4 82.8 606.4 DL 86.4 606.4 86.4 606.4 DL 90 606.4 90 606.4 DL 93.6 606.4 93.6 606.4 DL 97.2 606.4 97.2 606.4 DL 100.8 606.4 100.8 606.4 DL 104.4 606.4 104.4 606.4 DL 108 606.4 108 606.4 DL 108 606.4 108 606.4 DL 108 602.8 108 602.8 DL 108 599.2 108 599.2 DL 108 595.6 108 595.6 DL 108 592 108 592 DL 108 588.4 108 588.4 DL 108 584.8 108 584.8 DL 108 581.2 108 581.2 DL 108 577.6 108 577.6 DL 108 574 108 574 DL 108 570.4 108 570.4 DL 108 570.4 108 570.4 DL 104.4 570.4 104.4 570.4 DL 100.8 570.4 100.8 570.4 DL 97.2 570.4 97.2 570.4 DL 93.6 570.4 93.6 570.4 DL 90 570.4 90 570.4 DL 86.4 570.4 86.4 570.4 DL 82.8 570.4 82.8 570.4 DL 79.2 570.4 79.2 570.4 DL 75.6 570.4 75.6 570.4 DL 72 570.4 72 570.4 DL 72 570.4 72 570.4 DL 72 574 72 574 DL 72 577.6 72 577.6 DL 72 581.2 72 581.2 DL 72 584.8 72 584.8 DL 72 588.4 72 588.4 DL 72 592 72 592 DL 72 595.6 72 595.6 DL 72 599.2 72 599.2 DL 72 602.8 72 602.8 DL 72 606.4 72 606.4 DL F1 (line up left)67.22 626.6 Q 144 570.4 216 606.4 DL 144 570.4 MT 7.272 1.584 RL -1.584 3.24 RL CL BL 144 570.4 MT 7.272 1.584 RL -1.584 3.24 RL CL ST 144 606.4 144 606.4 DL 147.6 606.4 147.6 606.4 DL 151.2 606.4 151.2 606.4 DL 154.8 606.4 154.8 606.4 DL 158.4 606.4 158.4 606.4 DL 162 606.4 162 606.4 DL 165.6 606.4 165.6 606.4 DL 169.2 606.4 169.2 606.4 DL 172.8 606.4 172.8 606.4 DL 176.4 606.4 176.4 606.4 DL 180 606.4 180 606.4 DL 180 606.4 180 606.4 DL 180 602.8 180 602.8 DL 180 599.2 180 599.2 DL 180 595.6 180 595.6 DL 180 592 180 592 DL 180 588.4 180 588.4 DL 180 584.8 180 584.8 DL 180 581.2 180 581.2 DL 180 577.6 180 577.6 DL 180 574 180 574 DL 180 570.4 180 570.4 DL 180 570.4 180 570.4 DL 176.4 570.4 176.4 570.4 DL 172.8 570.4 172.8 570.4 DL 169.2 570.4 169.2 570.4 DL 165.6 570.4 165.6 570.4 DL 162 570.4 162 570.4 DL 158.4 570.4 158.4 570.4 DL 154.8 570.4 154.8 570.4 DL 151.2 570.4 151.2 570.4 DL 147.6 570.4 147.6 570.4 DL 144 570.4 144 570.4 DL 144 570.4 144 570.4 DL 144 574 144 574 DL 144 577.6 144 577.6 DL 144 581.2 144 581.2 DL 144 584.8 144 584.8 DL 144 588.4 144 588.4 DL 144 592 144 592 DL 144 595.6 144 595.6 DL 144 599.2 144 599.2 DL 144 602.8 144 602.8 DL 144 606.4 144 606.4 DL 180 606.4 180 606.4 DL 183.6 606.4 183.6 606.4 DL 187.2 606.4 187.2 606.4 DL 190.8 606.4 190.8 606.4 DL 194.4 606.4 194.4 606.4 DL 198 606.4 198 606.4 DL 201.6 606.4 201.6 606.4 DL 205.2 606.4 205.2 606.4 DL 208.8 606.4 208.8 606.4 DL 212.4 606.4 212.4 606.4 DL 216 606.4 216 606.4 DL 216 606.4 216 606.4 DL 216 602.8 216 602.8 DL 216 599.2 216 599.2 DL 216 595.6 216 595.6 DL 216 592 216 592 DL 216 588.4 216 588.4 DL 216 584.8 216 584.8 DL 216 581.2 216 581.2 DL 216 577.6 216 577.6 DL 216 574 216 574 DL 216 570.4 216 570.4 DL 216 570.4 216 570.4 DL 212.4 570.4 212.4 570.4 DL 208.8 570.4 208.8 570.4 DL 205.2 570.4 205.2 570.4 DL 201.6 570.4 201.6 570.4 DL 198 570.4 198 570.4 DL 194.4 570.4 194.4 570.4 DL 190.8 570.4 190.8 570.4 DL 187.2 570.4 187.2 570.4 DL 183.6 570.4 183.6 570.4 DL 180 570.4 180 570.4 DL 180 570.4 180 570.4 DL 180 574 180 574 DL 180 577.6 180 577.6 DL 180 581.2 180 581.2 DL 180 584.8 180 584.8 DL 180 588.4 180 588.4 DL 180 592 180 592 DL 180 595.6 180 595.6 DL 180 599.2 180 599.2 DL 180 602.8 180 602.8 DL 180 606.4 180 606.4 DL(arr)148.34 626.6 Q .2 -.1(ow u)-.18 H 2.5(pl).1 G(eft 1)-2.5 E 252 570.4 360 606.4 DL 252 570.4 MT 7.416 .576 RL -1.152 3.384 RL CL BL 252 570.4 MT 7.416 .576 RL -1.152 3.384 RL CL ST 252 606.4 252 606.4 DL 255.6 606.4 255.6 606.4 DL 259.2 606.4 259.2 606.4 DL 262.8 606.4 262.8 606.4 DL 266.4 606.4 266.4 606.4 DL 270 606.4 270 606.4 DL 273.6 606.4 273.6 606.4 DL 277.2 606.4 277.2 606.4 DL 280.8 606.4 280.8 606.4 DL 284.4 606.4 284.4 606.4 DL 288 606.4 288 606.4 DL 288 606.4 288 606.4 DL 288 602.8 288 602.8 DL 288 599.2 288 599.2 DL 288 595.6 288 595.6 DL 288 592 288 592 DL 288 588.4 288 588.4 DL 288 584.8 288 584.8 DL 288 581.2 288 581.2 DL 288 577.6 288 577.6 DL 288 574 288 574 DL 288 570.4 288 570.4 DL 288 570.4 288 570.4 DL 284.4 570.4 284.4 570.4 DL 280.8 570.4 280.8 570.4 DL 277.2 570.4 277.2 570.4 DL 273.6 570.4 273.6 570.4 DL 270 570.4 270 570.4 DL 266.4 570.4 266.4 570.4 DL 262.8 570.4 262.8 570.4 DL 259.2 570.4 259.2 570.4 DL 255.6 570.4 255.6 570.4 DL 252 570.4 252 570.4 DL 252 570.4 252 570.4 DL 252 574 252 574 DL 252 577.6 252 577.6 DL 252 581.2 252 581.2 DL 252 584.8 252 584.8 DL 252 588.4 252 588.4 DL 252 592 252 592 DL 252 595.6 252 595.6 DL 252 599.2 252 599.2 DL 252 602.8 252 602.8 DL 252 606.4 252 606.4 DL 288 606.4 288 606.4 DL 291.6 606.4 291.6 606.4 DL 295.2 606.4 295.2 606.4 DL 298.8 606.4 298.8 606.4 DL 302.4 606.4 302.4 606.4 DL 306 606.4 306 606.4 DL 309.6 606.4 309.6 606.4 DL 313.2 606.4 313.2 606.4 DL 316.8 606.4 316.8 606.4 DL 320.4 606.4 320.4 606.4 DL 324 606.4 324 606.4 DL 324 606.4 324 606.4 DL 324 602.8 324 602.8 DL 324 599.2 324 599.2 DL 324 595.6 324 595.6 DL 324 592 324 592 DL 324 588.4 324 588.4 DL 324 584.8 324 584.8 DL 324 581.2 324 581.2 DL 324 577.6 324 577.6 DL 324 574 324 574 DL 324 570.4 324 570.4 DL 324 570.4 324 570.4 DL 320.4 570.4 320.4 570.4 DL 316.8 570.4 316.8 570.4 DL 313.2 570.4 313.2 570.4 DL 309.6 570.4 309.6 570.4 DL 306 570.4 306 570.4 DL 302.4 570.4 302.4 570.4 DL 298.8 570.4 298.8 570.4 DL 295.2 570.4 295.2 570.4 DL 291.6 570.4 291.6 570.4 DL 288 570.4 288 570.4 DL 288 570.4 288 570.4 DL 288 574 288 574 DL 288 577.6 288 577.6 DL 288 581.2 288 581.2 DL 288 584.8 288 584.8 DL 288 588.4 288 588.4 DL 288 592 288 592 DL 288 595.6 288 595.6 DL 288 599.2 288 599.2 DL 288 602.8 288 602.8 DL 288 606.4 288 606.4 DL 324 606.4 324 606.4 DL 327.6 606.4 327.6 606.4 DL 331.2 606.4 331.2 606.4 DL 334.8 606.4 334.8 606.4 DL 338.4 606.4 338.4 606.4 DL 342 606.4 342 606.4 DL 345.6 606.4 345.6 606.4 DL 349.2 606.4 349.2 606.4 DL 352.8 606.4 352.8 606.4 DL 356.4 606.4 356.4 606.4 DL 360 606.4 360 606.4 DL 360 606.4 360 606.4 DL 360 602.8 360 602.8 DL 360 599.2 360 599.2 DL 360 595.6 360 595.6 DL 360 592 360 592 DL 360 588.4 360 588.4 DL 360 584.8 360 584.8 DL 360 581.2 360 581.2 DL 360 577.6 360 577.6 DL 360 574 360 574 DL 360 570.4 360 570.4 DL 360 570.4 360 570.4 DL 356.4 570.4 356.4 570.4 DL 352.8 570.4 352.8 570.4 DL 349.2 570.4 349.2 570.4 DL 345.6 570.4 345.6 570.4 DL 342 570.4 342 570.4 DL 338.4 570.4 338.4 570.4 DL 334.8 570.4 334.8 570.4 DL 331.2 570.4 331.2 570.4 DL 327.6 570.4 327.6 570.4 DL 324 570.4 324 570.4 DL 324 570.4 324 570.4 DL 324 574 324 574 DL 324 577.6 324 577.6 DL 324 581.2 324 581.2 DL 324 584.8 324 584.8 DL 324 588.4 324 588.4 DL 324 592 324 592 DL 324 595.6 324 595.6 DL 324 599.2 324 599.2 DL 324 602.8 324 602.8 DL 324 606.4 324 606.4 DL(arr)270.59 626.6 Q .2 -.1(ow u)-.18 H 2.5(pl).1 G(eft 1.5)-2.5 E 396 570.4 540 606.4 DL 396 570.4 MT 7.416 0 RL -.864 3.528 RL CL BL 396 570.4 MT 7.416 0 RL -.864 3.528 RL CL ST 396 606.4 396 606.4 DL 399.6 606.4 399.6 606.4 DL 403.2 606.4 403.2 606.4 DL 406.8 606.4 406.8 606.4 DL 410.4 606.4 410.4 606.4 DL 414 606.4 414 606.4 DL 417.6 606.4 417.6 606.4 DL 421.2 606.4 421.2 606.4 DL 424.8 606.4 424.8 606.4 DL 428.4 606.4 428.4 606.4 DL 432 606.4 432 606.4 DL 432 606.4 432 606.4 DL 432 602.8 432 602.8 DL 432 599.2 432 599.2 DL 432 595.6 432 595.6 DL 432 592 432 592 DL 432 588.4 432 588.4 DL 432 584.8 432 584.8 DL 432 581.2 432 581.2 DL 432 577.6 432 577.6 DL 432 574 432 574 DL 432 570.4 432 570.4 DL 432 570.4 432 570.4 DL 428.4 570.4 428.4 570.4 DL 424.8 570.4 424.8 570.4 DL 421.2 570.4 421.2 570.4 DL 417.6 570.4 417.6 570.4 DL 414 570.4 414 570.4 DL 410.4 570.4 410.4 570.4 DL 406.8 570.4 406.8 570.4 DL 403.2 570.4 403.2 570.4 DL 399.6 570.4 399.6 570.4 DL 396 570.4 396 570.4 DL 396 570.4 396 570.4 DL 396 574 396 574 DL 396 577.6 396 577.6 DL 396 581.2 396 581.2 DL 396 584.8 396 584.8 DL 396 588.4 396 588.4 DL 396 592 396 592 DL 396 595.6 396 595.6 DL 396 599.2 396 599.2 DL 396 602.8 396 602.8 DL 396 606.4 396 606.4 DL 432 606.4 432 606.4 DL 435.6 606.4 435.6 606.4 DL 439.2 606.4 439.2 606.4 DL 442.8 606.4 442.8 606.4 DL 446.4 606.4 446.4 606.4 DL 450 606.4 450 606.4 DL 453.6 606.4 453.6 606.4 DL 457.2 606.4 457.2 606.4 DL 460.8 606.4 460.8 606.4 DL 464.4 606.4 464.4 606.4 DL 468 606.4 468 606.4 DL 468 606.4 468 606.4 DL 468 602.8 468 602.8 DL 468 599.2 468 599.2 DL 468 595.6 468 595.6 DL 468 592 468 592 DL 468 588.4 468 588.4 DL 468 584.8 468 584.8 DL 468 581.2 468 581.2 DL 468 577.6 468 577.6 DL 468 574 468 574 DL 468 570.4 468 570.4 DL 468 570.4 468 570.4 DL 464.4 570.4 464.4 570.4 DL 460.8 570.4 460.8 570.4 DL 457.2 570.4 457.2 570.4 DL 453.6 570.4 453.6 570.4 DL 450 570.4 450 570.4 DL 446.4 570.4 446.4 570.4 DL 442.8 570.4 442.8 570.4 DL 439.2 570.4 439.2 570.4 DL 435.6 570.4 435.6 570.4 DL 432 570.4 432 570.4 DL 432 570.4 432 570.4 DL 432 574 432 574 DL 432 577.6 432 577.6 DL 432 581.2 432 581.2 DL 432 584.8 432 584.8 DL 432 588.4 432 588.4 DL 432 592 432 592 DL 432 595.6 432 595.6 DL 432 599.2 432 599.2 DL 432 602.8 432 602.8 DL 432 606.4 432 606.4 DL 468 606.4 468 606.4 DL 471.6 606.4 471.6 606.4 DL 475.2 606.4 475.2 606.4 DL 478.8 606.4 478.8 606.4 DL 482.4 606.4 482.4 606.4 DL 486 606.4 486 606.4 DL 489.6 606.4 489.6 606.4 DL 493.2 606.4 493.2 606.4 DL 496.8 606.4 496.8 606.4 DL 500.4 606.4 500.4 606.4 DL 504 606.4 504 606.4 DL 504 606.4 504 606.4 DL 504 602.8 504 602.8 DL 504 599.2 504 599.2 DL 504 595.6 504 595.6 DL 504 592 504 592 DL 504 588.4 504 588.4 DL 504 584.8 504 584.8 DL 504 581.2 504 581.2 DL 504 577.6 504 577.6 DL 504 574 504 574 DL 504 570.4 504 570.4 DL 504 570.4 504 570.4 DL 500.4 570.4 500.4 570.4 DL 496.8 570.4 496.8 570.4 DL 493.2 570.4 493.2 570.4 DL 489.6 570.4 489.6 570.4 DL 486 570.4 486 570.4 DL 482.4 570.4 482.4 570.4 DL 478.8 570.4 478.8 570.4 DL 475.2 570.4 475.2 570.4 DL 471.6 570.4 471.6 570.4 DL 468 570.4 468 570.4 DL 468 570.4 468 570.4 DL 468 574 468 574 DL 468 577.6 468 577.6 DL 468 581.2 468 581.2 DL 468 584.8 468 584.8 DL 468 588.4 468 588.4 DL 468 592 468 592 DL 468 595.6 468 595.6 DL 468 599.2 468 599.2 DL 468 602.8 468 602.8 DL 468 606.4 468 606.4 DL 504 606.4 504 606.4 DL 507.6 606.4 507.6 606.4 DL 511.2 606.4 511.2 606.4 DL 514.8 606.4 514.8 606.4 DL 518.4 606.4 518.4 606.4 DL 522 606.4 522 606.4 DL 525.6 606.4 525.6 606.4 DL 529.2 606.4 529.2 606.4 DL 532.8 606.4 532.8 606.4 DL 536.4 606.4 536.4 606.4 DL 540 606.4 540 606.4 DL 540 606.4 540 606.4 DL 540 602.8 540 602.8 DL 540 599.2 540 599.2 DL 540 595.6 540 595.6 DL 540 592 540 592 DL 540 588.4 540 588.4 DL 540 584.8 540 584.8 DL 540 581.2 540 581.2 DL 540 577.6 540 577.6 DL 540 574 540 574 DL 540 570.4 540 570.4 DL 540 570.4 540 570.4 DL 536.4 570.4 536.4 570.4 DL 532.8 570.4 532.8 570.4 DL 529.2 570.4 529.2 570.4 DL 525.6 570.4 525.6 570.4 DL 522 570.4 522 570.4 DL 518.4 570.4 518.4 570.4 DL 514.8 570.4 514.8 570.4 DL 511.2 570.4 511.2 570.4 DL 507.6 570.4 507.6 570.4 DL 504 570.4 504 570.4 DL 504 570.4 504 570.4 DL 504 574 504 574 DL 504 577.6 504 577.6 DL 504 581.2 504 581.2 DL 504 584.8 504 584.8 DL 504 588.4 504 588.4 DL 504 592 504 592 DL 504 595.6 504 595.6 DL 504 599.2 504 599.2 DL 504 602.8 504 602.8 DL 504 606.4 504 606.4 DL(arr) 436.34 626.6 Q .2 -.1(ow u)-.18 H 2.5(pl).1 G(eft 2)-2.5 E F0 (Figure 5-1: Diagonal arro)138.76 647.4 Q(ws \(dotted box)-.25 E(es sho) -.15 E 2.5(wt)-.25 G(he implied 0.5-inch grid\))-2.5 E F1 2.5 (5.2. Multi-Segment)72 683.4 R(Line Objects)2.5 E F0 3.228(A")97 699 S .728(line" or "arro)-3.228 F .728 (w" object may actually be a path consisting of an)-.25 F 3.228(yn)-.15 G .729(umber of se)-3.228 F .729(gments of v)-.15 F(arying)-.25 E .104 (lengths and directions.)72 711 R 1.704 -.8(To d)5.104 H .104 (escribe a path, connect se).8 F -.15(ve)-.25 G .104(ral line or arro) .15 F 2.604(wc)-.25 G .103(ommands with the k)-2.604 F -.15(ey)-.1 G -.1 (wo).15 G(rd).1 E F1(then)2.603 E F0(.)A EP %%Page: 7 7 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-7-)282.17 48 Q .4 LW 324 84 252 84 DL 252 120 324 84 DL 324 120 252 120 DL(Figure 5-2:)174.3 143 Q/F1 10/Times-Bold@0 SF(line right 1 then do)2.5 E(wn .5 left 1 then right 1)-.1 E 2.5 (5.3. Spline)72 179 R(Objects)2.5 E F0 .31(If you start a path with the) 97 194.6 R F1(spline)2.81 E F0 -.1(ke)2.81 G(yw)-.05 E .311 (ord, the path v)-.1 F .311 (ertices are treated as control points for a spline)-.15 F(curv)72 206.6 Q 2.5<658c>-.15 G(t.)-2.5 E 190.8 224.6 MT 36 0 RL 24 0 24 6 0 18 RC -24 12 -24 18 0 18 RC 36 0 RL ST(The spline curv)189.8 277.2 Q(e...)-.15 E 309.6 224.6 306 224.6 DL 317.232 224.6 313.632 224.6 DL 324.792 224.6 321.192 224.6 DL 332.424 224.6 328.824 224.6 DL 339.984 224.6 336.384 224.6 DL 347.616 224.6 344.016 224.6 DL 355.176 224.6 351.576 224.6 DL 362.808 224.6 359.208 224.6 DL 370.368 224.6 366.768 224.6 DL 378 224.6 374.4 224.6 DL 374.76 226.184 378 224.6 DL 368.496 229.28 371.736 227.696 DL 362.232 232.448 365.472 230.864 DL 355.968 235.544 359.208 233.96 DL 349.776 238.712 353.016 237.128 DL 343.512 241.808 346.752 240.224 DL 337.248 244.976 340.488 243.392 DL 330.984 248.072 334.224 246.488 DL 324.72 251.168 327.96 249.584 DL 318.456 254.336 321.696 252.752 DL 312.264 257.432 315.504 255.848 DL 306 260.6 309.24 259.016 DL 309.6 260.6 306 260.6 DL 317.232 260.6 313.632 260.6 DL 324.792 260.6 321.192 260.6 DL 332.424 260.6 328.824 260.6 DL 339.984 260.6 336.384 260.6 DL 347.616 260.6 344.016 260.6 DL 355.176 260.6 351.576 260.6 DL 362.808 260.6 359.208 260.6 DL 370.368 260.6 366.768 260.6 DL 378 260.6 374.4 260.6 DL 306 224.6 MT 36 0 RL 24 0 24 6 0 18 RC -24 12 -24 18 0 18 RC 36 0 RL ST(1)296.3 226.8 Q(2)382.7 226.8 Q(3)296.3 262.8 Q(4)382.7 262.8 Q(...with tangents displayed)291.03 277.2 Q(Figure 5-3:)169.575 298 Q F1(spline right 1 then do)2.5 E(wn .5 left 1 then right 1)-.1 E F0 -1.1(Yo)97 325.6 S 2.5(uc)1.1 G(an describe man)-2.5 E 2.5(yn)-.15 G (atural-looking b)-2.5 E(ut irre)-.2 E(gular curv)-.15 E(es this w)-.15 E(ay)-.1 E 2.5(.F)-.65 G(or e)-2.65 E(xample:)-.15 E 156.384 375.136 MT 18 0 RL 12 0 18 -6 18 -18 RC 0 -12 -6 -18 -18 -18 RC -12 0 -18 6 -18 18 RC 0 18 RL ST 156.384 375.136 MT -1.8 -7.2 RL 3.6 0 RL CL BL 156.384 375.136 MT -1.8 -7.2 RL 3.6 0 RL CL ST F1 (spline right then up then left then do)80.457 391.664 Q(wn ->;)-.1 E (spline left then up right then do)295.347 391.664 Q(wn right ->;)-.1 E 383.616 375.136 MT -18 0 RL -12 0 -12 -6 0 -18 RC 12 -12 24 -12 36 0 RC 18 18 RL ST 419.616 375.136 MT -6.336 -3.816 RL 2.52 -2.52 RL CL BL 419.616 375.136 MT -6.336 -3.816 RL 2.52 -2.52 RL CL ST F0 (Figure 5-4: T)210.895 412.464 Q .2 -.1(wo m)-.8 H(ore spline e).1 E (xamples)-.15 E .97(Note the arro)97 440.064 R 3.47(wd)-.25 G 3.47 (ecorations. Arro)-3.47 F .97(wheads can be applied naturally to an)-.25 F 3.47(yp)-.15 G .97(ath-based object, line or)-3.47 F 2.5(spline. W)72 452.064 R(e')-.8 E(ll see ho)-.1 E 2.5(wi)-.25 G 2.5(nt)-2.5 G(he ne) -2.5 E(xt section.)-.15 E F1 2.5(6. Decorating)72 476.064 R(Objects.)2.5 E 2.5(6.1. Dashed)72 500.064 R(Objects)2.5 E F0 -.8(We)97 515.664 S -1.65 -.5('v e).8 H 1.399(already seen that the modi\214er)4.399 F F1 (dashed)3.899 E F0 1.4 (can change the line style of an object from solid to)3.899 F 3.755 (dashed. GNU)72 527.664 R F1(gpic)3.755 E F0 1.254(permits you to dot o\ r dash ellipses, circles, and arcs \(and splines in)3.755 F/F2 10 /Symbol-Slanted SF(t)3.754 E F0 3.754(xm)C 1.254(ode only\);)-3.754 F .312(some v)72 539.664 R .312(ersions of D)-.15 F .312 (WB may only permit dashing of lines and box)-.3 F 2.812(es. It')-.15 F 2.812(sp)-.55 G .313(ossible to change the dash inter)-2.812 F(-)-.2 E -.25(va)72 551.664 S 2.5(lb).25 G 2.5(ys)-2.5 G (pecifying a number after the modi\214er)-2.5 E(.)-.55 E 84.6 609.264 81 609.264 DL 91.8 609.264 88.2 609.264 DL 99 609.264 95.4 609.264 DL 106.2 609.264 102.6 609.264 DL 113.4 609.264 109.8 609.264 DL 120.6 609.264 117 609.264 DL 127.8 609.264 124.2 609.264 DL 135 609.264 131.4 609.264 DL 135 605.664 135 609.264 DL 135 599.184 135 602.784 DL 135 592.704 135 596.304 DL 135 586.224 135 589.824 DL 135 579.744 135 583.344 DL 135 573.264 135 576.864 DL 131.4 573.264 135 573.264 DL 124.2 573.264 127.8 573.264 DL 117 573.264 120.6 573.264 DL 109.8 573.264 113.4 573.264 DL 102.6 573.264 106.2 573.264 DL 95.4 573.264 99 573.264 DL 88.2 573.264 91.8 573.264 DL 81 573.264 84.6 573.264 DL 81 576.864 81 573.264 DL 81 583.344 81 579.744 DL 81 589.824 81 586.224 DL 81 596.304 81 592.704 DL 81 602.784 81 599.184 DL 81 609.264 81 605.664 DL(def)94.165 593.464 Q (ault)-.1 E 174.6 609.264 171 609.264 DL 181.8 609.264 178.2 609.264 DL 189 609.264 185.4 609.264 DL 196.2 609.264 192.6 609.264 DL 203.4 609.264 199.8 609.264 DL 210.6 609.264 207 609.264 DL 217.8 609.264 214.2 609.264 DL 225 609.264 221.4 609.264 DL 225 605.664 225 609.264 DL 225 599.184 225 602.784 DL 225 592.704 225 596.304 DL 225 586.224 225 589.824 DL 225 579.744 225 583.344 DL 225 573.264 225 576.864 DL 221.4 573.264 225 573.264 DL 214.2 573.264 217.8 573.264 DL 207 573.264 210.6 573.264 DL 199.8 573.264 203.4 573.264 DL 192.6 573.264 196.2 573.264 DL 185.4 573.264 189 573.264 DL 178.2 573.264 181.8 573.264 DL 171 573.264 174.6 573.264 DL 171 576.864 171 573.264 DL 171 583.344 171 579.744 DL 171 589.824 171 586.224 DL 171 596.304 171 592.704 DL 171 602.784 171 599.184 DL 171 609.264 171 605.664 DL(0.05)189.25 593.464 Q 268.2 609.264 261 609.264 DL 283.824 609.264 276.624 609.264 DL 299.376 609.264 292.176 609.264 DL 315 609.264 307.8 609.264 DL 315 602.064 315 609.264 DL 315 587.664 315 594.864 DL 315 573.264 315 580.464 DL 307.8 573.264 315 573.264 DL 292.176 573.264 299.376 573.264 DL 276.624 573.264 283.824 573.264 DL 261 573.264 268.2 573.264 DL 261 580.464 261 573.264 DL 261 594.864 261 587.664 DL 261 609.264 261 602.064 DL(0.1) 281.75 593.464 Q 361.8 609.264 351 609.264 DL 383.4 609.264 372.6 609.264 DL 405 609.264 394.2 609.264 DL 405 598.464 405 609.264 DL 405 573.264 405 584.064 DL 394.2 573.264 405 573.264 DL 372.6 573.264 383.4 573.264 DL 351 573.264 361.8 573.264 DL 351 584.064 351 573.264 DL 351 609.264 351 598.464 DL(0.15)369.25 593.464 Q 455.4 609.264 441 609.264 DL 495 609.264 480.6 609.264 DL 495 594.864 495 609.264 DL 495 573.264 495 587.664 DL 480.6 573.264 495 573.264 DL 441 573.264 455.4 573.264 DL 441 587.664 441 573.264 DL 441 609.264 441 594.864 DL(0.2)461.75 593.464 Q(Figure 6-1: Dashed objects)233.98 632.264 Q F1 2.5(6.2. Dotted)72 668.264 R(Objects)2.5 E F0 .192(Another a)97 683.864 R -.25(va)-.2 G .192(ilable quali\214er is).25 F F1(dotted)2.692 E F0 5.191(.G)C(NU) -5.191 E F1(gpic)2.691 E F0 .191 (permits you to dot or dash ellipses, circles, and arcs)2.691 F .502 (\(and splines in)72 695.864 R F2(t)3.002 E F0 3.002(xm)C .502 (ode only\); some v)-3.002 F .503(ersions of D)-.15 F .503 (WB may only permit dashing of lines and box)-.3 F 3.003(es. It)-.15 F (too)3.003 E(can be suf)72 707.864 Q<8c78>-.25 E (ed with a number to specify the interv)-.15 E(al between dots:)-.25 E EP %%Page: 8 8 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-8-)282.17 48 Q .4 LW 81 120 81 120 DL 84.6 120 84.6 120 DL 88.2 120 88.2 120 DL 91.8 120 91.8 120 DL 95.4 120 95.4 120 DL 99 120 99 120 DL 102.6 120 102.6 120 DL 106.2 120 106.2 120 DL 109.8 120 109.8 120 DL 113.4 120 113.4 120 DL 117 120 117 120 DL 120.6 120 120.6 120 DL 124.2 120 124.2 120 DL 127.8 120 127.8 120 DL 131.4 120 131.4 120 DL 135 120 135 120 DL 135 120 135 120 DL 135 116.4 135 116.4 DL 135 112.8 135 112.8 DL 135 109.2 135 109.2 DL 135 105.6 135 105.6 DL 135 102 135 102 DL 135 98.4 135 98.4 DL 135 94.8 135 94.8 DL 135 91.2 135 91.2 DL 135 87.6 135 87.6 DL 135 84 135 84 DL 135 84 135 84 DL 131.4 84 131.4 84 DL 127.8 84 127.8 84 DL 124.2 84 124.2 84 DL 120.6 84 120.6 84 DL 117 84 117 84 DL 113.4 84 113.4 84 DL 109.8 84 109.8 84 DL 106.2 84 106.2 84 DL 102.6 84 102.6 84 DL 99 84 99 84 DL 95.4 84 95.4 84 DL 91.8 84 91.8 84 DL 88.2 84 88.2 84 DL 84.6 84 84.6 84 DL 81 84 81 84 DL 81 84 81 84 DL 81 87.6 81 87.6 DL 81 91.2 81 91.2 DL 81 94.8 81 94.8 DL 81 98.4 81 98.4 DL 81 102 81 102 DL 81 105.6 81 105.6 DL 81 109.2 81 109.2 DL 81 112.8 81 112.8 DL 81 116.4 81 116.4 DL 81 120 81 120 DL(def) 94.165 104.2 Q(ault)-.1 E 171 120 171 120 DL 174.6 120 174.6 120 DL 178.2 120 178.2 120 DL 181.8 120 181.8 120 DL 185.4 120 185.4 120 DL 189 120 189 120 DL 192.6 120 192.6 120 DL 196.2 120 196.2 120 DL 199.8 120 199.8 120 DL 203.4 120 203.4 120 DL 207 120 207 120 DL 210.6 120 210.6 120 DL 214.2 120 214.2 120 DL 217.8 120 217.8 120 DL 221.4 120 221.4 120 DL 225 120 225 120 DL 225 120 225 120 DL 225 116.4 225 116.4 DL 225 112.8 225 112.8 DL 225 109.2 225 109.2 DL 225 105.6 225 105.6 DL 225 102 225 102 DL 225 98.4 225 98.4 DL 225 94.8 225 94.8 DL 225 91.2 225 91.2 DL 225 87.6 225 87.6 DL 225 84 225 84 DL 225 84 225 84 DL 221.4 84 221.4 84 DL 217.8 84 217.8 84 DL 214.2 84 214.2 84 DL 210.6 84 210.6 84 DL 207 84 207 84 DL 203.4 84 203.4 84 DL 199.8 84 199.8 84 DL 196.2 84 196.2 84 DL 192.6 84 192.6 84 DL 189 84 189 84 DL 185.4 84 185.4 84 DL 181.8 84 181.8 84 DL 178.2 84 178.2 84 DL 174.6 84 174.6 84 DL 171 84 171 84 DL 171 84 171 84 DL 171 87.6 171 87.6 DL 171 91.2 171 91.2 DL 171 94.8 171 94.8 DL 171 98.4 171 98.4 DL 171 102 171 102 DL 171 105.6 171 105.6 DL 171 109.2 171 109.2 DL 171 112.8 171 112.8 DL 171 116.4 171 116.4 DL 171 120 171 120 DL(0.05)189.25 104.2 Q 261 120 261 120 DL 267.768 120 267.768 120 DL 274.536 120 274.536 120 DL 281.232 120 281.232 120 DL 288 120 288 120 DL 294.768 120 294.768 120 DL 301.536 120 301.536 120 DL 308.232 120 308.232 120 DL 315 120 315 120 DL 315 120 315 120 DL 315 112.8 315 112.8 DL 315 105.6 315 105.6 DL 315 98.4 315 98.4 DL 315 91.2 315 91.2 DL 315 84 315 84 DL 315 84 315 84 DL 308.232 84 308.232 84 DL 301.536 84 301.536 84 DL 294.768 84 294.768 84 DL 288 84 288 84 DL 281.232 84 281.232 84 DL 274.536 84 274.536 84 DL 267.768 84 267.768 84 DL 261 84 261 84 DL 261 84 261 84 DL 261 91.2 261 91.2 DL 261 98.4 261 98.4 DL 261 105.6 261 105.6 DL 261 112.8 261 112.8 DL 261 120 261 120 DL (0.1)281.75 104.2 Q 351 120 351 120 DL 361.8 120 361.8 120 DL 372.6 120 372.6 120 DL 383.4 120 383.4 120 DL 394.2 120 394.2 120 DL 405 120 405 120 DL 405 120 405 120 DL 405 107.976 405 107.976 DL 405 96.024 405 96.024 DL 405 84 405 84 DL 405 84 405 84 DL 394.2 84 394.2 84 DL 383.4 84 383.4 84 DL 372.6 84 372.6 84 DL 361.8 84 361.8 84 DL 351 84 351 84 DL 351 84 351 84 DL 351 96.024 351 96.024 DL 351 107.976 351 107.976 DL 351 120 351 120 DL(0.15)369.25 104.2 Q 441 120 441 120 DL 454.536 120 454.536 120 DL 468 120 468 120 DL 481.536 120 481.536 120 DL 495 120 495 120 DL 495 120 495 120 DL 495 107.976 495 107.976 DL 495 96.024 495 96.024 DL 495 84 495 84 DL 495 84 495 84 DL 481.536 84 481.536 84 DL 468 84 468 84 DL 454.536 84 454.536 84 DL 441 84 441 84 DL 441 84 441 84 DL 441 96.024 441 96.024 DL 441 107.976 441 107.976 DL 441 120 441 120 DL (0.2)461.75 104.2 Q(Figure 6-2: Dotted objects)235.365 143 Q/F1 10 /Times-Bold@0 SF 2.5(6.3. Rounding)72 179 R(Box Cor)2.5 E(ners)-.15 E F0 (It is also possible, in GNU)97 194.6 Q F1(gpic)2.5 E F0(only)2.5 E 2.5 (,t)-.65 G 2.5(om)-2.5 G(odify a box so it has rounded corners)-2.5 E 84.6 245 3.6 -180.0000 90.0000 DA 84.6 216.2 3.6 -90.0000 180.0000 DA 131.4 216.2 3.6 -0.0000 -90.0000 DA 131.4 245 3.6 90.0000 0.0000 DA 81 216.2 81 245 DL 131.4 212.6 84.6 212.6 DL 135 245 135 216.2 DL 84.6 248.6 131.4 248.6 DL(rad 0.05)91.615 232.8 Q 178.2 241.4 7.2 -180.0000 90.0000 DA 178.2 219.8 7.2 -90.0000 180.0000 DA 217.8 219.8 7.2 -0.0000 -90.0000 DA 217.8 241.4 7.2 90.0000 0.0000 DA 171 219.8 171 241.4 DL 217.8 212.6 178.2 212.6 DL 225 241.4 225 219.8 DL 178.2 248.6 217.8 248.6 DL(rad 0.1)184.115 232.8 Q 271.8 237.8 10.8 -180.0000 90.0000 DA 271.8 223.4 10.8 -90.0000 180.0000 DA 304.2 223.4 10.8 -0.0000 -90.0000 DA 304.2 237.8 10.8 90.0000 0.0000 DA 261 223.4 261 237.8 DL 304.2 212.6 271.8 212.6 DL 315 237.8 315 223.4 DL 271.8 248.6 304.2 248.6 DL (rad=0.15)270.045 232.8 Q 365.4 234.2 14.4 -180.0000 90.0000 DA 365.4 227 14.4 -90.0000 180.0000 DA 390.6 227 14.4 -0.0000 -90.0000 DA 390.6 234.2 14.4 90.0000 0.0000 DA 351 227 351 234.2 DL 390.6 212.6 365.4 212.6 DL 405 234.2 405 227 DL 365.4 248.6 390.6 248.6 DL(rad=0.2)362.545 232.8 Q 459 230.6 18 -180.0000 90.0000 DA 459 230.6 18 -90.0000 180.0000 DA 477 230.6 18 -0.0000 -90.0000 DA 477 230.6 18 90.0000 0.0000 DA 441 230.6 441 230.6 DL 477 212.6 459 212.6 DL 495 230.6 495 230.6 DL 459 248.6 477 248.6 DL(rad=0.25)450.045 232.8 Q(Figure 6-3:)187.16 271.6 Q F1(box rad)2.5 E F0(with increasing radius v)2.5 E(alues;)-.25 E (Radius v)97 299.2 Q(alues higher than half the minimum box dimension a\ re silently truncated to that v)-.25 E(alue.)-.25 E F1 2.5(6.4. Arr)72 323.2 R -.1(ow)-.18 G(heads).1 E F0 .757 (Lines and arcs can be decorated as well.)97 338.8 R(An)5.756 E 3.256 (yl)-.15 G .756(ine or arc \(and an)-3.256 F 3.256(ys)-.15 G .756 (pline as well\) can be decorated)-3.256 F(with arro)72 350.8 Q (wheads by adding one or more as modi\214ers:)-.25 E 306 368.8 270 368.8 DL 270 368.8 MT 7.2 -1.8 RL 0 3.6 RL CL BL 270 368.8 MT 7.2 -1.8 RL 0 3.6 RL CL ST 306 368.8 MT -7.2 1.8 RL 0 -3.6 RL CL BL 306 368.8 MT -7.2 1.8 RL 0 -3.6 RL CL ST(Figure 6-4: Double-headed line made with)181.065 391.8 Q F1(line <- ->)5 E F0 .631(In f)97 419.4 R .631(act, the)-.1 F F1 (arr)3.131 E -.1(ow)-.18 G F0 .632(command is just shorthand for)3.231 F F1 .632(line ->)3.132 F F0 5.632(.A)C .632 (nd there is a double-head modi\214er <->,)-5.632 F(so the \214gure abo) 72 431.4 Q .3 -.15(ve c)-.15 H(ould ha).15 E .3 -.15(ve b)-.2 H (een made with).15 E/F2 10/Courier@0 SF(Wline <->)2.5 E F0(.)A(Arro)97 447 Q .505(wheads ha)-.25 F .805 -.15(ve a)-.2 H F1(width)3.155 E F0 (attrib)3.005 E .505(ute, the distance across the rear; and a)-.2 F F1 (height)3.005 E F0(attrib)3.005 E .505(ute, the length of)-.2 F (the arro)72 459 Q(whead along the shaft.)-.25 E(Arro)97 474.6 Q .528 (whead style is controlled by the style v)-.25 F(ariable)-.25 E F1(arr) 3.028 E -.1(ow)-.18 G(head).1 E F0 5.528(.T)C .528(he D)-5.528 F .528 (WB and GNU v)-.3 F .528(ersions inter)-.15 F(-)-.2 E .798(pret it dif) 72 486.6 R(ferently)-.25 E 5.798(.D)-.65 G .798(WB def)-6.098 F .798 (aults to open arro)-.1 F .798(wheads and an)-.25 F F1(arr)3.297 E -.1 (ow)-.18 G(head).1 E F0 -.25(va)3.297 G .797(lue of 2; the K).25 F .797 (ernighan paper)-.25 F .668(says a v)72 498.6 R .668(alue of 7 will mak) -.25 F 3.168(es)-.1 G .668(olid arro)-3.168 F 3.168(wheads. GNU)-.25 F F1(gpic)3.168 E F0(def)3.168 E .668(aults to solid arro)-.1 F .669 (wheads and an)-.25 F F1(arr)3.169 E -.1(ow)-.18 G(head).1 E F0 -.25(va) 72 510.6 S(lue of 1; a v).25 E(alue of 0 will produce open arro)-.25 E (wheads.)-.25 E F1 2.5(6.5. Line)72 534.6 R(Thickness)2.5 E F0(It')97 550.2 Q 2.572(sa)-.55 G .071(lso possible to change the line thickness \ of an object \(this is a GNU e)-2.572 F .071(xtension, D)-.15 F(WB)-.3 E F1(pic)2.571 E F0(doesn')2.571 E(t)-.18 E .46(support it.\).)72 562.2 R .46(The def)5.46 F .46(ault thickness of the lines used to dra)-.1 F 2.96(wo)-.15 G .46(bjects is controlled by the)-2.96 F F1(linethick)2.96 E F0 -.25(va)2.96 G(riable.).25 E .65(This gi)72 574.2 R -.15(ve)-.25 G 3.15(st).15 G .65(he thickness of lines in points.)-3.15 F 3.149(An)5.65 G -2.25 -.15(eg a)-3.149 H(ti).15 E .949 -.15(ve v)-.25 H .649 (alue means use the def)-.1 F .649(ault thickness: in)-.1 F/F3 10 /Symbol-Slanted SF(t)3.149 E F0 3.149(xo)C(utput)-3.149 E .294 (mode, this means use a thickness of 8 milliinches; in)72 586.2 R F3(t) 2.794 E F0 2.794(xo)C .294(utput mode with the)-2.794 F F1(-c)2.794 E F0 .294(option, this means use the)2.794 F 1.065 (line thickness speci\214ed by)72 598.2 R F1(.ps)3.565 E F0 1.065 (lines; in trof)3.565 F 3.565(fo)-.25 G 1.064 (utput mode, this means use a thickness proportional to the)-3.565 F 3.293(pointsize. A)72 610.2 R .793(zero v)3.293 F .793(alue means dra) -.25 F 3.293(wt)-.15 G .793 (he thinnest possible line supported by the output de)-3.293 F 3.294 (vice. Initially)-.25 F(it)3.294 E .036(has a v)72 622.2 R .036 (alue of -1.)-.25 F .036(There is also a)5.036 F F1(thickness)2.536 E F0 (attrib)2.536 E .036(ute \(which can be abbre)-.2 F .036(viated to)-.25 F F1(thick)2.535 E F0 2.535(\). F)B .035(or e)-.15 F(xample,)-.15 E F1 (cir)2.535 E(-)-.37 E .475(cle thickness 1.5)72 634.2 R F0 -.1(wo)2.975 G .475(uld dra).1 F 2.975(wac)-.15 G .476 (ircle using a line with a thickness of 1.5 points.)-2.975 F .476 (The thickness of lines is)5.476 F(not af)72 646.2 Q(fected by the v) -.25 E(alue of the)-.25 E F1(scale)2.5 E F0 -.25(va)2.5 G (riable, nor by an).25 E 2.5(yw)-.15 G(idth or height gi)-2.5 E -.15(ve) -.25 G 2.5(ni).15 G 2.5(nt)-2.5 G(he)-2.5 E F1(.PS)2.5 E F0(line.)2.5 E F1 2.5(6.6. In)72 670.2 R(visible Objects)-.4 E F0 .001(The modi\214er) 97 685.8 R F1(in)2.501 E(vis)-.4 E F0(mak)2.501 E .001 (es an object entirely in)-.1 F 2.501(visible. This)-.4 F 0 (used to be useful for positioning te)2.501 F(xt in an)-.15 E(in)72 697.8 Q .301 (visible object that is properly joined to neighboring ones.)-.4 F(Ne) 5.301 E .301(wer D)-.25 F .301(WB v)-.3 F .301(ersions and GNU)-.15 F F1 (pic)2.802 E F0 .302(treat stan-)2.802 F(dalone te)72 709.8 Q(xt in e) -.15 E(xactly this w)-.15 E(ay)-.1 E(.)-.65 E EP %%Page: 9 9 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-9-)282.17 48 Q/F1 10/Times-Bold@0 SF 2.5 (6.7. Filled)72 84 R(Objects)2.5 E F0 .17(It is possible to \214ll box) 97 99.6 R .17(es, circles, and ellipses.)-.15 F .17(The modi\214er)5.17 F F1(\214ll[ed])2.67 E F0 .17(accomplishes this.)2.67 F -1.1(Yo)5.17 G 2.67(uc)1.1 G .17(an suf-)-2.67 F(\214x it with a \214ll v)72 111.6 Q (alue; the def)-.25 E(ault is gi)-.1 E -.15(ve)-.25 G 2.5(nb).15 G 2.5 (yt)-2.5 G(he stule v)-2.5 E(ariable)-.25 E F1(\214llv)2.5 E(al)-.1 E F0 (.)A -.3(DW)97 127.2 S(B).3 E F1(pic)4.191 E F0(and)4.191 E F1(gpic) 4.191 E F0(ha)4.191 E 1.991 -.15(ve o)-.2 H 1.691(pposite con).15 F -.15 (ve)-.4 G 1.691(ntions for \214ll v).15 F 1.692(alues and dif)-.25 F 1.692(ferent def)-.25 F 4.192(aults. D)-.1 F(WB)-.3 E F1(\214llv)4.192 E (al)-.1 E F0(def)72 139.2 Q(aults to 0.3 and smaller v)-.1 E (alues are dark)-.25 E(er; GNU)-.1 E F1(\214llv)2.5 E(al)-.1 E F0 (uses 0 for white and 1 for black.)2.5 E 216 175.2 18 DC 0.5000 FL 216 175.2 18 DC .4 LW ST 288 175.2 18 DC 0.6000 FL 288 175.2 18 DC ST 360 175.2 18 DC 0.8000 FL 360 175.2 18 DC ST(Figure 6-5:)158.355 216.2 Q F1 (cir)2.5 E(cle \214ll; mo)-.18 E -.1(ve)-.1 G 2.5(;c).1 G(ir)-2.5 E (cle \214ll 0.4; mo)-.18 E -.1(ve)-.1 G 2.5(;c).1 G(ir)-2.5 E (cle \214ll 0.9;)-.18 E F0(GNU)97 243.8 Q F1(gpic)2.528 E F0(mak)2.528 E .028(es some additional guarantees.)-.1 F 2.528<418c>5.028 G .028(ll v) -2.528 F .027(alue greater than 1 can also be used: this means)-.25 F .716(\214ll with the shade of gray that is currently being used for te) 72 255.8 R .717(xt and lines.)-.15 F .717 (Normally this will be black, b)5.717 F(ut)-.2 E .519(output de)72 267.8 R .519(vices may pro)-.25 F .519(vide a mechanism for changing this.) -.15 F .519(The in)5.519 F .519(visible attrib)-.4 F .518 (ute does not af)-.2 F .518(fect the \214ll-)-.25 F .215 (ing of objects.)72 279.8 R(An)5.215 E 2.715(yt)-.15 G -.15(ex)-2.715 G 2.715(ta).15 G .215(ssociated with a \214lled object will be added afte\ r the object has been \214lled, so that)-2.715 F(the te)72 291.8 Q (xt will not be obscured by the \214lling.)-.15 E 1.135 (The closed-object modi\214er)97 307.4 R F1(solid)3.635 E F0 1.135 (is equi)3.635 F -.25(va)-.25 G 1.135(lent to).25 F F1(\214ll)3.635 E F0 1.135(with the dark)3.635 F 1.135(est \214ll v)-.1 F 1.135(alue \(D)-.25 F(WB)-.3 E F1(pic)3.635 E F0 1.135(had this)3.635 F(capability b)72 319.4 Q(ut mentioned it only in a reference opinion\).)-.2 E F1 2.5 (7. Mor)72 343.4 R 2.5(eA)-.18 G(bout T)-2.5 E(ext Placement)-.92 E F0 .757(By def)97 359 R .757(ault, te)-.1 F .757(xt is centered at the geo\ metric center of the object it is associated with.)-.15 F .758 (The modi\214er)5.757 F F1(ljust)72 371 Q F0 .302(causes the left end t\ o be at the speci\214ed point \(which means that the te)2.803 F .302 (xt lies to the right of the speci-)-.15 F .548 (\214ed place!\), The modi\214er)72 383 R F1(rjust)3.048 E F0 .548 (puts the right end at the place.)3.048 F .549(The modi\214ers)5.548 F F1(abo)3.049 E -.1(ve)-.1 G F0(and)3.149 E F1(belo)3.049 E(w)-.1 E F0 .549(center the)3.049 F(te)72 395 Q(xt one half line space in the gi) -.15 E -.15(ve)-.25 G 2.5(nd).15 G(irection.)-2.5 E -1.25 -.7(Te x)97 410.6 T 2.5(ta).7 G(ttrib)-2.5 E(utes can be combined:)-.2 E 126 428.6 126 464.6 DL(ljust te)126 448.8 Q(xt)-.15 E 234 428.6 234 464.6 DL (rjust te)198.87 448.8 Q(xt)-.15 E 342 446.6 270 446.6 DL 342 446.6 MT -7.2 1.8 RL 0 -3.6 RL CL BL 342 446.6 MT -7.2 1.8 RL 0 -3.6 RL CL ST (ljust abo)306 442.8 Q -.15(ve)-.15 G 450 446.6 378 446.6 DL 450 446.6 MT -7.2 1.8 RL 0 -3.6 RL CL BL 450 446.6 MT -7.2 1.8 RL 0 -3.6 RL CL ST (rjust belo)369.53 454.8 Q(w)-.25 E(Figure 7-1: T)235.89 487.6 Q -.15 (ex)-.7 G 2.5(ta).15 G(ttrib)-2.5 E(utes)-.2 E .205 (What actually happens is that n te)97 515.2 R .204 (xt strings are centered in a box that is)-.15 F F1(textwid)2.704 E F0 .204(wide by)2.704 F F1(textht)2.704 E F0(high.)2.704 E 1.774 (Both these v)72 527.2 R 1.774(ariables are initially zero \(that is) -.25 F F1(pic)4.274 E F0 2.874 -.55('s w)D 1.774 (ay of not making assumptions about).45 F/F2 10/Times-Italic@0 SF([tg]r) 4.274 E(of)-.45 E(f)-.18 E F0(\(1\)')A(s)-.55 E(def)72 539.2 Q (ault point size\).)-.1 E .637(In GNU)97 554.8 R F1(gpic)3.137 E F0 3.137(,o)C .637(bjects can ha)-3.137 F .937 -.15(ve a)-.2 H(n).15 E F1 (aligned)3.137 E F0(attrib)3.137 E 3.137(ute. This)-.2 F .637 (will only w)3.137 F .637(ork when the postprocessor is)-.1 F F1(gr)72 566.8 Q(ops)-.18 E F0 5.744(.A)C 1.044 -.15(ny t)-5.744 H -.15(ex).15 G 3.244(ta).15 G .744(ssociated with an object ha)-3.244 F .744(ving the) -.2 F F1(aligned)3.244 E F0(attrib)3.244 E .744 (ute will be rotated about the center of)-.2 F .471(the object so that \ it is aligned in the direction from the start point to the end point of\ the object.)72 578.8 R .47(Note that)5.47 F(this attrib)72 590.8 Q (ute will ha)-.2 E .3 -.15(ve n)-.2 H 2.5(oe).15 G -.25(ff)-2.5 G (ect for objects whose start and end points are coincident.).25 E F1 2.5 (8. Mor)72 614.8 R 2.5(eA)-.18 G(bout Dir)-2.5 E(ection Changes)-.18 E F0 -.8(We)97 630.4 S -1.65 -.5('v e).8 H .87(already seen ho)3.87 F 3.37 (wt)-.25 G 3.37(oc)-3.37 G .871 (hange the direction in which objects are composed from rightw)-3.37 F .871(ards to)-.1 F(do)72 642.4 Q(wnw)-.25 E 2.5(ards. Here)-.1 F (are some more illustrati)2.5 E .3 -.15(ve ex)-.25 H(amples:).15 E EP %%Page: 10 10 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-10-)279.67 48 Q/F1 10/Times-Bold@0 SF (right; box; arr)204.365 86.2 Q -.1(ow)-.18 G 2.5(;c).1 G(ir)-2.5 E (cle; arr)-.18 E -.1(ow)-.18 G 2.5(;e).1 G(llipse)-2.5 E 234 134.4 MT 0 -36 RL -54 0 RL 0 36 RL CL .4 LW ST 270 116.4 234 116.4 DL 270 116.4 MT -7.2 1.8 RL 0 -3.6 RL CL BL 270 116.4 MT -7.2 1.8 RL 0 -3.6 RL CL ST 288 116.4 18 DC ST 342 116.4 306 116.4 DL 342 116.4 MT -7.2 1.8 RL 0 -3.6 RL CL BL 342 116.4 MT -7.2 1.8 RL 0 -3.6 RL CL ST 54 36 369 116.4 DE ST (left; box; arr)207.98 158.2 Q -.1(ow)-.18 G 2.5(;c).1 G(ir)-2.5 E (cle; arr)-.18 E -.1(ow)-.18 G 2.5(;e).1 G(llipse)-2.5 E 396 206.4 MT 0 -36 RL -54 0 RL 0 36 RL CL ST 306 188.4 342 188.4 DL 306 188.4 MT 7.2 -1.8 RL 0 3.6 RL CL BL 306 188.4 MT 7.2 -1.8 RL 0 3.6 RL CL ST 288 188.4 18 DC ST 234 188.4 270 188.4 DL 234 188.4 MT 7.2 -1.8 RL 0 3.6 RL CL BL 234 188.4 MT 7.2 -1.8 RL 0 3.6 RL CL ST 54 36 207 188.4 DE ST F0 (Figure 8-1: Ef)159.8 229.4 Q(fects of dif)-.25 E (ferent motion directions \(right and left\))-.25 E F1(do)102.635 261.6 Q(wn; box; arr)-.1 E -.1(ow)-.18 G 2.5(;c).1 G(ir)-2.5 E(cle; arr)-.18 E -.1(ow)-.18 G 2.5(;e).1 G(llipse;)-2.5 E 216 309.8 MT 0 -36 RL -54 0 RL 0 36 RL CL ST 189 345.8 189 309.8 DL 189 345.8 MT -1.8 -7.2 RL 3.6 0 RL CL BL 189 345.8 MT -1.8 -7.2 RL 3.6 0 RL CL ST 189 363.8 18 DC ST 189 417.8 189 381.8 DL 189 417.8 MT -1.8 -7.2 RL 3.6 0 RL CL BL 189 417.8 MT -1.8 -7.2 RL 3.6 0 RL CL ST 54 36 189 435.8 DE ST 414 453.8 MT 0 -36 RL -54 0 RL 0 36 RL CL ST 387 381.8 387 417.8 DL 387 381.8 MT 1.8 7.2 RL -3.6 0 RL CL BL 387 381.8 MT 1.8 7.2 RL -3.6 0 RL CL ST 387 363.8 18 DC ST 387 309.8 387 345.8 DL 387 309.8 MT 1.8 7.2 RL -3.6 0 RL CL BL 387 309.8 MT 1.8 7.2 RL -3.6 0 RL CL ST 54 36 387 291.8 DE ST(up; box; arr) 306.695 261.6 Q -.1(ow)-.18 G 2.5(;c).1 G(ir)-2.5 E(cle; arr)-.18 E -.1 (ow)-.18 G 2.5(;e).1 G(llipse;)-2.5 E F0(Figure 8-2: Ef)159.925 476.8 Q (fects of dif)-.25 E(ferent motion directions \(up and do)-.25 E(wn\)) -.25 E(Something that may appear surprising happens if you change direc\ tions in the ob)97 504.4 Q(vious w)-.15 E(ay:)-.1 E 265.5 558.4 MT 0 -36 RL -54 0 RL 0 36 RL CL ST 301.5 540.4 265.5 540.4 DL 301.5 540.4 MT -7.2 1.8 RL 0 -3.6 RL CL BL 301.5 540.4 MT -7.2 1.8 RL 0 -3.6 RL CL ST 319.5 540.4 18 DC ST 337.5 576.4 337.5 540.4 DL 337.5 576.4 MT -1.8 -7.2 RL 3.6 0 RL CL BL 337.5 576.4 MT -1.8 -7.2 RL 3.6 0 RL CL ST 54 36 337.5 594.4 DE ST(Figure 8-3:)179.69 635.4 Q F1(box; arr)2.5 E -.1(ow)-.18 G 2.5(;c).1 G(ir)-2.5 E(cle; do)-.18 E(wn; arr)-.1 E -.1(ow)-.18 G 2.5(;e) .1 G(llipse)-2.5 E F0 -1.1(Yo)72 663 S 2.5(um)1.1 G(ight ha)-2.5 E .3 -.15(ve ex)-.2 H(pected that program to yield this:).15 E EP %%Page: 11 11 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-11-)279.67 48 Q 274.5 120 MT 0 -36 RL -54 0 RL 0 36 RL CL .4 LW ST 310.5 102 274.5 102 DL 310.5 102 MT -7.2 1.8 RL 0 -3.6 RL CL BL 310.5 102 MT -7.2 1.8 RL 0 -3.6 RL CL ST 328.5 102 18 DC ST 328.5 156 328.5 120 DL 328.5 156 MT -1.8 -7.2 RL 3.6 0 RL CL BL 328.5 156 MT -1.8 -7.2 RL 3.6 0 RL CL ST 54 36 328.5 174 DE ST (Figure 8-4: More intuiti)233.62 215 Q -.15(ve)-.25 G(?).15 E(But, in f) 72 242.6 Q(act, to get Figure 8.3 you ha)-.1 E .3 -.15(ve t)-.2 H 2.5 (od).15 G 2.5(ot)-2.5 G(his:)-2.5 E/F1 10/Courier@0 SF(.PS)108 260.6 Q (box;)108 272.6 Q(arrow;)108 284.6 Q(circle;)108 296.6 Q (move to last circle .s;)108 308.6 Q(down;)108 320.6 Q(arrow;)108 332.6 Q(ellipse)108 344.6 Q(.PE)108 356.6 Q F0(Wh)72 374.6 Q 2.892(yi)-.05 G 2.891(st)-2.892 G 2.891(his? Because)-2.891 F .391(the e)2.891 F .391 (xit point for the current direction is already set when you dra)-.15 F 2.891(wt)-.15 G .391(he object.)-2.891 F(The)5.391 E .059(second arro)72 386.6 R 2.559(wi)-.25 G 2.559(nF)-2.559 G .059(igure 8.2 dropped do) -2.559 F(wnw)-.25 E .059(ards from the circle')-.1 F 2.559(sa)-.55 G .06 (ttachment point for an object to be joined)-2.559 F(to the right.)72 398.6 Q .19(The meaning of the command)97 414.2 R/F2 10/Times-Bold@0 SF (mo)2.69 E .39 -.1(ve t)-.1 H 2.69(ol).1 G .19(ast cir)-2.69 F .19 (cle .s)-.18 F F0 .19(should be ob)2.69 F 2.69(vious. In)-.15 F .19 (order to see ho)2.69 F 2.69(wi)-.25 G 2.69(tg)-2.69 G(ener)-2.69 E(-) -.2 E(alizes, we')72 426.2 Q(ll need to go into detail on tw)-.1 E 2.5 (oi)-.1 G(mportant topics; locations and object names.)-2.5 E F2 2.5 (9. Naming)72 450.2 R(Objects)2.5 E F0 .436(The most natural w)97 465.8 R .436(ay to name locations in)-.1 F F2(pic)2.936 E F0 .436(is relati) 2.936 F .736 -.15(ve t)-.25 H 2.936(oo).15 G 2.936(bjects. In)-2.936 F .436(order to do this, you ha)2.936 F .736 -.15(ve t)-.2 H(o).15 E .187 (be able you ha)72 477.8 R .487 -.15(ve t)-.2 H 2.686(ob).15 G 2.686(ea) -2.686 G .186(ble to name objects.)-2.686 F(The)5.186 E F2(pic)2.686 E F0 .186(language has rich f)2.686 F .186 (acilities for this that try to emulate)-.1 F(the syntax of English.)72 489.8 Q F2 2.5(9.1. Naming)72 513.8 R(Objects By Order Of Drawing)2.5 E F0 .303(The simplest \(and generally the most useful\) w)97 529.4 R .304 (ay to name an object is with a)-.1 F F2(last)2.804 E F0 2.804 (clause. It)2.804 F .304(needs to)2.804 F .542(be follo)72 541.4 R .542 (wed by an object type name;)-.25 F F2(box)3.042 E F0(,)A F2(cir)3.042 E (cle)-.18 E F0(,)A F2(ellipse)3.042 E F0(,)A F2(line)3.042 E F0(,)A F2 (arr)3.041 E -.1(ow)-.18 G F0(,).1 E F2(spline)3.041 E F0(or)3.041 E F2 ([])3.041 E F0 .541(\(the last type refers to a)3.041 F/F3 10 /Times-Italic@0 SF .226(composite object)72 553.4 R F0 .227(which we') 2.726 F .227(ll discuss later\).)-.1 F .227(So, for e)5.227 F .227 (xample, the)-.15 F F2 .227(last cir)2.727 F(cle)-.18 E F0 .227 (clause in the program attached)2.727 F (to Figure 9.1.3 refers to the last circle dra)72 565.4 Q(wn.)-.15 E .769(More generally)97 581 R 3.269(,o)-.65 G .768(bjects of a gi)-3.269 F -.15(ve)-.25 G 3.268(nt).15 G .768 (ype are implicitly numbered \(starting from 1\).)-3.268 F -1.1(Yo)5.768 G 3.268(uc)1.1 G .768(an refer to)-3.268 F .076 (\(say\) the third ellipse in the current picture with)72 593 R F2 .076 (3rd ellipse)2.576 F F0 2.576(,o)C 2.576(rt)-2.576 G 2.576(ot)-2.576 G .076(he \214rst box as)-2.576 F F2 .076(1st box)2.576 F F0 2.576(,o)C 2.576(rt)-2.576 G 2.576(ot)-2.576 G .077(he \214fth line)-2.576 F(as)72 605 Q F2(5th line)2.5 E F0(.)A .655(Objects are also numbered backw)97 620.6 R .654(ards by type from the last one of Y)-.1 F .654(ou can say) -1.1 F F2 .654(2nd last box)3.154 F F0 .654(to get)3.154 F (the second-to-last box, or)72 632.6 Q F2(3rd last ellipse)2.5 E F0 (to get the third-to-last box.)2.5 E .385(In places where)97 648.2 R F3 (n)2.885 E F2(th)A F3 .386(is allowed,)2.885 F F2(`)2.886 E F3 -.2(ex)C (pr).2 E F2('th)A F3 .386(is also allowed.)2.886 F .386(Note that)5.386 F F2('th)2.886 E F3 .386(is a single tok)2.886 F .386(en: no space is) -.1 F(allowed between the)72 660.2 Q F2(')2.5 E F3(and the)2.5 E F2(th) 2.5 E F3 5(.F)C(or e)-6.05 E(xample)-.2 E(,)-.1 E F0 (for i = 1 to 4 do {)133 681.8 Q(line from `i')140.5 693.8 Q (th box.nw to `i+1')-.18 E(th box.se)-.18 E(})133 705.8 Q EP %%Page: 12 12 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-12-)279.67 48 Q/F1 10/Times-Bold@0 SF 2.5 (9.2. Naming)72 84 R(Objects W)2.5 E(ith Labels)-.18 E F0 -1.1(Yo)97 99.6 S 3.338(uc)1.1 G .838 (an also specify an object by referring to a label.)-3.338 F 3.338(Al) 5.838 G .838(abel is a w)-3.338 F .838(ord \(which must be)-.1 F .838 (gin with a)-.15 F .26(capital letter\) follo)72 111.6 R .26(wed by a c\ olon; you declare it by placing it immediately before the object dra) -.25 F .26(wing com-)-.15 F 2.5(mand. F)72 123.6 R(or e)-.15 E (xample, the program)-.15 E/F2 10/Courier@0 SF(.PS)108 141.6 Q (A: box "first" "object")108 153.6 Q(move;)108 165.6 Q (B: ellipse "second" "object")108 177.6 Q(move;)108 189.6 Q (arrow left at A;)108 201.6 Q(.PE)108 213.6 Q F0(declares labels)72 235.2 Q F1(A)2.5 E F0(and)2.5 E F1(B)2.5 E F0 (for its \214rst and second objects.)2.5 E(Here')5 E 2.5(sw)-.55 G (hat that looks lik)-2.5 E(e:)-.1 E 270 289.2 MT 0 -36 RL -54 0 RL 0 36 RL CL .4 LW ST(\214rst)235.22 267.4 Q(object)230.78 279.4 Q 54 36 333 271.2 DE ST(second)319.115 267.4 Q(object)320.78 279.4 Q 180 271.2 216 271.2 DL 180 271.2 MT 7.2 -1.8 RL 0 3.6 RL CL BL 180 271.2 MT 7.2 -1.8 RL 0 3.6 RL CL ST(Figure 9-1: Example of label use)222.315 312.2 Q(The) 72 336.2 Q F1(at)3.35 E F0 .85 (statement in the fourth line uses the label)3.35 F F1(A)3.35 E F0 .85 (\(the beha)3.35 F .85(vior of)-.2 F F1(at)3.35 E F0 .85(will be e)3.35 F .85(xplained in the ne)-.15 F .85(xt sec-)-.15 F 2.5(tion\). W)72 348.2 R(e')-.8 E(ll see later on that labels are most useful for referr\ ing to block composite objects.)-.1 E 1.224(Labels are not constants b) 97 363.8 R 1.224(ut v)-.2 F 1.225(ariables \(you can vie)-.25 F 3.725 (wc)-.25 G 1.225(olon as a sort of assignment\).)-3.725 F -1.1(Yo)6.225 G 3.725(uc)1.1 G 1.225(an say)-3.725 F .452(something lik)72 375.8 R(e) -.1 E F1 .452(A: A + \(1,0\);)2.952 F F0 .452(and the ef)2.952 F .452 (fect will be to reassign the label)-.25 F F1(A)2.952 E F0 .452 (to designate a position one inch)2.952 F(to the right of its old v)72 387.8 Q(alue.)-.25 E F1 2.5(10. Describing)72 411.8 R(locations)2.5 E F0 .376(The location of points can be described in man)97 427.4 R 2.877(yd) -.15 G(if)-2.877 E .377(ferent w)-.25 F 2.877(ays. All)-.1 F .377 (these forms are interchangeable)2.877 F .581(as for as the)72 439.4 R F1(pic)3.081 E F0 .581 (language syntax is concerned; where you can use one, an)3.081 F 3.08 (yo)-.15 G 3.08(ft)-3.08 G .58(he others that w)-3.08 F .58(ould mak)-.1 F(e)-.1 E(semantic sense are allo)72 451.4 Q(wed.)-.25 E (The special label)97 467 Q F1(Her)2.5 E(e)-.18 E F0(al)2.5 E -.1(wa)-.1 G(ys refers to the current position.).1 E F1 2.5(10.1. Absolute)72 491 R (Coordinates)2.5 E F0 .853 (The simplest is absolute coordinates in inches;)97 506.6 R F1(pic)3.353 E F0 .854(uses a Cartesian system with \(0, 0\) at the lo)3.353 F(wer) -.25 E .593(left corner of the virtual dra)72 518.6 R .593(wing surf) -.15 F .592(ace for each picture \(that is, X increases to the right an\ d Y increases)-.1 F(upw)72 530.6 Q 3.232(ards\). An)-.1 F .732 (absolute location may al)3.232 F -.1(wa)-.1 G .732 (ys be written in the con).1 F -.15(ve)-.4 G .732(ntional form as tw).15 F 3.233(oc)-.1 G(omma-separated)-3.233 E .539(numbers surrounded by par\ entheses \(and this is recommended for clarity\).)72 542.6 R .538 (In conte)5.539 F .538(xts where it creates no)-.15 F(ambiguity)72 554.6 Q 2.5(,t)-.65 G(he pair of X and Y coordinates suf)-2.5 E (\214ces without punctuation.)-.25 E .034(It is a good idea to a)97 570.2 R -.2(vo)-.2 G .034(id absolute coordinates, ho).2 F(we)-.25 E -.15(ve)-.25 G 3.634 -.55(r. T).15 H(he).55 E 2.535(yt)-.15 G .035 (end to mak)-2.535 F 2.535(ep)-.1 G .035(icture descriptions dif)-2.535 F<8c2d>-.25 E .133(cult to understand and modify)72 582.2 R 5.133(.I) -.65 G .133(nstead, there are quite a number of w)-5.133 F .133 (ays to specify locations relati)-.1 F .432 -.15(ve t)-.25 H(o).15 E F1 (pic)2.632 E F0(objects and pre)72 594.2 Q(vious locations.)-.25 E F1 2.5(10.2. Locations)72 621.8 R(Relati)2.5 E .2 -.1(ve t)-.1 H 2.5(oO).1 G(bjects)-2.5 E F0 .73(The symbol)97 637.4 R F1(her)3.23 E(e)-.18 E F0 (al)3.23 E -.1(wa)-.1 G .73 (ys refers to the position of the last object dra).1 F .73 (wn or the destination of the last)-.15 F F1(mo)72 649.4 Q -.1(ve)-.1 G F0(.).1 E 1.113(Alone and unquali\214ed, a)97 665 R F1 1.113(last cir) 3.613 F(cle)-.18 E F0 1.113(or an)3.613 F 3.613(yo)-.15 G 1.112(ther w) -3.613 F 1.112(ay of specifying a closed-object or arc location)-.1 F .752(refers as a position to the geometric center of the object.)72 677 R .753(Unquali\214ed, the name of a line or spline object)5.753 F (refers to the position of the object start.)72 689 Q(Also,)97 704.6 Q F1(pic)3.016 E F0 .516(objects ha)3.016 F .816 -.15(ve q)-.2 H .516 (uite a fe).15 F 3.016(wn)-.25 G .516 (amed locations associated with them.)-3.016 F .516 (One of these is the object)5.516 F(center)72 716.6 Q 2.77(,w)-.4 G .27 (hich can be indicated \(redundantly\) with the suf)-2.77 F<8c78>-.25 E F1(.center)2.771 E F0 .271(\(or just)2.771 F F1(.c)2.771 E F0 2.771 (\). Thus,)B F1 .271(last cir)2.771 F .271(cle .center)-.18 F F0(is) 2.771 E(equi)72 728.6 Q -.25(va)-.25 G(lent to).25 E F1(last cir)2.5 E (cle)-.18 E F0(.)A EP %%Page: 13 13 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-13-)279.67 48 Q/F1 10/Times-Bold@0 SF 2.5 (10.2.1. Locations)72 84 R(Relati)2.5 E .2 -.1(ve t)-.1 H 2.5(oC).1 G (losed Objects)-2.5 E F0(Ev)97 99.6 Q .931(ery closed object \(box, cir\ cle, ellipse, or block composite\) also has eight compass points associ\ -)-.15 F(ated with it;)72 111.6 Q 213.12 203.04 MT 0 -72 RL -108 0 RL 0 72 RL CL .4 LW ST 159.12 167.04 1.44 DC 0.5000 FL 159.12 167.04 1.44 DC ST F1(.c)161.62 169.24 Q 159.12 131.04 1.44 DC 0.5000 FL 159.12 131.04 1.44 DC ST(.n)155.09 127.24 Q 213.12 131.04 1.44 DC 0.5000 FL 213.12 131.04 1.44 DC ST(.ne)208.12 127.24 Q 213.12 167.04 1.44 DC 0.5000 FL 213.12 167.04 1.44 DC ST(.e)215.62 169.24 Q 213.12 203.04 1.44 DC 0.5000 FL 213.12 203.04 1.44 DC ST(.se)208.955 211.24 Q 159.12 203.04 1.44 DC 0.5000 FL 159.12 203.04 1.44 DC ST(.s)155.925 211.24 Q 105.12 203.04 1.44 DC 0.5000 FL 105.12 203.04 1.44 DC ST(.sw)97.065 211.24 Q 105.12 167.04 1.44 DC 0.5000 FL 105.12 167.04 1.44 DC ST(.w)92.9 169.24 Q 105.12 131.04 1.44 DC 0.5000 FL 105.12 131.04 1.44 DC ST(.nw)96.23 127.24 Q 288 167.04 36 DC ST 288 167.04 1.44 DC 0.5000 FL 288 167.04 1.44 DC ST(.c)290.5 169.24 Q 288 131.04 1.44 DC 0.5000 FL 288 131.04 1.44 DC ST(.n)283.97 127.24 Q 313.488 141.552 1.44 DC 0.5000 FL 313.488 141.552 1.44 DC ST(.ne)308.488 137.752 Q 324 167.04 1.44 DC 0.5000 FL 324 167.04 1.44 DC ST(.e)326.5 169.24 Q 313.488 192.528 1.44 DC 0.5000 FL 313.488 192.528 1.44 DC ST(.se)309.323 200.728 Q 288 203.04 1.44 DC 0.5000 FL 288 203.04 1.44 DC ST(.s)284.805 211.24 Q 262.512 192.528 1.44 DC 0.5000 FL 262.512 192.528 1.44 DC ST(.sw)254.457 200.728 Q 252 167.04 1.44 DC 0.5000 FL 252 167.04 1.44 DC ST(.w)239.78 169.24 Q 262.512 141.552 1.44 DC 0.5000 FL 262.512 141.552 1.44 DC ST(.nw)253.622 137.752 Q 108 72 416.88 167.04 DE ST 416.88 167.04 1.44 DC 0.5000 FL 416.88 167.04 1.44 DC ST(.c)419.38 169.24 Q 416.88 131.04 1.44 DC 0.5000 FL 416.88 131.04 1.44 DC ST(.n)412.85 127.24 Q 455.04 141.552 1.44 DC 0.5000 FL 455.04 141.552 1.44 DC ST(.ne)450.04 137.752 Q 470.88 167.04 1.44 DC 0.5000 FL 470.88 167.04 1.44 DC ST(.e)473.38 169.24 Q 455.04 192.528 1.44 DC 0.5000 FL 455.04 192.528 1.44 DC ST(.se)450.875 200.728 Q 416.88 203.04 1.44 DC 0.5000 FL 416.88 203.04 1.44 DC ST(.s)413.685 211.24 Q 378.72 192.528 1.44 DC 0.5000 FL 378.72 192.528 1.44 DC ST(.sw) 370.665 200.728 Q 362.88 167.04 1.44 DC 0.5000 FL 362.88 167.04 1.44 DC ST(.w)350.66 169.24 Q 378.72 141.552 1.44 DC 0.5000 FL 378.72 141.552 1.44 DC ST(.nw)369.83 137.752 Q F0(Figure 10-1: Compass points)230.08 227.48 Q .588(these are the locations where eight compass rays from the\ geometric center w)72 255.08 R .588(ould intersect the \214gure.)-.1 F (So)5.589 E .421(when we say)72 267.08 R F1 .421(last cir)2.921 F .421 (cle .s)-.18 F F0 .421 (we are referring to the south compass point of the last circle dra) 2.921 F 2.921(wn. The)-.15 F -.15(ex)2.921 G(pla-).15 E (nation of Figure 7.3')72 279.08 Q 2.5(sp)-.55 G(rogram is no)-2.5 E 2.5 (wc)-.25 G(omplete.)-2.5 E .135(\(In case you dislik)97 294.68 R 2.635 (ec)-.1 G .135(ompass points, the names)-2.635 F F1(.top)2.635 E F0(,)A F1(.bottom)2.635 E F0(,)A F1(.left)2.635 E F0(and)2.635 E F1(.right) 2.635 E F0 .136(are synon)2.636 F .136(yms for)-.15 F F1(.n)2.636 E F0 (,)A F1(.s)2.636 E F0(,)A F1(.e)72 306.68 Q F0 2.5(,a)C(nd)-2.5 E F1(.w) 2.5 E F0(respecti)2.5 E -.15(ve)-.25 G(ly; the).15 E 2.5(yc)-.15 G(an e) -2.5 E -.15(ve)-.25 G 2.5(nb).15 G 2.5(ea)-2.5 G(bbre)-2.5 E(viated to) -.25 E F1(.t)2.5 E F0(,)A F1(.b)2.5 E F0(,)A F1(.l)2.5 E F0(and)2.5 E F1 (.r)2.5 E F0(\).)A .44(The names)97 322.28 R F1(center)2.94 E F0(,)A F1 (top)2.94 E F0(,)A F1(bottom)2.94 E F0(,)A F1(left)2.94 E F0(and)2.94 E F1(right)2.94 E F0 .439 (can also be used \(without the leading dot\) in a pre\214x)2.94 F 1.131 (form mark)72 334.28 R 1.131(ed by)-.1 F F1(of)3.631 E F0 3.631(;t)C (hus,)-3.631 E F1 1.131(center of last cir)3.631 F 1.132 (cle and top of 2nd last ellipse ar)-.18 F 3.632(eb)-.18 G 1.132(oth v) -3.632 F 1.132(alid object r)-.1 F(efer)-.18 E(-)-.37 E(ences.)72 346.28 Q F0(Arc objects also ha)97 361.88 Q .3 -.15(ve c)-.2 H (ompass point; the).15 E 2.5(ya)-.15 G (re the compass points of the implied circle.)-2.5 E F1 2.5 (10.2.2. Locations)72 385.88 R(Relati)2.5 E .2 -.1(ve t)-.1 H 2.5(oO).1 G(pen Objects)-2.5 E F0(Ev)97 401.48 Q .102 (ery open object \(line, arro)-.15 F 1.402 -.65(w, a)-.25 H .102 (rc, or spline\) has three named points;).65 F F1(.start)2.602 E F0(,)A F1(.center)2.602 E F0 2.602(,a)C(nd)-2.602 E F1(.end)2.601 E F0 5.101 (.T)C(he)-5.101 E(y)-.15 E .486 (can also be used without leading dots in the)72 413.48 R F1(of)2.986 E F0 .486(pre\214x form.)2.986 F .487 (The center of an arc is the center of its circle,)5.486 F -.2(bu)72 425.48 S 2.5(tt).2 G(he center of a line, path, or spline is halfw)-2.5 E(ay between its endpoints.)-.1 E 157.14 450.68 85.14 486.68 DL 121.14 468.68 1.44 DC 0.5000 FL 121.14 468.68 1.44 DC ST(.center)87.01 463.68 Q 85.14 486.68 1.44 DC 0.5000 FL 85.14 486.68 1.44 DC ST(.start)58.22 481.68 Q 157.14 450.68 1.44 DC 0.5000 FL 157.14 450.68 1.44 DC ST(.end) 133 445.68 Q 201.78 486.68 36 -0.0000 -90.0000 DA 201.78 486.68 1.44 DC 0.5000 FL 201.78 486.68 1.44 DC ST(.center)167.65 481.68 Q 201.78 450.68 1.44 DC 0.5000 FL 201.78 450.68 1.44 DC ST(.start)174.86 445.68 Q 237.78 486.68 1.44 DC 0.5000 FL 237.78 486.68 1.44 DC ST(.end)213.64 481.68 Q 354.42 450.68 282.42 450.68 DL 282.42 486.68 354.42 450.68 DL 354.42 486.68 282.42 486.68 DL 318.42 468.68 1.44 DC 0.5000 FL 318.42 468.68 1.44 DC ST(.center)284.29 463.68 Q 282.42 450.68 1.44 DC 0.5000 FL 282.42 450.68 1.44 DC ST(.start)255.5 445.68 Q 354.42 486.68 1.44 DC 0.5000 FL 354.42 486.68 1.44 DC ST(.end)330.28 481.68 Q 399.06 486.68 MT 36 0 RL 24 0 42 -6 54 -18 RC 12 -12 12 -18 0 -18 RC -12 0 -30 0 -54 0 RC -36 0 RL ST 399.06 468.68 1.44 DC 0.5000 FL 399.06 468.68 1.44 DC ST (.center)364.93 463.68 Q 399.06 486.68 1.44 DC 0.5000 FL 399.06 486.68 1.44 DC ST(.start)372.14 481.68 Q 399.06 450.68 1.44 DC 0.5000 FL 399.06 450.68 1.44 DC ST(.end)374.92 445.68 Q (Figure 10-2: Special points on open objects)201.06 525.52 Q F1 2.5 (10.3. W)72 565.12 R(ays of Composing P)-.65 E(ositions)-.2 E F0 .852 (Once you ha)97 580.72 R 1.152 -.15(ve t)-.2 H 1.052 -.1(wo p).15 H .852 (ositions to w).1 F .852(ork with, there are se)-.1 F -.15(ve)-.25 G .852(ral w).15 F .851(ays to combine them to specify ne)-.1 F(w)-.25 E (positions.)72 592.72 Q F1 2.5(10.3.1. V)72 616.72 R (ector Sums and Displacements)-1 E F0(An)97 632.32 Q 2.665(yt)-.15 G .365 -.1(wo p)-2.665 H .165 (ositions may be added or subtracted to yield a ne).1 F 2.665(wp)-.25 G 2.666(osition. The)-2.665 F .166(result is the con)2.666 F -.15(ve)-.4 G (ntional).15 E -.15(ve)72 644.32 S 1.455(ctor sum or dif).15 F 1.455 (ference of coordinates.)-.25 F -.15(Fo)6.455 G 3.955(re).15 G(xample,) -4.105 E F1 1.455(last box .ne + \(0.1, 0\))3.955 F F0 1.455(is a v) 3.955 F 1.455(alid position.)-.25 F(This)6.455 E -.15(ex)72 656.32 S .166(ample illustrates a common use, to de\214ne a position slightly of) .15 F .166(fset from a named one \(say)-.25 F 2.666(,f)-.65 G .166 (or captioning)-2.666 F(purposes\).)72 668.32 Q F1 2.5(10.3.2. Inter)72 692.32 R(polation Between P)-.1 E(ositions)-.2 E F0 4.496(Ap)97 707.92 S 1.996(osition may be interpolated between an)-4.496 F 4.495(yt)-.15 G 2.195 -.1(wo p)-4.495 H 4.495(ositions. The).1 F 1.995(syntax is `)4.495 F/F2 10/Times-Italic@0 SF(fr)A(action)-.15 E F1 1.995(of the way)4.495 F (between)72 719.92 Q F2(position1)2.557 E F1(and)2.557 E F2(position2) 2.557 E F0 3.957 -.7(.' F)D .057(or e).55 F .058(xample, you can say) -.15 F F1 .058(1/3 of the way between her)2.558 F 2.558(ea)-.18 G .058 (nd last ellipse)-2.558 F(.ne)72 731.92 Q F0 6.067(.T)C 1.066(he fracti\ on may be in numerator/denominator form or may be an ordinary number \(\ v)-6.067 F 1.066(alues are)-.25 F F2(not)3.566 E EP %%Page: 14 14 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-14-)279.67 48 Q 1.898(restricted to [0,1]\).)72 84 R 1.898(As an alternati)6.898 F 2.199 -.15(ve t)-.25 H 4.399(ot).15 G 1.899(his v)-4.399 F 1.899(erbose syntax, you can say `)-.15 F/F1 10 /Times-Italic@0 SF(fr)A(action)-.15 E/F2 10/Times-Bold@0 SF(<)6.899 E F1 (position1)A F2(,)4.399 E F1(posi-)4.399 E(tion2)72 96 Q F2(>)A F0 -.7 (.')C 2.5(;t).7 G(hus, the e)-2.5 E(xample could also be written)-.15 E F2(1/3)2.5 E F0()2.5 E F2(.)A .4 LW 306 114 270 150 DL 306 114 MT -3.816 6.336 RL -2.52 -2.52 RL CL BL 306 114 MT -3.816 6.336 RL -2.52 -2.52 RL CL ST 282.024 137.976 1.44 DC 0.5000 FL 282.024 137.976 1.44 DC ST(P)287.609 140.176 Q F0(Figure 10-3:)129.69 173 Q F2 (P: 1/3 of the way between last arr)2.5 E .2 -.1(ow .)-.18 H (start and last arr).1 E .2 -.1(ow .)-.18 H(end).1 E F0(This f)97 200.6 Q(acility can be used, for e)-.1 E(xample, to double connections.)-.15 E 270 254.6 MT 0 -36 RL -54 0 RL 0 36 RL CL ST(yin)236.61 238.8 Q 360 254.6 MT 0 -36 RL -54 0 RL 0 36 RL CL ST(yang)323.28 238.8 Q 306 232.136 270 232.136 DL 306 232.136 MT -7.2 1.8 RL 0 -3.6 RL CL BL 306 232.136 MT -7.2 1.8 RL 0 -3.6 RL CL ST 270 241.136 306 241.136 DL 270 241.136 MT 7.2 -1.8 RL 0 3.6 RL CL BL 270 241.136 MT 7.2 -1.8 RL 0 3.6 RL CL ST (Figure 10-4: Doubled arro)229.94 277.6 Q(ws)-.25 E -1.1(Yo)72 305.2 S 2.5(uc)1.1 G(an get Figure 10-4 from the follo)-2.5 E(wing program:)-.25 E/F3 10/Courier@0 SF(.PS)108 323.2 Q(A: box "yin"; move;)108 335.2 Q (B: box "yang";)108 347.2 Q(arrow right at 1/4 ;)108 359.2 Q (arrow left)108 371.2 Q(at 1/4 ;)12 E(.PE)108 383.2 Q F0 (Note the use of the short form for interpolating points.)72 404.8 Q F2 2.5(10.3.3. Pr)72 428.8 R(ojections of P)-.18 E(oints)-.2 E F0(Gi)97 444.4 Q -.15(ve)-.25 G 2.913(nt).15 G .613 -.1(wo p)-2.913 H(ositions).1 E F1(p)2.913 E F0(and)2.913 E F1(q)2.913 E F0 2.913(,t)C .413 (he position)-2.913 F F2(\()2.913 E F1(p)A F2(,)A F1(q)2.912 E F2(\))A F0 .412(has the X coordinate of)2.912 F F1(p)2.912 E F0 .412 (and the Y coordinate of)2.912 F F1(q)2.912 E F0(.)A 1.664(This can be \ helpful in placing an object at one of the corners of the virtual box d\ e\214ned by tw)72 456.4 R 4.164(oo)-.1 G(ther)-4.164 E(objects.)72 468.4 Q 360 493.6 1.44 DC 0.5000 FL 360 493.6 1.44 DC ST F2(\(B,A\) is her) 367.2 488.6 Q(e)-.18 E 360 565.6 1.44 DC 0.5000 FL 360 565.6 1.44 DC ST (B)367.2 575 Q 216 565.6 1.44 DC 0.5000 FL 216 565.6 1.44 DC ST (\(A,B\) is her)155.38 575 Q(e)-.18 E 216 493.6 1.44 DC 0.5000 FL 216 493.6 1.44 DC ST(A)208.8 488.6 Q F0(Figure 10-5: Using \()212.45 595.8 Q F1(x)A F0(,)A F1(y)2.5 E F0 2.5(\)c)C(omposition)-2.5 E F2 2.5 (10.4. Using)72 631.8 R(Locations)2.5 E F0 .656(There are four w)97 647.4 R .656(ays to use locations;)-.1 F F2(at)3.156 E F0(,)A F2(fr) 3.156 E(om)-.18 E F0(,)A F2(to)3.156 E F0 3.156(,a)C(nd)-3.156 E F2 (with)3.155 E F0 5.655(.A)C .655 (ll three are object modi\214ers; that is,)-5.655 F(you use them as suf) 72 659.4 Q<8c78>-.25 E(es to a dra)-.15 E(wing command.)-.15 E(The)97 675 Q F2(at)3.623 E F0 1.123(modi\214er says to dra)3.623 F -6.122 3.623 (wa c)-.15 H 1.124(losed object or arc with its center at the follo) -3.623 F 1.124(wing location, or to)-.25 F(dra)72 687 Q 2.5(wal)-.15 G (ine/spline/arro)-2.5 E 2.5(ws)-.25 G(tarting at the follo)-2.5 E (wing location.)-.25 E(The)97 702.6 Q F2(to)3.648 E F0 1.147 (modi\214er can be used alone to specify a mo)3.647 F 1.447 -.15(ve d) -.15 H 3.647(estination. The).15 F F2(fr)3.647 E(om)-.18 E F0 1.147 (modi\214er can be used)3.647 F(alone in the same w)72 714.6 Q(ay as)-.1 E F2(at)2.5 E F0(.)A EP %%Page: 15 15 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-15-)279.67 48 Q(The)97 84 Q/F1 10/Times-Bold@0 SF(fr)2.677 E(om)-.18 E F0(and)2.677 E F1(to)2.677 E F0 .177 (modi\214ers can be used with a)2.677 F F1(line)2.677 E F0(or)2.677 E F1 (ar)2.677 E(c)-.18 E F0 .177(command to specify start and end points of) 2.677 F 1.873(the object.)72 96 R 1.873 (In conjunction with named locations, this of)6.873 F 1.873(fers a v) -.25 F 1.873(ery \215e)-.15 F 1.872(xible mechanism for connecting)-.15 F 2.5(objects. F)72 108 R(or e)-.15 E(xample, the follo)-.15 E (wing program)-.25 E/F2 10/Courier@0 SF(.PS)108 126 Q(box "from")108 138 Q(move 0.75;)108 150 Q(ellipse "to")108 162 Q (arc cw from 1/3 of the way \\)108 174 Q (between last box .n and last box .ne to last ellipse .n;)132 186 Q(.PE) 108 198 Q F0(yields:)72 219.6 Q 261 293.328 MT 0 -36 RL -54 0 RL 0 36 RL CL .4 LW ST(from)224.28 277.528 Q 54 36 342 275.328 DE ST(to)338.11 277.528 Q 292.464 309.6 72.015 -46.5394 -133.4606 DA (Figure 10-6: A trick)153.135 316.328 Q 2.5(yc)-.15 G (onnection speci\214ed with English-lik)-2.5 E 2.5(es)-.1 G(yntax)-2.5 E (The)97 343.928 Q F1(with)3.146 E F0 .646(modi\214er allo)3.146 F .646(\ ws you to identify a named attachment point of an object with another p\ oint.)-.25 F(This is v)72 355.928 Q (ery useful for connecting objects in a natural w)-.15 E(ay)-.1 E 5(.F) -.65 G(or an e)-5.15 E(xample, consider these tw)-.15 E 2.5(op)-.1 G (rograms:)-2.5 E 162 418.928 MT 0 -36 RL -36 0 RL 0 36 RL CL ST 216 427.928 MT 0 -54 RL -54 0 RL 0 54 RL CL ST F1 (box wid 0.5 ht 0.5; box wid 0.75 ht 0.75)106.075 473.328 Q 396 427.928 MT 0 -36 RL -36 0 RL 0 36 RL CL ST 450 427.928 MT 0 -54 RL -54 0 RL 0 54 RL CL ST (box wid 0.5 ht 0.5; box wid 0.75 ht 0.75 with .sw at last box .se;) 289.8 473.328 Q F0(Figure 10-7: Using the)181.48 494.128 Q F1(with)2.5 E F0(modi\214er for attachments)2.5 E F1 2.5(10.5. The)72 530.128 R (chop modi\214er)2.5 E F0 .99(When dra)97 545.728 R .99 (wing lines between circles that don')-.15 F 3.49(ti)-.18 G .99 (ntersect them at a compass point, it is useful to be)-3.49 F(able to s\ horten a line by the radius of the circle at either or both ends.)72 557.728 Q(Consider the follo)5 E(wing program:)-.25 E(.PS)108 575.728 Q (circle "x")108 587.728 Q(circle "y" at 1st circle - \(0.4, 0.6\))108 599.728 Q(circle "z" at 1st circle + \(0.4, -0.6\))108 611.728 Q(arro) 108 623.728 Q 2.5(wf)-.25 G(rom 1st circle to 2nd circle chop)-2.5 E (arro)108 635.728 Q 2.5(wf)-.25 G(rom 2nd circle to 3rd circle chop)-2.5 E(arro)108 647.728 Q 2.5(wf)-.25 G(rom 3rd circle to 1st circle chop) -2.5 E(.PE)108 659.728 Q(It yields the follo)72 681.328 Q(wing:)-.25 E EP %%Page: 16 16 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-16-)279.67 48 Q 288 102 18 DC .4 LW ST(x)285.5 104.2 Q 259.2 145.2 18 DC ST(y)256.7 147.4 Q 316.8 145.2 18 DC ST(z) 314.58 147.4 Q 269.136 130.224 277.992 116.976 DL 269.208 130.224 MT 2.52 -6.984 RL 3.024 2.016 RL CL BL 269.208 130.224 MT 2.52 -6.984 RL 3.024 2.016 RL CL ST 298.8 145.2 277.2 145.2 DL 298.8 145.2 MT -7.2 1.8 RL 0 -3.6 RL CL BL 298.8 145.2 MT -7.2 1.8 RL 0 -3.6 RL CL ST 297.936 116.976 306.792 130.224 DL 298.008 116.976 MT 5.472 4.968 RL -3.024 2.016 RL CL BL 298.008 116.976 MT 5.472 4.968 RL -3.024 2.016 RL CL ST (Figure 10-8: The)224.39 186.2 Q/F1 10/Times-Bold@0 SF(chop)2.5 E F0 (modi\214er)2.5 E .458(Notice that the)72 213.8 R F1(chop)2.958 E F0 (attrib)2.958 E .459(ute mo)-.2 F -.15(ve)-.15 G 2.959(sa).15 G(rro) -2.959 E .459(wheads rather than stepping on them. By def)-.25 F .459 (ault, the)-.1 F F1(chop)2.959 E F0(modi-)2.959 E .438 (\214er shortens both ends of the line by)72 225.8 R F1(cir)2.937 E (clerad)-.18 E F0 5.437(.B)C 2.937(ys)-5.437 G(uf)-2.937 E .437 (\214xing it with a number you can change the amount)-.25 F (of chopping.)72 237.8 Q .624(If you say)97 253.4 R F1 .624 (line ... chop)3.124 F/F2 10/Times-Italic@0 SF(r1)3.124 E F1(chop)3.124 E F2(r2)3.124 E F0(with)3.124 E F2(r1)3.124 E F0(and)3.124 E F2(r2)3.124 E F0 .624(both numbers, you can v)3.124 F .625(ary the amount of chop-) -.25 F .082(ping at both ends.)72 265.4 R -1.1(Yo)5.081 G 2.581(uc)1.1 G .081(an use this in combination with trigonometric functions to write c\ ode that will deal)-2.581 F(with more comple)72 277.4 Q 2.5(xi)-.15 G (ntersections.)-2.5 E F1 2.5(11. Object)72 301.4 R(Gr)2.5 E(oups)-.18 E F0(There are tw)97 317 Q 2.5(od)-.1 G(if)-2.5 E(ferent w)-.25 E (ays to group objects in)-.1 E F1(pic)2.5 E F0(;)A F2(br)2.5 E(ace gr) -.15 E(ouping)-.45 E F0(and)2.5 E F2(bloc)2.5 E 2.5(kc)-.2 G(omposites) -2.5 E F0(.)A F1 2.5(11.1. Brace)72 341 R(Gr)2.5 E(ouping)-.18 E F0 .503 (The simpler method is simply to group a set of objects within curly br\ ack)97 356.6 R .504(et or brace characters.)-.1 F(On)5.504 E -.15(ex)72 368.6 S 1.491(it from this grouping, the current position and direction\ are restored to their v).15 F 1.49(alue when the opening)-.25 F (brace w)72 380.6 Q(as encountered.)-.1 E F1 2.5(11.2. Block)72 404.6 R (Composites)2.5 E F0 2.553(Ab)97 420.2 S .053(lock composite object is \ created a series of commands enclosed by square brack)-2.553 F 2.554 (ets. The)-.1 F(compos-)2.554 E .164 (ite can be treated for most purposes lik)72 432.2 R 2.664(eas)-.1 G .163(ingle closed object, with the size and shape of its bounding box.) -2.664 F(Here is an e)72 444.2 Q 2.5(xample. The)-.15 F (program fragment)2.5 E/F3 10/Courier@0 SF(A: [)108 462.2 Q(circle;)132 474.2 Q(line up 1 at last circle .n;)132 486.2 Q (line down 1 at last circle .s;)132 498.2 Q (line right 1 at last circle .e;)132 510.2 Q (line left 1 at last circle .w;)132 522.2 Q (box dashed with .nw at last circle .se + \(0.2, -0.2\);)132 534.2 Q (Caption: center of last box;)132 546.2 Q(])108 558.2 Q F0 .852 (yields the block in \214gure 11-1, which we sho)72 579.8 R 3.352(wb) -.25 G .853(oth with and without its attachment points.)-3.352 F .853 (The block')5.853 F(s)-.55 E(location becomes the v)72 591.8 Q(alue of) -.25 E F1(A)2.5 E F0(.)A EP %%Page: 17 17 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-17-)279.67 48 Q 178.56 175.44 18 DC .4 LW ST 178.56 85.44 178.56 157.44 DL 178.56 265.44 178.56 193.44 DL 268.56 175.44 196.56 175.44 DL 88.56 175.44 160.56 175.44 DL 209.304 238.584 205.704 238.584 DL 216.504 238.584 212.904 238.584 DL 223.704 238.584 220.104 238.584 DL 230.904 238.584 227.304 238.584 DL 238.104 238.584 234.504 238.584 DL 245.304 238.584 241.704 238.584 DL 252.504 238.584 248.904 238.584 DL 259.704 238.584 256.104 238.584 DL 259.704 234.984 259.704 238.584 DL 259.704 228.504 259.704 232.104 DL 259.704 222.024 259.704 225.624 DL 259.704 215.544 259.704 219.144 DL 259.704 209.064 259.704 212.664 DL 259.704 202.584 259.704 206.184 DL 256.104 202.584 259.704 202.584 DL 248.904 202.584 252.504 202.584 DL 241.704 202.584 245.304 202.584 DL 234.504 202.584 238.104 202.584 DL 227.304 202.584 230.904 202.584 DL 220.104 202.584 223.704 202.584 DL 212.904 202.584 216.504 202.584 DL 205.704 202.584 209.304 202.584 DL 205.704 206.184 205.704 202.584 DL 205.704 212.664 205.704 209.064 DL 205.704 219.144 205.704 215.544 DL 205.704 225.624 205.704 222.024 DL 205.704 232.104 205.704 228.504 DL 205.704 238.584 205.704 234.984 DL 396 175.44 18 DC ST 396 85.44 396 157.44 DL 396 265.44 396 193.44 DL 486 175.44 414 175.44 DL 306 175.44 378 175.44 DL 426.744 238.584 423.144 238.584 DL 433.944 238.584 430.344 238.584 DL 441.144 238.584 437.544 238.584 DL 448.344 238.584 444.744 238.584 DL 455.544 238.584 451.944 238.584 DL 462.744 238.584 459.144 238.584 DL 469.944 238.584 466.344 238.584 DL 477.144 238.584 473.544 238.584 DL 477.144 234.984 477.144 238.584 DL 477.144 228.504 477.144 232.104 DL 477.144 222.024 477.144 225.624 DL 477.144 215.544 477.144 219.144 DL 477.144 209.064 477.144 212.664 DL 477.144 202.584 477.144 206.184 DL 473.544 202.584 477.144 202.584 DL 466.344 202.584 469.944 202.584 DL 459.144 202.584 462.744 202.584 DL 451.944 202.584 455.544 202.584 DL 444.744 202.584 448.344 202.584 DL 437.544 202.584 441.144 202.584 DL 430.344 202.584 433.944 202.584 DL 423.144 202.584 426.744 202.584 DL 423.144 206.184 423.144 202.584 DL 423.144 212.664 423.144 209.064 DL 423.144 219.144 423.144 215.544 DL 423.144 225.624 423.144 222.024 DL 423.144 232.104 423.144 228.504 DL 423.144 238.584 423.144 234.984 DL 396 175.44 1.44 DC 0.5000 FL 396 175.44 1.44 DC ST/F1 10/Times-Bold@0 SF(.c)398.5 177.64 Q 396 85.44 1.44 DC 0.5000 FL 396 85.44 1.44 DC ST(.n)391.97 81.64 Q 486 85.44 1.44 DC 0.5000 FL 486 85.44 1.44 DC ST(.ne)481 81.64 Q 486 175.44 1.44 DC 0.5000 FL 486 175.44 1.44 DC ST(.e)488.5 177.64 Q 486 265.44 1.44 DC 0.5000 FL 486 265.44 1.44 DC ST(.se)481.835 273.64 Q 396 265.44 1.44 DC 0.5000 FL 396 265.44 1.44 DC ST(.s)392.805 273.64 Q 306 265.44 1.44 DC 0.5000 FL 306 265.44 1.44 DC ST(.sw)297.945 273.64 Q 306 175.44 1.44 DC 0.5000 FL 306 175.44 1.44 DC ST(.w)293.78 177.64 Q 306 85.44 1.44 DC 0.5000 FL 306 85.44 1.44 DC ST(.nw)297.11 81.64 Q F0 (Figure 11-1: A sample composite object)207.59 289.88 Q 3.042 -.8(To r) 72 317.48 T 1.442(efer to one of the composite').8 F 3.942(sa)-.55 G 1.442(ttachment points, you can say \(for e)-3.942 F(xample\))-.15 E F1 3.941(A.)3.941 G(s)-3.941 E F0 6.441(.F)C 1.441(or purposes of)-6.591 F .063(object naming, composites are a class.)72 329.48 R -1.1(Yo)5.063 G 2.563(uc)1.1 G .063(ould write)-2.563 F F1 .064(last [] .s)2.564 F F0 .064(as an equi)2.564 F -.25(va)-.25 G .064(lent refrence, usable an).25 F(ywhere)-.15 E 2.5(al)72 341.48 S(ocation is needed.)-2.5 E (This construction is v)5 E(ery important for putting together lar)-.15 E(ge, multi-part diagrams.)-.18 E .285(Blocks are also a v)97 357.08 R .284(ariable-scoping mechanism, lik)-.25 F 2.784(ea)-.1 G/F2 10 /Times-Italic@0 SF(gr)A(of)-.45 E(f)-.18 E F0 .284(\(1\) en)B 2.784 (vironment. All)-.4 F -.25(va)2.784 G .284(riable assignments).25 F .474 (done inside a block are undone at the end of it.)72 369.08 R 2.074 -.8 (To g)5.474 H .474(et at v).8 F .474 (alues within a block, write a name of the block)-.25 F(follo)72 381.08 Q .024(wed by a dot, follo)-.25 F .024(wed by the v)-.25 F .024 (ariable or label you w)-.25 F 2.523(ant. F)-.1 F .023(or e)-.15 F .023 (xample, we could refer the the center of)-.15 F(the box in the abo)72 393.08 Q .3 -.15(ve c)-.15 H(omposite as).15 E F1(last [] .Caption)2.5 E F0(or)2.5 E F1(A.Caption)2.5 E F0(.)A .626 (This kind of reference to a label can be used in an)97 408.68 R 3.126 (yw)-.15 G .626(ay an)-3.226 F 3.126(yo)-.15 G .626 (ther location can be.)-3.126 F -.15(Fo)5.626 G 3.126(re).15 G .626 (xample, if)-3.276 F(we added)72 420.68 Q F1("Hi!" at A.Caption)2.5 E F0 (the result w)2.5 E(ould look lik)-.1 E 2.5(et)-.1 G(his:)-2.5 E 288 528.68 18 DC ST 288 438.68 288 510.68 DL 288 618.68 288 546.68 DL 378 528.68 306 528.68 DL 198 528.68 270 528.68 DL 318.744 591.824 315.144 591.824 DL 325.944 591.824 322.344 591.824 DL 333.144 591.824 329.544 591.824 DL 340.344 591.824 336.744 591.824 DL 347.544 591.824 343.944 591.824 DL 354.744 591.824 351.144 591.824 DL 361.944 591.824 358.344 591.824 DL 369.144 591.824 365.544 591.824 DL 369.144 588.224 369.144 591.824 DL 369.144 581.744 369.144 585.344 DL 369.144 575.264 369.144 578.864 DL 369.144 568.784 369.144 572.384 DL 369.144 562.304 369.144 565.904 DL 369.144 555.824 369.144 559.424 DL 365.544 555.824 369.144 555.824 DL 358.344 555.824 361.944 555.824 DL 351.144 555.824 354.744 555.824 DL 343.944 555.824 347.544 555.824 DL 336.744 555.824 340.344 555.824 DL 329.544 555.824 333.144 555.824 DL 322.344 555.824 325.944 555.824 DL 315.144 555.824 318.744 555.824 DL 315.144 559.424 315.144 555.824 DL 315.144 565.904 315.144 562.304 DL 315.144 572.384 315.144 568.784 DL 315.144 578.864 315.144 575.264 DL 315.144 585.344 315.144 581.744 DL 315.144 591.824 315.144 588.224 DL(Hi!)335.479 576.024 Q (Figure 11-2: Adding a caption using interior labeling)182.035 641.68 Q -1.1(Yo)97 669.28 S 2.993(uc)1.1 G .492 (an also use interior labels in either part of a)-2.993 F F1(with)2.992 E F0(modi\214er)2.992 E 5.492(.T)-.55 G .492(his means that the e)-5.492 F .492(xample com-)-.15 F(posite could be placed relati)72 681.28 Q .3 -.15(ve t)-.25 H 2.5(oi).15 G(ts caption box by a command containing) -2.5 E F1(with A.Caption at)2.5 E F0(.)A 1.121(Blocks may be nested.)97 696.88 R 1.121(This means you can use block attachment points to b)6.121 F 1.122(uild up comple)-.2 F 3.622(xd)-.15 G(ia-)-3.622 E .156 (grams hierarchically)72 708.88 R 2.656(,f)-.65 G .156 (rom the inside out.)-2.656 F .155(Note that)5.155 F F1(last)2.655 E F0 .155(and the other sequential naming mechanisms don')2.655 F(t)-.18 E (look inside blocks, so if you ha)72 720.88 Q .3 -.15(ve a p)-.2 H (rogram that looks lik).15 E(e)-.1 E EP %%Page: 18 18 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-18-)279.67 48 Q/F1 10/Courier@0 SF(.PS)108 84 Q (P: [box "foo"; ellipse "bar"];)108 96 Q(Q: [)108 108 Q ([box "baz"; ellipse "quxx"])133 120 Q("random text";)133 132 Q(])126 144 Q(arrow from 2nd last [];)108 156 Q(.PE)108 168 Q F0(the arro)72 189.6 Q 2.5(wi)-.25 G 2.5(nt)-2.5 G (he last line will be attached to object)-2.5 E/F2 10/Times-Bold@0 SF(P) 2.5 E F0 2.5(,n)C(ot object)-2.5 E F2(Q)2.5 E F0(.)A .113(In D)97 205.2 R(WB)-.3 E F2(pic)2.613 E F0 2.613(,o)C .113(nly references one le) -2.613 F -.15(ve)-.25 G 2.613(ld).15 G .113 (eep into enclosed blocks were permitted. GNU)-2.613 F F2(gpic)2.614 E F0(remo)2.614 E -.15(ve)-.15 G(s).15 E(this restriction.)72 217.2 Q .913 (The combination of block v)97 232.8 R .913 (ariable scoping, assignability of labels and the macro f)-.25 F .912 (acility that we')-.1 F(ll)-.1 E .406 (describe later on can be used to simulate functions with local v)72 244.8 R .407(ariables \(just wrap the macro body in block)-.25 F (braces\).)72 256.8 Q F2 2.5(12. Style)72 280.8 R -.92(Va)2.5 G(riables) .92 E F0 .914(There are a number of global style v)97 296.4 R .913 (ariables in)-.25 F F2(pic)3.413 E F0 .913 (that can be used to change its o)3.413 F -.15(ve)-.15 G .913(rall beha) .15 F(vior)-.2 E(.)-.55 E -.8(We)72 308.4 S -1.65 -.5('v e).8 H .758 (mentioned se)3.758 F -.15(ve)-.25 G .758(ral of them in pre).15 F .758 (vious sections.)-.25 F(The)5.758 E(y')-.15 E .758 (re all described here.)-.5 F -.15(Fo)5.758 G 3.258(re).15 G .758(ach v) -3.258 F .758(ariable, the)-.25 F(def)72 320.4 Q(ault is gi)-.1 E -.15 (ve)-.25 G(n.).15 E F2(Style V)72 340.4 Q 12.5(ariable Default What)-.92 F(It Does)2.5 E .08 LW 371.35 346.9 72 346.9 DL 186.07 328.9 186.07 348.9 DL 139.41 328.9 139.41 348.9 DL F0 59.21(boxht 0.5)72 358.4 R(Def) 24.58 E(ault height of a box)-.1 E 51.99(boxwid 0.75)72 370.4 R(Def) 19.58 E(ault height of a box)-.1 E 59.21(lineht 0.5)72 382.4 R(Def)24.58 E(ault length of v)-.1 E(ertical line)-.15 E(line)72 394.4 Q 52.24 (wid 0.75)-.25 F(Def)19.58 E(ault length of horizontal line)-.1 E 57.01 (arcrad 0.25)72 406.4 R(Def)19.58 E(ault radius of an arc)-.1 E 47.01 (circlerad 0.25)72 418.4 R(Def)19.58 E(ault radius of a circle)-.1 E 48.1(ellipseht 0.5)72 430.4 R(Def)24.58 E(ault height of an ellipse)-.1 E(ellipse)72 442.4 Q 41.13(wid 0.75)-.25 F(Def)19.58 E (ault width of an ellipse)-.1 E(mo)72 454.4 Q -.15(ve)-.15 G 52.29 (ht 0.5).15 F(Def)24.58 E(ault length of v)-.1 E(ertical mo)-.15 E -.15 (ve)-.15 G(mo)72 466.4 Q -.15(ve)-.15 G 45.32(wid 0.75)-.1 F(Def)19.58 E (ault length of horizontal mo)-.1 E -.15(ve)-.15 G(te)72 478.4 Q 59.36 (xtht 0)-.15 F(Def)32.08 E(ault height of box enclosing a te)-.1 E (xt object)-.15 E(te)72 490.4 Q 52.14(xtwid 0)-.15 F(Def)32.08 E (ault width of box enclosing a te)-.1 E(xt object)-.15 E(arro)72 502.4 Q 51.14(wht 0.1)-.25 F(Length of arro)24.58 E(whead along shaft)-.25 E (arro)72 514.4 Q 43.92(wwid 0.05)-.25 F -.4(Wi)19.58 G (dth of rear of arro).4 E(whead)-.25 E(arro)72 526.4 Q 40.04(whead 1) -.25 F(Enable/disable arro)32.08 E(whead \214lling)-.25 E 48.66 (dashwid 0.05)72 538.4 R(Interv)19.58 E(al for dashed lines)-.25 E 35.88 (maxpswid 11)72 550.4 R(Maximum width of picture)32.08 E 48.1 (maxpsht 8.5)72 562.4 R(Maximum height of picture)24.58 E 62(scale 1)72 574.4 R(Unit scale f)32.08 E(actor)-.1 E(\214llv)72 586.4 Q 58.9(al 0.5) -.25 F(Def)24.58 E(ault \214ll v)-.1 E(alue)-.25 E 371.35 595.9 72 595.9 DL 186.07 348.9 186.07 595.9 DL 139.41 348.9 139.41 595.9 DL(An)72 611.4 Q 2.5(yo)-.15 G 2.5(ft)-2.5 G(hese v)-2.5 E (ariables can be set with a simple assignment statement.)-.25 E -.15(Fo) 5 G 2.5(re).15 G(xample:)-2.65 E EP %%Page: 19 19 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-19-)279.67 48 Q 244.8 156 MT 0 -72 RL -21.6 0 RL 0 72 RL CL .4 LW ST 280.8 156 MT 0 -72 RL -21.6 0 RL 0 72 RL CL ST 316.8 156 MT 0 -72 RL -21.6 0 RL 0 72 RL CL ST 352.8 156 MT 0 -72 RL -21.6 0 RL 0 72 RL CL ST(Figure 12-1:)98.615 179 Q/F1 10/Times-Bold@0 SF (boxht=1; boxwid=0.3; mo)2.5 E -.1(ve)-.1 G(wid=0.2; box; mo).1 E -.1 (ve)-.1 G 2.5(;b).1 G(ox; mo)-2.5 E -.1(ve)-.1 G 2.5(;b).1 G(ox; mo)-2.5 E -.1(ve)-.1 G 2.5(;b).1 G(ox;)-2.5 E F0 1.338(In GNU)97 206.6 R F1(pic) 3.838 E F0 3.838(,s)C 1.338(etting the)-3.838 F F1(scale)3.838 E F0 -.25 (va)3.837 G 1.337(riable re-scales all size-related state v).25 F 1.337 (ariables so that their v)-.25 F(alues)-.25 E(remain equi)72 218.6 Q -.25(va)-.25 G(lent in the ne).25 E 2.5(wu)-.25 G(nits.)-2.5 E .118 (The command)97 234.2 R F1 -.18(re)2.618 G(set).18 E F0 .118 (resets all style v)2.618 F .118(ariables to their def)-.25 F 2.618 (aults. Y)-.1 F .118(ou can gi)-1.1 F .418 -.15(ve i)-.25 H -5.117 2.618 (ta c).15 H .119(omma-separated list)-2.618 F(of v)72 246.2 Q (ariable names as ar)-.25 E (guments, in which case it resets only those.)-.18 E(State v)97 261.8 Q (ariables retain their v)-.25 E(alues across pictures until reset.)-.25 E F1 2.5(13. Expr)72 285.8 R(essions, V)-.18 E(ariables, and Assignment) -.92 E F0 2.85(An)97 301.4 S .35(umber is a v)-2.85 F .35(alid e)-.25 F .35(xpression, of course \(all numbers are stored internally as \215oat\ ing-point\).)-.15 F(Deci-)5.35 E .092 (mal-point notation is acceptable; in GNU)72 313.4 R F1(gpic)2.592 E F0 2.592(,s)C .093(cienti\214c notation in C')-2.592 F 2.593(s`)-.55 G .093 (e' format \(lik)-2.593 F(e)-.1 E/F2 10/Courier@0 SF(5e-2)2.593 E F0 2.593(\)i)C 2.593(sa)-2.593 G(ccepted.)-2.593 E(An)97 329 Q .092 (ywhere a number is e)-.15 F .091 (xpected, the language will also accept a v)-.15 F 2.591(ariable. V)-.25 F .091(ariables may be the b)-1.11 F(uilt-)-.2 E(in style v)72 341 Q (ariable described in the last section, or ne)-.25 E 2.5(wv)-.25 G (ariables created by assignment.)-2.75 E -.3(DW)97 356.6 S(B).3 E F1 (pic)2.592 E F0 .093 (supports only the ordinary assignment via =, de\214nes the v)2.592 F .093(ariable in the current block if it is)-.25 F .301 (not already de\214ned there, and then changes the v)72 368.6 R .301 (alue in the current block.)-.25 F(GNU)5.301 E F1(gpic)2.801 E F0 .301 (supports an alternate)2.801 F .8(form of assignment using :=. The)72 380.6 R/F3 10/Times-Italic@0 SF(variable)3.3 E F0 .801 (\(right side\) must already be de\214ned, and the v)3.3 F .801(alue of) -.25 F F3(variable)3.301 E F0 (will be changed only in the innermost block in which it is de\214ned.) 72 392.6 Q -1.1(Yo)97 408.2 S 2.863(uc)1.1 G .363 (an use the height, width, radius, and x and y coordinates of an)-2.863 F 2.863(yo)-.15 G .362(bject or corner in e)-2.863 F(xpressions)-.15 E (If)72 420.2 Q F1(A)2.5 E F0(is an object label or name, all the follo) 2.5 E(wing are v)-.25 E(alid:)-.25 E F2 102(A.x #)108 438.2 R 6(xc)6 G (oordinate of the center of A)-6 E 84(A.ne.y #)108 450.2 R 6(yc)6 G (oordinate of the northeast corner of A)-6 E 90(A.wid #)108 462.2 R (the width of A)6 E 96(A.ht #)108 474.2 R(and its height)6 E (2nd last circle.rad)108 486.2 Q 6(#t)12 G (he radius of the 2nd last circle)-6 E F0(Note the second e)72 504.2 Q (xpression, sho)-.15 E(wing ho)-.25 E 2.5(wt)-.25 G 2.5(oe)-2.5 G (xtract a corner coordinate.)-2.65 E .238 (Basic arithmetic resembling those of C operators are a)97 519.8 R -.25 (va)-.2 G .238(ilable; +, *, -, /, and %.).25 F .239(So is ^ for e)5.239 F(xponen-)-.15 E 3.308(tiation. Grouping)72 531.8 R .808 (is permitted in the usual w)3.308 F .807(ay using parentheses.)-.1 F (GNU)5.807 E F1(gpic)3.307 E F0(allo)3.307 E .807 (ws logical operators to)-.25 F(appear in e)72 543.8 Q (xpressions; ! \(logical ne)-.15 E -.05(ga)-.15 G(tion, not f).05 E (actorial\), &&, ||, ==, !=, >=, <=, <, >.)-.1 E -1.11(Va)97 559.4 S .562(rious b)1.11 F .562(uilt-in functions are supported:)-.2 F F1 (sin\()3.063 E F3(x)A F1(\))A F3(,)A F1(cos\()3.063 E F3(x)A F1(\))A F3 (,)A F1(log\()3.063 E F3(x)A F1(\))A F3(,)A F1(exp\()3.063 E F3(x)A F1 (\))A F3(,)A F1(sqrt\()3.063 E F3(x)A F1(\))A F3(,)A F1(max\()3.063 E F3 (x)A F1(,)A F3(y)A F1(\))A F3(,)A F1(atan2\()3.063 E F3(x)A F1(,)A F3(y) A F1(\))A F3(,)A F1(min\()72 571.4 Q F3(x)A F1(,)A F3(y)A F1(\))A F3(,)A F1(int\()3.818 E F3(x)A F1 1.318(\), and rand\(\), Both exp and log ar)B 3.817(eb)-.18 G 1.317(ase 10; int does integer truncation; and rand\(\)) -3.817 F -.18(re)72 583.4 S(tur).18 E(ns a random number in [0-1\).)-.15 E F0(GNU)97 599 Q F1(gpic)2.603 E F0 .103(also documents a one-ar)2.603 F .104(gument form or rand,)-.18 F F1(rand\()2.604 E F3(x)A F1 .104 (\), which r)B(etur)-.18 E .104(ns a random number)-.15 F(between 1 and) 72 611 Q F3(x)2.5 E F1 2.5(,b)C(ut this is depr)-2.7 E (ecated and may be r)-.18 E(emo)-.18 E -.1(ve)-.1 G 2.5(di).1 G 2.5(naf) -2.5 G(utur)-2.5 E 2.5(ev)-.18 G(ersion.)-2.6 E F0(The function)97 626.6 Q F1(sprintf\(\))2.5 E F0(beha)2.5 E -.15(ve)-.2 G 2.5(sl).15 G(ik)-2.5 E 2.5(eaC)-.1 G F3(sprintf)A F0(\(3\) that only tak)A (es %, %e, %f, and %g format strings.)-.1 E F1 2.5(14. Macr)72 650.6 R (os)-.18 E F0 -1.1(Yo)97 666.2 S 3(uc)1.1 G .5(an de\214ne macros in)-3 F F1(pic)3 E F0 5.5(.T)C .499(his is useful for diagrams with repetiti) -5.5 F .799 -.15(ve p)-.25 H 2.999(arts. In).15 F .499(conjunction with) 2.999 F(the scope rules for block composites, it ef)72 678.2 Q(fecti) -.25 E -.15(ve)-.25 G(ly gi).15 E -.15(ve)-.25 G 2.5(sy).15 G (ou the ability to write functions.)-2.5 E(The syntax is)97 693.8 Q F1 (de\214ne)108 711.8 Q F3(name)6 E F1({)6 E F3 -.37(re)6 G(placement te) .37 E(xt)-.2 E F1(})2.5 E EP %%Page: 20 20 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-20-)279.67 48 Q .217(This de\214nes)72 84 R/F1 10/Times-Italic@0 SF(name)2.717 E F0 .218 (as a macro to be replaced by the replacement te)2.717 F .218 (xt \(not including the braces\).)-.15 F .218(The macro)5.218 F (may be called as)72 96 Q F1(name)108 114 Q/F2 10/Times-Bold@0 SF(\()A F1(ar)A(g1, ar)-.37 E(g2, ... ar)-.37 E(gn)-.37 E F2(\))A F0(The ar)72 135.6 Q(guments \(if an)-.18 E(y\) will be substituted for tok)-.15 E (ens $1, $2 ... $n appearing in the replacement te)-.1 E(xt.)-.15 E (As an e)97 151.2 Q(xample of macro use, consider the follo)-.15 E (wing:)-.25 E/F3 10/Courier@0 SF(.PS)108 169.2 Q 6(#P)108 181.2 S (lot a single jumper in a $1 by $2 box, $3 is the on-off state)-6 E (define jumper { [)108 193.2 Q(shrinkfactor = 0.8;)132 205.2 Q (Outer: box invis wid 0.5 ht 1;)132 217.2 Q 6(#C)132 241.2 S (ount on end ] to reset these)-6 E (boxwid = Outer.wid * shrinkfactor / 2;)132 253.2 Q 6(boxht =)132 265.2 R 6(Outer.ht *)6 F(shrinkfactor / 2;)6 E (box fill \(!$1\) with .s at center of Outer;)132 289.2 Q (box fill \($1\))132 301.2 Q(with .n at center of Outer;)12 E 6(]})108 313.2 S 6(#P)108 337.2 S(lot a block of six jumpers)-6 E (define jumperblock {)108 349.2 Q(jumper\($1\);)132 361.2 Q (jumper\($2\);)132 373.2 Q(jumper\($3\);)132 385.2 Q(jumper\($4\);)132 397.2 Q(jumper\($5\);)132 409.2 Q(jumper\($6\);)132 421.2 Q 6(jwidth =) 132 445.2 R(last [].Outer.wid;)6 E(jheight = last [].Outer.ht;)132 457.2 Q(box with .nw at 6th last [].nw wid 6*jwidth ht jheight;)132 481.2 Q 6 (#U)132 505.2 S(se {} to avoid changing position from last box draw.)-6 E 6(#T)132 517.2 S (his is necessary so move in any direction will work as expected)-6 E ({"Jumpers in state $1$2$2$3$4$5$6" at last box .s + \(0, -0.2\);})132 529.2 Q(})108 541.2 Q 6(#S)108 565.2 S(ample macro invocations)-6 E (jumperblock\(1,1,0,0,1,0\);)108 577.2 Q(move;)108 589.2 Q (jumperblock\(1,0,1,0,1,1\);)108 601.2 Q F0(It yields the follo)72 630.2 Q(wing:)-.25 E EP %%Page: 21 21 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-21-)279.67 48 Q 97.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 97.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL .4 LW ST 97.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 97.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 133.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 133.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 133.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 133.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 169.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 169.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 169.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 169.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 205.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 205.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 205.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 205.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 241.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 241.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 241.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 241.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 277.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 277.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 277.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 277.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 288 156 MT 0 -72 RL -216 0 RL 0 72 RL CL ST (Jumpers in state 1110010)129.03 172.6 Q 349.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 349.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 349.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 349.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 385.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 385.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 385.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 385.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 421.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 421.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 421.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 421.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 457.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 457.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 457.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 457.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 493.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 493.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 493.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 493.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 529.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 1.0000 FL 529.2 120 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 529.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL 0.0000 FL 529.2 148.8 MT 0 -28.8 RL -14.4 0 RL 0 28.8 RL CL ST 540 156 MT 0 -72 RL -216 0 RL 0 72 RL CL ST (Jumpers in state 1001011)381.03 172.6 Q (Figure 14-1: Sample use of a macro)216.345 193.4 Q .645(This macro e)72 221 R .645(xample illustrates ho)-.15 F 3.145(wy)-.25 G .645 (ou can combine [], brace grouping, and v)-3.145 F .644 (ariable assignment to write)-.25 F(true functions.)72 233 Q .251 (One detail the e)97 248.6 R .251(xample abo)-.15 F .552 -.15(ve d)-.15 H .252(oes not illustrate is the f).15 F .252(act that macro ar)-.1 F .252(gument parsing is not tok)-.18 F(en-)-.1 E 2.662(oriented. If)72 260.6 R .162(you call)2.662 F/F1 10/Times-Bold@0 SF .162(jumper\( 1 \)) 2.662 F F0 2.662(,t)C .162(he v)-2.662 F .161(alue of $1 will be)-.25 F F1 2.661("1")2.661 G F0 2.661(.Y)-2.661 G .161(ou could e)-3.761 F -.15 (ve)-.25 G 2.661(nc).15 G(all)-2.661 E F1 2.661(jumper\(big string\)) 2.661 F F0(to)2.661 E(gi)72 272.6 Q .3 -.15(ve $)-.25 H 2.5(1t).15 G (he v)-2.5 E(alue)-.25 E F1 2.5("big string")2.5 F F0(.)A .272(If you w) 97 288.2 R .272(ant to pass in a coordinate pair)-.1 F 2.773(,y)-.4 G .273(ou can a)-2.773 F -.2(vo)-.2 G .273 (id getting tripped up by the comma by wrapping).2 F (the pair in parentheses.)72 300.2 Q(Macros persist through pictures.)97 315.8 Q 1.6 -.8(To u)5 H(nde\214ne a mcro, say).8 E F1(undef)2.5 E/F2 10 /Times-Italic@0 SF(name)2.5 E F0 2.5(;f)C(or e)-2.5 E(xample,)-.15 E/F3 10/Courier@0 SF(undef jumper)108 333.8 Q(undef jumperblock)108 345.8 Q F0 -.1(wo)72 367.4 S(uld unde\214ne the tw).1 E 2.5(om)-.1 G (acros in the jumper block e)-2.5 E(xample.)-.15 E F1 2.5 (15. Import/Export)72 391.4 R(Commands)2.5 E F0 (Commands that import or e)97 407 Q(xport data between)-.15 E F1(pic)2.5 E F0(and its en)2.5 E(vironment are described here.)-.4 E F1 2.5 (15.1. File)72 431 R(and T)2.5 E(able Insertion)-.92 E F0(The statement) 97 446.6 Q F3(copy)108 464.6 Q F2(\214lename)2.5 E F0 .465 (inserts the contents of)72 482.6 R F2(\214lename)2.965 E F0 .465 (in the)2.965 F F1(pic)2.965 E F0 .465(input stream.)2.965 F(An)5.465 E 2.965(y.)-.15 G .464(PS/.PE pair in the \214le will be ignored.)-2.965 F (This,)5.464 E(you can use this to include pre-generated images.)72 494.6 Q 2.5(Av)97 510.2 S(ariant of this statement replicates the)-2.75 E F1(copy thru)2.5 E F0(feature of)2.5 E F2(gr)2.5 E(ap)-.15 E F0 2.5 (\(1\). If)B(you say)2.5 E F3(copy)108 528.2 Q F2(\214lename)2.5 E F3 (thru)2.5 E F2(macr)2.5 E(o)-.45 E F0 .708(calls the)72 549.8 R F2(macr) 3.208 E(o)-.45 E F0 .708(\(which may be either a name or replacement te) 3.208 F .708(xt\) on the ar)-.15 F .709(guments obtained by breaking) -.18 F .432(each line of the \214le into blank-separated \214elds.)72 561.8 R .432(The macro may ha)5.432 F .732 -.15(ve u)-.2 H 2.932(pt).15 G 2.931(o9a)-2.932 G -.18(rg)-2.931 G 2.931(uments. The).18 F (replacement)2.931 E(te)72 573.8 Q .709 (xt may be delimited by braces or by a pair of instances of an)-.15 F 3.21(yc)-.15 G .71(haracter not appearing in the rest of the)-3.21 F(te) 72 585.8 Q(xt.)-.15 E(If you write)97 601.4 Q F3(copy thru)108 619.4 Q F2(macr)2.5 E(o)-.45 E F0 (omitting the \214lename, lines to be parsed are tak)72 641 Q (en from the input source up to the ne)-.1 E(xt .PE.)-.15 E .404 (In either of the)97 656.6 R F1(copy)2.904 E F0 .404(commands, GNU)2.904 F F1(gpic)2.904 E F0 .403(permits a trailing `)2.904 F F1(until)A F2 (wor)2.903 E(d)-.37 E F0 2.903('c)C .403(lause to be added which)-2.903 F .458(terminates the cop)72 668.6 R 2.958(yw)-.1 G .458 (hen the \214rst w)-2.958 F .459(ord matches the ar)-.1 F .459 (gument \(the def)-.18 F .459(ault beha)-.1 F .459 (vior is therefore equi)-.2 F -.25(va)-.25 G(lent).25 E(to)72 680.6 Q F1 (until .PE)2.5 E F0(,)A(Accordingly)97 696.2 Q 2.5(,t)-.65 G(he command) -2.5 E F3(.PS)122 711.8 Q(copy thru % circle at \($1,$2\) % until "END") 122 723.8 Q EP %%Page: 22 22 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-22-)279.67 48 Q/F1 10/Courier@0 SF 6(12)122 84 S 6(34)122 96 S 6(56)122 108 S(END)122 120 Q(box)122 132 Q(.PE)122 144 Q F0(is equi)72 159.6 Q -.25(va)-.25 G(lent to).25 E F1(.PS)122 175.2 Q (circle at \(1,2\))122 187.2 Q(circle at \(3,4\))122 199.2 Q (circle at \(5,6\))122 211.2 Q(box)122 223.2 Q(.PE)122 235.2 Q/F2 10 /Times-Bold@0 SF 2.5(15.2. Deb)72 259.2 R(ug Messages)-.2 E F0 .978 (The command)97 274.8 R F2(print)3.478 E F0 .977(accepts an)3.478 F 3.477(yn)-.15 G .977(umber of comma-separated ar)-3.477 F .977 (guments, concatenates their output)-.18 F .805 (forms, and writes the result to standard error)72 286.8 R 5.805(.E)-.55 G .805(ach ar)-5.805 F .805(gument must be an e)-.18 F .805 (xpression, a position, or a te)-.15 F(xt)-.15 E(string.)72 298.8 Q F2 2.5(15.3. Escape)72 322.8 R(to P)2.5 E(ost-Pr)-.2 E(ocessor)-.18 E F0 (If you write)97 338.4 Q F2(command)108 356.4 Q/F3 10/Times-Italic@0 SF (ar)2.5 E(g)-.37 E F0 1.666(...)1.666 G F2(pic)72 378 Q F0 1.548 (concatenates the ar)4.048 F 1.547 (guments and pass them through as a line to trof)-.18 F 4.047(fo)-.25 G 4.047(rT)-4.047 G(E)-5.714 2.24 M 4.047(X. Each)-1.25 -2.24 N F3(ar) 4.047 E(g)-.37 E F0 1.547(must be an)4.047 F -.15(ex)72 390 S .084 (pression, a position, or te).15 F 2.584(xt. This)-.15 F .084 (has a similar ef)2.584 F .084(fect to a line be)-.25 F .084 (ginning with)-.15 F F2(.)2.584 E F0(or)5.085 E F2(\\)2.585 E F0 2.585 (,b)C .085(ut allo)-2.785 F .085(ws the v)-.25 F(alues)-.25 E(of v)72 402 Q(ariables to be passed through.)-.25 E F2 2.5(15.4. Executing)72 426 R(Shell Commands)2.5 E F0(The command)97 441.6 Q F1(sh {)108 459.6 Q F3(anything)6 E(...)-.15 E F1(})6 E F0(macroe)72 481.2 Q 1.563 (xpands the te)-.15 F 1.563(xt in braces, then e)-.15 F -.15(xe)-.15 G 1.563(cutes it as a shell command.).15 F 1.563 (This could be used to generate)6.563 F .755 (images or data tables for later inclusion.)72 493.2 R .756 (The delimiters sho)5.756 F .756(wn as {} here may also be tw)-.25 F 3.256(oc)-.1 G .756(opies of an)-3.256 F(y)-.15 E 1.397 (one character not present in the shell command te)72 505.2 R 3.897 (xt. In)-.15 F 1.397(either case, the body may contain balanced {})3.897 F 2.5(pairs. Strings)72 517.2 R (in the body may contain balanced or unbalanced braces in an)2.5 E 2.5 (yc)-.15 G(ase.)-2.5 E F2 2.5(16. Contr)72 541.2 R(ol-\215o)-.18 E 2.5 (wc)-.1 G(onstructs)-2.5 E F0(The)97 556.8 Q F2(pic)2.5 E F0 (language pro)2.5 E(vides conditionals and looping.)-.15 E -.15(Fo)5 G 2.5(re).15 G(xample,)-2.65 E F1(pi = atan2\(0, -1\);)108 574.8 Q (for i = 0 to 2 * pi by 0.1 do {)108 586.8 Q("-" at \(i/2, 0\);)132 598.8 Q("." at \(i/2, sin\(i\)/2\);)132 610.8 Q (":" at \(i/2, cos\(i\)/2\);)132 622.8 Q(})108 634.8 Q F0 (which yields this:)72 656.4 Q EP %%Page: 23 23 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-23-)279.67 48 Q(-)174.735 122.2 Q(.)175.15 122.2 Q(:)175.01 86.2 Q(-)178.335 122.2 Q(.)178.75 118.6 Q(:)178.61 86.344 Q(-)181.935 122.2 Q(.)182.35 115.072 Q(:)182.21 86.92 Q(-)185.535 122.2 Q(.)185.95 111.544 Q(:)185.81 87.784 Q(-)189.135 122.2 Q(.)189.55 108.16 Q(:)189.41 89.008 Q(-)192.735 122.2 Q(.)193.15 104.92 Q(:)193.01 90.592 Q(-)196.335 122.2 Q(.)196.75 101.896 Q(:)196.61 92.464 Q(-) 199.935 122.2 Q(.)200.35 99.016 Q(:)200.21 94.696 Q(-)203.535 122.2 Q(.) 203.95 96.352 Q(:)203.81 97.144 Q(-)207.135 122.2 Q(.)207.55 93.976 Q(:) 207.41 99.808 Q(-)210.735 122.2 Q(.)211.15 91.888 Q(:)211.01 102.76 Q(-) 214.335 122.2 Q(.)214.75 90.088 Q(:)214.61 105.856 Q(-)217.935 122.2 Q (.)218.35 88.648 Q(:)218.21 109.168 Q(-)221.535 122.2 Q(.)221.95 87.496 Q(:)221.81 112.552 Q(-)225.135 122.2 Q(.)225.55 86.704 Q(:)225.41 116.08 Q(-)228.735 122.2 Q(.)229.15 86.272 Q(:)229.01 119.68 Q(-)232.335 122.2 Q(.)232.75 86.2 Q(:)232.61 123.28 Q(-)235.935 122.2 Q(.)236.35 86.488 Q (:)236.21 126.808 Q(-)239.535 122.2 Q(.)239.95 87.136 Q(:)239.81 130.408 Q(-)243.135 122.2 Q(.)243.55 88.144 Q(:)243.41 133.864 Q(-)246.735 122.2 Q(.)247.15 89.44 Q(:)247.01 137.176 Q(-)250.335 122.2 Q(.)250.75 91.096 Q(:)250.61 140.344 Q(-)253.935 122.2 Q(.)254.35 93.112 Q(:)254.21 143.368 Q(-)257.535 122.2 Q(.)257.95 95.344 Q(:)257.81 146.176 Q(-) 261.135 122.2 Q(.)261.55 97.864 Q(:)261.41 148.768 Q(-)264.735 122.2 Q (.)265.15 100.672 Q(:)265.01 151.072 Q(-)268.335 122.2 Q(.)268.75 103.624 Q(:)268.61 153.016 Q(-)271.935 122.2 Q(.)272.35 106.792 Q(:) 272.21 154.744 Q(-)275.535 122.2 Q(.)275.95 110.176 Q(:)275.81 156.112 Q (-)279.135 122.2 Q(.)279.55 113.56 Q(:)279.41 157.12 Q(-)282.735 122.2 Q (.)283.15 117.088 Q(:)283.01 157.84 Q(-)286.335 122.2 Q(.)286.75 120.688 Q(:)286.61 158.2 Q(-)289.935 122.2 Q(.)290.35 124.288 Q(:)290.21 158.128 Q(-)293.535 122.2 Q(.)293.95 127.888 Q(:)293.81 157.768 Q(-)297.135 122.2 Q(.)297.55 131.416 Q(:)297.41 156.976 Q(-)300.735 122.2 Q(.)301.15 134.8 Q(:)301.01 155.896 Q(-)304.335 122.2 Q(.)304.75 138.112 Q(:)304.61 154.456 Q(-)307.935 122.2 Q(.)308.35 141.28 Q(:)308.21 152.728 Q(-) 311.535 122.2 Q(.)311.95 144.232 Q(:)311.81 150.64 Q(-)315.135 122.2 Q (.)315.55 146.968 Q(:)315.41 148.336 Q(-)318.735 122.2 Q(.)319.15 149.416 Q(:)319.01 145.744 Q(-)322.335 122.2 Q(.)322.75 151.648 Q(:) 322.61 142.864 Q(-)325.935 122.2 Q(.)326.35 153.592 Q(:)326.21 139.84 Q (-)329.535 122.2 Q(.)329.95 155.176 Q(:)329.81 136.6 Q(-)333.135 122.2 Q (.)333.55 156.472 Q(:)333.41 133.288 Q(-)336.735 122.2 Q(.)337.15 157.408 Q(:)337.01 129.76 Q(-)340.335 122.2 Q(.)340.75 157.984 Q(:) 340.61 126.232 Q(-)343.935 122.2 Q(.)344.35 158.2 Q(:)344.21 122.632 Q (-)347.535 122.2 Q(.)347.95 158.056 Q(:)347.81 119.032 Q(-)351.135 122.2 Q(.)351.55 157.552 Q(:)351.41 115.504 Q(-)354.735 122.2 Q(.)355.15 156.688 Q(:)355.01 111.976 Q(-)358.335 122.2 Q(.)358.75 155.536 Q(:) 358.61 108.592 Q(-)361.935 122.2 Q(.)362.35 154.024 Q(:)362.21 105.352 Q (-)365.535 122.2 Q(.)365.95 152.152 Q(:)365.81 102.256 Q(-)369.135 122.2 Q(.)369.55 149.992 Q(:)369.41 99.376 Q(-)372.735 122.2 Q(.)373.15 147.616 Q(:)373.01 96.712 Q(-)376.335 122.2 Q(.)376.75 144.952 Q(:) 376.61 94.264 Q(-)379.935 122.2 Q(.)380.35 142 Q(:)380.21 92.176 Q(-) 383.535 122.2 Q(.)383.95 138.904 Q(:)383.81 90.304 Q(-)387.135 122.2 Q (.)387.55 135.664 Q(:)387.41 88.792 Q(-)390.735 122.2 Q(.)391.15 132.28 Q(:)391.01 87.64 Q(-)394.335 122.2 Q(.)394.75 128.752 Q(:)394.61 86.776 Q(-)397.935 122.2 Q(.)398.35 125.224 Q(:)398.21 86.344 Q (Figure 16-1: Plotting with a)214.79 179 Q/F1 10/Times-Bold@0 SF -.25 (fo)2.5 G(r).25 E F0(loop)2.5 E(The syntax of the)72 206.6 Q F1 -.25(fo) 2.5 G(r).25 E F0(statement is:)2.5 E F1 -.25(fo)108 224.6 S(r).25 E/F2 10/Times-Italic@0 SF(variable)2.5 E F1(=)2.5 E F2 -.2(ex)2.5 G(pr1).2 E F1(to)2.5 E F2 -.2(ex)2.5 G(pr2).2 E F0([)2.5 E F1(by)A F0([)2.5 E F1(*) A F0(])A F2 -.2(ex)C(pr3).2 E F0(])A F1(do)2.5 E F2 2.5(Xb)2.5 G(ody X) -2.5 E F0 .679(The semantics are as follo)72 242.6 R 3.179(ws: Set)-.25 F F2(variable)3.179 E F0(to)3.179 E F2 -.2(ex)3.179 G(pr).2 E F0 -3.179 3.179(1. W)D .68(hile the v)-3.179 F .68(alue of)-.25 F F2(variable)3.18 E F0 .68(is less than or equal to)3.18 F F2 -.2(ex)72 254.6 S(pr2).2 E F0 3.407(,d)C(o)-3.407 E F2(body)3.407 E F0 .907(and increment)3.407 F F2(variable)3.407 E F0(by)3.407 E F2 -.2(ex)3.406 G(pr3).2 E F0 3.406 (;i)C(f)-3.406 E F1(by)3.406 E F0 .906(is not gi)3.406 F -.15(ve)-.25 G .906(n, increment).15 F F2(variable)3.406 E F0 .906(by 1.)3.406 F(If) 5.906 E F2 -.2(ex)3.406 G(pr3).2 E F0(is)3.406 E(pre\214x)72 266.6 Q .976(ed by)-.15 F F1(*)3.476 E F0(then)3.476 E F2(variable)3.476 E F0 .976(will instead be multiplied by)3.476 F F2 -.2(ex)3.476 G(pr3).2 E F0 (.)A F2(X)5.976 E F0 .976(can be an)3.476 F 3.476(yc)-.15 G .977 (haracter not occurring in)-3.476 F F2(body)72 278.6 Q F0 2.5(;o)C 2.5 (rt)-2.5 G(he tw)-2.5 E 2.5(oX)-.1 G 2.5(sm)-2.5 G (ay be paired braces \(as in the)-2.5 E F1(sh)2.5 E F0(command\).)2.5 E (The syntax of the)97 294.2 Q F1(if)2.5 E F0(statement is as follo)2.5 E (ws:)-.25 E F1(if)108 312.2 Q F2 -.2(ex)2.5 G(pr).2 E F1(then)2.5 E F2 2.5(Xi)2.5 G(f-true X)-2.5 E F0([)2.5 E F1(else)A F2 2.5(Yi)2.5 G (f-false Y)-2.5 E F0(])A .38(Its semantics are as follo)72 330.2 R .38 (ws: Ev)-.25 F(aluate)-.25 E F2 -.2(ex)2.88 G(pr).2 E F0 2.88(;i)C 2.88 (fi)-2.88 G 2.88(ti)-2.88 G 2.879(sn)-2.88 G .379(on-zero then do)-2.879 F F2(if-true)2.879 E F0 2.879(,o)C .379(therwise do)-2.879 F F2 (if-false)2.879 E F0(.)A F2(X)5.379 E F0 .379(can be)2.879 F(an)72 342.2 Q 2.5(yc)-.15 G(haracter not occurring in)-2.5 E F2(if-true)2.5 E F0(.)A F2(Y)5 E F0(can be an)2.5 E 2.5(yc)-.15 G(haracter not occurring in)-2.5 E F2(if-false)2.5 E F0(.)A .289(Eithe or both of the X or Y pairs may i\ nstead be balanced pairs of braces \({ and }\) as in the)97 357.8 R F1 (sh)2.79 E F0(com-)2.79 E 3.571(mand. In)72 369.8 R 1.071 (either case, the)3.571 F F2(if-true)3.571 E F0 1.071 (may contain balanced pairs of braces.)3.571 F 1.07 (None of these delimiters will be)6.07 F(seen inside strings.)72 381.8 Q .463(All the usual relational operators my be used in conditional e)97 397.4 R .464(xpressions; ! \(logical ne)-.15 F -.05(ga)-.15 G .464 (tion, not f).05 F(ac-)-.1 E(torial\), &&, ||, ==, !=, >=, <=, <, >.)72 409.4 Q .582(String comparison is also supported using == and !=.)97 425 R .582(String comparisons may need to be parenthe-)5.582 F(sized to a)72 437 Q -.2(vo)-.2 G(id syntactic ambiguities.).2 E F1 2.5(17. Interface) 72 461 R 1.84 -.92(To [)2.5 H(gt]r).92 E(off)-.18 E F0 .295 (The output of)97 476.6 R F1(pic)2.795 E F0(is)2.795 E F1([gt]r)2.795 E (off)-.18 E F0(dra)2.795 E .295(wing commands.)-.15 F .295(The GNU)5.295 F F2(gpic)2.795 E F0 .295(\(1\) command w)B .295(arns that it relies on) -.1 F(dra)72 488.6 Q(wing e)-.15 E(xtensions present in)-.15 E F2(gr)2.5 E(of)-.45 E(f)-.18 E F0(\(1\) that are not present in)A F2(tr)2.5 E(of) -.45 E(f)-.18 E F0(\(1\).)A F1 2.5(17.1. Scaling)72 512.6 R(Ar)2.5 E (guments)-.1 E F0 .793(The D)97 528.2 R(WB)-.3 E F2(pic)3.293 E F0 .793 (\(1\) program will accept one or tw)B 3.293(oa)-.1 G -.18(rg)-3.293 G .793(uments to).18 F F1(.PS)3.293 E F0 3.293(,w)C .793 (hich is interpreted as a width)-3.293 F .284 (and height in inches to which the results of)72 540.2 R F2(pic)2.785 E F0 .285 (\(1\) should be scaled \(width and height scale independently\).)B .128 (If there is only one ar)72 552.2 R .127(gument, it is interpreted as a\ width to scale the picture to, and height will be scaled by)-.18 F (the same proportion.)72 564.2 Q(GNU)97 579.8 Q F1(gpic)3.283 E F0 .783 (is less general; it will accept a single width to scale to, or a zero \ width and a maximum)3.283 F(height to scale to.)72 591.8 Q -.4(Wi)5 G (th tw).4 E 2.5(on)-.1 G(onzero ar)-2.5 E (guments, it will scale to the maximum height.)-.18 E F1 2.5(17.2. Ho)72 615.8 R 2.5(wS)-.1 G(caling is Handled)-2.5 E F0(When)97 631.4 Q F1(pic) 2.558 E F0 .057(processes a picture description on input, it passes .PS\ and .PE through to the postprocessor)2.558 F(.)-.55 E .917 (The .PS gets decorated with tw)72 643.4 R 3.417(on)-.1 G .917 (umeric ar)-3.417 F .917 (guments which are the X and Y dimensions of the picture in)-.18 F 2.5 (inches. The)72 655.4 R(post-processor can use these to reserv)2.5 E 2.5 (es)-.15 G(pace for the picture and center it.)-2.5 E(The)97 671 Q F1 (mgs)2.5 E F0(macros, for e)2.5 E(xample, include the follo)-.15 E (wing de\214nitions:)-.25 E EP %%Page: 24 24 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-24-)279.67 48 Q/F1 10/Courier@0 SF(.de PS)108 84 Q(.br)108 96 Q(.sp \\n[DD]u)108 108 Q(.ie \\n[.$]<2 .@error bad argu\ ments to PS \(not preprocessed with pic?\))108 120 Q(.el .)108 132 Q (ds@need \(u;\\$1\)+1v)20 E 19(.i)108 144 S 6(n+)-19 G (\(u;\\n[.l]-\\n[.i]-\\$2/2>?0\))-6 E(.)108 156 Q(..)108 168 Q(.de PE) 108 180 Q(.par@reset)108 192 Q(.sp \\n[DD]u+.5m)108 204 Q(..)108 216 Q F0(Equi)72 237.6 Q -.25(va)-.25 G 1.608 (lent de\214nition will be supplied by GNU).25 F/F2 10/Times-Italic@0 SF (pic)4.108 E F0 1.607 (\(1\) if you use the -mpic option; this should mak)B 4.107(ei)-.1 G(t) -4.107 E(usable with macro pages other than)72 249.6 Q F2(ms)2.5 E F0 (\(1\).)A 2.431(if .PF is used instead of .PE, the)97 265.2 R/F3 10 /Times-Bold@0 SF(tr)4.931 E(off)-.18 E F0 2.432 (position is restored to what it w)4.932 F 2.432 (as at the picture start)-.1 F(\(K)72 277.2 Q (ernighan notes that the F stands for "\215yback"\).)-.25 E(The in)97 292.8 Q -.2(vo)-.4 G(cation).2 E F3(.PS <)108 310.8 Q F2(\214le)A F0 (causes the contents of)72 332.4 Q F2(\214le)2.5 E F0 (to replace the .PS line.)2.5 E(This feature is deprecated; use)5 E F3 (copy \214le)2.5 E F0(instead\).)2.5 E .352(By def)97 348 R .352 (ault, input lines that be)-.1 F .351 (gin with a period are passed to the postprocessor)-.15 F 2.851(,e)-.4 G .351(mbedded at the cor)-2.851 F(-)-.2 E .661 (responding point in the output.)72 360 R .662 (Messing with horizontal or v)5.662 F .662(ertical spacing is an ob)-.15 F .662(vious recipe for b)-.15 F(ugs,)-.2 E -.2(bu)72 372 S 2.5(tp).2 G (oint size and font changes will usually be safe.)-2.5 E .765 (Point sizes and font changes are also safe within te)97 387.6 R .764 (xt strings, as long as the)-.15 F 3.264(ya)-.15 G .764 (re undone before the)-3.264 F(end of string.)72 399.6 Q(The state of)97 415.2 Q F3([gt]r)2.5 E(off)-.18 E F0 1.1 -.55('s \214)D (ll mode is preserv).55 E(ed across pictures.)-.15 E .542(The K)97 430.8 R .543(ernighan paper notes that there is a subtle problem with complic\ ated equations inside)-.25 F F3(pic)3.043 E F0(pic-)3.043 E .918 (tures; the)72 442.8 R 3.418(yc)-.15 G .918(ome out wrong if)-3.418 F F2 (eqn)3.417 E F0 3.417(\(1\) has)B .917(to lea)3.417 F 1.217 -.15(ve ex) -.2 H .917(tra v).15 F .917(ertical space for the equation.)-.15 F .917 (If your equation)5.917 F(in)72 454.8 Q -.2(vo)-.4 G(lv).2 E .905 (es more than subscripts and superscripts, you must add to the be)-.15 F .906(ginning of each equation the e)-.15 F(xtra)-.15 E(information)72 466.8 Q F1(space 0)2.5 E F0 5(.H)C 2.5(eg)-5 G -2.15 -.25(iv e)-2.5 H 2.5(st).25 G(he follo)-2.5 E(wing e)-.25 E(xample:)-.15 E F1(arrow)108 484.8 Q(box "$space 0 {H\( omega \)} over {1 - H\( omega \)}$")108 496.8 Q(arrow)108 508.8 Q .4 LW 261 550.8 225 550.8 DL 261 550.8 MT -7.2 1.8 RL 0 -3.6 RL CL BL 261 550.8 MT -7.2 1.8 RL 0 -3.6 RL CL ST 315 568.8 MT 0 -36 RL -54 0 RL 0 36 RL CL ST F2(H)277.365 546 Q F0(\().95 E/F4 10 /Symbol-Slanted SF(w)-.35 E F0(\))1.26 E(1)-29.875 14 M/F5 10/Symbol SF (-)2.2 E F2(H)2.78 E F0(\().95 E F4(w)-.35 E 306.66 550.4 269.34 550.4 DL F0(\))303.33 560 Q 351 550.8 315 550.8 DL 351 550.8 MT -7.2 1.8 RL 0 -3.6 RL CL BL 351 550.8 MT -7.2 1.8 RL 0 -3.6 RL CL ST (Figure 17-1: Equations within pictures)210.78 591.8 Q F3 2.5 (18. Interface)72 627.8 R(to T)2.5 E(eX)-.92 E F0(T)97 647 Q(E)-1.667 2.24 M 3.171(Xm)-1.25 -2.24 O .671(ode is enabled by the)-3.171 F F3 3.171 E F0 3.171(option. In)3.171 F(T)3.171 E(E)-1.667 2.24 M 3.171(Xm)-1.25 -2.24 O .671(ode, pic will de\214ne a vbox called)-3.171 F F3(\\graph)3.17 E F0 .67(for each)3.17 F 2.5(picture. Y)72 659 R (ou must yourself print that vbox using, for e)-1.1 E (xample, the command)-.15 E F3(\\centerline{\\box\\graph})97 674.6 Q F0 (Actually)72 690.2 Q 2.568(,s)-.65 G .068 (ince the vbox has a height of zero this will produce slightly more v) -2.568 F .069(ertical space abo)-.15 F .369 -.15(ve t)-.15 H .069 (he picture).15 F(than belo)72 702.2 Q 2.5(wi)-.25 G(t;)-2.5 E F3 (\\centerline{\\raise 1em\\box\\graph})97 717.8 Q EP %%Page: 25 25 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-25-)279.67 48 Q -.1(wo)72 84 S(uld a).1 E -.2 (vo)-.2 G(id this.).2 E -1.1(Yo)97 99.6 S 2.5(um)1.1 G(ust use a T)-2.5 E(E)-1.667 2.24 M 2.5(Xd)-1.25 -2.24 O(ri)-2.5 E -.15(ve)-.25 G 2.5(rt) .15 G(hat supports the)-2.5 E/F1 10/Times-Bold@0 SF(tpic)2.5 E F0 (specials, v)2.5 E(ersion 2.)-.15 E .386(Lines be)97 115.2 R .386 (ginning with)-.15 F F1(\\)2.886 E F0 .385 (are passed through transparently; a)2.886 F F1(%)2.885 E F0 .385 (is added to the end of the line to a)2.885 F -.2(vo)-.2 G(id).2 E(unw) 72 127.2 Q .764(anted spaces.)-.1 F -1.1(Yo)5.764 G 3.264(uc)1.1 G .764 (an safely use this feature to change fonts or to change the v)-3.264 F .765(alue of)-.25 F/F2 10/Times-Italic@0 SF(\\baselineskip)3.265 E F0(.) A(An)72 139.2 Q .718 (ything else may well produce undesirable results; use at your o)-.15 F .718(wn risk.)-.25 F .718(Lines be)5.718 F .718(ginning with a period) -.15 F(are not gi)72 151.2 Q -.15(ve)-.25 G 2.5(na).15 G .3 -.15(ny s) -2.5 H(pecial treatment.).15 E(The)97 166.8 Q/F3 10/Symbol-Slanted SF(t) 2.5 E F0 2.5(xm)C(ode of)-2.5 E F2(pic)2.5 E F0(\(1\) will)A F2(not)2.5 E F0(translate)2.5 E F1(tr)2.5 E(off)-.18 E F0 (font and size changes included in te)2.5 E(xt strings!)-.15 E F1 2.5 (19. Obsolete)72 190.8 R(Commands)2.5 E F0(GNU)97 206.4 Q F2(gpic)2.5 E F0 2.5(\(1\) has)B 2.5(ac)2.5 G(ommand)-2.5 E F1(plot)108 224.4 Q F2 -.2 (ex)2.5 G(pr).2 E F0([)2.5 E F1(")A F2(te)A(xt)-.2 E F1(")A F0(])A .879 (This is a te)72 242.4 R .879(xt object which is constructed by using) -.15 F F2(te)3.379 E(xt)-.2 E F0 .879 (as a format string for sprintf with an ar)3.379 F .879(gument of)-.18 F F2 -.2(ex)72 254.4 S(pr).2 E F0 5.109(.I)C(f)-5.109 E F2(te)2.609 E(xt) -.2 E F0 .109(is omitted a format string of "%g" is used.)2.609 F (Attrib)5.109 E .108(utes can be speci\214ed in the same w)-.2 F .108 (ay as for a)-.1 F .654(normal te)72 266.4 R .654(xt object.)-.15 F .654 (Be v)5.654 F .655 (ery careful that you specify an appropriate format string;)-.15 F F1 (pic)3.155 E F0 .655(does only v)3.155 F .655(ery lim-)-.15 F (ited checking of the string.)72 278.4 Q(This is deprecated in f)5 E -.2 (avo)-.1 G(ur of).2 E F1(sprintf)2.5 E F0(.)A F1 2.5(20. Some)72 302.4 R (Lar)2.5 E(ger Examples)-.1 E F0(Here are a fe)97 318 Q 2.5(wl)-.25 G (ar)-2.5 E(ger e)-.18 E(xamples, with complete source code.)-.15 E (One of our earlier e)97 333.6 Q(xamples is generated in an instructi) -.15 E .3 -.15(ve w)-.25 H(ay using a for loop:).05 E/F4 10/Courier@0 SF (.PS)108 351.6 Q 6(#D)108 363.6 S (raw a demonstration up left arrow with grid box overlay)-6 E (define gridarrow)108 375.6 Q({)108 387.6 Q([)132 399.6 Q ({arrow up left $1;})156 411.6 Q (box wid 0.5 ht 0.5 dotted with .nw at last arrow .end;)156 423.6 Q (for i = 2 to \($1 / 0.5\) do)156 435.6 Q({)156 447.6 Q (box wid 0.5 ht 0.5 dotted with .sw at last box .se;)180 459.6 Q(})156 471.6 Q(move down from last arrow .center;)156 483.6 Q([)156 495.6 Q(if\ \( $1 == boxht \) then { "\\fBline up left\\fP" } else { sprintf\("\\f\ Barrow up left %g\\fP", $1\) };)180 507.6 Q(])156 519.6 Q(])132 531.6 Q (move right from last [] .e;)132 543.6 Q(})108 555.6 Q (gridarrow\(0.5\);)108 567.6 Q(gridarrow\(1\);)108 579.6 Q (gridarrow\(1.5\);)108 591.6 Q(gridarrow\(2\);)108 603.6 Q (undef gridarrow)108 615.6 Q(.PE)108 627.6 Q EP %%Page: 26 26 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-26-)279.67 48 Q .4 LW 72 84 108 120 DL 72 84 MT 6.336 3.816 RL -2.52 2.52 RL CL BL 72 84 MT 6.336 3.816 RL -2.52 2.52 RL CL ST 72 120 72 120 DL 75.6 120 75.6 120 DL 79.2 120 79.2 120 DL 82.8 120 82.8 120 DL 86.4 120 86.4 120 DL 90 120 90 120 DL 93.6 120 93.6 120 DL 97.2 120 97.2 120 DL 100.8 120 100.8 120 DL 104.4 120 104.4 120 DL 108 120 108 120 DL 108 120 108 120 DL 108 116.4 108 116.4 DL 108 112.8 108 112.8 DL 108 109.2 108 109.2 DL 108 105.6 108 105.6 DL 108 102 108 102 DL 108 98.4 108 98.4 DL 108 94.8 108 94.8 DL 108 91.2 108 91.2 DL 108 87.6 108 87.6 DL 108 84 108 84 DL 108 84 108 84 DL 104.4 84 104.4 84 DL 100.8 84 100.8 84 DL 97.2 84 97.2 84 DL 93.6 84 93.6 84 DL 90 84 90 84 DL 86.4 84 86.4 84 DL 82.8 84 82.8 84 DL 79.2 84 79.2 84 DL 75.6 84 75.6 84 DL 72 84 72 84 DL 72 84 72 84 DL 72 87.6 72 87.6 DL 72 91.2 72 91.2 DL 72 94.8 72 94.8 DL 72 98.4 72 98.4 DL 72 102 72 102 DL 72 105.6 72 105.6 DL 72 109.2 72 109.2 DL 72 112.8 72 112.8 DL 72 116.4 72 116.4 DL 72 120 72 120 DL/F1 10/Times-Bold@0 SF(line up left)67.22 140.2 Q 144 84 216 120 DL 144 84 MT 7.272 1.584 RL -1.584 3.24 RL CL BL 144 84 MT 7.272 1.584 RL -1.584 3.24 RL CL ST 144 120 144 120 DL 147.6 120 147.6 120 DL 151.2 120 151.2 120 DL 154.8 120 154.8 120 DL 158.4 120 158.4 120 DL 162 120 162 120 DL 165.6 120 165.6 120 DL 169.2 120 169.2 120 DL 172.8 120 172.8 120 DL 176.4 120 176.4 120 DL 180 120 180 120 DL 180 120 180 120 DL 180 116.4 180 116.4 DL 180 112.8 180 112.8 DL 180 109.2 180 109.2 DL 180 105.6 180 105.6 DL 180 102 180 102 DL 180 98.4 180 98.4 DL 180 94.8 180 94.8 DL 180 91.2 180 91.2 DL 180 87.6 180 87.6 DL 180 84 180 84 DL 180 84 180 84 DL 176.4 84 176.4 84 DL 172.8 84 172.8 84 DL 169.2 84 169.2 84 DL 165.6 84 165.6 84 DL 162 84 162 84 DL 158.4 84 158.4 84 DL 154.8 84 154.8 84 DL 151.2 84 151.2 84 DL 147.6 84 147.6 84 DL 144 84 144 84 DL 144 84 144 84 DL 144 87.6 144 87.6 DL 144 91.2 144 91.2 DL 144 94.8 144 94.8 DL 144 98.4 144 98.4 DL 144 102 144 102 DL 144 105.6 144 105.6 DL 144 109.2 144 109.2 DL 144 112.8 144 112.8 DL 144 116.4 144 116.4 DL 144 120 144 120 DL 180 120 180 120 DL 183.6 120 183.6 120 DL 187.2 120 187.2 120 DL 190.8 120 190.8 120 DL 194.4 120 194.4 120 DL 198 120 198 120 DL 201.6 120 201.6 120 DL 205.2 120 205.2 120 DL 208.8 120 208.8 120 DL 212.4 120 212.4 120 DL 216 120 216 120 DL 216 120 216 120 DL 216 116.4 216 116.4 DL 216 112.8 216 112.8 DL 216 109.2 216 109.2 DL 216 105.6 216 105.6 DL 216 102 216 102 DL 216 98.4 216 98.4 DL 216 94.8 216 94.8 DL 216 91.2 216 91.2 DL 216 87.6 216 87.6 DL 216 84 216 84 DL 216 84 216 84 DL 212.4 84 212.4 84 DL 208.8 84 208.8 84 DL 205.2 84 205.2 84 DL 201.6 84 201.6 84 DL 198 84 198 84 DL 194.4 84 194.4 84 DL 190.8 84 190.8 84 DL 187.2 84 187.2 84 DL 183.6 84 183.6 84 DL 180 84 180 84 DL 180 84 180 84 DL 180 87.6 180 87.6 DL 180 91.2 180 91.2 DL 180 94.8 180 94.8 DL 180 98.4 180 98.4 DL 180 102 180 102 DL 180 105.6 180 105.6 DL 180 109.2 180 109.2 DL 180 112.8 180 112.8 DL 180 116.4 180 116.4 DL 180 120 180 120 DL(arr)148.34 140.2 Q .2 -.1(ow u) -.18 H 2.5(pl).1 G(eft 1)-2.5 E 252 84 360 120 DL 252 84 MT 7.416 .576 RL -1.152 3.384 RL CL BL 252 84 MT 7.416 .576 RL -1.152 3.384 RL CL ST 252 120 252 120 DL 255.6 120 255.6 120 DL 259.2 120 259.2 120 DL 262.8 120 262.8 120 DL 266.4 120 266.4 120 DL 270 120 270 120 DL 273.6 120 273.6 120 DL 277.2 120 277.2 120 DL 280.8 120 280.8 120 DL 284.4 120 284.4 120 DL 288 120 288 120 DL 288 120 288 120 DL 288 116.4 288 116.4 DL 288 112.8 288 112.8 DL 288 109.2 288 109.2 DL 288 105.6 288 105.6 DL 288 102 288 102 DL 288 98.4 288 98.4 DL 288 94.8 288 94.8 DL 288 91.2 288 91.2 DL 288 87.6 288 87.6 DL 288 84 288 84 DL 288 84 288 84 DL 284.4 84 284.4 84 DL 280.8 84 280.8 84 DL 277.2 84 277.2 84 DL 273.6 84 273.6 84 DL 270 84 270 84 DL 266.4 84 266.4 84 DL 262.8 84 262.8 84 DL 259.2 84 259.2 84 DL 255.6 84 255.6 84 DL 252 84 252 84 DL 252 84 252 84 DL 252 87.6 252 87.6 DL 252 91.2 252 91.2 DL 252 94.8 252 94.8 DL 252 98.4 252 98.4 DL 252 102 252 102 DL 252 105.6 252 105.6 DL 252 109.2 252 109.2 DL 252 112.8 252 112.8 DL 252 116.4 252 116.4 DL 252 120 252 120 DL 288 120 288 120 DL 291.6 120 291.6 120 DL 295.2 120 295.2 120 DL 298.8 120 298.8 120 DL 302.4 120 302.4 120 DL 306 120 306 120 DL 309.6 120 309.6 120 DL 313.2 120 313.2 120 DL 316.8 120 316.8 120 DL 320.4 120 320.4 120 DL 324 120 324 120 DL 324 120 324 120 DL 324 116.4 324 116.4 DL 324 112.8 324 112.8 DL 324 109.2 324 109.2 DL 324 105.6 324 105.6 DL 324 102 324 102 DL 324 98.4 324 98.4 DL 324 94.8 324 94.8 DL 324 91.2 324 91.2 DL 324 87.6 324 87.6 DL 324 84 324 84 DL 324 84 324 84 DL 320.4 84 320.4 84 DL 316.8 84 316.8 84 DL 313.2 84 313.2 84 DL 309.6 84 309.6 84 DL 306 84 306 84 DL 302.4 84 302.4 84 DL 298.8 84 298.8 84 DL 295.2 84 295.2 84 DL 291.6 84 291.6 84 DL 288 84 288 84 DL 288 84 288 84 DL 288 87.6 288 87.6 DL 288 91.2 288 91.2 DL 288 94.8 288 94.8 DL 288 98.4 288 98.4 DL 288 102 288 102 DL 288 105.6 288 105.6 DL 288 109.2 288 109.2 DL 288 112.8 288 112.8 DL 288 116.4 288 116.4 DL 288 120 288 120 DL 324 120 324 120 DL 327.6 120 327.6 120 DL 331.2 120 331.2 120 DL 334.8 120 334.8 120 DL 338.4 120 338.4 120 DL 342 120 342 120 DL 345.6 120 345.6 120 DL 349.2 120 349.2 120 DL 352.8 120 352.8 120 DL 356.4 120 356.4 120 DL 360 120 360 120 DL 360 120 360 120 DL 360 116.4 360 116.4 DL 360 112.8 360 112.8 DL 360 109.2 360 109.2 DL 360 105.6 360 105.6 DL 360 102 360 102 DL 360 98.4 360 98.4 DL 360 94.8 360 94.8 DL 360 91.2 360 91.2 DL 360 87.6 360 87.6 DL 360 84 360 84 DL 360 84 360 84 DL 356.4 84 356.4 84 DL 352.8 84 352.8 84 DL 349.2 84 349.2 84 DL 345.6 84 345.6 84 DL 342 84 342 84 DL 338.4 84 338.4 84 DL 334.8 84 334.8 84 DL 331.2 84 331.2 84 DL 327.6 84 327.6 84 DL 324 84 324 84 DL 324 84 324 84 DL 324 87.6 324 87.6 DL 324 91.2 324 91.2 DL 324 94.8 324 94.8 DL 324 98.4 324 98.4 DL 324 102 324 102 DL 324 105.6 324 105.6 DL 324 109.2 324 109.2 DL 324 112.8 324 112.8 DL 324 116.4 324 116.4 DL 324 120 324 120 DL(arr)270.59 140.2 Q .2 -.1(ow u)-.18 H 2.5(pl).1 G(eft 1.5)-2.5 E 396 84 540 120 DL 396 84 MT 7.416 0 RL -.864 3.528 RL CL BL 396 84 MT 7.416 0 RL -.864 3.528 RL CL ST 396 120 396 120 DL 399.6 120 399.6 120 DL 403.2 120 403.2 120 DL 406.8 120 406.8 120 DL 410.4 120 410.4 120 DL 414 120 414 120 DL 417.6 120 417.6 120 DL 421.2 120 421.2 120 DL 424.8 120 424.8 120 DL 428.4 120 428.4 120 DL 432 120 432 120 DL 432 120 432 120 DL 432 116.4 432 116.4 DL 432 112.8 432 112.8 DL 432 109.2 432 109.2 DL 432 105.6 432 105.6 DL 432 102 432 102 DL 432 98.4 432 98.4 DL 432 94.8 432 94.8 DL 432 91.2 432 91.2 DL 432 87.6 432 87.6 DL 432 84 432 84 DL 432 84 432 84 DL 428.4 84 428.4 84 DL 424.8 84 424.8 84 DL 421.2 84 421.2 84 DL 417.6 84 417.6 84 DL 414 84 414 84 DL 410.4 84 410.4 84 DL 406.8 84 406.8 84 DL 403.2 84 403.2 84 DL 399.6 84 399.6 84 DL 396 84 396 84 DL 396 84 396 84 DL 396 87.6 396 87.6 DL 396 91.2 396 91.2 DL 396 94.8 396 94.8 DL 396 98.4 396 98.4 DL 396 102 396 102 DL 396 105.6 396 105.6 DL 396 109.2 396 109.2 DL 396 112.8 396 112.8 DL 396 116.4 396 116.4 DL 396 120 396 120 DL 432 120 432 120 DL 435.6 120 435.6 120 DL 439.2 120 439.2 120 DL 442.8 120 442.8 120 DL 446.4 120 446.4 120 DL 450 120 450 120 DL 453.6 120 453.6 120 DL 457.2 120 457.2 120 DL 460.8 120 460.8 120 DL 464.4 120 464.4 120 DL 468 120 468 120 DL 468 120 468 120 DL 468 116.4 468 116.4 DL 468 112.8 468 112.8 DL 468 109.2 468 109.2 DL 468 105.6 468 105.6 DL 468 102 468 102 DL 468 98.4 468 98.4 DL 468 94.8 468 94.8 DL 468 91.2 468 91.2 DL 468 87.6 468 87.6 DL 468 84 468 84 DL 468 84 468 84 DL 464.4 84 464.4 84 DL 460.8 84 460.8 84 DL 457.2 84 457.2 84 DL 453.6 84 453.6 84 DL 450 84 450 84 DL 446.4 84 446.4 84 DL 442.8 84 442.8 84 DL 439.2 84 439.2 84 DL 435.6 84 435.6 84 DL 432 84 432 84 DL 432 84 432 84 DL 432 87.6 432 87.6 DL 432 91.2 432 91.2 DL 432 94.8 432 94.8 DL 432 98.4 432 98.4 DL 432 102 432 102 DL 432 105.6 432 105.6 DL 432 109.2 432 109.2 DL 432 112.8 432 112.8 DL 432 116.4 432 116.4 DL 432 120 432 120 DL 468 120 468 120 DL 471.6 120 471.6 120 DL 475.2 120 475.2 120 DL 478.8 120 478.8 120 DL 482.4 120 482.4 120 DL 486 120 486 120 DL 489.6 120 489.6 120 DL 493.2 120 493.2 120 DL 496.8 120 496.8 120 DL 500.4 120 500.4 120 DL 504 120 504 120 DL 504 120 504 120 DL 504 116.4 504 116.4 DL 504 112.8 504 112.8 DL 504 109.2 504 109.2 DL 504 105.6 504 105.6 DL 504 102 504 102 DL 504 98.4 504 98.4 DL 504 94.8 504 94.8 DL 504 91.2 504 91.2 DL 504 87.6 504 87.6 DL 504 84 504 84 DL 504 84 504 84 DL 500.4 84 500.4 84 DL 496.8 84 496.8 84 DL 493.2 84 493.2 84 DL 489.6 84 489.6 84 DL 486 84 486 84 DL 482.4 84 482.4 84 DL 478.8 84 478.8 84 DL 475.2 84 475.2 84 DL 471.6 84 471.6 84 DL 468 84 468 84 DL 468 84 468 84 DL 468 87.6 468 87.6 DL 468 91.2 468 91.2 DL 468 94.8 468 94.8 DL 468 98.4 468 98.4 DL 468 102 468 102 DL 468 105.6 468 105.6 DL 468 109.2 468 109.2 DL 468 112.8 468 112.8 DL 468 116.4 468 116.4 DL 468 120 468 120 DL 504 120 504 120 DL 507.6 120 507.6 120 DL 511.2 120 511.2 120 DL 514.8 120 514.8 120 DL 518.4 120 518.4 120 DL 522 120 522 120 DL 525.6 120 525.6 120 DL 529.2 120 529.2 120 DL 532.8 120 532.8 120 DL 536.4 120 536.4 120 DL 540 120 540 120 DL 540 120 540 120 DL 540 116.4 540 116.4 DL 540 112.8 540 112.8 DL 540 109.2 540 109.2 DL 540 105.6 540 105.6 DL 540 102 540 102 DL 540 98.4 540 98.4 DL 540 94.8 540 94.8 DL 540 91.2 540 91.2 DL 540 87.6 540 87.6 DL 540 84 540 84 DL 540 84 540 84 DL 536.4 84 536.4 84 DL 532.8 84 532.8 84 DL 529.2 84 529.2 84 DL 525.6 84 525.6 84 DL 522 84 522 84 DL 518.4 84 518.4 84 DL 514.8 84 514.8 84 DL 511.2 84 511.2 84 DL 507.6 84 507.6 84 DL 504 84 504 84 DL 504 84 504 84 DL 504 87.6 504 87.6 DL 504 91.2 504 91.2 DL 504 94.8 504 94.8 DL 504 98.4 504 98.4 DL 504 102 504 102 DL 504 105.6 504 105.6 DL 504 109.2 504 109.2 DL 504 112.8 504 112.8 DL 504 116.4 504 116.4 DL 504 120 504 120 DL(arr)436.34 140.2 Q .2 -.1(ow u)-.18 H 2.5 (pl).1 G(eft 2)-2.5 E F0(Figure 20-1: Diagonal arro)136.26 161 Q (ws \(dotted box)-.25 E(es sho)-.15 E 2.5(wt)-.25 G (he implied 0.5-inch grid\))-2.5 E(Here')97 188.6 Q 2.5(sa)-.55 G 2.5 (ne)-2.5 G(xample concocted to demonstrate layout of a lar)-2.65 E (ge, multiple-part pattern:)-.18 E EP %%Page: 27 27 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-27-)279.67 48 Q/F1 10/Courier@0 SF(.PS)108 84 Q (define filter {box ht 0.25 rad 0.125})108 96 Q(lineht = 0.25;)108 108 Q (Top: [)108 120 Q(right;)132 132 Q(box "\\fBms\\fR" "sources";)132 144 Q (move;)132 156 Q(box "\\fBHTML\\fR" "sources";)132 168 Q(move;)132 180 Q (box "\\fBlinuxdoc-sgml\\fP" "sources" wid 1.5;)132 192 Q(move;)132 204 Q(box "\\fBTexinfo\\fP" "sources";)132 216 Q (line down from 1st box .s lineht;)132 240 Q(A: line down;)132 252 Q (line down from 2nd box .s; filter "\\fBhtml2ms";)132 264 Q (B: line down;)132 276 Q (line down from 3rd box .s; filter "\\fBformat\\fP";)132 288 Q (C: line down;)132 300 Q (line down from 4th box .s; filter "\\fBtexi2roff\\fP";)132 312 Q (D: line down;)132 324 Q(])108 336 Q(move down 1 from last [] .s;)108 348 Q(Anchor: box wid 1 ht 0.75 "\\fBms\\fR" "intermediate" "form";)108 360 Q(arrow from Top.A.end to Anchor.nw;)108 372 Q(arrow from Top.B.end\ to 1/3 of the way between Anchor.nw and Anchor.ne;)108 384 Q(arrow fro\ m Top.C.end to 2/3 of the way between Anchor.nw and Anchor.ne;)108 396 Q (arrow from Top.D.end to Anchor.ne)108 408 Q({)108 420 Q 6(#P)132 432 S (ostScript column)-6 E(move to Anchor .sw;)132 444 Q (line down left then down ->;)132 456 Q(filter "\\fBpic\\fP";)132 468 Q (arrow;)132 480 Q(filter "\\fBeqn\\fP";)132 492 Q(arrow;)132 504 Q (filter "\\fBtbl\\fP";)132 516 Q(arrow;)132 528 Q (filter "\\fBgroff\\fP";)132 540 Q(arrow;)132 552 Q(box "PostScript";) 132 564 Q 6(#H)132 588 S(TML column)-6 E(move to Anchor .se;)132 600 Q (line down right then down ->;)132 612 Q (A: filter dotted "\\fBpic2img\\fP";)132 624 Q(arrow;)132 636 Q (B: filter dotted "\\fBeqn2html\\fP";)132 648 Q(arrow;)132 660 Q (C: filter dotted "\\fBtbl2html\\fP";)132 672 Q(arrow;)132 684 Q (filter "\\fBms2html\\fP";)132 696 Q(arrow;)132 708 Q(box "HTML";)132 720 Q EP %%Page: 28 28 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-28-)279.67 48 Q/F1 10/Courier@0 SF 6(#N)132 96 S(onexistence caption)-6 E (box dashed wid 1 at B + \(2, 0\) "These tools" "don't yet exist";)132 108 Q(line chop 0 chop 0.1 dashed from last box .nw to A.e ->;)132 120 Q (line chop 0 chop 0.1 dashed from last box .w)132 132 Q(to B.e ->;)12 E (line chop 0 chop 0.1 dashed from last box .sw to C.e ->;)132 144 Q(}) 108 156 Q(.PE)108 168 Q 126 228 MT 0 -36 RL -54 0 RL 0 36 RL CL .4 LW ST /F2 10/Times-Bold@0 SF(ms)92.89 206.2 Q F0(sources)84.005 218.2 Q 216 228 MT 0 -36 RL -54 0 RL 0 36 RL CL ST F2(HTML)173.72 206.2 Q F0 (sources)174.005 218.2 Q 360 228 MT 0 -36 RL -108 0 RL 0 36 RL CL ST F2 (linuxdoc-sgml)275.995 206.2 Q F0(sources)291.005 218.2 Q 450 228 MT 0 -36 RL -54 0 RL 0 36 RL CL ST F2 -.92(Te)407.195 206.2 S(xinf).92 E(o) -.25 E F0(sources)408.005 218.2 Q 99 264 99 228 DL 99 282 99 264 DL 189 246 189 228 DL 171 255 9 -180.0000 90.0000 DA 171 255 9 -90.0000 180.0000 DA 207 255 9 -0.0000 -90.0000 DA 207 255 9 90.0000 0.0000 DA 162 255 162 255 DL 207 246 171 246 DL 216 255 216 255 DL 171 264 207 264 DL F2(html2ms)170.39 257.2 Q 189 282 189 264 DL 306 246 306 228 DL 288 255 9 -180.0000 90.0000 DA 288 255 9 -90.0000 180.0000 DA 324 255 9 -0.0000 -90.0000 DA 324 255 9 90.0000 0.0000 DA 279 255 279 255 DL 324 246 288 246 DL 333 255 333 255 DL 288 264 324 264 DL -.25(fo)291.41 257.2 S(rmat).25 E 306 282 306 264 DL 423 246 423 228 DL 405 255 9 -180.0000 90.0000 DA 405 255 9 -90.0000 180.0000 DA 441 255 9 -0.0000 -90.0000 DA 441 255 9 90.0000 0.0000 DA 396 255 396 255 DL 441 246 405 246 DL 450 255 450 255 DL 405 264 441 264 DL(texi2r)404.765 257.2 Q(off) -.18 E 423 282 423 264 DL 297 408 MT 0 -54 RL -72 0 RL 0 54 RL CL ST(ms) 254.89 371.2 Q F0(intermediate)236.005 383.2 Q(form)251.28 395.2 Q 225 354 99 282 DL 225 354 MT -7.128 -2.016 RL 1.8 -3.096 RL CL BL 225 354 MT -7.128 -2.016 RL 1.8 -3.096 RL CL ST 248.976 354 189 282 DL 248.976 354 MT -5.976 -4.392 RL 2.736 -2.304 RL CL BL 248.976 354 MT -5.976 -4.392 RL 2.736 -2.304 RL CL ST 273.024 354 306 282 DL 273.024 354 MT 1.368 -7.272 RL 3.24 1.512 RL CL BL 273.024 354 MT 1.368 -7.272 RL 3.24 1.512 RL CL ST 297 354 423 282 DL 297 354 MT 5.328 -5.112 RL 1.8 3.096 RL CL BL 297 354 MT 5.328 -5.112 RL 1.8 3.096 RL CL ST 189 426 225 408 DL 189 444 189 426 DL 189 444 MT -1.8 -7.2 RL 3.6 0 RL CL BL 189 444 MT -1.8 -7.2 RL 3.6 0 RL CL ST 171 453 9 -180.0000 90.0000 DA 171 453 9 -90.0000 180.0000 DA 207 453 9 -0.0000 -90.0000 DA 207 453 9 90.0000 0.0000 DA 162 453 162 453 DL 207 444 171 444 DL 216 453 216 453 DL 171 462 207 462 DL F2(pic)182.61 455.2 Q 189 480 189 462 DL 189 480 MT -1.8 -7.2 RL 3.6 0 RL CL BL 189 480 MT -1.8 -7.2 RL 3.6 0 RL CL ST 171 489 9 -180.0000 90.0000 DA 171 489 9 -90.0000 180.0000 DA 207 489 9 -0.0000 -90.0000 DA 207 489 9 90.0000 0.0000 DA 162 489 162 489 DL 207 480 171 480 DL 216 489 216 489 DL 171 498 207 498 DL(eqn)181.22 491.2 Q 189 516 189 498 DL 189 516 MT -1.8 -7.2 RL 3.6 0 RL CL BL 189 516 MT -1.8 -7.2 RL 3.6 0 RL CL ST 171 525 9 -180.0000 90.0000 DA 171 525 9 -90.0000 180.0000 DA 207 525 9 -0.0000 -90.0000 DA 207 525 9 90.0000 0.0000 DA 162 525 162 525 DL 207 516 171 516 DL 216 525 216 525 DL 171 534 207 534 DL(tbl)183.165 527.2 Q 189 552 189 534 DL 189 552 MT -1.8 -7.2 RL 3.6 0 RL CL BL 189 552 MT -1.8 -7.2 RL 3.6 0 RL CL ST 171 561 9 -180.0000 90.0000 DA 171 561 9 -90.0000 180.0000 DA 207 561 9 -0.0000 -90.0000 DA 207 561 9 90.0000 0.0000 DA 162 561 162 561 DL 207 552 171 552 DL 216 561 216 561 DL 171 570 207 570 DL(gr)178.54 563.2 Q(off)-.18 E 189 588 189 570 DL 189 588 MT -1.8 -7.2 RL 3.6 0 RL CL BL 189 588 MT -1.8 -7.2 RL 3.6 0 RL CL ST 216 624 MT 0 -36 RL -54 0 RL 0 36 RL CL ST F0(PostScript)168.44 608.2 Q 333 426 297 408 DL 333 444 333 426 DL 333 444 MT -1.8 -7.2 RL 3.6 0 RL CL BL 333 444 MT -1.8 -7.2 RL 3.6 0 RL CL ST 357.336 459.336 357.336 459.336 DL 359.28 456.456 359.28 456.456 DL 360 453 360 453 DL 360 453 360 453 DL 359.28 449.544 359.28 449.544 DL 357.336 446.664 357.336 446.664 DL 354.384 444.648 354.384 444.648 DL 350.928 444 350.928 444 DL 347.328 444 347.328 444 DL 343.728 444 343.728 444 DL 340.128 444 340.128 444 DL 336.6 444 336.6 444 DL 333 444 333 444 DL 329.4 444 329.4 444 DL 325.872 444 325.872 444 DL 322.272 444 322.272 444 DL 318.672 444 318.672 444 DL 315.072 444 315.072 444 DL 311.616 444.648 311.616 444.648 DL 308.664 446.664 308.664 446.664 DL 306.72 449.544 306.72 449.544 DL 306 453 306 453 DL 306 453 306 453 DL 306.72 456.456 306.72 456.456 DL 308.664 459.336 308.664 459.336 DL 311.616 461.352 311.616 461.352 DL 315.072 462 315.072 462 DL 318.672 462 318.672 462 DL 322.272 462 322.272 462 DL 325.872 462 325.872 462 DL 329.4 462 329.4 462 DL 333 462 333 462 DL 336.6 462 336.6 462 DL 340.128 462 340.128 462 DL 343.728 462 343.728 462 DL 347.328 462 347.328 462 DL 350.928 462 350.928 462 DL 354.384 461.352 354.384 461.352 DL F2 (pic2img)316.055 455.2 Q 333 480 333 462 DL 333 480 MT -1.8 -7.2 RL 3.6 0 RL CL BL 333 480 MT -1.8 -7.2 RL 3.6 0 RL CL ST 357.336 495.336 357.336 495.336 DL 359.28 492.456 359.28 492.456 DL 360 489 360 489 DL 360 489 360 489 DL 359.28 485.544 359.28 485.544 DL 357.336 482.664 357.336 482.664 DL 354.384 480.648 354.384 480.648 DL 350.928 480 350.928 480 DL 347.328 480 347.328 480 DL 343.728 480 343.728 480 DL 340.128 480 340.128 480 DL 336.6 480 336.6 480 DL 333 480 333 480 DL 329.4 480 329.4 480 DL 325.872 480 325.872 480 DL 322.272 480 322.272 480 DL 318.672 480 318.672 480 DL 315.072 480 315.072 480 DL 311.616 480.648 311.616 480.648 DL 308.664 482.664 308.664 482.664 DL 306.72 485.544 306.72 485.544 DL 306 489 306 489 DL 306 489 306 489 DL 306.72 492.456 306.72 492.456 DL 308.664 495.336 308.664 495.336 DL 311.616 497.352 311.616 497.352 DL 315.072 498 315.072 498 DL 318.672 498 318.672 498 DL 322.272 498 322.272 498 DL 325.872 498 325.872 498 DL 329.4 498 329.4 498 DL 333 498 333 498 DL 336.6 498 336.6 498 DL 340.128 498 340.128 498 DL 343.728 498 343.728 498 DL 347.328 498 347.328 498 DL 350.928 498 350.928 498 DL 354.384 497.352 354.384 497.352 DL(eqn2html) 312.72 491.2 Q 333 516 333 498 DL 333 516 MT -1.8 -7.2 RL 3.6 0 RL CL BL 333 516 MT -1.8 -7.2 RL 3.6 0 RL CL ST 357.336 531.336 357.336 531.336 DL 359.28 528.456 359.28 528.456 DL 360 525 360 525 DL 360 525 360 525 DL 359.28 521.544 359.28 521.544 DL 357.336 518.664 357.336 518.664 DL 354.384 516.648 354.384 516.648 DL 350.928 516 350.928 516 DL 347.328 516 347.328 516 DL 343.728 516 343.728 516 DL 340.128 516 340.128 516 DL 336.6 516 336.6 516 DL 333 516 333 516 DL 329.4 516 329.4 516 DL 325.872 516 325.872 516 DL 322.272 516 322.272 516 DL 318.672 516 318.672 516 DL 315.072 516 315.072 516 DL 311.616 516.648 311.616 516.648 DL 308.664 518.664 308.664 518.664 DL 306.72 521.544 306.72 521.544 DL 306 525 306 525 DL 306 525 306 525 DL 306.72 528.456 306.72 528.456 DL 308.664 531.336 308.664 531.336 DL 311.616 533.352 311.616 533.352 DL 315.072 534 315.072 534 DL 318.672 534 318.672 534 DL 322.272 534 322.272 534 DL 325.872 534 325.872 534 DL 329.4 534 329.4 534 DL 333 534 333 534 DL 336.6 534 336.6 534 DL 340.128 534 340.128 534 DL 343.728 534 343.728 534 DL 347.328 534 347.328 534 DL 350.928 534 350.928 534 DL 354.384 533.352 354.384 533.352 DL(tbl2html)314.665 527.2 Q 333 552 333 534 DL 333 552 MT -1.8 -7.2 RL 3.6 0 RL CL BL 333 552 MT -1.8 -7.2 RL 3.6 0 RL CL ST 315 561 9 -180.0000 90.0000 DA 315 561 9 -90.0000 180.0000 DA 351 561 9 -0.0000 -90.0000 DA 351 561 9 90.0000 0.0000 DA 306 561 306 561 DL 351 552 315 552 DL 360 561 360 561 DL 315 570 351 570 DL(ms2html)314.39 563.2 Q 333 588 333 570 DL 333 588 MT -1.8 -7.2 RL 3.6 0 RL CL BL 333 588 MT -1.8 -7.2 RL 3.6 0 RL CL ST 360 624 MT 0 -36 RL -54 0 RL 0 36 RL CL ST F0(HTML)318.835 608.2 Q 444.6 507 441 507 DL 452.232 507 448.632 507 DL 459.792 507 456.192 507 DL 467.424 507 463.824 507 DL 474.984 507 471.384 507 DL 482.616 507 479.016 507 DL 490.176 507 486.576 507 DL 497.808 507 494.208 507 DL 505.368 507 501.768 507 DL 513 507 509.4 507 DL 513 503.4 513 507 DL 513 496.92 513 500.52 DL 513 490.44 513 494.04 DL 513 483.96 513 487.56 DL 513 477.48 513 481.08 DL 513 471 513 474.6 DL 509.4 471 513 471 DL 501.768 471 505.368 471 DL 494.208 471 497.808 471 DL 486.576 471 490.176 471 DL 479.016 471 482.616 471 DL 471.384 471 474.984 471 DL 463.824 471 467.424 471 DL 456.192 471 459.792 471 DL 448.632 471 452.232 471 DL 441 471 444.6 471 DL 441 474.6 441 471 DL 441 481.08 441 477.48 DL 441 487.56 441 483.96 DL 441 494.04 441 490.44 DL 441 500.52 441 496.92 DL 441 507 441 503.4 DL(These tools)454.085 485.2 Q(don')448.555 497.2 Q 2.5(ty)-.18 G(et e)-2.5 E(xist)-.15 E 437.472 470.208 441 471 DL 430.416 468.624 433.944 469.416 DL 423.36 467.112 426.888 467.904 DL 416.304 465.528 419.832 466.32 DL 409.32 463.944 412.848 464.736 DL 402.264 462.36 405.792 463.152 DL 395.208 460.848 398.736 461.64 DL 388.152 459.264 391.68 460.056 DL 381.096 457.68 384.624 458.472 DL 374.04 456.096 377.568 456.888 DL 366.984 454.584 370.512 455.376 DL 367.056 454.584 MT 7.416 -.216 RL -.792 3.528 RL CL BL 367.056 454.584 MT 7.416 -.216 RL -.792 3.528 RL CL ST 437.4 489 441 489 DL 430.344 489 433.944 489 DL 423.36 489 426.96 489 DL 416.304 489 419.904 489 DL 409.32 489 412.92 489 DL 402.336 489 405.936 489 DL 395.28 489 398.88 489 DL 388.224 489 391.824 489 DL 381.24 489 384.84 489 DL 374.184 489 377.784 489 DL 367.2 489 370.8 489 DL 367.2 489 MT 7.2 -1.8 RL 0 3.6 RL CL BL 367.2 489 MT 7.2 -1.8 RL 0 3.6 RL CL ST 437.472 507.792 441 507 DL 430.416 509.376 433.944 508.584 DL 423.36 510.888 426.888 510.096 DL 416.304 512.472 419.832 511.68 DL 409.32 514.056 412.848 513.264 DL 402.264 515.64 405.792 514.848 DL 395.208 517.152 398.736 516.36 DL 388.152 518.736 391.68 517.944 DL 381.096 520.32 384.624 519.528 DL 374.04 521.904 377.568 521.112 DL 366.984 523.416 370.512 522.624 DL 367.056 523.416 MT 6.624 -3.312 RL .792 3.528 RL CL BL 367.056 523.416 MT 6.624 -3.312 RL .792 3.528 RL CL ST (Figure 20-2: Hypothetical production \215o)151.05 647 Q 2.5(wf)-.25 G (or dual-mode publishing)-2.5 E F2 2.5(21. PIC)72 686.6 R(Refer)2.5 E (ence)-.18 E F0(This is an annotated grammar of PIC.)97 702.2 Q EP %%Page: 29 29 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-29-)279.67 48 Q/F1 10/Times-Bold@0 SF 2.5 (21.1. Lexical)72 84 R(Items)2.5 E F0 .317(In general,)97 99.6 R F1(pic) 2.817 E F0 .317(is a free-format, tok)2.817 F .317 (en-oriented language that ignores whitespace outside strings.)-.1 F (But)5.316 E (certain lines and contructs are specially interpreted at the le)72 111.6 Q(xical le)-.15 E -.15(ve)-.25 G(l:).15 E 3.846(Ac)97 127.2 S 1.346(omment be)-3.846 F 1.347 (gins with # and continues to \\n \(comments may also follo)-.15 F 3.847 (wt)-.25 G -.15(ex)-3.847 G 3.847(ti).15 G 3.847(nal)-3.847 G 3.847 (ine\). A)-3.847 F(line)3.847 E(be)72 139.2 Q .359 (ginning with a period or backslash may be interpreted as te)-.15 F .359 (xt to be passed through to the post-processor)-.15 F(,)-.4 E .822 (depending on command-line options.)72 151.2 R .822 (An end-of-line backslash is interpreted as a request to continue the) 5.822 F(line; the backslash and follo)72 163.2 Q(wing ne)-.25 E (wline are ignored.)-.25 E(Here are the grammar terminals:)72 178.8 Q ()72 194.4 Q 3.406(Ad)97 206.4 S .906(ecimal numeric constant.) -3.406 F .906(May contain a decimal point or be e)5.906 F .906 (xpressed in scienti\214c notation in)-.15 F(the style of)97 218.4 Q/F2 10/Times-Italic@0 SF(printf)2.5 E F0(\(3\)')A 2.5(s%)-.55 G 2.5(ee)-2.5 G(scape. \(All v)-2.5 E (ariables are represented internally in \215oating-point.\))-.25 E ()72 234 Q(An)97 246 Q 3.611(yA)-.15 G 1.112 (SCII characters surrounded by a pair of double quotes.)-3.611 F 1.112 (May contain a double quote if pre-)6.112 F(ceded by a backslash.)97 258 Q()-.25 E 3.427(Al)97 285.6 S -.25(ow)-3.427 G(er) .25 E .927(-case alphabetic character)-.2 F 3.427(,f)-.4 G(ollo)-3.427 E .927(wed by an)-.25 F 3.427(yn)-.15 G .927(umber of alphanumerics.) -3.427 F(\(V)5.926 E .926(alues of v)-1.11 F(ariables)-.25 E (are preserv)97 297.6 Q(ed across pictures.\))-.15 E( = to [by ] do { ... })210 204 Q (if then { ... } [else { ... }])210 216 Q (copy [until ])210 228 Q (copy thru [until ])210 240 Q (sh )210 252 Q(print )210 264 Q (reset [ ... ])210 276 Q F0 (The current position and direction are sa)72 297.6 Q -.15(ve)-.2 G 2.5 (do).15 G 2.5(ne)-2.5 G(ntry to a { } and restored on e)-2.5 E (xit from it.)-.15 E(Dra)72 313.2 Q 1.606(wn objects within [ ] are tre\ ated as a single composite object with a rectangular shape \(that of th\ e)-.15 F 1.036(bounding box of all the elements\).)72 325.2 R -1.11(Va) 6.036 G 1.036 (riable and label assignments within a block are local to the block.) 1.11 F 1.369(Current direction of motion is restored to the v)72 337.2 R 1.37(alue at start of block upon e)-.25 F 3.87(xit. Position)-.15 F(is) 3.87 E/F2 10/Times-Italic@0 SF(not)3.87 E F0(restored)3.87 E(\(unlik)72 349.2 Q 3.182(e{})-.1 G 3.182(\)i)-3.182 G .682 (nstead, the current position becomes the e)-3.182 F .682 (xit position for the current direction on the block')-.15 F(s)-.55 E (bounding box.)72 361.2 Q EP %%Page: 31 31 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-31-)279.67 48 Q/F1 10/Courier@0 SF 6 ( ::=)108 84 R(box)6 E F0 2.5(#C)114 G (losed object -- rectangle)-2.5 E F1(circle)210 96 Q F0 2.5(#C)96 G (losed object -- circle)-2.5 E F1(ellipse)210 108 Q F0 2.5(#C)90 G (losed object -- ellipse)-2.5 E F1(arc)210 120 Q F0 2.5(#O)114 G (pen object -- quarter)-2.5 E(-circle)-.2 E F1(line)210 132 Q F0 2.5(#O) 108 G(pen object -- line)-2.5 E F1(arrow)210 144 Q F0 2.5(#O)102 G (pen object -- line with arro)-2.5 E(whead)-.25 E F1(spline)210 156 Q F0 2.5(#O)96 G(pen object -- spline curv)-2.5 E(e)-.15 E F1(move)210 168 Q ( ...)210 180 Q F0 2.5(#T)30 G -.15(ex)-3.2 G 2.5(tw).15 G (ithin in)-2.5 E(visible box)-.4 E F1 6( ::=)108 204 R (h[eigh]t )6 E F0 2.5(#S)42 G(et height of closed \214gure)-2.5 E F1(wid[th] )210 216 Q F0 2.5(#S)48 G(et width of closed \214gure) -2.5 E F1(rad[ius] )210 228 Q F0 2.5(#S)42 G (et radius of circle/arc)-2.5 E F1(diam[eter] )210 240 Q F0 2.5 (#S)30 G(et diameter of circle/arc)-2.5 E F1(up [ ])210 252 Q F0 2.5(#M)54 G .3 -.15(ove u)-2.5 H(p).15 E F1(down [ ])210 264 Q F0 2.5(#M)42 G .3 -.15(ove d)-2.5 H -.25(ow).15 G(n).25 E F1 (left [ ])210 276 Q F0 2.5(#M)42 G .3 -.15(ove l)-2.5 H(eft).15 E F1(right [ ])210 288 Q F0 2.5(#M)36 G .3 -.15(ove r)-2.5 H(ight) .15 E F1(from )210 300 Q F0 2.5(#S)42 G (et from position of open \214gure)-2.5 E F1(to )210 312 Q F0 2.5(#S)54 G(et to position of open \214gure)-2.5 E F1(at )210 324 Q F0 2.5(#S)54 G(et center of open \214gure)-2.5 E F1(with ) 210 336 Q F0 2.5(#F)54 G(ix corner at speci\214ed location)-2.5 E F1 (by )210 348 Q F0 2.5(#S)36 G(et object')-2.5 E 2.5(sa)-.55 G(ttachment point)-2.5 E F1(then)210 360 Q F0 2.5(#S)108 G(equential se) -2.5 E(gment composition)-.15 E F1(dotted [ ])210 372 Q F0 2.5 (#S)30 G(et dotted line style)-2.5 E F1(dashed [ ])210 384 Q F0 2.5(#S)30 G(et dashed line style)-2.5 E F1(chop [ ])210 396 Q F0 2.5(#C)42 G(hop end\(s\) of se)-2.5 E(gment)-.15 E F1(->)210 408 Q F0 2.5(#D)120 G(ecorate with "to" arro)-2.5 E(w)-.25 E F1(<-)210 420 Q F0 2.5(#D)120 G(ecorate with "from" arro)-2.5 E(w)-.25 E F1(<->)210 432 Q F0 2.5(#D)114 G(ecorate with both arro)-2.5 E(ws)-.25 E F1(invis)210 444 Q F0 2.5(#M)102 G(ak)-2.5 E 2.5(ep)-.1 G(rimiti)-2.5 E .3 -.15(ve i)-.25 H -.4(nv).15 G(isible).4 E F1(solid)210 456 Q F0 2.5(#M)102 G(ak)-2.5 E 2.5(ec)-.1 G(losed \214gure solid)-2.5 E F1(fill )210 468 Q F0 2.5 (#S)66 G(et \214ll density for \214gure)-2.5 E F1(same)210 480 Q F0 2.5 (#C)108 G(op)-2.5 E 2.5(ys)-.1 G(ize of pre)-2.5 E(vious object)-.25 E F1( ...)210 492 Q F0 2.5(#T)30 G -.15(ex)-3.2 G 2.5(tw).15 G(ithin object)-2.5 E F1()210 504 Q F0 2.5(#M)96 G (otion in the current direction)-2.5 E 1.238(Missing attrib)72 525.6 R 1.238(utes are supplied from def)-.2 F 1.239 (aults; inappropriate ones are silently ignored.)-.1 F -.15(Fo)6.239 G 3.739(rl).15 G 1.239(ines, splines,)-3.739 F (and arcs, height and width refer to arro)72 537.6 Q(whead size.)-.25 E (The)97 553.2 Q F1(at)2.892 E F0(primiti)2.892 E .692 -.15(ve s)-.25 H .392(ets the center of the current object.).15 F(The)5.392 E F1(with) 2.892 E F0(attrib)2.892 E .392(ute \214x)-.2 F .391 (es the speci\214ed feature)-.15 F(of the gi)72 565.2 Q -.15(ve)-.25 G 2.5(no).15 G(bject to a speci\214ed location.)-2.5 E(The)97 580.8 Q F1 (solid)2.5 E F0(primiti)2.5 E .3 -.15(ve i)-.25 H 2.5(sn).15 G (ot yet supported in GNU)-2.5 E/F2 10/Times-Bold@0 SF(gpic)2.5 E F0(.)A (The)97 596.4 Q F1(by)2.69 E F0(primiti)2.69 E .49 -.15(ve i)-.25 H 2.69 (sn).15 G .19(ot documented in the tutorial portion of the K)-2.69 F .19 (ernighan paper)-.25 F 2.69(,a)-.4 G .19(nd should proba-)-2.69 F (bly be considered unreliable.)72 608.4 Q(The primiti)97 624 Q -.15(ve) -.25 G F2(arr)2.65 E -.1(ow)-.18 G F0(is a synon)2.6 E(ym for)-.15 E F2 (line ->)2.5 E F0(.)A F1 6( ::=)108 642 R ( [ ... ])36 E (sprintf\("format", ...\) [ ... ])210 654 Q ( ::=)108 678 Q(center | ljust | rjust | above | below)12 E F0 -1.25 -.7(Te x)72 699.6 T 2.56(ti).7 G 2.56(sn)-2.56 G .06 (ormally an attrib)-2.56 F .059 (ute of some object, in which case successi)-.2 F .359 -.15(ve s)-.25 H .059(trings are v).15 F .059(ertically stack)-.15 F .059(ed and cen-)-.1 F(tered on the object')72 711.6 Q 2.5(sc)-.55 G(enter by def)-2.5 E 2.5 (ault. Standalone)-.1 F(te)2.5 E (xt is treated as though placed in an in)-.15 E(visible box.)-.4 E EP %%Page: 32 32 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF(-32-)279.67 48 Q 2.803(At)97 84 S -.15(ex)-2.803 G 2.803(ti).15 G .304(tem consists of a string or sprintf-e)-2.803 F .304(xpression, optionally follo)-.15 F .304 (wed by positioning information.)-.25 F -1.25 -.7(Te x)72 96 T 2.859(to) .7 G 2.859(rf)-2.859 G .359(ormat strings may contain {gtn}rof)-2.859 F 2.859(ff)-.25 G .358(ont changes, size changes, and local motions, pro) -2.859 F .358(vided those)-.15 F (changes are undone before the end of the current item.)72 108 Q 2.5(Ap) 97 123.6 S(osition is an \(x, y\) coordinate pair)-2.5 E 5(.T)-.55 G (here are lots of dif)-5 E(ferent w)-.25 E(ays to specify positions:)-.1 E/F1 10/Courier@0 SF 6( ::= )108 141.6 R 6(,<)6 G(expr>) -6 E( {+-} , )210 153.6 Q ( {+-} \( , \))210 165.6 Q 6(\(<)210 177.6 S (position> , \))-6 E ( [of the way] between and )210 189.6 Q ( '<' , '>')210 201.6 Q 6(\(<)210 213.6 S (position> \))-6 E 6( ::=)108 237.6 R(