GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
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

◆ db_auto_print_errors()

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.

◆ db_auto_print_protocol_errors()

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.

◆ db_clear_error()

void db_clear_error ( void  )

Clear error status.

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

◆ db_debug()

void db_debug ( const char *  s)

Print debug message.

Parameters
sdebug message

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

◆ db_debug_off()

void db_debug_off ( void  )

Turn off debugging.

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

◆ db_debug_on()

void db_debug_on ( void  )

Turn on debugging.

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

◆ db_error()

◆ db_get_error_code()

int db_get_error_code ( void  )

Get error code.

Returns
DB_OK if not defined

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

Referenced by db__recv_index_array(), and db_set_index_column_name().

◆ db_get_error_msg()

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.

Referenced by db__send_failure().

◆ db_get_error_who()

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.

◆ db_memory_error()

void db_memory_error ( void  )

Report memory error.

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

References _, and db_error().

◆ db_noproc_error()

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 _, and db_error().

Referenced by db__start_procedure_call().

◆ db_on_error()

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.

◆ db_print_error()

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.

◆ db_procedure_not_implemented()

◆ db_protocol_error()

void db_protocol_error ( void  )

◆ db_set_error_who()

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.

◆ db_syserror()

void db_syserror ( const char *  s)

Report system error.

Parameters
serror message

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

Referenced by db_read_dbmscap().