diff options
author | Charles Blake <cblake@csail.mit.edu> | 2014-09-26 11:56:56 -0400 |
---|---|---|
committer | Charles Blake <cblake@csail.mit.edu> | 2014-09-26 11:56:56 -0400 |
commit | 97665804e0e10d4c27028b994e5e0a4299a1b83e (patch) | |
tree | 850d652ca1ee7190cc1c7a62ddcaa7cd99a78a93 | |
parent | 3676e7a0a0904c83150f5384a81470f9de56c161 (diff) | |
download | cython-97665804e0e10d4c27028b994e5e0a4299a1b83e.tar.gz |
Move std C time APIs to libc.time; Move posix.sys_time to simply posix.time for system-level things like timer_* clock_*.
--HG--
extra : transplant_source : %1D%F7%80%B8jC%D1%83%0DH%FD%E1%81%26cqv%B7%1F%CE
-rw-r--r-- | Cython/Includes/libc/time.pxd | 87 | ||||
-rw-r--r-- | Cython/Includes/posix/sys_time.pxd | 25 | ||||
-rw-r--r-- | Cython/Includes/posix/time.pxd | 96 |
3 files changed, 104 insertions, 104 deletions
diff --git a/Cython/Includes/libc/time.pxd b/Cython/Includes/libc/time.pxd new file mode 100644 index 000000000..6c6e2d1fd --- /dev/null +++ b/Cython/Includes/libc/time.pxd @@ -0,0 +1,87 @@ +# http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html + +from posix.signal cimport sigevent +from posix.types cimport clock_t, clockid_t, suseconds_t, time_t, timer_t + +cdef extern from "time.h" nogil: + + enum: CLOCKS_PER_SEC + enum: CLOCK_PROCESS_CPUTIME_ID + enum: CLOCK_THREAD_CPUTIME_ID + + enum: CLOCK_REALTIME + enum: TIMER_ABSTIME + enum: CLOCK_MONOTONIC + + # FreeBSD-specific clocks + enum: CLOCK_UPTIME + enum: CLOCK_UPTIME_PRECISE + enum: CLOCK_UPTIME_FAST + enum: CLOCK_REALTIME_PRECISE + enum: CLOCK_REALTIME_FAST + enum: CLOCK_MONOTONIC_PRECISE + enum: CLOCK_MONOTONIC_FAST + enum: CLOCK_SECOND + + # Linux-specific clocks + enum: CLOCK_PROCESS_CPUTIME_ID + enum: CLOCK_THREAD_CPUTIME_ID + enum: CLOCK_MONOTONIC_RAW + enum: CLOCK_REALTIME_COARSE + enum: CLOCK_MONOTONIC_COARSE + enum: CLOCK_BOOTTIME + enum: CLOCK_REALTIME_ALARM + enum: CLOCK_BOOTTIME_ALARM + + cdef struct timespec: + time_t tv_sec + long tv_nsec + + cdef struct itimerspec: + timespec it_interval + timespec it_value + + cdef struct tm: + int tm_sec + int tm_min + int tm_hour + int tm_mday + int tm_mon + int tm_year + int tm_wday + int tm_yday + int tm_isdst + char *tm_zone + long tm_gmtoff + + char *asctime(const tm *) + char *asctime_r(const tm *, char *) + clock_t clock() + int clock_getcpuclockid(pid_t, clockid_t *) + int clock_getres(clockid_t, timespec *) + int clock_gettime(clockid_t, timespec *) + int clock_nanosleep(clockid_t, int, const timespec *, timespec *) + int clock_settime(clockid_t, const timespec *) + char *ctime(const time_t *) + char *ctime_r(const time_t *, char *) + double difftime(time_t, time_t) + tm *getdate(const char *) + tm *gmtime(const time_t *) + tm *gmtime_r(const time_t *, tm *) + tm *localtime(const time_t *) + tm *localtime_r(const time_t *, tm *) + time_t mktime(tm *) + int nanosleep(const timespec *, timespec *) + size_t strftime(char *, size_t, const char *, const tm *) + char *strptime(const char *, const char *, tm *) + time_t time(time_t *) + int timer_create(clockid_t, sigevent *, timer_t *) + int timer_delete(timer_t) + int timer_gettime(timer_t, itimerspec *) + int timer_getoverrun(timer_t) + int timer_settime(timer_t, int, const itimerspec *, itimerspec *) + void tzset() + + int daylight + long timezone + char *tzname[2] diff --git a/Cython/Includes/posix/sys_time.pxd b/Cython/Includes/posix/sys_time.pxd deleted file mode 100644 index 834d62308..000000000 --- a/Cython/Includes/posix/sys_time.pxd +++ /dev/null @@ -1,25 +0,0 @@ -# http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html - -from posix.types cimport suseconds_t, time_t - -cdef extern from "sys/time.h" nogil: - - enum: ITIMER_REAL - enum: ITIMER_VIRTUAL - enum: ITIMER_PROF - - cdef struct timezone: - int tz_minuteswest - int dsttime - - cdef struct timeval: - time_t tv_sec - suseconds_t tv_usec - - cdef struct itimerval: - timeval it_interval - timeval it_value - - int getitimer(int, itimerval *) - int gettimeofday(timeval *tp, timezone *tzp) - int setitimer(int, const itimerval *, itimerval *) diff --git a/Cython/Includes/posix/time.pxd b/Cython/Includes/posix/time.pxd index 6c6e2d1fd..834d62308 100644 --- a/Cython/Includes/posix/time.pxd +++ b/Cython/Includes/posix/time.pxd @@ -1,87 +1,25 @@ # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/time.h.html -from posix.signal cimport sigevent -from posix.types cimport clock_t, clockid_t, suseconds_t, time_t, timer_t +from posix.types cimport suseconds_t, time_t -cdef extern from "time.h" nogil: +cdef extern from "sys/time.h" nogil: - enum: CLOCKS_PER_SEC - enum: CLOCK_PROCESS_CPUTIME_ID - enum: CLOCK_THREAD_CPUTIME_ID + enum: ITIMER_REAL + enum: ITIMER_VIRTUAL + enum: ITIMER_PROF - enum: CLOCK_REALTIME - enum: TIMER_ABSTIME - enum: CLOCK_MONOTONIC + cdef struct timezone: + int tz_minuteswest + int dsttime - # FreeBSD-specific clocks - enum: CLOCK_UPTIME - enum: CLOCK_UPTIME_PRECISE - enum: CLOCK_UPTIME_FAST - enum: CLOCK_REALTIME_PRECISE - enum: CLOCK_REALTIME_FAST - enum: CLOCK_MONOTONIC_PRECISE - enum: CLOCK_MONOTONIC_FAST - enum: CLOCK_SECOND + cdef struct timeval: + time_t tv_sec + suseconds_t tv_usec - # Linux-specific clocks - enum: CLOCK_PROCESS_CPUTIME_ID - enum: CLOCK_THREAD_CPUTIME_ID - enum: CLOCK_MONOTONIC_RAW - enum: CLOCK_REALTIME_COARSE - enum: CLOCK_MONOTONIC_COARSE - enum: CLOCK_BOOTTIME - enum: CLOCK_REALTIME_ALARM - enum: CLOCK_BOOTTIME_ALARM + cdef struct itimerval: + timeval it_interval + timeval it_value - cdef struct timespec: - time_t tv_sec - long tv_nsec - - cdef struct itimerspec: - timespec it_interval - timespec it_value - - cdef struct tm: - int tm_sec - int tm_min - int tm_hour - int tm_mday - int tm_mon - int tm_year - int tm_wday - int tm_yday - int tm_isdst - char *tm_zone - long tm_gmtoff - - char *asctime(const tm *) - char *asctime_r(const tm *, char *) - clock_t clock() - int clock_getcpuclockid(pid_t, clockid_t *) - int clock_getres(clockid_t, timespec *) - int clock_gettime(clockid_t, timespec *) - int clock_nanosleep(clockid_t, int, const timespec *, timespec *) - int clock_settime(clockid_t, const timespec *) - char *ctime(const time_t *) - char *ctime_r(const time_t *, char *) - double difftime(time_t, time_t) - tm *getdate(const char *) - tm *gmtime(const time_t *) - tm *gmtime_r(const time_t *, tm *) - tm *localtime(const time_t *) - tm *localtime_r(const time_t *, tm *) - time_t mktime(tm *) - int nanosleep(const timespec *, timespec *) - size_t strftime(char *, size_t, const char *, const tm *) - char *strptime(const char *, const char *, tm *) - time_t time(time_t *) - int timer_create(clockid_t, sigevent *, timer_t *) - int timer_delete(timer_t) - int timer_gettime(timer_t, itimerspec *) - int timer_getoverrun(timer_t) - int timer_settime(timer_t, int, const itimerspec *, itimerspec *) - void tzset() - - int daylight - long timezone - char *tzname[2] + int getitimer(int, itimerval *) + int gettimeofday(timeval *tp, timezone *tzp) + int setitimer(int, const itimerval *, itimerval *) |