Example #1
0
RCODE FTKAPI F_DirHdl::openDir(
	const char *	pszDirName,
	const char *	pszPattern)
{
	RCODE		rc = NE_FLM_OK;

	m_rc = NE_FLM_OK;
	m_bFirstTime = TRUE;
	m_bFindOpen = FALSE;
	m_uiAttrib = 0;

	f_memset( &m_FindData, 0, sizeof( m_FindData));
	f_strcpy( m_szDirectoryPath, pszDirName);

	if( pszPattern)
	{
		if( f_strlen( pszPattern) >= (FLMINT)sizeof( m_szPattern))
		{
			rc = RC_SET( NE_FLM_MEM);
			goto Exit;
		}

		f_strcpy( m_szPattern, pszPattern);
	}
	else
	{
		m_szPattern[ 0] = 0;
	}

Exit:

	return( rc);
}
/********************************************************************
Desc:	Edit a number
*********************************************************************/
FLMBOOL ViewEditNum(
	void *		pvNum,
	FLMBOOL		bEnterHexFlag,
	FLMUINT		uiNumBytes,
	FLMUINT64	ui64MaxValue
	)
{
	char		szPrompt[ 80];
	FLMBOOL	bValEntered;

	f_strcpy( szPrompt, "Enter Value (in ");
	if (bEnterHexFlag)
	{
		f_strcpy( &szPrompt[ f_strlen( szPrompt)], "hex): ");
	}
	else
	{
		f_strcpy( &szPrompt[ f_strlen( szPrompt)], "decimal): ");
	}
	if (!ViewGetNum( szPrompt, pvNum, bEnterHexFlag, uiNumBytes, ui64MaxValue,
											&bValEntered) ||
		 !bValEntered)
	{
		return( FALSE);
	}
	else
	{
		return( TRUE);
	}
}
// setMode must be called with Client or ClientAndAccessPoint
void STC_FLASHMEM WiFi::configureClient(char const *SSID, char const *securityKey) {
  station_config config = {0};
  f_strcpy((char *)config.ssid, SSID);
  f_strcpy((char *)config.password, securityKey);
  Critical critical;
  wifi_station_disconnect();
  wifi_station_set_config(&config);
  wifi_station_connect();
}
Example #4
0
	TEST_INFO()
	{
		bLog = FALSE;
		bDisplay = FALSE;
		pNext = NULL;
		pszLogfile[ 0] = 0;
		pszConfig[ 0] = 0;
		
		f_strcpy( pszEnvironment, FLM_OSTYPE_STR);
		f_strcpy( pszBuild, __DATE__);
		f_strcpy( pszUser, "defaultUser");
	}
Example #5
0
/********************************************************************
Desc: ?
*********************************************************************/
FSTATIC void bldShowResults(
	const char *	FuncName,
	RCODE				rc,
	FLMUINT			uiTotalRecords,
	FLMUINT			uiRecordsRecovered,
	FLMUINT			uiDictRecordsRecovered)
{
	char		szErrMsg[ 100];

	if( RC_BAD( rc))
	{
		if( rc != FERR_FAILURE)
		{
			f_strcpy( szErrMsg, "Error calling ");
			f_strcpy( &szErrMsg[ f_strlen( szErrMsg)], FuncName);
			f_strcpy( &szErrMsg[ f_strlen( szErrMsg)], ": ");
			f_strcpy( &szErrMsg[ f_strlen( szErrMsg)], FlmErrorString( rc));
			bldShowError( szErrMsg);
			if( gv_bLoggingEnabled)
			{
				bldLogString( szErrMsg);
			}
		}
		else if( gv_bLoggingEnabled)
		{
			bldLogString( "REBUILD HALTED BY USER");
			gv_bShutdown = TRUE;
		}
	}
	else
	{
		bldOutNumValue( TOTAL_REC_ROW, uiTotalRecords);
		bldOutNumValue( RECOV_ROW, uiRecordsRecovered);
		bldOutNumValue( DICT_RECOV_ROW, uiDictRecordsRecovered);
		if( gv_bLoggingEnabled)
		{
			f_sprintf( (char *)szErrMsg, "Total Records:     %u", (unsigned)uiTotalRecords);
			bldLogString( szErrMsg);
			f_sprintf( (char *)szErrMsg, "Records Recovered: %u", (unsigned)uiRecordsRecovered);
			bldLogString( szErrMsg);
			f_sprintf( (char *)szErrMsg, "Dict Items Recovered: %u",
					(unsigned)uiDictRecordsRecovered);
			bldLogString( szErrMsg);
		}
		f_strcpy( szErrMsg, "Recovery completed successfully");
		bldShowError( szErrMsg);
		if( gv_bLoggingEnabled)
		{
			bldLogString( szErrMsg);
		}
	}
}
 // setMode must be called with AccessPoint or ClientAndAccessPoint
 // note: make sure there is enough stack space free otherwise mail cause reset (fatal exception)!
 // channel: 1..13
 void STC_FLASHMEM WiFi::configureAccessPoint(char const* SSID, char const* securityKey, uint8_t channel, SecurityProtocol securityProtocol, bool hiddenSSID)
 {						
     softap_config config = {0};
     wifi_softap_get_config(&config);
     f_strcpy((char *)config.ssid, SSID);
     config.ssid_len = f_strlen(SSID);
     f_strcpy((char *)config.password, securityKey);
     config.channel = channel;
     config.authmode = (AUTH_MODE)securityProtocol;
     config.ssid_hidden = (uint8)hiddenSSID;
     Critical critical;
     wifi_softap_set_config(&config);
 }
/****************************************************************************
Desc:
****************************************************************************/
RCODE	SortKeyTestImpl::createNameDoc( 
	char *		pszNames[ 2])
{
	RCODE						rc = NE_XFLM_OK;
	ELEMENT_NODE_INFO 	pNameNodes[2];

	f_memset( pNameNodes, 0, sizeof( pNameNodes));

	if ( RC_BAD( rc = f_alloc( 
		f_strlen( pszNames[0]) + 1, &pNameNodes[0].pvData)))
	{
		MAKE_FLM_ERROR_STRING( "f_alloc failed.", m_szDetails, rc);
		goto Exit;
	}

	f_strcpy( (char*)pNameNodes[0].pvData, pszNames[0]);
	pNameNodes[0].uiDataType = XFLM_TEXT_TYPE;
	pNameNodes[0].uiDataSize = f_strlen( pszNames[0]);
	pNameNodes[0].uiDictNum = FIRST_NAME_ID;

	if ( RC_BAD( rc = f_alloc( 
		f_strlen( pszNames[1]) + 1, &pNameNodes[1].pvData)))
	{
		MAKE_FLM_ERROR_STRING( "f_alloc failed.", m_szDetails, rc);
		goto Exit;
	}

	f_strcpy( (char*)pNameNodes[1].pvData, pszNames[1]);
	pNameNodes[1].uiDataType = XFLM_TEXT_TYPE;
	pNameNodes[1].uiDataSize = f_strlen( pszNames[0]);
	pNameNodes[1].uiDictNum = LAST_NAME_ID;

	if ( RC_BAD( rc = createCompoundDoc( pNameNodes, 2, NULL)))
	{
		goto Exit;
	}

Exit:

	if ( pNameNodes[0].pvData)
	{
		f_free( &pNameNodes[0].pvData);
	}

	if ( pNameNodes[1].pvData)
	{
		f_free( &pNameNodes[1].pvData);
	}

	return rc;
}
Example #8
0
/****************************************************************************
Desc:
****************************************************************************/
RCODE ArgList::addArg( 
	const char *	pszArg)
{
	RCODE		rc = FERR_OK;

	if( m_uiNumEntries >= m_uiCapacity)
	{
		if( RC_BAD( rc = resize()))
		{
			goto Exit;
		}
	}

	if( RC_BAD( rc = f_alloc( f_strlen( pszArg) + 1,
		&m_ppszArgs[ m_uiNumEntries])))
	{
		goto Exit;
	}

	f_strcpy( m_ppszArgs[ m_uiNumEntries++], pszArg);

Exit:

	return( rc);
}
Example #9
0
/****************************************************************************
Desc:
****************************************************************************/
RCODE ArgList::resize( void)
{
	RCODE			rc = FERR_OK;
	FLMUINT		uiLoop;
	char **		ppszTemp = NULL;

	if( RC_BAD( rc = f_alloc( m_uiCapacity * GROW_FACTOR * sizeof(char*), 
		&ppszTemp)))
	{
		goto Exit;
	}

	m_uiCapacity *= GROW_FACTOR;
	
	for( uiLoop = 0; uiLoop < m_uiNumEntries; uiLoop++)
	{
		if( RC_BAD( rc = f_alloc( f_strlen( m_ppszArgs[ uiLoop]) + 1, 
			&ppszTemp[ uiLoop])))
		{
			f_free( &ppszTemp);
			goto Exit;
		}
		
		f_strcpy( ppszTemp[uiLoop], m_ppszArgs[uiLoop]);
	}

	f_free( &m_ppszArgs);
	m_ppszArgs = ppszTemp;

Exit:

	return( rc);
}
Example #10
0
/****************************************************************************
Desc:
****************************************************************************/
RCODE IFlmTestLogger::init( 
	const char *		pszFilename)
{
	f_strcpy( m_szFilename, pszFilename);
	m_bInitialized = TRUE;
	return( FERR_OK);
}
Example #11
0
RCODE f_netwareRemoveDir( 
	const char *		pszDirName)
{
	RCODE			rc = NE_FLM_OK;
	FLMBYTE		pucPseudoLNamePath[ F_PATH_MAX_SIZE + 1];
	FLMBYTE		pucLNamePath[ F_PATH_MAX_SIZE];
	LONG			lVolumeID;
	LONG			lPathID;
	LONG			lLNamePathCount;
	LONG			lErrorCode;
	
	f_strcpy( (char *)&pucPseudoLNamePath[1], pszDirName);
	pucPseudoLNamePath[0] = (FLMBYTE)f_strlen( pszDirName);
	
	if( (lErrorCode = ConvertPathString( 0, 0, pucPseudoLNamePath, &lVolumeID,		
		&lPathID, pucLNamePath, &lLNamePathCount)) != 0)
	{
		goto Exit;
	}

	if( (lErrorCode = DeleteDirectory( 0, lVolumeID, lPathID, pucLNamePath,
		lLNamePathCount, LONGNameSpace)) != 0)
	{
		goto Exit;
	}

Exit:

	if( lErrorCode)
	{
		rc = f_mapPlatformError( lErrorCode, NE_FLM_IO_DELETING_FILE);
	}
	
	return( rc);
}
Example #12
0
/********************************************************************
Desc: Update the memory information on the screen.
*********************************************************************/
void gigaCheckpointDisplay( void)
{
	char					szBuf[ 80];
	CHECKPOINT_INFO	cpInfo;

	FlmDbGetConfig( gv_hDb, FDB_GET_CHECKPOINT_INFO, &cpInfo, NULL, NULL);
	if (!cpInfo.bRunning)
	{
		f_strcpy( szBuf, "Idle                  ");
	}
	else
	{
		if (cpInfo.bForcingCheckpoint)
		{
			f_sprintf( szBuf, "Forcing (%ums)          ",
				(unsigned)cpInfo.uiRunningTime);
		}
		else
		{
			f_sprintf( szBuf, "Running (%ums)           ",
				(unsigned)cpInfo.uiRunningTime);
		}
	}
	
	gigaOutputStr( CP_STATE_ROW, szBuf);
}
Example #13
0
/****************************************************************************
Desc:
****************************************************************************/
FlagSet::FlagSet( 
	const FlagSet&		fs)
{
	if( RC_BAD( f_alloc( sizeof( FLMBYTE *) * fs.m_uiNumElems,
										&m_ppucElemArray)))
	{
		flmAssert( 0);
	}
	
	if( RC_BAD( f_alloc( sizeof( FLMBOOL) * fs.m_uiNumElems,
										&m_pbFlagArray)))
	{
		flmAssert( 0);
	}
	
	f_memset( m_pbFlagArray, 0, sizeof( FLMBOOL) * fs.m_uiNumElems);
	
	for( FLMUINT uiLoop = 0; uiLoop < fs.m_uiNumElems; uiLoop++)
	{
		if( RC_BAD( f_alloc( f_strlen( (char *)fs.m_ppucElemArray[uiLoop]) + 1,
				&m_ppucElemArray[ uiLoop])))
		{
			flmAssert( 0);
		}
		
		f_strcpy( (char *)m_ppucElemArray[uiLoop], 
					 (char *)fs.m_ppucElemArray[uiLoop]);
	}
	
	m_uiNumElems = fs.m_uiNumElems;
}
Example #14
0
/********************************************************************
Desc:	Edit Text
*********************************************************************/
FLMBOOL ViewEditText(
	const char *	pszPrompt,
	char *			pszText,
	FLMUINT			uiTextLen,
	FLMBOOL *		pbValEntered)
{
	char		szTempBuf [100];
	FLMUINT	uiNumCols;
	FLMUINT	uiNumRows;

	f_conGetScreenSize( &uiNumCols, &uiNumRows);
	f_conSetBackFore( FLM_BLACK, FLM_WHITE);
	f_conClearScreen( 0, uiNumRows - 2);
	ViewAskInput( pszPrompt, szTempBuf, sizeof( szTempBuf) - 1);
	f_conSetBackFore( FLM_BLACK, FLM_WHITE);
	f_conClearScreen( 0, uiNumRows - 2);
	
	if (f_stricmp( szTempBuf, "\\") == 0)
	{
		*pbValEntered = FALSE;
		return( FALSE);
	}
	if( !szTempBuf[ 0])
	{
		*pbValEntered = FALSE;
		return( TRUE);
	}
	if (f_strlen( szTempBuf) >= uiTextLen)
	{
		szTempBuf [uiTextLen - 1] = 0;
	}
	f_strcpy( pszText, szTempBuf);
	*pbValEntered = TRUE;
	return( TRUE);
}
Example #15
0
/****************************************************************************
Desc:
****************************************************************************/
void FlagSet::init( 
	FLMBYTE **		ppucElemArray,
	FLMUINT			uiNumElems)
{
	reset();
	
	if( RC_BAD( f_alloc( sizeof( FLMBYTE *) * uiNumElems,
										&m_ppucElemArray)))
	{
		flmAssert( 0);
	}
	
	if( RC_BAD( f_alloc( sizeof( FLMBOOL) * uiNumElems,
										&m_pbFlagArray)))
	{
		flmAssert( 0);
	}
	
	f_memset( m_pbFlagArray, 0, sizeof( FLMBOOL) * uiNumElems);
	
	for( FLMUINT uiLoop = 0; uiLoop < uiNumElems; uiLoop++)
	{
		if( RC_BAD( f_alloc( f_strlen( (char *)ppucElemArray[ uiLoop]) + 1,
				&m_ppucElemArray[ uiLoop])))
		{
			flmAssert( 0);
		}
		
		f_strcpy( (char *)m_ppucElemArray[uiLoop], (char *)ppucElemArray[uiLoop]);
	}
	
	m_uiNumElems = uiNumElems;
}
Example #16
0
	FINLINE void releaseLockFile(
		const char *		pszBasePath,
		FLMBOOL				bDelete)
	{
#ifndef FLM_UNIX
		F_UNREFERENCED_PARM( bDelete);
		F_UNREFERENCED_PARM( pszBasePath);
#endif

		if( m_pLockFileHdl)
		{

			// Release the lock file

			(void)m_pLockFileHdl->closeFile();
			m_pLockFileHdl->Release();
			m_pLockFileHdl = NULL;

#ifdef FLM_UNIX
			if( bDelete)
			{
				IF_FileSystem *	pFileSystem = f_getFileSysPtr();
				char					szTmpPath[ F_PATH_MAX_SIZE];

				// Delete the lock file

				f_strcpy( szTmpPath, pszBasePath);
				pFileSystem->pathAppend( szTmpPath, "64.LCK");
				pFileSystem->deleteFile( szTmpPath);
			}
#endif
		}
	}
Example #17
0
//打开当前目录下的某个文件夹.
//dirname:文件夹名字
//返回值:0,成功;其他,失败;
u8 pfnmg_dir_opendir(u8*dirname)
{
	u8 res;
	u8 len;
	u8 deep;						   					    
	res=f_opendir(&dir,(const TCHAR*)dirname);//打开此文件夹
	if(res==0)//路径OK
	{
		len=f_strlen(dirname); 
		if(dirname[len-1]=='.'&&dirname[len-2]=='.')//回到上一层目录.
		{	    
			deep=f_getdirdeep(dirname);//得到目录深度
			if(deep)//还不是根目录
			{
				if(deep>1)deep--;						//得到上两层的目录
				f_getdirstr(dirname,dirname,deep-1); //得到上一层目录	
			}else dirname[len-2]=0;//添加结束符.	 
		}
		f_strcpy(pfnmg.plfname,dirname);//复制路径
 		pfnmg.cftp=0XFF; 	//当前为路径
		pfnmg.foldernum=0; 	//总文件数归零
		pfnmg.dfnum=0;	   	//目标文件数归零
		pfnmg_scan_folder();//扫描这个新文件夹.
	}
	return res;		
}
Example #18
0
/****************************************************************************
Desc:	Returns RFL directory for the database
****************************************************************************/
void XFLAPI F_Db::getRflDir(
	char *	pszRflDir
	)
{
	m_pDatabase->lockMutex();
	f_strcpy( pszRflDir, m_pDatabase->m_pRfl->getRflDirPtr());
	m_pDatabase->unlockMutex();
}
Example #19
0
/****************************************************************************
Desc: This routine obtains exclusive access to a database by creating
		a .lck file.  FLAIM holds the .lck file open as long as the database
		is open.  When the database is finally closed, it deletes the .lck
		file.  This is only used for 3.x databases.
****************************************************************************/
RCODE flmCreateLckFile(
	const char *	pszFilePath,
	IF_FileHdl **	ppLockFileHdlRV)
{
	RCODE				rc = NE_XFLM_OK;
	char				szLockPath [F_PATH_MAX_SIZE];
	char				szDbBaseName [F_FILENAME_SIZE];
	char *			pszFileExt;
	IF_FileHdl *	pLockFileHdl = NULL;
	char				szFilePathStr[ F_PATH_MAX_SIZE];

	if( RC_BAD( rc = gv_XFlmSysData.pFileSystem->pathToStorageString( 
		pszFilePath, szFilePathStr)))
	{
		goto Exit;
	}

	// Extract the 8.3 name and put a .lck extension on it to create
	// the full path for the .lck file.

	if (RC_BAD( rc = gv_XFlmSysData.pFileSystem->pathReduce( 
		szFilePathStr, szLockPath, szDbBaseName)))
	{
		goto Exit;
	}
	pszFileExt = &szDbBaseName [0];
	while ((*pszFileExt) && (*pszFileExt != '.'))
		pszFileExt++;
	f_strcpy( pszFileExt, ".lck");

	if( RC_BAD( rc = gv_XFlmSysData.pFileSystem->pathAppend( 
		szLockPath, szDbBaseName)))
	{
		goto Exit;
	}
	
	if( RC_BAD( rc = gv_XFlmSysData.pFileSystem->createLockFile( 
		szLockPath, &pLockFileHdl)))
	{
		goto Exit;
	}

	*ppLockFileHdlRV = (IF_FileHdl *)pLockFileHdl;
	pLockFileHdl = NULL;
	
Exit:

	if (pLockFileHdl)
	{
		(void)pLockFileHdl->closeFile();
		pLockFileHdl->Release();
		pLockFileHdl = NULL;
	}
	
	return( rc);
}
Example #20
0
/***************************************************************************
Desc:
****************************************************************************/
void FilenameIterator::produceFilename(
	char *			pszBuffer)
{
	char 		pszTemp[ FILENAME_ITERATOR_MAX_EXTENSION_LENGTH + 1];
	
	f_strcpy( pszBuffer, m_pszFullPrefix);
	f_strcat( pszBuffer, ".");
	f_sprintf( pszTemp, "%03x", (unsigned)m_uiExtension);
	f_strcat( pszBuffer, pszTemp);
}
Example #21
0
/********************************************************************
Desc: ?
*********************************************************************/
FSTATIC void bldOutLabel(
	FLMUINT			uiCol,
	FLMUINT			uiRow,
	const char *	pucLabel,
	const char *	pucValue,
	FLMUINT			uiNumValue,
	FLMBOOL			bLogIt)
{
	char			szMsg[ 100];
	FLMUINT		uiLen = (FLMUINT)(VALUE_COLUMN - uiCol - 1);

	f_memset( szMsg, '.', uiLen);
	szMsg[ uiLen] = 0;
	f_conSetBackFore( FLM_BLACK, FLM_LIGHTGRAY);
	f_conStrOutXY( szMsg, uiCol, uiRow);
	f_conStrOutXY( pucLabel, uiCol, uiRow);

	if( pucValue != NULL)
	{
		bldOutValue( uiRow, pucValue);
	}
	else
	{
		bldOutNumValue( uiRow, uiNumValue);
	}

	if( (bLogIt) && (gv_bLoggingEnabled))
	{
		f_strcpy( szMsg, pucLabel);
		f_strcpy( &szMsg[ f_strlen( szMsg)], ": ");
		if( pucValue != NULL)
		{
			f_strcpy( &szMsg[ f_strlen( szMsg)], pucValue);
		}
		else
		{
			f_sprintf( (char *)(&szMsg[ f_strlen( szMsg)]), "%u",
				(unsigned)uiNumValue);
		}
		bldLogString( szMsg);
	}
}
Example #22
0
	FINLINE void dataFilePath(
		FLMUINT		uiFileNum,
		char *		pszPath)
	{
		char					szFileName[ 13];
		IF_FileSystem *	pFileSystem = f_getFileSysPtr();

		f_strcpy( pszPath, m_szPath);
		formatFileNum( uiFileNum, szFileName);
		pFileSystem->pathAppend( pszPath, szFileName);
	}
Example #23
0
/****************************************************************************
Desc:
****************************************************************************/
RCODE F_FSRestore::setup(
	const char *		pszDbPath,
	const char *		pszBackupSetPath,
	const char *		pszRflDir)
{
	flmAssert( !m_bSetupCalled);
	flmAssert( pszDbPath);
	flmAssert( pszBackupSetPath);

	f_strcpy( m_szDbPath, pszDbPath);
	f_strcpy( m_szBackupSetPath, pszBackupSetPath);

	if( pszRflDir)
	{
		f_strcpy( m_szRflDir, pszRflDir);
	}


	m_bSetupCalled = TRUE;
	return( NE_SFLM_OK);
}
Example #24
0
/****************************************************************************
Desc:
****************************************************************************/
FINLINE void FTKAPI F_DirHdl::currentItemPath(
	char *		pszPath)
{
	if( RC_OK( m_rc))
	{
		f_strcpy( pszPath, m_szDirectoryPath);
#ifdef FLM_RING_ZERO_NLM
		f_pathAppend( pszPath, currentItemName());
#else
		f_pathAppend( pszPath, m_szFileName);
#endif
	}
}
Example #25
0
RCODE f_fileFindNext(
	F_IO_FIND_DATA *	pFindData,
	char *				pszFoundPath,
	FLMUINT *			puiFoundAttrib)
{
	RCODE					rc = NE_FLM_OK;
	IF_FileSystem *	pFileSystem = f_getFileSysPtr();

   if( FindNextFile( pFindData->findHandle,
		&(pFindData->findBuffer)) == FALSE)
	{
		rc = f_mapPlatformError( GetLastError(), NE_FLM_READING_FILE);
		goto Exit;
	}

	// Loop until a file with correct attributes is found

	for( ;;)
	{
		if( f_fileMeetsFindCriteria( pFindData))
		{
			break;
		}

		if( FindNextFile( pFindData->findHandle,
			&(pFindData->findBuffer)) == FALSE)
		{
			rc = f_mapPlatformError( GetLastError(), NE_FLM_READING_FILE);
			goto Exit;
		}
	}

	// Append the file name to the path name

	f_strcpy( pszFoundPath, pFindData->szSearchPath);
	
	if( RC_BAD( rc = pFileSystem->pathAppend( pszFoundPath, 
		(char *)pFindData->findBuffer.cFileName)))
	{
		goto Exit;
	}

	// Return the found file attribute

   *puiFoundAttrib = pFindData->findBuffer.dwFileAttributes;

Exit:

   return( rc);
}
Example #26
0
/****************************************************************************
Desc:
****************************************************************************/
FlagSet FlagSet::crossProduct( 
	FlagSet&		fs2)
{
	FlagSet		fsCross;
	FLMUINT		uiLoop1;
	FLMUINT		uiCrossProductElems = this->getNumElements() * fs2.getNumElements();
	FLMBYTE **	ppszCross = NULL;
	
	if( RC_BAD( f_alloc( sizeof( FLMBYTE *) * uiCrossProductElems,
		&ppszCross)))
	{
		flmAssert( 0);
		goto Exit;
	}

	for( uiLoop1 = 0; uiLoop1 < this->getNumElements(); uiLoop1++)
	{
		for( FLMUINT uiLoop2 = 0; uiLoop2 < fs2.getNumElements(); uiLoop2++)
		{
			FLMUINT	uiIndex = uiLoop1 * fs2.getNumElements() + uiLoop2;
			
			if( RC_BAD( f_alloc( f_strlen((char *)this->m_ppucElemArray[ uiLoop1]) + 
						f_strlen((char *)fs2.m_ppucElemArray[ uiLoop2]) + 1,
					&ppszCross[ uiIndex])))
			{
				flmAssert( 0);
			}
			
			f_strcpy( (char *)ppszCross[ uiIndex], 
				(char *)this->m_ppucElemArray[ uiLoop1]);
				
			f_strcat( (char *)ppszCross[ uiIndex], 
				(char *)fs2.m_ppucElemArray[ uiLoop2]);
		}
	}
	
	fsCross.init( ppszCross, uiCrossProductElems);

	for( uiLoop1 = 0; uiLoop1 < uiCrossProductElems; uiLoop1++)
	{
		f_free( &ppszCross[ uiLoop1]);
	}
	
	f_free( &ppszCross);
	
Exit:

	return( fsCross);
}
Example #27
0
/***************************************************************************
Desc:
****************************************************************************/
void FilenameIterator::getCurrent(
	char *			pszBuffer)
{
	// Since the meaning of calling getCurrent before calling getNext is
	// not defined, give back a null
	
	if (m_uiExtension == (FLMUINT)FILENAME_ITERATOR_NULL)
	{
		f_strcpy( pszBuffer, "null");
	}
	else
	{
		produceFilename( pszBuffer);
	}
}
Example #28
0
/***************************************************************************
Name:    FormatLFType
Desc:    This routine formats a logical file type into an ASCII buffer.
*****************************************************************************/
void FormatLFType(
	FLMBYTE *   DestBuf,
	FLMUINT		lfType
	)
{
	FLMBYTE	TempBuf [40];

	switch( lfType)
	{
		case LF_CONTAINER:
			f_strcpy( (char *)DestBuf, "Container");
			break;
		case LF_INDEX:
			f_strcpy( (char *)DestBuf, "Index");
			break;
		case LF_INVALID:
			f_strcpy( (char *)DestBuf, "Deleted");
			break;
		default:
			f_sprintf( (char *)TempBuf, "Unknown: %u", (unsigned)lfType);
			f_strcpy( (char *)DestBuf, (const char *)TempBuf);
			break;
	}
}
Example #29
0
//初始化路径
//不能以'/'结尾!
//path:路径;
//返回值:0,OK;其他,失败.
u8 pfnmg_init(u8*path)
{
	u8 res;
	res=f_opendir(&dir,(const TCHAR*)path);
	if(res)return res;//此路径非法
	else
	{										  
		pfnmg.cftp=0XFF; 	//当前为路径
		pfnmg.foldernum=0; 	//总文件数归零
		pfnmg.dfnum=0;	   	//目标文件数归零
		pfnmg.fttblsize=0; 	//目标文件类型表清空
		f_strcpy(pfnmg.plfname,path);//路径复制给pname	
	}
	return 0;
}
Example #30
0
/****************************************************************************
Desc: Creates a new 64-bit "file"
****************************************************************************/
RCODE F_MultiFileHdl::createFile(
	const char *	pszPath)
{
	RCODE					rc = NE_FLM_OK;
	FLMBOOL				bCreatedDir = FALSE;
	IF_FileSystem *	pFileSystem = f_getFileSysPtr();

	if( m_bOpen)
	{
		rc = RC_SET_AND_ASSERT( NE_FLM_FAILURE);
		goto Exit;
	}

	if( RC_BAD( rc = pFileSystem->createDir( pszPath)))
	{
		goto Exit;
	}

	f_strcpy( m_szPath, pszPath);
	bCreatedDir = TRUE;

	// Create the lock file

	if( RC_BAD( rc = createLockFile( m_szPath)))
	{
		goto Exit;
	}

	// Initialize the EOF to 0 and set the state to open

	m_ui64EOF = 0;
	m_bOpen = TRUE;

Exit:

	// Release the lock file

	if( RC_BAD( rc))
	{
		(void)releaseLockFile( m_szPath, TRUE);
		if( bCreatedDir)
		{
			(void)pFileSystem->removeDir( m_szPath);
		}
	}

	return( rc);
}