home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / muprg110.zip / STAMP.H < prev    next >
C/C++ Source or Header  |  1995-08-03  |  968b  |  61 lines

  1. #ifndef __STAMP_H_DEFINED
  2. #define __STAMP_H_DEFINED
  3.  
  4. #include "typedefs.h"
  5.  
  6. struct _stamp   /* DOS-style datestamp */
  7. {
  8.   struct
  9.   {
  10.     /* IBM Cset/2 is allergic to "unsigned short" when declaring bitfields! */
  11.  
  12. #ifdef __IBMC__
  13.     unsigned int da : 5;
  14.     unsigned int mo : 4;
  15.     unsigned int yr : 7;
  16. #else
  17. /*lint -e46 */
  18.     word da : 5;
  19.     word mo : 4;
  20.     word yr : 7;
  21. /*lint -restore */
  22. #endif
  23.   } date;
  24.  
  25.   struct
  26.   {
  27. #ifdef __IBMC__
  28.     unsigned int ss : 5;
  29.     unsigned int mm : 6;
  30.     unsigned int hh : 5;
  31. #else
  32. /*lint -e46 */
  33.     word ss : 5;
  34.     word mm : 6;
  35.     word hh : 5;
  36. /*lint -restore */
  37. #endif
  38.   } time;
  39. };
  40.  
  41.  
  42. struct _dos_st
  43. {
  44.   word date;
  45.   word time;
  46. };
  47.  
  48. /* Union so we can access stamp as "int" or by individual components */
  49.  
  50. union stamp_combo   
  51. {
  52.   dword ldate;
  53.   struct _stamp msg_st;
  54.   struct _dos_st dos_st;
  55. };
  56.  
  57. typedef union stamp_combo SCOMBO;
  58.  
  59. #endif /* __STAMP_H_DEFINED */
  60.  
  61.