vote.h
./vote-1.01/vote.h · 2.3 KB
From the archive vote-1.01.tar.gz
Download the archive « Back to the archive contents
/**************************************************************************
* Voting system designed and written for use on Legend of the Nobles *
* by Valnir (valnir@legendofthenobles.com). *
* *
* - http://www.legendofthenobles.com *
* - telnet://game.legendofthebobles.com:5400 *
* *
* This code is free for use by any person wishing to use it with the *
* restriction that this information is kept intact and unchanged. *
* Original version created on 05-26-2004 *
**************************************************************************/
#define POLL_CREDITS "Voting system designed and written for use on Legend of the Nobles\n\r" \
" by Valnir (valnir@legendofthenobles.com).\n\r" \
"\n\r" \
"- http://www.legendofthenobles.com\n\r" \
"- telnet://game.legendofthebobles.com:5400\n\r\n\r"
/* definitions */
#define POLL_FILE "polls.dat" /* actual data file */
#define MAX_CHOICE 15
#define PEDIT( fun ) bool fun( CHAR_DATA *ch, char *argument )
/* define poll->flags */
#define POLL_HIDDEN (A)
#define POLL_PUBLISHED (B)
#define POLL_DELETE (C)
#define POLL_CHANGED (D)
typedef struct poll_type POLL_DATA;
#define KEY( literal, field, value ) \
if ( !str_cmp( string, literal ) ) \
{ \
field = value; \
fMatch = TRUE; \
break; \
}
/*
* Skill / Spell Group definition
*/
struct poll_type
{
POLL_DATA * next;
bool valid;
char * topic;
char * to;
char * creator;
long open;
long close;
long created;
int flags;
int id;
char * choice[MAX_CHOICE];
sh_int votes[MAX_CHOICE];
};
const struct olc_cmd_type pedit_table[] =
{
/* { command function }, */
{ "show", pedit_show },
{ "list", pedit_list },
{ "create", pedit_create },
{ "to", pedit_to },
{ "topic", pedit_topic },
{ "open", pedit_open },
{ "close", pedit_close },
{ "reopen", pedit_reopen },
{ "choice", pedit_choice },
{ "publish", pedit_publish },
{ "delete", pedit_delete },
{ "credits", pedit_credits },
{ NULL, 0 }
};