[cvslog] [CVS] Module eggdrop1.8: Change committed

cvs at eggheads.org cvs at eggheads.org
Sat Oct 23 05:16:23 CST 2010


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.8
Commit time: 2010-10-23 11:16:23 UTC
Committer  : Rumen Stoyanov <pseudo at egg6.net>

Modified files:
     eggdrop.conf doc/Changes1.8 doc/tcl-commands.doc
     doc/html/egg-core.html doc/html/tcl-commands.html
     doc/man1/eggdrop.1 doc/settings/core.settings help/core.help
     help/set/cmds1.help src/main.c src/misc.c src/patch.h src/tcl.c
     src/tclhash.c src/tclhash.h src/mod/module.h

Log message:

Modified SIGQUIT handler to restart the bot by default.
Added support for evnt bind procs to cancel default signal actions.
Removed the die-on-sighup and die-on-sigterm variables.
Added a new bind type DIE triggered before a clean shutdown. Changed the exit status on clean shutdown to 0.

---------------------- diff included ----------------------
Index: eggdrop1.8/doc/Changes1.8
diff -u eggdrop1.8/doc/Changes1.8:1.22 eggdrop1.8/doc/Changes1.8:1.23
--- eggdrop1.8/doc/Changes1.8:1.22	Wed Oct 20 07:07:13 2010
+++ eggdrop1.8/doc/Changes1.8	Sat Oct 23 05:16:12 2010
@@ -1,4 +1,4 @@
-$Id: Changes1.8,v 1.22 2010/10/20 13:07:13 pseudo Exp $
+$Id: Changes1.8,v 1.23 2010/10/23 11:16:12 pseudo Exp $
 
 Eggdrop Changes (since version 1.8.0)
 
@@ -6,6 +6,13 @@
 
 1.8.0 (CVS):
 
+  - Modified SIGQUIT handler to restart the bot by default.
+  - Added support for evnt bind procs to cancel default signal actions.
+  - Removed the die-on-sighup and die-on-sigterm variables.
+  - Added a new bind type DIE triggered before a clean shutdown.
+  - Changed the exit status on clean shutdown to 0.
+    Patch by: pseudo
+
   - Clarified the OpenSSL version requirements.
   - Rewrote open_telnet() to make it more useful.
   - Replaced some calls to open_telnet_raw() with open_telnet().
Index: eggdrop1.8/doc/html/egg-core.html
diff -u eggdrop1.8/doc/html/egg-core.html:1.3 eggdrop1.8/doc/html/egg-core.html:1.4
--- eggdrop1.8/doc/html/egg-core.html:1.3	Tue Oct 19 06:13:32 2010
+++ eggdrop1.8/doc/html/egg-core.html	Sat Oct 23 05:16:12 2010
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: egg-core.html,v 1.3 2010/10/19 12:13:32 pseudo Exp $ -->
+<!-- $Id: egg-core.html,v 1.4 2010/10/23 11:16:12 pseudo Exp $ -->
 
 <html>
   <head>
@@ -813,22 +813,6 @@
           all of these.</p>
         </dd>
 
-        <dt><strong>set die-on-sighup 0</strong></dt>
-
-        <dd>
-          <p>Enable this setting if you want your Eggdrop to die upon
-          receiving a SIGHUP kill signal. Otherwise, the Eggdrop will just
-          save its userfile and rehash.</p>
-        </dd>
-
-        <dt><strong>set die-on-sigterm 0</strong></dt>
-
-        <dd>
-          <p>Enable this setting if you want your Eggdrop to die upon
-          receiving a SIGTERM kill signal. Otherwise, the Eggdrop will just
-          save its userfile and rehash.</p>
-        </dd>
-
         <dt><strong>unbind dcc n tcl *dcc:tcl</strong></dt>
         <dt><strong>unbind dcc n set *dcc:set</strong></dt>
 
Index: eggdrop1.8/doc/html/tcl-commands.html
diff -u eggdrop1.8/doc/html/tcl-commands.html:1.5 eggdrop1.8/doc/html/tcl-commands.html:1.6
--- eggdrop1.8/doc/html/tcl-commands.html:1.5	Tue Oct 19 06:13:32 2010
+++ eggdrop1.8/doc/html/tcl-commands.html	Sat Oct 23 05:16:12 2010
@@ -1,5 +1,5 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<!-- $Id: tcl-commands.html,v 1.5 2010/10/19 12:13:32 pseudo Exp $ -->
+<!-- $Id: tcl-commands.html,v 1.6 2010/10/23 11:16:12 pseudo Exp $ -->
 
 <html>
   <head>
@@ -5119,6 +5119,13 @@
               sending it. Only meaningful for messages with status
               &quot;queued&quot;.</p>
             </li>
+
+            <li>
+              <p><a name="bindb_evnt"></a><strong>EVNT</strong></p>
+            
+              <p>Return 1 to make Eggdrop not to take the default action for
+              the event. Used for signal type events, ignored for others.</p>
+            </li>
           </ol>
         </li>
       </ol>
Index: eggdrop1.8/doc/man1/eggdrop.1
diff -u eggdrop1.8/doc/man1/eggdrop.1:1.1.1.1 eggdrop1.8/doc/man1/eggdrop.1:1.2
--- eggdrop1.8/doc/man1/eggdrop.1:1.1.1.1	Mon Jul 26 15:11:06 2010
+++ eggdrop1.8/doc/man1/eggdrop.1	Sat Oct 23 05:16:12 2010
@@ -26,7 +26,7 @@
 .\" * 2000-10-07 Fabian    Updated and slightly re-organized.
 .\" * 2004-08-08 Wcc       Updated.
 .\"
-.\" $Id: eggdrop.1,v 1.1.1.1 2010/07/26 21:11:06 simple Exp $
+.\" $Id: eggdrop.1,v 1.2 2010/10/23 11:16:12 pseudo Exp $
 .TH eggdrop 1 "August 2004" "Eggheads Development Team" "IRC Tools"
 .SH NAME
 eggdrop \- an IRC bot
@@ -98,12 +98,16 @@
 running or not.
 .TP
 .B SIGTERM
-Depending on die-on-sigterm being set to 0 or 1 in the config file,
-Eggdrop will save its user and channel file and/or die.
+By default Eggdrop will save its user and channel file and die. A script can
+override the default handler by registering with the EVNT bind and returning 1.
 .TP
 .B SIGHUP
-Depending on die-on-sighup being set to 0 or 1 in the config file,
-Eggdrop will rehash (reload its config file) or die.
+By default Eggdrop will rehash (reload its config file). A script can override
+the default handler by registering with the EVNT bind and returning 1. 
+.TP
+.B SIGQUIT
+By default Eggdrop will restart. A script can override the default handler by
+registering with the EVNT bind and returning 1.
 .SH "ENVIRONMENT VARIABLES"
 .TP
 .B EGG_LANG
Index: eggdrop1.8/doc/settings/core.settings
diff -u eggdrop1.8/doc/settings/core.settings:1.3 eggdrop1.8/doc/settings/core.settings:1.4
--- eggdrop1.8/doc/settings/core.settings:1.3	Tue Oct 19 06:13:32 2010
+++ eggdrop1.8/doc/settings/core.settings	Sat Oct 23 05:16:12 2010
@@ -1,4 +1,4 @@
-$Id: core.settings,v 1.3 2010/10/19 12:13:32 pseudo Exp $
+$Id: core.settings,v 1.4 2010/10/23 11:16:12 pseudo Exp $
 
 Eggdrop Core Settings
 Last revised: April 17, 2003
@@ -481,18 +481,6 @@
       which provides commands for changing all of these.
 
 
-    set die-on-sighup 0
-      Enable this setting if you want your Eggdrop to die upon receiving a
-      SIGHUP kill signal. Otherwise, the Eggdrop will just save its userfile
-      and rehash.
-
-
-    set die-on-sigterm 0
-      Enable this setting if you want your Eggdrop to die upon receiving a
-      SIGTERM kill signal. Otherwise, the Eggdrop will just save its userfile
-      and rehash.
-
-
     unbind dcc n tcl *dcc:tcl
     unbind dcc n set *dcc:set
       Comment these two lines if you wish to enable the .tcl and .set commands.
Index: eggdrop1.8/doc/tcl-commands.doc
diff -u eggdrop1.8/doc/tcl-commands.doc:1.4 eggdrop1.8/doc/tcl-commands.doc:1.5
--- eggdrop1.8/doc/tcl-commands.doc:1.4	Tue Oct 19 06:13:32 2010
+++ eggdrop1.8/doc/tcl-commands.doc	Sat Oct 23 05:16:12 2010
@@ -1,7 +1,7 @@
-$Id: tcl-commands.doc,v 1.4 2010/10/19 12:13:32 pseudo Exp $
+$Id: tcl-commands.doc,v 1.5 2010/10/23 11:16:12 pseudo Exp $
 
 Eggdrop Tcl Commands
-Last revised: November 23, 2009
+Last revised: October 22, 2010
     _____________________________________________________________________
 
                            Eggdrop Tcl Commands
@@ -2286,6 +2286,15 @@
 |          to '*'.
 |        Module: core
 
+|   (48) DIE (stackable)
+|        bind die <flags> <mask> <proc>
+|        proc-name <shutdownreason>
+|
+|        Description: triggered when eggdrop is about to die. The mask is
+|          matched against the shutdown reason. The bind won't be triggered if
+|          the bot crashes or is being terminated by SIGKILL.
+|        Module: core
+
   (B) RETURN VALUES
 
     Several bindings pay attention to the value you return from the proc
@@ -2350,6 +2359,9 @@
 |   (16) OUT   Return 1 to make Eggdrop drop the message instead of sending
 |              it. Only meaningful for messages with status "queued".
 
+|   (17) EVNT  Return 1 to make Eggdrop not to take the default action for
+|              the event. Used for signal type events, ignored for others.
+
 *** CONTROL PROCEDURES ***
 
   Using the 'control' command, you can put a DCC connection (or outgoing
Index: eggdrop1.8/eggdrop.conf
diff -u eggdrop1.8/eggdrop.conf:1.5 eggdrop1.8/eggdrop.conf:1.6
--- eggdrop1.8/eggdrop.conf:1.5	Tue Oct 19 06:13:32 2010
+++ eggdrop1.8/eggdrop.conf	Sat Oct 23 05:16:11 2010
@@ -1,7 +1,7 @@
 #! /path/to/executable/eggdrop
 # ^- This should contain a fully qualified path to your Eggdrop executable.
 #
-# $Id: eggdrop.conf,v 1.5 2010/10/19 12:13:32 pseudo Exp $
+# $Id: eggdrop.conf,v 1.6 2010/10/23 11:16:11 pseudo Exp $
 #
 # This is a sample Eggdrop configuration file which includes all possible
 # settings that can be used to configure your bot.
@@ -493,14 +493,6 @@
 # which provides commands for changing all of these.
 set whois-fields "url birthday"
 
-# Enable this setting if you want your Eggdrop to die upon receiving a SIGHUP
-# kill signal. Otherwise, the Eggdrop will just save its userfile and rehash.
-set die-on-sighup 0
-
-# Enable this setting if you want your Eggdrop to die upon receiving a SIGTERM
-# kill signal. Otherwise, the Eggdrop will just save its userfile and rehash.
-set die-on-sigterm 1
-
 # Uncomment these two lines if you wish to disable the .tcl and .set commands.
 # If you select your owners wisely, you should be okay enabling these.
 #unbind dcc n tcl *dcc:tcl
Index: eggdrop1.8/help/core.help
diff -u eggdrop1.8/help/core.help:1.3 eggdrop1.8/help/core.help:1.4
--- eggdrop1.8/help/core.help:1.3	Tue Oct 19 06:13:32 2010
+++ eggdrop1.8/help/core.help	Sat Oct 23 05:16:12 2010
@@ -186,27 +186,25 @@
 logfile-suffix
 quiet-save
 sort-users
-die-on-sighup
-die-on-sigterm
 remote-boots
 max-socks
+ident-timeout
+allow-dk-cmds
 max-logs
 protect-telnet
 switch-logfiles-at
 share-unlinks
-allow-dk-cmds
-ident-timeout
 ssl-privatekey
 ssl-certificate
 ssl-privatekey
 ssl-certificate
-ssl-verify-depth
 ssl-capath
 ssl-cafile
+ssl-verify-depth
 ssl-cert-auth
-ssl-verify-clients
 ssl-verify-bots
 ssl-verify-dcc
+ssl-verify-clients
 %{end}
    Use %b'.help set <variable>'%b for more info on each variable.
 %{help=all}%{-}
Index: eggdrop1.8/help/set/cmds1.help
diff -u eggdrop1.8/help/set/cmds1.help:1.3 eggdrop1.8/help/set/cmds1.help:1.4
--- eggdrop1.8/help/set/cmds1.help:1.3	Tue Oct 19 06:13:32 2010
+++ eggdrop1.8/help/set/cmds1.help	Sat Oct 23 05:16:12 2010
@@ -223,16 +223,6 @@
    If you want your userfile to be sorted upon saving, enable this
    setting. This causes the bot to use a bit more CPU when saving the
    userfile.
-%{help=set die-on-sighup}%{+n}
-###  %bset die-on-sighup%b <0/1>
-   Enable this setting if you want your Eggdrop to die upon receiving
-   a SIGHUP kill signal. Otherwise, the Eggdrop will just save its
-   userfile and rehash.
-%{help=set die-on-sigterm}%{+n}
-###  %bset die-on-sigterm%b <0/1>
-   Enable this setting if you want your Eggdrop to die upon receiving
-   a SIGTERM kill signal. Otherwise, the Eggdrop will just save its
-   userfile and rehash.
 %{help=set remote-boots}%{+n}
 ###  %bset remote-boots%b <0/1>
    This setting defines whether or not people can boot users on the
Index: eggdrop1.8/src/main.c
diff -u eggdrop1.8/src/main.c:1.5 eggdrop1.8/src/main.c:1.6
--- eggdrop1.8/src/main.c:1.5	Tue Oct 19 08:20:56 2010
+++ eggdrop1.8/src/main.c	Sat Oct 23 05:16:12 2010
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.5 2010/10/19 14:20:56 pseudo Exp $
+ * $Id: main.c,v 1.6 2010/10/23 11:16:12 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -127,8 +127,6 @@
 char egg_xtra[2048]; /* Patch info                */
 
 int do_restart = 0;       /* .restart has been called, restart ASAP */
-int die_on_sighup = 0;    /* Die if bot receives SIGHUP             */
-int die_on_sigterm = 1;   /* Die if bot receives SIGTERM            */
 int resolve_timeout = 15; /* Hostname/address lookup timeout        */
 char quit_msg[1024];      /* Quit message                           */
 
@@ -181,9 +179,9 @@
   ssl_cleanup();
 #endif
   unlink(pid_file);
-  if (!recoverable) {
+  if (recoverable != 1) {
     bg_send_quit(BG_ABORT);
-    exit(1);
+    exit(!recoverable);
   }
 }
 
@@ -381,30 +379,29 @@
 
 static void got_term(int z)
 {
-  write_userfile(-1);
-  check_tcl_event("sigterm");
-  if (die_on_sigterm) {
-    botnet_send_chat(-1, botnetnick, "ACK, I've been terminated!");
-    fatal("TERMINATE SIGNAL -- SIGNING OFF", 0);
-  } else
-    putlog(LOG_MISC, "*", "RECEIVED TERMINATE SIGNAL (IGNORING)");
+  /* Now we die by default on sigterm, but scripts have the chance to
+   * catch the event themselves and cancel shutdown by returning 1
+   */
+  if (check_tcl_event("sigterm"))
+    return;
+  kill_bot("ACK, I've been terminated!", "TERMINATE SIGNAL -- SIGNING OFF");
 }
 
 static void got_quit(int z)
 {
-  check_tcl_event("sigquit");
-  putlog(LOG_MISC, "*", "RECEIVED QUIT SIGNAL (IGNORING)");
+  if (check_tcl_event("sigquit"))
+    return;
+  putlog(LOG_MISC, "*", "Received QUIT signal: restarting...");
+  do_restart = -1;
   return;
 }
 
 static void got_hup(int z)
 {
   write_userfile(-1);
-  check_tcl_event("sighup");
-  if (die_on_sighup) {
-    fatal("HANGUP SIGNAL -- SIGNING OFF", 0);
-  } else
-    putlog(LOG_MISC, "*", "Received HUP signal: rehashing...");
+  if (check_tcl_event("sighup"))
+    return;
+  putlog(LOG_MISC, "*", "Received HUP signal: rehashing...");
   do_restart = -2;
   return;
 }
Index: eggdrop1.8/src/misc.c
diff -u eggdrop1.8/src/misc.c:1.1.1.1 eggdrop1.8/src/misc.c:1.2
--- eggdrop1.8/src/misc.c:1.1.1.1	Mon Jul 26 15:11:06 2010
+++ eggdrop1.8/src/misc.c	Sat Oct 23 05:16:12 2010
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.1.1.1 2010/07/26 21:11:06 simple Exp $
+ * $Id: misc.c,v 1.2 2010/10/23 11:16:12 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1555,10 +1555,11 @@
  */
 void kill_bot(char *s1, char *s2)
 {
+  check_tcl_die(s2);
   call_hook(HOOK_DIE);
   chatout("*** %s\n", s1);
   botnet_send_chat(-1, botnetnick, s1);
   botnet_send_bye();
   write_userfile(-1);
-  fatal(s2, 0);
+  fatal(s2, 2);
 }
Index: eggdrop1.8/src/mod/module.h
diff -u eggdrop1.8/src/mod/module.h:1.4 eggdrop1.8/src/mod/module.h:1.5
--- eggdrop1.8/src/mod/module.h:1.4	Wed Oct 20 07:07:13 2010
+++ eggdrop1.8/src/mod/module.h	Sat Oct 23 05:16:13 2010
@@ -1,7 +1,7 @@
 /*
  * module.h
  *
- * $Id: module.h,v 1.4 2010/10/20 13:07:13 pseudo Exp $
+ * $Id: module.h,v 1.5 2010/10/23 11:16:13 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -210,7 +210,7 @@
 #define get_data_ptr(x) ((void *(*)(int,char*,int))global[86])(x,__FILE__,__LINE__)
 #define open_telnet ((int (*) (int, char *, int))global[87])
 /* 88 - 91 */
-#define check_tcl_event ((void * (*) (const char *))global[88])
+#define check_tcl_event ((int * (*) (const char *))global[88])
 #define my_memcpy ((void * (*) (void *, const void *, size_t))global[89])
 #define my_atoul ((IP(*)(char *))global[90])
 #define my_strcpy ((int (*)(char *, const char *))global[91])
Index: eggdrop1.8/src/patch.h
diff -u eggdrop1.8/src/patch.h:1.13 eggdrop1.8/src/patch.h:1.14
--- eggdrop1.8/src/patch.h:1.13	Wed Oct 20 07:07:13 2010
+++ eggdrop1.8/src/patch.h	Sat Oct 23 05:16:12 2010
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.13 2010/10/20 13:07:13 pseudo Exp $
+ * $Id: patch.h,v 1.14 2010/10/23 11:16:12 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1287576554");            /* current unixtime */
+patch("1287832418");            /* current unixtime */
 /*
  *
  *
  */
-patch("opentelnet");
+patch("binddie");
 /*
  *
  *
Index: eggdrop1.8/src/tcl.c
diff -u eggdrop1.8/src/tcl.c:1.4 eggdrop1.8/src/tcl.c:1.5
--- eggdrop1.8/src/tcl.c:1.4	Tue Oct 19 06:13:33 2010
+++ eggdrop1.8/src/tcl.c	Sat Oct 23 05:16:13 2010
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  *
- * $Id: tcl.c,v 1.4 2010/10/19 12:13:33 pseudo Exp $
+ * $Id: tcl.c,v 1.5 2010/10/23 11:16:13 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -56,11 +56,11 @@
            require_p, keep_all_logs, allow_new_telnets, stealth_telnets,
            use_telnet_banner, default_flags, conmask, switch_logfiles_at,
            connect_timeout, firewallport, notify_users_at, flood_thr, tands,
-           ignore_time, reserved_port_min, reserved_port_max, die_on_sighup,
-           die_on_sigterm, max_logs, max_logsize, dcc_total, raw_log,
-           identtimeout, dcc_sanitycheck, dupwait_timeout, egg_numver,
-           share_unlinks, protect_telnet, sort_users, strict_host,
-           resolve_timeout, default_uflags, userfile_perm, cidr_support;
+           ignore_time, reserved_port_min, reserved_port_max, max_logs,
+           max_logsize, dcc_total, raw_log, identtimeout, dcc_sanitycheck,
+           dupwait_timeout, egg_numver, share_unlinks, protect_telnet,
+           sort_users, strict_host, resolve_timeout, default_uflags,
+           userfile_perm, cidr_support;
 
 #ifdef IPV6
 extern char vhost6[];
@@ -550,8 +550,6 @@
   {"console",               &conmask,              0},
   {"default-flags",         &default_flags,        0},
   {"numversion",            &egg_numver,           2},
-  {"die-on-sighup",         &die_on_sighup,        1},
-  {"die-on-sigterm",        &die_on_sigterm,       1},
   {"remote-boots",          &remote_boots,         1},
   {"max-socks",             &max_socks,            0},
   {"max-logs",              &max_logs,             0},
Index: eggdrop1.8/src/tclhash.c
diff -u eggdrop1.8/src/tclhash.c:1.2 eggdrop1.8/src/tclhash.c:1.3
--- eggdrop1.8/src/tclhash.c:1.2	Tue Oct 19 06:13:33 2010
+++ eggdrop1.8/src/tclhash.c	Sat Oct 23 05:16:13 2010
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.2 2010/10/19 12:13:33 pseudo Exp $
+ * $Id: tclhash.c,v 1.3 2010/10/23 11:16:13 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,7 +41,7 @@
 p_tcl_bind_list bind_table_list;
 p_tcl_bind_list H_chat, H_act, H_bcst, H_chon, H_chof, H_load, H_unld, H_link,
                 H_disc, H_dcc, H_chjn, H_chpt, H_bot, H_time, H_nkch, H_away,
-                H_note, H_filt, H_event, H_cron, H_log = NULL;
+                H_note, H_filt, H_event, H_die, H_cron, H_log = NULL;
 #ifdef TLS
 p_tcl_bind_list H_tls = NULL;
 static int builtin_idx();
@@ -241,6 +241,7 @@
   H_away = add_bind_table("away", HT_STACKABLE, builtin_chat);
   H_act = add_bind_table("act", HT_STACKABLE, builtin_chat);
   H_event = add_bind_table("evnt", HT_STACKABLE, builtin_char);
+  H_die = add_bind_table("die", HT_STACKABLE, builtin_char);
   H_log = add_bind_table("log", HT_STACKABLE, builtin_log);
 #ifdef TLS
   H_tls = add_bind_table("tls", HT_STACKABLE, builtin_idx);
@@ -1180,10 +1181,20 @@
                  MATCH_CRON | BIND_STACKABLE);
 }
 
-void check_tcl_event(const char *event)
+int check_tcl_event(const char *event)
 {
+  int x;
+
   Tcl_SetVar(interp, "_event1", (char *) event, 0);
-  check_tcl_bind(H_event, event, 0, " $_event1", MATCH_EXACT | BIND_STACKABLE);
+  x = check_tcl_bind(H_event, event, 0, " $_event1",
+                 MATCH_EXACT | BIND_STACKABLE | BIND_WANTRET);
+  return (x == BIND_EXEC_LOG);
+}
+
+void check_tcl_die(char *reason)
+{
+  Tcl_SetVar(interp, "_die1", reason, 0);
+  check_tcl_bind(H_die, reason, 0, " $_die1", MATCH_MASK | BIND_STACKABLE);
 }
 
 void check_tcl_log(int lv, char *chan, char *msg)
Index: eggdrop1.8/src/tclhash.h
diff -u eggdrop1.8/src/tclhash.h:1.2 eggdrop1.8/src/tclhash.h:1.3
--- eggdrop1.8/src/tclhash.h:1.2	Tue Oct 19 06:13:33 2010
+++ eggdrop1.8/src/tclhash.h	Sat Oct 23 05:16:13 2010
@@ -1,7 +1,7 @@
 /*
  * tclhash.h
  *
- * $Id: tclhash.h,v 1.2 2010/10/19 12:13:33 pseudo Exp $
+ * $Id: tclhash.h,v 1.3 2010/10/23 11:16:13 pseudo Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -102,7 +102,8 @@
 void check_tcl_nkch(const char *, const char *);
 void check_tcl_away(const char *, int, const char *);
 void check_tcl_chatactbcst(const char *, int, const char *, tcl_bind_list_t *);
-void check_tcl_event(const char *);
+int check_tcl_event(const char *);
+void check_tcl_die(char *);
 void check_tcl_log(int, char *, char *);
 #ifdef TLS
 int check_tcl_tls(int);
----------------------- End of diff -----------------------


More information about the Changes mailing list