1 ! Copyright (C) 2010 Anton Gorenko.
2 ! See http://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
13 { [ os windows? ] [ "libglib-2.0-0.dll" cdecl add-library ] }
14 { [ os macosx? ] [ "/opt/local/lib/libglib-2.0.0.dylib" cdecl add-library ] }
15 { [ os unix? ] [ drop ] }
19 IMPLEMENT-STRUCTS: GError GPollFD GSource GSourceFuncs ;
21 CONSTANT: G_MININT8 -0x80
22 CONSTANT: G_MAXINT8 0x7f
23 CONSTANT: G_MAXUINT8 0xff
24 CONSTANT: G_MININT16 -0x8000
25 CONSTANT: G_MAXINT16 0x7fff
26 CONSTANT: G_MAXUINT16 0xffff
27 CONSTANT: G_MININT32 -0x80000000
28 CONSTANT: G_MAXINT32 0x7fffffff
29 CONSTANT: G_MAXUINT32 0xffffffff
30 CONSTANT: G_MININT64 -0x8000000000000000
31 CONSTANT: G_MAXINT64 0x7fffffffffffffff
32 CONSTANT: G_MAXUINT64 0xffffffffffffffff
34 GIR: vocab:glib/GLib-2.0.gir
36 DESTRUCTOR: g_source_unref
39 CALLBACK: gboolean GSourceFuncsPrepareFunc ( GSource* source, gint* timeout_ ) ;
40 CALLBACK: gboolean GSourceFuncsCheckFunc ( GSource* source ) ;
41 CALLBACK: gboolean GSourceFuncsDispatchFunc ( GSource* source, GSourceFunc callback, gpointer user_data ) ;
43 ERROR: g-error domain code message ;
45 : GError>g-error ( GError -- g-error )
46 [ domain>> g_quark_to_string utf8 alien>string ]
48 [ message>> utf8 alien>string ] tri
51 : handle-GError ( GError/f -- )