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
For bsrtput function
This sets the address of record passed to PowerBSORT.
When BS_IM is specified for recoprat of the BSRTPRIM structure specified in bsrtopen function, the address of the record group is set.
For bsrtget function
This sets the address of record returned to user application.
When BS_OM is specified for recoprat of the BSRTPRIM structure specified in the bsrtopen function, the address of the record group is set. NULL is set when there is no record or record group to be returned.
For bsrtmrge function
This sets address of the record passed to PowerBSORT.
rec_len
For bsrtput function
This sets the length of the record passed to PowerBSORT.
When BS_IM is specified for recoprat of the BSRTPRIM structure specified in bsrtopen function, the length of the record group is set. When the record of the text file is passed, the length of the record including line feed character is set.
For bsrtget function
This sets the length of the record returned to user application.
When BS_OM is specified for recoprat of the BSRTPRIM structure specified in the bsrtopen function, the length of the record group is set. 0 is set when there is no record or record group to be returned.
For bsrtmrge function
This sets the length of the record passed to PowerBSORT.
When the record of the text file is passed, the length of the record including line feed character is set.
rec_status
For bsrtput function
This notifies whether the records have been passed.
Set either of the following.
Define value | Meaning |
---|---|
BS_CONT | Records to be passed to PowerBSORT are left. |
BS_ENDDATA | Record to be passed to PowerBSORT is not left. |
For bsrtget function
This is not used.
For bsrtmrge function
This notifies whether it is the final record.
Set either of the following.
Define value | Meaning |
---|---|
BS_CONT | Records in the string of mgrec_string are left. |
BS_ENDDATA | Records in the string of mgrec_string are not left. |
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. |
BS_NOREQ | There is no input request of the record. |
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.