diff options
Diffstat (limited to 'lib/libcompat')
-rw-r--r-- | lib/libcompat/4.1/ascftime.c | 46 | ||||
-rw-r--r-- | lib/libcompat/4.1/cftime.3 | 105 | ||||
-rw-r--r-- | lib/libcompat/4.1/cftime.c | 47 | ||||
-rw-r--r-- | lib/libcompat/4.1/getpw.3 | 88 | ||||
-rw-r--r-- | lib/libcompat/4.1/getpw.c | 53 | ||||
-rw-r--r-- | lib/libcompat/4.3/cfree.3 | 49 | ||||
-rw-r--r-- | lib/libcompat/4.3/cfree.c | 44 | ||||
-rw-r--r-- | lib/libcompat/Makefile | 11 |
8 files changed, 4 insertions, 439 deletions
diff --git a/lib/libcompat/4.1/ascftime.c b/lib/libcompat/4.1/ascftime.c deleted file mode 100644 index cfb90af..0000000 --- a/lib/libcompat/4.1/ascftime.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1994 Joerg Wunsch - * - * All rights reserved. - * - * This program is free software. - * - * 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 Joerg Wunsch - * 4. The name of the developer may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. - * - * $FreeBSD$ - */ - -#include <time.h> - -#define MAXLEN 1000 /* just a guess, only the user knows... */ - -int -ascftime(char *s, const char *format, const struct tm *tmptr) -{ - - return (strftime(s, MAXLEN, format? format: "%C", tmptr)); -} diff --git a/lib/libcompat/4.1/cftime.3 b/lib/libcompat/4.1/cftime.3 deleted file mode 100644 index dd21e78..0000000 --- a/lib/libcompat/4.1/cftime.3 +++ /dev/null @@ -1,105 +0,0 @@ -.\" -.\" Copyright (c) 1994, 1995 Joerg Wunsch -.\" -.\" All rights reserved. -.\" -.\" This program is free software. -.\" -.\" 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 Joerg Wunsch -.\" 4. The name of the developer may not be used to endorse or promote -.\" products derived from this software without specific prior written -.\" permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. -.\" -.\" -.\" $FreeBSD$ -.\" -.Dd June 15, 1993 -.Dt CFTIME 3 -.Os -.Sh NAME -.Nm cftime , -.Nm ascftime -.Nd convert date and time to string -.Sh LIBRARY -.Lb libcompat -.Sh SYNOPSIS -.In time.h -.Ft int -.Fn cftime "char *s" "char *format" "const time_t *clock" -.Ft int -.Fn ascftime "char *s" "const char *format" "const struct tm *tmptr" -.Sh DESCRIPTION -.Bf -symbolic -The -.Fn cftime -and -.Fn ascftime -functions are made obsolete by -.Xr strftime 3 . -.Ef -.Pp -Use of the functions -.Fn cftime -and -.Fn ascftime -is strongly deprecated, since there is no way to check for a buffer -overflow condition. -Use -.Xr strftime 3 -instead. -.Pp -The -.Fn ascftime -function is almost identical to -.Xr strftime 3 , -with the only exception that there is no parameter to tell about the -maximal buffer length, and the -.Fa format -parameter defaults to -.Dq %C -if a -.Em NULL -pointer is given. -.Pp -The -.Fn cftime -function does the same job, but it first invokes -.Xr localtime 3 -in order to convert the given -.Fa clock , -then also performs the conversions as requested by the -.Fa format -argument. -.Sh RETURN VALUES -The -.Fn cftime -and -.Fn ascftime -functions return the number of characters written to the output -buffer -.Fa s , -not counting the trailing null character. -.Sh SEE ALSO -.Xr localtime 3 , -.Xr strftime 3 diff --git a/lib/libcompat/4.1/cftime.c b/lib/libcompat/4.1/cftime.c deleted file mode 100644 index 41275b6..0000000 --- a/lib/libcompat/4.1/cftime.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1994 Joerg Wunsch - * - * All rights reserved. - * - * This program is free software. - * - * 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 Joerg Wunsch - * 4. The name of the developer may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. - * - * $FreeBSD$ - */ - -#include <time.h> - -#define MAXLEN 1000 /* just a guess, only the user knows... */ - -int -cftime(char *s, char *format, const time_t *clock) -{ - - return (strftime(s, MAXLEN, format? format: "%C", localtime(clock))); -} - diff --git a/lib/libcompat/4.1/getpw.3 b/lib/libcompat/4.1/getpw.3 deleted file mode 100644 index ff3bd39..0000000 --- a/lib/libcompat/4.1/getpw.3 +++ /dev/null @@ -1,88 +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. -.\" 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. -.\" -.\" @(#)getpw.3 8.1 (Berkeley) 6/4/93 -.\" $FreeBSD$ -.\" -.Dd June 4, 1993 -.Dt GETPW 3 -.Os -.Sh NAME -.Nm getpw -.Nd get name from uid -.Sh LIBRARY -.Lb libcompat -.Sh SYNOPSIS -.In sys/types.h -.Ft int -.Fn getpw "uid_t uid" "char *buf" -.Sh DESCRIPTION -.Bf -symbolic -The -.Fn getpw -function is made obsolete by -.Xr getpwuid 3 . -.Ef -.Pp -The -.Fn getpw -function reads the file -.Pa /etc/passwd , -and if it finds -the specified -.Fa uid , -copies the password entry line into the string pointed to by -.Fa buf . -the null terminated entry line from the password database, -and appends the -.Dv NUL -character. -.Sh RETURN VALUES -The -.Fn getpw -function returns the zero if successful, otherwise -a non-zero if the entry does not exist. -.Sh FILES -.Bl -tag -width /etc/passwd -compact -.It Pa /etc/passwd -.El -.Sh SEE ALSO -.Xr getpwent 3 , -.Xr passwd 5 -.Sh HISTORY -A -.Fn getpw -function appeared in -.At v6 . -.Sh BUGS -The area pointed to by -.Fa buf -must be large enough to hold the user name. -.Pp -All of the bugs from -.Xr getpwent 3 -hold valid as well. diff --git a/lib/libcompat/4.1/getpw.c b/lib/libcompat/4.1/getpw.c deleted file mode 100644 index 7c66c8f..0000000 --- a/lib/libcompat/4.1/getpw.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1995 Joerg Wunsch - * - * 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 Joerg Wunsch - * 4. The name of the developer may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. - * - * $FreeBSD$ - */ - -#include <sys/types.h> -#include <pwd.h> -#include <string.h> -#include <stdio.h> - -int -getpw(uid_t uid, char *buf) -{ - struct passwd *pw; - - pw = getpwuid(uid); - endpwent(); - - if (pw == 0) - return (-1); - - strncpy(buf, pw->pw_name, L_cuserid); - return (0); -} diff --git a/lib/libcompat/4.3/cfree.3 b/lib/libcompat/4.3/cfree.3 deleted file mode 100644 index 4d380e4..0000000 --- a/lib/libcompat/4.3/cfree.3 +++ /dev/null @@ -1,49 +0,0 @@ -.\" -.\" Copyright (c) 1995 Joerg Wunsch -.\" -.\" 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. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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. -.\" -.\" $FreeBSD$ -.\" " <- this is for hilit19 :) -.Dd November 23, 1995 -.Dt CFREE 3 -.Os -.Sh NAME -.Nm cfree -.Nd free up allocated memory -.Sh LIBRARY -.Lb libcompat -.Sh SYNOPSIS -.Ft void -.Fn cfree "void *" -.Sh DESCRIPTION -.Bf -symbolic -The cfree function considered obsolete. -.Ef -.Pp -The -.Nm -function is a synonym for -.Xr free 3 . -.Sh SEE ALSO -.Xr free 3 diff --git a/lib/libcompat/4.3/cfree.c b/lib/libcompat/4.3/cfree.c deleted file mode 100644 index 7a7baad..0000000 --- a/lib/libcompat/4.3/cfree.c +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * Copyright (c) 1992, 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. - * 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)cfree.c 8.1 (Berkeley) 6/4/93"; -#endif /* LIBC_SCCS and not lint */ - -#include <stdlib.h> - -void -cfree(void *p) -{ - - free(p); -} diff --git a/lib/libcompat/Makefile b/lib/libcompat/Makefile index 35ced5f..fca86c7 100644 --- a/lib/libcompat/Makefile +++ b/lib/libcompat/Makefile @@ -10,17 +10,14 @@ WARNS?= 0 .PATH: ${.CURDIR}/4.1 ${.CURDIR}/4.3 ${.CURDIR}/4.4 # compat 4.1 sources -SRCS+= ascftime.c cftime.c ftime.c getpw.c +SRCS+= ftime.c -MAN+= 4.1/ftime.3 4.1/getpw.3 -MAN+= 4.1/cftime.3 - -MLINKS+=cftime.3 ascftime.3 +MAN+= 4.1/ftime.3 # compat 4.3 sources -SRCS+= cfree.c re_comp.c rexec.c +SRCS+= re_comp.c rexec.c -MAN+= 4.3/cfree.3 4.3/re_comp.3 4.3/rexec.3 +MAN+= 4.3/re_comp.3 4.3/rexec.3 MLINKS+=re_comp.3 re_exec.3 |