|
From: <jgr...@us...> - 2003-07-17 20:12:19
|
Update of /cvsroot/popfile/engine/POPFile
In directory sc8-pr-cvs1:/tmp/cvs-serv16442a/POPFile
Modified Files:
Loader.pm
Log Message:
Tidy up code
Index: Loader.pm
===================================================================
RCS file: /cvsroot/popfile/engine/POPFile/Loader.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Loader.pm 12 Jul 2003 20:22:00 -0000 1.2
--- Loader.pm 17 Jul 2003 20:12:16 -0000 1.3
***************
*** 1,3 ****
--- 1,4 ----
package POPFile::Loader;
+
# ---------------------------------------------------------------------------------------------
#
***************
*** 5,11 ****
# tasks
#
! # subroutine names beginning with CORE indicate a subroutine designed for exclusive use of
! # POPFile's core application. subroutines not so marked are suitable for use by POPFile-based
! # utilities to assist in loading and executing modules
#
# Copyright (c) 2001-2003 John Graham-Cumming
--- 6,14 ----
# tasks
#
! # Subroutine names beginning with CORE indicate a subroutine designed for exclusive use of
! # POPFile's core application (popfile.pl).
! #
! # Subroutines not so marked are suitable for use by POPFile-based utilities to assist in loading
! # and executing modules
#
# Copyright (c) 2001-2003 John Graham-Cumming
***************
*** 13,18 ****
# ---------------------------------------------------------------------------------------------
!
! #----------------------------------------------------------------------------
# new
#
--- 16,20 ----
# ---------------------------------------------------------------------------------------------
! #----------------------------------------------------------------------------------------------
# new
#
***************
*** 50,53 ****
--- 52,57 ----
}
+ # See CORE_loader_init below for an explanation of these
+
$self->{aborting__} = '';
$self->{pipeready__} = '';
***************
*** 55,62 ****
$self->{reaper__} = '';
$self->{major_version__} = '';
! $self->{minor_version__} = '';
$self->{build_version__} = '';
-
$self->{version_string__} = '';
--- 59,68 ----
$self->{reaper__} = '';
+ # POPFile's version number as individual numbers and as
+ # string
+
$self->{major_version__} = '';
! $self->{minor_version__} = '';
$self->{build_version__} = '';
$self->{version_string__} = '';
***************
*** 67,70 ****
--- 73,77 ----
#---------------------------------------------------------------------------------------------
+ #
# CORE_loader_init
#
***************
*** 72,79 ****
#
#---------------------------------------------------------------------------------------------
-
sub CORE_loader_init
{
! my ($self) = @_;
# These anonymous subroutine references allow us to call these important
--- 79,85 ----
#
#---------------------------------------------------------------------------------------------
sub CORE_loader_init
{
! my ( $self ) = @_;
# These anonymous subroutine references allow us to call these important
***************
*** 100,104 ****
sub CORE_aborting
{
! my ($self) = @_;
$self->{alive__} = 0;
--- 106,110 ----
sub CORE_aborting
{
! my ( $self ) = @_;
$self->{alive__} = 0;
***************
*** 158,162 ****
sub CORE_reaper
{
! my ($self) = @_;
foreach my $type (keys %{$self->{components__}}) {
--- 164,168 ----
sub CORE_reaper
{
! my ( $self ) = @_;
foreach my $type (keys %{$self->{components__}}) {
***************
*** 184,188 ****
sub CORE_forker
{
! my ($self) = @_;
# Tell all the modules that a fork is about to happen
--- 190,194 ----
sub CORE_forker
{
! my ( $self ) = @_;
# Tell all the modules that a fork is about to happen
***************
*** 239,243 ****
}
-
#---------------------------------------------------------------------------------------------
#
--- 245,248 ----
***************
*** 279,283 ****
#
# Called to load a single POPFile Loadable Module (implemented as .pm files with special
! # comment on first line and add it to the components hash.
# Returns a handle to the module
#
--- 284,289 ----
#
# Called to load a single POPFile Loadable Module (implemented as .pm files with special
! # comment on first line) and add it to the components hash.
! #
# Returns a handle to the module
#
***************
*** 334,337 ****
--- 340,344 ----
#---------------------------------------------------------------------------------------------
+ #
# CORE_signals
#
***************
*** 343,347 ****
sub CORE_signals
{
! my ($self) = @_;
# Redefine POPFile's signals
--- 350,354 ----
sub CORE_signals
{
! my ( $self ) = @_;
# Redefine POPFile's signals
***************
*** 368,371 ****
--- 375,379 ----
#---------------------------------------------------------------------------------------------
+ #
# CORE_platform_
#
***************
*** 375,379 ****
sub CORE_platform_
{
! my ($self) = @_;
# Look for a module called Platform::<platform> where <platform> is the value of $^O
--- 383,387 ----
sub CORE_platform_
{
! my ( $self ) = @_;
# Look for a module called Platform::<platform> where <platform> is the value of $^O
***************
*** 394,398 ****
#---------------------------------------------------------------------------------------------
! # load
#
# Loads POPFile's modules
--- 402,407 ----
#---------------------------------------------------------------------------------------------
! #
! # CORE_load
#
# Loads POPFile's modules
***************
*** 401,405 ****
sub CORE_load
{
! my ($self) = @_;
# Create the main objects that form the core of POPFile. Consists of the configuration
--- 410,414 ----
sub CORE_load
{
! my ( $self ) = @_;
# Create the main objects that form the core of POPFile. Consists of the configuration
***************
*** 419,423 ****
#---------------------------------------------------------------------------------------------
! # clink
#
# Links POPFile's modules together to allow them to make use of each-other as objects
--- 428,433 ----
#---------------------------------------------------------------------------------------------
! #
! # CORE_link_components
#
# Links POPFile's modules together to allow them to make use of each-other as objects
***************
*** 426,430 ****
sub CORE_link_components
{
! my ($self) = @_;
print "\n\nPOPFile Engine $self->{version_string__} starting" if $self->{debug__};
--- 436,440 ----
sub CORE_link_components
{
! my ( $self ) = @_;
print "\n\nPOPFile Engine $self->{version_string__} starting" if $self->{debug__};
***************
*** 454,458 ****
#---------------------------------------------------------------------------------------------
! # initialize
#
# Loops across POPFile's modules and initializes them
--- 464,469 ----
#---------------------------------------------------------------------------------------------
! #
! # CORE_initialize
#
# Loops across POPFile's modules and initializes them
***************
*** 461,465 ****
sub CORE_initialize
{
! my ($self) = @_;
print "\n\n Initializing... " if $self->{debug__};
--- 472,476 ----
sub CORE_initialize
{
! my ( $self ) = @_;
print "\n\n Initializing... " if $self->{debug__};
***************
*** 486,489 ****
--- 497,501 ----
#---------------------------------------------------------------------------------------------
+ #
# CORE_config
#
***************
*** 493,497 ****
sub CORE_config
{
! my ($self) = @_;
# Load the configuration from disk and then apply any command line
--- 505,509 ----
sub CORE_config
{
! my ( $self ) = @_;
# Load the configuration from disk and then apply any command line
***************
*** 503,506 ****
--- 515,519 ----
#---------------------------------------------------------------------------------------------
+ #
# CORE_start
#
***************
*** 510,514 ****
sub CORE_start
{
! my ($self) = @_;
print "\n\n Starting... " if $self->{debug__};
--- 523,527 ----
sub CORE_start
{
! my ( $self ) = @_;
print "\n\n Starting... " if $self->{debug__};
***************
*** 530,533 ****
--- 543,547 ----
#---------------------------------------------------------------------------------------------
+ #
# CORE_service
#
***************
*** 539,543 ****
sub CORE_service
{
! my ($self) = @_;
print "\n\nPOPFile Engine $self->{version_string__} running\n" if $self->{debug__};
--- 553,557 ----
sub CORE_service
{
! my ( $self ) = @_;
print "\n\nPOPFile Engine $self->{version_string__} running\n" if $self->{debug__};
***************
*** 575,578 ****
--- 589,593 ----
#---------------------------------------------------------------------------------------------
+ #
# CORE_stop
#
***************
*** 582,586 ****
sub CORE_stop
{
! my ($self) = @_;
print "\n\nPOPFile Engine $self->{version_string__} stopping\n" if $self->{debug__};
--- 597,601 ----
sub CORE_stop
{
! my ( $self ) = @_;
print "\n\nPOPFile Engine $self->{version_string__} stopping\n" if $self->{debug__};
***************
*** 605,611 ****
}
- # GETTERS/SETTERS
-
#---------------------------------------------------------------------------------------------
# CORE_version
#
--- 620,625 ----
}
#---------------------------------------------------------------------------------------------
+ #
# CORE_version
#
***************
*** 618,622 ****
#
#---------------------------------------------------------------------------------------------
-
sub CORE_version
{
--- 632,635 ----
***************
*** 636,639 ****
--- 649,653 ----
#---------------------------------------------------------------------------------------------
+ #
# get_module
#
***************
*** 650,657 ****
#
#---------------------------------------------------------------------------------------------
-
sub get_module
{
! my ($self, $name, $type) = @_;
if (!defined($type) && $name =~ /^(.*)::(.*)$/ ) {
--- 664,670 ----
#
#---------------------------------------------------------------------------------------------
sub get_module
{
! my ( $self, $name, $type ) = @_;
if (!defined($type) && $name =~ /^(.*)::(.*)$/ ) {
***************
*** 662,671 ****
}
-
return $self->{components__}{$type}{$name};
}
-
#---------------------------------------------------------------------------------------------
# set_module
#
--- 675,683 ----
}
return $self->{components__}{$type}{$name};
}
#---------------------------------------------------------------------------------------------
+ #
# set_module
#
***************
*** 685,688 ****
--- 697,701 ----
#---------------------------------------------------------------------------------------------
+ #
# remove_module
#
***************
*** 703,717 ****
}
!
! #---------------------------------------------------------------------------------------------
! # debug
! #
! # POPFile::Loader debugging getter/setter
! #
! #---------------------------------------------------------------------------------------------
sub debug
{
! my ($self, $debug) = @_;
$self->{debug__} = $debug;
--- 716,724 ----
}
! # SETTER
sub debug
{
! my ( $self, $debug ) = @_;
$self->{debug__} = $debug;
***************
*** 719,721 ****
1;
! ##
\ No newline at end of file
--- 726,728 ----
1;
!
|