From 7a99aea06e5d23ce1320c4e3a368543c6a7ab1e4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 7 Jun 2007 12:27:03 +0000 Subject: [PATCH] Get rid of record_assign_client --- src/logic.c | 5 ++--- src/record.c | 19 +++++-------------- src/record.h | 10 +++------- src/test_record.c | 7 ++----- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/logic.c b/src/logic.c index 9c6c414..1ceffce 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.37 2007-06-06 11:56:35 marc Exp $ +/* $Id: logic.c,v 1.38 2007-06-07 12:27:03 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -894,8 +894,7 @@ struct record *ingest_record(struct client *cl, Z_External *rec, } record = record_create(se->nmem, - service->num_metadata, service->num_sortkeys); - record_assign_client(record, cl); + service->num_metadata, service->num_sortkeys, cl); mergekey_norm = (xmlChar *) nmem_strdup(se->nmem, (char*) mergekey); xmlFree(mergekey); diff --git a/src/record.c b/src/record.c index 4a9aac6..5140abc 100644 --- a/src/record.c +++ b/src/record.c @@ -1,4 +1,4 @@ -/* $Id: record.c,v 1.8 2007-04-26 12:12:19 marc Exp $ +/* $Id: record.c,v 1.9 2007-06-07 12:27:03 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -19,7 +19,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: record.c,v 1.8 2007-04-26 12:12:19 marc Exp $ */ +/* $Id: record.c,v 1.9 2007-06-07 12:27:03 adam Exp $ */ #include @@ -58,7 +58,8 @@ union data_types * data_types_assign(NMEM nmem, } -struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys) +struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys, + struct client *client) { struct record * record = 0; int i = 0; @@ -68,8 +69,7 @@ struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys) record = nmem_malloc(nmem, sizeof(struct record)); record->next = 0; - // which client should I use for record->client = cl; ?? - record->client = 0; + record->client = client; record->metadata = nmem_malloc(nmem, @@ -86,15 +86,6 @@ struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys) return record; } - -struct client * record_assign_client(struct record * record, - struct client * client) -{ - record->client = client; - return client; -} - - struct record_metadata * record_metadata_create(NMEM nmem) { struct record_metadata * rec_md diff --git a/src/record.h b/src/record.h index 0e396a2..30effe6 100644 --- a/src/record.h +++ b/src/record.h @@ -1,4 +1,4 @@ -/* $Id: record.h,v 1.8 2007-04-27 11:56:41 marc Exp $ +/* $Id: record.h,v 1.9 2007-06-07 12:27:03 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -59,7 +59,8 @@ struct record { }; -struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys); +struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys, + struct client *client); struct record_metadata * record_metadata_create(NMEM nmem); @@ -81,11 +82,6 @@ struct record_metadata * record_add_metadata(NMEM nmem, union data_types data); -struct client * record_assign_client(struct record * record, - struct client *client); - - - union data_types * record_assign_sortkey_field_id(NMEM nmem, struct record * record, int field_id, diff --git a/src/test_record.c b/src/test_record.c index ecf1b23..d6c77c7 100644 --- a/src/test_record.c +++ b/src/test_record.c @@ -1,4 +1,4 @@ -/* $Id: test_record.c,v 1.5 2007-05-29 07:16:50 marc Exp $ +/* $Id: test_record.c,v 1.6 2007-06-07 12:27:03 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -86,12 +86,9 @@ void test_record(int argc, char **argv) // testing record things - record = record_create(nmem, 4, 3); + record = record_create(nmem, 4, 3, client); YAZ_CHECK(record); - // why on earth do we have a client dangeling from the record ?? - record->client = client; - tmp_md = record_metadata_insert(nmem, &(record->metadata[0]), data_text); YAZ_CHECK(tmp_md); YAZ_CHECK(0 == record->metadata[0]->next); -- 1.7.10.4