/* Ported to GNU C openVMS/Alpha by Klaus Kämpf, kkaempf@progis.de */ /* * * RMS Record Access Block (rab) definitions */ #ifndef _RABDEF_H #define _RABDEF_H #ifdef __cplusplus extern "C" { #endif /* There is one rab per connected stream it is used for all communications between the user and rms concerning operations on the stream. */ #define RAB$C_BID 1 /* code for rab */ /* special ISI fields for process permanent files */ #define RAB$V_PPF_RAT 6 #define RAB$M_PPF_RAT 0x3FC0 #define RAB$S_PPF_RAT 8 #define RAB$V_PPF_IND 14 #define RAB$M_PPF_IND 0x4000 #define RAB$V_PPISI 15 #define RAB$M_PPISI 0x8000 /* record options (ROP) mask bits */ #define RAB$V_ASY 0 #define RAB$V_TPT 1 #define RAB$V_REA 2 #define RAB$V_RRL 3 #define RAB$V_UIF 4 #define RAB$V_MAS 5 #define RAB$V_FDL 6 #ifndef NO_VMS_V6 #define RAB$V_REV 7 #endif #ifndef ONLY_VMS_V6 #define RAB$V_HSH 7 #endif #define RAB$V_EOF 8 #define RAB$V_RAH 9 #define RAB$V_WBH 10 #define RAB$V_BIO 11 #define RAB$V_CDK 12 #define RAB$V_LV2 12 #define RAB$V_LOA 13 #define RAB$V_LIM 14 #define RAB$V_SYNCSTS 15 #define RAB$V_LOC 16 #define RAB$V_WAT 17 #define RAB$V_ULK 18 #define RAB$V_RLK 19 #define RAB$V_NLK 20 #define RAB$V_KGE 21 #define RAB$V_EQNXT RAB$V_KGE /* 21 */ #define RAB$V_KGT 22 #define RAB$V_NXT RAB$V_KGT /* 22 */ #define RAB$V_NXR 23 #define RAB$V_RNE 24 #define RAB$V_TMO 25 #define RAB$V_CVT 26 #define RAB$V_RNF 27 #define RAB$V_ETO 28 #define RAB$V_PTA 29 #define RAB$V_PMT 30 #define RAB$V_CCO 31 #define RAB$M_ASY (1< or = */ unsigned rab$v_kgt : 1; /* key greater than */ unsigned rab$v_nxr : 1; /* get non-existent record */ /* The following bits are terminal qualifiers only. (separate byte) */ unsigned rab$v_rne : 1; /* read no echo */ unsigned rab$v_tmo : 1; /* use time-out period */ unsigned rab$v_cvt : 1; /* convert to upper case */ unsigned rab$v_rnf : 1; /* read no filter */ unsigned rab$v_eto : 1; /* extended terminal operation */ unsigned rab$v_pta : 1; /* purge type ahead */ unsigned rab$v_pmt : 1; /* use prompt buffer */ unsigned rab$v_cco : 1; /* cancel control o on output */ } rab$r_rop_bits0; #define rab$v_asy rab$r_rop_overlay.rab$r_rop_bits0.rab$v_asy #define rab$v_tpt rab$r_rop_overlay.rab$r_rop_bits0.rab$v_tpt #define rab$v_rea rab$r_rop_overlay.rab$r_rop_bits0.rab$v_rea #define rab$v_rrl rab$r_rop_overlay.rab$r_rop_bits0.rab$v_rrl #define rab$v_uif rab$r_rop_overlay.rab$r_rop_bits0.rab$v_uif #define rab$v_mas rab$r_rop_overlay.rab$r_rop_bits0.rab$v_mas #define rab$v_fdl rab$r_rop_overlay.rab$r_rop_bits0.rab$v_fdl #define rab$v_rev rab$r_rop_overlay.rab$r_rop_bits0.rab$v_rev #ifndef rab$v_hsh #define rab$v_hsh rab$r_rop_overlay.rab$r_rop_bits0.rab$v_hsh #endif #define rab$v_eof rab$r_rop_overlay.rab$r_rop_bits0.rab$v_eof #define rab$v_rah rab$r_rop_overlay.rab$r_rop_bits0.rab$v_rah #define rab$v_wbh rab$r_rop_overlay.rab$r_rop_bits0.rab$v_wbh #define rab$v_bio rab$r_rop_overlay.rab$r_rop_bits0.rab$v_bio #define rab$v_cdk rab$r_rop_overlay.rab$r_rop_bits0.rab$v_cdk #define rab$v_loa rab$r_rop_overlay.rab$r_rop_bits0.rab$v_loa #define rab$v_lim rab$r_rop_overlay.rab$r_rop_bits0.rab$v_lim #define rab$v_syncsts rab$r_rop_overlay.rab$r_rop_bits0.rab$v_syncsts #define rab$v_loc rab$r_rop_overlay.rab$r_rop_bits0.rab$v_loc #define rab$v_wat rab$r_rop_overlay.rab$r_rop_bits0.rab$v_wat #define rab$v_ulk rab$r_rop_overlay.rab$r_rop_bits0.rab$v_ulk #define rab$v_rlk rab$r_rop_overlay.rab$r_rop_bits0.rab$v_rlk #define rab$v_nlk rab$r_rop_overlay.rab$r_rop_bits0.rab$v_nlk #define rab$v_kge rab$r_rop_overlay.rab$r_rop_bits0.rab$v_kge #define rab$v_kgt rab$r_rop_overlay.rab$r_rop_bits0.rab$v_kgt #define rab$v_nxr rab$r_rop_overlay.rab$r_rop_bits0.rab$v_nxr #define rab$v_rne rab$r_rop_overlay.rab$r_rop_bits0.rab$v_rne #define rab$v_tmo rab$r_rop_overlay.rab$r_rop_bits0.rab$v_tmo #define rab$v_cvt rab$r_rop_overlay.rab$r_rop_bits0.rab$v_cvt #define rab$v_rnf rab$r_rop_overlay.rab$r_rop_bits0.rab$v_rnf #define rab$v_eto rab$r_rop_overlay.rab$r_rop_bits0.rab$v_eto #define rab$v_pta rab$r_rop_overlay.rab$r_rop_bits0.rab$v_pta #define rab$v_pmt rab$r_rop_overlay.rab$r_rop_bits0.rab$v_pmt #define rab$v_cco rab$r_rop_overlay.rab$r_rop_bits0.rab$v_cco struct { unsigned : 21; unsigned rab$v_eqnxt : 1; /* synonyms for KGE and */ unsigned rab$v_nxt : 1; /* KGT */ unsigned : 1; } rab$r_rop_bits1; #define rab$v_eqnxt rab$r_rop_overlay.rab$r_rop_bits1.rab$v_eqnxt #define rab$v_nxt rab$r_rop_overlay.rab$r_rop_bits1.rab$v_nxt struct { unsigned : 8; /* char fill; */ unsigned char rab$b_rop1; /* various options */ unsigned char rab$b_rop2; /* get/find options (use of this field discouraged */ /* due to REA and RRL being in a different byte) */ unsigned char rab$b_rop3; /* terminal read options */ } rab$r_rop_fields; #define rab$b_rop1 rab$r_rop_overlay.rab$r_rop_fields.rab$b_rop1 #define rab$b_rop2 rab$r_rop_overlay.rab$r_rop_fields.rab$b_rop2 #define rab$b_rop3 rab$r_rop_overlay.rab$r_rop_fields.rab$b_rop3 } rab$r_rop_overlay; unsigned long rab$l_sts; /* status */ union { unsigned long rab$l_stv; /* status value */ #define rab$l_stv rab$r_stv_overlay.rab$l_stv struct { unsigned short rab$w_stv0; /* low word of stv */ unsigned short rab$w_stv2; /* high word of stv */ } rab$r_stv_fields; #define rab$l_stv rab$r_stv_overlay.rab$l_stv #define rab$w_stv0 rab$r_stv_overlay.rab$r_stv_fields.rab$w_stv0 #define rab$w_stv2 rab$r_stv_overlay.rab$r_stv_fields.rab$w_stv2 } rab$r_stv_overlay; union { unsigned short rab$w_rfa[3]; /* record's file address */ #define rab$w_rfa rab$r_rfa_overlay.rab$w_rfa struct { unsigned long rab$l_rfa0 __attribute__ ((packed)); unsigned short rab$w_rfa4 __attribute__ ((packed)); } rab$r_rfa_fields __attribute__ ((packed)); #define rab$l_rfa0 rab$r_rfa_overlay.rab$r_rfa_fields.rab$l_rfa0 #define rab$w_rfa4 rab$r_rfa_overlay.rab$r_rfa_fields.rab$w_rfa4 } rab$r_rfa_overlay; unsigned short : 16; /* short fill; (reserved - rms release 1 optimizes stores to the */ /* rfa field to be a move quad, overwriting this reserved word) */ unsigned long rab$l_ctx; /* user context */ unsigned short : 16; /* short fill; (spare) */ unsigned char rab$b_rac; /* record access */ unsigned char rab$b_tmo; /* time-out period */ unsigned short rab$w_usz; /* user buffer size */ unsigned short rab$w_rsz; /* record buffer size */ void *rab$l_ubf; /* user buffer address */ void *rab$l_rbf; /* record buffer address */ void *rab$l_rhb; /* record header buffer addr */ union { void *rab$l_kbf; /* key buffer address */ void *rab$l_pbf; /* prompt buffer addr */ #define rab$l_pbf rab$r_kbf_overlay.rab$l_pbf #define rab$l_kbf rab$r_kbf_overlay.rab$l_kbf } rab$r_kbf_overlay; union { unsigned char rab$b_ksz; /* key buffer size */ unsigned char rab$b_psz; /* prompt buffer size */ #define rab$b_psz rab$r_ksz_overlay.rab$b_psz #define rab$b_ksz rab$r_ksz_overlay.rab$b_ksz } rab$r_ksz_overlay; unsigned char rab$b_krf; /* key of reference */ char rab$b_mbf; /* multi-buffer count */ unsigned char rab$b_mbc; /* multi-block count */ union { unsigned long rab$l_bkt; /* bucket hash code, vbn, or rrn */ unsigned long rab$l_dct; /* duplicates count on key accessed on alternate key */ #define rab$l_dct rab$r_bkt_overlay.rab$l_dct #define rab$l_bkt rab$r_bkt_overlay.rab$l_bkt } rab$r_bkt_overlay; struct fabdef *rab$l_fab; /* related fab for connect */ struct xabdef *rab$l_xab; /* XAB address */ } __attribute__ ((packed)); #define RAB rabdef /* declare initialized prototype data structure */ #ifdef __ALPHA extern struct RAB *cc$rms_rab_ptr __asm("DECC$GA_RMS_RAB"); #define cc$rms_rab (*cc$rms_rab_ptr) #else extern struct RAB cc$rms_rab __asm("_$$PsectAttributes_GLOBALSYMBOL$$cc$rms_rab"); #endif #ifdef __cplusplus } #endif #endif /*_RABDEF_H*/