This section describes miscellaneous C/C++ functions, their applications, and parameters.
parse the URL into the various components:
scheme: The protocol, for example, "ccl://" or "http://"
host: The host computer
port: The port number
path: The remainder of the URL after the port number.
If the parse is successful, C8_TRUE is returned; otherwise, C8_FALSE is returned. You must provide C8Char arrays of adequate size to contain the output of the parse. Results will be truncated if the arrays are too small. If the return value is C8_FALSE, the results are undefined. Suggested sizings are shown in the code fragment below:
C8Char scheme[8]; C8Char host[256]; C8Int port = 0; C8Char path[256]; if ( ! C8ParseURL(url, scheme, sizeof(scheme), host, sizeof(host), &port, path, sizeof(path))) { ... }
Parameters:
url: The URL that you would like parsed.
scheme: The scheme specifies the protocol, for example, "ccl://" or "http://".
scheme_size: The number of bytes in the scheme variable.
host : The name of the host computer specified in the URL.
host_size: The number of bytes available to store the host name.
port: The port number specified in the URL.
path: The remainder of the URL after the port number.
path_size: The number of bytes available to store the path.
Returns: C8_TRUE if the URL is parsed successfully; otherwise, C8_FALSE.