1odbx_lo_read(3)                     OpenDBX                    odbx_lo_read(3)
2
3
4

NAME

6       odbx_lo_read - Reads content from a large object
7

SYNOPSIS

9       #include <opendbx/api.h>
10
11
12       ssize_t odbx_lo_read (odbx_lo_t* lo, void* buffer, size_t buflen);
13

DESCRIPTION

15       To  get  the content of a large object, odbx_lo_read() fetches the data
16       in one or more pieces from the server and stores it into the user  sup‐
17       plied  buffer. After opening the large object using odbx_lo_open(), the
18       first call to odbx_lo_read() will return the bytes from the  beginning.
19       The second and all other calls will store subsequent parts of the large
20       object content into the buffer until the end of the data is reached. To
21       reread  the  content  a second time, you have to close the large object
22       handle and reopen it again as some databases provide no way to  reposi‐
23       tion the internal file position indicator for the stream.
24
25       The lo parameter has to be the large object handle created and returned
26       by odbx_lo_open() via its second parameter. It becomes invalid after it
27       was  supplied to odbx_lo_close() and this function will return an error
28       in this case. The large object  content  fetched  from  the  server  is
29       stored into the user supplied buffer up to buflen bytes.
30

RETURN VALUE

32       odbx_lo_read()  returns  the  number of bytes placed into buffer, which
33       may be up to buflen bytes. If the end of the content is reached and  no
34       more  data  is  available, the return value will be 0. On error, a code
35       whose value is less than zero is returned  if  one  of  the  operations
36       couldn't  be completed successfully. Possible error codes are listed in
37       the error section and they can be feed  to  odbx_error()  and  odbx_er‐
38       ror_type() to get further details.
39

ERRORS

41       -ODBX_ERR_BACKEND
42              The native database library couldn't read from the large object
43
44       -ODBX_ERR_HANDLE
45              lo is NULL or the supplied large object handle is invalid
46

SEE ALSO

48       odbx_lo_open(), odbx_lo_close()
49
50
51
52                                 24 July 2018                  odbx_lo_read(3)
Impressum