home *** CD-ROM | disk | FTP | other *** search
- /* wfc_defs.h -- definitions for Windows for C
-
- ************* Copyright 1985 by Vermont Creative Software **************
-
- DATE: April 2, 1987
- VERSION: v4.12
-
- */
-
- typedef int (*PFI)(); /*PFI - pointer to a function */
- /* returning an integer */
-
- /*----------------------------------------------------------------------------*/
- /* If not already defined by wfc_comp.h, then define NULLP, NULLFP and NULL */
- /*----------------------------------------------------------------------------*/
- #ifndef NULLP
- #define NULLP (char *) 0 /*NULL pointer to data */
- #endif
-
- #ifndef NULLFP
- #define NULLFP (int(*)()) 0 /*NULL pointer to function returning */
- #endif
-
- #define TAB '\t' /*C definition of ASCII tab number */
- #define NEWLINE '\n' /*C definition of ASCII newline */
- #define BACKSPACE '\b' /*C definition of ASCII backspace */
-
- #define VPSTMAXLEN 133 /*buffer size for use with v_printf() */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use with mv_rws() */
- /*----------------------------------------------------------------------------*/
- #define UP 6 /*moves rows up (mv_rws) */
- #define DOWN 7 /*moves rows down (mv_rws) */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for mf_scrl() */
- /*----------------------------------------------------------------------------*/
- #define ALL_ROWS -1 /*scroll all rows in file */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for mf_rwins() */
- /*----------------------------------------------------------------------------*/
- #define LAST_ROW -1 /*insert line at last row in file */
-
- /*----------------------------------------------------------------------------*/
- /* Bit switch definitions for use with v_st(), v_st_rw(), v_plst(), etc. */
- /*----------------------------------------------------------------------------*/
- #define NO_WRAP 0 /*No wrap, cs adv, clear in v_st_rw */
- #define WRAP 1 /*Specifies word-wrap in v_st_rw, etc */
- #define NO_CLEAR 2 /*disable auto clear to end row */
- #define NO_CS_ADV 4 /*disable cs advance on v_st_rw */
- #define PL_CSR 8 /*enable auto place of csr at cs */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use with v_mov(), v_mova() */
- /*----------------------------------------------------------------------------*/
- #define CH 0 /*size definition for v_mov, etc */
- #define ENDROW 1 /*size definition for v_mov, etc */
- #define ROW 2 /* ditto */
- #define ENDWIND 3 /* ditto */
- #define WIND 4 /* ditto */
- #define ENDCOL 5 /* ditto */
- #define COL 6 /* ditto */
-
- #define OUT 0 /*type definition for v_mov, etc */
- #define IN 1 /* ditto */
-
- /*----------------------------------------------------------------------------*/
- /* The following definitions are for possible cursor shapes */
- /*----------------------------------------------------------------------------*/
- #define LINE 0 /* a line at the bottom */
- #define BLOCK 1 /* a full block */
- #define BOT_BLK 2 /* a block in the bottom half of the */
- /* character box */
- #define TOP_BLK 3 /* a block in the top half of the */
- /* character box */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for border pointers */
- /*----------------------------------------------------------------------------*/
- #define BDR_0P &bdr_0 /*No border */
- #define BDR_LNP &bdr_ln /*Single line border */
- #define BDR_DLNP &bdr_dln /*Double line border */
- #define BDR_REVP &bdr_rev /*Reverse border */
- #define BDR_DOTP &bdr_dot /*Dot border */
- #define BDR_STARP &bdr_star /*Star border */
-
- /*----------------------------------------------------------------------------*/
- /* Different move types for internal low-level move function */
- /*----------------------------------------------------------------------------*/
- #define VM_MOVE 0 /*video to user-memory type of move */
- #define MV_MOVE 1 /*user-memory to video type of move */
- #define VV_MOVE 2 /*video to video type move */
- #define MM_MOVE 3 /*user-memory to user-memory type move*/
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use with dim_wn() */
- /*----------------------------------------------------------------------------*/
- #define INSIDE 1 /* def for wn.setsw, copy_wn, dim_wn */
- #define FULL 0 /* ditto */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use with ki_buf() */
- /*----------------------------------------------------------------------------*/
- #define SAVE 1 /*push key read back on input buffer */
- #define TOSS 0 /*don't push key back */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use with copy_wc() */
- /*----------------------------------------------------------------------------*/
- #define FREAD "r" /*fopen() mode for read open */
- #define FWRITE "w" /*fopen() mode for write open */
- #define FAPPEND "a" /*fopen() mode for append open */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use with boolean parameters */
- /*----------------------------------------------------------------------------*/
- #define YES 1 /*for use with boolean parameters */
- #define NO 0 /* ditto */
- #define ON 1 /* ditto */
- #define OFF 0 /* ditto */
- #define TRUE 1 /* ditto */
- #define FALSE 0 /* ditto */
-
- /*----------------------------------------------------------------------------*/
- /* Centers a window on the screen - for use with defs_wn() */
- /*----------------------------------------------------------------------------*/
- #define CENTER_WN -1 /*centers the window on the screen */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use with v_plst() */
- /*----------------------------------------------------------------------------*/
- #define LEFT_TEXT 0 /*left justfies text in window */
- #define CENTER_TEXT -1 /*centers text in window */
- #define RIGHT_TEXT -2 /*right justifies text in window */
-
- /*----------------------------------------------------------------------------*/
- /* Definitions for use in specifying position of window name in border */
- /*----------------------------------------------------------------------------*/
- #define TOPLEFT 1
- #define TOPCENTER 2
- #define TOPRIGHT 3
- #define BOTTOMLEFT 4
- #define BOTTOMCENTER 5
- #define BOTTOMRIGHT 6
-
- /*----------------------------------------------------------------------------*/
- /* Macro definitions */
- /*----------------------------------------------------------------------------*/
- #ifndef min
- #define min(a,b) ((a) <=(b) ? (a): (b)) /*minimum value function */
- #endif
- #ifndef max
- #define max(a,b) ((a) >=(b) ? (a): (b)) /*maximum value function */
- #endif
-
- #define col_qty(wnp) ((wnp)->ce - (wnp)->cb + 1) /*number of col in window */
- #define row_qty(wnp) ((wnp)->re - (wnp)->rb + 1) /*number of rows in window */
-
- #define hi_byte(a) (((a) >> 8) & 0x00ff) /*returns high byte of word */
- #define lo_byte(a) ((a) & 0x00ff) /*returns low byte of word */
-
- #define c_att(fground,bground) ((bground << 4) + fground)
-
- #define isset_wn(wnp) ((wnp)->setsw)
- #define smf_filespec(p, mfp) ((mfp)->fn = p)
- #define wnerrmsg(a) (_wnemsg[(a)])
-
- /*----------------------------------------------------------------------------*/
- /* Macros for setting environment variables */
- /*----------------------------------------------------------------------------*/
- #define se_errorfp(p) (_errfp = (p))
- #define se_keyloop(p) (_wfckifp = (p))
- #define se_mfmsg(a) (tbf_msg = (a))
- #define se_mncharselect(a) (_mnuchar = (a))
-
- /*----------------------------------------------------------------------------*/
- /* Macros for setting members of the WINDOW structure */
- /*----------------------------------------------------------------------------*/
- #define sw_att(attrib, wnp) ((wnp)->att = (attrib))
- #define sw_bdratt(att, wnp) ((wnp)->bdratt = (att))
- #define sw_border(borderp, wnp) ((wnp)->bdrp = (borderp))
- #define sw_cleor(a, wnp) ((wnp)->wrap = ((a) == ON ? (wnp)->wrap\
- &~NO_CLEAR : (wnp)->wrap | NO_CLEAR))
- #define sw_csadv(a, wnp) ((wnp)->wrap = ((a) == ON ? (wnp)->wrap\
- & ~NO_CS_ADV : (wnp)->wrap | NO_CS_ADV))
- #define sw_latt(a, wnp) ((wnp)->larray = (a))
- #define sw_margin(l, r, wnp) ((wnp)->l_mg = (l), (wnp)->r_mg = (r))
- #define sw_mf(a, wnp) ((wnp)->frp = (a))
- #define sw_name(name, wnp) ((wnp)->wname = (name))
- #define sw_namelocation(loc, wnp) ((wnp)->wnameloc = (loc))
- #define sw_plcsr(a, wnp) ((wnp)->wrap = ((a) == ON ? (wnp)->wrap\
- | PL_CSR : (wnp)->wrap & ~PL_CSR))
- #define sw_popup(a, wnp) ((wnp)->popup = (a))
- #define sw_scroll(a, wnp) ((wnp)->scr_q = (a))
- #define sw_wwrap(a, wnp) ((wnp)->wrap = ((a) == ON ? (wnp)->wrap\
- | WRAP : (wnp)->wrap & ~WRAP))
-
- /*----------------------------------------------------------------------------*/
- /* String images of maximum signed integer and signed long integer */
- /*----------------------------------------------------------------------------*/
- #define MAXLONGSTR "2147483647" /* (2**31) - 1 */
- #define MAXINTSTR "32767" /* (2**16) - 1 */
- #define MAXEXP 307 /* Maximum floating point exponent */
-
- /*----------------------------------------------------------------------------*/
- /* used for error handling with trace back buffer */
- /*----------------------------------------------------------------------------*/
- #define TRACE_BUF 256 /* size of trace back buffer */
- #define WNLOGSIZE 20 /* size of call log */
- #define INIT_MACRO(p) if(_wndebug == ON) (*_finitfp)(p)
- #define EXIT_MACRO(p) if(_wndebug == ON) (*_fexitfp)(p); if(_errfp != NULLFP && _wn_err != 0) (*_errfp)(p)
- #define INIT_MODULE(p) _modinit(p)
- #define EXIT_MODULE(p) _modexit(p)