@@ -33,11 +33,11 @@ OF_APPLICATION_DELEGATE(OFDNS) static void help(OFStream *stream, bool full, int status) { - [of_stderr writeLine: + [OFStdErr writeLine: OF_LOCALIZED(@"usage", @"Usage: %[prog] -[chst] domain1 [domain2 ...]", @"prog", [OFApplication programName])]; if (full) { @@ -65,13 +65,13 @@ exception: (id)exception { _inFlight--; if (exception == nil) - [of_stdout writeFormat: @"%@\n", response]; + [OFStdOut writeFormat: @"%@\n", response]; else { - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"failed_to_resolve", @"Failed to resolve: %[exception]", @"exception", exception)]; _errors++; } @@ -81,23 +81,23 @@ } - (void)applicationDidFinishLaunching { OFString *DNSClassString, *server; - const of_options_parser_option_t options[] = { + const OFOptionsParserOption options[] = { { 'c', @"class", 1, NULL, &DNSClassString }, { 'h', @"help", 0, NULL, NULL }, { 's', @"server", 1, NULL, &server }, { 't', @"type", 1, NULL, NULL }, { '\0', nil, 0, NULL, NULL } }; OFMutableArray OF_GENERIC(OFString *) *recordTypes; OFOptionsParser *optionsParser; - of_unichar_t option; + OFUnichar option; OFArray OF_GENERIC(OFString *) *remainingArguments; OFDNSResolver *resolver; - of_dns_class_t DNSClass; + OFDNSClass DNSClass; #ifdef OF_HAVE_FILES # ifndef OF_AMIGAOS [OFLocale addLanguageDirectory: @LANGUAGE_DIR]; # else @@ -109,11 +109,11 @@ OFSandbox *sandbox = [[OFSandbox alloc] init]; @try { sandbox.allowsStdIO = true; sandbox.allowsDNS = true; - [OFApplication activateSandbox: sandbox]; + [OFApplication of_activateSandbox: sandbox]; } @finally { [sandbox release]; } #endif @@ -124,25 +124,25 @@ switch (option) { case 't': [recordTypes addObject: optionsParser.argument]; break; case 'h': - help(of_stdout, true, 0); + help(OFStdOut, true, 0); break; case ':': if (optionsParser.lastLongOption != nil) - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"long_option_required_argument", @"%[prog]: Option --%[opt] requires an " @"argument", @"prog", [OFApplication programName], @"opt", optionsParser.lastLongOption)]; else { OFString *optStr = [OFString stringWithFormat: @"%C", optionsParser.lastOption]; - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"option_requires_argument", @"%[prog]: Option -%[opt] requires an " @"argument", @"prog", [OFApplication programName], @"opt", optStr)]; @@ -150,20 +150,20 @@ [OFApplication terminateWithStatus: 1]; break; case '?': if (optionsParser.lastLongOption != nil) - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"unknown_long_option", @"%[prog]: Unknown option: --%[opt]", @"prog", [OFApplication programName], @"opt", optionsParser.lastLongOption)]; else { OFString *optStr = [OFString stringWithFormat: @"%C", optionsParser.lastOption]; - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"Unknown_option", @"%[prog]: Unknown option: -%[opt]", @"prog", [OFApplication programName], @"opt", optStr)]; } @@ -174,16 +174,15 @@ } remainingArguments = optionsParser.remainingArguments; if (remainingArguments.count < 1) - help(of_stderr, false, 1); + help(OFStdErr, false, 1); resolver = [OFDNSResolver resolver]; DNSClass = (DNSClassString != nil - ? of_dns_class_parse(DNSClassString) - : OF_DNS_CLASS_IN); + ? OFDNSClassParseName(DNSClassString) : OFDNSClassIN); if (recordTypes.count == 0) [recordTypes addObject: @"ALL"]; if (server != nil) { @@ -191,19 +190,18 @@ resolver.nameServers = [OFArray arrayWithObject: server]; } for (OFString *domainName in remainingArguments) { for (OFString *recordTypeString in recordTypes) { - of_dns_record_type_t recordType = - of_dns_record_type_parse(recordTypeString); + OFDNSRecordType recordType = + OFDNSRecordTypeParseName(recordTypeString); OFDNSQuery *query = [OFDNSQuery queryWithDomainName: domainName DNSClass: DNSClass recordType: recordType]; _inFlight++; - [resolver asyncPerformQuery: query - delegate: self]; + [resolver asyncPerformQuery: query delegate: self]; } } } @end