• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef Py_INTERNAL_FILEUTILS_H
2 #define Py_INTERNAL_FILEUTILS_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #ifndef Py_BUILD_CORE
8 #  error "Py_BUILD_CORE must be defined to include this header"
9 #endif
10 
11 #include <locale.h>   /* struct lconv */
12 
13 PyAPI_DATA(int) _Py_HasFileSystemDefaultEncodeErrors;
14 
15 PyAPI_FUNC(int) _Py_DecodeUTF8Ex(
16     const char *arg,
17     Py_ssize_t arglen,
18     wchar_t **wstr,
19     size_t *wlen,
20     const char **reason,
21     _Py_error_handler errors);
22 
23 PyAPI_FUNC(int) _Py_EncodeUTF8Ex(
24     const wchar_t *text,
25     char **str,
26     size_t *error_pos,
27     const char **reason,
28     int raw_malloc,
29     _Py_error_handler errors);
30 
31 PyAPI_FUNC(wchar_t*) _Py_DecodeUTF8_surrogateescape(
32     const char *arg,
33     Py_ssize_t arglen,
34     size_t *wlen);
35 
36 PyAPI_FUNC(int) _Py_GetForceASCII(void);
37 
38 /* Reset "force ASCII" mode (if it was initialized).
39 
40    This function should be called when Python changes the LC_CTYPE locale,
41    so the "force ASCII" mode can be detected again on the new locale
42    encoding. */
43 PyAPI_FUNC(void) _Py_ResetForceASCII(void);
44 
45 
46 PyAPI_FUNC(int) _Py_GetLocaleconvNumeric(
47     struct lconv *lc,
48     PyObject **decimal_point,
49     PyObject **thousands_sep);
50 
51 PyAPI_FUNC(void) _Py_closerange(int first, int last);
52 
53 PyAPI_FUNC(wchar_t*) _Py_GetLocaleEncoding(void);
54 PyAPI_FUNC(PyObject*) _Py_GetLocaleEncodingObject(void);
55 
56 #ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION
57 extern int _Py_LocaleUsesNonUnicodeWchar(void);
58 
59 extern wchar_t* _Py_DecodeNonUnicodeWchar(
60     const wchar_t* native,
61     Py_ssize_t size);
62 
63 extern int _Py_EncodeNonUnicodeWchar_InPlace(
64     wchar_t* unicode,
65     Py_ssize_t size);
66 #endif
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 #endif /* !Py_INTERNAL_FILEUTILS_H */
72