X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=adt%2Fstrset.c;h=17e24eee61151fb8e6ce9fb4289f61d124ef1d29;hb=0da75194a7e7c0d1c8a157e107fad866b3e14b84;hp=5f0c5288f8b2541efca0c35976ee558b9ced190f;hpb=d5e8df5885f97ea65839f8970b8697549c207610;p=cparser diff --git a/adt/strset.c b/adt/strset.c index 5f0c528..17e24ee 100644 --- a/adt/strset.c +++ b/adt/strset.c @@ -1,6 +1,26 @@ +/* + * This file is part of cparser. + * Copyright (C) 2007-2009 Matthias Braun + * + * This program 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 + * of the License, or (at your option) any later version. + * + * This program 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ #include #include "strset.h" +#include "strutil.h" #include "hash_string.h" #define HashSet strset_t @@ -11,8 +31,9 @@ #define NullValue NULL #define DeletedValue ((void*)-1) #define Hash(this, value) hash_string(value) -#define KeysEqual(this,key1,key2) (strcmp(key1, key2) == 0) +#define KeysEqual(this,key1,key2) (streq(key1, key2)) #define SetRangeEmpty(ptr,size) memset(ptr, 0, (size) * sizeof(strset_entry_t)) +#define SCALAR_RETURN #define hashset_init strset_init #define hashset_init_size strset_init_size