Update copyright year + FSF address
[idzebra-moved-to-github.git] / index / zrpn.c
index ae0e9f0..34c6382 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zrpn.c,v 1.222 2006-07-03 10:43:43 adam Exp $
+/* $Id: zrpn.c,v 1.226 2006-08-14 10:40:15 adam Exp $
    Copyright (C) 1995-2006
    Index Data ApS
 
@@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
 */
 
 #include <stdio.h>
@@ -46,7 +46,7 @@ struct rpn_char_map_info
 static int log_level_set = 0;
 static int log_level_rpn = 0;
 
-
+#define TERMSET_DISABLE 1
 
 static const char **rpn_char_map_handler(void *vp, const char **from, int len)
 {
@@ -149,7 +149,6 @@ static void add_isam_p(const char *name, const char *info,
     assert(*info == sizeof(*p->isam_p_buf));
     memcpy(p->isam_p_buf + p->isam_p_indx, info+1, sizeof(*p->isam_p_buf));
 
-#if 1
     if (p->termset)
     {
         const char *db;
@@ -167,7 +166,6 @@ static void add_isam_p(const char *name, const char *info,
         resultSetAddTerm(p->zh, p->termset, name[len], db,
                         index_name, term_tmp);
     }
-#endif
     (p->isam_p_indx)++;
 }
 
@@ -929,7 +927,7 @@ static ZEBRA_RES term_limits_APT(ZebraHandle zh,
     AttrType hits_limit_attr;
     int term_ref_id_int;
  
-    attr_init_APT(&hits_limit_attr, zapt, 9);
+    attr_init_APT(&hits_limit_attr, zapt, 11);
     *hits_limit_value  = attr_find(&hits_limit_attr, NULL);
 
     attr_init_APT(&term_ref_id_attr, zapt, 10);
@@ -1325,7 +1323,6 @@ static ZEBRA_RES grep_info_prepare(ZebraHandle zh,
     grep_info->zh = zh;
     grep_info->reg_type = reg_type;
     grep_info->termset = 0;
-
     if (!zapt)
         return ZEBRA_OK;
     attr_init_APT(&termset, zapt, 8);
@@ -1333,6 +1330,10 @@ static ZEBRA_RES grep_info_prepare(ZebraHandle zh,
         attr_find_ex(&termset, NULL, &termset_value_string);
     if (termset_value_numeric != -1)
     {
+#if TERMSET_DISABLE
+        zebra_setError(zh, YAZ_BIB1_UNSUPP_SEARCH, "termset");
+        return ZEBRA_FAIL;
+#else
         char resname[32];
         const char *termset_name = 0;
         if (termset_value_numeric != -2)
@@ -1350,6 +1351,7 @@ static ZEBRA_RES grep_info_prepare(ZebraHandle zh,
            zebra_setError(zh, YAZ_BIB1_ILLEGAL_RESULT_SET_NAME, termset_name);
             return ZEBRA_FAIL;
         }
+#endif
     }
     return ZEBRA_OK;
 }
@@ -1357,6 +1359,7 @@ static ZEBRA_RES grep_info_prepare(ZebraHandle zh,
 /**
   \brief Create result set(s) for list of terms
   \param zh Zebra Handle
+  \param zapt Attributes Plust Term (RPN leaf)
   \param termz term as used in query but converted to UTF-8
   \param attributeSet default attribute set
   \param stream memory for result
@@ -1366,9 +1369,9 @@ static ZEBRA_RES grep_info_prepare(ZebraHandle zh,
   \param xpath_use use attribute for X-Path (-1 for no X-path)
   \param num_bases number of databases
   \param basenames array of databases
-  \param rset_mem memory for result sets
+  \param rset_nmem memory for result sets
   \param result_sets output result set for each term in list (output)
-  \param number number of output result sets
+  \param num_result_sets number of output result sets
   \param kc rset key control to be used for created result sets
 */
 static ZEBRA_RES term_list_trunc(ZebraHandle zh,