/[cwmp]/google/lib/CWMP/Request.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/lib/CWMP/Request.pm

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

revision 89 by dpavlin, Wed Jun 20 23:35:04 2007 UTC revision 90 by dpavlin, Sat Jun 23 08:14:45 2007 UTC
# Line 44  sub _tag { Line 44  sub _tag {
44          }          }
45  }  }
46    
47  my $state;  our $state;     # FIXME check this!
48    
49  my $parser = XML::Rules->new(  my $parser = XML::Rules->new(
50  #       start_rules => [  #       start_rules => [
# Line 109  my $parser = XML::Rules->new( Line 109  my $parser = XML::Rules->new(
109                  #                  #
110                  'ParameterInfoStruct' => sub {                  'ParameterInfoStruct' => sub {
111                          my ($tag_name, $tag_hash, $context, $parent_data) = @_;                          my ($tag_name, $tag_hash, $context, $parent_data) = @_;
112                          $state->{ParameterInfo}->{ _tag($tag_hash, 'Name', '_content') } = _tag($tag_hash, 'Writable', '_content' );                          my $name = _tag($tag_hash, 'Name', '_content');
113                          #warn dump( $tag_name, $tag_hash, $context );                          my $writable = _tag($tag_hash, 'Writable', '_content' );
114    
115                            confess "need state" unless ( $state ); # don't remove!
116    
117                            # XXX dragons ahead: convert name to tree rewriting it into perl
118    
119                            my $s = $name;
120                            $s =~ s#^#\$state->{ParameterInfo}->{'$name'}->{'#;
121                            $s =~ s#(\w+)\.(\d+)\.(\w+)#$1'}->[$2]->{'$3#ig;
122                            $s =~ s#(\w+)\.(\w+)#$1'}->{'$2#g;
123                            $s =~ s#(\w+)$#$1'}->{'writable'} = $writable;#;        #fix-vim
124                            eval "$s";
125                            confess "can't eval $s : $@" if ($@);
126    
127                            #warn "## tree: $s ", dump( $state ), "\n";
128                  },                  },
129                  #                  #
130                  # Fault                  # Fault

Legend:
Removed from v.89  
changed lines
  Added in v.90

  ViewVC Help
Powered by ViewVC 1.1.26