📄 slp.h
字号:
/* *//* Returns: If no error, the maximum refresh interval value allowed by all *//* DAs (a positive integer). If no DA advertises a *//* min-refresh-interval attribute, returns 0. If an error occurs,*//* returns an SLP error code. *//*=========================================================================*//*=========================================================================*/SLPEXP SLPError SLPAPI SLPFindScopes(SLPHandle hSLP, char** ppcScopeList);/* *//* Sets ppcScopeList parameter to a pointer to a comma separated list *//* including all available scope values. The list of scopes comes from *//* a variety of sources: the configuration file's net.slp.useScopes *//* property, unicast to DAs on the net.slp.DAAddresses property, DHCP, *//* or through the DA discovery process. If there is any order to the *//* scopes, preferred scopes are listed before less desirable scopes. *//* There is always at least one name in the list, the default scope, *//* "DEFAULT". *//* *//* hSLP The SLPHandle on which to search for scopes. *//* *//* ppcScopeList A pointer to char pointer into which the buffer pointer is *//* placed upon return. The buffer is null terminated. The *//* memory should be freed by calling SLPFree(). *//* *//* Returns: If no error occurs, returns SLP_OK, otherwise, the a *//* ppropriate error code. *//*=========================================================================*//*=========================================================================*/SLPEXP SLPError SLPAPI SLPParseSrvURL(const char *pcSrvURL, SLPSrvURL** ppSrvURL);/* *//* 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 structure returned in ppSrvURL should be *//* freed with SLPFreeURL(). If the URL has no service part, the *//* s_pcSrvPart string is the empty string, "", i.e. 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 *//* zero. *//* *//* pcSrvURL A pointer to a character buffer containing the null terminated *//* URL string to parse. *//* *//* 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. *//* *//* Returns: If no error occurs, the return value is SLP_OK. Otherwise, the *//* appropriate error code is returned. *//*=========================================================================*//*=========================================================================*/SLPEXP SLPError SLPAPI SLPEscape(const char* pcInbuf, char** ppcOutBuf, SLPBoolean isTag); /* *//* Process the input string in pcInbuf and escape any SLP reserved *//* characters. If the isTag parameter is SLPTrue, then look for bad tag *//* characters and signal an error if any are found by returning the *//* SLP_PARSE_ERROR code. The results are put into a buffer allocated by *//* the API library and returned in the ppcOutBuf parameter. This buffer *//* should be deallocated using SLPFree() when the memory is no longer *//* needed. *//* *//* pcInbuf Pointer to he input buffer to process for escape *//* characters. *//* *//* ppcOutBuf Pointer to a pointer for the output buffer with the SLP *//* reserved characters escaped. Must be freed using *//* SLPFree()when the memory is no longer needed. *//* *//* isTag When true, the input buffer is checked for bad tag *//* characters. *//* *//* Returns: Return SLP_PARSE_ERROR if any characters are bad tag *//* characters and the isTag flag is true, otherwise SLP_OK, *//* or the appropriate error code if another error occurs. *//*=========================================================================*//*=========================================================================*/SLPEXP SLPError SLPAPI SLPUnescape(const char* pcInbuf, char** ppcOutBuf, SLPBoolean isTag);/* *//* Process the input string in pcInbuf and unescape any SLP reserved *//* characters. If the isTag parameter is SLPTrue, then look for bad tag *//* characters and signal an error if any are found with the *//* SLP_PARSE_ERROR code. No transformation is performed if the input *//* string is an opaque. The results are put into a buffer allocated by *//* the API library and returned in the ppcOutBuf parameter. This buffer *//* should be deallocated using SLPFree() when the memory is no longer *//* needed. *//* *//* pcInbuf Pointer to he input buffer to process for escape *//* characters. *//* *//* ppcOutBuf Pointer to a pointer for the output buffer with the SLP *//* reserved characters escaped. Must be freed using *//* SLPFree() when the memory is no longer needed. *//* *//* isTag When true, the input buffer is checked for bad tag *//* characters. *//* *//* Returns: Return SLP_PARSE_ERROR if any characters are bad tag *//* characters and the isTag flag is true, otherwise SLP_OK, *//* or the appropriate error code if another error occurs. *//*=========================================================================*//*=========================================================================*/SLPEXP void SLPAPI SLPFree(void* pvMem);/* *//* Frees memory returned from SLPParseSrvURL(), SLPFindScopes(), *//* SLPEscape(), and SLPUnescape(). *//* *//* pvMem A pointer to the storage allocated by the SLPParseSrvURL(), *//* SLPEscape(), SLPUnescape(), or SLPFindScopes() function. *//* Ignored if NULL. *//*=========================================================================*//*=========================================================================*/SLPEXP const char* SLPAPI SLPGetProperty(const char* pcName);/* *//* Returns the value of the corresponding SLP property name. The returned *//* string is owned by the library and MUST NOT be freed. *//* *//* pcName Null terminated string with the property name, from *//* Section 2.1 of RFC 2614. *//* *//* Returns: If no error, returns a pointer to a character buffer containing*//* the property value. If the property was not set, returns the *//* default value. If an error occurs, returns NULL. The returned *//* string MUST NOT be freed. *//*=========================================================================*//*=========================================================================*/SLPEXP void SLPAPI SLPSetProperty(const char *pcName, const char *pcValue);/* *//* Sets the value of the SLP property to the new value. The pcValue *//* parameter should be the property value as a string. *//* *//* pcName Null terminated string with the property name, from Section *//* 2.1. of RFC 2614. *//* *//* pcValue Null terminated string with the property value, in UTF-8 *//* character encoding. *//*=========================================================================*//*=========================================================================*/SLPEXP SLPError SLPAPI SLPParseAttrs(const char* pcAttrList, const char *pcAttrId, char** ppcAttrVal);/* *//* Used to get individual attribute values from an attribute string that *//* is passed to the SLPAttrCallback *//* *//* pcAttrList (IN) A character buffer containing a comma separated, null *//* terminated list of attribute id/value assignments, in *//* SLP wire format; i.e. "(attr-id=attr-value-list)" *//* *//* pcAttrId (IN) The string indicating which attribute value to return. *//* MUST not be null. MUST not be the empty string (""). *//* *//* ppcAttrVal (OUT) A pointer to a pointer to the buffer to receive *//* attribute value. The memory should be freed by a call *//* to SLPFree() when no longer needed. *//* *//* Returns: Returns SLP_PARSE_ERROR if an attribute of the specified id *//* was not found otherwise SLP_OK *//*=========================================================================*/#if(defined __cplusplus)}#endif#endif /* (!defined SLP_H_INCLUDED) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -