Remove generated files
[framework/connectivity/libgphoto2.git] / libgphoto2 / gphoto2-library.c
1 /** \file
2  *
3  * \author Copyright 2001 Lutz Müller <lutz@users.sf.net>
4  *
5  * \par License
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * \par
12  * This library is distributed in the hope that it will be useful, 
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details. 
16  *
17  * \par
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #include "config.h"
25 #include <gphoto2/gphoto2-library.h>
26
27 /**
28  * \brief Get a unique camera id
29  * \param id a #CameraText that receives the id string
30  *
31  * This function should write a unique id into id and return #GP_OK. That is,
32  * choose a unique id, use strncpy in order to copy it into the id, and 
33  * return #GP_OK. The driver name should suffice.
34  *
35  * \returns a gphoto2 error code
36  **/
37 int
38 camera_id (CameraText *id)
39 {
40         strcpy (id->text, "sample driver");
41         return (GP_OK);
42 }
43
44 /**
45  * \brief Get a list of abilities of all supported cameras
46  * \param list a #CameraAbilitiesList
47  *
48  * This function should use #gp_abilities_list_append as many times as the 
49  * number of models the camera driver supports. That is, fill out (in a loop)
50  * the #CameraAbilities for each model and append each of those to the
51  * supplied list using gp_abilities_list_append(). Then, return #GP_OK.
52  *
53  * \returns a gphoto2 error code
54  **/
55 int
56 camera_abilities (CameraAbilitiesList *list)
57 {
58         /* Dummy implementation */
59         return (GP_OK);
60 }
61
62 /**
63  * \brief Initialize the camera
64  * \param camera a #Camera
65  *
66  * This is the most interesting function in your library. Here, you tell
67  * gphoto2 what operations your camera supports and you try to connect
68  * to the camera. That is, access camera->functions directly and set them
69  * to your implementation (if you have any). Then, tell the #CameraFilesystem 
70  * (available in #camera->fs) how to retrieve lists
71  * (gp_filesystem_set_list_funcs()), how to retrieve or set file information
72  * (gp_filesystem_set_info_funcs()), how to get or delete files
73  * (gp_filesystem_set_file_funcs()), or how to put files or delete all files
74  * in a folder (#gp_filesystem_set_folder_funcs). After that, configure
75  * the port (#camera->port) which is already opened by gphoto2. You just have
76  * to call gp_port_settings_get(), adjust the settings, call
77  * gp_port_settings_set(), and try to write to and read from the port.
78  * If the camera responds, return #GP_OK. If not, return some
79  * meaningful error code.
80  *
81  * \returns a gphoto2 error code
82  **/
83 int
84 camera_init (Camera *camera)
85 {
86         /* Dummy implementation */
87         return (GP_OK);
88 }