(context 'MAIN:Dbus)
;; Declaring the FOOP object
-(FOOP path bus)
+(FOOP path name bus)
;; "The FOOP Constructor". Creates an object for a given path.
-(define (Dbus:Dbus PATH (BUS 'SYSTEM-BUS))
- (list (context) PATH BUS))
-
-;; Return the bus name
-(define (bus-name)
- (join (find-all "([^/]+)" (%path) $1 0) "."))
+(define (Dbus:Dbus PATH (NAME (replace "/" (1 PATH) ".")) (BUS 'SYSTEM-BUS))
+ (list (context) PATH NAME BUS))
;; Update the connection serial and return it
(define (connection++)
(define (invoke METHOD ARGS (FLAGS 0))
(when (regex "((.+):)?((.+)\\.)?([^(]+)\\((.*)\\)$" METHOD 0)
(let ((PATH $2) (INTERFACE $4) (MEMBER $5) (SIGNATURE $6))
- ;;(println (list 'invoke (bus-name) INTERFACE MEMBER SIGNATURE))
+ ;;(println (list 'invoke (%name) INTERFACE MEMBER SIGNATURE))
(if (message 'METHOD_CALL FLAGS
(list nil ; (if SELF-NAME (list 'SENDER SELF-NAME))
- (list 'DESTINATION (bus-name))
+ (list 'DESTINATION (%name))
(list 'PATH (if (empty? PATH) (%path) PATH))
(if (empty? INTERFACE) nil
(list 'INTERFACE INTERFACE))