diff options
Diffstat (limited to 'gnu/usr.bin/man/lib')
-rw-r--r-- | gnu/usr.bin/man/lib/Makefile | 26 | ||||
-rw-r--r-- | gnu/usr.bin/man/lib/config.h_dist | 210 | ||||
-rw-r--r-- | gnu/usr.bin/man/lib/gripes.c | 180 | ||||
-rw-r--r-- | gnu/usr.bin/man/lib/gripes.h | 30 | ||||
-rw-r--r-- | gnu/usr.bin/man/lib/util.c | 160 |
5 files changed, 0 insertions, 606 deletions
diff --git a/gnu/usr.bin/man/lib/Makefile b/gnu/usr.bin/man/lib/Makefile deleted file mode 100644 index 0419db38..0000000 --- a/gnu/usr.bin/man/lib/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -LIB= man -INTERNALLIB= true -INTERNALSTATICLIB= true - -CFLAGS+= -DSTDC_HEADERS -CLEANFILES+= config.h -SRCS= gripes.c util.c - -# Kludge to create config.h for other modules. The library itself doesn't -# depend on config.h. -all beforedepend: config.h - -config.h: ${.CURDIR}/config.h_dist ${.CURDIR}/../Makefile.inc - sed -e 's,%apropos%,${apropos},' -e 's,%whatis%,${whatis},' \ - -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \ - -e 's,%nroff%,${nroff},' -e 's,%tbl%,${tbl},' \ - -e 's,%col%,${col},' -e 's,%pic%,${pic},' \ - -e 's,%eqn%,${eqn},' -e 's,%neqn%,${neqn},' \ - -e 's,%vgrind%,${vgrind},' -e 's,%refer%,${refer},' \ - -e 's,%grap%,${grap},' -e 's,%zcat%,${zcat},' \ - -e 's,%manpath_config_file%,${manpath_config_file},' \ - -e 's,%compress%,${compress},' \ - -e 's,%compext%,${compext},' \ - ${.CURDIR}/config.h_dist > ${.TARGET} - -.include <bsd.lib.mk> diff --git a/gnu/usr.bin/man/lib/config.h_dist b/gnu/usr.bin/man/lib/config.h_dist deleted file mode 100644 index 381ce13..0000000 --- a/gnu/usr.bin/man/lib/config.h_dist +++ /dev/null @@ -1,210 +0,0 @@ -/* - * config.h - * - * If you haven't read the README file, now might be a good time. - * - * This file is edited by configure, so you shouldn't have to. - * If that doesn't work, edit this file to match your site. - * - * Sorry it's so long, but there are lots of things you might want to - * customize for your site. - * - * Copyright (c) 1990, 1991, John W. Eaton. - * - * You may distribute under the terms of the GNU General Public - * License as specified in the file COPYING that comes with the man - * distribution. - * - * John W. Eaton - * jwe@che.utexas.edu - * Department of Chemical Engineering - * The University of Texas at Austin - * Austin, Texas 78712 - */ - -/* - * This is the size of a number of internal buffers. It should - * probably not be less than 512. - */ -#ifndef BUFSIZ -#define BUFSIZ 1024 -#endif - -/* - * This should be at least the size of the longest path. - */ -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif - -/* - * This is the maximum number of directories expected in the manpath. - */ -#ifndef MAXDIRS -#define MAXDIRS 64 -#endif - -/* - * This is the name of the group that owns the preformatted man pages. - * If you are running man as a setgid program, you should make sure - * that all of the preformatted man pages and the directories that - * they live in are readable and writeable and owned by this group. - */ -#ifdef SECURE_MAN_UID -#define MAN_USER "" -#endif - -/* - * It's probably best to define absolute paths to all of these. If - * you don't, you'll be depending on the user's path to be correct - * when system () is called. This can result in weird behavior that's - * hard to track down, especially after you forget how this program - * works... If you don't have some of these programs, simply define - * them to be empty strings (i.e. ""). As a minimum, you must have - * nroff installed. - */ -#ifndef APROPOS -#define APROPOS "%apropos%" -#endif - -#ifndef WHATIS -#define WHATIS "%whatis%" -#endif - -#ifndef PAGER -#define PAGER "%pager%" -#endif - -#ifdef HAS_TROFF -#ifndef TROFF -#define TROFF "%troff%" -#endif -#endif - -#ifndef NROFF -#define NROFF "%nroff%" -#endif - -#ifndef EQN -#define EQN "%eqn%" -#endif - -#ifndef NEQN -#define NEQN "%neqn%" -#endif - -#ifndef TBL -#define TBL "%tbl%" -#endif - -#ifndef COL -#define COL "%col%" -#endif - -#ifndef VGRIND -#define VGRIND "%vgrind%" -#endif - -#ifndef REFER -#define REFER "%refer%" -#endif - -#ifndef GRAP -#define GRAP "%grap%" -#endif - -#ifndef PIC -#define PIC "%pic%" -#endif - -/* - * Define the absolute path to the configuration file. - */ -#ifndef MAN_MAIN - static char config_file[] = "%manpath_config_file%" ; -#endif - -/* - * Define the uncompression program(s) to use for those preformatted - * pages that end in the given character. If you add extras here, you - * may need to change man.c. [I have no idea what FCAT and YCAT files - * are! - I will leave them in for now.. -jkh] - */ -/* .F files */ -#define FCAT "" -/* .Y files */ -#define YCAT "" -/* .Z files */ -#define ZCAT "%zcat%" - -/* - * This is the standard program to use on this system for compressing - * pages once they have been formatted, and the character to tack on - * to the end of those files. The program listed is expected to read - * from the standard input and write compressed output to the standard - * output. These won't actually be used unless compression is enabled. - */ -#ifdef DO_COMPRESS -#define COMPRESSOR "%compress%" -#define COMPRESS_EXT "%compext%" -#endif - -/* - * Define the standard manual sections. For example, if your man - * directory tree has subdirectories man1, man2, man3, mann, - * and man3foo, std_sections[] would have "1", "2", "3", "n", and - * "3foo". Directories are searched in the order they appear. Having - * extras isn't fatal, it just slows things down a bit. - * - * Note that this is just for directories to search. If you have - * files like .../man3/foobar.3Xtc, you don't need to have "3Xtc" in - * the list below -- this is handled separately, so that `man 3Xtc foobar', - * `man 3 foobar', and `man foobar' should find the file .../man3/foo.3Xtc, - * (assuming, of course, that there isn't a .../man1/foo.1 or somesuch - * that we would find first). - * - * Note that this list should be in the order that you want the - * directories to be searched. Is there a standard for this? What is - * the normal order? If anyone knows, please tell me! - */ -#ifndef MANPATH_MAIN - static char *std_sections[] = - { - "1", "8", "2", "3", "n", "4", "5", "6", "7", "9", "l", NULL - }; -#endif - -/* - * Not all systems define these in stat.h. - */ -#ifndef S_IRUSR -#define S_IRUSR 00400 /* read permission: owner */ -#endif -#ifndef S_IWUSR -#define S_IWUSR 00200 /* write permission: owner */ -#endif -#ifndef S_IRGRP -#define S_IRGRP 00040 /* read permission: group */ -#endif -#ifndef S_IWGRP -#define S_IWGRP 00020 /* write permission: group */ -#endif -#ifndef S_IROTH -#define S_IROTH 00004 /* read permission: other */ -#endif -#ifndef S_IWOTH -#define S_IWOTH 00002 /* write permission: other */ -#endif - -/* - * This is the mode used for formatted pages that we create. If you - * are using the setgid option, you should use 664. If you are not, - * you should use 666 and make the cat* directories mode 777. - */ -#ifndef CATMODE -#ifdef SECURE_MAN_UID -#define CATMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH -#else -#define CATMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH -#endif -#endif diff --git a/gnu/usr.bin/man/lib/gripes.c b/gnu/usr.bin/man/lib/gripes.c deleted file mode 100644 index 466f0bc..0000000 --- a/gnu/usr.bin/man/lib/gripes.c +++ /dev/null @@ -1,180 +0,0 @@ -/* - * gripes.c - * - * Copyright (c) 1990, 1991, John W. Eaton. - * - * You may distribute under the terms of the GNU General Public - * License as specified in the file COPYING that comes with the man - * distribution. - * - * John W. Eaton - * jwe@che.utexas.edu - * Department of Chemical Engineering - * The University of Texas at Austin - * Austin, Texas 78712 - */ - -#include <stdio.h> -#include "gripes.h" - -#ifdef STDC_HEADERS -#include <stdlib.h> -#else -extern int fprintf (); -extern int fflush (); -extern int exit (); -#endif - -extern char *prognam; - -void -gripe_no_name (section) - char *section; -{ - if (section) - fprintf (stderr, "What manual page do you want from section %s?\n", - section); - else - fprintf (stderr, "What manual page do you want?\n"); - - fflush (stderr); -} - -void -gripe_reading_man_file (name) - char *name; -{ - fprintf (stderr, "Read access denied for file %s\n", name); - - fflush (stderr); -} - -void -gripe_converting_name (name, to_cat) - char *name; - int to_cat; -{ - if (to_cat) - fprintf (stderr, "Error converting %s to cat name\n", name); - else - fprintf (stderr, "Error converting %s to man name\n", name); - - fflush (stderr); - - exit (1); -} - -void -gripe_system_command (status) - int status; -{ - fprintf (stderr, "Error executing formatting or display command.\n"); - fprintf (stderr, "system command exited with status %d\n", status); - - fflush (stderr); -} - -void -gripe_not_found (name, section) - char *name, *section; -{ - if (section) - fprintf (stderr, "No entry for %s in section %s of the manual\n", - name, section); - else - fprintf (stderr, "No manual entry for %s\n", name); - - fflush (stderr); -} - -void -gripe_incompatible (s) - char *s; -{ - fprintf (stderr, "%s: incompatible options %s\n", prognam, s); - - fflush (stderr); - - exit (1); -} - -void -gripe_getting_mp_config (file) - char *file; -{ - fprintf (stderr, "%s: unable to find the file %s\n", prognam, file); - - fflush (stderr); - - exit (1); -} - -void -gripe_reading_mp_config (file) - char *file; -{ - fprintf (stderr, "%s: unable to make sense of the file %s\n", prognam, file); - - fflush (stderr); - - exit (1); -} - -void -gripe_invalid_section (section) - char *section; -{ - fprintf (stderr, "%s: invalid section (%s) selected\n", prognam, section); - - fflush (stderr); - - exit (1); -} - -void -gripe_manpath () -{ - fprintf (stderr, "%s: manpath is null\n", prognam); - - fflush (stderr); - - exit (1); -} - -void -gripe_alloc (bytes, object) - int bytes; - char *object; -{ - fprintf (stderr, "%s: can't malloc %d bytes for %s\n", - prognam, bytes, object); - - fflush (stderr); - - exit (1); -} - -void -gripe_roff_command_from_file (file) - char *file; -{ - fprintf (stderr, "Error parsing *roff command from file %s\n", file); - - fflush (stderr); -} - -void -gripe_roff_command_from_env () -{ - fprintf (stderr, "Error parsing MANROFFSEQ. Using system defaults.\n"); - - fflush (stderr); -} - -void -gripe_roff_command_from_command_line () -{ - fprintf (stderr, "Error parsing *roff command from command line.\n"); - - fflush (stderr); -} diff --git a/gnu/usr.bin/man/lib/gripes.h b/gnu/usr.bin/man/lib/gripes.h deleted file mode 100644 index 5fd59b2..0000000 --- a/gnu/usr.bin/man/lib/gripes.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * gripes.h - * - * Copyright (c) 1990, 1991, John W. Eaton. - * - * You may distribute under the terms of the GNU General Public - * License as specified in the file COPYING that comes with the man - * distribution. - * - * John W. Eaton - * jwe@che.utexas.edu - * Department of Chemical Engineering - * The University of Texas at Austin - * Austin, Texas 78712 - */ - -extern void gripe_no_name (); -extern void gripe_converting_name (); -extern void gripe_system_command (); -extern void gripe_reading_man_file (); -extern void gripe_not_found (); -extern void gripe_invalid_section (); -extern void gripe_manpath (); -extern void gripe_alloc (); -extern void gripe_incompatible (); -extern void gripe_getting_mp_config (); -extern void gripe_reading_mp_config (); -extern void gripe_roff_command_from_file (); -extern void gripe_roff_command_from_env (); -extern void gripe_roff_command_from_command_line (); diff --git a/gnu/usr.bin/man/lib/util.c b/gnu/usr.bin/man/lib/util.c deleted file mode 100644 index 995d318..0000000 --- a/gnu/usr.bin/man/lib/util.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * util.c - * - * Copyright (c) 1990, 1991, John W. Eaton. - * - * You may distribute under the terms of the GNU General Public - * License as specified in the file COPYING that comes with the man - * distribution. - * - * John W. Eaton - * jwe@che.utexas.edu - * Department of Chemical Engineering - * The University of Texas at Austin - * Austin, Texas 78712 - */ - -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/wait.h> - -#ifdef STDC_HEADERS -#include <stdlib.h> -#else -extern int fprintf (); -extern int tolower (); -#endif - -extern char *strdup (); -extern int system (); - -#include "gripes.h" - -/* - * Extract last element of a name like /foo/bar/baz. - */ -char * -mkprogname (s) - register char *s; -{ - char *t; - - t = strrchr (s, '/'); - if (t == (char *)NULL) - t = s; - else - t++; - - return strdup (t); -} - -void -downcase (s) - char *s; -{ - register char c; - while ((c = *s) != '\0') - { - if (isalpha (c)) - *s = tolower (c); - s++; - } -} - -/* - * Is file a newer than file b? - * - * case: - * - * a newer than b returns 1 - * a older than b returns 0 - * stat on a fails returns -1 - * stat on b fails returns -2 - * stat on a and b fails returns -3 - */ -int -is_newer (fa, fb) - register char *fa; - register char *fb; -{ - struct stat fa_sb; - struct stat fb_sb; - register int fa_stat; - register int fb_stat; - register int status = 0; - - fa_stat = stat (fa, &fa_sb); - if (fa_stat != 0) - status = 1; - - fb_stat = stat (fb, &fb_sb); - if (fb_stat != 0) - status |= 2; - - if (status != 0) - return -status; - - return (fa_sb.st_mtime > fb_sb.st_mtime); -} - -/* - * Is path a directory? - */ -int -is_directory (path) - char *path; -{ - struct stat sb; - register int status; - - status = stat (path, &sb); - - if (status != 0) - return -1; - - return ((sb.st_mode & S_IFDIR) == S_IFDIR); - -} - -/* - * Attempt a system () call. Return 1 for success and 0 for failure - * (handy for counting successes :-). - */ -int -do_system_command (command) - char *command; -{ - int status = 0; - extern int debug; - - /* - * If we're debugging, don't really execute the command -- you never - * know what might be in that mangled string :-O. - */ - if (debug) - fprintf (stderr, "\ntrying command: %s\n", command); - else - status = system (command); - - /* check return value from system() function first */ - if (status == -1) { - fprintf(stderr, - "wait() for exit status of shell failed in function system()\n"); - return 0; - } else if (status == 127 || status == (127 << 8)) { - fprintf(stderr, "execution of the shell failed in function system()\n"); - return 0; - } - - if (WIFSIGNALED(status)) - return -1; - else if (WEXITSTATUS(status)) { - gripe_system_command (status); - return 0; - } - else - return 1; -} |