Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_filesystem_name ( CameraFilesystem fs,
const char *  folder,
int  filenumber,
const char **  filename,
GPContext context 
)

gp_filesystem_name: : a CameraFilesystem : the folder where to look up the file with the : the number of the file : : a GPContext

Looks up the of file with given in given . See gp_filesystem_number for exactly the opposite functionality.

Return value: a gphoto2 error code.

Definition at line 1238 of file gphoto2-filesys.c.

References _CameraFilesystem::folder.

{
        int x;

      CHECK_NULL (fs && folder);
      CC (context);
      CA (folder, context);

      CR (x = gp_filesystem_folder_number (fs, folder, context));
      
      if (filenumber > fs->folder[x].count) {
            gp_context_error (context, _("Folder '%s' does only contain "
                  "%i files, but you requested a file with number %i."),
                  folder, fs->folder[x].count, filenumber);
            return (GP_ERROR_FILE_NOT_FOUND);
      }
      
      *filename = fs->folder[x].file[filenumber].name;
      return (GP_OK);
}


Generated by  Doxygen 1.6.0   Back to index