[cvslog] (2006-11-21 01:38:51 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Mon Nov 20 19:38:51 CST 2006


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2006-11-21 01:38:51 UTC
Commited by: sven

Modified files:
     Doxyfile lib/eggdrop/botnet.c src/core_binds.c

Log message:

Added a few aliases to the Doxygen file to help generate a full list of all
binds:

\bind to create a new page listing all documented binds on a single page
      linked from "Related Pages"

\name, \flags, \match to add a paragraph for the Name, Flags and Matches

\stackable, \breakable to add a note stating the bind is stackable/breakable

\noparam, \noreturn to add a paragraph stating the bind has no parameters/return value

Documented the binds used in core and botnet. Look at the changelog for an
example of how to use them. Here's an example of the
doxygen output: http://www.semidefinite.de/eggdropDocs/bind.html

---------------------- diff included ----------------------
Index: eggdrop1.9/Doxyfile
diff -u eggdrop1.9/Doxyfile:1.1 eggdrop1.9/Doxyfile:1.2
--- eggdrop1.9/Doxyfile:1.1	Tue Nov 14 08:51:22 2006
+++ eggdrop1.9/Doxyfile	Mon Nov 20 19:38:40 2006
@@ -158,7 +158,14 @@
 # will result in a user-defined paragraph with heading "Side Effects:". 
 # You can put \n's in the value part of an alias to insert newlines.
 
-ALIASES                = 
+ALIASES                = "bind=\xrefitem bind \"Bind\" \"Bind List\""
+ALIASES               += "name=\par \"Name:\" "
+ALIASES               += "flags=\par \"Flags:\" "
+ALIASES               += "match=\par \"Match:\" "
+ALIASES               += "stackable=\par \"Note:\" This bind is stackable."
+ALIASES               += "breakable=\par \"Note:\" This bind is stackable and breakable."
+ALIASES               += "noparam=\par \"Parameters:\" None."
+ALIASES               += "noreturn=\return Any return value will be ignored."
 
 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
 # only. Doxygen will then generate output that is more tailored for C. 
Index: eggdrop1.9/lib/eggdrop/botnet.c
diff -u eggdrop1.9/lib/eggdrop/botnet.c:1.1 eggdrop1.9/lib/eggdrop/botnet.c:1.2
--- eggdrop1.9/lib/eggdrop/botnet.c:1.1	Tue Nov 14 08:51:23 2006
+++ eggdrop1.9/lib/eggdrop/botnet.c	Mon Nov 20 19:38:41 2006
@@ -28,7 +28,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: botnet.c,v 1.1 2006-11-14 14:51:23 sven Exp $";
+static const char rcsid[] = "$Id: botnet.c,v 1.2 2006-11-21 01:38:41 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -56,7 +56,55 @@
 //	{0}
 //};
 
-static bind_table_t *BT_request_link, *BT_link = NULL, *BT_disc = NULL;
+/*!
+ * \bind
+ * This bind is triggered every time the bot wants to link to another bot for
+ * some reason.
+ * \name request-link
+ * \flags Ignored.
+ * \match The bot's type.
+ * \param user The user record of the bot to be linked.
+ * \param string The type of the bot. (Same as the match.)
+ * \breakable
+ * \return A function should return ::BIND_RET_BREAK if it tried to establish a
+ *         link or 0 otherwise.
+ */
+
+static bind_table_t *BT_request_link;
+
+/*!
+ * \bind
+ * This bind is triggered every time a new bot is somehow linked to the botnet.
+ * There is no way to determine if it happened because it was directly linked
+ * or because another bot was linked and introduced it.
+ * \name link
+ * \flags Ignored.
+ * \match The new bot's name.
+ * \param bot The new bot.
+ * \stackable
+ * \noreturn
+ */
+
+static bind_table_t *BT_link;
+
+/*!
+ * \bind
+ * This bind is triggered every time a bot is lost from the botnet. If a bot
+ * gets disconnected this bind is triggered for all bots behind the lost one
+ * first, beginning with the most distant bots. That means that for some bots
+ * this bind is triggered for, the uplink still exists in this bots database
+ * even though it has already been lost.
+ * \name disc
+ * \flags Ignored.
+ * \match The lost bot's name.
+ * \param bot The lost bot.
+ * \param bot The bot that really got disconnected and caused the bots behind it to get lost.
+ * \param string Some kind of reason for the disconnect.
+ * \stackable
+ * \return Any return value will be ignored.
+ */
+
+static bind_table_t *BT_disc;
 
 /*!
  * \brief Inits the whole botnet stuff
@@ -74,7 +122,7 @@
 	bot_ht = hash_table_create(NULL, NULL, 13, HASH_TABLE_STRINGS);
 
 	BT_request_link = bind_table_add(BTN_BOTNET_REQUEST_LINK, 2, "Us", MATCH_MASK, BIND_BREAKABLE);
-	BT_link = bind_table_add(BTN_BOTNET_LINK, 2, "B", MATCH_MASK, BIND_STACKABLE);
+	BT_link = bind_table_add(BTN_BOTNET_LINK, 1, "B", MATCH_MASK, BIND_STACKABLE);
 	BT_disc = bind_table_add(BTN_BOTNET_DISC, 3, "BBs", MATCH_MASK, BIND_STACKABLE);
 	return 0;
 }
@@ -242,7 +290,7 @@
 		if (tmp->handler && tmp->handler->on_new_bot) tmp->handler->on_new_bot(tmp->client_data, bot, netburst);
 	}
 
-	bind_check(BT_link, NULL, bot->name, bot, bot->user);
+	bind_check(BT_link, NULL, bot->name, bot);
 
 	if (!netburst) {
 		if (!bot->uplink) putlog(LOG_MISC, "*", "Linked to %s.", bot->name);
Index: eggdrop1.9/src/core_binds.c
diff -u eggdrop1.9/src/core_binds.c:1.18 eggdrop1.9/src/core_binds.c:1.19
--- eggdrop1.9/src/core_binds.c:1.18	Wed Jun 30 12:07:20 2004
+++ eggdrop1.9/src/core_binds.c	Mon Nov 20 19:38:41 2006
@@ -20,9 +20,89 @@
 #include <eggdrop/eggdrop.h>
 #include "core_binds.h"			/* prototypes		*/
 
-static bind_table_t *BT_time = NULL,
-	*BT_secondly = NULL,
-	*BT_status = NULL, *BT_init = NULL, *BT_shutdown = NULL;
+/*!
+ * \bind
+ * This bind is triggered once a minute. It is similar to ::BT_event minutely
+ * but lets you match a specified date and time.
+ * \name time
+ * \flags Ignored.
+ * \match The currect date and time in the format: "minute hour day month year".
+ *        All fields except for "year" are two digit numbers including a leading
+ *        0 if necessary. "hour" is a number in 24 hour format between 0 and 23.
+ *        "year" is a full 4 digit number.
+ * \param int The "minute" field of the match string.
+ * \param int The "hour" field of the match string.
+ * \param int The "day" field of the match string.
+ * \param int The "month" field of the match string.
+ * \param int The "year" field of the match string.
+ * \stackable
+ * \noreturn
+ */
+
+static bind_table_t *BT_time = NULL;
+
+/*!
+ * \bind
+ * This bind is triggered once every second. The bind is not triggered one second
+ * after the time it was triggered last but one second after the time it should
+ * have been triggered last. So it should be triggered 60 times per minute on avarage.
+ * You should \b never do anything that \a might take longer than one second to
+ * execute here.
+ * \name secondly
+ * \flags Ignored.
+ * \match None.
+ * \noparam
+ * \stackable
+ * \noreturn
+ */
+
+static bind_table_t *BT_secondly = NULL;
+
+/*!
+ * \bind
+ * This bind is triggered every time a local partymember executes the ".status"
+ * command on the partyline.
+ * \name status
+ * \flags Ignored.
+ * \match None.
+ * \param partymember The partymember who typed ".status" on the partyline.
+ * \param string Whatever the user typed after ".status".
+ * \stackable
+ * \noreturn
+ * \bug The flags and match shouldn't be ignored, right?
+ */
+
+static bind_table_t *BT_status = NULL;
+
+/*!
+ * \bind
+ * This bind is triggered when the bot is originally started and then every
+ * time after a restart. It's impossible to tell which of the two just happened.
+ * \name init
+ * \flags Ignored.
+ * \match None.
+ * \noparam
+ * \stackable
+ * \noreturn
+ * \bug Should there be a way to tell a start from a restart?
+ */
+
+static bind_table_t *BT_init = NULL;
+
+/*!
+ * \bind
+ * This bind is triggered when the bot shuts down and before every restart.
+ * It's impossible to tell which of the two just happened.
+ * \name shutdown
+ * \flags Ignored.
+ * \match None.
+ * \noparam
+ * \stackable
+ * \noreturn
+ * \bug Should there be a way to tell a shutdown from a restart?
+ */
+
+static bind_table_t *BT_shutdown = NULL;
 
 int core_binds_init(void)
 {
@@ -64,8 +144,8 @@
 {
 	char full[32];
 
-	sprintf(full, "%02d %02d %02d %02d %04d", tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon, tm->tm_year + 1900);
-	bind_check(BT_time, NULL, full, tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon, tm->tm_year + 1900);
+	sprintf(full, "%02d %02d %02d %02d %04d", tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900);
+	bind_check(BT_time, NULL, full, tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900);
 }
 
 void check_bind_secondly()
----------------------- End of diff -----------------------



More information about the Changes mailing list