Logo Search packages:      
Sourcecode: ldns version File versions  Download package

ldns_rdf* ldns_rr_pop_rdf ( ldns_rr rr  ) 

removes a rd_field member, it will be popped from the last position.

Parameters:
[in] *rr rr to operate on
Returns:
rdf which was popped (null if nothing)

Definition at line 625 of file rr.c.

References ldns_struct_rr::_rdata_fields, ldns_rr_pop_rdf(), ldns_rr_rd_count(), and ldns_rr_set_rd_count().

Referenced by ldns_rr_pop_rdf().

{
      size_t rd_count;
      ldns_rdf *pop;
      
      rd_count = ldns_rr_rd_count(rr);

      if (rd_count == 0) {
            return NULL;
      }

      pop = rr->_rdata_fields[rd_count];
      
      /* shrink the array */
      rr->_rdata_fields = LDNS_XREALLOC(
            rr->_rdata_fields, ldns_rdf *, rd_count - 1);

      ldns_rr_set_rd_count(rr, rd_count - 1);
      return pop;
}


Generated by  Doxygen 1.6.0   Back to index