1 /**
2   Mirror _pydebug.h
3   */
4 module deimos.python.pydebug;
5 
6 import core.stdc.stdlib;
7 
8 import deimos.python.pyport;
9 
10 extern(C):
11 // Python-header-file: Include/node.h
12 
13 /// _
14 mixin(PyAPI_DATA!"int Py_DebugFlag");
15 /// _
16 mixin(PyAPI_DATA!"int Py_VerboseFlag");
17 version(Python_3_0_Or_Later) {
18     mixin(PyAPI_DATA!"int Py_QuietFlag");
19 }
20 /// _
21 mixin(PyAPI_DATA!"int Py_InteractiveFlag");
22 /// _
23 mixin(PyAPI_DATA!"int Py_OptimizeFlag");
24 /// _
25 mixin(PyAPI_DATA!"int Py_NoSiteFlag");
26 
27 version(Python_3_7_Or_Later) {
28 }else{
29     /// _
30     mixin(PyAPI_DATA!"int Py_UseClassExceptionsFlag");
31 }
32 
33 /// _
34 mixin(PyAPI_DATA!"int Py_FrozenFlag");
35 version(Python_3_0_Or_Later) {
36 }else{
37     /// Availability: 2.*
38     mixin(PyAPI_DATA!"int Py_TabcheckFlag");
39     /// Availability: 2.*
40     mixin(PyAPI_DATA!"int Py_UnicodeFlag");
41 }
42 /// _
43 mixin(PyAPI_DATA!"int Py_IgnoreEnvironmentFlag");
44 /// _
45 mixin(PyAPI_DATA!"int Py_DivisionWarningFlag");
46 version(Python_2_6_Or_Later) {
47     /// Availability: >= 2.6
48     mixin(PyAPI_DATA!"int Py_DontWriteBytecodeFlag");
49     /// Availability: >= 2.6
50     mixin(PyAPI_DATA!"int Py_NoUserSiteDirectory");
51 }
52 
53 version(Python_3_0_Or_Later) {
54 }else{
55     /* _XXX Py_QnewFlag should go away in 3.0.  It's true iff -Qnew is passed,
56        on the command line, and is used in 2.2 by ceval.c to make all "/" divisions
57        true divisions (which they will be in 3.0). */
58     /// Availability: 2.*
59     mixin(PyAPI_DATA!"int _Py_QnewFlag");
60 
61     version(Python_2_6_Or_Later) {
62         /// Availability: 2.6, 2.7
63         mixin(PyAPI_DATA!"int Py_Py3kWarningFlag");
64     }
65 }
66 version(Python_3_0_Or_Later) {
67     /// Availability: 3.*
68     mixin(PyAPI_DATA!"int Py_UnbufferedStdioFlag");
69 }
70 version(Python_2_7_Or_Later) {
71     /// Availability: >= 2.7
72     mixin(PyAPI_DATA!"int Py_HashRandomizationFlag");
73 }
74 
75 version(Python_3_4_Or_Later) {
76     /// Availability: >= 3.4
77     mixin(PyAPI_DATA!"int Py_IsolatedFlag");
78 }
79 
80 version(Windows) {
81     version(Python_3_7_Or_Later) {
82         mixin(PyAPI_DATA!"int Py_LegacyWindowsFSEncodingFlag");
83     }
84     version(Python_3_6_Or_Later) {
85         mixin(PyAPI_DATA!"int Py_LegacyWindowsStdioFlag");
86     }
87 }
88 
89 /** this is a wrapper around getenv() that pays attention to
90    Py_IgnoreEnvironmentFlag.  It should be used for getting variables like
91    PYTHONPATH and PYTHONHOME from the environment */
92 char* Py_GETENV()(const(char)* s) {
93     return (Py_IgnoreEnvironmentFlag ? null : getenv(s));
94 }
95 
96 /// _
97 void Py_FatalError(const(char)* message);
98