projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix handling of bad config
[pazpar2-moved-to-github.git]
/
src
/
reclists.c
diff --git
a/src/reclists.c
b/src/reclists.c
index
663fa33
..
7d92643
100644
(file)
--- a/
src/reclists.c
+++ b/
src/reclists.c
@@
-1,5
+1,5
@@
/* This file is part of Pazpar2.
/* This file is part of Pazpar2.
- Copyright (C) 2006-2008 Index Data
+ Copyright (C) 2006-2009 Index Data
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-27,11
+27,9
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "pazpar2.h"
#include "reclists.h"
#include "pazpar2.h"
#include "reclists.h"
+#include "parameters.h"
-extern struct parameters global_parameters;
-
-// Not threadsafe
-static struct reclist_sortparms *sortparms = 0;
+static struct reclist_sortparms *qsort_sortparms = 0; /* thread pr */
struct reclist_bucket
{
struct reclist_bucket
{
@@
-93,11
+91,11
@@
reclist_sortparms_insert(NMEM nmem,
#endif
#endif
-struct reclist_sortparms *reclist_parse_sortparms(NMEM nmem, const char *parms)
+struct reclist_sortparms *reclist_parse_sortparms(NMEM nmem, const char *parms,
+ struct conf_service *service)
{
struct reclist_sortparms *res = 0;
struct reclist_sortparms **rp = &res;
{
struct reclist_sortparms *res = 0;
struct reclist_sortparms **rp = &res;
- struct conf_service *service = config->servers->service;
if (strlen(parms) > 256)
return 0;
if (strlen(parms) > 256)
return 0;
@@
-168,7
+166,7
@@
static int reclist_cmp(const void *p1, const void *p2)
struct reclist_sortparms *s;
int res = 0;
struct reclist_sortparms *s;
int res = 0;
- for (s = sortparms; s && res == 0; s = s->next)
+ for (s = qsort_sortparms; s && res == 0; s = s->next)
{
union data_types *ut1 = r1->sortkeys[s->offset];
union data_types *ut2 = r2->sortkeys[s->offset];
{
union data_types *ut1 = r1->sortkeys[s->offset];
union data_types *ut2 = r2->sortkeys[s->offset];
@@
-214,7
+212,7
@@
static int reclist_cmp(const void *p1, const void *p2)
void reclist_sort(struct reclist *l, struct reclist_sortparms *parms)
{
void reclist_sort(struct reclist *l, struct reclist_sortparms *parms)
{
- sortparms = parms;
+ qsort_sortparms = parms;
qsort(l->flatlist, l->num_records,
sizeof(struct record_cluster*), reclist_cmp);
reclist_rewind(l);
qsort(l->flatlist, l->num_records,
sizeof(struct record_cluster*), reclist_cmp);
reclist_rewind(l);
@@
-340,7
+338,9
@@
struct record_cluster *reclist_insert( struct reclist *l,
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
+