gpgme_data_readreads up to length bytes from the data object with the handle dh into the space starting at buffer.
If no error occurs, the actual amount read is returned. If the end of the data object is reached, the function returns 0.
In all other cases, the function returns -1 and sets errno.
gpgme_data_writewrites up to size bytes starting from buffer into the data object with the handle dh at the current write position.
The function returns the number of bytes actually written, or -1 if an error occurs. If an error occurs, errno is set.
gpgme_data_seekchanges the current read/write position.
The whence argument specifies how the offset should be interpreted. It must be one of the following symbolic constants:
- Specifies that offset is a count of characters from the beginning of the data object.
- Specifies that offset is a count of characters from the current file position. This count may be positive or negative.
- Specifies that offset is a count of characters from the end of the data object. A negative count specifies a position within the current extent of the data object; a positive count specifies a position past the current end. If you set the position past the current end, and actually write data, you will extend the data object with zeros up to that position.
If successful, the function returns the resulting file position, measured in bytes from the beginning of the data object. You can use this feature together with
SEEK_CURto read the current read/write position.
If the function fails, -1 is returned and errno is set.
The following function is deprecated and should not be used. It will be removed in a future version of GPGME.