about summary refs log tree commit diff
path: root/gi
diff options
context:
space:
mode:
Diffstat (limited to 'gi')
-rw-r--r--gi/glib/types.ha10
-rw-r--r--gi/gobject/types.ha13
-rw-r--r--gi/libc/types.ha32
3 files changed, 55 insertions, 0 deletions
diff --git a/gi/glib/types.ha b/gi/glib/types.ha
new file mode 100644
index 0000000..2492c4e
--- /dev/null
+++ b/gi/glib/types.ha
@@ -0,0 +1,10 @@
+export type Type = size;
+
+// Boolean type used by GLib and related libraries, equivalent to gboolean in C.
+export type boolean = uint;
+
+// True value of [[boolean]].
+export def TRUE: boolean = 1;
+
+// False value of [[boolean]].
+export def FALSE: boolean = 0;
diff --git a/gi/gobject/types.ha b/gi/gobject/types.ha
new file mode 100644
index 0000000..570fe30
--- /dev/null
+++ b/gi/gobject/types.ha
@@ -0,0 +1,13 @@
+use types::c;
+
+export type ValueUnion = union {
+	v_int: int,
+	v_uint: uint,
+	v_long: c::long,
+	v_ulong: c::ulong,
+	v_int64: i64,
+	v_uint64: u64,
+	v_float: f32,
+	v_double: f64,
+	v_pointer: *opaque,
+};
diff --git a/gi/libc/types.ha b/gi/libc/types.ha
new file mode 100644
index 0000000..94959b7
--- /dev/null
+++ b/gi/libc/types.ha
@@ -0,0 +1,32 @@
+use types::c;
+
+export type time_t = i64;
+
+export type utimbuf = struct {
+	actime: time_t,
+	modtime: time_t,
+};
+
+export type tm = struct {
+	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: int,
+};
+
+export type FILE = opaque;
+
+export type passwd = struct {
+	pw_name: *c::char,
+	pw_passwd: *c::char,
+	pw_uid: uint,
+	pw_gid: uint,
+	pw_gecos: *c::char,
+	pw_dir: *c::char,
+	pw_shell: *c::char,
+};