Index: src/OFDNSResponse.h ================================================================== --- src/OFDNSResponse.h +++ src/OFDNSResponse.h @@ -20,23 +20,22 @@ @class OFArray OF_GENERIC(ObjectType); @class OFDictionary OF_GENERIC(KeyType, ObjectType); typedef OFDictionary OF_GENERIC(OFString *, OFArray OF_GENERIC( - OF_KINDOF(OFDNSResourceRecord *)) *) *of_dns_response_records_t; + OF_KINDOF(OFDNSResourceRecord *)) *) *OFDNSResponseRecords; /** * @class OFDNSResponse OFDNSResponse.h ObjFW/OFDNSResponse.h * * @brief A class storing a response from @ref OFDNSResolver. */ @interface OFDNSResponse: OFObject { OFString *_domainName; - of_dns_response_records_t _answerRecords; - of_dns_response_records_t _authorityRecords; - of_dns_response_records_t _additionalRecords; + OFDNSResponseRecords _answerRecords, _authorityRecords; + OFDNSResponseRecords _additionalRecords; OF_RESERVE_IVARS(OFDNSResponse, 4) } /** * @brief The domain name of the response. @@ -47,27 +46,27 @@ * @brief The answer records of the response. * * This is a dictionary with the key being the domain name and the value being * an array of @ref OFDNSResourceRecord. */ -@property (readonly, nonatomic) of_dns_response_records_t answerRecords; +@property (readonly, nonatomic) OFDNSResponseRecords answerRecords; /** * @brief The authority records of the response. * * This is a dictionary with the key being the domain name and the value being * an array of @ref OFDNSResourceRecord. */ -@property (readonly, nonatomic) of_dns_response_records_t authorityRecords; +@property (readonly, nonatomic) OFDNSResponseRecords authorityRecords; /** * @brief The additional records of the response. * * This is a dictionary with the key being the domain name and the value being * an array of @ref OFDNSResourceRecord. */ -@property (readonly, nonatomic) of_dns_response_records_t additionalRecords; +@property (readonly, nonatomic) OFDNSResponseRecords additionalRecords; /** * @brief Creates a new, autoreleased OFDNSResponse. * * @param domainName The domain name the response is for @@ -74,15 +73,14 @@ * @param answerRecords The answer records of the response * @param authorityRecords The authority records of the response * @param additionalRecords The additional records of the response * @return A new, autoreleased OFDNSResponse */ -+ (instancetype) - responseWithDomainName: (OFString *)domainName - answerRecords: (of_dns_response_records_t)answerRecords - authorityRecords: (of_dns_response_records_t)authorityRecords - additionalRecords: (of_dns_response_records_t)additionalRecords; ++ (instancetype)responseWithDomainName: (OFString *)domainName + answerRecords: (OFDNSResponseRecords)answerRecords + authorityRecords: (OFDNSResponseRecords)authorityRecords + additionalRecords: (OFDNSResponseRecords)additionalRecords; /** * @brief Initializes an already allocated OFDNSResponse. * * @param domainName The domain name the response is for @@ -89,16 +87,15 @@ * @param answerRecords The answer records of the response * @param authorityRecords The authority records of the response * @param additionalRecords The additional records of the response * @return An initialized OFDNSResponse */ -- (instancetype) - initWithDomainName: (OFString *)domainName - answerRecords: (of_dns_response_records_t)answerRecords - authorityRecords: (of_dns_response_records_t)authorityRecords - additionalRecords: (of_dns_response_records_t)additionalRecords +- (instancetype)initWithDomainName: (OFString *)domainName + answerRecords: (OFDNSResponseRecords)answerRecords + authorityRecords: (OFDNSResponseRecords)authorityRecords + additionalRecords: (OFDNSResponseRecords)additionalRecords OF_DESIGNATED_INITIALIZER; - (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END Index: src/OFDNSResponse.m ================================================================== --- src/OFDNSResponse.m +++ src/OFDNSResponse.m @@ -22,27 +22,26 @@ @implementation OFDNSResponse @synthesize domainName = _domainName, answerRecords = _answerRecords; @synthesize authorityRecords = _authorityRecords; @synthesize additionalRecords = _additionalRecords; -+ (instancetype) - responseWithDomainName: (OFString *)domainName - answerRecords: (of_dns_response_records_t)answerRecords - authorityRecords: (of_dns_response_records_t)authorityRecords - additionalRecords: (of_dns_response_records_t)additionalRecords ++ (instancetype)responseWithDomainName: (OFString *)domainName + answerRecords: (OFDNSResponseRecords)answerRecords + authorityRecords: (OFDNSResponseRecords)authorityRecords + additionalRecords: (OFDNSResponseRecords)additionalRecords { return [[[self alloc] initWithDomainName: domainName answerRecords: answerRecords authorityRecords: authorityRecords additionalRecords: additionalRecords] autorelease]; } - (instancetype)initWithDomainName: (OFString *)domainName - answerRecords: (of_dns_response_records_t)answerRecords - authorityRecords: (of_dns_response_records_t)authorityRecords - additionalRecords: (of_dns_response_records_t)additionalRecords + answerRecords: (OFDNSResponseRecords)answerRecords + authorityRecords: (OFDNSResponseRecords)authorityRecords + additionalRecords: (OFDNSResponseRecords)additionalRecords { self = [super init]; @try { _domainName = [domainName copy];