diff options
author | ru <ru@FreeBSD.org> | 2002-10-11 08:53:48 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-10-11 08:53:48 +0000 |
commit | d95ca6e95c94196dcd9fa5575dfab599c782c895 (patch) | |
tree | 8f31833c941b2d7ca267ee6b41bbd0627562e135 /contrib/groff/src | |
parent | 127e61728bacf1fb90edd8be1b0c406619e78bc8 (diff) | |
download | FreeBSD-src-d95ca6e95c94196dcd9fa5575dfab599c782c895.zip FreeBSD-src-d95ca6e95c94196dcd9fa5575dfab599c782c895.tar.gz |
Removed files not present in v1.18.1 import.
Diffstat (limited to 'contrib/groff/src')
-rw-r--r-- | contrib/groff/src/include/htmlindicate.h | 59 | ||||
-rw-r--r-- | contrib/groff/src/libs/libgroff/htmlindicate.cc | 97 | ||||
-rw-r--r-- | contrib/groff/src/libs/libgroff/illegal.cc | 60 | ||||
-rw-r--r-- | contrib/groff/src/preproc/html/pushbackbuffer.cc | 338 | ||||
-rw-r--r-- | contrib/groff/src/preproc/html/pushbackbuffer.h | 54 |
5 files changed, 0 insertions, 608 deletions
diff --git a/contrib/groff/src/include/htmlindicate.h b/contrib/groff/src/include/htmlindicate.h deleted file mode 100644 index 4915ba8..0000000 --- a/contrib/groff/src/include/htmlindicate.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. - Written by Gaius Mulley <gaius@glam.ac.uk> - -This file is part of groff. - -groff is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -groff is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with groff; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef HTMLINDICATE_H -#define HTMLINDICATE_H - -/* - * graphic_start - emit a html graphic start indicator, but only - * if one has not already been issued. - * - * The boolean, is_inline, should be: - * - * FALSE if this is called via EQ, TS, PS, and - * TRUE if issued via delim $$ $ x over y $ etc. - */ -extern void graphic_start(int is_inline); - -/* - * graphic_end - emit a html graphic end indicator, but only - * if a corresponding matching graphic-start has - * been issued. - * - */ -extern void graphic_end(); - -/* - * html_begin_suppress - suppresses output for the html device - * and resets the min/max registers for -Tps - * - * The boolean, is_inline, should be: - * - * FALSE if this is called via EQ, TS, PS, and - * TRUE if issued via delim $$ $ x over y $ etc. - */ -extern void html_begin_suppress(int is_inline); - -/* - * html_end_suppress - end the suppression of output. - */ -extern void html_end_suppress(int is_inline); - -#endif diff --git a/contrib/groff/src/libs/libgroff/htmlindicate.cc b/contrib/groff/src/libs/libgroff/htmlindicate.cc deleted file mode 100644 index 2e6a5d7..0000000 --- a/contrib/groff/src/libs/libgroff/htmlindicate.cc +++ /dev/null @@ -1,97 +0,0 @@ -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. - Written by Gaius Mulley (gaius@glam.ac.uk) - -This file is part of groff. - -groff is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -groff is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with groff; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stddef.h> -#include <stdlib.h> -#include <string.h> - -#include "nonposix.h" -#include "stringclass.h" -#include "html-strings.h" - -/* - * This file contains a very simple set of routines shared by - * tbl, pic, eqn which help the html device driver to make - * sensible formatting choices. Currently it simply indicates - * to pre-html when an image is about to be created this is then - * passes to pre-html. - * Pre-html runs troff twice, once with -Thtml and once with -Tps. - * troff -Thtml device driver emits a <src='image'.png> tag - * and the postscript device driver works out the min/max limits - * of the graphic region. These region limits are read by pre-html - * and an image is generated via troff -Tps -> gs -> png - */ - -static int is_in_graphic_start = 0; -static int is_inline_image = 0; - -/* - * html_begin_suppress - emit a start of image tag which will be seen - * by pre-html. - */ -void html_begin_suppress(int is_inline) -{ - if (is_inline) - put_string(HTML_IMAGE_INLINE_BEGIN, stdout); - else { - put_string(HTML_IMAGE_CENTERED, stdout); - put_string("\n", stdout); - } -} - -/* - * html_end_suppress - emit an end of image tag which will be seen - * by pre-html. - */ -void html_end_suppress(int is_inline) -{ - if (is_inline) - put_string(HTML_IMAGE_INLINE_END, stdout); - else { - put_string(HTML_IMAGE_END, stdout); - put_string("\n", stdout); - } -} - -/* - * graphic_start - The boolean, is_inline, should be: - * - * FALSE if this is called via EQ, TS, PS, and - * TRUE if issued via delim $$ $ x over y $ etc. - */ -void graphic_start(int is_inline) -{ - if (!is_in_graphic_start) { - html_begin_suppress(is_inline); - is_inline_image = is_inline; - is_in_graphic_start = 1; - } -} - -/* - * graphic_end - tell troff that the image region is ending. - */ - -void graphic_end() -{ - if (is_in_graphic_start) { - html_end_suppress(is_inline_image); - is_in_graphic_start = 0; - } -} diff --git a/contrib/groff/src/libs/libgroff/illegal.cc b/contrib/groff/src/libs/libgroff/illegal.cc deleted file mode 100644 index bacd891..0000000 --- a/contrib/groff/src/libs/libgroff/illegal.cc +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#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, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -#endif -}; diff --git a/contrib/groff/src/preproc/html/pushbackbuffer.cc b/contrib/groff/src/preproc/html/pushbackbuffer.cc deleted file mode 100644 index 4bea451..0000000 --- a/contrib/groff/src/preproc/html/pushbackbuffer.cc +++ /dev/null @@ -1,338 +0,0 @@ -// -*- C++ -*- -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. - Written by Gaius Mulley (gaius@glam.ac.uk). - -This file is part of groff. - -groff is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -groff is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with groff; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#include <stdio.h> -#include <signal.h> -#include <ctype.h> -#include <string.h> -#include <assert.h> -#include <stdlib.h> -#include <errno.h> -#include "lib.h" -#include "errarg.h" -#include "error.h" -#include "stringclass.h" -#include "posix.h" - -#include <errno.h> -#include <sys/types.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -#include "pushbackbuffer.h" -#include "pre-html.h" - -#if !defined(TRUE) -# define TRUE (1==1) -#endif - -#if !defined(FALSE) -# define FALSE (1==0) -#endif - -# define ERROR(X) (void)(fprintf(stderr, "%s:%d error %s\n", __FILE__, __LINE__, X) && \ - (fflush(stderr)) && localexit(1)) - - -#define MAXPUSHBACKSTACK 4096 /* maximum number of character that can be pushed back */ - - -/* - * constructor for pushBackBuffer - */ - -pushBackBuffer::pushBackBuffer (char *filename) -{ - charStack = (char *)malloc(MAXPUSHBACKSTACK); - if (charStack == 0) { - sys_fatal("malloc"); - } - stackPtr = 0; /* index to push back stack */ - debug = 0; - verbose = 0; - eofFound = FALSE; - lineNo = 1; - if (strcmp(filename, "") != 0) { - stdIn = dup(0); - close(0); - if (open(filename, O_RDONLY) != 0) { - sys_fatal("when trying to open file"); - } else { - fileName = filename; - } - } -} - -pushBackBuffer::~pushBackBuffer () -{ - int old; - - if (charStack != 0) { - free(charStack); - } - close(0); - /* restore stdin in file descriptor 0 */ - old = dup(stdIn); - close(stdIn); -} - -/* - * localexit - wraps exit with a return code to aid the ERROR macro. - */ - -int localexit (int i) -{ - exit(i); - return( 1 ); -} - -/* - * getPB - returns a character, possibly a pushed back character. - */ - -char pushBackBuffer::getPB (void) -{ - if (stackPtr>0) { - stackPtr--; - return( charStack[stackPtr] ); - } else { - char ch; - - if (read(0, &ch, 1) == 1) { - if (verbose) { - printf("%c", ch); - } - if (ch == '\n') { - lineNo++; - } - return( ch ); - } else { - eofFound = TRUE; - return( eof ); - } - } -} - -/* - * putPB - pushes a character onto the push back stack. - * The same character is returned. - */ - -char pushBackBuffer::putPB (char ch) -{ - if (stackPtr<MAXPUSHBACKSTACK) { - charStack[stackPtr] = ch ; - stackPtr++; - } else { - ERROR("max push back stack exceeded, increase MAXPUSHBACKSTACK constant"); - } - return( ch ); -} - -/* - * isWhite - returns TRUE if a white character is found. This character is NOT consumed. - */ - -static int isWhite (char ch) -{ - return( (ch==' ') || (ch == '\t') || (ch == '\n') ); -} - -/* - * skipToNewline - skips characters until a newline is seen. - */ - -void pushBackBuffer::skipToNewline (void) -{ - char ch; - - while ((putPB(getPB()) != '\n') && (! eofFound)) { - ch = getPB(); - } -} - -/* - * skipUntilToken - skips until a token is seen - */ - -void pushBackBuffer::skipUntilToken (void) -{ - char ch; - - while ((isWhite(putPB(getPB())) || (putPB(getPB()) == '#')) && (! eofFound)) { - ch = getPB(); - if (ch == '#') { - skipToNewline(); - } - } -} - -/* - * isString - returns TRUE if the string, s, matches the pushed back string. - * if TRUE is returned then this string is consumed, otherwise it is - * left alone. - */ - -int pushBackBuffer::isString (char *s) -{ - int length=strlen(s); - int i=0; - - while ((i<length) && (putPB(getPB())==s[i])) { - if (getPB() != s[i]) { - ERROR("assert failed"); - } - i++; - } - if (i==length) { - return( TRUE ); - } else { - i--; - while (i>=0) { - if (putPB(s[i]) != s[i]) { - ERROR("assert failed"); - } - i--; - } - } - return( FALSE ); -} - -/* - * isDigit - returns TRUE if the character, ch, is a digit. - */ - -static int isDigit (char ch) -{ - return( ((ch>='0') && (ch<='9')) ); -} - -/* - * isHexDigit - returns TRUE if the character, ch, is a hex digit. - */ - -#if 0 -static int isHexDigit (char ch) -{ - return( (isDigit(ch)) || ((ch>='a') && (ch<='f')) ); -} -#endif - -/* - * readInt - returns an integer from the input stream. - */ - -int pushBackBuffer::readInt (void) -{ - int c =0; - int i =0; - int s =1; - char ch=getPB(); - - while (isWhite(ch)) { - ch=getPB(); - } - // now read integer - - if (ch == '-') { - s = -1; - ch = getPB(); - } - while (isDigit(ch)) { - i *= 10; - if ((ch>='0') && (ch<='9')) { - i += (int)(ch-'0'); - } - ch = getPB(); - c++; - } - if (ch != putPB(ch)) { - ERROR("assert failed"); - } - return( i*s ); -} - -/* - * convertToFloat - converts integers, a and b into a.b - */ - -static float convertToFloat (int a, int b) -{ - int c=10; - float f; - - while (b>c) { - c *= 10; - } - f = ((float)a) + (((float)b)/((float)c)); - return( f ); -} - -/* - * readNumber - returns a float representing the word just read. - */ - -float pushBackBuffer::readNumber (void) -{ - int integer; - int fraction; - char ch; - float f; - - integer = readInt(); - if (putPB(getPB()) == '.') { - ch = getPB(); - fraction = readInt(); - f = convertToFloat(integer, fraction); - return( f ); - } else { - return( (float)integer ); - } -} - -/* - * readString - reads a string terminated by white space - * and returns a malloced area of memory containing - * a copy of the characters. - */ - -char *pushBackBuffer::readString (void) -{ - char buffer[MAXPUSHBACKSTACK]; - char *string = 0; - int i=0; - char ch=getPB(); - - while (isWhite(ch)) { - ch=getPB(); - } - while ((i < MAXPUSHBACKSTACK) && (! isWhite(ch)) && (! eofFound)) { - buffer[i] = ch; - i++; - ch = getPB(); - } - if (i < MAXPUSHBACKSTACK) { - buffer[i] = (char)0; - string = (char *)malloc(strlen(buffer)+1); - strcpy(string, buffer); - } - return( string ); -} diff --git a/contrib/groff/src/preproc/html/pushbackbuffer.h b/contrib/groff/src/preproc/html/pushbackbuffer.h deleted file mode 100644 index 93cb3f1..0000000 --- a/contrib/groff/src/preproc/html/pushbackbuffer.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C -*- -/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. - Written by Gaius Mulley (gaius@glam.ac.uk). - -This file is part of groff. - -groff is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -groff is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with groff; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - -#define eof (char)-1 - - -/* - * defines the class and methods implemented within pushbackbuffer.cc - */ - -class pushBackBuffer -{ - private: - char *charStack; - int stackPtr; /* index to push back stack */ - int debug; - int verbose; - int eofFound; - char *fileName; - int lineNo; - int stdIn; - - public: - pushBackBuffer (char *); - ~ pushBackBuffer (); - char getPB (void); - char putPB (char ch); - void skipUntilToken (void); - void skipToNewline (void); - float readNumber (void); - int readInt (void); - char *readString (void); - int isString (char *string); -}; - - |