Logo Search packages:      
Sourcecode: libgphoto2 version File versions

int gp_file_new ( CameraFile **  file  ) 

Create new CameraFile object.

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

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

References CHECK_NULL, GP_ERROR_NO_MEMORY, GP_FILE_ACCESSTYPE_MEMORY, GP_FILE_TYPE_NORMAL, and GP_OK.

Referenced by gp_camera_file_get_info(), and gp_filesystem_get_file().

{
      CHECK_NULL (file);

      *file = malloc (sizeof (CameraFile));
      if (!*file)
            return (GP_ERROR_NO_MEMORY);
      memset (*file, 0, sizeof (CameraFile));

      (*file)->type = GP_FILE_TYPE_NORMAL;
      strcpy ((*file)->mime_type, "unknown/unknown");
      (*file)->ref_count = 1;
      (*file)->accesstype = GP_FILE_ACCESSTYPE_MEMORY;
      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index