-RSET_TERM *rset_terms(RSET rs, int *no)
-{
- *no = rs->no_rset_terms;
- return rs->rset_terms;
-}
-
-RSET_TERM rset_term_create (const char *name, int length, const char *flags,
- int type)
-{
- RSET_TERM t = (RSET_TERM) xmalloc (sizeof(*t));
- if (!name)
- t->name = NULL;
- else if (length == -1)
- t->name = xstrdup (name);
- else
- {
- t->name = (char*) xmalloc (length+1);
- memcpy (t->name, name, length);
- t->name[length] = '\0';
- }
- if (!flags)
- t->flags = NULL;
- else
- t->flags = xstrdup (flags);
- t->nn = -1;
- t->count = 0;
- t->type = type;
- return t;
-}
-
-void rset_term_destroy (RSET_TERM t)
-{
- xfree (t->name);
- xfree (t->flags);
- xfree (t);
-}
-
-RSET_TERM rset_term_dup (RSET_TERM t)
-{
- RSET_TERM nt = (RSET_TERM) xmalloc (sizeof(*nt));
- if (t->name)
- nt->name = xstrdup (t->name);
- else
- nt->name = NULL;
- if (t->flags)
- nt->flags = xstrdup (t->flags);
- else
- nt->flags = NULL;
- nt->nn = t->nn;
- return nt;
-}