;; Partial bindings to the glib library #> #include #include <# (define-foreign-type FILE "FILE") (define-foreign-type g_list "GList") (define-foreign-type g_slist "GSList") (define-foreign-type g_node "GNode") ;; Free all the nodes in an GSList. (define gslist-free (foreign-lambda void "g_slist_free" (nonnull-c-pointer g_slist))) ;; Free one node in a GSList (define gslist-free1 (foreign-lambda void "g_slist_free1" (nonnull-c-pointer g_slist))) ;; Get the pointer to the next element in the GSList (define gslist-next (foreign-lambda (c-pointer g_slist) "g_slist_next" (nonnull-c-pointer g_slist))) ;; Get the pointer to the last element in the GSList (define gslist-last (foreign-lambda (nonnull-c-pointer g_slist) "g_slist_last" (nonnull-c-pointer g_slist))) ;; Get the length of the GSList (define gslist-length (foreign-lambda unsigned-int "g_slist_length" (nonnull-c-pointer g_slist))) ;; Get the n-th element of the GSList counting from 0 (define gslist-nth (foreign-lambda (c-pointer g_slist) "g_slist_nth" (nonnull-c-pointer g_slist) unsigned-int)) ;; Append a new node to a GSList (define gslist-append (foreign-lambda (nonnull-c-pointer g_slist) "g_slist_append" (nonnull-c-pointer g_slist) nonnull-c-pointer)) ;; Insert a new node in a GSList before the referenced node (define gslist-insert-before (foreign-lambda (nonnull-c-pointer g_slist) "g_slist_insert_before" (nonnull-c-pointer g_slist) (nonnull-c-pointer g_slist) nonnull-c-pointer)) ;; Insert a new node in a GSList at the specified position (define gslist-insert-before (foreign-lambda (nonnull-c-pointer g_slist) "g_slist_insert" (nonnull-c-pointer g_slist) nonnull-c-pointer int))