X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fsymtab.c;h=1d3c72a027b9a7d770f6605bd9386197aec4550b;hb=7811412f7d0c4af0a6f42c17b059d8a9d4162ae8;hp=d656621a950526972bf636a84b6cd1e33c8ec61b;hpb=caa7fe057dd8617129577a6725d2c4e3da066857;p=idzebra-moved-to-github.git diff --git a/index/symtab.c b/index/symtab.c index d656621..1d3c72a 100644 --- a/index/symtab.c +++ b/index/symtab.c @@ -1,19 +1,30 @@ -/* - * Copyright (C) 1994-1995, Index Data I/S - * All rights reserved. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: symtab.c,v $ - * Revision 1.1 1995-09-06 16:11:18 adam - * Option: only one word key per file. - * - */ +/* $Id: symtab.c,v 1.12 2006-11-22 14:12:49 adam Exp $ + Copyright (C) 1995-2006 + Index Data ApS + +This file is part of the Zebra server. + +Zebra is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + #include #include +#include #include - -#include -#include "index.h" +#include struct strentry { char *name; @@ -30,7 +41,7 @@ struct strtab { struct strtab *strtab_mk (void) { int i; - struct strtab *p = xmalloc (sizeof (*p)); + struct strtab *p = (struct strtab *) xmalloc (sizeof (*p)); for (i=0; iar[i] = NULL; return p; @@ -51,8 +62,8 @@ int strtab_src (struct strtab *t, const char *name, void ***infop) *infop = &e->info; return 1; } - e = xmalloc (sizeof(*e)); - e->name = xmalloc (strlen(name)+1); + e = (struct strentry *) xmalloc (sizeof(*e)); + e->name = (char *) xmalloc (strlen(name)+1); strcpy (e->name, name); e->next = t->ar[hash]; t->ar[hash] = e; @@ -72,8 +83,16 @@ void strtab_del (struct strtab *t, { e1 = e->next; (*func)(e->name, e->info, data); - free (e->name); - free (e); + xfree (e->name); + xfree (e); } - free (t); + xfree (t); } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +