]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/repl_modules.sh
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / repl_modules.sh
index e4e10604d8f22cae9c9dd467ff9fefd5ddb7d62b..97a9b21737fcfca290c0dc7eafa59c0b65289996 100755 (executable)
@@ -1,30 +1,25 @@
 #!/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 "}"