+struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list,
+ char *suffix_list[],
+ int num_list_entries)
+{
+ struct FileInfo *file_list =
+ checked_calloc(num_list_entries * sizeof(struct FileInfo));
+ int list_pos = 0;
+ int i, j;
+
+ for (i=0; config_list[i].token != NULL; i++)
+ {
+ int len_config_token = strlen(config_list[i].token);
+ boolean is_file_entry = TRUE;
+
+ for (j=0; suffix_list[j] != NULL; j++)
+ {
+ int len_suffix = strlen(suffix_list[j]);
+
+ if (len_suffix < len_config_token &&
+ strcmp(&config_list[i].token[len_config_token - len_suffix],
+ suffix_list[j]) == 0)
+ {
+ is_file_entry = FALSE;
+ break;
+ }
+ }
+
+ if (is_file_entry)
+ {
+ if (list_pos >= num_list_entries)
+ Error(ERR_EXIT, "inconsistant config list information -- please fix");
+
+ file_list[list_pos].token = config_list[i].token;
+ file_list[list_pos].default_filename = config_list[i].value;
+
+ list_pos++;
+ }
+ }
+
+ if (list_pos != num_list_entries)
+ Error(ERR_EXIT, "inconsistant config list information -- please fix");
+
+ return file_list;
+}
+