| 1703 | } |
| 1704 | |
| 1705 | static bool main_hook_options(int argc, char **argv, const char **event_out, |
| 1706 | const char **dialect_out) { |
| 1707 | if (!argv || !event_out || !dialect_out) { |
| 1708 | return false; |
| 1709 | } |
| 1710 | *event_out = NULL; |
| 1711 | *dialect_out = NULL; |
| 1712 | int hook_index = -1; |
| 1713 | for (int index = 1; index < argc; index++) { |
| 1714 | if (argv[index] && strcmp(argv[index], "hook-augment") == 0) { |
| 1715 | hook_index = index; |
| 1716 | break; |
| 1717 | } |
| 1718 | } |
| 1719 | if (hook_index < 0) { |
| 1720 | return false; |
| 1721 | } |
| 1722 | for (int index = hook_index + 1; index < argc; index++) { |
| 1723 | if (strcmp(argv[index], "--event") == 0 && index + 1 < argc) { |
| 1724 | *event_out = argv[++index]; |
| 1725 | } else if (strcmp(argv[index], "--dialect") == 0 && index + 1 < argc) { |
| 1726 | *dialect_out = argv[++index]; |
| 1727 | } else { |
| 1728 | return false; |
| 1729 | } |
| 1730 | } |
| 1731 | return cbm_hook_augment_invocation_supported(*event_out, *dialect_out); |
| 1732 | } |
| 1733 | |
| 1734 | enum { |
| 1735 | MAIN_DAEMON_CTL_PROBE_TIMEOUT_MS = 3000, |
no test coverage detected