1994-09-19 09:50:07 +00:00
|
|
|
#ifndef __EXTCTYPE_H
|
|
|
|
#define __EXTCTYPE_H
|
|
|
|
|
2008-10-07 09:02:41 +00:00
|
|
|
#ifndef __CCOMMON_H
|
|
|
|
#include <ccommon.h>
|
1998-02-13 13:50:39 +00:00
|
|
|
#endif
|
1994-09-28 10:36:08 +00:00
|
|
|
|
1994-09-19 09:50:07 +00:00
|
|
|
#ifndef __STDTTYPES_H
|
|
|
|
#include <stdtypes.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* @M */
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define __PACKED__ __attribute__ ((packed))
|
|
|
|
#define __ALIGNED__ __attribute__ ((aligned(2)))
|
|
|
|
#define __PACK_1__
|
2008-10-07 09:02:41 +00:00
|
|
|
#endif
|
1994-09-19 09:50:07 +00:00
|
|
|
|
2008-10-07 09:02:41 +00:00
|
|
|
#ifdef WIN32
|
1994-09-19 09:50:07 +00:00
|
|
|
#define __PACKED__
|
|
|
|
#define __ALIGNED__
|
1998-03-05 13:54:51 +00:00
|
|
|
#pragma pack(2)
|
1994-09-19 09:50:07 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* @DES Tipi e macro da programmi C */
|
|
|
|
/* @M */
|
|
|
|
#define MaxFields 100
|
|
|
|
#define MKFields 10
|
|
|
|
#define MaxKeys 8
|
|
|
|
#define NORDIR 0
|
|
|
|
#define COMDIR 1
|
|
|
|
#define MaxArray 80
|
|
|
|
#define BPageLen 512
|
|
|
|
#define PHLen 20
|
|
|
|
#define AreaLen (BPageLen - PHLen)
|
|
|
|
#define PDLen 28
|
|
|
|
#define FHRLen 32
|
|
|
|
#define MaxPD ((BPageLen - FHRLen) / PDLen)
|
|
|
|
#define NOFLDS 10
|
|
|
|
#define MOSTMEM 51200
|
|
|
|
#define LEASTMEM 10240
|
|
|
|
|
2003-03-27 12:14:51 +00:00
|
|
|
#define INT16 short
|
|
|
|
#define UINT16 unsigned short
|
|
|
|
|
1994-09-19 09:50:07 +00:00
|
|
|
/* @END */
|
|
|
|
|
|
|
|
/* @T */
|
|
|
|
typedef long TrDate;
|
|
|
|
typedef long RecNoType;
|
|
|
|
typedef char *RecType;
|
|
|
|
typedef char FieldName[12] ;
|
|
|
|
typedef char TKey[MaxArray + 2];
|
|
|
|
typedef char AreaKey[AreaLen];
|
|
|
|
typedef char DataArea[BPageLen];
|
1998-03-05 13:54:51 +00:00
|
|
|
|
1994-09-19 09:50:07 +00:00
|
|
|
typedef struct {
|
|
|
|
int F;
|
|
|
|
FILE* Fd;
|
|
|
|
int IOR;
|
|
|
|
int LenRec;
|
|
|
|
int BaseFil;
|
|
|
|
unsigned LockMode;
|
|
|
|
RecNoType lpos;
|
|
|
|
PathSt name;
|
|
|
|
} SecDef ;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char SysName[42] __PACKED__ ;
|
|
|
|
RecNoType EOD __PACKED__ ;
|
|
|
|
RecNoType EOX __PACKED__ ;
|
|
|
|
UINT16 LenR __PACKED__ ;
|
|
|
|
RecNoType Flags __PACKED__ ;
|
|
|
|
char Des[42] __PACKED__ ;
|
|
|
|
char FCalc[32] __PACKED__ ;
|
|
|
|
char GenPrompt[32] __PACKED__ ;
|
|
|
|
} FileDes;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
FieldName Name __PACKED__ ;
|
|
|
|
byte TypeF __PACKED__;
|
|
|
|
byte Len __PACKED__ ;
|
|
|
|
byte Dec __PACKED__ ;
|
|
|
|
#ifdef __PACK_1__
|
|
|
|
byte junk __PACKED__ ;
|
|
|
|
#endif
|
|
|
|
UINT16 RecOff __PACKED__ ;
|
|
|
|
} RecFieldDes ;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
word DupKeys __ALIGNED__ ;
|
|
|
|
byte NkFields __ALIGNED__ ;
|
|
|
|
byte FieldSeq[MKFields] __PACKED__ ;
|
|
|
|
byte FromCh[MKFields] __PACKED__ ;
|
|
|
|
byte ToCh[MKFields] __PACKED__ ;
|
|
|
|
} KeyDes ;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
INT16 NFields __PACKED__ ;
|
|
|
|
RecFieldDes Fd[MaxFields] __PACKED__ ;
|
|
|
|
byte SortFd[MaxFields] __PACKED__ ;
|
|
|
|
INT16 NKeys __PACKED__ ;
|
|
|
|
KeyDes Ky[MaxKeys] __PACKED__ ;
|
|
|
|
} RecDes ;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
RecNoType RootBlock __PACKED__ ;
|
|
|
|
INT16 KeyLen __PACKED__ ;
|
|
|
|
bool DupKeys __PACKED__ ;
|
|
|
|
#ifdef __PACK_1__
|
1994-09-28 10:36:08 +00:00
|
|
|
byte junk;
|
1994-09-19 09:50:07 +00:00
|
|
|
#endif
|
|
|
|
INT16 NKNode __PACKED__ ;
|
|
|
|
INT16 MaxKNode __PACKED__ ;
|
|
|
|
INT16 MinKNode __PACKED__ ;
|
|
|
|
RecNoType PEOD __PACKED__ ;
|
|
|
|
RecNoType PEOX __PACKED__ ;
|
|
|
|
INT16 Flags[3] __PACKED__ ;
|
|
|
|
} PD ;
|
|
|
|
|
|
|
|
typedef PD PathsArray[MaxPD];
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
byte TPage __PACKED__ ;
|
|
|
|
#ifdef __PACK_1__
|
1994-09-28 10:36:08 +00:00
|
|
|
byte junk;
|
1994-09-19 09:50:07 +00:00
|
|
|
#endif
|
|
|
|
INT16 PathNumber __PACKED__ ;
|
|
|
|
INT16 Flags __PACKED__ ;
|
|
|
|
RecNoType Father __PACKED__ ;
|
|
|
|
RecNoType Prev __PACKED__ ;
|
|
|
|
RecNoType Next __PACKED__ ;
|
|
|
|
INT16 NKey __PACKED__ ;
|
|
|
|
} PHR ;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
RecNoType FFBlock __PACKED__ ;
|
|
|
|
RecNoType CABlock __PACKED__ ;
|
|
|
|
RecNoType NBEOX __PACKED__ ;
|
|
|
|
RecNoType NBEOD __PACKED__ ;
|
|
|
|
INT16 Filler[3] __PACKED__ ;
|
|
|
|
INT16 Flags[4] __PACKED__ ;
|
|
|
|
INT16 DPN __PACKED__ ;
|
|
|
|
} FHR ;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
FHR Header __PACKED__ ;
|
|
|
|
PathsArray Paths __PACKED__ ;
|
|
|
|
} CA ;
|
|
|
|
|
|
|
|
typedef union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
PHR PageHeader __PACKED__ ;
|
|
|
|
AreaKey AreaForKey __PACKED__ ;
|
|
|
|
} PA __PACKED__ ;
|
|
|
|
CA CtrlArea __PACKED__ ;
|
|
|
|
DataArea BuffIO __PACKED__ ;
|
|
|
|
} Page;
|
|
|
|
|
1998-03-05 13:54:51 +00:00
|
|
|
#pragma pack()
|
|
|
|
|
1994-09-19 09:50:07 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
SecDef Fil;
|
|
|
|
FHR FHead;
|
|
|
|
INT16 PN;
|
|
|
|
PathsArray Base;
|
|
|
|
TKey Key;
|
|
|
|
RecNoType Ind;
|
|
|
|
INT16 Pos;
|
|
|
|
RecNoType CurPag;
|
|
|
|
} FilCtrl ;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
1995-07-03 07:49:30 +00:00
|
|
|
int fhnd;
|
1994-09-19 09:50:07 +00:00
|
|
|
FileDes *d;
|
|
|
|
RecDes *r;
|
1995-07-03 07:49:30 +00:00
|
|
|
RecNoType RecNo;
|
1994-09-19 09:50:07 +00:00
|
|
|
INT16 ln;
|
1995-07-03 07:49:30 +00:00
|
|
|
INT16 ft;
|
|
|
|
int knum;
|
1994-09-19 09:50:07 +00:00
|
|
|
} isdef ;
|
|
|
|
|
|
|
|
|
|
|
|
typedef isdef* isfdptr;
|
|
|
|
|
|
|
|
|
|
|
|
struct s_prm {
|
|
|
|
int rc_len;
|
|
|
|
struct {
|
|
|
|
int f_pos;
|
|
|
|
int f_len;
|
|
|
|
char ad;
|
|
|
|
} s_fld [NOFLDS];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* @END */
|
1996-01-29 14:01:13 +00:00
|
|
|
#endif /* __EXTCTYPE_H */
|