%{#
#include "libc/sys/CATS/types.cats"
%}
abst@ype blksize_t = $extype "ats_blksize_type" abst@ype blkcnt_t = $extype "ats_blkcnt_type"
abst@ype clock_t = $extype "ats_clock_type" fun lint_of_clock (c: clock_t):<> lint = "atslib_lint_of_clock"
overload lint_of with lint_of_clock
fun double_of_clock (c: clock_t):<> double = "atslib_double_of_clock"
overload double_of with double_of_clock
abst@ype clockid_t = $extype "ats_clockid_type"
abst@ype dev_t = $extype "ats_dev_type" castfn dev_of_uint (x: uint):<> dev_t
castfn uint_of_dev (x: dev_t):<> uint
fun eq_dev_dev (x1: dev_t, x2: dev_t): bool = "atslib_eq_dev_dev"
overload = with eq_dev_dev
abst@ype fsblkcnt_t = $extype "ats_fsblkcnt_type" castfn ulint_of_fsblkcnt (x: fsblkcnt_t): ulint
abst@ype fsfilcnt_t = $extype "ats_fsfilcnt_type" castfn ulint_of_fsfilcnt (x: fsfilcnt_t): ulint
abst@ype ino_t = $extype "ats_ino_type" castfn int_of_ino (x: ino_t):<> int
fun eq_ino_ino (x1: ino_t, x2: ino_t): bool = "atslib_eq_ino_ino"
overload = with eq_ino_ino
abst@ype key_t = $extype "ats_key_type"
abst@ype mode_t = $extype "ats_mode_type" castfn mode_of_int (x: int):<> mode_t
castfn int_of_mode (x: mode_t):<> int
castfn mode_of_uint (x: uint):<> mode_t
castfn uint_of_mode (x: mode_t):<> uint
fun eq_mode_mode
(m1: mode_t, m2: mode_t):<> bool = "atslib_eq_mode_mode"
overload = with eq_mode_mode
fun neq_mode_mode
(m1: mode_t, m2: mode_t):<> bool = "atslib_neq_mode_mode"
overload <> with neq_mode_mode
fun lor_mode_mode
(m1: mode_t, m2: mode_t): mode_t = "atslib_lor_mode_mode"
overload lor with lor_mode_mode
fun land_mode_mode
(m1: mode_t, m2: mode_t): mode_t = "atslib_land_mode_mode"
overload land with land_mode_mode
abst@ype nlink_t = $extype "ats_nlink_type" castfn nlink_of_int (x: int): nlink_t
castfn int_of_nlink (x: nlink_t): int
castfn nlink_of_lint (x: lint): nlink_t
castfn lint_of_nlink (x: nlink_t): lint
abst@ype whence_t = $extype "ats_int_type"
macdef SEEK_SET = $extval (whence_t, "SEEK_SET")
macdef SEEK_CUR = $extval (whence_t, "SEEK_CUR")
macdef SEEK_END = $extval (whence_t, "SEEK_END")
abst@ype off_t = $extype "ats_off_type" castfn off_of_lint (li: lint):<> off_t
castfn lint_of_off (off: off_t):<> lint
castfn off_of_size (sz: size_t):<> off_t
abst@ype pid_t = $extype "ats_pid_type"
castfn pid_of_int (int: int):<> pid_t
castfn int_of_pid (pid: pid_t):<> int
castfn pid_of_lint (lint: lint):<> pid_t
castfn lint_of_pid (pid: pid_t):<> lint
abst@ype gid_t = $extype "ats_gid_type" castfn int_of_gid (gid: gid_t):<> int
castfn gid_of_int (int: int):<> gid_t
castfn lint_of_gid (gid: gid_t):<> lint
castfn gid_of_lint (lint: lint):<> gid_t
abst@ype uid_t = $extype "ats_uid_type" castfn int_of_uid (uid: uid_t):<> int
castfn uid_of_int (int: int):<> uid_t
castfn lint_of_uid (uid: uid_t):<> lint
castfn uid_of_lint (lint: lint):<> uid_t
abst@ype time_t = $extype "ats_time_type" castfn lint_of_time (t: time_t):<> lint
overload lint_of with lint_of_time
fun double_of_time (t: time_t):<> double_t0ype = "atslib_double_of_time"
overload double_of with double_of_time
abst@ype timer_t = $extype "ats_timer_type"
abst@ype useconds_t = $extype "ats_useconds_type" castfn lint_of_useconds (x: useconds_t):<> lint
overload lint_of with lint_of_useconds
abst@ype suseconds_t = $extype "ats_suseconds_type" castfn lint_of_suseconds (x: suseconds_t):<> lint
overload lint_of with lint_of_suseconds