<None>

rankin at airgpx.caltech.edu rankin at airgpx.caltech.edu
Sun Aug 26 14:41:59 AEST 1990


In newsgroup comp.lang.c, article <3204 at dftsrv.gsfc.nasa.gov>,\
 vander at nssdcb.gsfc.nasa.gov (John Vanderpool) writes:
> a few days ago someone asked for the "magic" offset using VAXC I/O file
> pointers to the RMS structures - i didn't see anyone reply and was wondering
> if anybody replied to him personally if they could e-mail me the info.

     I didn't notice the original request; here's an answer though.
This intro is condensed from the V5.2 fiche for module VAXCIO:
 ;.sbttl  _fstat - return FAB and NAM and RAB block address
 ; FSTAT needs to use some fields in the FAB, so this routine returns the
 ; address of the FAB and NAM and RAB block address. [074]
 ;   Inputs:	4(ap)	file descriptor number
 ;		8(ap)	address to receive FAB address
 ;		12(ap)	address to receive NAM block address
 ;   [074]	16(ap)	address to receive RAB block address
 ;   Outputs:	R0	< 0 => error, >= 0 => success

     If you'd prefer that in C, here's a usage example:
#include <stdio.h>
#include <rms.h>
extern int _fstat(int, struct FAB **, struct NAM **, struct RAB **);
..
    FILE *fp;
    struct FAB *fab_p;
    struct NAM *nam_p;
    struct RAB *rab_p;
    int result = _fstat(fileno(fp), &fab_p, &nam_p, &rab_p);
    if ( result >= 0 ) {
	/* do something with one or more of the RMS blocks */
    }

     This routine is not accessible in the shareable image version of
VAXCRTL.  You'll have to link with the object library (vaxcrtl.olb).

     Since this isn't documented or intended for use by mere mortals,
they can change or eliminate it without any qualms.  Use at your own
risk.  (I don't--and won't--use it; simpler just use RMS directly if
one needs the file attributes, fully parsed filename, or whatever).

		Pat Rankin, rankin at eql.caltech.edu



More information about the Comp.lang.c mailing list