From 078ae830b37fc77b7af18b65c8d33b492742b1a2 Mon Sep 17 00:00:00 2001 From: dms Date: Wed, 30 Aug 2000 12:19:23 +0000 Subject: [PATCH] preliminary command hook support added git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@56 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/CommandStubs.pl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/CommandStubs.pl b/src/CommandStubs.pl index 60b8ec2..1775c08 100644 --- a/src/CommandStubs.pl +++ b/src/CommandStubs.pl @@ -17,7 +17,8 @@ $W3Search_regex = join '|', @W3Search_engines; # Cmdstats => 'text_label',) #} ### EXAMPLE -# addCmdHook('d?find', \&debianFind(), ( +# addCmdHook('d?find', ( +# CODEREF => \&debianFind(), # Forker => 1, # Identifier => "debian", # Help => "dfind", @@ -26,6 +27,26 @@ $W3Search_regex = join '|', @W3Search_engines; # * viable solution? ### +sub addCmdHook { + my ($ident, %hash) = @_; + + &DEBUG("aCH: added $ident to command hooks."); + $cmdhooks{$ident} = \%hash; +} + +# RUN IF ADDRESSED. +sub parseCmdHook { + foreach (keys %cmdhooks) { + &DEBUG("cmdhooks{$_} => ..."); + my %hash = \%{ $cmdhooks{$_} }; + foreach (keys %hash) { + &DEBUG(" '$_' => '$hash{$_}'."); + } + } + + &DEBUG("pCH: ended."); +} + sub Modules { if (!defined $message) { &WARN("Modules: message is undefined. should never happen."); -- 2.39.5