diff --git a/model/ccnx-face.cc b/model/ccnx-face.cc
index 3250355..d672f07 100644
--- a/model/ccnx-face.cc
+++ b/model/ccnx-face.cc
@@ -23,6 +23,7 @@
 
 #include "ns3/log.h"
 #include "ns3/node.h"
+#include "ns3/assert.h"
 
 NS_LOG_COMPONENT_DEFINE ("CcnxFace");
 
@@ -133,8 +134,17 @@
 bool
 CcnxFace::operator== (const CcnxFace &face) const
 {
-  return (m_node->GetId () == face.m_node->GetId ()) &&
-    (m_id == face.m_id);
+  NS_ASSERT_MSG (m_node->GetId () == face.m_node->GetId (), "Faces of different nodes should not be compared to each other");
+
+  return (m_id == face.m_id);
+}
+
+bool
+CcnxFace::operator< (const CcnxFace &face) const
+{
+  NS_ASSERT_MSG (m_node->GetId () == face.m_node->GetId (), "Faces of different nodes should not be compared to each other");
+
+  return (m_id < face.m_id);
 }
 
 std::ostream& operator<< (std::ostream& os, const CcnxFace &face)
diff --git a/model/ccnx-face.h b/model/ccnx-face.h
index 4370ab9..a1ef3e0 100644
--- a/model/ccnx-face.h
+++ b/model/ccnx-face.h
@@ -155,8 +155,21 @@
   inline uint32_t
   GetId () const;
 
+  /**
+   * \brief Compare two faces. Only two faces on the same node could be compared.
+   *
+   * Internal index is used for comparison.
+   */
   bool
   operator== (const CcnxFace &face) const;
+
+  /**
+   * \brief Compare two faces. Only two faces on the same node could be compared.
+   *
+   * Internal index is used for comparison.
+   */
+  bool
+  operator< (const CcnxFace &face) const;
   
 protected:
   virtual void DoDispose (void);
diff --git a/model/ccnx-fib.cc b/model/ccnx-fib.cc
new file mode 100644
index 0000000..14c6138
--- /dev/null
+++ b/model/ccnx-fib.cc
@@ -0,0 +1,169 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * 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
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ccnx-fib.h"
+
+#include "ccnx.h"
+#include "ccnx-face.h"
+#include "ccnx-interest-header.h"
+
+#include "ns3/node.h"
+
+//#define NDN_DEBUG_OSPF	0
+//#define NDN_DEBUG_OSPF_NODES 0
+
+//#define NDN_DUMP_FIB		0
+namespace ns3 {
+
+
+//////////////////////////////////////////////////////////////////////
+// Helpers
+//////////////////////////////////////////////////////////////////////
+namespace __ccnx_private_fib {
+
+struct CcnxFibFaceMetricByFace
+{
+  typedef CcnxFibFaceMetricContainer::type::index<i_face>::type
+  type;
+};
+
+struct ChangeStatus
+{
+  ChangeStatus (uint8_t status) : m_status (status) { }
+  void operator() (CcnxFibFaceMetric &entry)
+  {
+    entry.m_status = m_status;
+  }
+private:
+  uint8_t m_status;
+};
+
+
+struct SearchByFace {
+  /**
+   * \brief To perform effective searches by CcnxFace
+   */
+  bool
+  operator() (const CcnxFibFaceMetric &m, const Ptr<CcnxFace> &face) const
+  {
+    return *(m.m_face) < *face;
+  } 
+
+  /**
+   * \brief To perform effective searches by CcnxFace
+   */
+  bool
+  operator() (const Ptr<CcnxFace> &face, const CcnxFibFaceMetric &m) const
+  {
+    return *face < *(m.m_face);
+  } 
+};
+
+}
+//////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////
+
+using namespace __ccnx_private_fib;
+
+void
+CcnxFibEntry::UpdateStatus (Ptr<CcnxFace> face, uint8_t status)
+{
+  CcnxFibFaceMetricByFace::type::iterator record = m_faces.get<i_face> ().find (face, SearchByFace());
+  NS_ASSERT_MSG (record != m_faces.get<i_face> ().end (), "Update status can be performed only on existing faces of CcxnFibEntry");
+
+  m_faces.modify (record, ChangeStatus (status));
+}
+
+CcnxFib::CcnxFib (Ptr<Ccnx> node)
+  : m_node (node)
+{
+}
+
+std::pair<CcnxFibEntryContainer::type::iterator, bool>
+CcnxFib::LongestPrefixMatch (const CcnxInterestHeader &interest) const
+{
+  const CcnxNameComponents &name = interest.GetName ();
+  for (size_t componentsCount = name.GetComponents ().size ();
+       componentsCount > 0;
+       componentsCount--)
+    {
+      CcnxNameComponents subPrefix (name.GetSubComponents (componentsCount));
+      CcnxFibEntryContainer::type::iterator match = m_fib.find (subPrefix);
+      if (match != m_fib.end())
+        return std::pair<CcnxFibEntryContainer::type::iterator, bool> (match,true);
+    }
+  
+  return std::pair<CcnxFibEntryContainer::type::iterator, bool> (m_fib.end(),false);
+}
+
+std::ostream& operator<< (std::ostream& os, const CcnxFib &fib)
+{
+  os << "Node " << fib.m_node->GetObject<Node> ()->GetId () << "\n";
+  os << "  Dest prefix      Interfaces(Costs)                  \n";
+  os << "+-------------+--------------------------------------+\n";
+  
+  for (CcnxFibEntryContainer::type::iterator entry = fib.m_fib.begin ();
+       entry != fib.m_fib.end ();
+       entry++)
+    {
+      os << *entry << "\n";
+    }
+  return os;
+}
+
+std::ostream& operator<< (std::ostream& os, const CcnxFibEntry &entry)
+{
+  os << entry.m_prefix << "\t";
+  for (CcnxFibFaceMetricByFace::type::iterator metric = entry.m_faces.get<i_face> ().begin ();
+       metric != entry.m_faces.get<i_face> ().end ();
+       metric++)
+    {
+      if (metric != entry.m_faces.get<i_face> ().begin ())
+        os << ", ";
+
+      os << *metric;
+    }
+  return os;
+}
+
+std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric)
+{
+  static const std::string statusString[] = {"","g","y","r"};
+  NS_ASSERT_MSG (1<=metric.m_status && metric.m_status<=3, "Status can be only GREEN, YELLOW, or RED");
+
+  os << metric.m_face << "(" << metric.m_routingCost << ","<< statusString [metric.m_status] << ")";
+  return os;
+}
+
+// void CcnxFib::resetProbing()
+// {
+//     for(FibRangeIterator fib = _fib.begin(); fib != _fib.end(); fib++)
+//         VALUE(fib).needsProbing = true;
+// }
+
+// void CcnxFib::updateInterfaceStatus( int interface, int status )
+// {
+// 	for( FibRangeIterator fib = _fib.begin(); fib!=_fib.end(); fib++ )
+// 	{
+// 		VALUE(fib).updateStatus( interface, status );
+// 	}
+// }
+
+} // namespace ns3
diff --git a/model/ccnx-fib.h b/model/ccnx-fib.h
new file mode 100644
index 0000000..90d5ec8
--- /dev/null
+++ b/model/ccnx-fib.h
@@ -0,0 +1,279 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * 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
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _CCNX_FIB_H_
+#define	_CCNX_FIB_H_
+
+#include "hash-helper.h"
+#include "ccnx-face.h"
+#include "ns3/nstime.h"
+
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/tag.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/composite_key.hpp>
+#include <boost/multi_index/hashed_index.hpp>
+#include <boost/multi_index/member.hpp>
+#include <boost/multi_index/mem_fun.hpp>
+
+#include <iostream>
+
+namespace ns3 {
+
+namespace __ccnx_private_fib
+{
+const uint8_t NDN_FIB_GREEN = 1; ///< \brief 
+const uint8_t NDN_FIB_YELLOW = 2;
+const uint8_t NDN_FIB_RED = 3;
+
+class i_face {};
+class i_metric {};
+class i_prefix {};
+}
+
+class Ccnx;
+class CcnxInterestHeader;
+
+/**
+ * \ingroup ccnx
+ * \brief Structure holding various parameters associated with a (FibEntry, Face) tuple
+ */
+class CcnxFibFaceMetric
+{
+public:
+  /**
+   * \brief Metric constructor
+   *
+   * \param face Face for which metric
+   * \param cost Initial value for routing cost
+   */
+  CcnxFibFaceMetric (Ptr<CcnxFace> face, int cost)
+    : m_face (face)
+    , m_status (__ccnx_private_fib::NDN_FIB_YELLOW)
+    , m_routingCost (cost)
+    , m_sRtt   (Seconds (0))
+    , m_rttVar (Seconds (0))
+  { }
+
+  /**
+   * \brief Comparison operator used by boost::multi_index::identity<>
+   */
+  bool
+  operator< (const CcnxFibFaceMetric &m) const { return *m_face < *(m.m_face); } // return identity of the face
+
+private:
+  friend std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric);
+public:
+  Ptr<CcnxFace> m_face; ///< Face
+  
+  uint8_t m_status;		///< \brief Status of the next hop: 
+						///<		- #__ccnx_private_fib::NDN_FIB_GREEN
+						///<		- #__ccnx_private_fib::NDN_FIB_YELLOW
+						///<		- #__ccnx_private_fib::NDN_FIB_RED
+  
+  uint32_t m_routingCost; ///< \brief routing protocol cost (interpretation of the value depends on the underlying routing protocol)
+
+  Time m_sRtt;         ///< \brief smoothed round-trip time
+  Time m_rttVar;       ///< \brief round-trip time variation
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Typedef for indexed face container of CcnxFibEntry
+ *
+ * Currently, there are 2 indexes:
+ * - by face (used to find record and update metric)
+ * - by metric (face ranking)
+ */
+struct CcnxFibFaceMetricContainer
+{
+  typedef boost::multi_index::multi_index_container<
+    CcnxFibFaceMetric,
+    boost::multi_index::indexed_by<
+      // For fast access to elements using CcnxFace
+      boost::multi_index::ordered_unique<
+        boost::multi_index::tag<__ccnx_private_fib::i_face>,
+        boost::multi_index::identity<CcnxFibFaceMetric>
+      >,
+
+      // List of available faces ordered by (status, m_routingCost)
+      boost::multi_index::ordered_non_unique<
+        boost::multi_index::tag<__ccnx_private_fib::i_metric>,
+        boost::multi_index::composite_key<
+          CcnxFibFaceMetric,
+          boost::multi_index::member<CcnxFibFaceMetric,uint8_t,&CcnxFibFaceMetric::m_status>,
+          boost::multi_index::member<CcnxFibFaceMetric,uint32_t,&CcnxFibFaceMetric::m_routingCost>
+        >
+      >
+    >
+   > type;
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Structure for FIB table entry, holding indexed list of
+ *        available faces and their respective metrics
+ */
+class CcnxFibEntry
+{
+public:
+  /**
+   * \brief Constructor
+   * \param prefix Prefix for the FIB entry
+   */
+  CcnxFibEntry (Ptr<CcnxNameComponents> prefix)
+    : m_prefix (prefix)
+    , m_needsProbing (false)
+  { }
+	
+  /**
+   * \brief Update status of FIB next hop
+   */
+  void
+  UpdateStatus (Ptr<CcnxFace> face, uint8_t status);
+
+  /**
+   * \brief Get prefix for the FIB entry
+   */
+  const CcnxNameComponents&
+  GetName () const { return *m_prefix; }
+
+private:
+  friend std::ostream& operator<< (std::ostream& os, const CcnxFibEntry &entry);
+
+private:
+  Ptr<CcnxNameComponents> m_prefix; ///< \brief Prefix of the FIB entry
+  CcnxFibFaceMetricContainer::type m_faces; ///< \brief Indexed list of faces
+
+  bool m_needsProbing;      ///< \brief flag indicating that probing should be performed 
+};
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+ * \ingroup ccnx
+ * \brief Typedef for indexed container for FIB entries
+ *
+ * Currently, there is only one index
+ * - by prefix hash, which is used to perform prefix match
+ */
+struct CcnxFibEntryContainer
+{
+  typedef boost::multi_index::multi_index_container<
+    CcnxFibEntry,
+    boost::multi_index::indexed_by<
+      // For fast access to elements using CcnxFace
+      boost::multi_index::hashed_unique<
+        boost::multi_index::tag<__ccnx_private_fib::i_prefix>,
+        boost::multi_index::const_mem_fun<CcnxFibEntry,
+                                          const CcnxNameComponents&,
+                                          &CcnxFibEntry::GetName>,
+        CcnxPrefixHash>
+
+      // other indexes?
+    >
+  > type;
+};
+
+/**
+ * \ingroup ccnx
+ * \brief Class implementing FIB functionality
+ */
+class CcnxFib
+{
+public:
+  /**
+   * \brief Constructor
+   * \param node smart pointer to Ccnx stack associated with particular node
+   */
+  CcnxFib (Ptr<Ccnx> node);
+
+  // // Invalidate entries in FIB
+  // // Will leave FIB records in hash, but assign metric=NETWORK_UNREACHABLE
+  // void invalidate( );
+
+  // //Find corresponding FIB entry for the given content name
+  // //Longest match is performed
+  // FibIterator lookup( const string &name );
+  // bool isValid( const FibIterator &it ) { return it!=_fib.end(); }
+
+  /**
+   * \brief Perform longest prefix match
+   *
+   * \todo Implement exclude filters
+   *
+   * \param interest Interest packet header
+   * \returns If entry found a pair <valid_iterator, true> will be returned, otherwise <invalid_iterator, false>
+   */
+  std::pair<CcnxFibEntryContainer::type::iterator, bool>
+  LongestPrefixMatch (const CcnxInterestHeader &interest) const;
+  
+  /**
+   * Update FIB entry
+   * If the entry exists, metric will be updated. Otherwise, new entry will be created
+   *
+   * Entries in FIB never deleted. They can be invalidated with metric==NETWORK_UNREACHABLE
+   *
+   * @param name				Prefix
+   * @param interfaceIndex	Forwarding interface
+   * @param metric			Routing metric
+   * @param nextHop			Nexthop node address (IPv4)
+   * @return true if a new entry created, false otherwise
+   */
+  // bool update( const string &name, int interfaceIndex, int metric, NodeAddress nextHop );
+  // bool update( NodeAddress nodeId, int interfaceIndex, int metric, NodeAddress nextHop );
+  // Bool update( NodeAddress nodeId, int metric, NodeAddress nextHop );
+
+  // // Update Fib from OSPF routing table (through a hack in OSPF algorithm)
+  // void updateFibFromOSPFv2( int interface );
+
+  // // Update Fib from BGP routing table (using info from RibIn)
+  // void updateFibFromBGP( );
+
+  // // Update Fib from IP routing table
+  // void updateFibFromIpRouting( );
+
+  // // Update the status for all FIB records for the specified interface
+  // void updateInterfaceStatus( int interface, int status );
+
+  // void dump( );
+  // void dump( const FibIterator &fib );
+
+  // void resetProbing();    //reset needsProbing field for every FibEntry
+private:
+  friend std::ostream& operator<< (std::ostream& os, const CcnxFib &fib);
+
+private:
+  Ptr<Ccnx> m_node;
+
+  CcnxFibEntryContainer::type m_fib;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+std::ostream& operator<< (std::ostream& os, const CcnxFib &fib);
+std::ostream& operator<< (std::ostream& os, const CcnxFibEntry &entry);
+std::ostream& operator<< (std::ostream& os, const CcnxFibFaceMetric &metric);
+ 
+} // namespace ns3
+
+#endif	/* NDN_FIB_H */
diff --git a/model/ccnx-local-face.cc b/model/ccnx-local-face.cc
index 80b0b52..3dd9924 100644
--- a/model/ccnx-local-face.cc
+++ b/model/ccnx-local-face.cc
@@ -75,8 +75,7 @@
       return;
     }
 
-  // m_device->Send (p, m_device->GetBroadcast (), 
-  //                 CcnxL3Protocol::PROT_NUMBER);
+  
 }
 
 std::ostream& operator<< (std::ostream& os, const CcnxLocalFace &localFace)
diff --git a/model/ccnx-name-components.cc b/model/ccnx-name-components.cc
index 18e7ea2..1014f3d 100644
--- a/model/ccnx-name-components.cc
+++ b/model/ccnx-name-components.cc
@@ -19,6 +19,7 @@
  */
 
 #include "ccnx-name-components.h"
+#include <boost/foreach.hpp>
 
 #include <iostream>
 
@@ -26,31 +27,41 @@
 
 namespace ns3 {
 
-CcnxNameComponents::CcnxNameComponents ()
-{
-  // m_value = ccn_charbuf_create ();
-  // ccn_name_init(m_value);
-}
+ATTRIBUTE_HELPER_CPP (CcnxNameComponents);
 
 CcnxNameComponents::CcnxNameComponents (const string &s)
 {
-  // m_value = ccn_charbuf_create ();
-  // ccn_name_init(m_value);
-  // (*this) (s);
   m_prefix.push_back (s);
 }
 
-CcnxNameComponents::~CcnxNameComponents ()
+CcnxNameComponents::CcnxNameComponents (const std::list<boost::reference_wrapper<const std::string> > &components)
 {
-  // ccn_charbuf_destroy(&m_value);
+  BOOST_FOREACH (const boost::reference_wrapper<const std::string> &component, components)
+    {
+      Add (component.get ());
+    }
 }
-
+  
 const std::list<std::string> &
 CcnxNameComponents::GetComponents () const
 {
   return m_prefix;
 }
 
+std::list<boost::reference_wrapper<const std::string> >
+CcnxNameComponents::GetSubComponents (size_t num) const
+{
+  NS_ASSERT_MSG (1<=num && num<=m_prefix.size (), "Invalid number of subcomponents requested");
+  
+  std::list<boost::reference_wrapper<const std::string> > subComponents;
+  std::list<std::string>::const_iterator component = m_prefix.begin();
+  for (size_t i=0; i<num; i++, component++)
+    {
+      subComponents.push_back (boost::ref (*component));
+    }
+    
+  return subComponents;
+}
   
 // const ccn_charbuf*
 // Components::GetName () const
@@ -86,5 +97,27 @@
   components.Print (os);
   return os;
 }
+
+std::istream &
+operator >> (std::istream &is, CcnxNameComponents &components)
+{
+  istream_iterator<char> eos; // end of stream
+
+  std::string component = "";
+  for (istream_iterator<char> it (is); it != eos; it++)
+    {
+      if (*it == '/')
+        {
+          if (component != "")
+            components.Add (component);
+          component = "";
+        }
+      else
+        component.push_back (*it);
+    }
+
+  return is;
+}
+
 }
 
diff --git a/model/ccnx-name-components.h b/model/ccnx-name-components.h
index 55cd5ae..7e2bb71 100644
--- a/model/ccnx-name-components.h
+++ b/model/ccnx-name-components.h
@@ -30,15 +30,19 @@
 #include <list>
 #include "ns3/object.h"
 
+#include <boost/ref.hpp>
+
 namespace ns3 {
 
-class CcnxNameComponents : public Object
-
+class CcnxNameComponents : public SimpleRefCount<CcnxNameComponents>
 {
 public:
+  /**
+   * \brief Creates a prefix with zero components (can be looked as root "/")
+   */
   CcnxNameComponents ();
   CcnxNameComponents (const std::string &s);
-  ~CcnxNameComponents ();
+  CcnxNameComponents (const std::list<boost::reference_wrapper<const std::string> > &components);
   
   inline void
   Add (const std::string &s);
@@ -48,6 +52,13 @@
 
   const std::list<std::string> &
   GetComponents () const;
+
+  /**
+   * \brief Get subcomponents of the name, starting with first component
+   * \param num Number of components to return. Valid value is in range [1, GetComponents ().size ()]
+   */
+  std::list<boost::reference_wrapper<const std::string> >
+  GetSubComponents (size_t num) const;
   
   // virtual uint32_t
   // GetSerializedSize (void) const;
@@ -76,8 +87,22 @@
   typedef std::list<std::string>::const_iterator const_iterator;
 };
 
-std::ostream & operator << (std::ostream &os, const CcnxNameComponents &components);
+/**
+ * \brief Print out name components separated by slashes, e.g., /first/second/third
+ */
+std::ostream &
+operator << (std::ostream &os, const CcnxNameComponents &components);
 
+/**
+ * \brief Read components from input and add them to components. Will read input stream till eof
+ *
+ * \todo Check that NS-3 doesn't give unlimited input streams... Otherwise it would be disaster
+ *
+ * Substrings separated by slashes will become separate components
+ */
+std::istream &
+operator >> (std::istream &is, CcnxNameComponents &components);
+  
 size_t
 CcnxNameComponents::size () const
 {
@@ -111,9 +136,7 @@
 * \class ns3::ComponentsValue
 * \brief hold objects of type ns3:CcnxNameComponents
 */
-ATTRIBUTE_VALUE_DEFINE (CcnxNameComponents);
-ATTRIBUTE_ACCESSOR_DEFINE (CcnxNameComponents);
-ATTRIBUTE_CHECKER_DEFINE (CcnxNameComponents);
+ATTRIBUTE_HELPER_HEADER (CcnxNameComponents);
 } // namespace ns3
 
 #endif // _NDN_NAME_COMPONENTS_H_
diff --git a/model/uthash.h b/model/uthash.h
deleted file mode 100644
index b1e0d49..0000000
--- a/model/uthash.h
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- Copyright (c) 2003-2011, Troy D. Hanson     http://uthash.sourceforge.net
- All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef UTHASH_H
-#define UTHASH_H 
-
-#include <string.h>   /* memcmp,strlen */
-#include <stddef.h>   /* ptrdiff_t */
-#include <stdlib.h>   /* exit() */
-
-/* These macros use decltype or the earlier __typeof GNU extension.
- As decltype is only available in newer compilers (VS2010 or gcc 4.3+
- when compiling c++ source) this code uses whatever method is needed
- or, for VS2008 where neither is available, uses casting workarounds. */
-#ifdef _MSC_VER         /* MS compiler */
-#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */
-#define DECLTYPE(x) (decltype(x))
-#else                   /* VS2008 or older (or VS2010 in C mode) */
-#define NO_DECLTYPE
-#define DECLTYPE(x)
-#endif
-#else                   /* GNU, Sun and other compilers */
-#define DECLTYPE(x) (__typeof(x))
-#endif
-
-#ifdef NO_DECLTYPE
-#define DECLTYPE_ASSIGN(dst,src)                                                 \
-do {                                                                             \
-char **_da_dst = (char**)(&(dst));                                             \
-*_da_dst = (char*)(src);                                                       \
-} while(0)
-#else 
-#define DECLTYPE_ASSIGN(dst,src)                                                 \
-do {                                                                             \
-(dst) = DECLTYPE(dst)(src);                                                    \
-} while(0)
-#endif
-
-/* a number of the hash function use uint32_t which isn't defined on win32 */
-#ifdef _MSC_VER
-typedef unsigned int uint32_t;
-typedef unsigned char uint8_t;
-#else
-#include <inttypes.h>   /* uint32_t */
-#endif
-
-#define UTHASH_VERSION 1.9.4
-
-#define uthash_fatal(msg) exit(-1)        /* fatal error (out of memory,etc) */
-#define uthash_malloc(sz) malloc(sz)      /* malloc fcn                      */
-#define uthash_free(ptr,sz) free(ptr)     /* free fcn                        */
-
-#define uthash_noexpand_fyi(tbl)          /* can be defined to log noexpand  */
-#define uthash_expand_fyi(tbl)            /* can be defined to log expands   */
-
-/* initial number of buckets */
-#define HASH_INITIAL_NUM_BUCKETS 32      /* initial number of buckets        */
-#define HASH_INITIAL_NUM_BUCKETS_LOG2 5  /* lg2 of initial number of buckets */
-#define HASH_BKT_CAPACITY_THRESH 10      /* expand when bucket count reaches */
-
-/* calculate the element whose hash handle address is hhe */
-#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))
-
-#define HASH_FIND(hh,head,keyptr,keylen,out)                                     \
-do {                                                                             \
-unsigned _hf_bkt,_hf_hashv;                                                    \
-out=NULL;                                                                      \
-if (head) {                                                                    \
-HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \
-if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) {                           \
-HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ],  \
-keyptr,keylen,out);                                      \
-}                                                                           \
-}                                                                              \
-} while (0)
-
-#ifdef HASH_BLOOM
-#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM)
-#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0)
-#define HASH_BLOOM_MAKE(tbl)                                                     \
-do {                                                                             \
-(tbl)->bloom_nbits = HASH_BLOOM;                                               \
-(tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN);                 \
-if (!((tbl)->bloom_bv))  { uthash_fatal( "out of memory"); }                   \
-memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN);                                \
-(tbl)->bloom_sig = HASH_BLOOM_SIGNATURE;                                       \
-} while (0);
-
-#define HASH_BLOOM_FREE(tbl)                                                     \
-do {                                                                             \
-uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN);                              \
-} while (0);
-
-#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8)))
-#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8)))
-
-#define HASH_BLOOM_ADD(tbl,hashv)                                                \
-HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))
-
-#define HASH_BLOOM_TEST(tbl,hashv)                                               \
-HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))
-
-#else
-#define HASH_BLOOM_MAKE(tbl) 
-#define HASH_BLOOM_FREE(tbl) 
-#define HASH_BLOOM_ADD(tbl,hashv) 
-#define HASH_BLOOM_TEST(tbl,hashv) (1)
-#endif
-
-#define HASH_MAKE_TABLE(hh,head)                                                 \
-do {                                                                             \
-(head)->hh.tbl = (UT_hash_table*)uthash_malloc(                                \
-sizeof(UT_hash_table));                                        \
-if (!((head)->hh.tbl))  { uthash_fatal( "out of memory"); }                    \
-memset((head)->hh.tbl, 0, sizeof(UT_hash_table));                              \
-(head)->hh.tbl->tail = &((head)->hh);                                          \
-(head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS;                        \
-(head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2;              \
-(head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head);                    \
-(head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc(                      \
-HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \
-if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); }             \
-memset((head)->hh.tbl->buckets, 0,                                             \
-HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \
-HASH_BLOOM_MAKE((head)->hh.tbl);                                               \
-(head)->hh.tbl->signature = HASH_SIGNATURE;                                    \
-} while(0)
-
-#define HASH_ADD(hh,head,fieldname,keylen_in,add)                                \
-HASH_ADD_KEYPTR(hh,head,&add->fieldname,keylen_in,add)
-
-#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)                            \
-do {                                                                             \
-unsigned _ha_bkt;                                                               \
-(add)->hh.next = NULL;                                                          \
-(add)->hh.key = (char*)keyptr;                                                  \
-(add)->hh.keylen = keylen_in;                                                   \
-if (!(head)) {                                                                  \
-head = (add);                                                                \
-(head)->hh.prev = NULL;                                                      \
-HASH_MAKE_TABLE(hh,head);                                                    \
-} else {                                                                        \
-(head)->hh.tbl->tail->next = (add);                                          \
-(add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail);         \
-(head)->hh.tbl->tail = &((add)->hh);                                         \
-}                                                                               \
-(head)->hh.tbl->num_items++;                                                    \
-(add)->hh.tbl = (head)->hh.tbl;                                                 \
-HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets,                         \
-(add)->hh.hashv, _ha_bkt);                                              \
-HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh);                   \
-HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv);                                 \
-HASH_EMIT_KEY(hh,head,keyptr,keylen_in);                                        \
-HASH_FSCK(hh,head);                                                             \
-} while(0)
-
-#define HASH_TO_BKT( hashv, num_bkts, bkt )                                      \
-do {                                                                             \
-bkt = ((hashv) & ((num_bkts) - 1));                                            \
-} while(0)
-
-/* delete "delptr" from the hash table.
- * "the usual" patch-up process for the app-order doubly-linked-list.
- * The use of _hd_hh_del below deserves special explanation.
- * These used to be expressed using (delptr) but that led to a bug
- * if someone used the same symbol for the head and deletee, like
- *  HASH_DELETE(hh,users,users);
- * We want that to work, but by changing the head (users) below
- * we were forfeiting our ability to further refer to the deletee (users)
- * in the patch-up process. Solution: use scratch space to
- * copy the deletee pointer, then the latter references are via that
- * scratch pointer rather than through the repointed (users) symbol.
- */
-#define HASH_DELETE(hh,head,delptr)                                              \
-do {                                                                             \
-unsigned _hd_bkt;                                                            \
-struct UT_hash_handle *_hd_hh_del;                                           \
-if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) )  {         \
-uthash_free((head)->hh.tbl->buckets,                                     \
-(head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \
-HASH_BLOOM_FREE((head)->hh.tbl);                                         \
-uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                      \
-head = NULL;                                                             \
-} else {                                                                     \
-_hd_hh_del = &((delptr)->hh);                                            \
-if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) {     \
-(head)->hh.tbl->tail =                                               \
-(UT_hash_handle*)((char*)((delptr)->hh.prev) +                   \
-(head)->hh.tbl->hho);                                            \
-}                                                                        \
-if ((delptr)->hh.prev) {                                                 \
-((UT_hash_handle*)((char*)((delptr)->hh.prev) +                      \
-(head)->hh.tbl->hho))->next = (delptr)->hh.next;             \
-} else {                                                                 \
-DECLTYPE_ASSIGN(head,(delptr)->hh.next);                             \
-}                                                                        \
-if (_hd_hh_del->next) {                                                  \
-((UT_hash_handle*)((char*)_hd_hh_del->next +                         \
-(head)->hh.tbl->hho))->prev =                                \
-_hd_hh_del->prev;                                            \
-}                                                                        \
-HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt);   \
-HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del);        \
-(head)->hh.tbl->num_items--;                                             \
-}                                                                            \
-HASH_FSCK(hh,head);                                                          \
-} while (0)
-
-
-/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */
-#define HASH_FIND_STR(head,findstr,out)                                          \
-HASH_FIND(hh,head,findstr,strlen(findstr),out)
-#define HASH_ADD_STR(head,strfield,add)                                          \
-HASH_ADD(hh,head,strfield,strlen(add->strfield),add)
-#define HASH_FIND_INT(head,findint,out)                                          \
-HASH_FIND(hh,head,findint,sizeof(int),out)
-#define HASH_ADD_INT(head,intfield,add)                                          \
-HASH_ADD(hh,head,intfield,sizeof(int),add)
-#define HASH_FIND_PTR(head,findptr,out)                                          \
-HASH_FIND(hh,head,findptr,sizeof(void *),out)
-#define HASH_ADD_PTR(head,ptrfield,add)                                          \
-HASH_ADD(hh,head,ptrfield,sizeof(void *),add)
-#define HASH_DEL(head,delptr)                                                    \
-HASH_DELETE(hh,head,delptr)
-
-/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.
- * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.
- */
-#ifdef HASH_DEBUG
-#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
-#define HASH_FSCK(hh,head)                                                       \
-do {                                                                             \
-unsigned _bkt_i;                                                             \
-unsigned _count, _bkt_count;                                                 \
-char *_prev;                                                                 \
-struct UT_hash_handle *_thh;                                                 \
-if (head) {                                                                  \
-_count = 0;                                                              \
-for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) {       \
-_bkt_count = 0;                                                      \
-_thh = (head)->hh.tbl->buckets[_bkt_i].hh_head;                      \
-_prev = NULL;                                                        \
-while (_thh) {                                                       \
-if (_prev != (char*)(_thh->hh_prev)) {                            \
-HASH_OOPS("invalid hh_prev %p, actual %p\n",                  \
-_thh->hh_prev, _prev );                                      \
-}                                                                 \
-_bkt_count++;                                                     \
-_prev = (char*)(_thh);                                            \
-_thh = _thh->hh_next;                                             \
-}                                                                    \
-_count += _bkt_count;                                                \
-if ((head)->hh.tbl->buckets[_bkt_i].count !=  _bkt_count) {          \
-HASH_OOPS("invalid bucket count %d, actual %d\n",                 \
-(head)->hh.tbl->buckets[_bkt_i].count, _bkt_count);              \
-}                                                                    \
-}                                                                        \
-if (_count != (head)->hh.tbl->num_items) {                               \
-HASH_OOPS("invalid hh item count %d, actual %d\n",                   \
-(head)->hh.tbl->num_items, _count );                             \
-}                                                                        \
-/* traverse hh in app order; check next/prev integrity, count */         \
-_count = 0;                                                              \
-_prev = NULL;                                                            \
-_thh =  &(head)->hh;                                                     \
-while (_thh) {                                                           \
-_count++;                                                             \
-if (_prev !=(char*)(_thh->prev)) {                                    \
-HASH_OOPS("invalid prev %p, actual %p\n",                          \
-_thh->prev, _prev );                                         \
-}                                                                     \
-_prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh);                    \
-_thh = ( _thh->next ?  (UT_hash_handle*)((char*)(_thh->next) +        \
-(head)->hh.tbl->hho) : NULL );                 \
-}                                                                        \
-if (_count != (head)->hh.tbl->num_items) {                               \
-HASH_OOPS("invalid app item count %d, actual %d\n",                  \
-(head)->hh.tbl->num_items, _count );                             \
-}                                                                        \
-}                                                                            \
-} while (0)
-#else
-#define HASH_FSCK(hh,head) 
-#endif
-
-/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to 
- * the descriptor to which this macro is defined for tuning the hash function.
- * The app can #include <unistd.h> to get the prototype for write(2). */
-#ifdef HASH_EMIT_KEYS
-#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                                   \
-do {                                                                             \
-unsigned _klen = fieldlen;                                                   \
-write(HASH_EMIT_KEYS, &_klen, sizeof(_klen));                                \
-write(HASH_EMIT_KEYS, keyptr, fieldlen);                                     \
-} while (0)
-#else 
-#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                    
-#endif
-
-/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */
-#ifdef HASH_FUNCTION 
-#define HASH_FCN HASH_FUNCTION
-#else
-#define HASH_FCN HASH_JEN
-#endif
-
-/* The Bernstein hash function, used in Perl prior to v5.6 */
-#define HASH_BER(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _hb_keylen=keylen;                                                    \
-char *_hb_key=(char*)(key);                                                    \
-(hashv) = 0;                                                                   \
-while (_hb_keylen--)  { (hashv) = ((hashv) * 33) + *_hb_key++; }               \
-bkt = (hashv) & (num_bkts-1);                                                  \
-} while (0)
-
-
-/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at 
- * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */
-#define HASH_SAX(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _sx_i;                                                                \
-char *_hs_key=(char*)(key);                                                    \
-hashv = 0;                                                                     \
-for(_sx_i=0; _sx_i < keylen; _sx_i++)                                          \
-hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i];                     \
-bkt = hashv & (num_bkts-1);                                                    \
-} while (0)
-
-#define HASH_FNV(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _fn_i;                                                                \
-char *_hf_key=(char*)(key);                                                    \
-hashv = 2166136261UL;                                                          \
-for(_fn_i=0; _fn_i < keylen; _fn_i++)                                          \
-hashv = (hashv * 16777619) ^ _hf_key[_fn_i];                               \
-bkt = hashv & (num_bkts-1);                                                    \
-} while(0);
-
-#define HASH_OAT(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _ho_i;                                                                \
-char *_ho_key=(char*)(key);                                                    \
-hashv = 0;                                                                     \
-for(_ho_i=0; _ho_i < keylen; _ho_i++) {                                        \
-hashv += _ho_key[_ho_i];                                                   \
-hashv += (hashv << 10);                                                    \
-hashv ^= (hashv >> 6);                                                     \
-}                                                                              \
-hashv += (hashv << 3);                                                         \
-hashv ^= (hashv >> 11);                                                        \
-hashv += (hashv << 15);                                                        \
-bkt = hashv & (num_bkts-1);                                                    \
-} while(0)
-
-#define HASH_JEN_MIX(a,b,c)                                                      \
-do {                                                                             \
-a -= b; a -= c; a ^= ( c >> 13 );                                              \
-b -= c; b -= a; b ^= ( a << 8 );                                               \
-c -= a; c -= b; c ^= ( b >> 13 );                                              \
-a -= b; a -= c; a ^= ( c >> 12 );                                              \
-b -= c; b -= a; b ^= ( a << 16 );                                              \
-c -= a; c -= b; c ^= ( b >> 5 );                                               \
-a -= b; a -= c; a ^= ( c >> 3 );                                               \
-b -= c; b -= a; b ^= ( a << 10 );                                              \
-c -= a; c -= b; c ^= ( b >> 15 );                                              \
-} while (0)
-
-#define HASH_JEN(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-unsigned _hj_i,_hj_j,_hj_k;                                                    \
-char *_hj_key=(char*)(key);                                                    \
-hashv = 0xfeedbeef;                                                            \
-_hj_i = _hj_j = 0x9e3779b9;                                                    \
-_hj_k = keylen;                                                                \
-while (_hj_k >= 12) {                                                          \
-_hj_i +=    (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 )                      \
-+ ( (unsigned)_hj_key[2] << 16 )                                         \
-+ ( (unsigned)_hj_key[3] << 24 ) );                                      \
-_hj_j +=    (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 )                      \
-+ ( (unsigned)_hj_key[6] << 16 )                                         \
-+ ( (unsigned)_hj_key[7] << 24 ) );                                      \
-hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 )                         \
-+ ( (unsigned)_hj_key[10] << 16 )                                        \
-+ ( (unsigned)_hj_key[11] << 24 ) );                                     \
-\
-HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                          \
-\
-_hj_key += 12;                                                              \
-_hj_k -= 12;                                                                \
-}                                                                              \
-hashv += keylen;                                                               \
-switch ( _hj_k ) {                                                             \
-case 11: hashv += ( (unsigned)_hj_key[10] << 24 );                          \
-case 10: hashv += ( (unsigned)_hj_key[9] << 16 );                           \
-case 9:  hashv += ( (unsigned)_hj_key[8] << 8 );                            \
-case 8:  _hj_j += ( (unsigned)_hj_key[7] << 24 );                           \
-case 7:  _hj_j += ( (unsigned)_hj_key[6] << 16 );                           \
-case 6:  _hj_j += ( (unsigned)_hj_key[5] << 8 );                            \
-case 5:  _hj_j += _hj_key[4];                                               \
-case 4:  _hj_i += ( (unsigned)_hj_key[3] << 24 );                           \
-case 3:  _hj_i += ( (unsigned)_hj_key[2] << 16 );                           \
-case 2:  _hj_i += ( (unsigned)_hj_key[1] << 8 );                            \
-case 1:  _hj_i += _hj_key[0];                                               \
-}                                                                              \
-HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                             \
-bkt = hashv & (num_bkts-1);                                                    \
-} while(0)
-
-/* The Paul Hsieh hash function */
-#undef get16bits
-#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__)             \
-|| defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)
-#define get16bits(d) (*((const uint16_t *) (d)))
-#endif
-
-#if !defined (get16bits)
-#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)             \
-+(uint32_t)(((const uint8_t *)(d))[0]) )
-#endif
-#define HASH_SFH(key,keylen,num_bkts,hashv,bkt)                                  \
-do {                                                                             \
-char *_sfh_key=(char*)(key);                                                   \
-uint32_t _sfh_tmp, _sfh_len = keylen;                                          \
-\
-int _sfh_rem = _sfh_len & 3;                                                   \
-_sfh_len >>= 2;                                                                \
-hashv = 0xcafebabe;                                                            \
-\
-/* Main loop */                                                                \
-for (;_sfh_len > 0; _sfh_len--) {                                              \
-hashv    += get16bits (_sfh_key);                                            \
-_sfh_tmp       = (get16bits (_sfh_key+2) << 11) ^ hashv;                     \
-hashv     = (hashv << 16) ^ _sfh_tmp;                                        \
-_sfh_key += 2*sizeof (uint16_t);                                             \
-hashv    += hashv >> 11;                                                     \
-}                                                                              \
-\
-/* Handle end cases */                                                         \
-switch (_sfh_rem) {                                                            \
-case 3: hashv += get16bits (_sfh_key);                                       \
-hashv ^= hashv << 16;                                                \
-hashv ^= _sfh_key[sizeof (uint16_t)] << 18;                          \
-hashv += hashv >> 11;                                                \
-break;                                                               \
-case 2: hashv += get16bits (_sfh_key);                                       \
-hashv ^= hashv << 11;                                                \
-hashv += hashv >> 17;                                                \
-break;                                                               \
-case 1: hashv += *_sfh_key;                                                  \
-hashv ^= hashv << 10;                                                \
-hashv += hashv >> 1;                                                 \
-}                                                                              \
-\
-/* Force "avalanching" of final 127 bits */                                  \
-hashv ^= hashv << 3;                                                         \
-hashv += hashv >> 5;                                                         \
-hashv ^= hashv << 4;                                                         \
-hashv += hashv >> 17;                                                        \
-hashv ^= hashv << 25;                                                        \
-hashv += hashv >> 6;                                                         \
-bkt = hashv & (num_bkts-1);                                                  \
-} while(0);
-
-#ifdef HASH_USING_NO_STRICT_ALIASING
-/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads.
- * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error.
- * MurmurHash uses the faster approach only on CPU's where we know it's safe. 
- *
- * Note the preprocessor built-in defines can be emitted using:
- *
- *   gcc -m64 -dM -E - < /dev/null                  (on gcc)
- *   cc -## a.c (where a.c is a simple test file)   (Sun Studio)
- */
-#if (defined(__i386__) || defined(__x86_64__)) 
-#define MUR_GETBLOCK(p,i) p[i]
-#else /* non intel */
-#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0)
-#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1)
-#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2)
-#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3)
-#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))
-#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))
-#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))
-#define MUR_TWO_TWO(p)   ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))
-#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >>  8))
-#else /* assume little endian non-intel */
-#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24))
-#define MUR_TWO_TWO(p)   ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16))
-#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) <<  8))
-#endif
-#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) :           \
-(MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \
-(MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) :  \
-MUR_ONE_THREE(p))))
-#endif
-#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))
-#define MUR_FMIX(_h) \
-do {                 \
-_h ^= _h >> 16;    \
-_h *= 0x85ebca6b;  \
-_h ^= _h >> 13;    \
-_h *= 0xc2b2ae35l; \
-_h ^= _h >> 16;    \
-} while(0)
-
-#define HASH_MUR(key,keylen,num_bkts,hashv,bkt)                        \
-do {                                                                   \
-const uint8_t *_mur_data = (const uint8_t*)(key);                    \
-const int _mur_nblocks = (keylen) / 4;                               \
-uint32_t _mur_h1 = 0xf88D5353;                                       \
-uint32_t _mur_c1 = 0xcc9e2d51;                                       \
-uint32_t _mur_c2 = 0x1b873593;                                       \
-const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \
-int _mur_i;                                                          \
-for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) {                      \
-uint32_t _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i);               \
-_mur_k1 *= _mur_c1;                                                \
-_mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \
-_mur_k1 *= _mur_c2;                                                \
-\
-_mur_h1 ^= _mur_k1;                                                \
-_mur_h1 = MUR_ROTL32(_mur_h1,13);                                  \
-_mur_h1 = _mur_h1*5+0xe6546b64;                                    \
-}                                                                    \
-const uint8_t *_mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \
-uint32_t _mur_k1=0;                                                  \
-switch((keylen) & 3) {                                               \
-case 3: _mur_k1 ^= _mur_tail[2] << 16;                             \
-case 2: _mur_k1 ^= _mur_tail[1] << 8;                              \
-case 1: _mur_k1 ^= _mur_tail[0];                                   \
-_mur_k1 *= _mur_c1;                                                \
-_mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \
-_mur_k1 *= _mur_c2;                                                \
-_mur_h1 ^= _mur_k1;                                                \
-}                                                                    \
-_mur_h1 ^= (keylen);                                                 \
-MUR_FMIX(_mur_h1);                                                   \
-hashv = _mur_h1;                                                     \
-bkt = hashv & (num_bkts-1);                                          \
-} while(0)
-#endif  /* HASH_USING_NO_STRICT_ALIASING */
-
-/* key comparison function; return 0 if keys equal */
-#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) 
-
-/* iterate over items in a known bucket to find desired item */
-#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out)                       \
-do {                                                                             \
-if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head));          \
-else out=NULL;                                                                  \
-while (out) {                                                                   \
-if (out->hh.keylen == keylen_in) {                                           \
-if ((HASH_KEYCMP(out->hh.key,keyptr,keylen_in)) == 0) break;             \
-}                                                                            \
-if (out->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,out->hh.hh_next)); \
-else out = NULL;                                                             \
-}                                                                               \
-} while(0)
-
-/* add an item to a bucket  */
-#define HASH_ADD_TO_BKT(head,addhh)                                              \
-do {                                                                             \
-head.count++;                                                                   \
-(addhh)->hh_next = head.hh_head;                                                \
-(addhh)->hh_prev = NULL;                                                        \
-if (head.hh_head) { (head).hh_head->hh_prev = (addhh); }                        \
-(head).hh_head=addhh;                                                           \
-if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH)             \
-&& (addhh)->tbl->noexpand != 1) {                                           \
-HASH_EXPAND_BUCKETS((addhh)->tbl);                                        \
-}                                                                               \
-} while(0)
-
-/* remove an item from a given bucket */
-#define HASH_DEL_IN_BKT(hh,head,hh_del)                                          \
-(head).count--;                                                              \
-if ((head).hh_head == hh_del) {                                              \
-(head).hh_head = hh_del->hh_next;                                          \
-}                                                                            \
-if (hh_del->hh_prev) {                                                       \
-hh_del->hh_prev->hh_next = hh_del->hh_next;                              \
-}                                                                            \
-if (hh_del->hh_next) {                                                       \
-hh_del->hh_next->hh_prev = hh_del->hh_prev;                              \
-}                                                                
-
-/* Bucket expansion has the effect of doubling the number of buckets
- * and redistributing the items into the new buckets. Ideally the
- * items will distribute more or less evenly into the new buckets
- * (the extent to which this is true is a measure of the quality of
- * the hash function as it applies to the key domain). 
- * 
- * With the items distributed into more buckets, the chain length
- * (item count) in each bucket is reduced. Thus by expanding buckets
- * the hash keeps a bound on the chain length. This bounded chain 
- * length is the essence of how a hash provides constant time lookup.
- * 
- * The calculation of tbl->ideal_chain_maxlen below deserves some
- * explanation. First, keep in mind that we're calculating the ideal
- * maximum chain length based on the *new* (doubled) bucket count.
- * In fractions this is just n/b (n=number of items,b=new num buckets).
- * Since the ideal chain length is an integer, we want to calculate 
- * ceil(n/b). We don't depend on floating point arithmetic in this
- * hash, so to calculate ceil(n/b) with integers we could write
- * 
- *      ceil(n/b) = (n/b) + ((n%b)?1:0)
- * 
- * and in fact a previous version of this hash did just that.
- * But now we have improved things a bit by recognizing that b is
- * always a power of two. We keep its base 2 log handy (call it lb),
- * so now we can write this with a bit shift and logical AND:
- * 
- *      ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)
- * 
- */
-#define HASH_EXPAND_BUCKETS(tbl)                                                 \
-do {                                                                             \
-unsigned _he_bkt;                                                            \
-unsigned _he_bkt_i;                                                          \
-struct UT_hash_handle *_he_thh, *_he_hh_nxt;                                 \
-UT_hash_bucket *_he_new_buckets, *_he_newbkt;                                \
-_he_new_buckets = (UT_hash_bucket*)uthash_malloc(                            \
-2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));              \
-if (!_he_new_buckets) { uthash_fatal( "out of memory"); }                    \
-memset(_he_new_buckets, 0,                                                   \
-2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));               \
-tbl->ideal_chain_maxlen =                                                    \
-(tbl->num_items >> (tbl->log2_num_buckets+1)) +                           \
-((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0);                    \
-tbl->nonideal_items = 0;                                                     \
-for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++)                \
-{                                                                            \
-_he_thh = tbl->buckets[ _he_bkt_i ].hh_head;                             \
-while (_he_thh) {                                                        \
-_he_hh_nxt = _he_thh->hh_next;                                        \
-HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt);            \
-_he_newbkt = &(_he_new_buckets[ _he_bkt ]);                           \
-if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) {                \
-tbl->nonideal_items++;                                              \
-_he_newbkt->expand_mult = _he_newbkt->count /                       \
-tbl->ideal_chain_maxlen;                 \
-}                                                                     \
-_he_thh->hh_prev = NULL;                                              \
-_he_thh->hh_next = _he_newbkt->hh_head;                               \
-if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev =               \
-_he_thh;                                                         \
-_he_newbkt->hh_head = _he_thh;                                        \
-_he_thh = _he_hh_nxt;                                                 \
-}                                                                        \
-}                                                                            \
-uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \
-tbl->num_buckets *= 2;                                                       \
-tbl->log2_num_buckets++;                                                     \
-tbl->buckets = _he_new_buckets;                                              \
-tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ?         \
-(tbl->ineff_expands+1) : 0;                                              \
-if (tbl->ineff_expands > 1) {                                                \
-tbl->noexpand=1;                                                         \
-uthash_noexpand_fyi(tbl);                                                \
-}                                                                            \
-uthash_expand_fyi(tbl);                                                      \
-} while(0)
-
-
-/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */
-/* Note that HASH_SORT assumes the hash handle name to be hh. 
- * HASH_SRT was added to allow the hash handle name to be passed in. */
-#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn)
-#define HASH_SRT(hh,head,cmpfcn)                                                 \
-do {                                                                             \
-unsigned _hs_i;                                                                \
-unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize;               \
-struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail;            \
-if (head) {                                                                    \
-_hs_insize = 1;                                                            \
-_hs_looping = 1;                                                           \
-_hs_list = &((head)->hh);                                                  \
-while (_hs_looping) {                                                      \
-_hs_p = _hs_list;                                                      \
-_hs_list = NULL;                                                       \
-_hs_tail = NULL;                                                       \
-_hs_nmerges = 0;                                                       \
-while (_hs_p) {                                                        \
-_hs_nmerges++;                                                     \
-_hs_q = _hs_p;                                                     \
-_hs_psize = 0;                                                     \
-for ( _hs_i = 0; _hs_i  < _hs_insize; _hs_i++ ) {                  \
-_hs_psize++;                                                   \
-_hs_q = (UT_hash_handle*)((_hs_q->next) ?                      \
-((void*)((char*)(_hs_q->next) +                        \
-(head)->hh.tbl->hho)) : NULL);                         \
-if (! (_hs_q) ) break;                                         \
-}                                                                  \
-_hs_qsize = _hs_insize;                                            \
-while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) {           \
-if (_hs_psize == 0) {                                          \
-_hs_e = _hs_q;                                             \
-_hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \
-((void*)((char*)(_hs_q->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_qsize--;                                               \
-} else if ( (_hs_qsize == 0) || !(_hs_q) ) {                   \
-_hs_e = _hs_p;                                             \
-_hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \
-((void*)((char*)(_hs_p->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_psize--;                                               \
-} else if ((                                                   \
-cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \
-DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \
-) <= 0) {                                           \
-_hs_e = _hs_p;                                             \
-_hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \
-((void*)((char*)(_hs_p->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_psize--;                                               \
-} else {                                                       \
-_hs_e = _hs_q;                                             \
-_hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \
-((void*)((char*)(_hs_q->next) +                    \
-(head)->hh.tbl->hho)) : NULL);                     \
-_hs_qsize--;                                               \
-}                                                              \
-if ( _hs_tail ) {                                              \
-_hs_tail->next = ((_hs_e) ?                                \
-ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL);          \
-} else {                                                       \
-_hs_list = _hs_e;                                          \
-}                                                              \
-_hs_e->prev = ((_hs_tail) ?                                    \
-ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL);              \
-_hs_tail = _hs_e;                                              \
-}                                                                  \
-_hs_p = _hs_q;                                                     \
-}                                                                      \
-_hs_tail->next = NULL;                                                 \
-if ( _hs_nmerges <= 1 ) {                                              \
-_hs_looping=0;                                                     \
-(head)->hh.tbl->tail = _hs_tail;                                   \
-DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list));      \
-}                                                                      \
-_hs_insize *= 2;                                                       \
-}                                                                          \
-HASH_FSCK(hh,head);                                                        \
-}                                                                               \
-} while (0)
-
-/* This function selects items from one hash into another hash. 
- * The end result is that the selected items have dual presence 
- * in both hashes. There is no copy of the items made; rather 
- * they are added into the new hash through a secondary hash 
- * hash handle that must be present in the structure. */
-#define HASH_SELECT(hh_dst, dst, hh_src, src, cond)                              \
-do {                                                                             \
-unsigned _src_bkt, _dst_bkt;                                                   \
-void *_last_elt=NULL, *_elt;                                                   \
-UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL;                         \
-ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst));                 \
-if (src) {                                                                     \
-for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) {     \
-for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head;                \
-_src_hh;                                                               \
-_src_hh = _src_hh->hh_next) {                                          \
-_elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh);                       \
-if (cond(_elt)) {                                                      \
-_dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho);               \
-_dst_hh->key = _src_hh->key;                                         \
-_dst_hh->keylen = _src_hh->keylen;                                   \
-_dst_hh->hashv = _src_hh->hashv;                                     \
-_dst_hh->prev = _last_elt;                                           \
-_dst_hh->next = NULL;                                                \
-if (_last_elt_hh) { _last_elt_hh->next = _elt; }                     \
-if (!dst) {                                                          \
-DECLTYPE_ASSIGN(dst,_elt);                                         \
-HASH_MAKE_TABLE(hh_dst,dst);                                       \
-} else {                                                             \
-_dst_hh->tbl = (dst)->hh_dst.tbl;                                  \
-}                                                                    \
-HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt);    \
-HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh);            \
-(dst)->hh_dst.tbl->num_items++;                                      \
-_last_elt = _elt;                                                    \
-_last_elt_hh = _dst_hh;                                              \
-}                                                                      \
-}                                                                          \
-}                                                                            \
-}                                                                              \
-HASH_FSCK(hh_dst,dst);                                                         \
-} while (0)
-
-#define HASH_CLEAR(hh,head)                                                      \
-do {                                                                             \
-if (head) {                                                                    \
-uthash_free((head)->hh.tbl->buckets,                                         \
-(head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket));      \
-uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                          \
-(head)=NULL;                                                                 \
-}                                                                              \
-} while(0)
-
-#ifdef NO_DECLTYPE
-#define HASH_ITER(hh,head,el,tmp)                                                \
-for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL);       \
-el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) 
-#else
-#define HASH_ITER(hh,head,el,tmp)                                                \
-for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL);                 \
-el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL))
-#endif
-
-/* obtain a count of items in the hash */
-#define HASH_COUNT(head) HASH_CNT(hh,head) 
-#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0)
-
-typedef struct UT_hash_bucket {
-    struct UT_hash_handle *hh_head;
-    unsigned count;
-    
-    /* expand_mult is normally set to 0. In this situation, the max chain length
-     * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If
-     * the bucket's chain exceeds this length, bucket expansion is triggered). 
-     * However, setting expand_mult to a non-zero value delays bucket expansion
-     * (that would be triggered by additions to this particular bucket)
-     * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.
-     * (The multiplier is simply expand_mult+1). The whole idea of this
-     * multiplier is to reduce bucket expansions, since they are expensive, in
-     * situations where we know that a particular bucket tends to be overused.
-     * It is better to let its chain length grow to a longer yet-still-bounded
-     * value, than to do an O(n) bucket expansion too often. 
-     */
-    unsigned expand_mult;
-    
-} UT_hash_bucket;
-
-/* random signature used only to find hash tables in external analysis */
-#define HASH_SIGNATURE 0xa0111fe1
-#define HASH_BLOOM_SIGNATURE 0xb12220f2
-
-typedef struct UT_hash_table {
-    UT_hash_bucket *buckets;
-    unsigned num_buckets, log2_num_buckets;
-    unsigned num_items;
-    struct UT_hash_handle *tail; /* tail hh in app order, for fast append    */
-    ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */
-    
-    /* in an ideal situation (all buckets used equally), no bucket would have
-     * more than ceil(#items/#buckets) items. that's the ideal chain length. */
-    unsigned ideal_chain_maxlen;
-    
-    /* nonideal_items is the number of items in the hash whose chain position
-     * exceeds the ideal chain maxlen. these items pay the penalty for an uneven
-     * hash distribution; reaching them in a chain traversal takes >ideal steps */
-    unsigned nonideal_items;
-    
-    /* ineffective expands occur when a bucket doubling was performed, but 
-     * afterward, more than half the items in the hash had nonideal chain
-     * positions. If this happens on two consecutive expansions we inhibit any
-     * further expansion, as it's not helping; this happens when the hash
-     * function isn't a good fit for the key domain. When expansion is inhibited
-     * the hash will still work, albeit no longer in constant time. */
-    unsigned ineff_expands, noexpand;
-    
-    uint32_t signature; /* used only to find hash tables in external analysis */
-#ifdef HASH_BLOOM
-    uint32_t bloom_sig; /* used only to test bloom exists in external analysis */
-    uint8_t *bloom_bv;
-    char bloom_nbits;
-#endif
-    
-} UT_hash_table;
-
-typedef struct UT_hash_handle {
-    struct UT_hash_table *tbl;
-    void *prev;                       /* prev element in app order      */
-    void *next;                       /* next element in app order      */
-    struct UT_hash_handle *hh_prev;   /* previous hh in bucket order    */
-    struct UT_hash_handle *hh_next;   /* next hh in bucket order        */
-    void *key;                        /* ptr to enclosing struct's key  */
-    unsigned keylen;                  /* enclosing struct's key len     */
-    unsigned hashv;                   /* result of hash-fcn(key)        */
-} UT_hash_handle;
-
-#endif /* UTHASH_H */
