Coverage report: /home/ellis/comp/core/ffi/glib/pkg.lisp

KindCoveredAll%
expression130 3.3
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; pkg.lisp --- Glib FFI
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (defpackage :glib
7
   (:use :cl :std :sb-alien)
8
   (:export :load-glib
9
            :gmainloop
10
            :gmaincontext
11
            :gobjectgroup
12
            :glist
13
            :goptioncontext
14
            :goptiongroup
15
            :goptionentry
16
            :gvalue
17
            :gobject
18
            :g-object-getv))
19
 
20
 (in-package :glib)
21
 
22
 (define-alien-loader glib "/usr/lib/" "glib-2.0")
23
 
24
 (define-alien-type gtype unsigned)
25
 
26
 (define-alien-type gtype-interface (* t))
27
 
28
 (define-alien-type gdestroy-notify (* t))
29
 
30
 (define-opaque gmainloop)
31
 (define-opaque gmaincontext)
32
 (define-opaque gobjectgroup)
33
 (define-opaque glist)
34
 (define-opaque gvalue)
35
 (define-opaque gobject)
36
 (define-alien-type gthread (* t))
37
 (define-alien-type ghook-list (* t))
38
 (define-alien-type ginitially-unowned (* t))
39
 (define-alien-type gmutex (* t))
40
 (define-alien-type gpointer (* t))
41
 
42
 (define-alien-type gcond
43
     (struct gcond
44
             (p gpointer)
45
             (i (array unsigned-int 2))))
46
 
47
 
48
 (define-alien-type glist-t
49
   (struct glist
50
           (data gpointer)
51
           (next (* glist))
52
           (prev (* glist))))
53
 
54
 (define-alien-type grec-mutex
55
     (struct grec-mutex
56
             (p gpointer)
57
             (i (array unsigned-int 2))))
58
 
59
 (defar g-main-loop-new (* gmainloop) (context (* gmaincontext)) (is-running boolean))
60
 
61
 (define-alien-type gquark (unsigned 32))
62
 (define-alien-type gerror (struct gerror
63
                                   (domain gquark)
64
                                   (code int)
65
                                   (message c-string)))
66
 
67
 (define-alien-type goptioncontext (* t))
68
 (define-alien-type goptiongroup (* t))
69
 (define-alien-type goptionentry (* t))
70
 
71
 (define-alien-enum (goption-flags int)
72
                    :none 0
73
                    :hidden (ash 1 0)
74
                    :in-main (ash 1 1)
75
                    :reverse (ash 1 2)
76
                    :no-arg (ash 1 3)
77
                    :filename (ash 1 4)
78
                    :optional-arg (ash 1 5)
79
                    :noalias (ash 1 6))
80
 
81
 (define-alien-enum (goption-arg int)
82
                    :none 0
83
                    :string 1
84
                    :int 2
85
                    :callback 3
86
                    :filename 4
87
                    :string-array 5
88
                    :filename-array 6
89
                    :double 7
90
                    :int64 8)
91
 
92
 (defar g-option-error-quark gquark)
93
 
94
 (defar g-object-getv void
95
   (object (* gobject))
96
   (nprops unsigned-int)
97
   (names (* c-string)) ;; array
98
   (vals (array (* t))))