30 #ifndef __GPHOTO2_FILESYS_H__ 31 #define __GPHOTO2_FILESYS_H__ 218 char description[256];
241 const char *filename,
GPContext *context);
243 const char *folder,
const char *filename,
246 const char *folder,
const char *filename,
250 const char *filename,
GPContext *context);
257 int filenumber,
const char **filename,
262 const char *filename,
GPContext *context);
276 const char *filename,
281 const char *filename,
294 const char *filename,
300 const char *filename,
309 const char *filename,
316 uint64_t offset,
char *buf, uint64_t *size,
319 const char *filename,
GPContext *context);
324 const char *filename,
330 const char *folder,
void *data,
334 const char *name,
void *data,
339 int *nrofstorageinformations,
343 CameraStorageInformation **,
344 int *nrofstorageinformations,
355 CameraFilesystemDirFunc make_dir_func;
356 CameraFilesystemDirFunc remove_dir_func;
358 CameraFilesystemReadFileFunc read_file_func;
359 CameraFilesystemDeleteFileFunc del_file_func;
uint64_t size
Size of the file.
Definition: gphoto2-filesys.h:98
A fixed RAM storage. (e.g. SDRAM)
Definition: gphoto2-filesys.h:179
CameraStorageFilesystemType
Filesystem hierarchy types.
Definition: gphoto2-filesys.h:201
int gp_filesystem_set_info_noop(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileInfo info, GPContext *context)
Store the file information in the virtual fs.
Definition: gphoto2-filesys.c:2329
char type[64]
MIME type of the file.
Definition: gphoto2-filesys.h:99
Definition: gphoto2-list.c:47
CameraFileInfoFields fields
Bitmask containing the set members.
Definition: gphoto2-filesys.h:129
int folder_list_func(CameraFilesystem *fs, const char *folder, CameraList *list, void *data, GPContext *context)
Definition: template.c:379
int gp_filesystem_free(CameraFilesystem *fs)
Free filesystem struct.
Definition: gphoto2-filesys.c:685
Storage is Ready Only.
Definition: gphoto2-filesys.h:191
int gp_filesystem_get_file(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, CameraFile *file, GPContext *context)
Get file data from the filesystem.
Definition: gphoto2-filesys.c:1630
uint32_t height
Width of the file.
Definition: gphoto2-filesys.h:101
uint32_t height
Height of the preview.
Definition: gphoto2-filesys.h:119
time_t mtime
Modification time of the file.
Definition: gphoto2-filesys.h:103
Maximum capacity in kbytes.
Definition: gphoto2-filesys.h:164
Unknown storage type.
Definition: gphoto2-filesys.h:176
The filesize is set.
Definition: gphoto2-filesys.h:58
The base directory. Usually / if just 1 storage is attached.
Definition: gphoto2-filesys.h:154
CameraFileInfoFields fields
Bitmask containing the set members.
Definition: gphoto2-filesys.h:96
Internal.
Definition: gphoto2-filesys.h:76
int gp_filesystem_number(CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
Get the index of a file in specified folder.
Definition: gphoto2-filesys.c:1380
File information of a preview file.
Definition: gphoto2-filesys.h:112
A removable RAM storage. (any kind of cards etc)
Definition: gphoto2-filesys.h:180
uint64_t size
Size of the audio file.
Definition: gphoto2-filesys.h:131
int gp_filesystem_delete_file_noop(CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
Delete a virtal file from a folder in the filesystem.
Definition: gphoto2-filesys.c:1153
The modification time is set.
Definition: gphoto2-filesys.h:63
struct _CameraFileInfoAudio CameraFileInfoAudio
File information of an audio file.
int gp_filesystem_name(CameraFilesystem *fs, const char *folder, int filenumber, const char **filename, GPContext *context)
Lookup the filename of an indexed file within a folder.
Definition: gphoto2-filesys.c:1334
int gp_filesystem_set_info(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileInfo info, GPContext *context)
Set information about a file.
Definition: gphoto2-filesys.c:2361
CameraStorageInfoFields
Storage information flags.
Definition: gphoto2-filesys.h:153
The access permissions are set.
Definition: gphoto2-filesys.h:61
Free space in images.
Definition: gphoto2-filesys.h:166
Undefined or unknown filesystem hierarchy.
Definition: gphoto2-filesys.h:202
No fields set.
Definition: gphoto2-filesys.h:56
int gp_filesystem_set_file_noop(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, CameraFile *file, GPContext *context)
Attach file content to a specified file.
Definition: gphoto2-filesys.c:2194
CameraFileStatus
Possible status values.
Definition: gphoto2-filesys.h:84
int file_list_func(CameraFilesystem *fs, const char *folder, CameraList *list, void *data, GPContext *context)
Definition: template.c:399
int gp_filesystem_list_files(CameraFilesystem *fs, const char *folder, CameraList *list, GPContext *context)
Get the list of files in a folder.
Definition: gphoto2-filesys.c:948
int get_file_func(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, CameraFile *file, void *data, GPContext *context)
Definition: template.c:250
uint64_t size
Size of the preview.
Definition: gphoto2-filesys.h:115
Free space in kbytes.
Definition: gphoto2-filesys.h:165
Storage is Read / Write.
Definition: gphoto2-filesys.h:190
int gp_filesystem_new(CameraFilesystem **fs)
Create a new filesystem struct.
Definition: gphoto2-filesys.c:654
Access permissions.
Definition: gphoto2-filesys.h:161
int gp_filesystem_get_info(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileInfo *info, GPContext *context)
Get information about the specified file.
Definition: gphoto2-filesys.c:1851
Context callback operation functions.
int gp_filesystem_dump(CameraFilesystem *fs)
Dump the current filesystem.
Definition: gphoto2-filesys.c:801
No permissions.
Definition: gphoto2-filesys.h:73
int gp_filesystem_list_folders(CameraFilesystem *fs, const char *folder, CameraList *list, GPContext *context)
List all subfolders within a filesystem folder.
Definition: gphoto2-filesys.c:1014
struct _CameraFileInfoFile CameraFileInfoFile
File information of a regular file.
File information of an audio file.
Definition: gphoto2-filesys.h:128
Definition: gphoto2-filesys.h:86
The MIME type is set.
Definition: gphoto2-filesys.h:57
int gp_filesystem_reset(CameraFilesystem *fs)
Clear the filesystem.
Definition: gphoto2-filesys.c:630
int gp_filesystem_make_dir(CameraFilesystem *fs, const char *folder, const char *name, GPContext *context)
Create a subfolder within a folder.
Definition: gphoto2-filesys.c:1179
Read permissions.
Definition: gphoto2-filesys.h:74
int gp_filesystem_delete_all(CameraFilesystem *fs, const char *folder, GPContext *context)
Delete all files in specified folder.
Definition: gphoto2-filesys.c:887
uint32_t width
Height of the file.
Definition: gphoto2-filesys.h:100
Abstracted gphoto2 file operations.
DCIM style storage.
Definition: gphoto2-filesys.h:205
CameraStorageAccessType
Storage access modes.
Definition: gphoto2-filesys.h:189
int gp_filesystem_count(CameraFilesystem *fs, const char *folder, GPContext *context)
Count files a folder of a filesystem.
Definition: gphoto2-filesys.c:1072
File information structure.
Definition: gphoto2-filesys.h:141
int set_info_func(CameraFilesystem *fs, const char *folder, const char *file, CameraFileInfo info, void *data, GPContext *context)
Definition: template.c:359
Label of the filesystem. Could also be a DOS label.
Definition: gphoto2-filesys.h:157
Filesystem type.
Definition: gphoto2-filesys.h:163
int gp_filesystem_put_file(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, CameraFile *file, GPContext *context)
Upload a file to a folder on the device filesystem.
Definition: gphoto2-filesys.c:1288
int delete_all_func(CameraFilesystem *fs, const char *folder, void *data, GPContext *context)
Definition: template.c:316
int gp_filesystem_get_folder(CameraFilesystem *fs, const char *filename, char **folder, GPContext *context)
Search a folder that contains a given filename.
Definition: gphoto2-filesys.c:1511
struct _CameraStorageInformation CameraStorageInformation
Storage information structue.
The internal camera filesystem structure.
Definition: gphoto2-filesys.c:242
All possible fields set. Internal.
Definition: gphoto2-filesys.h:64
CameraFileStatus status
Status of the file.
Definition: gphoto2-filesys.h:97
CameraFilePermissions permissions
Permissions of the file.
Definition: gphoto2-filesys.h:102
CameraFileInfoFields fields
Bitmask containing the set members.
Definition: gphoto2-filesys.h:113
The height is set.
Definition: gphoto2-filesys.h:60
Hardware type.
Definition: gphoto2-filesys.h:162
CameraStorageType
Hardware storage types.
Definition: gphoto2-filesys.h:175
Definition: gphoto2-filesys.h:348
int gp_filesystem_remove_dir(CameraFilesystem *fs, const char *folder, const char *name, GPContext *context)
Remove a subfolder from within a folder.
Definition: gphoto2-filesys.c:1213
CameraFilePermissions
Bitmask containing the file permission flags.
Definition: gphoto2-filesys.h:72
CameraFileInfoFields
Bitmask on what fields are set in the CameraFileInfo structure.
Definition: gphoto2-filesys.h:55
uint32_t width
Width of the preview.
Definition: gphoto2-filesys.h:118
int gp_filesystem_get_storageinfo(CameraFilesystem *fs, CameraStorageInformation **, int *nrofstorageinformations, GPContext *context)
Get the storage information about this filesystem.
Definition: gphoto2-filesys.c:2443
File information of a regular file.
Definition: gphoto2-filesys.h:95
The width is set.
Definition: gphoto2-filesys.h:59
More verbose description.
Definition: gphoto2-filesys.h:160
Definition: gphoto2-filesys.h:85
int gp_filesystem_read_file(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, uint64_t offset, char *buf, uint64_t *size, GPContext *context)
Get partial file data from the filesystem.
Definition: gphoto2-filesys.c:1763
int put_file_func(CameraFilesystem *fs, const char *folder, const char *name, CameraFileType type, CameraFile *file, void *data, GPContext *context)
Definition: template.c:274
Generic flat storage (all in 1 directory).
Definition: gphoto2-filesys.h:203
int gp_filesystem_set_funcs(CameraFilesystem *fs, CameraFilesystemFuncs *funcs, void *data)
Set all filesystem related function pointers.
Definition: gphoto2-filesys.c:1818
Generic tree hierarchy.
Definition: gphoto2-filesys.h:204
int get_info_func(CameraFilesystem *fs, const char *folder, const char *filename, CameraFileInfo *info, void *data, GPContext *context)
Definition: template.c:341
Storage is Ready Only, but allows Delete.
Definition: gphoto2-filesys.h:192
The status is set (downloaded).
Definition: gphoto2-filesys.h:62
CameraFileType
The type of view on the specified file.
Definition: gphoto2-file.h:72
struct _CameraFileInfoPreview CameraFileInfoPreview
File information of a preview file.
int storage_info_func(CameraFilesystem *fs, CameraStorageInformation **storageinformations, int *nrofstorageinformations, void *data, GPContext *context)
Definition: template.c:420
Definition: gphoto2-context.c:38
Write permissions.
Definition: gphoto2-filesys.h:75
CameraFileStatus status
Status of the preview file.
Definition: gphoto2-filesys.h:130
int gp_filesystem_delete_file(CameraFilesystem *fs, const char *folder, const char *filename, GPContext *context)
Delete a file from a folder.
Definition: gphoto2-filesys.c:1109
A removable ROM storage.
Definition: gphoto2-filesys.h:178
CameraFileStatus status
Status of the preview.
Definition: gphoto2-filesys.h:114
A fixed ROM storage.
Definition: gphoto2-filesys.h:177
struct _CameraFileInfo CameraFileInfo
File information structure.