| 1720 | } |
| 1721 | |
| 1722 | static bool main_hook_options(int argc, char **argv, const char **event_out, |
| 1723 | const char **dialect_out) { |
| 1724 | if (!argv || !event_out || !dialect_out) { |
| 1725 | return false; |
| 1726 | } |
| 1727 | *event_out = NULL; |
| 1728 | *dialect_out = NULL; |
| 1729 | int hook_index = -1; |
| 1730 | for (int index = 1; index < argc; index++) { |
| 1731 | if (argv[index] && strcmp(argv[index], "hook-augment") == 0) { |
| 1732 | hook_index = index; |
| 1733 | break; |
| 1734 | } |
| 1735 | } |
| 1736 | if (hook_index < 0) { |
| 1737 | return false; |
| 1738 | } |
| 1739 | for (int index = hook_index + 1; index < argc; index++) { |
| 1740 | if (strcmp(argv[index], "--event") == 0 && index + 1 < argc) { |
| 1741 | *event_out = argv[++index]; |
| 1742 | } else if (strcmp(argv[index], "--dialect") == 0 && index + 1 < argc) { |
| 1743 | *dialect_out = argv[++index]; |
| 1744 | } else { |
| 1745 | return false; |
| 1746 | } |
| 1747 | } |
| 1748 | return cbm_hook_augment_invocation_supported(*event_out, *dialect_out); |
| 1749 | } |
| 1750 | |
| 1751 | enum { |
| 1752 | MAIN_DAEMON_CTL_PROBE_TIMEOUT_MS = 3000, |
no test coverage detected