HTBasic Help
×
Menu
Index

Windows C Include File

 
Windows C Include File
 
/* CSUBW.H — HTBasic Windows CSUB C Language Include File, 6.0 */
/* (c) Copyright 1989-2021 TransEra Corp. All Rights Reserved */
 
#define MX_STLEN 32767  /* maximum string length */
#define MX_SUBS  6      /* maximum number of subscripts */
 
typedef unsigned char U_CHAR;
typedef unsigned short int U_SHORT;
typedef unsigned long U_LONG;
 
typedef short int T_SUBS;/* subscript value */
 
typedef struct subs     /* SUBSCRIPT BOUNDS DATA */
{
T_SUBS  base;         /* subscript lower bound value */
T_SUBS  size;         /* number of elements */
} SUBS;
 
typedef struct dim      /* DIMENSION TABLE ENTRY */
{
U_LONG  elen;         /* Element LENgth (string max len) (bytes) */
U_LONG  tae;          /* Total Allocated Elements (upper byte nod) */
U_LONG  cae;          /* Current Allocated Elements */
SUBS sbs[MX_SUBS];    /* Subscript Bounds */
}   DIM;
 
/* The upper byte of dim.tae is used to store the number of dimensions */
 
#define NOD(d) ( ((d)->tae > 24) &0xFF) )  /* number of dimensions */
#define TAE(d) ( (d)->tae & 0x00FFFFFF )  /* total array elements */
 
typedef short int T_INT;        /* BASIC INTEGER value */
typedef double    T_FLT;        /* BASIC REAL value */
 
typedef struct t_cpx            /* BASIC COMPLEX value */
{
T_FLT r;                      /* real part */
T_FLT i;                      /*imaginary part */
}   T_CPX;
typedef struct t_str            /* BASIC STRING Data */
{
T_SUBS clen;                  /* current string length */
U_CHAR str[MX_STLEN];         /* string data */
}   T_STR;
 
typedef DIM    *dimptr;         /* pointer to Dimension Structure */
typedef T_INT  *intptr;         /* pointer to INTEGER Value */
typedef T_FLT  *realptr;        /* pointer to REAL Value */
typedef T_CPX  *cpxptr;         /* pointer to COMPLEX Value */
typedef T_STR  *strptr;         /* pointer to String Structure */
 
_declspec(dllexport) void *(*_fnd_var)(); /* COM memory finder */
#define com_var(n,v,p)  (*_fnd_var)( (char *)(n), (int)(v), (int)(p) )
 
/* CSUB Jump Table Definition */
_declspec(dllexport) int (** _cjmptbl)():  /* ptr to csub jump table */
 
#define CSB_VER ((long)_csbjtbl[ 0])
 
#define kbdcrt_check  if( CSB_VER < 16 ) return( 2009 )
 
/* Keyboard and Display Routines */
 
#define kbdcrt_clear_screen      (*_csbjtbl[ 2])
#define kbdcrt_controlcrt(r,v)   (*_csbjtbl[ 3])((int)(r),(int)(v))
#define kbdcrt_controlkbd(r,v)   (*_csbjtbl[ 4])((int)(r),(int)(v))
#define kbdcrt_crtreadstr(b,m,l) (*_csbjtbl[ 5]) \
                                ((char*)(b),(int)(m),(int*)(l))
#define kbdcrt_crtscroll(f,l,d)  (*_csbjtbl[ 6]) \
                                ((int)(f),(int)(l),(int)(d))
#define kbdcrt_cursor(c,l,t)     (*_csbjtbl[ 7]) \
                                ((int)(c),(int)(l),(int)(t))
#define kbdcrt_dispstr(c,l,b,s,a) (*_csbjtbl[ 8]) \
                                ((int)(c),(int)(l),(char *)(b), \
                                 (int)(s),(int)(a))
#define kbdcrt_printstr(b,l)     (*_csbjtbl[ 9]) \
                                ((char*)(b),(int)(l))
#define kbdcrt_readkbd(b,m,l)    (*_csbjtbl[10]) \
                                ((char*)(b),(int)(m),(int*)(l))
#define kbdcrt_scrolldn          (*_csbjtbl[11])
#define kbdcrt_scrollup          (*_csbjtbl[12])
#define kbdcrt_statuscrt(r,v)    (*_csbjtbl[13])((int)(r),(int*)(v))
#define kbdcrt_statuskbd(r,v)    (*_csbjtbl[14])((int)(r),(int*)(v))
#define kbdcrt_systemd(a,b,m,l)  (*_csbjtbl[15]) \
                               ((char*)(a),(int)(b),(int)(m),(int*)(l))
 
/* end of CSUBW.H */