/[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.3 by dams, Thu May 1 16:21:38 2003 UTC revision 1.4 by dams, Thu May 1 16:22:33 2003 UTC
# Line 42  sub debug { Libconf::debug(@_) } Line 42  sub debug { Libconf::debug(@_) }
42    
43  sub TIEHASH {  sub TIEHASH {
44      my ($pkg, $libconf) = @_;      my ($pkg, $libconf) = @_;
45      debug "Wrapper - TIEHASH\n";      debug;
46      bless { libconf => $libconf }, $pkg;      bless { libconf => $libconf }, $pkg;
47  }  }
48    
49  sub CLEAR {  sub CLEAR {
50      my ($obj) = @_;      my ($obj) = @_;
51      debug "Wrapper - CLEAR\n";      debug;
52      $obj->{libconf}->clear();      $obj->{libconf}->clear();
53  }  }
54    
55  sub DELETE {  sub DELETE {
56      my ($obj, $key) = @_;      my ($obj, $key) = @_;
57      debug "Wrapper - DELETE - key: $key\n";      debug "key: $key";
58      my @pos = $obj->{libconf}->findAtomPos( { type => 'KEY_VALUES', key => $key });      my @pos = $obj->{libconf}->findAtomPos( { type => 'KEY_VALUES', key => $key });
59      foreach (@pos) {      foreach (@pos) {
60          $obj->{libconf}->deleteAtom($_);          $obj->{libconf}->deleteAtom($_);
# Line 63  sub DELETE { Line 63  sub DELETE {
63    
64  sub FIRSTKEY {  sub FIRSTKEY {
65      my ($obj) = @_;      my ($obj) = @_;
66      debug "Wrapper - FIRSTKEY\n";      debug;
67      my $atom = $obj->{libconf}->getAtom(0);      my $atom = $obj->{libconf}->getAtom(0);
68  #    $atom->{key};  #    $atom->{key};
69      $atom->{key};      $atom->{key};
# Line 71  sub FIRSTKEY { Line 71  sub FIRSTKEY {
71    
72  sub EXISTS {  sub EXISTS {
73      my ($obj, $key) = @_;      my ($obj, $key) = @_;
74      debug "Wrapper - EXISTS - key : $key\n";      debug "key : $key";
75      my $pos = $obj->{libconf}->findAtomPos( { type => 'KEY_VALUES', key => $key });      my $pos = $obj->{libconf}->findAtomPos( { type => 'KEY_VALUES', key => $key });
76      defined $pos;      defined $pos;
77  }  }
78    
79  sub NEXTKEY {  sub NEXTKEY {
80      my ($obj, $lastkey) = @_;      my ($obj, $lastkey) = @_;
81      debug "Wrapper - NEXTKEY - lastkey : $lastkey\n";      debug "lastkey : $lastkey";
82      my @pos = $obj->{libconf}->findAtomPos( { type => 'KEY_VALUES', key => $lastkey }); #FIXME : double entries should be removed elsewhere      my @pos = $obj->{libconf}->findAtomPos( { type => 'KEY_VALUES', key => $lastkey }); #FIXME : double entries should be removed elsewhere
83      $pos[-1]+1 >= $obj->{libconf}->size() and return undef;      $pos[-1]+1 >= $obj->{libconf}->size() and return undef;
84      $obj->{libconf}->getAtom($pos[-1]+1)->{key};      $obj->{libconf}->getAtom($pos[-1]+1)->{key};
# Line 86  sub NEXTKEY { Line 86  sub NEXTKEY {
86    
87  sub STORE {  sub STORE {
88      my ($obj, $key, $value) = @_;      my ($obj, $key, $value) = @_;
89      debug "Wrapper - STORE - key : $key - value : $value\n";      debug "key : $key - value : $value";
90      ref $value eq '' or die 'trying to store anything else than a value';      ref $value eq '' or die 'trying to store anything else than a value';
91      my $index;      my $index;
92      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUES', key => $key });      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUES', key => $key });
# Line 100  sub STORE { Line 100  sub STORE {
100    
101  sub FETCH {  sub FETCH {
102      my ($obj, $key) = @_;      my ($obj, $key) = @_;
103      debug "Wrapper - FETCH - key : $key\n";      debug "key : $key\n";
104      $key eq 'libconf' and return $obj->{libconf};      $key eq 'libconf' and return $obj->{libconf};
105      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUES', key => $key });      my @pos = $obj->{libconf}->findAtomPos({ type => 'KEY_VALUES', key => $key });
106      $obj->{libconf}->getAtom($pos[-1])->{values};      $obj->{libconf}->getAtom($pos[-1])->{values};

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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