* \param[in] right the rightside
* \return a left with right concatenated to it
*/
-ldns_status ldns_rr_list_cat(ldns_rr_list *left, ldns_rr_list *right);
+bool ldns_rr_list_cat(ldns_rr_list *left, ldns_rr_list *right);
/**
* concatenates two ldns_rr_lists together, but makes clones of the rr's
typedef struct ldns_struct_zone ldns_zone;
-
/**
* \param[in] z the zone to read from
* \return the soa record in the zone
*/
void ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist);
+/**
+ * push an rrlist to a zone structure. This function use pointer
+ * copying, so the rr_list structure inside z is modified!
+ * \param[in] z the zone to add to
+ * \param[in] list the list to add
+ * \return a true on succes otherwise falsed
+ */
+bool ldns_zone_push_rr_list(ldns_zone *z, ldns_rr_list *list);
+
+/**
+ * push an singkle rr to a zone structure. This function use pointer
+ * copying, so the rr_list structure inside z is modified!
+ * \param[in] z the zone to add to
+ * \param[in] rr the rr to add
+ * \return a true on succes otherwise falsed
+ */
+bool ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr);
+
#endif /* LDNS_ZONE_H */
/* add right to left. So we modify *left! */
-ldns_status
+bool
ldns_rr_list_cat(ldns_rr_list *left, ldns_rr_list *right)
{
uint16_t r_rr_count;
if (left) {
l_rr_count = ldns_rr_list_rr_count(left);
} else {
- return LDNS_STATUS_NULL;
+ return false;
}
if (right) {
if (l_rr_count + r_rr_count > LDNS_MAX_RR ) {
/* overflow error */
- return LDNS_STATUS_ERR;
+ return false;
}
/* push right to left */
for(i = 0; i < r_rr_count; i++) {
ldns_rr_list_push_rr(left, ldns_rr_list_rr(right, i));
}
- return LDNS_STATUS_OK;
+ return true;
}
ldns_rr_list *
z->_rrs = rrlist;
}
+bool
+ldns_zone_push_rr_list(ldns_zone *z, ldns_rr_list *list)
+{
+ return ldns_rr_list_cat(ldns_zone_rrs(z), list);
+
+}
+
+bool
+ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr)
+{
+ return ldns_rr_list_push_rr(
+ ldns_zone_rrs(z), rr);
+}
#if 0