s5curl_open - fetches and loads a remote BLOW5 file’s meta data
slow5_file_t *s5curl_open(const char *url)
The s5curl_open()
function fetches and loads a remote BLOW5 file’s meta data pointed by the argument url, parses and populates the BLOW5 header.
An open slow5 file should be closed at the end using s5curl_open()
function.
Upon successful completion, s5curl_open()
returns a s5curl_t pointer. Otherwise, NULL is returned and s5curl_errno
is set to indicate the error.
S5CURL_ERR_CURL
Failed to initialise CURL handle.S5CURL_ERR_FETCH
Fetching data failed.S5CURL_ERR_ARG
Invalid argument.S5CURL_ERR_IO
Other IO error.S5CURL_ERR_MEM
Memory (re)allocation error.S5CURL_ERR_OTH
Other error (big endian, internal error, etc.).#include <slow5curl/s5curl.h>
#define URL "https://example.blow5"
int main () {
// setup
s5curl_t *s5c = s5curl_open(URL);
if (s5c == NULL) {
fprintf(stderr, "Error fetching slow5 file\n");
exit(EXIT_FAILURE);
}
// s5curl operations
s5curl_close(s5c);
// cleanup
}