Sun, 16 Oct 2011 12:20:52 +0200
generalized suffix_list to string_list
/* * suffix_fnc.c * * Created on: 15.09.2011 * Author: beckermi */ #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; }