Imported Upstream version 3.3.1
[debian/amanda] / perl / Amanda / Cmdline.pm
index 4a917bc73c5f88a3577947e50926e5a0983f4bc4..c7853b0e31f85bc4d442785d2a784e7e93bebb18 100644 (file)
@@ -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<Amanda::Cmdline::dumpspec_t> 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<format()>
+=item C<< $ds->format() >>
 
 Format the dumpspec as a string.
 
 =back
 
-=head1 Functions
+=head1 Package Functions
 
 =over
 
 =item C<format_dumpspec_components($host, $disk, $datestamp, $level)>
 
-This function returns a string representing the formatted form of the given dumpspec.  This formatting
-is the same as performed by C<format_dumpspec_components>, but does not need a C<dumpspec_t>.
+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<Dumpspec>.
+
+=item C<parse_dumpspecs([@cmdline], $flags)>
 
-=item C<parse_dumpspecs(@cmdline, $flags)> 
+This function parses C<@cmdline> into a list of C<Dumpspec> 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<dumpspec_t> 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<write_timestamp> on the command
+line.
+
+=item C<header_matches_dumpspecs($hdr, [@dumpspecs])>
+
+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<Amanda::Config> handles C<-o> options itself, through C<config_overwrites>.
+L<Amanda::Config> handles C<-o> options itself, through
+C<config_overrides>.
 
 =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;