@need 3200

@node A VU Handler for the URL File-Descriptor Scheme
@chapter A VU Handler for the URL File-Descriptor Scheme

These functions provide a VU namespace handler for file-names of
the form:

@example
@group
             fd:N
@end group
@group
@end group
@end example

@noindent
where @code{N} is a non-negative integer.


Opening such a file, with this namespace handler installed, returns
the indicated file descriptor.

@sp 1
@need 1750
@noindent
@b{* Function} @code{url_fd_push_handler}@fuindex url_fd_push_handler
@*
@example
@group
void url_fd_push_handler (int is_optional);
@end group
@group
@end group
@end example

Push a VU namespace handler named @geindex fd
@dfn{fd} which recognizes file-names
using the regexp:

@example
@group
             ^fd:[0-9]\+
@end group
@group
@end group
@end example

It handles file names like:

@example
@group
             fd:N
@end group
@group
@end group
@end example

@noindent
where @code{N} is a non-negative integer.


Opening such a file, with this namespace handler installed, returns
the indicated file descriptor.


If the flag @code{is_optional} is @code{0}, the namespace handler is simply
installed.  If it is not @code{0}, the handler is registered under the
name @code{"fd"}, but not installed.  


(See @strong{vu_enable_optional_name_handler} in @ref{Establishing VU Handlers}.)

@sp 1
@need 1750
@noindent
@b{* Function} @code{url_fd_to_fd}@fuindex url_fd_to_fd
@*
@example
@group
int url_fd_to_fd (int * errn, char * path);
@end group
@group
@end group
@end example

Return the file descriptor number named by a filename of the form:

@example
@group
     fd:N
@end group
@group
@end group
@end example

@noindent
where @code{N} is a non-negative integer.


If the filename can not be parsed, @code{-1} is returned and @code{*errn} is
set.




