summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-08-20 04:02:19 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-08-20 04:02:19 +0000
commita1e70df20cae2626fb6865651bf880c5efc935b0 (patch)
treecc74cde42b14f94eec31767889c44cc44958f1ea /lib/libc
parent67eccf19d86af151b84fdf0a25a8e721bb0ad0e2 (diff)
Move getsubopt(3) to stdlib like lite2 and XPG4.2 say...
Update man page from lite2 while I'm at it.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/Makefile.inc6
-rw-r--r--lib/libc/stdlib/Makefile.inc12
-rw-r--r--lib/libc/stdlib/getsubopt.3 (renamed from lib/libc/gen/getsubopt.3)17
-rw-r--r--lib/libc/stdlib/getsubopt.c (renamed from lib/libc/gen/getsubopt.c)16
4 files changed, 30 insertions, 21 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 1d7a9745697..e1783fa9989 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.12 1997/08/17 21:31:19 millert Exp $
+# $OpenBSD: Makefile.inc,v 1.13 1997/08/20 04:02:15 millert Exp $
# gen sources
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/gen ${.CURDIR}/gen
@@ -8,7 +8,7 @@ SRCS+= alarm.c assert.c basename.c clock.c closedir.c confstr.c ctermid.c \
errx.c errlist.c errno.c exec.c fnmatch.c fstab.c ftok.c fts.c \
getbsize.c getcap.c getcwd.c getdomainname.c getgrent.c \
getgrouplist.c gethostname.c getloadavg.c getlogin.c getmntinfo.c \
- getnetgrent.c getpagesize.c getpass.c getpwent.c getsubopt.c \
+ getnetgrent.c getpagesize.c getpass.c getpwent.c \
getttyent.c getusershell.c glob.c initgroups.c isatty.c isctype.c \
nice.c nlist.c opendir.c pause.c popen.c psignal.c pwcache.c raise.c \
readdir.c rewinddir.c scandir.c seekdir.c setdomainname.c \
@@ -47,7 +47,7 @@ MAN+= alarm.3 basename.3 clock.3 confstr.3 ctermid.3 ctype.3 daemon.3 \
getbsize.3 getcap.3 getcwd.3 getdomainname.3 getdiskbyname.3 \
getfsent.3 getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \
getmntinfo.3 getnetgrent.3 getpagesize.3 getpass.3 getpwent.3 \
- getsubopt.3 getttyent.3 getusershell.3 glob.3 initgroups.3 isalnum.3 \
+ getttyent.3 getusershell.3 glob.3 initgroups.3 isalnum.3 \
isalpha.3 isascii.3 isblank.3 iscntrl.3 isdigit.3 isgraph.3 isinf.3 \
islower.3 isprint.3 ispunct.3 isspace.3 isupper.3 isxdigit.3 \
ldexp.3 modf.3 nice.3 nlist.3 pause.3 popen.3 psignal.3 pwcache.3 \
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index fe343587f90..e75fc0d8bf1 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -4,10 +4,10 @@
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/stdlib ${.CURDIR}/stdlib
SRCS+= a64l.c abort.c atexit.c atoi.c atof.c atol.c bsearch.c calloc.c \
- cfree.c exit.c getenv.c getopt.c heapsort.c l64a.c malloc.c merge.c \
- multibyte.c putenv.c qsort.c radixsort.c rand.c random.c realpath.c \
- setenv.c strtod.c strtol.c strtoq.c strtoul.c strtouq.c system.c \
- tfind.c tsearch.c \
+ cfree.c exit.c getenv.c getopt.c getsubopt.c heapsort.c l64a.c \
+ malloc.c merge.c multibyte.c putenv.c qsort.c radixsort.c rand.c \
+ random.c realpath.c setenv.c strtod.c strtol.c strtoq.c strtoul.c \
+ strtouq.c system.c tfind.c tsearch.c \
_rand48.c drand48.c erand48.c jrand48.c lcong48.c lrand48.c \
mrand48.c nrand48.c seed48.c srand48.c qabs.c qdiv.c
@@ -33,8 +33,8 @@ SRCS+= abs.c div.c labs.c ldiv.c
.endif
MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
- calloc.3 div.3 exit.3 getenv.3 getopt.3 labs.3 ldiv.3 malloc.3 \
- memory.3 qabs.3 qdiv.3 qsort.3 radixsort.3 rand48.3 rand.3 \
+ calloc.3 div.3 exit.3 getenv.3 getopt.3 getsubopt.3 labs.3 ldiv.3 \
+ malloc.3 memory.3 qabs.3 qdiv.3 qsort.3 radixsort.3 rand48.3 rand.3 \
random.3 realpath.3 strtod.3 strtol.3 strtoul.3 system.3 tsearch.3
MLINKS+=getenv.3 setenv.3 getenv.3 unsetenv.3 getenv.3 putenv.3
diff --git a/lib/libc/gen/getsubopt.3 b/lib/libc/stdlib/getsubopt.3
index ac3ee0b5d4a..06e089203f1 100644
--- a/lib/libc/gen/getsubopt.3
+++ b/lib/libc/stdlib/getsubopt.3
@@ -1,7 +1,7 @@
-.\" $OpenBSD: getsubopt.3,v 1.2 1996/08/19 08:24:04 tholo Exp $
+.\" $OpenBSD: getsubopt.3,v 1.1 1997/08/20 04:02:17 millert Exp $
.\"
-.\" Copyright (c) 1990, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1990, 1991, 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
@@ -31,19 +31,23 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 31, 1991
+.\" @(#)getsubopt.3 8.1 (Berkeley) 6/9/93
+.\"
+.Dd June 9, 1993
.Dt GETSUBOPT 3
.Os
.Sh NAME
.Nm getsubopt
.Nd get sub options from an argument
.Sh SYNOPSIS
-.Fd #include <stdio.h>
+.Fd #include <stdlib.h>
+.Vt extern char *suboptarg
.Ft int
.Fn getsubopt "char **optionp" "char * const *tokens" "char **valuep"
.Sh DESCRIPTION
The
.Fn getsubopt
+function
parses a string containing tokens delimited by one or more tab, space or
comma
.Pq Ql \&,
@@ -140,5 +144,4 @@ while ((ch = getopt(argc, argv, "ab:")) != \-1) {
.Sh HISTORY
The
.Fn getsubopt
-function is
-.Ud .
+function first appeared in 4.4BSD.
diff --git a/lib/libc/gen/getsubopt.c b/lib/libc/stdlib/getsubopt.c
index b5933ae3390..1667a31d7da 100644
--- a/lib/libc/gen/getsubopt.c
+++ b/lib/libc/stdlib/getsubopt.c
@@ -1,6 +1,8 @@
+/* $OpenBSD: getsubopt.c,v 1.1 1997/08/20 04:02:17 millert Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * 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
@@ -31,9 +33,13 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getsubopt.c,v 1.2 1996/08/19 08:24:06 tholo Exp $";
-#endif /* LIBC_SCCS and not lint */
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)getsubopt.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$OpenBSD: getsubopt.c,v 1.1 1997/08/20 04:02:17 millert Exp $";
+#endif
+#endif /* not lint */
#include <unistd.h>
#include <stdlib.h>