blob: 24e18cd5fbf71c4e018453f83a0884ce239af20d [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 *
18msvcrt_heapmin_impl(PyModuleDef *module);
19
20static PyObject *
21msvcrt_heapmin(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
22{
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 *
43msvcrt_locking_impl(PyModuleDef *module, int fd, int mode, long nbytes);
44
45static PyObject *
46msvcrt_locking(PyModuleDef *module, PyObject *args)
47{
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",
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030054 &fd, &mode, &nbytes)) {
Zachary Ware45520892015-05-13 01:22:32 -050055 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030056 }
Zachary Ware45520892015-05-13 01:22:32 -050057 return_value = msvcrt_locking_impl(module, fd, mode, nbytes);
58
59exit:
60 return return_value;
61}
62
63PyDoc_STRVAR(msvcrt_setmode__doc__,
64"setmode($module, fd, mode, /)\n"
65"--\n"
66"\n"
67"Set the line-end translation mode for the file descriptor fd.\n"
68"\n"
69"To set it to text mode, flags should be os.O_TEXT; for binary, it\n"
70"should be os.O_BINARY.\n"
71"\n"
72"Return value is the previous mode.");
73
74#define MSVCRT_SETMODE_METHODDEF \
75 {"setmode", (PyCFunction)msvcrt_setmode, METH_VARARGS, msvcrt_setmode__doc__},
76
77static long
78msvcrt_setmode_impl(PyModuleDef *module, int fd, int flags);
79
80static PyObject *
81msvcrt_setmode(PyModuleDef *module, PyObject *args)
82{
83 PyObject *return_value = NULL;
84 int fd;
85 int flags;
86 long _return_value;
87
Zachary Ware77772c02015-05-13 10:58:35 -050088 if (!PyArg_ParseTuple(args, "ii:setmode",
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030089 &fd, &flags)) {
Zachary Ware45520892015-05-13 01:22:32 -050090 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030091 }
Zachary Ware45520892015-05-13 01:22:32 -050092 _return_value = msvcrt_setmode_impl(module, fd, flags);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030093 if ((_return_value == -1) && PyErr_Occurred()) {
Zachary Ware45520892015-05-13 01:22:32 -050094 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +030095 }
Zachary Ware45520892015-05-13 01:22:32 -050096 return_value = PyLong_FromLong(_return_value);
97
98exit:
99 return return_value;
100}
101
102PyDoc_STRVAR(msvcrt_open_osfhandle__doc__,
103"open_osfhandle($module, handle, flags, /)\n"
104"--\n"
105"\n"
106"Create a C runtime file descriptor from the file handle handle.\n"
107"\n"
108"The flags parameter should be a bitwise OR of os.O_APPEND, os.O_RDONLY,\n"
109"and os.O_TEXT. The returned file descriptor may be used as a parameter\n"
110"to os.fdopen() to create a file object.");
111
112#define MSVCRT_OPEN_OSFHANDLE_METHODDEF \
113 {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_VARARGS, msvcrt_open_osfhandle__doc__},
114
115static long
Zachary Ware77772c02015-05-13 10:58:35 -0500116msvcrt_open_osfhandle_impl(PyModuleDef *module, Py_intptr_t handle,
117 int flags);
Zachary Ware45520892015-05-13 01:22:32 -0500118
119static PyObject *
120msvcrt_open_osfhandle(PyModuleDef *module, PyObject *args)
121{
122 PyObject *return_value = NULL;
123 Py_intptr_t handle;
124 int flags;
125 long _return_value;
126
Zachary Ware77772c02015-05-13 10:58:35 -0500127 if (!PyArg_ParseTuple(args, ""_Py_PARSE_INTPTR"i:open_osfhandle",
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300128 &handle, &flags)) {
Zachary Ware45520892015-05-13 01:22:32 -0500129 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300130 }
Zachary Ware45520892015-05-13 01:22:32 -0500131 _return_value = msvcrt_open_osfhandle_impl(module, handle, flags);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300132 if ((_return_value == -1) && PyErr_Occurred()) {
Zachary Ware45520892015-05-13 01:22:32 -0500133 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300134 }
Zachary Ware45520892015-05-13 01:22:32 -0500135 return_value = PyLong_FromLong(_return_value);
136
137exit:
138 return return_value;
139}
140
141PyDoc_STRVAR(msvcrt_get_osfhandle__doc__,
142"get_osfhandle($module, fd, /)\n"
143"--\n"
144"\n"
145"Return the file handle for the file descriptor fd.\n"
146"\n"
147"Raises IOError if fd is not recognized.");
148
149#define MSVCRT_GET_OSFHANDLE_METHODDEF \
150 {"get_osfhandle", (PyCFunction)msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__},
151
152static Py_intptr_t
153msvcrt_get_osfhandle_impl(PyModuleDef *module, int fd);
154
155static PyObject *
156msvcrt_get_osfhandle(PyModuleDef *module, PyObject *arg)
157{
158 PyObject *return_value = NULL;
159 int fd;
160 Py_intptr_t _return_value;
161
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300162 if (!PyArg_Parse(arg, "i:get_osfhandle", &fd)) {
Zachary Ware45520892015-05-13 01:22:32 -0500163 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300164 }
Zachary Ware45520892015-05-13 01:22:32 -0500165 _return_value = msvcrt_get_osfhandle_impl(module, fd);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300166 if ((_return_value == -1) && PyErr_Occurred()) {
Zachary Ware45520892015-05-13 01:22:32 -0500167 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300168 }
Zachary Ware45520892015-05-13 01:22:32 -0500169 return_value = PyLong_FromVoidPtr((void *)_return_value);
170
171exit:
172 return return_value;
173}
174
175PyDoc_STRVAR(msvcrt_kbhit__doc__,
176"kbhit($module, /)\n"
177"--\n"
178"\n"
179"Return true if a keypress is waiting to be read.");
180
181#define MSVCRT_KBHIT_METHODDEF \
182 {"kbhit", (PyCFunction)msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__},
183
184static long
185msvcrt_kbhit_impl(PyModuleDef *module);
186
187static PyObject *
188msvcrt_kbhit(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
189{
190 PyObject *return_value = NULL;
191 long _return_value;
192
193 _return_value = msvcrt_kbhit_impl(module);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300194 if ((_return_value == -1) && PyErr_Occurred()) {
Zachary Ware45520892015-05-13 01:22:32 -0500195 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300196 }
Zachary Ware45520892015-05-13 01:22:32 -0500197 return_value = PyLong_FromLong(_return_value);
198
199exit:
200 return return_value;
201}
202
203PyDoc_STRVAR(msvcrt_getch__doc__,
204"getch($module, /)\n"
205"--\n"
206"\n"
207"Read a keypress and return the resulting character as a byte string.\n"
208"\n"
209"Nothing is echoed to the console. This call will block if a keypress is\n"
210"not already available, but will not wait for Enter to be pressed. If the\n"
211"pressed key was a special function key, this will return \'\\000\' or\n"
212"\'\\xe0\'; the next call will return the keycode. The Control-C keypress\n"
213"cannot be read with this function.");
214
215#define MSVCRT_GETCH_METHODDEF \
216 {"getch", (PyCFunction)msvcrt_getch, METH_NOARGS, msvcrt_getch__doc__},
217
218static int
219msvcrt_getch_impl(PyModuleDef *module);
220
221static PyObject *
222msvcrt_getch(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
223{
224 PyObject *return_value = NULL;
225 char s[1];
226
227 s[0] = msvcrt_getch_impl(module);
228 return_value = PyBytes_FromStringAndSize(s, 1);
229
230 return return_value;
231}
232
Zachary Ware45520892015-05-13 01:22:32 -0500233PyDoc_STRVAR(msvcrt_getwch__doc__,
234"getwch($module, /)\n"
235"--\n"
236"\n"
237"Wide char variant of getch(), returning a Unicode value.");
238
239#define MSVCRT_GETWCH_METHODDEF \
240 {"getwch", (PyCFunction)msvcrt_getwch, METH_NOARGS, msvcrt_getwch__doc__},
241
242static wchar_t
243msvcrt_getwch_impl(PyModuleDef *module);
244
245static PyObject *
246msvcrt_getwch(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
247{
248 PyObject *return_value = NULL;
249 wchar_t _return_value;
250
251 _return_value = msvcrt_getwch_impl(module);
252 return_value = PyUnicode_FromOrdinal(_return_value);
253
254 return return_value;
255}
256
Zachary Ware45520892015-05-13 01:22:32 -0500257PyDoc_STRVAR(msvcrt_getche__doc__,
258"getche($module, /)\n"
259"--\n"
260"\n"
261"Similar to getch(), but the keypress will be echoed if possible.");
262
263#define MSVCRT_GETCHE_METHODDEF \
264 {"getche", (PyCFunction)msvcrt_getche, METH_NOARGS, msvcrt_getche__doc__},
265
266static int
267msvcrt_getche_impl(PyModuleDef *module);
268
269static PyObject *
270msvcrt_getche(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
271{
272 PyObject *return_value = NULL;
273 char s[1];
274
275 s[0] = msvcrt_getche_impl(module);
276 return_value = PyBytes_FromStringAndSize(s, 1);
277
278 return return_value;
279}
280
Zachary Ware45520892015-05-13 01:22:32 -0500281PyDoc_STRVAR(msvcrt_getwche__doc__,
282"getwche($module, /)\n"
283"--\n"
284"\n"
285"Wide char variant of getche(), returning a Unicode value.");
286
287#define MSVCRT_GETWCHE_METHODDEF \
288 {"getwche", (PyCFunction)msvcrt_getwche, METH_NOARGS, msvcrt_getwche__doc__},
289
290static wchar_t
291msvcrt_getwche_impl(PyModuleDef *module);
292
293static PyObject *
294msvcrt_getwche(PyModuleDef *module, PyObject *Py_UNUSED(ignored))
295{
296 PyObject *return_value = NULL;
297 wchar_t _return_value;
298
299 _return_value = msvcrt_getwche_impl(module);
300 return_value = PyUnicode_FromOrdinal(_return_value);
301
302 return return_value;
303}
304
Zachary Ware45520892015-05-13 01:22:32 -0500305PyDoc_STRVAR(msvcrt_putch__doc__,
306"putch($module, char, /)\n"
307"--\n"
308"\n"
309"Print the byte string char to the console without buffering.");
310
311#define MSVCRT_PUTCH_METHODDEF \
312 {"putch", (PyCFunction)msvcrt_putch, METH_O, msvcrt_putch__doc__},
313
314static PyObject *
315msvcrt_putch_impl(PyModuleDef *module, char char_value);
316
317static PyObject *
318msvcrt_putch(PyModuleDef *module, PyObject *arg)
319{
320 PyObject *return_value = NULL;
321 char char_value;
322
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300323 if (!PyArg_Parse(arg, "c:putch", &char_value)) {
Zachary Ware45520892015-05-13 01:22:32 -0500324 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300325 }
Zachary Ware45520892015-05-13 01:22:32 -0500326 return_value = msvcrt_putch_impl(module, char_value);
327
328exit:
329 return return_value;
330}
331
Zachary Ware45520892015-05-13 01:22:32 -0500332PyDoc_STRVAR(msvcrt_putwch__doc__,
333"putwch($module, unicode_char, /)\n"
334"--\n"
335"\n"
336"Wide char variant of putch(), accepting a Unicode value.");
337
338#define MSVCRT_PUTWCH_METHODDEF \
339 {"putwch", (PyCFunction)msvcrt_putwch, METH_O, msvcrt_putwch__doc__},
340
341static PyObject *
342msvcrt_putwch_impl(PyModuleDef *module, int unicode_char);
343
344static PyObject *
345msvcrt_putwch(PyModuleDef *module, PyObject *arg)
346{
347 PyObject *return_value = NULL;
348 int unicode_char;
349
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300350 if (!PyArg_Parse(arg, "C:putwch", &unicode_char)) {
Zachary Ware45520892015-05-13 01:22:32 -0500351 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300352 }
Zachary Ware45520892015-05-13 01:22:32 -0500353 return_value = msvcrt_putwch_impl(module, unicode_char);
354
355exit:
356 return return_value;
357}
358
Zachary Ware45520892015-05-13 01:22:32 -0500359PyDoc_STRVAR(msvcrt_ungetch__doc__,
360"ungetch($module, char, /)\n"
361"--\n"
362"\n"
363"Opposite of getch.\n"
364"\n"
365"Cause the byte string char to be \"pushed back\" into the\n"
366"console buffer; it will be the next character read by\n"
367"getch() or getche().");
368
369#define MSVCRT_UNGETCH_METHODDEF \
370 {"ungetch", (PyCFunction)msvcrt_ungetch, METH_O, msvcrt_ungetch__doc__},
371
372static PyObject *
373msvcrt_ungetch_impl(PyModuleDef *module, char char_value);
374
375static PyObject *
376msvcrt_ungetch(PyModuleDef *module, PyObject *arg)
377{
378 PyObject *return_value = NULL;
379 char char_value;
380
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300381 if (!PyArg_Parse(arg, "c:ungetch", &char_value)) {
Zachary Ware45520892015-05-13 01:22:32 -0500382 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300383 }
Zachary Ware45520892015-05-13 01:22:32 -0500384 return_value = msvcrt_ungetch_impl(module, char_value);
385
386exit:
387 return return_value;
388}
389
Zachary Ware45520892015-05-13 01:22:32 -0500390PyDoc_STRVAR(msvcrt_ungetwch__doc__,
391"ungetwch($module, unicode_char, /)\n"
392"--\n"
393"\n"
394"Wide char variant of ungetch(), accepting a Unicode value.");
395
396#define MSVCRT_UNGETWCH_METHODDEF \
397 {"ungetwch", (PyCFunction)msvcrt_ungetwch, METH_O, msvcrt_ungetwch__doc__},
398
399static PyObject *
400msvcrt_ungetwch_impl(PyModuleDef *module, int unicode_char);
401
402static PyObject *
403msvcrt_ungetwch(PyModuleDef *module, PyObject *arg)
404{
405 PyObject *return_value = NULL;
406 int unicode_char;
407
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300408 if (!PyArg_Parse(arg, "C:ungetwch", &unicode_char)) {
Zachary Ware45520892015-05-13 01:22:32 -0500409 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300410 }
Zachary Ware45520892015-05-13 01:22:32 -0500411 return_value = msvcrt_ungetwch_impl(module, unicode_char);
412
413exit:
414 return return_value;
415}
416
Zachary Ware45520892015-05-13 01:22:32 -0500417#if defined(_DEBUG)
418
419PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__,
420"CrtSetReportFile($module, type, file, /)\n"
421"--\n"
422"\n"
423"Wrapper around _CrtSetReportFile.\n"
424"\n"
425"Only available on Debug builds.");
426
427#define MSVCRT_CRTSETREPORTFILE_METHODDEF \
428 {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_VARARGS, msvcrt_CrtSetReportFile__doc__},
429
430static long
431msvcrt_CrtSetReportFile_impl(PyModuleDef *module, int type, int file);
432
433static PyObject *
434msvcrt_CrtSetReportFile(PyModuleDef *module, PyObject *args)
435{
436 PyObject *return_value = NULL;
437 int type;
438 int file;
439 long _return_value;
440
Zachary Ware77772c02015-05-13 10:58:35 -0500441 if (!PyArg_ParseTuple(args, "ii:CrtSetReportFile",
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300442 &type, &file)) {
Zachary Ware45520892015-05-13 01:22:32 -0500443 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300444 }
Zachary Ware45520892015-05-13 01:22:32 -0500445 _return_value = msvcrt_CrtSetReportFile_impl(module, type, file);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300446 if ((_return_value == -1) && PyErr_Occurred()) {
Zachary Ware45520892015-05-13 01:22:32 -0500447 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300448 }
Zachary Ware45520892015-05-13 01:22:32 -0500449 return_value = PyLong_FromLong(_return_value);
450
451exit:
452 return return_value;
453}
454
455#endif /* defined(_DEBUG) */
456
457#if defined(_DEBUG)
458
459PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__,
460"CrtSetReportMode($module, type, mode, /)\n"
461"--\n"
462"\n"
463"Wrapper around _CrtSetReportMode.\n"
464"\n"
465"Only available on Debug builds.");
466
467#define MSVCRT_CRTSETREPORTMODE_METHODDEF \
468 {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_VARARGS, msvcrt_CrtSetReportMode__doc__},
469
470static long
471msvcrt_CrtSetReportMode_impl(PyModuleDef *module, int type, int mode);
472
473static PyObject *
474msvcrt_CrtSetReportMode(PyModuleDef *module, PyObject *args)
475{
476 PyObject *return_value = NULL;
477 int type;
478 int mode;
479 long _return_value;
480
Zachary Ware77772c02015-05-13 10:58:35 -0500481 if (!PyArg_ParseTuple(args, "ii:CrtSetReportMode",
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300482 &type, &mode)) {
Zachary Ware45520892015-05-13 01:22:32 -0500483 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300484 }
Zachary Ware45520892015-05-13 01:22:32 -0500485 _return_value = msvcrt_CrtSetReportMode_impl(module, type, mode);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300486 if ((_return_value == -1) && PyErr_Occurred()) {
Zachary Ware45520892015-05-13 01:22:32 -0500487 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300488 }
Zachary Ware45520892015-05-13 01:22:32 -0500489 return_value = PyLong_FromLong(_return_value);
490
491exit:
492 return return_value;
493}
494
495#endif /* defined(_DEBUG) */
496
497#if defined(_DEBUG)
498
499PyDoc_STRVAR(msvcrt_set_error_mode__doc__,
500"set_error_mode($module, mode, /)\n"
501"--\n"
502"\n"
503"Wrapper around _set_error_mode.\n"
504"\n"
505"Only available on Debug builds.");
506
507#define MSVCRT_SET_ERROR_MODE_METHODDEF \
508 {"set_error_mode", (PyCFunction)msvcrt_set_error_mode, METH_O, msvcrt_set_error_mode__doc__},
509
510static long
511msvcrt_set_error_mode_impl(PyModuleDef *module, int mode);
512
513static PyObject *
514msvcrt_set_error_mode(PyModuleDef *module, PyObject *arg)
515{
516 PyObject *return_value = NULL;
517 int mode;
518 long _return_value;
519
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300520 if (!PyArg_Parse(arg, "i:set_error_mode", &mode)) {
Zachary Ware45520892015-05-13 01:22:32 -0500521 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300522 }
Zachary Ware45520892015-05-13 01:22:32 -0500523 _return_value = msvcrt_set_error_mode_impl(module, mode);
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300524 if ((_return_value == -1) && PyErr_Occurred()) {
Zachary Ware45520892015-05-13 01:22:32 -0500525 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300526 }
Zachary Ware45520892015-05-13 01:22:32 -0500527 return_value = PyLong_FromLong(_return_value);
528
529exit:
530 return return_value;
531}
532
533#endif /* defined(_DEBUG) */
534
535PyDoc_STRVAR(msvcrt_SetErrorMode__doc__,
536"SetErrorMode($module, mode, /)\n"
537"--\n"
538"\n"
539"Wrapper around SetErrorMode.");
540
541#define MSVCRT_SETERRORMODE_METHODDEF \
542 {"SetErrorMode", (PyCFunction)msvcrt_SetErrorMode, METH_O, msvcrt_SetErrorMode__doc__},
543
544static PyObject *
545msvcrt_SetErrorMode_impl(PyModuleDef *module, unsigned int mode);
546
547static PyObject *
548msvcrt_SetErrorMode(PyModuleDef *module, PyObject *arg)
549{
550 PyObject *return_value = NULL;
551 unsigned int mode;
552
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300553 if (!PyArg_Parse(arg, "I:SetErrorMode", &mode)) {
Zachary Ware45520892015-05-13 01:22:32 -0500554 goto exit;
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300555 }
Zachary Ware45520892015-05-13 01:22:32 -0500556 return_value = msvcrt_SetErrorMode_impl(module, mode);
557
558exit:
559 return return_value;
560}
561
Zachary Ware45520892015-05-13 01:22:32 -0500562#ifndef MSVCRT_CRTSETREPORTFILE_METHODDEF
563 #define MSVCRT_CRTSETREPORTFILE_METHODDEF
564#endif /* !defined(MSVCRT_CRTSETREPORTFILE_METHODDEF) */
565
566#ifndef MSVCRT_CRTSETREPORTMODE_METHODDEF
567 #define MSVCRT_CRTSETREPORTMODE_METHODDEF
568#endif /* !defined(MSVCRT_CRTSETREPORTMODE_METHODDEF) */
569
570#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
571 #define MSVCRT_SET_ERROR_MODE_METHODDEF
572#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
Serhiy Storchaka5dee6552016-06-09 16:16:06 +0300573/*[clinic end generated code: output=636de3460aecbca7 input=a9049054013a1b77]*/