home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
DIGUTIL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-30
|
4KB
|
111 lines
/*
digutil.h
% declarations for DIG utility functions.
5/16/88 by Ted.
OWL 1.2
Copyright (c) 1986, 1987, 1988 by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
3/10/89 ted Added dig_SubHsecs
2/14/90 ted Added dig_squeezecmap and pmhist_func & pmcswap_func macros.
3/10/90 ted Added pmnearcol_func macro for dig_squeezecmap.
3/28/90 jmd ansi-fied
5/08/90 jmd added underscores to func macros for vms compiler
7/32/90 ted added BJ's klex & btree stuff.
10/31/90 ted made dig_powof2 return unsigned long instead of long.
*/
/* -------------------------------------------------------------------------- */
/* DIGCURSB.C */
extern void DIGPRIV dig_getcursbox(win_type win, cursortype ctype, opbox *cursboxp);
/* DIGPOW2.C */
extern unsigned long DIGPRIV dig_powof2(byte power);
/* DIGSHSEC.C */
extern unsigned dig_SubHsecs(unsigned tstart, unsigned time);
/* DIGFLIP.C */
extern void dig_flipshort(unsigned short *usp);
extern byte DIGPRIV dig_testbyteorder(void);
/* DIGSCMAP.C */
extern void DIGPRIV dig_shiftcmap(ocolmap_type cmap, int nright);
/* DIGCURSL.C */
extern void DIGPRIV dig_getcurslines(cursortype ctype, opcoord nlines, opcoord *startp, opcoord *endp);
/* DIGSQCM.C */
#define pmhist_func(fname) void fname(pmap_type _pmap, unsigned short *_histtab);
typedef pmhist_func ((*pmhist_fptr));
#define pmcswap_func(fname) void fname(pmap_type _pmap, byte *_swaptab);
typedef pmcswap_func ((*pmcswap_fptr));
#define pmnearcol_func(fname) opixval fname(orgb_struct *_rgb, ocolmap_type _cmap);
typedef pmnearcol_func ((*pmnearcol_fptr));
extern void DIGPRIV dig_squeezecmap(pmap_type _pmap, ocolmap_type _cmap,
ocolmap_type _crange, pmhist_fptr _pmhist,
pmcswap_fptr _pmcswap, pmnearcol_fptr _nearest);
/* DIGPMCLI.C */
extern boolean DIGPRIV copypm_clip(ptd_struct *ptd, pmap_type pixmap, opbox *pmboxp, opbox *scrboxp, opcoord *pmxp, opcoord *pmyp);
/* DIGBTREE.C */
typedef enum _btreecode {
BTREE_OK = 0,
BTREE_DUP = 1,
BTREE_ERROR = 2
} btreecode;
typedef struct _btnode {
struct _btnode *lchild;
struct _btnode *rchild;
VOID *data;
} *btnode_type;
#define btree_nodecomp_func(fname) int fname(VOID *_data1, VOID *_data2)
typedef btree_nodecomp_func ((*btree_nodecomp_fptr));
#define btree_keycomp_func(fname) int fname(VOID *_node, byte *_key)
typedef btree_keycomp_func ((*btree_keycomp_fptr));
#define btree_freertn_func(fname) void fname(VOID *_data)
typedef btree_freertn_func ((*btree_freertn_fptr));
typedef struct btree {
btnode_type root; /* Root node */
btree_nodecomp_fptr nodecomp;
btree_keycomp_fptr keycomp;
btree_freertn_fptr freertn;
} *btree_type;
btree_type DIGPRIV btree_Open(btree_nodecomp_fptr nodecomp, btree_keycomp_fptr keycomp, btree_freertn_fptr freertn);
void DIGPRIV btree_Close(btree_type bt);
btreecode DIGPRIV btree_Insert(btree_type bt, VOID *data);
VOID * DIGPRIV btree_Get(btree_type bt, VOID *key);
/* DIGKLEX.C */
typedef VOID *klex_type;
typedef int scancode_type;
klex_type DIGPRIV klex_Open(scancode_type *def_map);
void DIGPRIV klex_Close(klex_type kl);
int DIGPRIV klex_AddCode(klex_type kl, byte *seq, int seqlen, scancode_type code);
void DIGPRIV klex_InByte(klex_type kl, byte b);
void DIGPRIV klex_TimeOut(klex_type kl);
boolean DIGPRIV klex_ShouldTimeOut(klex_type kl);
scancode_type DIGPRIV klex_ReadScanCode(klex_type kl);
boolean DIGPRIV klex_ScanCodeReady(klex_type kl);
/* -------------------------------------------------------------------------- */