imgtools/buildrom/tools/flexmodload.pm
author Zheng Shen <zheng.shen@nokia.com>
Wed, 13 Oct 2010 16:27:55 +0800
changeset 647 53d1ab72f5bc
parent 600 6d08f4a05d93
permissions -rw-r--r--
ROM Tools 13.1.0.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
600
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     1
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     2
# All rights reserved.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     7
#
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     8
# Initial Contributors:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    10
#
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    11
# Contributors:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    12
#
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    13
# Description:
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    14
# Runtime module-loading routine for loading e32toolp modules into 'main' module
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    15
# 
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    16
#
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    17
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    18
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    19
package flexmodload;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    20
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    21
use romutl;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    22
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    23
require Exporter;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    24
@ISA=qw(Exporter);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    25
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    26
@EXPORT=qw(
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    27
	FlexLoad_ModuleL
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    28
);
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    29
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    30
sub FlexLoad_ModuleL (@) {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    31
# Loads a module into the 'main' package, including all the functions the module defines for export
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    32
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    33
	my @ModBaseList=@_;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    34
	my $ModBase;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    35
	foreach $ModBase (@ModBaseList) {
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    36
		$ModBase=lc $ModBase;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    37
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    38
		package main;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    39
		require $ModBase.".pm" or die "ERROR: Can't load function from \"$ModBase.pm\"\n";
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    40
		my $Package=ucfirst lc $ModBase;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    41
		$Package->import;
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    42
	}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    43
}
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    44
6d08f4a05d93 add deprecated files
jjkang
parents:
diff changeset
    45
1;