#!/bin/sh
+#
+## Copyright (C) 1996-2023 The Squid Software Foundation and contributors
+##
+## Squid software is distributed under GPLv2+ license and includes
+## contributions from numerous individuals and organizations.
+## Please see the COPYING and CONTRIBUTORS files for details.
+##
-# NOTE: echo '\n' is not portable. Some shells interpret and
-# change it to an actual newline character. The ugly hack here
-# is to use two echo commands:
-# echo -n 'blah\'
-# echo 'n'
-# This is probably more portable in Perl.
-
-echo "/* automatically generated `date` by"
-echo " * $0 $*"
-echo ' * do not edit'
-echo ' */'
-echo '#include "squid.h'
-echo ''
+echo "/* automatically generated by $0 $*"
+echo " * do not edit"
+echo " */"
+echo "#include \"squid.h\""
+echo "#include \"repl_modules.h\""
+echo "#include \"Store.h\""
+echo ""
for module in "$@"; do
- echo "REMOVALPOLICYCREATE createRemovalPolicy_${module};"
+ echo "extern REMOVALPOLICYCREATE createRemovalPolicy_${module};"
done
-echo ''
-echo 'RemovalPolicy *'
-echo 'createRemovalPolicy(RemovalPolicySettings *settings)'
-echo '{'
+echo "void storeReplSetup(void)"
+echo "{"
for module in "$@"; do
- echo " if (strcmp(settings->type, \"${module}\") == 0)"
- echo " return createRemovalPolicy_${module}(settings->args);"
+ echo " storeReplAdd(\"$module\", createRemovalPolicy_${module});"
done
- echo -n ' debug(20, 1) ("Unknown policy %s\'
- echo 'n", settings->type);'
- echo ' return NULL;'
-echo '}'
+echo "}"