[Lxr-commits] CVS: lxr/lib/LXR/Index Mysql.pm, 1.24, 1.25 DB.pm, 1.15, 1.16 Postgres.pm, 1.24, 1.25
Brought to you by:
ajlittoz
From: AdrianIssott <adr...@us...> - 2009-04-25 20:40:33
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5694/lib/LXR/Index Modified Files: Mysql.pm DB.pm Postgres.pm Oracle.pm Log Message: Feature 1691378 (Rearchitect the DB backends) Part IV: * Renamed LXR::Index subroutines to be more understandable Index: Mysql.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Mysql.pm 19 Apr 2009 16:52:40 -0000 1.24 +++ Mysql.pm 25 Apr 2009 20:40:24 -0000 1.25 @@ -138,21 +138,21 @@ return $self; } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; $self->{indexes_insert}->execute($self->symid($symname), $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); } -sub reference { +sub setsymreference { my ($self, $symname, $fileid, $line) = @_; $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); } -sub getindex { +sub symdeclarations { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -169,7 +169,7 @@ return @ret; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -204,7 +204,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; my $rows = $self->{releases_select}->execute($fileid + 0, $release); @@ -267,7 +267,7 @@ # If this file has not been indexed earlier return true. Return false # if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; my ($status); @@ -282,12 +282,12 @@ return $status == 0; } -sub setindexed { +sub setfileindexed { my ($self, $fileid) = @_; $self->{status_update}->execute(1, $fileid, 0); } -sub toreference { +sub filereferenced { my ($self, $fileid) = @_; my ($status); @@ -298,7 +298,7 @@ return $status < 2; } -sub setreferenced { +sub setfilereferenced { my ($self, $fileid) = @_; $self->{status_update}->execute(2, $fileid, 1); } @@ -306,11 +306,11 @@ # This function should be called before parsing each new file, # if this is not done the too much memory will be used and # tings will become very slow. -sub empty_cache { +sub emptycache { %symcache = (); } -sub getdecid { +sub decid { my ($self, $lang, $string) = @_; my $rows = $self->{decl_select}->execute($lang, $string); Index: DB.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/DB.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- DB.pm 19 Apr 2009 16:52:40 -0000 1.15 +++ DB.pm 25 Apr 2009 20:40:24 -0000 1.16 @@ -42,18 +42,18 @@ return $self; } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; my $symid = $self->symid($symname); $self->{'indexes'}{$symid} .= join("\t", $fileid, $line, $type, $relsym) . "\0"; - # $$self{'index'}{$self->symid($symname)} = + # $$self{'symdeclaration'}{$self->symid($symname)} = # join("\t", $filename, $line, $type, ''); } # Returns array of (fileid, line, type) -sub getindex { +sub symdeclarations { my ($self, $symname, $release) = @_; my (@d, $f); @@ -68,7 +68,7 @@ return @d; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; return (); } @@ -89,7 +89,7 @@ # If this file has not been indexed earlier, mark it as being indexed # now and return true. Return false if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; return undef if $self->{'status'}{$fileid} >= 1; @@ -99,7 +99,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; $self->{'releases'}{$fileid} .= $release . ";"; @@ -118,7 +118,7 @@ return $$self{'indexes'}{ $self->symid($symname) }; } -sub empty_cache { +sub emptycache { } 1; Index: Postgres.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Postgres.pm 19 Apr 2009 16:52:40 -0000 1.24 +++ Postgres.pm 25 Apr 2009 20:40:24 -0000 1.25 @@ -131,7 +131,7 @@ return $self; } -sub empty_cache { +sub emptycache { %symcache = (); } @@ -141,7 +141,7 @@ } } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; $indexes_insert->execute($self->symid($symname), @@ -149,14 +149,14 @@ commit_if_limit(); } -sub reference { +sub setsymreference { my ($self, $symname, $fileid, $line) = @_; $usage_insert->execute($fileid, $line, $self->symid($symname)); commit_if_limit(); } -sub getindex { +sub symdeclarations { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -179,7 +179,7 @@ return @ret; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -215,7 +215,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; $releases_select->execute($fileid + 0, $release); @@ -270,7 +270,7 @@ # If this file has not been indexed earlier, mark it as being indexed # now and return true. Return false if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; $status_insert->execute($fileid + 0, $fileid + 0); @@ -278,13 +278,13 @@ return $status_update->execute(1, $fileid + 0, 0) > 0; } -sub toreference { +sub filereferenced { my ($self, $fileid) = @_; return $status_update->execute(2, $fileid, 1) > 0; } -sub getdecid { +sub decid { my ($self, $lang, $string) = @_; my $rows = $decl_select->execute($lang, $string); @@ -317,12 +317,12 @@ commit_if_limit(); } -sub setindexed { +sub setfileindexed { my ($self, $fileid) = @_; $status_update->execute(1, $fileid, 0); } -sub setreferenced { +sub setfilereferenced { my ($self, $fileid) = @_; $status_update->execute(2, $fileid, 1); } Index: Oracle.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Oracle.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Oracle.pm 19 Apr 2009 16:52:40 -0000 1.13 +++ Oracle.pm 25 Apr 2009 20:40:24 -0000 1.14 @@ -131,21 +131,21 @@ return $self; } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; $self->{indexes_insert}->execute($self->symid($symname), $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); } -sub reference { +sub setsymreference { my ($self, $symname, $fileid, $line) = @_; $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); } -sub getindex { # Hinzugefügt von Variable @row, While-Schleife +sub symdeclarations { # Hinzugefügt von Variable @row, While-Schleife my ($self, $symname, $release) = @_; my ($rows, @ret, @row); @@ -166,7 +166,7 @@ return @ret; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret, @row); @@ -205,7 +205,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; my $rows = $self->{releases_select}->execute($fileid + 0, $release); @@ -268,7 +268,7 @@ # If this file has not been indexed earlier return true. Return false # if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; my ($status); @@ -283,12 +283,12 @@ return $status == 0; } -sub setindexed { +sub setfileindexed { my ($self, $fileid) = @_; $self->{status_update}->execute(1, $fileid, 0); } -sub toreference { +sub filereferenced { my ($self, $fileid) = @_; my ($status); @@ -299,7 +299,7 @@ return $status < 2; } -sub setreferenced { +sub setfilereferenced { my ($self, $fileid) = @_; $self->{status_update}->execute(2, $fileid, 1); } @@ -307,11 +307,11 @@ # This function should be called before parsing each new file, # if this is not done the too much memory will be used and # tings will become very slow. -sub empty_cache { +sub emptycache { %symcache = (); } -sub getdecid { +sub decid { my ($self, $lang, $string) = @_; my $rows = $self->{decl_select}->execute($lang, $string); |