ec04bce19cc30c00710d12a2c66b35be99f6ddfb
[debian/amanda] / perl / Amanda / Application.pm
1 # This file was automatically generated by SWIG (http://www.swig.org).
2 # Version 1.3.39
3 #
4 # Do not make changes to this file unless you know what you are doing--modify
5 # the SWIG interface file instead.
6
7 package Amanda::Application;
8 use base qw(Exporter);
9 use base qw(DynaLoader);
10 package Amanda::Applicationc;
11 bootstrap Amanda::Application;
12 package Amanda::Application;
13 @EXPORT = qw();
14
15 # ---------- BASE METHODS -------------
16
17 package Amanda::Application;
18
19 sub TIEHASH {
20     my ($classname,$obj) = @_;
21     return bless $obj, $classname;
22 }
23
24 sub CLEAR { }
25
26 sub FIRSTKEY { }
27
28 sub NEXTKEY { }
29
30 sub FETCH {
31     my ($self,$field) = @_;
32     my $member_func = "swig_${field}_get";
33     $self->$member_func();
34 }
35
36 sub STORE {
37     my ($self,$field,$newval) = @_;
38     my $member_func = "swig_${field}_set";
39     $self->$member_func($newval);
40 }
41
42 sub this {
43     my $ptr = shift;
44     return tied(%$ptr);
45 }
46
47
48 # ------- FUNCTION WRAPPERS --------
49
50 package Amanda::Application;
51
52 *run_calcsize_C = *Amanda::Applicationc::run_calcsize_C;
53
54 # ------- VARIABLE STUBS --------
55
56 package Amanda::Application;
57
58
59 @EXPORT_OK = ();
60 %EXPORT_TAGS = ();
61
62 push @ISA, qw(Amanda::Script_App);
63 require Amanda::Script_App;
64
65 use strict;
66 use warnings;
67
68 =head1 NAME
69
70 Amanda::Application - perl utility functions for Applications.
71
72 =head1 SYNOPSIS
73
74   package Amanda::Application::my_application;
75   use base qw(Amanda::Application);
76
77   sub new {
78     my $class = shift;
79     my ($foo, $bar) = @_;
80     my $self = $class->SUPER::new();
81
82     $self->{'foo'} = $foo;
83     $self->{'bar'} = $bar;
84
85     return $self;
86   }
87
88   # Define all command_* subs that you need, e.g.,
89   sub command_support {
90     my $self = shift;
91     # ...
92   }
93
94   package main;
95
96   # .. parse arguments ..
97
98   my $application = Amanda::Application::my_application->new($opt_foo, $opt_bar);
99   $application->do($cmd);
100
101 =cut
102
103 sub new {
104     my $class = shift;
105
106     my $self = Amanda::Script_App::new($class, "client", "application", @_);
107
108     $self->{known_commands} = {
109         support   => 1,
110         selfcheck => 1,
111         estimate  => 1,
112         backup    => 1,
113         restore   => 1,
114         validate  => 1,
115     };
116     return $self;
117 }
118
119 sub run_calcsize {
120     my $self = shift;
121     my $program = shift;
122
123     run_calcsize_C($self->{config}, $program, $self->{disk}, $self->{device}, $self->{level}, undef, undef);
124
125 }
126 1;