char *urltype(char *url);
char *urlhost(char *url);
char *urlport(char *url);
char *urluser(char *url)
char *urlgroup(char *url)
char *urlpass(char *url)
char *urlfn(char *url)
long *urloffs(char *url,int *n)
char *urlrest(char *url)
These functions parse URLs and return selected parts from them. All of these functions are passed to a URL as passed to a search callback function. They will all return alloced pointers that should be freed when no longer needed.
returns the type field of the URL. This will always be "tfile" in a search callback.
returns the host field of the URL. This is the address of the host that created the URL. With this information, the same host can be contacted at a later time through a new connection.
returns the port field of the URL. This is the port to use when contacting the host returned above.
returns the user name field of the URL. This is empty or the user to log in as when contacting the host.
returns the group name field of the URL. This is empty or the group to log in as when contacting this host.
returns the password field of the URL. This is empty or the password to use to log in with when contacting this host.
returns the filename field of the URL. This is the filename of interest as the server knows it. This can be used as the fn argument to n_openrfile().
returns the offsets and lengths of the hit and sub-hits within the hit.
The second parameter to
urloffs() is a pointer to an
receive the size of the returned array. The returned pointer points to a
list of pairs of longs. The first long in each pair is the offset of the
hit or sub-hit. The second long in each pair is the offset of the hit or
sub-hit. The first offset-length pair is the overall hit within the
document. The remaining offset-length pairs are subhits within the
returns everything after the filename field of the URL.