Move extension script handling to generate_script_1()

Signed-off-by: Tom Eastep <teastep@shorewall.net>

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9739 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2009-03-26 18:18:09 +00:00
parent 7549785e46
commit d67c94de9c

View File

@ -74,8 +74,9 @@ sub reinitialize() {
# #
# First stage of script generation. # First stage of script generation.
# #
# Copy the prog.header to the generated script. # Copy prog.header to the generated script.
# Generate the various user-exit jacket functions.
#
sub generate_script_1() { sub generate_script_1() {
my $date = localtime; my $date = localtime;
@ -90,18 +91,12 @@ sub generate_script_1() {
copy $globals{SHAREDIRPL} . 'prog.header6'; copy $globals{SHAREDIRPL} . 'prog.header6';
} }
} }
}
# emit <<'EOF';
# Second stage of script generation. ################################################################################
# # Functions to execute the various user exits (extension scripts)
# Generate the various user-exit jacket functions. ################################################################################
# Generate the 'initialize()' function. EOF
#
# Note: This function is not called when $command eq 'check'. So it must have no side effects other
# than those related to writing to the object file.
sub generate_script_2() {
for my $exit qw/init isusable start tcclear started stop stopped clear refresh refreshed restored/ { for my $exit qw/init isusable start tcclear started stop stopped clear refresh refreshed restored/ {
emit "\nrun_${exit}_exit() {"; emit "\nrun_${exit}_exit() {";
@ -111,6 +106,24 @@ sub generate_script_2() {
emit '}'; emit '}';
} }
emit <<'EOF';
################################################################################
# End user exit functions
################################################################################
EOF
}
#
# Second stage of script generation.
#
# Generate the 'initialize()' function.
#
# Note: This function is not called when $command eq 'check'. So it must have no side effects other
# than those related to writing to the object file.
sub generate_script_2() {
emit ( '', emit ( '',
'#', '#',
'# This function initializes the global variables used by the program', '# This function initializes the global variables used by the program',