Extracts the root of a given URL.
am_policy_get_url_resource_root() populates the resource_root pointer with the extracted information. For example, http://www.sun.com/index.html will return http://www.sun.com/ and http://www.sun.com:8080/index.html will return http://www.sun.com:8080/.
#include "am_policy.h" AM_EXPORT boolean_t am_policy_get_url_resource_root(const char *resource_name, char *resource_root, size_t length);
This function takes the following parameters:
Pointer to the protected resource URL.
Pointer to the location where the resource root will be written.
Value based on the size_t defined in the standard <stddef.h> header file that reflects the size of the resource_root buffer.
When using resources other than URLs, the developer implementing this function must make accurate judgement about the minimum size of resource_root.
This function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
If the root was successfully extracted.
If not.