X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=rset%2Frset.c;h=29c80607c2d392cd914a431185eababeb15bc17a;hb=dbf7ead21f60be189f0d532175c92924a8eb73fd;hp=5a3c4d2fbb93eb8f2cbcb778d2e3e85bf88f32a0;hpb=3c5f6226f97612c0d6ac40591f600587c5ffa858;p=idzebra-moved-to-github.git diff --git a/rset/rset.c b/rset/rset.c index 5a3c4d2..29c8060 100644 --- a/rset/rset.c +++ b/rset/rset.c @@ -4,7 +4,16 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: rset.c,v $ - * Revision 1.13 1999-02-02 14:51:33 adam + * Revision 1.16 2002-07-25 13:06:44 adam + * Character set negotiation updates + * + * Revision 1.15 2002/03/20 20:24:30 adam + * Hits per term. Returned in SearchResult-1 + * + * Revision 1.14 1999/05/26 07:49:14 adam + * C++ compilation. + * + * Revision 1.13 1999/02/02 14:51:33 adam * Updated WIN32 code specific sections. Changed header. * * Revision 1.12 1998/04/26 10:56:57 adam @@ -64,7 +73,7 @@ RSET rset_create(const struct rset_control *sel, void *parms) int i; logf (LOG_DEBUG, "rs_create(%s)", sel->desc); - rnew = xmalloc(sizeof(*rnew)); + rnew = (RSET) xmalloc(sizeof(*rnew)); rnew->control = sel; rnew->flags = 0; rnew->count = 1; @@ -99,16 +108,17 @@ RSET_TERM *rset_terms(RSET rs, int *no) return rs->rset_terms; } -RSET_TERM rset_term_create (const char *name, int length, const char *flags) +RSET_TERM rset_term_create (const char *name, int length, const char *flags, + int type) { - RSET_TERM t = xmalloc (sizeof(*t)); + RSET_TERM t = (RSET_TERM) xmalloc (sizeof(*t)); if (!name) t->name = NULL; else if (length == -1) t->name = xstrdup (name); else { - t->name = xmalloc (length+1); + t->name = (char*) xmalloc (length+1); memcpy (t->name, name, length); t->name[length] = '\0'; } @@ -116,7 +126,9 @@ RSET_TERM rset_term_create (const char *name, int length, const char *flags) t->flags = NULL; else t->flags = xstrdup (flags); - t->nn = 1; + t->nn = -1; + t->count = 0; + t->type = type; return t; } @@ -129,7 +141,7 @@ void rset_term_destroy (RSET_TERM t) RSET_TERM rset_term_dup (RSET_TERM t) { - RSET_TERM nt = xmalloc (sizeof(*nt)); + RSET_TERM nt = (RSET_TERM) xmalloc (sizeof(*nt)); if (t->name) nt->name = xstrdup (t->name); else