home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l350 / 3.ddi / EXAMPLES / C / LIBTEST.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-11  |  1.2 KB  |  43 lines

  1. //
  2. // This program demonstrates calling routines in the C library, the 
  3. // DOSX32 library of _dx_ routines, and the DOS32 library of _dos_ routines.
  4. //
  5. #include <stdlib.h>    // C library header
  6. #include <stdio.h>    // C library header
  7. #include <dos.h>    // C library header
  8.  
  9. #include <pharlap.h>    // Phar Lap header for _dx_ routines
  10. #include <pldos32.h>    // Phar Lap header for  _dos_ routines 
  11.  
  12. #ifdef __WATCOMC__
  13. #define _dosdate_t dosdate_t
  14. #endif
  15.  
  16. int main()
  17. {
  18.     CONFIG_INF config;    // 386|DOS-Extender configuration info
  19.     UCHAR    buf[256];    // buffer for _dx_config_inf call
  20.     struct _dosdate_t date;    // current system date
  21.  
  22. //
  23. // Call _dx_config_inf in the DOSX32.LIB library
  24. //
  25.     _dx_config_inf(&config, buf);
  26.  
  27. //
  28. // Call _dos_getdate in the DOS32.LIB library.
  29. // For MetaWare High C/C++ and Watcom C/386, the _dos_ routines are included
  30. // in the C library, so you don't link in DOS32.LIB.
  31. //
  32.     _dos_getdate(&date);
  33.  
  34. //
  35. // Call printf in the standard C library.
  36. //
  37.     printf("386|DOS-Extender version %d.%d, on a %d86 machine\n",
  38.             config.c_major, config.c_minor, config.c_processor);
  39.     printf("Date is %d/%d/%d\n", date.month, date.day, date.year);
  40.  
  41.     return 0;
  42. }
  43.