Logo Search packages:      
Sourcecode: libgphoto2 version File versions

gphoto2-filesys.c File Reference


Detailed Description

gp_filesystem_get_file: : a CameraFilesystem : the folder in which the file can be found : the name of the file to download : the type of the file

: a GPContext

Downloads the file called from the using the get_file_func if such a function has been previously supplied. If the file has been previously downloaded, the file is retrieved from cache.

Return value: a gphoto2 error code.

Definition in file gphoto2-filesys.c.

#include "config.h"
#include "gphoto2-filesys.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include "gphoto2-result.h"
#include "gphoto2-file.h"
#include "gphoto2-port-log.h"
#include <limits.h>

Go to the source code of this file.

Classes

struct  _CameraFilesystem
struct  _CameraFilesystemFile
struct  CameraFilesystemFolder

Defines

#define _(String)   (String)
#define bindtextdomain(Domain, Directory)   (Domain)
#define CA(f, c)
#define CC(context)
#define CHECK_MEM(m)   {if (!(m)) return (GP_ERROR_NO_MEMORY);}
#define CHECK_NULL(r)   {if (!(r)) return (GP_ERROR_BAD_PARAMETERS);}
#define CL(result, list)
#define CR(result)   {int r = (result); if (r < 0) return (r);}
#define CU(result, file)
#define dcgettext(Domain, Message, Type)   (Message)
#define dgettext(Domain, Message)   (Message)
#define gettext(String)   (String)
#define GP_MODULE   "libgphoto2"
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
#define N_(String)   (String)
#define textdomain(String)   (String)

Typedefs

typedef struct
_CameraFilesystemFile 
CameraFilesystemFile

Functions

static int append_file (CameraFilesystem *fs, int x, CameraFile *file)
static int append_folder (CameraFilesystem *fs, const char *folder, GPContext *context)
static int delete_all_files (CameraFilesystem *fs, int x)
static int delete_all_folders (CameraFilesystem *fs, const char *folder, GPContext *context)
static int delete_file (CameraFilesystem *fs, int x, int y)
static int delete_folder (CameraFilesystem *fs, int x)
int gp_filesystem_append (CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
int gp_filesystem_count (CameraFilesystem *fs, const char *folder, GPContext *context)
int gp_filesystem_delete_all (CameraFilesystem *fs, const char *folder, GPContext *context)
static int gp_filesystem_delete_all_one_by_one (CameraFilesystem *fs, const char *folder, GPContext *context)
int gp_filesystem_delete_file (CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
int gp_filesystem_delete_file_noop (CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
int gp_filesystem_dump (CameraFilesystem *fs)
static int gp_filesystem_folder_number (CameraFilesystem *fs, const char *folder, GPContext *context)
int gp_filesystem_free (CameraFilesystem *fs)
int gp_filesystem_list_files (CameraFilesystem *fs, const char *folder, CameraList *list, GPContext *context)
int gp_filesystem_list_folders (CameraFilesystem *fs, const char *folder, CameraList *list, GPContext *context)
int gp_filesystem_new (CameraFilesystem **fs)
int gp_filesystem_reset (CameraFilesystem *fs)
in given @folder.
Return value: a gphoto2 error code

int gp_filesystem_get_file (CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, CameraFile *file, GPContext *context)
static int gp_filesystem_get_file_impl (CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, CameraFile *file, GPContext *context)
int gp_filesystem_get_folder (CameraFilesystem *fs, const char *filename, const char **folder, GPContext *context)
int gp_filesystem_get_info (CameraFilesystem *fs, const char *folder, const char *filename, CameraFileInfo *info, GPContext *context)
static int gp_filesystem_lru_check (CameraFilesystem *fs)
static int gp_filesystem_lru_clear (CameraFilesystem *fs)
static int gp_filesystem_lru_free (CameraFilesystem *fs)
static int gp_filesystem_lru_remove_one (CameraFilesystem *fs, CameraFilesystemFile *item)
static int gp_filesystem_lru_update (CameraFilesystem *fs, const char *folder, CameraFile *file, GPContext *context)
int gp_filesystem_make_dir (CameraFilesystem *fs, const char *folder, const char *name, GPContext *context)
int gp_filesystem_name (CameraFilesystem *fs, const char *folder, int filenumber, const char **filename, GPContext *context)
int gp_filesystem_number (CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
int gp_filesystem_put_file (CameraFilesystem *fs, const char *folder, CameraFile *file, GPContext *context)
int gp_filesystem_remove_dir (CameraFilesystem *fs, const char *folder, const char *name, GPContext *context)
static int gp_filesystem_scan (CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
int gp_filesystem_set_file_funcs (CameraFilesystem *fs, CameraFilesystemGetFileFunc get_file_func, CameraFilesystemDeleteFileFunc del_file_func, void *data)
int gp_filesystem_set_file_noop (CameraFilesystem *fs, const char *folder, CameraFile *file, GPContext *context)
int gp_filesystem_set_folder_funcs (CameraFilesystem *fs, CameraFilesystemPutFileFunc put_file_func, CameraFilesystemDeleteAllFunc delete_all_func, CameraFilesystemDirFunc make_dir_func, CameraFilesystemDirFunc remove_dir_func, void *data)
int gp_filesystem_set_info (CameraFilesystem *fs, const char *folder, const char *filename, CameraFileInfo info, GPContext *context)
int gp_filesystem_set_info_funcs (CameraFilesystem *fs, CameraFilesystemGetInfoFunc get_info_func, CameraFilesystemSetInfoFunc set_info_func, void *data)
int gp_filesystem_set_info_noop (CameraFilesystem *fs, const char *folder, CameraFileInfo info, GPContext *context)
int gp_filesystem_set_list_funcs (CameraFilesystem *fs, CameraFilesystemListFunc file_list_func, CameraFilesystemListFunc folder_list_func, void *data)
static int gp_get_free_memory (GPContext *context, unsigned *free)


Generated by  Doxygen 1.6.0   Back to index