Thu, 20 Oct 2011 15:21:53 +0200
implemented bfile heuristics option + TODO: implement algorithm
/* * suffix_fnc.c * * Created on: 15.09.2011 * Author: Mike */ #include "suffix_fnc.h" bool testSuffix(char* filename, settings_t* settings) { bool ret = false; int tokenlen, fnamelen = strlen(filename); for (int t = 0 ; t < settings->suffixList->count ; t++) { tokenlen = strlen(settings->suffixList->items[t]); if (fnamelen >= tokenlen && tokenlen > 0) { if (strncmp(filename+fnamelen-tokenlen, settings->suffixList->items[t], tokenlen) == 0) { ret = true; break; } } } return ret ^ !settings->includeSuffixes; }