ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/map.c
(Generate patch)

Comparing deliantra/server/common/map.c (file contents):
Revision 1.6 by root, Mon Mar 6 22:59:26 2006 UTC vs.
Revision 1.7 by root, Tue Mar 7 13:44:42 2006 UTC

1/* 1/*
2 * static char *rcsid_map_c = 2 * static char *rcsid_map_c =
3 * "$Id: map.c,v 1.6 2006/03/06 22:59:26 root Exp $"; 3 * "$Id: map.c,v 1.7 2006/03/07 13:44:42 root Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
38#include "path.h" 38#include "path.h"
39 39
40 40
41extern int nrofallocobjects,nroffreeobjects; 41extern int nrofallocobjects,nroffreeobjects;
42 42
43void (*load_original_map_callback)(mapstruct *map);
44void (*load_temporary_map_callback)(mapstruct *map);
45void (*clean_temporary_map_callback)(mapstruct *map);
43 46
44/* 47/*
45 * Returns the mapstruct which has a name matching the given argument. 48 * Returns the mapstruct which has a name matching the given argument.
46 * return NULL if no match is found. 49 * return NULL if no match is found.
47 */ 50 */
1010 * cases, no matter if this flag is set or not. 1013 * cases, no matter if this flag is set or not.
1011 * MAP_STYLE: style map - don't add active objects, don't add to server 1014 * MAP_STYLE: style map - don't add active objects, don't add to server
1012 * managed map list. 1015 * managed map list.
1013 */ 1016 */
1014 1017
1015void (*load_original_map_callback)(mapstruct *map);
1016void (*load_temporary_map_callback)(mapstruct *map);
1017
1018mapstruct *load_original_map(const char *filename, int flags) { 1018mapstruct *load_original_map(const char *filename, int flags) {
1019 FILE *fp; 1019 FILE *fp;
1020 mapstruct *m; 1020 mapstruct *m;
1021 int comp; 1021 int comp;
1022 char pathname[MAX_BUF]; 1022 char pathname[MAX_BUF];
1664} 1664}
1665 1665
1666void clean_tmp_map(mapstruct *m) { 1666void clean_tmp_map(mapstruct *m) {
1667 if(m->tmpname == NULL) 1667 if(m->tmpname == NULL)
1668 return; 1668 return;
1669 if (clean_temporary_map_callback)
1670 clean_temporary_map_callback (m);
1669 (void) unlink(m->tmpname); 1671 (void) unlink(m->tmpname);
1670} 1672}
1671 1673
1672void free_all_maps(void) 1674void free_all_maps(void)
1673{ 1675{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines