home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 December / PCWorld_2000-12_cd.bin / Komunikace / Comanche / plugins / samba / lib / utils.tcl < prev   
Text File  |  2000-11-02  |  400b  |  15 lines

  1.  
  2. namespace eval ::sambautils:: {
  3. }
  4.  
  5. # First element is name, next element is value
  6. # Spaces in the name are turned into _
  7. # Thus hosts list turns into hosts_list
  8.  
  9. proc ::sambautils::getElements {data} {
  10.     set name {}
  11.     set value {}
  12.     regexp {^([^=]*)=(.*)} [string trim $data] result name value
  13.     regsub -all " " [string trim $name] "_" result
  14.     return [list $result [string trim $value]]
  15. }