ILE C/C++ Run-Time Library Functions


_Rdevatr() -- Get Device Attributes

Format

#include <recio.h>
#include <xxfdbk.h>
_XXDEV_ATR_T *_Rdevatr(_RFILE *fp, char *dev);

Language Level: ILE C Extension

Threadsafe: No.

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.

Note:
The dev parameter string must be EBCIDIC, even if the program is compiled using LOCALETYPE(*LOCALEUTF).

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


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]