summaryrefslogtreecommitdiffstats
path: root/ScreenManager.c
diff options
context:
space:
mode:
authorSahil Siddiq <icegambit91@gmail.com>2023-01-31 21:20:57 +0530
committerBenBE <BenBE@geshi.org>2023-05-22 12:07:16 +0200
commit87db37966a8969a931fd49ebc2f9709bd27290d9 (patch)
tree9b170d4d5f4648aebf68fa43029a45ca5f9efc6f /ScreenManager.c
parent3fc286257d3f40733d73722a0ea6b2ad1fd1a550 (diff)
Implement logic for '--max-iterations'
* Add '--max-iterations' option to longopts and shortopts * Implement termination logic * Add iterationsRemaining to 'struct Machine' Co-authored-by: BenBE <BenBE@geshi.org>
Diffstat (limited to 'ScreenManager.c')
-rw-r--r--ScreenManager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ScreenManager.c b/ScreenManager.c
index 18e09343..a089eda1 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -246,6 +246,12 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey, con
if (redraw || force_redraw) {
ScreenManager_drawPanels(this, focus, force_redraw);
force_redraw = false;
+ if (this->host->iterationsRemaining != -1) {
+ if (!--this->host->iterationsRemaining) {
+ quit = true;
+ continue;
+ }
+ }
}
int prevCh = ch;

© 2014-2024 Faster IT GmbH | imprint | privacy policy