mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 03:08:38 +01:00
Add bsd_getopt
This commit is contained in:
parent
7a8c1c8648
commit
7aed0593e0
@ -1,3 +1,11 @@
|
||||
2006-02-13 Robert Millan <rmh@aybabtu.com>
|
||||
|
||||
Add bsd_getopt.
|
||||
* bsd_getopt.c: New.
|
||||
* include/bsd/getopt.h: New.
|
||||
* Versions: Add bsd_getopt and optreset.
|
||||
* Makefile: Add bsd_getopt.c and include/bsd/getopt.h.
|
||||
|
||||
2006-02-10 Robert Millan <rmh@aybabtu.com>
|
||||
|
||||
Add errc, warnc, verrc and vwarnc.
|
||||
|
4
Makefile
4
Makefile
@ -4,9 +4,9 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
LIB_SRCS = arc4random.c err.c fgetln.c inet_net_pton.c strlcat.c strlcpy.c md5c.c fmtcheck.c
|
||||
LIB_SRCS = arc4random.c bsd_getopt.c err.c fgetln.c inet_net_pton.c strlcat.c strlcpy.c md5c.c fmtcheck.c
|
||||
|
||||
LIB_INCLUDES = include/bsd/err.h include/bsd/ip_icmp.h include/bsd/random.h include/bsd/queue.h include/bsd/md5.h include/bsd/string.h include/bsd/bsd.h include/bsd/stdlib.h
|
||||
LIB_INCLUDES = include/bsd/err.h include/bsd/getopt.h include/bsd/ip_icmp.h include/bsd/random.h include/bsd/queue.h include/bsd/md5.h include/bsd/string.h include/bsd/bsd.h include/bsd/stdlib.h
|
||||
|
||||
LIB_MANS = man/arc4random.3 man/strlcpy.3 man/fgetln.3 man/fmtcheck.3
|
||||
|
||||
|
1
Versions
1
Versions
@ -1,6 +1,7 @@
|
||||
LIBBSD_0.0 {
|
||||
global:
|
||||
arc4random;
|
||||
bsd_getopt; optreset;
|
||||
errc; warnc; verrc; vwarnc;
|
||||
fgetln;
|
||||
fgetwln;
|
||||
|
15
bsd_getopt.c
Normal file
15
bsd_getopt.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <bsd/getopt.h>
|
||||
|
||||
int optreset = 0;
|
||||
|
||||
int
|
||||
bsd_getopt (int argc, char **argv, char *shortopts)
|
||||
{
|
||||
if (optreset == 1)
|
||||
{
|
||||
optreset = 0;
|
||||
optind = 0;
|
||||
}
|
||||
|
||||
return getopt (argc, argv, shortopts);
|
||||
}
|
4
include/bsd/getopt.h
Normal file
4
include/bsd/getopt.h
Normal file
@ -0,0 +1,4 @@
|
||||
#include <getopt.h>
|
||||
extern int optreset;
|
||||
|
||||
int bsd_getopt (int, char **, char *);
|
Loading…
Reference in New Issue
Block a user