3
* $Log: netstatopt.c,v $
4
* Revision 1.1.1.1 1998/11/01 17:24:10 siegl
5
* COW 3.0 initial revision
23
for (i = 0; i < NETSTAT_NUMFIELDS; i++)
27
W_MapWindow(netstatWin);
33
double ns_get_tstat(void), ns_get_lstat(void);
34
char buf[BUFSIZ], *ns_get_nfthresh_s(void);
41
sprintf(buf, "%sollect network stats",
42
netstat ? "C" : "Don't c");
46
sprintf(buf, "Reset network stats");
50
sprintf(buf, "Total : %4.2f", ns_get_tstat());
54
sprintf(buf, "This ship : %4.2f", ns_get_lstat());
57
case NETSTAT_FAILURES:
58
sprintf(buf, "Network failures : %d", ns_get_nfailures());
61
case NETSTAT_NFTHRESH:
62
sprintf(buf, "Network failure threshold: %s_", ns_get_nfthresh_s());
70
W_WriteText(netstatWin, 0, i, color, buf, strlen(buf), 0);
73
void nsaction(W_Event * data)
75
char *ns_get_nfthresh_s(void);
84
if (data->type == W_EV_BUTTON)
89
W_UnmapWindow(lMeter);
97
nsrefresh(NETSTAT_SWITCH);
101
if (data->type == W_EV_BUTTON)
104
nsrefresh(NETSTAT_TOTAL);
105
nsrefresh(NETSTAT_LOCAL);
106
nsrefresh(NETSTAT_FAILURES);
110
case NETSTAT_NFTHRESH:
111
if (data->type == W_EV_KEY)
117
cp = ns_get_nfthresh_s();
127
ns_set_nfthresh_s("");
131
if (data->key >= '0' && data->key <= '9')
133
cp = ns_get_nfthresh_s();
144
nsrefresh(NETSTAT_NFTHRESH);
151
if (data->type == W_EV_BUTTON)
153
if (sscanf(ns_get_nfthresh_s(), "%d", &v) != 1)
155
ns_set_nfthresh_s(NETSTAT_DF_NFT_S);
156
ns_set_nfthresh(NETSTAT_DF_NFT);
170
W_UnmapWindow(netstatWin);