source: git/src/message.h @ 9fcc81a

RELEASE/1.2debug-cidebug-ci-sanitiserswalls-data
Last change on this file since 9fcc81a was 3f1dd91f, checked in by Olly Betts <olly@…>, 5 years ago

Make things work with PROJ 6

PROJ 6 no longer ships the esri projection list and doesn't implement
compatibility support so that +init=esri:<CODE> works. We can work
around this by installing a copy of the esri projection list which
PROJ used to provide and hooking things up so that PROJ finds it.

Addresses the remaining blocker in #102, reported by Bas Couwenberg.
Also reported by Richard Knapp and Martin Sluka.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/* message.h
2 * Function prototypes for message.c
3 * Copyright (C) 1998-2003,2005,2010,2015,2017,2019 Olly Betts
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20#ifndef MESSAGE_H /* only include once */
21#define MESSAGE_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <stdarg.h>
28
29#include "osdepend.h"
30#include "osalloc.h"
31
32/* Define MSG_SETUP_PROJ_SEARCH_PATH before including this header to enable the
33 * hooks to setup proj4's search path to look for data files we bundle.
34 */
35#ifdef MSG_SETUP_PROJ_SEARCH_PATH
36# define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
37# include <proj_api.h>
38# define msg_init(ARGV) do {\
39        msg_init_(ARGV); \
40        pj_set_finder(msg_proj_finder_); \
41    } while (0)
42#endif
43
44#ifndef msg_init
45# define msg_init(ARGV) msg_init_(ARGV)
46#endif
47
48#define STDERR stdout
49
50#define CHARSET_BAD        -1
51#define CHARSET_USASCII     0
52#define CHARSET_ISO_8859_1  1
53#define CHARSET_DOSCP850    2
54#define CHARSET_UTF8        4
55#define CHARSET_WINCP1252   5
56#define CHARSET_ISO_8859_15 6
57#define CHARSET_ISO_8859_2  8
58#define CHARSET_WINCP1250   9
59
60extern int msg_warnings; /* keep track of how many warnings we've given */
61extern int msg_errors;   /* and how many (non-fatal) errors */
62
63/* The language code - e.g. "en_GB" */
64extern const char *msg_lang;
65/* If the language code has a country specific qualification, then this will
66 * be just the language code.  Otherwise it's NULL.  e.g. "en" */
67extern const char *msg_lang2;
68
69/* Not intended for direct use - use msg_init() instead, optionally defining
70 * MSG_SETUP_PROJ_SEARCH_PATH.
71 */
72void msg_init_(char *const *argv);
73
74/* Not intended for direct use - use msg_init() instead, optionally defining
75 * MSG_SETUP_PROJ_SEARCH_PATH.
76 */
77const char * msg_proj_finder_(const char * file);
78
79const char *msg_cfgpth(void);
80const char *msg_exepth(void);
81const char *msg_appname(void);
82
83/* Return the message string corresponding to number en */
84const char *msg(int en);
85
86void v_report(int severity, const char *fnm, int line, int col, int en, va_list ap);
87
88void warning(int en, ...);
89void error(int en, ...);
90void fatalerror(int en, ...);
91
92void warning_in_file(const char *fnm, int line, int en, ...);
93void error_in_file(const char *fnm, int line, int en, ...);
94void fatalerror_in_file(const char *fnm, int line, int en, ...);
95
96int select_charset(int charset_code);
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* MESSAGE_H */
Note: See TracBrowser for help on using the repository browser.