1 /* $Id: record.c,v 1.1 2007-04-20 14:37:17 marc Exp $
2 Copyright (c) 2006-2007, Index Data.
4 This file is part of Pazpar2.
6 Pazpar2 is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Pazpar2; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 /* $Id: record.c,v 1.1 2007-04-20 14:37:17 marc Exp $ */
27 #include <yaz/yaz-util.h>
34 //#define CONFIG_NOEXTERNS
39 struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys)
41 struct record * record = 0;
45 record = nmem_malloc(nmem, sizeof(struct record));
48 // which client should I use for record->client = cl; ??
53 sizeof(struct record_metadata*) * num_metadata);
54 memset(record->metadata, 0,
55 sizeof(struct record_metadata*) * num_metadata);
59 sizeof(union data_types*) * num_sortkeys);
60 memset(record->metadata, 0,
61 sizeof(union data_types*) * num_sortkeys);
68 struct record_metadata * record_add_metadata_fieldno(NMEM nmem,
69 struct record * record,
71 union data_types data)
73 struct record_metadata * rmd = 0;
75 if (!record || fieldno < 0
76 || !record->metadata || !record->metadata[fieldno] )
79 // construct new record_metadata
80 rmd = nmem_malloc(nmem, sizeof(struct record_metadata));
84 // still needs to be assigned ..
94 * indent-tabs-mode: nil
96 * vim: shiftwidth=4 tabstop=8 expandtab