home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / NSDEDIT2.ZIP / EDTKT06B.ZIP / KEY_DEF.H < prev    next >
C/C++ Source or Header  |  1994-09-06  |  7KB  |  248 lines

  1. /***********************************************************************
  2. *                                                                      *
  3. *  Definition file for EDIT.HPP                                        *
  4. *                                                                      *
  5. *  Purpose : Defines KEYS and proboard stuff                           *
  6. *                                                                      *
  7. *  Author  : Peter Bloemendaal                                         *
  8. *            Brainbox systems +31-70-3523661                           *
  9. *  eMail   : internet -> bloemendaal@rullf2.LeidenUniv.nl              *
  10. *            fidonet  -> 2:281/908                                     *
  11. *                                                                      *
  12. *----------------------------------------------------------------------*
  13. *                                                                      *
  14. * $Header: C:\PROGRAMS\TC\EDIT\RCS\key_def.v 1.1                       *
  15. *  1994/07/30 09:31:32 BRAINBOX Exp BRAINBOX $                         *
  16. *                                                                      *
  17. * $Log: key_def.v $
  18.  * Revision 1.7  1994/08/20  13:34:13  BRAINBOX
  19.  * 1. More definitions added to make Edit PEX compatible
  20.  *
  21.  * Revision 1.6  1994/08/12  13:38:22  BRAINBOX
  22.  * 1. Code beautified
  23.  *                                                    *
  24. * Revision 1.5  1994/08/11  22:33:59  BRAINBOX                         *
  25. * 1. Fileno implemented                                                *
  26. *                                                                      *
  27. * Revision 1.4  1994/08/10  20:24:18  BRAINBOX                         *
  28. * 1. Added textattr function to SetFullColor                           *
  29. *                                                                      *
  30. * Revision 1.3  1994/08/08  13:23:38  BRAINBOX                         *
  31. * 1. Bool definition changed                                           *
  32. *                                                                      *
  33. * Revision 1.2  1994/08/01  21:31:01  BRAINBOX                         *
  34. * 2. Global stuff removed                                              *
  35. *                                                                      *
  36. * Revision 1.1  1994/07/30  09:31:32  BRAINBOX                         *
  37. * Initial revision                                                     *
  38. *                                                                      *
  39. *                                                                      *
  40. ************************************************************************
  41. */
  42. #ifndef _PB_SDK_H
  43.  
  44.  
  45. /**** KEY scan codes ****/
  46. #define KEY_F1   0x3B00U
  47. #define KEY_F2   0x3C00U
  48. #define KEY_F3   0x3D00U
  49. #define KEY_F4   0x3E00U
  50. #define KEY_F5   0x3F00U
  51. #define KEY_F6   0x4000U
  52. #define KEY_F7   0x4100U
  53. #define KEY_F8   0x4200U
  54. #define KEY_F9   0x4300U
  55. #define KEY_F10  0x4400U
  56.  
  57. #define KEY_SF1   0x5400U
  58. #define KEY_SF2   0x5500U
  59. #define KEY_SF3   0x5600U
  60. #define KEY_SF4   0x5700U
  61. #define KEY_SF5   0x5800U
  62. #define KEY_SF6   0x5900U
  63. #define KEY_SF7   0x5A00U
  64. #define KEY_SF8   0x5B00U
  65. #define KEY_SF9   0x5C00U
  66. #define KEY_SF10  0x5D00U
  67.  
  68. #define KEY_CF1   0x5E00U
  69. #define KEY_CF2   0x5F00U
  70. #define KEY_CF3   0x6000U
  71. #define KEY_CF4   0x6100U
  72. #define KEY_CF5   0x6200U
  73. #define KEY_CF6   0x6300U
  74. #define KEY_CF7   0x6400U
  75. #define KEY_CF8   0x6500U
  76. #define KEY_CF9   0x6600U
  77. #define KEY_CF10  0x6700U
  78.  
  79. #define KEY_AF1   0x6800U
  80. #define KEY_AF2   0x6900U
  81. #define KEY_AF3   0x6A00U
  82. #define KEY_AF4   0x6B00U
  83. #define KEY_AF5   0x6C00U
  84. #define KEY_AF6   0x6D00U
  85. #define KEY_AF7   0x6E00U
  86. #define KEY_AF8   0x6F00U
  87. #define KEY_AF9   0x7000U
  88. #define KEY_AF10  0x7100U
  89.  
  90. #define KEY_ALT1 0x7800U
  91. #define KEY_ALT2 0x7900U
  92. #define KEY_ALT3 0x7A00U
  93. #define KEY_ALT4 0x7B00U
  94. #define KEY_ALT5 0x7C00U
  95. #define KEY_ALT6 0x7D00U
  96. #define KEY_ALT7 0x7E00U
  97. #define KEY_ALT8 0x7F00U
  98. #define KEY_ALT9 0x8000U
  99. #define KEY_ALT0 0x8100U
  100.  
  101. #define KEY_ALTA 0x1E00U
  102. #define KEY_ALTB 0x3000U
  103. #define KEY_ALTC 0x2E00U
  104. #define KEY_ALTD 0x2000U
  105. #define KEY_ALTE 0x1200U
  106. #define KEY_ALTF 0x2100U
  107. #define KEY_ALTG 0x2200U
  108. #define KEY_ALTH 0x2300U
  109. #define KEY_ALTI 0x1700U
  110. #define KEY_ALTJ 0x2400U
  111. #define KEY_ALTK 0x2500U
  112. #define KEY_ALTL 0x2600U
  113. #define KEY_ALTM 0x3200U
  114. #define KEY_ALTN 0x3100U
  115. #define KEY_ALTO 0x1800U
  116. #define KEY_ALTP 0x1900U
  117. #define KEY_ALTQ 0x1000U
  118. #define KEY_ALTR 0x1300U
  119. #define KEY_ALTS 0x1F00U
  120. #define KEY_ALTT 0x1400U
  121. #define KEY_ALTU 0x1600U
  122. #define KEY_ALTV 0x2F00U
  123. #define KEY_ALTW 0x1100U
  124. #define KEY_ALTX 0x2D00U
  125. #define KEY_ALTY 0x1500U
  126. #define KEY_ALTZ 0x2C00U
  127.  
  128. #define KEY_CTLA 0x0001U
  129. #define KEY_CTLB 0x0002U
  130. #define KEY_CTLC 0x0003U
  131. #define KEY_CTLD 0x0004U
  132. #define KEY_CTLE 0x0005U
  133. #define KEY_CTLF 0x0006U
  134. #define KEY_CTLG 0x0007U
  135. #define KEY_CTLH 0x0008U
  136. #define KEY_CTLI 0x0009U
  137. #define KEY_CTLJ 0x000AU
  138. #define KEY_CTLK 0x000BU
  139. #define KEY_CTLL 0x000CU
  140. #define KEY_CTLM 0x000DU
  141. #define KEY_CTLN 0x000EU
  142. #define KEY_CTLO 0x000FU
  143. #define KEY_CTLP 0x0010U
  144. #define KEY_CTLQ 0x0011U
  145. #define KEY_CTLR 0x0012U
  146. #define KEY_CTLS 0x0013U
  147. #define KEY_CTLT 0x0014U
  148. #define KEY_CTLU 0x0015U
  149. #define KEY_CTLV 0x0016U
  150. #define KEY_CTLW 0x0017U
  151. #define KEY_CTLX 0x0018U
  152. #define KEY_CTLY 0x0019U
  153. #define KEY_CTLZ 0x001AU
  154.  
  155. #define KEY_DEL  0x5300U
  156. #define KEY_INS  0x5200U
  157. #define KEY_HOME 0x4700U
  158. #define KEY_END  0x4F00U
  159.  
  160. #define KEY_PGUP 0x4900U
  161. #define KEY_PGDN 0x5100U
  162. #define KEY_UP   0x4800U
  163. #define KEY_DN   0x5000U
  164. #define KEY_LT   0x4B00U
  165. #define KEY_RT   0x4D00U
  166.  
  167. #define KEY_ESC  0x001BU
  168. #define KEY_ENT  0x000DU
  169. #define KEY_RET  0x000DU
  170. #define KEY_TAB  0x0009U
  171. #define KEY_STAB 0x0F00U
  172. #define KEY_CPGUP 0x8400U
  173. #define KEY_CPGDN 0x7600U
  174.  
  175. #endif
  176.  
  177. // Always define these
  178. #define KEY_BACK 0x0008U
  179.  
  180. #define MAXPATH 128
  181.  
  182.  
  183. // Define some thing not defined in PB_SDK.H
  184. // Can only be used by Proboard Bulletin Board system
  185. #ifdef _PB_SDK_H
  186.  
  187. #define getch ScanKey
  188. #define EOF (-1)            /* End of file indicator */
  189. #define gotoxy GotoXY
  190. #define clrscr() printf("\f")
  191. #define cprintf printf
  192. #define _dos_findfirst dos_findfirst
  193.  
  194. #define _A_NORMAL  0x00
  195. #define _A_RDONLY    0x01
  196. #define _A_HIDDEN    0x02
  197. #define _A_SYSTEM    0x04
  198. #define _A_LABEL    0x08
  199. #define _A_DIREC    0x10
  200. #define _A_ARCH        0x20
  201.  
  202. int fileno(FILE *fp)
  203. {
  204.    return *fp ;
  205. }
  206.  
  207. void textattr(int color)
  208. {
  209.      SetFullColor(color) ;
  210. }
  211.  
  212. int kbhit (void)
  213. {
  214.     union REGS reg ;
  215.     struct SREGS sreg ;
  216.     reg.h.ah     = 0x0B ;
  217.     intdosx(®, ®, &sreg) ;
  218.  
  219.     return reg.x.ax & 255 ;
  220. }
  221.  
  222.  
  223. int strcmpi(const char *s1,const char *s2)
  224. {
  225.    int ret ;
  226.  
  227.    char *su1, *su2 ;
  228.  
  229.    if ( (su1 = (char*) malloc(strlen(s1) +1)) == NULL)
  230.       return NULL ;
  231.    if ( (su2 = (char*) malloc(strlen(s2) +1)) == NULL)
  232.       return NULL ;
  233.  
  234.    strcpy(su1,s1) ;
  235.    strcpy(su2,s2) ;
  236.  
  237.    strupr(su1) ;
  238.    strupr(su2) ;
  239.  
  240.    ret = strcmp(su1,su2) ;
  241.    free(su1) ;
  242.    free(su2) ;
  243.  
  244.    return ret ;
  245. }
  246.  
  247. #endif
  248.