1 |
/* |
2 |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
* motd.h: A header for the MOTD functions. |
4 |
* |
5 |
* Copyright (C) 2002 by the past and present ircd coders, and others. |
6 |
* |
7 |
* This program is free software; you can redistribute it and/or modify |
8 |
* it under the terms of the GNU General Public License as published by |
9 |
* the Free Software Foundation; either version 2 of the License, or |
10 |
* (at your option) any later version. |
11 |
* |
12 |
* This program is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with this program; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
20 |
* USA |
21 |
* |
22 |
* $Id$ |
23 |
*/ |
24 |
|
25 |
#ifndef INCLUDED_motd_h |
26 |
#define INCLUDED_motd_h |
27 |
#include "ircd_defs.h" |
28 |
|
29 |
|
30 |
#define MESSAGELINELEN 256 |
31 |
|
32 |
struct MessageFileLine |
33 |
{ |
34 |
char line[MESSAGELINELEN + 1]; |
35 |
struct MessageFileLine *next; |
36 |
}; |
37 |
|
38 |
typedef struct MessageFileLine MessageFileLine; |
39 |
|
40 |
typedef enum { |
41 |
USER_MOTD, |
42 |
USER_LINKS, |
43 |
OPER_MOTD, |
44 |
ISSUPPORT |
45 |
} MotdType; |
46 |
|
47 |
struct MessageFile |
48 |
{ |
49 |
MotdType motdType; |
50 |
MessageFileLine *contentsOfFile; |
51 |
char fileName[PATH_MAX + 1]; |
52 |
char lastChangedDate[MAX_DATE_STRING + 1]; |
53 |
}; |
54 |
|
55 |
typedef struct MessageFile MessageFile; |
56 |
|
57 |
struct Client; |
58 |
|
59 |
extern void init_message_file(MotdType, const char *, struct MessageFile *); |
60 |
extern int send_message_file(struct Client *, struct MessageFile *); |
61 |
extern int read_message_file(MessageFile *); |
62 |
extern MessageFile *init_MessageLine(void); |
63 |
extern void addto_MessageLine(MessageFile *, const char *); |
64 |
extern void destroy_MessageLine(MessageFile *); |
65 |
|
66 |
#endif /* INCLUDED_motd_h */ |