uclose

Synopsis

     void uclose(struct URL *url)

Arguments

Description

uclose closes a Dive stream obtained by the mean of uopen or udopen. Once uclose has been closed, the underlying file descriptor is closed and the reference url becomes invalid.

Related Commands

uopen, udopen


udopen

Synopsis

     struct URL *udopen(int fdes)

Arguments

Description

udopen assciates a Dive stream with the file descriptor fdes and return a pointer to the corresponding URL structure. Dive streams ressemble streams in ANSI C and offer a similar set of functions, all starting with "u" instead of "f".

Obtaining a file descriptor, ready for reading, can be done using the function dive_readURL_stream.

Related Commands

uopen, uread, ugets, ugetc, uclose,  dive_readURL_stream


ugetc

Synopsis

     int ugetc(struct URL *url)

Arguments

Description

ugetc return the next character (if it exists) from the opened stream referred by url. The character is returned as an unsigned character converted to an integer. The file pointer within the stream is incremented. EOF is returned at the end of file or upon error.

Related Commands

udopen, uopen, uread, ugets, uungetc 


ugets

Synopsis

     char *ugets(char *s, int maxlen, struct URL *url)

Arguments

Description

ugets reads characters from the Dive stream referenced by url, into the array pointed by s, until maxlen-1 characters are read or a new-line character is read or an end of line condition is encountered. The new-line character is discarded and the string is terminated with a null character.

If an error occured, NULL is returned, otherwise, s is returned.

Related Commands

udopen, uopen, uread, ugetc 


uopen

Synopsis

     struct URL *uopen(char *url)

Arguments

Description

uopen opens the Uniform Resource Locator (URL) named url for reading and associates a Dive stream with it. uopen returns a pointer to the URL structure associated with the stream. Dive streams ressemble streams in ANSI C and offer a similar set of functions, all starting with "u" instead of "f".

Related Commands

udopen, uread, ugets, ugetc, uclose 


uread

Synopsis

     int uread(void *ptr, int size, int nitems,
               struct URL *url)

Arguments

Description

uread copies, into an array pointed to by ptr, up to nitems of data from the named input Dive stream url, where an item of data is a sequence of bytes (not necessary terminated by a null byte) of length size. uread stops reading if an end of file or an error condition is encountered or if nitems have been read.

Related Commands

udopen, uopen, ugets, ugetc, uclose 


url_resolve_relative

Synopsis

     char *url_resolve_relative(char *base_url,
                                char *embedded_url)

Arguments

Description

url_resolve_relative resolve relative URLs, according to the algorithm of the RFC 1808, chapter 4. The base URL base_url is the model on which the embedded_url should be resolved. This function returns a mallocated pointer to a string containing the result of resolution, or NULL if an error was encountered.


uungetc

Synopsis

     int uungetc(int c, struct URL *url)

Arguments

Description

uungetc inserts the character c into the buffer associated with an input Dive stream url. Pushed-back characters will be returned by subsequent reads on that stream in the reverse order of their pushing. One character pushback is guaranteed, provided something has already been read from the stream.

Related Commands

udopen, uopen, ugets, ugetc, uread, uclose