b862a4b377868395f22e6cd86b0260d41e4df4e7
[idzebra-moved-to-github.git] / index / rset_isam.c
1 /* $Id: rset_isam.c,v 1.1 2007-12-03 13:04:04 adam Exp $
2    Copyright (C) 1995-2007
3    Index Data ApS
4
5 This file is part of the Zebra server.
6
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21 */
22
23 /** \file
24     \brief factory function for RSET from ISAM 
25 */
26 #include <stdio.h>
27 #include <assert.h>
28
29 #include "index.h"
30 #include <rset.h>
31
32 RSET zebra_create_rset_isam(ZebraHandle zh,
33                             NMEM rset_nmem, struct rset_key_control *kctrl,
34                             int scope, ISAM_P pos, TERMID termid)
35 {
36     assert(zh);
37     assert(zh->reg);
38     if (zh->reg->isamb)
39         return rsisamb_create(rset_nmem, kctrl, scope,
40                               zh->reg->isamb, pos, termid);
41     else if (zh->reg->isams)
42         return rsisams_create(rset_nmem, kctrl, scope,
43                               zh->reg->isams, pos, termid);
44     else if (zh->reg->isamc)
45         return rsisamc_create(rset_nmem, kctrl, scope,
46                               zh->reg->isamc, pos, termid);
47     else
48         return rset_create_null(rset_nmem, kctrl, termid);
49 }
50
51 /*
52  * Local variables:
53  * c-basic-offset: 4
54  * indent-tabs-mode: nil
55  * End:
56  * vim: shiftwidth=4 tabstop=8 expandtab
57  */
58