Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/src/tagging.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1242 - (show annotations) (download) (as text)
Sun Jan 20 13:52:52 2013 UTC (12 years, 1 month ago) by amb
File MIME type: text/x-chdr
File size: 2492 byte(s)
Change the <logerror> element of the configuration file to lookup the tag value
if not specified and add a custom error message.
Rework the access tag checking to use the new logcheck.

1 /***************************************
2 The data types for the tagging rules.
3
4 Part of the Routino routing software.
5 ******************/ /******************
6 This file Copyright 2010-2012 Andrew M. Bishop
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Affero General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Affero General Public License for more details.
17
18 You should have received a copy of the GNU Affero General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ***************************************/
21
22 #ifndef TAGGING_H
23 #define TAGGING_H /*+ To stop multiple inclusions. +*/
24
25 #include <stdint.h>
26
27
28 /* Data types */
29
30 typedef struct _TaggingRuleList TaggingRuleList;
31
32
33 /*+ A structure to contain the tagging rule/action. +*/
34 typedef struct _TaggingRule
35 {
36 int action; /*+ A flag to indicate the type of action. +*/
37
38 char *k; /*+ The tag key (or NULL). +*/
39 char *v; /*+ The tag value (or NULL). +*/
40 char *message; /*+ The message string for logerror (or NULL). +*/
41
42 TaggingRuleList *rulelist; /*+ The sub-rules belonging to this rule. +*/
43 }
44 TaggingRule;
45
46
47 /*+ A structure to contain the list of rules and associated information. +*/
48 struct _TaggingRuleList
49 {
50 TaggingRule *rules; /*+ The array of rules. +*/
51 int nrules; /*+ The number of rules. +*/
52 };
53
54
55 /*+ A structure to hold a list of tags to be processed. +*/
56 typedef struct _TagList
57 {
58 int ntags; /*+ The number of tags. +*/
59
60 char **k; /*+ The list of tag keys. +*/
61 char **v; /*+ The list of tag values. +*/
62 }
63 TagList;
64
65
66 /* Functions in tagging.c */
67
68 int ParseXMLTaggingRules(const char *filename);
69 void DeleteXMLTaggingRules(void);
70
71 TagList *NewTagList(void);
72 void DeleteTagList(TagList *tags);
73
74 void AppendTag(TagList *tags,const char *k,const char *v);
75
76 TagList *ApplyNodeTaggingRules(TagList *tags,int64_t id);
77 TagList *ApplyWayTaggingRules(TagList *tags,int64_t id);
78 TagList *ApplyRelationTaggingRules(TagList *tags,int64_t id);
79
80
81 #endif /* TAGGING_H */

Properties

Name Value
cvs:description Header file for reading the tag transformation rules and applying them.