emulator/io5/allocation.c
io5_error_t io5_file_deallocate(io5_file_t *file) {
  if (NULL == file) {
    return io5_error;
  }
  if (NULL != file->handle) {
    fclose(file->handle);
    file->handle = NULL;
  }
  if (NULL != file->name) {
    free(file->name);
    file->name = NULL;
  }

  memset(file, 0, sizeof(io5_file_t));
  free(file);

  return io5_ok;
}
// deallocate all resources attached to the instance
deallocate all resources attached to the instance
deallocate all resources attached to the instance
io5_error_t io5_file_deallocate(io5_file_t *file) {
  if (NULL == file) {
    return io5_error;
  }
  if (NULL != file->handle) {
    fclose(file->handle);
    file->handle = NULL;
  }
  if (NULL != file->name) {
    free(file->name);
    file->name = NULL;
  }
  memset(file, 0, sizeof(io5_file_t));
  free(file);
  return io5_ok;
}
io5_error_t io5_file_deallocate ( io5_file_t * file ) { if ( NULL == file ) { return io5_error ; } if ( NULL != file -> handle ) { fclose ( file -> handle ) ; file -> handle = NULL ; } if ( NULL != file -> name ) { free ( file -> name ) ; file -> name = NULL ; } memset ( file , 0 , sizeof ( io5_file_t ) ) ; free ( file ) ; return io5_ok ; }
deallocate all resources attached to the instance
deallocate all resources attached to the instance