]> granicus.if.org Git - python/commitdiff
move pygetopt.h to internal (closes bpo-32264) (#4830)
authorBenjamin Peterson <benjamin@python.org>
Fri, 15 Dec 2017 07:48:12 +0000 (23:48 -0800)
committerGitHub <noreply@github.com>
Fri, 15 Dec 2017 07:48:12 +0000 (23:48 -0800)
Include/internal/pygetopt.h [new file with mode: 0644]
Include/pygetopt.h [deleted file]
Makefile.pre.in
Misc/NEWS.d/next/C API/2017-12-12-23-09-46.bpo-32264.ahRlOI.rst [new file with mode: 0644]
Modules/main.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/getopt.c

diff --git a/Include/internal/pygetopt.h b/Include/internal/pygetopt.h
new file mode 100644 (file)
index 0000000..df6f183
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef Py_INTERNAL_PYGETOPT_H
+#define Py_INTERNAL_PYGETOPT_H
+
+int _PyOS_opterr;
+int _PyOS_optind;
+wchar_t *_PyOS_optarg;
+
+void _PyOS_ResetGetOpt(void);
+
+typedef struct {
+    const wchar_t *name;
+    int has_arg;
+    int val;
+} _PyOS_LongOption;
+
+int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring,
+                 const _PyOS_LongOption *longopts, int *longindex);
+
+#endif /* !Py_INTERNAL_PYGETOPT_H */
diff --git a/Include/pygetopt.h b/Include/pygetopt.h
deleted file mode 100644 (file)
index 3e3fe36..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-
-#ifndef Py_PYGETOPT_H
-#define Py_PYGETOPT_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef Py_LIMITED_API
-PyAPI_DATA(int) _PyOS_opterr;
-PyAPI_DATA(int) _PyOS_optind;
-PyAPI_DATA(wchar_t *) _PyOS_optarg;
-
-PyAPI_FUNC(void) _PyOS_ResetGetOpt(void);
-
-typedef struct {
-    const wchar_t *name;
-    int has_arg;
-    int val;
-} _PyOS_LongOption;
-
-PyAPI_FUNC(int) _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring,
-                             const _PyOS_LongOption *longopts, int *longindex);
-#endif /* !Py_LIMITED_API */
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_PYGETOPT_H */
index fcce62f257780669f764cedf21ca9495783c731a..4fe9affe0d25e9e4bc838ef0067b74970d06e26a 100644 (file)
@@ -987,7 +987,6 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/pyhash.h \
                $(srcdir)/Include/pylifecycle.h \
                $(srcdir)/Include/pymath.h \
-               $(srcdir)/Include/pygetopt.h \
                $(srcdir)/Include/pymacro.h \
                $(srcdir)/Include/pymem.h \
                $(srcdir)/Include/pyport.h \
@@ -1017,6 +1016,7 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/internal/ceval.h \
                $(srcdir)/Include/internal/gil.h \
                $(srcdir)/Include/internal/mem.h \
+               $(srcdir)/Include/internal/pygetopt.h \
                $(srcdir)/Include/internal/pystate.h \
                $(srcdir)/Include/internal/warnings.h \
                $(DTRACE_HEADERS)
diff --git a/Misc/NEWS.d/next/C API/2017-12-12-23-09-46.bpo-32264.ahRlOI.rst b/Misc/NEWS.d/next/C API/2017-12-12-23-09-46.bpo-32264.ahRlOI.rst
new file mode 100644 (file)
index 0000000..5033d61
--- /dev/null
@@ -0,0 +1 @@
+Moved the pygetopt.h header into internal/, since it has no public APIs.
index 339a0f5e681281c24430a9ae368b0bdb03edd713..6b602cf9b77543b32b460eb25cf817734a0da755 100644 (file)
@@ -3,6 +3,7 @@
 #include "Python.h"
 #include "osdefs.h"
 #include "internal/import.h"
+#include "internal/pygetopt.h"
 #include "internal/pystate.h"
 
 #include <locale.h>
@@ -27,8 +28,6 @@
 #define PYTHONHOMEHELP "<prefix>/lib/pythonX.X"
 #endif
 
-#include "pygetopt.h"
-
 #define COPYRIGHT \
     "Type \"help\", \"copyright\", \"credits\" or \"license\" " \
     "for more information."
index 1dca3ccca1d17fa988a861cd581bf02965ffae2c..25651d00049f2701b051956eb3abd5b0ab81e7f2 100644 (file)
     <ClInclude Include="..\Include\pyerrors.h" />
     <ClInclude Include="..\Include\pyexpat.h" />
     <ClInclude Include="..\Include\pyfpe.h" />
-    <ClInclude Include="..\Include\pygetopt.h" />
+    <ClInclude Include="..\Include\internal\pygetopt.h" />
     <ClInclude Include="..\Include\pylifecycle.h" />
     <ClInclude Include="..\Include\pymath.h" />
     <ClInclude Include="..\Include\pytime.h" />
index 969ba0850b2be12f1c563bf5c8084689521723e4..42b2fc3ea7c7f5a02aca529c6c1ffbc278d44b5b 100644 (file)
     <ClInclude Include="..\Include\pyfpe.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\pygetopt.h">
+    <ClInclude Include="..\Include\internal\pygetopt.h">
       <Filter>Include</Filter>
     </ClInclude>
     <ClInclude Include="..\Include\pylifecycle.h">
index de32ad4d8cb72945a2e8fe053d44fb2c8ad0a2a4..e8d7e523c2ea01ac8b96f6229d4f90e71c13b7b6 100644 (file)
@@ -31,7 +31,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <wchar.h>
-#include <pygetopt.h>
+#include "internal/pygetopt.h"
 
 #ifdef __cplusplus
 extern "C" {