/*
* 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 <stdio.h>
#include <signal.h>
#include <math.h>
-#include <cmd.h>
-#ifdef HAVE_STRING_H
+#include <afs/cmd.h>
#include <string.h>
-#endif
#undef IN
#include <time.h>
-#include <gtxwindows.h> /*Generic window package */
-#include <gtxobjects.h> /*Object definitions */
+#include <afs/gtxwindows.h> /*Generic window package */
+#include <afs/gtxobjects.h> /*Object definitions */
+#include <afs/gtxkeymap.h>
#if 0
-#include <gtxtextcb.h> /*Text object circular buffer interface */
-#include <gtxtextobj.h> /*Text object interface */
+#include <afs/gtxtextcb.h> /*Text object circular buffer interface */
+#include <afs/gtxtextobj.h> /*Text object interface */
#endif
-#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 <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/xstat_fs.h>
#include <afs/xstat_cm.h>
*------------------------------------------------------------------------*/
static struct onode *
-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;
-
+initLightObject(char *a_name, int a_x, int a_y, int a_width,
+ struct gwin *a_win)
{ /*initLightObject */
-
- static char rn[] = "initLightObject"; /*Routine name */
struct onode *newlightp; /*Ptr to new light onode */
struct gator_light_crparams light_crparams; /*Light creation params */
char *truncname; /*Truncated name, if needed */
*------------------------------------------------------------------------*/
int
-justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc)
- char *a_srcbuff;
- char *a_dstbuff;
- int a_dstwidth;
- int a_justification;
- int a_rightTrunc;
-
+justify_light(char *a_srcbuff, char *a_dstbuff, int a_dstwidth,
+ int a_justification, int a_rightTrunc)
{ /*justify_light */
static char rn[] = "justify_light"; /*Routine name */
* we automatically shorten up.
*/
if (a_dstwidth > GATOR_LABEL_CHARS) {
- /*
+ /*
* if (afsmon_debug) {
* fprintf(debugFD,
* "[%s] Dest width (%d) > gtx buflen (%d), shrinking dest width\n",
*
* Description:
* Call the exit routine. This function is mapped
- * to the keys Q and \ 3 in all the frames and is called by the
+ * to the keys Q and \ 3 in all the frames and is called by the
* gtx input server.
*----------------------------------------------------------------------*/
int
-afsmonExit_gtx()
+afsmonExit_gtx(void *d1, void *d2)
{
static char rn[] = "afsmonExit_gtx";
}
afsmon_Exit(0);
+ return 0; /* not reached */
}
*----------------------------------------------------------------------*/
int
-ovw_refresh(a_pageNum, a_updateType)
- int a_pageNum; /* page to refresh overview display */
- int a_updateType; /* OVW_UPDATE_FS = update fs column only,
+ovw_refresh(int a_pageNum, /* page to refresh overview display */
+ int a_updateType) /* OVW_UPDATE_FS = update fs column only,
* OVW_UPDATE_CM = update cm column only,
- * OVW_UPDATE_BOTH = update fs & cm columns. Note that
- * we do not want to update a column until the
+ * OVW_UPDATE_BOTH = update fs & cm columns. Note that
+ * we do not want to update a column until the
* corresponding probe cycle has completed */
{ /* ovw_refresh */
struct cm_Display_Data *cmDataP; /* ptr to CM display data array */
int fsIdx; /* for counting # of CM hosts */
int cmIdx; /* for counting # of CM hosts */
- int next_page = 0; /* is there a next ovw page ? */
- int prev_page = 0; /* is there a previous ovw page */
char cmdLine[80]; /* buffer for command line */
char printBuf[256]; /* buffer to print to screen */
int i;
fflush(debugFD);
}
- /* if the data is not yet available ie., not one probe cycle has
+ /* if the data is not yet available ie., not one probe cycle has
* completed, do nothing */
if ((a_updateType & OVW_UPDATE_FS) && !fs_Data_Available)
strcat(cmdLine, "]? ");
-
-
-
/* display the command line */
tmp_lightobj = (struct gator_lightobj *)ovw_cmd_o->o_data;
sprintf(printBuf, "%s", cmdLine);
RIGHT_JUSTIFY, 1);
gator_light_set(ovw_probeNum_o, 1);
-
-
/* update the file server names column if we are asked to */
if (numFS && (a_updateType & OVW_UPDATE_FS)) {
* Switch from the overview screen to the FS screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_2_fs()
+Switch_ovw_2_fs(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_2_fs";
* Switch from the overview screen to the CM screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_2_cm()
+Switch_ovw_2_cm(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_2_cm";
* Switch to the next page in overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_next()
+Switch_ovw_next(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_next";
* Switch to the last page in the overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_last()
+Switch_ovw_last(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_last";
* Switch to the previous page in the overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_prev()
+Switch_ovw_prev(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_prev";
* Switch to the first page in the overview screen
*----------------------------------------------------------------------*/
int
-Switch_ovw_first()
+Switch_ovw_first(void *d1, void *d2)
{
static char rn[] = "Switch_ovw_first";
*----------------------------------------------------------------------*/
int
-create_ovwFrame_objects()
+create_ovwFrame_objects(void)
{ /* create_ovwFrame_objects */
static char rn[] = "create_ovwFrame_objects";
int hostLines; /* number of lines of host names to display */
struct onode **ovw_fsNames_o_Ptr; /* index to list of fs names onodes */
struct onode **ovw_cmNames_o_Ptr; /* index to list of cm names onodes */
- int code;
int i;
if (afsmon_debug) {
sprintf(errMsg, "[ %s ] Failed to create initMsg_o onode\n", rn);
afsmon_Exit(250);
}
- code = gtxframe_AddToList(ovwFrame, initMsg_o);
- code = gator_light_set(initMsg_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, initMsg_o);
+ gator_light_set(initMsg_o, HIGHLIGHT);
initMsg_on = 1;
sprintf(errMsg, "[ %s ] Failed to create command onode\n", rn);
afsmon_Exit(265);
}
- code = gtxframe_AddToList(ovwFrame, ovw_cmd_o);
- code = gator_light_set(ovw_cmd_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_cmd_o);
+ gator_light_set(ovw_cmd_o, HIGHLIGHT);
/* create the program name object */
sprintf(errMsg, "[ %s ] Failed to create programName onode\n", rn);
afsmon_Exit(255);
}
- code = gtxframe_AddToList(ovwFrame, ovw_progName_o);
- code = gator_light_set(ovw_progName_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_progName_o);
+ gator_light_set(ovw_progName_o, HIGHLIGHT);
/* create the page number object */
sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
afsmon_Exit(260);
}
- code = gtxframe_AddToList(ovwFrame, ovw_pageNum_o);
- code = gator_light_set(ovw_pageNum_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_pageNum_o);
+ gator_light_set(ovw_pageNum_o, HIGHLIGHT);
/* create the probe number object */
ovw_probeNum_o =
sprintf(errMsg, "[ %s ] Failed to create probe number onode\n", rn);
afsmon_Exit(270);
}
- code = gtxframe_AddToList(ovwFrame, ovw_probeNum_o);
- code = gator_light_set(ovw_probeNum_o, HIGHLIGHT);
+ gtxframe_AddToList(ovwFrame, ovw_probeNum_o);
+ gator_light_set(ovw_probeNum_o, HIGHLIGHT);
/* create the numFS monitored object */
ovw_numFS_o = initLightObject("", 0, 2, FC_NUMHOSTS_O_WIDTH, afsmon_win);
sprintf(errMsg, "[ %s ] Failed to create numFS onode\n", rn);
afsmon_Exit(275);
}
- code = gtxframe_AddToList(ovwFrame, ovw_numFS_o);
+ gtxframe_AddToList(ovwFrame, ovw_numFS_o);
/* create the numCM monitored object */
ovw_numCM_o =
sprintf(errMsg, "[ %s ] Failed to create numCM_o onode\n", rn);
afsmon_Exit(280);
}
- code = gtxframe_AddToList(ovwFrame, ovw_numCM_o);
+ gtxframe_AddToList(ovwFrame, ovw_numCM_o);
/* create the number-of-FS-alerts object */
ovw_FSalerts_o =
sprintf(errMsg, "[ %s ] Failed to create FSalerts_o onode\n", rn);
afsmon_Exit(285);
}
- code = gtxframe_AddToList(ovwFrame, ovw_FSalerts_o);
+ gtxframe_AddToList(ovwFrame, ovw_FSalerts_o);
/* create the number-of-CM-alerts object */
ovw_CMalerts_o =
sprintf(errMsg, "[ %s ] Failed to create CMalerts_o onode\n", rn);
afsmon_Exit(290);
}
- code = gtxframe_AddToList(ovwFrame, ovw_CMalerts_o);
+ gtxframe_AddToList(ovwFrame, ovw_CMalerts_o);
/* create file-server-name and cache-manager-names objects */
ovw_numHosts_perPage = maxY - OVW_NUM_FIXED_LINES;
/* allocate memory for a list of onode pointers for file server names */
- ovw_fsNames_o =
- (struct onode **)malloc(sizeof(struct onode *) *
- ovw_numHosts_perPage);
+ ovw_fsNames_o = malloc(sizeof(struct onode *) * ovw_numHosts_perPage);
if (ovw_fsNames_o == NULL) {
sprintf(errMsg, "[ %s ] Failed to allocate memory for FS onodes\n",
rn);
* fflush(debugFD);
* }
*/
- code = gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr);
+ gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr);
ovw_fsNames_o_Ptr++;
}
/* allocate memory for a list of onode pointers for cache manager names */
- ovw_cmNames_o =
- (struct onode **)malloc(sizeof(struct onode *) *
- ovw_numHosts_perPage);
+ ovw_cmNames_o = malloc(sizeof(struct onode *) * ovw_numHosts_perPage);
if (ovw_cmNames_o == NULL) {
sprintf(errMsg, "[ %s ] Failed to allocate memory for CM onodes\n",
rn);
sprintf(errMsg, "[ %s ] Failed to create a CM name onode\n", rn);
afsmon_Exit(310);
}
- code = gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr);
+ gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr);
ovw_cmNames_o_Ptr++;
}
*----------------------------------------------------------------------*/
int
-resolve_CmdLine(a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
- a_curr_LCol, a_cols_perPage, a_Data_Available)
- char *a_buffer; /* buffer to copy command line */
- int a_currFrame; /* current frame ovw, fs or cm? */
- int a_currPage; /* current page number */
- int a_numPages; /* number of pages of data */
- int a_numCols; /* number of columns of data to display */
- int a_curr_LCol; /* current number of leftmost column */
- int a_cols_perPage; /* number of columns per page */
-
+resolve_CmdLine(char *a_buffer, /* buffer to copy command line */
+ int a_currFrame, /* current frame ovw, fs or cm? */
+ int a_currPage, /* current page number */
+ int a_numPages, /* number of pages of data */
+ int a_numCols, /* number of columns of data to display */
+ int a_curr_LCol, /* current number of leftmost column */
+ int a_cols_perPage, /* number of columns per page */
+ int a_Data_Available)
{ /* resolve_CmdLine */
static char rn[] = "resolve_CmdLine";
int pageType;
if (afsmon_debug) {
fprintf(debugFD,
- "[ %s ] Called, a_buffer= %d, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n",
+ "[ %s ] Called, a_buffer= %p, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n",
rn, a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
a_curr_LCol, a_cols_perPage);
fflush(debugFD);
* The data in the file server & cache manager frames are displayed
* in two objects, one below the other. If the data is too long to
* fit in the first object it will overflow into the next. This is
- * to conserve real estate on the screen. This function copies the
+ * to conserve real estate on the screen. This function copies the
* contents of the source buffer adjusted to the two objects if the
- * probe had succeded. Otherwise it enters "--" in the first object
+ * probe had succeded. Otherwise it enters "--" in the first object
* blanks out the second. If the object needs to be highlightned
* (due to a threshold crossing) it is done.
*
* 0 always
*----------------------------------------------------------------------*/
int
-display_Server_datum(a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, a_just,
- a_highlight)
-
- char *a_srcBuf; /* source buffer */
- struct onode *a_firstObj_o; /* first object */
- struct onode *a_secondObj_o; /* second object */
- int a_probeOK; /* probe OK ? */
- int a_just; /* justification */
- int a_highlight; /* highlight object ? */
-
+display_Server_datum(char *a_srcBuf, /* source buffer */
+ struct onode *a_firstObj_o, /* first object */
+ struct onode *a_secondObj_o, /* second object */
+ int a_probeOK, /* probe OK ? */
+ int a_just, /* justification */
+ int a_highlight) /* highlight object ? */
{ /* display_Server_datum */
static char rn[] = "display_Server_datum";
if (afsmon_debug) {
if (a_highlight)
fprintf(debugFD,
- "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %d, a_secondObj_o= %d, a_probeOK= %d, a_just= %d, a_highlight= %d\n",
+ "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %p, a_secondObj_o= %p, a_probeOK= %d, a_just= %d, a_highlight= %d\n",
rn, a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK,
a_just, a_highlight);
fflush(debugFD);
*----------------------------------------------------------------------*/
int
-display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o)
- char *a_srcBuf;
- struct onode *a_firstObj_o; /* first object */
- struct onode *a_secondObj_o; /* second object */
- struct onode *a_thirdObj_o; /* third object */
-
+display_Server_label(char *a_srcBuf,
+ struct onode *a_firstObj_o, /* first object */
+ struct onode *a_secondObj_o, /* second object */
+ struct onode *a_thirdObj_o) /* third object */
{ /* display_Server_label */
-
static char rn[] = "display_Server_label";
char part[3][20]; /* buffer for three parts of label */
char *strPtr;
part[i][j] = '\0';
}
- /*
+ /*
* if (afsmon_debug) {
* fprintf(debugFD,"[ %s ] LABELS %s -> %s %s %s\n",
* rn, a_srcBuf, part[0], part[1], part[2]);
}
}
}
-
+ return 0;
} /* display_Server_label */
*
* Description:
* Refresh the File Servers screen with the given page number starting
- * at the given left-column number. The appropriate contents of
- * prev_fsData are displayed.
+ * at the given left-column number. The appropriate contents of
+ * prev_fsData are displayed.
* First the status labels at the four corners of the screen are
* updated. Next the column labels are updated and then each row
* of statistics.
- *
+ *
* Returns:
* Success: 0
* Failure: Exits afsmoitor on a severe error.
int
-fs_refresh(a_pageNum, a_LcolNum)
- int a_pageNum; /* page to display */
- int a_LcolNum; /* starting (leftmost) column number */
-
+fs_refresh(int a_pageNum, /* page to display */
+ int a_LcolNum) /* starting (leftmost) column number */
{ /* fs_refresh */
static char rn[] = "fs_refresh"; /* routine name */
int code;
int fsIdx;
int labelIdx;
- int dataIndex; /* index to the data[] field of
+ int dataIndex; /* index to the data[] field of
* struct fs_Display_Data */
if (afsmon_debug) {
}
- /* if the data is not yet available, ie., not one probe cycle has
+ /* if the data is not yet available, ie., not one probe cycle has
* completed, do nothing */
if (!fs_Data_Available)
/* command line */
/* figure out what we need to show in the prompt & set the page type */
- /* the fs_pageType variable is in turn used by the keyboard handler
+ /* the fs_pageType variable is in turn used by the keyboard handler
* routines to call fs_refresh() with the correct parameters */
fs_pageType = resolve_CmdLine(cmdLine, 1 /* fs frame */ , a_pageNum,
fs_numPages, fs_numCols, a_LcolNum,
- fs_cols_perPage);
+ fs_cols_perPage, 0);
/* display the command line */
tmp_lightobj = (struct gator_lightobj *)fs_cmd_o->o_data;
/* display the hostname , first names only please! */
- sprintf(printBuf, fsDataP->hostName);
+ sprintf(printBuf, "%s", fsDataP->hostName);
for (j = 0; j < strlen(printBuf); j++) {
if (printBuf[j] == '.') {
printBuf[j] = '\0';
* overflow flag is set and highlight if so. if the probe had failed
* enter "--" is all columns */
- /* each host has two rows of slots for datums. get the pointers to
+ /* each host has two rows of slots for datums. get the pointers to
* both the arrays */
firstSlot_o_Ptr = tmp_fs_lines_P->data_o[0];
* Switch from the File Server screen to the Overview Screen
*----------------------------------------------------------------------*/
int
-Switch_fs_2_ovw()
+Switch_fs_2_ovw(void *d1, void *d2)
{
/* bind the overview frame to the window */
gtxframe_SetFrame(afsmon_win, ovwFrame);
* Switch_fs_2_cm()
*
* Description:
- * Switch from the File Server screen to the Cache Managers screen.
+ * Switch from the File Server screen to the Cache Managers screen.
*----------------------------------------------------------------------*/
int
-Switch_fs_2_cm()
+Switch_fs_2_cm(void *d1, void *d2)
{
if (fs_pageType & CMD_CM) {
/* bind the overview Cache Managers to the window */
* Switch_fs_next()
*
* Description:
- * Switch to next page of file server screen
+ * Switch to next page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_next()
+Switch_fs_next(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_next";
-
if (fs_pageType & CMD_NEXT) {
/* we have a next page, refresh with next page number */
fs_refresh(fs_currPage + 1, fs_curr_LCol);
* Switch_fs_last()
*
* Description:
- * Switch to last page of file server screen
+ * Switch to last page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_last()
+Switch_fs_last(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_last";
-
-
if (fs_pageType & CMD_NEXT) {
/* we have a next page, refresh with the last page number */
fs_refresh(fs_numPages, fs_curr_LCol);
* Switch_fs_prev()
*
* Description:
- * Switch to previous page of file server screen
+ * Switch to previous page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_prev()
+Switch_fs_prev(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_prev";
-
if (fs_pageType & CMD_PREV) {
/* we have a previous page, refresh with the rpevious page number */
fs_refresh(fs_currPage - 1, fs_curr_LCol);
* Switch_fs_first()
*
* Description:
- * Switch to first page of file server screen
+ * Switch to first page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_first()
+Switch_fs_first(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_first";
-
if (fs_pageType & CMD_PREV) {
/* we have a previous page, got to first page */
fs_refresh(1, fs_curr_LCol);
* Switch_fs_left()
*
* Description:
- * Scroll left on the file server screen
+ * Scroll left on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_left()
+Switch_fs_left(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_left";
-
if (fs_pageType & CMD_LEFT) {
/* we have columns on left, refresh with new column number */
fs_refresh(fs_currPage, fs_curr_LCol - fs_cols_perPage);
* Switch_fs_leftmost()
*
* Description:
- * Scroll to first column on the file server screen
+ * Scroll to first column on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_leftmost()
+Switch_fs_leftmost(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_leftmost";
-
if (fs_pageType & CMD_LEFT) {
/* we have columns on left, go to the first */
fs_refresh(fs_currPage, 0);
* Switch_fs_right()
*
* Description:
- * Scroll right on the file server screen
+ * Scroll right on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_right()
+Switch_fs_right(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_right";
-
if (fs_pageType & CMD_RIGHT) {
/* we have columns on right, refresh with new column number */
fs_refresh(fs_currPage, fs_curr_LCol + fs_cols_perPage);
* Switch_fs_rightmost()
*
* Description:
- * Scroll to last column on the file server screen
+ * Scroll to last column on the file server screen
*----------------------------------------------------------------------*/
int
-Switch_fs_rightmost()
+Switch_fs_rightmost(void *d1, void *d2)
{
- static char rn[] = "Switch_fs_rightmost";
int curr_LCol;
-
if (fs_pageType & CMD_RIGHT) {
/* we have columns on right, go to the last column */
if (fs_numCols % fs_cols_perPage)
*----------------------------------------------------------------------*/
int
-create_FSframe_objects()
+create_FSframe_objects(void)
{ /* create_FSframe_objects */
static char rn[] = "create_FSframe_objects";
struct ServerInfo_line *fs_lines_Ptr;
struct onode **fsLabels_o_Ptr;
int x_pos;
int y_pos;
- int code;
int i;
int j;
int numBytes;
sprintf(errMsg, "[ %s ] Failed to create fs command onode\n", rn);
afsmon_Exit(340);
}
- code = gtxframe_AddToList(fsFrame, fs_cmd_o);
- code = gator_light_set(fs_cmd_o, HIGHLIGHT);
+ gtxframe_AddToList(fsFrame, fs_cmd_o);
+ gator_light_set(fs_cmd_o, HIGHLIGHT);
/* we already have the dimensions for the frame - same as the ovw frame */
/* use the ovw program name object for the fs screen too */
- code = gtxframe_AddToList(fsFrame, ovw_progName_o);
+ gtxframe_AddToList(fsFrame, ovw_progName_o);
/* create the page number object */
sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
afsmon_Exit(335);
}
- code = gtxframe_AddToList(fsFrame, fs_pageNum_o);
- code = gator_light_set(fs_pageNum_o, HIGHLIGHT);
+ gtxframe_AddToList(fsFrame, fs_pageNum_o);
+ gator_light_set(fs_pageNum_o, HIGHLIGHT);
/* create the probe number object */
fs_probeNum_o =
sprintf(errMsg, "[ %s ] Failed to create fs probeNum onode\n", rn);
afsmon_Exit(345);
}
- code = gtxframe_AddToList(fsFrame, fs_probeNum_o);
- code = gator_light_set(fs_probeNum_o, HIGHLIGHT);
+ gtxframe_AddToList(fsFrame, fs_probeNum_o);
+ gator_light_set(fs_probeNum_o, HIGHLIGHT);
/* create the numFS monitored object */
"[ %s ] Failed to create numFS onode for the fs frame\n", rn);
afsmon_Exit(350);
}
- code = gtxframe_AddToList(fsFrame, fs_numFS_o);
+ gtxframe_AddToList(fsFrame, fs_numFS_o);
/* create the "more columns to left" indicator */
fs_leftArrows_o =
rn);
afsmon_Exit(355);
}
- code = gtxframe_AddToList(fsFrame, fs_leftArrows_o);
+ gtxframe_AddToList(fsFrame, fs_leftArrows_o);
/* create the "more columns to right" indicator */
fs_rightArrows_o =
rn);
afsmon_Exit(360);
}
- code = gtxframe_AddToList(fsFrame, fs_rightArrows_o);
+ gtxframe_AddToList(fsFrame, fs_rightArrows_o);
* the file server statistics */
numBytes = fs_numHosts_perPage * sizeof(struct ServerInfo_line);
- fs_lines = (struct ServerInfo_line *)malloc(numBytes);
+ fs_lines = malloc(numBytes);
if (fs_lines == (struct ServerInfo_line *)0) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for FS data lines\n", rn,
afsmon_Exit(365);
}
- /* for each line of server statistics allocate memory to store two arrays
+ /* for each line of server statistics allocate memory to store two arrays
* of data onodes */
fs_lines_Ptr = fs_lines;
for (i = 0; i < fs_numHosts_perPage; i++) {
for (arrIdx = 0; arrIdx < 2; arrIdx++) {
numBytes = fs_cols_perPage * sizeof(struct onode *);
- fs_lines_Ptr->data_o[arrIdx] = (struct onode **)malloc(numBytes);
+ fs_lines_Ptr->data_o[arrIdx] = malloc(numBytes);
if (fs_lines_Ptr->data_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for FS data onodes\n",
sprintf(errMsg, "[ %s ] Failed to create an FS name onode\n", rn);
afsmon_Exit(375);
}
- code = gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o);
+ gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o);
/* if (afsmon_debug) {
* fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n",
"[ %s ] Failed to create an FS data onode\n", rn);
afsmon_Exit(380);
}
- code = gtxframe_AddToList(fsFrame, *fs_data_o_Ptr);
+ gtxframe_AddToList(fsFrame, *fs_data_o_Ptr);
fs_data_o_Ptr++;
} /* for each column */
* labels */
for (arrIdx = 0; arrIdx < 3; arrIdx++) {
- fsLabels_o[arrIdx] =
- (struct onode **)malloc(sizeof(struct onode *) * fs_cols_perPage);
+ fsLabels_o[arrIdx] = malloc(sizeof(struct onode *) * fs_cols_perPage);
if (fsLabels_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate memory for FS label onodes\n",
rn);
afsmon_Exit(390);
}
- code = gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr);
+ gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr);
fsLabels_o_Ptr++;
}
keymap_BindToString(fsFrame->keymap, "Q", afsmonExit_gtx, NULL, NULL);
keymap_BindToString(fsFrame->keymap, "\ 3", afsmonExit_gtx, NULL, NULL);
- /* o = overview, c = cm, n = next, p = prev, l = left, r = right
+ /* o = overview, c = cm, n = next, p = prev, l = left, r = right
* N = last page, P = first page, L = leftmost col, R = rightmost col */
keymap_BindToString(fsFrame->keymap, "o", Switch_fs_2_ovw, NULL, NULL);
*
* Description:
* Refresh the Cache Managers screen with the given page number starting
- * at the given left-column number. The appropriate contents of
- * prev_cmData are displayed.
+ * at the given left-column number. The appropriate contents of
+ * prev_cmData are displayed.
* First the status labels at the four corners of the screen are
* updated. Next the column labels are updated and then each row
* of statistics.
- *
+ *
* Returns:
* Success: 0
* Failure: Exits afsmoitor on a severe error.
*----------------------------------------------------------------------*/
int
-cm_refresh(a_pageNum, a_LcolNum)
- int a_pageNum; /* page to display */
- int a_LcolNum; /* starting (leftmost) column number */
-
+cm_refresh(int a_pageNum, /* page to display */
+ int a_LcolNum) /* starting (leftmost) column number */
{ /* cm_refresh */
static char rn[] = "cm_refresh"; /* routine name */
int code;
int cmIdx;
int labelIdx;
- int dataIndex; /* index to the data[] field of
+ int dataIndex; /* index to the data[] field of
* struct cm_Display_Data */
if (afsmon_debug) {
}
- /* if the data is not yet available, ie., not one probe cycle has
+ /* if the data is not yet available, ie., not one probe cycle has
* completed, do nothing */
if (!cm_Data_Available)
/* command line */
/* figure out what we need to show in the prompt & set the page type */
- /* the cm_pageType variable is in turn used by the keyboard handler
+ /* the cm_pageType variable is in turn used by the keyboard handler
* routines to call cm_refresh() with the correct parameters */
cm_pageType = resolve_CmdLine(cmdLine, 2 /* cm frame */ , a_pageNum,
cm_numPages, cm_numCols, a_LcolNum,
- cm_cols_perPage);
+ cm_cols_perPage, 0);
/* display the command line */
tmp_lightobj = (struct gator_lightobj *)cm_cmd_o->o_data;
/* display the hostname , first names only please! */
- sprintf(printBuf, cmDataP->hostName);
+ sprintf(printBuf, "%s", cmDataP->hostName);
for (j = 0; j < strlen(printBuf); j++) {
if (printBuf[j] == '.') {
printBuf[j] = '\0';
* overflow flag is set and highlight if so. if the probe had failed
* enter "--" is all columns */
- /* each host has two rows of slots for datums. get the pointers to
+ /* each host has two rows of slots for datums. get the pointers to
* both the arrays */
firstSlot_o_Ptr = tmp_cm_lines_P->data_o[0];
* Switch from the Cache Manager screen to the Overview Screen
*----------------------------------------------------------------------*/
int
-Switch_cm_2_ovw()
+Switch_cm_2_ovw(void *d1, void *d2)
{
/* bind the overview frame to the window */
gtxframe_SetFrame(afsmon_win, ovwFrame);
* Switch_cm_2_fs()
*
* Description:
- * Switch from the Cache Manager screen to the File Servers screen
+ * Switch from the Cache Manager screen to the File Servers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_2_fs()
+Switch_cm_2_fs(void *d1, void *d2)
{
if (cm_pageType & CMD_FS) {
/* bind the file servers frame to the window */
* Switch_cm_next()
*
* Description:
- * Switch to next page of cache managers screen
+ * Switch to next page of cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_next()
+Switch_cm_next(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_next";
-
if (cm_pageType & CMD_NEXT) {
/* we have a next page, refresh with next page number */
cm_refresh(cm_currPage + 1, cm_curr_LCol);
* Switch_cm_last()
*
* Description:
- * Switch to last page of file server screen
+ * Switch to last page of file server screen
*----------------------------------------------------------------------*/
int
-Switch_cm_last()
+Switch_cm_last(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_last";
-
-
if (cm_pageType & CMD_NEXT) {
/* we have a next page, refresh with last page number */
cm_refresh(cm_numPages, cm_curr_LCol);
* Switch_cm_prev()
*
* Description:
- * Switch to previous page of cache managers screen
+ * Switch to previous page of cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_prev()
+Switch_cm_prev(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_prev";
-
if (cm_pageType & CMD_PREV) {
/* we have a previous page, refresh to previous page */
cm_refresh(cm_currPage - 1, cm_curr_LCol);
* Switch_cm_first()
*
* Description:
- * Switch to first page of cache managers screen
+ * Switch to first page of cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_first()
+Switch_cm_first(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_first";
-
if (cm_pageType & CMD_PREV) {
/* we have a previous page, refresh to first page */
cm_refresh(1, cm_curr_LCol);
* Switch_cm_left()
*
* Description:
- * Scroll left on the cache managers screen
+ * Scroll left on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_left()
+Switch_cm_left(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_left";
-
if (cm_pageType & CMD_LEFT) {
/* we have columns on left, refresh with new column number */
cm_refresh(cm_currPage, cm_curr_LCol - cm_cols_perPage);
* Switch_cm_leftmost()
*
* Description:
- * Scroll to first column on the cache managers screen
+ * Scroll to first column on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_leftmost()
+Switch_cm_leftmost(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_leftmost";
-
if (cm_pageType & CMD_LEFT) {
/* we have columns on left, go to the first column */
cm_refresh(cm_currPage, 0);
* Switch_cm_right()
*
* Description:
- * Scroll right on the cache managers screen
+ * Scroll right on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_right()
+Switch_cm_right(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_right";
-
if (cm_pageType & CMD_RIGHT) {
/* we have columns on right, refresh with new column number */
cm_refresh(cm_currPage, cm_curr_LCol + cm_cols_perPage);
* Switch_cm_rightmost()
*
* Description:
- * Scroll to last column on the cache managers screen
+ * Scroll to last column on the cache managers screen
*----------------------------------------------------------------------*/
int
-Switch_cm_rightmost()
+Switch_cm_rightmost(void *d1, void *d2)
{
- static char rn[] = "Switch_cm_rightmost";
int curr_LCol;
-
if (cm_pageType & CMD_RIGHT) {
/* we have columns on right, go to the last column */
if (cm_numCols % cm_cols_perPage)
*----------------------------------------------------------------------*/
int
-create_CMframe_objects()
+create_CMframe_objects(void)
{ /* create_CMframe_objects */
static char rn[] = "create_CMframe_objects";
struct ServerInfo_line *cm_lines_Ptr;
struct onode **cmLabels_o_Ptr;
int x_pos;
int y_pos;
- int code;
int i;
int j;
int numBytes;
sprintf(errMsg, "[ %s ] Failed to create cm command onode\n", rn);
afsmon_Exit(420);
}
- code = gtxframe_AddToList(cmFrame, cm_cmd_o);
- code = gator_light_set(cm_cmd_o, HIGHLIGHT);
+ gtxframe_AddToList(cmFrame, cm_cmd_o);
+ gator_light_set(cm_cmd_o, HIGHLIGHT);
/* we already have the dimensions for the frame - same as the ovw frame */
/* use the ovw program name object for the cm screen too */
- code = gtxframe_AddToList(cmFrame, ovw_progName_o);
+ gtxframe_AddToList(cmFrame, ovw_progName_o);
/* create the page number object */
sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
afsmon_Exit(415);
}
- code = gtxframe_AddToList(cmFrame, cm_pageNum_o);
- code = gator_light_set(cm_pageNum_o, HIGHLIGHT);
+ gtxframe_AddToList(cmFrame, cm_pageNum_o);
+ gator_light_set(cm_pageNum_o, HIGHLIGHT);
/* create the probe number object */
cm_probeNum_o =
sprintf(errMsg, "[ %s ] Failed to create cm probeNum onode\n", rn);
afsmon_Exit(425);
}
- code = gtxframe_AddToList(cmFrame, cm_probeNum_o);
- code = gator_light_set(cm_probeNum_o, HIGHLIGHT);
+ gtxframe_AddToList(cmFrame, cm_probeNum_o);
+ gator_light_set(cm_probeNum_o, HIGHLIGHT);
/* create the numCM monitored object */
"[ %s ] Failed to create numCM onode for the cm frame\n", rn);
afsmon_Exit(430);
}
- code = gtxframe_AddToList(cmFrame, cm_numCM_o);
+ gtxframe_AddToList(cmFrame, cm_numCM_o);
/* create the "more columns to left" indicator */
cm_leftArrows_o =
rn);
afsmon_Exit(435);
}
- code = gtxframe_AddToList(cmFrame, cm_leftArrows_o);
+ gtxframe_AddToList(cmFrame, cm_leftArrows_o);
/* create the "more columns to right" indicator */
cm_rightArrows_o =
rn);
afsmon_Exit(440);
}
- code = gtxframe_AddToList(cmFrame, cm_rightArrows_o);
+ gtxframe_AddToList(cmFrame, cm_rightArrows_o);
* the file server statistics */
numBytes = cm_numHosts_perPage * sizeof(struct ServerInfo_line);
- cm_lines = (struct ServerInfo_line *)malloc(numBytes);
+ cm_lines = malloc(numBytes);
if (cm_lines == (struct ServerInfo_line *)0) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for CM data lines\n", rn,
afsmon_Exit(445);
}
- /* for each line of server statistics allocate memory to store two arrays
+ /* for each line of server statistics allocate memory to store two arrays
* of data onodes */
cm_lines_Ptr = cm_lines;
for (i = 0; i < cm_numHosts_perPage; i++) {
for (arrIdx = 0; arrIdx < 2; arrIdx++) {
numBytes = cm_cols_perPage * sizeof(struct onode *);
- cm_lines_Ptr->data_o[arrIdx] = (struct onode **)malloc(numBytes);
+ cm_lines_Ptr->data_o[arrIdx] = malloc(numBytes);
if (cm_lines_Ptr->data_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for CM data onodes\n",
sprintf(errMsg, "[ %s ] Failed to create an CM name onode\n", rn);
afsmon_Exit(455);
}
- code = gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o);
+ gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o);
/* if (afsmon_debug) {
* fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n",
"[ %s ] Failed to create an CM data onode\n", rn);
afsmon_Exit(460);
}
- code = gtxframe_AddToList(cmFrame, *cm_data_o_Ptr);
+ gtxframe_AddToList(cmFrame, *cm_data_o_Ptr);
cm_data_o_Ptr++;
} /* for each column */
* labels */
for (arrIdx = 0; arrIdx < 3; arrIdx++) {
- cmLabels_o[arrIdx] =
- (struct onode **)malloc(sizeof(struct onode *) * cm_cols_perPage);
+ cmLabels_o[arrIdx] = malloc(sizeof(struct onode *) * cm_cols_perPage);
if (cmLabels_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate memory for CM label onodes\n",
rn);
afsmon_Exit(470);
}
- code = gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr);
+ gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr);
cmLabels_o_Ptr++;
}
}
-
-
-
-
-
/* initialize the column & page counters */
cm_currPage = 1;
keymap_BindToString(cmFrame->keymap, "Q", afsmonExit_gtx, NULL, NULL);
keymap_BindToString(cmFrame->keymap, "\ 3", afsmonExit_gtx, NULL, NULL);
- /* o = overview, c = cm, n = next, p = prev, l = left, r = right
+ /* o = overview, c = cm, n = next, p = prev, l = left, r = right
* N = last page, P = first page, L = leftmost col, R = rightmost col */
keymap_BindToString(cmFrame->keymap, "o", Switch_cm_2_ovw, NULL, NULL);
* for the overview, File Servers & Cache Managers screens.
*----------------------------------------------------------------------*/
int
-gtx_initialize()
+gtx_initialize(void)
{ /* gtx_initialize */
static char rn[] = "gtx_initialize"; /* routine name */
int code;