changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/ffi/glib/pkg.lisp

changeset 698: 96958d3eb5b0
parent: 34aaf1f7f1b5
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; pkg.lisp --- Glib FFI
2 
3 ;;
4 
5 ;;; Code:
6 (defpackage :glib
7  (:use :cl :std :sb-alien)
8  (:export))
9 
10 (in-package :glib)
11 
12 (define-alien-loader glib t "/usr/lib/" "glib-2.0")
13 
14 (define-alien-type gtype unsigned)
15 
16 (define-alien-type gtype-interface (* t))
17 
18 (define-alien-type gdestroy-notify (* t))
19 
20 (eval-always
21  (define-opaque gmainloop)
22  (define-opaque gmaincontext)
23  (define-opaque gobjectgroup)
24  (define-opaque glist))
25 
26 (define-alien-type gthread (* t))
27 (define-alien-type ghook-list (* t))
28 (define-alien-type ginitially-unowned (* t))
29 (define-alien-type gmutex (* t))
30 (define-alien-type gpointer (* t))
31 
32 (define-alien-type gcond
33  (struct gcond
34  (p gpointer)
35  (i (array unsigned-int 2))))
36 
37 
38 (define-alien-type glist-t
39  (struct glist
40  (data gpointer)
41  (next (* glist))
42  (prev (* glist))))
43 
44 (define-alien-type grec-mutex
45  (struct grec-mutex
46  (p gpointer)
47  (i (array unsigned-int 2))))
48 
49 (define-alien-routine g-main-loop-new (* gmainloop) (context (* gmaincontext)) (is-running boolean))
50 
51 (define-alien-type gquark (unsigned 32))
52 (define-alien-type gerror (struct gerror
53  (domain gquark)
54  (code int)
55  (message c-string)))
56 
57 (define-opaque goptioncontext (* t))
58 (define-opaque goptiongroup (* t))
59 (define-opaque goptionentry (* t))
60 
61 (define-alien-enum (goption-flags int)
62  :none 0
63  :hidden (ash 1 0)
64  :in-main (ash 1 1)
65  :reverse (ash 1 2)
66  :no-arg (ash 1 3)
67  :filename (ash 1 4)
68  :optional-arg (ash 1 5)
69  :noalias (ash 1 6))
70 
71 (define-alien-enum (goption-arg int)
72  :none 0
73  :string 1
74  :int 2
75  :callback 3
76  :filename 4
77  :string-array 5
78  :filename-array 6
79  :double 7
80  :int64 8)
81 
82 (define-alien-routine g-option-error-quark gquark)