/* Ported to GNU C openVMS/Alpha by Klaus Kämpf, kkaempf@progis.de */ /* * * RMS date/time XAB definitions */ #ifndef _XABDATDEF_H #define _XABDATDEF_H #ifdef __cplusplus extern "C" { #endif #define XAB$C_DAT 18 /* xabdat ID code */ #define XAB$K_DATLEN_V2 36 /* version 2 XABDAT length */ #define XAB$C_DATLEN_V2 36 #ifndef NO_VMS_V6 # define XAB$K_DATLEN_V54 44 /* version 5.4 XABDAT length */ # define XAB$C_DATLEN_V54 44 # define XAB$K_DATLEN_V60 60 /* version 6.0 XABDAT length */ # define XAB$C_DATLEN_V60 60 #endif #define XAB$K_DATLEN (sizeof (struct XABDAT)) #define XAB$C_DATLEN XAB$K_DATLEN #ifndef __XABSTART_FIELDS #include #endif #ifdef __ALPHA #define __XABDAT_DATE5_FIELDS \ unsigned long long xab$q_rdt; /* revision date & time */ \ unsigned long long xab$q_cdt; /* creation date & time */ \ unsigned long long xab$q_edt; /* expiration date & time */ \ /*- end of v20 XABDAT -*/ \ unsigned long long xab$q_bdt; /* backup date and time */ \ /*- end of v54 XABDAT -*/ # define __XABDAT_XTRA_FIELDS \ unsigned long long xab$q_rcd; /* recorded date and time */ \ unsigned long long xab$q_eff; /* effective date and time */ \ /*- end of v60 XABDAT -*/ #else /* VAX */ #define __XABDAT_DATE5_FIELDS \ unsigned long xab$q_rdt[2]; /* revision date & time */ \ unsigned long xab$q_cdt[2]; /* creation date & time */ \ unsigned long xab$q_edt[2]; /* expiration date & time */ \ /*- end of v20 XABDAT -*/ \ unsigned long xab$q_bdt[2]; /* backup date and time */ \ /*- end of v54 XABDAT -*/ # define __XABDAT_XTRA_FIELDS \ unsigned long xab$q_rcd[2]; /* recorded date and time */ \ unsigned long xab$q_eff[2]; /* effective date and time */ \ /*- end of v60 XABDAT -*/ #endif /* __ALPHA */ #define __XABDAT_FIELDS \ __XABSTART_FIELDS \ unsigned short xab$w_rvn; /* revision number */ \ unsigned short : 16; /* spare */ \ __XABDAT_DATE5_FIELDS struct XABDAT { __XABDAT_FIELDS #ifdef ONLY_VMS_V6 __XABDAT_XTRA_FIELDS #endif } __attribute__ ((packed)); #ifndef NO_VMS_V6 struct XABDAT_V54 { __XABDAT_FIELDS } __attribute__ ((packed)); struct XABDAT_V60 { __XABDAT_FIELDS __XABDAT_XTRA_FIELDS } __attribute__ ((packed)); #endif /*!NO_VMS_V6*/ struct xabdatdef { __XABDAT_FIELDS #ifndef NO_VMS_V6 __XABDAT_XTRA_FIELDS #endif /*!NO_VMS_V6*/ } __attribute__ ((packed)); #undef __XABDAT_FIELDS #undef __XABDAT_XTRA_FIELDS /* declare initialized prototype data structure */ #ifdef __ALPHA extern struct XABDAT cc$rms_xabdat_ptr __asm("DECC$GA_RMS_XABDAT"); # define cc$rms_xabdat (*cc$rms_xabdat_ptr) #else extern struct XABDAT cc$rms_xabdat __asm("_$$PsectAttributes_GLOBALSYMBOL$$cc$rms_xabdat"); /* globalref struct XABDAT cc$rms_xabdat; */ #endif #ifndef NO_VMS_V6 /* *** Note well!!! *** Normal use of cc$rms_xabdat has become very dangerous, because there's no way to tell whether the C run-time library has created it using the old definition of XABDAT or the new one without examining its length field, which isn't practical for use as a static initializer. If it is created using the old definition, but here we tell the compiler that it has the size and shape of the new structure, then when using it as an initializer, 16 bytes of arbitrary garbage will be copied into the last two fields--assuming an access violation is not triggered, that is. *** */ #endif /*!NO_VMS_V6*/ #ifdef __cplusplus } #endif #endif /*_XABDATDEF_H*/