1 ! Copyright (C) 2010 Anton Gorenko.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors alien alien.destructors alien.libraries
4 alien.strings alien.syntax combinators gobject-introspection
5 gobject-introspection.standard-types io.encodings.utf8 kernel
12 { [ os windows? ] [ "libglib-2.0-0.dll" ] }
13 { [ os macosx? ] [ "libglib-2.0.dylib" ] }
14 { [ os unix? ] [ "libglib-2.0.so" ] }
15 } cond cdecl add-library >>
17 IMPLEMENT-STRUCTS: GError GPollFD GSource GSourceFuncs ;
19 CONSTANT: G_MININT8 -0x80
20 CONSTANT: G_MAXINT8 0x7f
21 CONSTANT: G_MAXUINT8 0xff
22 CONSTANT: G_MININT16 -0x8000
23 CONSTANT: G_MAXINT16 0x7fff
24 CONSTANT: G_MAXUINT16 0xffff
25 CONSTANT: G_MININT32 -0x80000000
26 CONSTANT: G_MAXINT32 0x7fffffff
27 CONSTANT: G_MAXUINT32 0xffffffff
28 CONSTANT: G_MININT64 -0x8000000000000000
29 CONSTANT: G_MAXINT64 0x7fffffffffffffff
30 CONSTANT: G_MAXUINT64 0xffffffffffffffff
32 GIR: vocab:glib/GLib-2.0.gir
34 DESTRUCTOR: g_source_unref
37 CALLBACK: gboolean GSourceFuncsPrepareFunc ( GSource* source, gint* timeout_ )
38 CALLBACK: gboolean GSourceFuncsCheckFunc ( GSource* source )
39 CALLBACK: gboolean GSourceFuncsDispatchFunc ( GSource* source, GSourceFunc callback, gpointer user_data )
41 ERROR: g-error domain code message ;
43 : GError>g-error ( GError -- g-error )
44 [ domain>> g_quark_to_string utf8 alien>string ]
46 [ message>> utf8 alien>string ] tri
49 : handle-GError ( GError/f -- )