Skip to content

Abstract htop main function to allow for a platform binary#575

Merged
natoscott merged 1 commit intohtop-dev:masterfrom
natoscott:refactor-command-line
Mar 25, 2021
Merged

Abstract htop main function to allow for a platform binary#575
natoscott merged 1 commit intohtop-dev:masterfrom
natoscott:refactor-command-line

Conversation

@natoscott
Copy link
Copy Markdown
Member

One review request relating to the PCP platform is to have
a clearly separate binary from the regular htop so that we
have no confusion as to what is being requested to run, to
aid debugging, and a bunch of other good reasons.

This commit renames htop.c to CommandLine.c and provides a
minimal htop main function for 'native' platforms to use.
The PCP version of this will setup libpcp.so and then call
the same CommandLine_run function as regular htop.

Related to #536

@natoscott natoscott added the PCP PCP related issues label Mar 23, 2021
Copy link
Copy Markdown
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Although the noise in Makefile.am is kinda a bit overkill (at least for now).

Comment thread CommandLine.c Outdated

#include "Action.h"
#include "CRT.h"
#include "CommandLine.h"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #include "CommandLine.h" should go right after #include "config.h".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Although the noise in Makefile.am is kinda a bit overkill (at least for now).

Yep - makes more sense once we have the PCP front-end of course.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. That's what I meant with the parens …

@natoscott natoscott force-pushed the refactor-command-line branch from 9d9c49b to ef95534 Compare March 23, 2021 21:20
Comment thread CommandLine.h
@@ -0,0 +1,7 @@
#ifndef HEADER_CommandLine
#define HEADER_CommandLine

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you like to add a Copyright header?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

One review request relating to the PCP platform is to have
a clearly separate binary from the regular htop so that we
have no confusion as to what is being requested to run, to
aid debugging, and a bunch of other good reasons.

This commit renames htop.c to CommandLine.c and provides a
minimal htop main function for 'native' platforms to use.
The PCP version of this will setup libpcp.so and then call
the same CommandLine_run function as regular htop.

Related to htop-dev#536
@natoscott natoscott force-pushed the refactor-command-line branch from ef95534 to 36389fb Compare March 25, 2021 04:56
@natoscott natoscott merged commit 272e726 into htop-dev:master Mar 25, 2021
@natoscott natoscott deleted the refactor-command-line branch March 25, 2021 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PCP PCP related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants