8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 17:23:04 +01:00

Improvements and correction to external routines.

This commit is contained in:
asfernandes 2012-05-23 15:39:27 +00:00
parent 69da2285d0
commit 595bc63f5b
3 changed files with 50 additions and 1 deletions

View File

@ -79,13 +79,20 @@
FB_BOOST_PP_CAT(FB_BLR_, FB_BOOST_PP_TUPLE_ELEM(2, 0, xy)), \
FB_BLR_FB_SMALLINT,
//// TODO: more types
#define FB_BLR_FB_SCALED_SMALLINT(scale) blr_short, (scale)
#define FB_BLR_FB_SCALED_INTEGER(scale) blr_long, (scale)
#define FB_BLR_FB_SCALED_BIGINT(scale) blr_int64, (scale)
#define FB_BLR_FB_SMALLINT FB_BLR_FB_SCALED_SMALLINT(0)
#define FB_BLR_FB_INTEGER FB_BLR_FB_SCALED_INTEGER(0)
#define FB_BLR_FB_BIGINT FB_BLR_FB_SCALED_BIGINT(0)
#define FB_BLR_FB_FLOAT blr_float
#define FB_BLR_FB_DOUBLE blr_double
#define FB_BLR_FB_BLOB blr_blob2, 0, 0, 0, 0
#define FB_BLR_FB_BOOLEAN blr_bool
#define FB_BLR_FB_DATE blr_sql_date
#define FB_BLR_FB_TIME blr_sql_time
#define FB_BLR_FB_TIMESTAMP blr_timestamp
#define FB_BLR_FB_CHAR(len) blr_text2, 0, 0, (len) & 0xFF, (len) >> 8
#define FB_BLR_FB_VARCHAR(len) blr_varying2, 0, 0, (len) & 0xFF, (len) >> 8
#define FB_TYPE_FB_SCALED_SMALLINT(x) ISC_SHORT
@ -94,6 +101,14 @@
#define FB_TYPE_FB_SMALLINT ISC_SHORT
#define FB_TYPE_FB_INTEGER ISC_LONG
#define FB_TYPE_FB_BIGINT ISC_INT64
#define FB_TYPE_FB_FLOAT float
#define FB_TYPE_FB_DOUBLE double
#define FB_TYPE_FB_BLOB ISC_QUAD
#define FB_TYPE_FB_BOOLEAN unsigned char
#define FB_TYPE_FB_DATE ISC_DATE
#define FB_TYPE_FB_TIME ISC_TIME
#define FB_TYPE_FB_TIMESTAMP ISC_TIMESTAMP
#define FB_TYPE_FB_CHAR(len) ::Firebird::FbChar<(len)>
#define FB_TYPE_FB_VARCHAR(len) ::Firebird::FbVarChar<(len)>
#define FB_MESSAGE_DESC(name, fields) \
@ -114,6 +129,12 @@
namespace Firebird {
template <unsigned N>
struct FbChar
{
char str[N];
};
template <unsigned N>
struct FbVarChar
{

View File

@ -73,6 +73,14 @@ namespace Firebird
\
FB_UDR_EXECUTE__FUNCTION
#define FB_UDR_EXECUTE_MESSAGE_FUNCTION_OUT(outputs) \
typedef void* InMessage; \
FB_MESSAGE(OutMessage, \
outputs \
); \
\
FB_UDR_EXECUTE__FUNCTION
#define FB_UDR_EXECUTE__FUNCTION \
virtual void FB_CALL execute(::Firebird::Error* error, ::Firebird::ExternalContext* context, \
void* inMsg, void* outMsg) \
@ -129,6 +137,22 @@ namespace Firebird
\
FB_UDR_EXECUTE__PROCEDURE
#define FB_UDR_EXECUTE_MESSAGE_PROCEDURE_IN(inputs) \
FB_MESSAGE(InMessage, \
inputs \
); \
typedef void* OutMessage; \
\
FB_UDR_EXECUTE__PROCEDURE
#define FB_UDR_EXECUTE_MESSAGE_PROCEDURE_OUT(outputs) \
typedef void* InMessage; \
FB_MESSAGE(OutMessage, \
outputs \
); \
\
FB_UDR_EXECUTE__PROCEDURE
#define FB_UDR_EXECUTE__PROCEDURE \
virtual ::Firebird::ExternalResultSet* FB_CALL open(::Firebird::Error* error, \
::Firebird::ExternalContext* context, void* inMsg, void* outMsg) \

View File

@ -441,6 +441,10 @@ void PreparedStatement::generateBlr(const dsc* desc, UCharBuffer& blr)
blr.add(desc->getTextType() >> 8);
break;
case dtype_boolean:
blr.add(blr_bool);
break;
default:
fb_assert(false);
}