From 6876abb0a01800bd275c5559c7d2b1e2fe68e725 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 22 Jul 2016 14:25:37 +0100 Subject: [PATCH] Export hook strings. --- gui.cpp | 5 +++-- hook.cpp | 3 +++ settings.cpp | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gui.cpp b/gui.cpp index 148314c..d07af68 100644 --- a/gui.cpp +++ b/gui.cpp @@ -1,9 +1,10 @@ #include "nssm.h" +extern const TCHAR *hook_event_strings[]; +extern const TCHAR *hook_action_strings[]; + static enum { NSSM_TAB_APPLICATION, NSSM_TAB_DETAILS, NSSM_TAB_LOGON, NSSM_TAB_DEPENDENCIES, NSSM_TAB_PROCESS, NSSM_TAB_SHUTDOWN, NSSM_TAB_EXIT, NSSM_TAB_IO, NSSM_TAB_ROTATION, NSSM_TAB_ENVIRONMENT, NSSM_TAB_HOOKS, NSSM_NUM_TABS } nssm_tabs; static HWND tablist[NSSM_NUM_TABS]; -static const TCHAR *hook_event_strings[] = { NSSM_HOOK_EVENT_START, NSSM_HOOK_EVENT_STOP, NSSM_HOOK_EVENT_EXIT, NSSM_HOOK_EVENT_POWER, NSSM_HOOK_EVENT_ROTATE, NULL }; -static const TCHAR *hook_action_strings[] = { NSSM_HOOK_ACTION_PRE, NSSM_HOOK_ACTION_POST, NSSM_HOOK_ACTION_CHANGE, NSSM_HOOK_ACTION_RESUME, NULL }; static int selected_tab; static HWND dialog(const TCHAR *templ, HWND parent, DLGPROC function, LPARAM l) { diff --git a/hook.cpp b/hook.cpp index dc9e02f..6671d3b 100644 --- a/hook.cpp +++ b/hook.cpp @@ -9,6 +9,9 @@ typedef struct { kill_t k; } hook_t; +const TCHAR *hook_event_strings[] = { NSSM_HOOK_EVENT_START, NSSM_HOOK_EVENT_STOP, NSSM_HOOK_EVENT_EXIT, NSSM_HOOK_EVENT_POWER, NSSM_HOOK_EVENT_ROTATE, NULL }; +const TCHAR *hook_action_strings[] = { NSSM_HOOK_ACTION_PRE, NSSM_HOOK_ACTION_POST, NSSM_HOOK_ACTION_CHANGE, NSSM_HOOK_ACTION_RESUME, NULL }; + static unsigned long WINAPI await_hook(void *arg) { hook_t *hook = (hook_t *) arg; if (! hook) return NSSM_HOOK_STATUS_ERROR; diff --git a/settings.cpp b/settings.cpp index d978909..a144f3c 100644 --- a/settings.cpp +++ b/settings.cpp @@ -7,6 +7,8 @@ extern const TCHAR *exit_action_strings[]; extern const TCHAR *startup_strings[]; extern const TCHAR *priority_strings[]; +extern const TCHAR *hook_event_strings[]; +extern const TCHAR *hook_action_strings[]; /* Does the parameter refer to the default value of the setting? */ static inline int is_default(const TCHAR *value) { -- 2.7.4