Skip to content

Commit e425bd7

Browse files
authored
move pygetopt.h to internal (closes bpo-32264) (python#4830)
1 parent f74ef45 commit e425bd7

File tree

8 files changed

+25
-34
lines changed

8 files changed

+25
-34
lines changed

Include/internal/pygetopt.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#ifndef Py_INTERNAL_PYGETOPT_H
2+
#define Py_INTERNAL_PYGETOPT_H
3+
4+
int _PyOS_opterr;
5+
int _PyOS_optind;
6+
wchar_t *_PyOS_optarg;
7+
8+
void _PyOS_ResetGetOpt(void);
9+
10+
typedef struct {
11+
const wchar_t *name;
12+
int has_arg;
13+
int val;
14+
} _PyOS_LongOption;
15+
16+
int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring,
17+
const _PyOS_LongOption *longopts, int *longindex);
18+
19+
#endif /* !Py_INTERNAL_PYGETOPT_H */

Include/pygetopt.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,6 @@ PYTHON_HEADERS= \
987987
$(srcdir)/Include/pyhash.h \
988988
$(srcdir)/Include/pylifecycle.h \
989989
$(srcdir)/Include/pymath.h \
990-
$(srcdir)/Include/pygetopt.h \
991990
$(srcdir)/Include/pymacro.h \
992991
$(srcdir)/Include/pymem.h \
993992
$(srcdir)/Include/pyport.h \
@@ -1017,6 +1016,7 @@ PYTHON_HEADERS= \
10171016
$(srcdir)/Include/internal/ceval.h \
10181017
$(srcdir)/Include/internal/gil.h \
10191018
$(srcdir)/Include/internal/mem.h \
1019+
$(srcdir)/Include/internal/pygetopt.h \
10201020
$(srcdir)/Include/internal/pystate.h \
10211021
$(srcdir)/Include/internal/warnings.h \
10221022
$(DTRACE_HEADERS)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Moved the pygetopt.h header into internal/, since it has no public APIs.

Modules/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "Python.h"
44
#include "osdefs.h"
55
#include "internal/import.h"
6+
#include "internal/pygetopt.h"
67
#include "internal/pystate.h"
78

89
#include <locale.h>
@@ -27,8 +28,6 @@
2728
#define PYTHONHOMEHELP "<prefix>/lib/pythonX.X"
2829
#endif
2930

30-
#include "pygetopt.h"
31-
3231
#define COPYRIGHT \
3332
"Type \"help\", \"copyright\", \"credits\" or \"license\" " \
3433
"for more information."

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
<ClInclude Include="..\Include\pyerrors.h" />
151151
<ClInclude Include="..\Include\pyexpat.h" />
152152
<ClInclude Include="..\Include\pyfpe.h" />
153-
<ClInclude Include="..\Include\pygetopt.h" />
153+
<ClInclude Include="..\Include\internal\pygetopt.h" />
154154
<ClInclude Include="..\Include\pylifecycle.h" />
155155
<ClInclude Include="..\Include\pymath.h" />
156156
<ClInclude Include="..\Include\pytime.h" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
<ClInclude Include="..\Include\pyfpe.h">
235235
<Filter>Include</Filter>
236236
</ClInclude>
237-
<ClInclude Include="..\Include\pygetopt.h">
237+
<ClInclude Include="..\Include\internal\pygetopt.h">
238238
<Filter>Include</Filter>
239239
</ClInclude>
240240
<ClInclude Include="..\Include\pylifecycle.h">

Python/getopt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <stdio.h>
3232
#include <string.h>
3333
#include <wchar.h>
34-
#include <pygetopt.h>
34+
#include "internal/pygetopt.h"
3535

3636
#ifdef __cplusplus
3737
extern "C" {

0 commit comments

Comments
 (0)