VisualIB  1.0
IBExpress library for making use of Borland IBExpress outside of C++Builder
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
viberror.cpp File Reference

VisualIB - InterBase wrapper for use in Visual Studio. More...

#include <cstdlib>
#include "vibdefines.h"
#include "viberror.h"

Classes

struct  VIBError
 Tracking data for the last error to occur. More...
 

Functions

void VIBCALL VIBError_GetLastError (const char **message, int *iberror, int *sqlcode)
 We can't throw exceptions directly out of the library, as I want it to be as widely usable as possible.
 
char * cpp_strdup (const char *input)
 Internal function.
 
void VIBCALL VIBError_Report (const char *message, int iberror, int sqlcode)
 Internal function.
 

Variables

static VIBError lastError
 

Detailed Description

VisualIB - InterBase wrapper for use in Visual Studio.

Error Handling and Propagation

Author
James Haley

Function Documentation

char* cpp_strdup ( const char *  input)

Internal function.

A strdup substitute that uses new [] to do allocation.

void VIBCALL VIBError_GetLastError ( const char **  message,
int *  iberror,
int *  sqlcode 
)

We can't throw exceptions directly out of the library, as I want it to be as widely usable as possible.

Instead, routines that intercept an EIBError or EIBInterBaseError will report it to this module, which can be queried externally when a routine gives an unexpected return value.

Parameters
[inout]message Receives the last error message, if any; "" if not.
[inout]iberror Receives the last IBErrorCode
[inout]sqlcode Receives the last SQLCode
Warning
All three parameters must be non-NULL.
void VIBCALL VIBError_Report ( const char *  message,
int  iberror,
int  sqlcode 
)

Internal function.

Saves the current error.