As attachements don't work, a short one:
Source is here:
https://github.com/FirebirdSQL/firebird/blob/master/src/burp/OdsDetection.epp
results in:
/*** Preprocessed module -- do not edit ***/
/*** Preprocessed module -- do not edit ***/
/*** Preprocessed module -- do not edit ***/
/*** Preprocessed module -- do not edit ***/
/*** Preprocessed module -- do not edit ***/
/* gpre version LI-T4.0.0.1436-dev Firebird 4.0 Beta 1
**/
/*
* PROGRAM:JRD Backup and Restore Program
* MODULE: OdsDetection.cpp
* DESCRIPTION:Detecting the backup (source) or restore (target) ODS
*
* The contents of this file are subject to the Interbase 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.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, 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 Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): __.
*
*/
#include "firebird.h"
#include "../burp/burp.h"
#include "../burp/burp_proto.h"
#include "../burp/OdsDetection.h"
namespace
{
// table used to determine capabilities, checking for specific
// fields in system relations
struct rel_field_t
{
const char* relation;
const char* field;
int ods_version;
};
const rel_field_t relations[] =
{
{"RDB$PROCEDURES", 0, DB_VERSION_DDL8}, // IB4
{"RDB$ROLES", 0, DB_VERSION_DDL9}, // IB5
{"RDB$PACKAGES",0, DB_VERSION_DDL12}, // FB3
{0, 0, 0}
};
const rel_field_t rel_fields[] =
{
{"RDB$FIELDS",
"RDB$FIELD_PRECISION", DB_VERSION_DDL10}, // FB1,
FB1.5
{"RDB$ROLES",
"RDB$DESCRIPTION", DB_VERSION_DDL11}, // FB2
{"RDB$RELATIONS",
"RDB$RELATION_TYPE",DB_VERSION_DDL11_1},// FB2.1
{"RDB$PROCEDURE_PARAMETERS","RDB$FIELD_NAME",
DB_VERSION_DDL11_2},
// FB2.5
{"RDB$PROCEDURES",
"RDB$ENGINE_NAME", DB_VERSION_DDL12}, // FB3.0
{0, 0, 0}
};
void general_on_error();
}
/*DATABASE DB = STATIC FILENAME "yachts.lnk";*/
/ GDS Preprocessor Definitions /
#ifndef JRD_IBASE_H
#include
#endif
#include
#define CAST_CONST_MSG(A) (reinterpret_cast(A))
#define CAST_MSG(A) (reinterpret_cast(A))
static const ISC_QUAD
fbBlobNull = {0, 0};/* initializer for blobs */
static Firebird::IAttachment*
DB = 0; /* database handle */
static Firebird::ITransaction*
fbTrans = 0;/* default transaction handle */
static Firebird::IMaster* fbMaster =
Firebird::fb_get_master_interface();/* master interface */
static Firebird::IProvider* fbProvider = fbMaster->getDispatcher();
/*
provider interface */
static Firebird::CheckStatusWrapper fbStatusObj(fbMaster->getStatus());
/* status vector */
static Firebird::CheckStatusWrapper fbStatus2Obj(fbMaster->getStatus());
/* status vector */
static Firebird::CheckStatusWrapper* fbStatus =/* status
vector */
static Firebird::CheckStatusWrapper* fbStatus2 = /*
status vector */
static int fbIStatus; /* last completion code */
static const unsigned
fb_0l = 164;
static const unsigned char
fb_0 [] = {
blr_version4,
blr_begin,
blr_message, 1, 1,0,
blr_short, 0,
blr_message, 0, 2,0,
blr_cstring, 241,3,
blr_cstring, 241,3,
blr_receive, 0,
blr_begin,
blr_for,
blr_rse, 1,
blr_relation, 19,
'R','D','B','$','R','E','L','A','T','I','O','N','_','F','I','E','L','D','S',
0,
blr_first,
blr_literal, blr_long, 0, 1,0,0,0,
blr_boolean,
blr_and,
blr_eql,
blr_field, 0, 17,
'R','D','B','$','R','E','L','A','T','I','O','N','_','N','A','M','E',
blr_parameter, 0, 0,0,
blr_and,