/[libconf]/libconf/perl-Libconf/Glueconf/Passwd.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/Glueconf/Passwd.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by dams, Sun May 25 13:13:02 2003 UTC revision 1.6 by dams, Sun Aug 17 14:20:11 2003 UTC
# Line 30  use Libconf; Line 30  use Libconf;
30  @ISA = qw(Libconf);  @ISA = qw(Libconf);
31    
32  sub new {  sub new {
33      my ($pkg, $filename) = @_;      my ($class, $filename) = @_;
34      my $libconf = $pkg->Libconf::new($filename, 'passwd', '');      my $libconf = Libconf::new('Libconf', $filename, 'passwd', '');
35      tie my %wrapper, 'Libconf::Glueconf::Passwd::Wrapper', $libconf;      tie my %wrapper, 'Libconf::Glueconf::Passwd::Wrapper', $libconf;
36      bless \%wrapper, $pkg;      bless \%wrapper, $class;
37    }
38    
39    sub readConf {
40        my ($obj) = @_;
41        $obj->{libconf}->readConf();
42    }
43    
44    sub writeConf {
45        my ($obj) = @_;
46        $obj->{libconf}->writeConf();
47  }  }
48    
49  package Libconf::Glueconf::Passwd::Wrapper;  package Libconf::Glueconf::Passwd::Wrapper;
# Line 100  sub STORE { Line 110  sub STORE {
110    
111  sub FETCH {  sub FETCH {
112      my ($obj, $key) = @_;      my ($obj, $key) = @_;
113      debug "key : $key\n";      debug "key : $key";
114      $key eq 'libconf' and return $obj->{libconf};      $key eq 'libconf' and return $obj->{libconf};
115        substr($key, 0, 1) eq '_' and return $obj->{$key};
116      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUES', key => $key });      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUES', key => $key });
117        @pos == 0 and return undef;
118      $obj->{libconf}->getAtom($pos[-1])->{values};      $obj->{libconf}->getAtom($pos[-1])->{values};
119  }  }
120    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26