When the sort option is specified in the bsrtopen function and records are passed from user applications to PowerBSORT, the bsrtput function is used.
Format
#include "bsrt.h" BSRTFUNC func; (Note) int func.bsrtput(BSPTR_BSRTREC rec);
NOTE
func is a parameter specified in thebsrtopen function.
Function explanation
The function of the bsrtput function is shown below.
Records or record groups are passed from the user applications to PowerBSORT.
The end of the records or record groups is notified to PowerBSORT.
How to pass record group
When two or more records are passed to PowerBSORT at once, specify the length of the record group in rec_len of BSRTREC structure.
The length of the record group is in multiple of the number of records of record length in the fixed-length record format. In the variable-length record format, area of the record length (long type of C language) is prefaced for each record. The length of record group is accumulated length of the record and record length area. The record length does not include the area of the record length. In text file, the record that includes line feed character is stored in a continuous area. The length of the record group is the length from the head of the record to the line feed character of the last record.
Parameter detail
In the following, it explains the parameter of the bsrtput 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 bsrtput function are as follows.
Return value | Meaning |
---|---|
0 | This shows that the bsrtput function ended normally. |
1 | This shows that the end of the record or record group was normally accepted. |
-1 | This shows that an error occurred in the bsrtput function. |