library/src/filesystem/BP-FilesystemRegistry.cc
// this is an internal function, do not use this
// Simple internal routine to parse individual entries (needed for recursion)
this is an internal function, do not use this
Simple internal routine to parse individual entries (needed for recursion)
this is an internal function do not use this Simple internal routine to parse individual entries ( needed for recursion )
BP_ERROR_T BP_FSRegRetrieveEntryFullPathsAsBPCallocedNullTerminatedPointerArray__entry_r
(
		P_BP_FSREG                      fs_reg,
		P_BP_HASH_TABLE_KEYED_ENTRY     file_entry,
		P_BP_FSREG_FILE_POLICY_ANALYSIS optional_policy_analysis_filter,
		char ***                        entries_in_out,
		size_t *                        entries_n
)
{
	P_BP_FSREG_ENTRY fsreg_entry = (P_BP_FSREG_ENTRY) file_entry->data;
	if(!fsreg_entry)
		return ERR_FAILURE;
	if(fsreg_entry->type == BP_FSREG_ENTRY_TYPE_DIR)
		return ERR_SUCCESS;
	char * entry = BP_FSRegLookupFilesystemPathFromEntry
	(
			fs_reg,
			file_entry
	);
	if(!entry)
		return ERR_FAILURE;
	entries_in_out[0] = (char **) bprealloc((char *) entries_in_out[0], sizeof(char *) * (*entries_n + 2));
	if(!entries_in_out)
		return ERR_FAILURE;
	entries_in_out[0][*entries_n]   = bpstrdup(entry);
	entries_in_out[0][*entries_n+1] = NULL;
	*entries_n = *entries_n + 1;
	if(entry)
		bpfree(entry);
	return ERR_SUCCESS;
}
BP_ERROR_T BP_FSRegRetrieveEntryFullPathsAsBPCallocedNullTerminatedPointerArray__entry_r ( P_BP_FSREG fs_reg , P_BP_HASH_TABLE_KEYED_ENTRY file_entry , P_BP_FSREG_FILE_POLICY_ANALYSIS optional_policy_analysis_filter , char * * * entries_in_out , size_t * entries_n ) { P_BP_FSREG_ENTRY fsreg_entry = ( P_BP_FSREG_ENTRY ) file_entry -> data ; if ( ! fsreg_entry ) return ERR_FAILURE ; if ( fsreg_entry -> type == BP_FSREG_ENTRY_TYPE_DIR ) return ERR_SUCCESS ; char * entry = BP_FSRegLookupFilesystemPathFromEntry ( fs_reg , file_entry ) ; if ( ! entry ) return ERR_FAILURE ; entries_in_out [ 0 ] = ( char * * ) bprealloc ( ( char * ) entries_in_out [ 0 ] , sizeof ( char * ) * ( * entries_n + 2 ) ) ; if ( ! entries_in_out ) return ERR_FAILURE ; entries_in_out [ 0 ] [ * entries_n ] = bpstrdup ( entry ) ; entries_in_out [ 0 ] [ * entries_n + 1 ] = NULL ; * entries_n = * entries_n + 1 ; if ( entry ) bpfree ( entry ) ; return ERR_SUCCESS ; }
this is an internal function, do not use this
Simple internal routine to parse individual entries (needed for recursion)
this is an internal function do not use this Simple internal routine to parse individual entries ( needed for recursion )
// set fsreg entry // return immediately if the type is dir // attempt to lookup the filesystem registry // ensure we have an entry // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%% Alloc Entry and Store %%%%%%%%%%%%%%%%%%%%%%%%%%%% // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% // allocate space for entry // duplicate the entry and increment counter // printf("\n son of a gun: %u - %s", *entries_n, entries_in_out[0][*entries_n]); // destroy the entry // return indicating success