home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 29 Fixes_o / 29-Fixes_o.zip / prgcsd.exe / UTILS.H < prev    next >
Text File  |  1993-02-24  |  3KB  |  68 lines

  1. /********************************************************copyrite.xic***/
  2. /*                                                                     */
  3. /*   Licensed Materials - Property of IBM                              */
  4. /*                                                                     */
  5. /*   This product contains "Restricted Materials of IBM":              */
  6. /*      Program Number:   5798RXW                                      */
  7. /*      Program Name:     IBM TCP/IP Version 1.2 for OS/2              */
  8. /*   (C) Copyright IBM Corporation. 1990, 1991.                        */
  9. /*                                                                     */
  10. /*   All rights reserved.                                              */
  11. /*                                                                     */
  12. /*   US Government Users Restricted Rights -                           */
  13. /*   Use, duplication or disclosure restricted by GSA ADP Schedule     */
  14. /*   Contract with IBM Corp.                                           */
  15. /*                                                                     */
  16. /*   See IBM Copyright Instructions.                                   */
  17. /*                                                                     */
  18. /********************************************************copyrite.xic***/
  19. #ifndef __32BIT__
  20. #define _Far16
  21. #define _Cdecl
  22. #endif
  23. u_long _Far16 _Cdecl lswap( u_long );
  24. u_short _Far16 _Cdecl bswap( u_short );
  25.  
  26. #define htonl(x)   (lswap(x))
  27. #define ntohl(x)   (lswap(x))
  28. #define htons(x)   (bswap(x))
  29. #define ntohs(x)   (bswap(x))
  30.  
  31.  
  32. #define bzero(x,y) memset((x),0,(y))
  33. #ifdef KERNEL
  34. #define bcopy(x,y,z) mymemcpy((y),(x),(z))
  35. #else
  36. #define bcopy(x,y,z) memcpy((y),(x),(z))
  37. #endif
  38. #define ovbcopy(x,y,z) bcopy((x),(y),(z))
  39. #define copyout(x,y,z) memcpy((y),(x),(z))
  40. #define bcmp(x,y,z)  memcmp((y),(x),(z))
  41. #define strcasecmp(x,y) strcmpi((x),(y))
  42. #define strncasecmp(x,y,z) strnicmp(x,y,z)
  43. #ifndef KERNEL
  44. #define sleep(x) DOSSLEEP(((long)(x))*1000L)
  45. #endif
  46.  
  47. #ifndef MIN
  48. #define MIN(a,b) (((a)<(b))?(a):(b))
  49. #define imin(x,y) MIN((x),(y))
  50. #define MAX(a,b) (((a)>(b))?(a):(b))
  51. #endif
  52. #ifndef min
  53. #define min(a,b) (((a)<(b))?(a):(b))
  54. #endif
  55.  
  56. #ifndef FP_SEG
  57. #define FP_SEG(fp) (*((unsigned *)&(fp)+1))
  58. #endif
  59. #ifndef FP_OFF
  60. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  61. #endif
  62.  
  63. #define timercmp(t1,t2,op) (((t1)->tv_sec op (t2)->tv_sec) || \
  64.                            (((t1)->tv_sec == (t2)->tv_sec) \
  65.                            && ((t1)->tv_usec op (t2)->tv_usec)))
  66. #define random() ((u_long)rand())
  67. #define srandom(x) srand(x)
  68.