Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export getopt, getopt_long, and getopt_long_only functions along with optreset global var #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'wingetopt',
'c',
version: '0.95',
version: '1.00',
license : ['ISC', 'BSD-3-Clause'],
meson_version: '>= 0.55',
default_options: [
Expand Down
6 changes: 3 additions & 3 deletions src/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ getopt_internal(int nargc, char * const *nargv, const char *options,
*
* [eventually this will replace the BSD getopt]
*/
int
WINGETOPT_API int
getopt(int nargc, char * const *nargv, const char *options)
{

Expand All @@ -539,7 +539,7 @@ getopt(int nargc, char * const *nargv, const char *options)
* getopt_long --
* Parse argc/argv argument vector.
*/
int
WINGETOPT_API int
getopt_long(int nargc, char * const *nargv, const char *options,
const struct option *long_options, int *idx)
{
Expand All @@ -552,7 +552,7 @@ getopt_long(int nargc, char * const *nargv, const char *options,
* getopt_long_only --
* Parse argc/argv argument vector.
*/
int
WINGETOPT_API int
getopt_long_only(int nargc, char * const *nargv, const char *options,
const struct option *long_options, int *idx)
{
Expand Down
8 changes: 4 additions & 4 deletions src/getopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ WINGETOPT_API extern int opterr; /* flag to enable built-in diagnostics... */

WINGETOPT_API extern char *optarg; /* pointer to argument of current option */

extern int getopt(int nargc, char * const *nargv, const char *options);
WINGETOPT_API extern int getopt(int nargc, char * const *nargv, const char *options);

#ifdef _BSD_SOURCE
/*
Expand All @@ -46,7 +46,7 @@ extern int getopt(int nargc, char * const *nargv, const char *options);
* to maintain portability, developers are advised to avoid it.
*/
# define optreset __mingw_optreset
extern int optreset;
WINGETOPT_API extern int optreset;
#endif
#ifdef __cplusplus
}
Expand Down Expand Up @@ -84,9 +84,9 @@ enum /* permitted values for its `has_arg' field... */
optional_argument /* option may take an argument */
};

extern int getopt_long(int nargc, char * const *nargv, const char *options,
WINGETOPT_API extern int getopt_long(int nargc, char * const *nargv, const char *options,
const struct option *long_options, int *idx);
extern int getopt_long_only(int nargc, char * const *nargv, const char *options,
WINGETOPT_API extern int getopt_long_only(int nargc, char * const *nargv, const char *options,
const struct option *long_options, int *idx);
/*
* Previous MinGW implementation had...
Expand Down