+/*********************************************************************
+ *
+ * Function : get_number_of_filters
+ *
+ * Description : Counts the number of filter available.
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ *
+ * Returns : Number of filters available.
+ *
+ *********************************************************************/
+static int get_number_of_filters(const struct client_state *csp)
+{
+ int i;
+ struct re_filterfile_spec *b;
+ struct file_list *fl;
+ int number_of_filters = 0;
+
+ for (i = 0; i < MAX_AF_FILES; i++)
+ {
+ fl = csp->rlist[i];
+ if ((NULL == fl) || (NULL == fl->f))
+ {
+ /*
+ * Either there are no filter files left or this
+ * filter file just contains no valid filters.
+ *
+ * Continue to be sure we don't miss valid filter
+ * files that are chained after empty or invalid ones.
+ */
+ continue;
+ }
+
+ for (b = fl->f; b != NULL; b = b->next)
+ {
+ number_of_filters++;
+ }
+ }
+
+ return number_of_filters;
+
+}
+
+