diff options
author | Lutz Mueller <lutz@users.sourceforge.net> | 2001-10-27 15:22:38 +0000 |
---|---|---|
committer | Lutz Mueller <lutz@users.sourceforge.net> | 2001-10-27 15:22:38 +0000 |
commit | 640f1c8388c65aea861970abd4224e44883425f5 (patch) | |
tree | def9b5ba6c46855ec3194b8979e411364d4ffbb7 | |
parent | cf879bdcaff959cb9e26fd1335dda18f7c4dd9ac (diff) | |
download | libgphoto2-640f1c8388c65aea861970abd4224e44883425f5.tar.gz |
Documentation updates
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2799 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | doc/api/tmpl/gphoto2-abilities.sgml | 22 | ||||
-rw-r--r-- | doc/api/tmpl/gphoto2-filesys.sgml | 31 | ||||
-rw-r--r-- | doc/api/tmpl/gphoto2-result.sgml | 41 |
3 files changed, 72 insertions, 22 deletions
diff --git a/doc/api/tmpl/gphoto2-abilities.sgml b/doc/api/tmpl/gphoto2-abilities.sgml deleted file mode 100644 index b0a61eccb..000000000 --- a/doc/api/tmpl/gphoto2-abilities.sgml +++ /dev/null @@ -1,22 +0,0 @@ -<!-- ##### SECTION Title ##### --> -CameraAbilities - -<!-- ##### SECTION Short_Description ##### --> - - -<!-- ##### SECTION Long_Description ##### --> -<para> - -</para> - -<!-- ##### SECTION See_Also ##### --> -<para> - -</para> - -<!-- ##### TYPEDEF CameraAbilities ##### --> -<para> - -</para> - - diff --git a/doc/api/tmpl/gphoto2-filesys.sgml b/doc/api/tmpl/gphoto2-filesys.sgml index 08b2190fd..1de048fa4 100644 --- a/doc/api/tmpl/gphoto2-filesys.sgml +++ b/doc/api/tmpl/gphoto2-filesys.sgml @@ -11,6 +11,37 @@ the camera drivers in order to avoid unnecessary communication overhead and prevent synchronization errors. </para> +<para> +Camera drivers need to set up the #CameraFilesystem on #camera_init in order +to make the #CameraFilesystem capable of getting file or folder listings, +retreiving information about a file, etc. + <example> + <title>Setting up the #CameraFilesystem</title> + <programlisting> + int + file_list_func (#CameraFilesystem *fs, const char *folder, + #CameraList *list, void *data) + { + #Camera *camera = data; + + #gp_list_append (list, "file1.jpeg", NULL); + #gp_list_append (list, "file2.jpeg", NULL); + + return (#GP_OK); + } + + int + #camera_init (#Camera *camera) + { + #gp_filesystem_set_list_funcs (camera->fs, file_list_func, + NULL, camera); + + return (#GP_OK); + } + </programlisting> + </example> +</para> + <!-- ##### SECTION See_Also ##### --> <para> #CameraLibraryInitFunc diff --git a/doc/api/tmpl/gphoto2-result.sgml b/doc/api/tmpl/gphoto2-result.sgml index ec894570d..44a43d86c 100644 --- a/doc/api/tmpl/gphoto2-result.sgml +++ b/doc/api/tmpl/gphoto2-result.sgml @@ -11,6 +11,47 @@ representation of those. Note that those error codes are supplementary to the ones defined in gphoto2-port. </para> +<para> + <example> + <title>Checking error codes</title> + <programlisting> + #CameraAbilitiesList *list; + int result; + const char *model = "Unknown model"; + + /* Create a new abilities list */ + result = #gp_abilities_list_new (&list); + if (result < 0) { + printf ("An error occurred: %s\n", #gp_result_as_string (result)); + return (result); + } + + /* Fill it */ + result = #gp_abilities_list_load (list); + if (result < 0) { + printf ("An error occurred: %s\n", #gp_result_as_string (result)); + return (result); + } + + /* Look for a camera model */ + result = #gp_abilities_list_lookup_model (list, model); + if (result < 0) { + switch (result) { + case #GP_ERROR_MODEL_NOT_FOUND: + printf ("Could not find model '%s'\n", model); + default: + printf ("An error occurred: %s\n", #gp_result_as_string (result)); + } + return (result); + } + </programlisting> + </example> + + In your code, you would probably use predefined macros for quick and easy + checking return codes. + +</para> + <!-- ##### SECTION See_Also ##### --> <para> #gp_port_result_as_string |