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): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
2004-06-29 06:37:59 +02:00
|
|
|
/* 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"
|
2004-05-18 18:40:20 +02:00
|
|
|
#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,
|
2003-08-04 01:26:51 +02:00
|
|
|
#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,
|
2003-08-04 01:26:51 +02:00
|
|
|
#include "../jrd/names.h"
|
2001-05-23 15:26:42 +02:00
|
|
|
};
|
|
|
|
#undef NAME
|
|
|
|
|
2004-05-07 09:57:46 +02:00
|
|
|
//******************************
|
|
|
|
// fields.h
|
|
|
|
//******************************
|
2006-07-17 19:44:18 +02:00
|
|
|
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 {
|
2003-08-04 01:26:51 +02:00
|
|
|
#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
|
2006-07-17 19:44:18 +02:00
|
|
|
#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
|
2006-07-17 19:44:18 +02:00
|
|
|
#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
|
|
|
|
|
2004-01-28 08:50:41 +01:00
|
|
|
struct gfld
|
2001-05-23 15:26:42 +02:00
|
|
|
{
|
2006-07-17 19:44:18 +02:00
|
|
|
int gfld_type;
|
|
|
|
int gfld_name;
|
2001-05-23 15:26:42 +02:00
|
|
|
UCHAR gfld_dtype;
|
2004-11-17 13:19:18 +01:00
|
|
|
USHORT gfld_length;
|
2004-03-30 10:34:14 +02:00
|
|
|
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;
|
2004-01-28 08:50:41 +01:00
|
|
|
};
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2003-02-28 13:57:13 +01:00
|
|
|
static const struct gfld gfields[] = {
|
2003-08-04 01:26:51 +02:00
|
|
|
#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 */
|
|
|
|
|
2006-07-17 19:44:18 +02:00
|
|
|
#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 {
|
2003-08-04 01:26:51 +02:00
|
|
|
#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 */
|
|
|
|
|
2006-07-17 19:44:18 +02:00
|
|
|
#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)\
|
2006-07-17 19:44:18 +02:00
|
|
|
(int) name, (int) id, update, ods, (int) upd_id, upd_ods,
|
2001-05-23 15:26:42 +02:00
|
|
|
#define END_RELATION 0,
|
|
|
|
|
2004-05-01 00:47:16 +02:00
|
|
|
const int RFLD_R_NAME = 0;
|
|
|
|
const int RFLD_R_ID = 1;
|
2006-07-17 19:44:18 +02:00
|
|
|
const int RFLD_R_ODS = 2;
|
|
|
|
const int RFLD_R_TYPE = 3;
|
|
|
|
const int RFLD_RPT = 4;
|
2004-05-01 00:47:16 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2006-07-17 19:44:18 +02:00
|
|
|
static const int relfields[] =
|
2001-05-23 15:26:42 +02:00
|
|
|
{
|
2003-08-04 01:26:51 +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 */
|
|
|
|
|
2004-01-28 08:50:41 +01:00
|
|
|
struct rtyp {
|
|
|
|
const TEXT* rtyp_name;
|
2001-05-23 15:26:42 +02:00
|
|
|
SSHORT rtyp_value;
|
2007-09-28 14:54:51 +02:00
|
|
|
int rtyp_field;
|
2004-01-28 08:50:41 +01:00
|
|
|
};
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2007-09-28 14:54:51 +02:00
|
|
|
#define TYPE(text, type, field) { text, type, field },
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-01-28 08:50:41 +01:00
|
|
|
static const rtyp types[] = {
|
2001-05-23 15:26:42 +02:00
|
|
|
#include "../jrd/types.h"
|
|
|
|
{NULL, 0, 0}
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef TYPE
|