blob: e7a72c47f6db739cf24e500f740c268c87b1af62 [file] [log] [blame]
Zachary Ware45520892015-05-13 01:22:32 -05001/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(msvcrt_heapmin__doc__,
6"heapmin($module, /)\n"
7"--\n"
8"\n"
9"Minimize the malloc() heap.\n"
10"\n"
11"Force the malloc() heap to clean itself up and return unused blocks\n"
12"to the operating system. On failure, this raises OSError.");
13
14#define MSVCRT_HEAPMIN_METHODDEF \
15 {"heapmin", (PyCFunction)msvcrt_heapmin, METH_NOARGS, msvcrt_heapmin__doc__},
16
17static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030018msvcrt_heapmin_impl(PyObject *module);
Zachary Ware45520892015-05-13 01:22:32 -050019
20static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030021msvcrt_heapmin(PyObject *module, PyObject *Py_UNUSED(ignored))
Zachary Ware45520892015-05-13 01:22:32 -050022{
23 return msvcrt_heapmin_impl(module);
24}
25
26PyDoc_STRVAR(msvcrt_locking__doc__,
27"locking($module, fd, mode, nbytes, /)\n"
28"--\n"
29"\n"
30"Lock part of a file based on file descriptor fd from the C runtime.\n"
31"\n"
32"Raises IOError on failure. The locked region of the file extends from\n"
33"the current file position for nbytes bytes, and may continue beyond\n"
34"the end of the file. mode must be one of the LK_* constants listed\n"
35"below. Multiple regions in a file may be locked at the same time, but\n"
36"may not overlap. Adjacent regions are not merged; they must be unlocked\n"
37"individually.");
38
39#define MSVCRT_LOCKING_METHODDEF \
40 {"locking", (PyCFunction)msvcrt_locking, METH_VARARGS, msvcrt_locking__doc__},
41
42static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030043msvcrt_locking_impl(PyObject *module, int fd, int mode, long nbytes);
Zachary Ware45520892015-05-13 01:22:32 -050044
45static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030046msvcrt_locking(PyObject *module, PyObject *args)
Zachary Ware45520892015-05-13 01:22:32 -050047{
48 PyObject *return_value = NULL;
49 int fd;
50 int mode;
51 long nbytes;
52
Zachary Ware77772c02015-05-13 10:58:35 -050053 if (!PyArg_ParseTuple(args, "iil:locking",
Zachary Ware45520892015-05-13 01:22:32 -050054 &fd, &mode, &nbytes))
55 goto exit;
56 return_value = msvcrt_locking_impl(module, fd, mode, nbytes);
57
58exit:
59 return return_value;
60}
61
62PyDoc_STRVAR(msvcrt_setmode__doc__,
63"setmode($module, fd, mode, /)\n"
64"--\n"
65"\n"
66"Set the line-end translation mode for the file descriptor fd.\n"
67"\n"
68"To set it to text mode, flags should be os.O_TEXT; for binary, it\n"
69"should be os.O_BINARY.\n"
70"\n"
71"Return value is the previous mode.");
72
73#define MSVCRT_SETMODE_METHODDEF \
74 {"setmode", (PyCFunction)msvcrt_setmode, METH_VARARGS, msvcrt_setmode__doc__},
75
76static long
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030077msvcrt_setmode_impl(PyObject *module, int fd, int flags);
Zachary Ware45520892015-05-13 01:22:32 -050078
79static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +030080msvcrt_setmode(PyObject *module, PyObject *args)
Zachary Ware45520892015-05-13 01:22:32 -050081{
82 PyObject *return_value = NULL;
83 int fd;
84 int flags;
85 long _return_value;
86
Zachary Ware77772c02015-05-13 10:58:35 -050087 if (!PyArg_ParseTuple(args, "ii:setmode",
Zachary Ware45520892015-05-13 01:22:32 -050088 &fd, &flags))
89 goto exit;
90 _return_value = msvcrt_setmode_impl(module, fd, flags);
91 if ((_return_value == -1) && PyErr_Occurred())
92 goto exit;
93 return_value = PyLong_FromLong(_return_value);
94
95exit:
96 return return_value;
97}
98
99PyDoc_STRVAR(msvcrt_open_osfhandle__doc__,
100"open_osfhandle($module, handle, flags, /)\n"
101"--\n"
102"\n"
103"Create a C runtime file descriptor from the file handle handle.\n"
104"\n"
105"The flags parameter should be a bitwise OR of os.O_APPEND, os.O_RDONLY,\n"
106"and os.O_TEXT. The returned file descriptor may be used as a parameter\n"
107"to os.fdopen() to create a file object.");
108
109#define MSVCRT_OPEN_OSFHANDLE_METHODDEF \
110 {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_VARARGS, msvcrt_open_osfhandle__doc__},
111
112static long
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300113msvcrt_open_osfhandle_impl(PyObject *module, Py_intptr_t handle, int flags);
Zachary Ware45520892015-05-13 01:22:32 -0500114
115static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300116msvcrt_open_osfhandle(PyObject *module, PyObject *args)
Zachary Ware45520892015-05-13 01:22:32 -0500117{
118 PyObject *return_value = NULL;
119 Py_intptr_t handle;
120 int flags;
121 long _return_value;
122
Zachary Ware77772c02015-05-13 10:58:35 -0500123 if (!PyArg_ParseTuple(args, ""_Py_PARSE_INTPTR"i:open_osfhandle",
Zachary Ware45520892015-05-13 01:22:32 -0500124 &handle, &flags))
125 goto exit;
126 _return_value = msvcrt_open_osfhandle_impl(module, handle, flags);
127 if ((_return_value == -1) && PyErr_Occurred())
128 goto exit;
129 return_value = PyLong_FromLong(_return_value);
130
131exit:
132 return return_value;
133}
134
135PyDoc_STRVAR(msvcrt_get_osfhandle__doc__,
136"get_osfhandle($module, fd, /)\n"
137"--\n"
138"\n"
139"Return the file handle for the file descriptor fd.\n"
140"\n"
141"Raises IOError if fd is not recognized.");
142
143#define MSVCRT_GET_OSFHANDLE_METHODDEF \
144 {"get_osfhandle", (PyCFunction)msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__},
145
146static Py_intptr_t
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300147msvcrt_get_osfhandle_impl(PyObject *module, int fd);
Zachary Ware45520892015-05-13 01:22:32 -0500148
149static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300150msvcrt_get_osfhandle(PyObject *module, PyObject *arg)
Zachary Ware45520892015-05-13 01:22:32 -0500151{
152 PyObject *return_value = NULL;
153 int fd;
154 Py_intptr_t _return_value;
155
Zachary Ware77772c02015-05-13 10:58:35 -0500156 if (!PyArg_Parse(arg, "i:get_osfhandle", &fd))
Zachary Ware45520892015-05-13 01:22:32 -0500157 goto exit;
158 _return_value = msvcrt_get_osfhandle_impl(module, fd);
159 if ((_return_value == -1) && PyErr_Occurred())
160 goto exit;
161 return_value = PyLong_FromVoidPtr((void *)_return_value);
162
163exit:
164 return return_value;
165}
166
167PyDoc_STRVAR(msvcrt_kbhit__doc__,
168"kbhit($module, /)\n"
169"--\n"
170"\n"
171"Return true if a keypress is waiting to be read.");
172
173#define MSVCRT_KBHIT_METHODDEF \
174 {"kbhit", (PyCFunction)msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__},
175
176static long
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300177msvcrt_kbhit_impl(PyObject *module);
Zachary Ware45520892015-05-13 01:22:32 -0500178
179static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300180msvcrt_kbhit(PyObject *module, PyObject *Py_UNUSED(ignored))
Zachary Ware45520892015-05-13 01:22:32 -0500181{
182 PyObject *return_value = NULL;
183 long _return_value;
184
185 _return_value = msvcrt_kbhit_impl(module);
186 if ((_return_value == -1) && PyErr_Occurred())
187 goto exit;
188 return_value = PyLong_FromLong(_return_value);
189
190exit:
191 return return_value;
192}
193
194PyDoc_STRVAR(msvcrt_getch__doc__,
195"getch($module, /)\n"
196"--\n"
197"\n"
198"Read a keypress and return the resulting character as a byte string.\n"
199"\n"
200"Nothing is echoed to the console. This call will block if a keypress is\n"
201"not already available, but will not wait for Enter to be pressed. If the\n"
202"pressed key was a special function key, this will return \'\\000\' or\n"
203"\'\\xe0\'; the next call will return the keycode. The Control-C keypress\n"
204"cannot be read with this function.");
205
206#define MSVCRT_GETCH_METHODDEF \
207 {"getch", (PyCFunction)msvcrt_getch, METH_NOARGS, msvcrt_getch__doc__},
208
209static int
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300210msvcrt_getch_impl(PyObject *module);
Zachary Ware45520892015-05-13 01:22:32 -0500211
212static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300213msvcrt_getch(PyObject *module, PyObject *Py_UNUSED(ignored))
Zachary Ware45520892015-05-13 01:22:32 -0500214{
215 PyObject *return_value = NULL;
216 char s[1];
217
218 s[0] = msvcrt_getch_impl(module);
219 return_value = PyBytes_FromStringAndSize(s, 1);
220
221 return return_value;
222}
223
Zachary Ware45520892015-05-13 01:22:32 -0500224PyDoc_STRVAR(msvcrt_getwch__doc__,
225"getwch($module, /)\n"
226"--\n"
227"\n"
228"Wide char variant of getch(), returning a Unicode value.");
229
230#define MSVCRT_GETWCH_METHODDEF \
231 {"getwch", (PyCFunction)msvcrt_getwch, METH_NOARGS, msvcrt_getwch__doc__},
232
233static wchar_t
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300234msvcrt_getwch_impl(PyObject *module);
Zachary Ware45520892015-05-13 01:22:32 -0500235
236static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300237msvcrt_getwch(PyObject *module, PyObject *Py_UNUSED(ignored))
Zachary Ware45520892015-05-13 01:22:32 -0500238{
239 PyObject *return_value = NULL;
240 wchar_t _return_value;
241
242 _return_value = msvcrt_getwch_impl(module);
243 return_value = PyUnicode_FromOrdinal(_return_value);
244
245 return return_value;
246}
247
Zachary Ware45520892015-05-13 01:22:32 -0500248PyDoc_STRVAR(msvcrt_getche__doc__,
249"getche($module, /)\n"
250"--\n"
251"\n"
252"Similar to getch(), but the keypress will be echoed if possible.");
253
254#define MSVCRT_GETCHE_METHODDEF \
255 {"getche", (PyCFunction)msvcrt_getche, METH_NOARGS, msvcrt_getche__doc__},
256
257static int
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300258msvcrt_getche_impl(PyObject *module);
Zachary Ware45520892015-05-13 01:22:32 -0500259
260static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300261msvcrt_getche(PyObject *module, PyObject *Py_UNUSED(ignored))
Zachary Ware45520892015-05-13 01:22:32 -0500262{
263 PyObject *return_value = NULL;
264 char s[1];
265
266 s[0] = msvcrt_getche_impl(module);
267 return_value = PyBytes_FromStringAndSize(s, 1);
268
269 return return_value;
270}
271
Zachary Ware45520892015-05-13 01:22:32 -0500272PyDoc_STRVAR(msvcrt_getwche__doc__,
273"getwche($module, /)\n"
274"--\n"
275"\n"
276"Wide char variant of getche(), returning a Unicode value.");
277
278#define MSVCRT_GETWCHE_METHODDEF \
279 {"getwche", (PyCFunction)msvcrt_getwche, METH_NOARGS, msvcrt_getwche__doc__},
280
281static wchar_t
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300282msvcrt_getwche_impl(PyObject *module);
Zachary Ware45520892015-05-13 01:22:32 -0500283
284static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300285msvcrt_getwche(PyObject *module, PyObject *Py_UNUSED(ignored))
Zachary Ware45520892015-05-13 01:22:32 -0500286{
287 PyObject *return_value = NULL;
288 wchar_t _return_value;
289
290 _return_value = msvcrt_getwche_impl(module);
291 return_value = PyUnicode_FromOrdinal(_return_value);
292
293 return return_value;
294}
295
Zachary Ware45520892015-05-13 01:22:32 -0500296PyDoc_STRVAR(msvcrt_putch__doc__,
297"putch($module, char, /)\n"
298"--\n"
299"\n"
300"Print the byte string char to the console without buffering.");
301
302#define MSVCRT_PUTCH_METHODDEF \
303 {"putch", (PyCFunction)msvcrt_putch, METH_O, msvcrt_putch__doc__},
304
305static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300306msvcrt_putch_impl(PyObject *module, char char_value);
Zachary Ware45520892015-05-13 01:22:32 -0500307
308static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300309msvcrt_putch(PyObject *module, PyObject *arg)
Zachary Ware45520892015-05-13 01:22:32 -0500310{
311 PyObject *return_value = NULL;
312 char char_value;
313
Zachary Ware77772c02015-05-13 10:58:35 -0500314 if (!PyArg_Parse(arg, "c:putch", &char_value))
Zachary Ware45520892015-05-13 01:22:32 -0500315 goto exit;
316 return_value = msvcrt_putch_impl(module, char_value);
317
318exit:
319 return return_value;
320}
321
Zachary Ware45520892015-05-13 01:22:32 -0500322PyDoc_STRVAR(msvcrt_putwch__doc__,
323"putwch($module, unicode_char, /)\n"
324"--\n"
325"\n"
326"Wide char variant of putch(), accepting a Unicode value.");
327
328#define MSVCRT_PUTWCH_METHODDEF \
329 {"putwch", (PyCFunction)msvcrt_putwch, METH_O, msvcrt_putwch__doc__},
330
331static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300332msvcrt_putwch_impl(PyObject *module, int unicode_char);
Zachary Ware45520892015-05-13 01:22:32 -0500333
334static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300335msvcrt_putwch(PyObject *module, PyObject *arg)
Zachary Ware45520892015-05-13 01:22:32 -0500336{
337 PyObject *return_value = NULL;
338 int unicode_char;
339
Zachary Ware77772c02015-05-13 10:58:35 -0500340 if (!PyArg_Parse(arg, "C:putwch", &unicode_char))
Zachary Ware45520892015-05-13 01:22:32 -0500341 goto exit;
342 return_value = msvcrt_putwch_impl(module, unicode_char);
343
344exit:
345 return return_value;
346}
347
Zachary Ware45520892015-05-13 01:22:32 -0500348PyDoc_STRVAR(msvcrt_ungetch__doc__,
349"ungetch($module, char, /)\n"
350"--\n"
351"\n"
352"Opposite of getch.\n"
353"\n"
354"Cause the byte string char to be \"pushed back\" into the\n"
355"console buffer; it will be the next character read by\n"
356"getch() or getche().");
357
358#define MSVCRT_UNGETCH_METHODDEF \
359 {"ungetch", (PyCFunction)msvcrt_ungetch, METH_O, msvcrt_ungetch__doc__},
360
361static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300362msvcrt_ungetch_impl(PyObject *module, char char_value);
Zachary Ware45520892015-05-13 01:22:32 -0500363
364static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300365msvcrt_ungetch(PyObject *module, PyObject *arg)
Zachary Ware45520892015-05-13 01:22:32 -0500366{
367 PyObject *return_value = NULL;
368 char char_value;
369
Zachary Ware77772c02015-05-13 10:58:35 -0500370 if (!PyArg_Parse(arg, "c:ungetch", &char_value))
Zachary Ware45520892015-05-13 01:22:32 -0500371 goto exit;
372 return_value = msvcrt_ungetch_impl(module, char_value);
373
374exit:
375 return return_value;
376}
377
Zachary Ware45520892015-05-13 01:22:32 -0500378PyDoc_STRVAR(msvcrt_ungetwch__doc__,
379"ungetwch($module, unicode_char, /)\n"
380"--\n"
381"\n"
382"Wide char variant of ungetch(), accepting a Unicode value.");
383
384#define MSVCRT_UNGETWCH_METHODDEF \
385 {"ungetwch", (PyCFunction)msvcrt_ungetwch, METH_O, msvcrt_ungetwch__doc__},
386
387static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300388msvcrt_ungetwch_impl(PyObject *module, int unicode_char);
Zachary Ware45520892015-05-13 01:22:32 -0500389
390static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300391msvcrt_ungetwch(PyObject *module, PyObject *arg)
Zachary Ware45520892015-05-13 01:22:32 -0500392{
393 PyObject *return_value = NULL;
394 int unicode_char;
395
Zachary Ware77772c02015-05-13 10:58:35 -0500396 if (!PyArg_Parse(arg, "C:ungetwch", &unicode_char))
Zachary Ware45520892015-05-13 01:22:32 -0500397 goto exit;
398 return_value = msvcrt_ungetwch_impl(module, unicode_char);
399
400exit:
401 return return_value;
402}
403
Zachary Ware45520892015-05-13 01:22:32 -0500404#if defined(_DEBUG)
405
406PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__,
407"CrtSetReportFile($module, type, file, /)\n"
408"--\n"
409"\n"
410"Wrapper around _CrtSetReportFile.\n"
411"\n"
412"Only available on Debug builds.");
413
414#define MSVCRT_CRTSETREPORTFILE_METHODDEF \
415 {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_VARARGS, msvcrt_CrtSetReportFile__doc__},
416
417static long
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300418msvcrt_CrtSetReportFile_impl(PyObject *module, int type, int file);
Zachary Ware45520892015-05-13 01:22:32 -0500419
420static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300421msvcrt_CrtSetReportFile(PyObject *module, PyObject *args)
Zachary Ware45520892015-05-13 01:22:32 -0500422{
423 PyObject *return_value = NULL;
424 int type;
425 int file;
426 long _return_value;
427
Zachary Ware77772c02015-05-13 10:58:35 -0500428 if (!PyArg_ParseTuple(args, "ii:CrtSetReportFile",
Zachary Ware45520892015-05-13 01:22:32 -0500429 &type, &file))
430 goto exit;
431 _return_value = msvcrt_CrtSetReportFile_impl(module, type, file);
432 if ((_return_value == -1) && PyErr_Occurred())
433 goto exit;
434 return_value = PyLong_FromLong(_return_value);
435
436exit:
437 return return_value;
438}
439
440#endif /* defined(_DEBUG) */
441
442#if defined(_DEBUG)
443
444PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__,
445"CrtSetReportMode($module, type, mode, /)\n"
446"--\n"
447"\n"
448"Wrapper around _CrtSetReportMode.\n"
449"\n"
450"Only available on Debug builds.");
451
452#define MSVCRT_CRTSETREPORTMODE_METHODDEF \
453 {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_VARARGS, msvcrt_CrtSetReportMode__doc__},
454
455static long
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300456msvcrt_CrtSetReportMode_impl(PyObject *module, int type, int mode);
Zachary Ware45520892015-05-13 01:22:32 -0500457
458static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300459msvcrt_CrtSetReportMode(PyObject *module, PyObject *args)
Zachary Ware45520892015-05-13 01:22:32 -0500460{
461 PyObject *return_value = NULL;
462 int type;
463 int mode;
464 long _return_value;
465
Zachary Ware77772c02015-05-13 10:58:35 -0500466 if (!PyArg_ParseTuple(args, "ii:CrtSetReportMode",
Zachary Ware45520892015-05-13 01:22:32 -0500467 &type, &mode))
468 goto exit;
469 _return_value = msvcrt_CrtSetReportMode_impl(module, type, mode);
470 if ((_return_value == -1) && PyErr_Occurred())
471 goto exit;
472 return_value = PyLong_FromLong(_return_value);
473
474exit:
475 return return_value;
476}
477
478#endif /* defined(_DEBUG) */
479
480#if defined(_DEBUG)
481
482PyDoc_STRVAR(msvcrt_set_error_mode__doc__,
483"set_error_mode($module, mode, /)\n"
484"--\n"
485"\n"
486"Wrapper around _set_error_mode.\n"
487"\n"
488"Only available on Debug builds.");
489
490#define MSVCRT_SET_ERROR_MODE_METHODDEF \
491 {"set_error_mode", (PyCFunction)msvcrt_set_error_mode, METH_O, msvcrt_set_error_mode__doc__},
492
493static long
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300494msvcrt_set_error_mode_impl(PyObject *module, int mode);
Zachary Ware45520892015-05-13 01:22:32 -0500495
496static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300497msvcrt_set_error_mode(PyObject *module, PyObject *arg)
Zachary Ware45520892015-05-13 01:22:32 -0500498{
499 PyObject *return_value = NULL;
500 int mode;
501 long _return_value;
502
Zachary Ware77772c02015-05-13 10:58:35 -0500503 if (!PyArg_Parse(arg, "i:set_error_mode", &mode))
Zachary Ware45520892015-05-13 01:22:32 -0500504 goto exit;
505 _return_value = msvcrt_set_error_mode_impl(module, mode);
506 if ((_return_value == -1) && PyErr_Occurred())
507 goto exit;
508 return_value = PyLong_FromLong(_return_value);
509
510exit:
511 return return_value;
512}
513
514#endif /* defined(_DEBUG) */
515
516PyDoc_STRVAR(msvcrt_SetErrorMode__doc__,
517"SetErrorMode($module, mode, /)\n"
518"--\n"
519"\n"
520"Wrapper around SetErrorMode.");
521
522#define MSVCRT_SETERRORMODE_METHODDEF \
523 {"SetErrorMode", (PyCFunction)msvcrt_SetErrorMode, METH_O, msvcrt_SetErrorMode__doc__},
524
525static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300526msvcrt_SetErrorMode_impl(PyObject *module, unsigned int mode);
Zachary Ware45520892015-05-13 01:22:32 -0500527
528static PyObject *
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300529msvcrt_SetErrorMode(PyObject *module, PyObject *arg)
Zachary Ware45520892015-05-13 01:22:32 -0500530{
531 PyObject *return_value = NULL;
532 unsigned int mode;
533
Zachary Ware77772c02015-05-13 10:58:35 -0500534 if (!PyArg_Parse(arg, "I:SetErrorMode", &mode))
Zachary Ware45520892015-05-13 01:22:32 -0500535 goto exit;
536 return_value = msvcrt_SetErrorMode_impl(module, mode);
537
538exit:
539 return return_value;
540}
541
Zachary Ware45520892015-05-13 01:22:32 -0500542#ifndef MSVCRT_CRTSETREPORTFILE_METHODDEF
543 #define MSVCRT_CRTSETREPORTFILE_METHODDEF
544#endif /* !defined(MSVCRT_CRTSETREPORTFILE_METHODDEF) */
545
546#ifndef MSVCRT_CRTSETREPORTMODE_METHODDEF
547 #define MSVCRT_CRTSETREPORTMODE_METHODDEF
548#endif /* !defined(MSVCRT_CRTSETREPORTMODE_METHODDEF) */
549
550#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
551 #define MSVCRT_SET_ERROR_MODE_METHODDEF
552#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
Serhiy Storchaka1a2b24f2016-07-07 17:35:15 +0300553/*[clinic end generated code: output=2a794c520d6ae887 input=a9049054013a1b77]*/