X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FCmdline.pm;h=c7853b0e31f85bc4d442785d2a784e7e93bebb18;hb=refs%2Ftags%2Fupstream%2F3.3.1;hp=4a917bc73c5f88a3577947e50926e5a0983f4bc4;hpb=96f35b20267e8b1a1c846d476f27fcd330e0b018;p=debian%2Famanda diff --git a/perl/Amanda/Cmdline.pm b/perl/Amanda/Cmdline.pm index 4a917bc..c7853b0 100644 --- a/perl/Amanda/Cmdline.pm +++ b/perl/Amanda/Cmdline.pm @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.39 +# Version 2.0.4 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. @@ -51,6 +51,7 @@ package Amanda::Cmdline; *format_dumpspec_components = *Amanda::Cmdlinec::format_dumpspec_components; *parse_dumpspecs = *Amanda::Cmdlinec::parse_dumpspecs; +*header_matches_dumpspecs = *Amanda::Cmdlinec::header_matches_dumpspecs; ############# Class : Amanda::Cmdline::dumpspec_t ############## @@ -67,6 +68,8 @@ use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); *swig_datestamp_set = *Amanda::Cmdlinec::dumpspec_t_datestamp_set; *swig_level_get = *Amanda::Cmdlinec::dumpspec_t_level_get; *swig_level_set = *Amanda::Cmdlinec::dumpspec_t_level_set; +*swig_write_timestamp_get = *Amanda::Cmdlinec::dumpspec_t_write_timestamp_get; +*swig_write_timestamp_set = *Amanda::Cmdlinec::dumpspec_t_write_timestamp_set; sub new { my $pkg = shift; my $self = Amanda::Cmdlinec::new_dumpspec_t(@_); @@ -109,6 +112,7 @@ package Amanda::Cmdline; @EXPORT_OK = (); %EXPORT_TAGS = (); + =head1 NAME Amanda::Cmdline - utilities for handling command lines @@ -117,29 +121,43 @@ Amanda::Cmdline - utilities for handling command lines use Amanda::Cmdline; - my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level); + my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level, $write_timestamp); print "host: $spec->{'host'}; disk: $spec->{'disk'}\n"; my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"], $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP); -=head1 API STATUS +=head1 Amanda::Cmdline::dumpspec_t Objects -Will change. +Note that this class was called C in older versions; +that name will still work, but is deprecated. -=head1 Amanda::Cmdline::dumpspec_t Objects +=head2 Keys -=head2 Instance Variables +Each key contains a match expression, in the form of a string, or undef. Note +that the values of these keys are read-only. =over -=item C<$host> +=item C<< $ds->{'host'} >> + +Hostname + +=item C<< $ds->{'disk'} >> -=item C<$disk> +Disk name -=item C<$datestamp> +=item C<< $ds->{'datestamp'} >> -=item C<$level> +Dump timestamp. + +=item C<< $ds->{'level'} >> + +Dump level + +=item C<< $ds->{'write_timestamp'} >> + +Timestamp when the dump is written to storage media. =back @@ -147,36 +165,57 @@ Will change. =over -=item C +=item C<< $ds->format() >> Format the dumpspec as a string. =back -=head1 Functions +=head1 Package Functions =over =item C -This function returns a string representing the formatted form of the given dumpspec. This formatting -is the same as performed by C, but does not need a C. +This function returns a string representing the formatted form of the +given dumpspec. This formatting is the same as performed by +C<< $ds->format() >>, but does not need a C. + +=item C -=item C +This function parses C<@cmdline> into a list of C objects, +according to C<$flags>, which is a logical combination of zero or more +of -This function parses C<@cmdline> into a list of C objects, -according to C<$flags>, which is a logical combination of zero or -more of C<$CMDLINE_PARSE_DATESTAMP> to recognize datestamps and -C<$CMDLINE_PARSE_LEVEL> to recognize levels. + $CMDLINE_PARSE_DATESTAMP - recognize datestamps + $CMDLINE_PARSE_LEVEL - recognize levels + $CMDLINE_EMPTY_TO_WILDCARD - if @cmdline is empty, make a wildcard dumpspec + +These constants are available in export tag C<:constants>. The command-line +format is + + [host [disk [datestamp [level [host [..]]]]]] + +Note that there is no facility for specifying C on the command +line. + +=item C + +This function compares a header to a list of dumpspecs, returning true if the +header matches at least one dumpspec. If C<@dumpspecs> is empty, the function +returns false. =back =head1 SEE ALSO -L handles C<-o> options itself, through C. +L handles C<-o> options itself, through +C. =cut + + push @EXPORT_OK, qw(cmdline_parse_dumpspecs_flags_to_strings); push @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}, qw(cmdline_parse_dumpspecs_flags_to_strings); @@ -217,4 +256,9 @@ push @EXPORT_OK, qw($CMDLINE_EMPTY_TO_WILDCARD); push @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}, qw($CMDLINE_EMPTY_TO_WILDCARD); $_cmdline_parse_dumpspecs_flags_VALUES{"CMDLINE_EMPTY_TO_WILDCARD"} = $CMDLINE_EMPTY_TO_WILDCARD; + +#copy symbols in cmdline_parse_dumpspecs_flags to constants +push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"cmdline_parse_dumpspecs_flags"}}; + +push @EXPORT_OK, qw(header_matches_dumpspecs parse_dumpspecs format_dumpspec_components); 1;