Routino SVN Repository Browser

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

ViewVC logotype

Annotation of /trunk/src/errorlog.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1318 - (hide annotations) (download) (as text)
Mon May 13 18:06:15 2013 UTC (11 years, 10 months ago) by amb
Original Path: trunk/src/logerror.h
File MIME type: text/x-chdr
File size: 4107 byte(s)
Move the logerror function prototypes back into logging.h and remove the
logerror.h header file from most source files again.

1 amb 1313 /***************************************
2     Header file for error logging function prototypes
3    
4     Part of the Routino routing software.
5     ******************/ /******************
6     This file Copyright 2013 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    
23     #ifndef LOGERROR_H
24     #define LOGERROR_H /*+ To stop multiple inclusions. +*/
25    
26     #include <stdint.h>
27    
28     #include "types.h"
29     #include "typesx.h"
30    
31    
32 amb 1317 /*+ A structure containing information for an error message during processing. +*/
33     typedef struct _ErrorLogX
34     {
35     latlong_t latitude; /*+ The error message latitude. +*/
36     latlong_t longitude; /*+ The error message longitude. +*/
37 amb 1313
38 amb 1317 uint32_t offset; /*+ The offset of the error message from the beginning of the text file. +*/
39     uint32_t length; /*+ The length of the error message in the text file. +*/
40     }
41     ErrorLogX;
42    
43    
44     /*+ A structure containing information for an error message in the file. +*/
45     typedef struct _ErrorLog
46     {
47     ll_off_t latoffset; /*+ The error message latitude offset within its bin. +*/
48     ll_off_t lonoffset; /*+ The error message longitude offset within its bin. +*/
49    
50     uint32_t offset; /*+ The offset of the error message from the beginning of the text section. +*/
51     uint32_t length; /*+ The length of the error message in the text section. +*/
52     }
53     ErrorLog;
54    
55    
56     /*+ A structure containing the header from the error log file. +*/
57     typedef struct _ErrorLogsFile
58     {
59     index_t number; /*+ The total number of error messages. +*/
60     index_t number_geo; /*+ The number of error messages with a geographical location. +*/
61     index_t number_nongeo; /*+ The number of error messages without a geographical location. +*/
62    
63     ll_bin_t latbins; /*+ The number of bins containing latitude. +*/
64     ll_bin_t lonbins; /*+ The number of bins containing longitude. +*/
65    
66     ll_bin_t latzero; /*+ The bin number of the furthest south bin. +*/
67     ll_bin_t lonzero; /*+ The bin number of the furthest west bin. +*/
68     }
69     ErrorLogsFile;
70    
71    
72     /*+ A structure containing a set of error log messages read from the file. +*/
73     struct _ErrorLogs
74     {
75     ErrorLogsFile file; /*+ The header data from the file. +*/
76    
77     #if !SLIM
78    
79     void *data; /*+ The memory mapped data in the file. +*/
80    
81     index_t *offsets; /*+ A pointer to the array of offsets in the file. +*/
82    
83     ErrorLog *errorlogs_geo; /*+ A pointer to the array of geographical error logs in the file. +*/
84     ErrorLog *errorlogs_nongeo; /*+ A pointer to the array of non-geographical error logs in the file. +*/
85    
86     char *strings; /*+ A pointer to the array of error strings in the file. +*/
87    
88     #else
89    
90     int fd; /*+ The file descriptor for the file. +*/
91    
92     index_t *offsets; /*+ An allocated array with a copy of the file offsets. +*/
93    
94     off_t errorlogsoffset_geo; /*+ The offset of the geographical error logs within the file. +*/
95     off_t errorlogsoffset_nongeo; /*+ The offset of the non-geographical error logs within the file. +*/
96    
97     off_t stringsoffset; /*+ The offset of the error strings within the file. +*/
98    
99     #endif
100     }
101     ErrorLogs;
102    
103    
104     /* Error log processing functions in logerrorx.c */
105    
106     void ProcessErrorLogs(NodesX *nodesx,WaysX *waysx,RelationsX *relationsx);
107     void SortErrorLogsGeographically(void);
108     void SaveErrorLogs(NodesX *nodesx,char *filename);
109    
110    
111 amb 1313 #endif /* LOGERROR_H */