/*! Closes d and releases all storage associated with it except the internal p_cdio pointer. @param d cdrom_drive_t object to be closed. @return 0 if passed a null pointer and 1 if not in which case some work was probably done. @see cdio_cddap_close */ bool cdio_cddap_close_no_free_cdio(cdrom_drive_t *d) { if(d){ if(d->opened) d->enable_cdda(d,0); _clean_messages(d); if (d->cdda_device_name) free(d->cdda_device_name); if (d->drive_model) free(d->drive_model); d->cdda_device_name = d->drive_model = NULL; free(d); return true; } return false; }
/* doubles as "cdrom_drive_free()" */ int cdda_close(cdrom_drive *d){ if(d){ if(d->opened) d->enable_cdda(d,0); _clean_messages(d); if(d->cdda_device_name)free(d->cdda_device_name); if(d->ioctl_device_name)free(d->ioctl_device_name); if(d->drive_model)free(d->drive_model); if(d->cdda_fd!=-1)close(d->cdda_fd); if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd); if(d->sg)free(d->sg); free(d); } return(0); }
/* doubles as "cdrom_drive_free()" */ int cdda_close(cdrom_drive *d){ if(d){ if(d->opened) d->enable_cdda(d,0); _clean_messages(d); #ifndef __APPLE__ if(d->cdda_device_name)free(d->cdda_device_name); if(d->ioctl_device_name)free(d->ioctl_device_name); if(d->drive_model)free(d->drive_model); if(d->cdda_fd!=-1)close(d->cdda_fd); if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd); if(d->sg)free(d->sg); #else osx_cdda_close(d); #endif /* __APPLE__ */ free(d); } return(0); }