Browse Source

Export hook strings.

Iain Patterson 5 years ago
parent
commit
6876abb0a0
3 changed files with 8 additions and 2 deletions
  1. 3 2
      gui.cpp
  2. 3 0
      hook.cpp
  3. 2 0
      settings.cpp

+ 3 - 2
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) {

+ 3 - 0
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;

+ 2 - 0
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) {