1 /*
2  * Copyright (C) 1999  Ross Combs (rocombs@cs.nmsu.edu)
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17  */
18 #ifndef INCLUDED_ADBANNER_TYPES
19 #define INCLUDED_ADBANNER_TYPES
20 
21 #include "common/tag.h"
22 
23 typedef struct adbanner
24 #ifdef ADBANNER_INTERNAL_ACCESS
25 {
26     unsigned int id;
27     unsigned int extensiontag;
28     unsigned int delay; /* in seconds */
29     unsigned int next; /* adid or 0 */
30     char const * filename;
31     char const * link;
32     t_clienttag	 client;
33 }
34 #endif
35 t_adbanner;
36 
37 #endif
38 
39 
40 /*****/
41 #ifndef JUST_NEED_TYPES
42 #ifndef INCLUDED_ADBANNER_PROTOS
43 #define INCLUDED_ADBANNER_PROTOS
44 
45 #define JUST_NEED_TYPES
46 #include "connection.h"
47 #undef JUST_NEED_TYPES
48 
49 extern t_adbanner * adbanner_pick(t_connection const * c, unsigned int prev_id);
50 extern t_adbanner * adbanner_get(t_connection const * c, unsigned int id);
51 extern unsigned int adbanner_get_id(t_adbanner const * ad);
52 extern unsigned int adbanner_get_extensiontag(t_adbanner const * ad);
53 extern char const * adbanner_get_filename(t_adbanner const * ad);
54 extern char const * adbanner_get_link(t_adbanner const * ad);
55 extern t_clienttag  adbanner_get_client(t_adbanner const * ad);
56 
57 extern int adbannerlist_create(char const * filename);
58 extern int adbannerlist_destroy(void);
59 
60 #endif
61 #endif
62