strlcpy restricted to array length.
[openafs.git] / src / scout / scout.c
index 47b4cbc..e474662 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
+#include <roken.h>
+#include <opr/softsig.h>
 
 #undef IN
-#ifdef AFS_AIX32_ENV
-#include <signal.h>
-#endif
+#include <afs/gtxwindows.h>            /*Generic window package */
+#include <afs/gtxobjects.h>            /*Object definitions */
+#include <afs/gtxtextobj.h>            /*Text object interface */
+#include <afs/gtxlightobj.h>   /*Light object interface */
+#include <afs/gtxcurseswin.h>  /*Curses window package */
+#include <afs/gtxdumbwin.h>            /*Dumb terminal window package */
+#include <afs/gtxX11win.h>             /*X11 window package */
+#include <afs/gtxframe.h>              /*Frame package */
+#include <afs/gtxinput.h>
+#include <afs/cmd.h>           /*Command interpretation library */
+#include <afs/fsprobe.h>               /*Interface for fsprobe module */
+#include <afs/afsutil.h>
+
 #include <string.h>
-#undef IN
-#include <gtxwindows.h>                /*Generic window package */
-#include <gtxobjects.h>                /*Object definitions */
-#include <gtxtextobj.h>                /*Text object interface */
-#include <gtxlightobj.h>       /*Light object interface */
-#include <gtxcurseswin.h>      /*Curses window package */
-#include <gtxdumbwin.h>                /*Dumb terminal window package */
-#include <gtxX11win.h>         /*X11 window package */
-#include <gtxframe.h>          /*Frame package */
-#include <stdio.h>             /*Standard I/O stuff */
-#include <cmd.h>               /*Command interpretation library */
-#include <fsprobe.h>           /*Interface for fsprobe module */
-#include <errno.h>
-
-
-extern struct hostent *hostutil_GetHostByName();
-extern int gtx_InputServer();
-extern int gethostname();
 
 /*
  * Command line parameter indicies.
  */
 #define P_SERVER    0
 #define P_BASE     1
-#if 0
-#define        P_PACKAGE   2
-#endif /* 0 */
 #define P_FREQ     2
 #define P_HOST     3
 #define P_ATTENTION 4
 #define        P_DEBUG     5
+#define        P_WIDTHS    6
 
 /*
-  * Define the width in chars for each light object on the mini-line.
+  * Define the default width in chars for each light object on the mini-line.
   */
 #define LIGHTOBJ_CONN_WIDTH     5
 #define LIGHTOBJ_FETCH_WIDTH   10
@@ -65,6 +55,16 @@ extern int gethostname();
 #define LIGHTOBJ_DISK_WIDTH    12
 
 /*
+ * Define column width indices.
+ */
+#define COL_CONN       0
+#define COL_FETCH      1
+#define COL_STORE      2
+#define COL_WK         3
+#define COL_SRVNAME    4
+#define COL_DISK       5
+
+/*
  * Define the types of justification we can perform.
  */
 #define SCOUT_RIGHT_JUSTIFY    0
@@ -159,6 +159,14 @@ static struct onode *scout_banner2_lp;     /*Banner light, line 2 */
 static int scout_DiskLightLeftCol = 0; /*Column for leftmost disk light */
 static struct gwin_sizeparams scout_frameDims; /*Frame dimensions */
 
+static int scout_col_width[] = { LIGHTOBJ_CONN_WIDTH,
+    LIGHTOBJ_FETCH_WIDTH,
+    LIGHTOBJ_STORE_WIDTH,
+    LIGHTOBJ_WK_WIDTH,
+    LIGHTOBJ_SRVNAME_WIDTH,
+    LIGHTOBJ_DISK_WIDTH
+};
+
 /*
   * Attention thresholds & modes.
   */
@@ -179,10 +187,10 @@ static char scout_attn_disk_pcusedstr[8] = "95";
   * Some strings we'll be using over and over again.
   */
 static char scout_Banner[256];
-static char scout_LightLabels[] =
-    "Conn      Fetch      Store    Ws                Disk attn:";
-static char scout_LightLabelUnd[] =
-    "----   --------   -------- -----                ----------";
+static const char *scout_label[] =
+    { "Conn", "Fetch", "Store", "Ws", "", "Disk attn" };
+static const char *scout_underline[] =
+    { "----", "--------", "--------", "-----", "", "----------" };
 
 
 /*------------------------------------------------------------------------
@@ -202,16 +210,14 @@ static char scout_LightLabelUnd[] =
  *     Void.
  *
  * Environment:
- *     Actions depend on scout_gtx_initialized.  
+ *     Actions depend on scout_gtx_initialized.
  *
  * Side Effects:
  *     This routine will always exit Scout.
  *------------------------------------------------------------------------*/
 
 static void
-scout_CleanExit(a_exitval)
-     int a_exitval;
-
+scout_CleanExit(int a_exitval)
 {                              /*scout_CleanExit */
 
     static char rn[] = "scout_CleanExit";      /*Routine name */
@@ -223,7 +229,7 @@ scout_CleanExit(a_exitval)
 
     if (scout_gtx_initialized) {
        gtxframe_exitValue = a_exitval;
-       gtxframe_ExitCmd((char *)(&gtxframe_exitValue));
+       gtxframe_ExitCmd((void *)(&gtxframe_exitValue), NULL);
     } else
        exit(a_exitval);
 
@@ -255,20 +261,13 @@ scout_CleanExit(a_exitval)
  *------------------------------------------------------------------------*/
 
 static struct onode *
-mini_initLightObject(a_name, a_x, a_y, a_width, a_win)
-     char *a_name;
-     int a_x;
-     int a_y;
-     int a_width;
-     struct gwin *a_win;
-
+mini_initLightObject(char *a_name, int a_x, int a_y, int a_width, struct gwin *a_win)
 {                              /*mini_initLightObject */
 
     static char rn[] = "mini_initLightObject"; /*Routine name */
     struct onode *newlightp;   /*Ptr to new light onode */
     /*We only support curses right now */
     struct gator_light_crparams light_crparams;        /*Light creation params */
-    char *truncname;           /*Truncated name, if needed */
     int name_len;              /*True length of name */
 
     if (scout_debug) {
@@ -288,18 +287,14 @@ mini_initLightObject(a_name, a_x, a_y, a_width, a_win)
     if (scout_debug)
        fprintf(scout_debugfd, "[%s] Name '%s' has %d chars\n", rn, a_name,
                name_len);
-    if (name_len <= a_width)
-       sprintf(light_crparams.onode_params.cr_name, "%s", a_name);
-    else {
-       /*
-        * We need to truncate the given name, leaving a `*' at the end to
-        * show us it's been truncated.
-        */
-       truncname = light_crparams.onode_params.cr_name;
-       strncpy(truncname, a_name, a_width - 1);
-       truncname[a_width - 1] = '*';
-       truncname[a_width] = 0;
-    }
+
+    if (a_width >= sizeof(light_crparams.onode_params.cr_name))
+       a_width = sizeof(light_crparams.onode_params.cr_name) - 1;
+
+    if (strlcpy(light_crparams.onode_params.cr_name, a_name, a_width + 1) >= a_width + 1)
+       /* The name is truncated, put a '*' at the end to note */
+       light_crparams.onode_params.cr_name[a_width - 1] = '*';
+
     light_crparams.onode_params.cr_x = a_x;
     light_crparams.onode_params.cr_y = a_y;
     light_crparams.onode_params.cr_width = a_width;
@@ -349,10 +344,7 @@ mini_initLightObject(a_name, a_x, a_y, a_width, a_win)
  *------------------------------------------------------------------------*/
 
 static int
-scout_initDiskLightObjects(a_line, a_win)
-     struct mini_line *a_line;
-     struct gwin *a_win;
-
+scout_initDiskLightObjects(struct mini_line *a_line, struct gwin *a_win)
 {                              /*scout_initDiskLightObjects */
 
     static char rn[] = "scout_initDiskLightObjects";   /*Routine name */
@@ -384,7 +376,7 @@ scout_initDiskLightObjects(a_line, a_win)
        if ((curr_disk->disk_lp = mini_initLightObject("Disk",  /*Object name */
                                                       0,       /*X value */
                                                       0,       /*Y value */
-                                                      LIGHTOBJ_DISK_WIDTH,     /*Width */
+                                                      scout_col_width[COL_DISK],       /*Width */
                                                       a_win))  /*Window */
            == NULL) {
            fprintf(stderr, "[%s:%s] Can't create disk %d light object\n", pn,
@@ -400,7 +392,7 @@ scout_initDiskLightObjects(a_line, a_win)
        curr_disk->prev = i - 1;
        curr_disk->next = i + 1;
        curr_disk->active = 0;
-       curr_disk->name = '\0';
+       curr_disk->name = "";
 
        /*
         * Bump up to the next disk structure.
@@ -454,15 +446,9 @@ scout_initDiskLightObjects(a_line, a_win)
  *------------------------------------------------------------------------*/
 
 int
-mini_justify(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc,
-            a_isLabeledDisk)
-     char *a_srcbuff;
-     char *a_dstbuff;
-     int a_dstwidth;
-     int a_justification;
-     int a_rightTrunc;
-     int a_isLabeledDisk;
-
+mini_justify(char *a_srcbuff, char *a_dstbuff, int a_dstwidth,
+            int a_justification, int a_rightTrunc,
+            int a_isLabeledDisk)
 {                              /*mini_justify */
 
     static char rn[] = "mini_justify"; /*Routine name */
@@ -470,7 +456,7 @@ mini_justify(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc,
     int num_src_chars;         /*# of chars in source */
     int true_num_src_chars;    /*# src chars before truncation */
     int trunc_needed;          /*Is truncation needed? */
-    char diskChar;             /*Disk name prefix */
+    char diskChar = 0;         /*Disk name prefix */
 
     if (scout_debug) {
        fprintf(scout_debugfd, "[%s] Called with '%s', dest width=%d\n", rn,
@@ -593,13 +579,9 @@ mini_justify(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc,
  *------------------------------------------------------------------------*/
 
 static void
-scout_SetNonDiskLightLine(a_srvline, a_linenum)
-     struct mini_line *a_srvline;
-     int a_linenum;
-
+scout_SetNonDiskLightLine(struct mini_line *a_srvline, int a_linenum)
 {                              /*scout_SetNonDiskLightLine */
 
-    static char rn[] = "scout_SetNonDiskLightLine";    /*Routine name */
     struct gator_lightobj *nondisk_lightdata;  /*Non-disk light data field */
     struct gwin_strparams *nondisk_strparams;  /*Associated string params */
 
@@ -665,9 +647,7 @@ scout_SetNonDiskLightLine(a_srvline, a_linenum)
  *------------------------------------------------------------------------*/
 
 static int
-scout_RecomputeLightLocs(a_srvline)
-     struct mini_line *a_srvline;
-
+scout_RecomputeLightLocs(struct mini_line *a_srvline)
 {                              /*scout_RecomputeLightLocs */
 
     static char rn[] = "scout_RecomputeLightLocs";     /*Routine name */
@@ -690,18 +670,21 @@ scout_RecomputeLightLocs(a_srvline)
      * If we haven't yet computed the column for the leftmost disk light,
      * do it now.
      */
-    if (scout_DiskLightLeftCol == 0)
-       scout_DiskLightLeftCol =
-           LIGHTOBJ_CONN_WIDTH + LIGHTOBJ_FETCH_WIDTH +
-           LIGHTOBJ_STORE_WIDTH + LIGHTOBJ_WK_WIDTH +
-           LIGHTOBJ_SRVNAME_WIDTH + 5;
+    if (scout_DiskLightLeftCol == 0) {
+       int i;
+       int num_cols = sizeof(scout_col_width) / sizeof(*scout_col_width);
+       scout_DiskLightLeftCol = 0;
+       for (i = 0; i < (num_cols - 1); i++) {
+           scout_DiskLightLeftCol += scout_col_width[i] + 1;
+       }
+    }
 
     /*
      * Calculate how many disk light objects can fit in one line.
      */
     lights_per_line =
        (scout_frameDims.maxx -
-        scout_DiskLightLeftCol) / (LIGHTOBJ_DISK_WIDTH + 1);
+        scout_DiskLightLeftCol) / (scout_col_width[COL_DISK] + 1);
     if (scout_debug) {
        fprintf(scout_debugfd, "[%s] %d lights per line\n", rn,
                lights_per_line);
@@ -754,7 +737,7 @@ scout_RecomputeLightLocs(a_srvline)
         * light, if any.
         */
        lights_this_line++;
-       curr_x += LIGHTOBJ_DISK_WIDTH + 1;
+       curr_x += scout_col_width[COL_DISK] + 1;
        curr_idx = sc_disk[curr_idx].next;
 
     }                          /*Update each used disk light */
@@ -815,11 +798,7 @@ scout_RecomputeLightLocs(a_srvline)
  *------------------------------------------------------------------------*/
 
 static int
-scout_FindUsedDisk(a_diskname, a_srvline, a_record_added)
-     char *a_diskname;
-     struct mini_line *a_srvline;
-     int *a_record_added;
-
+scout_FindUsedDisk(char *a_diskname, struct mini_line *a_srvline, int *a_record_added)
 {                              /*scout_FindUsedDisk */
 
     static char rn[] = "scout_FindUsedDisk";   /*Routine name */
@@ -988,10 +967,7 @@ scout_FindUsedDisk(a_diskname, a_srvline, a_record_added)
  *------------------------------------------------------------------------*/
 
 static void
-scout_RemoveInactiveDisk(a_srvline, a_used_idx)
-     struct mini_line *a_srvline;
-     int a_used_idx;
-
+scout_RemoveInactiveDisk(struct mini_line *a_srvline, int a_used_idx)
 {                              /*scout_RemoveInactiveDisk */
 
     static char rn[] = "scout_RemoveInactiveDisk";     /*Routine name */
@@ -1033,18 +1009,13 @@ scout_RemoveInactiveDisk(a_srvline, a_used_idx)
  *------------------------------------------------------------------------*/
 
 static int
-mini_PrintDiskStats(a_srvline, a_stats, a_probeOK, a_width_changed,
-                   a_fix_line_num, a_delta_line_num)
-     struct mini_line *a_srvline;
-     struct ProbeViceStatistics *a_stats;
-     int a_probeOK;
-     int a_fix_line_num;
-     int a_delta_line_num;
-
+mini_PrintDiskStats(struct mini_line *a_srvline,
+                   struct ProbeViceStatistics *a_stats,
+                   int a_probeOK, int a_width_changed,
+                   int a_fix_line_num, int a_delta_line_num)
 {                              /*mini_PrintDiskStats */
 
     static char rn[] = "mini_PrintDiskStats";  /*Routine name */
-    int code;                  /*Return code */
     char s[128];               /*String buffer */
     struct onode *curr_disklight;      /*Ptr to current disk light */
     struct onode *srvname_light;       /*Ptr to server name light */
@@ -1100,13 +1071,13 @@ mini_PrintDiskStats(a_srvline, a_stats, a_probeOK, a_width_changed,
                        used_disk_idx, diskdata->label);
                fflush(scout_debugfd);
            }
-           code = mini_justify(" ",    /*Src buffer */
-                               diskdata->label,        /*Dest buffer */
-                               LIGHTOBJ_DISK_WIDTH,    /*Dest's width */
-                               SCOUT_RIGHT_JUSTIFY,    /*Right-justify */
-                               SCOUT_LEFT_TRUNC,       /*Left-truncate */
-                               SCOUT_ISNT_LDISK);      /*Not a labeled disk */
-           code = gator_light_set(curr_disklight, 0);
+           mini_justify(" ",   /*Src buffer */
+                        diskdata->label,       /*Dest buffer */
+                        scout_col_width[COL_DISK],     /*Dest's width */
+                        SCOUT_RIGHT_JUSTIFY,   /*Right-justify */
+                        SCOUT_LEFT_TRUNC,      /*Left-truncate */
+                        SCOUT_ISNT_LDISK);     /*Not a labeled disk */
+           gator_light_set(curr_disklight, 0);
            if (a_fix_line_num) {
                curr_disklight->o_y += a_delta_line_num;
                disk_strparams = (struct gwin_strparams *)(diskdata->llrock);
@@ -1139,7 +1110,6 @@ mini_PrintDiskStats(a_srvline, a_stats, a_probeOK, a_width_changed,
      * mark all used disk objects for this server as inactive and fix
      * their line numbers if needed.
      */
-    sc_disk = a_srvline->disks;
     used_disk_idx = a_srvline->used_head;
     while (used_disk_idx != SCOUT_NIL) {
        if (scout_debug) {
@@ -1164,7 +1134,7 @@ mini_PrintDiskStats(a_srvline, a_stats, a_probeOK, a_width_changed,
         * An AFS partition name must be prefixed by `/vicep`.
         */
        if (scout_debug) {
-           fprintf(scout_debugfd, "[%s] Disk stats at 0x%x for disk '%s'\n",
+           fprintf(scout_debugfd, "[%s] Disk stats at %p for disk '%s'\n",
                    rn, curr_diskstat, curr_diskstat->Name);
            fflush(scout_debugfd);
        }
@@ -1212,14 +1182,14 @@ mini_PrintDiskStats(a_srvline, a_stats, a_probeOK, a_width_changed,
                            rn, s, found_idx, diskdata->label);
                    fflush(scout_debugfd);
                }
-               code = mini_justify(s,  /*Src buffer */
-                                   diskdata->label,    /*Dest buffer */
-                                   LIGHTOBJ_DISK_WIDTH,        /*Dest's width */
-                                   SCOUT_LEFT_JUSTIFY, /*Left-justify */
-                                   SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                                   SCOUT_IS_LDISK);    /*Labeled disk */
+               mini_justify(s, /*Src buffer */
+                            diskdata->label,   /*Dest buffer */
+                            scout_col_width[COL_DISK], /*Dest's width */
+                            SCOUT_LEFT_JUSTIFY,        /*Left-justify */
+                            SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                            SCOUT_IS_LDISK);   /*Labeled disk */
 
-               code = gator_light_set(sc_disk->disk_lp, pastthreshold);
+               gator_light_set(sc_disk->disk_lp, pastthreshold);
 
            }                   /*Found disk record */
        }
@@ -1301,7 +1271,7 @@ mini_PrintDiskStats(a_srvline, a_stats, a_probeOK, a_width_changed,
  *------------------------------------------------------------------------*/
 
 int
-FS_Handler()
+FS_Handler(void)
 {                              /*FS_Handler */
 
     static char rn[] = "FS_Handler";   /*Routine name */
@@ -1351,7 +1321,6 @@ FS_Handler()
     curr_probeOK = fsprobe_Results.probeOK;
     curr_line_num = curr_line->base_line;
 
-    setting = 0;
     for (curr_srvidx = 0; curr_srvidx < scout_screen.numServers;
         curr_srvidx++) {
        /*
@@ -1376,56 +1345,56 @@ FS_Handler()
            sprintf(sp, "%d", curr_stats->CurrentConnections);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           LIGHTOBJ_CONN_WIDTH,        /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_CONN], /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_conn != SCOUT_ATTN_NOTUSED
            && curr_stats->CurrentConnections >= scout_attn_conn)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->currConns_lp, setting);
+       gator_light_set(curr_line->currConns_lp, setting);
 
        lightdata = (struct gator_lightobj *)(curr_line->fetches_lp->o_data);
        if (*curr_probeOK == 0) {
            sp = s;
-           sprintf(sp, "%d", curr_stats->TotalFetchs);
+           sprintf(sp, "%u", curr_stats->TotalFetchs);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           LIGHTOBJ_FETCH_WIDTH,       /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_FETCH],        /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_fetch != SCOUT_ATTN_NOTUSED
            && curr_stats->TotalFetchs >= scout_attn_fetch)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->fetches_lp, setting);
+       gator_light_set(curr_line->fetches_lp, setting);
 
        lightdata = (struct gator_lightobj *)(curr_line->stores_lp->o_data);
        if (*curr_probeOK == 0) {
            sp = s;
-           sprintf(sp, "%d", curr_stats->TotalStores);
+           sprintf(sp, "%u", curr_stats->TotalStores);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           LIGHTOBJ_STORE_WIDTH,       /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_STORE],        /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_store != SCOUT_ATTN_NOTUSED
            && curr_stats->TotalStores >= scout_attn_store)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->stores_lp, setting);
+       gator_light_set(curr_line->stores_lp, setting);
 
        lightdata =
            (struct gator_lightobj *)(curr_line->workstations_lp->o_data);
@@ -1434,18 +1403,18 @@ FS_Handler()
            sprintf(sp, "%d", curr_stats->WorkStations);
        } else
            sp = sblank;
-       code = mini_justify(sp, /*Src buffer */
-                           lightdata->label,   /*Dest buffer */
-                           LIGHTOBJ_WK_WIDTH,  /*Dest's width */
-                           SCOUT_RIGHT_JUSTIFY,        /*Right-justify */
-                           SCOUT_LEFT_TRUNC,   /*Left-truncate */
-                           SCOUT_ISNT_LDISK);  /*Not a labeled disk */
+       mini_justify(sp,        /*Src buffer */
+                    lightdata->label,  /*Dest buffer */
+                    scout_col_width[COL_WK],   /*Dest's width */
+                    SCOUT_RIGHT_JUSTIFY,       /*Right-justify */
+                    SCOUT_LEFT_TRUNC,  /*Left-truncate */
+                    SCOUT_ISNT_LDISK); /*Not a labeled disk */
        if (scout_attn_workstations != SCOUT_ATTN_NOTUSED
            && curr_stats->WorkStations >= scout_attn_workstations)
            setting = 1;
        else
            setting = 0;
-       code = gator_light_set(curr_line->workstations_lp, setting);
+       gator_light_set(curr_line->workstations_lp, setting);
 
        /*
         * We turn the server light on if there was an error in the
@@ -1453,7 +1422,7 @@ FS_Handler()
         * (Don't forget to fix the light's line if it needs it).
         */
        setting = (*curr_probeOK) ? 1 : 0;
-       code = gator_light_set(curr_line->srvName_lp, setting);
+       gator_light_set(curr_line->srvName_lp, setting);
 
        /*
         * Print out the disk statistics.  The value returned is the
@@ -1521,12 +1490,8 @@ FS_Handler()
  *------------------------------------------------------------------------*/
 
 static int
-init_mini_line(a_skt, a_lineNum, a_line, a_srvname)
-     struct sockaddr_in *a_skt;
-     int a_lineNum;
-     struct mini_line *a_line;
-     char *a_srvname;
-
+init_mini_line(struct sockaddr_in *a_skt, int a_lineNum,
+              struct mini_line *a_line, char *a_srvname)
 {                              /*init_mini_line */
 
     static char rn[] = "init_mini_line";       /*Routine name */
@@ -1551,50 +1516,50 @@ init_mini_line(a_skt, a_lineNum, a_line, a_srvname)
     a_line->base_line = a_lineNum + scout_screen.base_line_num;
     a_line->num_lines = 1;
 
-    curr_x = 0;
+    curr_x = 1;
     curr_y = a_line->base_line;
     if ((a_line->currConns_lp =
-        mini_initLightObject("Conns", curr_x, curr_y, LIGHTOBJ_CONN_WIDTH,
+        mini_initLightObject("Conns", curr_x, curr_y, scout_col_width[COL_CONN],
                              scout_gwin))
        == NULL) {
        fprintf(stderr, "[%s:%s] Can't create currConns light object\n", pn,
                rn);
        return (-1);
     }
-    curr_x += LIGHTOBJ_CONN_WIDTH + 1;
+    curr_x += scout_col_width[COL_CONN] + 1;
 
     if ((a_line->fetches_lp =
-        mini_initLightObject("Fetches", curr_x, curr_y, LIGHTOBJ_FETCH_WIDTH,
+        mini_initLightObject("Fetches", curr_x, curr_y, scout_col_width[COL_FETCH],
                              scout_frame->window))
        == NULL) {
        fprintf(stderr, "[%s:%s] Can't create fetches light object\n", pn,
                rn);
        return (-1);
     }
-    curr_x += LIGHTOBJ_FETCH_WIDTH + 1;
+    curr_x += scout_col_width[COL_FETCH] + 1;
 
     if ((a_line->stores_lp =
-        mini_initLightObject("Stores", curr_x, curr_y, LIGHTOBJ_STORE_WIDTH,
+        mini_initLightObject("Stores", curr_x, curr_y, scout_col_width[COL_STORE],
                              scout_frame->window))
        == NULL) {
        fprintf(stderr, "[%s:%s] Can't create stores light object\n", pn, rn);
        return (-1);
     }
-    curr_x += LIGHTOBJ_STORE_WIDTH + 1;
+    curr_x += scout_col_width[COL_STORE] + 1;
 
     if ((a_line->workstations_lp =
-        mini_initLightObject("WrkStn", curr_x, curr_y, LIGHTOBJ_WK_WIDTH,
+        mini_initLightObject("WrkStn", curr_x, curr_y, scout_col_width[COL_WK],
                              scout_frame->window))
        == NULL) {
        fprintf(stderr, "[%s:%s] Can't create workstations light object\n",
                pn, rn);
        return (-1);
     }
-    curr_x += LIGHTOBJ_WK_WIDTH + 1;
+    curr_x += scout_col_width[COL_WK] + 1;
 
     if ((a_line->srvName_lp =
         mini_initLightObject(a_srvname, curr_x, curr_y,
-                             LIGHTOBJ_SRVNAME_WIDTH, scout_frame->window))
+                             scout_col_width[COL_SRVNAME], scout_frame->window))
        == NULL) {
        fprintf(stderr, "[%s:%s] Can't create server name light object\n", pn,
                rn);
@@ -1604,7 +1569,7 @@ init_mini_line(a_skt, a_lineNum, a_line, a_srvname)
     lightdata = (struct gator_lightobj *)(a_line->srvName_lp->o_data);
     code = mini_justify(s,     /*Src buffer */
                        lightdata->label,       /*Dest buffer */
-                       LIGHTOBJ_SRVNAME_WIDTH, /*Dest's width */
+                       scout_col_width[COL_SRVNAME],   /*Dest's width */
                        SCOUT_CENTER,   /*Centered */
                        SCOUT_RIGHT_TRUNC,      /*Right-truncate */
                        SCOUT_ISNT_LDISK);      /*Not a labeled disk */
@@ -1613,7 +1578,6 @@ init_mini_line(a_skt, a_lineNum, a_line, a_srvname)
                "[%s] Can't center server name inside of light object\n", rn);
        return (code);
     }
-    curr_x += LIGHTOBJ_SRVNAME_WIDTH + 1;
 
     if (scout_initDiskLightObjects(a_line, scout_frame->window)) {
        fprintf(stderr, "[%s:%s] Can't create disk light objects\n", pn, rn);
@@ -1651,16 +1615,12 @@ init_mini_line(a_skt, a_lineNum, a_line, a_srvname)
  *------------------------------------------------------------------------*/
 
 static int
-execute_scout(a_numservers, a_srvname, a_pkg)
-     int a_numservers;
-     struct cmd_item *a_srvname;
-     int a_pkg;
-
+execute_scout(int a_numservers, struct cmd_item *a_srvname, int a_pkg)
 {                              /*execute_scout */
 
     static char rn[] = "execute_scout";        /*Routine name */
     static char fullsrvname[128];      /*Full server name */
-    register int code;         /*Return code */
+    int code;          /*Return code */
     struct sockaddr_in *FSSktArray;    /*Server socket array */
     int sktbytes;              /*Num bytes in above */
     struct sockaddr_in *curr_skt;      /*Ptr to current socket */
@@ -1670,12 +1630,7 @@ execute_scout(a_numservers, a_srvname, a_pkg)
     struct mini_line *curr_line;       /*Ptr to current line */
     int i;                     /*Generic loop variable */
     int mini_line_bytes;       /*Num bytes in mini_lines */
-    struct timeval tv;         /*Time structure */
     int linenum;               /*Current mini-line number */
-#if 0
-    PROCESS pid;               /*Main LWP process ID */
-    PROCESS gxlistener_ID;     /*Input Server LWP process ID */
-#endif /* 0 */
     struct gator_lightobj *lightdata;  /*Private light data */
 
     if (scout_debug) {
@@ -1684,23 +1639,14 @@ execute_scout(a_numservers, a_srvname, a_pkg)
     }
 
     /*
-     * We have to initialize LWP support before we start up any of
+     * We have to initialize thread support before we start up any of
      * our packages.
      */
-#if 0
-    code = LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &pid);
-    if (code) {
-       fprintf(stderr, "[%s:%s] Can't initialize LWP\n", pn, rn);
-       scout_CleanExit(code);
-    }
-#endif /* 0 */
+    opr_softsig_Init();
 
     /*
      * Initialize the gtx package.
      */
-#if 0
-    fprintf(stderr, "[%s:%s] Starting up gtx package\n", pn, rn);
-#endif /* 0 */
     scout_gwin = gtx_Init(0,   /*Don't start up InputServer yet */
                          -1);  /*Type of window package */
     if (scout_gwin == NULL) {
@@ -1731,14 +1677,13 @@ execute_scout(a_numservers, a_srvname, a_pkg)
      * watching.
      */
     sktbytes = a_numservers * sizeof(struct sockaddr_in);
-    FSSktArray = (struct sockaddr_in *)malloc(sktbytes);
+    FSSktArray = calloc(1, sktbytes);
     if (FSSktArray == (struct sockaddr_in *)0) {
        fprintf(stderr,
                "[%s] Can't malloc() %d sockaddrs (%d bytes) for the given servers\n",
                rn, a_numservers, sktbytes);
        scout_CleanExit(-1);
     }
-    memset(FSSktArray, 0, sktbytes);
 
     /*
      * Sweep through the server names provided, filling in the socket
@@ -1759,12 +1704,8 @@ execute_scout(a_numservers, a_srvname, a_pkg)
            return (-1);
        }
        memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
-       curr_skt->sin_family = AF_INET;         /*Internet family */
-#else
-       curr_skt->sin_family = htons(AF_INET);  /*Internet family */
-#endif
-       curr_skt->sin_port = htons(7000);       /*FileServer port */
+       curr_skt->sin_family = AF_INET;
+       curr_skt->sin_port = htons(7000);       /* FileServer port */
 
        /*
         * Bump our pointers.
@@ -1778,13 +1719,12 @@ execute_scout(a_numservers, a_srvname, a_pkg)
      * Create the set of mini-lines, one per server.
      */
     mini_line_bytes = a_numservers * sizeof(struct mini_line);
-    mini_lines = (struct mini_line *)malloc(mini_line_bytes);
+    mini_lines = calloc(1, mini_line_bytes);
     if (mini_lines == (struct mini_line *)0) {
        fprintf(stderr, "[%s] Can't malloc() %d bytes for %d screen lines\n",
                rn, mini_line_bytes, a_numservers);
        return (-1);
     }
-    memset(mini_lines, 0, mini_line_bytes);
 
     /*
      * Set up each line in the mini_lines, creating and initializing
@@ -1819,15 +1759,14 @@ execute_scout(a_numservers, a_srvname, a_pkg)
                                            scout_gwin);        /*Window */
     if (scout_banner0_lp != NULL) {
        lightdata = (struct gator_lightobj *)(scout_banner0_lp->o_data);
-       code =
-           mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
-                        SCOUT_CENTER, SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
-       code = gator_light_set(scout_banner0_lp, 1);
-       code = gtxframe_AddToList(scout_frame, scout_banner0_lp);
+       mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
+                    SCOUT_CENTER, SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
+       gator_light_set(scout_banner0_lp, 1);
+       gtxframe_AddToList(scout_frame, scout_banner0_lp);
 
        /*Debugging */
        if (scout_debug)
-           fprintf(scout_debugfd, "[%s] Scout label is '%s', %d chars\n", rn,
+           fprintf(scout_debugfd, "[%s] Scout label is '%s', %" AFS_SIZET_FMT " chars\n", rn,
                    lightdata->label, strlen(lightdata->label));
     }
 
@@ -1835,32 +1774,53 @@ execute_scout(a_numservers, a_srvname, a_pkg)
                                            0, /*X*/ 2, /*Y*/ scout_frameDims.maxx,     /*Width */
                                            scout_gwin);        /*Window */
     if (scout_banner1_lp != NULL) {
+       char attn_label[256];
        if (scout_attn_disk_mode == SCOUT_DISKM_PCUSED) {
-           sprintf(scout_Banner, "%s > %s%% used", scout_LightLabels,
-                   scout_attn_disk_pcusedstr);
+           snprintf(attn_label, sizeof(attn_label), "%s: > %s%% used",
+                    scout_label[5], scout_attn_disk_pcusedstr);
        } else {
-           sprintf(scout_Banner, "%s < %d blocks free", scout_LightLabels,
-                   scout_attn_disk_minfree);
+           snprintf(attn_label, sizeof(attn_label), "%s: < %d blocks free",
+                    scout_label[5], scout_attn_disk_minfree);
+       }
+       code = snprintf(scout_Banner, sizeof(scout_Banner),
+                       "%*s %*s %*s %*s %*s %s",
+                       scout_col_width[0], scout_label[0],
+                       scout_col_width[1], scout_label[1],
+                       scout_col_width[2], scout_label[2],
+                       scout_col_width[3], scout_label[3],
+                       scout_col_width[4], scout_label[4],
+                       attn_label);
+       if (code < 0 || code >= sizeof(scout_Banner)) {
+           fprintf(stderr, "[%s] Truncation while generating banner\n", rn);
+           return -1;
        }
+
        lightdata = (struct gator_lightobj *)(scout_banner1_lp->o_data);
-       code =
-           mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
-                        SCOUT_LEFT_JUSTIFY, SCOUT_RIGHT_TRUNC,
-                        SCOUT_ISNT_LDISK);
+       mini_justify(scout_Banner, lightdata->label, scout_frameDims.maxx,
+                    SCOUT_LEFT_JUSTIFY, SCOUT_RIGHT_TRUNC,
+                    SCOUT_ISNT_LDISK);
 
-       code = gtxframe_AddToList(scout_frame, scout_banner1_lp);
+       gtxframe_AddToList(scout_frame, scout_banner1_lp);
     }
 
     scout_banner2_lp = mini_initLightObject("Banner 2",        /*Light name */
                                            0, /*X*/ 3, /*Y*/ scout_frameDims.maxx,     /*Width */
                                            scout_gwin);        /*Window */
     if (scout_banner2_lp != NULL) {
+       snprintf(scout_Banner, sizeof(scout_Banner),
+                "%*s %*s %*s %*s %*s %s",
+                scout_col_width[0], scout_underline[0],
+                scout_col_width[1], scout_underline[1],
+                scout_col_width[2], scout_underline[2],
+                scout_col_width[3], scout_underline[3],
+                scout_col_width[4], scout_underline[4],
+                scout_underline[5]);
+
        lightdata = (struct gator_lightobj *)(scout_banner2_lp->o_data);
-       code =
-           mini_justify(scout_LightLabelUnd, lightdata->label,
-                        scout_frameDims.maxx, SCOUT_LEFT_JUSTIFY,
-                        SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
-       code = gtxframe_AddToList(scout_frame, scout_banner2_lp);
+       mini_justify(scout_Banner, lightdata->label,
+                    scout_frameDims.maxx, SCOUT_LEFT_JUSTIFY,
+                    SCOUT_RIGHT_TRUNC, SCOUT_ISNT_LDISK);
+       gtxframe_AddToList(scout_frame, scout_banner2_lp);
     }
 
     for (i = 0; i < a_numservers; i++) {
@@ -1928,21 +1888,6 @@ execute_scout(a_numservers, a_srvname, a_pkg)
 
     }                          /*Add lights in server records to display list */
 
-#if 0
-    /*
-     * Set up the minimal keymap.
-     */
-    code = keymap_BindToString(scout_frame->keymap,    /*Ptr to keymap */
-                              "e",     /*Key to bind */
-                              ExitCmd, /*Cmd to execute */
-                              NULL,    /*Name */
-                              NULL);   /*Ptr to rock */
-    if (code) {
-       fprintf(stderr, "[%s] Can't bind key `e', code is %d\n", rn, code);
-       return (code);
-    }
-#endif /* 0 */
-
     /*
      * Finish setting up the overall mini_screen structure.
      */
@@ -1961,29 +1906,13 @@ execute_scout(a_numservers, a_srvname, a_pkg)
                        scout_probefreq,        /*Probe frequency */
                        FS_Handler,     /*Handler routine */
                        0);     /*Turn debugging output off */
-#if 0
-    scout_debug);              /*Turn debugging output off */
-#endif /* 0 */
     if (code) {
        fprintf(stderr, "[%s] Error returned by fsprobe_Init: %d\n", rn,
                code);
        return (-1);
     }
 
-
-    /*
-     * Start up the input server LWP for our window.
-     */
-#if 0
-    code = LWP_CreateProcess(gtx_InputServer,  /*Fcn to start up */
-                            8192,      /*Stack size in bytes */
-                            LWP_NORMAL_PRIORITY,       /*Priority */
-                            (void *)scout_gwin,        /*Params: Ptr to window */
-                            "gx-listener",     /*Name to use */
-                            &gxlistener_ID);   /*Returned LWP process ID */
-#endif /* 0 */
-
-    code = gtx_InputServer(scout_gwin);
+    code = (int)(intptr_t)gtx_InputServer(scout_gwin);
     if (code) {
        fprintf(stderr,
                "[%s] Error exit from gtx_InputServer(), error is %d\n", rn,
@@ -1991,28 +1920,8 @@ execute_scout(a_numservers, a_srvname, a_pkg)
        scout_CleanExit(code);
     }
 
-    /*
-     * We fall into a loop, sleeping forever.
-     */
-    while (1) {
-       tv.tv_sec = 60 * 60;    /*Sleep for an hour at a time */
-       tv.tv_usec = 0;
-       code = select(0,        /*Num fds */
-                     0,        /*Descriptors ready for reading */
-                     0,        /*Descriptors ready for writing */
-                     0,        /*Descriptors with exceptional conditions */
-                     &tv);     /*Timeout structure */
-    }                          /*Sleep forever */
-
-#if 0
-    /*
-     * How did we get here?  Oh, well, clean up our windows and
-     * return sweetness and light anyway.
-     */
-    WOP_CLEANUP(&scout_gwin);
-    return (0);
-#endif /* 0 */
-
+    fsprobe_Wait(0); /* sleep forever */
+    return 0;
 }                              /*execute_scout */
 
 /*------------------------------------------------------------------------
@@ -2035,9 +1944,7 @@ execute_scout(a_numservers, a_srvname, a_pkg)
  *     As advertised.
  *------------------------------------------------------------------------*/
 
-static int countServers(a_firstItem)
-     struct cmd_item *a_firstItem;
-
+static int countServers(struct cmd_item *a_firstItem)
 {                              /*countServers */
 
     int list_len;              /*List length */
@@ -2087,9 +1994,7 @@ static int countServers(a_firstItem)
  *     As specified.
  *------------------------------------------------------------------------*/
 
-static void scout_AdoptThresholds(a_thresh_item)
-     struct cmd_item *a_thresh_item;
-
+static void scout_AdoptThresholds(struct cmd_item *a_thresh_item)
 {                              /*scout_AdoptThresholds */
 
     static char rn[] = "scout_AdoptThresholds";        /*Routine name */
@@ -2117,7 +2022,7 @@ static void scout_AdoptThresholds(a_thresh_item)
            if (scout_debug) {
                fprintf(scout_debugfd,
                        "[%s] Setting conn attn value to %d (default %d)\n",
-                       rn, curr_value, scout_attn_conn);
+                       rn, atoi(curr_value), scout_attn_conn);
                fflush(scout_debugfd);
            }
            scout_attn_conn = atoi(curr_value);
@@ -2142,8 +2047,8 @@ static void scout_AdoptThresholds(a_thresh_item)
            else {
                if (scout_debug) {
                    fprintf(scout_debugfd,
-                           "[%s] New disk attn value: %s min free (default %d)\n",
-                           rn, atoi(curr_value), scout_attn_disk_pcused);
+                           "[%s] New disk attn value: %s min free (default %f)\n",
+                           rn, curr_value, scout_attn_disk_pcused);
                    fflush(scout_debugfd);
                }
                scout_attn_disk_mode = SCOUT_DISKM_MINFREE;
@@ -2153,7 +2058,7 @@ static void scout_AdoptThresholds(a_thresh_item)
            if (scout_debug) {
                fprintf(scout_debugfd,
                        "[%s] Setting fetch attn value to %d (default %d)\n",
-                       rn, curr_value, scout_attn_fetch);
+                       rn, atoi(curr_value), scout_attn_fetch);
                fflush(scout_debugfd);
            }
            scout_attn_fetch = atoi(curr_value);
@@ -2161,7 +2066,7 @@ static void scout_AdoptThresholds(a_thresh_item)
            if (scout_debug) {
                fprintf(scout_debugfd,
                        "[%s] Setting store attn value to %d (default %d)\n",
-                       rn, curr_value, scout_attn_store);
+                       rn, atoi(curr_value), scout_attn_store);
                fflush(scout_debugfd);
            }
            scout_attn_store = atoi(curr_value);
@@ -2169,7 +2074,7 @@ static void scout_AdoptThresholds(a_thresh_item)
            if (scout_debug) {
                fprintf(scout_debugfd,
                        "[%s] Setting workstation attn value to %d (default %d)\n",
-                       rn, curr_value, scout_attn_workstations);
+                       rn, atoi(curr_value), scout_attn_workstations);
                fflush(scout_debugfd);
            }
            scout_attn_workstations = atoi(curr_value);
@@ -2188,6 +2093,43 @@ static void scout_AdoptThresholds(a_thresh_item)
 
 }                              /*scout_AdoptThresholds */
 
+/**
+ * Setup the user specified column widths.
+ *
+ * The column widths specifies the number of digits which
+ * will be displayed without truncation.  The column widths
+ * are given in the same order in which they are displayed,
+ * from left to right. Not all columns need to be specified
+ * on the command line. The default column widths for those
+ * columns not specified. Column widths can not be set smaller
+ * than the heading underline.
+ *
+ * @param[in] a_width_item     command line width item list
+ */
+void
+scout_SetColumnWidths(struct cmd_item *a_width_item)
+{
+    int i;
+    int width;
+    int num_cols = sizeof(scout_col_width) / sizeof(*scout_col_width);
+
+    for (i = 0; a_width_item && i < num_cols; i++) {
+       width = atoi(a_width_item->data);
+       if (width > 0) {
+           int min_width = strlen(scout_underline[i]);
+           if (min_width) {
+              width = max(width, min_width);
+           }
+           scout_col_width[i] = width + 1;
+       }
+       a_width_item = a_width_item->next;
+    }
+    if (a_width_item) {
+        fprintf(stderr, "Too many values given for -columnwidths\n");
+       scout_CleanExit(1);
+    }
+}
+
 /*------------------------------------------------------------------------
  * scoutInit
  *
@@ -2236,29 +2178,7 @@ static int scoutInit(struct cmd_syndesc *as, void *arock)
        fprintf(scout_debugfd, "[%s] Writing to Scout debugging file '%s'\n",
                rn, debug_filename);
     }
-#if 0
-    wpkg_to_use = atoi(as->parms[P_PACKAGE].items->data);
-#endif /* 0 */
     wpkg_to_use = 2;           /*Always use curses for now */
-#if 0
-    fprintf(stderr, "[%s:%s] Using graphics package %d: ", pn, rn,
-           wpkg_to_use);
-    switch (wpkg_to_use) {
-    case GATOR_WIN_CURSES:
-       fprintf(stderr, "curses\n");
-       break;
-    case GATOR_WIN_DUMB:
-       fprintf(stderr, "dumb terminal\n");
-       break;
-    case GATOR_WIN_X11:
-       fprintf(stderr, "X11\n");
-       break;
-    default:
-       fprintf(stderr, "Illegal graphics package: %d\n", wpkg_to_use);
-       scout_CleanExit(-1);
-    }                          /*end switch (wpkg_to_use) */
-#endif /* 0 */
-
     if (as->parms[P_FREQ].items != 0)
        scout_probefreq = atoi(as->parms[P_FREQ].items->data);
     else
@@ -2300,6 +2220,10 @@ static int scoutInit(struct cmd_syndesc *as, void *arock)
     if (as->parms[P_ATTENTION].items != 0)
        scout_AdoptThresholds(as->parms[P_ATTENTION].items);
 
+    if (as->parms[P_WIDTHS].items != 0) {
+        scout_SetColumnWidths(as->parms[P_WIDTHS].items);
+    }
+
     /*
      * Now, drive the sucker.
      */
@@ -2320,19 +2244,17 @@ static int scoutInit(struct cmd_syndesc *as, void *arock)
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
-     int argc;
-     char **argv;
-
+int
+main(int argc, char **argv)
 {                              /*main */
 
-    register afs_int32 code;   /*Return code */
-    register struct cmd_syndesc *ts;   /*Ptr to cmd line syntax descriptor */
+    afs_int32 code;    /*Return code */
+    struct cmd_syndesc *ts;    /*Ptr to cmd line syntax descriptor */
 
 #ifdef AFS_AIX32_ENV
     /*
-     * The following signal action for AIX is necessary so that in case of a 
-     * crash (i.e. core is generated) we can include the user's data section 
+     * The following signal action for AIX is necessary so that in case of a
+     * crash (i.e. core is generated) we can include the user's data section
      * in the core dump. Unfortunately, by default, only a partial core is
      * generated which, in many cases, isn't too useful.
      */
@@ -2346,15 +2268,11 @@ main(argc, argv)
     /*
      * Set up the commands we understand.
      */
-    ts = cmd_CreateSyntax("initcmd", scoutInit, NULL, "initialize the program");
+    ts = cmd_CreateSyntax("initcmd", scoutInit, NULL, 0, "initialize the program");
     cmd_AddParm(ts, "-server", CMD_LIST, CMD_REQUIRED,
                "FileServer name(s) to monitor");
     cmd_AddParm(ts, "-basename", CMD_SINGLE, CMD_OPTIONAL,
                "base server name");
-#if 0
-    cmd_AddParm(ts, "-package", CMD_SINGLE, CMD_REQUIRED,
-               "Graphics package to use");
-#endif /* 0 */
     cmd_AddParm(ts, "-frequency", CMD_SINGLE, CMD_OPTIONAL,
                "poll frequency, in seconds");
     cmd_AddParm(ts, "-host", CMD_FLAG, CMD_OPTIONAL,
@@ -2363,6 +2281,8 @@ main(argc, argv)
                "specify attention (highlighting) level");
     cmd_AddParm(ts, "-debug", CMD_SINGLE, CMD_OPTIONAL,
                "turn debugging output on to the named file");
+    cmd_AddParm(ts, "-columnwidths", CMD_LIST, CMD_OPTIONAL,
+               "specify column widths");
 
     /*
      * Parse command-line switches & execute the test, then get the heck
@@ -2370,12 +2290,9 @@ main(argc, argv)
      */
     code = cmd_Dispatch(argc, argv);
     if (code) {
-#if 0
-       fprintf(stderr, "[%s:%s] Call to cmd_Dispatch() failed; code is %d\n",
-               pn, rn, code);
-#endif /* 0 */
        scout_CleanExit(1);
     } else
        scout_CleanExit(0);
 
+    return 0; /* not reachable */
 }                              /*main */