Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
6d90e58c
Commit
6d90e58c
authored
Feb 27, 2014
by
Hisham Muhammad
Browse files
alignment improvements
parent
953ec712
Changes
19
Show whitespace changes
Inline
Side-by-side
CRT.c
View file @
6d90e58c
...
@@ -123,6 +123,8 @@ int CRT_colors[LAST_COLORELEMENT] = { 0 };
...
@@ -123,6 +123,8 @@ int CRT_colors[LAST_COLORELEMENT] = { 0 };
int
CRT_cursorX
=
0
;
int
CRT_cursorX
=
0
;
int
CRT_scrollHAmount
=
5
;
char
*
CRT_termType
;
char
*
CRT_termType
;
void
*
backtraceArray
[
128
];
void
*
backtraceArray
[
128
];
...
@@ -173,6 +175,10 @@ void CRT_init(int delay, int colorScheme) {
...
@@ -173,6 +175,10 @@ void CRT_init(int delay, int colorScheme) {
CRT_hasColors
=
false
;
CRT_hasColors
=
false
;
}
}
CRT_termType
=
getenv
(
"TERM"
);
CRT_termType
=
getenv
(
"TERM"
);
if
(
String_eq
(
CRT_termType
,
"linux"
))
CRT_scrollHAmount
=
20
;
else
CRT_scrollHAmount
=
5
;
if
(
String_eq
(
CRT_termType
,
"xterm"
)
||
String_eq
(
CRT_termType
,
"xterm-color"
)
||
String_eq
(
CRT_termType
,
"vt220"
))
{
if
(
String_eq
(
CRT_termType
,
"xterm"
)
||
String_eq
(
CRT_termType
,
"xterm-color"
)
||
String_eq
(
CRT_termType
,
"vt220"
))
{
define_key
(
"
\033
[H"
,
KEY_HOME
);
define_key
(
"
\033
[H"
,
KEY_HOME
);
define_key
(
"
\033
[F"
,
KEY_END
);
define_key
(
"
\033
[F"
,
KEY_END
);
...
...
CRT.h
View file @
6d90e58c
...
@@ -109,6 +109,8 @@ extern int CRT_colors[LAST_COLORELEMENT];
...
@@ -109,6 +109,8 @@ extern int CRT_colors[LAST_COLORELEMENT];
extern
int
CRT_cursorX
;
extern
int
CRT_cursorX
;
extern
int
CRT_scrollHAmount
;
char
*
CRT_termType
;
char
*
CRT_termType
;
void
*
backtraceArray
[
128
];
void
*
backtraceArray
[
128
];
...
...
CheckItem.c
View file @
6d90e58c
...
@@ -18,8 +18,8 @@ in the source distribution for its full text.
...
@@ -18,8 +18,8 @@ in the source distribution for its full text.
typedef struct CheckItem_ {
typedef struct CheckItem_ {
Object super;
Object super;
char* text;
char* text;
bool value;
bool* ref;
bool* ref;
bool value;
} CheckItem;
} CheckItem;
}*/
}*/
...
...
CheckItem.h
View file @
6d90e58c
...
@@ -14,8 +14,8 @@ in the source distribution for its full text.
...
@@ -14,8 +14,8 @@ in the source distribution for its full text.
typedef
struct
CheckItem_
{
typedef
struct
CheckItem_
{
Object
super
;
Object
super
;
char
*
text
;
char
*
text
;
bool
value
;
bool
*
ref
;
bool
*
ref
;
bool
value
;
}
CheckItem
;
}
CheckItem
;
...
...
Header.c
View file @
6d90e58c
...
@@ -37,9 +37,9 @@ typedef struct Header_ {
...
@@ -37,9 +37,9 @@ typedef struct Header_ {
Vector* leftMeters;
Vector* leftMeters;
Vector* rightMeters;
Vector* rightMeters;
ProcessList* pl;
ProcessList* pl;
bool margin;
int height;
int height;
int pad;
int pad;
bool margin;
} Header;
} Header;
}*/
}*/
...
...
Header.h
View file @
6d90e58c
...
@@ -21,9 +21,9 @@ typedef struct Header_ {
...
@@ -21,9 +21,9 @@ typedef struct Header_ {
Vector
*
leftMeters
;
Vector
*
leftMeters
;
Vector
*
rightMeters
;
Vector
*
rightMeters
;
ProcessList
*
pl
;
ProcessList
*
pl
;
bool
margin
;
int
height
;
int
height
;
int
pad
;
int
pad
;
bool
margin
;
}
Header
;
}
Header
;
...
...
Meter.c
View file @
6d90e58c
...
@@ -143,6 +143,7 @@ MeterClass* Meter_types[] = {
...
@@ -143,6 +143,7 @@ MeterClass* Meter_types[] = {
&
RightCPUsMeter_class
,
&
RightCPUsMeter_class
,
&
LeftCPUs2Meter_class
,
&
LeftCPUs2Meter_class
,
&
RightCPUs2Meter_class
,
&
RightCPUs2Meter_class
,
&
BlankMeter_class
,
NULL
NULL
};
};
...
@@ -470,3 +471,33 @@ MeterMode* Meter_modes[] = {
...
@@ -470,3 +471,33 @@ MeterMode* Meter_modes[] = {
&
LEDMeterMode
,
&
LEDMeterMode
,
NULL
NULL
};
};
/* Blank meter */
static
void
BlankMeter_setValues
(
Meter
*
this
,
char
*
buffer
,
int
size
)
{
(
void
)
this
;
(
void
)
buffer
;
(
void
)
size
;
}
static
void
BlankMeter_display
(
Object
*
cast
,
RichString
*
out
)
{
(
void
)
cast
;
RichString_prune
(
out
);
}
int
BlankMeter_attributes
[]
=
{
DEFAULT_COLOR
};
MeterClass
BlankMeter_class
=
{
.
super
=
{
.
extends
=
Class
(
Meter
),
.
delete
=
Meter_delete
,
.
display
=
BlankMeter_display
,
},
.
setValues
=
BlankMeter_setValues
,
.
defaultMode
=
TEXT_METERMODE
,
.
total
=
100
.
0
,
.
attributes
=
BlankMeter_attributes
,
.
name
=
"Blank"
,
.
uiName
=
"Blank"
,
.
caption
=
""
};
Meter.h
View file @
6d90e58c
...
@@ -123,4 +123,10 @@ ListItem* Meter_toListItem(Meter* this);
...
@@ -123,4 +123,10 @@ ListItem* Meter_toListItem(Meter* this);
extern
MeterMode
*
Meter_modes
[];
extern
MeterMode
*
Meter_modes
[];
/* Blank meter */
extern
int
BlankMeter_attributes
[];
extern
MeterClass
BlankMeter_class
;
#endif
#endif
OpenFilesScreen.c
View file @
6d90e58c
...
@@ -29,9 +29,9 @@ in the source distribution for its full text.
...
@@ -29,9 +29,9 @@ in the source distribution for its full text.
#include "FunctionBar.h"
#include "FunctionBar.h"
typedef struct OpenFiles_ProcessData_ {
typedef struct OpenFiles_ProcessData_ {
char* data[256];
struct OpenFiles_FileData_* files;
struct OpenFiles_FileData_* files;
int error;
int error;
char* data[256];
} OpenFiles_ProcessData;
} OpenFiles_ProcessData;
typedef struct OpenFiles_FileData_ {
typedef struct OpenFiles_FileData_ {
...
...
OpenFilesScreen.h
View file @
6d90e58c
...
@@ -14,9 +14,9 @@ in the source distribution for its full text.
...
@@ -14,9 +14,9 @@ in the source distribution for its full text.
#include "FunctionBar.h"
#include "FunctionBar.h"
typedef
struct
OpenFiles_ProcessData_
{
typedef
struct
OpenFiles_ProcessData_
{
char
*
data
[
256
];
struct
OpenFiles_FileData_
*
files
;
struct
OpenFiles_FileData_
*
files
;
int
error
;
int
error
;
char
*
data
[
256
];
}
OpenFiles_ProcessData
;
}
OpenFiles_ProcessData
;
typedef
struct
OpenFiles_FileData_
{
typedef
struct
OpenFiles_FileData_
{
...
...
Panel.c
View file @
6d90e58c
...
@@ -53,12 +53,12 @@ struct Panel_ {
...
@@ -53,12 +53,12 @@ struct Panel_ {
WINDOW* window;
WINDOW* window;
Vector* items;
Vector* items;
int selected;
int selected;
int scrollV, scrollH;
int scrollHAmount;
int oldSelected;
int oldSelected;
char* eventHandlerBuffer;
int scrollV;
short scrollH;
bool needsRedraw;
bool needsRedraw;
RichString header;
RichString header;
char* eventHandlerBuffer;
};
};
}*/
}*/
...
@@ -110,10 +110,6 @@ void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool
...
@@ -110,10 +110,6 @@ void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool
this
->
oldSelected
=
0
;
this
->
oldSelected
=
0
;
this
->
needsRedraw
=
true
;
this
->
needsRedraw
=
true
;
RichString_beginAllocated
(
this
->
header
);
RichString_beginAllocated
(
this
->
header
);
if
(
String_eq
(
CRT_termType
,
"linux"
))
this
->
scrollHAmount
=
20
;
else
this
->
scrollHAmount
=
5
;
}
}
void
Panel_done
(
Panel
*
this
)
{
void
Panel_done
(
Panel
*
this
)
{
...
@@ -299,18 +295,16 @@ void Panel_draw(Panel* this, bool focus) {
...
@@ -299,18 +295,16 @@ void Panel_draw(Panel* this, bool focus) {
Object_display
(
itemObj
,
&
item
);
Object_display
(
itemObj
,
&
item
);
int
itemLen
=
RichString_sizeVal
(
item
);
int
itemLen
=
RichString_sizeVal
(
item
);
int
amt
=
MIN
(
itemLen
-
scrollH
,
this
->
w
);
int
amt
=
MIN
(
itemLen
-
scrollH
,
this
->
w
);
if
(
i
==
this
->
selected
)
{
bool
selected
=
(
i
==
this
->
selected
);
if
(
selected
)
{
attrset
(
highlight
);
attrset
(
highlight
);
RichString_setAttr
(
&
item
,
highlight
);
RichString_setAttr
(
&
item
,
highlight
);
mvhline
(
y
+
j
,
x
+
0
,
' '
,
this
->
w
);
}
mvhline
(
y
+
j
,
x
,
' '
,
this
->
w
);
if
(
amt
>
0
)
if
(
amt
>
0
)
RichString_printoffnVal
(
item
,
y
+
j
,
x
+
0
,
scrollH
,
amt
);
RichString_printoffnVal
(
item
,
y
+
j
,
x
,
scrollH
,
amt
);
if
(
selected
)
attrset
(
CRT_colors
[
RESET_COLOR
]);
attrset
(
CRT_colors
[
RESET_COLOR
]);
}
else
{
mvhline
(
y
+
j
,
x
+
0
,
' '
,
this
->
w
);
if
(
amt
>
0
)
RichString_printoffnVal
(
item
,
y
+
j
,
x
+
0
,
scrollH
,
amt
);
}
RichString_end
(
item
);
RichString_end
(
item
);
}
}
for
(
int
i
=
y
+
(
last
-
first
);
i
<
y
+
this
->
h
;
i
++
)
for
(
int
i
=
y
+
(
last
-
first
);
i
<
y
+
this
->
h
;
i
++
)
...
@@ -330,13 +324,13 @@ void Panel_draw(Panel* this, bool focus) {
...
@@ -330,13 +324,13 @@ void Panel_draw(Panel* this, bool focus) {
mvhline
(
y
+
this
->
oldSelected
-
this
->
scrollV
,
x
+
0
,
' '
,
this
->
w
);
mvhline
(
y
+
this
->
oldSelected
-
this
->
scrollV
,
x
+
0
,
' '
,
this
->
w
);
if
(
scrollH
<
oldLen
)
if
(
scrollH
<
oldLen
)
RichString_printoffnVal
(
old
,
y
+
this
->
oldSelected
-
this
->
scrollV
,
x
,
RichString_printoffnVal
(
old
,
y
+
this
->
oldSelected
-
this
->
scrollV
,
x
,
this
->
scrollH
,
MIN
(
oldLen
-
scrollH
,
this
->
w
));
scrollH
,
MIN
(
oldLen
-
scrollH
,
this
->
w
));
attrset
(
highlight
);
attrset
(
highlight
);
mvhline
(
y
+
this
->
selected
-
this
->
scrollV
,
x
+
0
,
' '
,
this
->
w
);
mvhline
(
y
+
this
->
selected
-
this
->
scrollV
,
x
+
0
,
' '
,
this
->
w
);
RichString_setAttr
(
&
new
,
highlight
);
RichString_setAttr
(
&
new
,
highlight
);
if
(
scrollH
<
newLen
)
if
(
scrollH
<
newLen
)
RichString_printoffnVal
(
new
,
y
+
this
->
selected
-
this
->
scrollV
,
x
,
RichString_printoffnVal
(
new
,
y
+
this
->
selected
-
this
->
scrollV
,
x
,
this
->
scrollH
,
MIN
(
newLen
-
scrollH
,
this
->
w
));
scrollH
,
MIN
(
newLen
-
scrollH
,
this
->
w
));
attrset
(
CRT_colors
[
RESET_COLOR
]);
attrset
(
CRT_colors
[
RESET_COLOR
]);
RichString_end
(
new
);
RichString_end
(
new
);
RichString_end
(
old
);
RichString_end
(
old
);
...
@@ -383,13 +377,13 @@ bool Panel_onKey(Panel* this, int key) {
...
@@ -383,13 +377,13 @@ bool Panel_onKey(Panel* this, int key) {
case
KEY_LEFT
:
case
KEY_LEFT
:
case
KEY_CTRLB
:
case
KEY_CTRLB
:
if
(
this
->
scrollH
>
0
)
{
if
(
this
->
scrollH
>
0
)
{
this
->
scrollH
-=
5
;
this
->
scrollH
-=
CRT_scrollHAmount
;
this
->
needsRedraw
=
true
;
this
->
needsRedraw
=
true
;
}
}
return
true
;
return
true
;
case
KEY_RIGHT
:
case
KEY_RIGHT
:
case
KEY_CTRLF
:
case
KEY_CTRLF
:
this
->
scrollH
+=
5
;
this
->
scrollH
+=
CRT_scrollHAmount
;
this
->
needsRedraw
=
true
;
this
->
needsRedraw
=
true
;
return
true
;
return
true
;
case
KEY_PPAGE
:
case
KEY_PPAGE
:
...
...
Panel.h
View file @
6d90e58c
...
@@ -42,12 +42,12 @@ struct Panel_ {
...
@@ -42,12 +42,12 @@ struct Panel_ {
WINDOW
*
window
;
WINDOW
*
window
;
Vector
*
items
;
Vector
*
items
;
int
selected
;
int
selected
;
int
scrollV
,
scrollH
;
int
scrollHAmount
;
int
oldSelected
;
int
oldSelected
;
char
*
eventHandlerBuffer
;
int
scrollV
;
short
scrollH
;
bool
needsRedraw
;
bool
needsRedraw
;
RichString
header
;
RichString
header
;
char
*
eventHandlerBuffer
;
};
};
...
...
Process.c
View file @
6d90e58c
...
@@ -94,7 +94,6 @@ typedef struct Process_ {
...
@@ -94,7 +94,6 @@ typedef struct Process_ {
Object super;
Object super;
struct ProcessList_ *pl;
struct ProcessList_ *pl;
bool updated;
pid_t pid;
pid_t pid;
char* comm;
char* comm;
...
@@ -110,12 +109,12 @@ typedef struct Process_ {
...
@@ -110,12 +109,12 @@ typedef struct Process_ {
pid_t tgid;
pid_t tgid;
int tpgid;
int tpgid;
unsigned long int flags;
unsigned long int flags;
#ifdef DEBUG
u
nsigned long int minflt
;
u
id_t st_uid
;
unsigned long int cminflt
;
float percent_cpu
;
unsigned long int majflt
;
float percent_mem
;
unsigned long int cmajflt
;
char* user
;
#endif
unsigned long long int utime;
unsigned long long int utime;
unsigned long long int stime;
unsigned long long int stime;
unsigned long long int cutime;
unsigned long long int cutime;
...
@@ -126,25 +125,21 @@ typedef struct Process_ {
...
@@ -126,25 +125,21 @@ typedef struct Process_ {
IOPriority ioPriority;
IOPriority ioPriority;
char starttime_show[8];
char starttime_show[8];
time_t starttime_ctime;
time_t starttime_ctime;
#ifdef DEBUG
long int itrealvalue;
#ifdef HAVE_TASKSTATS
unsigned long int vsize;
unsigned long long io_rchar;
long int rss;
unsigned long long io_wchar;
unsigned long int rlim;
unsigned long long io_syscr;
unsigned long int startcode;
unsigned long long io_syscw;
unsigned long int endcode;
unsigned long long io_read_bytes;
unsigned long int startstack;
unsigned long long io_write_bytes;
unsigned long int kstkesp;
unsigned long long io_cancelled_write_bytes;
unsigned long int kstkeip;
double io_rate_read_bps;
unsigned long int signal;
unsigned long long io_rate_read_time;
unsigned long int blocked;
double io_rate_write_bps;
unsigned long int sigignore;
unsigned long long io_rate_write_time;
unsigned long int sigcatch;
unsigned long int wchan;
unsigned long int nswap;
unsigned long int cnswap;
#endif
#endif
int exit_signal;
int processor;
int processor;
int m_size;
int m_size;
int m_resident;
int m_resident;
...
@@ -153,10 +148,7 @@ typedef struct Process_ {
...
@@ -153,10 +148,7 @@ typedef struct Process_ {
int m_drs;
int m_drs;
int m_lrs;
int m_lrs;
int m_dt;
int m_dt;
uid_t st_uid;
float percent_cpu;
float percent_mem;
char* user;
#ifdef HAVE_OPENVZ
#ifdef HAVE_OPENVZ
unsigned int ctid;
unsigned int ctid;
unsigned int vpid;
unsigned int vpid;
...
@@ -164,25 +156,40 @@ typedef struct Process_ {
...
@@ -164,25 +156,40 @@ typedef struct Process_ {
#ifdef HAVE_VSERVER
#ifdef HAVE_VSERVER
unsigned int vxid;
unsigned int vxid;
#endif
#endif
#ifdef HAVE_TASKSTATS
unsigned long long io_rchar;
unsigned long long io_wchar;
unsigned long long io_syscr;
unsigned long long io_syscw;
unsigned long long io_read_bytes;
unsigned long long io_write_bytes;
unsigned long long io_cancelled_write_bytes;
double io_rate_read_bps;
unsigned long long io_rate_read_time;
double io_rate_write_bps;
unsigned long long io_rate_write_time;
#endif
#ifdef HAVE_CGROUP
#ifdef HAVE_CGROUP
char* cgroup;
char* cgroup;
#endif
#endif
#ifdef HAVE_OOM
#ifdef HAVE_OOM
unsigned int oom;
unsigned int oom;
#endif
#endif
int exit_signal;
bool updated;
#ifdef DEBUG
unsigned long int minflt;
unsigned long int cminflt;
unsigned long int majflt;
unsigned long int cmajflt;
long int itrealvalue;
unsigned long int vsize;
long int rss;
unsigned long int rlim;
unsigned long int startcode;
unsigned long int endcode;
unsigned long int startstack;
unsigned long int kstkesp;
unsigned long int kstkeip;
unsigned long int signal;
unsigned long int blocked;
unsigned long int sigignore;
unsigned long int sigcatch;
unsigned long int wchan;
unsigned long int nswap;
unsigned long int cnswap;
#endif
} Process;
} Process;
}*/
}*/
...
...
Process.h
View file @
6d90e58c
...
@@ -73,7 +73,6 @@ typedef struct Process_ {
...
@@ -73,7 +73,6 @@ typedef struct Process_ {
Object
super
;
Object
super
;
struct
ProcessList_
*
pl
;
struct
ProcessList_
*
pl
;
bool
updated
;
pid_t
pid
;
pid_t
pid
;
char
*
comm
;
char
*
comm
;
...
@@ -89,12 +88,12 @@ typedef struct Process_ {
...
@@ -89,12 +88,12 @@ typedef struct Process_ {
pid_t
tgid
;
pid_t
tgid
;
int
tpgid
;
int
tpgid
;
unsigned
long
int
flags
;
unsigned
long
int
flags
;
#ifdef DEBUG
u
nsigned
long
int
minflt
;
u
id_t
st_uid
;
unsigned
long
int
cminflt
;
float
percent_cpu
;
unsigned
long
int
majflt
;
float
percent_mem
;
unsigned
long
int
cmajflt
;
char
*
user
;
#endif
unsigned
long
long
int
utime
;
unsigned
long
long
int
utime
;
unsigned
long
long
int
stime
;
unsigned
long
long
int
stime
;
unsigned
long
long
int
cutime
;
unsigned
long
long
int
cutime
;
...
@@ -105,25 +104,21 @@ typedef struct Process_ {
...
@@ -105,25 +104,21 @@ typedef struct Process_ {
IOPriority
ioPriority
;
IOPriority
ioPriority
;
char
starttime_show
[
8
];
char
starttime_show
[
8
];
time_t
starttime_ctime
;
time_t
starttime_ctime
;
#ifdef DEBUG
long
int
itrealvalue
;
#ifdef HAVE_TASKSTATS
unsigned
long
int
vsize
;
unsigned
long
long
io_rchar
;
long
int
rss
;
unsigned
long
long
io_wchar
;
unsigned
long
int
rlim
;
unsigned
long
long
io_syscr
;
unsigned
long
int
startcode
;
unsigned
long
long
io_syscw
;
unsigned
long
int
endcode
;
unsigned
long
long
io_read_bytes
;
unsigned
long
int
startstack
;
unsigned
long
long
io_write_bytes
;
unsigned
long
int
kstkesp
;
unsigned
long
long
io_cancelled_write_bytes
;
unsigned
long
int
kstkeip
;
double
io_rate_read_bps
;
unsigned
long
int
signal
;
unsigned
long
long
io_rate_read_time
;
unsigned
long
int
blocked
;
double
io_rate_write_bps
;
unsigned
long
int
sigignore
;
unsigned
long
long
io_rate_write_time
;
unsigned
long
int
sigcatch
;
unsigned
long
int
wchan
;
unsigned
long
int
nswap
;
unsigned
long
int
cnswap
;
#endif
#endif
int
exit_signal
;
int
processor
;
int
processor
;
int
m_size
;
int
m_size
;
int
m_resident
;
int
m_resident
;
...
@@ -132,10 +127,7 @@ typedef struct Process_ {
...
@@ -132,10 +127,7 @@ typedef struct Process_ {
int
m_drs
;
int
m_drs
;
int
m_lrs
;
int
m_lrs
;
int
m_dt
;
int
m_dt
;
uid_t
st_uid
;
float
percent_cpu
;
float
percent_mem
;
char
*
user
;
#ifdef HAVE_OPENVZ
#ifdef HAVE_OPENVZ
unsigned
int
ctid
;
unsigned
int
ctid
;
unsigned
int
vpid
;
unsigned
int
vpid
;
...
@@ -143,25 +135,40 @@ typedef struct Process_ {
...
@@ -143,25 +135,40 @@ typedef struct Process_ {
#ifdef HAVE_VSERVER
#ifdef HAVE_VSERVER
unsigned
int
vxid
;
unsigned
int
vxid
;
#endif
#endif
#ifdef HAVE_TASKSTATS
unsigned
long
long
io_rchar
;
unsigned
long
long
io_wchar
;
unsigned
long
long
io_syscr
;
unsigned
long
long
io_syscw
;
unsigned
long
long
io_read_bytes
;
unsigned
long
long
io_write_bytes
;
unsigned
long
long
io_cancelled_write_bytes
;
double
io_rate_read_bps
;
unsigned
long
long
io_rate_read_time
;
double
io_rate_write_bps
;
unsigned
long
long
io_rate_write_time
;
#endif
#ifdef HAVE_CGROUP
#ifdef HAVE_CGROUP
char
*
cgroup
;
char
*
cgroup
;
#endif
#endif
#ifdef HAVE_OOM
#ifdef HAVE_OOM
unsigned
int
oom
;
unsigned
int
oom
;
#endif
#endif
int
exit_signal
;
bool
updated
;
#ifdef DEBUG
unsigned
long
int
minflt
;
unsigned
long
int
cminflt
;
unsigned
long
int
majflt
;
unsigned
long
int
cmajflt
;
long
int
itrealvalue
;
unsigned
long
int
vsize
;
long
int
rss
;
unsigned
long
int
rlim
;
unsigned
long
int
startcode
;
unsigned
long
int
endcode
;
unsigned
long
int
startstack
;
unsigned
long
int
kstkesp
;
unsigned
long
int
kstkeip
;
unsigned
long
int
signal
;
unsigned
long
int
blocked
;
unsigned
long
int
sigignore
;
unsigned
long
int
sigcatch
;
unsigned
long
int
wchan
;
unsigned
long
int
nswap
;
unsigned
long
int
cnswap
;
#endif
}
Process
;
}
Process
;
...
@@ -178,6 +185,9 @@ void Process_getMaxPid();
...
@@ -178,6 +185,9 @@ void Process_getMaxPid();
#define ONE_M (ONE_K * ONE_K)
#define ONE_M (ONE_K * ONE_K)
#define ONE_G (ONE_M * ONE_K)
#define ONE_G (ONE_M * ONE_K)
#define ONE_DECIMAL_K 1000
#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K)
void
Process_delete
(
Object
*
cast
);
void
Process_delete
(
Object
*
cast
);
extern
ObjectClass
Process_class
;
extern
ObjectClass
Process_class
;
...
...
ProcessList.c
View file @
6d90e58c
...
@@ -99,6 +99,7 @@ typedef struct CPUData_ {
...
@@ -99,6 +99,7 @@ typedef struct CPUData_ {
} CPUData;
} CPUData;
typedef struct ProcessList_ {
typedef struct ProcessList_ {
const char **treeStr;
Vector* processes;
Vector* processes;
Vector* processes2;
Vector* processes2;
Hashtable* processTable;
Hashtable* processTable;
...
@@ -106,7 +107,6 @@ typedef struct ProcessList_ {
...
@@ -106,7 +107,6 @@ typedef struct ProcessList_ {
Panel* panel;
Panel* panel;
int following;
int following;
bool userOnly;
uid_t userId;
uid_t userId;
const char* incFilter;
const char* incFilter;
Hashtable* pidWhiteList;
Hashtable* pidWhiteList;
...
@@ -151,7 +151,7 @@ typedef struct ProcessList_ {
...
@@ -151,7 +151,7 @@ typedef struct ProcessList_ {
bool countCPUsFromZero;
bool countCPUsFromZero;
bool updateProcessNames;
bool updateProcessNames;
bool accountGuestInCPUMeter;
bool accountGuestInCPUMeter;
const char **treeStr
;
bool userOnly
;
} ProcessList;
} ProcessList;
...
...
ProcessList.h
View file @
6d90e58c
...
@@ -79,6 +79,7 @@ typedef struct CPUData_ {
...
@@ -79,6 +79,7 @@ typedef struct CPUData_ {
}
CPUData
;
}
CPUData
;
typedef
struct
ProcessList_
{
typedef
struct
ProcessList_
{
const
char
**
treeStr
;
Vector
*
processes
;
Vector
*
processes
;
Vector
*
processes2
;
Vector
*
processes2
;
Hashtable
*
processTable
;
Hashtable
*
processTable
;
...
@@ -86,7 +87,6 @@ typedef struct ProcessList_ {
...
@@ -86,7 +87,6 @@ typedef struct ProcessList_ {
Panel
*
panel
;
Panel
*
panel
;
int
following
;
int
following
;
bool
userOnly
;
uid_t
userId
;
uid_t
userId
;
const
char
*
incFilter
;
const
char
*
incFilter
;
Hashtable
*
pidWhiteList
;
Hashtable
*
pidWhiteList
;
...
@@ -131,7 +131,7 @@ typedef struct ProcessList_ {
...
@@ -131,7 +131,7 @@ typedef struct ProcessList_ {
bool
countCPUsFromZero
;
bool
countCPUsFromZero
;
bool
updateProcessNames
;
bool
updateProcessNames
;
bool
accountGuestInCPUMeter
;
bool
accountGuestInCPUMeter
;
const
char
**
treeStr
;
bool
userOnly
;
}
ProcessList
;
}
ProcessList
;
...
...
RichString.c
View file @
6d90e58c
...
@@ -154,6 +154,7 @@ void RichString_prune(RichString* this) {
...
@@ -154,6 +154,7 @@ void RichString_prune(RichString* this) {
free
(
this
->
chptr
);
free
(
this
->
chptr
);
this
->
chptr
=
this
->
chstr
;
this
->
chptr
=
this
->
chstr
;
this
->
chlen
=
0
;
this
->
chlen
=
0
;
RichString_setChar
(
this
,
0
,
0
);
}
}
void
RichString_setAttr
(
RichString
*
this
,
int
attrs
)
{
void
RichString_setAttr
(
RichString
*
this
,
int
attrs
)
{
...
...
Settings.c
View file @
6d90e58c
...
@@ -27,8 +27,8 @@ typedef struct Settings_ {
...
@@ -27,8 +27,8 @@ typedef struct Settings_ {
ProcessList* pl;
ProcessList* pl;
Header* header;
Header* header;
int colorScheme;
int colorScheme;
bool changed;
int delay;
int delay;
bool changed;
} Settings;
} Settings;
}*/
}*/
...
...
Settings.h
View file @
6d90e58c
...
@@ -20,8 +20,8 @@ typedef struct Settings_ {
...
@@ -20,8 +20,8 @@ typedef struct Settings_ {
ProcessList
*
pl
;
ProcessList
*
pl
;
Header
*
header
;
Header
*
header
;
int
colorScheme
;
int
colorScheme
;
bool
changed
;
int
delay
;
int
delay
;
bool
changed
;
}
Settings
;
}
Settings
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment