Xref: utzoo comp.os.vms:29552 comp.lang.c:31376 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!elroy.jpl.nasa.gov!jarthur!nntp-server.caltech.edu!airgpx.caltech.edu!rankin From: rankin@airgpx.caltech.edu Newsgroups: comp.os.vms,comp.lang.c Subject: Summary: access to RMS data structures from C file pointers Keywords: VAXC, RMS Message-ID: <1990Aug25.204159.1@airgpx.caltech.edu> Date: 26 Aug 90 04:41:59 GMT References: <3204@dftsrv.gsfc.nasa.gov> Sender: news@laguna.ccsf.caltech.edu Followup-To: comp.lang.c Organization: California Institute of Technology Lines: 40 In newsgroup comp.lang.c, article <3204@dftsrv.gsfc.nasa.gov>,\ vander@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 #include 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@eql.caltech.edu