blob: e9bad80b8734ccbc0218b8deaf434828651a4ee8 [file] [log] [blame]
Victor Stinner4e314432010-10-07 21:45:39 +00001#ifndef Py_FILEUTILS_H
2#define Py_FILEUTILS_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Brett Cannonefb00c02012-02-29 18:31:31 -05008PyAPI_FUNC(PyObject *) _Py_device_encoding(int);
9
Victor Stinner4e314432010-10-07 21:45:39 +000010PyAPI_FUNC(wchar_t *) _Py_char2wchar(
Victor Stinner168e1172010-10-16 23:16:16 +000011 const char *arg,
12 size_t *size);
Victor Stinner4e314432010-10-07 21:45:39 +000013
14PyAPI_FUNC(char*) _Py_wchar2char(
Victor Stinner2f02a512010-11-08 22:43:46 +000015 const wchar_t *text,
16 size_t *error_pos);
Victor Stinner4e314432010-10-07 21:45:39 +000017
Victor Stinnerb306d752010-10-07 22:09:40 +000018#if defined(HAVE_STAT) && !defined(MS_WINDOWS)
Victor Stinner4e314432010-10-07 21:45:39 +000019PyAPI_FUNC(int) _Py_wstat(
20 const wchar_t* path,
21 struct stat *buf);
22#endif
23
24#ifdef HAVE_STAT
25PyAPI_FUNC(int) _Py_stat(
Victor Stinnera4a75952010-10-07 22:23:10 +000026 PyObject *path,
Victor Stinner4e314432010-10-07 21:45:39 +000027 struct stat *statbuf);
28#endif
29
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010030#ifndef Py_LIMITED_API
Victor Stinnerdaf45552013-08-28 00:53:59 +020031PyAPI_FUNC(int) _Py_open(
32 const char *pathname,
33 int flags);
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010034#endif
Victor Stinnerdaf45552013-08-28 00:53:59 +020035
Victor Stinner4e314432010-10-07 21:45:39 +000036PyAPI_FUNC(FILE *) _Py_wfopen(
37 const wchar_t *path,
38 const wchar_t *mode);
39
40PyAPI_FUNC(FILE*) _Py_fopen(
Victor Stinnerdaf45552013-08-28 00:53:59 +020041 const char *pathname,
42 const char *mode);
43
44PyAPI_FUNC(FILE*) _Py_fopen_obj(
Victor Stinnera4a75952010-10-07 22:23:10 +000045 PyObject *path,
Victor Stinner4e314432010-10-07 21:45:39 +000046 const char *mode);
47
48#ifdef HAVE_READLINK
49PyAPI_FUNC(int) _Py_wreadlink(
50 const wchar_t *path,
51 wchar_t *buf,
52 size_t bufsiz);
53#endif
54
55#ifdef HAVE_REALPATH
56PyAPI_FUNC(wchar_t*) _Py_wrealpath(
57 const wchar_t *path,
Victor Stinner015f4d82010-10-07 22:29:53 +000058 wchar_t *resolved_path,
59 size_t resolved_path_size);
Victor Stinner4e314432010-10-07 21:45:39 +000060#endif
61
62PyAPI_FUNC(wchar_t*) _Py_wgetcwd(
63 wchar_t *buf,
64 size_t size);
65
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010066#ifndef Py_LIMITED_API
Victor Stinnerdaf45552013-08-28 00:53:59 +020067PyAPI_FUNC(int) _Py_get_inheritable(int fd);
68
69PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable,
70 int *atomic_flag_works);
71
72PyAPI_FUNC(int) _Py_dup(int fd);
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010073#endif
Victor Stinnerdaf45552013-08-28 00:53:59 +020074
Victor Stinner4e314432010-10-07 21:45:39 +000075#ifdef __cplusplus
76}
77#endif
78
79#endif /* !Py_FILEUTILS_H */