⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hdrutil.h

📁 是一个手机功能的模拟程序
💻 H
📖 第 1 页 / 共 3 页
字号:
==========================================================================
	The function converts a WCHAR-string containing characters from the
	'Base64 Alphabeth' (see RFC 1521, section 5.2) into an bytestream. The
	length of the created stream is stored in the parameter piNbrBytes.
	If error, NULL is returned and the parameter piNbrBytes is set to -1.

	NOTE! It is the callers responsibility to deallocate the memory.
	
	Input :	Pointer to WCHAR, pointer to INT16.
	Output:	BYTE* or NULL
==========================================================================*/
BYTE* WSP_ConvertBase64ToByte (WCHAR* pwchMd5, INT16* piNbrBytes);




/* ============ ADDRESS FUNCTIONS ==============
	Functions for handling address parsing.
   ============================================= */

/* ---------------------------------------------
	Descr : The function parses an instream for
			address data according to the WSP
			specification section 8.2.2.3. If the
			function fails for any reason, FALSE
			is returned and the *ppAddress parameter
			is set to NULL. Otherwise the ppAddress
			includes all addresses in the instream.

			If the Bearer Type or the Port Number
			is not specified, these fields are set
			to -1 in the ADDRESS struct.
		
			NOTE! It is the caller's responsibility
			to delete all data. The ADDRESS-structs
			will be useless if the pbData is deleted.

	Input :	Data (IN), length of data (IN) and 
			ADDRESS** (OUT)
	Output:	TRUE/FALSE, *ppAdress is set if 
			TRUE is returned (NULL otherwise)
   --------------------------------------------- */
BOOL WSP_ParseAddress( BYTE* pbData, INT32 iLength, pADDRESS* ppAddress );


/* ---------------------------------------------
	Descr : The function deletes a list of ADDRESS-
			structs, starting with the specified one.

	Input :	ADDRESS** (The first element in the list
			to be deleted)
	Output:	-
   --------------------------------------------- */
void WSP_DeleteAddress( pADDRESS* ppAddress );


/* ============================================= */




/* ============= CONVERT FUNCTIONS =============
	   Functions for coverting from bytes to
	   strings and vice versa.
   ============================================= */
/* ---------------------------------------------
	Descr : Converts the value of the Content Type
			Value from a character string to a BYTE
			or vice versa. If *ppbText is NULL the byte
			is converted to a string. If the string 
			is not NULL, it is converted to a BYTE.
			The string is NOT deallocated. If the 
			operation was succesful, the result is
			stored in the appropriate field (pbValue
			or ppbText)
	Input :	Pointer to BYTE and pointer to BYTE *
	Output:	TRUE if OK, FALSE otherwise.
   --------------------------------------------- */
BOOL WSP_ConvertContentStringByte(BYTE *pbValue, BYTE **ppbText);

/* ============================================= */




/* ======================== MULTIPART FUNCTIONS ==========================
			Functions for parsing and creating multipart data.
========================================================================== */

/*========================================================================
	WSP_PreParseMultipart
==========================================================================
	This function parses the body of a multipart entity and returns a list
	of MULTIPARTSTR (consult HeadDef.h). The pbInstream must NOT be 
	deallocated until the list is deleted.
	
	Input: Pointer to BYTEstream and length.
	Output: Pointer to MULTIPARTSTR, NULL if error.
==========================================================================*/
pMULTIPARTSTR WSP_PreParseMultipart (BYTE *pbInstream, UINT32 iLength);


/*========================================================================
	WSP_DeleteMultipartList
==========================================================================
	This function deletes a list of MULTIPARTSTR (consult HeadDef.h).

	NOTE! The data in the stucts is NOT deallocated!
	
	Input: pointer to pMULTIPARTSTR
	Output: -
==========================================================================*/
void WSP_DeleteMultipartList (pMULTIPARTSTR* ppList);


/*========================================================================
	WSP_DeleteMultipartListWithContent
==========================================================================
	This function deletes a list of MULTIPARTSTR (consult HeadDef.h).

	NOTE! The data in the stucts IS deallocated!
	
	Input: pointer to pMULTIPARTSTR
	Output: -
==========================================================================*/
void WSP_DeleteMultipartListWithContent (pMULTIPARTSTR* ppList);


/*========================================================================
	WSP_MultipartAddPart
==========================================================================
	This function creates an instance of a MULTIPARTSTR, and stores the
	appropriate values in the struct. The created struct is then stored 
	last in the list. The list is transformed into multipart content with 
	a call to the function WSP_BuildMulipart.

	NOTE! It is the caller's responsibility to deallocate the created 
	list.
	
	NOTE! The allocated memory in the parameters ppbHeader and ppbData 
	is taken over by the function, i.e., the parameters are set to point 
	to NULL before the function returns.

	NOTE! ppList, ppbHeader, and ppbData MUST not be NULL.
	
	Input: Pointer to list of (MULTIPARTSTR), pointer to header data and 
		   content data (BYTE**), and length of header data and content 
		   data (UINT32). 
	Output: -
==========================================================================*/
void WSP_MultipartAddPart (pMULTIPARTSTR* ppList, BYTE** ppbHeader, 
						   BYTE** ppbData, UINT32 iHeaderLen, UINT32 iDataLen);


/*========================================================================
	WSP_BuildMultipart
==========================================================================
	This function creates multipart content from a list of MULTIPARTSTR
	structs. If the transformation is successful, TRUE is returned and the
	list is removed. Otherwise FALSE is returned (and the list is left
	unchanged). 
	
	The created data is stored in the ppbContentData, and the length of 
	the data is stored in the piDataLen parameter. It is the caller's
	responsibility to deallocate the memory.
		
	Input: Pointer to list of (MULTIPARTSTR), pointer to created multipart 
		   data (BYTE**) and length of the data (UINT32). When using Large 
		   Data transfer and multipart the total data length (iTotalSize) 
		   is used. Otherwise iTotalSize should be set to 0.
	Output: TRUE if the transformation was ok, FALSE otherwise.
==========================================================================*/
BOOL WSP_BuildMultipart (pMULTIPARTSTR* ppList, BYTE** ppbContentData,
						 UINT32* piDataLen, UINT32 iTotalSize);


/*========================================================================
	The following functions use the functions above to create valid WSP
	multipart content parts. When all parts are created, they must be 
	assembled by a call to the WSP_BuildMultipart function. Before the 
	content is sent, a header for the multipart content must also be 
	created, using the "HEADER BUILD HELP FUNCTIONS" below. 
==========================================================================*/


/*========================================================================
	WAE_AddTextFormDataPart
==========================================================================
	This function creates one part of a multipart/form-data and stores 
	the result last in the list ppMultiPartList (MULTIPARTSTR). A WSP
	header is created and added for each part. The list is transformed 
	into multipart content with a call to the function WSP_BuildMulipart.
	The following WSP headers are added to each part:
	
	Content-type : text/plain with charset as indicated by the parameter 
		(iCharEnc). "Charset is required when the content contains 
		characters not in the US-ASCII characer set" (WML 9.5.1)
	
	Content-Disposition : form-data with parameter name as indicated by 
		the ppbNameData.

	NOTE! It is the caller's responsibility to deallocate the created 
	list.
	
	NOTE! The allocated memory in the parameter ppbValueData is taken 
	over by the function (the parameter is set to point to NULL before 
	the function returns).

  	NOTE! ppMultipartList, ppbNameData, and ppbValueData MUST NOT be NULL.

	Input: Pointer to list (MULTIPARTSTR**), Name (BYTE*), Value (BYTE**),
		   Value length (UINT32) and character encoding IANA nbr (INT16) 
	Output: -
==========================================================================*/
/*  Modified by GBU,000510, use type
void WAE_AddTextFormDataPart (void** ppMultiPartList, BYTE* pbNameData,  
							  BYTE** ppbValueData, UINT32 iValueLen, INT16 iCharEnc);
*/
void WAE_AddTextFormDataPart (pMULTIPARTSTR* ppMultiPartList, BYTE* pbNameData,  
                              BYTE** ppbValueData, UINT32 iValueLen, INT16 iCharEnc);


/*========================================================================
	WAE_AddGenericFormDataPart
==========================================================================
	This function creates one part of a multipart/form-data and stores 
	the result last in the list ppMultiPartList (MULTIPARTSTR). A WSP
	header is created and added for each part. The list is transformed 
	into multipart content with a call to the function WSP_BuildMulipart.
	The following WSP headers are added to each part:
	
	Content-type : As indicated by the string pbContentType.
	
	Content-Disposition : attachment. If the pbContentDispositionFileName
		parameter is specified, this is added as the filename parameter.

	NOTE! It is the caller's responsibility to deallocate the created 
	list.
	
	NOTE! The allocated memory in the parameter ppbData is taken over by 
	the function (the parameter is set to point to NULL before the function 
	returns).

	NOTE! ppMultipartHandle MUST NOT be NULL.

	Input: Pointer to list (MULTIPARTSTR**), Data (BYTE*), DataLen (UINT16),
		   ContentType (BYTE*), File name (BYTE*)
	Output: -
==========================================================================*/
/*  Modified by GBU,000510, use type
void WAE_AddGenericFormDataPart (void** ppMultiPartHandle, BYTE** ppbData, UINT16 iDataLen, 
								 BYTE* pbContentType, BYTE* pbContentDispositionFileName);
*/
void WAE_AddGenericFormDataPart (pMULTIPARTSTR* ppMultiPartHandle, BYTE** ppbData, UINT16 iDataLen,
                                 BYTE* pbContentType, BYTE* pbContentDispositionFileName);



/* ==================== HEADER BUILD HELP FUNCTIONS ======================
			Help functions used during the construction of headers.
   ======================================================================= */

/*========================================================================
	WSP_CreateHeaderField
==========================================================================
	Creates one header with the specified data and adds it to the end of 
	the header list. The indata pbData is NOT deallocated. The ppList 
	pointer	is updated to point to the last added header.

	NOTE! The Data MUST be defined, i.e., NOT null and at least one byte
	in length.

	Supported headers are:
	
	Field_Accept, Field_Accept_Charset, Field_Accept_Language, 
	Field_Authorization, Field_Proxy_Authorization, Field_Referer,
	Field_If_Modified_Since, Field_User_Agent, Field_If_None_Match,
	Field_Profile, Field_Accept_Application, and Field_Bearer_Indication
	
	Input: Field, data (NOT NULL), length of data in bytes (NOT 0) and 
		   pointer to pointer of header list.
	Output: TRUE if OK, FALSE otherwise.
==========================================================================*/
BOOL WSP_CreateHeaderField (BYTE bField, BYTE *pbData, UINT32 iDataLength,
						pHEADBUILDSTR *ppList);

/*========================================================================
	WSP_BuildHeader
==========================================================================
	Assembles the headers in the header	list to a byte stream. This stream 
	can then be sent as a valid header. The length of the byte stream is 
	stored in the iDataLength variable. The list of header build elements 
	is deleted if the operation is succesful.
	
	Input :	Pointer to Header List and pointer to iDataLength.
	Output:	BYTE *, NULL if error.
==========================================================================*/
BYTE *WSP_BuildHeader (pHEADBUILDSTR pList, UINT32 *iDataLength);


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -