Format
#include <recio.h>
#include <xxfdbk.h>
_XXDEV_ATR_T *_Rdevatr(_RFILE *fp, char *dev);
Language Level: ILE C Extension
Threadsafe: No.
Job CCSID Interface: All character data sent to this function is expected to be in the CCSID of the job. All character data returned by this function is in the CCSID of the job. See Understanding CCSIDs and Locales for more information.
Description
The _Rdevatr() function returns a pointer to a copy of the device attributes feedback area for the file pointed to by fp, and the device specified by dev.
The dev parameter is a null-ended C string. The device name must be specified in uppercase.
The _Rdevatr() function is valid for display and ICF files.
Return Value
The _Rdevatr() function returns NULL if an error occurs.
See Table 12 and Table 14 for errno settings.
Example that uses _Rdevatr()
#include <stdio.h>
#include <recio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char ** argv)
{
_RFILE *fp; /* File pointer */
_RIOFB_T *rfb; /*Pointer to the file's feedback structure */
_XXIOFB_T *iofb; /* Pointer to the file's feedback area */
_XXDEV_ATR_T *dv_atr; /* Pointer to a copy of the file's device */
/* attributes feedback area */
/* Open the device file. */
if (( fp = _Ropen ( "MYLIB/T1677RD2", "ar+" )) == NULL )
{
printf ( "Could not open file\n" );
exit ( 1 );
}
dv_atr = _Rdevatr (fp, argv[1]);
if (dv_atr == NULL)
printf("Error occurred getting device attributes for %s.\n",
argv[1]);
_Rclose ( fp );
}
Related Information