1 /**
2  * WinPR: Windows Portable Runtime
3  * Windows Registry (.reg file format)
4  *
5  * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 #ifndef REGISTRY_REG_H_
20 #define REGISTRY_REG_H_
21 
22 #include <winpr/registry.h>
23 
24 typedef struct _reg Reg;
25 typedef struct _reg_key RegKey;
26 typedef struct _reg_val RegVal;
27 
28 struct _reg
29 {
30 	FILE* fp;
31 	char* line;
32 	char* next_line;
33 	size_t line_length;
34 	char* buffer;
35 	char* filename;
36 	BOOL read_only;
37 	RegKey* root_key;
38 };
39 
40 struct _reg_val
41 {
42 	char* name;
43 	DWORD type;
44 	RegVal* prev;
45 	RegVal* next;
46 
47 	union reg_data
48 	{
49 		DWORD dword;
50 		char* string;
51 	} data;
52 };
53 
54 struct _reg_key
55 {
56 	char* name;
57 	DWORD type;
58 	RegKey* prev;
59 	RegKey* next;
60 
61 	char* subname;
62 	RegVal* values;
63 	RegKey* subkeys;
64 };
65 
66 Reg* reg_open(BOOL read_only);
67 void reg_close(Reg* reg);
68 
69 #endif
70