From: Heikki Levanto Date: Thu, 19 Dec 2013 13:56:30 +0000 (+0100) Subject: Add reclist rewind function X-Git-Tag: v1.6.38~9 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=9db0457fa07df43928fc8fbade13593eb6c9b534;p=pazpar2-moved-to-github.git Add reclist rewind function starts the reclist from beginning, but does not touch the mutex --- diff --git a/src/reclists.c b/src/reclists.c index 817c133..103eefd 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -342,6 +342,12 @@ void reclist_leave(struct reclist *l) l->sorted_ptr = l->sorted_list; } +void reclist_rewind(struct reclist *l) +{ + if (l) + l->sorted_ptr = l->sorted_list; +} + struct reclist *reclist_create(NMEM nmem) { diff --git a/src/reclists.h b/src/reclists.h index e10ffdc..150cd21 100644 --- a/src/reclists.h +++ b/src/reclists.h @@ -49,6 +49,7 @@ void reclist_sort(struct reclist *l, struct reclist_sortparms *parms); struct record_cluster *reclist_read_record(struct reclist *l); void reclist_enter(struct reclist *l); void reclist_leave(struct reclist *l); +void reclist_rewind(struct reclist *l); struct reclist_sortparms *reclist_parse_sortparms(NMEM nmem, const char *parms, struct conf_service *service);