High Performance OPC UA Server SDK  1.1.0.158
url

Url utility functions. More...

Data Structures

struct  util_url
 Struct to represent the elements of a URL. More...
 

Functions

int util_url_parse (const char *string, struct util_url *elements)
 Parses an URL like 'https://www.example.com:443/path'. More...
 

Detailed Description

Url utility functions.

Function Documentation

int util_url_parse ( const char *  str,
struct util_url elements 
)

Parses an URL like 'https://www.example.com:443/path'.

https://www.example.com:443/path ___/ _____________/ _/___/ | | | | scheme host port path (optional) (optional)

The parts of the URL are parsed into the provided struct. The pointers in the struct point to the respective position of the provided URL. So these are only valid as long as the URL is valid and do not need to be freed. The URL is not modified, so the pointers are not zero terminated and the length field of the struct must be respected.

The port in the result is zero if omitted in the URL string.

Parameters
strThe URL to parse.
elementsThe parsed parts of the URL.
Returns
Zero on success or errorcode on failure.