annotate liblocfile.h @ 1770:cc59f80b0e78

Various cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 27 Oct 2017 04:35:51 +0300
parents 3f52fa562a46
children 7c254d090221
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1674
3f52fa562a46 Update copyrights and add copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 1657
diff changeset
1 /*
3f52fa562a46 Update copyrights and add copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 1657
diff changeset
2 * liblocfile - Location file format handling
3f52fa562a46 Update copyrights and add copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 1657
diff changeset
3 * Programmed by Matti 'ccr' Hämäläinen (Ggr Pupunen)
3f52fa562a46 Update copyrights and add copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 1657
diff changeset
4 * (C) Copyright 2006-2017 Tecnic Software productions (TNSP)
3f52fa562a46 Update copyrights and add copyright headers.
Matti Hamalainen <ccr@tnsp.org>
parents: 1657
diff changeset
5 */
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 #ifndef LIBLOCFILE_H
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #define LIBLOCFILE_H
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
1311
3b330a27cbb1 Add a "bogus" proxy header for th-libs.
Matti Hamalainen <ccr@tnsp.org>
parents: 1309
diff changeset
9 #include "libutil.h"
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 #include <time.h>
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #include <stdio.h>
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 /* Version string
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 */
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 #define LOC_MAGIC "MapUtils LOC file"
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 #define LOC_VERSION_MAJOR (4)
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 #define LOC_VERSION_MINOR (0)
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 /* LOCD_* is an enum describing the preferred orientation of the
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 * location marker _label_ in relation to the marker spot.
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 */
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 enum {
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 LOCD_NONE = 0,
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 LOCD_LEFT,
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 LOCD_LEFTDOWN,
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 LOCD_DOWN
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 };
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 /* Timestamp used in loc-files, in sscanf() format.
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 */
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #define LOC_TIMEFMT "%02d.%02d.%04d"
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 /* These flags are used to describe the marker/location type and label
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 * related information: [LOCF_M_*] Draw marker of specified type (by default,
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 * no marker is drawn). LOCF_M_CITY and LOCF_M_PCITY are special, they also
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 * work as aliases to LOCF_T_CITY/PCITY and thus have similar functionality.
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 *
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 * [LOCF_T_*] specify the type of the location/marker. Currently the effect
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 * of this settings is addition of "GUILD", "SHRINE"-type strings to labels,
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 * but this information can be used in other ways too.
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 */
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 #define LOCF_NONE (0x00000)
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47
1770
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
48 // Marker types
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
49 #define LOCF_M_SCENIC1 (0x000001) // '?' Scenic marker
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
50 #define LOCF_M_SCENIC2 (0x000002) // '%' Shrine marker/etc
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
51 #define LOCF_M_PCITY (0x000004) // 'C' Player city
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
52 #define LOCF_M_CITY (0x000008) // 'c' City
1657
c2a6e11ea44c Add instance flag support to liblocfile and mkloc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1526
diff changeset
53 #define LOCF_M_MASK (0x00000F)
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
1770
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
55 // Location types
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
56 #define LOCF_T_SHRINE (0x000010) // 'S' Raceshrine
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
57 #define LOCF_T_GUILD (0x000020) // 'G' Guild
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
58 #define LOCF_T_SS (0x000040) // 'P' Player guild/Secret Society
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
59 #define LOCF_T_MONSTER (0x000080) // 'M' Special monster
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
60 #define LOCF_T_TRAINER (0x000100) // 'T' Guild trainer
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
61 #define LOCF_T_FORT (0x000200) // 'F' Regions fort
1657
c2a6e11ea44c Add instance flag support to liblocfile and mkloc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1526
diff changeset
62 #define LOCF_T_MASK (0x00FFF0)
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 #define LOCF_MASK (LOCF_M_MASK | LOCF_T_MASK)
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64
1770
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
65 // Extra flags
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
66 #define LOCF_INVIS (0x010000) // '-' Invisible marker / Don't show label
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
67 #define LOCF_CLOSED (0x020000) // '!' Area is CLOSED
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
68 #define LOCF_INSTANCED (0x040000) // 'I' Location is "instanced" for each player
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
69 #define LOCF_INVALID (0x400000) // Possibly invalid location
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
70 #define LOCF_NOMARKER (0x800000) // Location has no marker in mapdata or explicitly defined
1657
c2a6e11ea44c Add instance flag support to liblocfile and mkloc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1526
diff changeset
71 #define LOCF_Q_MASK (0xFF0000)
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 /* Misc constants
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 */
1770
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
76 #define LOC_MAX_NAMES (64) // Probably more than enough?
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 #define LOC_MARKERS "?%C"
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 #define LOC_MAX_FILES (64)
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80
1770
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
81 #define NAME_ORIG (0x00001) // '@' Original area name or coder
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
82 #define NAME_RECODER (0x00002) // '!' Converter or recoder of area
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
83 #define NAME_MAINTAINER (0x00004) // '%' Maintainer
cc59f80b0e78 Various cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1674
diff changeset
84 #define NAME_EXPANDER (0x00008) // '&' Expander, adding new things
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 /* Structures
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 */
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
89 typedef struct
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
90 {
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 int day, month, year;
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
92 } LocDateStruct;
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
95 typedef struct
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
96 {
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97 char *filename;
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 char *continent;
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 int x, y;
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
100 } LocFileInfo;
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
103 typedef struct
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
104 {
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 char *name;
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 int flags;
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
107 } LocName;
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
110 typedef struct
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
111 {
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
112 LocFileInfo *file; // Reference to file/continent data
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
113
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
114 int x, y, ox, oy; // Location coordinates
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
115 int align; // Label alignment value
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
116 int flags; // Flags (see LOCF_*)
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
117
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
118 LocDateStruct added; // Date / time information
1313
cb8c21f5f95b Synced changes from Map Mask Designer project.
Matti Hamalainen <ccr@tnsp.org>
parents: 1311
diff changeset
119 BOOL valid;
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
120
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 int nnames, ncoders;
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
122 LocName names[LOC_MAX_NAMES], coders[LOC_MAX_NAMES];
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
123
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 char *uri, *freeform;
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
126 int val; // Special value for sorting purposes
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
127 } LocMarker;
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
130 typedef struct
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
131 {
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 int n;
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
133 LocMarker **locations;
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
134 } MapLocations;
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 /* Location file parsing and data handling
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 */
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
139 BOOL locAddNew(MapLocations *l, int x, int y, int dir, int flags,
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
140 LocName *names, LocName *coders, LocDateStruct *added, BOOL valid,
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
141 const char *uri, const char *freeform, LocFileInfo *file);
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
143 BOOL locParseLocStream(FILE *fp, LocFileInfo *file, MapLocations *l, int offX, int offY);
1508
006b79fc386b Add functions for freeing MapLoc structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 1505
diff changeset
144 void locFreeMarkerData(LocMarker *marker);
006b79fc386b Add functions for freeing MapLoc structures.
Matti Hamalainen <ccr@tnsp.org>
parents: 1505
diff changeset
145 void locFreeMapLocations(MapLocations *loc);
1504
521f7f5726dc Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1503
diff changeset
146
1309
5cd310e1dab9 Rename some structures/data types.
Matti Hamalainen <ccr@tnsp.org>
parents: 1302
diff changeset
147 int locFindByCoords(MapLocations *l, int x, int y, BOOL locTrue);
1444
f537af4ccb78 Adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1313
diff changeset
148
f537af4ccb78 Adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1313
diff changeset
149 const char * locGetType(int flags);
f537af4ccb78 Adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1313
diff changeset
150 const char * locGetLocationType(int flags);
f537af4ccb78 Adjustments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1313
diff changeset
151
1313
cb8c21f5f95b Synced changes from Map Mask Designer project.
Matti Hamalainen <ccr@tnsp.org>
parents: 1311
diff changeset
152 LocMarker *locCopyLocMarker(LocMarker *);
cb8c21f5f95b Synced changes from Map Mask Designer project.
Matti Hamalainen <ccr@tnsp.org>
parents: 1311
diff changeset
153 void locCopyLocations(MapLocations *dst, MapLocations *src);
cb8c21f5f95b Synced changes from Map Mask Designer project.
Matti Hamalainen <ccr@tnsp.org>
parents: 1311
diff changeset
154
1526
aba0900dc31a Refactor liblocfile API a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1508
diff changeset
155 void setLocFileInfo(LocFileInfo *f, const char *filename, const char *continent);
1302
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156
9233b482b87a Moved loc-file functionality to liblocfile.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 #endif