diff options
Diffstat (limited to 'gnu/groff/include')
| -rw-r--r-- | gnu/groff/include/assert.h | 41 | ||||
| -rw-r--r-- | gnu/groff/include/cmap.h | 56 | ||||
| -rw-r--r-- | gnu/groff/include/cset.h | 75 | ||||
| -rw-r--r-- | gnu/groff/include/defs.h | 9 | ||||
| -rw-r--r-- | gnu/groff/include/device.h | 21 | ||||
| -rw-r--r-- | gnu/groff/include/driver.h | 36 | ||||
| -rw-r--r-- | gnu/groff/include/errarg.h | 46 | ||||
| -rw-r--r-- | gnu/groff/include/error.h | 58 | ||||
| -rw-r--r-- | gnu/groff/include/font.h | 113 | ||||
| -rw-r--r-- | gnu/groff/include/index.h | 42 | ||||
| -rw-r--r-- | gnu/groff/include/lib.h | 105 | ||||
| -rw-r--r-- | gnu/groff/include/macropath.h | 21 | ||||
| -rw-r--r-- | gnu/groff/include/posix.h | 49 | ||||
| -rw-r--r-- | gnu/groff/include/printer.h | 66 | ||||
| -rw-r--r-- | gnu/groff/include/ptable.h | 166 | ||||
| -rw-r--r-- | gnu/groff/include/refid.h | 35 | ||||
| -rw-r--r-- | gnu/groff/include/search.h | 96 | ||||
| -rw-r--r-- | gnu/groff/include/searchpath.h | 29 | ||||
| -rw-r--r-- | gnu/groff/include/stringclass.h | 174 | ||||
| -rw-r--r-- | gnu/groff/include/unix.h | 0 |
20 files changed, 0 insertions, 1238 deletions
diff --git a/gnu/groff/include/assert.h b/gnu/groff/include/assert.h deleted file mode 100644 index 3963b4fb4b22..000000000000 --- a/gnu/groff/include/assert.h +++ /dev/null @@ -1,41 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifndef ASSERT_H -#define ASSERT_H -#ifdef __GNUG__ -volatile -#endif -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/gnu/groff/include/cmap.h b/gnu/groff/include/cmap.h deleted file mode 100644 index 18c88fb262b6..000000000000 --- a/gnu/groff/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, 675 Mass Ave, Cambridge, MA 02139, 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/gnu/groff/include/cset.h b/gnu/groff/include/cset.h deleted file mode 100644 index f454cc5114d6..000000000000 --- a/gnu/groff/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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#ifdef HAVE_CC_LIMITS_H -#include <limits.h> -#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/gnu/groff/include/defs.h b/gnu/groff/include/defs.h deleted file mode 100644 index df2efba57eab..000000000000 --- a/gnu/groff/include/defs.h +++ /dev/null @@ -1,9 +0,0 @@ -#define PROG_PREFIX "" -#define DEVICE "ps" -#define FONTPATH "/usr/share/groff_font" -#define MACROPATH "/usr/share/tmac" -#define INDEX_SUFFIX ".i" -#define COMMON_WORDS_FILE "/usr/share/dict/eign" -#define DEFAULT_INDEX_DIR "/usr/share/dict/papers" -#define DEFAULT_INDEX_NAME "Ind" -#define DEFAULT_INDEX "/usr/share/dict/papers/Ind" diff --git a/gnu/groff/include/device.h b/gnu/groff/include/device.h deleted file mode 100644 index 76be1334172f..000000000000 --- a/gnu/groff/include/device.h +++ /dev/null @@ -1,21 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -extern const char *device; diff --git a/gnu/groff/include/driver.h b/gnu/groff/include/driver.h deleted file mode 100644 index be7a6dc6a195..000000000000 --- a/gnu/groff/include/driver.h +++ /dev/null @@ -1,36 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <stdlib.h> -#include <stddef.h> -#include <errno.h> -#include <assert.h> -#include <math.h> -#include "errarg.h" -#include "error.h" -#include "font.h" -#include "printer.h" -#include "lib.h" - -void do_file(const char *); -extern printer *pr; diff --git a/gnu/groff/include/errarg.h b/gnu/groff/include/errarg.h deleted file mode 100644 index 2f5ea5fc9f16..000000000000 --- a/gnu/groff/include/errarg.h +++ /dev/null @@ -1,46 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -class errarg { - enum { EMPTY, STRING, CHAR, INTEGER, DOUBLE } type; - union { - const char *s; - int n; - char c; - double d; - }; - public: - errarg(); - errarg(const char *); - errarg(char); - errarg(unsigned char); - errarg(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/gnu/groff/include/error.h b/gnu/groff/include/error.h deleted file mode 100644 index 7a687127a399..000000000000 --- a/gnu/groff/include/error.h +++ /dev/null @@ -1,58 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -extern void fatal_with_file_and_line(const char *filename, int lineno, - const char *format, - const errarg &arg1 = empty_errarg, - const errarg &arg2 = empty_errarg, - const errarg &arg3 = empty_errarg); - -extern void error_with_file_and_line(const char *filename, int lineno, - const char *format, - const errarg &arg1 = empty_errarg, - const errarg &arg2 = empty_errarg, - const errarg &arg3 = empty_errarg); - -extern void warning_with_file_and_line(const char *filename, int lineno, - const char *format, - const errarg &arg1 = empty_errarg, - const errarg &arg2 = empty_errarg, - const errarg &arg3 = empty_errarg); - -extern void fatal(const char *, - const errarg &arg1 = empty_errarg, - const errarg &arg2 = empty_errarg, - const errarg &arg3 = empty_errarg); - -extern void error(const char *, - const errarg &arg1 = empty_errarg, - const errarg &arg2 = empty_errarg, - const errarg &arg3 = empty_errarg); - -extern void warning(const char *, - const errarg &arg1 = empty_errarg, - const errarg &arg2 = empty_errarg, - const errarg &arg3 = empty_errarg); - - -extern const char *program_name; -extern int current_lineno; -extern const char *current_filename; - diff --git a/gnu/groff/include/font.h b/gnu/groff/include/font.h deleted file mode 100644 index 6470b65a4c7d..000000000000 --- a/gnu/groff/include/font.h +++ /dev/null @@ -1,113 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -typedef void (*FONT_COMMAND_HANDLER)(const char *, const char *, - const char *, int); - -struct font_kern_list; -struct font_char_metric; -struct font_widths_cache; - -class font { -public: - enum { - LIG_ff = 1, - LIG_fi = 2, - LIG_fl = 4, - LIG_ffi = 8, - LIG_ffl = 16 - }; - - virtual ~font(); - int contains(int index); - int is_special(); - int get_width(int index, int point_size); - int get_height(int index, int point_size); - int get_depth(int index, int point_size); - int get_space_width(int point_size); - int get_character_type(int index); - int get_kern(int index1, int index2, int point_size); - int get_skew(int index, int point_size, int slant); - int has_ligature(int); - int get_italic_correction(int index, int point_size); - int get_left_italic_correction(int index, int point_size); - int get_subscript_correction(int index, int point_size); - int get_code(int i); - const char *get_name(); - const char *get_internal_name(); - - static font *load_font(const char *, int *not_found = 0); - static void command_line_font_dir(const char *path); - static FILE *open_file(const char *name, char **pathp); - static int load_desc(); - static int name_to_index(const char *); - static int number_to_index(int); - static FONT_COMMAND_HANDLER - set_unknown_desc_command_handler(FONT_COMMAND_HANDLER); - - static int res; - static int hor; - static int vert; - static int unitwidth; - static int paperwidth; - static int paperlength; - static int biggestfont; - static int spare2; - static int sizescale; - static int tcommand; - - static const char **font_name_table; - static const char **style_table; - static const char *family; - static int *sizes; -private: - unsigned ligatures; - font_kern_list **kern_hash_table; - int space_width; - short *ch_index; - int nindices; - font_char_metric *ch; - int ch_used; - int ch_size; - int special; - char *name; - char *internalname; - double slant; - font_widths_cache *widths_cache; - static FONT_COMMAND_HANDLER unknown_desc_command_handler; - - enum { KERN_HASH_TABLE_SIZE = 503 }; - - void add_entry(int index, const font_char_metric &); - void copy_entry(int new_index, int old_index); - void add_kern(int index1, int index2, int amount); - static int hash_kern(int i1, int i2); - void alloc_ch_index(int); - void extend_ch(); - void compact(); - - static int scale(int w, int pointsize); - virtual void handle_unknown_font_command(const char *command, - const char *arg, - const char *file, int lineno); -protected: - font(const char *); - int load(int *not_found = 0); -}; diff --git a/gnu/groff/include/index.h b/gnu/groff/include/index.h deleted file mode 100644 index 719b0266b209..000000000000 --- a/gnu/groff/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, 675 Mass Ave, Cambridge, MA 02139, 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/gnu/groff/include/lib.h b/gnu/groff/include/lib.h deleted file mode 100644 index 2cee5671925b..000000000000 --- a/gnu/groff/include/lib.h +++ /dev/null @@ -1,105 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -extern "C" { - char *strerror(int); -#ifndef __BORLANDC__ - const char *itoa(int); - const char *iftoa(int, int); -#endif /* __BORLANDC__ */ -}; - -#ifdef STDLIB_H_DECLARES_GETOPT -#include <stdlib.h> -#else /* not STDLIB_H_DECLARES_GETOPT */ -#ifdef UNISTD_H_DECLARES_GETOPT -#include <sys/types.h> -#include <unistd.h> -#else /* not UNISTD_H_DECLARES_GETOPT */ -extern "C" { - int getopt(int, char **, const char *); -} -#endif /* not UNISTD_H_DECLARES_GETOPT */ - -extern "C" { - extern char *optarg; - extern int optind; - extern int opterr; -} - -#endif /* not STDLIB_H_DECLARES_GETOPT */ - -char *strsave(const char *s); -int is_prime(unsigned); - -#include <stdio.h> - -FILE *xtmpfile(); - -int interpret_lf_args(const char *p); - -extern char illegal_char_table[]; - -inline int illegal_input_char(int c) -{ - return c >= 0 && illegal_char_table[c]; -} - -#ifdef HAVE_CC_LIMITS_H -#include <limits.h> -#else /* not HAVE_CC_LIMITS_H */ -#define INT_MAX 2147483647 -#endif /* not HAVE_CC_LIMITS_H */ - -/* It's not safe to rely on people getting INT_MIN right (ie signed). */ - -#ifdef INT_MIN -#undef INT_MIN -#endif - -#ifdef CFRONT_ANSI_BUG - -/* This works around a bug in cfront 2.0 used with ANSI C compilers. */ - -#define INT_MIN ((long)(-INT_MAX-1)) - -#else /* not CFRONT_ANSI_BUG */ - -#define INT_MIN (-INT_MAX-1) - -#endif /* not CFRONT_ANSI_BUG */ - -/* Maximum number of digits in the decimal representation of an int -(not including the -). */ - -#define INT_DIGITS 10 - -/* ad_delete deletes an array of objects with destructors; -a_delete deletes an array of objects without destructors */ - -#ifdef ARRAY_DELETE_NEEDS_SIZE -/* for 2.0 systems */ -#define ad_delete(size) delete [size] -#define a_delete delete -#else /* not ARRAY_DELETE_NEEDS_SIZE */ -/* for ARM systems */ -#define ad_delete(size) delete [] -#define a_delete delete [] -#endif /* not ARRAY_DELETE_NEEDS_SIZE */ diff --git a/gnu/groff/include/macropath.h b/gnu/groff/include/macropath.h deleted file mode 100644 index 0b0f5c307e0a..000000000000 --- a/gnu/groff/include/macropath.h +++ /dev/null @@ -1,21 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -extern search_path macro_path; diff --git a/gnu/groff/include/posix.h b/gnu/groff/include/posix.h deleted file mode 100644 index fc76d90bfbb0..000000000000 --- a/gnu/groff/include/posix.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -#ifdef HAVE_CC_UNISTD_H -#include <unistd.h> -#else -#include <osfcn.h> -#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_ISREG -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif - -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif diff --git a/gnu/groff/include/printer.h b/gnu/groff/include/printer.h deleted file mode 100644 index d517addb7208..000000000000 --- a/gnu/groff/include/printer.h +++ /dev/null @@ -1,66 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -struct environment { - int fontno; - int size; - int hpos; - int vpos; - int height; - int slant; -}; - -struct font; - -struct font_pointer_list { - font *p; - font_pointer_list *next; - - font_pointer_list(font *, font_pointer_list *); -}; - -class printer { -public: - printer(); - virtual ~printer(); - void load_font(int i, const char *name); - void set_ascii_char(unsigned char c, const environment *env, - int *widthp = 0); - void set_special_char(const char *nm, const environment *env, - int *widthp = 0); - void set_numbered_char(int n, const environment *env, int *widthp = 0); - virtual void draw(int code, int *p, int np, const environment *env); - virtual void begin_page(int) = 0; - virtual void end_page(int page_length) = 0; - virtual font *make_font(const char *nm); - virtual void end_of_line(); - virtual void special(char *arg, const environment *env); - static int adjust_arc_center(const int *, double *); -protected: - font_pointer_list *font_list; -private: - font **font_table; - int nfonts; - font *find_font(const char *); - virtual void set_char(int index, font *f, const environment *env, - int w) = 0; -}; - -printer *make_printer(); diff --git a/gnu/groff/include/ptable.h b/gnu/groff/include/ptable.h deleted file mode 100644 index 0e7c1996a82c..000000000000 --- a/gnu/groff/include/ptable.h +++ /dev/null @@ -1,166 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include <assert.h> -#include <string.h> - -#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 */ - -#define PTABLE(T) name2(T,_ptable) -#define PASSOC(T) name2(T,_passoc) -#define PTABLE_ITERATOR(T) name2(T,_ptable_iterator) - -extern unsigned next_ptable_size(unsigned); -extern unsigned long hash_string(const char *); - -#define declare_ptable(T) \ - \ -struct PASSOC(T) { \ - char *key; \ - T *val; \ - PASSOC(T)(); \ -}; \ - \ -struct PTABLE(T); \ - \ -class PTABLE_ITERATOR(T) { \ - PTABLE(T) *p; \ - unsigned i; \ -public: \ - PTABLE_ITERATOR(T)(PTABLE(T) *); \ - int next(const char **, T **); \ -}; \ - \ -class PTABLE(T) { \ - PASSOC(T) *v; \ - unsigned size; \ - unsigned used; \ - enum { FULL_NUM = 2, FULL_DEN = 3, INITIAL_SIZE = 17 }; \ -public: \ - PTABLE(T)(); \ - ~PTABLE(T)(); \ - void define(const char *, T *); \ - T *lookup(const char *); \ - friend class PTABLE_ITERATOR(T); \ -}; - - -#define implement_ptable(T) \ - \ -PASSOC(T)::PASSOC(T)() \ -: key(0), val(0) \ -{ \ -} \ - \ -PTABLE(T)::PTABLE(T)() \ -{ \ - v = new PASSOC(T)[size = INITIAL_SIZE]; \ - used = 0; \ -} \ - \ -PTABLE(T)::~PTABLE(T)() \ -{ \ - for (unsigned i = 0; i < size; i++) { \ - a_delete v[i].key; \ - delete v[i].val; \ - } \ - a_delete v; \ -} \ - \ -void PTABLE(T)::define(const char *key, T *val) \ -{ \ - assert(key != 0); \ - unsigned long h = hash_string(key); \ - for (unsigned n = unsigned(h % size); \ - v[n].key != 0; \ - n = (n == 0 ? size - 1 : n - 1)) \ - if (strcmp(v[n].key, key) == 0) { \ - delete v[n].val; \ - v[n].val = val; \ - return; \ - } \ - if (val == 0) \ - return; \ - if (used*FULL_DEN >= size*FULL_NUM) { \ - PASSOC(T) *oldv = v; \ - unsigned old_size = size; \ - size = next_ptable_size(size); \ - v = new PASSOC(T)[size]; \ - for (unsigned i = 0; i < old_size; i++) \ - if (oldv[i].key != 0) { \ - if (oldv[i].val == 0) \ - a_delete oldv[i].key; \ - else { \ - for (unsigned j = unsigned(hash_string(oldv[i].key) % size); \ - v[j].key != 0; \ - j = (j == 0 ? size - 1 : j - 1)) \ - ; \ - v[j].key = oldv[i].key; \ - v[j].val = oldv[i].val; \ - } \ - } \ - for (n = unsigned(h % size); \ - v[n].key != 0; \ - n = (n == 0 ? size - 1 : n - 1)) \ - ; \ - a_delete oldv; \ - } \ - char *temp = new char[strlen(key)+1]; \ - strcpy(temp, key); \ - v[n].key = temp; \ - v[n].val = val; \ - used++; \ -} \ - \ -T *PTABLE(T)::lookup(const char *key) \ -{ \ - assert(key != 0); \ - for (unsigned n = unsigned(hash_string(key) % size); \ - v[n].key != 0; \ - n = (n == 0 ? size - 1 : n - 1)) \ - if (strcmp(v[n].key, key) == 0) \ - return v[n].val; \ - return 0; \ -} \ - \ -PTABLE_ITERATOR(T)::PTABLE_ITERATOR(T)(PTABLE(T) *t) \ -: p(t), i(0) \ -{ \ -} \ - \ -int PTABLE_ITERATOR(T)::next(const char **keyp, T **valp) \ -{ \ - unsigned size = p->size; \ - PASSOC(T) *v = p->v; \ - for (; i < size; i++) \ - if (v[i].key != 0) { \ - *keyp = v[i].key; \ - *valp = v[i].val; \ - i++; \ - return 1; \ - } \ - return 0; \ -} - diff --git a/gnu/groff/include/refid.h b/gnu/groff/include/refid.h deleted file mode 100644 index a0e86a31f8fd..000000000000 --- a/gnu/groff/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, 675 Mass Ave, Cambridge, MA 02139, 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/gnu/groff/include/search.h b/gnu/groff/include/search.h deleted file mode 100644 index e1fdb84530aa..000000000000 --- a/gnu/groff/include/search.h +++ /dev/null @@ -1,96 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -struct search_item; -struct search_item_iterator; - -class search_list { -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; -}; - -struct bmpattern; - -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); - ~linear_searcher(); - int search(const char *buf, const char *bufend, - const char **startp, int *lengthp) const; -}; - -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 { -protected: - char *name; - int filename_id; -public: - search_item *next; - search_item(const char *nm, int fid); - virtual search_item_iterator *make_search_item_iterator(const char *) = 0; - virtual ~search_item(); - int is_named(const char *) const; - virtual int next_filename_id() const; -}; - -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, - reference_id *) = 0; -}; - -search_item *make_index_search_item(const char *filename, int fid); -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; diff --git a/gnu/groff/include/searchpath.h b/gnu/groff/include/searchpath.h deleted file mode 100644 index 14a74f672dd5..000000000000 --- a/gnu/groff/include/searchpath.h +++ /dev/null @@ -1,29 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -class search_path { - char *dirs; - unsigned init_len; -public: - search_path(const char *envvar, const char *standard); - ~search_path(); - void command_line_dir(const char *); - FILE *open_file(const char *, char **); -}; diff --git a/gnu/groff/include/stringclass.h b/gnu/groff/include/stringclass.h deleted file mode 100644 index 570f47ac71a0..000000000000 --- a/gnu/groff/include/stringclass.h +++ /dev/null @@ -1,174 +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, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include <string.h> -#include <stdio.h> -#include <assert.h> - -class string { -public: - string(); - string(const string &); - string(const char *); - string(const char *, int); - string(char); - - ~string(); - - string &operator=(const string &); - string &operator=(const char *); - string &operator=(char); - - string &operator+=(const string &); - string &operator+=(const char *); - string &operator+=(char); - void append(const char *, int); - - int length() const; - int empty() const; - int operator*() const; - - string substring(int i, int n) const; - - char &operator[](int); - char operator[](int) const; - - void set_length(int i); - const char *contents() const; - int search(char) const; - char *extract() const; - void clear(); - void move(string &); - - friend inline string operator+(const string &, const string &); - friend inline string operator+(const string &, const char *); - friend inline string operator+(const char *, const string &); - friend inline string operator+(const string &, char); - friend inline string operator+(char, const string &); - - friend inline int operator==(const string &, const string &); - friend inline 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); - return ptr[i]; -} - -inline char string::operator[](int i) const -{ - assert(i >= 0 && i < len); - return ptr[i]; -} - -inline int string::length() const -{ - return len; -} - -inline int string::empty() const -{ - return len == 0; -} - -inline int string::operator*() const -{ - return len; -} - -inline const char *string::contents() const -{ - return ptr; -} - -inline string operator+(const string &s1, const string &s2) -{ - return string(s1.ptr, s1.len, s2.ptr, s2.len); -} - -inline string operator+(const string &s1, const char *s2) -{ - if (s2 == 0) - return s1; - else - return string(s1.ptr, s1.len, s2, strlen(s2)); -} - -inline string operator+(const char *s1, const string &s2) -{ - if (s1 == 0) - return s2; - else - return string(s1, strlen(s1), s2.ptr, s2.len); -} - -inline string operator+(const string &s, char c) -{ - return string(s.ptr, s.len, &c, 1); -} - -inline string operator+(char c, const string &s) -{ - return string(&c, 1, s.ptr, s.len); -} - -inline int operator==(const string &s1, const string &s2) -{ - 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 - || (s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) != 0)); -} - -inline string string::substring(int i, int n) const -{ - assert(i >= 0 && i + n <= len); - return string(ptr + i, n); -} - -inline string &string::operator+=(char c) -{ - if (len >= sz) - grow1(); - ptr[len++] = c; - return *this; -} - -void put_string(const string &, FILE *); - -string as_string(int); diff --git a/gnu/groff/include/unix.h b/gnu/groff/include/unix.h deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/gnu/groff/include/unix.h +++ /dev/null |
