/************************************************************************ Realms of Aurealis James Rhone aka Vall of RoA boards.h Header file, function prototypes, defines, structures and the like for the board system. ******** Heavily modified and expanded ******** *** BE AWARE OF ALL RIGHTS AND RESERVATIONS *** ******** Heavily modified and expanded ******** All rights reserved henceforth. Please note that no guarantees are associated with any code from Realms of Aurealis. All code which has been released to the general public has been done so with an 'as is' pretense. RoA is based on both Diku and CircleMUD and ALL licenses from both *MUST* be adhered to as well as the RoA license. *** Read, Learn, Understand, Improve *** *************************************************************************/ #ifndef ROA_BOARDS_H #define ROA_BOARDS_H // structures typedef struct master_index { BOOL used; // is this slot being used ? char *msg; // ptr to actual char string } bindex; typedef struct board_msginfo { int slot_num; /* pos of message in "master index" */ char *heading; /* pointer to message's heading */ int level; /* level of poster */ int heading_len; /* size of header (for file write) */ int message_len; /* size of message text (for file write) */ } bmsginfo; typedef struct board_info_type { int vnum; /* vnum of this board */ int read_lvl; /* min level to read messages on this board */ int write_lvl; /* min level to write messages on this board */ int remove_lvl; /* min level to remove messages from this board */ BOOL valid; // is this a valid board slot? int num_msgs; // how many messages on this board right now? } binfotype; // defines #define BOARD_CONFIG_FILE "config/boards.cfg" #define BOARD_DIR "boards" #define MAX_BOARDS 20 #define MAX_BOARD_MESSAGES 40 /* arbitrary */ #define MAX_MESSAGE_LENGTH 4096 /* arbitrary */ #define MAX_MSGS ((MAX_BOARDS*MAX_BOARD_MESSAGES) + 5) #define B_VNUM(i) (board_info[i].vnum) #define B_MSGS(i) (board_info[i].num_msgs) #define READ_LVL(i) (board_info[i].read_lvl) #define WRITE_LVL(i) (board_info[i].write_lvl) #define REMOVE_LVL(i) (board_info[i].remove_lvl) #define B_VALID(i) (board_info[i].valid) #define MESSAGE(i, j) (msg_index[i][j]) #define NEW_MSG_INDEX(i) (MESSAGE(i, B_MSGS(i))) #define MSG_HEADING(i, j) (MESSAGE(i, j).heading) #define MSG_SLOTNUM(i, j) (MESSAGE(i, j).slot_num) #define MSG_LEVEL(i, j) (MESSAGE(i, j).level) // to know which board to save after done writing #define BOARD_WRITING(ch) ((ch)->pc_specials->index) // function prototypes... int Board_display_msg(int board_type, chdata *ch, char *arg); int Board_show_board(int board_type, chdata *ch, char *arg); int Board_remove_msg(int board_type, chdata *ch, char *arg); void Board_save_board(int board_type); void Board_load_board(int board_type); void Board_reset_board(int board_num); void Board_write_message(int board_type, chdata *ch, char *arg); int board_interaction(chdata *ch, char *arg, int cmd); BOOL board_in_room(int rnum); void init_boards(void); #endif // ROA_BOARDS_H