1 # This file was automatically generated by SWIG (http://www.swig.org).
4 # Don't modify this file, modify the SWIG interface instead.
6 package Amanda::Device;
9 @ISA = qw(Exporter DynaLoader);
10 require Amanda::Types;
11 package Amanda::Devicec;
12 bootstrap Amanda::Device;
13 package Amanda::Device;
16 # ---------- BASE METHODS -------------
18 package Amanda::Device;
21 my ($classname,$obj) = @_;
22 return bless $obj, $classname;
32 my ($self,$field) = @_;
33 my $member_func = "swig_${field}_get";
34 $self->$member_func();
38 my ($self,$field,$newval) = @_;
39 my $member_func = "swig_${field}_set";
40 $self->$member_func($newval);
49 # ------- FUNCTION WRAPPERS --------
51 package Amanda::Device;
53 *IS_WRITABLE_ACCESS_MODE = *Amanda::Devicec::IS_WRITABLE_ACCESS_MODE;
55 ############# Class : Amanda::Device::queue_fd_t ##############
57 package Amanda::Device::queue_fd_t;
58 use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
59 @ISA = qw( Amanda::Device );
62 *swig_fd_get = *Amanda::Devicec::queue_fd_t_fd_get;
63 *swig_fd_set = *Amanda::Devicec::queue_fd_t_fd_set;
64 *swig_errmsg_get = *Amanda::Devicec::queue_fd_t_errmsg_get;
65 *swig_errmsg_set = *Amanda::Devicec::queue_fd_t_errmsg_set;
68 my $self = Amanda::Devicec::new_queue_fd_t(@_);
69 bless $self, $pkg if defined($self);
73 return unless $_[0]->isa('HASH');
74 my $self = tied(%{$_[0]});
75 return unless defined $self;
76 delete $ITERATORS{$self};
77 if (exists $OWNER{$self}) {
78 Amanda::Devicec::delete_queue_fd_t($self);
85 my $ptr = tied(%$self);
91 my $ptr = tied(%$self);
96 ############# Class : Amanda::Device::Device ##############
98 package Amanda::Device::Device;
99 use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
100 @ISA = qw( Amanda::Device );
105 my $self = Amanda::Devicec::new_Device(@_);
106 bless $self, $pkg if defined($self);
110 return unless $_[0]->isa('HASH');
111 my $self = tied(%{$_[0]});
112 return unless defined $self;
113 delete $ITERATORS{$self};
114 if (exists $OWNER{$self}) {
115 Amanda::Devicec::delete_Device($self);
116 delete $OWNER{$self};
120 *configure = *Amanda::Devicec::Device_configure;
121 *error = *Amanda::Devicec::Device_error;
122 *status_error = *Amanda::Devicec::Device_status_error;
123 *error_or_status = *Amanda::Devicec::Device_error_or_status;
124 *read_label = *Amanda::Devicec::Device_read_label;
125 *start = *Amanda::Devicec::Device_start;
126 *finish = *Amanda::Devicec::Device_finish;
127 *start_file = *Amanda::Devicec::Device_start_file;
128 *write_block = *Amanda::Devicec::Device_write_block;
129 *write_from_fd = *Amanda::Devicec::Device_write_from_fd;
130 *finish_file = *Amanda::Devicec::Device_finish_file;
131 *seek_file = *Amanda::Devicec::Device_seek_file;
132 *seek_block = *Amanda::Devicec::Device_seek_block;
133 *read_block = *Amanda::Devicec::Device_read_block;
134 *read_to_fd = *Amanda::Devicec::Device_read_to_fd;
135 *property_list = *Amanda::Devicec::Device_property_list;
136 *property_get = *Amanda::Devicec::Device_property_get;
137 *property_set = *Amanda::Devicec::Device_property_set;
138 *property_set_ex = *Amanda::Devicec::Device_property_set_ex;
139 *recycle_file = *Amanda::Devicec::Device_recycle_file;
140 *file = *Amanda::Devicec::Device_file;
141 *block = *Amanda::Devicec::Device_block;
142 *in_file = *Amanda::Devicec::Device_in_file;
143 *device_name = *Amanda::Devicec::Device_device_name;
144 *access_mode = *Amanda::Devicec::Device_access_mode;
145 *is_eof = *Amanda::Devicec::Device_is_eof;
146 *volume_label = *Amanda::Devicec::Device_volume_label;
147 *volume_time = *Amanda::Devicec::Device_volume_time;
148 *status = *Amanda::Devicec::Device_status;
149 *min_block_size = *Amanda::Devicec::Device_min_block_size;
150 *max_block_size = *Amanda::Devicec::Device_max_block_size;
151 *block_size = *Amanda::Devicec::Device_block_size;
152 *volume_header = *Amanda::Devicec::Device_volume_header;
155 my $ptr = tied(%$self);
161 my $ptr = tied(%$self);
166 # ------- VARIABLE STUBS --------
168 package Amanda::Device;
170 *ACCESS_NULL = *Amanda::Devicec::ACCESS_NULL;
171 *ACCESS_READ = *Amanda::Devicec::ACCESS_READ;
172 *ACCESS_WRITE = *Amanda::Devicec::ACCESS_WRITE;
173 *ACCESS_APPEND = *Amanda::Devicec::ACCESS_APPEND;
174 *DEVICE_STATUS_SUCCESS = *Amanda::Devicec::DEVICE_STATUS_SUCCESS;
175 *DEVICE_STATUS_DEVICE_ERROR = *Amanda::Devicec::DEVICE_STATUS_DEVICE_ERROR;
176 *DEVICE_STATUS_DEVICE_BUSY = *Amanda::Devicec::DEVICE_STATUS_DEVICE_BUSY;
177 *DEVICE_STATUS_VOLUME_MISSING = *Amanda::Devicec::DEVICE_STATUS_VOLUME_MISSING;
178 *DEVICE_STATUS_VOLUME_UNLABELED = *Amanda::Devicec::DEVICE_STATUS_VOLUME_UNLABELED;
179 *DEVICE_STATUS_VOLUME_ERROR = *Amanda::Devicec::DEVICE_STATUS_VOLUME_ERROR;
180 *DEVICE_STATUS_FLAGS_MAX = *Amanda::Devicec::DEVICE_STATUS_FLAGS_MAX;
181 *PROPERTY_PHASE_BEFORE_START = *Amanda::Devicec::PROPERTY_PHASE_BEFORE_START;
182 *PROPERTY_PHASE_BETWEEN_FILE_WRITE = *Amanda::Devicec::PROPERTY_PHASE_BETWEEN_FILE_WRITE;
183 *PROPERTY_PHASE_INSIDE_FILE_WRITE = *Amanda::Devicec::PROPERTY_PHASE_INSIDE_FILE_WRITE;
184 *PROPERTY_PHASE_BETWEEN_FILE_READ = *Amanda::Devicec::PROPERTY_PHASE_BETWEEN_FILE_READ;
185 *PROPERTY_PHASE_INSIDE_FILE_READ = *Amanda::Devicec::PROPERTY_PHASE_INSIDE_FILE_READ;
186 *PROPERTY_PHASE_MAX = *Amanda::Devicec::PROPERTY_PHASE_MAX;
187 *PROPERTY_PHASE_MASK = *Amanda::Devicec::PROPERTY_PHASE_MASK;
188 *PROPERTY_PHASE_SHIFT = *Amanda::Devicec::PROPERTY_PHASE_SHIFT;
189 *PROPERTY_ACCESS_GET_BEFORE_START = *Amanda::Devicec::PROPERTY_ACCESS_GET_BEFORE_START;
190 *PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE;
191 *PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE;
192 *PROPERTY_ACCESS_GET_BETWEEN_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_GET_BETWEEN_FILE_READ;
193 *PROPERTY_ACCESS_GET_INSIDE_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_GET_INSIDE_FILE_READ;
194 *PROPERTY_ACCESS_SET_BEFORE_START = *Amanda::Devicec::PROPERTY_ACCESS_SET_BEFORE_START;
195 *PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE;
196 *PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE = *Amanda::Devicec::PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE;
197 *PROPERTY_ACCESS_SET_BETWEEN_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_SET_BETWEEN_FILE_READ;
198 *PROPERTY_ACCESS_SET_INSIDE_FILE_READ = *Amanda::Devicec::PROPERTY_ACCESS_SET_INSIDE_FILE_READ;
199 *PROPERTY_ACCESS_GET_MASK = *Amanda::Devicec::PROPERTY_ACCESS_GET_MASK;
200 *PROPERTY_ACCESS_SET_MASK = *Amanda::Devicec::PROPERTY_ACCESS_SET_MASK;
201 *CONCURRENCY_PARADIGM_EXCLUSIVE = *Amanda::Devicec::CONCURRENCY_PARADIGM_EXCLUSIVE;
202 *CONCURRENCY_PARADIGM_SHARED_READ = *Amanda::Devicec::CONCURRENCY_PARADIGM_SHARED_READ;
203 *CONCURRENCY_PARADIGM_RANDOM_ACCESS = *Amanda::Devicec::CONCURRENCY_PARADIGM_RANDOM_ACCESS;
204 *STREAMING_REQUIREMENT_NONE = *Amanda::Devicec::STREAMING_REQUIREMENT_NONE;
205 *STREAMING_REQUIREMENT_DESIRED = *Amanda::Devicec::STREAMING_REQUIREMENT_DESIRED;
206 *STREAMING_REQUIREMENT_REQUIRED = *Amanda::Devicec::STREAMING_REQUIREMENT_REQUIRED;
207 *MEDIA_ACCESS_MODE_READ_ONLY = *Amanda::Devicec::MEDIA_ACCESS_MODE_READ_ONLY;
208 *MEDIA_ACCESS_MODE_WORM = *Amanda::Devicec::MEDIA_ACCESS_MODE_WORM;
209 *MEDIA_ACCESS_MODE_READ_WRITE = *Amanda::Devicec::MEDIA_ACCESS_MODE_READ_WRITE;
210 *MEDIA_ACCESS_MODE_WRITE_ONLY = *Amanda::Devicec::MEDIA_ACCESS_MODE_WRITE_ONLY;
211 *SIZE_ACCURACY_UNKNOWN = *Amanda::Devicec::SIZE_ACCURACY_UNKNOWN;
212 *SIZE_ACCURACY_ESTIMATE = *Amanda::Devicec::SIZE_ACCURACY_ESTIMATE;
213 *SIZE_ACCURACY_REAL = *Amanda::Devicec::SIZE_ACCURACY_REAL;
214 *PROPERTY_SURETY_BAD = *Amanda::Devicec::PROPERTY_SURETY_BAD;
215 *PROPERTY_SURETY_GOOD = *Amanda::Devicec::PROPERTY_SURETY_GOOD;
216 *PROPERTY_SOURCE_DEFAULT = *Amanda::Devicec::PROPERTY_SOURCE_DEFAULT;
217 *PROPERTY_SOURCE_DETECTED = *Amanda::Devicec::PROPERTY_SOURCE_DETECTED;
218 *PROPERTY_SOURCE_USER = *Amanda::Devicec::PROPERTY_SOURCE_USER;
225 Amanda::Device - interact with Amanda data-storage devices
229 use Amanda::Device qw( :constants );
231 my $dev = Amanda::Device->new($device_name);
232 if ($dev->read_label() == $DEVICE_STATUS_SUCCESS) {
233 print "Label on $device_name is '$dev->volume_label'\n";
236 See http://wiki.zmanda.com/index.php/Device_API for details on how Devices are used.
242 =head1 Amanda::Device Objects
244 See the wiki for descriptions of these functions. Note that C instance variables
245 are represented by accessor functions of the same name.
249 =item C<configure($use_global_config)>
251 =item C<read_label()>
253 =item C<start($mode, $label, $timestamp)>
257 =item C<start_file($jobinfo)>
259 where C<$jobinfo> is a C<dumpfile_t> (see L<Amanda::Types>)
261 =item C<write_block($size, $data, $short_block)>
263 Note that Perl code is not expected to handle on-device data, so there
264 is currently no way to provide data to this function from Perl. This may
265 change in future revisions.
267 =item C<write_from_fd($queue_fd)>
269 where C<$fd> is an integer file descriptor, not a filehandle
271 =item C<finish_file()>
273 =item C<seek_file($file)>
275 =item C<seek_block($block)>
277 =item C<read_block($size)>
279 =item C<read_to_fd($queue_fd)>
281 where C<$fd> is an integer file descriptor, not a filehandle
283 Note that Perl code is not expected to handle on-device data, so there
284 is currently no way to access the data this function returns. This may
285 change in future revisions.
287 =item C<property_list()>
289 returns a list of properties, each represented as a hash:
291 { 'access' => $access_flags,
292 'name' => $property_name,
293 'description' => $property_description }
295 =item C<property_get($property_name)>
297 returns the property, with the appropriate Perl type, or undef. In array
298 context, returns the list C<($value, $surety, $source)>.
300 =item C<property_set($property_name, $value)>
302 =item C<property_set_ex($property_name, $value, $surety, $source)>
304 where C<$value> is of an appropriate type for the given property, C<$surety> is
305 a C<$PROPERTY_SURETY_*> constant, and C<$source> is a C<$PROPERTY_SOURCE_*>
308 =item C<recycle_file($filenum)>
310 =item C<file()> (accessor function)
312 =item C<block()> (accessor function)
314 =item C<in_file()> (accessor function)
316 =item C<device_name()> (accessor function)
318 =item C<access_mode()> (accessor function)
320 =item C<is_eof()> (accessor function)
322 =item C<volume_label()> (accessor function)
324 =item C<volume_time()> (accessor function)
326 =item C<min_block_size()> (accessor function)
328 =item C<max_block_size()> (accessor function)
330 =item C<block_size()> (accessor function)
332 =item C<volume_header()> (accessor function)
338 This module defines a large number of constants. Again, consult the
339 wiki or C<device.h> for the details on their meaning. These constants
340 are available from the package namespace (e.g.,
341 C<Amanda::Device::ACCESS_WRITE>), or imported with the C<:constant>
346 push @EXPORT_OK, qw(DeviceAccessMode_to_strings);
347 push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw(DeviceAccessMode_to_strings);
349 my %_DeviceAccessMode_VALUES;
350 #Convert a flag value to a list of names for flags that are set.
351 sub DeviceAccessMode_to_strings {
355 for my $k (keys %_DeviceAccessMode_VALUES) {
356 my $v = $_DeviceAccessMode_VALUES{$k};
358 #is this a matching flag?
359 if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
364 #by default, just return the number as a 1-element list
372 push @EXPORT_OK, qw($ACCESS_NULL);
373 push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_NULL);
375 $_DeviceAccessMode_VALUES{"NULL"} = $ACCESS_NULL;
377 push @EXPORT_OK, qw($ACCESS_READ);
378 push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_READ);
380 $_DeviceAccessMode_VALUES{"READ"} = $ACCESS_READ;
382 push @EXPORT_OK, qw($ACCESS_WRITE);
383 push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_WRITE);
385 $_DeviceAccessMode_VALUES{"WRITE"} = $ACCESS_WRITE;
387 push @EXPORT_OK, qw($ACCESS_APPEND);
388 push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw($ACCESS_APPEND);
390 $_DeviceAccessMode_VALUES{"APPEND"} = $ACCESS_APPEND;
392 push @EXPORT_OK, qw(IS_WRITABLE_ACCESS_MODE);
393 push @{$EXPORT_TAGS{"DeviceAccessMode"}}, qw(IS_WRITABLE_ACCESS_MODE);
395 #copy symbols in DeviceAccessMode to constants
396 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"DeviceAccessMode"}};
398 push @EXPORT_OK, qw(DeviceStatusFlags_to_strings);
399 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw(DeviceStatusFlags_to_strings);
401 my %_DeviceStatusFlags_VALUES;
402 #Convert a flag value to a list of names for flags that are set.
403 sub DeviceStatusFlags_to_strings {
407 for my $k (keys %_DeviceStatusFlags_VALUES) {
408 my $v = $_DeviceStatusFlags_VALUES{$k};
410 #is this a matching flag?
411 if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
416 #by default, just return the number as a 1-element list
424 push @EXPORT_OK, qw($DEVICE_STATUS_SUCCESS);
425 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_SUCCESS);
427 $_DeviceStatusFlags_VALUES{"SUCCESS"} = $DEVICE_STATUS_SUCCESS;
429 push @EXPORT_OK, qw($DEVICE_STATUS_DEVICE_ERROR);
430 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_DEVICE_ERROR);
432 $_DeviceStatusFlags_VALUES{"DEVICE_ERROR"} = $DEVICE_STATUS_DEVICE_ERROR;
434 push @EXPORT_OK, qw($DEVICE_STATUS_DEVICE_BUSY);
435 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_DEVICE_BUSY);
437 $_DeviceStatusFlags_VALUES{"DEVICE_BUSY"} = $DEVICE_STATUS_DEVICE_BUSY;
439 push @EXPORT_OK, qw($DEVICE_STATUS_VOLUME_MISSING);
440 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_VOLUME_MISSING);
442 $_DeviceStatusFlags_VALUES{"VOLUME_MISSING"} = $DEVICE_STATUS_VOLUME_MISSING;
444 push @EXPORT_OK, qw($DEVICE_STATUS_VOLUME_UNLABELED);
445 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_VOLUME_UNLABELED);
447 $_DeviceStatusFlags_VALUES{"VOLUME_UNLABELED"} = $DEVICE_STATUS_VOLUME_UNLABELED;
449 push @EXPORT_OK, qw($DEVICE_STATUS_VOLUME_ERROR);
450 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_VOLUME_ERROR);
452 $_DeviceStatusFlags_VALUES{"VOLUME_ERROR"} = $DEVICE_STATUS_VOLUME_ERROR;
454 push @EXPORT_OK, qw($DEVICE_STATUS_FLAGS_MAX);
455 push @{$EXPORT_TAGS{"DeviceStatusFlags"}}, qw($DEVICE_STATUS_FLAGS_MAX);
457 #copy symbols in DeviceStatusFlags to constants
458 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"DeviceStatusFlags"}};
460 push @EXPORT_OK, qw(PropertyPhaseFlags_to_strings);
461 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw(PropertyPhaseFlags_to_strings);
463 my %_PropertyPhaseFlags_VALUES;
464 #Convert a flag value to a list of names for flags that are set.
465 sub PropertyPhaseFlags_to_strings {
469 for my $k (keys %_PropertyPhaseFlags_VALUES) {
470 my $v = $_PropertyPhaseFlags_VALUES{$k};
472 #is this a matching flag?
473 if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
478 #by default, just return the number as a 1-element list
486 push @EXPORT_OK, qw($PROPERTY_PHASE_BEFORE_START);
487 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_BEFORE_START);
489 $_PropertyPhaseFlags_VALUES{"BEFORE_START"} = $PROPERTY_PHASE_BEFORE_START;
491 push @EXPORT_OK, qw($PROPERTY_PHASE_BETWEEN_FILE_WRITE);
492 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_BETWEEN_FILE_WRITE);
494 $_PropertyPhaseFlags_VALUES{"BETWEEN_FILE_WRITE"} = $PROPERTY_PHASE_BETWEEN_FILE_WRITE;
496 push @EXPORT_OK, qw($PROPERTY_PHASE_INSIDE_FILE_WRITE);
497 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_INSIDE_FILE_WRITE);
499 $_PropertyPhaseFlags_VALUES{"INSIDE_FILE_WRITE"} = $PROPERTY_PHASE_INSIDE_FILE_WRITE;
501 push @EXPORT_OK, qw($PROPERTY_PHASE_BETWEEN_FILE_READ);
502 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_BETWEEN_FILE_READ);
504 $_PropertyPhaseFlags_VALUES{"BETWEEN_FILE_READ"} = $PROPERTY_PHASE_BETWEEN_FILE_READ;
506 push @EXPORT_OK, qw($PROPERTY_PHASE_INSIDE_FILE_READ);
507 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_INSIDE_FILE_READ);
509 $_PropertyPhaseFlags_VALUES{"INSIDE_FILE_READ"} = $PROPERTY_PHASE_INSIDE_FILE_READ;
511 push @EXPORT_OK, qw($PROPERTY_PHASE_MAX);
512 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_MAX);
514 push @EXPORT_OK, qw($PROPERTY_PHASE_MASK);
515 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_MASK);
517 push @EXPORT_OK, qw($PROPERTY_PHASE_SHIFT);
518 push @{$EXPORT_TAGS{"PropertyPhaseFlags"}}, qw($PROPERTY_PHASE_SHIFT);
520 #copy symbols in PropertyPhaseFlags to constants
521 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"PropertyPhaseFlags"}};
523 push @EXPORT_OK, qw(PropertyAccessFlags_to_strings);
524 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw(PropertyAccessFlags_to_strings);
526 my %_PropertyAccessFlags_VALUES;
527 #Convert a flag value to a list of names for flags that are set.
528 sub PropertyAccessFlags_to_strings {
532 for my $k (keys %_PropertyAccessFlags_VALUES) {
533 my $v = $_PropertyAccessFlags_VALUES{$k};
535 #is this a matching flag?
536 if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
541 #by default, just return the number as a 1-element list
549 push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_BEFORE_START);
550 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_BEFORE_START);
552 $_PropertyAccessFlags_VALUES{"GET_BEFORE_START"} = $PROPERTY_ACCESS_GET_BEFORE_START;
554 push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE);
555 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE);
557 $_PropertyAccessFlags_VALUES{"GET_BETWEEN_FILE_WRITE"} = $PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE;
559 push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE);
560 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE);
562 $_PropertyAccessFlags_VALUES{"GET_INSIDE_FILE_WRITE"} = $PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE;
564 push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_READ);
565 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_BETWEEN_FILE_READ);
567 $_PropertyAccessFlags_VALUES{"GET_BETWEEN_FILE_READ"} = $PROPERTY_ACCESS_GET_BETWEEN_FILE_READ;
569 push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_READ);
570 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_INSIDE_FILE_READ);
572 $_PropertyAccessFlags_VALUES{"GET_INSIDE_FILE_READ"} = $PROPERTY_ACCESS_GET_INSIDE_FILE_READ;
574 push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_BEFORE_START);
575 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_BEFORE_START);
577 $_PropertyAccessFlags_VALUES{"SET_BEFORE_START"} = $PROPERTY_ACCESS_SET_BEFORE_START;
579 push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE);
580 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE);
582 $_PropertyAccessFlags_VALUES{"SET_BETWEEN_FILE_WRITE"} = $PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE;
584 push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE);
585 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE);
587 $_PropertyAccessFlags_VALUES{"SET_INSIDE_FILE_WRITE"} = $PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE;
589 push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_READ);
590 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_BETWEEN_FILE_READ);
592 $_PropertyAccessFlags_VALUES{"SET_BETWEEN_FILE_READ"} = $PROPERTY_ACCESS_SET_BETWEEN_FILE_READ;
594 push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_READ);
595 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_INSIDE_FILE_READ);
597 $_PropertyAccessFlags_VALUES{"SET_INSIDE_FILE_READ"} = $PROPERTY_ACCESS_SET_INSIDE_FILE_READ;
599 push @EXPORT_OK, qw($PROPERTY_ACCESS_GET_MASK);
600 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_GET_MASK);
602 push @EXPORT_OK, qw($PROPERTY_ACCESS_SET_MASK);
603 push @{$EXPORT_TAGS{"PropertyAccessFlags"}}, qw($PROPERTY_ACCESS_SET_MASK);
605 #copy symbols in PropertyAccessFlags to constants
606 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"PropertyAccessFlags"}};
608 push @EXPORT_OK, qw(ConcurrencyParadigm_to_string);
609 push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw(ConcurrencyParadigm_to_string);
611 my %_ConcurrencyParadigm_VALUES;
612 #Convert an enum value to a single string
613 sub ConcurrencyParadigm_to_string {
616 for my $k (keys %_ConcurrencyParadigm_VALUES) {
617 my $v = $_ConcurrencyParadigm_VALUES{$k};
619 #is this a matching flag?
620 if ($enumval == $v) {
625 #default, just return the number
629 push @EXPORT_OK, qw($CONCURRENCY_PARADIGM_EXCLUSIVE);
630 push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw($CONCURRENCY_PARADIGM_EXCLUSIVE);
632 $_ConcurrencyParadigm_VALUES{"EXCLUSIVE"} = $CONCURRENCY_PARADIGM_EXCLUSIVE;
634 push @EXPORT_OK, qw($CONCURRENCY_PARADIGM_SHARED_READ);
635 push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw($CONCURRENCY_PARADIGM_SHARED_READ);
637 $_ConcurrencyParadigm_VALUES{"SHARED_READ"} = $CONCURRENCY_PARADIGM_SHARED_READ;
639 push @EXPORT_OK, qw($CONCURRENCY_PARADIGM_RANDOM_ACCESS);
640 push @{$EXPORT_TAGS{"ConcurrencyParadigm"}}, qw($CONCURRENCY_PARADIGM_RANDOM_ACCESS);
642 $_ConcurrencyParadigm_VALUES{"RANDOM_ACCESS"} = $CONCURRENCY_PARADIGM_RANDOM_ACCESS;
644 #copy symbols in ConcurrencyParadigm to constants
645 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"ConcurrencyParadigm"}};
647 push @EXPORT_OK, qw(StreamingRequirement_to_string);
648 push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw(StreamingRequirement_to_string);
650 my %_StreamingRequirement_VALUES;
651 #Convert an enum value to a single string
652 sub StreamingRequirement_to_string {
655 for my $k (keys %_StreamingRequirement_VALUES) {
656 my $v = $_StreamingRequirement_VALUES{$k};
658 #is this a matching flag?
659 if ($enumval == $v) {
664 #default, just return the number
668 push @EXPORT_OK, qw($STREAMING_REQUIREMENT_NONE);
669 push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw($STREAMING_REQUIREMENT_NONE);
671 $_StreamingRequirement_VALUES{"NONE"} = $STREAMING_REQUIREMENT_NONE;
673 push @EXPORT_OK, qw($STREAMING_REQUIREMENT_DESIRED);
674 push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw($STREAMING_REQUIREMENT_DESIRED);
676 $_StreamingRequirement_VALUES{"DESIRED"} = $STREAMING_REQUIREMENT_DESIRED;
678 push @EXPORT_OK, qw($STREAMING_REQUIREMENT_REQUIRED);
679 push @{$EXPORT_TAGS{"StreamingRequirement"}}, qw($STREAMING_REQUIREMENT_REQUIRED);
681 $_StreamingRequirement_VALUES{"REQUIRED"} = $STREAMING_REQUIREMENT_REQUIRED;
683 #copy symbols in StreamingRequirement to constants
684 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"StreamingRequirement"}};
686 push @EXPORT_OK, qw(MediaAccessMode_to_string);
687 push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw(MediaAccessMode_to_string);
689 my %_MediaAccessMode_VALUES;
690 #Convert an enum value to a single string
691 sub MediaAccessMode_to_string {
694 for my $k (keys %_MediaAccessMode_VALUES) {
695 my $v = $_MediaAccessMode_VALUES{$k};
697 #is this a matching flag?
698 if ($enumval == $v) {
703 #default, just return the number
707 push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_READ_ONLY);
708 push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_READ_ONLY);
710 $_MediaAccessMode_VALUES{"READ_ONLY"} = $MEDIA_ACCESS_MODE_READ_ONLY;
712 push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_WORM);
713 push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_WORM);
715 $_MediaAccessMode_VALUES{"WORM"} = $MEDIA_ACCESS_MODE_WORM;
717 push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_READ_WRITE);
718 push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_READ_WRITE);
720 $_MediaAccessMode_VALUES{"READ_WRITE"} = $MEDIA_ACCESS_MODE_READ_WRITE;
722 push @EXPORT_OK, qw($MEDIA_ACCESS_MODE_WRITE_ONLY);
723 push @{$EXPORT_TAGS{"MediaAccessMode"}}, qw($MEDIA_ACCESS_MODE_WRITE_ONLY);
725 $_MediaAccessMode_VALUES{"WRITE_ONLY"} = $MEDIA_ACCESS_MODE_WRITE_ONLY;
727 #copy symbols in MediaAccessMode to constants
728 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"MediaAccessMode"}};
730 push @EXPORT_OK, qw(SizeAccuracy_to_string);
731 push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw(SizeAccuracy_to_string);
733 my %_SizeAccuracy_VALUES;
734 #Convert an enum value to a single string
735 sub SizeAccuracy_to_string {
738 for my $k (keys %_SizeAccuracy_VALUES) {
739 my $v = $_SizeAccuracy_VALUES{$k};
741 #is this a matching flag?
742 if ($enumval == $v) {
747 #default, just return the number
751 push @EXPORT_OK, qw($SIZE_ACCURACY_UNKNOWN);
752 push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_UNKNOWN);
754 $_SizeAccuracy_VALUES{"UNKNOWN"} = $SIZE_ACCURACY_UNKNOWN;
756 push @EXPORT_OK, qw($SIZE_ACCURACY_ESTIMATE);
757 push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_ESTIMATE);
759 $_SizeAccuracy_VALUES{"ESTIMATE"} = $SIZE_ACCURACY_ESTIMATE;
761 push @EXPORT_OK, qw($SIZE_ACCURACY_REAL);
762 push @{$EXPORT_TAGS{"SizeAccuracy"}}, qw($SIZE_ACCURACY_REAL);
764 $_SizeAccuracy_VALUES{"REAL"} = $SIZE_ACCURACY_REAL;
766 #copy symbols in SizeAccuracy to constants
767 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"SizeAccuracy"}};
769 push @EXPORT_OK, qw(PropertySurety_to_strings);
770 push @{$EXPORT_TAGS{"PropertySurety"}}, qw(PropertySurety_to_strings);
772 my %_PropertySurety_VALUES;
773 #Convert a flag value to a list of names for flags that are set.
774 sub PropertySurety_to_strings {
778 for my $k (keys %_PropertySurety_VALUES) {
779 my $v = $_PropertySurety_VALUES{$k};
781 #is this a matching flag?
782 if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
787 #by default, just return the number as a 1-element list
795 push @EXPORT_OK, qw($PROPERTY_SURETY_BAD);
796 push @{$EXPORT_TAGS{"PropertySurety"}}, qw($PROPERTY_SURETY_BAD);
798 $_PropertySurety_VALUES{"SURETY_BAD"} = $PROPERTY_SURETY_BAD;
800 push @EXPORT_OK, qw($PROPERTY_SURETY_GOOD);
801 push @{$EXPORT_TAGS{"PropertySurety"}}, qw($PROPERTY_SURETY_GOOD);
803 $_PropertySurety_VALUES{"SURETY_GOOD"} = $PROPERTY_SURETY_GOOD;
805 #copy symbols in PropertySurety to constants
806 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"PropertySurety"}};
808 push @EXPORT_OK, qw(PropertySource_to_strings);
809 push @{$EXPORT_TAGS{"PropertySource"}}, qw(PropertySource_to_strings);
811 my %_PropertySource_VALUES;
812 #Convert a flag value to a list of names for flags that are set.
813 sub PropertySource_to_strings {
817 for my $k (keys %_PropertySource_VALUES) {
818 my $v = $_PropertySource_VALUES{$k};
820 #is this a matching flag?
821 if (($v == 0 && $flags == 0) || ($v != 0 && ($flags & $v) == $v)) {
826 #by default, just return the number as a 1-element list
834 push @EXPORT_OK, qw($PROPERTY_SOURCE_DEFAULT);
835 push @{$EXPORT_TAGS{"PropertySource"}}, qw($PROPERTY_SOURCE_DEFAULT);
837 $_PropertySource_VALUES{"SOURCE_DEFAULT"} = $PROPERTY_SOURCE_DEFAULT;
839 push @EXPORT_OK, qw($PROPERTY_SOURCE_DETECTED);
840 push @{$EXPORT_TAGS{"PropertySource"}}, qw($PROPERTY_SOURCE_DETECTED);
842 $_PropertySource_VALUES{"SOURCE_DETECTED"} = $PROPERTY_SOURCE_DETECTED;
844 push @EXPORT_OK, qw($PROPERTY_SOURCE_USER);
845 push @{$EXPORT_TAGS{"PropertySource"}}, qw($PROPERTY_SOURCE_USER);
847 $_PropertySource_VALUES{"SOURCE_USER"} = $PROPERTY_SOURCE_USER;
849 #copy symbols in PropertySource to constants
850 push @{$EXPORT_TAGS{"constants"}}, @{$EXPORT_TAGS{"PropertySource"}};
853 # SWIG produces a sub-package for the Device "class", in this case named
854 # Amanda::Device::Device. For user convenience, we allow Amanda::Device->new(..) to
855 # do the same thing. This is a wrapper function, and not just a typeglob assignment,
856 # because we want to get the right blessing.
859 Amanda::Device::Device->new(@_);