diff --git a/basis/calendar/unix/unix.factor b/basis/calendar/unix/unix.factor index 1da554e0f1..e811abcab8 100644 --- a/basis/calendar/unix/unix.factor +++ b/basis/calendar/unix/unix.factor @@ -1,7 +1,27 @@ -USING: alien alien.c-types arrays calendar kernel structs -math unix.time namespaces system ; +USING: alien alien.c-types alien.syntax arrays calendar +kernel structs math unix.time namespaces system ; IN: calendar.unix +C-STRUCT: timeval + { "long" "sec" } + { "long" "usec" } ; + +: make-timeval ( ms -- timeval ) + 1000 /mod 1000 * + "timeval" + [ set-timeval-usec ] keep + [ set-timeval-sec ] keep ; + +C-STRUCT: timespec + { "time_t" "sec" } + { "long" "nsec" } ; + +: make-timespec ( ms -- timespec ) + 1000 /mod 1000000 * + "timespec" + [ set-timespec-nsec ] keep + [ set-timespec-sec ] keep ; + : get-time ( -- alien ) f time localtime ; diff --git a/basis/structs/authors.txt b/basis/structs/authors.txt deleted file mode 100755 index 7c1b2f2279..0000000000 --- a/basis/structs/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Doug Coleman diff --git a/basis/structs/structs.factor b/basis/structs/structs.factor deleted file mode 100644 index 6aef757eb4..0000000000 --- a/basis/structs/structs.factor +++ /dev/null @@ -1,22 +0,0 @@ -USING: alien.c-types alien.syntax kernel math unix.types ; -IN: structs - -C-STRUCT: timeval - { "long" "sec" } - { "long" "usec" } ; - -: make-timeval ( ms -- timeval ) - 1000 /mod 1000 * - "timeval" - [ set-timeval-usec ] keep - [ set-timeval-sec ] keep ; - -C-STRUCT: timespec - { "time_t" "sec" } - { "long" "nsec" } ; - -: make-timespec ( ms -- timespec ) - 1000 /mod 1000000 * - "timespec" - [ set-timespec-nsec ] keep - [ set-timespec-sec ] keep ; diff --git a/basis/structs/summary.txt b/basis/structs/summary.txt deleted file mode 100644 index 86d6ad349e..0000000000 --- a/basis/structs/summary.txt +++ /dev/null @@ -1 +0,0 @@ -Cross-platform C structs