Format
#include <recio.h> int _Racquire(_RFILE *fp, char *dev);
Language Level: ILE C Extension
Threadsafe: No.
Description
The _Racquire() function acquires the program device specified by the dev parameter and associates it with the file specified by fp. The dev parameter is a null-ended C string. The program device name must be specified in uppercase. The program device must be defined to the file.
This function is valid for display and ICF files.
Return Value
The _Racquire() function returns 1 if it is successful or zero if it is unsuccessful. The value of errno may be set to EIOERROR (a non-recoverable I/O error occurred) or EIORECERR (a recoverable I/O error occurred).
See Table 12 and Table 14 for errno settings.
Example that uses _Racquire()
#include <stdio.h> #include <recio.h> #include <string.h> #include <stdlib.h> int main(void) { _RFILE *fp; _RIOFB_T *rfb; /* Open the device file. */ if (( fp = _Ropen ( "MYLIB/T1677RD2", "ar+" )) == NULL ) { printf ( "Could not open file\n" ); exit ( 1 ); } _Racquire ( fp,"DEVICE1" ); /* Acquire another program device. */ /* Replace with actual device name.*/ _Rformat ( fp,"FORMAT1" ); /* Set the record format for the */ /* display file. */ rfb = _Rwrite ( fp, "", 0 ); /* Set up the display. */ /* Do some processing... */ _Rclose ( fp ); }
Related Information
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.