1 /*
2  * %CopyrightBegin%
3  *
4  * Copyright Ericsson AB 1998-2016. All Rights Reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * %CopyrightEnd%
19  */
20 #ifndef _ERLSRV_REGISTRY_H
21 #define _ERLSRV_REGISTRY_H
22 
23 typedef struct _reg_entry {
24   wchar_t *name;
25   DWORD type;
26   union {
27     wchar_t *string;
28     DWORD value;
29     struct {
30       wchar_t *string;
31       wchar_t *unexpanded;
32     } expand;
33   } data;
34 } RegEntry;
35 
36 typedef struct _reg_entry_desc {
37   wchar_t *servicename;
38   RegEntry *entries;
39 } RegEntryDesc;
40 
41 enum {
42   StopAction,
43   OnFail,
44   Machine,
45   Env,
46   WorkDir,
47   Priority,
48   SName,
49   Name,
50   Args,
51   DebugType,
52   InternalServiceName,
53   Comment
54 };
55 
56 #define ON_FAIL_IGNORE 0
57 #define ON_FAIL_RESTART 1
58 #define ON_FAIL_REBOOT 2
59 #define ON_FAIL_RESTART_ALWAYS 3
60 
61 #define DEBUG_TYPE_NO_DEBUG 0
62 #define DEBUG_TYPE_NEW 1
63 #define DEBUG_TYPE_REUSE 2
64 #define DEBUG_TYPE_CONSOLE 3
65 
66 extern int num_reg_entries;
67 
68 RegEntry *empty_reg_tab(void);
69 void free_keys(RegEntry *keys);
70 void free_all_keys(RegEntryDesc *descs);
71 RegEntry *get_keys(wchar_t *servicename);
72 int set_keys(wchar_t *servicename, RegEntry *keys);
73 RegEntryDesc *get_all_keys(void);
74 int remove_keys(wchar_t *servicename);
75 int register_logkeys(void);
76 #endif /* _ERLSRV_REGISTRY_H */
77 
78