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
ae823c37
Commit
ae823c37
authored
Feb 14, 2016
by
Hisham
Browse files
Make unsupported platform build again.
(Thanks @coypoop at #397 for the heads up!)
parent
0b704393
Changes
2
Show whitespace changes
Inline
Side-by-side
unsupported/Platform.c
View file @
ae823c37
...
@@ -19,9 +19,16 @@ in the source distribution for its full text.
...
@@ -19,9 +19,16 @@ in the source distribution for its full text.
/*{
/*{
#include "Action.h"
#include "Action.h"
#include "BatteryMeter.h"
#include "BatteryMeter.h"
#include "SignalsPanel.h"
#include "UnsupportedProcess.h"
#include "UnsupportedProcess.h"
}*/
}*/
SignalItem
Platform_signals
[]
=
{
{
.
name
=
" 0 Cancel"
,
.
number
=
0
},
};
unsigned
int
Platform_numberOfSignals
=
sizeof
(
Platform_signals
)
/
sizeof
(
SignalItem
);
ProcessField
Platform_defaultFields
[]
=
{
PID
,
USER
,
PRIORITY
,
NICE
,
M_SIZE
,
M_RESIDENT
,
STATE
,
PERCENT_CPU
,
PERCENT_MEM
,
TIME
,
COMM
,
0
};
ProcessField
Platform_defaultFields
[]
=
{
PID
,
USER
,
PRIORITY
,
NICE
,
M_SIZE
,
M_RESIDENT
,
STATE
,
PERCENT_CPU
,
PERCENT_MEM
,
TIME
,
COMM
,
0
};
ProcessFieldData
Process_fields
[]
=
{
ProcessFieldData
Process_fields
[]
=
{
...
@@ -79,7 +86,12 @@ void Platform_setBindings(Htop_Action* keys) {
...
@@ -79,7 +86,12 @@ void Platform_setBindings(Htop_Action* keys) {
}
}
int
Platform_numberOfFields
=
100
;
int
Platform_numberOfFields
=
100
;
char
*
Process_pidFormat
=
"%7u "
;
extern
char
Process_pidFormat
[
20
];
ProcessPidColumn
Process_pidColumns
[]
=
{
{
.
id
=
0
,
.
label
=
NULL
},
};
int
Platform_getUptime
()
{
int
Platform_getUptime
()
{
return
0
;
return
0
;
...
@@ -95,42 +107,26 @@ int Platform_getMaxPid() {
...
@@ -95,42 +107,26 @@ int Platform_getMaxPid() {
return
1
;
return
1
;
}
}
void
Process_setupColumnWidths
()
{
int
maxPid
=
Platform_getMaxPid
();
if
(
maxPid
==
-
1
)
return
;
if
(
maxPid
>
99999
)
{
Process_fields
[
PID
].
title
=
" PID "
;
Process_fields
[
PPID
].
title
=
" PPID "
;
Process_fields
[
TPGID
].
title
=
" TPGID "
;
Process_fields
[
TGID
].
title
=
" TGID "
;
Process_fields
[
PGRP
].
title
=
" PGRP "
;
Process_fields
[
SESSION
].
title
=
" SESN "
;
Process_pidFormat
=
"%7u "
;
}
else
{
Process_fields
[
PID
].
title
=
" PID "
;
Process_fields
[
PPID
].
title
=
" PPID "
;
Process_fields
[
TPGID
].
title
=
"TPGID "
;
Process_fields
[
TGID
].
title
=
" TGID "
;
Process_fields
[
PGRP
].
title
=
" PGRP "
;
Process_fields
[
SESSION
].
title
=
" SESN "
;
Process_pidFormat
=
"%5u "
;
}
}
double
Platform_setCPUValues
(
Meter
*
this
,
int
cpu
)
{
double
Platform_setCPUValues
(
Meter
*
this
,
int
cpu
)
{
(
void
)
this
;
(
void
)
cpu
;
return
0
.
0
;
return
0
.
0
;
}
}
void
Platform_setMemoryValues
(
Meter
*
this
)
{
void
Platform_setMemoryValues
(
Meter
*
this
)
{
(
void
)
this
;
}
}
void
Platform_setSwapValues
(
Meter
*
this
)
{
void
Platform_setSwapValues
(
Meter
*
this
)
{
(
void
)
this
;
}
}
bool
Process_isThread
(
Process
*
this
)
{
bool
Process_isThread
(
Process
*
this
)
{
(
void
)
this
;
return
false
;
return
false
;
}
}
char
*
Platform_getProcessEnv
(
pid_t
pid
)
{
char
*
Platform_getProcessEnv
(
pid_t
pid
)
{
(
void
)
pid
;
return
NULL
;
return
NULL
;
}
}
unsupported/Platform.h
View file @
ae823c37
...
@@ -12,8 +12,13 @@ in the source distribution for its full text.
...
@@ -12,8 +12,13 @@ in the source distribution for its full text.
#include "Action.h"
#include "Action.h"
#include "BatteryMeter.h"
#include "BatteryMeter.h"
#include "SignalsPanel.h"
#include "UnsupportedProcess.h"
#include "UnsupportedProcess.h"
extern
SignalItem
Platform_signals
[];
extern
unsigned
int
Platform_numberOfSignals
;
extern
ProcessField
Platform_defaultFields
[];
extern
ProcessField
Platform_defaultFields
[];
extern
ProcessFieldData
Process_fields
[];
extern
ProcessFieldData
Process_fields
[];
...
@@ -23,7 +28,10 @@ extern MeterClass* Platform_meterTypes[];
...
@@ -23,7 +28,10 @@ extern MeterClass* Platform_meterTypes[];
void
Platform_setBindings
(
Htop_Action
*
keys
);
void
Platform_setBindings
(
Htop_Action
*
keys
);
extern
int
Platform_numberOfFields
;
extern
int
Platform_numberOfFields
;
extern
char
*
Process_pidFormat
;
extern
char
Process_pidFormat
[
20
];
extern
ProcessPidColumn
Process_pidColumns
[];
int
Platform_getUptime
();
int
Platform_getUptime
();
...
@@ -31,8 +39,6 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen);
...
@@ -31,8 +39,6 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen);
int
Platform_getMaxPid
();
int
Platform_getMaxPid
();
void
Process_setupColumnWidths
();
double
Platform_setCPUValues
(
Meter
*
this
,
int
cpu
);
double
Platform_setCPUValues
(
Meter
*
this
,
int
cpu
);
void
Platform_setMemoryValues
(
Meter
*
this
);
void
Platform_setMemoryValues
(
Meter
*
this
);
...
...
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