Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_file_clean ( CameraFile file  ) 

Parameters:
file a CameraFile
Returns:
a gphoto2 error code.

Definition at line 628 of file gphoto2-file.c.

References CHECK_NULL, GP_FILE_ACCESSTYPE_FD, GP_FILE_ACCESSTYPE_MEMORY, and GP_OK.

Referenced by gp_camera_capture_preview(), gp_camera_file_get(), gp_file_free(), and gp_file_open().

{
        /* 
       * Frees a CameraFile's components, not the CameraFile itself.
       * This is used to prep a CameraFile struct to be filled.
         */

      CHECK_NULL (file);

      switch (file->accesstype) {
      case GP_FILE_ACCESSTYPE_MEMORY:
            if (file->data != NULL)
                  free(file->data);
            file->data = NULL;
            file->size = 0;
            break;
      case GP_FILE_ACCESSTYPE_FD:
            break;
      default:break;
      }
      strcpy (file->name, "");
        return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index