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

Changed location of some defines in order to avoid internals inside ibase.h.

This commit is contained in:
dimitr 2005-12-05 11:31:45 +00:00
parent c7909a4827
commit 52abeceb5e
5 changed files with 139 additions and 92 deletions

View File

@ -33,31 +33,31 @@
typedef struct
{
SSHORT sqltype; /* datatype of field */
SSHORT sqlscale; /* scale factor */
SSHORT sqlsubtype; /* datatype subtype - currently BLOBs only */
SSHORT sqllen; /* length of data area */
SCHAR* sqldata; /* address of data */
SSHORT* sqlind; /* address of indicator variable */
SSHORT sqlname_length; /* length of sqlname field */
SCHAR sqlname[32]; /* name of field, name length + space for NULL */
SSHORT relname_length; /* length of relation name */
SCHAR relname[32]; /* field's relation name + space for NULL */
SSHORT ownname_length; /* length of owner name */
SCHAR ownname[32]; /* relation's owner name + space for NULL */
SSHORT aliasname_length; /* length of alias name */
SCHAR aliasname[32]; /* relation's alias name + space for NULL */
ISC_SHORT sqltype; /* datatype of field */
ISC_SHORT sqlscale; /* scale factor */
ISC_SHORT sqlsubtype; /* datatype subtype - currently BLOBs only */
ISC_SHORT sqllen; /* length of data area */
ISC_SCHAR* sqldata; /* address of data */
ISC_SHORT* sqlind; /* address of indicator variable */
ISC_SHORT sqlname_length; /* length of sqlname field */
ISC_SCHAR sqlname[32]; /* name of field, name length + space for NULL */
ISC_SHORT relname_length; /* length of relation name */
ISC_SCHAR relname[32]; /* field's relation name + space for NULL */
ISC_SHORT ownname_length; /* length of owner name */
ISC_SCHAR ownname[32]; /* relation's owner name + space for NULL */
ISC_SHORT aliasname_length; /* length of alias name */
ISC_SCHAR aliasname[32]; /* relation's alias name + space for NULL */
} XSQLVAR;
#define SQLDA_VERSION1 1
typedef struct
{
SSHORT version; /* version of this XSQLDA */
SCHAR sqldaid[8]; /* XSQLDA name field */
SLONG sqldabc; /* length in bytes of SQLDA */
SSHORT sqln; /* number of fields allocated */
SSHORT sqld; /* actual number of fields */
ISC_SHORT version; /* version of this XSQLDA */
ISC_SCHAR sqldaid[8]; /* XSQLDA name field */
ISC_LONG sqldabc; /* length in bytes of SQLDA */
ISC_SHORT sqln; /* number of fields allocated */
ISC_SHORT sqld; /* actual number of fields */
XSQLVAR sqlvar[1]; /* first field address */
} XSQLDA;

View File

@ -29,33 +29,10 @@
*
*/
#ifndef INCLUDE_FB_TYPES_H
#define INCLUDE_FB_TYPES_H
/******************************************************************/
/* Define type, export and other stuff based on c/c++ and Windows */
/******************************************************************/
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#define ISC_EXPORT __stdcall
#define ISC_EXPORT_VARARG __cdecl
#else
#define ISC_EXPORT
#define ISC_EXPORT_VARARG
#endif
/*******************************************************************/
/* 64 bit Integers */
/*******************************************************************/
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(__GNUC__)
typedef __int64 ISC_INT64;
typedef unsigned __int64 ISC_UINT64;
#else
typedef long long int ISC_INT64;
typedef unsigned long long int ISC_UINT64;
#endif
#include <types_pub.h>
/* Nickolay: it is easier to assume that integer is at least 32-bit.
* This comes from limitation that we cannot reliably detect datatype size at
@ -70,12 +47,9 @@ typedef unsigned long long int ISC_UINT64;
/* EKU: Firebird requires (S)LONG to be 32 bit */
typedef int SLONG;
typedef unsigned int ULONG;
typedef unsigned int FB_API_HANDLE;
/* typedef void* FB_API_HANDLE; */
#else
typedef long SLONG;
typedef unsigned long ULONG;
typedef void* FB_API_HANDLE;
#endif
typedef struct {
@ -83,17 +57,6 @@ typedef struct {
ULONG low;
} SQUAD;
struct GDS_QUAD_t {
SLONG gds_quad_high;
ULONG gds_quad_low;
};
typedef struct GDS_QUAD_t GDS_QUAD;
typedef struct GDS_QUAD_t ISC_QUAD;
#define isc_quad_high gds_quad_high
#define isc_quad_low gds_quad_low
/* Basic data types */
/* typedef signed char SCHAR;
@ -102,11 +65,18 @@ typedef struct GDS_QUAD_t ISC_QUAD;
*/
typedef char SCHAR;
typedef unsigned char UCHAR;
typedef short SSHORT;
typedef unsigned short USHORT;
/* Substitution of API data types */
typedef SCHAR ISC_SCHAR;
typedef UCHAR ISC_UCHAR;
typedef SSHORT ISC_SHORT;
typedef USHORT ISC_USHORT;
typedef SLONG ISC_LONG;
typedef ULONG ISC_ULONG;
/*
* TMN: some misc data types from all over the place
@ -124,6 +94,8 @@ struct lstring
UCHAR* lstr_address;
};
#define ISC_STATUS_LENGTH 20
typedef ISC_STATUS ISC_STATUS_ARRAY[ISC_STATUS_LENGTH];
typedef unsigned char BOOLEAN;
typedef char TEXT; /* To be expunged over time */
@ -131,9 +103,9 @@ typedef char TEXT; /* To be expunged over time */
typedef unsigned char UTEXT; Unsigned text - not used */
typedef unsigned char BYTE; /* Unsigned byte - common */
/*typedef char SBYTE; Signed byte - not used */
typedef long ISC_STATUS;
typedef long IPTR;
typedef unsigned long U_IPTR;
typedef void (*FPTR_VOID) ();
typedef void (*FPTR_VOID_PTR) (void*);
typedef int (*FPTR_INT) ();
@ -159,9 +131,6 @@ typedef int (*lock_ast_t)(void*);
typedef IPTR FB_THREAD_ID;
#define ISC_STATUS_LENGTH 20
typedef ISC_STATUS ISC_STATUS_ARRAY[ISC_STATUS_LENGTH];
/* Number of elements in an array */
#define FB_NELEM(x) ((int)(sizeof(x) / sizeof(x[0])))
#define FB_ALIGN(n, b) ((n + b - 1) & ~(b - 1))

87
src/include/types_pub.h Normal file
View File

@ -0,0 +1,87 @@
/*
* PROGRAM: Client/Server Common Code
* MODULE: types_pub.h
* DESCRIPTION: Types that are used both internally and externally
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
*
* Software distributed under the License is distributed AS IS,
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights
* and limitations under the License.
*
* The Original Code was created by Dmitry Yemanov
* for the Firebird Open Source RDBMS project.
*
* Copyright (c) 2004 Dmitry Yemanov <dimitr@users.sf.net>
* and all contributors signed below.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#ifndef INCLUDE_TYPES_PUB_H
#define INCLUDE_TYPES_PUB_H
/******************************************************************/
/* API handles */
/******************************************************************/
#if defined(_LP64) || defined(__LP64__) || defined(__arch64__)
typedef unsigned int FB_API_HANDLE;
#else
typedef void* FB_API_HANDLE;
#endif
/******************************************************************/
/* Status vector */
/******************************************************************/
typedef long ISC_STATUS;
/******************************************************************/
/* Define type, export and other stuff based on c/c++ and Windows */
/******************************************************************/
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#define ISC_EXPORT __stdcall
#define ISC_EXPORT_VARARG __cdecl
#else
#define ISC_EXPORT
#define ISC_EXPORT_VARARG
#endif
/*******************************************************************/
/* Time & Date support */
/*******************************************************************/
#ifndef ISC_TIMESTAMP_DEFINED
typedef int ISC_DATE;
typedef unsigned int ISC_TIME;
typedef struct
{
ISC_DATE timestamp_date;
ISC_TIME timestamp_time;
} ISC_TIMESTAMP;
#define ISC_TIMESTAMP_DEFINED
#endif /* ISC_TIMESTAMP_DEFINED */
/*******************************************************************/
/* Blob Id support */
/*******************************************************************/
struct GDS_QUAD_t {
long gds_quad_high;
unsigned long gds_quad_low;
};
typedef struct GDS_QUAD_t GDS_QUAD;
typedef struct GDS_QUAD_t ISC_QUAD;
#define isc_quad_high gds_quad_high
#define isc_quad_low gds_quad_low
#endif // INCLUDE_TYPES_PUB_H

View File

@ -36,7 +36,7 @@
#ifndef JRD_IBASE_H
#define JRD_IBASE_H
#include "fb_types.h"
#include "types_pub.h"
#define FB_API_VER 20
#define isc_version4
@ -80,6 +80,19 @@ typedef unsigned short ISC_USHORT;
typedef unsigned char ISC_UCHAR;
typedef char ISC_SCHAR;
/*******************************************************************/
/* 64 bit Integers */
/*******************************************************************/
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(__GNUC__)
typedef __int64 ISC_INT64;
typedef unsigned __int64 ISC_UINT64;
#else
typedef long long int ISC_INT64;
typedef unsigned long long int ISC_UINT64;
#endif
/********************************/
/* InterBase Handle Definitions */
/********************************/
@ -94,26 +107,10 @@ typedef FB_API_HANDLE isc_tr_handle;
typedef void (* isc_callback) ();
typedef ISC_LONG isc_resv_handle;
/*******************************************************************/
/* Time & Date Support */
/*******************************************************************/
typedef void (*ISC_PRINT_CALLBACK) (void*, ISC_SHORT, const char*);
typedef void (*ISC_VERSION_CALLBACK)(void*, const char*);
typedef void (*ISC_EVENT_CALLBACK)(void*, ISC_USHORT, const ISC_UCHAR*);
#ifndef ISC_TIMESTAMP_DEFINED
typedef int ISC_DATE;
typedef unsigned int ISC_TIME;
typedef struct
{
ISC_DATE timestamp_date;
ISC_TIME timestamp_time;
} ISC_TIMESTAMP;
#define ISC_TIMESTAMP_DEFINED
#endif /* ISC_TIMESTAMP_DEFINED */
/*
* Included in dsc_pub.h
* #define ISC_TIME_SECONDS_PRECISION 10000L
* #define ISC_TIME_SECONDS_PRECISION_SCALE (-4)
*/
/*******************************************************************/
/* Blob id structure */
/*******************************************************************/
@ -149,8 +146,6 @@ typedef struct
ISC_UCHAR blob_desc_relation_name[32];
} ISC_BLOB_DESC;
/***************************/
/* Blob control structure */
/***************************/
@ -193,7 +188,6 @@ typedef struct bstream
#define putb(x,p) (((x) == '\n' || (!(--(p)->bstr_cnt))) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
#define putbx(x,p) ((!(--(p)->bstr_cnt)) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
/********************************************************************/
/* CVC: Public blob interface definition held in val.h. */
/* For some unknown reason, it was only documented in langRef */
@ -229,7 +223,6 @@ typedef struct blobcallback {
#endif /* !defined(JRD_VAL_H) && !defined(REQUESTER) */
/********************************************************************/
/* CVC: Public descriptor interface held in dsc2.h. */
/* We need it documented to be able to recognize NULL in UDFs. */
@ -263,14 +256,12 @@ typedef struct paramvary {
#endif /* !defined(JRD_DSC_H) */
/***************************/
/* Dynamic SQL definitions */
/***************************/
#include "../dsql/sqlda_pub.h"
/***************************/
/* OSRI database functions */
/***************************/
@ -616,7 +607,7 @@ ISC_STATUS ISC_EXPORT isc_que_events(ISC_STATUS*,
ISC_LONG*,
short,
const ISC_SCHAR*,
FPTR_EVENT_CALLBACK,
ISC_EVENT_CALLBACK,
void*);
ISC_STATUS ISC_EXPORT isc_rollback_retaining(ISC_STATUS *,
@ -1069,7 +1060,7 @@ ISC_LONG ISC_EXPORT isc_ftof(const ISC_SCHAR*,
const unsigned short);
ISC_STATUS ISC_EXPORT isc_print_blr(const ISC_SCHAR*,
FPTR_PRINT_CALLBACK,
ISC_PRINT_CALLBACK,
void*,
short);
@ -1087,7 +1078,7 @@ void ISC_EXPORT isc_vtov(const ISC_SCHAR*,
short);
int ISC_EXPORT isc_version(isc_db_handle*,
FPTR_VERSION_CALLBACK,
ISC_VERSION_CALLBACK,
void*);
ISC_LONG ISC_EXPORT isc_reset_fpe(ISC_USHORT);

View File

@ -1,4 +1,4 @@
s/#include "fb_types.h"//g
s/#include "types_pub.h"//g
s/#include "blr.h"//g
s/#include "iberror.h"//g
s/#include "sqlda_pub.h"//g