2023-02-11 21:31:08 +01:00
|
|
|
// event.h and event.cpp only contain cpp-side ffi compat code to make event.rs.h a drop-in
|
|
|
|
// replacement. There is no logic still in here that needs to be ported to rust.
|
|
|
|
|
2016-05-18 22:30:21 +00:00
|
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
|
2019-10-13 15:50:48 -07:00
|
|
|
#include "event.h"
|
|
|
|
|
2016-04-28 19:19:50 -07:00
|
|
|
#include <signal.h>
|
2016-04-20 23:00:54 -07:00
|
|
|
#include <unistd.h>
|
2017-02-10 18:47:02 -08:00
|
|
|
|
2016-04-20 23:00:54 -07:00
|
|
|
#include <algorithm>
|
2022-05-28 13:35:17 -07:00
|
|
|
#include <array>
|
2019-02-20 19:36:29 -08:00
|
|
|
#include <atomic>
|
2022-08-20 23:14:48 -07:00
|
|
|
#include <bitset>
|
2016-04-28 19:19:50 -07:00
|
|
|
#include <memory>
|
2015-07-25 23:14:25 +08:00
|
|
|
#include <string>
|
2023-02-10 18:19:22 +01:00
|
|
|
#include <utility>
|
2005-10-06 08:37:08 +10:00
|
|
|
|
|
|
|
#include "common.h"
|
2016-04-28 19:19:50 -07:00
|
|
|
#include "fallback.h" // IWYU pragma: keep
|
2022-08-20 23:14:48 -07:00
|
|
|
#include "flog.h"
|
2015-07-25 23:14:25 +08:00
|
|
|
#include "io.h"
|
2022-08-20 23:14:48 -07:00
|
|
|
#include "maybe.h"
|
2016-04-28 19:19:50 -07:00
|
|
|
#include "parser.h"
|
|
|
|
#include "proc.h"
|
2023-01-14 14:56:24 -08:00
|
|
|
#include "signals.h"
|
2021-04-14 17:17:22 +02:00
|
|
|
#include "termsize.h"
|
2021-05-17 15:33:33 -07:00
|
|
|
#include "wcstringutil.h"
|
2016-04-28 19:19:50 -07:00
|
|
|
#include "wutil.h" // IWYU pragma: keep
|
2006-07-20 08:55:49 +10:00
|
|
|
|
2023-02-11 21:31:08 +01:00
|
|
|
// TODO: Remove after porting functions.cpp to rust
|
2021-05-19 11:29:03 -07:00
|
|
|
const wchar_t *const event_filter_names[] = {L"signal", L"variable", L"exit",
|
|
|
|
L"process-exit", L"job-exit", L"caller-exit",
|
|
|
|
L"generic", nullptr};
|
|
|
|
|
2023-02-11 21:31:08 +01:00
|
|
|
void event_fire_generic(parser_t &parser, const wcstring &name, const wcstring_list_t &args) {
|
|
|
|
std::vector<wcharz_t> ffi_args;
|
|
|
|
for (const auto &arg : args) ffi_args.push_back(arg.c_str());
|
|
|
|
event_fire_generic_ffi(parser, name, ffi_args);
|
2021-05-17 15:33:33 -07:00
|
|
|
}
|