OpenTP1 Version 7 Programming Reference C Language
dc_dam_dput - Output directly a physical file block
Format
ANSI C, C++
#include <dcdami.h> int dc_dam_dput (int fno, char *datadr, int datalen, int blkno, DCLONG flags) |
K&R C
#include <dcdami.h> int dc_dam_dput (fno, datadr, datalen, blkno, flags) int fno; char *datadr; int datalen; int blkno; DCLONG flags; |
Description
The function dc_dam_dput() outputs 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 output data length is less than the value specified for the block length, a block is output and the remaining area is padded with null characters. If the value specified for the output data length is greater than the value specified for the block length, an error is returned.
When directly outputting 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 to which a block is output directly.
datadr
Specify the address of the output data.
datalen
Specify the length of the output data.
blkno
Specify the relative block number of the output destination block.
flags
Specify DCNOFLAGS.
Return values
Return value | Return value (numeric) | Explanation |
---|---|---|
Positive integer | A positive integer indicates the length of the output 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 output 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 output 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_dput() 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.