if (filtered(namelist[file_num]->d_name) == TRUE) {
char tmp_buffer[FILENAME_MAX+1];  tmp_buffer[0] = '\0'; tmp_buffer[FILENAME_MAX] = '\0'; strncpy(tmp_buffer, RA_PATH, FILENAME_MAX); strncat(tmp_buffer, namelist[file_num]->d_name, FILENAME_MAX); if ( filtered(tmp_buffer) == TRUE ) {
get_resource_list(GList ** rsc_info){	struct dirent **namelist;	int file_num;	if ( rsc_info == NULL ) {		cl_log(LOG_ERR, "Parameter error: get_resource_list");		return -2;	}	if ( *rsc_info != NULL ) {		cl_log(LOG_ERR, "Parameter error: get_resource_list."\			"will cause memory leak.");		*rsc_info = NULL;	} 	file_num = scandir(RA_PATH, &namelist, 0, alphasort);	if (file_num < 0) {		cl_log(LOG_ERR, "scandir failed in OCF RA plugin");		return -2;	} else 	{		while (file_num--) {			rsc_info_t * rsc_info_tmp = NULL;			if (filtered(namelist[file_num]->d_name) == TRUE) {				rsc_info_tmp = g_new(rsc_info_t, 1);					rsc_info_tmp->rsc_type = 					g_strdup(namelist[file_num]->d_name);			/* 			 * Since the version definition isn't cleat yet,			 * the version is setted 1.0.			 */				rsc_info_tmp->version = g_strdup("1.0");				*rsc_info = g_list_append(*rsc_info, 						(gpointer)rsc_info_tmp);			}			free(namelist[file_num]);		}		free(namelist);	}	return g_list_length(*rsc_info);			}