#ifndef __EXTCDECL_H
#define __EXTCDECL_H

#ifndef __EXTCTYPE_H
#include <extctype.h>
#endif
#if XVT_OS == XVT_OS_SCOUNIX
#include "keye.h"
#else
#include "hlapi_c.h"
#endif
/* @(:) 2.3.01.178 */
#define MAXCKEY                                 5
#define MAXCLEN                                 10
#define MAXENTRYNAME    16
#define MAXTENTRY                               48
/* @(!) 2.3.01.temp */
#define MAXENTRYSIZE    4096
/* @(:) 2.3.01.temp */
#define MAXDISPCOLS                     4
#define CONFFILE                "conf.gen"
#if     XVT_OS == XVT_OS_SCOUNIX
#include "keye.h"
#define HLBLOCK         2
#else
#include "hlapi_c.h"
#define HLBLOCK         1
#define REFKEY          "CAMPOKEY"
#define VERKEY          "ìpÙˆ¬cê<"
#endif


/* @DES Funzioni C esterne. Sorgenti in /disk1/p.uno */

extern "C"  {

  /* @DPUB */
  extern SecDef fdir[2], rdir[2];
  extern int dirfl[2], recfl[2];
  extern short    formflag;
  extern int      SerNo;
  extern word     ModAd;
  extern word     _int_tab0[4];
  extern char     __ptprf[80];

  // Guy moved these outside extern
  extern isfdptr* openf;
  extern Str80    cprefix;

#ifdef __STDTYPES_CPP
#define extern
#endif

  extern short    isjournal;

#ifdef __STDTYPES_CPP
#undef extern
#endif

  /* @END */

  /* @FPUB */       
// definite in isam.cpp
  int hashfun(const char *);
  int findfld(const RecDes *, const char *);   
#if XVT_OS == XVT_OS_SCOUNIX
  Word Hl_Port(Word);
#endif
  TDitta *CGetDitta(char *);
  short CGetAut(int );
  char *CGetConf(int );
  word getser(void);
  void CVerify(SecDef *,char *);
  void COpen(SecDef *,char *, unsigned, unsigned, unsigned);
  void CCreate(SecDef *,char *,unsigned ,unsigned ,RecNoType);
  void CChsize(SecDef *,char *,unsigned ,unsigned ,RecNoType);
  void CClose(SecDef *);
  void CDelete(SecDef *,char *);
  void CRead(SecDef *, RecType, RecNoType, unsigned );
  void CLockRec(SecDef *, RecNoType, unsigned);
  void CWrite(SecDef *,RecType,RecNoType ,unsigned );
  int excllock(char *, short);
  int exclunlock(char *, short);
  void COpenDir(int, int);
  void CCloseDir(int);
  void COpenFile(int, FileDes *, int, int);
  void CCloseFile(int, FileDes *, int);
  void CGetFile(int,  FileDes *, int, int);
  void CPutFile(int,  FileDes *, int);
  void zerofdes(FileDes *);
  void COpenRecDir(int, int);
  void CCloseRecDir(int);
  void CGetRec(int, RecDes *, int);
  void CPutRec(int, RecDes *, int);
  void zerordes(RecDes *);
  word setrdes(RecDes *);
  char *prefname(void);
  char *CAddPref(char *);
  char  *CGetPref(void);
  void  CPutPref(char *);
  char  *CInsPref(char *, int);
  char  *CGetIdxName(char *);
  int init_sort(struct s_prm *);
  void sort(char *);
  char *sort_op(void);
  void sort_stats(void);

  /* @END */
};

#endif // __EXTCDECL_H
