8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-28 02:43:03 +01:00
firebird-mirror/src/jrd/ini.h

174 lines
3.8 KiB
C
Raw Normal View History

2001-05-23 15:26:42 +02:00
/*
* PROGRAM: JRD Access Method
* MODULE: ini.h
* DESCRIPTION: Declarations for metadata initialization
*
* 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): ______________________________________.
*/
/* Note that this file is used by jrdmet.cpp in gpre
as well as by ini.epp in JRD. Make sure that any
2001-05-23 15:26:42 +02:00
changes are compatible in both places. */
2005-05-28 00:45:31 +02:00
#include "../jrd/intlobj_new.h"
2001-05-23 15:26:42 +02:00
#include "../jrd/intl.h"
#include "../intl/country_codes.h"
#include "../intl/charsets.h"
2002-07-01 17:46:07 +02:00
#include "../jrd/obj.h"
#include "../jrd/dflt.h"
2004-05-07 09:57:46 +02:00
//******************************
// names.h
//******************************
2001-05-23 15:26:42 +02:00
/* Define name ids */
#define NAME(name, id) id,
2008-12-21 07:12:41 +01:00
enum name_ids { nam_MIN,
#include "../jrd/names.h"
2008-12-21 07:12:41 +01:00
nam_MAX};
2001-05-23 15:26:42 +02:00
#undef NAME
/* Define name strings */
#define NAME(name, id) name,
2003-02-28 13:57:13 +01:00
static const TEXT* const names[] =
2001-05-23 15:26:42 +02:00
{
0,
#include "../jrd/names.h"
2001-05-23 15:26:42 +02:00
};
#undef NAME
2004-05-07 09:57:46 +02:00
//******************************
// fields.h
//******************************
const USHORT BLOB_SIZE = 8;
const USHORT TIMESTAMP_SIZE = 8;
2001-05-23 15:26:42 +02:00
/* Pick up global ids */
#define FIELD(type,name,dtype,length,sub_type,ods,dflt_blr) type,
2004-05-24 19:31:47 +02:00
enum gflds {
#include "../jrd/fields.h"
2004-05-24 19:31:47 +02:00
gfld_MAX};
2001-05-23 15:26:42 +02:00
#undef FIELD
2004-05-24 19:31:47 +02:00
typedef gflds GFLDS;
2001-05-23 15:26:42 +02:00
/* Pick up actual global fields */
#ifndef GPRE
#define FIELD(type,name,dtype,length,sub_type,ods,dflt_blr) \
{ (int) type, (int) name, dtype, length, sub_type, ods, dflt_blr, sizeof(dflt_blr) },
2001-05-23 15:26:42 +02:00
#else
#define FIELD(type,name,dtype,length,sub_type,ods,dflt_blr) \
{ (int) type, (int) name, dtype, length, sub_type, ods, NULL, 0 },
2001-05-23 15:26:42 +02:00
#endif
struct gfld
2001-05-23 15:26:42 +02:00
{
int gfld_type;
int gfld_name;
2001-05-23 15:26:42 +02:00
UCHAR gfld_dtype;
USHORT gfld_length;
UCHAR gfld_sub_type; // mismatch; dsc2.h uses SSHORT.
2001-05-23 15:26:42 +02:00
UCHAR gfld_minor;
2003-02-13 11:11:35 +01:00
const UCHAR *gfld_dflt_blr;
2001-05-23 15:26:42 +02:00
USHORT gfld_dflt_len;
};
2001-05-23 15:26:42 +02:00
2003-02-28 13:57:13 +01:00
static const struct gfld gfields[] = {
#include "../jrd/fields.h"
2003-12-22 11:00:59 +01:00
{ 0, 0, dtype_unknown, 0, 0, 0, NULL, 0 }
2001-05-23 15:26:42 +02:00
};
#undef FIELD
2004-05-07 09:57:46 +02:00
//******************************
// relations.h
//******************************
2001-05-23 15:26:42 +02:00
/* Pick up relation ids */
#define RELATION(name, id, ods, type) id,
2001-05-23 15:26:42 +02:00
#define FIELD(symbol, name, id, update, ods, upd_id, upd_ods)
#define END_RELATION
2004-05-24 19:31:47 +02:00
enum rids {
#include "../jrd/relations.h"
2004-05-24 19:31:47 +02:00
rel_MAX};
2001-05-23 15:26:42 +02:00
#undef RELATION
#undef FIELD
#undef END_RELATION
2004-05-24 19:31:47 +02:00
typedef rids RIDS;
2001-05-23 15:26:42 +02:00
/* Pick up relations themselves */
#define RELATION(name, id, ods, type) (int) name, (int) id, ods, type,
2001-05-23 15:26:42 +02:00
#define FIELD(symbol, name, id, update, ods, upd_id, upd_ods)\
(int) name, (int) id, update, ods, (int) upd_id, upd_ods,
2001-05-23 15:26:42 +02:00
#define END_RELATION 0,
const int RFLD_R_NAME = 0;
const int RFLD_R_ID = 1;
const int RFLD_R_ODS = 2;
const int RFLD_R_TYPE = 3;
const int RFLD_RPT = 4;
const int RFLD_F_NAME = 0;
const int RFLD_F_ID = 1;
const int RFLD_F_UPDATE = 2;
const int RFLD_F_MINOR = 3;
const int RFLD_F_UPD_ID = 4;
const int RFLD_F_UPD_MINOR = 5;
const int RFLD_F_LENGTH = 6;
2001-05-23 15:26:42 +02:00
static const int relfields[] =
2001-05-23 15:26:42 +02:00
{
#include "../jrd/relations.h"
2001-05-23 15:26:42 +02:00
0
};
#undef RELATION
#undef FIELD
#undef END_RELATION
2004-05-07 09:57:46 +02:00
//******************************
2008-01-16 10:07:24 +01:00
// types.h
2004-05-07 09:57:46 +02:00
//******************************
2001-05-23 15:26:42 +02:00
/* obtain field types */
struct rtyp {
const TEXT* rtyp_name;
2001-05-23 15:26:42 +02:00
SSHORT rtyp_value;
int rtyp_field;
};
2001-05-23 15:26:42 +02:00
#define TYPE(text, type, field) { text, type, field },
2001-05-23 15:26:42 +02:00
static const rtyp types[] = {
2001-05-23 15:26:42 +02:00
#include "../jrd/types.h"
{NULL, 0, 0}
};
#undef TYPE