roken: Prototype getopt
Add a prototype for getopt to the roken.h header, and fix the function definition in getopt.c to be ANSI, rather than K&Rs style.
This commit is contained in:

committed by
Simon Wilkinson

parent
0cc7b890e2
commit
f317b91b1b
@@ -55,10 +55,7 @@ ROKEN_LIB_VARIABLE char *optarg; /* argument associated with option */
|
|||||||
#define EMSG ""
|
#define EMSG ""
|
||||||
|
|
||||||
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
|
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
|
||||||
getopt(nargc, nargv, ostr)
|
getopt(int nargc, char * const *nargv, const char *ostr)
|
||||||
int nargc;
|
|
||||||
char * const *nargv;
|
|
||||||
const char *ostr;
|
|
||||||
{
|
{
|
||||||
static char *place = EMSG; /* option letter processing */
|
static char *place = EMSG; /* option letter processing */
|
||||||
char *oli; /* option letter list index */
|
char *oli; /* option letter list index */
|
||||||
|
@@ -765,6 +765,15 @@ ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL get_window_size(int fd, struct winsize *);
|
|||||||
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL vsyslog(int, const char *, va_list);
|
ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL vsyslog(int, const char *, va_list);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_GETOPT
|
||||||
|
#define getopt rk_getopt
|
||||||
|
#define optarg rk_optarg
|
||||||
|
#define optind rk_optind
|
||||||
|
#define opterr rk_opterr
|
||||||
|
ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
|
||||||
|
getopt(int nargc, char * const *nargv, const char *ostr);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !HAVE_DECL_OPTARG
|
#if !HAVE_DECL_OPTARG
|
||||||
ROKEN_LIB_VARIABLE extern char *optarg;
|
ROKEN_LIB_VARIABLE extern char *optarg;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user