You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2006/03/18 00:20:19 UTC

svn commit: r386765 - in /webservices/axis/trunk/c/src/configuration: AxisConfiguration.cpp AxisConfiguration.hpp

Author: prestonf
Date: Fri Mar 17 15:20:15 2006
New Revision: 386765

URL: http://svn.apache.org/viewcvs?rev=386765&view=rev
Log:
Updates to AxisConfiguration.


Modified:
    webservices/axis/trunk/c/src/configuration/AxisConfiguration.cpp
    webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp

Modified: webservices/axis/trunk/c/src/configuration/AxisConfiguration.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/AxisConfiguration.cpp?rev=386765&r1=386764&r2=386765&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/configuration/AxisConfiguration.cpp (original)
+++ webservices/axis/trunk/c/src/configuration/AxisConfiguration.cpp Fri Mar 17 15:20:15 2006
@@ -104,7 +104,7 @@
 					}
 					else
 					{
-						SelectFileFromList( sChoiceList, iChoiceCount, &sDLLNames, iConfigInfoArray, (char **) psDefaultParamList);
+						SelectFileFromList( sChoiceList, iChoiceCount, &sDLLNames, iConfigInfoArray, (char **) psDefaultParamList, &sFileNameList, szAxisCpp_Deploy);
 					}
 				}
 
@@ -146,7 +146,7 @@
 		WriteAxisConfigFile( &sDLLNames, iConfigInfoArray, sChoiceList);
 	}
 
-	Destroy( &sDLLNames, &sFileNameList, (char *) psDefaultParamList);
+	Destroy( &sDLLNames, &sFileNameList, (char **) psDefaultParamList);
 
 	return (int) bSuccess;
 }
@@ -192,7 +192,7 @@
 				{
 					iIndex++;
 				}
-			} while( iIndex < eConfigMax && !bOptionFound);
+			} while( iIndex < (eConfigMax - 1) && !bOptionFound);
 
 			if( bOptionFound)
 			{
@@ -420,7 +420,7 @@
 	}
 }
 
-void SelectFileFromList( CHOICELIST * psChoiceList, int iChoiceCount, DLLNAMES * psDLLNames, int * piConfigInfoArray, char ** ppsDefaultParamList)
+void SelectFileFromList( CHOICELIST * psChoiceList, int iChoiceCount, DLLNAMES * psDLLNames, int * piConfigInfoArray, char ** ppsDefaultParamList, FILENAMELIST * psFileNameList, char * pszAxisCpp_Deploy)
 {
 	cout << endl << "Select the filename for the " << psChoiceList[iChoiceCount].pszElementDescription << "." << endl;
 
@@ -431,15 +431,16 @@
 
 	do
 	{
-		while( iDLLCount < psDLLNames->iIndex)
-		{
-			char *	pszUpper = new char[strlen( psChoiceList[iChoiceCount].pszElement) + 1];
+		char *	pszUpper = new char[strlen( psChoiceList[iChoiceCount].pszElement) + 1];
 
-			strcpy( pszUpper, psChoiceList[iChoiceCount].pszElement);
+		strcpy( pszUpper, psChoiceList[iChoiceCount].pszElement);
 
-			StringToUpper( pszUpper);
+		StringToUpper( pszUpper);
+
+		while( iDLLCount < psDLLNames->iIndex)
+		{
 
-			if( strstr( psDLLNames->ppsDLLName[iDLLCount]->pszDLLName, pszUpper) != NULL)
+			if( psDLLNames->ppsDLLName[iDLLCount]->pszDLLName != NULL && strstr( psDLLNames->ppsDLLName[iDLLCount]->pszDLLName, pszUpper) != NULL)
 			{
 				iDLLOffsetList[iDLLListCount] = iDLLCount;
 
@@ -447,58 +448,64 @@
 			}
 
 			iDLLCount++;
-
-			free( pszUpper);
 		}
 
-		if( ppsDefaultParamList[iChoiceCount] != NULL)
+		free( pszUpper);
+
+		if( ppsDefaultParamList[psChoiceList[iChoiceCount].eConfigType] != NULL)
 		{
-			if( iDLLListCount > 0)
-			{
-			}
-			else
-			{
-//				psDLLNames->ppsDLLName[iDLLOffsetList[iChoice - 1]]->bAddToClientConfig = true;
-//				piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = iDLLOffsetList[iChoice - 1];
-			}
-		}
+			CreateNewDLLNamesElement( psDLLNames, psFileNameList);
+			psDLLNames->ppsDLLName[psDLLNames->iIndex]->bAddToClientConfig = true;
+			piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = psDLLNames->iIndex;
+			psDLLNames->ppsDLLName[psDLLNames->iIndex]->pszDLLFilename = (char *) malloc( strlen( ppsDefaultParamList[psChoiceList[iChoiceCount].eConfigType]) + 1);
+
+			strcpy( psDLLNames->ppsDLLName[psDLLNames->iIndex]->pszDLLFilename, ppsDefaultParamList[psChoiceList[iChoiceCount].eConfigType]);
+
+			psDLLNames->iIndex++;
 
-		if( iDLLListCount > 0)
+			bHTTPTransportFound = true;
+
+			cout << "Choices have been overridden by input parameter." << endl;
+		}
+		else
 		{
-			if( iDLLListCount > 1)
+			if( iDLLListCount > 0)
 			{
-				cout << "Select an index between 1 and " << iDLLListCount << " : ";
+				if( iDLLListCount > 1)
+				{
+					cout << "Select an index between 1 and " << iDLLListCount << " : ";
 
-				int	iChoice;
+					int	iChoice;
 
-				cin >> iChoice;
+					cin >> iChoice;
 
-				if( iChoice < 1 || iChoice > iDLLListCount)
-				{
-					cout << "Number was out of range." << endl;
+					if( iChoice < 1 || iChoice > iDLLListCount)
+					{
+						cout << "Number was out of range." << endl;
+					}
+					else
+					{
+						psDLLNames->ppsDLLName[iDLLOffsetList[iChoice - 1]]->bAddToClientConfig = true;
+						piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = iDLLOffsetList[iChoice - 1];
+						bHTTPTransportFound = true;
+					}
 				}
 				else
 				{
-					psDLLNames->ppsDLLName[iDLLOffsetList[iChoice - 1]]->bAddToClientConfig = true;
-					piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = iDLLOffsetList[iChoice - 1];
+					cout << "Automatically selected " << psDLLNames->ppsDLLName[iDLLOffsetList[0]]->pszDLLFilename << endl;
+
+					psDLLNames->ppsDLLName[iDLLOffsetList[0]]->bAddToClientConfig = true;
+					piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = iDLLOffsetList[0];
 					bHTTPTransportFound = true;
 				}
 			}
 			else
 			{
-				cout << "Automatically selected " << psDLLNames->ppsDLLName[iDLLOffsetList[0]]->pszDLLFilename << endl;
+				cout << "There are no recognised file names for the type of DLL." << endl << "You will have to modify the configuration file namually." << endl << endl;
 
-				psDLLNames->ppsDLLName[iDLLOffsetList[0]]->bAddToClientConfig = true;
-				piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = iDLLOffsetList[0];
 				bHTTPTransportFound = true;
 			}
 		}
-		else
-		{
-			cout << "There are no recognised file names for the type of DLL." << endl << "You will have to modify the configuration file namually." << endl << endl;
-
-			bHTTPTransportFound = true;
-		}
 	} while( !bHTTPTransportFound);
 }
 
@@ -603,7 +610,7 @@
 	psFileNameList->iListCount++;
 }
 
-void Destroy( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList, char * psDefaultParamList)
+void Destroy( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList, char ** ppsDefaultParamList)
 {
 	int iCount;
 
@@ -624,9 +631,9 @@
 
 	for( iCount = 0; iCount < eConfigMax; iCount++)
 	{
-		if( psDefaultParamList[iCount] != NULL)
+		if( ppsDefaultParamList[iCount] != NULL)
 		{
-			free( (void *) psDefaultParamList[iCount]);
+			free( (void *) ppsDefaultParamList[iCount]);
 		}
 	}
 }

Modified: webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp?rev=386765&r1=386764&r2=386765&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp (original)
+++ webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp Fri Mar 17 15:20:15 2006
@@ -80,11 +80,11 @@
 const char * CreateConfigElement( DLLNAMES * psDLLNames, int * piConfigInfoArray, CHOICELIST * psChoiceList, ECONFIGTYPE eConfigType);
 void GetHomeAndLibrary( DLLNAMES * psDLLNames, char * pszAxisCpp_Deploy, char * pszAxis_Bin, char * pszAxis_Bin_Default, FILENAMELIST * psFileNameList, char ** ppsDefaultParamList);
 void Initialise( DLLNAMES * psDLLNames, int * piConfigInfoArray, FILENAMELIST * psFileNameList, char ** ppsDefaultParamList);
-void SelectFileFromList( CHOICELIST * psChoiceList, int iChoiceCount, DLLNAMES * psDLLNames, int * piConfigInfoArray, char ** ppsDefaultParamList);
+void SelectFileFromList( CHOICELIST * psChoiceList, int iChoiceCount, DLLNAMES * psDLLNames, int * piConfigInfoArray, char ** ppsDefaultParamList, FILENAMELIST * psFileNameList, char * pszAxisCpp_Deploy);
 void WriteAxisConfigFile( DLLNAMES * psDLLNames, int * piConfigInfoArray, CHOICELIST * psChoiceList);
 bool ReadFilenamesInaDirectory( char * pszDirName, FILENAMELIST * psFileNameList);
 void AddFilenameToList( FILENAMELIST * psFileNameList, char * pszFilename);
-void Destroy( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList, char * psDefaultParamList);
+void Destroy( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList, char ** psDefaultParamList);
 bool StringCompare( char * pszString1, char * pszString2);
 void StringToUpper( char * pszString);
 void CreateNewDLLNamesElement( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList);