File: types.pxd

package info (click to toggle)
cython 3.1.6%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,932 kB
  • sloc: python: 92,172; ansic: 19,275; cpp: 1,407; xml: 1,031; javascript: 511; makefile: 373; sh: 223; sed: 11
file content (30 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Note that the actual size of these types is system-dependent, and
# cannot be detected before C compile time.  However, the generated C code
# will correctly use the actual size of these types *except* for
# determining promotion in binary arithmetic expressions involving
# mixed types.  In this case, operands are promoted to the declared
# larger type, with a bias towards typedef types.  Thus, with the
# declarations below, long + time_t will result in a time_t whereas
# long long + time_t will result in a long long which should be
# acceptable for either 32-bit or 64-bit signed time_t (though admittedly
# the POSIX standard doesn't even specify that time_t must be an integral
# type).

cdef extern from "<sys/types.h>":
    ctypedef long blkcnt_t
    ctypedef long blksize_t
    ctypedef long clockid_t
    ctypedef long dev_t
    ctypedef long gid_t
    ctypedef long id_t
    ctypedef unsigned long ino_t
    ctypedef long mode_t
    ctypedef long nlink_t
    ctypedef long off_t
    ctypedef long pid_t
    ctypedef struct sigset_t:
        pass
    ctypedef long suseconds_t
    ctypedef long time_t
    ctypedef long timer_t
    ctypedef long uid_t