home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 220_01 / boss_sup.lzh / WINDOWS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-30  |  22.0 KB  |  659 lines

  1. /*
  2. ** WINDOW BOSS - Simple but Elegant Window Functions 
  3. **
  4. ** Lattice, Computer Innovations, Microsoft, Datalight, Aztec, 
  5. ** Watcom, Mix Power C, Zortech
  6. **
  7. ** Copyright (c) 1984, 1985, 1986 - Philip A. Mongelluzzo
  8. ** All rights reserved.
  9. **
  10. ** The complex web of compiler defines and feature tests follows.
  11. */
  12.  
  13. /*
  14. ** Computer Innovations comes first....
  15. */
  16.  
  17. #ifdef C86
  18. #define BORLAND 0
  19. #define MSCV3   0
  20. #define MSCV4   0
  21. #define MSCV6   0
  22. #define MSC     0
  23. #define MSC3    0
  24. #define MSC4    0
  25. #define DLC     0
  26. #define CI86    1
  27. #define LC2     0
  28. #define LC3     0
  29. #define LC6     0
  30. #define __ZTC__ 0
  31. #define __TSC__ 0
  32. #define MIXPC   0
  33. #define AZTEC   0
  34. #define WATCOM  0
  35. #ifdef _C86_BIG
  36. #define LPTR    1
  37. #define SPTR    0
  38. #else
  39. #define LPTR    0
  40. #define SPTR    1
  41. #endif
  42. #define LATTICE 0
  43. #define void int                        /* define void as int */
  44. struct WORDREGS {                       /* register layout is */
  45.         unsigned int ax;                /* different from the rest !! */
  46.         unsigned int bx;
  47.         unsigned int cx;
  48.         unsigned int dx;
  49.         unsigned int si;
  50.         unsigned int di;
  51.         unsigned int ds;                /* <= NB */
  52.         unsigned int es;                /* <= NB */
  53.         unsigned int flags;
  54.         };
  55. struct BYTEREGS {
  56.         unsigned char al, ah;
  57.         unsigned char bl, bh;
  58.         unsigned char cl, ch;
  59.         unsigned char dl, dh;
  60.         };
  61. union REGS {
  62.         struct WORDREGS x;
  63.         struct BYTEREGS h;
  64.         };
  65. struct SREGS {
  66.         unsigned int cs;
  67.         unsigned int ss;
  68.         unsigned int ds;
  69.         unsigned int es;
  70.         };
  71. extern unsigned wns_mtype();            /* make everyone happy */
  72. #endif                                  /* end C86 Stuff */
  73.  
  74.  
  75. #if WATCOM
  76. #pragma aux v_kstat "_*" parm caller []                           \
  77.                          value struct float struct routine [ax]   \
  78.                          modify [ax bx cx dx es]; 
  79.  
  80. #pragma aux xferdata "_*" parm caller []                           \
  81.                          value struct float struct routine [ax]   \
  82.                          modify [ax bx cx dx es]; 
  83.  
  84. #pragma aux v_border "_*" parm caller []                           \
  85.                          value struct float struct routine [ax]   \
  86.                          modify [ax bx cx dx es]; 
  87.  
  88. #pragma aux _vidblt "_*" parm caller []                           \
  89.                          value struct float struct routine [ax]   \
  90.                          modify [ax bx cx dx es]; 
  91. #endif
  92.  
  93. /*
  94. ** TopSpeed C
  95. */
  96.  
  97. #if __TSC__
  98. #define MSCV4   1
  99. #ifdef M_I86XM                          /* (XLARGE) large code, large data */
  100. #define SPTR    0
  101. #define LPTR    1
  102. #endif
  103. #ifdef M_I86MTM                         /* (MTHREAD) large code, large data */
  104. #define SPTR    0
  105. #define LPTR    1
  106. #endif
  107. #endif
  108.  
  109. /*
  110. ** Microsoft 4.0, 5.X, 6.X, QuickC, PowerC
  111. */
  112.  
  113.  
  114. #if MSCV6
  115. #undef NULL                             /* NULL must be redefined */
  116. #define NULL (int)0                     /* to avoid useless errors MSC 6.XX */
  117. #define MSCV4   1
  118. #endif
  119.  
  120. #if MSCV4
  121. #define MSC     1
  122. #define MSCV3   0
  123. #define MSC4    1
  124. #define DLC     0
  125. #define CI86    0
  126. #define LC2     0
  127. #define LC3     0
  128. #define BORLAND 0
  129. #ifndef MIXPC
  130. #define MIXPC   0
  131. #endif
  132. #define AZTEC   0
  133. #ifdef M_I86SM                          /* small code, small data */
  134. #define SPTR    1
  135. #define LPTR    0
  136. #endif
  137. #ifdef M_I86LM                          /* large code, large data */
  138. #define SPTR    0
  139. #define LPTR    1
  140. #endif
  141. #ifdef M_I86CM                          /* small code, large data */
  142. #define SPTR    0
  143. #define LPTR    1
  144. #endif
  145. #ifdef M_I86MM                          /* large code, small data */
  146. #define SPTR    1
  147. #define LPTR    0
  148. #endif
  149. #define LATTICE 1
  150. #endif
  151.  
  152. /*
  153. ** Microsoft 3.00
  154. */
  155.  
  156. #if MSCV3
  157. #define MSC     1
  158. #define MSC4    0
  159. #define DLC     0
  160. #define CI86    0
  161. #define LC2     0
  162. #define LC3     0
  163. #define BORLAND 0
  164. #define MIXPC   0
  165. #ifndef AZTEC
  166. #define AZTEC   0
  167. #endif
  168. #ifdef M_I86SM                          /* small code, small data */
  169. #define SPTR    1
  170. #define LPTR    0
  171. #endif
  172. #ifdef M_I86LM                          /* large code, large data */
  173. #define SPTR    0
  174. #define LPTR    1
  175. #endif
  176. #ifdef M_I86CM                          /* small code, large data */
  177. #define SPTR    0
  178. #define LPTR    1
  179. #endif
  180. #ifdef M_I86MM                          /* large code, small data */
  181. #define SPTR    1
  182. #define LPTR    0
  183. #endif
  184. #define LATTICE 1
  185. #endif
  186.  
  187. /*
  188. ** Lattice 6.XX
  189. */
  190.  
  191. #if LC6                                 /* Lattice 6 looks like BORLAND! */
  192. #define BORLAND 1                       /* from a code standpoint */
  193. #undef NULL                             /* NULL must be redefined */
  194. #define NULL (int)0                     /* to avoid useless errors */
  195. #endif                                  /* any changes here must also */
  196.                                         /* be made in "windows.c" */
  197.  
  198. /*
  199. ** Zortech
  200. */
  201.  
  202. #if __ZTC__                             /* ZORTECH looks like BORLAND! */
  203. #define BORLAND 1                       /* from a code standpoint */
  204. #undef NULL                             /* NULL must be undefined */
  205. #endif                                  /* any changes here must also */
  206.                                         /* be made in "windows.c" */
  207. /*
  208. ** BORLAND
  209. */
  210.  
  211. #ifdef __TURBOC__
  212. #ifndef BORLAND
  213. #define BORLAND 1
  214. #endif
  215. #endif
  216.  
  217. #if BORLAND
  218. #define MSC     1
  219. #define MSC4    1
  220. #define DLC     0
  221. #define CI86    0
  222. #define LC2     0
  223. #define LC3     0
  224. #define MIXPC   0
  225. #define AZTEC   0
  226. #ifdef __SMALL__                        /* small code, small data */
  227. #define SPTR    1
  228. #define LPTR    0
  229. #endif
  230. #ifdef __LARGE__                        /* large code, large data */
  231. #define SPTR    0
  232. #define LPTR    1
  233. #endif
  234. #ifdef __COMPACT__                      /* small code, large data */
  235. #define SPTR    0
  236. #define LPTR    1
  237. #endif
  238. #ifdef __MEDIUM__                       /* large code, small data */
  239. #define SPTR    1
  240. #define LPTR    0
  241. #endif
  242. #ifdef __HUGE__                         /* large code, large data */
  243. #define SPTR    0
  244. #define LPTR    1
  245. #endif
  246. #define LATTICE 1
  247. #endif
  248.  
  249. #define TRUE    1                       /* truth */
  250. #define FALSE   0                       /* lies */
  251. #define The_BOSS TRUE                   /* convienent equate */
  252.  
  253. #include "stdio.h"                      /* standard header */
  254. #if CI86
  255. char *malloc(), *calloc();              /* for the OLD TIMER */
  256. #else
  257. #include "stdlib.h"                     /* For the rest */
  258. #endif
  259. #if LC6
  260. #include "string.h"                     /* Now for Lattice 6.XX */
  261. #endif
  262.  
  263. #if BORLAND | MSC | DLC | LC2 | LC3 | MIXPC | WATCOM | CI86
  264. #if AZTEC
  265. #else
  266. #include "dos.h"                        /* Lattice stuff */
  267. #endif
  268. #endif
  269. #include "ctype.h"                      /* character conversion stuff */
  270. #if MSC4
  271. #include "stdarg.h"                     /* variable arg list marcos */
  272. #include "string.h"                     /* added 12/26/90 for Topspeed */
  273. #endif
  274.  
  275. #if AZTEC                               /* AZTEC DOS.H */
  276.  
  277. struct WORDREGS {
  278.     unsigned int ax;
  279.     unsigned int bx;
  280.     unsigned int cx;
  281.     unsigned int dx;
  282.     unsigned int si;
  283.     unsigned int di;
  284.     unsigned int cflag;
  285.     };
  286.  
  287. struct BYTEREGS {
  288.     unsigned char al, ah;
  289.     unsigned char bl, bh;
  290.     unsigned char cl, ch;
  291.     unsigned char dl, dh;
  292.     };
  293.  
  294. union REGS {
  295.     struct WORDREGS x;
  296.     struct BYTEREGS h;
  297.     };
  298.  
  299. struct SREGS {
  300.     unsigned int cs;
  301.     unsigned int ss;
  302.     unsigned int ds;
  303.     unsigned int es;
  304.     };
  305.  
  306. #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
  307. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  308.  
  309. struct RS {
  310.   int ax, bx, cx, dx, si, di, ds, es;
  311. };
  312. #endif                                  /* End AZTEC DOS.H */
  313.  
  314. #define SAVE    TRUE                    /* similar truth */
  315. #define RESTORE FALSE                   /* fibs */
  316. #define PAINT   TRUE                    /* screen update modes */
  317. #define FLASH   FALSE                   /* ditto */
  318. #define REPLACE 1                       /* for flicker free */
  319. #define ERASE   0                       /* scroll w_sapd & w_sapu */
  320. #define FAST    0x01                    /* fast retrace */
  321. #define SLOW    0x08                    /* slow retrace */
  322.  
  323. #define NULPTR  (char *) 0              /* null pointer */
  324. #define NUL     '\0'                    /* NUL char */
  325. #define NVAL    0                       /* null value - INTEGER */
  326. #define ECHO    0x8000                  /* echo disable bit */
  327.  
  328. #define BIOS    0x01                    /* BIOS Scrolling */
  329. #define DMAS    0x02                    /* The BOSS's DMA Scrolling */
  330.  
  331. #define MO_LEFT   0                     /* Mouse left button */
  332. #define MO_RIGHT  1                     /* Mouse right button */
  333. #define MO_HDW    1                     /* Mouse hardware */
  334. #define MO_SFT    0                     /* Mouse software */
  335.  
  336. #define WNTOPR  1                       /* top rigth */
  337. #define WNTOPL  2                       /* top left */
  338. #define WNTOPC  3                       /* top center */
  339. #define WNBOTR  4                       /* bottom right */
  340. #define WNBOTL  5                       /* bottom left */
  341. #define WNBOTC  6                       /* bottom center */
  342.  
  343. /*
  344. ** The following 2 equates are needed by Lattice Ver 2.XX (which is
  345. ** no longer "officially" supported.  Lattice Ver 2.XX users that need
  346. ** to work with larger Physical screens must change these constants here
  347. ** and in "windows.c". Other users can use the wns_ssiz() function.  Refer
  348. ** to wn_sup.c for usage.
  349. */
  350.  
  351. #define WN_MXROWS 25                    /* MAX PHYSICAL SCREEN */
  352. #define WN_MXCOLS 80                    /* MAX PHYSICAL SCREEN */
  353. #define MAXIMAGES 10                    /* MAX # of PUSH/POP IMAGES */      
  354.  
  355. #define BCUL  wns_bchars[0]             /* some shorthand for later */
  356. #define BCUR  wns_bchars[1]
  357. #define BCTB  wns_bchars[2]
  358. #define BCSD  wns_bchars[3]
  359. #define BCLL  wns_bchars[4]
  360. #define BCLR  wns_bchars[5]
  361.  
  362. /*
  363. ** HELP System Stuff
  364. */
  365.  
  366. #define HLPMAXKY 255                    /* ISAM file length (# of keys) */
  367. #define HLPKEYLN 25                     /* Maximum KEY length */
  368.  
  369. /*
  370. ** Misc Stuff
  371. */
  372.  
  373. #define WMR   wn->bsize                 /* shorthand */
  374.  
  375. typedef struct wcb                      /* Window control block */
  376. {
  377. int ulx,                                /* upper left corner x coordinate */
  378.     uly,                                /* upper left corner y coordinate */
  379.     xsize,                              /* width of window - INSIDE dimension */
  380.     ysize,                              /* height of window -INSIDE dimension */
  381.     ccx,                                /* virtual cursor offset in window */
  382.     ccy,
  383.     style,                              /* attribute to be used in window */
  384.     bstyle,                             /* border attribute */
  385.     bsize;                              /* total border size 0 or 2 only */
  386. char *scrnsave;                         /* pointer to screen save buffer */
  387. int page,                               /* current video page being used */
  388.     oldx,                               /* cursor position when window was */
  389.     oldy,                               /* opened (used for screen restore) */
  390.     wrpflg,                             /* wrap flag */
  391.     synflg;                             /* cursor sync flag */
  392. char *handle;                           /* my own id */
  393.     char *prevptr;                      /* linked list - previous */
  394.     char *nextptr;                      /* linked list - next */
  395.     unsigned tmpseg;                    /* for activate */
  396.     unsigned tmpoff;                    /* ditto */
  397.     int  smeth;                         /* scroll method to use */
  398.     int  shadow;                        /* shadow flag */
  399. char *rshwin;                           /* right shadow WINDOWPTR */
  400. char *bshwin;                           /* bottom shadow WINDOWPTR */
  401. } WINDOW, *WINDOWPTR;
  402.  
  403. typedef struct mcb                      /* Mouse control block */
  404. {
  405. int exists,                             /* TRUE if MOUSE exists */
  406.     nbuts,                              /* number of buttons */
  407.     bstat,                              /* button status */
  408.     nclik,                              /* number of clicks */
  409.     col,                                /* position - column */
  410.     row,                                /* position - row */
  411.     hmove,                              /* net horizontal movement */
  412.     vmove;                              /* net vertical movement */
  413.     char *handle;                       /* my own id */
  414. } MOUSE, *MOUSEPTR;         
  415.  
  416. union wi_args {                         /* variable arg type union */
  417.   int vi;                               /* (int) */
  418.   int *vip;                             /* (int *) */ 
  419.   unsigned int vui;                     /* (unsigned int) */
  420.   unsigned int *vuip;                   /* (unsigned int *) */
  421.   char vc;                              /* (char) */
  422.   char *vcp;                            /* (char *) */
  423.   long vl;                              /* (long) */
  424.   long *vlp;                            /* (long *) */
  425.   unsigned long vul;                    /* (unsigned long) */
  426.   unsigned long *vulp;                  /* (unsigned long *) */
  427.   float vf;                             /* (float) */
  428.   float *vfp;                           /* (float *) */
  429.   double vd;                            /* (double) */
  430.   double *vdp;                          /* (double *) */
  431.   unsigned char *vuc;                   /* (unsiged char) */
  432.   unsigned char *vucp;                  /* (unsigned char *) */
  433. } ;
  434.  
  435. typedef struct wi_scb {                 /* screen control block */
  436.   char *pself;                          /* pointer to myself */
  437.   int fcode;                            /* input funtion code */
  438.   WINDOWPTR wn;                         /* the window */
  439.   int row;                              /* window (wn) location - row */
  440.   int col;                              /* window (wn) location - col */
  441.   char *prmpt;                          /* prompt string for field */
  442.   unsigned int atrib;                   /* input field attribute */
  443.   char fill;                            /* input field fill character */
  444.   union wi_args v1;                     /* whatever */
  445.   union wi_args v2;                     /* whatever */
  446.   union wi_args v3;                     /* whatever */
  447.   union wi_args v4;                     /* whatever */
  448.   union wi_args v5;                     /* whatever */
  449.   union wi_args v6;                     /* whatever */
  450.   union wi_args v7;                     /* whatever */
  451.   union wi_args v8;                     /* whatever */
  452. } WIFLD, *WIFLDPTR, **WIFORM;
  453.  
  454.   struct mitem {                        /* POPUP menu item template */
  455.     int r;                              /* row */
  456.     int c;                              /* col */
  457.     char *t;                            /* text */
  458.     int rv;                             /* return value */
  459.   };
  460.  
  461.   struct pmenu {                        /* POPUP menu structure */
  462.     WINDOWPTR wpsave;                   /* place to hold window id */
  463.     int winopn;                         /* leave window open flag */
  464.     int lndx;                           /* last index */
  465.     int fm;                             /* first menu item index */
  466.     int lm;                             /* last menu item index */
  467.     struct mitem scrn[WN_MXROWS*4];     /* a bunch of menu items */
  468.   };                                    /* NOTE RELATIVE LIMIT */
  469.  
  470.  
  471. #if MSCV3 | MSCV4 | BORLAND | DLC | LC3 /* allow for LINT_ARGS */
  472. #ifndef GENFNS
  473. #include "windows.fns"                  /* enforce type checking */
  474. #endif
  475. #else                                   /* and almost lint args */
  476. struct wcb *wn_open();
  477. struct wcb *wn_move();
  478. struct wcb *wn_save();
  479. struct mcb *mo_reset();
  480. char *wn_gets();
  481. char *wn_sleftj();
  482. char *wn_srightj();
  483. char *wn_scenter();
  484. char *wn_sdelspc();
  485. struct wcb *wn_save();
  486. struct wi_scb * *wn_frmopn();
  487. unsigned int wns_mtype();
  488. #endif
  489.  
  490. #define BLACK   0x00                    /* foreground */
  491. #define RED     0x04                    /* background */
  492. #define GREEN   0x02                    /* colors */
  493. #define YELLOW  0x06                    /* bg << 4 | fg */
  494. #define BLUE    0x01
  495. #define MAGENTA 0x05
  496. #define CYAN    0x03
  497. #define WHITE   0x07
  498. #define BLINK   0x80
  499. #define BOLD    0x08
  500. #define NDISPB  0x00                    /* non display black */
  501. #define NDISPW  0x77                    /* non display white */
  502. #define RVIDEO  0x70                    /* reverse video */
  503. #define UNLINE  0x01                    /* under line (BLUE) */
  504.  
  505. #define NVIDEO  0x07                    /* normal video */
  506. #define NORMAL  0x03                    /* cyan is normal for me */
  507.  
  508. /*
  509. ** Display Mode Atributes
  510. */
  511.  
  512. #define B4025  0                        /* black & white 40 x 25 */
  513. #define C4025  1                        /* color 40 x 25 */
  514. #define B8025  2                        /* black & white 80 x 25 */
  515. #define C8025  3                        /* color 80 x 25 */
  516. #define C320   4                        /* color graphics 320 x 200 */
  517. #define B320   5                        /* black & white graphics */
  518. #define HIRES  6                        /* B&W hi res 640 * 200 */
  519. #define MONO   7                        /* monocrome 80 x 25 */
  520.  
  521. /*
  522. ** Macro to set attribute byte
  523. */
  524.  
  525. #define v_setatr(bg,fg,blink,bold) ((blink|(bg<<4))|(fg|bold))
  526. #define v_setrev(atrib) ((atrib&0x88) | ((atrib>>4)&0x07) | ((atrib<<4)&0x70) )
  527.  
  528. /*
  529. ** Key Scan Scodes & Window Input Stuff 
  530. */
  531.  
  532. #define LARROW          0x4b00          /* left arrow */
  533. #define RARROW          0x4d00          /* right arrow */
  534. #define DARROW          0x5000          /* down arrow */
  535. #define UARROW          0x4800          /* up arrow */
  536. #define HOME            0x4700          /* home key */
  537. #define END             0x4f00          /* end key */
  538. #define INS             0x5200          /* insert key */
  539. #define DEL             0x5300          /* delete key */        
  540. #define PGUP            0x4900          /* pgup */  
  541. #define PGDN            0x5100          /* pgdn */
  542. #define F1              0x3b00          /* F1 aka HELP */
  543. #define HELP            F1              /* same as F1 */
  544. #define TAB             0x0f09          /* tab */
  545. #define BKTAB           0x0f00          /* back (shift) tab */
  546. #define SPACE           0x3920          /* space */        
  547. #define ESCAPE          0x011b          /* escape */
  548. #if __TSC__ 
  549. #define RETurn          0x1c0d          /* return for TopSpeed */
  550. #else
  551. #define RET             0x1c0d
  552. #define RETurn          RET
  553. #endif        
  554.  
  555. /*
  556. ** Character codes (non scan codes)
  557. */
  558.  
  559. #define BELL            0x07            /* ring a ding */
  560. #define BS              0x08            /* backspace */
  561. #define ESC             0x1b            /* Escape */
  562. #define CR              0x0d            /* carriage return */
  563. #define LF              0x0a            /* linefeed */
  564. #define RUB             0x7f            /* delete */
  565. #define NAK             0x15            /* ^U */
  566. #define ETX             0x03            /* ^C */
  567. #define CAN             0x18            /* ^X */
  568.  
  569. /*
  570. ** Special Cases
  571. */
  572.  
  573. #define Del             0x53            /* Del key scan code >> 8 */
  574. #define ESC_CODE  -2                    /* return code: ESCAPE - ESC.001 */
  575.  
  576. #define VIDEO 0x10                      /* for wn_bios */
  577. #define KBOARD 0x16                     /* and wn_mouse */
  578.  
  579. /*
  580. ** Data Clerk Stuff
  581. */
  582.                                         /* 0 to 100 are reserved!! */
  583. #define GDONE  0                        /* end of list */
  584. #define GDATE  10                       /* wn_gdate */
  585. #define GTIME  11                       /* wn_gtime */
  586. #define GINT   12                       /* wn_gint */
  587. #define GUINT  13                       /* wn_guint */
  588. #define GLONG  14                       /* wn_glong */
  589. #define GFLOAT 15                       /* wn_gfloat */
  590. #define GPHONE 16                       /* wn_gphone */
  591. #define GTEXT  17                       /* wn_gtext */
  592. #define GBOOL  18                       /* wn_gbool */
  593. #define DTEXT  19                       /* Display text only */
  594. #define GPWORD 20                       /* wn_gpword */
  595. #define GULONG 21                       /* wn_gulong */
  596. #define GDOUBL 22                       /* wn_gdouble */
  597. #define GUTEXT 23                       /* wn_gutext */
  598. #define GLTEXT 24                       /* wn_gltext */
  599. #define GATEXT 25                       /* wn_gatext */
  600.                                         /* from above to 100 are reserved!! */
  601.  
  602. #define NSTR ""                         /* null string */
  603. #define NFRM (WIFORM)(0)                /* null form pointer */
  604. #define NFLD 0                          /* must be int 0 */
  605. #define SET  1                          /* form setup */
  606. #define XEQ  2                          /* immediate execution */
  607. #define MAXSTR 80                       /* max size - wn_gtext, wn_input */         
  608.  
  609. #define WNLPTR (WINDOWPTR) 0            /* A TRUE NULL WINDOW POINTER */
  610. #define MOLPTR (MOUSEPTR) 0             /* A TRUE NULL MOUSE POINTER */
  611.  
  612. /*
  613. ** FAR MEMORY MACROS
  614. */
  615.  
  616. #if MSCV3 | MSCV4
  617. #define FPSEG(fp) (*((unsigned *)&(fp) + 1))
  618. #define FPOFF(fp) (*((unsigned *)&(fp)))
  619. #endif
  620.  
  621. #if DLC
  622. #define FPOFF(fp) ((unsigned) ((char *)(fp) - (char *)0))
  623. #define FPSEG(fp) (((unsigned *) (&(fp)))[1])
  624. #endif
  625.  
  626. #if BORLAND 
  627. #define FPOFF(fp) ((unsigned)(fp))
  628. #define FPSEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
  629. #endif
  630.  
  631. #if LC3
  632. #define FPOFF(fp) (unsigned)FP_OFF( (char far *) fp)
  633. #define FPSEG(fp) (unsigned)FP_SEG( (char far *) fp)
  634. #endif
  635.  
  636. #if CI86
  637. unsigned wns_off();
  638. unsigned wns_seg();
  639. unsigned long wns_gticks();
  640. #define intdos  sysint21
  641. #define int86 sysint
  642. #define int86x sysint
  643. #define FPOFF(fp) (unsigned)wns_off(fp)
  644. #define FPSEG(fp) (unsigned)wns_seg(fp)
  645. #endif
  646.  
  647. #if LC2
  648. #define FPOFF(fp) wns_off(fp)
  649. #define FPSEG(fp) wns_seg(fp)
  650. #endif
  651.  
  652. #ifndef N1ADE
  653. #include "windows.ext"                  /* load externals */
  654. #endif
  655.  
  656. #define WNBDEBUG        FALSE           /* disable debugging */
  657.  
  658. /* End */
  659.