regexps.com
These functions provide a VU namespace handler for file-names of the form:
fd:N
where N
is a non-negative integer.
Opening such a file, with this namespace handler installed, returns the indicated file descriptor.
void url_fd_push_handler (int is_optional);
Push a VU namespace handler named fd which recognizes file-names using the regexp:
^fd:[0-9]\+
It handles file names like:
fd:N
where N
is a non-negative integer.
Opening such a file, with this namespace handler installed, returns the indicated file descriptor.
If the flag is_optional
is 0
, the namespace handler is simply
installed. If it is not 0
, the handler is registered under the
name "fd"
, but not installed.
(See vu_enable_optional_name_handler.)
int url_fd_to_fd (int * errn, char * path);
Return the file descriptor number named by a filename of the form:
fd:N
where N
is a non-negative integer.
If the filename can not be parsed, -1
is returned and *errn
is
set.
regexps.com