diff options
author | David Robillard <d@drobilla.net> | 2018-06-03 17:34:07 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-06-03 17:34:07 +0200 |
commit | 613fcc9170bb5f97e2a9e23f590cf8a427a3e0e2 (patch) | |
tree | 62eaa8bed00373ea3a87a066a4d1f4fbfaafb7df /serd | |
parent | 47a3af08b7efcc9cad531283ab6d85f3b90f95df (diff) | |
download | serd-613fcc9170bb5f97e2a9e23f590cf8a427a3e0e2.tar.gz serd-613fcc9170bb5f97e2a9e23f590cf8a427a3e0e2.tar.bz2 serd-613fcc9170bb5f97e2a9e23f590cf8a427a3e0e2.zip |
Move byte source/sink functions into their own section
Diffstat (limited to 'serd')
-rw-r--r-- | serd/serd.h | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/serd/serd.h b/serd/serd.h index a5a3f882..f3d83515 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -324,6 +324,43 @@ serd_base64_decode(const uint8_t* str, size_t len, size_t* size); /** @} + @name Byte Streams + @{ +*/ + +/** + Function to detect I/O stream errors. + + Identical semantics to `ferror`. + + @return Non-zero if `stream` has encountered an error. +*/ +typedef int (*SerdStreamErrorFunc)(void* stream); + +/** + Source function for raw string input. + + Identical semantics to `fread`, but may set errno for more informative error + reporting than supported by SerdStreamErrorFunc. + + @param buf Output buffer. + @param size Size of a single element of data in bytes (always 1). + @param nmemb Number of elements to read. + @param stream Stream to read from (FILE* for fread). + @return Number of elements (bytes) read. +*/ +typedef size_t (*SerdSource)(void* buf, + size_t size, + size_t nmemb, + void* stream); + +/** + Sink function for raw string output. +*/ +typedef size_t (*SerdSink)(const void* buf, size_t len, void* stream); + +/** + @} @name URI @{ */ @@ -379,37 +416,6 @@ void serd_uri_resolve(const SerdURI* r, const SerdURI* base, SerdURI* t); /** - Function to detect I/O stream errors. - - Identical semantics to `ferror`. - - @return Non-zero if `stream` has encountered an error. -*/ -typedef int (*SerdStreamErrorFunc)(void* stream); - -/** - Source function for raw string input. - - Identical semantics to `fread`, but may set errno for more informative error - reporting than supported by SerdStreamErrorFunc. - - @param buf Output buffer. - @param size Size of a single element of data in bytes (always 1). - @param nmemb Number of elements to read. - @param stream Stream to read from (FILE* for fread). - @return Number of elements (bytes) read. -*/ -typedef size_t (*SerdSource)(void* buf, - size_t size, - size_t nmemb, - void* stream); - -/** - Sink function for raw string output. -*/ -typedef size_t (*SerdSink)(const void* buf, size_t len, void* stream); - -/** Serialise `uri` with a series of calls to `sink`. */ SERD_API |