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

ldns_rdf* ldns_rr_set_rdf ( ldns_rr rr,
const ldns_rdf f,
size_t  position 

sets a rdf member, it will be set on the position given. The old value is returned, like pop.

[in] *rr the rr to operate on
[in] *f the rdf to set
[in] position the position the set the rdf
the old value in the rr, NULL on failyre

Definition at line 583 of file rr.c.

References ldns_struct_rr::_rdata_fields, ldns_rr_rd_count(), and ldns_rr_set_rdf().

Referenced by ldns_rr_a_set_address(), and ldns_rr_set_rdf().

      size_t rd_count;
      ldns_rdf *pop;
      ldns_rdf **rdata_fields;

      rd_count = ldns_rr_rd_count(rr);
      if (position < rd_count) {
            rdata_fields = rr->_rdata_fields;
            /* dicard the old one */
            pop = rr->_rdata_fields[position];
            rr->_rdata_fields[position] = (ldns_rdf*)f;
            return pop;
      } else {
            return NULL;

Generated by  Doxygen 1.6.0   Back to index