summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/lib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/lib')
-rw-r--r--contrib/cvs/lib/fnmatch.h40
-rw-r--r--contrib/cvs/lib/getwd.c33
-rw-r--r--contrib/cvs/lib/hostname.c45
-rw-r--r--contrib/cvs/lib/md5.h15
-rw-r--r--contrib/cvs/lib/strdup.c39
-rw-r--r--contrib/cvs/lib/strippath.c80
6 files changed, 15 insertions, 237 deletions
diff --git a/contrib/cvs/lib/fnmatch.h b/contrib/cvs/lib/fnmatch.h
deleted file mode 100644
index b157347..0000000
--- a/contrib/cvs/lib/fnmatch.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details. */
-
-#ifndef _FNMATCH_H
-
-#define _FNMATCH_H 1
-
-/* Bits set in the FLAGS argument to `fnmatch'. */
-#undef FNM_PATHNAME
-#define FNM_PATHNAME (1 << 0)/* No wildcard can ever match `/'. */
-#undef FNM_NOESCAPE
-#define FNM_NOESCAPE (1 << 1)/* Backslashes don't quote special chars. */
-#undef FNM_PERIOD
-#define FNM_PERIOD (1 << 2)/* Leading `.' is matched only explicitly. */
-#undef __FNM_FLAGS
-#define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)
-
-/* Value returned by `fnmatch' if STRING does not match PATTERN. */
-#undef FNM_NOMATCH
-#define FNM_NOMATCH 1
-
-/* Match STRING against the filename pattern PATTERN,
- returning zero if it matches, FNM_NOMATCH if not. */
-#if __STDC__
-extern int fnmatch (const char *pattern, const char *string, int flags);
-#else
-extern int fnmatch ();
-#endif
-
-#endif /* fnmatch.h */
diff --git a/contrib/cvs/lib/getwd.c b/contrib/cvs/lib/getwd.c
deleted file mode 100644
index 5707dcb..0000000
--- a/contrib/cvs/lib/getwd.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* getwd.c -- get current working directory pathname
- Copyright (C) 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details. */
-
-/* Some systems which include both getwd() and getcwd() have an implementation
- of getwd() which is much faster than getcwd(). As a result, we use the
- system's getwd() if it is available */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "system.h"
-
-/* Get the current working directory into PATHNAME */
-
-char *
-getwd (pathname)
- char *pathname;
-{
- char *getcwd();
-
- return (getcwd(pathname, PATH_MAX));
-}
diff --git a/contrib/cvs/lib/hostname.c b/contrib/cvs/lib/hostname.c
deleted file mode 100644
index 7fde534..0000000
--- a/contrib/cvs/lib/hostname.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* hostname.c -- use uname() to get the name of the host
- Copyright (C) 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(STDC_HEADERS) || defined(USG)
-#include <string.h>
-#ifndef index
-#define index strchr
-#endif
-#else
-#include <strings.h>
-#endif
-
-#include <sys/utsname.h>
-
-/* Put this host's name into NAME, using at most NAMELEN characters */
-
-int
-gethostname(name, namelen)
- char *name;
- int namelen;
-{
- struct utsname ugnm;
-
- if (uname(&ugnm) < 0)
- return (-1);
-
- (void) strncpy(name, ugnm.nodename, namelen-1);
- name[namelen-1] = '\0';
-
- return (0);
-}
diff --git a/contrib/cvs/lib/md5.h b/contrib/cvs/lib/md5.h
index 876b632..3b5ba05 100644
--- a/contrib/cvs/lib/md5.h
+++ b/contrib/cvs/lib/md5.h
@@ -1,8 +1,21 @@
/* See md5.c for explanation and copyright information. */
+/*
+ * $FreeBSD$
+ */
+
#ifndef MD5_H
#define MD5_H
+#ifdef __FreeBSD__
+#define cvs_MD5Context MD5Context
+#define cvs_MD5Init MD5Init
+#define cvs_MD5Update MD5Update
+#define cvs_MD5Final MD5Final
+#define cvs_MD5Transform MD5Transform
+#include <sys/md5.h>
+#else
+
/* Unlike previous versions of this code, uint32 need not be exactly
32 bits, merely 32 bits or more. Choosing a data type which is 32
bits instead of 64 is not important; speed is considerably more
@@ -23,4 +36,6 @@ void cvs_MD5Final PROTO ((unsigned char digest[16],
struct cvs_MD5Context *context));
void cvs_MD5Transform PROTO ((cvs_uint32 buf[4], const unsigned char in[64]));
+#endif
+
#endif /* !MD5_H */
diff --git a/contrib/cvs/lib/strdup.c b/contrib/cvs/lib/strdup.c
deleted file mode 100644
index c81969d..0000000
--- a/contrib/cvs/lib/strdup.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* strdup.c -- return a newly allocated copy of a string
- Copyright (C) 1990 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef STDC_HEADERS
-#include <string.h>
-#include <stdlib.h>
-#else
-char *malloc ();
-char *strcpy ();
-#endif
-
-/* Return a newly allocated copy of STR,
- or 0 if out of memory. */
-
-char *
-strdup (str)
- char *str;
-{
- char *newstr;
-
- newstr = (char *) malloc (strlen (str) + 1);
- if (newstr)
- strcpy (newstr, str);
- return newstr;
-}
diff --git a/contrib/cvs/lib/strippath.c b/contrib/cvs/lib/strippath.c
deleted file mode 100644
index 39687f9..0000000
--- a/contrib/cvs/lib/strippath.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* strippath.c -- remove unnecessary components from a path specifier
- Copyright (C) 1992 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if STDC_HEADERS || HAVE_STRING_H
-#include <string.h>
-/* An ANSI string.h and pre-ANSI memory.h might conflict. */
-#if !STDC_HEADERS && HAVE_MEMORY_H
-#include <memory.h>
-#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
-#else /* not STDC_HJEADERS and not HAVE_STRING_H */
-#include <strings.h>
-/* memory.h and strings.h conflict on some systems. */
-#endif /* not STDC_HEADERS and not HAVE_STRING_H */
-
-#include <stdio.h>
-
-#if __STDC__
-static void remove_component(char *beginc, char *endc);
-void strip_trailing_slashes(char *path);
-#else
-static void remove_component();
-void strip_trailing_slashes();
-#endif /* __STDC__ */
-
-/* Remove unnecessary components from PATH. */
-
-void
-strip_path (path)
- char *path;
-{
- int stripped = 0;
- char *cp, *slash;
-
- for (cp = path; (slash = strchr(cp, '/')) != NULL; cp = slash)
- {
- *slash = '\0';
- if ((!*cp && (cp != path || stripped)) ||
- strcmp(cp, ".") == 0 || strcmp(cp, "/") == 0)
- {
- stripped = 1;
- remove_component(cp, slash);
- slash = cp;
- }
- else
- {
- *slash++ = '/';
- }
- }
- strip_trailing_slashes(path);
-}
-
-/* Remove the component delimited by BEGINC and ENDC from the path */
-
-static void
-remove_component (beginc, endc)
- char *beginc;
- char *endc;
-{
- for (endc++; *endc; endc++)
- *beginc++ = *endc;
- *beginc = '\0';
-}
OpenPOWER on IntegriCloud