GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-c17eaff561
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.


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.

Joel Jones (CERL/UIUC)
Upgraded to GRASS 5.7 by Radim Blazek
Doxygenized by Martin Landa <landa.martin> (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.


Definition at line 247 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.


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

◆ db_clear_error()

void db_clear_error ( void  )

Clear error status.

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

◆ db_debug()

void db_debug ( const char *  s)

Print debug message.

sdebug message

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

◆ db_debug_off()

void db_debug_off ( void  )

Turn off debugging.

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

◆ db_debug_on()

void db_debug_on ( void  )

Turn on debugging.

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

◆ db_error()

◆ db_get_error_code()

int db_get_error_code ( void  )

Get error code.

DB_OK if not defined

Definition at line 125 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.

pointer to error message string

Definition at line 237 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

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 133 of file db/dbmi_base/error.c.

References _, and db_error().

◆ db_noproc_error()

void db_noproc_error ( int  procnum)

Report no procedure error.

procnumprocedure number

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

References _, db_error(), and procnum.

Referenced by db__start_procedure_call().

◆ db_on_error()

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

User defined error procedure.

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

memy name

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

◆ db_syserror()

void db_syserror ( const char *  s)

Report system error.

serror message

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

Referenced by db_read_dbmscap().