libgphoto2 photo camera library (libgphoto2) API  2.4.14
gphoto2-filesys.h
Go to the documentation of this file.
1 
29 #ifndef __GPHOTO2_FILESYS_H__
30 #define __GPHOTO2_FILESYS_H__
31 
32 #include <time.h>
33 
35 #include <gphoto2/gphoto2-list.h>
36 #include <gphoto2/gphoto2-file.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 
53 typedef enum {
55  GP_FILE_INFO_TYPE = 1 << 0,
56  GP_FILE_INFO_NAME = 1 << 1,
57  GP_FILE_INFO_SIZE = 1 << 2,
58  GP_FILE_INFO_WIDTH = 1 << 3,
62  GP_FILE_INFO_MTIME = 1 << 7,
65 
71 typedef enum {
73  GP_FILE_PERM_READ = 1 << 0,
77 
83 typedef enum {
87 
94 typedef struct _CameraFileInfoFile {
97  unsigned long size;
98  char type[64];
100  unsigned int width;
101  unsigned int height;
102  char name[64];
104  time_t mtime;
106 
113 typedef struct _CameraFileInfoPreview {
116  unsigned long size;
117  char type[64];
119  unsigned int width;
120  unsigned int height;
122 
129 typedef struct _CameraFileInfoAudio {
132  unsigned long size;
133  char type[64];
135 
142 typedef struct _CameraFileInfo {
143  CameraFileInfoPreview preview;
144  CameraFileInfoFile file;
145  CameraFileInfoAudio audio;
147 
154 typedef enum {
169 
176 typedef enum {
183 
190 typedef enum {
195 
202 typedef enum {
208 
217  char basedir[256];
218  char label[256];
219  char description[256];
223  unsigned long capacitykbytes;
224  unsigned long freekbytes;
225  unsigned long freeimages;
227 
236 
239 
240 /* Manual editing */
241 int gp_filesystem_append (CameraFilesystem *fs, const char *folder,
242  const char *filename, GPContext *context);
243 int gp_filesystem_set_info_noop (CameraFilesystem *fs, const char *folder,
244  CameraFileInfo info, GPContext *context);
245 int gp_filesystem_set_file_noop (CameraFilesystem *fs, const char *folder,
246  CameraFile *file, GPContext *context);
247 int gp_filesystem_delete_file_noop (CameraFilesystem *fs, const char *folder,
248  const char *filename, GPContext *context);
250 
251 /* Information retrieval */
252 int gp_filesystem_count (CameraFilesystem *fs, const char *folder,
253  GPContext *context);
254 int gp_filesystem_name (CameraFilesystem *fs, const char *folder,
255  int filenumber, const char **filename,
256  GPContext *context);
257 int gp_filesystem_get_folder (CameraFilesystem *fs, const char *filename,
258  char **folder, GPContext *context);
259 int gp_filesystem_number (CameraFilesystem *fs, const char *folder,
260  const char *filename, GPContext *context);
261 
262 /* Listings */
263 typedef int (*CameraFilesystemListFunc) (CameraFilesystem *fs,
264  const char *folder, CameraList *list,
265  void *data, GPContext *context);
267  CameraFilesystemListFunc file_list_func,
268  CameraFilesystemListFunc folder_list_func,
269  void *data);
270 int gp_filesystem_list_files (CameraFilesystem *fs, const char *folder,
271  CameraList *list, GPContext *context);
272 int gp_filesystem_list_folders (CameraFilesystem *fs, const char *folder,
273  CameraList *list, GPContext *context);
274 
275 /* File information */
276 typedef int (*CameraFilesystemSetInfoFunc) (CameraFilesystem *fs,
277  const char *folder,
278  const char *filename,
279  CameraFileInfo info, void *data,
280  GPContext *context);
281 typedef int (*CameraFilesystemGetInfoFunc) (CameraFilesystem *fs,
282  const char *folder,
283  const char *filename,
284  CameraFileInfo *info, void *data,
285  GPContext *context);
287  CameraFilesystemGetInfoFunc get_info_func,
288  CameraFilesystemSetInfoFunc set_info_func,
289  void *data);
290 int gp_filesystem_get_info (CameraFilesystem *fs, const char *folder,
291  const char *filename, CameraFileInfo *info,
292  GPContext *context);
293 int gp_filesystem_set_info (CameraFilesystem *fs, const char *folder,
294  const char *filename, CameraFileInfo info,
295  GPContext *context);
296 
297 /* Files */
298 typedef int (*CameraFilesystemGetFileFunc) (CameraFilesystem *fs,
299  const char *folder,
300  const char *filename,
301  CameraFileType type,
302  CameraFile *file, void *data,
303  GPContext *context);
304 typedef int (*CameraFilesystemDeleteFileFunc) (CameraFilesystem *fs,
305  const char *folder,
306  const char *filename,
307  void *data, GPContext *context);
309  CameraFilesystemGetFileFunc get_file_func,
310  CameraFilesystemDeleteFileFunc del_file_func,
311  void *data);
312 int gp_filesystem_get_file (CameraFilesystem *fs, const char *folder,
313  const char *filename, CameraFileType type,
314  CameraFile *file, GPContext *context);
315 int gp_filesystem_delete_file (CameraFilesystem *fs, const char *folder,
316  const char *filename, GPContext *context);
317 
318 /* Folders */
319 typedef int (*CameraFilesystemPutFileFunc) (CameraFilesystem *fs,
320  const char *folder,
321  CameraFile *file, void *data,
322  GPContext *context);
323 typedef int (*CameraFilesystemDeleteAllFunc) (CameraFilesystem *fs,
324  const char *folder, void *data,
325  GPContext *context);
326 typedef int (*CameraFilesystemDirFunc) (CameraFilesystem *fs,
327  const char *folder,
328  const char *name, void *data,
329  GPContext *context);
331  CameraFilesystemPutFileFunc put_file_func,
332  CameraFilesystemDeleteAllFunc delete_all_func,
333  CameraFilesystemDirFunc make_dir_func,
334  CameraFilesystemDirFunc remove_dir_func,
335  void *data);
336 
337 typedef int (*CameraFilesystemStorageInfoFunc) (CameraFilesystem *fs,
339  int *nrofstorageinformations,
340  void *data, GPContext *context);
341 
343  CameraStorageInformation **,
344  int *nrofstorageinformations,
345  GPContext *context);
346 
349  CameraFilesystemListFunc file_list_func;
350  CameraFilesystemListFunc folder_list_func;
351  CameraFilesystemPutFileFunc put_file_func;
352  CameraFilesystemDeleteAllFunc delete_all_func;
353  CameraFilesystemGetInfoFunc get_info_func;
354  CameraFilesystemSetInfoFunc set_info_func;
355  CameraFilesystemDirFunc make_dir_func;
356  CameraFilesystemDirFunc remove_dir_func;
357  CameraFilesystemGetFileFunc get_file_func;
358  CameraFilesystemDeleteFileFunc del_file_func;
359 
360  CameraFilesystemStorageInfoFunc storage_info_func;
361 
362  /* for later use. Remove one if you add a new function */
363  void *unused[31];
364 };
366  CameraFilesystemFuncs *funcs,
367  void *data);
368 int gp_filesystem_put_file (CameraFilesystem *fs, const char *folder,
369  CameraFile *file, GPContext *context);
370 int gp_filesystem_delete_all (CameraFilesystem *fs, const char *folder,
371  GPContext *context);
372 int gp_filesystem_make_dir (CameraFilesystem *fs, const char *folder,
373  const char *name, GPContext *context);
374 int gp_filesystem_remove_dir (CameraFilesystem *fs, const char *folder,
375  const char *name, GPContext *context);
376 
377 /* For debugging */
379 
380 #ifdef __cplusplus
381 }
382 #endif /* __cplusplus */
383 
384 #endif /* __GPHOTO2_FILESYS_H__ */