1 /* Tower Toppler - Nebulus
2  * Copyright (C) 2000-2012  Andreas R�ver
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 
19 #ifndef HIGHSCORE_H
20 #define HIGHSCORE_H
21 
22 #include <SDL_types.h>
23 
24 /* this modules contains all the function for highscoretable access
25  * because this is the only section that needs the sticky bit privileges
26  * it's the one that handled the group id things as well
27  */
28 
29 /* the number of characters a name can be long in the highscoretable */
30 #define SCORENAMELEN 9
31 
32 /* call this at init time, so that the program can desice on the
33  * highscore table file to use. This files will then be used the
34  * complete running time
35  */
36 void hsc_init(void);
37 
38 /* selects one mission by name, if there is currently no table
39  * for this mission the table is assumed to be empty
40  */
41 void hsc_select(const char * mission);
42 
43 /* how many value entries has the selected table? */
44 Uint8 hsc_entries(void);
45 
46 /* fills name, points and tower with the values of the nr-th entry,
47  * if you give 0 pointers the values are ignored,
48  * name must be at least SCORENAMELEN+1 characters long */
49 void hsc_entry(Uint8 nr, char *name, Uint32 *points, Uint8 *tower);
50 
51 /* returns true, if the player will enter the highscore table with his points
52  * you can use this function on locked and unlocked highscore tables
53  * but of course the information may change until you have locked the table
54  */
55 bool hsc_canEnter(Uint32 points);
56 
57 /* enters one user into the table with his number of points and the reached tower
58  * the table gets locked, the entry written in and the unlocked
59  * returned is the position in the table the user got, or 0xff if he didn't get in
60  * the table will be saved automatically
61  */
62 Uint8 hsc_enter(Uint32 points, Uint8 tower, char *name);
63 
64 #endif
65