Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
4345655e
Commit
4345655e
authored
Apr 08, 2014
by
Lars Buitinck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
POSIX interface: stat.h, types.h
parent
9c0c8a89
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
7 deletions
+77
-7
Cython/Includes/posix/stat.pxd
Cython/Includes/posix/stat.pxd
+55
-0
Cython/Includes/posix/types.pxd
Cython/Includes/posix/types.pxd
+12
-0
Cython/Includes/posix/unistd.pxd
Cython/Includes/posix/unistd.pxd
+2
-7
tests/compile/posix_pxds.pyx
tests/compile/posix_pxds.pyx
+8
-0
No files found.
Cython/Includes/posix/stat.pxd
0 → 100644
View file @
4345655e
from
posix.types
cimport
(
blkcnt_t
,
blksize_t
,
dev_t
,
gid_t
,
ino_t
,
mode_t
,
nlink_t
,
off_t
,
time_t
,
uid_t
)
cdef
extern
from
"sys/stat.h"
nogil
:
cdef
struct
struct_stat
"stat"
:
dev_t
st_dev
ino_t
st_ino
# POSIX prescribes including both <sys/stat.h> and <unistd.h> for these
cdef
extern
from
"unistd.h"
nogil
:
int
fchmod
(
int
,
mode_t
)
int
chmod
(
const
char
*
,
mode_t
)
int
fstat
(
int
,
struct_stat
*
)
int
lstat
(
const
char
*
,
struct_stat
*
)
int
stat
(
const
char
*
,
struct_stat
*
)
# Macros for st_mode
mode_t
S_ISREG
(
mode_t
)
mode_t
S_ISDIR
(
mode_t
)
mode_t
S_ISCHR
(
mode_t
)
mode_t
S_ISBLK
(
mode_t
)
mode_t
S_ISFIFO
(
mode_t
)
mode_t
S_ISLNK
(
mode_t
)
mode_t
S_ISSOCK
(
mode_t
)
mode_t
S_IFMT
mode_t
S_IFREG
mode_t
S_IFDIR
mode_t
S_IFCHR
mode_t
S_IFBLK
mode_t
S_IFIFO
mode_t
S_IFLNK
mode_t
S_IFSOCK
# Permissions
mode_t
S_ISUID
mode_t
S_ISGID
mode_t
S_ISVTX
mode_t
S_IRWXU
mode_t
S_IRUSR
mode_t
S_IWUSR
mode_t
S_IXUSR
mode_t
S_IRWXG
mode_t
S_IRGRP
mode_t
S_IWGRP
mode_t
S_IXGRP
mode_t
S_IRWXO
mode_t
S_IROTH
mode_t
S_IWOTH
mode_t
S_IXOTH
Cython/Includes/posix/types.pxd
0 → 100644
View file @
4345655e
cdef
extern
from
"sys/types.h"
:
ctypedef
long
blkcnt_t
ctypedef
long
blksize_t
ctypedef
long
dev_t
ctypedef
long
gid_t
ctypedef
long
ino_t
ctypedef
long
mode_t
ctypedef
long
nlink_t
ctypedef
long
off_t
ctypedef
long
pid_t
ctypedef
long
time_t
ctypedef
long
uid_t
Cython/Includes/posix/unistd.pxd
View file @
4345655e
# http://www.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html
from
posix.types
cimport
gid_t
,
pid_t
,
off_t
,
uid_t
cdef
extern
from
"unistd.h"
nogil
:
#:NULL
...
...
@@ -32,14 +34,7 @@ cdef extern from "unistd.h" nogil:
enum
:
STDOUT_FILENO
#1
enum
:
STDERR_FILENO
#2
#:ctypedef unsigned size_t
#:ctypedef signed ssize_t
ctypedef
int
uid_t
ctypedef
int
gid_t
ctypedef
signed
off_t
ctypedef
signed
pid_t
ctypedef
unsigned
useconds_t
ctypedef
signed
intptr_t
int
access
(
const
char
*
,
int
)
unsigned
alarm
(
unsigned
)
...
...
tests/compile/posix_pxds.pyx
View file @
4345655e
...
...
@@ -10,3 +10,11 @@ from posix.unistd cimport *
cimport
posix.fcntl
from
posix
cimport
fcntl
from
posix.fcntl
cimport
*
cimport
posix.types
from
posix
cimport
types
from
posix.types
cimport
*
cimport
posix.stat
from
posix
cimport
stat
from
posix.stat
cimport
*
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment