home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / print / ascii2ps / nenscrib / machdep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-03  |  1.3 KB  |  62 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. /*****************************************************
  6.  *
  7.  *  MSDOS stuff 
  8.  *
  9.  *****************************************************/
  10.  
  11. #ifdef MSDOS
  12.  
  13. # include <ctype.h>
  14. # include <string.h>
  15. # include <malloc.h>
  16.  
  17. # define STRICMP(s1,s2) _stricmp (s1,s2)
  18. # ifdef _WINDOWS
  19. #  define    STRDUP(str)    _strdup(str)
  20. # else
  21. #  define    STRDUP(str)    strdup(str)
  22. # endif
  23.  
  24. # define USERNAME    getenv("LOGNAME")!=NULL?getenv("LOGNAME"):getenv("USER")!=NULL?getenv("USER"):"Unknown")
  25.  
  26. # define    GETTIME(tm,str)    strftime(str,15,"%X",tm)
  27.  
  28. # ifdef US_VERSION
  29. #  define     GETDATE(tm,str) strftime(str,15,"%b %d %y",tm)
  30. # else
  31. #  define    GETDATE(tm,str) strftime(str,15,"%d %b %y",tm)
  32. # endif
  33.  
  34. #else
  35.  
  36. /*****************************************************
  37.  *
  38.  *  Unix stuff
  39.  *
  40.  *****************************************************/
  41.  
  42. # include <pwd.h>
  43. # include <string.h>
  44.  
  45. # define    LPR        "lpr -P "        /* spooler with option to set name of printer */
  46.  
  47. # define    STRICMP(s1,s2)    strcasecmp(s1,s2)
  48. # define    STRDUP(str)    strdup(str)
  49.  
  50. # define    USERNAME    ((getpwuid (getuid()))->pw_name)
  51.  
  52. # define     GETTIME(tm,str)    strftime(str,15,"%T",tm)
  53.  
  54. # ifdef US_VERSION
  55. #  define    GETDATE(tm,str) strftime(str,15,"%h %d %y",tm)
  56. # else
  57. #  define    GETDATE(tm,str) strftime(str,15,"%d %h %y",tm)
  58. # endif
  59.  
  60. #endif
  61.  
  62.