Make a copy of ord(inals) in rset_term_create.
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 7 Jun 2005 07:41:04 +0000 (07:41 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 7 Jun 2005 07:41:04 +0000 (07:41 +0000)
include/rset.h
index/zrpn.c
rset/rset.c

index 7fc3c95..b37becc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: rset.h,v 1.54 2005-06-06 21:31:08 adam Exp $
+/* $Id: rset.h,v 1.55 2005-06-07 07:41:04 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -40,6 +40,10 @@ struct ord_list {
     struct ord_list *next;
 };
 
     struct ord_list *next;
 };
 
+struct ord_list *ord_list_create(NMEM nmem);
+struct ord_list *ord_list_append(NMEM nmem, struct ord_list *list, int ord);
+struct ord_list *ord_list_dup(NMEM nmem, struct ord_list *list);
+
 /** 
  * rset_term is all we need to know of a term to do ranking etc. 
  * As far as the rsets are concerned, it is just a dummy pointer to
 /** 
  * rset_term is all we need to know of a term to do ranking etc. 
  * As far as the rsets are concerned, it is just a dummy pointer to
index ce55c6e..4b39270 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zrpn.c,v 1.195 2005-06-06 21:31:08 adam Exp $
+/* $Id: zrpn.c,v 1.196 2005-06-07 07:41:05 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -50,20 +50,6 @@ typedef struct
     Z_AttributesPlusTerm *zapt;
 } AttrType;
 
     Z_AttributesPlusTerm *zapt;
 } AttrType;
 
-static struct ord_list *ord_list_create(NMEM nmem)
-{
-    return 0;
-}
-
-static struct ord_list *ord_list_append(NMEM nmem, struct ord_list *list,
-                                       int ord)
-{
-    struct ord_list *n = nmem_malloc(nmem, sizeof(*n));
-    n->ord = ord;
-    n->next = list;
-    return n;
-}
-
 static int log_level_set = 0;
 static int log_level_rpn = 0;
 
 static int log_level_set = 0;
 static int log_level_rpn = 0;
 
index c825bf0..c7821d3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: rset.c,v 1.48 2005-06-06 21:31:09 adam Exp $
+/* $Id: rset.c,v 1.49 2005-06-07 07:41:05 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -277,6 +277,28 @@ void rset_get_one_term(RSET ct, TERMID *terms, int maxterms, int *curterm)
     }
 }
 
     }
 }
 
+struct ord_list *ord_list_create(NMEM nmem)
+{
+    return 0;
+}
+
+struct ord_list *ord_list_append(NMEM nmem, struct ord_list *list,
+                                       int ord)
+{
+    struct ord_list *n = nmem_malloc(nmem, sizeof(*n));
+    n->ord = ord;
+    n->next = list;
+    return n;
+}
+
+struct ord_list *ord_list_dup(NMEM nmem, struct ord_list *list)
+{
+    struct ord_list *n = ord_list_create(nmem);
+    for (; list; list = list->next)
+       n = ord_list_append(nmem, n, list->ord);
+    return n;
+}
+
 /**
    \brief Creates a TERMID entry.
    \param name Term/Name buffer with given length
 /**
    \brief Creates a TERMID entry.
    \param name Term/Name buffer with given length
@@ -311,7 +333,7 @@ TERMID rset_term_create(const char *name, int length, const char *flags,
     t->type = type;
     t->rankpriv = 0;
     t->rset = 0;
     t->type = type;
     t->rankpriv = 0;
     t->rset = 0;
-    t->ol = ol;
+    t->ol = ord_list_dup(nmem, ol);
     return t;
 }
 
     return t;
 }