| 1 | /* |
| 2 | * Copyright (C) 2000 Alexey Belyaev ([email protected]) |
| 3 | * Copyright (C) 2004 Dizzy |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef INCLUDED_NEWS_TYPES |
| 21 | #define INCLUDED_NEWS_TYPES |
| 22 | |
| 23 | #include <ctime> |
| 24 | #include "common/elist.h" |
| 25 | #include "common/lstr.h" |
| 26 | |
| 27 | namespace pvpgn |
| 28 | { |
| 29 | |
| 30 | namespace bnetd |
| 31 | { |
| 32 | |
| 33 | typedef struct news_index |
| 34 | #ifdef NEWS_INTERNAL_ACCESS |
| 35 | { |
| 36 | std::time_t date; |
| 37 | t_lstr body; |
| 38 | t_elist list; |
| 39 | } |
| 40 | #endif |
| 41 | t_news_index; |
| 42 | |
| 43 | typedef int(*t_news_cb)(std::time_t, t_lstr *, void *); |
| 44 | |
| 45 | } |
| 46 | |
| 47 | } |
| 48 | |
| 49 | |
| 50 | #endif |
| 51 | |
| 52 | /*****/ |
| 53 | #ifndef JUST_NEED_TYPES |
| 54 | #ifndef NEWS_INTERNAL_ACCESS |
| 55 | #define NEWS_INTERNAL_ACCESS |
| 56 | |
| 57 | namespace pvpgn |
| 58 | { |
| 59 | |
| 60 | namespace bnetd |
| 61 | { |
| 62 | |
| 63 | extern int news_load(const char *filename); |
| 64 | extern int news_unload(void); |
| 65 | |
| 66 | extern unsigned int news_get_firstnews(void); |
| 67 | extern unsigned int news_get_lastnews(void); |
| 68 | |
| 69 | extern void news_traverse(t_news_cb cb, void *data); |
| 70 | |
| 71 | } |
| 72 | |
| 73 | } |
| 74 | |
| 75 | #endif |
| 76 | #endif |