Mercurial > cpython-lru_cache-weakref
annotate Include/fileobject.h @ 84007:dbfbdf2b5c19 3.3
Fix #17967: For ftp urls CWD to target instead of hopping to each directory
towards target. This fixes a bug where target is accessible, but parent
directories are restricted.
| author | Senthil Kumaran <senthil@uthcode.com> |
|---|---|
| date | Sat, 01 Jun 2013 08:27:06 -0700 |
| parents | 852ca32eb18d |
| children | 3055e61f1e66 |
| rev | line source |
|---|---|
|
42071
825041fc8e2c
Rip out the file object's implementation.
Guido van Rossum <guido@python.org>
parents:
41554
diff
changeset
|
1 /* File object interface (what's left of it -- see io.py) */ |
| 6 | 2 |
|
13444
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
3 #ifndef Py_FILEOBJECT_H |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
4 #define Py_FILEOBJECT_H |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
5 #ifdef __cplusplus |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
6 extern "C" { |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
7 #endif |
|
5709ddba423c
ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents:
13256
diff
changeset
|
8 |
|
42071
825041fc8e2c
Rip out the file object's implementation.
Guido van Rossum <guido@python.org>
parents:
41554
diff
changeset
|
9 #define PY_STDIOTEXTMODE "b" |
|
22312
19d1d35020bd
Patch #530105: Allow file object may to be subtyped
Martin v. Löwis <martin@v.loewis.de>
parents:
21095
diff
changeset
|
10 |
|
43712
00b136b7da84
Patch 1329 (partial) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43632
diff
changeset
|
11 PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *, |
|
44134
e08b12c3b913
Add an errors parameter to open() and TextIOWrapper() to specify error handling.
Guido van Rossum <guido@python.org>
parents:
44064
diff
changeset
|
12 char *, int); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24594
diff
changeset
|
13 PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24594
diff
changeset
|
14 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24594
diff
changeset
|
15 PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24594
diff
changeset
|
16 PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *); |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
64622
diff
changeset
|
17 #ifndef Py_LIMITED_API |
|
42071
825041fc8e2c
Rip out the file object's implementation.
Guido van Rossum <guido@python.org>
parents:
41554
diff
changeset
|
18 PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
64622
diff
changeset
|
19 #endif |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
20 |
|
17822
50376d470648
Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a fileobject.h, and initialize it in bltinmodule.
Mark Hammond <mhammond@skippinet.com.au>
parents:
14375
diff
changeset
|
21 /* The default encoding used by the platform file system APIs |
|
23201
c408e8b2675a
Py_UniversalNewlineFread(): Many changes.
Tim Peters <tim.peters@gmail.com>
parents:
23029
diff
changeset
|
22 If non-NULL, this is different than the default encoding for strings |
|
17822
50376d470648
Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a fileobject.h, and initialize it in bltinmodule.
Mark Hammond <mhammond@skippinet.com.au>
parents:
14375
diff
changeset
|
23 */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
24594
diff
changeset
|
24 PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding; |
|
49403
e822992cf6ce
Issue #3187: Add sys.setfilesystemencoding.
Martin v. Löwis <martin@v.loewis.de>
parents:
44134
diff
changeset
|
25 PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding; |
|
17822
50376d470648
Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a fileobject.h, and initialize it in bltinmodule.
Mark Hammond <mhammond@skippinet.com.au>
parents:
14375
diff
changeset
|
26 |
|
43718
e510b716bd80
Patch 1352 (continued in issue 1329) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43712
diff
changeset
|
27 /* Internal API |
|
e510b716bd80
Patch 1352 (continued in issue 1329) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43712
diff
changeset
|
28 |
|
e510b716bd80
Patch 1352 (continued in issue 1329) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43712
diff
changeset
|
29 The std printer acts as a preliminary sys.stderr until the new io |
|
e510b716bd80
Patch 1352 (continued in issue 1329) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43712
diff
changeset
|
30 infrastructure is in place. */ |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
64622
diff
changeset
|
31 #ifndef Py_LIMITED_API |
|
43718
e510b716bd80
Patch 1352 (continued in issue 1329) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43712
diff
changeset
|
32 PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int); |
|
e510b716bd80
Patch 1352 (continued in issue 1329) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43712
diff
changeset
|
33 PyAPI_DATA(PyTypeObject) PyStdPrinter_Type; |
|
e510b716bd80
Patch 1352 (continued in issue 1329) by Christian Heimes.
Guido van Rossum <guido@python.org>
parents:
43712
diff
changeset
|
34 |
|
51579
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
35 #if defined _MSC_VER && _MSC_VER >= 1400 |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
36 /* A routine to check if a file descriptor is valid on Windows. Returns 0 |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
37 * and sets errno to EBADF if it isn't. This is to avoid Assertions |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
38 * from various functions in the Windows CRT beginning with |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
39 * Visual Studio 2005 |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
40 */ |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
41 int _PyVerify_fd(int fd); |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
42 #else |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
43 #define _PyVerify_fd(A) (1) /* dummy */ |
|
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
44 #endif |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
64622
diff
changeset
|
45 #endif /* Py_LIMITED_API */ |
|
51579
648e07dd0825
Merged revisions 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents:
49403
diff
changeset
|
46 |
|
72115
852ca32eb18d
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
Charles-François Natali <neologix@free.fr>
parents:
66664
diff
changeset
|
47 /* A routine to check if a file descriptor can be select()-ed. */ |
|
852ca32eb18d
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
Charles-François Natali <neologix@free.fr>
parents:
66664
diff
changeset
|
48 #ifdef HAVE_SELECT |
|
852ca32eb18d
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
Charles-François Natali <neologix@free.fr>
parents:
66664
diff
changeset
|
49 #define _PyIsSelectable_fd(FD) (((FD) >= 0) && ((FD) < FD_SETSIZE)) |
|
852ca32eb18d
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
Charles-François Natali <neologix@free.fr>
parents:
66664
diff
changeset
|
50 #else |
|
852ca32eb18d
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
Charles-François Natali <neologix@free.fr>
parents:
66664
diff
changeset
|
51 #define _PyIsSelectable_fd(FD) (1) |
|
852ca32eb18d
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
Charles-François Natali <neologix@free.fr>
parents:
66664
diff
changeset
|
52 #endif /* HAVE_SELECT */ |
|
852ca32eb18d
Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
Charles-François Natali <neologix@free.fr>
parents:
66664
diff
changeset
|
53 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
54 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
55 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
56 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
57 #endif /* !Py_FILEOBJECT_H */ |
