ccid_close_reader (ccid_driver_t handle)
{
  if (!handle || (!handle->idev && handle->dev_fd == -1))
    return 0;

  do_close_reader (handle);
  free (handle->rid);
  free (handle);
  return 0;
}
ccid_close_reader (ccid_driver_t handle)
{
  if (!handle || (!handle->idev && handle->dev_fd == -1))
    return 0;

  do_close_reader (handle);
  free (handle->rid);
  free (handle);
  return 0;
}