GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73561
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
db/dbmi_base/error.c File Reference

DBMI Library (base) - error management. More...

#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
Include dependency graph for db/dbmi_base/error.c:

Go to the source code of this file.

Functions

void db_on_error (void(*f)(const char *))
 User defined error procedure. More...
 
void db_set_error_who (const char *me)
 Set 'who' for error messages. More...
 
const char * db_get_error_who (void)
 
void db_error (const char *s)
 Report error message. More...
 
void db_protocol_error (void)
 Report protocol error. More...
 
void db_syserror (const char *s)
 Report system error. More...
 
int db_get_error_code (void)
 Get error code. More...
 
void db_memory_error (void)
 Report memory error. More...
 
void db_procedure_not_implemented (const char *name)
 Report 'not implemented' error. More...
 
void db_noproc_error (int procnum)
 Report no procedure error. More...
 
void db_clear_error (void)
 Clear error status. More...
 
void db_print_error (void)
 Print error. More...
 
void db_debug_on (void)
 Turn on debugging. More...
 
void db_debug_off (void)
 Turn off debugging. More...
 
void db_debug (const char *s)
 Print debug message. More...
 
const char * db_get_error_msg (void)
 Get error message. More...
 
void db_auto_print_errors (int flag)
 Toggles printing of DBMI error messages. More...
 
void db_auto_print_protocol_errors (int flag)
 Set auto print protocol error. More...
 

Detailed Description

DBMI Library (base) - error management.

(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.

Author
Joel Jones (CERL/UIUC)
Upgraded to GRASS 5.7 by Radim Blazek
Doxygenized by Martin Landa <landa.martin gmail.com> (2011)

Definition in file db/dbmi_base/error.c.

Function Documentation

void db_auto_print_errors ( int  flag)

Toggles printing of DBMI error messages.

Parameters
flag?

Definition at line 249 of file db/dbmi_base/error.c.

Referenced by db_driver().

void db_auto_print_protocol_errors ( int  flag)

Set auto print protocol error.

Parameters
flag?

Definition at line 260 of file db/dbmi_base/error.c.

Referenced by db_driver().

void db_clear_error ( void  )

Clear error status.

Definition at line 171 of file db/dbmi_base/error.c.

References DB_OK.

Referenced by db_dirent(), and db_driver().

void db_debug ( const char *  s)

Print debug message.

Parameters
sdebug message

Definition at line 228 of file db/dbmi_base/error.c.

void db_debug_off ( void  )

Turn off debugging.

Definition at line 218 of file db/dbmi_base/error.c.

void db_debug_on ( void  )

Turn on debugging.

Definition at line 210 of file db/dbmi_base/error.c.

const char* db_get_error_msg ( void  )

Get error message.

Returns
pointer to error message string

Definition at line 239 of file db/dbmi_base/error.c.

References NULL.

Referenced by db__send_failure().

const char* db_get_error_who ( void  )

brief Get 'who' string

Returns
pointer to string buffer
empty buffer if 'who' is not defined

Definition at line 59 of file db/dbmi_base/error.c.

void db_memory_error ( void  )

Report memory error.

Definition at line 134 of file db/dbmi_base/error.c.

References _, db_error(), and DB_MEMORY_ERR.

Referenced by db_calloc(), db_malloc(), and db_realloc().

void db_noproc_error ( int  procnum)

Report no procedure error.

Parameters
procnumprocedure number

Definition at line 159 of file db/dbmi_base/error.c.

References _, db_error(), and DB_NOPROC.

Referenced by db__start_procedure_call().

void db_on_error ( void(*)(const char *)  f)

User defined error procedure.

Parameters
fpointer to user-defined function

Definition at line 36 of file db/dbmi_base/error.c.

void db_print_error ( void  )

Print error.

If not defined, the error message is printed to stderr.

Definition at line 183 of file db/dbmi_base/error.c.

Referenced by db_error().

void db_set_error_who ( const char *  me)

Set 'who' for error messages.

Parameters
memy name

Definition at line 46 of file db/dbmi_base/error.c.

References db_free(), and db_store().

void db_syserror ( const char *  s)

Report system error.

Parameters
serror message

Definition at line 101 of file db/dbmi_base/error.c.

References db_error().

Referenced by db_dirent(), db_driver(), db_read_dbmscap(), and db_start_driver().