OpenTP1 Version 7 Programming Reference C Language
dc_dam_get - Input a physical file block
Format
ANSI C, C++
#include <dcdami.h> int dc_dam_get (int fno, char *datadr, int datalen, DCLONG flags) |
K&R C
#include <dcdami.h> int dc_dam_get (fno, datadr, datalen, flags) int fno; char *datadr; int datalen; DCLONG flags; |
Description
The function dc_dam_get() sequentially inputs data in blocks from a physical file of the OpenTP1 file system. Call the function dc_dam_get() after the function dc_dam_iopen().
If the value specified for the block length is smaller 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 buffer length, an error is returned.
When 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.
datadr
Specify the address of the input buffer.
datalen
Specify the length of the input buffer. You can specify a value in the range from 504 to 2147483647.
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, or the file is not open. |
DCDAMER_BUFER | -1604 | The value specified for the block length is greater than the value specified for the buffer length. |
The value specified for the input buffer length is outside the range of values that can be specified. | ||
DCDAMER_SEQER | -1605 | The call sequence of functions which access the DAM file 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_get() has no access permission. |
DCDAMER_EOF | -1637 | The file end was reached. |
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.