home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / MCOMM530.ZIP / EXTRA.H < prev    next >
C/C++ Source or Header  |  1990-06-22  |  2KB  |  47 lines

  1.  
  2. /****************************************************************************
  3.  EXTRA.H -- miscellaneous functions
  4.    Mike Dumdei,  6 Holly Lane,  Texarkana TX  75503    (c) 1989,1990
  5. ****************************************************************************/
  6.  
  7. #if !defined(MCOMM)
  8. #define _C_ cdecl
  9. #define _N_ near
  10. #define _F_ far
  11. #define MCOMM
  12. #endif
  13.  
  14. #define SET_TO_TENTHS(to, tenths)   set_timeout((&to), (tenths)*9/5)
  15. #define SET_TO_SECS(to, secs)       set_timeout((&to), (secs)*18)
  16. #define SET_TO_MINS(to, mins)       set_timeout((&to), (mins)*1080)
  17. #define DELAY_TENTHS(tenths)        tdelay((tenths)*9/5)
  18. #define DELAY_SECS(secs)            tdelay((secs)*18)
  19. #define DELAY_MINS(mins)            tdelay((mins)*1080)
  20.  
  21. /* function declarations */
  22. int _C_ calc_crc(char *blk, int blksz);
  23. int _C_ update_crc(int oldcrc, char ch);
  24. int _C_ strcntch(char *str, char ch_to_cnt);
  25. char * _C_ strrstr(char *str1, char *str2);
  26. char * _C_ strpbrkf(char *str1, char *str2);
  27. char * _C_ strrtrim(char *str);
  28. char * _C_ strltrim(char *str);
  29. char * _C_ strtrim(char *str);
  30. char * _C_ strsum(char *, ...);               /* dest, str1, str2, ..., NULL */
  31. char * _C_ strrjust(char *str, int fldwidth, char pad);
  32. char * _C_ strljust(char *str, int fldwidth, char pad);
  33. char * _C_ strcentr(char *str, int fldwidth, char pad);
  34. int _C_ watchdogset(int flag, int commchipadrs);
  35. void interrupt _F_ watchdoghook(void);
  36. int _C_ ctshookset(int flag, int port, int chipadrs);
  37. void interrupt _F_ int14ctshook(void);
  38.  
  39.  /*------- NEW TIMER FUNCTIONS ---------*/
  40. int _C_ tickhookset(int flag); /* MUST disable before exiting program !!!!! */
  41. void _C_ set_timeout(long *timer, unsigned ticks);
  42. void _C_ set_longtimeout(long *timer, long ticks);
  43. int _C_ timed_out(long *timer);
  44. void _C_ tdelay(unsigned ticks);
  45. long _C_ get_ticker(void);
  46.  
  47.