/[tcldrop]/tcldrop/modules/core.tcl
ViewVC logotype

Diff of /tcldrop/modules/core.tcl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by fireegl, Thu May 22 07:46:16 2003 UTC revision 1.7 by Papillon, Thu May 22 21:28:46 2003 UTC
# Line 51  namespace eval tcldrop { Line 51  namespace eval tcldrop {
51          variable Timers          variable Timers
52          variable TimerIDCount 1          variable TimerIDCount 1
53          # Export all the commands that should be available to 3rd-party scripters:          # Export all the commands that should be available to 3rd-party scripters:
54          namespace export bind unbind binds timer utimer killtimer killutimer timers utimers          namespace export bind unbind binds timer utimer killtimer killutimer timers utimers maskhost
55  }  }
56    
57    
# Line 189  proc ::tcldrop::CheckFlags {flags1 flags Line 189  proc ::tcldrop::CheckFlags {flags1 flags
189                  {default} {                  {default} {
190                          # FixMe: This is really simple right now, it needs fixing to allow &'s though.                          # FixMe: This is really simple right now, it needs fixing to allow &'s though.
191                          #        I think it'll require a foreach [split $flags1 {}] { }                          #        I think it'll require a foreach [split $flags1 {}] { }
192                          regexp [join [split $flags1 {}] {|}] $flags2                          # regexp [join [split $flags1 {}] {|}] $flags2
193                            foreach x [split $flags1 {}] {
194                                    if {[string match "*$x*" $flags2]} { set found 1 }
195                            }
196                            return [info exists found]
197                  }                  }
198          }          }
199  }  }
# Line 396  proc ::tcldrop::calltime {} { Line 400  proc ::tcldrop::calltime {} {
400  # This proc is from Papillon@EFNet  # This proc is from Papillon@EFNet
401  # (Papillon) -> I've enabeled this to apply to ipv6 hosts aswell, it does not mask them yet, but I'll look into it  # (Papillon) -> I've enabeled this to apply to ipv6 hosts aswell, it does not mask them yet, but I'll look into it
402  # Note: This is untested and unmodified.  # Note: This is untested and unmodified.
403  proc maskhost {x} {  proc ::tcldrop::maskhost {x} {
404          if {[string match "*\**" [lindex [split $x @] 1]]} { return $x }          if {[string match "*\**" [lindex [split $x @] 1]]} { return $x }
405          if {![regexp ".*@.*" $x]} { set x "*@${x}" }          if {![regexp ".*@.*" $x]} { set x "*@${x}" }
406          if {[set mask1 [lindex [split $x @] 0]] != {*}} {          if {[set mask1 [lindex [split $x @] 0]] != {*}} {
407                  regsub "\~" $mask1 "" mask1                  set mask1 [string trimleft $mask1 {~*!}]
                 regsub {\*} $mask1 "" mask1  
                 regsub "\!" $mask1 "" mask1  
408          }          }
409          if {[regexp {@([0-9]+\.){3}[0-9]+} $x mask2]} {          if {[regexp {@([0-9]+\.){3}[0-9]+} $x mask2]} {
410                  set mask2 [join "[lrange [split $mask2 \.] 0 end-1] *" \.]                  set mask2 [join "[lrange [split $mask2 \.] 0 end-1] *" \.]
# Line 481  proc die {{reason {EXIT}}} { Line 483  proc die {{reason {EXIT}}} {
483          exit 0          exit 0
484  }  }
485    
486    
487  # Rehash, just like in Eggdrop, it (re)loads the config.  # Rehash, just like in Eggdrop, it (re)loads the config.
488  proc rehash {{type {}}} {  proc rehash {{type {}}} {
489          callevent prerehash          callevent prerehash

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26