1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
/*
* motd.h
*
*
*/
#ifndef INCLUDED_motd_h
#define INCLUDED_motd_h
#ifndef INCLUDED_ircd_defs_h
#include "ircd_defs.h" /* MAX_DATE_STRING */
#endif
#ifndef INCLUDED_limits_h
#include <limits.h> /* PATH_MAX */
#define INCLUDED_limits_h
#endif
#include <sys/types.h>
#define MESSAGELINELEN 89
typedef enum {
USER_MOTD,
OPER_MOTD,
HELP_MOTD
} MotdType;
struct MessageFileLine
{
char line[MESSAGELINELEN + 1];
struct MessageFileLine* next;
};
typedef struct MessageFileLine MessageFileLine;
struct MessageFile
{
char fileName[PATH_MAX + 1];
MotdType motdType;
MessageFileLine* contentsOfFile;
char lastChangedDate[MAX_DATE_STRING + 1];
};
typedef struct MessageFile MessageFile;
struct Client;
void InitMessageFile(MotdType, const char *, struct MessageFile *);
int SendMessageFile(struct Client *, struct MessageFile *);
int ReadMessageFile(MessageFile *);
size_t count_message_file(MessageFile *);
#endif /* INCLUDED_motd_h */
|