-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 <slot #> load tape from slot <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 <label> find and load labeled tape") },
+ { "taper", amtape_taper_scan,
+ T_("taper perform taper's scan alg.") },
+ { "device", show_device,
+ T_("device show current tape device") },
+ { "update", show_slots,
+ T_("update update the label matchingdatabase")},
+};
+#define NCMDS (int)(sizeof(cmdtab) / sizeof(cmdtab[0]))
+
+static void
+usage(void)