-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace strategy for SIGINT and refactor a few names
- Loading branch information
1 parent
2d26cf9
commit d7b684c
Showing
10 changed files
with
91 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
#ifndef ESC_DETAIL_SIGNALS | ||
#define ESC_DETAIL_SIGNALS | ||
#pragma once | ||
|
||
#include <atomic> | ||
|
||
namespace esc { | ||
|
||
/// This is set to true when SIGINT is received. This should be periodically | ||
/// checked by your event loop. | ||
extern std::atomic<bool> sigint_flag; | ||
|
||
} // namespace esc | ||
|
||
namespace esc::detail { | ||
|
||
/// Notifies read() and next_state(Initial) that the window has been resized. | ||
/** Used by SIGWINCH handler and accessed in esc/io.cpp. */ | ||
extern bool window_resize_sig; | ||
extern std::atomic<bool> window_resize_sig; | ||
|
||
/// Install signal handlers for SIGWINCH and SIGINT, if sigint is true. | ||
void register_signals(bool sigint); | ||
|
||
} // namespace esc::detail | ||
#endif // ESC_DETAIL_SIGNALS | ||
} // namespace esc::detail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters