Home | History | Annotate | Download | only in Include
      1 #ifndef Py_FILEUTILS_H
      2 #define Py_FILEUTILS_H
      3 
      4 #ifdef __cplusplus
      5 extern "C" {
      6 #endif
      7 
      8 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
      9 PyAPI_FUNC(wchar_t *) Py_DecodeLocale(
     10     const char *arg,
     11     size_t *size);
     12 
     13 PyAPI_FUNC(char*) Py_EncodeLocale(
     14     const wchar_t *text,
     15     size_t *error_pos);
     16 #endif
     17 
     18 #ifndef Py_LIMITED_API
     19 
     20 PyAPI_FUNC(PyObject *) _Py_device_encoding(int);
     21 
     22 #ifdef MS_WINDOWS
     23 struct _Py_stat_struct {
     24     unsigned long st_dev;
     25     __int64 st_ino;
     26     unsigned short st_mode;
     27     int st_nlink;
     28     int st_uid;
     29     int st_gid;
     30     unsigned long st_rdev;
     31     __int64 st_size;
     32     time_t st_atime;
     33     int st_atime_nsec;
     34     time_t st_mtime;
     35     int st_mtime_nsec;
     36     time_t st_ctime;
     37     int st_ctime_nsec;
     38     unsigned long st_file_attributes;
     39 };
     40 #else
     41 #  define _Py_stat_struct stat
     42 #endif
     43 
     44 PyAPI_FUNC(int) _Py_fstat(
     45     int fd,
     46     struct _Py_stat_struct *status);
     47 
     48 PyAPI_FUNC(int) _Py_fstat_noraise(
     49     int fd,
     50     struct _Py_stat_struct *status);
     51 
     52 PyAPI_FUNC(int) _Py_stat(
     53     PyObject *path,
     54     struct stat *status);
     55 
     56 PyAPI_FUNC(int) _Py_open(
     57     const char *pathname,
     58     int flags);
     59 
     60 PyAPI_FUNC(int) _Py_open_noraise(
     61     const char *pathname,
     62     int flags);
     63 
     64 PyAPI_FUNC(FILE *) _Py_wfopen(
     65     const wchar_t *path,
     66     const wchar_t *mode);
     67 
     68 PyAPI_FUNC(FILE*) _Py_fopen(
     69     const char *pathname,
     70     const char *mode);
     71 
     72 PyAPI_FUNC(FILE*) _Py_fopen_obj(
     73     PyObject *path,
     74     const char *mode);
     75 
     76 PyAPI_FUNC(Py_ssize_t) _Py_read(
     77     int fd,
     78     void *buf,
     79     size_t count);
     80 
     81 PyAPI_FUNC(Py_ssize_t) _Py_write(
     82     int fd,
     83     const void *buf,
     84     size_t count);
     85 
     86 PyAPI_FUNC(Py_ssize_t) _Py_write_noraise(
     87     int fd,
     88     const void *buf,
     89     size_t count);
     90 
     91 #ifdef HAVE_READLINK
     92 PyAPI_FUNC(int) _Py_wreadlink(
     93     const wchar_t *path,
     94     wchar_t *buf,
     95     size_t bufsiz);
     96 #endif
     97 
     98 #ifdef HAVE_REALPATH
     99 PyAPI_FUNC(wchar_t*) _Py_wrealpath(
    100     const wchar_t *path,
    101     wchar_t *resolved_path,
    102     size_t resolved_path_size);
    103 #endif
    104 
    105 PyAPI_FUNC(wchar_t*) _Py_wgetcwd(
    106     wchar_t *buf,
    107     size_t size);
    108 
    109 PyAPI_FUNC(int) _Py_get_inheritable(int fd);
    110 
    111 PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable,
    112                                     int *atomic_flag_works);
    113 
    114 PyAPI_FUNC(int) _Py_dup(int fd);
    115 
    116 #ifndef MS_WINDOWS
    117 PyAPI_FUNC(int) _Py_get_blocking(int fd);
    118 
    119 PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking);
    120 #endif   /* !MS_WINDOWS */
    121 
    122 #endif   /* Py_LIMITED_API */
    123 
    124 #ifdef __cplusplus
    125 }
    126 #endif
    127 
    128 #endif /* !Py_FILEUTILS_H */
    129