/*********************************************************************
** Copyright (c) 1992-2025 MAK Technologies, Inc
** All rights reserved.
*********************************************************************/

#ifndef mtlenv_H
#define mtlenv_H

//! \file mtlenv.h
//! \ingroup mtl
//! \brief This class declares DtlHashTable

#ifdef DtUSE_UTILITIES_NAMESPACE
namespace DtUSE_UTILITIES_NAMESPACE
{
#endif

class DT_DLL_MTL symbol_entry
{
  public:
    symbol_entry(const DtlObjPtr& sym, const DtlObjPtr& bind);
    ~symbol_entry();
    DtlObjPtr symbol;
    DtlObjPtr binding;
    symbol_entry *next;
};

//! This is where symbol_entries are stored.
//! \ingroup mtl
class DT_DLL_MTL DtlHashTable
{
  public:
    DtlHashTable(void);
    ~DtlHashTable();
    DtlObjPtr lookup(const char *name);
    DtlObjPtr findsym(const char *name);
    DtlObjPtr insert(const DtlObjPtr& sym, const DtlObjPtr& bind, const DtlObjPtr& env);
    DtlObjPtr rebind(const DtlObjPtr& sym, const DtlObjPtr& bind, const DtlObjPtr& env);
    DtlObjPtr bindings();
    void dump(void);

#define DtMTL_MASK	0xff
    symbol_entry *bucket[DtMTL_MASK + 1];
};

#ifdef DtUSE_UTILITIES_NAMESPACE
} //! end of namespace DtUSE_UTILITIES_NAMESPACE
#endif

#endif

