GRASS Programmer's Manual
6.4.1(2011)
|
GIS Library: Error messages functions. More...
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <stdarg.h>
#include <sys/types.h>
#include <grass/glocale.h>
#include <grass/gis.h>
Go to the source code of this file.
Defines | |
#define | MSG 0 |
A message. | |
#define | WARN 1 |
A warning message. | |
#define | ERR 2 |
A fatal error message. | |
Functions | |
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) | |
int | G_fatal_error (const char *msg,...) |
Print a fatal error message to stderr. | |
int | 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. | |
int | 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. | |
int | G_unset_error_routine (void) |
After this call subsequent error messages will be handled in the default method. | |
int | G_info_format (void) |
Get current message format. |
GIS Library: Error messages functions.
(C) 1999-2008 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 error.c.
#define ERR 2 |
#define MSG 0 |
A message.
Definition at line 29 of file error.c.
Referenced by G_important_message(), G_message(), and G_verbose_message().
#define WARN 1 |
int G_fatal_error | ( | const char * | msg, |
... | |||
) |
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 150 of file error.c.
References ERR.
Referenced by G__calloc(), G__gisinit(), G__ls(), G__make_mapset_element(), G__malloc(), G__no_gisinit(), G__realloc(), G_ask_ellipse_name(), G_ask_proj_name(), G_check_input_output_name(), G_get_default_window(), G_get_ellipsoid_parameters(), G_get_raster_sample(), G_get_window(), G_getenv(), G_getenv2(), G_home(), G_list(), G_location_path(), G_make_location(), G_make_mapset(), G_mapset(), G_put_map_row(), G_put_reclass(), and G_read_color_rule().
void G_important_message | ( | const char * | msg, |
... | |||
) |
Print a message to stderr even in brief mode (verbosity=1)
Ususally 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 119 of file error.c.
References G_verbose(), G_verbose_min(), and MSG.
int G_info_format | ( | void | ) |
Get current message format.
Maybe set to either "standard" or "gui" (normally GRASS takes care)
Definition at line 487 of file error.c.
References G_strcasecmp().
Referenced by G_percent2().
void G_message | ( | const char * | msg, |
... | |||
) |
Print a message to stderr.
The output format depends on environment variable GRASS_MESSAGE_FORMAT
msg | string (cannot be NULL) |
Definition at line 74 of file error.c.
References G_verbose(), G_verbose_std(), and MSG.
Referenced by G_done_msg(), and G_dump().
int G_set_error_routine | ( | int(*)(const char *, int) | error_routine | ) |
int G_sleep_on_error | ( | int | flag | ) |
int G_suppress_warnings | ( | int | flag | ) |
int G_unset_error_routine | ( | void | ) |
void G_verbose_message | ( | const char * | msg, |
... | |||
) |
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 95 of file error.c.
References G_verbose(), G_verbose_std(), and MSG.
int G_warning | ( | const char * | 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 173 of file error.c.
References WARN.
Referenced by G__check_for_auto_masking(), G__check_fp_type(), G__check_gisinit(), G__check_null_bit(), G__open_cell_old(), G__open_null_write(), G__quant_import(), G__random_d_initialize_0(), G__random_f_initialize_0(), G__raster_misc_read_line(), G__raster_misc_write_line(), G__read_row_ptrs(), G__write_fp_format(), G__write_null_bits(), G_adjust_Cell_head(), G_adjust_Cell_head3(), G_ask_colors(), G_ask_datum_name(), G_check_input_output_name(), G_command_history(), G_copy_file(), G_debug(), G_distance_point_to_line_segment(), G_get_3dview(), G_get_cellhd(), G_get_projinfo(), G_get_projunits(), G_get_reclass(), G_is_null_value(), G_open_cell_old(), G_parser(), G_put_3dview(), G_put_cell_title(), G_put_cellhd(), G_put_reclass(), G_quantize_fp_map(), G_quantize_fp_map_range(), G_raster_map_is_fp(), G_raster_map_type(), G_read_colors(), G_read_fp_range(), G_read_histogram(), G_read_history(), G_read_range(), G_read_raster_cats(), G_read_vector_cats(), G_round_fp_map(), G_set_fp_type(), G_set_null_value(), G_set_quant_rules(), G_set_window(), G_system(), G_truncate_fp_map(), G_write_fp_range(), G_write_history(), G_write_quant(), and G_write_range().