From 9db0457fa07df43928fc8fbade13593eb6c9b534 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Thu, 19 Dec 2013 14:56:30 +0100 Subject: [PATCH] Add reclist rewind function starts the reclist from beginning, but does not touch the mutex --- src/reclists.c | 6 ++++++ src/reclists.h | 1 + 2 files changed, 7 insertions(+) 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); -- 1.7.10.4