X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Famtape.c;h=365c1af73bd0c04b9c21e205ec8ab05a4b10cae9;hb=c489fc6ad53e4658722b7f63fb40edc6f53c57a9;hp=3465e7ffdb958923e3f4c6b59a087b59d3632975;hpb=bde83ad58d800ae004caccab6531234272181da2;p=debian%2Famanda diff --git a/server-src/amtape.c b/server-src/amtape.c index 3465e7f..365c1af 100644 --- a/server-src/amtape.c +++ b/server-src/amtape.c @@ -24,161 +24,161 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: amtape.c,v 1.22.2.6.4.5.2.4.2.1 2005/09/20 21:31:52 jrjackson Exp $ + * $Id: amtape.c,v 1.47 2006/07/25 18:27:57 martinea Exp $ * * tape changer interface program */ #include "amanda.h" #include "conffile.h" #include "tapefile.h" -#include "tapeio.h" +#include "taperscan.h" #include "clock.h" #include "changer.h" #include "version.h" +#include "device.h" +#include "timestamp.h" /* local functions */ -void usage P((void)); -int main P((int argc, char **argv)); -void reset_changer P((int argc, char **argv)); -void eject_tape P((int argc, char **argv)); -void clean_tape P((int argc, char **argv)); -void load_slot P((int argc, char **argv)); -void load_label P((int argc, char **argv)); -void show_slots P((int argc, char **argv)); -void show_current P((int argc, char **argv)); -void taper_scan P((int argc, char **argv)); -void show_device P((int argc, char **argv)); -int scan_init P((int rc, int ns, int bk)); -int loadlabel_slot P((int rc, char *slotstr, char *device)); -int show_init P((int rc, int ns, int bk)); -int show_init_all P((int rc, int ns, int bk)); -int show_init_current P((int rc, int ns, int bk)); -int show_slot P((int rc, char *slotstr, char *device)); -int taperscan_slot P((int rc, char *slotstr, char *device)); -int update_one_slot P((int rc, char *slotstr, char *device)); -void update_labeldb P((int argc, char **argv)); - -void usage() +static void usage(void); +int main(int argc, char **argv); +static void reset_changer(int argc, char **argv); +static void eject_tape(int argc, char **argv); +static void clean_tape(int argc, char **argv); +static void load_slot(int argc, char **argv); +static void load_label(int argc, char **argv); +static void show_slots(int argc, char **argv); +static void show_current(int argc, char **argv); +static void amtape_taper_scan(int argc, char **argv); +static void show_device(int argc, char **argv); +static int loadlabel_slot(void *ud, int rc, char *slotstr, char *device); +int show_init(void *ud, int rc, int ns, int bk, int s); +static int show_slots_slot(void *ud, int rc, char *slotstr, char *device); + +static const struct { + const char *name; + void (*fn)(int, char **); + const char *usage; +} cmdtab[] = { + { "reset", reset_changer, + T_("reset Reset changer to known state") }, + { "eject", eject_tape, + T_("eject Eject current tape from drive") }, + { "clean", clean_tape, + T_("clean Clean the drive") }, + { "show", show_slots, + T_("show Show contents of all slots") }, + { "current", show_current, + T_("current Show contents of current slot") }, + { "slot" , load_slot, + T_("slot load tape from slot ") }, + { "slot" , load_slot, + T_("slot current load tape from current slot") }, + { "slot" , load_slot, + T_("slot next load tape from next slot") }, + { "slot" , load_slot, + T_("slot advance advance to next slot but do not load") }, + { "slot" , load_slot, + T_("slot first load tape from first slot") }, + { "label", load_label, + T_("label