1odbx_lo_write(3) OpenDBX odbx_lo_write(3)
2
3
4
6 odbx_lo_write - Writes buffer content into the large object
7
9 #include <opendbx/api.h>
10
11
12 ssize_t odbx_lo_write (odbx_lo_t* lo, void* buffer, size_t buflen);
13
15 odbx_lo_write() sends the data supplied in buffer to the server for
16 storing it inside the large object. The function can be called more
17 than once to add subsequent parts of the content to the object. If it
18 isn't a new or empty object, the existing data will be overwritten and
19 truncated to the new size. It's not possible to update only parts of
20 the content as some databases doesn't support to position the internal
21 file position indicator.
22
23 The lo parameter has to be the large object handle created and returned
24 by odbx_lo_open() via its second parameter. It becomes invalid after it
25 was supplied to odbx_lo_close() and this function will return an error
26 in this case. The data which should be send to the server is read from
27 buffer up to buflen bytes.
28
30 odbx_lo_write() returns the number of bytes read from buffer and sent
31 to the database server, which may be up to buflen bytes. It isn't guar‐
32 anteed that the complete chunk was sent to the server, so the returned
33 size may be less than the value in buflen. On error, a code whose value
34 is less than zero is returned if one of the operations couldn't be com‐
35 pleted successfully. Possible error codes are listed in the error sec‐
36 tion and they can be feed to odbx_error() and odbx_error_type() to get
37 further details.
38
40 -ODBX_ERR_BACKEND
41 The native database library couldn't write to the large object
42 successfully
43
44 -ODBX_ERR_HANDLE
45 lo is NULL or the supplied large object handle is invalid
46
48 odbx_lo_open(), odbx_lo_close()
49
50
51
52 28 July 2020 odbx_lo_write(3)