/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* 61haes_r714 src/43haes/usr/sbin/cluster/clstat/xclstat.h 1.3.1.2       */
/*                                                                        */
/* Licensed Materials - Property of IBM                                   */
/*                                                                        */
/* Restricted Materials of IBM                                            */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 1990,2005              */
/* All Rights Reserved                                                    */
/*                                                                        */
/* US Government Users Restricted Rights - Use, duplication or            */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.      */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
/* @(#)47	1.3.1.2  src/43haes/usr/sbin/cluster/clstat/xclstat.h, hacmp.clstat, 61haes_r714 5/3/05 14:42:59  */
/*
 *   COMPONENT_NAME: CLSTAT
 *
 *   FUNCTIONS: ATOI
 *		ISDEFCLUSTER
 *		ISDEFNETIF
 *		ISDEFNODE
 *		ISUPADDRESS
 *		ISUPCLUSTER
 *		ISUPNODE
 *		ITOA
 *		defined
 *
 *   ORIGINS: 27
 *
 *
 *   (C) COPYRIGHT International Business Machines Corp. 1990,1994
 *   All Rights Reserved
 *   Licensed Materials - Property of IBM
 *   US Government Users Restricted Rights - Use, duplication or
 *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 */
#if !defined(XCLSTAT_H)
#define XCLSTAT_H

struct widgetList {
    char *wl_label;
    char *wl_tag;
    Widget wl_widget;
    struct widgetList *wl_next; };

struct clstatRes {
    Pixel cr_background;
    Pixel cr_foreground;
    Dimension cr_borderWidth;
    Bool cr_reverseVideo;
    Pixel cr_upColor;
    Pixel cr_downColor;
    Pixel cr_fluxColor;
    int cr_refreshInterval;
    char *cr_helpFile; };

#define ATOI(a,i)	((void) sscanf  ((a), "%d", &(i)))
#define ITOA(i,a)	((void) sprintf ((a), "%d", (i)))

#define ISDEFCLUSTER(c)	(CLS_UP == (c).clc_state || CLS_DOWN == (c).clc_state)
#define ISDEFNODE(n)	(CLS_UP == (n).cln_state || CLS_DOWN == (n).cln_state || CLS_JOINING == (n).cln_state || CLS_LEAVING == (n).cln_state)
#define ISDEFNETIF(i)	(CLS_UP == (i).cli_state || CLS_DOWN == (i).cli_state)

#define ISUPCLUSTER(c)		(CLE_OK == cl_isclusteravail((c)))
#define ISUPNODE(c,n)		(CLE_OK == cl_isnodeavail((c),(n)))
#define ISUPADDRESS(c,n,a)	(CLE_OK == cl_isaddressavail((c),(n),(a)))

/*
** Function prototypes.
*/
void Usage ();
int clstat_init (int, char *);

void create_top (Widget);
void create_nodemap (Widget);
void create_bottom (Widget);

char *create_helptext (char *);

/* accelerators */
void prevCluster (Widget, XEvent *, char **, int *);
void nextCluster (Widget, XEvent *, char **, int *);
void viewNode (Widget, XEvent *, char **, int *);
void quit (Widget, XEvent *, char **, int *);
void quitPopup (Widget, XEvent *, char **, int *);
void help (Widget, XEvent *, char **, int *);
void title (Widget, XEvent *, char **, int *);

/* timer */
void refreshMap (Widget, caddr_t, int);

/* event handlers */
void highlight (Widget, char *, XEvent *);
void unHighlight (Widget, char *, XEvent *);

void putWidget (char *, Widget);
Widget getWidgetByLabel (char *);
void delWidgetByLabel (char *);
Widget getWidgetByTag (char *);
void delWidgetByTag (char *);
void getWidgetTag(char *, char **);
void setWidgetTag (char *, char *);
void freeWidgetList ();

size_t mkdatestr (char *);

#endif