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