From:	SMTP%"hoffman@xdelta.enet.dec.com" 22-JUN-1994 12:34:37.54
To:	EVERHART
CC:	
Subj:	Re: RAB's XAB's, FILE's and FAB's

From: hoffman@xdelta.enet.dec.com (Stephen Hoffman)
X-Newsgroups: comp.os.vms
Subject: Re: RAB's XAB's, FILE's and FAB's
Date: 22 Jun 1994 15:19:41 GMT
Organization: Digital Equipment Corporation
Lines: 38
Distribution: world
Message-ID: <2u9kqd$i3h@jac.zko.dec.com>
Reply-To: hoffman@xdelta.enet.dec.com (Stephen Hoffman)
NNTP-Posting-Host: XDELTA
X-Newsreader: mxrn 6.18-5
To: Info-VAX@CRVAX.SRI.COM
X-Gateway-Source-Info: USENET


In article <2u9fl4$45@freenet3.scri.fsu.edu>, jimhowes@freenet2.scri.fsu.edu
(Jim Howes) writes:

|>How do I get from a FILE * in C (or even a int (returned from open() )
|>to the address of a RAB
|>So far I've worked out that on AXP/VMS I can use (*fp)[0x0d] (from
|>FILE, and on VMS use something like myrabaddr = (RAB *)&((long *)*fp)[61]

|>Neither of these look very 'official', and could of course be mere
|>coincedences - Anyone got anything better.
|>I need to get the RAB to do a SYS$FLUSH(RAB,sun,err) on a file
|>(fflush() only flushes the RTL buffers, not the RMS buffers)

   The simplest way to flush the buffers to disk is to use the call
   that is intended to do this: fsynch().  The DEC C documentation
   includes cross-references between fflush() and fsynch() -- making
   this information easier to find.

   To at the FAB and RAB underneath the C RTL, use the "acc" keyword on
   the open() or create()-- this calls a user-written function and passes
   in the FAB and RAB addresses.  Examples of the open() call and the
   callback routine follow:

     open("file.dat", O_RDONLY, 0 ,"acc", acc_callback, &first_arg)
     VAX: int acc_callback( int *first_arg,
                            FAB *fab, RAB *rab);
     AXP: int acc_callback( int *first_arg,
                            struct FAB *fab, struct RAB *rab);

   Since you are working with an OpenVMS AXP system, I have assumed the
   use of DEC C on both OpenVMS AXP and OpenVMS VAX.
 
-- 

  Steve Hoffman          hoffman@xdelta.enet.dec.com          EMT-Intermediate
      OSHA BBP training in 10 seconds: "Blood is Bad.  Gloves are Good."
   "I may work for Digital Equipment Corporation, but I don't speak for it."

