diff options
author | ru <ru@FreeBSD.org> | 2002-10-11 08:52:17 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-10-11 08:52:17 +0000 |
commit | 127e61728bacf1fb90edd8be1b0c406619e78bc8 (patch) | |
tree | 8c45b0385e4d4d3172ddd7926de65d06c5b2e88b /contrib/groff/src/include | |
parent | 737a9b93ec94c55fd85de176c9de9302f1a9f95f (diff) | |
download | FreeBSD-src-127e61728bacf1fb90edd8be1b0c406619e78bc8.zip FreeBSD-src-127e61728bacf1fb90edd8be1b0c406619e78bc8.tar.gz |
Virgin import of FSF groff v1.18.1
Diffstat (limited to 'contrib/groff/src/include')
-rw-r--r-- | contrib/groff/src/include/Makefile.sub | 5 | ||||
-rw-r--r-- | contrib/groff/src/include/color.h | 87 | ||||
-rw-r--r-- | contrib/groff/src/include/config.hin | 150 | ||||
-rw-r--r-- | contrib/groff/src/include/driver.h | 8 | ||||
-rw-r--r-- | contrib/groff/src/include/errarg.h | 7 | ||||
-rw-r--r-- | contrib/groff/src/include/font.h | 6 | ||||
-rw-r--r-- | contrib/groff/src/include/geometry.h | 27 | ||||
-rw-r--r-- | contrib/groff/src/include/getopt.h | 25 | ||||
-rw-r--r-- | contrib/groff/src/include/html-strings.h | 6 | ||||
-rw-r--r-- | contrib/groff/src/include/htmlhint.h | 37 | ||||
-rw-r--r-- | contrib/groff/src/include/lib.h | 57 | ||||
-rw-r--r-- | contrib/groff/src/include/nonposix.h | 26 | ||||
-rw-r--r-- | contrib/groff/src/include/paper.h | 37 | ||||
-rw-r--r-- | contrib/groff/src/include/posix.h | 14 | ||||
-rw-r--r-- | contrib/groff/src/include/printer.h | 61 | ||||
-rw-r--r-- | contrib/groff/src/include/stringclass.h | 5 |
16 files changed, 493 insertions, 65 deletions
diff --git a/contrib/groff/src/include/Makefile.sub b/contrib/groff/src/include/Makefile.sub index cee00d3..620d345 100644 --- a/contrib/groff/src/include/Makefile.sub +++ b/contrib/groff/src/include/Makefile.sub @@ -2,14 +2,16 @@ HDRS=\ assert.h \ cmap.h \ cset.h \ + color.h \ device.h \ driver.h \ errarg.h \ error.h \ font.h \ + geometry.h \ getopt.h \ groff-getopt.h \ - htmlindicate.h \ + htmlhint.h \ index.h \ lib.h \ macropath.h \ @@ -22,7 +24,6 @@ HDRS=\ searchpath.h \ stringclass.h GENHDRS=defs.h -CLEANADD=$(GENHDRS) all depend: $(GENHDRS) diff --git a/contrib/groff/src/include/color.h b/contrib/groff/src/include/color.h new file mode 100644 index 0000000..6888da1 --- /dev/null +++ b/contrib/groff/src/include/color.h @@ -0,0 +1,87 @@ +// -*- C++ -*- + +/* <groff_src_dir>/src/include/color.h + +Last update: 10 Apr 2002 + +Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Written by Gaius Mulley <gaius@glam.ac.uk> + +This file is part of groff. + +groff 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. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include <stddef.h> + +enum color_scheme {DEFAULT, CMY, CMYK, RGB, GRAY}; + +class color { +private: + color_scheme scheme; + unsigned int components[4]; + + int read_encoding(const color_scheme, const char * const, + const size_t); + +public: + enum {MAX_COLOR_VAL = 0xffff}; + color() : scheme(DEFAULT){} + color(const color * const); + + int operator==(const color & c) const; + int operator!=(const color & c) const; + + int is_default() { return scheme == DEFAULT; } + + // set color from given color component values + void set_default(); + void set_rgb(const unsigned int r, const unsigned int g, + const unsigned int b); + void set_cmy(const unsigned int c, const unsigned int m, + const unsigned int y); + void set_cmyk(const unsigned int c, const unsigned int m, + const unsigned int y, const unsigned int k); + void set_gray(const unsigned int g); + + // set color from a color string + int read_rgb(const char * const s); + int read_cmy(const char * const s); + int read_cmyk(const char * const s); + int read_gray(const char * const s); + + // Return the actual color scheme and retrieve the color components + // into a predefined vector (of length at least 4). + color_scheme get_components(unsigned int *c) const; + + // retrieve the components of a color + void get_rgb(unsigned int *r, unsigned int *g, unsigned int *b) const; + void get_cmy(unsigned int *c, unsigned int *m, unsigned int *y) const; + void get_cmyk(unsigned int *c, unsigned int *m, + unsigned int *y, unsigned int *k) const; + void get_gray(unsigned int *g) const; +}; + +#define Cyan components[0] +#define Magenta components[1] +#define Yellow components[2] +#define Black components[3] + +#define Red components[0] +#define Green components[1] +#define Blue components[2] + +#define Gray components[0] + +extern color default_color; diff --git a/contrib/groff/src/include/config.hin b/contrib/groff/src/include/config.hin new file mode 100644 index 0000000..850e317 --- /dev/null +++ b/contrib/groff/src/include/config.hin @@ -0,0 +1,150 @@ +/* src/include/config.hin. Generated automatically from configure.ac by autoheader. */ + +/* Define if your C++ doesn't understand `delete []'. */ +#undef ARRAY_DELETE_NEEDS_SIZE + +/* Define if you have a C++ <limits.h>. */ +#undef HAVE_CC_LIMITS_H + +/* Define if you have a C++ <osfcn.h>. */ +#undef HAVE_CC_OSFCN_H + +/* Define if you have the <dirent.h> header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the `fmod' function. */ +#undef HAVE_FMOD + +/* Define if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the <math.h> header file. */ +#undef HAVE_MATH_H + +/* Define if you have mkstemp(). */ +#undef HAVE_MKSTEMP + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define if you have the `rename' function. */ +#undef HAVE_RENAME + +/* Define if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define if you have the `isatty' function. */ +#undef HAVE_ISATTY + +/* Define if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define if you have the `strsep' function. */ +#undef HAVE_STRSEP + +/* Define if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define if <math.h> defines struct exception. */ +#undef HAVE_STRUCT_EXCEPTION + +/* Define if you have the <sys/dir.h> header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have sys_errlist in <errno.h> or in <stdio.h>. */ +#undef HAVE_SYS_ERRLIST + +/* Define if you have sysnerr in <errno.h> or <stdio.h>. */ +#undef HAVE_SYS_NERR + +/* Define if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define if the host's encoding is EBCDIC. */ +#undef IS_EBCDIC_HOST + +/* Define if localtime() takes a long * not a time_t *. */ +#undef LONG_FOR_TIME_T + +/* Define if your C++ doesn't declare gettimeofday(). */ +#undef NEED_DECLARATION_GETTIMEOFDAY + +/* Define if your C++ doesn't declare hypot(). */ +#undef NEED_DECLARATION_HYPOT + +/* Define if your C++ doesn't declare pclose(). */ +#undef NEED_DECLARATION_PCLOSE + +/* Define if your C++ doesn't declare popen(). */ +#undef NEED_DECLARATION_POPEN + +/* Define if your C++ doesn't declare putenv(). */ +#undef NEED_DECLARATION_PUTENV + +/* Define if your C++ doesn't declare strcasecmp(). */ +#undef NEED_DECLARATION_STRCASECMP + +/* Define if your C++ doesn't declare strncasecmp(). */ +#undef NEED_DECLARATION_STRNCASECMP + +/* Define if the printer's page size is A4. */ +#undef PAGEA4 + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define if srand() returns void not int. */ +#undef RET_TYPE_SRAND_IS_VOID + +/* Define if `sys_siglist' is declared by <signal.h> or <unistd.h>. */ +#undef SYS_SIGLIST_DECLARED + +/* Define if your C++ compiler uses a traditional (Reiser) preprocessor. */ +#undef TRADITIONAL_CPP + +/* Define if the 0200 bit of the status returned by wait() indicates whether a + core image was produced for a process that was terminated by a signal. */ +#undef WCOREFLAG + +/* Define if -D_POSIX_SOURCE is necessary. */ +#undef _POSIX_SOURCE + +/* Define if you have ISC 3.x or 4.x. */ +#undef _SYSV3 + +/* Define uintmax_t to `unsigned long' or `unsigned long long' if <inttypes.h> + does not exist. */ +#undef uintmax_t diff --git a/contrib/groff/src/include/driver.h b/contrib/groff/src/include/driver.h index 97eb891..d957928 100644 --- a/contrib/groff/src/include/driver.h +++ b/contrib/groff/src/include/driver.h @@ -1,5 +1,6 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001 + Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -18,7 +19,8 @@ You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdio.h> +#include "lib.h" + #include <ctype.h> #include <stdlib.h> #include <stddef.h> @@ -29,7 +31,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "error.h" #include "font.h" #include "printer.h" -#include "lib.h" +#include "geometry.h" void do_file(const char *); extern printer *pr; diff --git a/contrib/groff/src/include/errarg.h b/contrib/groff/src/include/errarg.h index 0c7957c..08af44a 100644 --- a/contrib/groff/src/include/errarg.h +++ b/contrib/groff/src/include/errarg.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -19,10 +19,11 @@ with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ class errarg { - enum { EMPTY, STRING, CHAR, INTEGER, DOUBLE } type; + enum { EMPTY, STRING, CHAR, INTEGER, UNSIGNED_INTEGER, DOUBLE } type; union { const char *s; int n; + unsigned int u; char c; double d; }; @@ -32,6 +33,7 @@ class errarg { errarg(char); errarg(unsigned char); errarg(int); + errarg(unsigned int); errarg(double); int empty() const; void print() const; @@ -43,4 +45,3 @@ extern void errprint(const char *, const errarg &arg1 = empty_errarg, const errarg &arg2 = empty_errarg, const errarg &arg3 = empty_errarg); - diff --git a/contrib/groff/src/include/font.h b/contrib/groff/src/include/font.h index 099f97b..43bf121 100644 --- a/contrib/groff/src/include/font.h +++ b/contrib/groff/src/include/font.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -54,6 +54,8 @@ public: const char *get_name(); const char *get_internal_name(); + static int scan_papersize(const char *, const char **, double *, double *); + static font *load_font(const char *, int *not_found = 0); static void command_line_font_dir(const char *path); static FILE *open_file(const char *name, char **pathp); @@ -69,6 +71,7 @@ public: static int unitwidth; static int paperwidth; static int paperlength; + static const char *papersize; static int biggestfont; static int spare2; static int sizescale; @@ -107,6 +110,7 @@ private: void compact(); static int scale(int w, int pointsize); + static int unit_scale(double *value, char unit); virtual void handle_unknown_font_command(const char *command, const char *arg, const char *file, int lineno); diff --git a/contrib/groff/src/include/geometry.h b/contrib/groff/src/include/geometry.h new file mode 100644 index 0000000..d425f15 --- /dev/null +++ b/contrib/groff/src/include/geometry.h @@ -0,0 +1,27 @@ +// -*- C++ -*- +/* Copyright (C) 2001 Free Software Foundation, Inc. + Written by Gaius Mulley <gaius@glam.ac.uk> + +This file is part of groff. + +groff 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. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +int adjust_arc_center(const int *, double *); +void check_output_arc_limits(int x, int y, + int xv1, int yv1, + int xv2, int yv2, + double c0, double c1, + int *minx, int *maxx, + int *miny, int *maxy); diff --git a/contrib/groff/src/include/getopt.h b/contrib/groff/src/include/getopt.h index c2f0180..4283c35 100644 --- a/contrib/groff/src/include/getopt.h +++ b/contrib/groff/src/include/getopt.h @@ -3,19 +3,19 @@ This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ #ifndef _GETOPT_H @@ -142,20 +142,21 @@ struct option /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ -extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt -extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, +extern int getopt_long (int ___argc, char *const *___argv, + const char *__shortopts, const struct option *__longopts, int *__longind); -extern int getopt_long_only (int __argc, char *const *__argv, +extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int __argc, char *const *__argv, +extern int _getopt_internal (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); diff --git a/contrib/groff/src/include/html-strings.h b/contrib/groff/src/include/html-strings.h index 710e8d7..23a36d1 100644 --- a/contrib/groff/src/include/html-strings.h +++ b/contrib/groff/src/include/html-strings.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002 Free Software Foundation, Inc. Written by Gaius Mulley (gaius@glam.ac.uk). This file is part of groff. @@ -25,7 +25,3 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define HTML_IMAGE_INLINE_BEGIN "\\O[HTML-IMAGE-INLINE-BEGIN]" #define HTML_IMAGE_INLINE_END "\\O[HTML-IMAGE-INLINE-END]" -#define HTML_IMAGE_CENTERED ".HTML-IMAGE" -#define HTML_IMAGE_RIGHT ".HTML-IMAGE-RIGHT" -#define HTML_IMAGE_LEFT ".HTML-IMAGE-LEFT" -#define HTML_IMAGE_END ".HTML-IMAGE-END" diff --git a/contrib/groff/src/include/htmlhint.h b/contrib/groff/src/include/htmlhint.h new file mode 100644 index 0000000..f1f46f7 --- /dev/null +++ b/contrib/groff/src/include/htmlhint.h @@ -0,0 +1,37 @@ +// -*- C++ -*- +/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + Written by Gaius Mulley <gaius@glam.ac.uk> + +This file is part of groff. + +groff 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. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef HTMLINDICATE_H +#define HTMLINDICATE_H + +/* + * html_begin_suppress - suppresses output for the html device + * and resets the min/max registers for -Tps. + * Only called for inline images (such as eqn). + * + */ +extern void html_begin_suppress(); + +/* + * html_end_suppress - end the suppression of output. + */ +extern void html_end_suppress(); + +#endif diff --git a/contrib/groff/src/include/lib.h b/contrib/groff/src/include/lib.h index db5277c..c6468e0 100644 --- a/contrib/groff/src/include/lib.h +++ b/contrib/groff/src/include/lib.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1989-2000, 2001, 2002 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -18,20 +18,30 @@ You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + extern "C" { #ifndef HAVE_STRERROR char *strerror(int); #endif const char *i_to_a(int); + const char *ui_to_a(unsigned int); const char *if_to_a(int, int); } -/* stdio.h on IRIX, OSF/1, and UWIN includes getopt.h */ +/* stdio.h on IRIX, OSF/1, emx, and UWIN include getopt.h */ +/* unistd.h on CYGWIN includes getopt.h */ #if !(defined(__sgi) \ || (defined(__osf__) && defined(__alpha)) \ - || defined(_UWIN)) + || defined(_UWIN) \ + || defined(__EMX__) \ + || defined(__CYGWIN__)) #include <groff-getopt.h> +#else +#include <getopt.h> #endif char *strsave(const char *s); @@ -43,31 +53,54 @@ int is_prime(unsigned); #include <strings.h> #endif -FILE *xtmpfile(char **namep = 0, char *postfix = 0, int do_unlink = 1); -char *xtmptemplate(char *extension = 0); +#ifndef HAVE_SNPRINTF +#include <stdarg.h> +extern "C" { + int snprintf(char *, size_t, const char *, /*args*/ ...); + int vsnprintf(char *, size_t, const char *, va_list); +} +#endif + +#ifndef HAVE_MKSTEMP +/* since mkstemp() is defined as a real C++ function if taken from + groff's mkstemp.cc we need a declaration */ +int mkstemp(char *tmpl); +#endif /* HAVE_MKSTEMP */ -#ifdef NEED_DECLARATION_POPEN +int mksdir(char *tmpl); -extern "C" { FILE *popen(const char *, const char *); } +FILE *xtmpfile(char **namep = 0, + const char *postfix_long = 0, const char *postfix_short = 0, + int do_unlink = 1); +char *xtmptemplate(const char *postfix_long, const char *postfix_short); +#ifdef NEED_DECLARATION_POPEN +extern "C" { FILE *popen(const char *, const char *); } #endif /* NEED_DECLARATION_POPEN */ #ifdef NEED_DECLARATION_PCLOSE - extern "C" { int pclose (FILE *); } - #endif /* NEED_DECLARATION_PCLOSE */ size_t file_name_max(const char *fname); int interpret_lf_args(const char *p); -extern char illegal_char_table[]; +extern char invalid_char_table[]; -inline int illegal_input_char(int c) +inline int invalid_input_char(int c) { - return c >= 0 && illegal_char_table[c]; + return c >= 0 && invalid_char_table[c]; +} + +#ifdef HAVE_STRCASECMP +#ifdef NEED_DECLARATION_STRCASECMP +extern "C" { + // Ultrix4.3's string.h fails to declare this. + int strcasecmp(const char *, const char *); } +#endif /* NEED_DECLARATION_STRCASECMP */ +#endif /* HAVE_STRCASECMP */ #if !defined(_AIX) && !defined(sinix) && !defined(__sinix__) #ifdef HAVE_STRNCASECMP diff --git a/contrib/groff/src/include/nonposix.h b/contrib/groff/src/include/nonposix.h index abd7d1e..86aa2e0 100644 --- a/contrib/groff/src/include/nonposix.h +++ b/contrib/groff/src/include/nonposix.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Written by Eli Zaretskii (eliz@is.elta.co.il) This file is part of groff. @@ -24,11 +24,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # ifndef _WIN32 # define _WIN32 # endif -# define setmode(f,m) _setmode(f,m) #endif #if defined(__MSDOS__) \ - || (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN32__)) + || (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)) /* Binary I/O nuisances. Note: "setmode" is right for DJGPP and Borland; Windows compilers might need _setmode or some such. */ @@ -37,17 +36,21 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # ifdef HAVE_UNISTD_H # include <unistd.h> # endif -# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) -# define FOPEN_RB "rb" -# define FOPEN_WB "wb" -# define FOPEN_RWB "wb+" # ifdef _MSC_VER # define POPEN_RT "rt" # define POPEN_WT "wt" # define popen(c,m) _popen(c,m) # define pclose(p) _pclose(p) # define getpid() (1) +# define mkdir(p,m) _mkdir(p) +# define setmode(f,m) _setmode(f,m) +# define WAIT(s,p,m) _cwait(s,p,m) +# define creat(p,m) _creat(p,m) # endif +# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) +# define FOPEN_RB "rb" +# define FOPEN_WB "wb" +# define FOPEN_RWB "wb+" # ifndef O_BINARY # ifdef _O_BINARY # define O_BINARY (_O_BINARY) @@ -135,3 +138,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef NULL_DEV # define NULL_DEV "/dev/null" #endif +#ifndef GS_NAME +# define GS_NAME "gs" +#endif +#ifndef WAIT +# define WAIT(s,p,m) wait(s) +#endif +#ifndef _WAIT_CHILD +# define _WAIT_CHILD 0 +#endif diff --git a/contrib/groff/src/include/paper.h b/contrib/groff/src/include/paper.h new file mode 100644 index 0000000..7a01fc2 --- /dev/null +++ b/contrib/groff/src/include/paper.h @@ -0,0 +1,37 @@ +// -*- C++ -*- +/* Copyright (C) 2002 Free Software Foundation, Inc. + Written by Werner Lemberg (wl@gnu.org) + +This file is part of groff. + +groff 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. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +struct paper { + char *name; + double length; // in PS points + double width; // in PS points +}; + +// global constructor +static class papersize_init { + static int initialised; +public: + papersize_init(); +} _papersize_init; + +// A0-A7, B0-B7, C0-C7, D0-D7, 8 American paper sizes, 1 special size */ +#define NUM_PAPERSIZES 4*8 + 8 + 1 + +extern paper papersizes[]; diff --git a/contrib/groff/src/include/posix.h b/contrib/groff/src/include/posix.h index 1b7d5cd..e7f38cd 100644 --- a/contrib/groff/src/include/posix.h +++ b/contrib/groff/src/include/posix.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1992, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1992, 2000, 2001 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -42,6 +42,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define S_IROTH 0004 #endif +#ifndef S_IWUSR +#define S_IWUSR 0200 +#endif + +#ifndef S_IXUSR +#define S_IXUSR 0100 +#endif + #ifndef S_ISREG #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif @@ -49,3 +57,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef O_RDONLY #define O_RDONLY 0 #endif + +#ifndef HAVE_ISATTY +#define isatty(n) (1) +#endif diff --git a/contrib/groff/src/include/printer.h b/contrib/groff/src/include/printer.h index beae4d9..4d5cbf5 100644 --- a/contrib/groff/src/include/printer.h +++ b/contrib/groff/src/include/printer.h @@ -1,22 +1,42 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.com) -This file is part of groff. +// <groff_src_dir>/src/include/printer.h -groff 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. +/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002 + Free Software Foundation, Inc. -groff is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. + Written by James Clark (jjc@jclark.com) -You should have received a copy of the GNU General Public License along -with groff; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Last update: 12 Apr 2002 + + This file is part of groff. + + groff 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. + + groff is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with groff; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +/* Description + + The class `printer' performs the postprocessing. Each + postprocessor only need to implement a derived class of `printer' and + a suitable function `make_printer' for the device-dependent tasks. + Then the methods of class `printer' are called automatically by + `do_file()' in `input.cc'. +*/ + +#include "color.h" struct environment { int fontno; @@ -25,6 +45,8 @@ struct environment { int vpos; int height; int slant; + color *col; + color *fill; }; struct font; @@ -45,17 +67,22 @@ public: int *widthp = 0); void set_special_char(const char *nm, const environment *env, int *widthp = 0); - void set_numbered_char(int n, const environment *env, int *widthp = 0); + void set_numbered_char(int n, const environment *env, + int *widthp = 0); int set_char_and_width(const char *nm, const environment *env, int *widthp, font **f); font *get_font_from_index(int fontno); virtual void draw(int code, int *p, int np, const environment *env); + // perform change of line color (text, outline) in the print-out + virtual void change_color(const environment * const env); + // perform change of fill color in the print-out + virtual void change_fill_color(const environment * const env); virtual void begin_page(int) = 0; virtual void end_page(int page_length) = 0; virtual font *make_font(const char *nm); virtual void end_of_line(); - virtual void special(char *arg, const environment *env, char type = 'p'); - static int adjust_arc_center(const int *, double *); + virtual void special(char *arg, const environment *env, + char type = 'p'); protected: font_pointer_list *font_list; diff --git a/contrib/groff/src/include/stringclass.h b/contrib/groff/src/include/stringclass.h index be3a044..c6295b0 100644 --- a/contrib/groff/src/include/stringclass.h +++ b/contrib/groff/src/include/stringclass.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -67,6 +67,7 @@ public: const char *contents() const; int search(char) const; char *extract() const; + void remove_spaces(); void clear(); void move(string &); @@ -122,7 +123,7 @@ inline int string::operator*() const inline const char *string::contents() const { - return ptr; + return ptr; } inline string operator+(const string &s1, const string &s2) |