library/src/filesystem/BP-FilesystemRegistry.cc
// this will display all items in a filesystem.  A policy filter can be applied to selection.
this will display all items in a filesystem.  A policy filter can be applied to selection.
this will display all items in a filesystem . A policy filter can be applied to selection .
BP_ERROR_T BP_FSRegDisplayFilesystem
(
		P_BP_FSREG fs_reg,
		BP_BOOL display_files,
		BP_BOOL display_directories,
		BP_BOOL recurse,
		P_BP_FSREG_POLICIES policy_filter
)
{
	if(!fs_reg)
		return ERR_FAILURE;
	if(!fs_reg->hreg)
		return ERR_FAILURE;
	BP_HASH_TABLE_ENTER_CRITICAL_SECTION(fs_reg->hreg);
	P_BP_HASH_TABLE_KEYED_ENTRY entry = NULL;
	P_BP_HASH_TABLE_KEYED_ENTRY tmp   = NULL;
	size_t display_tab_depth = 0;
	HASH_ITER(hh, fs_reg->hreg->hive, entry, tmp)
	{
		if(entry->type == BP_HASH_TABLE_KEYED_ENTRY_TYPE_NAMED_HASH_TABLE)
		{
			printf("\n [+] Displaying Filesystem Entries for FS Registry %p: ", fs_reg);
			BP_FSRegDisplayFilesystemDirectory
			(
				fs_reg,
				entry,
				recurse,
				0
			);
		}
	}
	BP_HASH_TABLE_LEAVE_CRITICAL_SECTION(fs_reg->hreg);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_FSRegDisplayFilesystem ( P_BP_FSREG fs_reg , BP_BOOL display_files , BP_BOOL display_directories , BP_BOOL recurse , P_BP_FSREG_POLICIES policy_filter ) { if ( ! fs_reg ) return ERR_FAILURE ; if ( ! fs_reg -> hreg ) return ERR_FAILURE ; BP_HASH_TABLE_ENTER_CRITICAL_SECTION ( fs_reg -> hreg ) ; P_BP_HASH_TABLE_KEYED_ENTRY entry = NULL ; P_BP_HASH_TABLE_KEYED_ENTRY tmp = NULL ; size_t display_tab_depth = 0 ; HASH_ITER ( hh , fs_reg -> hreg -> hive , entry , tmp ) { if ( entry -> type == BP_HASH_TABLE_KEYED_ENTRY_TYPE_NAMED_HASH_TABLE ) { printf ( " \n " , fs_reg ) ; BP_FSRegDisplayFilesystemDirectory ( fs_reg , entry , recurse , 0 ) ; } } BP_HASH_TABLE_LEAVE_CRITICAL_SECTION ( fs_reg -> hreg ) ; return ERR_SUCCESS ; }
this will display all items in a filesystem.
this will display all items in a filesystem .
// enter critical section before crawling // temporary iterator values used during the HASH_ITER loop below // increase the display tab depth in case of recursion (keeps // things lined up) // iterate through all hashes and display // leave when crawling is finished // return indicating success