📄 hdrutil.h
字号:
==========================================================================
Finds the field names in the header and stores the pointers to the in
a linked list. The pointers are to a COPY of the inputted data. The
error-flag is set if error.
Input : The header as a BYTE *, number of bytes and pointer to BOOL.
Output: Creates a HEADERDEF and returns a pointer to it
(consult HeadDef.h).
==========================================================================*/
pHEADERDEF WSP_PreParseHeaders (BYTE *pbInstream, INT32 iLength, BOOL *fError);
/*========================================================================
WSP_EmptyHeaderList
==========================================================================
Descr : Deletes the element list and frees the memory.
Input : pDef
Output: -
==========================================================================*/
void WSP_EmptyHeaderList (pHEADERDEF pDef);
/*========================================================================
WSP_DeleteParameters
==========================================================================
Removes a tWSPPARAMETERS struct.
Input : (**) to tWSPPARAMETERS
Output: -
==========================================================================*/
void WSP_DeleteParameters (pWSPPARAMETERS* ppParameters);
/*========================================================================
WSP_GetHeaderWK
WSP_GetHeaderTT
==========================================================================
The function returns a pointer to the element specified by the
parameters. Some headers might exist in more than one instance, e.g.
Accept-language. To get all the elements, the function should be
called repeatedly and the pFirstElm should be changed gradually.
Input : The desired field as a short-int (first function) or a
Token-Text (second function). The pFirstElm points to the
first element in the list to be examined.
Output: Pointer to header element, NULL if not found.
==========================================================================*/
/* Well-Known header */
pHEADERELEMENT WSP_GetHeaderWK (BYTE bCodePage, BYTE bByte,
pHEADERELEMENT pFirstElm);
/* Token-Text header */
pHEADERELEMENT WSP_GetHeaderTT (BYTE *pbTokenText, pHEADERELEMENT pFirstElm);
/* Various functions */
BYTE WSP_GetShortInt (BYTE bShortInt);
UINT32 WSP_GetLongInteger (BYTE **ppbStart, BYTE *pbEnd, BOOL *pfError);
UINT32 WSP_GetInteger (BYTE **ppbStart, BYTE *pbEnd, BOOL *pfError);
BYTE* WSP_GetTextString (BYTE **ppbStart, BYTE *pbEnd, BOOL *pfError);
/*========================================================================
WSP_GetContentTypeByte
==========================================================================
The function returns the Content-type value of the HEADERELEMENT. If
the value includes parameters (e.g. charset or level), a struct of the
type tWSPPARAMETERS is created and the values in the struct are set
accordingly. The iCharset is set with the IANA value of the charset.
If no charset parameter is included the iCharset is set to
IANA_INVALID. The iLevel is set in the same way with the default value
0.
NOTE! If no parameters are specified, the pParameters is set to NULL.
If one or more parameters are found, these are stored in the struct.
Parameters that are not specifed are given their defualt values. The
pParameters struct MUST be deleted with a call to the function
WSP_DeleteParameters.
Input: Pointer to HEADERELEMENT, pointer to error flag (set to FALSE),
and a (**) to (WSPPARAMETERS) - set to NULL if no parameters
Output: BYTE, The error flag is set if error.
==========================================================================*/
BYTE WSP_GetContentTypeByte (pHEADERELEMENT pElement, BOOL *fError,
pWSPPARAMETERS* ppParameters);
/*========================================================================
WSP_GetContentTypeString
==========================================================================
As above, but returns string. It is the caller's responsibility to de-
allocate the memory of the string.
Input: Pointer to HEADERELEMENT, pointer to error flag (set to FALSE),
and a (**) to (WSPPARAMETERS) - set to NULL if no parameters
Output: BYTE*, The error flag is set if error.
==========================================================================*/
BYTE *WSP_GetContentTypeString (pHEADERELEMENT pElement, BOOL *fError,
pWSPPARAMETERS* ppParameters);
/* ---------------------------------------------
Descr : Returns the Cache-control value of
the HEADERELEMENT. If Delta-seconds
are specified, they are stored in the
piDeltaSec parameter.
Input : Pointer to HEADERELEMENT, pointer
to error flag, pointer to UINT32.
Output: BYTE, The error flag is set if error
(e.g. if the value is not a BYTE)
--------------------------------------------- */
BYTE WSP_GetCacheControlByte (pHEADERELEMENT pElement, UINT32 *piDeltaSec,
BOOL *fError);
/* ---------------------------------------------
Descr : Returns a Basic Realm-value.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetProxyAuthenticateRealm (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns a Basic Realm-value.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetWWWAuthenticateRealm (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns the value of the Age field
as an UINT32. If error the Error flag
is set.
Input : Pointer to HEADERELEMENT, pointer to
flag (set to FALSE).
Output: UINT32
--------------------------------------------- */
UINT32 WSP_GetAge (pHEADERELEMENT pElement, BOOL *pfError);
/* ---------------------------------------------
Descr : Returns the value of the Date field
as an UINT32. If error the Error flag
is set.
Input : Pointer to HEADERELEMENT, pointer to
flag (set to FALSE).
Output: UINT32
--------------------------------------------- */
UINT32 WSP_GetDate (pHEADERELEMENT pElement, BOOL *pfError);
/* ---------------------------------------------
Descr : Returns an Etag-value.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetEtag (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns the value of the Expires field
as an UINT32. If error the Error flag
is set.
Input : Pointer to HEADERELEMENT, pointer to
flag (set to FALSE).
Output: UINT32
--------------------------------------------- */
UINT32 WSP_GetExpires (pHEADERELEMENT pElement, BOOL *pfError);
/* ---------------------------------------------
Descr : Returns the value of the Last Modified
field as an UINT32. If error the Error
flag is set.
Input : Pointer to HEADERELEMENT, pointer to
flag (set to FALSE).
Output: UINT32
--------------------------------------------- */
UINT32 WSP_GetLastModified (pHEADERELEMENT pElement, BOOL *pfError);
/* ---------------------------------------------
Descr : Returns a Location-value.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetLocation (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns a Content-location-value.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetContentLocation (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns a Content-base-value.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetContentBase (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns the value of the Push Flag
field as an UINT8.
Input : Pointer to HEADERELEMENT, pointer to
flag (set to FALSE).
Output: UINT8
--------------------------------------------- */
UINT8 WSP_GetPushFlag (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns a X-Wap-Initiator-URI.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetXInitiatorURI(pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns a X-Wap-Content-URI.
Input : Pointer to HEADERELEMENT
Output: Pointer to text. (Not copied)
NULL if error.
--------------------------------------------- */
BYTE *WSP_GetXContentURI (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns a Profile-warning code
according to WSP (8.4.2.62)
Input : Pointer to HEADERELEMENT
Output: BYTE, 0 if error
--------------------------------------------- */
BYTE WSP_GetProfileWarning (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns a Encoding-Version value
according to WSP (8.4.2.70)
Input : Pointer to HEADERELEMENT
Output: BYTE, 0 if error
--------------------------------------------- */
BYTE WSP_GetEncodingVersion (pHEADERELEMENT pElement);
/* ---------------------------------------------
Descr : Returns the value of the SetCookie header
according to WSP (8.4.2.68)
This function assumes that all pointer parameters
are non-NULL, i.e. no NULL pointers may be passed
when calling this function. (The only exception
to this is a NULL value for pElement which causes
a return indicating error.)
In addition, the UINT32 memory behind **ppuiMaxAge
is memory owned by the caller.
Input : Pointer to HEADERELEMENT
Output: *pfError which is set in case of error
On successful return ,i.e. when *pfError is false:
*ppbName, *ppbValue, which are non-Null
*ppbDomain, *ppbPath *ppuiMaxAge which may be NULL
If *ppuiMaxAge is non-NULL the found Max-Age value
is in **ppuiMaxAge.
*puiVersion
--------------------------------------------- */
void WSP_GetSetCookie (pHEADERELEMENT pElement, BOOL *pfError,
BYTE **ppbName, BYTE **ppbValue,
BYTE **ppbDomain, BYTE **ppbPath,
UINT32 **ppuiMaxAge, UINT32 *puiVersion);
/*========================================================================
WSP_GetPushHeaderAppId
==========================================================================
Descr : Returns TRUE if the decoding of the X-WAP-Application-Id is
successful, FALSE if not.
Sets URIHeaderAppId = X-WAP-Application-Id if it is an URI, OR
CodeHeaderAppId = X-WAP-Application-Id and URIHeaderAppId = NULL
Input : Pointer to HEADERELEMENT, adress to URIHeaderAppld and
CodeHeaderAppId
Output: TRUE/FALSE, URIHeaderAppId or CodeHeaderAppId is set if TRUE
is returned (NULL and 0 otherwise)
==========================================================================*/
BOOL WSP_GetPushHeaderAppId (pHEADERELEMENT pElement, BYTE** ppbURIHeaderAppId, int* piCodeHeaderAppId);
/*========================================================================
WSP_GetMd5
==========================================================================
The function returns a stream of 16 bytes containing the md5-data of
the header. The stream MUST NOT be deallocated.
If error, NULL is returned and the error flag is set.
Input : Pointer to HEADERELEMENT, pointer to flag.
Output: BYTE* or NULL
==========================================================================*/
BYTE* WSP_GetMd5 (pHEADERELEMENT pElement, BOOL *pfError);
/*========================================================================
WSP_ConvertBase64ToByte
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -