summaryrefslogtreecommitdiffstats
path: root/contrib/groff/src/include
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-10-20 10:45:19 +0000
committerru <ru@FreeBSD.org>2005-10-20 10:45:19 +0000
commit353ac0b339df3493d1950b6527988b77b76bd197 (patch)
tree8a188846a3f5bd2f2b8cb869cba64e3c470a2b26 /contrib/groff/src/include
parentc40093b1f1b43dc237b9d272697cdd0842ec64ec (diff)
downloadFreeBSD-src-353ac0b339df3493d1950b6527988b77b76bd197.zip
FreeBSD-src-353ac0b339df3493d1950b6527988b77b76bd197.tar.gz
Virgin import of FSF groff v1.19.2
Diffstat (limited to 'contrib/groff/src/include')
-rw-r--r--contrib/groff/src/include/DviChar.h37
-rw-r--r--contrib/groff/src/include/Makefile.sub11
-rw-r--r--contrib/groff/src/include/XFontName.h50
-rw-r--r--contrib/groff/src/include/assert.h2
-rw-r--r--contrib/groff/src/include/cmap.h2
-rw-r--r--contrib/groff/src/include/color.h6
-rw-r--r--contrib/groff/src/include/config.hin36
-rw-r--r--contrib/groff/src/include/cset.h2
-rw-r--r--contrib/groff/src/include/device.h2
-rw-r--r--contrib/groff/src/include/driver.h4
-rw-r--r--contrib/groff/src/include/errarg.h2
-rw-r--r--contrib/groff/src/include/error.h7
-rw-r--r--contrib/groff/src/include/font.h14
-rw-r--r--contrib/groff/src/include/geometry.h2
-rw-r--r--contrib/groff/src/include/getopt.h140
-rw-r--r--contrib/groff/src/include/getopt_int.h131
-rw-r--r--contrib/groff/src/include/gettext.h4
-rw-r--r--contrib/groff/src/include/html-strings.h2
-rw-r--r--contrib/groff/src/include/htmlhint.h2
-rw-r--r--contrib/groff/src/include/index.h2
-rw-r--r--contrib/groff/src/include/lib.h59
-rw-r--r--contrib/groff/src/include/macropath.h2
-rw-r--r--contrib/groff/src/include/nonposix.h171
-rw-r--r--contrib/groff/src/include/paper.h2
-rw-r--r--contrib/groff/src/include/posix.h8
-rw-r--r--contrib/groff/src/include/printer.h13
-rw-r--r--contrib/groff/src/include/ptable.h7
-rw-r--r--contrib/groff/src/include/refid.h2
-rw-r--r--contrib/groff/src/include/relocate.h27
-rw-r--r--contrib/groff/src/include/search.h10
-rw-r--r--contrib/groff/src/include/searchpath.h6
-rw-r--r--contrib/groff/src/include/stringclass.h2
-rw-r--r--contrib/groff/src/include/symbol.h83
-rw-r--r--contrib/groff/src/include/unicode.h26
34 files changed, 697 insertions, 179 deletions
diff --git a/contrib/groff/src/include/DviChar.h b/contrib/groff/src/include/DviChar.h
new file mode 100644
index 0000000..a77f036
--- /dev/null
+++ b/contrib/groff/src/include/DviChar.h
@@ -0,0 +1,37 @@
+/*
+ * DviChar.h
+ *
+ * descriptions for mapping dvi names to
+ * font indexes and back. Dvi fonts are all
+ * 256 elements (actually only 256-32 are usable).
+ *
+ * The encoding names are taken from X -
+ * case insensitive, a dash separating the
+ * CharSetRegistry from the CharSetEncoding
+ */
+
+# define DVI_MAX_SYNONYMS 10
+# define DVI_MAP_SIZE 256
+# define DVI_HASH_SIZE 256
+
+typedef struct _dviCharNameHash {
+ struct _dviCharNameHash *next;
+ const char *name;
+ int position;
+} DviCharNameHash;
+
+typedef struct _dviCharNameMap {
+ const char *encoding;
+ int special;
+ const char *dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS];
+ DviCharNameHash *buckets[DVI_HASH_SIZE];
+} DviCharNameMap;
+
+DviCharNameMap *DviFindMap (char *);
+void DviRegisterMap (DviCharNameMap *);
+#ifdef NOTDEF
+char *DviCharName (DviCharNameMap *, int, int);
+#else
+#define DviCharName(map,index,synonym) ((map)->dvi_names[index][synonym])
+#endif
+int DviCharIndex (DviCharNameMap *, const char *);
diff --git a/contrib/groff/src/include/Makefile.sub b/contrib/groff/src/include/Makefile.sub
index 620d345..58e1ac9 100644
--- a/contrib/groff/src/include/Makefile.sub
+++ b/contrib/groff/src/include/Makefile.sub
@@ -5,12 +5,14 @@ HDRS=\
color.h \
device.h \
driver.h \
+ DviChar.h \
errarg.h \
error.h \
font.h \
geometry.h \
getopt.h \
- groff-getopt.h \
+ getopt_int.h \
+ gettext.h \
htmlhint.h \
index.h \
lib.h \
@@ -20,9 +22,13 @@ HDRS=\
printer.h \
ptable.h \
refid.h \
+ relocate.h \
search.h \
searchpath.h \
- stringclass.h
+ stringclass.h \
+ symbol.h \
+ unicode.h \
+ XFontName.h
GENHDRS=defs.h
all depend: $(GENHDRS)
@@ -31,6 +37,7 @@ defs.h: FORCE
@$(SHELL) $(top_srcdir)/gendef.sh defs.h \
"PROG_PREFIX=\"$(g)\"" \
"DEVICE=\"$(DEVICE)\"" \
+ "INSTALLPATH=\"$(prefix)\"" \
"BINPATH=\"$(bindir)\"" \
"FONTPATH=\"$(fontpath)\"" \
"MACROPATH=\"$(tmacpath)\"" \
diff --git a/contrib/groff/src/include/XFontName.h b/contrib/groff/src/include/XFontName.h
new file mode 100644
index 0000000..4e9c694
--- /dev/null
+++ b/contrib/groff/src/include/XFontName.h
@@ -0,0 +1,50 @@
+typedef struct _xFontName {
+ char Registry[256];
+ char Foundry[256];
+ char FamilyName[256];
+ char WeightName[256];
+ char Slant[3];
+ char SetwidthName[256];
+ char AddStyleName[256];
+ unsigned int PixelSize;
+ unsigned int PointSize;
+ unsigned int ResolutionX;
+ unsigned int ResolutionY;
+ char Spacing[2];
+ unsigned int AverageWidth;
+ char CharSetRegistry[256];
+ char CharSetEncoding[256];
+} XFontName;
+
+#define FontNameRegistry (1<<0)
+#define FontNameFoundry (1<<1)
+#define FontNameFamilyName (1<<2)
+#define FontNameWeightName (1<<3)
+#define FontNameSlant (1<<4)
+#define FontNameSetwidthName (1<<5)
+#define FontNameAddStyleName (1<<6)
+#define FontNamePixelSize (1<<7)
+#define FontNamePointSize (1<<8)
+#define FontNameResolutionX (1<<9)
+#define FontNameResolutionY (1<<10)
+#define FontNameSpacing (1<<11)
+#define FontNameAverageWidth (1<<12)
+#define FontNameCharSetRegistry (1<<13)
+#define FontNameCharSetEncoding (1<<14)
+
+#define SlantRoman "R"
+#define SlantItalic "I"
+#define SlantOblique "O"
+#define SlantReverseItalic "RI"
+#define SlantReverseOblique "RO"
+
+#define SpacingMonoSpaced "M"
+#define SpacingProportional "P"
+#define SpacingCharacterCell "C"
+
+typedef char *XFontNameString;
+
+Bool XParseFontName (XFontNameString, XFontName *, unsigned int *);
+Bool XFormatFontName (XFontName *, unsigned int, XFontNameString);
+Bool XCompareFontName (XFontName *, XFontName *, unsigned int);
+Bool XCopyFontName (XFontName *, XFontName *, unsigned int);
diff --git a/contrib/groff/src/include/assert.h b/contrib/groff/src/include/assert.h
index 18d9c26..76b3b20 100644
--- a/contrib/groff/src/include/assert.h
+++ b/contrib/groff/src/include/assert.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef ASSERT_H
#define ASSERT_H
diff --git a/contrib/groff/src/include/cmap.h b/contrib/groff/src/include/cmap.h
index 1537d46..d786829 100644
--- a/contrib/groff/src/include/cmap.h
+++ b/contrib/groff/src/include/cmap.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef UCHAR_MAX
#define UCHAR_MAX 255
diff --git a/contrib/groff/src/include/color.h b/contrib/groff/src/include/color.h
index 205f70e..52f97c6 100644
--- a/contrib/groff/src/include/color.h
+++ b/contrib/groff/src/include/color.h
@@ -21,9 +21,10 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stddef.h>
+#include "symbol.h"
enum color_scheme {DEFAULT, CMY, CMYK, RGB, GRAY};
@@ -38,8 +39,9 @@ private:
const size_t);
public:
+ symbol nm;
enum {MAX_COLOR_VAL = 0xffff};
- color() : scheme(DEFAULT){}
+ color(symbol s = default_symbol) : scheme(DEFAULT), nm(s) {}
color(const color * const);
~color();
void *operator new(size_t);
diff --git a/contrib/groff/src/include/config.hin b/contrib/groff/src/include/config.hin
index 13a3630..5f871aa 100644
--- a/contrib/groff/src/include/config.hin
+++ b/contrib/groff/src/include/config.hin
@@ -3,14 +3,21 @@
/* Define if your C++ doesn't understand `delete []'. */
#undef ARRAY_DELETE_NEEDS_SIZE
+/* Define if you have a C++ <inttypes.h>. */
+#undef HAVE_CC_INTTYPES_H
+
/* 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 a C++ <stdint.h>. */
-#undef HAVE_CC_STDINT_H
+/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SYS_SIGLIST
+
+/* Define to 1 if you have the <direct.h> header file. */
+#undef HAVE_DIRECT_H
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
@@ -33,6 +40,9 @@
/* Define to 1 if you have the `isatty' function. */
#undef HAVE_ISATTY
+/* Define to 1 if you have the `kill' function. */
+#undef HAVE_KILL
+
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
@@ -48,6 +58,9 @@
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
+/* Define to 1 if you have the <process.h> header file. */
+#undef HAVE_PROCESS_H
+
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
@@ -93,10 +106,10 @@
/* Define to 1 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>. */
+/* Define if you have sys_errlist in <errno.h>, <stdio.h>, or <stdlib.h>. */
#undef HAVE_SYS_ERRLIST
-/* Define if you have sysnerr in <errno.h> or <stdio.h>. */
+/* Define if you have sys_nerr in <errno.h>, <stdio.h>, or <stdio.h>. */
#undef HAVE_SYS_NERR
/* Define to 1 if you have the <sys/stat.h> header file. */
@@ -111,6 +124,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
/* Define if the host's encoding is EBCDIC. */
#undef IS_EBCDIC_HOST
@@ -147,6 +163,12 @@
/* Define if your C++ doesn't declare strncasecmp(). */
#undef NEED_DECLARATION_STRNCASECMP
+/* Define if your C++ doesn't declare vfprintf(). */
+#undef NEED_DECLARATION_VFPRINTF
+
+/* Define if your C++ doesn't declare vsnprintf(). */
+#undef NEED_DECLARATION_VSNPRINTF
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -174,9 +196,6 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define to 1 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
@@ -184,6 +203,9 @@
core image was produced for a process that was terminated by a signal. */
#undef WCOREFLAG
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
+
/* Define if -D_POSIX_SOURCE is necessary. */
#undef _POSIX_SOURCE
diff --git a/contrib/groff/src/include/cset.h b/contrib/groff/src/include/cset.h
index b3a1a97..a241c00 100644
--- a/contrib/groff/src/include/cset.h
+++ b/contrib/groff/src/include/cset.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CC_LIMITS_H
#include <limits.h>
diff --git a/contrib/groff/src/include/device.h b/contrib/groff/src/include/device.h
index 341af8d..ecafc26 100644
--- a/contrib/groff/src/include/device.h
+++ b/contrib/groff/src/include/device.h
@@ -16,6 +16,6 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
extern const char *device;
diff --git a/contrib/groff/src/include/driver.h b/contrib/groff/src/include/driver.h
index b15d6c9..f6804ef 100644
--- a/contrib/groff/src/include/driver.h
+++ b/contrib/groff/src/include/driver.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
@@ -17,7 +17,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "lib.h"
diff --git a/contrib/groff/src/include/errarg.h b/contrib/groff/src/include/errarg.h
index 08af44a..1aa191a 100644
--- a/contrib/groff/src/include/errarg.h
+++ b/contrib/groff/src/include/errarg.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class errarg {
enum { EMPTY, STRING, CHAR, INTEGER, UNSIGNED_INTEGER, DOUBLE } type;
diff --git a/contrib/groff/src/include/error.h b/contrib/groff/src/include/error.h
index e227682..b9d48d0 100644
--- a/contrib/groff/src/include/error.h
+++ b/contrib/groff/src/include/error.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
extern void fatal_with_file_and_line(const char *filename, int lineno,
const char *format,
@@ -52,7 +53,7 @@ extern void warning(const char *,
const errarg &arg3 = empty_errarg);
-extern const char *program_name;
+extern "C" const char *program_name;
extern int current_lineno;
extern const char *current_filename;
extern const char *current_source_filename;
diff --git a/contrib/groff/src/include/font.h b/contrib/groff/src/include/font.h
index 43bf121..3ef4fed 100644
--- a/contrib/groff/src/include/font.h
+++ b/contrib/groff/src/include/font.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
typedef void (*FONT_COMMAND_HANDLER)(const char *, const char *,
const char *, int);
@@ -53,10 +54,11 @@ public:
const char *get_special_device_encoding(int index);
const char *get_name();
const char *get_internal_name();
+ const char *get_image_generator();
static int scan_papersize(const char *, const char **, double *, double *);
- static font *load_font(const char *, int *not_found = 0);
+ static font *load_font(const char *, int * = 0, int = 0);
static void command_line_font_dir(const char *path);
static FILE *open_file(const char *name, char **pathp);
static int load_desc();
@@ -76,8 +78,10 @@ public:
static int spare2;
static int sizescale;
static int tcommand;
+ static int unscaled_charwidths;
static int pass_filenames;
static int use_charnames_in_special;
+ static const char *image_generator;
static const char **font_name_table;
static const char **style_table;
@@ -87,7 +91,7 @@ private:
unsigned ligatures;
font_kern_list **kern_hash_table;
int space_width;
- short *ch_index;
+ int *ch_index;
int nindices;
font_char_metric *ch;
int ch_used;
@@ -116,5 +120,5 @@ private:
const char *file, int lineno);
protected:
font(const char *);
- int load(int *not_found = 0);
+ int load(int * = 0, int = 0);
};
diff --git a/contrib/groff/src/include/geometry.h b/contrib/groff/src/include/geometry.h
index d425f15..1ce0df0 100644
--- a/contrib/groff/src/include/geometry.h
+++ b/contrib/groff/src/include/geometry.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
int adjust_arc_center(const int *, double *);
void check_output_arc_limits(int x, int y,
diff --git a/contrib/groff/src/include/getopt.h b/contrib/groff/src/include/getopt.h
index 4283c35..a4e78cb 100644
--- a/contrib/groff/src/include/getopt.h
+++ b/contrib/groff/src/include/getopt.h
@@ -1,21 +1,21 @@
/* Declarations for getopt.
- Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+ Free Software Foundation, Inc.
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 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.
+ 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.
- The GNU C Library is distributed in the hope that it will be useful,
+ 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
- Lesser General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- 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. */
+ 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. */
#ifndef _GETOPT_H
@@ -23,6 +23,64 @@
# define _GETOPT_H 1
#endif
+/* Standalone applications should #define __GETOPT_PREFIX to an
+ identifier that prefixes the external functions and variables
+ defined in this header. When this happens, include the
+ headers that might declare getopt so that they will not cause
+ confusion if included after this file. Then systematically rename
+ identifiers so that they do not collide with the system functions
+ and variables. Renaming avoids problems with some compilers and
+ linkers. */
+#if defined __GETOPT_PREFIX && !defined __need_getopt
+# include <stdlib.h>
+# include <stdio.h>
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+# undef __need_getopt
+# undef getopt
+# undef getopt_long
+# undef getopt_long_only
+# undef optarg
+# undef opterr
+# undef optind
+# undef optopt
+# define __GETOPT_CONCAT(x, y) x ## y
+# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# define getopt __GETOPT_ID (getopt)
+# define getopt_long __GETOPT_ID (getopt_long)
+# define getopt_long_only __GETOPT_ID (getopt_long_only)
+# define optarg __GETOPT_ID (optarg)
+# define opterr __GETOPT_ID (opterr)
+# define optind __GETOPT_ID (optind)
+# define optopt __GETOPT_ID (optopt)
+#endif
+
+/* Standalone applications get correct prototypes for getopt_long and
+ getopt_long_only; they declare "char **argv". libc uses prototypes
+ with "char *const *argv" that are incorrect because getopt_long and
+ getopt_long_only can permute argv; this is required for backward
+ compatibility (e.g., for LSB 2.0.1).
+
+ This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
+ but it caused redefinition warnings if both unistd.h and getopt.h were
+ included, since unistd.h includes getopt.h having previously defined
+ __need_getopt.
+
+ The only place where __getopt_argv_const is used is in definitions
+ of getopt_long and getopt_long_only below, but these are visible
+ only if __need_getopt is not defined, so it is quite safe to rewrite
+ the conditional as follows:
+*/
+#if !defined __need_getopt
+# if defined __GETOPT_PREFIX
+# define __getopt_argv_const /* empty */
+# else
+# define __getopt_argv_const const
+# endif
+#endif
+
/* If __GNU_LIBRARY__ is not already defined, either we are being used
standalone, or this is the first header included in the source file.
If we are being used with glibc, we need to include <features.h>, but
@@ -34,6 +92,17 @@
# include <ctype.h>
#endif
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+# define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -78,7 +147,7 @@ extern int optopt;
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
+ optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
@@ -93,11 +162,7 @@ extern int optopt;
struct option
{
-# if (defined __STDC__ && __STDC__) || defined __cplusplus
const char *name;
-# else
- char *name;
-# endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
@@ -137,39 +202,20 @@ struct option
arguments to the option '\0'. This behavior is specific to the GNU
`getopt'. */
-#if (defined __STDC__ && __STDC__) || defined __cplusplus
-# ifdef __GNU_LIBRARY__
-/* 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);
-# 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,
- const struct option *__longopts, int *__longind);
-extern int getopt_long_only (int ___argc, char *const *___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind);
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+ __THROW;
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int ___argc, char *const *___argv,
+#ifndef __need_getopt
+extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind)
+ __THROW;
+extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only);
-# endif
-#else /* not __STDC__ */
-extern int getopt ();
-# ifndef __need_getopt
-extern int getopt_long ();
-extern int getopt_long_only ();
+ const struct option *__longopts, int *__longind)
+ __THROW;
-extern int _getopt_internal ();
-# endif
-#endif /* __STDC__ */
+#endif
#ifdef __cplusplus
}
diff --git a/contrib/groff/src/include/getopt_int.h b/contrib/groff/src/include/getopt_int.h
new file mode 100644
index 0000000..401579f
--- /dev/null
+++ b/contrib/groff/src/include/getopt_int.h
@@ -0,0 +1,131 @@
+/* Internal declarations for getopt.
+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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. */
+
+#ifndef _GETOPT_INT_H
+#define _GETOPT_INT_H 1
+
+extern int _getopt_internal (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, int __posixly_correct);
+
+
+/* Reentrant versions which can handle parsing multiple argument
+ vectors at the same time. */
+
+/* Data type for reentrant functions. */
+struct _getopt_data
+{
+ /* These have exactly the same meaning as the corresponding global
+ variables, except that they are used for the reentrant
+ versions of getopt. */
+ int optind;
+ int opterr;
+ int optopt;
+ char *optarg;
+
+ /* Internal members. */
+
+ /* True if the internal members have been initialized. */
+ int __initialized;
+
+ /* 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. */
+ char *__nextchar;
+
+ /* 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, or by calling getopt.
+
+ 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 -1 with `optind' != ARGC. */
+
+ enum
+ {
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+ } __ordering;
+
+ /* If the POSIXLY_CORRECT environment variable is set
+ or getopt was called. */
+ int __posixly_correct;
+
+
+ /* 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. */
+
+ int __first_nonopt;
+ int __last_nonopt;
+
+#if defined _LIBC && defined USE_NONOPTION_FLAGS
+ int __nonoption_flags_max_len;
+ int __nonoption_flags_len;
+# endif
+};
+
+/* The initializer is necessary to set OPTIND and OPTERR to their
+ default values and to clear the initialization flag. */
+#define _GETOPT_DATA_INITIALIZER { 1, 1 }
+
+extern int _getopt_internal_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only, int __posixly_correct,
+ struct _getopt_data *__data);
+
+extern int _getopt_long_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ struct _getopt_data *__data);
+
+extern int _getopt_long_only_r (int ___argc, char **___argv,
+ const char *__shortopts,
+ const struct option *__longopts,
+ int *__longind,
+ struct _getopt_data *__data);
+
+#endif /* getopt_int.h */
diff --git a/contrib/groff/src/include/gettext.h b/contrib/groff/src/include/gettext.h
new file mode 100644
index 0000000..26fd2c5
--- /dev/null
+++ b/contrib/groff/src/include/gettext.h
@@ -0,0 +1,4 @@
+/* This is a dummy header file to make getopt compile without gettext
+ support. */
+
+#define gettext(s) s
diff --git a/contrib/groff/src/include/html-strings.h b/contrib/groff/src/include/html-strings.h
index fd757c3f..26daeb6 100644
--- a/contrib/groff/src/include/html-strings.h
+++ b/contrib/groff/src/include/html-strings.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/*
* defines the image tags issued by the pre-processors (tbl, pic, eqn)
diff --git a/contrib/groff/src/include/htmlhint.h b/contrib/groff/src/include/htmlhint.h
index f1f46f7..e0b41dd 100644
--- a/contrib/groff/src/include/htmlhint.h
+++ b/contrib/groff/src/include/htmlhint.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef HTMLINDICATE_H
#define HTMLINDICATE_H
diff --git a/contrib/groff/src/include/index.h b/contrib/groff/src/include/index.h
index 7e60813..c90610e 100644
--- a/contrib/groff/src/include/index.h
+++ b/contrib/groff/src/include/index.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#define INDEX_MAGIC 0x23021964
#define INDEX_VERSION 1
diff --git a/contrib/groff/src/include/lib.h b/contrib/groff/src/include/lib.h
index bebad98..bb59337 100644
--- a/contrib/groff/src/include/lib.h
+++ b/contrib/groff/src/include/lib.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2005
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -31,18 +32,8 @@ extern "C" {
const char *if_to_a(int, int);
}
-/* 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(__EMX__) \
- || defined(__CYGWIN__))
-#include <groff-getopt.h>
-#else
+#define __GETOPT_PREFIX groff_
#include <getopt.h>
-#endif
#ifdef HAVE_SETLOCALE
#include <locale.h>
@@ -52,6 +43,7 @@ extern "C" {
char *strsave(const char *s);
int is_prime(unsigned);
+double groff_hypot(double, double);
#include <stdio.h>
#include <string.h>
@@ -59,13 +51,21 @@ int is_prime(unsigned);
#include <strings.h>
#endif
-/* HP-UX 10.20 doesn't declare snprintf() */
-#if !defined(HAVE_SNPRINTF) || defined(NEED_DECLARATION_SNPRINTF)
#include <stdarg.h>
-extern "C" {
- int snprintf(char *, size_t, const char *, /*args*/ ...);
- int vsnprintf(char *, size_t, const char *, va_list);
-}
+
+/* HP-UX 10.20 and LynxOS 4.0.0 don't declare snprintf() */
+#if !defined(HAVE_SNPRINTF) || defined(NEED_DECLARATION_SNPRINTF)
+extern "C" { int snprintf(char *, size_t, const char *, /*args*/ ...); }
+#endif
+
+/* LynxOS 4.0.0 has snprintf() but no vsnprintf() */
+#if !defined(HAVE_VSNPRINTF) || defined(NEED_DECLARATION_VSNPRINTF)
+extern "C" { int vsnprintf(char *, size_t, const char *, va_list); }
+#endif
+
+/* LynxOS 4.0.0 doesn't declare vfprintf() */
+#ifdef NEED_DECLARATION_VFPRINTF
+extern "C" { int vfprintf(FILE *, const char *, va_list); }
#endif
#ifndef HAVE_MKSTEMP
@@ -90,6 +90,7 @@ extern "C" { int pclose (FILE *); }
#endif /* NEED_DECLARATION_PCLOSE */
size_t file_name_max(const char *fname);
+size_t path_name_max();
int interpret_lf_args(const char *p);
@@ -102,29 +103,21 @@ inline int invalid_input_char(int 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 *);
-}
+// Ultrix4.3's string.h fails to declare this.
+extern "C" { int strcasecmp(const char *, const char *); }
#endif /* NEED_DECLARATION_STRCASECMP */
#else /* not HAVE_STRCASECMP */
-extern "C" {
- int strcasecmp(const char *, const char *);
-}
+extern "C" { int strcasecmp(const char *, const char *); }
#endif /* HAVE_STRCASECMP */
#if !defined(_AIX) && !defined(sinix) && !defined(__sinix__)
#ifdef HAVE_STRNCASECMP
#ifdef NEED_DECLARATION_STRNCASECMP
-extern "C" {
- // SunOS's string.h fails to declare this.
- int strncasecmp(const char *, const char *, int);
-}
+// SunOS's string.h fails to declare this.
+extern "C" { int strncasecmp(const char *, const char *, int); }
#endif /* NEED_DECLARATION_STRNCASECMP */
#else /* not HAVE_STRNCASECMP */
-extern "C" {
- int strncasecmp(const char *, const char *, size_t);
-}
+extern "C" { int strncasecmp(const char *, const char *, size_t); }
#endif /* HAVE_STRNCASECMP */
#endif /* !_AIX && !sinix && !__sinix__ */
diff --git a/contrib/groff/src/include/macropath.h b/contrib/groff/src/include/macropath.h
index b4a2bd0..3b38baa 100644
--- a/contrib/groff/src/include/macropath.h
+++ b/contrib/groff/src/include/macropath.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
extern search_path macro_path;
extern search_path safer_macro_path;
diff --git a/contrib/groff/src/include/nonposix.h b/contrib/groff/src/include/nonposix.h
index 73422d9..9564a8b 100644
--- a/contrib/groff/src/include/nonposix.h
+++ b/contrib/groff/src/include/nonposix.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Written by Eli Zaretskii (eliz@is.elta.co.il)
This file is part of groff.
@@ -15,10 +16,12 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
/* This header file compartmentalize all idiosyncrasies of non-Posix
- systems, such as MS-DOS, MS-Windows, etc. */
+ systems, such as MS-DOS, MS-Windows, etc. It should be loaded after
+ the system headers like stdio.h to protect against warnings and error
+ messages w.r.t. redefining macros. */
#if defined _MSC_VER
# ifndef _WIN32
@@ -29,31 +32,48 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if defined(__MSDOS__) || defined(__EMX__) \
|| (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. */
+/* Binary I/O nuisances. */
# include <fcntl.h>
# include <io.h>
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
-# 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)
+# ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+# define STDOUT_FILENO 1
+# define STDERR_FILENO 2
# 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 HAVE_DIRECT_H
+# include <direct.h>
+# endif
+# ifdef HAVE_PROCESS_H
+# include <process.h>
+# endif
+# if defined(_MSC_VER) || defined(__MINGW32__)
+# define POPEN_RT "rt"
+# define POPEN_WT "wt"
+# define popen(c,m) _popen(c,m)
+# define pclose(p) _pclose(p)
+# define pipe(pfd) _pipe((pfd),0,_O_BINARY|_O_NOINHERIT)
+# 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)
+# define read(f,b,s) _read(f,b,s)
+# define write(f,b,s) _write(f,b,s)
+# define dup(f) _dup(f)
+# define dup2(f1,f2) _dup2(f1,f2)
+# define close(f) _close(f)
+# define isatty(f) _isatty(f)
+# define access(p,m) _access(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)
+# define O_BINARY (_O_BINARY)
# endif
# endif
@@ -61,96 +81,151 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
systems don't have standard places where it lives, and might not
have it installed to begin with. We want to give them some leeway. */
# ifdef __EMX__
-# define getcwd(b,s) _getcwd2(b,s)
+# define getcwd(b,s) _getcwd2(b,s)
# else
-# define BSHELL (system_shell_name())
-# define BSHELL_DASH_C (system_shell_dash_c())
-# define IS_BSHELL(s) (is_system_shell(s))
+# define BSHELL (system_shell_name())
+# define BSHELL_DASH_C (system_shell_dash_c())
+# define IS_BSHELL(s) (is_system_shell(s))
# endif
/* The separator for directories in PATH and other environment
variables. */
-# define PATH_SEP ";"
+# define PATH_SEP ";"
+# define PATH_SEP_CHAR ';'
/* Characters that separate directories in a path name. */
-# define DIR_SEPS "/\\:"
+# define DIR_SEPS "/\\:"
/* How to tell if the argument is an absolute file name. */
# define IS_ABSOLUTE(f) \
((f)[0] == '/' || (f)[0] == '\\' || (f)[0] && (f)[1] == ':')
/* The executable extension. */
-# define EXE_EXT ".exe"
+# define EXE_EXT ".exe"
+
+/* Possible executable extensions. */
+# define PATH_EXT ".com;.exe;.bat;.cmd"
/* The system null device. */
-# define NULL_DEV "NUL"
+# define NULL_DEV "NUL"
+
+/* The default place to create temporary files. */
+# ifndef P_tmpdir
+# ifdef _P_tmpdir
+# define P_tmpdir _P_tmpdir
+# else
+# define P_tmpdir "c:/temp"
+# endif
+# endif
/* Prototypes. */
# ifdef __cplusplus
extern "C" {
# endif
- const char * system_shell_name(void);
+ char * system_shell_name(void);
const char * system_shell_dash_c(void);
- int is_system_shell(const char *);
+ int is_system_shell(const char *);
+# ifdef __cplusplus
+ }
+# endif
+
+#endif
+
+#if defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__)
+/* Win32 implementations which use the Microsoft runtime library
+ * are prone to hanging when a pipe reader quits with unread data in the pipe.
+ * `gtroff' avoids this, by invoking `FLUSH_INPUT_PIPE()', defined as ... */
+# define FLUSH_INPUT_PIPE(fd) \
+ do if (!isatty(fd)) \
+ { \
+ char drain[BUFSIZ]; \
+ while (read(fd, drain, sizeof(drain)) > 0) \
+ ; \
+ } while (0)
+
+/* The Microsoft runtime library also has a broken argument passing mechanism,
+ * which may result in improper grouping of arguments passed to a child process
+ * by the `spawn()' family of functions. In `groff', only the `spawnvp()'
+ * function is affected; we work around this defect, by substituting a
+ * wrapper function in place of `spawnvp()' calls. */
+
+# ifdef __cplusplus
+ extern "C" {
+# endif
+ int spawnvp_wrapper(int, char *, char **);
# ifdef __cplusplus
}
# endif
+# ifndef SPAWN_FUNCTION_WRAPPERS
+# undef spawnvp
+# define spawnvp spawnvp_wrapper
+# undef _spawnvp
+# define _spawnvp spawnvp
+# endif /* SPAWN_FUNCTION_WRAPPERS */
+#else
+/* Other implementations do not suffer from Microsoft runtime bugs,
+ * but `gtroff' requires a dummy definition for FLUSH_INPUT_PIPE() */
+# define FLUSH_INPUT_PIPE(fd) do {} while(0)
#endif
/* Defaults, for Posix systems. */
#ifndef SET_BINARY
-# define SET_BINARY(f) do {} while(0)
+# define SET_BINARY(f) do {} while(0)
#endif
#ifndef FOPEN_RB
-# define FOPEN_RB "r"
+# define FOPEN_RB "r"
#endif
#ifndef FOPEN_WB
-# define FOPEN_WB "w"
+# define FOPEN_WB "w"
#endif
#ifndef FOPEN_RWB
-# define FOPEN_RWB "w+"
+# define FOPEN_RWB "w+"
#endif
#ifndef POPEN_RT
-# define POPEN_RT "r"
+# define POPEN_RT "r"
#endif
#ifndef POPEN_WT
-# define POPEN_WT "w"
+# define POPEN_WT "w"
#endif
#ifndef O_BINARY
-# define O_BINARY 0
+# define O_BINARY 0
#endif
#ifndef BSHELL
-# define BSHELL "/bin/sh"
+# define BSHELL "/bin/sh"
#endif
#ifndef BSHELL_DASH_C
-# define BSHELL_DASH_C "-c"
+# define BSHELL_DASH_C "-c"
#endif
#ifndef IS_BSHELL
-# define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0)
+# define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0)
#endif
#ifndef PATH_SEP
-# define PATH_SEP ":"
+# define PATH_SEP ":"
+# define PATH_SEP_CHAR ':'
#endif
#ifndef DIR_SEPS
-# define DIR_SEPS "/"
+# define DIR_SEPS "/"
#endif
#ifndef IS_ABSOLUTE
-# define IS_ABSOLUTE(f) ((f)[0] == '/')
+# define IS_ABSOLUTE(f) ((f)[0] == '/')
#endif
#ifndef EXE_EXT
-# define EXE_EXT ""
+# define EXE_EXT ""
+#endif
+#ifndef PATH_EXT
+# define PATH_EXT ""
#endif
#ifndef NULL_DEV
-# define NULL_DEV "/dev/null"
+# define NULL_DEV "/dev/null"
#endif
#ifndef GS_NAME
-# define GS_NAME "gs"
+# define GS_NAME "gs"
#endif
#ifndef WAIT
-# define WAIT(s,p,m) wait(s)
+# define WAIT(s,p,m) wait(s)
#endif
#ifndef _WAIT_CHILD
-# define _WAIT_CHILD 0
+# define _WAIT_CHILD 0
#endif
diff --git a/contrib/groff/src/include/paper.h b/contrib/groff/src/include/paper.h
index 7a01fc2..e88965d 100644
--- a/contrib/groff/src/include/paper.h
+++ b/contrib/groff/src/include/paper.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
struct paper {
char *name;
diff --git a/contrib/groff/src/include/posix.h b/contrib/groff/src/include/posix.h
index e7f38cd..28b807c 100644
--- a/contrib/groff/src/include/posix.h
+++ b/contrib/groff/src/include/posix.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1992, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <sys/types.h>
#include <sys/stat.h>
@@ -58,6 +58,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define O_RDONLY 0
#endif
+#ifndef F_OK
+#define F_OK 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 3976215..fb39f48 100644
--- a/contrib/groff/src/include/printer.h
+++ b/contrib/groff/src/include/printer.h
@@ -2,12 +2,12 @@
// <groff_src_dir>/src/include/printer.h
-/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003
+/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
- Last update: 12 Apr 2002
+ Last update: 15 Dec 2004
This file is part of groff.
@@ -23,8 +23,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.
+ Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
+ 02110-1301, USA.
*/
/* Description
@@ -49,7 +49,7 @@ struct environment {
color *fill;
};
-struct font;
+class font;
struct font_pointer_list {
font *p;
@@ -83,6 +83,9 @@ public:
virtual void end_of_line();
virtual void special(char *arg, const environment *env,
char type = 'p');
+ virtual void devtag(char *arg, const environment *env,
+ char type = 'p');
+
protected:
font_pointer_list *font_list;
font **font_table;
diff --git a/contrib/groff/src/include/ptable.h b/contrib/groff/src/include/ptable.h
index ffbe8e6..b288187 100644
--- a/contrib/groff/src/include/ptable.h
+++ b/contrib/groff/src/include/ptable.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2004
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <assert.h>
#include <string.h>
@@ -43,7 +44,7 @@ struct PASSOC(T) { \
PASSOC(T)(); \
}; \
\
-struct PTABLE(T); \
+class PTABLE(T); \
\
class PTABLE_ITERATOR(T) { \
PTABLE(T) *p; \
diff --git a/contrib/groff/src/include/refid.h b/contrib/groff/src/include/refid.h
index 605427e..84e5119 100644
--- a/contrib/groff/src/include/refid.h
+++ b/contrib/groff/src/include/refid.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class reference_id {
int filename_id;
diff --git a/contrib/groff/src/include/relocate.h b/contrib/groff/src/include/relocate.h
new file mode 100644
index 0000000..0d9edc4
--- /dev/null
+++ b/contrib/groff/src/include/relocate.h
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+/* Provide relocation for macro and font files.
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+ This program 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, 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301,
+ USA. */
+
+extern char *curr_prefix;
+extern size_t curr_prefix_len;
+
+void set_current_prefix ();
+char *xdirname (char *s);
+char *searchpath (const char *name, const char *pathp);
+char *relocatep (const char *path);
+char *relocate (const char *path);
diff --git a/contrib/groff/src/include/search.h b/contrib/groff/src/include/search.h
index 260410e..3dde894 100644
--- a/contrib/groff/src/include/search.h
+++ b/contrib/groff/src/include/search.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,10 +16,10 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
-struct search_item;
-struct search_item_iterator;
+class search_item;
+class search_item_iterator;
class search_list {
public:
@@ -34,7 +34,7 @@ private:
friend class search_list_iterator;
};
-struct bmpattern;
+class bmpattern;
class linear_searcher {
const char *ignore_fields;
diff --git a/contrib/groff/src/include/searchpath.h b/contrib/groff/src/include/searchpath.h
index 4d89a8d..dab161e 100644
--- a/contrib/groff/src/include/searchpath.h
+++ b/contrib/groff/src/include/searchpath.h
@@ -1,5 +1,6 @@
// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2003
+ Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.com)
This file is part of groff.
@@ -16,7 +17,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
class search_path {
char *dirs;
@@ -27,4 +28,5 @@ public:
~search_path();
void command_line_dir(const char *);
FILE *open_file(const char *, char **);
+ FILE *open_file_cautious(const char *, char ** = 0, const char * = 0);
};
diff --git a/contrib/groff/src/include/stringclass.h b/contrib/groff/src/include/stringclass.h
index c6295b0..fb3299c 100644
--- a/contrib/groff/src/include/stringclass.h
+++ b/contrib/groff/src/include/stringclass.h
@@ -16,7 +16,7 @@ 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. */
+Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
#include <string.h>
#include <stdio.h>
diff --git a/contrib/groff/src/include/symbol.h b/contrib/groff/src/include/symbol.h
new file mode 100644
index 0000000..c3cc8ee
--- /dev/null
+++ b/contrib/groff/src/include/symbol.h
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
+ Free Software Foundation, Inc.
+ Written by James Clark (jjc@jclark.com)
+
+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, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define DONT_STORE 1
+#define MUST_ALREADY_EXIST 2
+
+class symbol {
+ static const char **table;
+ static int table_used;
+ static int table_size;
+ static char *block;
+ static int block_size;
+ const char *s;
+public:
+ symbol(const char *p, int how = 0);
+ symbol();
+ unsigned long hash() const;
+ int operator ==(symbol) const;
+ int operator !=(symbol) const;
+ const char *contents() const;
+ int is_null() const;
+ int is_empty() const;
+};
+
+
+extern const symbol NULL_SYMBOL;
+extern const symbol EMPTY_SYMBOL;
+
+inline symbol::symbol() : s(0)
+{
+}
+
+inline int symbol::operator==(symbol p) const
+{
+ return s == p.s;
+}
+
+inline int symbol::operator!=(symbol p) const
+{
+ return s != p.s;
+}
+
+inline unsigned long symbol::hash() const
+{
+ return (unsigned long)s;
+}
+
+inline const char *symbol::contents() const
+{
+ return s;
+}
+
+inline int symbol::is_null() const
+{
+ return s == 0;
+}
+
+inline int symbol::is_empty() const
+{
+ return s != 0 && *s == 0;
+}
+
+symbol concat(symbol, symbol);
+
+extern symbol default_symbol;
diff --git a/contrib/groff/src/include/unicode.h b/contrib/groff/src/include/unicode.h
new file mode 100644
index 0000000..90dab11
--- /dev/null
+++ b/contrib/groff/src/include/unicode.h
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+/* Copyright (C) 2002, 2003
+ 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, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
+
+const char *glyph_name_to_unicode(const char *);
+const char *unicode_to_glyph_name(const char *);
+const char *decompose_unicode(const char *);
+
+const char *check_unicode_name(const char *);
OpenPOWER on IntegriCloud