aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>1997-12-15 23:08:47 +0000
committercvs2svn <cvs2svn@FreeBSD.org>1997-12-15 23:08:47 +0000
commit8831a5f1be8d35c28d7867eceb294a76a8cea328 (patch)
tree89b67804093be62bdf748357afe90f6d8dda4fd5
parentdde39e507a44a036d4d16ba337db2dab31cd58f6 (diff)
This commit was manufactured by cvs2svn to create tagvendor/global/2.2.1
'global-vendor-v2_2_1'.
Notes
Notes: svn path=/vendor/global/dist/; revision=31750 svn path=/vendor/global/2.2.1/; revision=31752; tag=vendor/global/2.2.1
-rw-r--r--contrib/global/btreeop/err.c217
-rw-r--r--contrib/global/gctags/err.c217
-rw-r--r--contrib/global/global/global.pl302
-rw-r--r--contrib/global/gtags/gtags.pl84
-rw-r--r--contrib/global/include/ansi.h93
-rw-r--r--contrib/global/include/cdefs.h158
-rw-r--r--contrib/global/include/err.h62
7 files changed, 0 insertions, 1133 deletions
diff --git a/contrib/global/btreeop/err.c b/contrib/global/btreeop/err.c
deleted file mode 100644
index bd84d4613d9e..000000000000
--- a/contrib/global/btreeop/err.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <err.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-/* extern char *__progname; Program name, from crt0. */
-char *progname = "btreeop";
-
-static FILE *err_file; /* file to use for error output */
-static void (*err_exit)(int);
-
-void
-err_set_file(void *fp)
-{
- if (fp)
- err_file = fp;
- else
- err_file = stderr;
-}
-
-void
-err_set_exit(void (*ef)(int))
-{
- err_exit = ef;
-}
-
-void
-#ifdef __STDC__
-err(int eval, const char *fmt, ...)
-#else
-err(eval, fmt, va_alist)
- int eval;
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- verr(eval, fmt, ap);
- va_end(ap);
-}
-
-void
-verr(eval, fmt, ap)
- int eval;
- const char *fmt;
- va_list ap;
-{
- int sverrno;
-
- sverrno = errno;
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL) {
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, ": ");
- }
- (void)fprintf(err_file, "%s\n", strerror(sverrno));
- if(err_exit)
- err_exit(eval);
- exit(eval);
-}
-
-void
-#if __STDC__
-errx(int eval, const char *fmt, ...)
-#else
-errx(eval, fmt, va_alist)
- int eval;
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- verrx(eval, fmt, ap);
- va_end(ap);
-}
-
-void
-verrx(eval, fmt, ap)
- int eval;
- const char *fmt;
- va_list ap;
-{
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL)
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, "\n");
- if (err_exit)
- err_exit(eval);
- exit(eval);
-}
-
-void
-#if __STDC__
-warn(const char *fmt, ...)
-#else
-warn(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- vwarn(fmt, ap);
- va_end(ap);
-}
-
-void
-vwarn(fmt, ap)
- const char *fmt;
- va_list ap;
-{
- int sverrno;
-
- sverrno = errno;
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL) {
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, ": ");
- }
- (void)fprintf(err_file, "%s\n", strerror(sverrno));
-}
-
-void
-#ifdef __STDC__
-warnx(const char *fmt, ...)
-#else
-warnx(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#ifdef __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- vwarnx(fmt, ap);
- va_end(ap);
-}
-
-void
-vwarnx(fmt, ap)
- const char *fmt;
- va_list ap;
-{
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL)
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, "\n");
-}
diff --git a/contrib/global/gctags/err.c b/contrib/global/gctags/err.c
deleted file mode 100644
index 9d20812fed86..000000000000
--- a/contrib/global/gctags/err.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <err.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-/* extern char *__progname; Program name, from crt0. */
-char *progname = "gctags";
-
-static FILE *err_file; /* file to use for error output */
-static void (*err_exit)(int);
-
-void
-err_set_file(void *fp)
-{
- if (fp)
- err_file = fp;
- else
- err_file = stderr;
-}
-
-void
-err_set_exit(void (*ef)(int))
-{
- err_exit = ef;
-}
-
-void
-#ifdef __STDC__
-err(int eval, const char *fmt, ...)
-#else
-err(eval, fmt, va_alist)
- int eval;
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- verr(eval, fmt, ap);
- va_end(ap);
-}
-
-void
-verr(eval, fmt, ap)
- int eval;
- const char *fmt;
- va_list ap;
-{
- int sverrno;
-
- sverrno = errno;
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL) {
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, ": ");
- }
- (void)fprintf(err_file, "%s\n", strerror(sverrno));
- if(err_exit)
- err_exit(eval);
- exit(eval);
-}
-
-void
-#if __STDC__
-errx(int eval, const char *fmt, ...)
-#else
-errx(eval, fmt, va_alist)
- int eval;
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- verrx(eval, fmt, ap);
- va_end(ap);
-}
-
-void
-verrx(eval, fmt, ap)
- int eval;
- const char *fmt;
- va_list ap;
-{
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL)
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, "\n");
- if (err_exit)
- err_exit(eval);
- exit(eval);
-}
-
-void
-#if __STDC__
-warn(const char *fmt, ...)
-#else
-warn(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#if __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- vwarn(fmt, ap);
- va_end(ap);
-}
-
-void
-vwarn(fmt, ap)
- const char *fmt;
- va_list ap;
-{
- int sverrno;
-
- sverrno = errno;
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL) {
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, ": ");
- }
- (void)fprintf(err_file, "%s\n", strerror(sverrno));
-}
-
-void
-#ifdef __STDC__
-warnx(const char *fmt, ...)
-#else
-warnx(fmt, va_alist)
- const char *fmt;
- va_dcl
-#endif
-{
- va_list ap;
-#ifdef __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
- vwarnx(fmt, ap);
- va_end(ap);
-}
-
-void
-vwarnx(fmt, ap)
- const char *fmt;
- va_list ap;
-{
- if (! err_file)
- err_set_file((FILE *)0);
- (void)fprintf(err_file, "%s: ", progname);
- if (fmt != NULL)
- (void)vfprintf(err_file, fmt, ap);
- (void)fprintf(err_file, "\n");
-}
diff --git a/contrib/global/global/global.pl b/contrib/global/global/global.pl
deleted file mode 100644
index 571bddb2bce6..000000000000
--- a/contrib/global/global/global.pl
+++ /dev/null
@@ -1,302 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Shigio Yamaguchi.
-# 4. Neither the name of the author nor the names of any co-contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# global.pl 7-Jul-97
-#
-sub getcwd {
- local($dir);
- chop($dir = `/bin/pwd`);
- $dir;
-}
-sub regexp {
- $_[0] =~ /[][.*\^\$+?|(){}\\]/; # include regular expression ?
-}
-$com = $0;
-$com =~ s/.*\///;
-$usage = "usage:\t$com [-a][-r][-x] pattern\n\t$com -c [name]\n\t$com [-a] -f file\n";
-$ENV{'PATH'} = '/bin:/usr/bin';
-#
-# options check
-#
-while ($ARGV[0] =~ /^-/) {
- $opt = shift;
- if ($opt =~ /a/) { $aflag = 1; }
- if ($opt =~ /c/) { $cflag = 1; }
- if ($opt =~ /f/) { $fflag = 1; }
- if ($opt =~ /r/) { $rflag = 1; }
- if ($opt =~ /x/) { $xflag = 1; }
-}
-# -f option is valid when it is only one except for -a and -x option
-if ($fflag && ($cflag || $rflag)) {
- $fflag = 0;
-}
-# -c option is valid when it is only one
-if ($cflag && ($aflag || $fflag || $rflag || $xflag)) {
- $cflag = 0;
-}
-if (@ARGV == 0) {
- die($usage) if (! $cflag);
-}
-if ($cflag && &regexp($ARGV[0])) {
- die "$com: regular expression not allowed with -c option.\n";
-}
-$ARGV[0] =~ s/^[ \t]+//; # remove leading blanks
-#
-# get $dbpath and $root
-#
-local($dbpath, $root) = &getdbpath();
-#
-# recognize format version of GTAGS. 'format version record' is saved as a
-# META record in GTAGS and GRTAGS. if 'format version record' is not found,
-# it's assumed version 1.
- $support_version = 1; # accept this format version
-#
-open(GTAGS, "btreeop -K ' __.VERSION' $dbpath/GTAGS |") || die "$com: GTAGS not found.\n";
-$rec = <GTAGS>;
-close(GTAGS);
-if ($rec =~ /^ __\.VERSION[ \t]+([0-9]+)$/) {
- $format_version = $1;
-} else {
- $format_version = 1;
-}
-if ($format_version > $support_version) {
- die "$com: GTAGS seems new format. Please install the latest GLOBAL.\n";
-}
-#
-# complete function name
-#
-if ($cflag) {
- open(PIPEIN, "btreeop -L $dbpath/GTAGS |") || die "$com: btreeop cannot exec.\n";
- while (<PIPEIN>) {
- print if (@ARGV == 0 || $_ =~ /^$ARGV[0]/o);
- }
- close(PIPEIN);
- exit(0);
-}
-#
-# make path filter.
-#
-if ($aflag) {
- @com = ("-e 's!\\.!$root!'"); # absolute
-} else {
- @com = &relative_filter($root); # relative
-}
-#
-# print function definitions.
-#
-if ($fflag) {
- if (! -f $ARGV[0]) { die "$com: file '$ARGV[0]' not exist.\n"; }
- $path = &realpath($ARGV[0]);
- $path =~ s/^$root/./;
- chdir($root) || die "$com: cannot move to directory '$root'.\n";
- system("gctags -Dex '$path' | sort +1n -2 | sed @com");
- exit(0);
-}
-#
-# search in current source tree.
-#
-$cnt = &search($ARGV[0], $dbpath, @com);
-#
-# search in library path.
-#
-if ($cnt == 0 && ! &regexp($ARGV[0]) && ! $rflag && defined($ENV{'GTAGSLIBPATH'})) {
- local($cwd) = &getcwd;
- foreach $lib (split(':', $ENV{'GTAGSLIBPATH'})) {
- next unless (-f "$lib/GTAGS");
- next if ($dbpath eq $lib);
- chdir($lib) || die "$com: cannot chdir to $lib.\n";
- $root = $dbpath = &getcwd;
- if ($aflag) {
- @com = ("-e 's!\\.!$root!'");
- } else {
- $common = &common($root, $cwd);
- $up = $root;
- $up =~ s/$common//;
- $down = $cwd;
- $down =~ s/$common//;
- $down =~ s![^/]+!..!g;
- next if ($down eq '' || $up eq '');
- @com = ("-e 's!\\./!$down/$up/!'");
- }
- $cnt = &search($ARGV[0], $dbpath, @com);
- last if ($cnt > 0);
- }
- chdir($cwd) || die "$com: cannot return current directory.\n";
-}
-exit(0);
-#
-# realpath: get absolute path name
-#
-# r) absolute path
-#
-sub realpath {
- local($path) = @_;
- local($dirname, $basename);
- if ($path =~ m!^(.*)/([^/]*)$!) {
- $dirname = $1;
- $basename = $2;
- } else {
- $dirname = '.';
- $basename = $path;
- }
- local($cwd) = &getcwd;
- chdir($dirname) || die "$com: cannot move to '$dirname'.\n";
- $path = &getcwd . '/' . $basename;
- chdir($cwd) || die "$com: cannot return to '$cwd'.\n";
- $path;
-}
-#
-# getdbpath: get dbpath and root directory
-#
-# r) ($dbpath, $root)
-#
-sub getdbpath {
- local($dbpath, $root);
- local($cwd) = &getcwd;
-
- if (defined($ENV{'GTAGSROOT'})) {
- $dbpath = $root = $ENV{'GTAGSROOT'};
- if (defined($ENV{'GTAGSDBPATH'})) {
- $dbpath = $ENV{'GTAGSDBPATH'};
- }
- $root =~ /^\// || die "$com: GTAGSROOT must be an absolute path.\n";
- $dbpath =~ /^\// || die "$com: GTAGSDBPATH must be an absolute path.\n";
- chdir($root) || die "$com: directory $root not found.\n";
- $root = &getcwd;
- chdir($cwd);
- chdir($dbpath) || die "$com: directory $dbpath not found.\n";
- $dbpath = &getcwd;
- if ($cwd !~ /^$root/) {
- die "$com: you must be under GTAGSROOT.\n";
- }
- }
- if (!$root) {
- local($gtags) = 'GTAGS';
- while (! -r $gtags && ! -r "obj/$gtags") {
- if (&getcwd =~ m!^/$!) { die "$com: $gtags not found.\n"; }
- chdir('..');
- }
- $dbpath = $root = &getcwd;
- $dbpath = "$dbpath/obj" if (! -r $gtags);
- }
- chdir($cwd) || die "$com: cannot return current directory.\n";
- ($dbpath, $root);
-}
-#
-# relative_filter: make relative path filter
-#
-# i) $root the root directory of source tree
-# r) @com sed command list
-#
-sub relative_filter {
- local($root) = @_;
- local($cwd) = &getcwd;
- local($cur) = $cwd;
-
- $cur =~ s!$root!!;
- $cur =~ s!^/!!;
- local(@step) = split('/', $cur);
- local($downpath) = '\\.\\./' x @step;
- local(@com);
- push(@com, "-e 's!\\./!$downpath!'");
- foreach $step (@step) {
- push(@com, "-e 's!\\.\\./$step/!!'");
- }
- chdir($cwd) || die "$com: cannot return current directory.\n";
- @com;
-}
-#
-# common: extract a common part of two paths.
-#
-# i) $p1, $p2 paths
-# r) common part
-#
-sub common {
- local($p1, $p2) = @_;
- local(@p1, @p2, @common, $common);
-
- @p1 = split('/', $p1);
- @p2 = split('/', $p2);
- while (@p1 && @p2 && $p1[0] eq $p2[0]) {
- push(@common, shift @p1);
- shift @p2;
- }
- $common = join('/', @common);
- $common .= '/';
- $common;
-}
-#
-# search: search specified function
-#
-# i) $pattern search pattern
-# i) $dbpath where GTAGS exist
-# i) @com sed's command
-# gi) $xflag -x option
-# gi) $rflag -r option
-# r) count of output lines
-#
-sub search {
- local($pattern, $dbpath, @com) = @_;
- local($regex, $gtags, $outfilter, $infilter);
- #
- # make input filter
- #
- $gtags = ($rflag) ? 'GRTAGS' : 'GTAGS';
- if ($regex = &regexp($pattern)) { # regular expression
- $infilter = "btreeop $dbpath/$gtags |";
- } else {
- $infilter = "btreeop -K '$pattern' $dbpath/$gtags |";
- }
- #
- # make output filter
- # gtags fields is same to ctags -x format.
- # 0:tag, 1:lineno, 2:filename, 3: pattern.
- #
- if ($xflag) {
- $outfilter = "| sort +0 -1 +2 -3 +1n -2";
- } else {
- $outfilter = "| awk '{print \$3}' | sort | uniq";
- }
- $outfilter .= "| sed @com";
- open(PIPEIN, $infilter) || die "$com: database not found.\n";
- open(PIPEOUT, $outfilter) || die "$com: pipe cannot open.\n";
- local($cnt) = 0;
- while (<PIPEIN>) {
- local($tag) = split;
- if (! $regex || $tag =~ /$pattern/o) {
- $cnt++;
- print PIPEOUT $_;
- }
- }
- close(PIPEIN);
- close(PIPEOUT);
- $cnt;
-}
diff --git a/contrib/global/gtags/gtags.pl b/contrib/global/gtags/gtags.pl
deleted file mode 100644
index 20c5877f05ce..000000000000
--- a/contrib/global/gtags/gtags.pl
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/perl
-#
-# Copyright (c) 1996, 1997 Shigio Yamaguchi. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by Shigio Yamaguchi.
-# 4. Neither the name of the author nor the names of any co-contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# gtags.pl 5-Jul-97
-#
-$com = $0;
-$com =~ s/.*\///;
-$usage = "usage: $com [-e][-s][dbpath]";
-$ENV{'PATH'} = '/bin:/usr/bin';
-#
-# ctags flag
-#
-$eflag = $sflag = '';
-while ($ARGV[0] =~ /^-/) {
- $opt = shift;
- if ($opt =~ /[^-es]/) { die "$usage\n"; }
- if ($opt =~ /e/) { $eflag = 'e'; }
- if ($opt =~ /s/) { $sflag = 's'; }
-}
-$dbpath = '.';
-$dbpath = $ARGV[0] if ($ARGV[0]);
-if (-f "$dbpath/GTAGS" && -f "$dbpath/GRTAGS") {
- if (! -w "$dbpath/GTAGS") {
- die "$com: cannot write to GTAGS.\n";
- } elsif (! -w "$dbpath/GRTAGS") {
- die "$com: cannot write to GRTAGS.\n";
- }
-} elsif (! -w "$dbpath") {
- die "$com: cannot write to the directory '$dbpath'.\n"
-}
-#
-# make global database
-#
-foreach $db ('GTAGS', 'GRTAGS') {
- # currently only *.c *.h *.y are supported.
- # *.s *.S is valid only when -s option specified.
- open(FIND, "find . -type f -name '*.[chysS]' -print |") || die "$com: cannot exec find.\n";
- open(DB, "|btreeop -C $dbpath/$db") || die "$com: cannot create db file '$dbpath/$db'.\n";
- while (<FIND>) {
- chop;
- next if /(y\.tab\.c|y\.tab\.h)$/;
- next if /(\/SCCS\/|\/RCS\/)/;
- next if (/\.[sS]$/ && (!$sflag || $db eq 'GRTAGS'));
-
- $flag = ($db eq 'GRTAGS') ? "${eflag}Dxr" : "${eflag}Dx";
- $ENV{'GTAGDBPATH'} = $dbpath;
- open(TAGS, "gctags -$flag $_ |") || die "$com: cannot read '$_'.\n";
- while (<TAGS>) {
- print DB;
- }
- close(TAGS);
- }
- close(DB);
- close(FIND);
-}
-exit 0;
diff --git a/contrib/global/include/ansi.h b/contrib/global/include/ansi.h
deleted file mode 100644
index 2d71f774de2c..000000000000
--- a/contrib/global/include/ansi.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)ansi.h 8.2 (Berkeley) 1/4/94
- * $Id: ansi.h,v 1.10 1996/05/01 00:47:05 bde Exp $
- */
-
-#ifndef _MACHINE_ANSI_H_
-#define _MACHINE_ANSI_H_
-
-/*
- * Types which are fundamental to the implementation and must be declared
- * in more than one standard header are defined here. Standard headers
- * then use:
- * #ifdef _BSD_SIZE_T_
- * typedef _BSD_SIZE_T_ size_t;
- * #undef _BSD_SIZE_T_
- * #endif
- */
-#define _BSD_CLOCK_T_ unsigned long /* clock() */
-#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
-#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */
-#define _BSD_SIZE_T_ unsigned int /* sizeof() */
-#define _BSD_SSIZE_T_ int /* byte count or error */
-#define _BSD_TIME_T_ long /* time() */
-#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */
-
-/*
- * Types which are fundamental to the implementation and must be used
- * in more than one standard header although they are only declared in
- * one (perhaps nonstandard) header are defined here. Standard headers
- * use _BSD_XXX_T_ without undef'ing it.
- */
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
-#define _BSD_OFF_T_ long long /* file offset */
-#define _BSD_PID_T_ int /* process [group] */
-#define _BSD_VA_LIST_ char * /* va_list */
-
-/*
- * The rune type is declared to be an ``int'' instead of the more natural
- * ``unsigned long'' or ``long''. Two things are happening here. It is not
- * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- * it looks like 10646 will be a 31 bit standard. This means that if your
- * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- * chosen over a long is that the is*() and to*() routines take ints (says
- * ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
- * here, you lose a bit of ANSI conformance, but your programs will still
- * work.
- */
-
-/*
- * Frequencies of the clock ticks reported by clock() and times(). They
- * are the same as stathz for bogus historical reasons. They should be
- * 1e6 because clock() and times() are implemented using getrusage() and
- * there is no good reason why they should be less accurate. There is
- * the bad reason that (broken) programs might not like clock_t or
- * CLOCKS_PER_SEC being ``double'' (``unsigned long'' is not large enough
- * to hold the required 24 hours worth of ticks if the frequency is
- * 1000000ul, and ``unsigned long long'' would be nonstandard).
- */
-#define _BSD_CLK_TCK_ 128
-#define _BSD_CLOCKS_PER_SEC_ 128
-
-#endif /* !_MACHINE_ANSI_H_ */
diff --git a/contrib/global/include/cdefs.h b/contrib/global/include/cdefs.h
deleted file mode 100644
index fe2cd6605f84..000000000000
--- a/contrib/global/include/cdefs.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Berkeley Software Design, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)cdefs.h 8.8 (Berkeley) 1/9/95
- * $Id: cdefs.h,v 1.11 1996/08/18 16:14:03 peter Exp $
- */
-
-#ifndef _SYS_CDEFS_H_
-#define _SYS_CDEFS_H_
-
-#if defined(__cplusplus)
-#define __BEGIN_DECLS extern "C" {
-#define __END_DECLS };
-#else
-#define __BEGIN_DECLS
-#define __END_DECLS
-#endif
-
-/*
- * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
- * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
- * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
- * in between its arguments. __CONCAT can also concatenate double-quoted
- * strings produced by the __STRING macro, but this only works with ANSI C.
- */
-#if defined(__STDC__) || defined(__cplusplus)
-#define __P(protos) protos /* full-blown ANSI C */
-#define __CONCAT1(x,y) x ## y
-#define __CONCAT(x,y) __CONCAT1(x,y)
-#define __STRING(x) #x
-
-#define __const const /* define reserved names to standard */
-#define __signed signed
-#define __volatile volatile
-#if defined(__cplusplus)
-#define __inline inline /* convert to C++ keyword */
-#else
-#ifndef __GNUC__
-#define __inline /* delete GCC keyword */
-#endif /* !__GNUC__ */
-#endif /* !__cplusplus */
-
-#else /* !(__STDC__ || __cplusplus) */
-#define __P(protos) () /* traditional C preprocessor */
-#define __CONCAT(x,y) x/**/y
-#define __STRING(x) "x"
-
-#ifndef __GNUC__
-#define __const /* delete pseudo-ANSI C keywords */
-#define __inline
-#define __signed
-#define __volatile
-/*
- * In non-ANSI C environments, new programs will want ANSI-only C keywords
- * deleted from the program and old programs will want them left alone.
- * When using a compiler other than gcc, programs using the ANSI C keywords
- * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
- * When using "gcc -traditional", we assume that this is the intent; if
- * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
- */
-#ifndef NO_ANSI_KEYWORDS
-#define const /* delete ANSI C keywords */
-#define inline
-#define signed
-#define volatile
-#endif /* !NO_ANSI_KEYWORDS */
-#endif /* !__GNUC__ */
-#endif /* !(__STDC__ || __cplusplus) */
-
-/*
- * GCC1 and some versions of GCC2 declare dead (non-returning) and
- * pure (no side effects) functions using "volatile" and "const";
- * unfortunately, these then cause warnings under "-ansi -pedantic".
- * GCC2.5 uses a new, peculiar __attribute__((attrs)) style. All of
- * these work for GNU C++ (modulo a slight glitch in the C++ grammar
- * in the distribution version of 2.5.5).
- */
-#if __GNUC__ < 2
-#define __dead
-#define __dead2
-#define __pure
-#define __pure2
-#define __unused
-#define __attribute__(x)
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ < 5
-#define __dead __volatile
-#define __dead2
-#define __pure __const
-#define __pure2
-#define __unused
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
-#define __dead
-#define __dead2 __attribute__((__noreturn__))
-#define __pure
-#define __pure2 __attribute__((__const__))
-#define __unused
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3
-#define __dead
-#define __dead2 __attribute__((__noreturn__))
-#define __pure
-#define __pure2 __attribute__((__const__))
-#define __unused __attribute__((__unused__))
-#endif
-
-#ifdef __GNUC__
-#ifdef __STDC__
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_" #alias "\",11,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs \"" msg "\",30,0,0,0"); \
- __asm__(".stabs \"_" #sym "\",1,0,0,0")
-#else
-#define __weak_reference(sym,alias) \
- __asm__(".stabs \"_/**/alias\",11,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
-#define __warn_references(sym,msg) \
- __asm__(".stabs msg,30,0,0,0"); \
- __asm__(".stabs \"_/**/sym\",1,0,0,0")
-#endif
-#endif
-
-#endif /* !_SYS_CDEFS_H_ */
diff --git a/contrib/global/include/err.h b/contrib/global/include/err.h
deleted file mode 100644
index f03c67d45a46..000000000000
--- a/contrib/global/include/err.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)err.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _ERR_H_
-#define _ERR_H_
-
-/*
- * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two
- * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
- * of them here we may collide with the utility's includes. It's unreasonable
- * for utilities to have to include one of them to include err.h, so we get
- * _BSD_VA_LIST_ from <machine/ansi.h> and use it.
- */
-#include <ansi.h>
-#include <cdefs.h>
-
-__BEGIN_DECLS
-void err __P((int, const char *, ...)) __dead2;
-void verr __P((int, const char *, _BSD_VA_LIST_)) __dead2;
-void errx __P((int, const char *, ...)) __dead2;
-void verrx __P((int, const char *, _BSD_VA_LIST_)) __dead2;
-void warn __P((const char *, ...));
-void vwarn __P((const char *, _BSD_VA_LIST_));
-void warnx __P((const char *, ...));
-void vwarnx __P((const char *, _BSD_VA_LIST_));
-void err_set_file __P((void *));
-void err_set_exit __P((void (*)(int)));
-__END_DECLS
-
-#endif /* !_ERR_H_ */