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

ldns_rr_list* ldns_rr_list_pop_rr_list ( ldns_rr_list rr_list,
size_t  size 

pops an rr_list of size s from an rrlist.

[in] rr_list the rr_list to pop from
[in] size the number of rr's to pop
NULL if nothing to pop. Otherwise the popped rr_list

Definition at line 939 of file rr.c.

References ldns_rr_list_new(), ldns_rr_list_pop_rr(), ldns_rr_list_pop_rr_list(), and ldns_rr_list_push_rr().

Referenced by ldns_rr_list_pop_rr_list().

      /* pop a number of rr's and put them in a rr_list */
      ldns_rr_list *popped;
      ldns_rr *p;
      size_t i = howmany;

      popped = ldns_rr_list_new();

      if (!popped) {
            return NULL;

      while(i > 0 && 
                  (p = ldns_rr_list_pop_rr(rr_list)) != NULL) {
            ldns_rr_list_push_rr(popped, p);

      if (i == howmany) {
            return NULL;
      } else {
            return popped;

Generated by  Doxygen 1.6.0   Back to index