SLPParseSrvURL Subroutine

Purpose

Parses the URL passed in as the argument into a service URL structure and returns it in the ppSrvURL pointer.

Syntax

SLPError SLPParseSrvURL(char *pcSrvURL
                           SLPSrvURL** ppSrvURL);

Description

The SLPParseSrvURL subroutine parses the URL passed in as the argument into a service URL structure and returns it in the ppSrvURL pointer. If a parse error occurs, returns SLP_PARSE_ERROR. The input buffer pcSrvURL is destructively modified during the parse and used to fill in the fields of the return structure. The structure returned in ppSrvURL should be freed with SLPFreeURL(). If the URL has no service part, the s_pcSrvPart string is the empty string (""), not NULL. If pcSrvURL is not a service: URL, then the s_pcSrvType field in the returned data structure is the URL's scheme, which might not be the same as the service type under which the URL was registered. If the transport is IP, the s_pcTransport field is the empty string. If the transport is not IP or there is no port number, the s_iPort field is 0.

Parameters

Item Description
pcSrvURL A pointer to a character buffer containing the null-terminated URL string to parse. It is destructively modified to produce the output structure.
ppSrvURL A pointer to a pointer for the SLPSrvURL structure to receive the parsed URL. The memory should be freed by a call to SLPFree() when no longer needed.

Return Values

If no error occurs, the return value is SLP_OK. Otherwise, the appropriate error code is returned.