diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-04-02 20:03:32 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-04-02 23:01:48 +0200 |
commit | d76eb9dd46081279642d3353f51ebc09fe4bbe9f (patch) | |
tree | 1841a5e9016b760a6e0c6592dc85b0e4879d11c0 /include | |
parent | a772248e1a2f0886d8479b2f14392f020ea8c6e0 (diff) |
Add a libcompat implementation of getopt
Limited to the subset actually needed. Vaguely inspired by the NetBSD
libc implementation.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/compat.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/compat.h b/include/compat.h index 5d7a052..6f8a77d 100644 --- a/include/compat.h +++ b/include/compat.h @@ -197,6 +197,13 @@ char *strndup(const char *str, size_t max_len); int getsubopt(char **opt, char *const *keys, char **val); #endif +#ifndef HAVE_GETOPT +extern int optind; +extern char *optarg; + +int getopt(int argc, char *const argv[], const char *optstr); +#endif + #if defined(_WIN32) || defined(__WINDOWS__) WCHAR *path_to_windows(const char *input); #endif |