$darkmode
main_commands.hpp File Reference
#include <optional>
#include <string>
#include <vector>
#include <cloe/stack_config.hpp>
#include <cloe/stack_factory.hpp>
#include "lua_setup.hpp"
Include dependency graph for main_commands.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  engine::CheckOptions
 
struct  engine::DumpOptions
 
struct  engine::ProbeOptions
 
struct  engine::RunOptions
 
struct  engine::ShellOptions
 
struct  engine::UsageOptions
 
struct  engine::VersionOptions
 

Functions

int engine::check (const CheckOptions &opt, const std::vector< std::string > &filepaths)
 
int engine::dump (const DumpOptions &opt, const std::vector< std::string > &filepaths)
 
int engine::probe (const ProbeOptions &opt, const std::vector< std::string > &filepaths)
 
int engine::run (const RunOptions &opt, const std::vector< std::string > &filepaths)
 
int engine::shell (const ShellOptions &opt, const std::vector< std::string > &filepaths)
 
int engine::usage (const UsageOptions &opt, const std::string &argument)
 
int engine::version (const VersionOptions &opt)
 
void engine::handle_signal (int sig)
 

Detailed Description

See also
main.cpp

Function Documentation

◆ handle_signal()

void engine::handle_signal ( int  sig)

Handle interrupt signals sent by the operating system.

When this function is called, it cannot call any other functions that might have set any locks, because it might not get the lock, and then the program hangs instead of gracefully exiting. It's a bit sad, true, but that's the way it is.

That is why you cannot make use of the logging in this function. You also cannot make use of triggers, because they also have a lock.

The function immediately resets the signal handler to the default provided by the standard library, so that in the case that we do hang for some reasons, the user can force abort by sending the signal a third time.

Here is the call graph for this function:
Here is the caller graph for this function: