cpython: 709850f1ec67 (original) (raw)

--- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -398,6 +398,268 @@ static int win32_can_symlink = 0; #endif #endif +/*

+} argument_path_t; + +typedef struct {

+} argument_parser_table_t; + +#define APT_DECLARE(apt, fname) [](#l1.32)

+ +#define _APT_ARGUMENT_OBJECT(apt, name, variable, format) [](#l1.40)

+ +#define APT_ARGUMENT_OBJECT(apt, name, variable) [](#l1.45)

+ +#define APT_ARGUMENT_OBJECT_WITH_CONVERTER(apt, name, variable, converter) [](#l1.48)

+ +#define APT_ARGUMENT_UNICODE(apt, name, variable) [](#l1.53)

+ +#define APT_ARGUMENT_BYTES(apt, name, variable) [](#l1.56)

+ +#define APT_ARGUMENT_INT(apt, name, variable) [](#l1.59)

+ +static int +bool_converter(PyObject *object, void *address) {

+} + +#define APT_ARGUMENT_BOOL(apt, name, variable) [](#l1.72)

+ +#if !MS_WINDOWS

+#else

+#endif + +#define APT_ARGUMENT_PATH(apt, name, w, n, l) [](#l1.85)

+ +#define APT_OPTIONAL(apt) [](#l1.99)

+ +#define APT_KEYWORD_ONLY(apt) [](#l1.102)

+ + +static int apt_parse(argument_parser_table_t *apt) {

+

+

+

+

+

+

+

+#if MS_WINDOWS

+#else

+#endif

+ +#if !MS_WINDOWS

+#else

+#endif

+

+} + +static void apt_cleanup(argument_parser_table_t *apt) { +#if !MS_WINDOWS

+#endif +} + /* A helper used by a number of POSIX-only functions */ #ifndef MS_WINDOWS static int @@ -1942,6 +2204,12 @@ posix_do_stat(PyObject *self, PyObject / POSIX methods */ +#ifdef AT_FDCWD +#define DEFAULT_DIR_FD AT_FDCWD +#else +#define DEFAULT_DIR_FD (-100) +#endif + PyDoc_STRVAR(posix_access__doc__, "access(path, mode) -> True if granted, False otherwise\n\n[](#l1.283) Use the real uid/gid to test for access to a path. Note that most\n[](#l1.284) @@ -1951,34 +2219,54 @@ specified access to the path. The mode existence, or the inclusive-OR of R_OK, W_OK, and X_OK."); static PyObject * -posix_access(PyObject *self, PyObject *args) -{

+posix_access(PyObject *self, PyObject *args, PyObject *kwargs) +{ int mode;

#ifdef MS_WINDOWS DWORD attr;

-finish: +#else

+#endif +

+ +#define ACCESS_FAIL_IF_KEYWORD_USED [](#l1.337)

+

+ +#ifdef MS_WINDOWS

+

+

+ if (attr == 0xFFFFFFFF) /* File does not exist, or cannot read attributes */ return PyBool_FromLong(0); @@ -1989,16 +2277,28 @@ finish: || !(attr & FILE_ATTRIBUTE_READONLY) || (attr & FILE_ATTRIBUTE_DIRECTORY)); #else

+

+#ifdef HAVE_FACCESSAT

+#else

+#endif

+

#endif } @@ -10596,7 +10896,9 @@ get_terminal_size(PyObject *self, PyObje static PyMethodDef posix_methods[] = {

#ifdef HAVE_TTYNAME {"ttyname", posix_ttyname, METH_VARARGS, posix_ttyname__doc__}, #endif