summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-12-22 02:54:37 +0000
committerfukachan <fukachan>2002-12-22 02:54:37 +0000
commita65723e5c55190909cc72ccc573bc737ee2caa73 (patch)
tree170e40d592f6902e2ea1292fe4188f9278207568 /fml/lib
parent3ef16f3fb2fd86aaf0904fa177b90d4339684b67 (diff)
downloadfml8-a65723e5c55190909cc72ccc573bc737ee2caa73.tar.gz
fml8-a65723e5c55190909cc72ccc573bc737ee2caa73.tar.bz2
fml8-a65723e5c55190909cc72ccc573bc737ee2caa73.zip
fix comments. cosmetics.
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/IO/Adapter/Array.pm18
-rw-r--r--fml/lib/IO/Adapter/DBI.pm20
-rw-r--r--fml/lib/IO/Adapter/LDAP.pm8
-rw-r--r--fml/lib/IO/Adapter/NIS.pm7
-rw-r--r--fml/lib/IO/Adapter/UnixGroup.pm6
5 files changed, 35 insertions, 24 deletions
diff --git a/fml/lib/IO/Adapter/Array.pm b/fml/lib/IO/Adapter/Array.pm
index 0edc0bd1..a88b4a30 100644
--- a/fml/lib/IO/Adapter/Array.pm
+++ b/fml/lib/IO/Adapter/Array.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Array.pm,v 1.25 2002/09/11 23:18:19 fukachan Exp $
+# $FML: Array.pm,v 1.26 2002/09/22 14:56:58 fukachan Exp $
#
package IO::Adapter::Array;
@@ -16,7 +16,7 @@ use IO::Adapter::ErrorStatus qw(error_set error error_clear);
=head1 NAME
-IO::Adapter::Array - base class for IO emulation for the ARRAY
+IO::Adapter::Array - base class for IO emulation for ARRAY_REF.
=head1 SYNOPSIS
@@ -30,7 +30,7 @@ IO::Adapter::Array - base class for IO emulation for the ARRAY
=head1 DESCRIPTION
-emulate IO operation for the ARRAY.
+emulate IO operation for the ARRAY_REF on memory.
One array is similar to a set of primary keys without optional values
such as a file:
@@ -64,7 +64,7 @@ sub new
=item C<open($args)>
-open IO for the array. $args is a hash reference.
+open IO for the array ARRAY_REF. $args is a hash reference.
The option follows:
$args = {
@@ -76,6 +76,7 @@ $flag is "r" only (read only) now.
=cut
+
# Descriptions: open() emulation
# Arguments: OBJ($self) HASH_REF($args)
# $args = {
@@ -88,7 +89,7 @@ sub open
{
my ($self, $args) = @_;
my $flag = $args->{ flag } || 'r';
- my $r_array = $self->{ _array_reference};
+ my $r_array = $self->{ _array_reference };
if ($flag ne 'r') {
$self->error_set("Error: type=$self->{_type} is read only.");
@@ -112,7 +113,7 @@ the same as get_next_value().
=item C<get_next_key()>
-return the next element of the array
+return the next element of the array.
=item C<get_next_value()>
@@ -139,7 +140,8 @@ sub get_next_key
my ($self, $args) = @_;
my $i = $self->{_counter}++;
my $ra = $self->{_elements};
- defined $$ra[ $i ] ? $$ra[ $i ] : undef;
+
+ return( defined $$ra[ $i ] ? $$ra[ $i ] : undef );
}
@@ -155,7 +157,7 @@ sub get_next_value
=head2 C<getpos()>
-return the current position in the array
+return the current position in the array.
=head2 C<setpos($pos)>
diff --git a/fml/lib/IO/Adapter/DBI.pm b/fml/lib/IO/Adapter/DBI.pm
index 584e729f..b073daeb 100644
--- a/fml/lib/IO/Adapter/DBI.pm
+++ b/fml/lib/IO/Adapter/DBI.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: DBI.pm,v 1.20 2002/09/11 23:18:20 fukachan Exp $
+# $FML: DBI.pm,v 1.21 2002/09/22 14:56:58 fukachan Exp $
#
package IO::Adapter::DBI;
@@ -18,7 +18,7 @@ my $debug = 0;
=head1 NAME
-IO::Adapter::DBI - DBI
+IO::Adapter::DBI - DBI abstraction layer
=head1 SYNOPSIS
@@ -27,9 +27,8 @@ IO::Adapter::DBI - DBI
This module is a top level driver to talk with a DBI server in SQL
(Structured Query Language).
-The model dependent SQL statement is expected to be holded in
-other modules in such as C<IO::Adapter::SQL::> class.
-Each model name is specified at $args->{ schema } in new($args).
+The model dependent SQL statement is expected to be given as
+parameters.
=head1 METHODS
@@ -207,6 +206,8 @@ sub get_next_key
sub get_next_value
{
my ($self, $args) = @_;
+
+ # XXX-TODO 'get_net_value() not implemented. (why ?)
croak('get_net_value() not implemented');
}
@@ -292,6 +293,7 @@ sub add
$self->open();
+ # XXX-TODO: &address hard-coded.
$query =~ s/\&address/$addr/g;
$self->execute({ query => $query });
@@ -312,6 +314,7 @@ sub delete
$self->open();
+ # XXX-TODO: &address hard-coded.
$query =~ s/\&address/$addr/g;
$self->execute({ query => $query });
@@ -343,11 +346,14 @@ sub md_find
$self->open();
+ # XXX-TODO: &regexp hard-coded.
$query =~ s/\&regexp/$regexp/g;
$self->execute({ query => $query });
if (defined $self->{ _res }) {
my ($row);
+
+ RES:
while (defined ($row = $self->{ _res }->fetchrow_arrayref)) {
$x = join(" ", @$row);
@@ -361,10 +367,10 @@ sub md_find
}
else {
if ($case_sensitive) {
- last if $x =~ /$regexp/;
+ last RES if $x =~ /$regexp/;
}
else {
- last if $x =~ /$regexp/i;
+ last RES if $x =~ /$regexp/i;
}
}
}
diff --git a/fml/lib/IO/Adapter/LDAP.pm b/fml/lib/IO/Adapter/LDAP.pm
index 59226f78..3d794e4d 100644
--- a/fml/lib/IO/Adapter/LDAP.pm
+++ b/fml/lib/IO/Adapter/LDAP.pm
@@ -1,10 +1,10 @@
#-*- perl -*-
#
-# Copyright (C) 2001 Ken'ichi Fukamachi
+# Copyright (C) 2001,2002 Ken'ichi Fukamachi
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: LDAP.pm,v 1.12 2002/09/11 23:18:20 fukachan Exp $
+# $FML: LDAP.pm,v 1.13 2002/09/22 14:56:59 fukachan Exp $
#
package IO::Adapter::LDAP;
@@ -32,6 +32,8 @@ not yet
=cut
+# XXX-TODO: NOT IMPLENETED.
+
# Descriptions: standard constructor
# Arguments: OBJ($self)
@@ -56,7 +58,7 @@ Ken'ichi Fukamachi
=head1 COPYRIGHT
-Copyright (C) 2001 Ken'ichi Fukamachi
+Copyright (C) 2001,2002 Ken'ichi Fukamachi
All rights reserved. This program is free software; you can
redistribute it and/or modify it under the same terms as Perl itself.
diff --git a/fml/lib/IO/Adapter/NIS.pm b/fml/lib/IO/Adapter/NIS.pm
index 39a199f6..c3c1f4b1 100644
--- a/fml/lib/IO/Adapter/NIS.pm
+++ b/fml/lib/IO/Adapter/NIS.pm
@@ -1,10 +1,10 @@
#-*- perl -*-
#
-# Copyright (C) 2001 Ken'ichi Fukamachi
+# Copyright (C) 2001,2002 Ken'ichi Fukamachi
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: NIS.pm,v 1.18 2002/09/11 23:18:20 fukachan Exp $
+# $FML: NIS.pm,v 1.19 2002/09/22 14:56:59 fukachan Exp $
#
package IO::Adapter::NIS;
@@ -60,6 +60,7 @@ sub configure
my ($self, $me) = @_;
my ($type) = ref($self) || $self;
+ # XXX-TODO: we call "ypmatch" but should use full-path if could.
# emulate an array on memory
my $key = $me->{_name};
my (@x) = split(/:/, `ypmatch $key group.byname`);
@@ -82,7 +83,7 @@ Ken'ichi Fukamachi
=head1 COPYRIGHT
-Copyright (C) 2001 Ken'ichi Fukamachi
+Copyright (C) 2001,2002 Ken'ichi Fukamachi
All rights reserved. This program is free software; you can
redistribute it and/or modify it under the same terms as Perl itself.
diff --git a/fml/lib/IO/Adapter/UnixGroup.pm b/fml/lib/IO/Adapter/UnixGroup.pm
index cef2880a..bd23ea60 100644
--- a/fml/lib/IO/Adapter/UnixGroup.pm
+++ b/fml/lib/IO/Adapter/UnixGroup.pm
@@ -1,10 +1,10 @@
#-*- perl -*-
#
-# Copyright (C) 2001 Ken'ichi Fukamachi
+# Copyright (C) 2001,2002 Ken'ichi Fukamachi
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: UnixGroup.pm,v 1.16 2002/09/11 23:18:20 fukachan Exp $
+# $FML: UnixGroup.pm,v 1.17 2002/09/22 14:56:59 fukachan Exp $
#
package IO::Adapter::UnixGroup;
@@ -81,7 +81,7 @@ Ken'ichi Fukamachi
=head1 COPYRIGHT
-Copyright (C) 2001 Ken'ichi Fukamachi
+Copyright (C) 2001,2002 Ken'ichi Fukamachi
All rights reserved. This program is free software; you can
redistribute it and/or modify it under the same terms as Perl itself.