home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcp30tkt.zip / PGMG1.ZIP / INCLUDE / UTILS.H < prev   
Text File  |  1995-12-04  |  1KB  |  42 lines

  1. #ifndef __UTILS_32H
  2. #define __UTILS_32H
  3.  
  4. unsigned long _System lswap(unsigned long);
  5. unsigned short _System bswap(unsigned short);
  6. int _System rexec(char **, int, char *, char *, char *, int *);
  7. /* int _System getpid(void); */
  8.  
  9. /* Definition for bswap */
  10. #define htonl(x)   (lswap(x))
  11. #define ntohl(x)   (lswap(x))
  12. #define htons(x)   (bswap(x))
  13. #define ntohs(x)   (bswap(x))
  14.  
  15. #ifndef X11
  16. #define bzero(x,y) memset((x),'\0',(y))
  17. #define bcopy(x,y,z) memcpy((y),(x),(z))
  18. #define bcmp(x,y,z)  memcmp((y),(x),(z))
  19. #endif /* X11 */
  20. #define ovbcopy(x,y,z) bcopy((x),(y),(z))
  21. #define copyout(x,y,z) memcpy((y),(x),(z))
  22. #define strcasecmp(x,y) strcmpi((x),(y))
  23. #define strncasecmp(x,y,z) strnicmp(x,y,z)
  24. #define sleep(x) DosSleep(((long)(x))*1000L)
  25.  
  26. #ifndef MIN
  27. #define MIN(a,b) (((a)<(b))?(a):(b))
  28. #define imin(x,y) MIN((x),(y))
  29. #define MAX(a,b) (((a)>(b))?(a):(b))
  30. #endif
  31. #ifndef min
  32. #define min(a,b) (((a)<(b))?(a):(b))
  33. #endif
  34.  
  35. #define timercmp(t1,t2,op) (((t1)->tv_sec op (t2)->tv_sec) || \
  36.                            (((t1)->tv_sec == (t2)->tv_sec) \
  37.                            && ((t1)->tv_usec op (t2)->tv_usec)))
  38. #define random() ((unsigned long)rand())
  39. #define srandom(x) srand(x)
  40.  
  41. #endif /* __UTILS_32H */
  42.