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

ldns_rr* ldns_rr_list_set_rr ( ldns_rr_list rr_list,
const ldns_rr r,
size_t  count 
)

set a rr on a specific index in a ldns_rr_list

Parameters:
[in] rr_list the rr_list to use
[in] r the rr to set
[in] count index into the rr_list
Returns:
the old rr which was stored in the rr_list, or NULL is the index was too large set a specific rr

Definition at line 699 of file rr.c.

References ldns_struct_rr_list::_rrs, ldns_rr_list_rr(), ldns_rr_list_rr_count(), and ldns_rr_list_set_rr().

Referenced by ldns_rr_list_set_rr().

{
      ldns_rr *old;

      if (count > ldns_rr_list_rr_count(rr_list)) {
            return NULL;
      }

      old = ldns_rr_list_rr(rr_list, count);

      /* overwrite old's pointer */
      rr_list->_rrs[count] = (ldns_rr*)r;
      return old;
}


Generated by  Doxygen 1.6.0   Back to index