ObjFW  Check-in [4b20f0e12c]

Overview
Comment:OFDNSResolver: Win32: Get hosts path from registry
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4b20f0e12cfc4d31f9f21331ea5d3dd964b1ac0de59ba61f84f3da9abe5ec7bf
User & Date: js on 2018-07-10 21:24:18
Other Links: manifest | tags
Context
2018-07-10
22:58
OFDNSResolver: Get name servers & domain on Win32 check-in: 42bee3f920 user: js tags: trunk
21:24
OFDNSResolver: Win32: Get hosts path from registry check-in: 4b20f0e12c user: js tags: trunk
21:09
OFWindowsRegistryKey: Add convenience methods check-in: 710622bc64 user: js tags: trunk
Changes

Modified src/OFDNSResolver.m from [07800749f7] to [452969d7b3].

23
24
25
26
27
28
29



30
31
32
33
34
35
36
#import "OFDNSResolver.h"
#import "OFArray.h"
#import "OFCharacterSet.h"
#import "OFDictionary.h"
#import "OFFile.h"
#import "OFLocalization.h"
#import "OFString.h"




#import "OFOpenItemFailedException.h"

@interface OFDNSResolver ()
#ifdef OF_HAVE_FILES
- (void)of_parseHosts: (OFString *)path;
- (void)of_parseResolvConf: (OFString *)path;







>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#import "OFDNSResolver.h"
#import "OFArray.h"
#import "OFCharacterSet.h"
#import "OFDictionary.h"
#import "OFFile.h"
#import "OFLocalization.h"
#import "OFString.h"
#ifdef OF_WINDOWS
# import "OFWindowsRegistryKey.h"
#endif

#import "OFOpenItemFailedException.h"

@interface OFDNSResolver ()
#ifdef OF_HAVE_FILES
- (void)of_parseHosts: (OFString *)path;
- (void)of_parseResolvConf: (OFString *)path;
66
67
68
69
70
71
72





73
74
75
76













77
78
79
80
81
82
83
}

- (instancetype)init
{
	self = [super init];

	@try {





		_minNumberOfDotsInAbsoluteName = 1;

#ifdef OF_HAVE_FILES
# if defined(OF_HAIKU)













		[self of_parseHosts: @"/boot/common/settings/network/hosts"];
# elif defined(OF_MORPHOS)
		[self of_parseHosts: @"ENVARC:sys/net/hosts"];
# elif defined(OF_AMIGAOS4)
		[self of_parseHosts: @"DEVS:Internet/hosts"];
# elif defined(OF_AMIGAOS)
		[self of_parseHosts: @"AmiTCP:db/hosts"];







>
>
>
>
>



|
>
>
>
>
>
>
>
>
>
>
>
>
>







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
}

- (instancetype)init
{
	self = [super init];

	@try {
#ifdef OF_WINDOWS
		void *pool;
		OFString *path;
#endif

		_minNumberOfDotsInAbsoluteName = 1;

#ifdef OF_HAVE_FILES
# if defined(OF_WINDOWS)
		pool = objc_autoreleasePoolPush();

		path = [[OFWindowsRegistryKey localMachineKey]
		    stringForValue: @"DataBasePath"
			subKeyPath: @"SYSTEM\\CurrentControlSet\\Services\\"
				    @"Tcpip\\Parameters"];
		path = [path stringByAppendingPathComponent: @"hosts"];

		if (path != nil)
			[self of_parseHosts: path];

		objc_autoreleasePoolPop(pool);
# elif defined(OF_HAIKU)
		[self of_parseHosts: @"/boot/common/settings/network/hosts"];
# elif defined(OF_MORPHOS)
		[self of_parseHosts: @"ENVARC:sys/net/hosts"];
# elif defined(OF_AMIGAOS4)
		[self of_parseHosts: @"DEVS:Internet/hosts"];
# elif defined(OF_AMIGAOS)
		[self of_parseHosts: @"AmiTCP:db/hosts"];