📄 mgcpdef.c
字号:
/******************************************************************************* * Function : CopyRequestedEvents * * Description : Copy the Requested Events * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/18 : Creation * * Date : July 18 2005, Frank ZHANG ******************************************************************************/void CopyRequestedEvents(REQUESTED_EVENTS *pDesData, REQUESTED_EVENTS *pSrcData){ int i; if (pSrcData != NULL && pSrcData->wNum > 0) { pDesData->wNum = pSrcData->wNum; pDesData->pReqEventList = (REQUESTED_EVENT*)calloc(pDesData->wNum, sizeof(REQUESTED_EVENT)); for (i = 0; i < pDesData->wNum; i++) CopyRequestedEvent(pDesData->pReqEventList+i, pSrcData->pReqEventList+i); }}/******************************************************************************* * Function : ClearSignalRequest * * Description : Clear the Signal Request * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/18 : Creation * * Date : July 18 2005, Frank ZHANG ******************************************************************************/void ClearSignalRequest(SIGNAL_REQUEST *pData){ if (pData != NULL) { ClearEventName(&pData->SignalName); ClearEventParameters(&pData->SigParamList); }}/******************************************************************************* * Function : CopySignalRequest * * Description : Copy the Signal Request * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/18 : Creation * * Date : July 18 2005, Frank ZHANG ******************************************************************************/void CopySignalRequest(SIGNAL_REQUEST *pDesData, SIGNAL_REQUEST *pSrcData){ Assert(pDesData); Assert(pSrcData); if (pSrcData != NULL) { CopyEventName(&pDesData->SignalName, &pSrcData->SignalName); CopyEventParameters(&pDesData->SigParamList, &pSrcData->SigParamList); }}/******************************************************************************* * Function : ClearSignalRequests * * Description : Clear the Signal Requests * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/19 : Creation * * Date : July 19 2005, Frank ZHANG ******************************************************************************/void ClearSignalRequests(SIGNAL_REQUESTS *pData){ if (pData != NULL) { if (pData->wNum > 0) { while (pData->wNum-- > 0) ClearSignalRequest(pData->pSigReqList+pData->wNum); pData->wNum = 0; free(pData->pSigReqList); pData->pSigReqList = NULL; } }}/******************************************************************************* * Function : CopySignalRequests * * Description : Copy the Signal Requests * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/19 : Creation * * Date : July 19 2005, Frank ZHANG ******************************************************************************/void CopySignalRequests(SIGNAL_REQUESTS *pDesData, SIGNAL_REQUESTS *pSrcData){ int i; if (pSrcData != NULL && pSrcData->wNum > 0) { pDesData->wNum = pSrcData->wNum; pDesData->pSigReqList = (SIGNAL_REQUEST*)calloc(pDesData->wNum, sizeof(SIGNAL_REQUEST)); for (i = 0; i < pDesData->wNum; i++) CopySignalRequest(pDesData->pSigReqList+i, pSrcData->pSigReqList+i); }}/******************************************************************************* * Function : CopyDigitMap * * Description : Copy the Digit Map * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/19 : Creation * * Date : July 19 2005, Frank ZHANG ******************************************************************************/void CopyDigitMap(DIGIT_MAP *pDesData, DIGIT_MAP *pSrcData){ int i = 0; Assert(pDesData); Assert(pSrcData); if (pSrcData != NULL) { pDesData->eType = pSrcData->eType; pDesData->wNum = pSrcData->wNum; if (pSrcData->wNum > 0) { pDesData->pDigitString = (char**)calloc(pSrcData->wNum, sizeof(char*)); for (i = 0; i < pSrcData->wNum; i++) { StrClone(pDesData->pDigitString+i, pSrcData->pDigitString[i]); } } }}/******************************************************************************* * Function : ClearDigitMap * * Description : Clear the Digit Map * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/19 : Creation * * Date : July 19 2005, Frank ZHANG ******************************************************************************/void ClearDigitMap(DIGIT_MAP *pData){ if (pData != NULL) { if (pData->wNum >0) { while (pData->wNum-- > 0) free(pData->pDigitString[pData->wNum]); pData->wNum = 0; free(pData->pDigitString); pData->pDigitString = NULL; } pData->eType = 0; }}/******************************************************************************* * Function : ClearMgcpDigitMap * * Description : Clear the Mgcp Digit Map * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/19 : Creation * * Date : July 19 2005, Frank ZHANG ******************************************************************************/void ClearMgcpDigitMap(MGCP_DIGIT_MAP *pData){ if (pData != NULL) { ClearDigitMap(&pData->DigitMap); while (pData->wStrNum-- > 0) { WORD wNum = pData->pDigitStrList[pData->wStrNum].wSubStrNum; while (wNum-- > 0) { free(pData->pDigitStrList[pData->wStrNum].pSubStrList[wNum].pcDigitString); } free(pData->pDigitStrList[pData->wStrNum].pSubStrList); } pData->wStrNum = 0; free(pData->pDigitStrList); pData->pDigitStrList = NULL; }}/******************************************************************************* * Function : ClearConnectionParameters * * Description : Clear the Connection Parameters * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/20 : Creation * * Date : July 20 2005, Frank ZHANG ******************************************************************************/void ClearConnectionParameters(CONNECTION_PARAMETERS *pData){ if (pData != NULL) { if (pData->pExtension != NULL) { if (pData->pExtension->pcPackageName != NULL) free(pData->pExtension->pcPackageName); if (pData->pExtension->pcExtensionName != NULL) free(pData->pExtension->pcExtensionName); free(pData->pExtension); pData->pExtension = NULL; } }}/******************************************************************************* * Function : CopyConnectionParameters * * Description : Copy the Connection Parameters * * Input parameters : pDesData - Pointer to the destination data be copied into * pSrcData - Pointer to the source data to be copied * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/20 : Creation * * Date : July 20 2005, Frank ZHANG ******************************************************************************/void CopyConnectionParameters(CONNECTION_PARAMETERS *pDesData, CONNECTION_PARAMETERS *pSrcData){ Assert(pDesData); if (pSrcData) { memcpy(pDesData, pSrcData, sizeof(CONNECTION_PARAMETERS)); if (pSrcData->pExtension != NULL) { pDesData->pExtension = (CONNECTION_PARAM_EXTEN*)calloc(1, sizeof(CONNECTION_PARAM_EXTEN)); pDesData->pExtension->eType = pSrcData->pExtension->eType; StrClone(&pDesData->pExtension->pcPackageName, pSrcData->pExtension->pcPackageName); StrClone(&pDesData->pExtension->pcExtensionName, pSrcData->pExtension->pcExtensionName); pDesData->pExtension->dwExtensionValue = pSrcData->pExtension->dwExtensionValue; } }}/******************************************************************************* * Function : ClearReasonCode * * Description : Clear the Reason Code * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/20 : Creation * * Date : July 20 2005, Frank ZHANG ******************************************************************************/void ClearReasonCode(REASON_CODE *pData){ if (pData != NULL) { if (pData->pcReasonDescription != NULL) { free(pData->pcReasonDescription); pData->pcReasonDescription = NULL; } }}/******************************************************************************* * Function : ClearEndpointName * * Description : Clear the Endpoint Name * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/20 : Creation * * Date : July 20 2005, Frank ZHANG ******************************************************************************/void ClearEndpointName(ENDPOINT_NAME *pData){ if (pData != NULL) { if (pData->pcLocalName != NULL) { free(pData->pcLocalName); pData->pcLocalName = NULL; } if (pData->pcDomainName != NULL) { free(pData->pcDomainName); pData->pcDomainName = NULL; } }}/******************************************************************************* * Function : ClearExtensionParameter * * Description : Clear the Extension Parameter * * Input parameters : pData - Pointer to the data to be cleared * * Output parameters : * * Return value : * * Comments : * * History : * 2005/07/20 : Creation * * Date : July 20 2005, Frank ZHANG ******************************************************************************/void Clea
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -