File: globalvars.cc

package info (click to toggle)
gps 1.1.0.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,212 kB
  • ctags: 987
  • sloc: cpp: 11,600; sh: 381; makefile: 319; ansic: 227; perl: 17
file content (139 lines) | stat: -rw-r--r-- 3,499 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* $Id: globalvars.cc,v 1.11 2001/03/22 18:37:23 bergo Exp $ */

/*

    GPS - Graphical Process Statistics
    Copyright (C) 1999-2000 Felipe Paulo Guazzi Bergo
    bergo@seul.org

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <gtk/gtk.h>
#include "transient.h"
#include "gps.h"
#include "filter.h"
#include "polling.h"

/* Global Flags */
gint show_long_names=FALSE;
gint continuum=FALSE;
gint poll_local_only=FALSE;
gint jelly_bar=FALSE;
int gotgui=0;

gint net_halt_request=0;

gint netcritical=0;
gint nettimeout=DEFAULT_NET_TIMEOUT;

/* Pollers */
ProcessListPoller *list_poller;
ProcessDetailsPoller *details_poller;
SystemInfoProvider *info_provider;

int watch_count=0;
GList *listwatch=NULL;
GList *detailswatch=NULL;
GList *sysinfowatch=NULL;

/* Filtering */
gint have_filter=FALSE;
struct filter_info fi_work={0,0,"0"},fi_stru;

/* Network watch list */
GList *hostlist_fixed=NULL; /* netwatch host list */

/* selection and local host */
gint pid_sel=-1;
char host_sel[128],this_host[128];

/* gui stuff */
GtkWidget *hdlg=NULL;
GtkWidget *status_label[3];

GtkWindow *MainWindow;

gint to_history=-1;

gchar col_title[PROCESS_LIST_COLUMNS][10]=
      {"PID","Name","Owner","Host","State","%CPU","Size",
       "RSS","Nice","Pri","Start"};

/* signals */

char *posixnames[]={
  "SIGHUP", "SIGINT", "SIGQUIT","SIGILL", "SIGABRT","SIGFPE",
  "SIGKILL","SIGSEGV","SIGPIPE","SIGALRM","SIGTERM","SIGUSR1",
  "SIGUSR2","SIGCHLD","SIGCONT","SIGSTOP","SIGTSTP","SIGTTIN",
  "SIGTTOU"};

gint posixvalues[]={
  SIGHUP,SIGINT,SIGQUIT,SIGILL,SIGABRT,SIGFPE,
  SIGKILL,SIGSEGV,SIGPIPE,SIGALRM,SIGTERM,SIGUSR1,
  SIGUSR2,SIGCHLD,SIGCONT,SIGSTOP,SIGTSTP,SIGTTIN,
  SIGTTOU};

char *T_SNT=" \n\t";

// colors

int c_history_cpu_a;    // 0x00ff00
int c_history_cpu_b;    // 0x004000
int c_history_cpu_c;    // 0x006000
int c_history_grid;     // 0x008000

int c_history_swap_a;   // 0xff0000
int c_history_swap_b;   // 0x800000
int c_history_swap_c;   // 0x600000

int c_blue_a;   // 0x0000ff
int c_blue_b;   // 0x000080
int c_blue_c;   // 0x000060

int c_yellow_a;   // 0xffff00
int c_yellow_b;   // 0x808000
int c_yellow_c;   // 0x606000

int c_ubox_cpu_a;       // 0x7070e0
int c_ubox_cpu_b;       // 0x202080
int c_ubox_cpu_c;       // 0x8080f0
int c_ubox_cpu_d;       // 0x000060

int c_ubox_mem_a;       // 0xffaf4f
int c_ubox_mem_b;       // 0xff7700
int c_ubox_mem_c;       // 0xffe060
int c_ubox_mem_d;       // 0x806015

int c_ubox_uline;       // 0xb0b0b0
int c_ubox_link;        // 0xffffff
int c_ubox_border;      // 0xe0e0e0
int c_ubox_label;       // 0xffffff

char ** pix_mem;
char ** pix_swp;

int history_interval;
int list_interval;

int quickbar_pos=0; // top
int quickbar_width=256;
int quickbar_halign=0;
int quickbar_windowed=0;