When the sort option is specified in the bsrtopen function and record of the sort result is received from PowerBSORT, the bsrtget function is used.
Format
#include "bsrt.h" BSRTFUNC func; (Note) int func.bsrtget(BSPTR_BSRTREC rec);
NOTE
func is a parameter specified in thebsrtopen function.
Function explanation
The function of the bsrtget function is shown below.
Record or record group is received from PowerBSORT.
The end of record or record group is notified from PowerBSORT.
Format of record group to be returned
Individual record is stored and returned to a continuous area.
For the fixed-length record format, the address on the first record is set in rec_addr of BSRTREC structure and the length of the record group (in multiple of the number of the records of the record length) is set in rec_len of BSRTREC structure. For the variable-length record format, the address on the first record is set in rec_addr of BSRTREC structure in the form with the area where the record length (long type of C language) was stored in the head of each record and length in which the area of the record and the record length are accumulated is set in rec_len of BSRTREC structure. For the record in text files, record that includes line feed characters is stored and returned to a continuous area. The address of the first record is set in rec_addr of BSRTREC structure and the length in which the records to be returned are accumulated is set in rec_len of BSRTREC structure.
Parameter detail
In the following, it explains the parameter of the bsrtget function.
rec
This specifies rec specified in bsrtopen function.
Information
BSPTR_BSRTREC is a pointer of BSRTREC structure.
Return value
The return values of the bsrtget function are as follows.
Return value | Meaning |
---|---|
0 | This shows that the bsrtget function ended normally. |
1 | This shows that the bsrtget function ended normally. |
-1 | This shows that an error occurred in the bsrtget function. |