Tcl DBus Interface

Check-in [248e7aa88c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:- Nodes without any methods, signals, or properties would prevent any underlying nodes from being discovered via introspection - Deleting a node should also delete any child nodes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | master
Files: files | file ages | folders
SHA3-256:248e7aa88c3f7ea1f29eb4425f2e5f6083e5562b324d66f63e77166bd1e969f3
User & Date: schelte 2015-12-02 20:08:50
Context
2015-12-12
20:11
Fix error when a method deletes its own path. check-in: 70d7950f3e user: schelte tags: trunk, master
2015-12-02
20:08
- Nodes without any methods, signals, or properties would prevent any underlying nodes from being discovered via introspection - Deleting a node should also delete any child nodes check-in: 248e7aa88c user: schelte tags: trunk, master
2015-08-01
15:57
- Update to the latest TEA check-in: 55f1ecb3bc user: schelte tags: trunk, master
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to dbif.tcl.

653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
...
828
829
830
831
832
833
834
835



836
837
838
839
840
841

842
843
844
845
846
847
848
    dict with defaults {}
    cmdline opt arg {path} $args {
	-bus: {set bus [buscheck $arg]}
	-interface: {set intf [intfcheck $arg]}
    }
    pathcheck $path
    if {$path eq "/"} {set pat /*} else {set pat $path/*}
    set paths [array names dbif($bus,$pat,$intf)]
    if {[info exists dbif($bus,$path,$intf)]} {lappend paths $bus,$path,$intf}
    foreach n $paths {
	foreach sig [dict get $dbif($n) signals] {
	    unset -nocomplain signal($sig)
	}
	unset dbif($n)
    }
................................................................................
########################################################################
# Introspection procedures
########################################################################

proc dbus::dbif::node {bus path} {
    variable dbif
    set list [array names dbif $bus,$path,*]
    if {[llength $list] == 0} return



    set rc {
	{<!DOCTYPE node PUBLIC\
	  "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"}
	{"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">}
    }
    lappend rc {<node>}

    foreach n $list {
	set i [lindex [split $n ,] 2]
	set dict $dbif($n)
	if {[info exists dbif($bus,,$i)]} {
	    dict with dict {
		set std $dbif($bus,,$i)
		set methods [dict merge [dict get $std methods] $methods]







|







 







|
>
>
>






>







653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
...
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
    dict with defaults {}
    cmdline opt arg {path} $args {
	-bus: {set bus [buscheck $arg]}
	-interface: {set intf [intfcheck $arg]}
    }
    pathcheck $path
    if {$path eq "/"} {set pat /*} else {set pat $path/*}
    set paths [array names dbif $bus,$pat,$intf]
    if {[info exists dbif($bus,$path,$intf)]} {lappend paths $bus,$path,$intf}
    foreach n $paths {
	foreach sig [dict get $dbif($n) signals] {
	    unset -nocomplain signal($sig)
	}
	unset dbif($n)
    }
................................................................................
########################################################################
# Introspection procedures
########################################################################

proc dbus::dbif::node {bus path} {
    variable dbif
    set list [array names dbif $bus,$path,*]
    if {[llength $list] == 0} {
	if {$path eq "/"} {set pat /*} else {set pat $path/*}
	if {[llength [array names dbif $bus,$pat,*]] == 0} return
    }
    set rc {
	{<!DOCTYPE node PUBLIC\
	  "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"}
	{"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">}
    }
    lappend rc {<node>}
    set ilist {}
    foreach n $list {
	set i [lindex [split $n ,] 2]
	set dict $dbif($n)
	if {[info exists dbif($bus,,$i)]} {
	    dict with dict {
		set std $dbif($bus,,$i)
		set methods [dict merge [dict get $std methods] $methods]