ILE C/C++ Programmer's Guide

Checking the System Exceptions for Record Files

To detect record file errors, you can check some values in the _RIOFB_T structure, which is defined in <recio.h>. Both the num_bytes field and the sysparm field contain information regarding record file I/O errors.

The following figure shows the type definition of the _RIOFB_T structure:

Figure 163. _RIOFB_T Type Definition


typedef struct {
  unsigned char   *key;
  _Sys_Struct_T   *sysparm;(1), (3)
  unsigned long   rrn;
  long            num_bytes;(1)
  short           blk_count;
  char            blk_filled_by;
  int             dup_key   : 1;
  int             icf_locate: 1;
  int             reserved1 : 6;
  char            reserved2[20];
} _RIOFB_T;

Notes:

  1. If your program processes display, ICF, or printer files as record files, you can check the values in the num_bytes field in the _RIOFB_T structure and the major/minor return code fields in the sysparm area of the _RIOFB_T structure. The num_bytes field indicates if the I/O operation was successful.

  2. If your program processes database files as stream files, you can check the values in some fields of the _RIOFB_T structure.

  3. The sysparm field points to a structure that contains the major/minor return code for display, ICF, or printer files. The definition of _Sys_Struct_T structure is shown below:

Figure 164. _Sys_Struct_T Type Definition




typedef struct { /* System specific information */
void *sysparm_ext;
_Maj_Min_rc_T _Maj_Min;
char reserved1[12];
} _Sys_Struct_T;

The following figure shows the definition of the _Maj_Min_rc_T structure:

Figure 165. _Maj_Min_rc_T Type Definition




typedef struct {
char major_rc[2];
char minor_rc[2];
} _Maj_Min_rc_T;


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