205 lines
4.3 KiB
C
205 lines
4.3 KiB
C
|
#ifndef h_DATUM
|
||
|
#define h_DATUM
|
||
|
/******************************************************************************
|
||
|
*
|
||
|
* Definition of "typeless" structure DATUM
|
||
|
*
|
||
|
* Module %M% Version %I% Date %H%
|
||
|
*
|
||
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
||
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
||
|
* The copyright notice above does not evidence any actual or intented
|
||
|
* publication of such source code.
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
* Maintenence log - insert most recent change descriptions at top
|
||
|
*
|
||
|
* Date.... GTAR# WHO Description.........................................
|
||
|
* 10/14/98 23801 SAP Change copyrights.
|
||
|
* 10/30/95 17244 DPB Change Fassigned to return 0 for unassigned COMMON
|
||
|
* variables (in PICK flavor accounts).
|
||
|
* 06/25/93 11417 CSM Add ODBC info to datum struct, new td_odbc macros
|
||
|
* 01/02/93 10795 JWT Added dynamic array field caching areas to DATUMs
|
||
|
* 08/22/91 8657 JSM Added Tnull data type
|
||
|
* 11/13/89 6098 JWT changed MATRIX dim type to ushort to use all
|
||
|
* available bits
|
||
|
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
|
||
|
*
|
||
|
*****************************************************************************/
|
||
|
|
||
|
#include "DBFILE.h"
|
||
|
#include "SEQFILE.h"
|
||
|
|
||
|
#define Tundef 0
|
||
|
#define Tnumber 1
|
||
|
#define Tstring 2
|
||
|
#define Tfile 4
|
||
|
#define Tselect 5
|
||
|
#define Tmatrix 6
|
||
|
#define Tsfile 7
|
||
|
#define Tsubr 8
|
||
|
#define Tfmatrix 9
|
||
|
#define Tint 10
|
||
|
#define Tgci 11
|
||
|
#define Tnull 12
|
||
|
#define Todbc 13
|
||
|
|
||
|
|
||
|
#if DATUM12
|
||
|
|
||
|
typedef struct
|
||
|
{ DATUM *mat;
|
||
|
ushort xmax,
|
||
|
ymax;
|
||
|
} MATRIX;
|
||
|
|
||
|
struct Dstring
|
||
|
{ STRING str;
|
||
|
int lastfield;
|
||
|
uchar *lastfptr;
|
||
|
};
|
||
|
|
||
|
typedef struct
|
||
|
{ PROGRAM *prog;
|
||
|
DATUM *flink;
|
||
|
} SUBR;
|
||
|
|
||
|
struct datum
|
||
|
{ BITMAP datatype : 5,
|
||
|
temp : 1,
|
||
|
reuse : 1,
|
||
|
assigned : 1,
|
||
|
misc :24;
|
||
|
union { double number;
|
||
|
struct Dstring str;
|
||
|
DBFILE *dbfile;
|
||
|
SELFILE *selfile;
|
||
|
MATRIX matrix;
|
||
|
SEQFILE *seqfile;
|
||
|
SUBR subr;
|
||
|
int integer;
|
||
|
int gci;
|
||
|
char *odbc;
|
||
|
} data;
|
||
|
};
|
||
|
|
||
|
#define td_type datatype
|
||
|
#define td_temp temp
|
||
|
#define td_reuse reuse
|
||
|
#define td_assigned assigned
|
||
|
#define td_number data.number
|
||
|
#define td_string data.str.str
|
||
|
#define td_remove misc
|
||
|
#define td_lastfield data.str.lastfield
|
||
|
#define td_lastfptr data.str.lastfptr
|
||
|
#define td_dbfile data.dbfile
|
||
|
#define td_selfile data.selfile
|
||
|
#define td_matrix data.matrix.mat
|
||
|
#define td_xmax data.matrix.xmax
|
||
|
#define td_ymax data.matrix.ymax
|
||
|
#define td_seqfile data.seqfile
|
||
|
#define td_subr data.subr
|
||
|
#define td_integer data.integer
|
||
|
#define td_gci data.gci
|
||
|
#define td_odbc data.odbc
|
||
|
|
||
|
#else /* DATUM16 */
|
||
|
|
||
|
struct Dint
|
||
|
{
|
||
|
int integer;
|
||
|
};
|
||
|
|
||
|
struct Dnumber
|
||
|
{
|
||
|
double numval;
|
||
|
};
|
||
|
|
||
|
struct Dstring
|
||
|
{
|
||
|
STRING str;
|
||
|
int remptr;
|
||
|
int lastfield;
|
||
|
uchar *lastfptr;
|
||
|
};
|
||
|
|
||
|
struct Dmatrix
|
||
|
{
|
||
|
int xmax,
|
||
|
ymax;
|
||
|
DATUM *mat;
|
||
|
};
|
||
|
|
||
|
struct Dsfile
|
||
|
{
|
||
|
SEQFILE *fp;
|
||
|
};
|
||
|
|
||
|
struct Dfilei
|
||
|
{
|
||
|
DBFILE *dfp;
|
||
|
};
|
||
|
|
||
|
struct Dsubr
|
||
|
{
|
||
|
PROGRAM *prog;
|
||
|
DATUM *flink,
|
||
|
*blink;
|
||
|
|
||
|
};
|
||
|
|
||
|
union descriptor
|
||
|
{
|
||
|
struct Dstring sdesc;
|
||
|
struct Dnumber ndesc;
|
||
|
struct Dmatrix mdesc;
|
||
|
struct Dfilei fdesc;
|
||
|
struct Dselect *xdesc;
|
||
|
struct Dsfile qdesc;
|
||
|
struct Dsubr subrdesc;
|
||
|
struct Dint idesc;
|
||
|
int gcifunct;
|
||
|
char *odbc;
|
||
|
};
|
||
|
|
||
|
struct datum
|
||
|
{
|
||
|
union descriptor xdatadesc;
|
||
|
uchar xdatatype,
|
||
|
xtemp,
|
||
|
xreuse,
|
||
|
xassigned;
|
||
|
};
|
||
|
|
||
|
#define td_type xdatatype
|
||
|
#define td_temp xtemp
|
||
|
#define td_reuse xreuse
|
||
|
#define td_assigned xassigned
|
||
|
#define td_string xdatadesc.sdesc.str
|
||
|
#define td_remove xdatadesc.sdesc.remptr
|
||
|
#define td_lastfield xdatadesc.sdesc.lastfield
|
||
|
#define td_lastfptr xdatadesc.sdesc.lastfptr
|
||
|
#define td_number xdatadesc.ndesc.numval
|
||
|
#define td_matrix xdatadesc.mdesc.mat
|
||
|
#define td_xmax xdatadesc.mdesc.xmax
|
||
|
#define td_ymax xdatadesc.mdesc.ymax
|
||
|
#define td_dbfile xdatadesc.fdesc.dfp
|
||
|
#define td_selfile xdatadesc.xdesc
|
||
|
#define td_seqfile xdatadesc.qdesc.fp
|
||
|
#define td_subr xdatadesc.subrdesc
|
||
|
#define td_integer xdatadesc.idesc.integer
|
||
|
#define td_gci xdatadesc.gcifunct
|
||
|
#define td_odbc xdatadesc.odbc
|
||
|
|
||
|
#endif /* DATUM12 */
|
||
|
|
||
|
EXTERN int sl_tem,sl_ruse;
|
||
|
EXTERN STRING str_load();
|
||
|
EXTERN double num_load();
|
||
|
EXTERN void str_store(),num_store(),rel_var(),clear_var();
|
||
|
EXTERN void DATUMdisp();
|
||
|
EXTERN int RMODrel_varcb();
|
||
|
|
||
|
#endif /* end of DATUM.h */
|