home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l180 / 2.ddi / CTOOLS1.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-07  |  9.3 KB  |  302 lines

  1. #include <ctype.h>
  2. #include <memory.h>
  3.  
  4. /***********************************************
  5. **  Name:         IsItAlnum%                  **
  6. **  Type:         Function                    **
  7. **  Module:       CTOOLS1.C                   **
  8. **  Language:     Microsoft QuickC/QuickBASIC **
  9. ************************************************
  10. *
  11. * EXAMPLE OF USE:   result% = IsItAlnum%(c%)                        
  12. * PARAMETERS:       c%         ASCII character code                 
  13. * VARIABLES:        (none)                                          
  14. * MODULE LEVEL                                                      
  15. *   DECLARATIONS:   #include <ctype.h>        */
  16.  
  17.  
  18. int isitalnum (c)
  19. int c;
  20.     {
  21.     return (isalnum(c));
  22.     }
  23.  
  24. /***********************************************
  25. **  Name:         IsItAlpha%                  **
  26. **  Type:         Function                    **
  27. **  Module:       CTOOLS1.C                   **
  28. **  Language:     Microsoft QuickC/QuickBASIC **
  29. ************************************************
  30. *
  31. * EXAMPLE OF USE:   result% = IsItAlpha%(c%)                        
  32. * PARAMETERS:       c%         ASCII character code                 
  33. * VARIABLES:        (none)                                      
  34. * MODULE LEVEL
  35. *   DECLARATIONS:   #include <ctype.h>        */                   
  36.  
  37.  
  38. int isitalpha (c)
  39. int c;
  40.     {
  41.     return (isalpha(c));
  42.     }
  43.  
  44. /***********************************************
  45. **  Name:         IsItAscii%                  **
  46. **  Type:         Function                    **
  47. **  Module:       CTOOLS1.C                   **
  48. **  Language:     Microsoft QuickC/QuickBASIC **
  49. ************************************************
  50. *
  51. * EXAMPLE OF USE:  result% = IsItAscii%(c%)
  52. * PARAMETERS:      c%         ASCII character code
  53. * VARIABLES:       (none)
  54. * MODULE LEVEL
  55. *   DECLARATIONS:  #include <ctype.h>         */
  56.  
  57.  
  58. int isitascii (c)
  59. int c;
  60.     {
  61.     return (isascii(c));
  62.     }
  63.  
  64. /***********************************************
  65. **  Name:         IsItCntrl%                  **
  66. **  Type:         Function                    **
  67. **  Module:       CTOOLS1.C                   **
  68. **  Language:     Microsoft QuickC/QuickBASIC **
  69. ************************************************
  70. *
  71. * EXAMPLE OF USE:   result% = IsItCntrl%(c%)
  72. * PARAMETERS:       c%         ASCII character code
  73. * VARIABLES:        (none)
  74. * MODULE LEVEL
  75. *   DECLARATIONS:   #include <ctype.h>        */
  76.  
  77.  
  78. int isitcntrl (c)
  79. int c;
  80.     {
  81.     return (iscntrl(c));
  82.     }
  83.  
  84. /***********************************************
  85. **  Name:         IsItDigit%                  **
  86. **  Type:         Function                    **
  87. **  Module:       CTOOLS1.C                   **
  88. **  Language:     Microsoft QuickC/QuickBASIC **
  89. ************************************************
  90. *
  91. * EXAMPLE OF USE:  result% = IsItDigit%(c%)
  92. * PARAMETERS:      c%         ASCII character code
  93. * VARIABLES:       (none)
  94. * MODULE LEVEL
  95. *   DECLARATIONS:  #include <ctype.h>         */
  96.  
  97.  
  98. int isitdigit (c)
  99. int c;
  100.     {
  101.     return (isdigit(c));
  102.     }
  103.  
  104. /***********************************************
  105. **  Name:         IsItGraph%                  **
  106. **  Type:         Function                    **
  107. **  Module:       CTOOLS1.C                   **
  108. **  Language:     Microsoft QuickC/QuickBASIC **
  109. ************************************************
  110. *
  111. * EXAMPLE OF USE:  result% = IsItGraph%(c%)
  112. * PARAMETERS:      c%         ASCII character code
  113. * VARIABLES:       (none)
  114. * MODULE LEVEL
  115. *   DECLARATIONS:  #include <ctype.h>         */
  116.  
  117.  
  118. int isitgraph (c)
  119. int c;
  120.     {
  121.     return (isgraph(c));
  122.     }
  123.  
  124. /***********************************************
  125. **  Name:         IsItLower%                  **
  126. **  Type:         Function                    **
  127. **  Module:       CTOOLS1.C                   **
  128. **  Language:     Microsoft QuickC/QuickBASIC **
  129. ************************************************
  130. *
  131. * EXAMPLE OF USE:  result% = IsItLower%(c%)
  132. * PARAMETERS:      c%         ASCII character code
  133. * VARIABLES:       (none)
  134. * MODULE LEVEL
  135. *   DECLARATIONS:  #include <ctype.h>         */
  136.  
  137.  
  138. int isitlower (c)
  139. int c;
  140.     {
  141.     return (islower(c));
  142.     }
  143.  
  144. /***********************************************
  145. **  Name:         IsItPrint%                  **
  146. **  Type:         Function                    **
  147. **  Module:       CTOOLS1.C                   **
  148. **  Language:     Microsoft QuickC/QuickBASIC **
  149. ************************************************
  150. *
  151. * EXAMPLE OF USE:  result% = IsItPrint%(c%)
  152. * PARAMETERS:      c%         ASCII character code
  153. * VARIABLES:       (none)
  154. * MODULE LEVEL
  155. *   DECLARATIONS:  #include <ctype.h>         */
  156.  
  157.  
  158. int isitprint (c)
  159. int c;
  160.     {
  161.     return (isprint(c));
  162.     }
  163.  
  164. /***********************************************
  165. **  Name:         IsItPunct%                  **
  166. **  Type:         Function                    **
  167. **  Module:       CTOOLS1.C                   **
  168. **  Language:     Microsoft QuickC/QuickBASIC **
  169. ************************************************
  170. *
  171. * EXAMPLE OF USE:  result% = IsItPunct%(c%)
  172. * PARAMETERS:      c%         ASCII character code
  173. * VARIABLES:       (none)
  174. * MODULE LEVEL
  175. *   DECLARATIONS:  #include <ctype.h>         */
  176.  
  177.  
  178. int isitpunct (c)
  179. int c;
  180.     {
  181.     return (ispunct(c));
  182.     }
  183.  
  184. /***********************************************
  185. **  Name:         IsItSpace%                  **
  186. **  Type:         Function                    **
  187. **  Module:       CTOOLS1.C                   **
  188. **  Language:     Microsoft QuickC/QuickBASIC **
  189. ************************************************
  190. *
  191. * EXAMPLE OF USE:  result% = IsItSpace%(c%)
  192. * PARAMETERS:      c%         ASCII character code
  193. * VARIABLES:       (none)
  194. * MODULE LEVEL
  195. *   DECLARATIONS:  #include <ctype.h>         */
  196.  
  197.  
  198. int isitspace (c)
  199. int c;
  200.     {
  201.     return (isspace(c));
  202.     }
  203.  
  204. /***********************************************
  205. **  Name:         IsItUpper%                  **
  206. **  Type:         Function                    **
  207. **  Module:       CTOOLS1.C                   **
  208. **  Language:     Microsoft QuickC/QuickBASIC **
  209. ************************************************
  210. *
  211. * EXAMPLE OF USE:   result% = IsItUpper%(c%)
  212. * PARAMETERS:       c%         ASCII character code
  213. * VARIABLES:        (none)
  214. * MODULE LEVEL
  215. *   DECLARATIONS:   #include <ctype.h>         */
  216.  
  217. int isitupper (c)
  218. int c;
  219.     {
  220.     return (isupper(c));
  221.     }
  222.  
  223. /***********************************************
  224. **  Name:         IsItXDigit%                 **
  225. **  Type:         Function                    **
  226. **  Module:       CTOOLS1.C                   **
  227. **  Language:     Microsoft QuickC/QuickBASIC **
  228. ************************************************
  229. *
  230. * EXAMPLE OF USE:  result% = IsItXDigit%(c%)
  231. * PARAMETERS:      c%         ASCII character code
  232. * VARIABLES:       (none)
  233. * MODULE LEVEL
  234. *   DECLARATIONS:  #include <ctype.h>         */
  235.  
  236.  
  237. int isitxdigit (c)
  238. int c;
  239.     {
  240.     return (isxdigit(c));
  241.     }
  242.  
  243. /***********************************************
  244. **  Name:         MovBytes                    **
  245. **  Type:         Subprogram                  **
  246. **  Module:       CTOOLS1.C                   **
  247. **  Language:     Microsoft QuickC/QuickBASIC **
  248. ************************************************
  249. *
  250. *  Moves bytes from a source segment and offset
  251. *  location in memory to a destination segment and
  252. *  offset location.
  253. *
  254. *  EXAMPLE OF USE:  MovBytes sseg%, soff%, dseg%, doff%, nbytes%
  255. *  PARAMETERS:      sseg%      Source segment address of bytes to be moved
  256. *                   soff%      Source offset address of bytes to be moved
  257. *                   dseg%      Destination segment address of bytes to be moved
  258. *                   doff%      Destination offset address of bytes to be moved
  259. *                   nbytes%    Number of bytes to be moved
  260. * VARIABLES:        (none)
  261. * MODULE LEVEL
  262. *   DECLARATIONS:   #include <memory.h>     */
  263.  
  264.  
  265. void movbytes(srcseg, srcoff, destseg, destoff, nbytes)
  266. unsigned int *srcseg, *srcoff, *destseg, *destoff, *nbytes;
  267.     {
  268.     movedata(*srcseg, *srcoff, *destseg, *destoff, *nbytes);
  269.     }
  270.  
  271. /***********************************************
  272. **  Name:         MovWords                    **
  273. **  Type:         Subprogram                  **
  274. **  Module:       CTOOLS1.C                   **
  275. **  Language:     Microsoft QuickC/QuickBASIC **
  276. ************************************************
  277. *
  278. *  Moves words from a source segment and offset
  279. *  location in memory to a destination segment and
  280. *  offset location.
  281. *
  282. * EXAMPLE OF USE:  MovWords sseg%, soff%, dseg%, doff%, nbytes%
  283. * PARAMETERS:      sseg%      Source segment address of words to be moved
  284. *                  soff%      Source offset address of words to be moved
  285. *                  dseg%      Destination segment address of words to be moved
  286. *                  doff%      Destination offset address of words to be moved
  287. *                  nwords%    Number of words to be moved
  288. * VARIABLES:       (none)
  289. * MODULE LEVEL
  290. *   DECLARATIONS:  #include <memory.h>        */
  291.  
  292.  
  293. void movwords(srcseg, srcoff, destseg, destoff, nwords)
  294. unsigned int *srcseg, *srcoff, *destseg, *destoff, *nwords;
  295.     {
  296.     unsigned int nbytes;
  297.     
  298.     nbytes = *nwords + *nwords;
  299.     movedata(*srcseg, *srcoff, *destseg, *destoff, nbytes);
  300.     }
  301.  
  302.