dwg_free_variable_type (Dwg_Data *restrict dwg, Dwg_Object *restrict obj)
{
  const int i = obj->type - 500;
  Dwg_Class *klass;
  Bit_Chain *dat = &pdat;

  if (i < 0 || i >= (int)dwg->num_classes)
    return DWG_ERR_INVALIDTYPE;

  klass = &dwg->dwg_class[i];
  if (!klass || !klass->dxfname)
    return DWG_ERR_INTERNALERROR;

  if (strNE (obj->dxfname, klass->dxfname))
    {
      LOG_ERROR ("Wrong %s.type %d for obj [%d]: != %s",  obj->dxfname, obj->type,
                 obj->index, klass->dxfname);
      return DWG_ERR_INVALIDTYPE;
    }

  // global class dispatcher:
  // with indxf even DEBUGGING objects, such as TABLE are created.
  // usually not written/encoded though.

  // clang-format off
  #include "classes.inc"

  #undef WARN_UNHANDLED_CLASS
  #undef WARN_UNSTABLE_CLASS
  // clang-format on

  return DWG_ERR_UNHANDLEDCLASS;
}
dwg_free_variable_type (Dwg_Data *restrict dwg, Dwg_Object *restrict obj)
{
  const int i = obj->type - 500;
  Dwg_Class *klass;
  Bit_Chain *dat = &pdat;

  if (i < 0 || i >= (int)dwg->num_classes)
    return DWG_ERR_INVALIDTYPE;

  klass = &dwg->dwg_class[i];
  if (!klass || !klass->dxfname)
    return DWG_ERR_INTERNALERROR;

  if (strNE (obj->dxfname, klass->dxfname))
    {
      LOG_ERROR ("Wrong %s.type %d for obj [%d]: != %s",  obj->dxfname, obj->type,
                 obj->index, klass->dxfname);
      return DWG_ERR_INVALIDTYPE;
    }

   
   
   

   
  #include "classes.inc"

  #undef WARN_UNHANDLED_CLASS
  #undef WARN_UNSTABLE_CLASS
   

  return DWG_ERR_UNHANDLEDCLASS;
}