comparison utillib.tcl @ 599:76d19fa28753

utillib: Add command matching helper function.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 04 Feb 2021 12:15:54 +0200
parents 1ace0cbde1dd
children 543f1d72361e
comparison
equal deleted inserted replaced
598:40db54427950 599:76d19fa28753
126 } 126 }
127 return [clock format $utime -format "%d.%m.%Y %H:%M"] 127 return [clock format $utime -format "%d.%m.%Y %H:%M"]
128 } 128 }
129 129
130 130
131 proc utl_cmd_match { ucommands uid ustr } {
132 upvar $ucommands ucmds
133
134 if {[info exists ucmds($uid)] && [regexp -nocase -- $ucmds($uid) $ustr]} {
135 return 1
136 } else {
137 return 0
138 }
139 }
140
141
131 ### 142 ###
132 ### SQL database handling 143 ### SQL database handling
133 ### 144 ###
134 proc utl_sql_init {ndb_handle db_type db_name db_host db_port db_user db_pass} { 145 proc utl_sql_init {ndb_handle db_type db_name db_host db_port db_user db_pass} {
135 upvar $ndb_handle udb_handle 146 upvar $ndb_handle udb_handle