nbd_is_uri3
Detect if a string could be an nbd uri
Usage
#include <libnbd.h>int nbd_is_uri (struct nbd_handle *h, const char *uri);
Overview
Detect if the parameter "uri" could be an NBD URI or not. The function returns true if "uri" is likely to be an NBD URI, or false if not.
This can be used to write programs that take either a URI or something else like a filename as a parameter. nbdcopy(1) is one such program.
The current test is heuristic. In particular it does not guarantee that nbd_connect_uri(3) will work.
Return value
This call returns a boolean value.
Errors
On error -1 is returned.
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error.
The following parameters must not be NULL: "h", "uri". For more information see "Non-NULL parameters" in libnbd(3).
Version
This function first appeared in libnbd 1.22.
If you need to test if this function is available at compile time check if the following macro is defined:
#define LIBNBD_HAVE_NBD_IS_URI 1
Releases
2 releases since Debian 13 (Trixie); the text changed 1 time.