/*	@(#)hslocal.h	1.8	10/06/90	13:00:39	*/

#ifndef HSLOCAL_INCL

#ifndef EXPORT
#ifdef VMS
#define EXPORT globaldef
#define IMPORT globalref
#else
#define EXPORT
#define IMPORT extern
#endif
#endif

#define STRAIGHT		

#define DONTCONVERT   0
#define SHORTINT     10
#define REGINT       11
#define LONGINT      12
#define INC_VP(vp,n)	((vp)=(void FAR *)(((char FAR *)(vp))+(n)))
#define GETLOGID(x,y)	((y)=((((x) >> 16) & 0xFFFF)))
#define GETSEQNO(x,y)	((y)=((x) & 0xFFFF))
#define MAKEHDL(x,y,z) 	((x)=(((((u32)(y)) << 16)) | (u32)(z)))

IMPORT HS_SESSIONID Logons;

extern PFH errhandler;
extern PFDH datahandler;


#include <sv_move.h>

/*
**	Local functions prototyped
*/

extern int CheckHistHandle(void *phdl);
extern char *putdvals(char *dest, HS_DA *hsda, u32 rowsize, short fldcnt, 
					  short startrow, short *rowspacked);
extern char *puttypes(char *dest, HS_DA *hsda);
extern char *putcolnames(char *dest, HS_DA *hsda);
extern char *getmsghdr(char *dptr);
extern char *gethsda(char *dptr, HS_DA **hsda);
extern int sendmail(HS_SESSIONID session, MBXMSG *mbxmsg);
extern int ferrhandler(short fcode, short rcode, void *handle);
extern void block_on_mailbox(HS_SESSIONID session);
extern MBXMSG *syncmail(HS_SESSIONID session, u32 msgid);
extern MBXMSG *syncmail_hsopen(HS_SESSIONID session, u32 msgid);
extern short getrdata(HS_STMTID stmtid, int rows);
extern short getfdata(HS_DA *hsda, char **dpptr, short rows, short start);
extern short get_rowsize(HS_DA *hsda, u32 *maxsize, u16 *maxrows);
extern short gettypes(HS_DA *hsda, u32 *size);
extern void canonicalize(void *dest, void *src, short numtype, short size);
extern void uncanonicalize(void *dest, void *src, short numtype, short size);
extern void	*hs_malloc_msgdata( size_t size );
extern void	hs_free_msgdata(void);
extern void *hs_malloc( size_t size );
extern void hs_free( void *ptr );
extern void hs_xlate_error(int fcode, char *errtext, short hserr, long srverr);

#define HSLOCAL_INCL
#endif
