18 |
|
# areatoolbox(ConfigArea) : return the toolbox of the specified area |
19 |
|
# setuptoolsinarea($area[,$toolname[,$toolversion[,toolfile]) : setup |
20 |
|
# arch() : get/set the architecture string |
21 |
+ |
# scramobjectinterface(Class) : print out the interface of a scram class |
22 |
|
|
23 |
|
package Scram::ScramFunctions; |
24 |
|
use URL::URLcache; |
32 |
|
$self={}; |
33 |
|
bless $self, $class; |
34 |
|
# -- default settings |
35 |
< |
$self->{cachedir}=$ENV{HOME}."/.SCRAM/globalcache"; |
35 |
> |
$self->{cachedir}=$ENV{HOME}."/.scramrc/globalcache"; |
36 |
|
$self->{scramprojectsdbdir}=$ENV{SCRAM_LOOKUPDB}; |
37 |
|
return $self; |
38 |
|
} |
234 |
|
:$self->{arch}; |
235 |
|
} |
236 |
|
|
237 |
+ |
sub scramobjectinterface { |
238 |
+ |
my $self=shift; |
239 |
+ |
my $class=shift; |
240 |
+ |
|
241 |
+ |
my $file; |
242 |
+ |
($file=$class."\.pm")=~s/::/\//g; |
243 |
+ |
$file=$ENV{TOOL_HOME}."/".$file; |
244 |
+ |
|
245 |
+ |
if ( ! -f $file ) { |
246 |
+ |
$self->error("Unable to find $class in ".$ENV{TOOL_HOME}); |
247 |
+ |
} |
248 |
+ |
print "--------------------- $class ------------------\n"; |
249 |
+ |
my $fh=FileHandle->new(); |
250 |
+ |
$fh->open("<$file"); |
251 |
+ |
while ( <$fh> ) { |
252 |
+ |
if ( $_=~/#\s*Interface/g ) { |
253 |
+ |
$intregion=1; |
254 |
+ |
next; |
255 |
+ |
} |
256 |
+ |
if ( $intregion ) { # if we are in the interface documentation |
257 |
+ |
if ( ( $_!~/^#/ ) || ( $_=~/^#\s?-{40}/ ) ) { #moving out of Int doc |
258 |
+ |
$intregion=0; |
259 |
+ |
next; |
260 |
+ |
} |
261 |
+ |
print $_; |
262 |
+ |
if ( $_=~/^#\s*(.*)\((.*)\)?:(.*)/ ) { |
263 |
+ |
$interface=$1; |
264 |
+ |
$args=$2; |
265 |
+ |
$rest=$3; |
266 |
+ |
next if ($interface eq ""); |
267 |
+ |
push @interfaces,$interface; |
268 |
+ |
$interfaceargs{$interface}=$args; |
269 |
+ |
} |
270 |
+ |
} |
271 |
+ |
} |
272 |
+ |
print "\n"; |
273 |
+ |
undef $fh; |
274 |
+ |
} |
275 |
+ |
|
276 |
|
# -------------- Support Routines ------------------------------ |
277 |
|
|
278 |
|
|