use-slots is a property, each property is an array.
You should do something like:
$properties = changer_config_getconf($ss, $CHANGER_CONFIG_PROPERTY);
#get all properties
@slot_range = $properties->{'use-slots'}; #get 'use-slots' property
You must then use the first element of the @slot_range array.
Jean-louis
Dustin J. Mitchell wrote:
First, I'm excited you're using the modules, and thanks for the feedback!
On Wed, Jun 16, 2010 at 11:50 AM, Jean-Francois Malouin
<[email protected]> wrote:
Using Amanda::Config.pm as an example I tried:
config_init($CONFIG_INIT_EXPLICIT_NAME, "Config_Name");
$ss = lookup_changer_config("av48");
$slot_range = changer_config_getconf($ss, "use-slots");
but that obviously fails. Notice my lack of perl-fu :)
I think the only missing aspect in the above is that instead of
"use-slots", you'll need to use $CHANGER_CONFIG_USE_SLOTS, which is
available with
use Amanda::Config qw( :constants );
I didn't document these constants in the POD because there's no
automatic way to make sure that conffile.c/h and the POD will stay in
sync, and we're fabulously bad at remembering to update the same thing
in two places. They're all available and pretty readable in
common-src/conffile.h.
It occurs to me that the necessary string tables exist to also make
things work the way you've expected them to work. Unless there's s
SWIG expert in the crowd (where's Dave Beazley when you need him?) who
wants to take a swing at that, I'll see what I can cook up.
There seems to be a few typos in the pod for Config.pm btw.
Patches and/or specific pointers would be welcome!
http://wiki.zmanda.com/index.php/Fork_Amanda_on_Github
Dustin