Changeset 25880 in project


Ignore:
Timestamp:
02/08/12 22:52:49 (9 years ago)
Author:
ecloud
Message:

Added support for dict and variant and a connman introspection example.

Not sure if the variant support is quite right, because what's inside
is often unsupported.

Location:
release/4/dbus/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/dbus/trunk/dbus.meta

    r23255 r25880  
    44 (category os)
    55 (license "MIT")
    6  (depends easyffi protobj matchable miscmacros foreigners)
     6 ;(depends easyffi protobj matchable miscmacros foreigners)
     7 (depends easyffi matchable miscmacros foreigners)
    78 (doc-from-wiki)
    89 (author "Shawn Rutledge")
  • release/4/dbus/trunk/dbus.scm

    r25785 r25880  
    8585(define dbus:type-string-string  (foreign-value DBUS_TYPE_STRING_AS_STRING int))
    8686(define dbus:type-object-path  (foreign-value DBUS_TYPE_OBJECT_PATH int))
    87 (define dbus:type-object-path-string  (foreign-value DBUS_TYPE_OBJECT_PATH_AS_STRING int))
    8887(define dbus:type-signature  (foreign-value DBUS_TYPE_SIGNATURE int))
    8988(define dbus:type-signature-string  (foreign-value DBUS_TYPE_SIGNATURE_AS_STRING int))
    9089(define dbus:type-array (foreign-value DBUS_TYPE_ARRAY int))
    9190(define dbus:type-array-string  (foreign-value DBUS_TYPE_ARRAY_AS_STRING int))
     91(define dbus:type-dict  (foreign-value DBUS_TYPE_DICT_ENTRY int))
     92(define dbus:type-variant (foreign-value DBUS_TYPE_VARIANT int))
    9293
    9394(define dbus:make-context)
     
    308309
    309310        ;; TODO: iter-append-basic-T for each possible type:
    310         ;; especially array, variant and struct might be possible
     311        ;; especially variant, array and struct might still be possible
    311312
    312313        ;; val would usually be a single value, but
     
    348349                        (cond
    349350                                [(memq type `(,dbus:type-string ,dbus:type-invalid-string
    350                                                                 ,dbus:type-string-string ,dbus:type-object-path-string
     351                                                                ,dbus:type-string-string ,dbus:type-object-path
    351352                                                                ,dbus:type-signature-string
    352353                                                                ;; TODO maybe the following types ought to be converted?
     
    388389                                [(eq? type dbus:type-array)
    389390                                        (iter->vector (make-sub-iter iter))]
     391                                [(eq? type dbus:type-dict)
     392                                        (iter->pair (make-sub-iter iter))]
     393                                [(eq? type dbus:type-variant)
     394                                        ((make-sub-iter iter))]
    390395                                ;; unsupported so far (not understood well enough):
    391396                                ;;      dbus:type-object-path and dbus:type-signature
    392397                                ;; dbus:type-invalid is returned as #f (could be (void) but that
    393398                                ;; would be the termination condition for the iterator)
     399                                ;[else (format "unsupported-~c" (integer->char type))] )))
    394400                                [else #f] )))
    395401
     
    440446                                        (reverse retval)
    441447                                        (loop (cons next retval))))))
     448
     449        (define (iter->pair iter)
     450                (cons (iter) (iter)))
    442451
    443452        (define (iter->vector iter)
     
    711720                                (and (pair? xml) (car xml))))))
    712721
    713 )
    714 )
     722)) ;; end module
  • release/4/dbus/trunk/dbus.setup

    r25788 r25880  
    33(use files utils)
    44
    5 (make (("dbus.import.so" ("dbus.c")
    6         (compile -s -O3 -d0 dbus.import.scm))
    7        ("dbus.so" ("dbus.c")
    8         (compile -s -O3 -d1 dbus.scm -C "`pkg-config --cflags dbus-1`" -L "`pkg-config --libs dbus-1`"))
    9        ("dbus.c" ("dbus.scm")
    10         (compile -t dbus.scm -O3 -d1 -X easyffi -C -g -j dbus)))
    11  '("dbus.so" "dbus.import.so"))
     5(make (
     6                ("dbus.import.so" ("dbus.c")
     7                        (compile -s -O3 -d0 dbus.import.scm))
     8                ("dbus.so" ("dbus.c")
     9                        (compile -s -O3 -d1 dbus.scm -C "`pkg-config --cflags dbus-1`" -L "`pkg-config --libs dbus-1`"))
     10                ("dbus.c" ("dbus.scm")
     11                        (compile -t dbus.scm -O3 -d1 -X easyffi -C -g -j dbus)))
     12        '("dbus.so" "dbus.import.so"))
    1213
    1314(install-extension 'dbus
    14                    `("dbus.so" "dbus.import.so")
    15                    `((version 0.88)))
    16 
     15        `("dbus.so" "dbus.import.so")
     16        `((version 0.88)))
Note: See TracChangeset for help on using the changeset viewer.