/* MiddleMan filtering proxy server Copyright (C) 2002 Jason McLaughlin This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "proto.h" KEYWORD_LIST *keyword_load(KEYWORD_LIST *keyword_list, XML_LIST *xml_list) { KEYWORD_LIST *tmp_list = keyword_list; struct KEYWORD_LIST_LIST *keywords = NULL; if (tmp_list == NULL) { tmp_list = xmalloc(sizeof(KEYWORD_LIST)); tmp_list->keyword_list = NULL; tmp_list->threshold = 0; tmp_list->template = NULL; tmp_list->id = 0; tmp_list->enabled = TRUE; keyword_list = tmp_list; pthread_rwlock_init(&tmp_list->lock, NULL); } else keywords = tmp_list->keyword_list; while ((xml_list = xml_section(xml_list, ""))) { XML_LIST_LOOP(xml_list, "") { XML_LIST_CMP(xml_list, "") { keywords = keyword_list_new(keywords); keywords->id = tmp_list->id++; if (tmp_list->keyword_list == NULL) tmp_list->keyword_list = keywords; XML_LIST_LOOP(xml_list, "") { XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) { if (!strcasecmp(xml_list->item, "false")) keywords->enabled = FALSE; else keywords->enabled = TRUE; } } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) keyword_list_insert(keywords, xml_list->item, NULL, NULL, NULL, NULL, NULL); } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) keyword_list_insert(keywords, NULL, xml_list->item, NULL, NULL, NULL, NULL); } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) keyword_list_insert(keywords, NULL, NULL, xml_list->item, NULL, NULL, NULL); } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) keyword_list_insert(keywords, NULL, NULL, NULL, xml_list->item, NULL, NULL); } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) keyword_list_insert(keywords, NULL, NULL, NULL, NULL, xml_list->item, NULL); } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) keyword_list_insert(keywords, NULL, NULL, NULL, NULL, NULL, xml_list->item); } } } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) { if (!strcasecmp(xml_list->item, "false")) tmp_list->enabled = FALSE; else tmp_list->enabled = TRUE; } } XML_LIST_CMP(xml_list, "") { xml_list = xml_list->next; if (xml_list->type == XML_VALUE) tmp_list->threshold = atoi(xml_list->item); } XML_LIST_CMP(xml_list, "