Allow service editing on the command line.
[nssm.git] / settings.h
1 #ifndef SETTINGS_H
2 #define SETTINGS_H
3
4 #define NSSM_NATIVE_DESCRIPTION _T("Description")
5 #define NSSM_NATIVE_DISPLAYNAME _T("DisplayName")
6 #define NSSM_NATIVE_IMAGEPATH _T("ImagePath")
7 #define NSSM_NATIVE_OBJECTNAME _T("ObjectName")
8 #define NSSM_NATIVE_STARTUP _T("Start")
9 #define NSSM_NATIVE_TYPE _T("Type")
10
11 /* Are additional arguments needed? */
12 #define ADDITIONAL_GETTING (1 << 0)
13 #define ADDITIONAL_SETTING (1 << 1)
14 #define ADDITIONAL_RESETTING (1 << 2)
15 #define ADDITIONAL_CRLF (1 << 3)
16 #define ADDITIONAL_MANDATORY ADDITIONAL_GETTING|ADDITIONAL_SETTING|ADDITIONAL_RESETTING
17
18 typedef union {
19   unsigned long numeric;
20   TCHAR *string;
21 } value_t;
22
23 typedef int (*setting_function_t)(const TCHAR *, void *, const TCHAR *, void *, value_t *, const TCHAR *);
24
25 typedef struct {
26   const TCHAR *name;
27   unsigned long type;
28   void *default_value;
29   bool native;
30   int additional;
31   setting_function_t set;
32   setting_function_t get;
33 } settings_t;
34
35 int set_setting(const TCHAR *, HKEY, settings_t *, value_t *, const TCHAR *);
36 int set_setting(const TCHAR *, SC_HANDLE, settings_t *, value_t *, const TCHAR *);
37 int get_setting(const TCHAR *, HKEY, settings_t *, value_t *, const TCHAR *);
38 int get_setting(const TCHAR *, SC_HANDLE, settings_t *, value_t *, const TCHAR *);
39
40 #endif