OpenTP1 Version 7 Programming Reference C Language
dc_dam_dget - Input directly a physical file block
Format
ANSI C, C++
#include <dcdami.h> int dc_dam_dget (int fno, char *datadr, int datalen, int blkno, DCLONG flags) |
K&R C
#include <dcdami.h> int dc_dam_dget (fno, datadr, datalen, blkno, flags) int fno; char *datadr; int datalen; int blkno; DCLONG flags; |
Description
The function dc_dam_dget() inputs a block corresponding to a specified relative block number. Call this function after the function dc_dam_iopen() that requests re-creation output.
If the value specified for the block length is less than the value specified for the buffer length, the length of the input block is returned. If the value specified for the block length is greater than the value specified for the buffer length, an error is returned.
When directly inputting a physical file block, specify the file descriptor which is the return value of the function dc_dam_iopen().
Arguments whose values are set in the UAP
fno
Specify the file descriptor of the file containing a block to be input directly.
datadr
Specify the address of the input buffer.
datalen
Specify the length of the input buffer.
blkno
Specify the relative block number of the input block.
flags
Specify DCNOFLAGS.
Return values
Return value | Return value (numeric) | Explanation |
---|---|---|
Positive integer | A positive integer indicates the length of the input block. | |
DCDAMER_BADF | -1603 | The file descriptor specified for fno is not the one which was acquired by opening the file normally. |
The DAM file is not open. | ||
DCDAMER_BUFER | -1604 | The value specified for the input data length is less than the value specified for the block length. |
DCDAMER_SEQER | -1605 | The call sequence of functions which access the DAM file is invalid. |
DCDAMER_BNOER | -1606 | The relative block number is invalid. |
DCDAMER_PARAM_FLAGS | -1611 | The value specified for flags is invalid. |
DCDAMER_IOER | -1620 | An input error occurred. |
DCDAMER_ACCESS | -1628 | A DAM file to be accessed is protected with the security facility. The UAP that called the function dc_dam_dget() has no access permission. |
DCDAMER_NO_ACL | -1646 | A DAM file to be accessed is protected with the security facility. There is no ACL for the corresponding file. |
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.