dwg_get_layer_count (const Dwg_Data *dwg)
{
  Dwg_Object *ctrl;
  assert (dwg);
  ctrl = dwg_get_first_object (dwg, DWG_TYPE_LAYER_CONTROL);
  if (ctrl && ctrl->tio.object && ctrl->tio.object->tio.LAYER_CONTROL)
    return ctrl->tio.object->tio.LAYER_CONTROL->num_entries;
  else
    return 0;
}
dwg_get_layer_count (const Dwg_Data *dwg)
{
  Dwg_Object *ctrl;
  assert (dwg);
  ctrl = dwg_get_first_object (dwg, DWG_TYPE_LAYER_CONTROL);
  if (ctrl && ctrl->tio.object && ctrl->tio.object->tio.LAYER_CONTROL)
    return ctrl->tio.object->tio.LAYER_CONTROL->num_entries;
  else
    return 0;
}