Guardian Procedure Calls Reference Manual

READLOCK[X] Procedures
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Condition Code Settings
Considerations
OSS Considerations
Considerations for READLOCKX Only
Errors for READLOCKX Only
Related Programming Manuals
Summary
The READLOCK[X] procedures sequentially lock and read records in a disk file, exactly like the
combination of LOCKREC and READ[X]. The READLOCK procedure is intended for use with 16-bit
addresses, while the READLOCKX procedure is intended for use with 32-bit extended addresses.
The data buffer for READLOCKX can be either in the caller's stack segment or any extended data
segment.
NOTE: The READLOCK[X] procedures perform the same operation as the FILE_READLOCK64_
Procedure (page 482), which is recommended for new code.
Key differences in FILE_READLOCK64_ are:
The pointer and tag parameters are 64 bits wide.
The read-count parameter is 32 bits wide.
The procedure returns an error code value rather than a condition code, simplifying
error-handling code.
Syntax for C Programmers
#include <cextdecs(READLOCK)>
_cc_status READLOCK ( short filenum
,short _near *buffer
,unsigned short read-count
,[ unsigned short _near *count-read ]
,[ __int32_t tag ] );
#include <cextdecs(READLOCKX)>
_cc_status READLOCKX ( short filenum
,char _far *buffer
,unsigned short read-count
,[ unsigned short _far *count-read ]
,[ __int32_t tag ] );
CEXTDECS (through the included file TNSINTH) defines 32-bit values as the typedef
__int32_t, which for TNS and TNS/R compiles is defined as long and for TNS/E compiles
is defined as int.
The function value returned by READLOCK[X], which indicates the condition code, can be
interpreted by _status_lt(), _status_eq(), or _status_gt() (defined in the file
tal.h).
1208 Guardian Procedure Calls (R)