diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2017-04-29 10:15:09 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2017-04-29 10:16:15 +0200 |
commit | e366d6a1f072663be672e697f7d1accfc21252b4 (patch) | |
tree | 138f471325762abb9a5fbcc6e03fc8e3ddc801cc | |
parent | 13007e4b4b4c0e5d9f33a71f212efcf2d46d6f8f (diff) | |
download | libgphoto2-e366d6a1f072663be672e697f7d1accfc21252b4.tar.gz |
list folders and files too
-rw-r--r-- | examples/sample-afl.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/sample-afl.c b/examples/sample-afl.c index 2e7c12958..8224b4db5 100644 --- a/examples/sample-afl.c +++ b/examples/sample-afl.c @@ -24,6 +24,7 @@ int main(int argc, char **argv) { CameraWidget *rootwidget; char buf[200]; CameraText summary; + CameraList *list; gp_log_add_func(GP_LOG_DEBUG, errordumper, NULL); @@ -48,6 +49,24 @@ int main(int argc, char **argv) { } /* AFL PART STARTS HERE */ + + gp_list_new (&list); + ret = gp_camera_folder_list_files (camera, "/", list, context); + if (ret < GP_OK) { + printf ("Could not list files.\n"); + goto out; + } + gp_list_sort (list); + + gp_list_reset (list); + ret = gp_camera_folder_list_folders (camera, "/", list, context); + if (ret < GP_OK) { + printf ("Could not list files.\n"); + goto out; + } + gp_list_sort (list); + gp_list_free (list); + ret = gp_camera_get_summary (camera, &summary, context); if (ret < GP_OK) { printf ("Could not get summary.\n"); |