home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sunquest!spades.aces.com!gavron
- From: gavron@spades.aces.com (Ehud Gavron 602-570-2000 x. 2546)
- Newsgroups: comp.os.vms
- Subject: Re: RMS RAB & FAB for VAXC file
- Message-ID: <8JAN199310215940@spades.aces.com>
- Date: 8 Jan 93 17:21:00 GMT
- References: <C0Bwu6.F59@wm.estec.esa.nl> <1ijk8dINNs5m@gap.caltech.edu>
- Sender: news@sunquest.UUCP
- Reply-To: gavron@ACES.COM
- Organization: ACES Consulting Inc.
- Lines: 53
- News-Software: VAX/VMS VNEWS 1.4-b1
-
- In article <1ijk8dINNs5m@gap.caltech.edu>, carl@SOL1.GPS.CALTECH.EDU writes...
- #In article <C0Bwu6.F59@wm.estec.esa.nl>, guy@wmsg02.wm.estec.esa.nl (Guy Brooker) writes:
- #>Coming back from my Christmas I have read a long discussion about VAX C
- #>buffer flushing. Many people say that it is easy to get the RAB/FABs from
- #>a VAX C FILE *
- #>
- #>OK so how do you do it ???
- #
- ..
- #There's no such routine (at least under VMS v5.4-2
- #in the VAXC RTL), though Ehud had indicated that a perusal of the listings will
- #allow you to figure out how to find it. Unfortunately, I don't have the
- #listings, and the contact for the CSLG here won't mount them except upon
- ..
-
- Ok, I can take a hint. The code below was shared with me by Jerry Leichter
- in early 1991, but still works today :)
-
- #--------------------------------------------------------------------------------
- #Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
-
- Ehud
-
- --
- Ehud Gavron (EG76)
- gavron@aces.com
-
- #include stdio
- #include rab;
- #include fab;
- #include nam;
- #define fcb_l_rab 0x0f4; /* This offset might change depending on vms
- version. It works for 5.4. */
- struct FAB *fabptr;
- struct RAB *rabptr;
- struct NAM *namptr;
- FILE fp;
- int *mp;
- main()
- {
- int fn = 0;
- fp = fopen("stuff.dat","w");
- mp = fp;
- rabptr = *mp + fcb_l_rab;
- printf("RAB.BID = %x.RAB.BLN = %x. RAB.FAB = %x. \n",
- rabptr->rab$b_bid,rabptr->rab$b_bln,rabptr->rab$l_fab);
- fabptr = rabptr->rab$l_fab;
- printf("FAB.BID = %x.FAB.BLN = %x. FAB.NAM = %x. \n",
- fabptr->fab$b_bid,fabptr->fab$b_bln,fabptr->fab$l_nam);
- namptr = fabptr->fab$l_nam;
- printf("Per NAM block, file name string is %.*s. \n",
- namptr->nam$b_rsl,namptr->nam$l_rsa);
- }
-