home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perlkt40.zip / HANDY.H < prev    next >
Text File  |  1996-06-13  |  1KB  |  52 lines

  1. /* $RCSfile: handy.h,v $$Revision: 4.0.1.2 $$Date: 91/06/07 12:15:43 $
  2.  *
  3.  *    Copyright (c) 1991, Larry Wall
  4.  *
  5.  *    You may distribute under the terms of either the GNU General Public
  6.  *    License or the Artistic License, as specified in the README file.
  7.  *
  8.  * $Log:    handy.h,v $
  9.  * Revision 4.0.1.2  91/06/07  12:15:43  lwall
  10.  * patch4: new copyright notice
  11.  * 
  12.  * Revision 4.0.1.1  91/04/12  09:29:08  lwall
  13.  * patch1: random cleanup in cpp namespace
  14.  * 
  15.  * Revision 4.0  91/03/20  01:57:45  lwall
  16.  * 4.0 baseline.
  17.  * 
  18.  */
  19.  
  20. #define Null(type) ((type)0)
  21. #define Nullch Null(char*)
  22. #define Nullfp Null(FILE*)
  23.  
  24. #define bool char
  25. #ifdef TRUE
  26. #undef TRUE
  27. #endif
  28. #ifdef FALSE
  29. #undef FALSE
  30. #endif
  31. #define TRUE (1)
  32. #define FALSE (0)
  33.  
  34. #define Ctl(ch) (ch & 037)
  35.  
  36. #define strNE(s1,s2) (strcmp(s1,s2))
  37. #define strEQ(s1,s2) (!strcmp(s1,s2))
  38. #define strLT(s1,s2) (strcmp(s1,s2) < 0)
  39. #define strLE(s1,s2) (strcmp(s1,s2) <= 0)
  40. #define strGT(s1,s2) (strcmp(s1,s2) > 0)
  41. #define strGE(s1,s2) (strcmp(s1,s2) >= 0)
  42. #define strnNE(s1,s2,l) (strncmp(s1,s2,l))
  43. #define strnEQ(s1,s2,l) (!strncmp(s1,s2,l))
  44.  
  45. #ifdef MSDOS
  46. #define UC(c)        ((unsigned char)(c))
  47. #define BD(l, h, c)    (((l) <= (c))&&((c) <= (h)))
  48. #define iskanji(c)    ((BD(0x81, 0x9F, UC(c)) || BD(0xE0, 0xFC, UC(c))) ? 1:0)
  49. #define I80286
  50. #endif
  51.  
  52.