/*
- * Copyright (c) 2002,2003 Robert Collins <rbtcollins@hotmail.com>
- *
- * 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, USA.
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
*
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
*/
#include "squid.h"
#include "Trie.h"
-#if HAVE_UNISTD_H
-#include <unistd.h>
-#endif
#include "TrieCharTransform.h"
#include "TrieNode.h"
-#if !_USE_INLINE_
-#include "Trie.cci"
+#if HAVE_UNISTD_H
+#include <unistd.h>
#endif
-Trie::Trie(TrieCharTransform *aTransform) : head(0) , transform(aTransform)
+Trie::Trie(TrieCharTransform *aTransform) : head(0), transform(aTransform)
{}
-extern "C" void *TrieCreate()
-{
- return new Trie;
-}
-
Trie::~Trie()
{
delete head;
delete transform;
}
-extern "C" void TrieDestroy(void *aTrie)
-{
- delete (Trie *)aTrie;
-}
-
-extern "C" void *TrieFind(void *aTrie, char const *aString, size_t theLength)
-{
- return ((Trie *)aTrie)->find(aString, theLength);
-}
-
bool
Trie::add(char const *aString, size_t theLength, void *privatedata)
{
return head->add(aString, theLength, privatedata, transform);
}
-extern "C" int TrieAdd(void *aTrie, char const *aString, size_t theLength, void *privatedata)
-{
-
- return ((Trie *)aTrie)->add(aString, theLength, privatedata);
-}