home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / tsr / mixtsr / tsr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-16  |  714 b   |  43 lines

  1. /* ----- tsr.c ----- */
  2.  
  3. #include <dos.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include <bios.h>
  7. #include "tsr.h"
  8.  
  9. void Msg_start(void);
  10. void Msg_resid(void);
  11. void Msg_restr(void);
  12.  
  13. static union REGS rg;
  14. static struct SREGS sg;
  15. extern char signature[];               /* tsr signature */
  16.  
  17. /* ------- main function for the TSR program ------ */
  18. main()
  19. {
  20.    int r;
  21.  
  22.    if ((r = resident(signature))==0  ){
  23.       /* -- tsr is resident -- */
  24.       Msg_start();
  25.       openfiles();
  26.       resinit();
  27.    }
  28.    r==1?Msg_resid():Msg_restr();
  29. }
  30.  
  31. int get_char()
  32. {
  33.    int c;
  34.    while (keyhit()==0)
  35.       ;
  36.    c=bioskey(0);
  37.    return ((c&0xff)==0)?(((c>>8)&0xff)|128):(c&0xff);
  38. }
  39.  
  40.  
  41.  
  42.  
  43.