--------------------- PatchSet 1571 Date: 2001/02/14 13:51:42 Author: rbcollins Branch: generic_modules Tag: (none) Log: genericmodules new files Members: src/conf_modules.sh:1.1->1.1.6.1 src/modules.c:1.1->1.1.6.1 src/modules/Makefile.in:1.1->1.1.6.1 --- /dev/null Wed Feb 14 00:50:05 2007 +++ squid/src/conf_modules.sh Wed Feb 14 00:50:27 2007 @@ -0,0 +1,21 @@ +#!/bin/sh +echo "/* automatically generated by $0 $*" +echo " * do not edit" +echo " */" +echo "#include \"squid.h\"" +echo "" +for module in "$@"; do + echo "extern MOD_INSTALL mod_install_${module};" + echo "extern MOD_UNINSTALL mod_uninstall_${module};" +done +echo "int mod_internal_install(const char *namestr, modNode *module)" +echo "{" +for module in "$@"; do + echo " if (strcasecmp(namestr,\"$module\")==0) {" + echo " mod_register(\"$module\", mod_install_${module}, mod_uninstall_${module}, module);" + echo " return -1;" + echo " } else" +done +echo " debug(3,0)(\"mod_internal_install: unrecognised module '%s'.\n\",namestr);" +echo " return 0;" +echo "}" --- /dev/null Wed Feb 14 00:50:05 2007 +++ squid/src/modules.c Wed Feb 14 00:50:27 2007 @@ -0,0 +1,54 @@ + +/* + * $Id$ + * + * DEBUG: section 84 Modules Interface + * AUTHOR: Robert Collins + * + * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from the + * Internet community. Development is led by Duane Wessels of the + * National Laboratory for Applied Network Research and funded by the + * National Science Foundation. Squid is Copyrighted (C) 1998 by + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. + * + * 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, USA. + * + */ + + +/* TEMPORARY HOME FOR DOCUMENTATION: + * + * the uninstall function returns true for 'I uninstalled succesfully' and + * not true for 'I didn't uninstall'. Some modules may not uninstall ever, + * and some may only uninstall if there are no references - it's + * up to the module. + */ + +#include "squid.h" + +void +mod_register(const char *namestr, MOD_INSTALL *install, MOD_UNINSTALL *uninstall, modNode *module) { + debug(84,1)("mod_register: registering %s\n"); + module->install=install; + module->uninstall=uninstall; + /* this may be skippable here ... */ + install(namestr); +} --- /dev/null Wed Feb 14 00:50:05 2007 +++ squid/src/modules/Makefile.in Wed Feb 14 00:50:27 2007 @@ -0,0 +1,36 @@ +# Makefile for modules in the Squid Object Cache server +# +# $Id$ +# + +SUBDIRS = @CONF_MODULES@ +OUTLIBS = @CONF_MODULE_LIBS@ + +all install: + @test -z "$(SUBDIRS)" || for dir in $(SUBDIRS); do \ + sh -c "cd $$dir && $(MAKE) $(MFLAGS) $@" || exit 1; \ + done; + +$(OUTLIBS): + @sh -c "cd `basename $@ .a` && $(MAKE) $(MFLAGS) ../$@" + +clean: + -rm -f *.a stamp + -for dir in *; do \ + if [ -f $$dir/Makefile ]; then \ + sh -c "cd $$dir && $(MAKE) $(MFLAGS) $@" || exit 1;\ + fi; \ + done + +distclean: + -rm -f *.a Makefile + -for dir in *; do \ + if [ -f $$dir/Makefile ]; then \ + sh -c "cd $$dir && $(MAKE) $(MFLAGS) distclean"; \ + fi; \ + done + +.DEFAULT: + @test -z "$(SUBDIRS)" || for dir in $(SUBDIRS); do \ + sh -c "cd $$dir && $(MAKE) $(MFLAGS) $@" || exit 1; \ + done