src/core_binds.c File Reference

#include <eggdrop/eggdrop.h>
#include "core_binds.h"

Go to the source code of this file.

Functions

int core_binds_init (void)
int core_binds_shutdown (void)
void check_bind_init (void)
void check_bind_shutdown (void)
void check_bind_time (struct tm *tm)
void check_bind_secondly ()
void check_bind_status (partymember_t *p, const char *text)

Variables

static bind_table_tBT_time = NULL
static bind_table_tBT_secondly = NULL
static bind_table_tBT_status = NULL
static bind_table_tBT_init = NULL
static bind_table_tBT_shutdown = NULL


Function Documentation

void check_bind_init ( void   ) 

Definition at line 129 of file core_binds.c.

References bind_check(), egg_assert, and NULL.

Referenced by core_init().

00130 {
00131   egg_assert(BT_init != NULL);
00132 
00133   bind_check (BT_init, NULL, NULL);
00134 }

void check_bind_secondly (  ) 

Definition at line 151 of file core_binds.c.

References bind_check(), and NULL.

Referenced by core_secondly().

00152 {
00153   bind_check(BT_secondly, NULL, NULL);
00154 }

void check_bind_shutdown ( void   ) 

Definition at line 136 of file core_binds.c.

References bind_check(), egg_assert, and NULL.

Referenced by core_shutdown_or_restart().

00137 {
00138   egg_assert(BT_shutdown != NULL);
00139 
00140   bind_check (BT_shutdown, NULL, NULL);
00141 }

void check_bind_status ( partymember_t p,
const char *  text 
)

Definition at line 156 of file core_binds.c.

References bind_check(), and NULL.

Referenced by party_status().

00157 {
00158   bind_check(BT_status, NULL, NULL, p, text);
00159 }

void check_bind_time ( struct tm *  tm  ) 

Definition at line 143 of file core_binds.c.

References bind_check(), and NULL.

Referenced by core_secondly().

00144 {
00145   char full[32];
00146 
00147   sprintf(full, "%02d %02d %02d %02d %04d", tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900);
00148   bind_check(BT_time, NULL, full, tm->tm_min, tm->tm_hour, tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900);
00149 }

int core_binds_init ( void   ) 

int core_binds_shutdown ( void   ) 

Definition at line 118 of file core_binds.c.

References bind_table_del().

Referenced by core_shutdown_or_restart().

00119 {
00120   bind_table_del(BT_status);
00121   bind_table_del(BT_secondly);
00122   bind_table_del(BT_time);
00123   bind_table_del(BT_shutdown);
00124   bind_table_del(BT_init);
00125 
00126   return (0);
00127 }


Variable Documentation

bind_table_t* BT_init = NULL [static]

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.
Parameters:
None.
Note:
This bind is stackable.
Returns:
Any return value will be ignored.
Bug:
Should there be a way to tell a start from a restart?

Definition at line 90 of file core_binds.c.

bind_table_t* BT_secondly = NULL [static]

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 never do anything that might take longer than one second to execute here.
Name:
secondly
Flags:
Ignored.
Match:
None.
Parameters:
None.
Note:
This bind is stackable.
Returns:
Any return value will be ignored.

Definition at line 59 of file core_binds.c.

bind_table_t* BT_shutdown = NULL [static]

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.
Parameters:
None.
Note:
This bind is stackable.
Returns:
Any return value will be ignored.
Bug:
Should there be a way to tell a shutdown from a restart?

Definition at line 105 of file core_binds.c.

bind_table_t* BT_status = NULL [static]

Bind:
This bind is triggered every time a local partymember executes the ".status" command on the partyline.
Name:
status
Flags:
Ignored.
Match:
None.
Parameters:
partymember The partymember who typed ".status" on the partyline.
string Whatever the user typed after ".status".
Note:
This bind is stackable.
Returns:
Any return value will be ignored.
Bug:
The flags and match shouldn't be ignored, right?

Definition at line 75 of file core_binds.c.

bind_table_t* BT_time = NULL [static]

Bind:
This bind is triggered once a minute. It is similar to BT_event minutely but allows you to 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.
Parameters:
int The "minute" field of the match string.
int The "hour" field of the match string.
int The "day" field of the match string.
int The "month" field of the match string.
int The "year" field of the match string.
Note:
This bind is stackable.
Returns:
Any return value will be ignored.

Definition at line 42 of file core_binds.c.


Generated on Sun Nov 30 18:43:36 2008 for eggdrop1.9 by  doxygen 1.5.6