-/* $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
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
-/* $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
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;
-/* $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
}
}
+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
t->type = type;
t->rankpriv = 0;
t->rset = 0;
- t->ol = ol;
+ t->ol = ord_list_dup(nmem, ol);
return t;
}