home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / LA / LA004.ZIP / TESS-C.ARC / TESS.H next >
C/C++ Source or Header  |  1988-10-02  |  20KB  |  493 lines

  1.     /*
  2.      * TESS.H -- 'C' INCLUDE file for TesSeRact
  3.      */
  4. /********************************< TESS.H >**********************************
  5. *                                                                           *
  6. *                       C Include File for TesSeRact                        *
  7. *                       ----------------------------                        *
  8. *                                                                           *
  9. *   TesSeRact(TM) -- A Library of Routines for Creating Ram-Resident (TSR)  *
  10. *                    programs for the IBM PC and compatible Personal        *
  11. *                    Computers.                                             *
  12. *                                                                           *
  13. *   The software, documentation and source code are:                        *
  14. *                                                                           *
  15. *       Copyright (C) 1986, 1987, 1988 Tesseract Development Team           *
  16. *       All Rights Reserved                                                 *
  17. *                                                                           *
  18. *************************************************************************CR*/
  19.  
  20. /**
  21.      This product  supports the  TesSeRact(TM)  Standard  for  Ram-Resident
  22.      Program Communication.   For  information about TesSeRact, contact the
  23.      TesSeRact Development Team at:
  24.      
  25.           TesSeRact Development Team
  26.           c/o Chip Rabinowitz
  27.           2084 Woodlawn Avenue
  28.           Glenside, PA 19038
  29.           1-215-884-3373
  30.      
  31.           Compuserve:    70731,20
  32.           MCIMAIL:       315-5415
  33.      
  34.      This MCIMAIL  Account has  been provided  to the TesSeRact Development
  35.      Team by Borland International, Inc.  The TesSeRact Development Team is
  36.      in no  way associated with Borland International, Inc.  TesSeRact is a
  37.      trademark of the TesSeRact Development Team.
  38.  
  39. **/
  40.  
  41. /**
  42. ***************************************************************************
  43.                              Copyright Notice
  44. ***************************************************************************
  45.  
  46. This  document,   other  accompanying  written  and  disk-based  notes  and
  47. specifications, and all referenced and related program files, demonstration
  48. code and  object modules  accompanying this document are copyrighted by the
  49. TesSeRact Development  Team.   The copyright  owner hereby licenses you to:
  50. use the  software; make as many copies of the software and documentation as
  51. you wish;  give exact  copies of the original to anyone; and distribute the
  52. software and  documentation in  its unmodified  form via  electronic means.
  53. There is no charge for any of the above.
  54.  
  55. You are specifically prohibited from charging, or requesting donations, for
  56. any such  copies, however made.  Exceptions may be granted to organizations
  57. which charge  a small  fee for  materials, handling,  postage  and  general
  58. overhead.  NO   ORGANIZATION  IS   AUTHORIZED  TO  CHARGE  ANY  AMOUNT  FOR
  59. DISTRIBUTION OF  THE SOFTWARE  OR DOCUMENTATION UNDER ANY OTHER CONDITIONS.
  60. Organizations which  charge a fee for distribution of any and all TesSeRact
  61. materials, except  as noted  above or  with the express, written consent of
  62. the TesSeRact  Development Team,  will be  considered in  violation of this
  63. copyright, and will be prosecuted to the full extent of the law.
  64.  
  65. In addition,  you are specifically prohibited from making any modifications
  66. to the  TesSeRact Library  Routines and/or documentation, unless you have a
  67. license for  the use  of the  source code.   Under  no circumstances is the
  68. copyright notice embedded in the TesSeRact code to be modified or removed.
  69.  
  70. This is  not free  software.   This license allows you to use this software
  71. without charge  for a period of 30 days.  In order to include this software
  72. as part  of any  product, either commercial, shareware, freeware, or public
  73. domain, registration  is required.   TesSeRact  may not  be included in any
  74. product for  any use  without registration.   Any such use of the TesSeRact
  75. product are in violation of federal copyright laws, and will be prosecuted.
  76.  
  77. No copy  of the  software may  be distributed  or given  away without  this
  78. accompanying documentation; this notice must not be removed.
  79.  
  80.  
  81. ***************************************************************************
  82.                                  Warranty
  83. ***************************************************************************
  84.  
  85. There is  no warranty  of any  kind associated  with this software, and the
  86. copyright owner  is not  liable for  damages of  any kind.   By  using this
  87. software, you  agree to  this.  Every effort has been made by the TesSeRact
  88. Development Team  to make  this product  bug-free.   However, the nature of
  89. software development  is  that  it  is  impossible  to  guarantee  bug-free
  90. software.
  91.  
  92. In the event a verifiable bug is found, the TesSeRact Development Team will
  93. make every  attempt to  repair the  bug as  soon as possible.  
  94.  
  95. ***************************************************************************
  96.                              Acknowledgements
  97. ***************************************************************************
  98.  
  99. Grateful appreciation  is expressed  to CompuServe Information Service, the
  100. IBM Software  Forums and  their Sysops, and Computer Language Magazine, for
  101. providing us  with the  means to  accomplish the  development of TesSeRact.
  102. Without their  gracious assistance,  TesSeRact could  never have  come into
  103. existence.
  104.  
  105. And let's not forget Anne Marie, who suffered through the long evenings and
  106. nights spent getting this product ready.
  107.  
  108. ***************************************************************************
  109. The TesSeRact Development Team:
  110. ***************************************************************************
  111.      
  112.      Team Leader:   Chip Rabinowitz
  113.      Developers:    Lane Ferris
  114.                     Kim Kokkonen
  115.                     Jim Kyle
  116.                     Neil J. Rubenking
  117.                     Barry Simon
  118.                     Rick Wilson
  119.      Contributors:  Thomas Brandenborg
  120.                     Chris Dunford
  121.                     John Friend
  122.                     Mark Horvatich
  123.                     John Hensley
  124.      Advisors:      Robert Bierman
  125.                     David Intersimone
  126.                     Rick Kraus
  127.                     David Moskowitz
  128.                     Gary Saxer
  129.  
  130. ***************************************************************************
  131.  
  132. **/
  133.  
  134. /*#define MSC5 */                       /* If using Microsoft C 5.0        */
  135. /*#define TC */                         /* If using Turbo C 1.5            */
  136.  
  137.  
  138.     /*
  139.      * Stores interrupt vector information for TesSeRact use
  140.      */
  141. struct TsrIntTable {
  142.     void far * OldVector;               /* Old Interrupt Vector            */
  143.     unsigned char IntNumber;            /* Interrupt Number                */
  144.     void near * NewVector;              /* offset of new vector            */
  145.     };
  146.  
  147.     /*
  148.      * User structure for defining additional hotkeys
  149.      */
  150. struct ExtraHot {
  151.     unsigned char Hotkey;               /* hotkey to check for             */
  152.     unsigned char ShiftState;           /* shift state for this hot key    */
  153.     unsigned char FlagByte;             /* flag value to use               */
  154.                                         /*  MAY NOT BE ZERO!!!             */
  155.     };
  156.  
  157.     /*
  158.      * TesSeRact internal data
  159.      */
  160. struct TsrData {
  161.     unsigned char RevLvl;               /* Revision Level of TESS Lib      */
  162.     unsigned char PopupType;            /* Type of popup in effect         */
  163.     unsigned char WasInt8;              /* An Interrupt 08h occurred       */
  164.     unsigned char WasInt13;             /* An Interrupt 13h occurred       */
  165.     unsigned char IntFlags;             /* Which interrupts are active     */
  166.     unsigned char SoftFlags;            /* Which soft ints are active      */
  167.     unsigned char DosVersion;           /* current major revision of DOS   */
  168.     unsigned char waitcount;            /* Count to wait before popping up */
  169.     void far * InDosFlag;               /* Pointer to DOS INDOS flag       */
  170.     void far * DosCritErr;              /* Pointer to DOS Critical Error   */
  171.     unsigned short UserPSP;             /* PSP segment of user program     */
  172.     unsigned short User28PSP;           /* PSP segment of user program     */
  173.     void far * UserDTA;                 /* DTA of interrupted program      */
  174.     void far * User28DTA;               /* DTA of interrupted program      */
  175.     unsigned short UserSS;              /* Stack segment of user program   */
  176.     unsigned short UserSP;              /* Stack pointer of user program   */
  177.     unsigned short User28SS;            /* Stack segment of user program   */
  178.     unsigned short User28SP;            /* Stack pointer of user program   */
  179.     void far * UserInt24;               /* pointer to use INT 24 handler   */
  180.     unsigned short OldExtErr[3];        /* storage for old DOS 3 extended  */
  181.                                         /*     error information           */
  182.     unsigned char OldBreak;             /* Old Break Setting               */
  183.     unsigned char OldVerify;            /* Old Verify Setting              */
  184.     unsigned char InWord4;              /* flag to indicate in WORD 4.0    */
  185.     unsigned char WasWord4;             /* word 4 special popup flag       */
  186.     unsigned char NewKbdFlag;           /* Enhanced Keyboard Call in use   */
  187.     unsigned char Word4Delay;           /* Delay for Word 4                */
  188.  
  189.     struct TsrIntTable Int8;            /* Interrupt vector tables         */
  190.     struct TsrIntTable Int9;
  191.     struct TsrIntTable Int13;
  192.     struct TsrIntTable Int16;
  193.     struct TsrIntTable Int1C;
  194.     struct TsrIntTable Int21;
  195.     struct TsrIntTable Int28;
  196.     struct TsrIntTable Int2F;
  197.     struct TsrIntTable Int1B;
  198.     struct TsrIntTable Int23;
  199.     struct TsrIntTable Int24;
  200.  
  201.     };
  202.  
  203.     /*
  204.      * TesSeRact data for individual TSR
  205.      */
  206. struct TsrParms {
  207.     char IdCode[8];                     /* Unique TSR Identification String*/
  208.                                         /* NOTE -- NOT NULL-TERMINATED     */
  209.     unsigned short IdNum;               /* Unique TSR Identification Number*/
  210.     unsigned long FuncFlags;            /* Bit map of supported functions  */
  211.     unsigned char HotKey;               /* Hotkey used by TSR for popup    */
  212.     unsigned char ShiftState;           /* ShiftState used by this TSR pop */
  213.     unsigned char HotKeyFlag;           /* which hotkey is in use          */
  214.     unsigned char ExtraHotCount;        /* Number of Extra Hotkeys to use  */
  215.     void far * ExtraHotKeys;            /* Pointer to extra hotkeys        */
  216.     unsigned short TsrStatus;           /* Current TSR Status Flags        */
  217.     unsigned short TsrPSP;              /* TSR's PSP Segment               */
  218.     void far * TsrDTA;                  /* Pointer to TSR's DTA region     */
  219.     unsigned short TsrDSeg;             /* TSR's Default Data Segment      */
  220.     void far * PopupStack;              /* Pointer to Popup Stack Area     */
  221.     void far * BackStack;               /* Pointer to Background Stack     */
  222.     };
  223.  
  224. /*-------------------------------------------------------------------------*/
  225.  
  226.         /************************************************************
  227.         *   Other EQUates                                           *
  228.         *********************************************************CR*/
  229.  
  230.     /*
  231.      * #defines for HotKey
  232.      */
  233. #define TSRHOT_A        0x1e
  234. #define TSRHOT_B        0x30
  235. #define TSRHOT_C        0x2e
  236. #define TSRHOT_D        0x20
  237. #define TSRHOT_E        0x12
  238. #define TSRHOT_F        0x21
  239. #define TSRHOT_G        0x22
  240. #define TSRHOT_H        0x23
  241. #define TSRHOT_I        0x17
  242. #define TSRHOT_J        0x24
  243. #define TSRHOT_K        0x25
  244. #define TSRHOT_L        0x26
  245. #define TSRHOT_M        0x32
  246. #define TSRHOT_N        0x31
  247. #define TSRHOT_O        0x18
  248. #define TSRHOT_P        0x19
  249. #define TSRHOT_Q        0x10
  250. #define TSRHOT_R        0x13
  251. #define TSRHOT_S        0x1f
  252. #define TSRHOT_T        0x14
  253. #define TSRHOT_U        0x16
  254. #define TSRHOT_V        0x2f
  255. #define TSRHOT_W        0x11
  256. #define TSRHOT_X        0x2d
  257. #define TSRHOT_Y        0x15
  258. #define TSRHOT_Z        0x2c
  259. #define TSRHOT_0        0x0b
  260. #define TSRHOT_1        0x02
  261. #define TSRHOT_2        0x03
  262. #define TSRHOT_3        0x04
  263. #define TSRHOT_4        0x05
  264. #define TSRHOT_5        0x06
  265. #define TSRHOT_6        0x07
  266. #define TSRHOT_7        0x08
  267. #define TSRHOT_8        0x09
  268. #define TSRHOT_9        0x0a
  269. #define TSRHOT_F1       0x3b
  270. #define TSRHOT_F2       0x3c
  271. #define TSRHOT_F3       0x3d
  272. #define TSRHOT_F4       0x3e
  273. #define TSRHOT_F5       0x3f
  274. #define TSRHOT_F6       0x40
  275. #define TSRHOT_F7       0x41
  276. #define TSRHOT_F8       0x42
  277. #define TSRHOT_F9       0x43
  278. #define TSRHOT_F10      0x44
  279.     
  280.     /*
  281.      * Enhanced Keyboards only
  282.      * 
  283.      * May not work with all computers, keyboards
  284.      * 
  285.      */
  286. #define TSRHOT_F11      0x57
  287. #define TSRHOT_F12      0x58
  288.  
  289.     /*
  290.      * #defines for ShiftState
  291.      */
  292. #define TSRPOPRSHIFT    0x01
  293. #define TSRPOPLSHIFT    0x02
  294. #define TSRPOPCTRL      0x04
  295. #define TSRPOPALT       0x08
  296.  
  297.     /*
  298.      * #defines for TSRFLAGS
  299.      */
  300. #define TSRUSEPOPUP     0x0010          /* Use TsrMain()                   */
  301. #define TSRUSEBACK      0x0020          /* Use TsrBackProc()               */
  302. #define TSRUSETIMER     0x0040          /* Use TsrTimer()                  */
  303. #define TSRUSEUSER      0x0100          /* Use TsrUserProc()               */
  304. #define NOPOPGRAPH      0x1000          /* Don't pop over graphics         */
  305. #define NOPOPCOMMAND    0x2000          /* Don't pop over command-line     */
  306.  
  307.     /*
  308.      * #defines for TsrStatus flags
  309.      */
  310.  
  311. #define HOTKEYON        0x0001          /* hot key pressed                 */
  312. #define SHIFTSON        0x0002          /* shift states match              */
  313. #define TSRACTIVE       0x0004          /* tsr is running in foreground    */
  314. #define INT28ACTIVE     0x0008          /* INT28 routine is running        */
  315.  
  316. #define POPUPSET        0x0010          /* popup resident routine installed*/
  317. #define BACKSET         0x0020          /* background routine installed    */
  318. #define TIMERSET        0x0040          /* timer procedure installed       */
  319. #define EXTRAHOTSET     0x0080          /* extra hot keys installed        */
  320.  
  321. #define USERPROCON      0x0100          /* User-defined procedure installed*/
  322. #define TSRENABLED      0x0200          /* TSR currently enabled           */
  323. #define TSRRELEASED     0x0400          /* TSR has been released           */
  324. #define EXTRAINT24      0x0800          /* User installed replacement INT24*/
  325.  
  326.  
  327.     /*
  328.      * EQUates for IntFlags and SoftFlags
  329.      */
  330.  
  331. #define ININT13         0x04            /* Interrupt 13 is currently active*/
  332. #define ININT21         0x08            /* Interrupt 21 is currently active*/
  333. #define ININT16         0x10            /* Interrupt 16 is currently active*/
  334. #define ININT28         0x20            /* Interrupt 28 is currently active*/
  335. #define ININT08         0x40            /* Interrupt 08 is currently active*/
  336. #define ININT1C         0x80            /* Interrupt 1C is currently active*/
  337.  
  338.     /*
  339.      * Keyboard Stuffing speeds
  340.      */
  341. #define STUFF_SLOW      0               /* Stuff key when buffer is empty  */
  342. #define STUFF_MED       1               /* Stuff up to four keys per tick  */
  343. #define STUFF_FAST      2               /* Full buffer on every tick       */
  344.  
  345. /*-------------------------------------------------------------------------*/
  346.  
  347.         /************************************************************
  348.         *   Prototypes for routines in TESS.LIB                     *
  349.         *********************************************************CR*/
  350.  
  351. extern unsigned far pascal TsDoInit(
  352.     unsigned char HotKey,
  353.     unsigned char ShiftState,
  354.     unsigned short TSRFlags,
  355.     unsigned short MemoryTop
  356.     );
  357.  
  358.  
  359. extern void far pascal TsSetStack(
  360.     void far *PopUpStack, 
  361.     void far *BackGroundStack
  362.     );
  363.  
  364. extern void far pascal TessBeep(
  365.     void
  366.     );
  367.  
  368. /*-------------------------------------------------------------------------*/
  369.         /************************************************************
  370.         *  TesSeRact Multiplex Interrupt (2Fh) functions            *
  371.         *    These functions are provided for your convenience in   *
  372.         *    TESS.LIB                                               *
  373.         *********************************************************CR*/
  374.  
  375. extern unsigned far pascal TsCheckResident(
  376.     char far *IDStr,
  377.     unsigned far *IDNum
  378.     );
  379.  
  380. extern struct TsrParms far * far pascal TsGetParms(
  381.     unsigned short TsrIdNum
  382.     );
  383.  
  384. extern unsigned far pascal TsCheckHotkey(
  385.     unsigned char HotKey
  386.     );
  387.  
  388. extern unsigned far pascal TsSetUser24(
  389.     unsigned short TsrIdNum,
  390.     void (far *UserCritErrProc) (void)
  391.     );
  392.  
  393. extern struct TsrData far * far pascal TsGetData(
  394.     unsigned short TsrIdNum
  395.     );
  396.  
  397. extern unsigned far pascal TsSetExtraHot(
  398.     unsigned short TsrIdNum,
  399.     unsigned char count, 
  400.     struct ExtraHot far *ExtraHotKeys
  401.     );
  402.  
  403. extern unsigned far pascal TsEnable(
  404.     unsigned short TsrIdNum
  405.     );
  406.  
  407. extern unsigned far pascal TsDisable(
  408.     unsigned short TsrIdNum
  409.     );
  410.  
  411. extern unsigned far pascal TsRelease(
  412.     unsigned short TsrIdNum
  413.     );
  414.  
  415. extern unsigned far pascal TsRestart(
  416.     unsigned short TsrIdNum
  417.     );
  418.  
  419. extern unsigned far pascal TsGetStat(
  420.     unsigned short TsrIdNum
  421.     );
  422.  
  423. extern unsigned far pascal TsSetStat(
  424.     unsigned short TsrIdNum,
  425.     unsigned short NewStatus
  426.     );
  427.  
  428. extern unsigned far pascal TsGetPopType(
  429.     unsigned short TsrIdNum
  430.     );
  431.  
  432. extern unsigned far pascal TsCallUserProc(
  433.     unsigned short TsrIdNum,
  434.     void far *UserPtr
  435.     );
  436.  
  437. extern unsigned far pascal TsStuffKeyboard(
  438.     unsigned short TsrIdNum,
  439.     void far *KbdChars,
  440.     unsigned short CharCount,
  441.     unsigned short Speed
  442.     );
  443.  
  444. extern unsigned far pascal TsTriggerPop(
  445.     unsigned short TsrIdNum
  446.     );
  447.  
  448. extern unsigned far pascal TsTriggerBack(
  449.     unsigned short TsrIdNum
  450.     );
  451.  
  452. void far pascal TsVerify2f(void);
  453.  
  454. void far pascal TsRestore2f(void);
  455.  
  456. /*-------------------------------------------------------------------------*/
  457.         /************************************************************
  458.         *   USER-DEFINED routines                                   *
  459.         *     If no entry point for these routines is defined in    *
  460.         *     your code, a dummy procedure from TESS.LIB will be    *
  461.         *     used to satisfy the external references.              *
  462.         *       These are the prototypes for the functions.         *
  463.         *     Note that beginning with Version 0.74, it is no       *
  464.         *       longer necessary for all these procedures to be     *
  465.         *       defined -- TESS.LIB has dummy procedures to resolve *
  466.         *       the external references.                            *
  467.         *********************************************************CR*/
  468.  
  469. void far pascal TsrMain(
  470.     void
  471.     );
  472.  
  473. unsigned far pascal TsrBackCheck(
  474.     void
  475.     );
  476.  
  477. void far pascal TsrBackProc(
  478.     void
  479.     );
  480.  
  481. void far pascal TsrTimerProc(
  482.     void
  483.     );
  484.  
  485. void far pascal TsrUserProc(
  486.     void far *UserPtr
  487.     );
  488.  
  489. void far pascal TsrCleanUp(
  490.     unsigned InitOrShutdown
  491.     );
  492.  
  493.