]> git.pond.sub.org Git - empserver/blob - include/tel.h
Update copyright notice
[empserver] / include / tel.h
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                           Ken Stevens, Steve McClure
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  *  ---
21  *
22  *  See files README, COPYING and CREDITS in the root of the source
23  *  tree for related information and legal notices.  It is expected
24  *  that future projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  tel.h: Definitions for things having to do with telegrams
29  *
30  *  Known contributors to this file:
31  *     Markus Armbruster, 2009
32  */
33
34 #ifndef TEL_H
35 #define TEL_H
36
37 #include <stdio.h>
38 #include <time.h>
39 #include "types.h"
40
41 #define MAXTELSIZE      1024    /* doesn't apply to TEL_UPDATE */
42
43 #define TEL_NORM        0       /* normal */
44 #define TEL_ANNOUNCE    1       /* announcement */
45 #define TEL_BULLETIN    2       /* bulletin */
46 #define TEL_UPDATE      3       /* update message */
47 #define TEL_LAST        3
48
49 #define TEL_SECONDS 5           /* how many seconds before starting a new telegram */
50
51 struct telstr {
52     natid tel_from;             /* sender */
53     unsigned char tel_type;
54     unsigned tel_length;        /* how long */
55     time_t tel_date;            /* when sent */
56 };
57
58 extern char *mailbox(char *buf, natid cn);
59 extern int tel_read_header(FILE *, char *, struct telstr *);
60 extern int tel_read_body(FILE *, char *, struct telstr *,
61                          int (*sink)(char *, size_t, void *),
62                          void *);
63
64 #endif