From 467e7b5cfeb98ab86d323773f4612ff6807d6aa5 Mon Sep 17 00:00:00 2001 From: Steffen Nurpmeso Date: Fri, 19 Sep 2014 22:53:40 +0200 Subject: [PATCH] Adapt include (src/include) --- include/cmap.h | 63 +++++++++++++++++ {src/include => include}/color.h | 60 +++++++++-------- src/include/config.hin => include/config.h.in | 4 +- include/cset.h | 78 +++++++++++++++++++++ include/device.h | 32 +++++++++ include/driver.h | 44 ++++++++++++ include/errarg.h | 55 +++++++++++++++ {src/include => include}/error.h | 48 +++++++------ {src/include => include}/file_case.h | 6 +- {src/include => include}/font.h | 67 +++++++++--------- include/geometry.h | 35 ++++++++++ {src/include => include}/getopt.h | 46 +++++++------ {src/include => include}/getopt_int.h | 44 ++++++------ include/gettext.h | 7 ++ include/html-strings.h | 30 +++++++++ include/htmlhint.h | 40 +++++++++++ include/index.h | 50 ++++++++++++++ {src/include => include}/itable.h | 60 ++++++++--------- {src/include => include}/lib.h | 92 +++++++++++++++++-------- include/localcharset.h | 42 ++++++++++++ include/macropath.h | 31 +++++++++ {src/include => include}/nonposix.h | 56 +++++++++------- include/paper.h | 45 +++++++++++++ include/posix.h | 75 +++++++++++++++++++++ {src/include => include}/printer.h | 82 +++++++++++----------- {src/include => include}/ptable.h | 60 ++++++++--------- include/refid.h | 45 +++++++++++++ include/relocate.h | 47 +++++++++++++ {src/include => include}/search.h | 75 +++++++++++++-------- include/searchpath.h | 46 +++++++++++++ {src/include => include}/stringclass.h | 97 +++++++++++++-------------- include/symbol.h | 93 +++++++++++++++++++++++++ {src/include => include}/unicode.h | 46 +++++++------ src/include/assert.h | 39 ----------- src/include/cmap.h | 56 ---------------- src/include/cset.h | 75 --------------------- src/include/device.h | 26 ------- src/include/driver.h | 36 ---------- src/include/errarg.h | 47 ------------- src/include/geometry.h | 27 -------- src/include/gettext.h | 4 -- src/include/html-strings.h | 27 -------- src/include/htmlhint.h | 37 ---------- src/include/index.h | 42 ------------ src/include/localcharset.h | 41 ----------- src/include/macropath.h | 23 ------- src/include/paper.h | 37 ---------- src/include/posix.h | 67 ------------------ src/include/refid.h | 35 ---------- src/include/relocate.h | 37 ---------- src/include/searchpath.h | 36 ---------- src/include/symbol.h | 83 ----------------------- 52 files changed, 1323 insertions(+), 1153 deletions(-) create mode 100644 include/cmap.h rename {src/include => include}/color.h (64%) rename src/include/config.hin => include/config.h.in (98%) create mode 100644 include/cset.h create mode 100644 include/device.h create mode 100644 include/driver.h create mode 100644 include/errarg.h rename {src/include => include}/error.h (55%) rename {src/include => include}/file_case.h (98%) rename {src/include => include}/font.h (91%) create mode 100644 include/geometry.h rename {src/include => include}/getopt.h (86%) rename {src/include => include}/getopt_int.h (78%) create mode 100644 include/gettext.h create mode 100644 include/html-strings.h create mode 100644 include/htmlhint.h create mode 100644 include/index.h rename {src/include => include}/itable.h (82%) rename {src/include => include}/lib.h (70%) create mode 100644 include/localcharset.h create mode 100644 include/macropath.h rename {src/include => include}/nonposix.h (80%) create mode 100644 include/paper.h create mode 100644 include/posix.h rename {src/include => include}/printer.h (52%) rename {src/include => include}/ptable.h (85%) create mode 100644 include/refid.h create mode 100644 include/relocate.h rename {src/include => include}/search.h (62%) create mode 100644 include/searchpath.h rename {src/include => include}/stringclass.h (72%) create mode 100644 include/symbol.h rename {src/include => include}/unicode.h (60%) delete mode 100644 src/include/assert.h delete mode 100644 src/include/cmap.h delete mode 100644 src/include/cset.h delete mode 100644 src/include/device.h delete mode 100644 src/include/driver.h delete mode 100644 src/include/errarg.h delete mode 100644 src/include/geometry.h delete mode 100644 src/include/gettext.h delete mode 100644 src/include/html-strings.h delete mode 100644 src/include/htmlhint.h delete mode 100644 src/include/index.h delete mode 100644 src/include/localcharset.h delete mode 100644 src/include/macropath.h delete mode 100644 src/include/paper.h delete mode 100644 src/include/posix.h delete mode 100644 src/include/refid.h delete mode 100644 src/include/relocate.h delete mode 100644 src/include/searchpath.h delete mode 100644 src/include/symbol.h diff --git a/include/cmap.h b/include/cmap.h new file mode 100644 index 00000000..ba2052ae --- /dev/null +++ b/include/cmap.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _CMAP_H +#define _CMAP_H + +#include "config.h" + +#include + +enum cmap_builtin { CMAP_BUILTIN }; + +class cmap +{ + friend class cmap_init; + + unsigned char v[UCHAR_MAX +1]; + +public: + cmap(); + cmap(cmap_builtin); + int operator()(unsigned char) const; + unsigned char &operator[](unsigned char); +}; + +inline int cmap::operator()(unsigned char c) const +{ + return v[c]; +} + +inline unsigned char &cmap::operator[](unsigned char c) +{ + return v[c]; +} + +extern cmap cmlower; +extern cmap cmupper; + +static class cmap_init { /* FIXME oh my god.. injection initializers!! */ + static int initialised; +public: + cmap_init(); +} _cmap_init; + +#endif // _CMAP_H +// s-it2-mode diff --git a/src/include/color.h b/include/color.h similarity index 64% rename from src/include/color.h rename to include/color.h index 52f97c64..9794e4ad 100644 --- a/src/include/color.h +++ b/include/color.h @@ -1,35 +1,36 @@ -// -*- C++ -*- - -/* /src/include/color.h - -Last update: 14 Feb 2003 - -Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - Written by Gaius Mulley - -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. */ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + * Written by Gaius Mulley + * + * 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. + */ +#ifndef _COLOR_H +#define _COLOR_H + +#include "config.h" #include + #include "symbol.h" enum color_scheme {DEFAULT, CMY, CMYK, RGB, GRAY}; -class color { -private: +class color +{ color_scheme scheme; unsigned int components[4]; color *next; @@ -61,7 +62,7 @@ public: 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); @@ -93,4 +94,7 @@ public: #define Gray components[0] -extern color default_color; +extern color default_color; /* FIXME class-global static? (access fun?!) */ + +#endif // _COLOR_H +// s-it2-mode diff --git a/src/include/config.hin b/include/config.h.in similarity index 98% rename from src/include/config.hin rename to include/config.h.in index 08e60015..b5ec2677 100644 --- a/src/include/config.hin +++ b/include/config.h.in @@ -1,4 +1,4 @@ -/* src/include/config.hin. Generated from configure.ac by autoheader. */ +/*@*/ /* Define if your C++ doesn't understand `delete []'. */ #undef ARRAY_DELETE_NEEDS_SIZE @@ -235,3 +235,5 @@ /* Define uintmax_t to `unsigned long' or `unsigned long long' if does not exist. */ #undef uintmax_t + +/* s-it2-mode */ diff --git a/include/cset.h b/include/cset.h new file mode 100644 index 00000000..7cdcb9f7 --- /dev/null +++ b/include/cset.h @@ -0,0 +1,78 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _CSET_H +#define _CSET_H + +#include "config.h" + +#include + +enum cset_builtin { CSET_BUILTIN }; + +class cset +{ + friend class cset_init; + + char v[UCHAR_MAX +1]; + void clear(); + +public: + cset(); + cset(cset_builtin); + cset(const char *); + cset(const unsigned char *); + int operator()(unsigned char) const; + + cset &operator|=(const cset &); + cset &operator|=(unsigned char); +}; + +inline int cset::operator()(unsigned char c) const +{ + return v[c]; +} + +inline cset &cset::operator|=(unsigned char c) +{ + v[c] = 1; + return *this; +} + +extern cset csalpha; +extern cset csupper; +extern cset cslower; +extern cset csdigit; +extern cset csxdigit; +extern cset csspace; +extern cset cspunct; +extern cset csalnum; +extern cset csprint; +extern cset csgraph; +extern cset cscntrl; + +static class cset_init { /* FIXME oh my god.. injection initializers!! */ + static int initialised; +public: + cset_init(); +} _cset_init; + +#endif // _CSET_H +// s-it2-mode diff --git a/include/device.h b/include/device.h new file mode 100644 index 00000000..980f2529 --- /dev/null +++ b/include/device.h @@ -0,0 +1,32 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2006 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _DEVICE_H +#define _DEVICE_H + +#include "config.h" + +// The target device. Once initialized, the device doesn't change during +// the entire program run. Sample devices are `ps' (for Postscript), `html' +// (for HTML), and `ascii', `latin1', `utf8' for TTY output. +extern const char *device; + +#endif // _DEVICE_H +// s-it2-mode diff --git a/include/driver.h b/include/driver.h new file mode 100644 index 00000000..329802db --- /dev/null +++ b/include/driver.h @@ -0,0 +1,44 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2000, 2001, 2003 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _DRIVER_H +#define _DRIVER_H + +#include "config.h" +#include "lib.h" + +#include +#include +#include +#include +#include +#include + +#include "errarg.h" +#include "error.h" +#include "font.h" +#include "geometry.h" +#include "printer.h" + +void do_file(const char *); + +#endif // _DRIVER_H +// s-it2-mode diff --git a/include/errarg.h b/include/errarg.h new file mode 100644 index 00000000..932e8a68 --- /dev/null +++ b/include/errarg.h @@ -0,0 +1,55 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2002 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _ERRARG_H +#define _ERRARG_H + +class errarg +{ + enum { EMPTY, STRING, CHAR, INTEGER, UNSIGNED_INTEGER, DOUBLE } type; + union { + const char *s; + int n; + unsigned int u; + char c; + double d; + }; + +public: + errarg(); + errarg(const char *); + errarg(char); + errarg(unsigned char); + errarg(int); + errarg(unsigned int); + errarg(double); + int empty() const; + void print() const; +}; + +extern errarg empty_errarg; + +extern void errprint(const char *, + const errarg &arg1 = empty_errarg, + const errarg &arg2 = empty_errarg, + const errarg &arg3 = empty_errarg); + +#endif // _ERRARG_H +// s-it2-mode diff --git a/src/include/error.h b/include/error.h similarity index 55% rename from src/include/error.h rename to include/error.h index b9d48d0a..efa5bbff 100644 --- a/src/include/error.h +++ b/include/error.h @@ -1,23 +1,26 @@ -// -*- C++ -*- -/* 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. - -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. */ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2003, 2004 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _ERROR_H +#define _ERROR_H extern void fatal_with_file_and_line(const char *filename, int lineno, const char *format, @@ -53,7 +56,10 @@ extern void warning(const char *, const errarg &arg3 = empty_errarg); -extern "C" const char *program_name; +extern "C" const char *program_name; /* FIXME (and all around us) */ extern int current_lineno; extern const char *current_filename; extern const char *current_source_filename; + +#endif // _ERROR_H +// s-it2-mode diff --git a/src/include/file_case.h b/include/file_case.h similarity index 98% rename from src/include/file_case.h rename to include/file_case.h index 39b25509..16b07664 100644 --- a/src/include/file_case.h +++ b/include/file_case.h @@ -17,6 +17,7 @@ #ifndef _FILE_CASE_H #define _FILE_CASE_H +#include "config.h" #include "lib.h" #include @@ -29,6 +30,7 @@ class file_case void *_layer; // E.g., gzFile uint32_t _flags; uint8_t _dummy[4]; + public: // Flags for ctor / muxer() enum { @@ -122,5 +124,5 @@ file_case::is_pipe(void) const return ((_flags & fc_pipe) != 0); } -#endif -/* s-it2-mode */ +#endif // _FILE_CASE_H +// s-it2-mode diff --git a/src/include/font.h b/include/font.h similarity index 91% rename from src/include/font.h rename to include/font.h index e8897741..97cea6fb 100644 --- a/src/include/font.h +++ b/include/font.h @@ -1,23 +1,28 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004, 2006 - Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.com) +/* + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2002, 2004, 2006 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _FONT_H +#define _FONT_H -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. */ +#include "config.h" #include "file_case.h" @@ -95,7 +100,8 @@ struct font_widths_cache; // A `class font' instance represents the relevant information of a font of // the given device. This includes the set of glyphs represented by the // font, and metrics for each glyph. -class font { +class font +{ public: enum { // The valid argument values of `has_ligature'. LIG_ff = 1, @@ -108,7 +114,7 @@ public: virtual ~font(); // Destructor. int contains(glyph *); // Return 1 if this font contains the given // glyph, 0 otherwise. - int is_special(); // Return 1 if this font is special, 0 otherwise. + int is_special(); // Return 1 if this font is special, 0 otherwise. // See section `Special Fonts' in the info file of // groff. Used by make_glyph_node(). int get_width(glyph *, int); // A rectangle represents the shape of the @@ -125,7 +131,7 @@ public: int get_depth(glyph *, int); // A rectangle represents the shape of the // given glyph (arg1) at the given point size // (arg2). Return the distance between the base - // line and the bottom of this rectangle. + // line and the bottom of this rectangle. // This is often also called the `descent' of the // glyph. If the bottom is below the base line, // this value is positive. @@ -181,7 +187,7 @@ public: // amount. See groff manual, description of \w and // the `ssc' register. Return this amount. void set_zoom(int); // Set the font's zoom factor * 1000. Must be a - // non-negative value. + // non-negative value. int get_zoom(); // Return the font's zoom factor * 1000. int get_code(glyph *); // Return the code point in the physical // font of the given glyph. @@ -200,17 +206,17 @@ public: double *, double *); // Parse the // `papersize' attribute in a DESC file (given in // arg1). Return the name of the size (in arg2), - // and the length and width (in arg3 and arg4). + // and the length and width (in arg3 and arg4). // Return 1 in case of success, 0 otherwise. static font *load_font(const char *, int * = 0, int = 0); // Load the // font description file with the given name (arg1) // and return it as a `font' class. If arg2 points // to an integer variable, set it to 1 if the file - // is not found, without emitting an error message. + // is not found, without emitting an error message. // If arg2 is NULL, print an error message if the // file is not found. If arg3 is nonzero, only the // part of the font description file before the - // `charset' and `kernpairs' sections is loaded. + // `charset' and `kernpairs' sections is loaded. // Return NULL in case of failure. static void command_line_font_dir(const char *); // Prepend given // path (arg1) to the list of directories in which @@ -270,7 +276,7 @@ public: private: unsigned ligatures; // Bit mask of available ligatures. Used by // has_ligature(). - font_kern_list **kern_hash_table; // Hash table of kerning pairs. + font_kern_list **kern_hash_table; // Hash table of kerning pairs. // Used by get_kern(). int space_width; // The normal width of a space. Used by // get_space_width(). @@ -281,7 +287,7 @@ private: // NULL. Used by get_internal_name(). double slant; // The natural slant angle (in degrees) of this font. int zoom; // The font's magnification, multiplied by 1000. - // Used by scale(). A zero value means `no zoom'. + // Used by scale(). A zero value means `no zoom'. int *ch_index; // Conversion table from font-independent character // indices to indices for this particular font. int nindices; @@ -336,11 +342,12 @@ protected: // object. If arg1 points to an integer variable, // set it to 1 if the file is not found, without // emitting an error message. If arg1 is NULL, - // print an error message if the file is not found. + // print an error message if the file is not found. // If arg2 is nonzero, only the part of the font // description file before the `charset' and // `kernpairs' sections is loaded. Return NULL in // case of failure. }; -// end of font.h +#endif // _FONT_H +// s-it2-mode diff --git a/include/geometry.h b/include/geometry.h new file mode 100644 index 00000000..b45b66bf --- /dev/null +++ b/include/geometry.h @@ -0,0 +1,35 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2001 Free Software Foundation, Inc. + * Written by Gaius Mulley + * + * 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. + */ +#ifndef _GEOMETRY_H +#define _GEOMETRY_H + +#include "config.h" + +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); + +#endif // _GEOMETRY_H +// s-it2-mode diff --git a/src/include/getopt.h b/include/getopt.h similarity index 86% rename from src/include/getopt.h rename to include/getopt.h index a4e78cb0..7a4d3973 100644 --- a/src/include/getopt.h +++ b/include/getopt.h @@ -1,24 +1,26 @@ -/* 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. */ - +/*@ Declarations for getopt. FIXME use Sx::Sys::Misc::GetOpt! Everywhere!! + * + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * 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_H - #ifndef __need_getopt # define _GETOPT_H 1 #endif @@ -223,5 +225,5 @@ extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt - -#endif /* getopt.h */ +#endif /* _GETOPT_H */ +/* s-it2-mode */ diff --git a/src/include/getopt_int.h b/include/getopt_int.h similarity index 78% rename from src/include/getopt_int.h rename to include/getopt_int.h index 401579fd..8ffc5c5c 100644 --- a/src/include/getopt_int.h +++ b/include/getopt_int.h @@ -1,22 +1,25 @@ -/* 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. */ - +/*@ Internal decls. for getopt. FIXME use Sx::Sys::Misc::GetOpt! Everywhere!! + * + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * 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 @@ -128,4 +131,5 @@ extern int _getopt_long_only_r (int ___argc, char **___argv, int *__longind, struct _getopt_data *__data); -#endif /* getopt_int.h */ +#endif /* _GETOPT_INT_H */ +/* s-it2-mode */ diff --git a/include/gettext.h b/include/gettext.h new file mode 100644 index 00000000..a54e9f02 --- /dev/null +++ b/include/gettext.h @@ -0,0 +1,7 @@ +/*@ This is a dummy header file to make getopt compile without gettext + *@ support. FIXME use Sx::Sys::Misc::GetOpt! Everywhere!! + */ + +#define gettext(s) s + +/* s-it2-mode */ diff --git a/include/html-strings.h b/include/html-strings.h new file mode 100644 index 00000000..5ae07339 --- /dev/null +++ b/include/html-strings.h @@ -0,0 +1,30 @@ +/*@ Defines the image tags issued by the pre-processors (tbl, pic, eqn) + *@ and later detected by pre-html.cpp. + * + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2001 - 2003 Free Software Foundation, Inc. + * Written by Gaius Mulley (gaius@glam.ac.uk). + * + * 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. + */ +#ifndef _HTML_STRINGS_H +#define _HTML_STRINGS_H + +#define HTML_IMAGE_INLINE_BEGIN "\\O[HTML-IMAGE-INLINE-BEGIN]" +#define HTML_IMAGE_INLINE_END "\\O[HTML-IMAGE-INLINE-END]" + +#endif // _HTML_STRINGS_H +// s-it2-mode diff --git a/include/htmlhint.h b/include/htmlhint.h new file mode 100644 index 00000000..188b87c8 --- /dev/null +++ b/include/htmlhint.h @@ -0,0 +1,40 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2000 - 2002 Free Software Foundation, Inc. + * Written by Gaius Mulley + * + * 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. + */ +#ifndef _HTML_INDICATE_H +#define _HTML_INDICATE_H + +#include "config.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 // _HTML_INDICATE_H +// s-it2-mode diff --git a/include/index.h b/include/index.h new file mode 100644 index 00000000..0257c097 --- /dev/null +++ b/include/index.h @@ -0,0 +1,50 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _INDEX_H +#define _INDEX_H + +#include "config.h" + +#define INDEX_MAGIC 0x23021964 +#define INDEX_VERSION 1 + +struct index_header { + int magic; + int version; + int tags_size; + int table_size; + int lists_size; + int strings_size; + int truncate; + int shortest; + int common; +}; + +struct tag { + int filename_index; + int start; + int length; +}; + +unsigned hash(const char *s, int len); + +#endif // _INDEX_H +// s-it2-mode diff --git a/src/include/itable.h b/include/itable.h similarity index 82% rename from src/include/itable.h rename to include/itable.h index e8a79d94..5f503a7d 100644 --- a/src/include/itable.h +++ b/include/itable.h @@ -1,34 +1,31 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2004, 2006 - Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.com) +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2003, 2004, 2006 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _ITABLE_H +#define _ITABLE_H -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. */ +#include "config.h" #include -// name2(a,b) concatenates two C identifiers. -#ifdef TRADITIONAL_CPP -# define name2(a,b) a/**/b -#else /* not TRADITIONAL_CPP */ -# define name2(a,b) name2x(a,b) -# define name2x(a,b) a ## b -#endif /* not TRADITIONAL_CPP */ - // `class ITABLE(T)' is the type of a hash table mapping an integer (int >= 0) // to an object of type T. // @@ -40,9 +37,9 @@ Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */ // // Nowadays one would use templates for this; this code predates the addition // of templates to C++. -#define ITABLE(T) name2(T,_itable) -#define IASSOC(T) name2(T,_iassoc) -#define ITABLE_ITERATOR(T) name2(T,_itable_iterator) +#define ITABLE(T) CONCAT(T,_itable) +#define IASSOC(T) CONCAT(T,_iassoc) +#define ITABLE_ITERATOR(T) CONCAT(T,_itable_iterator) // ptable.h declares this too #ifndef NEXT_PTABLE_SIZE_DEFINED @@ -197,4 +194,5 @@ int ITABLE_ITERATOR(T)::next(int *keyp, T **valp) \ return 0; \ } -// end of itable.h +#endif // _ITABLE_H +// s-it2-mode diff --git a/src/include/lib.h b/include/lib.h similarity index 70% rename from src/include/lib.h rename to include/lib.h index 03418e06..1eb161fc 100644 --- a/src/include/lib.h +++ b/include/lib.h @@ -1,29 +1,28 @@ -// -*- C++ -*- -/* Copyright (C) 1989-2000, 2001, 2002, 2003, 2005, 2006 - 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. */ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 2003, 2005, 2006 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ #ifndef _LIB_H #define _LIB_H -#ifdef HAVE_CONFIG_H -#include -#endif +#include "config.h" extern "C" { #ifndef HAVE_STRERROR @@ -200,10 +199,49 @@ typedef signed long int int32_t; #define CLASS_DISABLE_COPY(C) private: C(C const &); C &operator=(C const &) -#ifndef NDEBUG -# define INJECT(X) X +#if 1 +# define STRING(X) #X +# define XSTRING(X) STRING(X) +# define CONCAT(S1,S2) _CONCAT(S1, S2) +# define _CONCAT(S1,S2) S1 ## S2 #else -# define INJECT(X) +# define STRING(X) "X" +# define XSTRING STRING +# define CONCAT(S1,S2) S1/**/S2 #endif -#endif /* _LIB_H */ +/* Compile-Time-Assert */ +#define CTA(TEST) _CTA_1(TEST, __LINE__) +#define _CTA_1(TEST,L) _CTA_2(TEST, L) +#define _CTA_2(TEST,L) \ + typedef char COMPILE_TIME_ASSERT_failed_at_line_ ## L[(TEST) ? 1 : -1] + +#undef ISPOW2 +#define ISPOW2(X) ((((X) - 1) & (X)) == 0) +#undef MIN +#define MIN(A, B) ((A) < (B) ? (A) : (B)) +#undef MAX +#define MAX(A, B) ((A) < (B) ? (B) : (A)) +#undef ABS +#define ABS(A) ((A) < 0 ? -(A) : (A)) + +#undef DBG +#undef NDBG +#ifdef NDEBUG +# define DBG(X) +# define NDBG(X) X +#else +# define DBG(X) X +# define NDBG(X) +#endif + +/* Translation */ +#undef _ +#undef N_ +#undef V_ +#define _(S) (S) +#define N_(S) (S) +#define V_(S) (S) + +#endif // _LIB_H +// s-it2-mode diff --git a/include/localcharset.h b/include/localcharset.h new file mode 100644 index 00000000..5065cfc2 --- /dev/null +++ b/include/localcharset.h @@ -0,0 +1,42 @@ +/*@ Determine a canonical name for the current locale's character encoding. + * + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2000 - 2003 Free Software Foundation, Inc. + * This file is part of the GNU CHARSET 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 _LOCALCHARSET_H +#define _LOCALCHARSET_H + +#include "config.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); + +#ifdef __cplusplus +} +#endif +#endif // _LOCALCHARSET_H +// s-it2-mode diff --git a/include/macropath.h b/include/macropath.h new file mode 100644 index 00000000..a01346dd --- /dev/null +++ b/include/macropath.h @@ -0,0 +1,31 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2000 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _MACROPATH_H +#define _MACROPATH_H + +#include "config.h" + +extern search_path macro_path; +extern search_path safer_macro_path; +extern search_path config_macro_path; + +#endif // _MACROPATH_H +// s-it2-mode diff --git a/src/include/nonposix.h b/include/nonposix.h similarity index 80% rename from src/include/nonposix.h rename to include/nonposix.h index 9564a8b7..49075f35 100644 --- a/src/include/nonposix.h +++ b/include/nonposix.h @@ -1,27 +1,32 @@ -/* 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. - -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. */ - -/* This header file compartmentalize all idiosyncrasies of non-Posix - 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. */ +/*@ This header file compartmentalize all idiosyncrasies of non-Posix + *@ 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. + * + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2000 - 2005 + * Free Software Foundation, Inc. + * Written by Eli Zaretskii (eliz@is.elta.co.il) + * + * 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. + */ +#ifndef _NONPOSIX_H +#define _NONPOSIX_H + +#include "config.h" #if defined _MSC_VER # ifndef _WIN32 @@ -229,3 +234,6 @@ Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _WAIT_CHILD # define _WAIT_CHILD 0 #endif + +#endif // _NONPOSIX_H +// s-it2-mode diff --git a/include/paper.h b/include/paper.h new file mode 100644 index 00000000..73d8211f --- /dev/null +++ b/include/paper.h @@ -0,0 +1,45 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2002 Free Software Foundation, Inc. + * Written by Werner Lemberg (wl@gnu.org) + * + * 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. + */ +#ifndef _PAPER_H +#define _PAPER_H + +#include "config.h" + +struct paper { + char *name; + double length; // in PS points + double width; // in PS points +}; + +// global constructor +static class papersize_init { /* FIXME oh my god.. injection initializers!! */ + 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[]; + +#endif // _PAPER_H +// s-it2-mode diff --git a/include/posix.h b/include/posix.h new file mode 100644 index 00000000..41abcb96 --- /dev/null +++ b/include/posix.h @@ -0,0 +1,75 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1992, 2000 - 2002, 2005 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _POSIX_H +#define _POSIX_H + +#include "config.h" + +#include +#include + +#ifdef HAVE_CC_OSFCN_H +#include +#else +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#endif + +#ifndef S_IRUSR +#define S_IRUSR 0400 +#endif + +#ifndef S_IRGRP +#define S_IRGRP 0040 +#endif + +#ifndef S_IROTH +#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 + +#ifndef O_RDONLY +#define O_RDONLY 0 +#endif + +#ifndef F_OK +#define F_OK 0 +#endif + +#ifndef HAVE_ISATTY +#define isatty(n) (1) +#endif + +#endif // _POSIX_H +// s-it2-mode diff --git a/src/include/printer.h b/include/printer.h similarity index 52% rename from src/include/printer.h rename to include/printer.h index b4106937..92d37e0b 100644 --- a/src/include/printer.h +++ b/include/printer.h @@ -1,40 +1,34 @@ -// -*- C++ -*- - -// /src/include/printer.h - -/* Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2006 - Free Software Foundation, Inc. - - Written by James Clark (jjc@jclark.com) - - Last update: 11 Feb 2006 - - 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. -*/ - -/* Description - - The class `printer' performs the postprocessing. Each - postprocessor only needs 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.cpp'. -*/ +/*@ The class `printer' performs the postprocessing. Each postprocessor only + *@ needs 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.cpp'. + * + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2001 - 2004, 2006 + * Free Software Foundation, Inc. + * + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _PRINTER_H +#define _PRINTER_H + +#include "config.h" #include "color.h" @@ -51,14 +45,17 @@ struct environment { class font; -struct font_pointer_list { +class font_pointer_list +{ +public: font *p; font_pointer_list *next; font_pointer_list(font *, font_pointer_list *); }; -class printer { +class printer +{ public: printer(); virtual ~printer(); @@ -70,9 +67,9 @@ public: int *, font **); font *get_font_from_index(int); virtual void draw(int, int *, int, const environment *); - // perform change of line color (text, outline) in the print-out + // perform change of line color (text, outline) in the print-out virtual void change_color(const environment * const); - // perform change of fill color in the print-out + // perform change of fill color in the print-out virtual void change_fill_color(const environment * const); virtual void begin_page(int) = 0; virtual void end_page(int) = 0; @@ -100,3 +97,6 @@ private: }; printer *make_printer(); + +#endif // _PRINTER_H +// s-it2-mode diff --git a/src/include/ptable.h b/include/ptable.h similarity index 85% rename from src/include/ptable.h rename to include/ptable.h index 7a67527a..acf1a721 100644 --- a/src/include/ptable.h +++ b/include/ptable.h @@ -1,35 +1,32 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2003, 2004, 2006 - Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.com) +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2003, 2004, 2006 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _PTABLE_H +#define _PTABLE_H -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. */ +#include "config.h" #include #include -// name2(a,b) concatenates two C identifiers. -#ifdef TRADITIONAL_CPP -# define name2(a,b) a/**/b -#else /* not TRADITIONAL_CPP */ -# define name2(a,b) name2x(a,b) -# define name2x(a,b) a ## b -#endif /* not TRADITIONAL_CPP */ - // `class PTABLE(T)' is the type of a hash table mapping a string // (const char *) to an object of type T. // @@ -41,9 +38,9 @@ Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */ // // Nowadays one would use templates for this; this code predates the addition // of templates to C++. -#define PTABLE(T) name2(T,_ptable) -#define PASSOC(T) name2(T,_passoc) -#define PTABLE_ITERATOR(T) name2(T,_ptable_iterator) +#define PTABLE(T) CONCAT(T,_ptable) +#define PASSOC(T) CONCAT(T,_passoc) +#define PTABLE_ITERATOR(T) CONCAT(T,_ptable_iterator) // itable.h declares this too #ifndef NEXT_PTABLE_SIZE_DEFINED @@ -233,4 +230,5 @@ int PTABLE_ITERATOR(T)::next(const char **keyp, T **valp) \ return 0; \ } -// end of ptable.h +#endif // _PTABLE_H +// s-it2-mode diff --git a/include/refid.h b/include/refid.h new file mode 100644 index 00000000..0598d83b --- /dev/null +++ b/include/refid.h @@ -0,0 +1,45 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _REFID_H +#define _REFID_H + +#include "config.h" + +class reference_id +{ + int filename_id; + int pos; + +public: + reference_id() : filename_id(-1) { } + reference_id(int fid, int off) : filename_id(fid), pos(off) { } + unsigned hash() const { return (filename_id << 4) + pos; } + int is_null() const { return filename_id < 0; } + friend inline int operator==(const reference_id &, const reference_id &); +}; + +inline int operator==(const reference_id &r1, const reference_id &r2) +{ + return r1.filename_id == r2.filename_id && r1.pos == r2.pos; +} + +#endif // _REFID_H +// s-it2-mode diff --git a/include/relocate.h b/include/relocate.h new file mode 100644 index 00000000..a5cd61c0 --- /dev/null +++ b/include/relocate.h @@ -0,0 +1,47 @@ +/*@ Provide relocation for macro and font files. FIXME please + * + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 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 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. + */ +#ifndef _RELOCATE_H +#define _RELOCATE_H + +#include "config.h" + +#ifdef __cplusplus +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); +#endif + +/* This function has C linkage. */ +extern +#ifdef __cplusplus +"C" +#endif +char *relocatep (const char *path); + +#ifdef __cplusplus +char *relocate (const char *path); +#endif + +#endif // _RELOCATE_H +// s-it2-mode diff --git a/src/include/search.h b/include/search.h similarity index 62% rename from src/include/search.h rename to include/search.h index 3dde8944..1128b32b 100644 --- a/src/include/search.h +++ b/include/search.h @@ -1,52 +1,62 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2004 Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.com) +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2004 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _SEARCH_H +#define _SEARCH_H -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. */ +#include "config.h" class search_item; class search_item_iterator; -class search_list { +class search_list +{ + friend class search_list_iterator; + + search_item *list; + int niterators; + int next_fid; + public: search_list(); ~search_list(); void add_file(const char *fn, int silent = 0); int nfiles() const; -private: - search_item *list; - int niterators; - int next_fid; - friend class search_list_iterator; }; class bmpattern; -class linear_searcher { +class linear_searcher +{ const char *ignore_fields; int truncate_len; bmpattern **keys; int nkeys; + const char *search_and_check(const bmpattern *key, const char *buf, const char *bufend, const char **start = 0) const; int check_match(const char *buf, const char *bufend, const char *match, int matchlen, const char **cont, const char **start) const; + public: linear_searcher(const char *query, int query_len, const char *ign, int trunc); @@ -55,22 +65,26 @@ public: const char **startp, int *lengthp) const; }; -class search_list_iterator { +class search_list_iterator +{ search_list *list; search_item *ptr; search_item_iterator *iter; char *query; linear_searcher searcher; + public: search_list_iterator(search_list *, const char *query); ~search_list_iterator(); int next(const char **, int *, reference_id * = 0); }; -class search_item { +class search_item +{ protected: char *name; int filename_id; + public: search_item *next; search_item(const char *nm, int fid); @@ -80,8 +94,10 @@ public: virtual int next_filename_id() const; }; -class search_item_iterator { +class search_item_iterator +{ char shut_g_plus_plus_up; + public: virtual ~search_item_iterator(); virtual int next(const linear_searcher &, const char **ptr, int *lenp, @@ -94,3 +110,6 @@ search_item *make_linear_search_item(int fd, const char *filename, int fid); extern int linear_truncate_len; extern const char *linear_ignore_fields; extern int verify_flag; + +#endif // _SEARCH_H +// s-it2-mode diff --git a/include/searchpath.h b/include/searchpath.h new file mode 100644 index 00000000..203a8f91 --- /dev/null +++ b/include/searchpath.h @@ -0,0 +1,46 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2000, 2003 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _SEARCHPATH_H +#define _SEARCHPATH_H + +#include "config.h" + +#include "file_case.h" + +class search_path +{ + char *dirs; + unsigned init_len; + +public: + search_path(const char *envvar, const char *standard, int add_home, + int add_current); + ~search_path(); + + void command_line_dir(char const *); + file_case * open_file(char const *name, uint32_t f=file_case::mux_default); + file_case * open_file_cautious(char const *name, + uint32_t f=file_case::mux_default); +}; + +#endif // _SEARCHPATH_H +// s-it2-mode diff --git a/src/include/stringclass.h b/include/stringclass.h similarity index 72% rename from src/include/stringclass.h rename to include/stringclass.h index fb3299ce..c037d582 100644 --- a/src/include/stringclass.h +++ b/include/stringclass.h @@ -1,26 +1,31 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2002 Free Software Foundation, Inc. - Written by James Clark (jjc@jclark.com) +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2002 Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _STRINGCLASS_H +#define _STRINGCLASS_H + +#include "config.h" -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. */ - -#include -#include #include +#include +#include // Ensure that the first declaration of functions that are later // declared as inline declares them as inline. @@ -35,7 +40,15 @@ inline string operator+(char, const string &); inline int operator==(const string &, const string &); inline int operator!=(const string &, const string &); -class string { +class string +{ + char *ptr; + int len; + int sz; + + string(const char *, int, const char *, int); // for use by operator+ + void grow1(); + public: string(); string(const string &); @@ -44,7 +57,7 @@ public: string(char); ~string(); - + string &operator=(const string &); string &operator=(const char *); string &operator=(char); @@ -53,7 +66,7 @@ public: string &operator+=(const char *); string &operator+=(char); void append(const char *, int); - + int length() const; int empty() const; int operator*() const; @@ -76,24 +89,15 @@ public: friend string operator+(const char *, const string &); friend string operator+(const string &, char); friend string operator+(char, const string &); - + friend int operator==(const string &, const string &); friend int operator!=(const string &, const string &); friend int operator<=(const string &, const string &); friend int operator<(const string &, const string &); friend int operator>=(const string &, const string &); friend int operator>(const string &, const string &); - -private: - char *ptr; - int len; - int sz; - - string(const char *, int, const char *, int); // for use by operator+ - void grow1(); }; - inline char &string::operator[](int i) { assert(i >= 0 && i < len); @@ -133,26 +137,12 @@ inline string operator+(const string &s1, const string &s2) inline string operator+(const string &s1, const char *s2) { -#ifdef __GNUG__ - if (s2 == 0) - return s1; - else - return string(s1.ptr, s1.len, s2, strlen(s2)); -#else - return s2 == 0 ? s1 : string(s1.ptr, s1.len, s2, strlen(s2)); -#endif + return (s2 == NULL) ? s1 : string(s1.ptr, s1.len, s2, strlen(s2)); } inline string operator+(const char *s1, const string &s2) { -#ifdef __GNUG__ - if (s1 == 0) - return s2; - else - return string(s1, strlen(s1), s2.ptr, s2.len); -#else - return s1 == 0 ? s2 : string(s1, strlen(s1), s2.ptr, s2.len); -#endif + return (s1 == NULL) ? s2 : string(s1, strlen(s1), s2.ptr, s2.len); } inline string operator+(const string &s, char c) @@ -167,13 +157,13 @@ inline string operator+(char c, const string &s) inline int operator==(const string &s1, const string &s2) { - return (s1.len == s2.len + return (s1.len == s2.len && (s1.len == 0 || memcmp(s1.ptr, s2.ptr, s1.len) == 0)); } inline int operator!=(const string &s1, const string &s2) { - return (s1.len != s2.len + return (s1.len != s2.len || (s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) != 0)); } @@ -194,3 +184,6 @@ inline string &string::operator+=(char c) void put_string(const string &, FILE *); string as_string(int); + +#endif // _STRINGCLASS_H +// s-it2-mode diff --git a/include/symbol.h b/include/symbol.h new file mode 100644 index 00000000..509618ac --- /dev/null +++ b/include/symbol.h @@ -0,0 +1,93 @@ +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 1989 - 1992, 2002, 2004 + * Free Software Foundation, Inc. + * Written by James Clark (jjc@jclark.com) + * + * 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. + */ +#ifndef _SYMBOL_H +#define _SYMBOL_H + +#include "config.h" + +#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; + +#endif // _SYMBOL_H +// s-it2-mode diff --git a/src/include/unicode.h b/include/unicode.h similarity index 60% rename from src/include/unicode.h rename to include/unicode.h index d5351c35..9acc9803 100644 --- a/src/include/unicode.h +++ b/include/unicode.h @@ -1,23 +1,28 @@ -// -*- C++ -*- -/* Copyright (C) 2002, 2003, 2006 - Free Software Foundation, Inc. - Written by Werner Lemberg +/*@ + * Copyright (c) 2014 Steffen (Daode) Nurpmeso . + * + * Copyright (C) 2002, 2003, 2006 + * Free Software Foundation, Inc. + * Written by Werner Lemberg + * + * 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. + */ +#ifndef _UNICODE_H +#define _UNICODE_H -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. */ +#include "config.h" // Convert a groff glyph name to a string containing an underscore-separated // list of Unicode code points. For example, @@ -62,4 +67,5 @@ const char *decompose_unicode(const char *); // of success, NULL otherwise. const char *check_unicode_name(const char *); -// end of unicode.h +#endif // _UNICODE_H +// s-it2-mode diff --git a/src/include/assert.h b/src/include/assert.h deleted file mode 100644 index 76b3b203..00000000 --- a/src/include/assert.h +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 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. */ - -#ifndef ASSERT_H -#define ASSERT_H - -void assertion_failed(int, const char *); - -inline void do_assert(int expr, int line, const char *file) -{ - if (!expr) - assertion_failed(line, file); -} -#endif /* ASSERT_H */ - -#undef assert - -#ifdef NDEBUG -#define assert(ignore) /* as nothing */ -#else -#define assert(expr) do_assert(expr, __LINE__, __FILE__) -#endif diff --git a/src/include/cmap.h b/src/include/cmap.h deleted file mode 100644 index d786829d..00000000 --- a/src/include/cmap.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 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. */ - -#ifndef UCHAR_MAX -#define UCHAR_MAX 255 -#endif - -enum cmap_builtin { CMAP_BUILTIN }; - -class cmap { -public: - cmap(); - cmap(cmap_builtin); - int operator()(unsigned char) const; - unsigned char &operator[](unsigned char); - - friend class cmap_init; -private: - unsigned char v[UCHAR_MAX+1]; -}; - -inline int cmap::operator()(unsigned char c) const -{ - return v[c]; -} - -inline unsigned char &cmap::operator[](unsigned char c) -{ - return v[c]; -} - -extern cmap cmlower; -extern cmap cmupper; - -static class cmap_init { - static int initialised; -public: - cmap_init(); -} _cmap_init; diff --git a/src/include/cset.h b/src/include/cset.h deleted file mode 100644 index a241c002..00000000 --- a/src/include/cset.h +++ /dev/null @@ -1,75 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 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. */ - -#ifdef HAVE_CC_LIMITS_H -#include -#else /* not HAVE_CC_LIMITS_H */ -#ifndef UCHAR_MAX -#define UCHAR_MAX 255 -#endif -#endif /* not HAVE_CC_LIMITS_H */ - -enum cset_builtin { CSET_BUILTIN }; - -class cset { -public: - cset(); - cset(cset_builtin); - cset(const char *); - cset(const unsigned char *); - int operator()(unsigned char) const; - - cset &operator|=(const cset &); - cset &operator|=(unsigned char); - - friend class cset_init; -private: - char v[UCHAR_MAX+1]; - void clear(); -}; - -inline int cset::operator()(unsigned char c) const -{ - return v[c]; -} - -inline cset &cset::operator|=(unsigned char c) -{ - v[c] = 1; - return *this; -} - -extern cset csalpha; -extern cset csupper; -extern cset cslower; -extern cset csdigit; -extern cset csxdigit; -extern cset csspace; -extern cset cspunct; -extern cset csalnum; -extern cset csprint; -extern cset csgraph; -extern cset cscntrl; - -static class cset_init { - static int initialised; -public: - cset_init(); -} _cset_init; diff --git a/src/include/device.h b/src/include/device.h deleted file mode 100644 index 4bd4378b..00000000 --- a/src/include/device.h +++ /dev/null @@ -1,26 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2006 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. */ - -// The target device. Once initialized, the device doesn't change during -// the entire program run. Sample devices are `ps' (for Postscript), `html' -// (for HTML), and `ascii', `latin1', `utf8' for TTY output. -extern const char *device; - -// end of device.h diff --git a/src/include/driver.h b/src/include/driver.h deleted file mode 100644 index f6804eff..00000000 --- a/src/include/driver.h +++ /dev/null @@ -1,36 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2003 - 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. */ - -#include "lib.h" - -#include -#include -#include -#include -#include -#include -#include "errarg.h" -#include "error.h" -#include "font.h" -#include "printer.h" -#include "geometry.h" - -void do_file(const char *); diff --git a/src/include/errarg.h b/src/include/errarg.h deleted file mode 100644 index 1aa191a4..00000000 --- a/src/include/errarg.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2002 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. */ - -class errarg { - enum { EMPTY, STRING, CHAR, INTEGER, UNSIGNED_INTEGER, DOUBLE } type; - union { - const char *s; - int n; - unsigned int u; - char c; - double d; - }; - public: - errarg(); - errarg(const char *); - errarg(char); - errarg(unsigned char); - errarg(int); - errarg(unsigned int); - errarg(double); - int empty() const; - void print() const; -}; - -extern errarg empty_errarg; - -extern void errprint(const char *, - const errarg &arg1 = empty_errarg, - const errarg &arg2 = empty_errarg, - const errarg &arg3 = empty_errarg); diff --git a/src/include/geometry.h b/src/include/geometry.h deleted file mode 100644 index 1ce0df03..00000000 --- a/src/include/geometry.h +++ /dev/null @@ -1,27 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 2001 Free Software Foundation, Inc. - Written by Gaius Mulley - -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. */ - -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/src/include/gettext.h b/src/include/gettext.h deleted file mode 100644 index 26fd2c57..00000000 --- a/src/include/gettext.h +++ /dev/null @@ -1,4 +0,0 @@ -/* This is a dummy header file to make getopt compile without gettext - support. */ - -#define gettext(s) s diff --git a/src/include/html-strings.h b/src/include/html-strings.h deleted file mode 100644 index 26daeb6c..00000000 --- a/src/include/html-strings.h +++ /dev/null @@ -1,27 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 2001, 2002, 2003 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, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */ - -/* - * defines the image tags issued by the pre-processors (tbl, pic, eqn) - * and later detected by pre-html.cpp - */ - -#define HTML_IMAGE_INLINE_BEGIN "\\O[HTML-IMAGE-INLINE-BEGIN]" -#define HTML_IMAGE_INLINE_END "\\O[HTML-IMAGE-INLINE-END]" diff --git a/src/include/htmlhint.h b/src/include/htmlhint.h deleted file mode 100644 index e0b41dd7..00000000 --- a/src/include/htmlhint.h +++ /dev/null @@ -1,37 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. - Written by Gaius Mulley - -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. */ - -#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/src/include/index.h b/src/include/index.h deleted file mode 100644 index c90610e6..00000000 --- a/src/include/index.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 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 INDEX_MAGIC 0x23021964 -#define INDEX_VERSION 1 - -struct index_header { - int magic; - int version; - int tags_size; - int table_size; - int lists_size; - int strings_size; - int truncate; - int shortest; - int common; -}; - -struct tag { - int filename_index; - int start; - int length; -}; - -unsigned hash(const char *s, int len); diff --git a/src/include/localcharset.h b/src/include/localcharset.h deleted file mode 100644 index 5030210d..00000000 --- a/src/include/localcharset.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003 Free Software Foundation, Inc. - This file is part of the GNU CHARSET 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 _LOCALCHARSET_H -#define _LOCALCHARSET_H - - -#ifdef __cplusplus -extern "C" { -#endif - - -/* Determine the current locale's character encoding, and canonicalize it - into one of the canonical names listed in config.charset. - The result must not be freed; it is statically allocated. - If the canonical name cannot be determined, the result is a non-canonical - name. */ -extern const char * locale_charset (void); - - -#ifdef __cplusplus -} -#endif - - -#endif /* _LOCALCHARSET_H */ diff --git a/src/include/macropath.h b/src/include/macropath.h deleted file mode 100644 index 3b38baa0..00000000 --- a/src/include/macropath.h +++ /dev/null @@ -1,23 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000 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. */ - -extern search_path macro_path; -extern search_path safer_macro_path; -extern search_path config_macro_path; diff --git a/src/include/paper.h b/src/include/paper.h deleted file mode 100644 index e88965d1..00000000 --- a/src/include/paper.h +++ /dev/null @@ -1,37 +0,0 @@ -// -*- 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, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, 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/src/include/posix.h b/src/include/posix.h deleted file mode 100644 index 28b807c7..00000000 --- a/src/include/posix.h +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1992, 2000, 2001, 2002, 2005 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. */ - -#include -#include - -#ifdef HAVE_CC_OSFCN_H -#include -#else -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#endif - -#ifndef S_IRUSR -#define S_IRUSR 0400 -#endif - -#ifndef S_IRGRP -#define S_IRGRP 0040 -#endif - -#ifndef S_IROTH -#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 - -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif - -#ifndef F_OK -#define F_OK 0 -#endif - -#ifndef HAVE_ISATTY -#define isatty(n) (1) -#endif diff --git a/src/include/refid.h b/src/include/refid.h deleted file mode 100644 index 84e5119f..00000000 --- a/src/include/refid.h +++ /dev/null @@ -1,35 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 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. */ - -class reference_id { - int filename_id; - int pos; -public: - reference_id() : filename_id(-1) { } - reference_id(int fid, int off) : filename_id(fid), pos(off) { } - unsigned hash() const { return (filename_id << 4) + pos; } - int is_null() const { return filename_id < 0; } - friend inline int operator==(const reference_id &, const reference_id &); -}; - -inline int operator==(const reference_id &r1, const reference_id &r2) -{ - return r1.filename_id == r2.filename_id && r1.pos == r2.pos; -} diff --git a/src/include/relocate.h b/src/include/relocate.h deleted file mode 100644 index 51f48950..00000000 --- a/src/include/relocate.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Provide relocation for macro and font files. - Copyright (C) 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 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. */ - -#ifdef __cplusplus -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); -#endif - -/* This function has C linkage. */ -extern -#ifdef __cplusplus -"C" -#endif -char *relocatep (const char *path); - -#ifdef __cplusplus -char *relocate (const char *path); -#endif diff --git a/src/include/searchpath.h b/src/include/searchpath.h deleted file mode 100644 index e9d904bb..00000000 --- a/src/include/searchpath.h +++ /dev/null @@ -1,36 +0,0 @@ -// -*- C++ -*- -/* 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. - -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. */ - -#include "file_case.h" - -class search_path { - char *dirs; - unsigned init_len; -public: - search_path(const char *envvar, const char *standard, int add_home, - int add_current); - ~search_path(); - - void command_line_dir(char const *); - file_case * open_file(char const *name, uint32_t f=file_case::mux_default); - file_case * open_file_cautious(char const *name, - uint32_t f=file_case::mux_default); -}; diff --git a/src/include/symbol.h b/src/include/symbol.h deleted file mode 100644 index c3cc8eea..00000000 --- a/src/include/symbol.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- 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; -- 2.11.4.GIT