botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
bsLibError.c File Reference

Error and logging handling routines. More...

#include <stdio.h>
#include <stdlib.h>
#include <libgen.h>
#include <string.h>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "botsense/BotSense.h"
#include "botsense/libBotSense.h"
#include "bsLibInternal.h"

Go to the source code of this file.

Functions

const char * bsStrError (int ecode)
 Get the error string describing the BotSense error code. More...
 

Variables

static const char * bsEcodeStrTbl []
  BotSense Error Code String Table. More...
 

Detailed Description

Error and logging handling routines.

LastChangedDate
2010-09-25 09:06:47 -0600 (Sat, 25 Sep 2010)
Rev
605
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)

Definition in file bsLibError.c.

Function Documentation

const char* bsStrError ( int  ecode)

Get the error string describing the BotSense error code.

The absolute value of the error code is taken prior retrieving the string. An unknown or out-of-range error code will be mapped to BS_ECODE_BADEC.

Parameters
ecode

Definition at line 122 of file bsLibError.c.

References BS_ECODE_BADEC, and bsEcodeStrTbl.

123 {
124  if( ecode < 0 )
125  {
126  ecode = -ecode;
127  }
128 
129  if( ecode >= arraysize(bsEcodeStrTbl) )
130  {
131  ecode = BS_ECODE_BADEC;
132  }
133  return bsEcodeStrTbl[ecode];
134 }
#define BS_ECODE_BADEC
bad error code
Definition: BotSense.h:95
static const char * bsEcodeStrTbl[]
<b><i>BotSense</i></b> Error Code String Table.
Definition: bsLibError.c:73

Variable Documentation

const char* bsEcodeStrTbl[]
static

BotSense Error Code String Table.

Table is indexed by BotSense error codes (see BotSense Error Codes). Keep in sync.

Definition at line 73 of file bsLibError.c.

Referenced by bsStrError().