bdfp1m1n | Programming Concepts and Reference |
Use this function to obtain and initialize work space linked to the SW00SR
slot for a subfile. This space is available while the subfile is
open.
Format
void *dfspa(dft_fil *file, dft_spc spc, dft_sps sps);
- file
- is a pointer to the base address of the SW00SR slot (defined in
c$sw00sr.h) of the subfile that you want to access
and is returned by the dfopn function.
- spc
- is the character you want to use to initialize the work space.
- sps
- is the size of the space, which can be a maximum of 3952 bytes.
Entry Requirements
None.
Normal Return
The address of the space that the TPFDF product has provided. The
TPFDF product also loads this address in the SW00WKA field of the SW00SR
slot.
Error Return
None.
Programming Considerations
- The type definitions (for example, dft_fil,
dft_ref, and dft_kyl) are defined in the
c$cdfapi.h header file.
- If you allocate work space with the dfopn function and you then
call the dfspa function for the same file, the TPFDF product
returns the space originally allocated.
- If you set the sps parameter to zero, the TPFDF product releases
any space previously allocated by a dfspa or dfopn
function.
Examples
The following example creates a 400-byte area filled with space
characters. The TPFDF product puts a pointer to the space in
SW00WKA.
dft_fil *file_ptr;
·
·
·
dfspa(file_ptr, ' ', 400);
Related Functions
dfopn-Open a Subfile.