Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
6880f37f
Commit
6880f37f
authored
Oct 20, 1998
by
Kurt Zeilenga
Browse files
modified for OpenLDAP
parent
b2ccd693
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblutil/getopt.c
View file @
6880f37f
...
...
@@ -2,33 +2,24 @@
getopt.c
modified public-domain AT&T getopt(3)
modified by Kurt Zeilenga for inclusion into OpenLDAP
*/
#include
"portable.h"
#ifndef HAVE_GETOPT
#include
<stdio.h>
#include
<string.h>
#ifdef _POSIX_SOURCE
# include <unistd.h>
#else
# define STDERR_FILENO 2
# ifdef __STDC__
extern
int
write
(
int
fildes
,
char
*
buf
,
unsigned
nbyte
);
# else
extern
int
write
();
# endif
#endif
#include
<ac/string.h>
#include
<ac/unistd.h>
int
opterr
=
1
;
int
optind
=
1
;
int
optopt
;
char
*
optarg
;
#ifdef __STDC__
static
void
ERR
(
char
**
argv
,
char
*
s
,
char
c
)
#else
static
void
ERR
(
argv
,
s
,
c
)
char
**
argv
,
*
s
,
c
;
#endif
static
void
ERR
(
char
**
argv
,
char
*
s
,
char
c
)
{
char
errbuf
[
2
];
...
...
@@ -45,13 +36,7 @@ printf("DF_TRACE_DEBUG: static void ERR () in getopt.c\n");
}
}
#ifdef __STDC__
int
getopt
(
int
argc
,
char
**
argv
,
char
*
opts
)
#else
int
getopt
(
argc
,
argv
,
opts
)
int
argc
;
char
**
argv
,
*
opts
;
#endif
int
getopt
(
int
argc
,
char
**
argv
,
char
*
opts
)
{
static
int
sp
=
1
,
error
=
(
int
)
'?'
;
static
char
sw
=
'-'
,
eos
=
'\0'
,
arg
=
':'
;
...
...
@@ -106,3 +91,4 @@ printf("DF_TRACE_DEBUG: int getopt () in getopt.c\n");
}
return
(
int
)
c
;
}
#endif
/* HAVE_GETOPT */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment