axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r387243 - /webservices/axis/trunk/c/src/configuration/
Date Mon, 20 Mar 2006 16:48:51 GMT
Author: prestonf
Date: Mon Mar 20 08:48:48 2006
New Revision: 387243

URL: http://svn.apache.org/viewcvs?rev=387243&view=rev
Log:
Refactoring and changes for AxisConfiguration to work with AIX.

Added:
    webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.cpp
    webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.hpp
    webservices/axis/trunk/c/src/configuration/FileFunctions.cpp
    webservices/axis/trunk/c/src/configuration/FileFunctions.hpp
    webservices/axis/trunk/c/src/configuration/ListMethods.cpp
    webservices/axis/trunk/c/src/configuration/ListMethods.hpp
    webservices/axis/trunk/c/src/configuration/MissingCFunctions.cpp
    webservices/axis/trunk/c/src/configuration/MissingCFunctions.hpp
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=387243&r1=387242&r2=387243&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/configuration/AxisConfiguration.cpp (original)
+++ webservices/axis/trunk/c/src/configuration/AxisConfiguration.cpp Mon Mar 20 08:48:48 2006
@@ -1,8 +1,13 @@
+#include "FileFunctions.hpp"
 #include "AxisConfiguration.hpp"
+#include "MissingCFunctions.hpp"
+#include "AxisConfigurationLibraries.hpp"
+
+// Client -a c:\wscc -o obj\bin -th transport.dll -c channel.dll -cs sslChannel.dll -x xerces.dll
-cl client.log
 
 int main( int argc, char * argv[])
 {
-	DLLNAMES		sDLLNames;
+	LIST			sDLLNames;
 	int				iConfigInfoArray[eConfigMax];
 	CHOICELIST		sChoiceList[] = { {PLATFORM_TRANSPORTHTTP_PATH,	"HTTP Transport library",		
								AXCONF_TRANSPORTHTTP_TAGNAME,		eHTTPTransport,		eClientAndServer},
 									  {PLATFORM_CHANNEL_PATH,		"HTTP Channel library",												AXCONF_CHANNEL_HTTP_TAGNAME,
	eHTTPChannel,		eClientAndServer},
@@ -19,7 +24,7 @@
 									  {"",							"Root directory",													0,									eUnknown,			eEmpty},
 									  {"",							"library offset directory",											0,									eUnknown,			eEmpty}};
 	bool			bSuccess = false;
-	FILENAMELIST	sFileNameList;
+	LIST			sFileNameList;
 	char *			psDefaultParamList[eConfigMax];
 
 	Initialise( &sDLLNames, iConfigInfoArray, &sFileNameList, (char **) psDefaultParamList);
@@ -36,7 +41,7 @@
 			cout << "Client" << endl;
 			cout << "-a  root directory of Axis download (AXISCPP_HOME)" << endl;
 			cout << "-o  offset from AXISCPP_HOME to object files" << endl;
-			cout << "-t  transport library name" << endl;
+			cout << "-th transport library name" << endl;
 			cout << "-c  channel library name" << endl;
 			cout << "-cs ssl channel library name" << endl;
 			cout << "-x  xerces library name" << endl;
@@ -69,38 +74,43 @@
 					if( sChoiceList[iChoiceCount].eConfigType == eClientLog ||
 						sChoiceList[iChoiceCount].eConfigType == eServerLog)
 					{
-						if(sChoiceList[iChoiceCount].eConfigType == eClientLog)
+						char	szLog[256];
+
+						szLog[0] = '\0';
+
+						if( sChoiceList[iChoiceCount].eConfigType == eClientLog)
 						{
-							cout << "Enter name of client trace/log file: ";
+							if( psDefaultParamList[eClientLog] == NULL)
+							{
+								cout << "Enter name of client trace/log file: ";
+							}
+							else
+							{
+								strcpy( szLog, psDefaultParamList[eClientLog]);
+							}
 						}
 						else
 						{
-							cout << "Enter name of server trace/log file: ";
+							if( psDefaultParamList[eServerLog] == NULL)
+							{
+								cout << "Enter name of server trace/log file: ";
+							}
+							else
+							{
+								strcpy( szLog, psDefaultParamList[eServerLog]);
+							}
 						}
 
-						CreateNewDLLNamesElement( &sDLLNames, &sFileNameList);
-
-						char 	szLog[256];
-						char	szFilename[512];
+						char			szFilename[512];
 
-						cin >> szLog;
-						
-						sDLLNames.ppsDLLName[sDLLNames.iIndex]->pszDLLName = (char *) malloc( strlen( szLog)
+ 1);
-
-						strcpy( sDLLNames.ppsDLLName[sDLLNames.iIndex]->pszDLLName, szLog);
+						if( szLog[0] == '\0')
+						{
+							cin >> szLog;
+						}
 
 						sprintf( szFilename, "%s\\%s", szAxisCpp_Deploy, szLog);
 
-						sDLLNames.ppsDLLName[sDLLNames.iIndex]->pszDLLFilename = (char *) malloc( strlen(
szFilename) + 1);
-
-						strcpy( sDLLNames.ppsDLLName[sDLLNames.iIndex]->pszDLLFilename, szFilename);
-
-						iConfigInfoArray[sChoiceList[iChoiceCount].eConfigType] = sDLLNames.iIndex;
-
-						sDLLNames.ppsDLLName[iChoiceCount]->bAddToClientConfig = true;
-
-						sDLLNames.iIndex++;
-
+						iConfigInfoArray[sChoiceList[iChoiceCount].eConfigType] = PopulateNewDLLNameInfo( &sDLLNames,
szLog, szFilename, true);
 					}
 					else
 					{
@@ -154,17 +164,17 @@
 ECONFIG	ReadConfigOptions( int iParamCount, char * pParamArray[], char ** ppsDefaultParamList)
 {
 	ECONFIG		eConfig = eEmpty;
-	OPTIONLIST	sOptions[] = {{eHTTPTransport, "TH"},
-							  {eHTTPChannel, "C"},
-							  {eHTTPSSLChannel, "CS"},
-							  {eXMLParser, "X"},
-							  {eSMTPTransport, "TS"},
-							  {eClientLog, "CL"},
-							  {eClientWSDD, "CW"},
-							  {eServerLog, "SL"},
-							  {eRootDirectory, "A"},
-							  {eOffsetToLibs, "O"},
-							  {eServerWSDD, "SW"}};
+	OPTIONLIST	sOptions[] = {{eHTTPTransport,	"TH"},
+							  {eHTTPChannel,	"C"},
+							  {eHTTPSSLChannel,	"CS"},
+							  {eXMLParser,		"X"},
+							  {eSMTPTransport,	"TS"},
+							  {eClientLog,		"CL"},
+							  {eClientWSDD,		"CW"},
+							  {eServerLog,		"SL"},
+							  {eRootDirectory,	"A"},
+							  {eOffsetToLibs,	"O"},
+							  {eServerWSDD,		"SW"}};
 
 	for( int iCount = 0; iCount < iParamCount; iCount++)
 	{
@@ -205,9 +215,27 @@
 
 				if( iCount < iParamCount)
 				{
-					ppsDefaultParamList[sOptions[iIndex].eConfType] = (char *) malloc( strlen( pParamArray[iCount])
+ 1);
+					if( ppsDefaultParamList[eOffsetToLibs] != NULL &&
+						ppsDefaultParamList[eRootDirectory] != NULL)
+					{
+						char	szLocation[512];
+						char	cSlash = '/';
 
-					strcpy( ppsDefaultParamList[sOptions[iIndex].eConfType], pParamArray[iCount]);
+#if WIN32
+						cSlash = '\\';
+#endif
+						sprintf( szLocation, "%s%c%s%c%s", ppsDefaultParamList[eRootDirectory], cSlash, ppsDefaultParamList[eOffsetToLibs],
cSlash, pParamArray[iCount]);
+
+						ppsDefaultParamList[sOptions[iIndex].eConfType] = (char *) malloc( strlen( szLocation)
+ 1);
+
+						strcpy( ppsDefaultParamList[sOptions[iIndex].eConfType], szLocation);
+					}
+					else
+					{
+						ppsDefaultParamList[sOptions[iIndex].eConfType] = (char *) malloc( strlen( pParamArray[iCount])
+ 1);
+
+						strcpy( ppsDefaultParamList[sOptions[iIndex].eConfType], pParamArray[iCount]);
+					}
 				}
 			}
 			else
@@ -219,134 +247,20 @@
 
 	return eConfig;
 }
-bool CheckAxisBinDirectoryExists( char * pszAxisCpp_Deploy, char * pszAxis_Bin, char * pszAxis_Bin_Default,
DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList)
-{
-	bool	bFound = false;
-
-	if( strlen( pszAxis_Bin) < 2)
-	{
-		strcpy( pszAxis_Bin, pszAxis_Bin_Default);
-	}
-
-	char	szFilename[512];
-	char	szFileDirAndName[512];
-
-	sprintf( szFilename, "%s\\%s\\*.*", pszAxisCpp_Deploy, pszAxis_Bin);
-
-	bFound = ReadFilenamesInaDirectory( szFilename, psFileNameList);
 
-	int		iIndex = 0;
-
-	do
-	{
-		char *	pExtn = psFileNameList->ppszListArray[iIndex];
 
-		do
-		{
-			if( (pExtn = strchr( pExtn, '.')) != NULL)
-			{
-				pExtn++;
-
-#if WIN32
-				if( StringCompare( pExtn, "DLL"))
-#else
-				if( StringCompare( pExtn, "SO"))
-#endif
-				{
-					CreateNewDLLNamesElement( psDLLNames, psFileNameList);
-
-					psDLLNames->ppsDLLName[psDLLNames->iIndex]->pszDLLName = (char *) malloc( strlen(
psFileNameList->ppszListArray[iIndex]) + 1);
-
-					strcpy( psDLLNames->ppsDLLName[psDLLNames->iIndex]->pszDLLName, psFileNameList->ppszListArray[iIndex]);
-
-					StringToUpper( psDLLNames->ppsDLLName[psDLLNames->iIndex]->pszDLLName);
-
-					sprintf( szFileDirAndName, "%s\\%s\\%s", pszAxisCpp_Deploy, pszAxis_Bin, psFileNameList->ppszListArray[iIndex]);
-
-					psDLLNames->ppsDLLName[psDLLNames->iIndex]->pszDLLFilename = (char *) malloc(
strlen( szFileDirAndName) + 1);
-
-					strcpy( psDLLNames->ppsDLLName[psDLLNames->iIndex]->pszDLLFilename, szFileDirAndName);
-
-					psDLLNames->iIndex++;
-
-					break;
-				}
-			}
-		} while( pExtn != NULL);
-
-		iIndex++;
-	} while( iIndex < psFileNameList->iListCount);
-
-	if( !bFound)
-	{
-		cout << "The directory " << pszAxis_Bin << " was not found." <<
endl;
-	}
-
-	return bFound;
-}
-
-const char * CreateConfigElement( DLLNAMES * psDLLNames, int * piConfigInfoArray, CHOICELIST
* psChoiceList, ECONFIGTYPE eConfigType)
-{
-	int					iIndex = 0;
-	bool				bFound = false;
-	char *				pszConfigName = "<unknown name>";
-	static std::string	sReturn;
-
-	while( iIndex < eConfigMax && !bFound)
-	{
-		if( psChoiceList[iIndex].eConfigType == eConfigType)
-		{
-			bFound = true;
-
-			pszConfigName = psChoiceList[iIndex].pszConfigName;
-		}
-		else
-		{
-			iIndex++;
-		}
-	}
-
-	if( bFound)
-	{
-		sReturn = "#Path to ";
-		sReturn += psChoiceList[iIndex].pszElementDescription;
-		sReturn += "\n";
-	}
-	else
-	{
-		sReturn = "#Path to an unknown element\n";
-	}
-
-	char	szReturn[256];
-
-	if( piConfigInfoArray[eConfigType] != -1)
-	{
-		sprintf( szReturn, "%s:%s\n", pszConfigName, psDLLNames->ppsDLLName[piConfigInfoArray[eConfigType]]->pszDLLFilename);
-	}
-	else
-	{
-		sprintf( szReturn, "#%s:<not set>\n", pszConfigName);
-	}
-
-	sReturn += szReturn;
-
-	return sReturn.c_str();
-}
-
-void GetHomeAndLibrary( DLLNAMES * psDLLNames, char * pszAxisCpp_Deploy, char * pszAxis_Bin,
char * pszAxis_Bin_Default, FILENAMELIST * psFileNameList, char ** ppsDefaultParamList)
+void GetHomeAndLibrary( LIST * psDLLNames, char * pszAxisCpp_Deploy, char * pszAxis_Bin,
char * pszAxis_Bin_Default, LIST * psFileNameList, char ** ppsDefaultParamList)
 {
 	if( ppsDefaultParamList[eRootDirectory] == NULL)
 	{
 #if WIN32
-		cout << "Type in full qualified directory path into which you downloaded Axis." <<
endl
-			<< "(e.g. C:\\Axis).  Where C:\\Axis\\axis-c-1.6-Win32-trace-bin is the" <<
endl
-			<< "directory created when Axis was unzipped (this directory must also" <<
endl
-			<< "contain the axiscpp.conf file)." << endl;
+		cout << "Type in the Axis fully qualified directory path (e.g. C:\\Axis)" <<
endl
+			<< "used when Axis was unzipped (NB: this directory must also contain the" <<
endl
+			<< "axiscpp.conf file)." << endl;
 #else
-		cout << "Type in full qualified directory path into which you downloaded Axis." <<
endl
-			<< "(e.g. /home/Axis).  Where /home/Axis/axis-c-1.6-Linux-trace-bin is the" <<
endl
-			<< "directory created when Axis was untared (this directory must also" <<
endl
-			<< "contain the etc/axiscpp.conf file)." << endl;
+		cout << "Type in the Axis fully qualified directory path (e.g. /home/Axis)" <<
endl
+			<< "used when Axis was unzipped (NB: this directory must also contain the" <<
endl
+			<< "etc/axiscpp.conf file)." << endl;
 #endif
 		cout << "AXISCPP_DEPLOY = ";
 		cin >> pszAxisCpp_Deploy;
@@ -370,10 +284,12 @@
 		}
 	}
 
+	strcpy( pszAxis_Bin_Default, pszAxisCpp_Deploy);
+
 #if WIN32
-	strcpy( pszAxis_Bin_Default, "\\axis-c-1.6-Win32-trace-bin\\bin");
+	strcat( pszAxis_Bin_Default, "\\axis-c-1.6-Win32-trace-bin\\bin");
 #else
-	strcpy( pszAxis_Bin_Default, "/axis-c-1.6-Linux-trace-bin/bin");
+	strcat( pszAxis_Bin_Default, "/axis-c-1.6-Linux-trace-bin/bin");
 #endif
 
 	if( ppsDefaultParamList[eOffsetToLibs] == NULL)
@@ -388,19 +304,22 @@
 			 << "EXPORT AXISCPP_DEPLOY=" << pszAxisCpp_Deploy << endl << endl;
 #endif
 
-		strcpy( pszAxis_Bin_Default, pszAxisCpp_Deploy);
-
 		do
 		{
 #if WIN32
 			cout << "Type in the directory where the Axis libraries (e.g. axis_client.dll) can
be" << endl
-					<< "found.  (The default directory is " << pszAxisCpp_Deploy << "\\axis-c-1.6-Win32-trace-bin\\bin)."
<< endl;
+					<< "found.  (If you type '*', it will use the default '" << pszAxis_Bin_Default
<< "')." << endl;
 #else
 			cout << "Type in the directory where the Axis libraries (e.g. axis_client.so) can
be" << endl
-					<< "found.  (The default directory is " << pszAxisCpp_Deploy << "/axis-c-1.6-Linux-trace-bin/bin)."
<< endl;
+					<< "found.  (If you type '*', it will use the default '" << pszAxis_Bin_Default
<< "')." << endl;
 #endif
 			cout << "Axis binaries directory = ";
 			cin >> pszAxis_Bin;
+
+			if( !strcmp( pszAxis_Bin, "*"))
+			{
+				strcpy( pszAxis_Bin, pszAxis_Bin_Default);
+			}
 		}
 		while( !CheckAxisBinDirectoryExists( pszAxisCpp_Deploy, pszAxis_Bin, pszAxis_Bin_Default,
psDLLNames, psFileNameList));
 	}
@@ -408,27 +327,16 @@
 	cout << endl << "Begin to configure the AXISCPP.CONF file." << endl;
 }
 
-void Initialise( DLLNAMES * psDLLNames, int * piConfigInfoArray, FILENAMELIST * psFileNameList,
char ** ppsDefaultParamList)
-{
-	memset( psDLLNames, 0, sizeof( DLLNAMES));
-	memset( psFileNameList, 0, sizeof( FILENAMELIST));
-
-	for( int iCount = 0; iCount < eConfigMax; iCount++)
-	{
-		piConfigInfoArray[iCount] = -1;
-		ppsDefaultParamList[iCount] = NULL;
-	}
-}
-
-void SelectFileFromList( CHOICELIST * psChoiceList, int iChoiceCount, DLLNAMES * psDLLNames,
int * piConfigInfoArray, char ** ppsDefaultParamList, FILENAMELIST * psFileNameList, char
* pszAxisCpp_Deploy)
+void SelectFileFromList( CHOICELIST * psChoiceList, int iChoiceCount, LIST * psDLLNames,
int * piConfigInfoArray, char ** ppsDefaultParamList, LIST * psFileNameList, char * pszAxisCpp_Deploy)
 {
 	cout << endl << "Select the filename for the " << psChoiceList[iChoiceCount].pszElementDescription
<< "." << endl;
 
 	int		iDLLCount = 0;
-	int		iDLLListCount = 0;
-	int		iDLLOffsetList[8];
+	LIST	sDLLOffsetList;
 	bool	bHTTPTransportFound = false;
 
+	memset( &sDLLOffsetList, 0, sizeof( LIST));
+
 	do
 	{
 		char *	pszUpper = new char[strlen( psChoiceList[iChoiceCount].pszElement) + 1];
@@ -437,14 +345,16 @@
 
 		StringToUpper( pszUpper);
 
-		while( iDLLCount < psDLLNames->iIndex)
+		while( iDLLCount < psDLLNames->iCount)
 		{
 
-			if( psDLLNames->ppsDLLName[iDLLCount]->pszDLLName != NULL && strstr( psDLLNames->ppsDLLName[iDLLCount]->pszDLLName,
pszUpper) != NULL)
+			if( ((DLLNAMEINFO *) psDLLNames->ppArray[iDLLCount])->pszDLLName != NULL &&
strstr( ((DLLNAMEINFO *) psDLLNames->ppArray[iDLLCount])->pszDLLName, pszUpper) != NULL)
 			{
-				iDLLOffsetList[iDLLListCount] = iDLLCount;
+				int *	piDLLOffset = (int *) GetNextListElement( &sDLLOffsetList, sizeof( int));
 
-				cout << ++iDLLListCount << ".\t" << psDLLNames->ppsDLLName[iDLLCount]->pszDLLFilename
<< endl;
+				*piDLLOffset = iDLLCount;
+
+				cout << sDLLOffsetList.iCount << ".\t" << ((DLLNAMEINFO *) psDLLNames->ppArray[iDLLCount])->pszDLLFilename
<< endl;
 			}
 
 			iDLLCount++;
@@ -452,16 +362,10 @@
 
 		free( pszUpper);
 
-		if( ppsDefaultParamList[psChoiceList[iChoiceCount].eConfigType] != NULL)
+		if( ppsDefaultParamList[psChoiceList[iChoiceCount].eConfigType] != NULL &&
+			FileExists( ppsDefaultParamList[psChoiceList[iChoiceCount].eConfigType]))
 		{
-			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++;
+			piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = PopulateNewDLLNameInfo( psDLLNames,
NULL, ppsDefaultParamList[psChoiceList[iChoiceCount].eConfigType], true);
 
 			bHTTPTransportFound = true;
 
@@ -469,33 +373,33 @@
 		}
 		else
 		{
-			if( iDLLListCount > 0)
+			if( sDLLOffsetList.iCount > 0)
 			{
-				if( iDLLListCount > 1)
+				if( sDLLOffsetList.iCount > 1)
 				{
-					cout << "Select an index between 1 and " << iDLLListCount << " : ";
+					cout << "Select an index between 1 and " << sDLLOffsetList.iCount <<
" : ";
 
 					int	iChoice;
 
 					cin >> iChoice;
 
-					if( iChoice < 1 || iChoice > iDLLListCount)
+					if( iChoice < 1 || iChoice > sDLLOffsetList.iCount)
 					{
 						cout << "Number was out of range." << endl;
 					}
 					else
 					{
-						psDLLNames->ppsDLLName[iDLLOffsetList[iChoice - 1]]->bAddToClientConfig = true;
-						piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = iDLLOffsetList[iChoice
- 1];
+						((DLLNAMEINFO *) psDLLNames->ppArray[*((int *) sDLLOffsetList.ppArray[iChoice -
1])])->bAddToClientConfig = true;
+						piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = *((int *) sDLLOffsetList.ppArray[iChoice
- 1]);
 						bHTTPTransportFound = true;
 					}
 				}
 				else
 				{
-					cout << "Automatically selected " << psDLLNames->ppsDLLName[iDLLOffsetList[0]]->pszDLLFilename
<< endl;
+					cout << "Automatically selected " << ((DLLNAMEINFO *) psDLLNames->ppArray[*((int
*) sDLLOffsetList.ppArray[0])])->pszDLLFilename << endl;
 
-					psDLLNames->ppsDLLName[iDLLOffsetList[0]]->bAddToClientConfig = true;
-					piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = iDLLOffsetList[0];
+					((DLLNAMEINFO *) psDLLNames->ppArray[*((int *) sDLLOffsetList.ppArray[0])])->bAddToClientConfig
= true;
+					piConfigInfoArray[psChoiceList[iChoiceCount].eConfigType] = *((int *) sDLLOffsetList.ppArray[0]);
 					bHTTPTransportFound = true;
 				}
 			}
@@ -507,206 +411,31 @@
 			}
 		}
 	} while( !bHTTPTransportFound);
-}
-
-void WriteAxisConfigFile( DLLNAMES * psDLLNames, int * piConfigInfoArray, CHOICELIST * psChoiceList)
-{
-	cout << "DLL selection complete" << endl << endl;
-
-	cout << "AxisCPP.conf file now has the following information:-" << endl;
-
-	cout << "# The comment character is '#'" << endl;
-	cout << "#Available directives are as follows" << endl;
-	cout << "#(Some of these directives may not be implemented yet)" << endl;
-	cout << "#" << endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eServerLog)
<< endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eServerWSDD)
<< endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eClientLog)
<< endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eClientWSDD)
<< endl;
-	cout << "#Node name." << endl;
-	cout << "#NodeName: <not set>" << endl << endl;
-	cout << "#Listening port." << endl;
-	cout << "#ListenPort: <not set>" << endl << endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eHTTPTransport)
<< endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eSMTPTransport)
<< endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eXMLParser)
<< endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eHTTPChannel)
<< endl;
-	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eHTTPSSLChannel)
<< endl;
-	cout << endl;
-}
-
-bool ReadFilenamesInaDirectory( char * pszDirName, FILENAMELIST * psFileNameList)
-{
-	bool				bSuccess = false;
-
-#if WIN32
-	intptr_t			lFindFile;
-	struct _finddata_t	sFindData;
-
-	if( (lFindFile = _findfirst( pszDirName, &sFindData)) != -1)
-	{
-		if( sFindData.name[0] == '.' && sFindData.attrib & _A_SUBDIR)
-		{
-			bSuccess = true;
-		}
-
-		do
-		{
-			if( !(sFindData.attrib & _A_SUBDIR))
-			{
-				AddFilenameToList( psFileNameList, sFindData.name);
-			}
-		} while( _findnext( lFindFile, &sFindData) == 0);
-
-		_findclose( lFindFile);
-	}
-#else
-	DIR *				psDIR;
-	struct dirent*		pDirEnt;
-	int					iFilenameCount = 0;
-
-	if( (psDIR = opendir( pszDirName)) == NULL)
-	{
-		return bSuccess;
-	}
-
-	while( (pDirEnt = readdir( psDIR)) != NULL)
-	{
-		AddFilenameToList( psFileNameList, pDirEnt->d_name);
-	}
-
-	if( closedir( psDIR) == -1)
-	{
-		return bSuccess;
-	}
-	else
-	{
-		bSuccess = true;
-	}
-#endif
-
-	return bSuccess;
-}
-
-void AddFilenameToList( FILENAMELIST * psFileNameList, char * pszFilename)
-{
-	if( psFileNameList->iListMax == 0)
-	{
-		psFileNameList->iListMax = 1;
-
-		psFileNameList->ppszListArray = (char **) malloc( sizeof( char *));
-	}
-	else if( psFileNameList->iListCount >= psFileNameList->iListMax)
-	{
-		psFileNameList->iListMax *= 2;
-
-		psFileNameList->ppszListArray = (char **) realloc( psFileNameList->ppszListArray,
sizeof( char *) * psFileNameList->iListMax);
-	}
-
-	psFileNameList->ppszListArray[psFileNameList->iListCount] = (char *) malloc( strlen(
pszFilename) + 1);
 
-	strcpy( psFileNameList->ppszListArray[psFileNameList->iListCount], pszFilename);
-
-	psFileNameList->iListCount++;
-}
-
-void Destroy( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList, char ** ppsDefaultParamList)
-{
-	int iCount;
-
-	for( iCount = 0; iCount < psDLLNames->iIndex; iCount++)
+	for( int iCount = 0; iCount < sDLLOffsetList.iCount; iCount++)
 	{
-		free( psDLLNames->ppsDLLName[iCount]->pszDLLFilename);
-		free( psDLLNames->ppsDLLName[iCount]->pszDLLName);
-		free( psDLLNames->ppsDLLName[iCount]);
-	}
-
-	for( iCount = 0; iCount < psFileNameList->iListCount; iCount++)
-	{
-		free( psFileNameList->ppszListArray[iCount]);
-	}
-
-	free( psDLLNames->ppsDLLName);
-	free( psFileNameList->ppszListArray);
-
-	for( iCount = 0; iCount < eConfigMax; iCount++)
-	{
-		if( ppsDefaultParamList[iCount] != NULL)
-		{
-			free( (void *) ppsDefaultParamList[iCount]);
-		}
+		free( sDLLOffsetList.ppArray[iCount]);
 	}
 }
 
-bool StringCompare( char * pszString1, char * pszString2)
+void AddFilenameToList( LIST * psFileNameList, char * pszFilename)
 {
-	bool	bSame = false;
-
-	if( pszString1 == NULL || pszString2 == NULL)
-	{
-		return bSame;
-	}
-
-	if( strlen( pszString1) != strlen( pszString2))
-	{
-		return bSame;
-	}
-
-	if( strlen( pszString1) == 0)
-	{
-		bSame = true;
-	}
-	else
-	{
-		char *	psString1 = pszString1;
-		char *	psString2 = pszString2;
+	char *	psList = (char *) GetNextListElement( psFileNameList, (int) strlen( pszFilename)
+ 1);
 
-		do
-		{
-			bSame = (toupper( *psString1++) == toupper( *psString2++));
-		} while( bSame && *psString1 != '\0');
-	}
-
-	return bSame;
+	strcpy( psList, pszFilename);
 }
 
-void StringToUpper( char * pszString)
+bool FileExists( char * pszFilename)
 {
-	if( pszString != NULL)
-	{
-		char *	pc = pszString;
-
-		while( *pc != '\0')
-		{
-			*pc = toupper( *pc);
-
-			pc++;
-		}
-	}
-}
+	FILE *	fp = fopen( pszFilename, "r");
+	bool	bSuccess = false;
 
-void CreateNewDLLNamesElement( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList)
-{
-	if( psDLLNames->iIndex >= psDLLNames->iMaxCount)
+	if( fp != NULL)
 	{
-		psDLLNames->iMaxCount = psDLLNames->iMaxCount * 2 + 1;
+		fclose( fp);
 
-		if( psDLLNames->ppsDLLName == NULL)
-		{
-			psDLLNames->ppsDLLName = (DLLNAMEINFO **) malloc( sizeof( void *) * psDLLNames->iMaxCount);
-		}
-		else
-		{
-			psDLLNames->ppsDLLName = (DLLNAMEINFO **) realloc( psDLLNames->ppsDLLName, sizeof(
void *) * psDLLNames->iMaxCount);
-		}
-
-		for( int iNewIndex = psDLLNames->iIndex; iNewIndex < psDLLNames->iMaxCount; iNewIndex++)
-		{
-			psDLLNames->ppsDLLName[iNewIndex] = NULL;
-		}
+		bSuccess = true;
 	}
-
-	psDLLNames->ppsDLLName[psDLLNames->iIndex] = (DLLNAMEINFO *) malloc( sizeof( DLLNAMEINFO));
-
-	memset( psDLLNames->ppsDLLName[psDLLNames->iIndex], 0, sizeof( DLLNAMEINFO));
+	
+	return bSuccess;
 }

Modified: webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp?rev=387243&r1=387242&r2=387243&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp (original)
+++ webservices/axis/trunk/c/src/configuration/AxisConfiguration.hpp Mon Mar 20 08:48:48 2006
@@ -1,14 +1,11 @@
-#if WIN32
-#include <io.h>
-#else
-#include <stdio.h>
-#include <sys/types.h>
-#include <dirent.h>
-#endif
+#if !defined(__AXIS_CONFIG__)
+
+#define __AXIS_CONFIG__
 
 #include <iostream>
 #include "platforms/PlatformAutoSense.hpp"
 #include "common/AxisConfig.h"
+#include "ListMethods.hpp"
 
 #undef _DEBUG
 
@@ -48,13 +45,6 @@
 
 typedef struct
 {
-	int				iIndex;
-	int				iMaxCount;
-	DLLNAMEINFO **	ppsDLLName;
-} DLLNAMES;
-
-typedef struct
-{
 	char *			pszElement;
 	char *			pszElementDescription;
 	char *			pszConfigName;
@@ -64,28 +54,15 @@
 
 typedef struct
 {
-	int				iListCount;
-	int				iListMax;
-	char **			ppszListArray;
-} FILENAMELIST;
-
-typedef struct
-{
 	ECONFIGTYPE		eConfType;
 	char *			pszOption;
 } OPTIONLIST;
 
 ECONFIG	ReadConfigOptions( int iParamCount, char * pszParamArray[], char ** ppsDefaultParamList);
-bool CheckAxisBinDirectoryExists( char * pszAxisCpp_Deploy, char * pszAxis_Bin, char * pszAxis_Bin_Default,
DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList);
-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, 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);
-bool StringCompare( char * pszString1, char * pszString2);
-void StringToUpper( char * pszString);
-void CreateNewDLLNamesElement( DLLNAMES * psDLLNames, FILENAMELIST * psFileNameList);
+bool CheckAxisBinDirectoryExists( char * pszAxisCpp_Deploy, char * pszAxis_Bin, char * pszAxis_Bin_Default,
LIST * psLIST, LIST * psFileNameList);
+void GetHomeAndLibrary( LIST * psLIST, char * pszAxisCpp_Deploy, char * pszAxis_Bin, char
* pszAxis_Bin_Default, LIST * psFileNameList, char ** ppsDefaultParamList);
+void SelectFileFromList( CHOICELIST * psChoiceList, int iChoiceCount, LIST * psLIST, int
* piConfigInfoArray, char ** ppsDefaultParamList, LIST * psFileNameList, char * pszAxisCpp_Deploy);
+void AddFilenameToList( LIST * psFileNameList, char * pszFilename);
+bool FileExists( char * pszFilename);
 
+#endif
\ No newline at end of file

Added: webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.cpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.cpp (added)
+++ webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.cpp Mon Mar 20 08:48:48
2006
@@ -0,0 +1,112 @@
+#include "AxisConfigurationLibraries.hpp"
+
+const char * CreateConfigElement( LIST * psDLLNames, int * piConfigInfoArray, CHOICELIST
* psChoiceList, ECONFIGTYPE eConfigType)
+{
+	int					iIndex = 0;
+	bool				bFound = false;
+	char *				pszConfigName = "<unknown name>";
+	static std::string	sReturn;
+
+	while( iIndex < eConfigMax && !bFound)
+	{
+		if( psChoiceList[iIndex].eConfigType == eConfigType)
+		{
+			bFound = true;
+
+			pszConfigName = psChoiceList[iIndex].pszConfigName;
+		}
+		else
+		{
+			iIndex++;
+		}
+	}
+
+	if( bFound)
+	{
+		sReturn = "#Path to ";
+		sReturn += psChoiceList[iIndex].pszElementDescription;
+		sReturn += "\n";
+	}
+	else
+	{
+		sReturn = "#Path to an unknown element\n";
+	}
+
+	char	szReturn[256];
+
+	if( piConfigInfoArray[eConfigType] != -1)
+	{
+		sprintf( szReturn, "%s:%s\n", pszConfigName, ((DLLNAMEINFO *)(psDLLNames->ppArray[piConfigInfoArray[eConfigType]]))->pszDLLFilename);
+	}
+	else
+	{
+		sprintf( szReturn, "#%s:<not set>\n", pszConfigName);
+	}
+
+	sReturn += szReturn;
+
+	return sReturn.c_str();
+}
+
+void Initialise( LIST * psDLLNames, int * piConfigInfoArray, LIST * psFileNameList, char
** ppsDefaultParamList)
+{
+	memset( psDLLNames, 0, sizeof( LIST));
+	memset( psFileNameList, 0, sizeof( LIST));
+
+	for( int iCount = 0; iCount < eConfigMax; iCount++)
+	{
+		piConfigInfoArray[iCount] = -1;
+		ppsDefaultParamList[iCount] = NULL;
+	}
+}
+
+void Destroy( LIST * psDLLNames, LIST * psFileNameList, char ** ppsDefaultParamList)
+{
+	int iCount;
+
+	for( iCount = 0; iCount < psDLLNames->iCount; iCount++)
+	{
+		free( ((DLLNAMEINFO *) psDLLNames->ppArray[iCount])->pszDLLFilename);
+		free( ((DLLNAMEINFO *) psDLLNames->ppArray[iCount])->pszDLLName);
+		free( psDLLNames->ppArray[iCount]);
+	}
+
+	for( iCount = 0; iCount < psFileNameList->iCount; iCount++)
+	{
+		free( psFileNameList->ppArray[iCount]);
+	}
+
+	free( psDLLNames->ppArray);
+	free( psFileNameList->ppArray);
+
+	for( iCount = 0; iCount < eConfigMax; iCount++)
+	{
+		if( ppsDefaultParamList[iCount] != NULL)
+		{
+			free( (void *) ppsDefaultParamList[iCount]);
+		}
+	}
+}
+
+int PopulateNewDLLNameInfo( LIST * psDLLNames, char * pszName, char * pszFilename, bool bAddToClientConfig)
+{
+	DLLNAMEINFO *	psDLLNameInfo = (DLLNAMEINFO *) GetNextListElement( psDLLNames, sizeof( DLLNAMEINFO));
+
+	if( pszName != NULL)
+	{
+		psDLLNameInfo->pszDLLName = (char *) malloc( strlen( pszName) + 1);
+
+		strcpy( psDLLNameInfo->pszDLLName, pszName);
+	}
+
+	if( pszFilename != NULL)
+	{
+		psDLLNameInfo->pszDLLFilename = (char *) malloc( strlen( pszFilename) + 1);
+
+		strcpy( psDLLNameInfo->pszDLLFilename, pszFilename);
+	}
+
+	psDLLNameInfo->bAddToClientConfig = bAddToClientConfig;
+
+	return psDLLNames->iCount - 1;
+}
\ No newline at end of file

Added: webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.hpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.hpp (added)
+++ webservices/axis/trunk/c/src/configuration/AxisConfigurationLibraries.hpp Mon Mar 20 08:48:48
2006
@@ -0,0 +1,6 @@
+#include "AxisConfiguration.hpp"
+
+const char * CreateConfigElement( LIST * psDLLNames, int * piConfigInfoArray, CHOICELIST
* psChoiceList, ECONFIGTYPE eConfigType);
+void Initialise( LIST * psDLLNames, int * piConfigInfoArray, LIST * psFileNameList, char
** ppsDefaultParamList);
+void Destroy( LIST * psDLLNames, LIST * psFileNameList, char ** psDefaultParamList);
+int PopulateNewDLLNameInfo( LIST * psDLLNames, char * pszName, char * pszFilename, bool bAddToClientConfig);

Added: webservices/axis/trunk/c/src/configuration/FileFunctions.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/FileFunctions.cpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/FileFunctions.cpp (added)
+++ webservices/axis/trunk/c/src/configuration/FileFunctions.cpp Mon Mar 20 08:48:48 2006
@@ -0,0 +1,157 @@
+#include "FileFunctions.hpp"
+#include "MissingCFunctions.hpp"
+#include "AxisConfigurationLibraries.hpp"
+
+bool ReadFilenamesInaDirectory( char * pszDirName, LIST * psFileNameList)
+{
+	bool				bSuccess = false;
+
+#if WIN32									// Start WINDOWS code
+#if defined(_MSC_VER) && _MSC_VER >= 1300	// Start MSVC verison number > 7.0
+	intptr_t			lFindFile;
+#else										// Else !(MSVC verison number > 7.0)
+	long				lFindFile;
+#endif										// End MSVC verison number
+	struct _finddata_t	sFindData;
+
+	if( (lFindFile = _findfirst( pszDirName, &sFindData)) != -1)
+	{
+		if( sFindData.name[0] == '.' && sFindData.attrib & _A_SUBDIR)
+		{
+			bSuccess = true;
+		}
+
+		do
+		{
+			if( !(sFindData.attrib & _A_SUBDIR))
+			{
+				AddFilenameToList( psFileNameList, sFindData.name);
+			}
+		} while( _findnext( lFindFile, &sFindData) == 0);
+
+		_findclose( lFindFile);
+	}
+#else									// Else !(WINDOWS code)
+	DIR *				psDIR;
+	struct dirent*		pDirEnt;
+	int					iFilenameCount = 0;
+
+	cout << "pszDirName=" << pszDirName << endl;
+
+	if( (psDIR = opendir( pszDirName)) == NULL)
+	{
+		return bSuccess;
+	}
+
+	cout << "2" << endl;
+
+	while( (pDirEnt = readdir( psDIR)) != NULL)
+	{
+		cout << "pDirEnt->d_name=" << pDirEnt->d_name << endl;
+
+		AddFilenameToList( psFileNameList, pDirEnt->d_name);
+	}
+
+	if( closedir( psDIR) == -1)
+	{
+		return bSuccess;
+	}
+	else
+	{
+		bSuccess = true;
+	}
+#endif									// End WINDOWS code
+
+	return bSuccess;
+}
+
+bool CheckAxisBinDirectoryExists( char * pszAxisCpp_Deploy, char * pszAxis_Bin, char * pszAxis_Bin_Default,
LIST * psDLLNames, LIST * psFileNameList)
+{
+	bool	bFound = false;
+
+	if( strlen( pszAxis_Bin) < 2)
+	{
+		strcpy( pszAxis_Bin, pszAxis_Bin_Default);
+	}
+
+	char	szFilename[512];
+	char	szFileDirAndName[512];
+
+	sprintf( szFilename, "%s\\%s\\*.*", pszAxisCpp_Deploy, pszAxis_Bin);
+
+	if( (bFound = ReadFilenamesInaDirectory( szFilename, psFileNameList)) == true)
+	{
+		int		iIndex = 0;
+
+		do
+		{
+			char *	pExtn = (char *) psFileNameList->ppArray[iIndex];
+
+			do
+			{
+				if( (pExtn = strchr( pExtn, '.')) != NULL)
+				{
+					pExtn++;
+
+#if WIN32
+					if( StringCompare( pExtn, "DLL"))
+#else
+					if( StringCompare( pExtn, "SO"))
+#endif
+					{
+						DLLNAMEINFO * psDLLNameInfo = (DLLNAMEINFO *) GetNextListElement( psDLLNames, sizeof(
DLLNAMEINFO));
+
+						psDLLNameInfo->pszDLLName = (char *) malloc( strlen( (char *) psFileNameList->ppArray[iIndex])
+ 1);
+
+						strcpy( psDLLNameInfo->pszDLLName, (char *) psFileNameList->ppArray[iIndex]);
+
+						StringToUpper( psDLLNameInfo->pszDLLName);
+
+						sprintf( szFileDirAndName, "%s\\%s\\%s", pszAxisCpp_Deploy, pszAxis_Bin, (char *) psFileNameList->ppArray[iIndex]);
+
+						psDLLNameInfo->pszDLLFilename = (char *) malloc( strlen( szFileDirAndName) + 1);
+
+						strcpy( psDLLNameInfo->pszDLLFilename, szFileDirAndName);
+
+						break;
+					}
+				}
+			} while( pExtn != NULL);
+
+			iIndex++;
+		} while( iIndex < psFileNameList->iCount);
+	}
+
+	if( !bFound)
+	{
+		cout << endl << "The directory " << pszAxis_Bin << " was not found."
<< endl << endl;
+	}
+
+	return bFound;
+}
+
+void WriteAxisConfigFile( LIST * psDLLNames, int * piConfigInfoArray, CHOICELIST * psChoiceList)
+{
+	cout << "DLL selection complete" << endl << endl;
+
+	cout << "AxisCPP.conf file now has the following information:-" << endl;
+
+	cout << "# The comment character is '#'" << endl;
+	cout << "#Available directives are as follows" << endl;
+	cout << "#(Some of these directives may not be implemented yet)" << endl;
+	cout << "#" << endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eServerLog)
<< endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eServerWSDD)
<< endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eClientLog)
<< endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eClientWSDD)
<< endl;
+	cout << "#Node name." << endl;
+	cout << "#NodeName: <not set>" << endl << endl;
+	cout << "#Listening port." << endl;
+	cout << "#ListenPort: <not set>" << endl << endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eHTTPTransport)
<< endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eSMTPTransport)
<< endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eXMLParser)
<< endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eHTTPChannel)
<< endl;
+	cout << CreateConfigElement( psDLLNames, piConfigInfoArray, psChoiceList, eHTTPSSLChannel)
<< endl;
+	cout << endl;
+}

Added: webservices/axis/trunk/c/src/configuration/FileFunctions.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/FileFunctions.hpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/FileFunctions.hpp (added)
+++ webservices/axis/trunk/c/src/configuration/FileFunctions.hpp Mon Mar 20 08:48:48 2006
@@ -0,0 +1,12 @@
+#if WIN32
+#include <io.h>
+#else
+#include <stdio.h>
+#include <sys/types.h>
+#include <dirent.h>
+#endif
+
+#include "AxisConfiguration.hpp"
+
+bool ReadFilenamesInaDirectory( char * pszDirName, LIST * psFileNameList);
+void WriteAxisConfigFile( LIST * psDLLNames, int * piConfigInfoArray, CHOICELIST * psChoiceList);

Added: webservices/axis/trunk/c/src/configuration/ListMethods.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/ListMethods.cpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/ListMethods.cpp (added)
+++ webservices/axis/trunk/c/src/configuration/ListMethods.cpp Mon Mar 20 08:48:48 2006
@@ -0,0 +1,32 @@
+#include "ListMethods.hpp"
+#include "AxisConfiguration.hpp"
+
+void * GetNextListElement( LIST * psList, int iElementLength)
+{
+	if( psList->ppArray == NULL)
+	{
+		psList->iMaxCount = 1;
+
+		psList->ppArray = (void **) malloc( sizeof( void *));
+	}
+
+	if( psList->iCount >= psList->iMaxCount)
+	{
+		psList->iMaxCount = psList->iMaxCount * 2;
+
+		psList->ppArray = (void **) realloc( psList->ppArray, sizeof( void *) * psList->iMaxCount);
+
+		for( int iNewIndex = psList->iCount; iNewIndex < psList->iMaxCount; iNewIndex++)
+		{
+			psList->ppArray[iNewIndex] = NULL;
+		}
+	}
+
+	psList->ppArray[psList->iCount] = malloc( iElementLength);
+
+	memset( psList->ppArray[psList->iCount], 0, iElementLength);
+
+	psList->iCount++;
+
+	return psList->ppArray[psList->iCount - 1];
+}
\ No newline at end of file

Added: webservices/axis/trunk/c/src/configuration/ListMethods.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/ListMethods.hpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/ListMethods.hpp (added)
+++ webservices/axis/trunk/c/src/configuration/ListMethods.hpp Mon Mar 20 08:48:48 2006
@@ -0,0 +1,14 @@
+#if !defined(__AXIS_CONFIG_LIST__)
+
+#define __AXIS_CONFIG_LIST__
+
+typedef struct
+{
+	int				iCount;
+	int				iMaxCount;
+	void **			ppArray;
+} LIST;
+
+void * GetNextListElement( LIST * psList, int iElementLength);
+
+#endif

Added: webservices/axis/trunk/c/src/configuration/MissingCFunctions.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/MissingCFunctions.cpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/MissingCFunctions.cpp (added)
+++ webservices/axis/trunk/c/src/configuration/MissingCFunctions.cpp Mon Mar 20 08:48:48 2006
@@ -0,0 +1,49 @@
+#include "MissingCFunctions.hpp"
+
+bool StringCompare( char * pszString1, char * pszString2)
+{
+	bool	bSame = false;
+
+	if( pszString1 == NULL || pszString2 == NULL)
+	{
+		return bSame;
+	}
+
+	if( strlen( pszString1) != strlen( pszString2))
+	{
+		return bSame;
+	}
+
+	if( strlen( pszString1) == 0)
+	{
+		bSame = true;
+	}
+	else
+	{
+		char *	psString1 = pszString1;
+		char *	psString2 = pszString2;
+
+		do
+		{
+			bSame = (toupper( *psString1++) == toupper( *psString2++));
+		} while( bSame && *psString1 != '\0');
+	}
+
+	return bSame;
+}
+
+void StringToUpper( char * pszString)
+{
+	if( pszString != NULL)
+	{
+		char *	pc = pszString;
+
+		while( *pc != '\0')
+		{
+			*pc = toupper( *pc);
+
+			pc++;
+		}
+	}
+}
+

Added: webservices/axis/trunk/c/src/configuration/MissingCFunctions.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/configuration/MissingCFunctions.hpp?rev=387243&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/configuration/MissingCFunctions.hpp (added)
+++ webservices/axis/trunk/c/src/configuration/MissingCFunctions.hpp Mon Mar 20 08:48:48 2006
@@ -0,0 +1,4 @@
+#include "AxisConfiguration.hpp"
+
+bool StringCompare( char * pszString1, char * pszString2);
+void StringToUpper( char * pszString);



Mime
View raw message