=head1 NAME

nbd_is_uri - detect if a string could be an NBD URI

=head1 SYNOPSIS

 #include <libnbd.h>

 int nbd_is_uri (
       struct nbd_handle *h, const char *uri
     );

=head1 DESCRIPTION

Detect if the parameter C<uri> could be an NBD URI or not.
The function returns true if C<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.  L<nbdcopy(1)>
is one such program.

The current test is heuristic.  In particular it I<does not>
guarantee that L<nbd_connect_uri(3)> will work.

=head1 RETURN VALUE

This call returns a boolean value.

=head1 ERRORS

On error C<-1> is returned.

Refer to L<libnbd(3)/ERROR HANDLING>
for how to get further details of the error.

The following parameters must not be NULL: C<h>, C<uri>.
For more information see L<libnbd(3)/Non-NULL parameters>.

=head1 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

=head1 SEE ALSO

L<nbd_aio_connect_uri(3)>,
L<nbd_connect_uri(3)>,
L<nbd_create(3)>,
L<nbd_get_uri(3)>,
L<nbd_supports_uri(3)>,
L<libnbd(3)>,
L<nbdcopy(1)>.

=head1 AUTHORS

Eric Blake

Richard W.M. Jones

=head1 COPYRIGHT

Copyright Red Hat
