1 | /* |
1 | /* |
2 | * CrossFire, A Multiplayer game for X-windows |
2 | * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. |
3 | * |
3 | * |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * Crossfire TRT is free software; you can redistribute it and/or modify it |
9 | * it under the terms of the GNU General Public License as published by |
9 | * under the terms of the GNU General Public License as published by the Free |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * Software Foundation; either version 2 of the License, or (at your option) |
11 | * (at your option) any later version. |
11 | * any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, but |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
16 | * GNU General Public License for more details. |
16 | * for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License along |
19 | * along with this program; if not, write to the Free Software |
19 | * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail at <crossfire@schmorp.de> |
22 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | #include <global.h> |
25 | #include <global.h> |
26 | #include <sproto.h> |
26 | #include <sproto.h> |
27 | |
27 | |
… | |
… | |
41 | |
41 | |
42 | /* |
42 | /* |
43 | * spool works mostly like strtok(char *, ":"), but it can also |
43 | * spool works mostly like strtok(char *, ":"), but it can also |
44 | * log a specified error message if something goes wrong. |
44 | * log a specified error message if something goes wrong. |
45 | */ |
45 | */ |
46 | |
|
|
47 | char * |
46 | char * |
48 | spool (char *bp, char *error) |
47 | spool (char *bp, const char *error) |
49 | { |
48 | { |
50 | static char *prev_pos = NULL; |
49 | static char *prev_pos = NULL; |
51 | char *next_pos; |
50 | char *next_pos; |
52 | |
51 | |
53 | if (bp == NULL) |
52 | if (bp == NULL) |
… | |
… | |
76 | |
75 | |
77 | /* |
76 | /* |
78 | * Does what it says, copies the contents of the first score structure |
77 | * Does what it says, copies the contents of the first score structure |
79 | * to the second one. |
78 | * to the second one. |
80 | */ |
79 | */ |
81 | |
|
|
82 | static void |
80 | static void |
83 | copy_score (score *sc1, score *sc2) |
81 | copy_score (score *sc1, score *sc2) |
84 | { |
82 | { |
85 | assign (sc2->name , sc1->name); |
83 | assign (sc2->name , sc1->name); |
86 | assign (sc2->title , sc1->title); |
84 | assign (sc2->title , sc1->title); |
… | |
… | |
94 | |
92 | |
95 | /* |
93 | /* |
96 | * Writes the given score structure to a static buffer, and returns |
94 | * Writes the given score structure to a static buffer, and returns |
97 | * a pointer to it. |
95 | * a pointer to it. |
98 | */ |
96 | */ |
99 | |
|
|
100 | static char * |
97 | static char * |
101 | put_score (score *sc) |
98 | put_score (score *sc) |
102 | { |
99 | { |
103 | static char buf[MAX_BUF]; |
100 | static char buf[MAX_BUF]; |
104 | |
101 | |