home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / ctrlclib.zip / CTRLCDOC.EXE / CTRLCMAN.DOC
Text File  |  1991-01-15  |  162KB  |  4,361 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                              --==    C T R L C L I B    ==--
  11.  
  12.  
  13.                                    The Ctrl+C Library
  14.  
  15.  
  16.  
  17.  
  18.  
  19.             A C-language Library of Integrated Interrupt Management Functions
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                                       USER'S GUIDE
  26.  
  27.                                            and
  28.  
  29.                                     REFERENCE MANUAL
  30.  
  31.  
  32.  
  33.                                        Version 1.0
  34.  
  35.  
  36.  
  37.  
  38.  
  39.                            
  40.                                    _______
  41.                               ____|__     |     MEMBER
  42.                            --|       |    |-------------------
  43.                              |   ____|__  |  Association of
  44.                              |  |       |_|  Shareware
  45.                              |__|   o   |    Professionals
  46.                            -----|   |   |---------------------
  47.                                 |___|___|               (R)
  48.                            
  49.  
  50.  
  51.                  Copyright (C) 1990  Trendtech Corporation,  Wayne, NJ,
  52.                                    All Rights Reserved
  53.              Licensed Material - Program, Documentation, and Text Files are
  54.                            Property of Trendtech Corporation.
  55.  
  56.  
  57.  
  58.                                                                        Page 2
  59.                                                 CTRLCLIB - The Ctrl+C Library
  60.  
  61.             COPYRIGHT NOTICES AND TRADEMARKS
  62.  
  63.             CTRLCLIB -  The Ctrl+C Library(Tm) is Copyright 1990 by Trendtech
  64.             Corporation, Inc.,  Wayne,  New  Jersey,    U.S.A.    All  rights
  65.             reserved.
  66.  
  67.             Licensed Material;  this  collection  of  software  objects,  its
  68.             documentation, demo  programs,  other  accompanying  written  and
  69.             disk-based notes  and  specifications,  and  all  referenced  and
  70.             related program files, are the property of Trendtech Corporation,
  71.             Inc., Wayne, NJ,  U.S.A.
  72.  
  73.  
  74.             -CTRLCLIB -  The Ctrl+C  Library  is  a  trademark  of  Trendtech
  75.             Corporation, Inc., Wayne, NJ.
  76.             -The ASP and logo are registered trademarks of the Association of
  77.             Shareware Professionals.
  78.             -CompuServe is a registered trademark of CompuServe Incorporated.
  79.             -DESQview is a trademark of Quarterdeck Office Systems.
  80.             -IBM  is   a  registered   trademark  of  International  Business
  81.             Machines.
  82.             -Microsoft is a registered trademark of Microsoft Corporation.
  83.             -Turbo C is a registered trademark of Borland International.
  84.             -QuickC is a trademark of Microsoft Corporation.
  85.  
  86.  
  87.                  CTRLCLIB   is distributed  as  Shareware  and  has  specific
  88.             licensing provisions, please read the following sections for more
  89.             information  about   Shareware,   licensing,   and   registration
  90.             procedures.
  91.  
  92.                  Use, duplication, or disclosure by the Government is subject
  93.             to restrictions  as set  forth in  subdivision (b)(3)(ii)  of the
  94.             Rights in Technical Data and Computer Software clause at
  95.             252.227-7013.
  96.  
  97.  
  98.             EVALUATION NOTE:
  99.                  Space limitations  on the  Shareware  disk  allow  only  two
  100.             memory-model libraries  for each  compiler.  If you can not fully
  101.             evaluate CTRLCLIB  because of the lack of a specific memory model
  102.             such as "compact" or "medium", please contact us.  We will supply
  103.             you with  a disk  containing a  library for  the memory-model you
  104.             need for the compiler you specify.  This disk will be supplied to
  105.             you free of charge so that you may thoroughly evaluate CTRLCLIB.
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.             _________________________________________________________________
  113.                        Copyright 1990 Trendtech Corporation, Inc.
  114.  
  115.  
  116.  
  117.                                                                        Page 3
  118.                                                 CTRLCLIB - The Ctrl+C Library
  119.  
  120.                           T A B L E   O F   C O N T E N T S
  121.             ____________________________________________________________
  122.  
  123.  
  124.             1. REGISTRATION                                            5
  125.             2. SUPPORT                                                 5
  126.                 2.1 Technical Support                                  5
  127.                 2.2 Electronic Support                                 6
  128.                 2.3 Telephone and Mail Support                         6
  129.             3. ACKNOWLEDGEMENTS                                        7
  130.             4. INTRODUCTION                                            8
  131.                 4.1 What Can I Do With CTRLCLIB?                      10
  132.                 4.2 What Took So Long?                                11
  133.                 4.3 The Mechanics of CTRL-C and CTRL-BREAK            12
  134.                 4.4 Our Solution - an Intelligent INT09               16
  135.             5. USING CTRLCLIB  EFFECTIVELY                            16
  136.                 5.1 Technicals                                        16
  137.                 5.2 Operation                                         17
  138.                 5.3 Using Library Functions                           17
  139.                 5.4 The Interrupt Management Control Structure        18
  140.                 5.5 Code Examples                                     18
  141.             6. LIBRARY DISTRIBUTION                                   20
  142.                 6.1 The Shareware Disk                                21
  143.                 6.2 The Registered Source Disk                        23
  144.             7. INSTALLING CTRLCLIB                                    24
  145.                 7.1 Installation                                      24
  146.                 7.2 Compiling                                         25
  147.                 7.3 Linking                                           25
  148.             8. GENERAL NOTES                                          25
  149.                 8.1 Borland Turbo C Notes                             26
  150.                 8.2 Microsoft C Notes                                 27
  151.                 8.3 Microsoft QuickC Notes                            27
  152.                 8.4 MS-DOS Notes                                      27
  153.                 8.5 General Caveats                                   28
  154.                     8.5.1 Keyboard Idiosyncrasies                     28
  155.                     8.5.2 Virtual Control Programs                    29
  156.                         8.5.2.1 WINDOWS, DESQview, VM386, OS/2, et al 29
  157.                     8.5.3 Other Caveats                               30
  158.                         8.5.3.1 TSR's                                 30
  159.                 8.6 Making Changes                                    31
  160.                 8.7 Feedback                                          31
  161.             9. FUNCTION CALL REFERENCE SECTION                        32
  162.                 9.1 int  BreakFlag( action, flagset )                 33
  163.                 9.2 int  CapsLock( setting )                          34
  164.                 9.3 int  CtrlcLibSetup(varg)                          36
  165.                 9.4 void CtrlcLibCleanup( void )                      38
  166.                 9.5 void CtrlAltDel( action )                         39
  167.                 9.6 void CtrlBreak( action )                          40
  168.  
  169.  
  170.  
  171.             _________________________________________________________________
  172.                        Copyright 1990 Trendtech Corporation, Inc.
  173.  
  174.  
  175.  
  176.                                                                        Page 4
  177.                                                 CTRLCLIB - The Ctrl+C Library
  178.  
  179.                 9.7 void CtrlC( action )                              41
  180.                 9.8 void CtrlP( action )                              42
  181.                 9.9 void CtrlS( action)                               43
  182.                 9.10 void FullCtrlC( action )                         44
  183.                 9.11 int  InsertLock( setting)                        45
  184.                 9.12 void KeyboardHandler( action )                   47
  185.                 9.13 int  NumLock( setting )                          48
  186.                 9.14 void PauseKey( action )                          50
  187.                 9.15 void PrintScreen( action )                       51
  188.                 9.16 unsigned QueryCtrlC(void)                        52
  189.                 9.17 unsigned QueryKeyPad5(void)                      53
  190.                 9.18 unsigned QueryPrtScr(void)                       54
  191.                 9.19 unsigned QuerySysReq(void)                       55
  192.                 9.20 int  ScrollLock( setting )                       56
  193.                 9.21 void ShowCtrlC( void)                            58
  194.                 9.22 void SysReq( action )                            59
  195.                 9.23 void SystemReset( action )                       60
  196.             10. APPENDIX -A- LICENSE AND REGISTRATION                 61
  197.                 10.1 SHAREWARE LICENSE                                61
  198.                 10.2 Warranty and Liability Information.              62
  199.                     10.2.1  Shareware Version - Warranty Exclusion    62
  200.                     10.2.2  Registered Version - Limited Warranty     62
  201.                     10.2.3  Liability Limitation                      63
  202.                 10.3 REGISTRATION                                     63
  203.                     10.3.1  Source Code                               63
  204.                     10.3.2  Single-User License                       64
  205.                     10.3.3  Network License.                          65
  206.                     10.3.4  Site License                              66
  207.                     10.3.5  Retail Distribution                       66
  208.                     10.3.6  Sales Tax:                                66
  209.                 10.4 OWNERSHIP                                        66
  210.             11. APPENDIX  -B-  WHAT IS SHAREWARE                      67
  211.             12. APPENDIX  -C-  DISTRIBUTION REQUIREMENTS              68
  212.             13. APPENDIX  -D-  REGISTRATION BENEFITS                  69
  213.                 13.1 Upgrade Policy                                   69
  214.             14. APPENDIX  -E-  THE A.S.P.                             70
  215.                 14.1 The ASP Ombudsman Statement                      70
  216.                 14.2 Summary of ASP Goals                             70
  217.                 14.3 ASP Standards for Author Members                 71
  218.                     14.3.1 PROGRAMMING STANDARDS                      71
  219.                     14.3.2 DOCUMENTATION STANDARDS                    71
  220.                     14.3.3 SUPPORT STANDARDS                          71
  221.                     14.3.4 GENERAL                                    72
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.             _________________________________________________________________
  231.                        Copyright 1990 Trendtech Corporation, Inc.
  232.  
  233.  
  234.  
  235.                                                                        Page 5
  236.                                                 CTRLCLIB - The Ctrl+C Library
  237.  
  238.             1. REGISTRATION
  239.  
  240.                  CTRLCLIB  and all programs and documentation distributed or
  241.             shipped with it are copyrighted works protected by U.S. and
  242.             international copyright laws.  This collection of programs and
  243.             files is referred to simply as "CTRLCLIB".  You are granted a
  244.             license to use your evaluation copy of CTRLCLIB only under the
  245.             terms and conditions specified in APPENDIX -A- of this document.
  246.  
  247.                  CTRLCLIB is a commercial software package.  It is not free,
  248.             and it is not in the public domain.  It is distributed as
  249.             Shareware, which means that before you pay for the package, you
  250.             may try it and see if you want to continue using it.  You may use
  251.             CTRLCLIB free for a trial period of up to 30 days.  If you wish
  252.             to continue using CTRLCLIB after that period, you must pay a
  253.             registration fee.  If you choose not to pay the registration fee,
  254.             you must stop using CTRLCLIB and remove it from your computer,
  255.             though you are still free to keep copies and pass them along to
  256.             others.  Please read the APPENDIX for complete license and
  257.             registration details.
  258.  
  259.  
  260.  
  261.             2. SUPPORT
  262.  
  263.             2.1 Technical Support
  264.  
  265.                  We support  our software.  One of the great strengths of the
  266.             Shareware concept  is the  direct interaction between the program
  267.             author and  the users.   Many of the current features in CTRLCLIB
  268.             are the  result of  user input.  If you have a problem evaluating
  269.             the components  of this library or desire to make a suggestion or
  270.             comment (or  even a  complaint), please don't hesitate to contact
  271.             us.
  272.  
  273.                  Technical  support   for  CTRLCLIB   is  available  to  both
  274.             shareware and  registered users.   If  you are  not a  registered
  275.             user, we  will provide limited assistance to help you install and
  276.             evaluate CTRLCLIB .
  277.  
  278.                  You may call or write us for technical support.  Unless your
  279.             problem is  relatively complex,  you will get the best results by
  280.             calling.   If you write us, please include a phone number and the
  281.             times when  you will  be available.   Most of the time you'll get
  282.             our answering  machine, so  please speak  clearly and slowly when
  283.             you leave your name and telephone number.
  284.  
  285.  
  286.  
  287.  
  288.  
  289.             _________________________________________________________________
  290.                        Copyright 1990 Trendtech Corporation, Inc.
  291.  
  292.  
  293.  
  294.                                                                        Page 6
  295.                                                 CTRLCLIB - The Ctrl+C Library
  296.  
  297.                  With reference  to calls,  if we  do not  call back,  please
  298.             remember that  a small  percentage of  our call-backs  do not get
  299.             completed because  of faulty  phone numbers,  unanswered, or busy
  300.             phones, or  a garbled  answering machine  message. If we have not
  301.             called you back within one work day, please call us again.
  302.  
  303.             2.2 Electronic Support
  304.  
  305.                  Electronic support  is available  on CompuServe.  CompuServe
  306.             electronic correspondence is limited to electronic mail only. Our
  307.             MAIL ID  is [76210,771].   If you wish to find out more about the
  308.             Shareware concept  and talk  electronically  to  other  Shareware
  309.             authors,  we  encourage  you  to  join  the  SHAREWARE  forum  on
  310.             Compuserve.  After logging in to CIS, simply type "GO SHAREWARE".
  311.             This will  put you in the IBMJR forum.  Don't be alarmed however,
  312.             as of this writing, CompuServe has not yet changed the forum name
  313.             to "SHAREWARE",  it is  still called  "IBMJR".  Author-members of
  314.             the Association  of Shareware  Professionals have  been allocated
  315.             sections 8,  9, 10, 11, and 12.  Sections 8 and 9 are open to the
  316.             general public.   We  occasionally check other forums (SIG's) too
  317.             but these  should not  be  considered  a  vehicle  for  effective
  318.             communication to  Trendtech. If you are a CompuServe user and you
  319.             need to  reach us,  please use electronic MAIL.  Most of the time
  320.             MAIL messages  are answered  on a  daily  basis.    If  you  need
  321.             information on  obtaining  a  CompuServe  account  you  can  call
  322.             CompuServe toll free at 1-800-848-8199.
  323.  
  324.  
  325.             2.3 Telephone and Mail Support
  326.  
  327.             We can be reached via U.S. Mail at:
  328.  
  329.                       TRENDTECH CORPORATION
  330.                       P.O. Box 3687
  331.                       Wayne, New Jersey 07474-3687
  332.                       U.S.A.
  333.  
  334.                  by FAX: (201) 694-2543
  335.  
  336.                  by VOICE: (201) 694-8622
  337.  
  338.                  For voice,  please leave  a message; as stated above, we try
  339.             to respond  to telephone messages as quickly as possible, but may
  340.             require 24 hours or more depending on our workload and the timing
  341.             of your call.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.             _________________________________________________________________
  349.                        Copyright 1990 Trendtech Corporation, Inc.
  350.  
  351.  
  352.  
  353.                                                                        Page 7
  354.                                                 CTRLCLIB - The Ctrl+C Library
  355.  
  356.             3. ACKNOWLEDGEMENTS
  357.  
  358.                  Trendtech  Corporation   would  like   to  thank   all   who
  359.             participated in  Alpha  and  Beta  testing  of  CTRLCLIB.    We'd
  360.             especially like  to thank  Dave  Jurgens,  Tracey  Siesser,  Walt
  361.             Myers, Hans  Salvisberg, Mike Vore, Roger Baird, Kenneth Loafman,
  362.             Carl Huff,  Larry Weaver,  and  others  who  provided  thoughtful
  363.             insight into  potential problems, offered solutions, and tendered
  364.             new ideas  for possible  enhancements.   Your efforts are greatly
  365.             appreciated.
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.             _________________________________________________________________
  408.                        Copyright 1990 Trendtech Corporation, Inc.
  409.  
  410.  
  411.  
  412.                                                                        Page 8
  413.                                                 CTRLCLIB - The Ctrl+C Library
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.                     ---==<<   CTRLCLIB - THE CTRL+C LIBRARY   >>==---
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.             4. INTRODUCTION
  429.  
  430.                  What do  you think  would happen to your application program
  431.             or the database files it has opened if the user accidently (or on
  432.             purpose) hit  the CONTROL-C  or CONTROL-BREAK  keys?  Or, suppose
  433.             they pressed  CTRL+ALT+DEL in  the middle  of a  complicated file
  434.             update?   These keys  will terminate  your program,  we all  know
  435.             that.   But what  about the  CTRL+2 keys  (the CTRL  key plus the
  436.             number row  "2" key)?  Or, how about the "back-door" ALT+kp3 (the
  437.             ALT key  plus the  keypad 3  )?   If the  user accidently pressed
  438.             these keys,  they will cause your program to come to a screeching
  439.             halt too  just as well as the more straight-forward control-c and
  440.             control-break keys.
  441.  
  442.                  If your  program doesn't  use  standard  console  input  and
  443.             output you  might be  okay.   But, suppose the user placed "BREAK
  444.             ON" in their CONFIG.SYS file?  This means that DOS will check for
  445.             the break  keys on  a wider  variety of  DOS functions  than just
  446.             console I/O, so your program could 'crash and burn' anyway.
  447.  
  448.                  If part  of your application is keyboard intensive such as a
  449.             complicated data-entry  program, then you'd probably want to make
  450.             your program  "user-proof".   If users  wanted to  "break out" of
  451.             your program,  it should  be robust enough to detect that action,
  452.             and then  "gracefully" terminate.   We  say "gracefully"  because
  453.             this will  give your application program a chance to do its final
  454.             "cleanup" before ending.
  455.  
  456.                  With CTRLCLIB  in  your  toolbox  of  professional  software
  457.             development  tools,   you  can   provide  the   robustness   your
  458.             applications need to make them fully user-proof.  To paraphrase a
  459.             famous line  from a popular science-fiction TV show of years ago:
  460.             "YOU CAN  CONTROL THE  VERTICAL, YOU CAN CONTROL THE HORIZONTAL".
  461.             In other  words, you  can fully  direct the course of action your
  462.             program can take in response to user-initiated interrupts.
  463.  
  464.  
  465.  
  466.             _________________________________________________________________
  467.                        Copyright 1990 Trendtech Corporation, Inc.
  468.  
  469.  
  470.  
  471.                                                                        Page 9
  472.                                                 CTRLCLIB - The Ctrl+C Library
  473.  
  474.  
  475.                  CTRLCLIB is  a C-language  library of  integrated  interrupt
  476.             management functions  that commercial software developers, system
  477.             designers, and  programmers can  use to  help make their programs
  478.             "user-proof".  With as little as a simple one-time call to one or
  479.             more functions  from  the  library,  you  can  set  up  interrupt
  480.             handlers and  traps to  block keystroke  combinations that  would
  481.             normally cause most programs to terminate unexpectedly.
  482.  
  483.                  But let's  face it,  no program  is completely  user-proof -
  484.             there is always the power-OFF switch.  But short of that however,
  485.             with functions  from CTRLCLIB  you can "catch" many inappropriate
  486.             keypresses by users of your application program.  For example, if
  487.             your application is a complicated word-processor or editor, you'd
  488.             want to ask the user to save changed files before they accidently
  489.             (or  purposely)  pressed  the  CTRL+C  or  CTRL+BREAK  keys  that
  490.             normally terminates  any MS-DOS  program.   If you're designing a
  491.             sophisticated windowing application, you don't want the insidious
  492.             "^C" characters botching up your windows when the user accidently
  493.             pressed <ALT>+<keypad  3> or  <CTRL>+<number 2>.   Yes, these too
  494.             are program break keys.
  495.  
  496.                  By including routines from CTRLCLIB you can insure that your
  497.             application is  well protected  from anxious users who press keys
  498.             indiscriminately.
  499.  
  500.                  With support  functions  from  CTRLCLIB,  your  program  can
  501.             control the  setting of  the LOCK  keys too.   If  the data entry
  502.             procedures in  your application  need to  have the  NUM LOCK  key
  503.             "ALWAYS" ON,  for example,  just call a CTRLCLIB library function
  504.             once, and  from then  on, the  NUM LOCK will remain ON,  the user
  505.             cannot turn  it off.   When your data entry function is finished,
  506.             just call a function from CTRLCLIB to turn it off.  The same goes
  507.             for the other LOCK keys too.
  508.  
  509.                  If your  application is time-critical and you don't want the
  510.             user messing with the PAUSE key or CTRL+S, simply call a function
  511.             from CTRLCLIB to disable it.
  512.  
  513.                  CTRLCLIB  is  a  collection  of  C-language  functions  that
  514.             replace interrupt  handlers as  needed and removes them when they
  515.             are not  needed -  all controlled  by  you    -  the  application
  516.             developer.  And best of all,  the entire library is written in C,
  517.             there is NO assembly language,  so you don't need MASM or Debug.
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.             _________________________________________________________________
  526.                        Copyright 1990 Trendtech Corporation, Inc.
  527.  
  528.  
  529.  
  530.                                                                       Page 10
  531.                                                 CTRLCLIB - The Ctrl+C Library
  532.  
  533.             4.1 What Can I Do With CTRLCLIB?
  534.  
  535.                  The functions  in CTRLCLIB can help your application program
  536.             manage a  discreet class  of interrupts.  For the most part these
  537.             consist of  the interrupts that are initiated by the user and are
  538.             caused by  unique keystroke  combinations  made  while  they  are
  539.             running your application program.  The following list illustrates
  540.             the kinds  of  interrupts  that  your  program  can  catch  using
  541.             functions from CTRLCLIB:
  542.  
  543.  
  544.                  KEYPRESS INTERRUPT:          What it normally does:
  545.                  ============================================================
  546.  
  547.                  o  CTRL+BREAK and CTRL+C   - Program termination
  548.  
  549.                  o  CTRL+2 and ALT+Keypad 3 - Program termination
  550.  
  551.                  o  The "^C" screen print   - Disrupts screen display
  552.  
  553.                  o  CTRL+ALT+DEL            - System reset
  554.  
  555.                  o  PRINT SCREEN            - Screen dump to printer
  556.  
  557.                  o  CTRL+PRTSCRN and CTRL+P - Screen echo to printer
  558.  
  559.                  o  PAUSE KEY or CTRL+NUML  - System pause until keystroke
  560.  
  561.                  o  CTRL+S                  - Pause MS-DOS output to STDOUT
  562.  
  563.  
  564.                  Callable functions  from CTRLCLIB  can disable any or all of
  565.             the above keypress interrupts.
  566.  
  567.                  Your application  program can also exercise a high degree of
  568.             control over  the following  keyboard keys  with  functions  from
  569.             CTRLCLIB:
  570.  
  571.  
  572.                  o  CAPS LOCK KEY           - Full control
  573.  
  574.                  o  NUM LOCK KEY            - Full control
  575.  
  576.                  o  SCROLL LOCK KEY         - Full control
  577.  
  578.                  o  INSERT LOCK KEY         - Full control
  579.  
  580.                  o  KEYPAD 5 KEY            - Full keypress detection
  581.  
  582.  
  583.  
  584.             _________________________________________________________________
  585.                        Copyright 1990 Trendtech Corporation, Inc.
  586.  
  587.  
  588.  
  589.                                                                       Page 11
  590.                                                 CTRLCLIB - The Ctrl+C Library
  591.  
  592.  
  593.                                 Full  control  options:  ALWAYS-ON,
  594.                                 ALWAYS-OFF, ON, OFF, TOGGLE
  595.  
  596.  
  597.                  Your application  can have  the following  support functions
  598.             available as needed:
  599.  
  600.                  o  REBOOT - Initiate a WARM or COLD reboot anytime
  601.  
  602.                  o  DISPLAY THE "^C" CHARACTERS - when YOU want
  603.  
  604.                  o  QUERY functions - determine if user pressed any of the
  605.                                       interrupt keys.
  606.  
  607.  
  608.  
  609.             4.2 What Took So Long?
  610.  
  611.                  Over the  years there  have been  many articles  written  in
  612.             computer magazines,  newsletters, and  books about  ways to  trap
  613.             various critical  keypresses such as control-break and control-c.
  614.             Some of  these articles  illustrated how  to trap  these keys  in
  615.             BASIC,  Assembly,   and  even   C.    Many  so-called  "advanced"
  616.             programming language  books addressed  the issue  too.  Some even
  617.             provided sample  code to  trap certain  keystrokes and to install
  618.             Interrupt Service  Routines (ISR's).   There  are also  expensive
  619.             commercial C-language  libraries that  contain a few functions to
  620.             handle some  of these  critical keypresses.   Most  of  what  was
  621.             written,  and  most  of  what  is  currently  sold  in  expensive
  622.             libraries only  skimmed the surface or skirted the more important
  623.             issues of  interrupt management.    Almost  all  of  the  methods
  624.             illustrated lacked  one critical  element; they failed to provide
  625.             feedback to  the program  when these  keys were pressed.  A truly
  626.             robust program should know if a user wants to get out but doesn't
  627.             know how so they hit the break keys.
  628.  
  629.                  Until now,  no one  has ever  addressed the  issues of  FULL
  630.             user-caused interrupt management control, especially with respect
  631.             to Ctrl-C  and Ctrl-Break  protection.   Yes, it's easy enough to
  632.             trap these  keys and  prevent program  termination, but  it's NOT
  633.             easy to  stop MS-DOS  from throwing  up  the  insidious  "  ^C  "
  634.             characters on  the screen.   This  can be  caused in a variety of
  635.             ways.   David Burki  succinctly addressed the issue in an article
  636.             entitled "Eliminating Control-C" in the August 1990 issue of TECH
  637.             SPECIALIST Vol. 1 Number 3.  David has graciously approved, and R
  638.             & D Publications has granted us permission to reprint most of his
  639.             article in this CTRLCLIB User's Guide.
  640.  
  641.  
  642.  
  643.             _________________________________________________________________
  644.                        Copyright 1990 Trendtech Corporation, Inc.
  645.  
  646.  
  647.  
  648.                                                                       Page 12
  649.                                                 CTRLCLIB - The Ctrl+C Library
  650.  
  651.  
  652.                  With CTRLCLIB  - The Ctrl+C Library, we want to "pull it all
  653.             together" and  create a  programming support  library - a central
  654.             repository,  if   you  will,  of  interrupt  management  control.
  655.             CTRLCLIB is  the result  of an  extensive  effort  to  create  an
  656.             integrated set of interrupt management functions written entirely
  657.             in C,  and callable  from any  program.   Our  goal  is  to  make
  658.             CTRLCLIB  the  definitive  MS-DOS  standard  for  managing  user-
  659.             initiated program interrupts.
  660.  
  661.  
  662.             4.3 The Mechanics of CTRL-C and CTRL-BREAK
  663.  
  664.                  The following description of the control-c and control-break
  665.             process was  written by  David Burki  and appeared  in the August
  666.             1990  issue  of  Tech  Specialist.    Additionally,  the  article
  667.             included David's  assembly language  implementation of  an INT16H
  668.             interrupt  handler   to  intercept   control-c  and   the    "^C"
  669.             characters.   In the  interest of  space, that  portion has  been
  670.             dropped.  Full reprints may be obtained from R & D Publications -
  671.             see address and phone number below.
  672.  
  673.                  The following is an edited version of David's article:
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.             _________________________________________________________________
  703.                        Copyright 1990 Trendtech Corporation, Inc.
  704.  
  705.  
  706.  
  707.                                                                       Page 13
  708.                                                 CTRLCLIB - The Ctrl+C Library
  709.  
  710.  
  711.                                   Eliminating Control-C
  712.  
  713.                                            by
  714.  
  715.                                        David Burki
  716.  
  717.  
  718.                 The standard  "solutions" to  preventing Ctrl-C and Ctrl-
  719.                 Break from  abnormally terminating an application program
  720.                 all  deal  with  replacing  the  23H  and  1bH  interrupt
  721.                 vectors.   While it  is true that replacing these vectors
  722.                 with  your   own  handler   can  prevent  the  user  from
  723.                 terminating the program by pressing Ctrl-C or Ctrl-Break,
  724.                 what do you do about the annoying, unesthetic ^C that DOS
  725.                 puts on the screen?
  726.  
  727.                 One method  of preventing  the ^C  from appearing  on the
  728.                 screen is  to locate  the hardware  cursor at  some  non-
  729.                 displayed location  like row  26.   This  strategy  works
  730.                 great until  you either  want  to  display  the  hardware
  731.                 cursor or use a DOS screen output function.
  732.  
  733.                 BACKGROUND
  734.  
  735.                 An int  21H generally  causes internal  DOS  housekeeping
  736.                 code to  check the  next available  key in  the  keyboard
  737.                 buffer, using  the BIOS interrupt 16H function 1.  If the
  738.                 next available  keycode is 2e03H (the scan and ASCII code
  739.                 for Ctrl-C), or the DOS Ctrl-Break flag is 3 (more on the
  740.                 flag in a minute), DOS puts the ^C on the screen, flushes
  741.                 the keyboard  buffer, switches  to the user stack, clears
  742.                 the carry flag, and executes interrupt 23H.
  743.  
  744.                 Among other  things, the  default interrupt  23H  handler
  745.                 flushes the  file buffers using function 0dH of interrupt
  746.                 21H.   The 23H  handler then  sets  the  carry  flag  and
  747.                 returns with a RET 2.  When the housekeeping code regains
  748.                 control, it uses the carry flag to determine if it should
  749.                 terminate the  process (function 4cH of interrupt 21H) or
  750.                 continue with  the execution of the interrupted function.
  751.                 If your  application keeps  the typeahead buffer empty by
  752.                 using BIOS  function calls, DOS may never get a chance to
  753.                 see a  CTRL-C.   However, a  user might  still be able to
  754.                 sneak one  in, especially  if your  application makes DOS
  755.                 function calls that write to the screen.
  756.  
  757.  
  758.  
  759.  
  760.  
  761.             _________________________________________________________________
  762.                        Copyright 1990 Trendtech Corporation, Inc.
  763.  
  764.  
  765.  
  766.                                                                       Page 14
  767.                                                 CTRLCLIB - The Ctrl+C Library
  768.  
  769.                 Ctrl-Break is  recognized within  the  keyboard  hardware
  770.                 interrupt, BIOS int 9.  When int 9 detects the Ctrl-Break
  771.                 key combination,  code within  interrupt 9  first flushes
  772.                 the keyboard  buffer and  then executes an interrupt 1bH.
  773.                 By default,  the code  pointed to  by the  interrupt  1bH
  774.                 vector contains only two instructions:
  775.  
  776.                       MOV  CS:[FLAG],3
  777.                       IRET
  778.  
  779.                 The  first   instruction  sets  the  internal  DOS  flag,
  780.                 mentioned  earlier,   to  indicate  Ctrl-Break  has  been
  781.                 pressed.     The  IRET   returns  to  the  BIOS  keyboard
  782.                 interrupt. DOS  examines the internal DOS flag during its
  783.                 housekeeping code  to determine  if Ctrl-Break  has  been
  784.                 pressed.  If the internal DOS flag equals 3, DOS runs the
  785.                 same code that executes when Ctrl-C is detected.  A quick
  786.                 session with Debug shows that if you set the internal DOS
  787.                 flag byte  to 3,  DOS places  the ^C on the screen at the
  788.                 current cursor  location and  executes an INT 23H.  Since
  789.                 the DOS interrupt 1bH handler is called from the keyboard
  790.                 hardware interrupt,  it must  be  replaced  in  order  to
  791.                 prevent Ctrl-Break  from displaying  ^C  on  the  screen.
  792.                 Flagging Ctrl-Break is an asynchronous event.  Therefore,
  793.                 Ctrl-Break  may  interrupt  a  program's  execution  when
  794.                 Ctrl-C won't.   For  Ctrl-C to  be recognized, the Ctrl-C
  795.                 keycode has to be at the head of the keyboard buffer when
  796.                 the DOS housekeeping process is executing.  Ctrl-Break on
  797.                 the other  hand, immediately  sets the internal DOS break
  798.                 flag, which  will  be  checked  the  next  time  the  DOS
  799.                 housekeeping process is executed.
  800.  
  801.                 Following is  the pseudocode for the section of interrupt
  802.                 21H which  does the  checking for  Ctrl-C and Ctrl-Break.
  803.                 FLAG is the DOS internal variable interrupt 1bH sets to 3
  804.                 and NEXT_KEY is the value returned in AX by interrupt 16H
  805.                 function 1.
  806.  
  807.                  if FLAG equals 3 OR NEXT_KEY equals CTRL_C then
  808.                       print "^C"
  809.                       flush keyboard buffer
  810.                       switch to user stack
  811.                       clear carry flag
  812.                       execute INT 23h
  813.                       change back to DOS stack
  814.                       if (carry set) then
  815.                            terminate program
  816.                       else
  817.  
  818.  
  819.  
  820.             _________________________________________________________________
  821.                        Copyright 1990 Trendtech Corporation, Inc.
  822.  
  823.  
  824.  
  825.                                                                       Page 15
  826.                                                 CTRLCLIB - The Ctrl+C Library
  827.  
  828.                            continue interrupted DOS function
  829.                       endif
  830.  
  831.                 In the  BIOS System  Data Area  you can  find a  byte  at
  832.                 40:71H called  the Break  Flag.  According to the comment
  833.                 in the  BIOS listing,  this byte flag will have bit 7 set
  834.                 by the  BIOS interrupt 9 handler when Ctrl-Break has been
  835.                 pressed and  the BIOS  listing for  interrupt  9  clearly
  836.                 shows bit 7 being set.  If you explore the BIOS code with
  837.                 Debug you'll  see that  once set, bit 7 is never cleared.
  838.                 The BIOS  Break Flag  is ignored  by DOS.   Once  set  by
  839.                 interrupt 9, it stays set.
  840.  
  841.                 [David then  describes his implementation of a Ctrl-c and
  842.                 Ctrl-Break  handler   written  in   assembler.    David's
  843.                 approach is  to override  the INT16H  keyboard handler to
  844.                 solve the ^C problem.]
  845.  
  846.                 A SOLUTION
  847.                  [In summary], you [can] replace the interrupt 1bH vector
  848.                 with an  IRET instruction  to prevent DOS from displaying
  849.                 the ^C  on the screen when Ctrl-Break is pressed, and DOS
  850.                 won't even  know it happened.  Ctrl-C, on the other hand,
  851.                 involves hiding from DOS the Ctrl-C returned by the BIOS.
  852.                 There are  advantages to  filtering the  return values of
  853.                 interrupt 16H  as a  means of  controlling Ctrl-C.   As I
  854.                 demonstrated, the  ^C won't  show up  on the screen.  You
  855.                 can have  a  flag  set  for    your  favorite  high-level
  856.                 language to  examine, or  with a  little more effort, you
  857.                 can convert Ctrl-C for use as a valid key combination for
  858.                 your application.  You have control!
  859.  
  860.             -----------------
  861.             Reprinted by permission from TECH Specialist,
  862.             vol. 1, no. 3, August 1990, for Trendtech Corporation.
  863.             Copyright 1990 by R&D Publications, 2601 Iowa Street,
  864.             Lawrence, KS 66046  (913) 841-1631.
  865.  
  866.  
  867.             [Biography]:
  868.                  David Burki  is a  consultant and author.  He specializes in
  869.             systems and application software design and development under MS-
  870.             DOS  using  C  and  Assembly  language.    Projects  include  the
  871.             development of  a sales  analysis database  for a  major chemical
  872.             company  and   the  design   and   development   of   a   quality
  873.             assurance/patient tracking  database for trauma center hospitals.
  874.             David may be contacted through us; call (201) 694-8622.
  875.  
  876.  
  877.  
  878.  
  879.             _________________________________________________________________
  880.                        Copyright 1990 Trendtech Corporation, Inc.
  881.  
  882.  
  883.  
  884.                                                                       Page 16
  885.                                                 CTRLCLIB - The Ctrl+C Library
  886.  
  887.             4.4 Our Solution - an Intelligent INT09
  888.  
  889.                  We've taken  a different  approach to solving the control-c,
  890.             control-break, and  "^C" print  problem.   The gem of CTRLCLIB is
  891.             our implementation of an INT09H keyboard handler.  In addition to
  892.             detecting Ctrl-C  and other  keystrokes,   plus the "broadsiding"
  893.             keystrokes that  cause the insidious "^C" characters to appear in
  894.             STDOUT,  our INT09H implementation also handles most of the other
  895.             features and  functions of  CTRLCLIB.   The communications device
  896.             between the  various functions  and our  keyboard  handler  is  a
  897.             control structure  contained in  a "header"  file called CTRLC.H.
  898.             Our INT09H  handler will  intercept only  the keystrokes you want
  899.             trapped based  on CTRLCLIB  functions  your  application  program
  900.             calls and  the flag  settings they  communicated to  the  control
  901.             structure.
  902.  
  903.                  We chose  to use INT09H over INT16H so that we could provide
  904.             software developers  with absolute  control over  the behavior of
  905.             their programs.   Many  TSR's trap  INT09 looking for their "hot"
  906.             keys.   This allows  the TSR  to manipulate the keystrokes BEFORE
  907.             your program  gets them.   If  you implemented  INT16H to capture
  908.             critical keystrokes, you couldn't be sure what was done with them
  909.             before your  handler intercepted  them.   That's not  to say that
  910.             some future TSR might use functions from CTRLCLIB;  nevertheless,
  911.             since your  application is  normally  loaded  AFTER  TSR's,  your
  912.             program would STILL get first crack at the users' keystrokes.  We
  913.             think this is what you want.
  914.  
  915.  
  916.             5. USING CTRLCLIB  EFFECTIVELY
  917.  
  918.             5.1 Technicals
  919.  
  920.                  CTRLCLIB supports  PC/MS-DOS for  the IBM PC/XT/AT, PS/2 and
  921.             80286 and  80386 compatibles.     However, you'll need one of the
  922.             following compilers so your application can take advantage of the
  923.             benefits available in the Library:
  924.  
  925.                  Microsoft C
  926.                  Microsoft Quick C
  927.                  Borland Turbo C and C++
  928.  
  929.                  CTRLCLIB is  written entirely in "C"; there is absolutely NO
  930.             assembly language for you to fool with.  You just need one of the
  931.             C-compilers  mentioned  above  to  take  full  advantage  of  the
  932.             functions in CTRLCLIB.
  933.  
  934.  
  935.  
  936.  
  937.  
  938.             _________________________________________________________________
  939.                        Copyright 1990 Trendtech Corporation, Inc.
  940.  
  941.  
  942.  
  943.                                                                       Page 17
  944.                                                 CTRLCLIB - The Ctrl+C Library
  945.  
  946.             5.2 Operation
  947.  
  948.                  Simply include the functions you need in your source code at
  949.             compile-time, plus  CTRLCLIB that's specific to your compiler and
  950.             memory model size at link-time.  That's all there is to it.
  951.  
  952.  
  953.  
  954.             5.3 Using Library Functions
  955.  
  956.                  The easiest  way to implement interrupt management functions
  957.             from CTRLCLIB  is with  a single  call to  the CtrlcLibSetup(...)
  958.             function placed  at the  beginning of  your program.  You specify
  959.             the traps  and interrupts  that your application is to control by
  960.             writing their  CONSTANT names  and "OR'ing"  them together  as  a
  961.             single argument to the CtrlcLibSetup() function call.
  962.  
  963.                  Example:
  964.  
  965.                            CtrlcLibSetup( FCTRLC | PAUSEKEY | PRINTSCREEN )
  966.  
  967.                  The  function   call  to   CtrlcLibSetup()  given   in  this
  968.             particular example  will extend   full  control over the Control-
  969.             Break/Control-C   program   termination   keypresses,   including
  970.             accidental keypresses  of Control-2  or ALT-3  (which also  cause
  971.             program termination).   Additionally, it will automatically reset
  972.             the PAUSE  flag when the keyboard PAUSE key (CTRL+NUMLOCK on some
  973.             keyboards) is  pressed, and  deactivate  the  Print  Screen  key.
  974.             That's it. One function call.
  975.  
  976.                  You'll  also  want  to  make  sure  all  of  the  traps  and
  977.             interrupts that  your program  sets are  cleared  before  program
  978.             termination.     This  can   be  done   with  a  single  call  to
  979.             CtrlcLibCleanup().  This function will look through the interrupt
  980.             management control  structure and  reset all traps and interrupts
  981.             that it finds were previously set by the CtrlcLibSetup() function
  982.             call.   This is  important  because  if  your  program  does  not
  983.             properly reset  some interrupt  vectors when  it terminates,  the
  984.             interrupt vectors will be pointing to an area of memory which may
  985.             no longer contain the altered vector's code.  In most cases, this
  986.             will "hang" the user's system.  The only solution is a cold-boot.
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.             _________________________________________________________________
  998.                        Copyright 1990 Trendtech Corporation, Inc.
  999.  
  1000.  
  1001.  
  1002.                                                                       Page 18
  1003.                                                 CTRLCLIB - The Ctrl+C Library
  1004.  
  1005.  
  1006.  
  1007.             5.4 The Interrupt Management Control Structure
  1008.  
  1009.                  Communication  between   the  installed   interrupts,  other
  1010.             CTRLCLIB functions,  and your application program is accomplished
  1011.             by setting  values in  a control structure which is #include'd in
  1012.             your program  at  compile  time.    You  don't  set  values,  the
  1013.             functions you  call from  CTRLCLIB do.  The header file is called
  1014.             CTRLC.H and  must be  included in  any source  module which calls
  1015.             functions from  CTRLCLIB.   Additionally, the source module which
  1016.             defines and  initializes the  variables are  contained in  module
  1017.             CL_COMM.C.   There's no  need to  add any special code to get the
  1018.             functions to work.
  1019.  
  1020.  
  1021.             5.5 Code Examples
  1022.  
  1023.                  The following  example shows  the minimum  code  needed  for
  1024.             using functions from CTRLCLIB:
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.             _________________________________________________________________
  1057.                        Copyright 1990 Trendtech Corporation, Inc.
  1058.  
  1059.  
  1060.  
  1061.                                                                       Page 19
  1062.                                                 CTRLCLIB - The Ctrl+C Library
  1063.  
  1064.  
  1065.             Main source module:
  1066.  
  1067.  
  1068.                       #include <stdio.h>
  1069.                       #include "ctrlc.h"   /* required header */
  1070.  
  1071.                       main()
  1072.                            {
  1073.                            CtrlcLibSetup( FCTRLC | CTRLP | PAUSEKEY );
  1074.                                      .
  1075.                                      .
  1076.                                      .  (your application code)
  1077.                                      .
  1078.                            if (program_error())
  1079.                                 {
  1080.                                 CtrlcLibCleanup();
  1081.                                 abort();
  1082.                                 }
  1083.                                      .
  1084.                                      .
  1085.                                      .
  1086.                            CtrlcLibCleanup();
  1087.                            exit(0);
  1088.                            }
  1089.  
  1090.  
  1091.             Subsequent source module:
  1092.  
  1093.  
  1094.                       #include "ctrlc.h"   /* required header */
  1095.  
  1096.                       int
  1097.                       program_error(void)
  1098.                           {
  1099.                                (more code)
  1100.                                     .
  1101.                                     .
  1102.                           if (QueryCtrlC() == CTRLC) /*user pressed ctrl-c*/
  1103.                                 return(1);     /*(these tests are optional)*/
  1104.                                      .
  1105.                                      .
  1106.                                      .
  1107.                           return(0);
  1108.                           }
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.             _________________________________________________________________
  1116.                        Copyright 1990 Trendtech Corporation, Inc.
  1117.  
  1118.  
  1119.  
  1120.                                                                       Page 20
  1121.                                                 CTRLCLIB - The Ctrl+C Library
  1122.  
  1123.             6. LIBRARY DISTRIBUTION
  1124.  
  1125.                  CTRLCLIB is  distributed on  floppy diskettes  for both  the
  1126.             Shareware version  and the  Registered version.   The  Registered
  1127.             version contains full source code and two additional memory model
  1128.             libraries.   This document  describes  both  versions.    Neither
  1129.             version contains ALL of the files listed below.
  1130.  
  1131.                  The Shareware  evaluation diskette  can be freely copied and
  1132.             shared.   The Registered,  number-serialized disks contain source
  1133.             code and  can not  be shared  or distributed.  In either case you
  1134.             receive a fully functional "bundled" product.  That is to say, we
  1135.             do not  require you  to order  a separate  disk for the Microsoft
  1136.             compiler, another  for the  Borland compiler, and so on.  You get
  1137.             ready-made libraries for all supported C compilers.
  1138.  
  1139.                  CTRLCLIB is  supported for  all the  C compilers we specify.
  1140.             This makes  porting your code from one compiler to another a very
  1141.             easy process.  It also helps to protect your application software
  1142.             development investment  while at  the  same  time  saving  you  a
  1143.             significant sum of money!
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.             _________________________________________________________________
  1175.                        Copyright 1990 Trendtech Corporation, Inc.
  1176.  
  1177.  
  1178.  
  1179.                                                                       Page 21
  1180.                                                 CTRLCLIB - The Ctrl+C Library
  1181.  
  1182.             6.1 The Shareware Disk
  1183.  
  1184.                  The Shareware version of CTRLCLIB is distributed on a single
  1185.             360k diskette.   It  contains libraries  for the small and medium
  1186.             models for  use with  the Microsoft  C compiler,   the  Microsoft
  1187.             Quick-C compiler, and Borland's Turbo-C and C++ compilers.
  1188.  
  1189.                  The Shareware disk contains the following files:
  1190.  
  1191.                  README.1ST     <- Latest information and what to do
  1192.                  MSC5SH.ZIP     <- Microsoft 5.1 archive library
  1193.                  MSC6SH.ZIP     <- Microsoft 6.0 archive library
  1194.                  QC25SH.ZIP     <- Microsoft Quick-C 2.5 archive library
  1195.                  TC20SH.ZIP     <- Borland Turbo-C 2.0  archive library
  1196.                  TCXXSH.ZIP     <- Borland Turbo-C++ 1.0 archive library
  1197.                  QUICKREF.DOC   <- Summary of function calls
  1198.                  CTRLCDOC.EXE   <- The User's Manual-self extracting
  1199.                  CLDEMO.EXE     <- Demo program
  1200.                  BOOTDEMO.EXE   <- System Reset demo program
  1201.                  CTRLC.H        <- CTRLCLIB header file
  1202.                  CLDEMO.C       <- Source code for Demo program
  1203.                  BOOTDEMO.C     <- Source code for reboot program
  1204.                  HISTORY.DOC    <- Revision history
  1205.                  REGISTER.FRM   <- Registration form
  1206.                  VENDOR.DOC     <- Distribution notes for disk vendors
  1207.                  SYSOP.DOC      <- Distribution notes for BBS sysops
  1208.  
  1209.  
  1210.                  Each ZIP  file contains two memory-model libraries, a 'MAKE'
  1211.             file for  building the  two demo  programs, and  a batch file for
  1212.             invoking the make program of your choice.
  1213.  
  1214.             Contents of MSC5SH.ZIP   (for Microsoft C Version 5.1)
  1215.                  COMPMSC5.BAT   <- Batch program to invoke MAKE
  1216.                  MSC5.MAK       <- MAKE file for Microsoft C 5.1 compiler
  1217.                  SMSC5CL.LIB    <- Ctrl+C Library - small memory model
  1218.                  LMSC5CL.LIB    <- Ctrl+C Library - large memory model
  1219.  
  1220.             Contents of MSC6SH.ZIP   (for Microsoft C Version 6.0)
  1221.                  COMPMSC6.BAT   <- Batch program to invoke MAKE
  1222.                  MSC6.MAK       <- MAKE file for Microsoft C 6.0 compiler
  1223.                  SMSC6CL.LIB    <- Ctrl+C Library - small memory model
  1224.                  LMSC6CL.LIB    <- Ctrl+C Library - large memory model
  1225.  
  1226.             Contents of QC25SH.ZIP   (for Microsoft Quick-C Version 2.5)
  1227.                  COMPQC25.BAT   <- Batch program to invoke MAKE
  1228.                  QC25.MAK       <- MAKE file for MS Quick-C 2.5 compiler
  1229.                  SQC25CL.LIB    <- Ctrl+C Library - small memory model
  1230.  
  1231.  
  1232.  
  1233.             _________________________________________________________________
  1234.                        Copyright 1990 Trendtech Corporation, Inc.
  1235.  
  1236.  
  1237.  
  1238.                                                                       Page 22
  1239.                                                 CTRLCLIB - The Ctrl+C Library
  1240.  
  1241.                  LQC25CL.LIB    <- Ctrl+C Library - large memory model
  1242.  
  1243.             Contents of TC20SH.ZIP   (for Borland Turbo-C Version 2.0)
  1244.                  COMPTC20.BAT   <- Batch program to invoke MAKE
  1245.                  TC20.MAK       <- MAKE file for Turbo C 2.0 compiler
  1246.                  STC20CL.LIB    <- Ctrl+C Library - small memory model
  1247.                  LTC20CL.LIB    <- Ctrl+C Library - large memory model
  1248.  
  1249.             Contents of TCXXSH.ZIP   (for Borland Turbo-C++ Version 1.0)
  1250.                  COMPTCXX.BAT   <- Batch program to invoke MAKE
  1251.                  TCXX.MAK       <- MAKE file for Turbo C++ 1.0 compiler
  1252.                  STCXXCL.LIB    <- Ctrl+C Library - small memory model
  1253.                  LTCXXCL.LIB    <- Ctrl+C Library - large memory model
  1254.  
  1255.             Contents of CTRLCDOC.EXE
  1256.                  CTRLCMAN.DOC   <- Complete User Guide and Reference Manual
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.             _________________________________________________________________
  1293.                        Copyright 1990 Trendtech Corporation, Inc.
  1294.  
  1295.  
  1296.  
  1297.                                                                       Page 23
  1298.                                                 CTRLCLIB - The Ctrl+C Library
  1299.  
  1300.             6.2 The Registered Source Disk
  1301.  
  1302.                  Registered  users  will  receive  a  number-serialized  disk
  1303.             containing the  full source code, plus  libraries for the compact
  1304.             and medium  memory-model for  supported compilers.  Additionally,
  1305.             the disk  will contain  batch and make files for compiling all of
  1306.             the source code and building each of the libraries.
  1307.  
  1308.                  The registered disk contains the following files:
  1309.  
  1310.                  README.2ND     <- Latest information and what to do
  1311.                  SERIAL.NBR     <- Registrant's serial number
  1312.                  LICENSE.DOC    <- Licensing information
  1313.                  MSC5REG.ZIP    <- Microsoft 5.1 additional archive library
  1314.                  MSC6REG.ZIP    <- Microsoft 6.0 additional archive library
  1315.                  QC25REG.ZIP    <- Microsoft Quick-C 2.5 additional library
  1316.                  TC20REG.ZIP    <- Borland Turbo-C 2.0  additional library
  1317.                  TCXXREG.ZIP    <- Borland Turbo-C++ 1.0 additional library
  1318.                  CLSOURCE.ZIP   <- The full source code archive
  1319.                  CTRLCDOC.EXE   <- The User's Guide-self extracting
  1320.                  HISTORY.DOC    <- Revision history
  1321.  
  1322.  
  1323.             Contents of CLSOURCE.ZIP
  1324.                  All source code for components of CTRLCLIB.
  1325.  
  1326.             Contents of CTRLCDOC.EXE
  1327.                  CTRLCMAN.DOC   <- Complete User Guide and Reference Manual
  1328.  
  1329.             Contents of MSC5REG.ZIP  (for Microsoft C Version 5.1)
  1330.                  CMSC5CL.LIB    <- Ctrl+C Library - compact memory model
  1331.                  MMSC5CL.LIB    <- Ctrl+C Library - medium memory model
  1332.  
  1333.             Contents of MSC6REG.ZIP  (for Microsoft C Version 6.0)
  1334.                  CMSC6CL.LIB    <- Ctrl+C Library - compact memory model
  1335.                  MMSC6CL.LIB    <- Ctrl+C Library - medium memory model
  1336.  
  1337.             Contents of QC25REG.ZIP  (for Microsoft Quick-C Version 2.5)
  1338.                  CQC25CL.LIB    <- Ctrl+C Library - compact memory model
  1339.                  MQC25CL.LIB    <- Ctrl+C Library - medium memory model
  1340.  
  1341.             Contents of TC20REG.ZIP  (for Borland Turbo-C Version 2.0)
  1342.                  CTC20CL.LIB    <- Ctrl+C Library - compact memory model
  1343.                  MTC20CL.LIB    <- Ctrl+C Library - medium memory model
  1344.  
  1345.             Contents of TCXXREG.ZIP  (for Borland Turbo-C++ Version 1.0)
  1346.                  CTCXXCL.LIB    <- Ctrl+C Library - compact memory model
  1347.                  MTCXXCL.LIB    <- Ctrl+C Library - medium memory model
  1348.  
  1349.  
  1350.  
  1351.             _________________________________________________________________
  1352.                        Copyright 1990 Trendtech Corporation, Inc.
  1353.  
  1354.  
  1355.  
  1356.                                                                       Page 24
  1357.                                                 CTRLCLIB - The Ctrl+C Library
  1358.  
  1359.  
  1360.  
  1361.  
  1362.             7. INSTALLING CTRLCLIB
  1363.  
  1364.  
  1365.  
  1366.             7.1 Installation
  1367.  
  1368.  
  1369.                  1) Please! MAKE A BACKUP OF ALL DISKS before you do anything
  1370.                     else!!!
  1371.  
  1372.                  2) For installation on a hard drive, make a directory called
  1373.                     \CTRLC and copy the files from both diskettes to it.
  1374.                     Important files do NOT have duplicate names; even the
  1375.                     readme's are different.
  1376.  
  1377.                  2) a. SHAREWARE diskette  - Use PKUNZIP to unarchive the
  1378.                     various ZIP files.  There is a ZIP file for each
  1379.                     supported compiler.  You will need about 400k of free
  1380.                     disk space for all of the files!  Alternatively you can
  1381.                     extract only those files you need for use with a specific
  1382.                     compiler.  Simply use PKUNZIP to extract the files from
  1383.                     each xxxxSH.ZIP file, for example:
  1384.  
  1385.                           C> A:PKUNZIP E A:MSC5SH  SMSC5CL.LIB
  1386.  
  1387.                     gets you the small model library for the Microsoft C
  1388.                     Version 5.1 compiler.  These library files contain the
  1389.                     SMALL and LARGE models.
  1390.  
  1391.                     b. REGISTERED Source Code diskette  - Use PKUNZIP to
  1392.                     unarchive SOURCE.ZIP.  Then, depending upon the compiler
  1393.                     and memory model you intend to use, unarchive one or more
  1394.                     of the following ZIP'd library files: MSC5REG.ZIP,
  1395.                     MSC6REG.ZIP, QC25REG.ZIP, TC20REG.ZIP, or TCXXREG.ZIP. If
  1396.                     you plan on unarchiving all of the compiler specific ZIP
  1397.                     files you will need approximately 800K of free disk
  1398.                     space!  These library files contain the MEDIUM and
  1399.                     COMPACT models.
  1400.  
  1401.                  3) Copy the Library that corresponds to the compiler and
  1402.                     memory model you are using onto the disk partition and
  1403.                     directory that you usually use with your "C" compiler.
  1404.                     The .LIB file should be on the same disk partition and
  1405.                     directory that the "C" runtime libraries are on.
  1406.  
  1407.  
  1408.  
  1409.  
  1410.             _________________________________________________________________
  1411.                        Copyright 1990 Trendtech Corporation, Inc.
  1412.  
  1413.  
  1414.  
  1415.                                                                       Page 25
  1416.                                                 CTRLCLIB - The Ctrl+C Library
  1417.  
  1418.                  4) Remember there is no magic to using CTRLCLIB to make your
  1419.                     programs user-proof.  Just a few simple steps is all you
  1420.                     need.
  1421.  
  1422.  
  1423.             7.2 Compiling
  1424.  
  1425.                  Compile your  source code  using whichever method suites you
  1426.             best.  If you're using an integrated development environment or a
  1427.             programmers workbench  make sure  you specify  the  path  to  the
  1428.             CTRLC.H header file.  If you're using the full compiler with MAKE
  1429.             files make  sure your  environment  variables  and/or  make  file
  1430.             macros point  to the path where CTRLC.H and the .LIB files can be
  1431.             found.
  1432.  
  1433.  
  1434.             7.3 Linking
  1435.  
  1436.                    Simply specify the xxxxCL.LIB file that corresponds to the
  1437.             compiler/memory model  you are  using.   Don't forget  to include
  1438.             your compilers  runtime library  as well.  The following examples
  1439.             demonstrate basic linking using the small model library.
  1440.  
  1441.               Microsoft (C & Quick C):
  1442.               link cldemo,cldemo,,smsc5cl
  1443.  
  1444.               Borland Turbo C:
  1445.               tlink /c c0s cldemo,cldemo,cldemo,stc20cl emu maths cs
  1446.  
  1447.  
  1448.  
  1449.             8. GENERAL NOTES
  1450.  
  1451.                  It is  important here  to note  that  when  you  incorporate
  1452.             functions from  CTRLCLIB into  your program that you do so at the
  1453.             end of  your development  and debugging  cycle.   Functions  from
  1454.             CTRLCLIB should  be activated  when you  are confident  that your
  1455.             program will  run without aborting or terminating abnormally.  It
  1456.             this happens,  and your  program has  not restored  the interrupt
  1457.             handlers, you  will almost  ALWAYS have  to  reboot  your  system
  1458.             because it  will "hang".   You  can save  a significant amount of
  1459.             development time if you locate in your source code where you want
  1460.             to place calls to functions in CTRLCLIB and then comment them out
  1461.             so they won't compile.  Remove the comments when you are ready to
  1462.             ENABLE or DISABLE the interrupt handlers.
  1463.  
  1464.                  One of  the benefits  of using  functions from  CTRLCLIB  is
  1465.             interrupt feedback.   By  placing critical tests in your keyboard
  1466.  
  1467.  
  1468.  
  1469.             _________________________________________________________________
  1470.                        Copyright 1990 Trendtech Corporation, Inc.
  1471.  
  1472.  
  1473.  
  1474.                                                                       Page 26
  1475.                                                 CTRLCLIB - The Ctrl+C Library
  1476.  
  1477.             input routines  you  can  detect  user-initiated  interrupts.  We
  1478.             suggest your program ALWAYS test for the break keys and allow the
  1479.             user a  graceful exit from your program.  Try to sense the user's
  1480.             need to exit quickly and provide feedback to them.  Tell them for
  1481.             example: "CTRL-C  detected -  cleaning up"  and then  allow  your
  1482.             program  to  perform  its  cleanup  functions  such  as  emptying
  1483.             buffers, closing  files, and  freeing memory.   You give the user
  1484.             what they want - a quick exit -  but, under your full control.
  1485.  
  1486.                  Complete management  of, and communications between CTRLCLIB
  1487.             functions is  handled by variables declared in the CTRLC.H header
  1488.             file.   This is  how various  functions in  the library can track
  1489.             interrupts that  have been  installed.   It is  not advisable  to
  1490.             allow your  program to manipulate the contents of these variables
  1491.             directly.   The user  of your  application program may find their
  1492.             systems "hung"  at termination time because your program modified
  1493.             something that  the interrupt management functions needed to know
  1494.             about to properly reset an interrupt vector.
  1495.  
  1496.                  If you  are upgrading from a previous version of CTRLCLIB be
  1497.             sure to  re-compile and re-link all of the source modules in your
  1498.             application that  call functions  from the  Library.   This  will
  1499.             eliminate the possibility of any "unusual" problems.
  1500.  
  1501.                  The libraries  were created  on an  AST 386/20 under DOS 3.3
  1502.             using  Microsoft   5.1,  Microsoft  6.0,  Microsoft  QuickC  2.5,
  1503.             Borland's Turbo  C 2.0,  and Turbo-C++  1.0.  Each compiler's own
  1504.             "LIB" facility  was used  to create each associated library.  The
  1505.             test hardware  included the  following: AST 386/20, IBM PC/XT/AT,
  1506.             DELL 386/25.  Additionally, a wide variety of clones (8088, 8086,
  1507.             80186, 80286,  80386) with  brand name and noname components were
  1508.             also tested.
  1509.  
  1510.  
  1511.             8.1 Borland Turbo C Notes
  1512.  
  1513.                  Integrated  Development   Environment  users  should  create
  1514.             PROJECT files  in order  to be able to create executable programs
  1515.             from within  the IDE.  The PROJECT file must contain the names of
  1516.             all of  the programs  that comprise  the application  along  with
  1517.             specific entries  for all  third party  libraries being used.  In
  1518.             the  case   of  third   party  libraries,   the   complete   path
  1519.             specification  for   the   library   must   be   provided   (e.g.
  1520.             c:\tc\lib\stc20cl.lib).
  1521.  
  1522.                  The control-c  keystrokes will not be recognized by signal()
  1523.             and ctrlbrk().   However,  since your  program will  get feedback
  1524.  
  1525.  
  1526.  
  1527.  
  1528.             _________________________________________________________________
  1529.                        Copyright 1990 Trendtech Corporation, Inc.
  1530.  
  1531.  
  1532.  
  1533.                                                                       Page 27
  1534.                                                 CTRLCLIB - The Ctrl+C Library
  1535.  
  1536.             from functions in CTRLCLIB if these keys are pressed, it won't be
  1537.             necessary to use these standard library functions.
  1538.  
  1539.                  If your  testing your program within the IDE environment you
  1540.             should comment  out any  CTRLCLIB functions  since their  use can
  1541.             cause unpredictable  results in  these environments.  When you're
  1542.             ready to  test your program as a stand-alone (i.e. outside of the
  1543.             IDE environment) - then you can un-comment the functions.
  1544.  
  1545.  
  1546.             8.2 Microsoft C Notes
  1547.  
  1548.                  Microsoft  Version   5.1  and  Version  6.0  libraries  were
  1549.             generated using  the "/Zl"  command line  parameter. This  should
  1550.             insure compatibility with previous versions of the compiler.
  1551.  
  1552.  
  1553.             8.3 Microsoft QuickC Notes
  1554.  
  1555.                  Quick-C Programming  Environment users  should  create  MAKE
  1556.             files in  order to  be able  to create  executable programs  from
  1557.             within the  Programming Environment.   The MAKE file must contain
  1558.             the names  of all  of the  programs that comprise the application
  1559.             along with  specific entries  for all third party libraries being
  1560.             used.
  1561.  
  1562.  
  1563.             8.4 MS-DOS Notes
  1564.  
  1565.                  The CtrlC()  function is  a superset  function and  includes
  1566.             trapping CTRL+BREAK;  however, the  code returned by QueryCtrlC()
  1567.             is ALWAYS  "CTRLC" because  CTRL+BREAK generates  a ^C  character
  1568.             which DOS  gets a  hold of  and indicates   a 'break'.  ALSO note
  1569.             that the  infamous ^C characters are printed on the screen by DOS
  1570.             when using  PRINTF in  C.   If you  want to prevent this, use the
  1571.             FullCtrlC() function.
  1572.  
  1573.                  Disabling CTRL+BREAK *ONLY* will NOT disable CTRL+C.  Typing
  1574.             a CTRL+C  (or CTRL+2)  on the  keyboard will definitely break the
  1575.             user out of your program and NOT restore the CTRL+BREAK interrupt
  1576.             vector.   Note too  that if your program only disables CTRL+BREAK
  1577.             and the  user presses CTRL+BREAK, the interrupt will NOT generate
  1578.             the infamous  ^C on  the  screen  as  CTRL+C  will  do.  However,
  1579.             pressing CTRL+C  with just  the CTRL+BREAK handler installed will
  1580.             generate the  ^C and  return the  user to DOS and hang the users'
  1581.             system because  the  CTRL+BREAK  vector  will  NOT  get  properly
  1582.             restored.
  1583.  
  1584.  
  1585.  
  1586.  
  1587.             _________________________________________________________________
  1588.                        Copyright 1990 Trendtech Corporation, Inc.
  1589.  
  1590.  
  1591.  
  1592.                                                                       Page 28
  1593.                                                 CTRLCLIB - The Ctrl+C Library
  1594.  
  1595.  
  1596.  
  1597.             8.5 General Caveats
  1598.  
  1599.             8.5.1 Keyboard Idiosyncrasies
  1600.  
  1601.                  Some of  the following problems and idiosyncrasies that were
  1602.             reported by  alpha and  beta testers  during development  of this
  1603.             library.   We report  them here  because they  are not mainstream
  1604.             problems,  but   rare  oddities  and  quirks  unique  to  certain
  1605.             keyboards.   If you're concerned about these, remember - when you
  1606.             register, you'll  get full  source code to work with so you'll be
  1607.             able to program for these oddities.
  1608.  
  1609.                  Tandy computers  and keyboards  of the TL and TX models seem
  1610.             to be  a real  problem.   With a third party video card installed
  1611.             and the  IEMSEMM.SYS EMS  driver installed,  the machine will not
  1612.             respond to  the CTRL+ALT+DEL  reboot.   Additionally, the machine
  1613.             will not  respond to  a programmed reboot (SystemReset function).
  1614.             If the  video card  is removed and the default hardwired TANDY 16
  1615.             color is  used with  a CGA  monitor and  EMS driver  removed then
  1616.             CTRL+ALT+DEL works fine as well as the internal system reset call
  1617.             (SystemReset  function).     This   code  won't   work  with  the
  1618.             IEMSEMM.SYS EMS  driver installed.   The  machine will get to the
  1619.             point where  it tries to load the driver then hangs.  This may be
  1620.             a problem with this particular EMS driver.  The following code is
  1621.             needed to make the machine reboot with EGA:
  1622.                  
  1623.                  mov bx,1234
  1624.                  mov ax,0040'
  1625.                  mov ds,ax
  1626.                  mov [0072],bx
  1627.                  jmp f000:e465
  1628.  
  1629.  
  1630.                  The Tandy  keyboard (as well as some others) has "hardwired"
  1631.             LED lights.   That  is, they  respond only when the lock keys are
  1632.             physically pressed.   They  don't respond programmatically to the
  1633.             setting of  the keyboard flags in the BIOS.  If your program uses
  1634.             the lock  key functions there is no guarantee that the LED status
  1635.             will reflect your programmed setting.  However, the functionality
  1636.             will be  there.   i.e. if  you set a lock key to L_ON, it will be
  1637.             on, and the keystroke entered will reflect the status of the lock
  1638.             key - Capital A with caps lock set to L_ON, etc.  even though the
  1639.             LED light may be off.
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.             _________________________________________________________________
  1647.                        Copyright 1990 Trendtech Corporation, Inc.
  1648.  
  1649.  
  1650.  
  1651.                                                                       Page 29
  1652.                                                 CTRLCLIB - The Ctrl+C Library
  1653.  
  1654.                  Apparently some  models of  TANDY don't have a PAUSE key and
  1655.             the CTRL+NUMLOCK  keys won't  pause the  system either.  The HOLD
  1656.             button acts like the pause key and can be trapped.
  1657.  
  1658.                  There are  several other  keyboards that  act the  same way.
  1659.             Also, we found that the user can defeat the use of the L_ALWAYSON
  1660.             setting.   For example, if your program sets the caps lock key to
  1661.             L_ALWAYSON, the  user can  type lower case characters by pressing
  1662.             and HOLDING  DOWN the  SHIFT keys  to type lower case characters.
  1663.             This is normal procedure anyway since the keyboard was engineered
  1664.             to respond that way.
  1665.  
  1666.                  The Heathkit  H-150 has  the same problems as the Tandy with
  1667.             regard to the pause keys and keyboard LED lights.
  1668.  
  1669.                  One tester  reported the  PRINTSCREEN  key  on  a  Northgate
  1670.             OmniKey/Plus had  to be  pressed  twice  to  get  the  CLDEMO.EXE
  1671.             program (Test  9,10,11) to  respond.   This may be a problem with
  1672.             the demo  program , but the functionality of blocking PRINTSCREEN
  1673.             will still  be preserved.  Although another user with a Northgate
  1674.             didn't report the problem.  This problem did not occur on DELL or
  1675.             AST extended keyboards.
  1676.  
  1677.                  Early DELL computers with the PHOENIX bios has a bug in the
  1678.             way the mode lights are handled by the controller.  When your
  1679.             program sets the NUMLOCK to "L_ALWAYSON" you will ALWAYS get a
  1680.             number returned when any keypad number key is pressed.  HOWEVER,
  1681.             if you press the NUMLOCK key, the light goes out!  And - you will
  1682.             still get numerics from keypad keypresses.  These subsequent
  1683.             keypresses will turn the mode light back on.  Even though the
  1684.             mode lights are messed up - the program functionality is
  1685.             retained.
  1686.  
  1687.             8.5.2 Virtual Control Programs
  1688.  
  1689.             8.5.2.1 WINDOWS, DESQview, VM386, OS/2, et al
  1690.  
  1691.                  There are some important functions provided by CTRLCLIB that
  1692.             simply will not work under some or all of these types of control
  1693.             programs.  Applications will run as sub-tasks under these multi-
  1694.             tasking systems, so if they use functions from CTRLCLIB there's
  1695.             no guarantee that they will work properly.  This is because some
  1696.             of the more powerful functions like capturing control-c, blocking
  1697.             ctrl-alt-delete, etc. are controlled by our INT09 ISR (Interrupt
  1698.             Service Routine). Many control programs reset their ISR's if
  1699.             they've found to be replaced which means the functionality is
  1700.             lost to a certain extent because they are usually replaced with
  1701.             an equivalent provided by the control program.
  1702.  
  1703.  
  1704.  
  1705.             _________________________________________________________________
  1706.                        Copyright 1990 Trendtech Corporation, Inc.
  1707.  
  1708.  
  1709.  
  1710.                                                                       Page 30
  1711.                                                 CTRLCLIB - The Ctrl+C Library
  1712.  
  1713.  
  1714.                  Under Microsoft Windows, virtually all of the key sequences
  1715.             that can be captured and blocked by functions in CTRLCLIB are
  1716.             already suitably controlled by Windows.  However, the LOCK keys
  1717.             can still be controlled.
  1718.  
  1719.                  Under DESQview, the CTRL+ALT+DEL reboot sequence is captured
  1720.             and serves to close the current window.  The CTRL+NUMLOCK
  1721.             sequence, which is the PAUSE on XT keyboards but not on extended
  1722.             keyboards will still PAUSE the system under DESQview.
  1723.  
  1724.                  The CTRL+ALT+DEL sequence trap does not appear to work when
  1725.             running the CLDEMO program in a DOS box under Windows.
  1726.  
  1727.  
  1728.             8.5.3 Other Caveats
  1729.  
  1730.             8.5.3.1 TSR's
  1731.  
  1732.             o    There is  a minor  problem with  the Shareware  TSR  program
  1733.             called "CTRLALT".   When "popped up", CTRLALT modifies the keypad
  1734.             such that  ALT+1 produces  a lower left box character (equivalent
  1735.             to ALT+192;  ALT+2 is  the lower  line, and  ALT+3 is  the  right
  1736.             corner.  With your program loaded and running with full control-c
  1737.             suppression   (function FullCtrlC),   ALT+3  keypress will not be
  1738.             passed to CTRLALT to draw the lower right corner.
  1739.  
  1740.             o    The use  of a  TSR called KBFIX produces interesting results
  1741.             in TEST  16 of  the CLDEMO program.  If you press ScrollLock, the
  1742.             system pauses.   Then,  if you  press Enter  a few  times nothing
  1743.             happens.   When you  press  ScrollLock  again,  the  Enter's  get
  1744.             released all at once which appears to be KBFIX's normal behavior.
  1745.  
  1746.             o    Regarding controlling  of the CapsLock, NumLock, ScrollLock,
  1747.             and such,  popping into  SIDEKICK PLUS  allows one to release the
  1748.             locks (by  pressing their  keys *twice*).    With  CapsLock,  for
  1749.             example, you  can pop  back down  to CLDEMO,  press the letter  a
  1750.             key and  get a  lower-case   "a" echoed  to the  screen.  At that
  1751.             point, the CapsLock light does go back on again.
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.             NOTE: Please  remember -  these caveats  were reported when using
  1758.             the demo  program.   The demo  program was  especially set  up to
  1759.             provide feedback  to the  evaluator.   Except for  some  physical
  1760.  
  1761.  
  1762.  
  1763.  
  1764.             _________________________________________________________________
  1765.                        Copyright 1990 Trendtech Corporation, Inc.
  1766.  
  1767.  
  1768.  
  1769.                                                                       Page 31
  1770.                                                 CTRLCLIB - The Ctrl+C Library
  1771.  
  1772.             keyboard design  problems, NO  CTRL+C  LIBRARY  FUNCTIONALITY  IS
  1773.             LOST!  You can use each function for its intended purpose.
  1774.  
  1775.  
  1776.  
  1777.             8.6 Making Changes
  1778.  
  1779.                  Incorporating local  modifications or  enhancements  is,  in
  1780.             part, why  you acquired  the source  code for  CTRLCLIB to  begin
  1781.             with.  Incorporating your modifications or enhancements should be
  1782.             a relatively  straight forward task.  Please study and understand
  1783.             the code  before attempting  modifications.   Remember there is a
  1784.             lot of communication going on between the functions.
  1785.  
  1786.                  If you  feel you  have developed  a significant  enhancement
  1787.             that would  be useful  and is  well written and documented please
  1788.             let us  know.   We  have  often  incorporated  customer  supplied
  1789.             enhancements to our products.  Contact us for further details.
  1790.  
  1791.  
  1792.  
  1793.             8.7 Feedback
  1794.  
  1795.                  PLEASE -  Pass along  your comments  to us.   CTRLCLIB  is a
  1796.             powerful tool  for making your application programs "user-proof".
  1797.             If you  find any  logic errors  please  let  us  know.    We  are
  1798.             committed to  making CTRLCLIB   a  standard "tool"  in the MS-DOS
  1799.             programmer's toolbox at the best price available.  If you have an
  1800.             idea for a new function or a way to improve an existing one, then
  1801.             please call,  write, fax,  or if you prefer, you can reach us via
  1802.             CompuServe.   Our CompuServe  electronic mail  ID is [76210,771].
  1803.             We will  consider all  requests and  ideas.   Lastly, if  you use
  1804.             CTRLCLIB, register  your copy  and get  the complete source code.
  1805.             The Shareware System will only work if you support it!
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.             _________________________________________________________________
  1824.                        Copyright 1990 Trendtech Corporation, Inc.
  1825.  
  1826.  
  1827.  
  1828.                                                                       Page 32
  1829.                                                 CTRLCLIB - The Ctrl+C Library
  1830.  
  1831.             9. FUNCTION CALL REFERENCE SECTION
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.                                 CTRLCLIB - Function Calls
  1856.  
  1857.  
  1858.  
  1859.  
  1860.                                  (listed alphabetically)
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.             _________________________________________________________________
  1883.                        Copyright 1990 Trendtech Corporation, Inc.
  1884.  
  1885.  
  1886.  
  1887.                                                                       Page 33
  1888.                                                 CTRLCLIB - The Ctrl+C Library
  1889.  
  1890.             Summary
  1891.  
  1892.             9.1 int  BreakFlag( action, flagset )
  1893.             int action;
  1894.             int flagset;
  1895.  
  1896.  
  1897.             Description
  1898.  
  1899.                  The BreakFlag function can be used to set or interrogate the
  1900.             status of CTRL+C checking by MS-DOS.  MS-DOS normally checks for
  1901.             the pressing of CTRL+C only when performing certain tasks.  When
  1902.             CTRL+C checking is enabled, MS-DOS will check for CTRL+C during
  1903.             ANY function request.
  1904.  
  1905.                  The BREAK command is normally used in the config.sys file to
  1906.             establish the degree of checking by MS-DOS for the CTRL+BREAK
  1907.             keypress.  The default setting - BREAK OFF means that MS-DOS will
  1908.             only check for CTRL+BREAK during keyboard and screen I/O.  BREAK
  1909.             ON lets MS-DOS check for the CTRL+BREAK keypress during ANY MS-
  1910.             DOS function.  The application program can override the "BREAK
  1911.             ON" or BREAK OFF" command by issuing a BreakFlag function call to
  1912.             check the current status, and then changing the setting of the
  1913.             flag accordingly.
  1914.  
  1915.                  "action" is a constant and can be either GETBREAKFLAG or
  1916.             SETBREAKFLAG.  "flagset" must contain a zero or non-zero value.
  1917.             "flagset" is ignored if the "action" is GETBREAKFLAG.  If the
  1918.             "action" is SETBREAKFLAG, and "flagset" is a non-zero value, the
  1919.             break flag will be set to the equivalent of "BREAK ON" and will
  1920.             enable MS-DOS to check for the CTRL+BREAK keypress during all
  1921.             function requests.
  1922.  
  1923.             Return Value
  1924.                The return value is the current effective setting of the flag.
  1925.  
  1926.             Usage
  1927.                  i = BreakFlag(GETBREAKFLAG,0); //Interrogate current setting
  1928.                  i = BreakFlag(SETBREAKFLAG,1); // Same as BREAK ON
  1929.                  i = BreakFlag(SETBREAKFLAG,0); // Same as BREAK OFF
  1930.  
  1931.             Additional Notes and Cautions
  1932.  
  1933.                  This is useful for applications doing extensive file I/O
  1934.             that requires a degree of control over MS-DOS's break checking
  1935.             rules.
  1936.  
  1937.             See Also:      FullCtrlC(), CtrlBreak(), CtrlC()
  1938.  
  1939.  
  1940.  
  1941.             _________________________________________________________________
  1942.                        Copyright 1990 Trendtech Corporation, Inc.
  1943.  
  1944.  
  1945.  
  1946.                                                                       Page 34
  1947.                                                 CTRLCLIB - The Ctrl+C Library
  1948.  
  1949.  
  1950.             Summary
  1951.  
  1952.             9.2 int  CapsLock( setting )
  1953.             int  setting;
  1954.  
  1955.  
  1956.             Description
  1957.  
  1958.                  The CapsLock function provides a number of different ways a
  1959.             program can manage the status of the keyboard CAPS LOCK key.  The
  1960.             "setting" must be one of the CONSTANTS listed below.  A setting
  1961.             of NULL or zero will return the previous CapsLock() setting of
  1962.             the CAPS LOCK key.
  1963.  
  1964.                  "setting" is one of the following constants:
  1965.  
  1966.                       CONSTANTS           Meaning
  1967.                       -------------------------------------------------------
  1968.                       L_OFF               Turns CAPS LOCK off
  1969.                       L_ON                Turns CAPS LOCK on
  1970.                       L_ALWAYSOFF         Turn CAPS LOCK off and keep it off;
  1971.                                           user cannot turn the CAPS LOCK key
  1972.                                           on
  1973.                       L_ALWAYSON          Turn CAPS LOCK on and keep it on;
  1974.                                           user cannot turn the CAPS LOCK key
  1975.                                           off
  1976.                       L_TOGGLE            Reverses the setting of the CAPS
  1977.                                           LOCK key; if it was ON, it will be
  1978.                                           turned off, and visa versa.
  1979.                       zero or NULL        Return previous setting
  1980.  
  1981.  
  1982.  
  1983.             Return Value
  1984.  
  1985.                  CapsLock() returns the functions' previous setting.  It will
  1986.             return zero the first time it is called.  It will also return
  1987.             zero or the previous setting if it was called with an invalid
  1988.             CONSTANT.
  1989.  
  1990.  
  1991.             Additional Notes and Cautions
  1992.  
  1993.                  This function returns the setting as it was set by a
  1994.             previous call to this function.  It does NOT return the current
  1995.             status of the CAPS LOCK key as it is currently set in the
  1996.  
  1997.  
  1998.  
  1999.  
  2000.             _________________________________________________________________
  2001.                        Copyright 1990 Trendtech Corporation, Inc.
  2002.  
  2003.  
  2004.  
  2005.                                                                       Page 35
  2006.                                                 CTRLCLIB - The Ctrl+C Library
  2007.  
  2008.             keyboard FLAG bytes.  If this function was never previously
  2009.             called, it will return a zero.
  2010.  
  2011.                  Before using the L_TOGGLE parameter, the program should set
  2012.             the key to some known state such as L_OFF or L_ON.
  2013.  
  2014.                  Behavior of the keyboard with regard to the NEXT keystroke
  2015.             is unpredictable if CapsLock() is called with L_TOGGLE after an
  2016.             L_ALWAYSON or L_ALWAYSOFF setting.
  2017.  
  2018.                  Use L_OFF to remove the permanent L_ALWAYSOFF or L_ALWAYSON
  2019.             setting.
  2020.  
  2021.                  The L_ALWAYSOFF and L_ALWAYSON settings will cause the
  2022.             Keyboard Handler to be installed.  You MUST call CapsLock(L_OFF)
  2023.             or CtrlcLibCleanup() to remove it prior to an exit() or abort()
  2024.             function call.
  2025.  
  2026.  
  2027.             See Also
  2028.  
  2029.                  NumLock(), ScrollLock(), InsertLock()
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.             _________________________________________________________________
  2060.                        Copyright 1990 Trendtech Corporation, Inc.
  2061.  
  2062.  
  2063.  
  2064.                                                                       Page 36
  2065.                                                 CTRLCLIB - The Ctrl+C Library
  2066.  
  2067.             Summary
  2068.  
  2069.             9.3 int  CtrlcLibSetup(varg)
  2070.             unsigned int varg;
  2071.  
  2072.  
  2073.             Description
  2074.  
  2075.                  The CtrlcLibSetup() function can be used as a shortcut to
  2076.             install all the desired interrupt handlers and traps that you
  2077.             need in a single function call.  By OR'ing together some or all
  2078.             of the CONSTANTS listed below, this function will install each
  2079.             one listed.  The corresponding function CtrlcLibCleanup() must be
  2080.             called prior to any programmed exit or abort.
  2081.  
  2082.                  
  2083.                       CONSTANTS           Meaning
  2084.                       -------------------------------------------------------
  2085.                       FCTRLC              Install full CTRL+C and CTRL-BREAK
  2086.                                           interrupt management
  2087.                       CTRLALTDEL          Install system reset interrupt
  2088.                                           management control
  2089.                       PAUSEKEY            Prevent use of the PAUSE key or
  2090.                                           CTRL+NUMLOCK to pause the system
  2091.                       CTRLS               Prevent use of CTRL+S to pause
  2092.                                           printing to the screen
  2093.                       CTRLP               Prevent line echo to the printer
  2094.  
  2095.                       PRINTSCREEN         Prevent screen dump to the printer
  2096.  
  2097.                       SYSREQ              Trap the SYSREQ keypress
  2098.  
  2099.                       CTRLC               Trap the CTRL+C keypress and
  2100.                                           prevent program termination
  2101.                       CTRLBREAK           Trap the CTRL+BREAK keypress and
  2102.                                           prevent program termination
  2103.  
  2104.                       (Note: FCTRLC includes CTRLC and CTRLBREAK)
  2105.  
  2106.  
  2107.             Return Value
  2108.  
  2109.                  CtrlcLibSetup() returns a count of the number of traps and
  2110.             handlers installed.
  2111.  
  2112.  
  2113.             Additional Notes and Cautions
  2114.  
  2115.  
  2116.  
  2117.  
  2118.             _________________________________________________________________
  2119.                        Copyright 1990 Trendtech Corporation, Inc.
  2120.  
  2121.  
  2122.  
  2123.                                                                       Page 37
  2124.                                                 CTRLCLIB - The Ctrl+C Library
  2125.  
  2126.                  Using FCTRLC will install the Keyboard Handler to prevent
  2127.             the ^C character from entering the keyboard buffer.  FCTRLC will
  2128.             also trap the CTRL+C and CTRL+BREAK keypress.  Use of FCTRLC with
  2129.             either/or CTRLC or CTRLBREAK is redundant and unnecessary.
  2130.  
  2131.  
  2132.             See Also
  2133.  
  2134.                  CtrlcLibCleanup()
  2135.  
  2136.  
  2137.             Example
  2138.  
  2139.                  #include <stdio.h>
  2140.                  #include "ctrlc.h"
  2141.                  
  2142.                  void main(void)
  2143.                    {
  2144.                    int i;
  2145.                    i = CtrlcLibSetup( FCTRLC | CTRLALTDEL | PAUSEKEY | SYSREQ
  2146.             );
  2147.                         .
  2148.                         .
  2149.                         .
  2150.                    CtrlcLibCleanup();
  2151.                    exit(0);
  2152.                    }
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.             _________________________________________________________________
  2178.                        Copyright 1990 Trendtech Corporation, Inc.
  2179.  
  2180.  
  2181.  
  2182.                                                                       Page 38
  2183.                                                 CTRLCLIB - The Ctrl+C Library
  2184.  
  2185.             Summary
  2186.  
  2187.             9.4 void CtrlcLibCleanup( void )
  2188.  
  2189.  
  2190.             Description
  2191.  
  2192.                  The CtrlcLibCleanup function will remove all interrupt
  2193.             management routines that your application may have installed, and
  2194.             additionally, will reset all the LOCK keys to off.
  2195.  
  2196.  
  2197.             Return Value
  2198.  
  2199.                  There is no return value from this function.
  2200.  
  2201.  
  2202.             Additional Notes and Cautions
  2203.  
  2204.                  CtrlcLibCleanup() can be called whether or not
  2205.             CtrlcLibSetup() was used to initialize interrupt management.  If
  2206.             separate interrupt management functions were used to trap keys,
  2207.             CtrlcLibCleanup() can be used instead of re-issuing separate
  2208.             function calls to remove them.
  2209.  
  2210.                  Be aware that calling CtrlcLibCleanup will increase your
  2211.             programs code size because this function call causes ALL of
  2212.             CTRLCLIB interrupt management routines to be linked into your
  2213.             program whether you use them or not. All interrupt management
  2214.             functions are called inside of CtrlcLibCleanup() with the
  2215.             argument of "ENABLE" or "REMOVE".  The functions are robust
  2216.             enough to know if they've been installed or not, so you don't
  2217.             have to worry about missing an interrupt.
  2218.  
  2219.             See Also
  2220.  
  2221.                  CtrlcLibSetup()
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.             _________________________________________________________________
  2237.                        Copyright 1990 Trendtech Corporation, Inc.
  2238.  
  2239.  
  2240.  
  2241.                                                                       Page 39
  2242.                                                 CTRLCLIB - The Ctrl+C Library
  2243.  
  2244.             Summary
  2245.  
  2246.             9.5 void CtrlAltDel( action )
  2247.             int action;
  2248.  
  2249.  
  2250.             Description
  2251.  
  2252.                  The CtrlAltDel function call installs the Keyboard Handler
  2253.             to trap the CTRL+ALT+DEL keypress action of the user.  The
  2254.             CTRL+ALT+DEL is the standard system reset keypress sequence.
  2255.  
  2256.  
  2257.                  "action" is one of the following CONSTANTS:
  2258.  
  2259.                       CONSTANTS      Meaning
  2260.                       -------------------------------------------------------
  2261.                       DISABLE             Traps the Ctrl+Alt+Del keypress and
  2262.                                           prevents a system reset by the
  2263.                                           user.
  2264.                       ENABLE              Returns full functionality to the
  2265.                                           Ctrl+Alt+Del system reset keys.
  2266.  
  2267.  
  2268.  
  2269.             Return Value
  2270.  
  2271.                  There is no return value.
  2272.  
  2273.  
  2274.             Additional Notes and Cautions
  2275.  
  2276.                  The program can check if these keys were pressed by
  2277.             examining the variable "cl.BootFlag" for a non-zero value.
  2278.  
  2279.                  If desired, your program can then perform an "orderly"
  2280.             shutdown - closing files, cleaning up work areas, etc., then call
  2281.             SystemReset() to force a reboot.
  2282.  
  2283.             See Also
  2284.  
  2285.                  SystemReset()
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.             _________________________________________________________________
  2296.                        Copyright 1990 Trendtech Corporation, Inc.
  2297.  
  2298.  
  2299.  
  2300.                                                                       Page 40
  2301.                                                 CTRLCLIB - The Ctrl+C Library
  2302.  
  2303.             Summary
  2304.  
  2305.             9.6 void CtrlBreak( action )
  2306.             int action;
  2307.  
  2308.  
  2309.             Description
  2310.  
  2311.                  The CtrlBreak function call installs an interrupt management
  2312.             function to intercept the CTRL+BREAK keypress by the user.
  2313.  
  2314.  
  2315.                  "action" is one of the following CONSTANTS:
  2316.  
  2317.                       CONSTANTS           Meaning
  2318.                       -------------------------------------------------------
  2319.                       DISABLE             Traps the Ctrl+Break keypress and
  2320.                                           prevents program termination.
  2321.                       ENABLE              Returns full functionality to the
  2322.                                           Ctrl+Break keypress.
  2323.  
  2324.  
  2325.  
  2326.             Return Value
  2327.  
  2328.                  There is no return value.
  2329.  
  2330.  
  2331.             Additional Notes and Cautions
  2332.  
  2333.                  Using CtrlBreak by itself will only trap the CTRL+BREAK
  2334.             keypress.  The "^C" code will still be echo'ed to the screen by
  2335.             MS-DOS.
  2336.  
  2337.                  The application program can examine the variable
  2338.             cl.BreakFlag or use QueryCtrlC() to see if this key was pressed
  2339.             by the user.
  2340.  
  2341.  
  2342.             See Also
  2343.  
  2344.                  CtrlC(), FullCtrlC(), QueryCtrlC()
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.             _________________________________________________________________
  2355.                        Copyright 1990 Trendtech Corporation, Inc.
  2356.  
  2357.  
  2358.  
  2359.                                                                       Page 41
  2360.                                                 CTRLCLIB - The Ctrl+C Library
  2361.  
  2362.             Summary
  2363.  
  2364.             9.7 void CtrlC( action )
  2365.             int action;
  2366.  
  2367.  
  2368.             Description
  2369.  
  2370.                  The CtrlC function installs an interrupt management routine
  2371.             to intercept the CTRL+C keypress by the user.
  2372.  
  2373.  
  2374.                  "action" is one of the following CONSTANTS:
  2375.  
  2376.                       CONSTANTS           Meaning
  2377.                       -------------------------------------------------------
  2378.                       DISABLE             Traps the Ctrl+C keypress and
  2379.                                           prevents program termination.
  2380.                       ENABLE              Returns full functionality to the
  2381.                                           Ctrl+C keys.
  2382.  
  2383.  
  2384.  
  2385.             Return Value
  2386.  
  2387.                  There is no return value.
  2388.  
  2389.  
  2390.             Additional Notes and Cautions
  2391.  
  2392.                  Using CtrlC by itself will only trap the CTRL+C keypress.
  2393.             The "^C" code will still be echo'ed to the screen by MS-DOS.
  2394.             Additionally, if the CTRL+BREAK key is pressed AND the CtrlBreak
  2395.             interrupt management function was NOT installed, then the
  2396.             control-break keypress will act like control-c and cause program
  2397.             termination.
  2398.  
  2399.  
  2400.             See Also
  2401.  
  2402.                  CtrlC(), FullCtrlC(), QueryCtrlC()
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.             _________________________________________________________________
  2414.                        Copyright 1990 Trendtech Corporation, Inc.
  2415.  
  2416.  
  2417.  
  2418.                                                                       Page 42
  2419.                                                 CTRLCLIB - The Ctrl+C Library
  2420.  
  2421.             Summary
  2422.  
  2423.             9.8 void CtrlP( action )
  2424.             int action;
  2425.  
  2426.  
  2427.             Description
  2428.  
  2429.                  The CtrlP interrupt management function will capture the
  2430.             CTRL+PRTSCRN and the CTRL+P keypresses.  These keypresses by the
  2431.             user normally cause STDOUT output to the screen to be echo'ed
  2432.             line-by-line to the attached printer.
  2433.  
  2434.                  "action" is one of the following CONSTANTS:
  2435.  
  2436.                       CONSTANTS           Meaning
  2437.                       -------------------------------------------------------
  2438.                       DISABLE             Traps the Ctrl+P and
  2439.                                           Ctrl+PrintScreen keypress and
  2440.                                           prevents MS-DOS from echoing screen
  2441.                                           lines to the printer
  2442.                       ENABLE              Returns full functionality to the
  2443.                                           Ctrl+P and Ctrl+PrintScreen keys.
  2444.  
  2445.  
  2446.  
  2447.             Return Value
  2448.  
  2449.                  There is no return value.
  2450.  
  2451.  
  2452.             Additional Notes and Cautions
  2453.  
  2454.                  Use QueryPrtScrn() to determine which set of print keys were
  2455.             pressed.
  2456.  
  2457.             See Also
  2458.  
  2459.                  PrintScreen(),  QueryPrtScrn()
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.             _________________________________________________________________
  2473.                        Copyright 1990 Trendtech Corporation, Inc.
  2474.  
  2475.  
  2476.  
  2477.                                                                       Page 43
  2478.                                                 CTRLCLIB - The Ctrl+C Library
  2479.  
  2480.             Summary
  2481.  
  2482.             9.9 void CtrlS( action)
  2483.             int action;
  2484.  
  2485.  
  2486.             Description
  2487.  
  2488.                  When the user presses the CTRL+S keys, MS-DOS output to the
  2489.             screen is halted temporarily until any typing key is pressed.
  2490.             The CtrlS interrupt management function will capture the CTRL+S
  2491.             keypress by the user thus preventing printing to the screen to be
  2492.             paused.
  2493.  
  2494.                  "action" is one of the following CONSTANTS:
  2495.  
  2496.                       CONSTANTS           Meaning
  2497.                       -------------------------------------------------------
  2498.                       DISABLE             Traps the Ctrl+S pause to STDOUT
  2499.  
  2500.                       ENABLE              Returns full functionality to the
  2501.                                           Ctrl+S keys.
  2502.  
  2503.  
  2504.  
  2505.             Return Value
  2506.  
  2507.                  There is no return value.
  2508.  
  2509.  
  2510.             Additional Notes
  2511.  
  2512.                  The application program can examine the variable named
  2513.             cl.PauseFlag in the control structure to see if the user pressed
  2514.             CTRL+S.
  2515.  
  2516.  
  2517.             See Also
  2518.  
  2519.                  PauseKey()
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.             _________________________________________________________________
  2532.                        Copyright 1990 Trendtech Corporation, Inc.
  2533.  
  2534.  
  2535.  
  2536.                                                                       Page 44
  2537.                                                 CTRLCLIB - The Ctrl+C Library
  2538.  
  2539.             Summary
  2540.  
  2541.             9.10 void FullCtrlC( action )
  2542.             int action;
  2543.  
  2544.  
  2545.             Description
  2546.  
  2547.                  The FullCtrlC interrupt management function will prevent the
  2548.             user from breaking out of the application program when the
  2549.             CTRL+BREAK or the CTRL+C keys are pressed.  This function will
  2550.             also prevent MS-DOS from echoing the "^C" characters to the
  2551.             screen.
  2552.  
  2553.                  "action" is one of the following CONSTANTS:
  2554.  
  2555.                       CONSTANTS           Meaning
  2556.                       -------------------------------------------------------
  2557.                       DISABLE             Traps the Control-C, Alt+kp3,
  2558.                                           Control-2 keypress, plus control-
  2559.                                           break and prevents program
  2560.                                           termination.
  2561.                       ENABLE              Returns full functionality to these
  2562.                                           program break keys.
  2563.  
  2564.  
  2565.  
  2566.             Return Value
  2567.  
  2568.                  There is no return value.
  2569.  
  2570.  
  2571.             Additional Notes and Cautions
  2572.  
  2573.                  The application program can issue the function call
  2574.             QueryCtrlC() to determine which keys were pressed.
  2575.  
  2576.  
  2577.             See Also
  2578.  
  2579.                  CtrlC(), CtrlBreak(), QueryCtrlC()
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.             _________________________________________________________________
  2591.                        Copyright 1990 Trendtech Corporation, Inc.
  2592.  
  2593.  
  2594.  
  2595.                                                                       Page 45
  2596.                                                 CTRLCLIB - The Ctrl+C Library
  2597.  
  2598.             Summary
  2599.  
  2600.             9.11 int  InsertLock( setting)
  2601.             int setting;
  2602.  
  2603.  
  2604.             Description
  2605.  
  2606.                  The InsertLock function provides a number of different ways
  2607.             a program can manage the status of the keyboard INSERT key.  The
  2608.             INSERT key is the keypad zero ( 0 ) key on ALL keyboards.  On the
  2609.             101 key keyboard it is also a separate key located above the
  2610.             DELETE key in the cursor movement key area between the main
  2611.             typing area and the keypad area.  The INSERT key has no mode
  2612.             light to indicate a "LOCKED" or "ON" condition.  The "setting"
  2613.             must be one of the CONSTANTS listed below.  A setting of NULL or
  2614.             zero will return the previous InsertLock() setting of the INSERT
  2615.             LOCK key.
  2616.  
  2617.  
  2618.                       CONSTANTS           Meaning
  2619.                       -------------------------------------------------------
  2620.                       L_OFF               Turns INSERT key off
  2621.                       L_ON                Turns INSERT key on
  2622.                       L_ALWAYSOFF         Turn INSERT key off and keep it
  2623.                                           off;                   user cannot
  2624.                                           turn the INSERT key on
  2625.                       L_ALWAYSON          Turn INSERT key on and keep it on;
  2626.                                           user cannot turn the INSERT LOCK
  2627.                                           key off
  2628.                       L_TOGGLE            Reverses the setting of the INSERT
  2629.                                           key; if it was ON, it will be
  2630.                                           turned off, and visa versa.
  2631.                       0 or NULL           Return previous setting
  2632.  
  2633.  
  2634.  
  2635.             Return Value
  2636.  
  2637.                  InsertLock() returns the functions' previous setting.  It
  2638.             will return zero the first time it is called.  It will also
  2639.             return zero or the previous setting if it was called with an
  2640.             invalid CONSTANT.
  2641.  
  2642.  
  2643.             Additional Notes and Cautions
  2644.  
  2645.  
  2646.  
  2647.  
  2648.  
  2649.             _________________________________________________________________
  2650.                        Copyright 1990 Trendtech Corporation, Inc.
  2651.  
  2652.  
  2653.  
  2654.                                                                       Page 46
  2655.                                                 CTRLCLIB - The Ctrl+C Library
  2656.  
  2657.                  This function returns the setting of the INSERT key as it
  2658.             was set by a previous call to this function.
  2659.  
  2660.                  Before using the L_TOGGLE parameter, the program should set
  2661.             the INSERT key to some known state such as L_OFF or L_ON.
  2662.  
  2663.                  Behavior of the keyboard with regard to the NEXT keystroke
  2664.             is unpredictable if InsertLock is called with L_TOGGLE after an
  2665.             L_ALWAYSON or L_ALWAYSOFF setting.
  2666.  
  2667.                  Use L_OFF to remove the permanent L_ALWAYSOFF or L_ALWAYSON
  2668.             setting.
  2669.  
  2670.                  The L_ALWAYSOFF and L_ALWAYSON settings will cause the
  2671.             Keyboard Handler to be installed.  You MUST call
  2672.             InsertLock(L_OFF) or CtrlcLibCleanup() to remove it prior to a
  2673.             standard library  exit() or abort() function call.
  2674.  
  2675.  
  2676.             See Also
  2677.  
  2678.                  NumLock(), CapsLock(), ScrollLock()
  2679.  
  2680.  
  2681.             Example
  2682.  
  2683.                  void main(void)
  2684.                       {
  2685.                       InsertLock(L_ALWAYSON);    /* keep caps lock ON */
  2686.                            .
  2687.                            .
  2688.                            .
  2689.                       InsertLock(L_OFF);  /* unlock the caps lock key */
  2690.                       exit(0);
  2691.                       }
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.             _________________________________________________________________
  2709.                        Copyright 1990 Trendtech Corporation, Inc.
  2710.  
  2711.  
  2712.  
  2713.                                                                       Page 47
  2714.                                                 CTRLCLIB - The Ctrl+C Library
  2715.  
  2716.             Summary
  2717.  
  2718.             9.12 void KeyboardHandler( action )
  2719.             int action;
  2720.  
  2721.  
  2722.             Description
  2723.  
  2724.                  The KeyboardHandler function installs an INT09 interrupt
  2725.             service routine to handle keyboard make/break codes.  This is a
  2726.             low-level routine that is called by most of the other interrupt
  2727.             management functions when the trapping of certain keypresses
  2728.             requires this routine to be called.  The INSTALL action will
  2729.             replace the BIOS INT09 with KeyboardVector, the actual ISR.  The
  2730.             REMOVE action will restore the original BIOS INT09.
  2731.  
  2732.  
  2733.             Return Value
  2734.  
  2735.                  There is no return value.
  2736.  
  2737.  
  2738.             Additional Notes and Cautions
  2739.  
  2740.                  The application program should never call this function
  2741.             directly.  Use the interrupt management functions for the
  2742.             specific keys to be trapped.  These functions in turn, will call
  2743.             KeyboardHandler().  If the application program installs the INT09
  2744.             interrupt service routine with KeyboardHandler, then it must use
  2745.             either KeyboardHandler with the REMOVE parameter or call
  2746.             CtrlcLibCleanup().
  2747.  
  2748.             See Also
  2749.  
  2750.                  n/a
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.             _________________________________________________________________
  2768.                        Copyright 1990 Trendtech Corporation, Inc.
  2769.  
  2770.  
  2771.  
  2772.                                                                       Page 48
  2773.                                                 CTRLCLIB - The Ctrl+C Library
  2774.  
  2775.             Summary
  2776.  
  2777.             9.13 int  NumLock( setting )
  2778.             int setting;
  2779.  
  2780.  
  2781.             Description
  2782.  
  2783.                  The NumLock function provides a number of different ways a
  2784.             program can manage the status of the keyboard NUM LOCK key.  The
  2785.             Num-Lock key, when locked on will cause keypresses of the keypad
  2786.             keys to send the ASCII numbers 0 thru 9 to the keyboard buffer
  2787.             area.  When the NUM LOCK key is off, the keypresses will send
  2788.             cursor movement characters to the keyboard buffer.  On more
  2789.             advanced keyboards, the NUM LOCK key has a mode light to indicate
  2790.             a "LOCKED" or "ON" condition.
  2791.  
  2792.                  The "setting" must be one of the CONSTANTS listed below.  A
  2793.             setting of NULL or zero will return the previous NumLock()
  2794.             setting of the NUM LOCK key.
  2795.  
  2796.  
  2797.                       CONSTANTS           Meaning
  2798.                       -------------------------------------------------------
  2799.                       L_OFF               Turns NUM LOCK off
  2800.                       L_ON                Turns NUM LOCK on
  2801.                       L_ALWAYSOFF         Turn NUM LOCK off and keep it off;
  2802.                                           user cannot turn the NUM LOCK key
  2803.                                           on
  2804.                       L_ALWAYSON          Turn NUM LOCK on and keep it on;
  2805.                                           user cannot turn the NUM LOCK key
  2806.                                           off
  2807.                       L_TOGGLE            Reverses the setting of the NUM
  2808.                                           LOCK key; if it was ON, it will be
  2809.                                           turned off, and visa versa.
  2810.                       0 or NULL           Return previous setting
  2811.  
  2812.  
  2813.  
  2814.             Return Value
  2815.  
  2816.                  NumLock() returns the functions' previous setting.  It will
  2817.             return zero the first time it is called.  It will also return
  2818.             zero or the previous setting if it was called with an invalid
  2819.             CONSTANT.
  2820.  
  2821.  
  2822.             Additional Notes and Cautions
  2823.  
  2824.  
  2825.  
  2826.             _________________________________________________________________
  2827.                        Copyright 1990 Trendtech Corporation, Inc.
  2828.  
  2829.  
  2830.  
  2831.                                                                       Page 49
  2832.                                                 CTRLCLIB - The Ctrl+C Library
  2833.  
  2834.  
  2835.                  This function returns the setting of the NUM LOCK key as it
  2836.             was set by a previous call to this function.
  2837.  
  2838.                  Before using the L_TOGGLE parameter, the program should set
  2839.             the NUM LOCK key to some known state such as L_OFF or L_ON.
  2840.  
  2841.                  Behavior of the keyboard with regard to the NEXT keystroke
  2842.             is unpredictable if NumLock is called with L_TOGGLE after an
  2843.             L_ALWAYSON or L_ALWAYSOFF setting.
  2844.  
  2845.                  Use L_OFF to remove the permanent L_ALWAYSOFF or L_ALWAYSON
  2846.             setting.
  2847.  
  2848.                  The L_ALWAYSOFF and L_ALWAYSON settings will cause the
  2849.             Keyboard Handler to be installed.  You MUST call NumLock(L_OFF)
  2850.             or CtrlcLibCleanup() to remove it prior to a standard library
  2851.             exit() or abort() function call.
  2852.  
  2853.  
  2854.             See Also
  2855.  
  2856.                  CapsLock(), ScrollLock(), InsertLock()
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.             _________________________________________________________________
  2886.                        Copyright 1990 Trendtech Corporation, Inc.
  2887.  
  2888.  
  2889.  
  2890.                                                                       Page 50
  2891.                                                 CTRLCLIB - The Ctrl+C Library
  2892.  
  2893.             Summary
  2894.  
  2895.             9.14 void PauseKey( action )
  2896.             int action;
  2897.  
  2898.  
  2899.             Description
  2900.  
  2901.                  The PauseKey interrupt management function resets the effect
  2902.             of a keypress of the PAUSE key or the CTRL+NUMLOCK keys.  These
  2903.             keys cause the system to pause all processing.  When pressed, a
  2904.             flag is set in the BIOS and the BIOS keyboard handler will loop
  2905.             internally until the flag is reset by another keypress.  The
  2906.             DISABLE action installs a timer interrupt handler that will reset
  2907.             the internal hold flag every time the pause key is pressed.  The
  2908.             ENABLE action will remove the interrupt handler and restore the
  2909.             capability of the pause key to pause the system.
  2910.  
  2911.                  "action" is one of the following CONSTANTS:
  2912.  
  2913.                       CONSTANTS           Meaning
  2914.                       -------------------------------------------------------
  2915.                       DISABLE             Install a timer interrupt to reset
  2916.                                           the "wait" bit whenever PAUSE is
  2917.                                           pressed
  2918.                       ENABLE              Returns full functionality to the
  2919.                                           PAUSE or CTRL-NUMLOCK key(s).
  2920.  
  2921.  
  2922.  
  2923.             Return Value
  2924.  
  2925.                  There is no return value.
  2926.  
  2927.  
  2928.             Additional Notes and Cautions
  2929.  
  2930.                  The PauseKey function will NOT trap the CTRL+S keypress by
  2931.             the user.  The CTRL+S keys will only pause output to the screen
  2932.             or STDOUT.  Use the CtrlS() function to trap these keys.
  2933.  
  2934.                  The application program can test the cl.PauseFlag variable
  2935.             to determine if the PAUSE key was pressed by the user.
  2936.  
  2937.             See Also
  2938.  
  2939.                  CtrlS()
  2940.  
  2941.  
  2942.  
  2943.  
  2944.             _________________________________________________________________
  2945.                        Copyright 1990 Trendtech Corporation, Inc.
  2946.  
  2947.  
  2948.  
  2949.                                                                       Page 51
  2950.                                                 CTRLCLIB - The Ctrl+C Library
  2951.  
  2952.             Summary
  2953.  
  2954.             9.15 void PrintScreen( action )
  2955.             int action;
  2956.  
  2957.  
  2958.             Description
  2959.  
  2960.                  The PrintScreen function installs an interrupt management
  2961.             function that traps the PRINT SCREEN keypress sequence and
  2962.             disables the usual screen print to the printer.
  2963.  
  2964.                  "action" is one of the following CONSTANTS:
  2965.  
  2966.                       CONSTANTS           Meaning
  2967.                       -------------------------------------------------------
  2968.                       DISABLE             Traps the PRINT SCREEN keypress and
  2969.                                           prevents a screen "dump" to the
  2970.                                           printer
  2971.                       ENABLE              Returns full functionality to the
  2972.                                           PRINT SCREEN key.
  2973.  
  2974.  
  2975.  
  2976.             Return Value
  2977.  
  2978.                  There is no return value.
  2979.  
  2980.  
  2981.             Additional Notes and Cautions
  2982.  
  2983.                  none
  2984.  
  2985.  
  2986.             See Also
  2987.  
  2988.                  CtrlP()
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.             _________________________________________________________________
  3004.                        Copyright 1990 Trendtech Corporation, Inc.
  3005.  
  3006.  
  3007.  
  3008.                                                                       Page 52
  3009.                                                 CTRLCLIB - The Ctrl+C Library
  3010.  
  3011.             Summary
  3012.  
  3013.             9.16 unsigned QueryCtrlC(void)
  3014.  
  3015.             Description
  3016.  
  3017.                  The QueryCtrlC function returns the value of CTRLCLIB
  3018.             structure's "break" flag and at the same time resets it to zero.
  3019.  
  3020.  
  3021.             Return Value
  3022.  
  3023.                  Returns a value indicating if the user pressed one of the
  3024.             "break" keys depending on the interrupt management functions
  3025.             installed:
  3026.  
  3027.  
  3028.                   CTRLC         The user pressed the CTRL+C keys.
  3029.                   CTRLBREAK     The user pressed the CTRL+BREAK keys
  3030.                   CTRL2         The user pressed the CTRL+2 keys
  3031.                   ALT3          The user pressed the ALT+Keypad 3 keys
  3032.                   zero          None of these keys were pressed.
  3033.  
  3034.             Additional Notes and Cautions
  3035.  
  3036.                  The CTRL2 and ALT3 values will be returned ONLY if the
  3037.             FullCtrlC interrupt management function was called.
  3038.  
  3039.  
  3040.             See Also
  3041.  
  3042.                  FullCtrlC(),  CtrlC(),  CtrlBreak()
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.             _________________________________________________________________
  3063.                        Copyright 1990 Trendtech Corporation, Inc.
  3064.  
  3065.  
  3066.  
  3067.                                                                       Page 53
  3068.                                                 CTRLCLIB - The Ctrl+C Library
  3069.  
  3070.             Summary
  3071.  
  3072.             9.17 unsigned QueryKeyPad5(void)
  3073.  
  3074.             Description
  3075.  
  3076.  
  3077.                  The QueryKeyPad5 function returns the value of CTRLCLIB
  3078.             structure's  keypad 5 status flag and resets it to zero.
  3079.  
  3080.  
  3081.             Return Value
  3082.  
  3083.                  Returns a boolean value indicating if the user pressed the
  3084.             key pad 5 key.  The setting of the NUMLOCK key is irrelevant.
  3085.  
  3086.  
  3087.                   KEYPAD5       The user pressed the Keypad 5 key.
  3088.                   zero          This key was not pressed.
  3089.  
  3090.  
  3091.             Additional Notes and Cautions
  3092.  
  3093.                  none
  3094.  
  3095.  
  3096.             See Also
  3097.  
  3098.                  n/a
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.             _________________________________________________________________
  3122.                        Copyright 1990 Trendtech Corporation, Inc.
  3123.  
  3124.  
  3125.  
  3126.                                                                       Page 54
  3127.                                                 CTRLCLIB - The Ctrl+C Library
  3128.  
  3129.             Summary
  3130.  
  3131.             9.18 unsigned QueryPrtScr(void)
  3132.  
  3133.             Description
  3134.  
  3135.  
  3136.                  The QueryPrtScr function returns the value of CTRLCLIB
  3137.             structure's  print screen status flag and resets it to zero.
  3138.  
  3139.  
  3140.             Return Value
  3141.  
  3142.                  Returns a value indicating if the user pressed any print
  3143.             screen function keys depending on the interrupt management
  3144.             functions installed:
  3145.  
  3146.  
  3147.                   CTRLP         The user pressed the CTRL+P keys.
  3148.                   CTRLPRTSCR    The user pressed the CTRL+PRTSCRN keys
  3149.                   PRINTSCEEN    The user pressed the PRINTSCREEN or
  3150.                   zero          None of these keys were pressed.
  3151.  
  3152.             Additional Notes and Cautions
  3153.  
  3154.                  none
  3155.  
  3156.  
  3157.             See Also
  3158.  
  3159.                  CtrlP()  PrintScreen()
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.             _________________________________________________________________
  3181.                        Copyright 1990 Trendtech Corporation, Inc.
  3182.  
  3183.  
  3184.  
  3185.                                                                       Page 55
  3186.                                                 CTRLCLIB - The Ctrl+C Library
  3187.  
  3188.             Summary
  3189.  
  3190.             9.19 unsigned QuerySysReq(void)
  3191.  
  3192.             Description
  3193.  
  3194.                  The QuerySysReq function returns the value of CTRLCLIB
  3195.             structure's SysReq flag and at the same time resets it to zero.
  3196.  
  3197.  
  3198.             Return Value
  3199.  
  3200.                  Returns a value indicating if the user pressed the SysReq
  3201.             key.
  3202.  
  3203.                   SYSREQ   The user pressed the SysReq key.
  3204.                   zero     This key was not pressed.
  3205.  
  3206.  
  3207.             Additional Notes and Cautions
  3208.  
  3209.                  none
  3210.  
  3211.  
  3212.             See Also
  3213.  
  3214.                  FullCtrlC(),  CtrlC(),  CtrlBreak()
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.             _________________________________________________________________
  3240.                        Copyright 1990 Trendtech Corporation, Inc.
  3241.  
  3242.  
  3243.  
  3244.                                                                       Page 56
  3245.                                                 CTRLCLIB - The Ctrl+C Library
  3246.  
  3247.             Summary
  3248.  
  3249.             9.20 int  ScrollLock( setting )
  3250.             int setting;
  3251.  
  3252.  
  3253.             Description
  3254.  
  3255.                  The ScrollLock function provides a variety of ways a program
  3256.             can manage the status of the keyboard SCROLL LOCK key.  The
  3257.             "setting" must be one of the CONSTANTS listed below.  A setting
  3258.             of NULL or zero will return the previous ScrollLock() setting of
  3259.             the SCROLL LOCK key.
  3260.  
  3261.  
  3262.                       CONSTANTS           Meaning
  3263.                       -------------------------------------------------------
  3264.                       L_OFF               Turns SCROLL LOCK off
  3265.                       L_ON                Turns SCROLL LOCK on
  3266.                       L_ALWAYSOFF         Turns SCROLL LOCK off and keeps it
  3267.                                           off; user cannot turn the SCROLL
  3268.                                           LOCK key on
  3269.                       L_ALWAYSON          Turns SCROLL LOCK on and keeps it
  3270.                                           on; user cannot turn the SCROLL
  3271.                                           LOCK key off
  3272.                       L_TOGGLE            Reverses the setting of the SCROLL
  3273.                                           LOCK key; if it was ON, it will be
  3274.                                           turned off, and visa versa.
  3275.                       0 or NULL           Return the previous setting
  3276.  
  3277.  
  3278.             Return Value
  3279.  
  3280.                  ScrollLock() returns the functions' previous setting.  It
  3281.             will return zero the first time it is called.  It will also
  3282.             return zero or the previous setting if it was called with an
  3283.             invalid CONSTANT.
  3284.  
  3285.  
  3286.             Additional Notes and Cautions
  3287.  
  3288.                  This function returns the setting as it was set by a
  3289.             previous call to ScrollLock.  If this function was not previously
  3290.             called, the first call to it will return a zero.
  3291.  
  3292.                  Before using the L_TOGGLE parameter, the program should set
  3293.             the Scroll Lock key to some known state such as L_OFF or L_ON.
  3294.  
  3295.  
  3296.  
  3297.  
  3298.             _________________________________________________________________
  3299.                        Copyright 1990 Trendtech Corporation, Inc.
  3300.  
  3301.  
  3302.  
  3303.                                                                       Page 57
  3304.                                                 CTRLCLIB - The Ctrl+C Library
  3305.  
  3306.                  Behavior of the keyboard with regard to the NEXT keystroke
  3307.             is unpredictable if ScrollLock is called with L_TOGGLE after an
  3308.             L_ALWAYSON or L_ALWAYSOFF setting.
  3309.  
  3310.                  Use L_OFF to remove the permanent L_ALWAYSOFF or L_ALWAYSON
  3311.             setting.
  3312.  
  3313.                  The L_ALWAYSOFF and L_ALWAYSON settings will cause the
  3314.             Keyboard Handler to be installed.  You MUST call
  3315.             ScrollLock(L_OFF) or CtrlcLibCleanup() to remove it prior to a
  3316.             standard library exit() or abort() function call.
  3317.  
  3318.  
  3319.             See Also
  3320.  
  3321.                  NumLock(), CapsLock(), InsertLock()
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.             _________________________________________________________________
  3358.                        Copyright 1990 Trendtech Corporation, Inc.
  3359.  
  3360.  
  3361.  
  3362.                                                                       Page 58
  3363.                                                 CTRLCLIB - The Ctrl+C Library
  3364.  
  3365.             Summary
  3366.  
  3367.             9.21 void ShowCtrlC( void)
  3368.  
  3369.  
  3370.             Description
  3371.  
  3372.                  This support function will print the "^C" characters on the
  3373.             display at the current cursor location.
  3374.  
  3375.  
  3376.             Return Value
  3377.  
  3378.                  There is no return value
  3379.  
  3380.  
  3381.             Additional Notes and Cautions
  3382.  
  3383.                  The  ^C  characters are followed by a carriage return
  3384.             character that positions the cursor at the beginning of the next
  3385.             line.  Use this with FullCtrlC() to fully simulate a control-
  3386.             break.
  3387.  
  3388.  
  3389.             See Also
  3390.  
  3391.                  FullCtrlC()  CtrlC()  CtrlBreak()
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.             _________________________________________________________________
  3417.                        Copyright 1990 Trendtech Corporation, Inc.
  3418.  
  3419.  
  3420.  
  3421.                                                                       Page 59
  3422.                                                 CTRLCLIB - The Ctrl+C Library
  3423.  
  3424.             Summary
  3425.  
  3426.             9.22 void SysReq( action )
  3427.             int action;
  3428.  
  3429.  
  3430.             Description
  3431.  
  3432.                  The SysReq function installs an interrupt service routine
  3433.             that captures any keypress of the "SysReq" key.
  3434.  
  3435.                  "action" is one of the following CONSTANTS:
  3436.  
  3437.                       CONSTANTS           Meaning
  3438.                       -------------------------------------------------------
  3439.                       INSTALL             Traps the SysReq keypress. Sets a
  3440.                                           flag when the user presses this
  3441.                                           key.
  3442.                       REMOVE              Returns full functionality to the
  3443.                                           SysReq key.
  3444.  
  3445.  
  3446.  
  3447.             Return Value
  3448.  
  3449.                  There is no return value.
  3450.  
  3451.  
  3452.             Additional Notes and Cautions
  3453.  
  3454.                  This function installs the Keyboard Handler, be sure to
  3455.             REMOVE the SysReq trap before program termination.
  3456.  
  3457.                  Use the QuerySysReq function to determine if the user
  3458.             pressed the SysReq key.  The return value of QuerySysReq is
  3459.             unpredictable if SysReq was never INSTALL'ed.
  3460.  
  3461.  
  3462.             See Also
  3463.  
  3464.                  QuerySysReq()
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.             _________________________________________________________________
  3476.                        Copyright 1990 Trendtech Corporation, Inc.
  3477.  
  3478.  
  3479.  
  3480.                                                                       Page 60
  3481.                                                 CTRLCLIB - The Ctrl+C Library
  3482.  
  3483.             Summary
  3484.  
  3485.             9.23 void SystemReset( action )
  3486.             int action;
  3487.  
  3488.  
  3489.             Description
  3490.  
  3491.                  Calling this function will cause the users PC to reboot
  3492.             according to the "action" requested.
  3493.  
  3494.  
  3495.                  "action" is one of the following CONSTANTS:
  3496.  
  3497.                       CONSTANTS           Meaning
  3498.                       -------------------------------------------------------
  3499.                       WARMBOOT            Reset the PC and perform a
  3500.                                           warmboot; same as pressing the
  3501.                                           CTRL+ALT+DEL key sequence
  3502.                       COLDBOOT            Reset the PC and perform complete
  3503.                                           coldboot diagnostics followed by
  3504.                                           boot-up of MS-DOS.  This is the
  3505.                                           same as turning the machine OFF
  3506.                                           then ON again.
  3507.  
  3508.  
  3509.  
  3510.             Return Value
  3511.  
  3512.                  There is no return value.  The system is reset.
  3513.  
  3514.  
  3515.             Additional Notes and Cautions
  3516.  
  3517.                  This function should be used in conjunction with the
  3518.             CtrlAltDel() function to trap any user keypress of the system
  3519.             reset keys.
  3520.  
  3521.             See Also
  3522.  
  3523.                  CtrlAltDel()
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.             _________________________________________________________________
  3535.                        Copyright 1990 Trendtech Corporation, Inc.
  3536.  
  3537.  
  3538.  
  3539.                                                                       Page 61
  3540.                                                 CTRLCLIB - The Ctrl+C Library
  3541.  
  3542.             10. APPENDIX -A- LICENSE AND REGISTRATION
  3543.  
  3544.  
  3545.             10.1 SHAREWARE LICENSE
  3546.  
  3547.                  (a)  This collection of object libraries, programs and files
  3548.             is referred  to as  "CTRLCLIB - The Ctrl+C Library".  If you have
  3549.             received it  without registering  with Trendtech Corporation, you
  3550.             have the "Shareware Version" of CTRLCLIB, and the license in this
  3551.             section describes  your permitted  use of  the software.   If you
  3552.             have registered with Trendtech Corporation, your permitted use is
  3553.             described in  the registration  section below;   in addition, you
  3554.             continue to have the right to distribute the Shareware Version of
  3555.             CTRLCLIB as described in this section.
  3556.  
  3557.  
  3558.  
  3559.                  (b)   CTRLCLIB is  a commercial software package.  It is not
  3560.             free, and  it is  not in the public domain.  It is distributed as
  3561.             Shareware, which  means that  before you pay for the package, you
  3562.             may evaluate  it and  see if  you want to continue using it.  You
  3563.             may use  CTRLCLIB free  for a  trial period  of up to thirty (30)
  3564.             days.  In order to continue use after that period, or include any
  3565.             part or  all of  this software  as part  of any saleable product,
  3566.             either commercial,  shareware, or  freeware,   registration  with
  3567.             Trendtech Corporation  is required.   Any  such use  of  CTRLCLIB
  3568.             without registration  is in  violation of  federal copyright laws
  3569.             and will be prosecuted to the fullest extent of the law.
  3570.  
  3571.  
  3572.  
  3573.                  (c)   (i)  You may give complete, exact copies of the entire
  3574.                       Shareware   Version to  others,  either  personally  or
  3575.                       through electronic distribution.  They may also use and
  3576.                       copy this  Shareware Version  under the  terms of  this
  3577.                       Agreement.
  3578.  
  3579.                       (ii)   You  may  NOT  distribute  CTRLCLIB  other  than
  3580.                       through exact, complete copies of the Shareware Version
  3581.                       passed to  friends and  associates for their individual
  3582.                       use,  or   distributed  electronically.    Among  other
  3583.                       things, you  may not  place CTRLCLIB or any part of the
  3584.                       CTRLCLIB  package   in  any  user-group  or  commercial
  3585.                       library  without   express  written   permission   from
  3586.                       Trendtech Corporation, and you may not distribute for a
  3587.                       fee, or  in any way sell copies of CTRLCLIB or any part
  3588.                       of CTRLCLIB  package without express written permission
  3589.                       from Trendtech  Corporation.   Any  other  use  of  the
  3590.  
  3591.  
  3592.  
  3593.             _________________________________________________________________
  3594.                        Copyright 1990 Trendtech Corporation, Inc.
  3595.  
  3596.  
  3597.  
  3598.                                                                       Page 62
  3599.                                                 CTRLCLIB - The Ctrl+C Library
  3600.  
  3601.                       Shareware Version by any person, business, corporation,
  3602.                       government  organization,   or  any   other  entity  is
  3603.                       strictly forbidden  and is  a violation of this license
  3604.                       Agreement.
  3605.  
  3606.                       (iii)   The CTRLCLIB  Shareware Version diskette, which
  3607.                       contains a  copy of  this manual,  may be freely copied
  3608.                       and shared.   But  printed copies  of this document may
  3609.                       not  be   photocopied  in   any  way   without  written
  3610.                       permission from  Trendtech Corporation.  No copy of the
  3611.                       software may  be distributed or given away without this
  3612.                       accompanying documentation;  this notice  must  not  be
  3613.                       removed. ONLY  COPIES OF  THE SHAREWARE  VERSION MAY BE
  3614.                       DISTRIBUTED.   THE REGISTERED  VERSION OF  THIS PROGRAM
  3615.                       MAY NOT  BE DISTRIBUTED IN ANY FORM EXCEPT AS EXPRESSLY
  3616.                       DESCRIBED IN PARAGRAPH 3.
  3617.  
  3618.                  If you  do not agree with these terms and conditions, you do
  3619.             not  have   permission  from   the  copyright  holder,  Trendtech
  3620.             Corporation, to  use the  Shareware Version  of CTRLCLIB, and you
  3621.             must stop  using it and remove it from your computer.  Any use or
  3622.             distribution of  CTRLCLIB which  violates this  license agreement
  3623.             will be  considered a  copyright violation, and prosecuted to the
  3624.             full extent of the law.
  3625.  
  3626.  
  3627.             10.2 Warranty and Liability Information.
  3628.  
  3629.             10.2.1  Shareware Version - Warranty Exclusion
  3630.  
  3631.                  TRENDTECH CORPORATION  LICENSES THE  SOFTWARE AND MANUAL FOR
  3632.             THE SHAREWARE  VERSION "AS  IS" WITHOUT  WARRANTY  OF  ANY  KIND,
  3633.             EITHER EXPRESSED  OR IMPLIED,  INCLUDING, BUT NOT LIMITED TO, THE
  3634.             WARRANTIES  OF  MERCHANTABILITY  AND  FITNESS  FOR  A  PARTICULAR
  3635.             PURPOSE.    TRENDTECH  CORPORATION  DOES  NOT  WARRANT  THAT  THE
  3636.             SHAREWARE VERSION  WILL  MEET  YOUR  REQUIREMENTS,  OR  THAT  THE
  3637.             OPERATION OF THE SHAREWARE VERSION WILL BE UNINTERRUPTED OR ERROR
  3638.             FREE.
  3639.  
  3640.             10.2.2  Registered Version - Limited Warranty
  3641.                  Trendtech  Corporation   warrants  that  CTRLCLIB  diskette,
  3642.             source code and documentation distributed to registered users are
  3643.             free of  physical defects,  subject to  the following:  Trendtech
  3644.             Corporation will  replace or  refund the  purchase price  of  the
  3645.             diskette  and/or  any  other  physical  parts  or  components  of
  3646.             CTRLCLIB found  to be  defective, if  such defect is the fault of
  3647.             Trendtech Corporation  and not the result of misuse or abuse, and
  3648.             if the  defective items  are returned  to  Trendtech  Corporation
  3649.  
  3650.  
  3651.  
  3652.             _________________________________________________________________
  3653.                        Copyright 1990 Trendtech Corporation, Inc.
  3654.  
  3655.  
  3656.  
  3657.                                                                       Page 63
  3658.                                                 CTRLCLIB - The Ctrl+C Library
  3659.  
  3660.             within  the   warranty  period   of  thirty   (30)   days   after
  3661.             registration.
  3662.  
  3663.             TRENDTECH CORPORATION  MAKES  NO  OTHER  WARRANTIES,  EXPRESS  OR
  3664.             IMPLIED,  INCLUDING   WITHOUT  LIMITATION   ANY   WARRANTIES   OF
  3665.             MERCHANTABILITY  OR   FITNESS  FOR   A  PARTICULAR  PURPOSE,  AND
  3666.             TRENDTECH CORPORATION'S WARRANTY IS EXPRESSLY LIMITED TO THE COST
  3667.             OF REPLACEMENT OF ANY DEFECTIVE DISKETTE OR OTHER PART.
  3668.  
  3669.             10.2.3  Liability Limitation
  3670.  
  3671.             IN  NO   EVENT  WILL   TRENDTECH  CORPORATION   BE   LIABLE   FOR
  3672.             CONSEQUENTIAL, INCIDENTAL,  INDIRECT OR  OTHER DAMAGES, INCLUDING
  3673.             ANY  LOST   PROFITS,  LOST   SAVINGS,  OR   OTHER  INCIDENTAL  OR
  3674.             CONSEQUENTIAL DAMAGES  ARISING OUT OF THE USE OF, OR INABILITY TO
  3675.             USE, THIS  SOFTWARE,  EVEN  IF  TRENDTECH  CORPORATION  HAS  BEEN
  3676.             ADVISED OF  THE POSSIBILITY  OF SUCH DAMAGES, OR FOR ANY CLAIM BY
  3677.             ANY OTHER PARTY.
  3678.  
  3679.  
  3680.             10.3 REGISTRATION
  3681.  
  3682.                  We encourage  you to  register your  copy of  CTRLCLIB.  The
  3683.             registration  fee   is  $30.00   plus  shipping   and   handling.
  3684.             Registration entitles you to several benefits:
  3685.  
  3686.                  1.   A number-serialized  diskette  containing  ALL  of  the
  3687.             SOURCE CODE in CTRLCLIB for all supported C compilers.
  3688.  
  3689.                  2.  Free telephone and mail support.
  3690.  
  3691.                  3.   Minimal fee  updates.   Minimal fees  cover the cost of
  3692.             media, shipping,  handling, and  update  preparation.    See  the
  3693.             section   entitled Upgrade  Policy in  Appendix -D-  for  upgrade
  3694.             details.
  3695.  
  3696.                  4.   Royalty-free distribution of compiled CTRLCLIB routines
  3697.             used within your own software products.
  3698.  
  3699.                  5.   A license  to use  CTRLCLIB after  the thirty  day (30)
  3700.             trial period has expired.
  3701.  
  3702.                  6.  Thanks from us for your support and encouragement!
  3703.  
  3704.  
  3705.             10.3.1  Source Code
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.             _________________________________________________________________
  3712.                        Copyright 1990 Trendtech Corporation, Inc.
  3713.  
  3714.  
  3715.  
  3716.                                                                       Page 64
  3717.                                                 CTRLCLIB - The Ctrl+C Library
  3718.  
  3719.                  All source  code provided  with the  registered  version  of
  3720.             CTRLCLIB is provided for purposes of your internal use only.  You
  3721.             may freely  modify the  source code  as you  please, and  use  it
  3722.             internally within  the scope  of  your  applicable  internal  use
  3723.             license, provided  that the original copyright notice on CTRLCLIB
  3724.             in the form released by Trendtech Corporation must be included in
  3725.             all modified  code.   YOU MAY  NOT DISTRIBUTE  THE SOURCE CODE TO
  3726.             OTHERS UNDER  ANY CIRCUMSTANCES,  WHETHER OR  NOT YOU  HAVE  MADE
  3727.             CHANGES TO IT."
  3728.  
  3729.                  If you  include some  or all of the source code, in modified
  3730.             or unmodified form, within your own program as a functioning part
  3731.             of your  program, then you may distribute as part of that program
  3732.             under the same terms as set forth in 3.2, 3.3, and 3.4 below.
  3733.  
  3734.  
  3735.             10.3.2  Single-User License
  3736.  
  3737.                  (a)   Description.  You become a registered user of CTRLCLIB
  3738.             when you  pay the  registration fee  indicated below to Trendtech
  3739.             Corporation.
  3740.  
  3741.                  The Single-User Registration fee for CTRLCLIB is as follows:
  3742.  
  3743.                       U.S.A.   - $30.00, plus  $3.00 for shipping/handling
  3744.                       Canada   - $30.00, plus  $5.00 for shipping/handling
  3745.                       Overseas - $30.00, plus $10.00 for shipping/handling
  3746.  
  3747.             MASTERCARD and  VISA  credit  cards  are  accepted.    All  paper
  3748.             payments (checks,  M.O., Postal  M.O., etc.) MUST be expressed in
  3749.             U.S. dollars and drawn on a U.S. bank.  Others will be returned.
  3750.  
  3751.                  These prices are only for the registered version of CTRLCLIB
  3752.             corresponding to  the release  of the  Shareware Version in which
  3753.             this license  Agreement is contained.  Later releases of CTRLCLIB
  3754.             may have  different registration  fees, and Trendtech Corporation
  3755.             is not  obligated to  accept registrations for less than the fees
  3756.             applicable to the then-current release.
  3757.  
  3758.                  (b)   Internal Use.   This  "SINGLE-USER" license authorizes
  3759.             you to  use CTRLCLIB on any computer system you may own or use on
  3760.             a regular basis, so long as CTRLCLIB is used on only one computer
  3761.             system at a time.  You may also install it on a computer attached
  3762.             to a  network, or remove it from one computer and install it on a
  3763.             different one,  provided there  is no possibility  that a  single
  3764.             copy of  CTRLCLIB will  be used  on more  than one  computer at a
  3765.             time.
  3766.  
  3767.  
  3768.  
  3769.  
  3770.             _________________________________________________________________
  3771.                        Copyright 1990 Trendtech Corporation, Inc.
  3772.  
  3773.  
  3774.  
  3775.                                                                       Page 65
  3776.                                                 CTRLCLIB - The Ctrl+C Library
  3777.  
  3778.                  (c)  Distribution.  You may distribute routines and programs
  3779.             that use functions from CTRLCLIB on the following terms only:
  3780.  
  3781.                       (i)   They may  be distributed  free of charge, but you
  3782.                       must  register   your  intended   use  with   Trendtech
  3783.                       Corporation BEFORE ANY distribution.
  3784.  
  3785.                       (ii)   They can  be distributed  only within  your  own
  3786.                       computer programs, and not by themselves.
  3787.  
  3788.                       (iii)  They must be fully functioning parts of your own
  3789.                       programs, and  entirely unavailable  to  recipients  of
  3790.                       your programs  as stand-alone  parts  of  any  software
  3791.                       toolkit, library, or collection.
  3792.  
  3793.                       (iv)     Any  program  containing  CTRLCLIB  functions,
  3794.                       routines or  programs must  be distributed  in compiled
  3795.                       form only.
  3796.  
  3797.                       (v)     Any  program  that  you  distribute  containing
  3798.                       CTRLCLIB functions, routines or programs must contain a
  3799.                       copyright  notice   in  the   program   code   properly
  3800.                       protecting  Trendtech   Corporation's   copyrights   in
  3801.                       CTRLCLIB.   If you are uncertain about proper copyright
  3802.                       notice,  please   contact  Trendtech   Corporation  for
  3803.                       instructions."
  3804.  
  3805.                  Except as set forth above, you may NOT give, sell, or
  3806.             otherwise transfer copies of the registered version of CTRLCLIB
  3807.             to any other person or business for any reason.  You may copy
  3808.             your registered version of CTRLCLIB for backup purposes only.
  3809.  
  3810.             10.3.3  Network License.
  3811.  
  3812.                  (a)   Description.   You may  register CTRLCLIB for use on a
  3813.             computer network  or other  multi-user computer  system.  A fully
  3814.             registered and paid-for copy of CTRLCLIB, according to the prices
  3815.             set   forth    in   3.1(a)    above,   is   required   for   each
  3816.             workstation/"keyboard".
  3817.  
  3818.                  (b)   Internal Use.  Usage of CTRLCLIB on a network or other
  3819.             multi   user-system    constitutes   usage   of   it   for   each
  3820.             workstation/"keyboard" connected to the network, whether CTRLCLIB
  3821.             is used on each of the workstations or not.
  3822.  
  3823.                  (c)  Distribution.  Same as 3.2
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.             _________________________________________________________________
  3830.                        Copyright 1990 Trendtech Corporation, Inc.
  3831.  
  3832.  
  3833.  
  3834.                                                                       Page 66
  3835.                                                 CTRLCLIB - The Ctrl+C Library
  3836.  
  3837.             10.3.4  Site License
  3838.  
  3839.                  (a)   Description.  You may register CTRLCLIB for use at one
  3840.             or more "sites".  A site is defined as a single building or group
  3841.             of buildings at the same public mailing address.
  3842.  
  3843.                  (b)  Internal Use.  A site license allows unlimited INTERNAL
  3844.             use of  CTRLCLIB, on  any number  of machines,  at the  specified
  3845.             location.  Please contact TRENDTECH CORPORATION for a copy of our
  3846.             General Licensing Provisions and site license fee schedule.
  3847.  
  3848.                  (c)  Distribution.   Same as 3.2
  3849.  
  3850.  
  3851.             10.3.5  Retail Distribution
  3852.  
  3853.                  Contact Trendtech  Corporation for  information about retail
  3854.             distribution of CTRLCLIB and discount schedules.
  3855.  
  3856.             10.3.6  Sales Tax:
  3857.  
  3858.             Licenses purchased in the State of New Jersey are subject to
  3859.             applicable sales taxes.
  3860.  
  3861.  
  3862.             10.4 OWNERSHIP
  3863.  
  3864.                  You agree  that Trendtech  Corporation is  the sole owner of
  3865.             all rights  and interests  in CTRLCLIB, including but not limited
  3866.             to all  copyrights, trade  secrets, and  patents  (to  Licensor's
  3867.             knowledge) in CTRLCLIB.  You agree that nothing in this Agreement
  3868.             shall cause  Trendtech Corporation's ownership rights in CTRLCLIB
  3869.             to be  reduced in  any way,  nor cause  you to gain any ownership
  3870.             rights  in   CTRLCLIB.    Licensee  shall  not  copy,  reproduce,
  3871.             distribute, display,  or operate  CTRLCLIB  except  as  expressly
  3872.             provided herein,  nor modify  or attempt  to modify  CTRLCLIB  in
  3873.             whole or  in part.   You further agree that any modified versions
  3874.             you may  create of  any  source  code  routines  or  programs  in
  3875.             CTRLCLIB are fully covered by all of the terms of this Agreement,
  3876.             and may  not  be  used  by  you  except  as  authorized  in  this
  3877.             Agreement.
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.             _________________________________________________________________
  3889.                        Copyright 1990 Trendtech Corporation, Inc.
  3890.  
  3891.  
  3892.  
  3893.                                                                       Page 67
  3894.                                                 CTRLCLIB - The Ctrl+C Library
  3895.  
  3896.             11. APPENDIX  -B-  WHAT IS SHAREWARE
  3897.  
  3898.                  The Shareware  method of software distribution gives users a
  3899.             chance to  try software  before buying  it by evaluating it for a
  3900.             period of  time.   If you  try a  Shareware program  and continue
  3901.             using it,  you are  expected  to  register  with  the  author  or
  3902.             copyright  holder.    Individual  Shareware  products  differ  on
  3903.             details -- some request registration while others require it, and
  3904.             most specify a maximum evaluation period.  With registration, and
  3905.             depending on  the product  you register, you will obtain anything
  3906.             from the  simple right  to continue  using  the  software  to  an
  3907.             updated program with a printed manual.
  3908.  
  3909.                  Shareware is  NOT the same as public domain software; public
  3910.             domain software  typically does  NOT contain copyright notices by
  3911.             the author.   Shareware,  on the other hand IS COPYRIGHTED by the
  3912.             author!   Copyright laws  apply to  BOTH  Shareware  as  well  as
  3913.             commercial software (software distributed in retail markets), and
  3914.             the copyright  holder retains  all rights,  with a  few  specific
  3915.             exceptions as stated below.
  3916.  
  3917.                  Shareware authors  are accomplished  programmers, just  like
  3918.             commercial software  authors, and the programs are of comparable,
  3919.             if not  better, quality.  (In both cases, there are good programs
  3920.             and bad  ones!)    The  main  difference  is  in  the  method  of
  3921.             distribution.   The author  of a  Shareware program  specifically
  3922.             grants the  right to  copy and distribute the software, either to
  3923.             all and  sundry computer  users or  to a  specific  group.    For
  3924.             example, most Shareware authors require written permission before
  3925.             a disk vendor may copy and distribute their Shareware program.
  3926.  
  3927.                  So, Shareware  is a  software "distribution  method", not  a
  3928.             "type" or "kind" of software.  As a computer user, you should try
  3929.             to  find   software  that  suits  your  needs  as  well  as  your
  3930.             pocketbook, whether  it's commercial or Shareware.  The Shareware
  3931.             system accommodates  your needs,  because you can "try before you
  3932.             buy".   And because  the overhead is low, prices - in the form of
  3933.             registration fees  are low  also.   Shareware  has  the  ULTIMATE
  3934.             money-back guarantee  -- "if you don't use the product, you don't
  3935.             pay for it".
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.             _________________________________________________________________
  3948.                        Copyright 1990 Trendtech Corporation, Inc.
  3949.  
  3950.  
  3951.  
  3952.                                                                       Page 68
  3953.                                                 CTRLCLIB - The Ctrl+C Library
  3954.  
  3955.             12. APPENDIX  -C-  DISTRIBUTION REQUIREMENTS
  3956.  
  3957.                  Any person,  group, or  organization who wants to distribute
  3958.             CTRLCLIB  for   any  kind  of  remuneration  must  FIRST  contact
  3959.             TRENDTECH  CORPORATION   by  letter  at  the  address  below  for
  3960.             distribution  permission.    Authorization  will  be  granted  to
  3961.             distributors and  disk vendors  recognized by  the Association of
  3962.             Shareware Professionals  (ASP) as  adhering to its guidelines for
  3963.             Shareware  distributors.     These  organizations  are  known  as
  3964.             "Associate Members"  of the  ASP.   Distribution to other vendors
  3965.             will be  made on  the basis  of their  understanding of Shareware
  3966.             principles.
  3967.  
  3968.                  CTRLCLIB  is   a  "Shareware"-distributed   program  and  is
  3969.             provided at  no charge to the user for evaluation.  Any fees paid
  3970.             by  you  -  the  user,  to  organizations  other  than  Trendtech
  3971.             Corporation are  for  their  disk  duplication  and  distribution
  3972.             services only.   Trendtech  Corporation receives NO PART of those
  3973.             fees.   "For-Profit" disk  vendors must  obtain  permission  from
  3974.             Trendtech Corporation to distribute CTRLCLIB.
  3975.  
  3976.                  All  users  are  granted  a  limited  license  to  copy  the
  3977.             Shareware version  of CTRLCLIB  and give  it  to  others  without
  3978.             charge for  their evaluation  and trial  use under  the following
  3979.             conditions:
  3980.  
  3981.                 - CTRLCLIB  Shareware disk  must be  distributed  in  its
  3982.                 original,  unmodified,   complete  form,   including  all
  3983.                 library files,  documentation files,  text  files,  files
  3984.                 containing  license  agreements,  registration  fees  and
  3985.                 schedules, and Shareware information.
  3986.                 - CTRLCLIB  Shareware disk  or  any  of  its  components,
  3987.                 objects,  or   libraries  may   NOT  be   distributed  in
  3988.                 conjunction with  any other  product or  service, without
  3989.                 express written permission from Trendtech Corporation.
  3990.                 - The  serialized registered  version of  CTRLCLIB  which
  3991.                 contains source  code, is  NOT to be given to anyone, nor
  3992.                 is it to be distributed under any circumstances.  Backups
  3993.                 may be  made by the registered user for archival purposes
  3994.                 only.
  3995.  
  3996.             Please send all requests and inquiries regarding distribution to
  3997.             the following address:
  3998.  
  3999.                            TRENDTECH CORPORATION
  4000.                            P.O. Box 3687
  4001.                            Wayne, NJ  07474-3687   USA
  4002.                       - or - FAX: (201) 694-2543
  4003.  
  4004.  
  4005.  
  4006.             _________________________________________________________________
  4007.                        Copyright 1990 Trendtech Corporation, Inc.
  4008.  
  4009.  
  4010.  
  4011.                                                                       Page 69
  4012.                                                 CTRLCLIB - The Ctrl+C Library
  4013.  
  4014.             13. APPENDIX  -D-  REGISTRATION BENEFITS
  4015.  
  4016.                  Registration  of  CTRLCLIB  gives  you  many  benefits:  all
  4017.             registered users  will receive  a copy  of the  latest version of
  4018.             CTRLCLIB  containing   full  C-Source  code,  libraries  for  all
  4019.             supported compilers  and memory  models, and  free  support  from
  4020.             Trendtech Corporation  by telephone  or  letter.    Finally,  the
  4021.             author's letter  of sincere  thanks for supporting Shareware will
  4022.             include an  unconditional money-back-guarantee  if  you  are  not
  4023.             fully satisfied.   The  money-back-guarantee is limited to thirty
  4024.             (30) days from the date you receive the registered package.
  4025.  
  4026.  
  4027.             13.1 Upgrade Policy
  4028.  
  4029.                  Please be  advised that Trendtech Corporation may or may not
  4030.             notify registered  users directly  of new versions of CTRLCLIB as
  4031.             we  are   constantly  changing   and   improving   the   product.
  4032.             Notification, when  necessary, may be made through direct mailing
  4033.             to registered  users,  publication  of  press  releases,  upgrade
  4034.             listings  in   disk  vendor   catalogs,  ASP   catalogs,   vendor
  4035.             advertisements, etc.   If  registered users  would like  to  keep
  4036.             current, they may send us their original registered disk (the one
  4037.             with our label and serial number on it) along with $5.00 to cover
  4038.             shipping and handling.  Registered users will then receive a disk
  4039.             with the  most current version of CTRLCLIB on it.  We suggest you
  4040.             do this  at least  annually to  benefit from significant software
  4041.             changes.
  4042.  
  4043.                  Single-user registration  fees, and requests for other kinds
  4044.             of licenses should be mailed to:
  4045.  
  4046.  
  4047.                            TRENDTECH CORPORATION
  4048.                            CTRLCLIB Registration
  4049.                            P.O. Box 3687
  4050.                            Wayne, NJ  07474-3687   USA
  4051.  
  4052.                            FAX: (201) 694-2543
  4053.  
  4054.  
  4055.                  Please take  a moment  to complete  and  mail  the  CTRLCLIB
  4056.             registration  form.    It  is  in  a  file  on  the  disk  called
  4057.             REGISTER.FRM and  contains a SINGLE-USER License agreement and an
  4058.             order form.   Be  sure to  specify the  disk size  needed.   This
  4059.             action will  register you as a bonafide user of CTRLCLIB and help
  4060.             us provide you with better service.
  4061.  
  4062.  
  4063.  
  4064.  
  4065.             _________________________________________________________________
  4066.                        Copyright 1990 Trendtech Corporation, Inc.
  4067.  
  4068.  
  4069.  
  4070.                                                                       Page 70
  4071.                                                 CTRLCLIB - The Ctrl+C Library
  4072.  
  4073.             14. APPENDIX  -E-  THE A.S.P.
  4074.  
  4075.                  William Letendre, the author of CTRLCLIB, and the PC-FASTYPE
  4076.             typing tutorials,  along with  his company TRENDTECH CORPORATION,
  4077.             are members  of The Association of Shareware Professionals (ASP).
  4078.             The  ASP   was  formed  in  1987  to  strengthen  the  future  of
  4079.             "Shareware" (formerly  known as  user-supported software)  as  an
  4080.             alternative  to  software  distributed  under  normal  commercial
  4081.             marketing methods.   The  ASP has established stringent standards
  4082.             for both  its author-members  and any  vending organization which
  4083.             has "ASP  Approved" status.   ASP  members subscribe to a code of
  4084.             ethics and  are committed to the concept of Shareware as a way of
  4085.             marketing their  product.   The ASP itself does NOT rate members'
  4086.             software for  functionality or  usefulness.  That is for you "the
  4087.             user"  to  decide.    Shareware-distributed-software,  especially
  4088.             software authorized  to carry  the ASP name, can be tested by you
  4089.             on a  try-before-you-buy basis.  If, after the evaluation period,
  4090.             you determine  the program doesn't fit your needs, you won't have
  4091.             to worry  about getting  a refund - simply don't register; that's
  4092.             the beauty of Shareware.
  4093.  
  4094.  
  4095.             14.1 The ASP Ombudsman Statement
  4096.  
  4097.                  The ASP wants to make sure the Shareware principle works for
  4098.             you.   If you  are unable  to resolve a Shareware-related problem
  4099.             with an ASP member by contacting the member directly, the ASP may
  4100.             be able  to help  you.   The ASP Ombudsman can help you resolve a
  4101.             dispute or  problem with  an ASP  member, but  does  not  provide
  4102.             technical support for members' products.  Please write to the ASP
  4103.             Ombudsman at the following address:
  4104.  
  4105.                       ASP Ombudsman
  4106.                       545 Grover Road
  4107.                       Muskegon, MI  49442-9427
  4108.  
  4109.                       Fax: 616-788-2765 (24 hrs/day)
  4110.                       Compuserve:  PPN: 70007,3536 (Ombudsman only)
  4111.                                    PPN: 72050,1433 (All other business)
  4112.  
  4113.  
  4114.             14.2 Summary of ASP Goals
  4115.  
  4116.                 o To inform users about shareware programs and about
  4117.                   shareware as a method of distributing and marketing
  4118.                   software;
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.             _________________________________________________________________
  4125.                        Copyright 1990 Trendtech Corporation, Inc.
  4126.  
  4127.  
  4128.  
  4129.                                                                       Page 71
  4130.                                                 CTRLCLIB - The Ctrl+C Library
  4131.  
  4132.                 o To encourage broader distribution of shareware through user
  4133.                   groups and disk dealers who agree to identify and explain
  4134.                   the nature of shareware;
  4135.  
  4136.                 o To assist members in marketing their software;
  4137.  
  4138.                 o To provide a forum through which ASP members may
  4139.                   communicate, share ideas, and learn from each other; and
  4140.  
  4141.                 o To foster a high degree of professionalism among shareware
  4142.                   authors by setting programming, marketing, and support
  4143.                   standards for ASP members to follow.
  4144.  
  4145.  
  4146.             14.3 ASP Standards for Author Members
  4147.  
  4148.             14.3.1 PROGRAMMING STANDARDS
  4149.  
  4150.             The program  meets the  ASP's definition of "shareware" (i.e., it
  4151.             is not a commercial demo with major feature disabled, nor a time-
  4152.             limited program).
  4153.  
  4154.             The program  has been  thoroughly tested by the author and should
  4155.             not
  4156.             be harmful to other files or hardware if used properly.
  4157.  
  4158.  
  4159.             14.3.2 DOCUMENTATION STANDARDS
  4160.  
  4161.             Sufficient documentation is provided to allow the average user to
  4162.             try all the major functions of the program.
  4163.  
  4164.             Any discussion  of the  shareware  concept  and  of  registration
  4165.             requirements is done in a professional and positive manner.
  4166.  
  4167.  
  4168.             14.3.3 SUPPORT STANDARDS
  4169.  
  4170.             The member  will respond to users who send registration payments,
  4171.             as promised  in the  program's documentation.   At a minimum, the
  4172.             member will acknowledge receipt of all payments.
  4173.  
  4174.             The member  will establish  a procedure  for users to report, and
  4175.             have acknowledged, matters such as bug reports, and will describe
  4176.             such means  in the documentation accompanying all versions of the
  4177.             programs.   The author  will respond  to written bug reports from
  4178.             registered users when the user provides a self-addressed, stamped
  4179.             envelope.
  4180.  
  4181.  
  4182.  
  4183.             _________________________________________________________________
  4184.                        Copyright 1990 Trendtech Corporation, Inc.
  4185.  
  4186.  
  4187.  
  4188.                                                                       Page 72
  4189.                                                 CTRLCLIB - The Ctrl+C Library
  4190.  
  4191.  
  4192.             Known incompatibilities with other software or hardware and major
  4193.             or unusual  program limitations  are noted  in the  documentation
  4194.             that comes with the shareware (evaluation) program.
  4195.  
  4196.  
  4197.  
  4198.  
  4199.             14.3.4 GENERAL
  4200.  
  4201.             Members will keep the ASP apprised of changes in mailing address;
  4202.             which shareware  programs they  have published  and are currently
  4203.             supporting; the  current version  numbers; and  of any changes in
  4204.             the status of their programs.
  4205.  
  4206.             If a  user has  a dispute with an ASP member-author, the user may
  4207.             appeal to the ASP to mediate for arbitration of the dispute.
  4208.  
  4209.             For  more   information  about   the  Association   of  Shareware
  4210.             Professionals, write  to: Membership  Secretary,  Association  of
  4211.             Shareware Professionals,  P.O.  Box 5786,  Bellevue, WA 98006.
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.             _________________________________________________________________
  4243.                        Copyright 1990 Trendtech Corporation, Inc.
  4244.  
  4245.  
  4246.  
  4247.                                                                       Page 73
  4248.                                                 CTRLCLIB - The Ctrl+C Library
  4249.  
  4250.             CTRLCLIB NOTES:
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.             _________________________________________________________________
  4302.                        Copyright 1990 Trendtech Corporation, Inc.
  4303.  
  4304.  
  4305.  
  4306.                                                                       Page 74
  4307.                                                 CTRLCLIB - The Ctrl+C Library
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.             _________________________________________________________________
  4361.                        Copyright 1990 Trendtech Corporation, Inc.