SynopsisParse a URL into its component parts. Prototype#include "webs.h" int websUrlParse(char_t *url, char_t **buf, char_t **host, char_t **path, char_t **port, char_t **query, char_t **proto, char_t **tag, char_t **ext); Parameters
DescriptionThe websUrlParse procedure cracks the URL into its constituent components. To store the parts, websUrlParse allocates a dynamic buffer. This must eventually be freed via bfree by the caller. websUrlParse stores pointers to the URL components in host, path, port, query, proto, tag and ext. If any of these parameters contains NULL, that component is ignored. Note: Tag parsing is not fully supported. Return ValueReturns 0 if successful. Returns -1 if memory cannot be allocated to hold the results. Examplechar_t *host, *port, *buf; websUrlParse(url, &buf, &host, NULL, &port, NULL, NULL, NULL, NULL); Stability ClassificationStable. See Also |