blob: 5466e3c7e0d713aca171f807829137eaa79ff167 [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
Victor Stinnerdaf45552013-08-28 00:53:59 +020030PyAPI_FUNC(int) _Py_open(
31 const char *pathname,
32 int flags);
33
Victor Stinner4e314432010-10-07 21:45:39 +000034PyAPI_FUNC(FILE *) _Py_wfopen(
35 const wchar_t *path,
36 const wchar_t *mode);
37
38PyAPI_FUNC(FILE*) _Py_fopen(
Victor Stinnerdaf45552013-08-28 00:53:59 +020039 const char *pathname,
40 const char *mode);
41
42PyAPI_FUNC(FILE*) _Py_fopen_obj(
Victor Stinnera4a75952010-10-07 22:23:10 +000043 PyObject *path,
Victor Stinner4e314432010-10-07 21:45:39 +000044 const char *mode);
45
46#ifdef HAVE_READLINK
47PyAPI_FUNC(int) _Py_wreadlink(
48 const wchar_t *path,
49 wchar_t *buf,
50 size_t bufsiz);
51#endif
52
53#ifdef HAVE_REALPATH
54PyAPI_FUNC(wchar_t*) _Py_wrealpath(
55 const wchar_t *path,
Victor Stinner015f4d82010-10-07 22:29:53 +000056 wchar_t *resolved_path,
57 size_t resolved_path_size);
Victor Stinner4e314432010-10-07 21:45:39 +000058#endif
59
60PyAPI_FUNC(wchar_t*) _Py_wgetcwd(
61 wchar_t *buf,
62 size_t size);
63
Victor Stinnerdaf45552013-08-28 00:53:59 +020064PyAPI_FUNC(int) _Py_get_inheritable(int fd);
65
66PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable,
67 int *atomic_flag_works);
68
69PyAPI_FUNC(int) _Py_dup(int fd);
70
Victor Stinner4e314432010-10-07 21:45:39 +000071#ifdef __cplusplus
72}
73#endif
74
75#endif /* !Py_FILEUTILS_H */