|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
|
GIS Library - Error messages functions. More...
#include <stdlib.h>#include <string.h>#include <setjmp.h>#include <unistd.h>#include <time.h>#include <stdarg.h>#include <sys/types.h>#include <grass/glocale.h>#include <grass/gis.h>#include "gis_local_proto.h"
Go to the source code of this file.
Macros | |
| #define | MSG 0 |
| A message. | |
| #define | WARN 1 |
| A warning message. | |
| #define | ERR 2 |
| A fatal error message. | |
Functions | |
| jmp_buf * | G_fatal_longjmp (int enable) |
| void | G_message (const char *msg,...) |
| Print a message to stderr. | |
| void | G_verbose_message (const char *msg,...) |
| Print a message to stderr but only if module is in verbose mode. | |
| void | G_important_message (const char *msg,...) |
| Print a message to stderr even in brief mode (verbosity=1) | |
| void | G_fatal_error (const char *msg,...) |
| Print a fatal error message to stderr. | |
| void | G_warning (const char *msg,...) |
| Print a warning message to stderr. | |
| int | G_suppress_warnings (int flag) |
| Suppress printing a warning message to stderr. | |
| int | G_sleep_on_error (int flag) |
| Turn on/off no_sleep flag. | |
| void | G_set_error_routine (int(*error_routine)(const char *, int)) |
| Establishes error_routine as the routine that will handle the printing of subsequent error messages. | |
| void | G_unset_error_routine (void) |
| After this call subsequent error messages will be handled in the default method. | |
| void | G_init_logging (void) |
| int | G_info_format (void) |
| Get current message format. | |
GIS Library - Error messages functions.
(C) 1999-2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file gis/error.c.
| #define ERR 2 |
A fatal error message.
Definition at line 44 of file gis/error.c.
| #define MSG 0 |
A message.
Definition at line 32 of file gis/error.c.
| #define WARN 1 |
A warning message.
Definition at line 38 of file gis/error.c.
Print a fatal error message to stderr.
The output format depends on environment variable GRASS_MESSAGE_FORMAT
By default, the message is handled by an internal routine which prints the message to the screen. Using G_set_error_routine() the programmer can have the message handled by another routine. This is especially useful if the message should go to a particular location on the screen when using curses or to a location on a graphics device (monitor).
| msg | string (cannot be NULL) |
Definition at line 159 of file gis/error.c.
References ERR, G__call_error_handlers(), and G_verbose().
Definition at line 66 of file gis/error.c.
Print a message to stderr even in brief mode (verbosity=1)
Usually just G_percent()/G_clicker() would be shown at this level. This allows important non-error/warning messages to display as well.
The output format depends on environment variables GRASS_MESSAGE_FORMAT and GRASS_VERBOSE
| msg | string (cannot be NULL) |
Definition at line 130 of file gis/error.c.
References G_verbose(), G_verbose_min(), and MSG.
Get current message format.
Maybe set to either "standard" or "gui" (normally GRASS takes care)
Definition at line 540 of file gis/error.c.
References G_init_logging().
Referenced by G_clicker(), G_percent(), and G_progress().
Definition at line 355 of file gis/error.c.
References _, G__home(), G_INFO_FORMAT_GUI, G_INFO_FORMAT_PLAIN, G_INFO_FORMAT_SILENT, G_INFO_FORMAT_STANDARD, G_init_counter(), G_initialize_done(), G_is_initialized(), G_store(), G_strcasecmp(), and GPATH_MAX.
Referenced by G_info_format(), and G_init_all().
Print a message to stderr.
The output format depends on environment variable GRASS_MESSAGE_FORMAT
| msg | string (cannot be NULL) |
Definition at line 89 of file gis/error.c.
References G_verbose(), G_verbose_std(), and MSG.
Establishes error_routine as the routine that will handle the printing of subsequent error messages.
| error_routine | routine will be called like this: error_routine(msg, fatal) |
Definition at line 260 of file gis/error.c.
Turn on/off no_sleep flag.
If flag is 0, then no pause will occur after printing an error or warning message. Otherwise the pause will occur.
| flag | if non-zero/zero value is given G_sleep() will be activated/deactivated |
Definition at line 242 of file gis/error.c.
Suppress printing a warning message to stderr.
| flag | a warning message will be suppressed if non-zero value is given |
Definition at line 222 of file gis/error.c.
Referenced by G_parser(), I_get_group(), I_get_group_title(), I_get_subgroup(), and I_get_target().
After this call subsequent error messages will be handled in the default method.
Error messages are printed directly to the screen: ERROR: message or WARNING: message
Definition at line 274 of file gis/error.c.
Print a message to stderr but only if module is in verbose mode.
The output format depends on environment variables GRASS_MESSAGE_FORMAT and GRASS_VERBOSE
| msg | string (cannot be NULL) |
Definition at line 108 of file gis/error.c.
References G_verbose(), G_verbose_std(), and MSG.
Print a warning message to stderr.
The output format depends on environment variable GRASS_MESSAGE_FORMAT
A warning message can be suppressed by G_suppress_warnings()
| msg | string (cannot be NULL) |
Definition at line 203 of file gis/error.c.
References G_verbose(), and WARN.