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

RELEASE/1.2debug-cidebug-ci-sanitiserswalls-datawalls-data-hanging-as-warning
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
RevLine 
[106af12]1/* message.h
[9af1d7a]2 * Function prototypes for message.c
[3f1dd91f]3 * Copyright (C) 1998-2003,2005,2010,2015,2017,2019 Olly Betts
[846746e]4 *
[89231c4]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.
[846746e]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
[89231c4]12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
[846746e]14 *
[89231c4]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
[ecbc6c18]17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
[9af1d7a]18 */
19
20#ifndef MESSAGE_H /* only include once */
21#define MESSAGE_H
22
[8df22e9]23#ifdef __cplusplus
24extern "C" {
25#endif
26
[7f94ee7]27#include <stdarg.h>
28
[9af1d7a]29#include "osdepend.h"
30#include "osalloc.h"
31
[ded6cfa]32/* Define MSG_SETUP_PROJ_SEARCH_PATH before including this header to enable the
[3f1dd91f]33 * hooks to setup proj4's search path to look for data files we bundle.
[de963e4]34 */
[3924ef1]35#ifdef MSG_SETUP_PROJ_SEARCH_PATH
[3f1dd91f]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_); \
[de963e4]41    } while (0)
42#endif
43
44#ifndef msg_init
45# define msg_init(ARGV) msg_init_(ARGV)
46#endif
47
[a420b49]48#define STDERR stdout
49
[f8e03f3]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
[f0a0b05]57#define CHARSET_ISO_8859_2  8
[4fa44e7]58#define CHARSET_WINCP1250   9
[6a4871e]59
[25ab06b]60extern int msg_warnings; /* keep track of how many warnings we've given */
61extern int msg_errors;   /* and how many (non-fatal) errors */
[a2f9d5c]62
[cf54765]63/* The language code - e.g. "en_GB" */
[25ab06b]64extern const char *msg_lang;
[cf54765]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" */
[c0a9908]67extern const char *msg_lang2;
[f2a6ce4]68
[de963e4]69/* Not intended for direct use - use msg_init() instead, optionally defining
[3924ef1]70 * MSG_SETUP_PROJ_SEARCH_PATH.
[de963e4]71 */
[3f1dd91f]72void msg_init_(char *const *argv);
[de963e4]73
74/* Not intended for direct use - use msg_init() instead, optionally defining
[3924ef1]75 * MSG_SETUP_PROJ_SEARCH_PATH.
[de963e4]76 */
77const char * msg_proj_finder_(const char * file);
[9af1d7a]78
[25ab06b]79const char *msg_cfgpth(void);
[b88b171]80const char *msg_exepth(void);
[bdfe97f]81const char *msg_appname(void);
[9af1d7a]82
[c8fcf66]83/* Return the message string corresponding to number en */
[25ab06b]84const char *msg(int en);
[a420b49]85
[da96015]86void v_report(int severity, const char *fnm, int line, int col, int en, va_list ap);
[a420b49]87
88void warning(int en, ...);
89void error(int en, ...);
90void fatalerror(int en, ...);
[9af1d7a]91
[a420b49]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, ...);
[9af1d7a]95
[a420b49]96int select_charset(int charset_code);
[9af1d7a]97
[8df22e9]98#ifdef __cplusplus
99}
100#endif
101
[9af1d7a]102#endif /* MESSAGE_H */
Note: See TracBrowser for help on using the repository browser.