diff options
author | Thomas Wouters <thomas@python.org> | 2000-11-03 08:18:37 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2000-11-03 08:18:37 (GMT) |
commit | 2cffc7d4202fc1197280a05d998075551b459283 (patch) | |
tree | 7c5d86617226e1517840a60c44bd21183160b3e0 /Include/pygetopt.h | |
parent | 9dce7b3737c456f3c6f56f1f57c29b3c3b6b20aa (diff) | |
download | cpython-2cffc7d4202fc1197280a05d998075551b459283.zip cpython-2cffc7d4202fc1197280a05d998075551b459283.tar.gz cpython-2cffc7d4202fc1197280a05d998075551b459283.tar.bz2 |
Move our own getopt() implementation to _PyOS_GetOpt(), and use it
regardless of whether the system getopt() does what we want. This avoids the
hassle with prototypes and externs, and the check to see if the system
getopt() does what we want. Prefix optind, optarg and opterr with _PyOS_ to
avoid name clashes. Add new include file to define the right symbols. Fix
Demo/pyserv/pyserv.c to include getopt.h itself, instead of relying on
Python to provide it.
Diffstat (limited to 'Include/pygetopt.h')
-rw-r--r-- | Include/pygetopt.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Include/pygetopt.h b/Include/pygetopt.h new file mode 100644 index 0000000..9c74cbe --- /dev/null +++ b/Include/pygetopt.h @@ -0,0 +1,17 @@ + +#ifndef Py_PYGETOPT_H +#define Py_PYGETOPT_H +#ifdef __cplusplus +extern "C" { +#endif + +extern DL_IMPORT(int) _PyOS_opterr; +extern DL_IMPORT(int) _PyOS_optind; +extern DL_IMPORT(char *) _PyOS_optarg; + +DL_IMPORT(int) _PyOS_GetOpt(int argc, char **argv, char *optstring); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYGETOPT_H */ |