Top
PowerBSORT V7.0 User's Guide
FUJITSU Software

7.5.2 BSRTREC structure

The BSRTREC structure is a structure to receive and to pass the record between PowerBSORT and the user application.
In the BSRTREC structure, there is no member that user application sets before issuing the bsrtopen function.

typedef struct {
    BSPTR_VOID       sort_table;
    unsigned long    errdetail;
    unsigned long    in_count;
    unsigned long    out_count;
    BSPTR_VOID       rec_addr;
    unsigned long    rec_len;
    unsigned char    rec_status;
    unsigned char    mgrec_status;
    unsigned short   mgrec_string;
    BSPTR_VOID       mgrec_addr;
    unsigned long    mgrec_len;
    unsigned long    hProcFile;
    unsigned long    sub_error_code;
} BSRTREC;

BSRTREC structure member

In the following, it explains about the member of the BSRTREC structure.

sort_table

This sets an address in work area that PowerBSORT uses when the bsrtopen function is processed.
This member is a specific area that PowerBSORT uses and the user application should guarantee the content from the issue of the bsrtopen function to the completion of the issue of the bsrtclse function. The user application need not do anything to this member.

errdetail

When an error is detected while PowerBSORT is being executed, error detail codes of BSORT function is set.
The user application can know occurrence of error by return value of each BSORT function. The user applications don't have to refer to the member except for the case of error occurrence.

in_count

The number of records that PowerBSORT received from the user application is notified to the user application whenever the records are handed over.
Refer to this member when the user application is necessary.

out_count

The number of records that PowerBSORT handed over to the user application is notified to the user application whenever the records are handed over.
Refer to this member when the user application is necessary.

rec_addr

rec_len

rec_status

mgrec_status

This allows PowerBSORT to notify input request of the record.
This member is set when the bsrtmrge function is used. Either of the following is set.

Define value

Meaning

BS_REQ

This shows input request of the record is set.
The record of the string that mgrec_string shows is passed in the following bsrtmrge function.

BS_NOREQ

There is no input request of the record.
Set NULL for rec_addr and set 0 for rec_len, and issue the bsrtmrge function again.

mgrec_string

This sets the string number of record to be passed to PowerBSORT.
When the first record is passed in the bsrtmrge function set to 0. PowerBSORT sets the string number after the first call and should be let unaltered. User application should pass the string number back to PowerBSORT on subsequent calls to the bsrtmrge function. This member is set when the bsrtmrge function is used.

mgrec_addr

This sets address of the record to be returned to the user application.
NULL is set when there is no record to be returned. This member is set when the bsrtmrge function is used.

mgrec_len

This sets the length of the record to be returned to the user application.
0 is set when there is no record to be returned. This member is set when the bsrtmrge function is used.

hProcFile

This is a member that PowerBSORT uses for processing.
The user application need not do anything to this member.

sub_error_code

When the error occurs in the file system, the detail code is set.