0499dbe711e565c7a726ddc76b2f4b7c0606feca
[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_NAME _T("Name")
8 #define NSSM_NATIVE_OBJECTNAME _T("ObjectName")
9 #define NSSM_NATIVE_STARTUP _T("Start")
10 #define NSSM_NATIVE_TYPE _T("Type")
11
12 /* Are additional arguments needed? */
13 #define ADDITIONAL_GETTING (1 << 0)
14 #define ADDITIONAL_SETTING (1 << 1)
15 #define ADDITIONAL_RESETTING (1 << 2)
16 #define ADDITIONAL_CRLF (1 << 3)
17 #define ADDITIONAL_MANDATORY ADDITIONAL_GETTING|ADDITIONAL_SETTING|ADDITIONAL_RESETTING
18
19 typedef union {
20   unsigned long numeric;
21   TCHAR *string;
22 } value_t;
23
24 typedef int (*setting_function_t)(const TCHAR *, void *, const TCHAR *, void *, value_t *, const TCHAR *);
25
26 typedef struct {
27   const TCHAR *name;
28   unsigned long type;
29   void *default_value;
30   bool native;
31   int additional;
32   setting_function_t set;
33   setting_function_t get;
34 } settings_t;
35
36 int set_setting(const TCHAR *, HKEY, settings_t *, value_t *, const TCHAR *);
37 int set_setting(const TCHAR *, SC_HANDLE, settings_t *, value_t *, const TCHAR *);
38 int get_setting(const TCHAR *, HKEY, settings_t *, value_t *, const TCHAR *);
39 int get_setting(const TCHAR *, SC_HANDLE, settings_t *, value_t *, const TCHAR *);
40
41 #endif