diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2007-01-02 21:15:31 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2007-01-02 21:15:31 +0000 |
commit | bccfd0b9f241c1fcc1ba0fe154fc1152aea70f09 (patch) | |
tree | 5cf9dd11655aee9364ff5b54ede1fe55499f54f8 /libgphoto2/gphoto2-filesys.c | |
parent | b96c54c9a5f26a0dacbb9b6402f872236d40e686 (diff) | |
download | libgphoto2-bccfd0b9f241c1fcc1ba0fe154fc1152aea70f09.tar.gz |
implemented a programmatic way to get storage information.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9830 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-filesys.c')
-rw-r--r-- | libgphoto2/gphoto2-filesys.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libgphoto2/gphoto2-filesys.c b/libgphoto2/gphoto2-filesys.c index 09a6f1348..1f28c0233 100644 --- a/libgphoto2/gphoto2-filesys.c +++ b/libgphoto2/gphoto2-filesys.c @@ -240,6 +240,8 @@ struct _CameraFilesystem { CameraFilesystemDirFunc make_dir_func; CameraFilesystemDirFunc remove_dir_func; void *folder_data; + + CameraFilesystemStorageInfoFunc storage_info_func; }; #undef MIN @@ -1786,6 +1788,7 @@ gp_filesystem_set_funcs (CameraFilesystem *fs, fs->get_file_func = funcs->get_file_func; fs->file_data = data; + fs->storage_info_func = funcs->storage_info_func; return (GP_OK); } @@ -2393,3 +2396,24 @@ gp_filesystem_set_info (CameraFilesystem *fs, const char *folder, return (GP_OK); } + +int +gp_filesystem_get_storageinfo ( + CameraFilesystem *fs, + CameraStorageInformation **storageinfo, + int *nrofstorageinfos, + GPContext *context +) { + CHECK_NULL (fs && storageinfo && nrofstorageinfos); + CC (context); + + if (!fs->storage_info_func) { + gp_context_error (context, + _("The filesystem doesn't support getting storage " + "information")); + return (GP_ERROR_NOT_SUPPORTED); + } + return fs->storage_info_func (fs, + storageinfo, nrofstorageinfos, + fs->info_data, context); +} |