libgphoto2 photo camera library (libgphoto2) Internals  2.5.23
gphoto2-abilities-list.c
Go to the documentation of this file.
1 
25 #include "config.h"
27 
28 #include <stdlib.h>
29 #include <stdio.h>
30 #include <string.h>
31 
32 #include <ltdl.h>
33 
34 #include <gphoto2/gphoto2-result.h>
37 
38 #ifdef ENABLE_NLS
39 # include <libintl.h>
40 # undef _
41 # define _(String) dgettext (GETTEXT_PACKAGE, String)
42 # ifdef gettext_noop
43 # define N_(String) gettext_noop (String)
44 # else
45 # define N_(String) (String)
46 # endif
47 #else
48 # define textdomain(String) (String)
49 # define gettext(String) (String)
50 # define dgettext(Domain,Message) (Message)
51 # define dcgettext(Domain,Message,Type) (Message)
52 # define bindtextdomain(Domain,Directory) (Domain)
53 # define bind_textdomain_codeset(Domain,Charset) (Domain)
54 # define _(String) (String)
55 # define N_(String) (String)
56 #endif
57 
59 #define CHECK_RESULT(result) {int r = (result); if (r < 0) return (r);}
60 
63  int count;
64  int maxcount;
66 };
67 
69 static int gp_abilities_list_lookup_id (CameraAbilitiesList *, const char *);
72 
83 const char*
84 gp_message_codeset (const char *codeset)
85 {
86  gp_port_message_codeset (codeset);
87  return bind_textdomain_codeset (GETTEXT_PACKAGE, codeset);
88 }
89 
100 int
102 {
103  C_PARAMS (list);
104 
105  /*
106  * We do this here because everybody needs to call this function
107  * first before accessing a camera. Pretty ugly, but I don't know
108  * an other way without introducing a global initialization
109  * function...
110  */
111  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
112 
113  C_MEM (*list = calloc (1, sizeof (CameraAbilitiesList)));
114 
115  return (GP_OK);
116 }
117 
124 int
126 {
127  C_PARAMS (list);
128 
130 
131  free (list);
132 
133  return (GP_OK);
134 }
135 
136 
137 typedef struct {
139  int result;
141 
142 
143 static int
144 foreach_func (const char *filename, lt_ptr data)
145 {
146  foreach_data_t *fd = data;
147  CameraList *list = fd->list;
148 
149  GP_LOG_D ("Found '%s'.", filename);
150  fd->result = gp_list_append (list, filename, NULL);
151 
152  return ((fd->result == GP_OK)?0:1);
153 }
154 
155 
156 int
158  GPContext *context)
159 {
162  CameraText text;
163  int ret, x, old_count, new_count;
164  int i, p;
165  const char *filename;
166  CameraList *flist;
167  int count;
168  lt_dlhandle lh;
169 
170  C_PARAMS (list && dir);
171 
172  GP_LOG_D ("Using ltdl to load camera libraries from '%s'...", dir);
173  CHECK_RESULT (gp_list_new (&flist));
174  ret = gp_list_reset (flist);
175  if (ret < GP_OK) {
176  gp_list_free (flist);
177  return ret;
178  }
179  if (1) { /* a new block in which we can define a temporary variable */
180  foreach_data_t foreach_data = { NULL, GP_OK };
181  foreach_data.list = flist;
182  lt_dlinit ();
183  lt_dladdsearchdir (dir);
184  ret = lt_dlforeachfile (dir, foreach_func, &foreach_data);
185  lt_dlexit ();
186  if (ret != 0) {
187  gp_list_free (flist);
188  GP_LOG_E ("Internal error looking for camlibs (%d)", ret);
189  gp_context_error (context,
190  _("Internal error looking for camlibs. "
191  "(path names too long?)"));
192  return (foreach_data.result!=GP_OK)?foreach_data.result:GP_ERROR;
193  }
194  }
195  count = gp_list_count (flist);
196  if (count < GP_OK) {
197  gp_list_free (flist);
198  return ret;
199  }
200  GP_LOG_D ("Found %i camera drivers.", count);
201  lt_dlinit ();
202  p = gp_context_progress_start (context, count,
203  _("Loading camera drivers from '%s'..."), dir);
204  for (i = 0; i < count; i++) {
205  ret = gp_list_get_name (flist, i, &filename);
206  if (ret < GP_OK) {
207  gp_list_free (flist);
208  return ret;
209  }
210  lh = lt_dlopenext (filename);
211  if (!lh) {
212  GP_LOG_D ("Failed to load '%s': %s.", filename,
213  lt_dlerror ());
214  continue;
215  }
216 
217  /* camera_id */
218  id = lt_dlsym (lh, "camera_id");
219  if (!id) {
220  GP_LOG_D ("Library '%s' does not seem to "
221  "contain a camera_id function: %s",
222  filename, lt_dlerror ());
223  lt_dlclose (lh);
224  continue;
225  }
226 
227  /*
228  * Make sure the camera driver hasn't been
229  * loaded yet.
230  */
231  if (id (&text) != GP_OK) {
232  lt_dlclose (lh);
233  continue;
234  }
235  if (gp_abilities_list_lookup_id (list, text.text) >= 0) {
236  lt_dlclose (lh);
237  continue;
238  }
239 
240  /* camera_abilities */
241  ab = lt_dlsym (lh, "camera_abilities");
242  if (!ab) {
243  GP_LOG_D ("Library '%s' does not seem to "
244  "contain a camera_abilities function: "
245  "%s", filename, lt_dlerror ());
246  lt_dlclose (lh);
247  continue;
248  }
249 
250  old_count = gp_abilities_list_count (list);
251  if (old_count < 0) {
252  lt_dlclose (lh);
253  continue;
254  }
255 
256  if (ab (list) != GP_OK) {
257  lt_dlclose (lh);
258  continue;
259  }
260 
261  /* do not free the library in valgrind mode */
262 #if !defined(VALGRIND)
263  lt_dlclose (lh);
264 #endif
265 
266  new_count = gp_abilities_list_count (list);
267  if (new_count < 0)
268  continue;
269 
270  /* Copy in the core-specific information */
271  for (x = old_count; x < new_count; x++) {
272  strcpy (list->abilities[x].id, text.text);
273  strcpy (list->abilities[x].library, filename);
274  }
275 
276  gp_context_progress_update (context, p, i);
278  lt_dlexit ();
279  gp_list_free (flist);
280  return (GP_ERROR_CANCEL);
281  }
282  }
283  gp_context_progress_stop (context, p);
284  lt_dlexit ();
285  gp_list_free (flist);
286 
287  return (GP_OK);
288 }
289 
290 
301 int
303 {
304  const char *camlib_env = getenv(CAMLIBDIR_ENV);
305  const char *camlibs = (camlib_env != NULL)?camlib_env:CAMLIBS;
306  C_PARAMS (list);
307 
308  CHECK_RESULT (gp_abilities_list_load_dir (list, camlibs, context));
310 
311  return (GP_OK);
312 }
313 
314 
315 static int
317  int *ability, GPPort *port)
318 {
319  int i, count, res = GP_ERROR_IO_USB_FIND;
320 
321  CHECK_RESULT (count = gp_abilities_list_count (list));
322 
323  /* Detect USB cameras */
324  GP_LOG_D ("Auto-detecting USB cameras...");
325  *ability = -1;
326  for (i = 0; i < count; i++) {
327  int v, p, c, s;
328 
329  if (!(list->abilities[i].port & port->type))
330  continue;
331 
332  v = list->abilities[i].usb_vendor;
333  p = list->abilities[i].usb_product;
334  if (v) {
335  res = gp_port_usb_find_device(port, v, p);
336  if (res == GP_OK) {
337  GP_LOG_D ("Found '%s' (0x%x,0x%x)",
338  list->abilities[i].model, v, p);
339  *ability = i;
340  } else if (res < 0 && res != GP_ERROR_IO_USB_FIND) {
341  /* another error occurred.
342  * perhaps we should better
343  * report this to the calling
344  * method?
345  */
346  GP_LOG_D (
347  "gp_port_usb_find_device(vendor=0x%x, "
348  "product=0x%x) returned %i, clearing "
349  "error message on port", v, p, res);
350  }
351 
352  if (res != GP_ERROR_IO_USB_FIND)
353  return res;
354  }
355 
356  c = list->abilities[i].usb_class;
357  s = list->abilities[i].usb_subclass;
358  p = list->abilities[i].usb_protocol;
359  if (c) {
360  res = gp_port_usb_find_device_by_class(port, c, s, p);
361  if (res == GP_OK) {
362  GP_LOG_D ("Found '%s' (0x%x,0x%x,0x%x)",
363  list->abilities[i].model, c, s, p);
364  *ability = i;
365  } else if (res < 0 && res != GP_ERROR_IO_USB_FIND) {
366  /* another error occurred.
367  * perhaps we should better
368  * report this to the calling
369  * method?
370  */
371  GP_LOG_D (
372  "gp_port_usb_find_device_by_class("
373  "class=0x%x, subclass=0x%x, "
374  "protocol=0x%x) returned %i, "
375  "clearing error message on port",
376  c, s, p, res);
377  }
378 
379  if (res != GP_ERROR_IO_USB_FIND)
380  return res;
381  }
382  }
383 
384  return res;
385 }
386 
387 
399 int
401  GPPortInfoList *info_list, CameraList *l,
402  GPContext *context)
403 {
404  GPPortInfo info;
405  GPPort *port;
406  int i, info_count;
407 
408  C_PARAMS (list && info_list && l);
409 
410  gp_list_reset (l);
411 
412  CHECK_RESULT (info_count = gp_port_info_list_count (info_list));
413 
414  CHECK_RESULT (gp_port_new (&port));
415  for (i = 0; i < info_count; i++) {
416  int res;
417  char *xpath;
418  GPPortType type;
419 
420  CHECK_RESULT (gp_port_info_list_get_info (info_list, i, &info));
421  CHECK_RESULT (gp_port_set_info (port, info));
422  gp_port_info_get_type (info, &type);
423  res = gp_port_info_get_path (info, &xpath);
424  if (res <GP_OK)
425  continue;
426  switch (type) {
427  case GP_PORT_USB:
428  case GP_PORT_USB_SCSI:
430  int ability;
431 
432  res = gp_abilities_list_detect_usb (list, &ability, port);
433  if (res == GP_OK) {
434  gp_list_append(l,
435  list->abilities[ability].model,
436  xpath);
437  } else if (res < 0)
438  gp_port_set_error (port, NULL);
439 
440  break;
441  }
442  case GP_PORT_DISK: {
443  char *s, path[1024];
444  struct stat stbuf;
445 
446  s = strchr (xpath, ':');
447  if (!s)
448  break;
449  s++;
450  snprintf (path, sizeof(path), "%s/DCIM", s);
451  if (-1 == stat(path, &stbuf)) {
452  snprintf (path, sizeof(path), "%s/dcim", s);
453  if (-1 == stat(path, &stbuf))
454  continue;
455  }
456  gp_list_append (l, "Mass Storage Camera", xpath);
457  break;
458  }
459  case GP_PORT_PTPIP: {
460  char *s;
461 
462  s = strchr (xpath, ':');
463  if (!s) break;
464  s++;
465  if (!strlen(s)) break;
466  gp_list_append (l, "PTP/IP Camera", xpath);
467  break;
468  }
469  default:
470  /*
471  * We currently cannot detect any cameras on this
472  * port
473  */
474  break;
475  }
476  }
477 
478  gp_port_free (port);
479 
480  return (GP_OK);
481 }
482 
483 
488 static void
490 {
491  char *ch;
492  ch = strchr(str, ':');
493  if (ch) {
494  *ch = ' ';
495  }
496 }
497 
498 
509 int
511 {
512  C_PARAMS (list);
513 
514  if (list->count == list->maxcount) {
515  C_MEM (list->abilities = realloc (list->abilities,
516  sizeof (CameraAbilities) * (list->maxcount + 100)));
517  list->maxcount += 100;
518  }
519 
520  memcpy (&(list->abilities [list->count]), &abilities,
521  sizeof (CameraAbilities));
522 
523  /* FIXME: We replace the colon by a space in the model string
524  * This keeps backward compatibility until we have
525  * thought of and implemented something better.
526  */
528 
529  list->count++;
530 
531  return (GP_OK);
532 }
533 
534 
540 int
542 {
543  C_PARAMS (list);
544 
545  free (list->abilities);
546  list->abilities = NULL;
547  list->count = 0;
548  list->maxcount = 0;
549 
550  return (GP_OK);
551 }
552 
553 
559 int
561 {
562  C_PARAMS (list);
563 
564  return (list->count);
565 }
566 
567 static int
568 cmp_abilities (const void *a, const void *b) {
569  const CameraAbilities *ca = a;
570  const CameraAbilities *cb = b;
571 
572  return strcasecmp (ca->model, cb->model);
573 }
574 
575 static int
577 {
578  C_PARAMS (list);
579 
580  qsort (list->abilities, list->count, sizeof(CameraAbilities), cmp_abilities);
581  return (GP_OK);
582 }
583 
584 
585 static int
587 {
588  int x;
589 
590  C_PARAMS (list && id);
591 
592  for (x = 0; x < list->count; x++)
593  if (!strcmp (list->abilities[x].id, id))
594  return (x);
595 
596  return (GP_ERROR);
597 }
598 
599 
606 int
608 {
609  int x;
610 
611  C_PARAMS (list && model);
612 
613  for (x = 0; x < list->count; x++) {
614  if (!strcasecmp (list->abilities[x].model, model))
615  return (x);
616  }
617 
618  GP_LOG_E ("Could not find any driver for '%s'", model);
619  return (GP_ERROR_MODEL_NOT_FOUND);
620 }
621 
622 
635 int
637  CameraAbilities *abilities)
638 {
639  C_PARAMS (list && abilities);
640  C_PARAMS (0 <= index && index < list->count);
641 
642  memcpy (abilities, &list->abilities[index], sizeof (CameraAbilities));
643 
644  return (GP_OK);
645 }
646 
647 
648 #ifdef _GPHOTO2_INTERNAL_CODE
649 
650 /* enum CameraOperation */
651 const StringFlagItem gpi_camera_operation_map[] = {
652  { "none", GP_OPERATION_NONE },
653  { "capture_image", GP_OPERATION_CAPTURE_IMAGE },
654  { "capture_video", GP_OPERATION_CAPTURE_VIDEO },
655  { "capture_audio", GP_OPERATION_CAPTURE_AUDIO },
656  { "capture_preview", GP_OPERATION_CAPTURE_PREVIEW },
657  { "config", GP_OPERATION_CONFIG },
658  { NULL, 0 },
659 };
660 
661 /* enum CameraFileOperation */
662 const StringFlagItem gpi_file_operation_map[] = {
663  { "none", GP_FILE_OPERATION_NONE },
664  { "delete", GP_FILE_OPERATION_DELETE },
665  { "preview", GP_FILE_OPERATION_PREVIEW },
666  { "raw", GP_FILE_OPERATION_RAW },
667  { "audio", GP_FILE_OPERATION_AUDIO },
668  { "exif", GP_FILE_OPERATION_EXIF },
669  { NULL, 0 },
670 };
671 
672 /* enum CameraFolderOperation */
673 const StringFlagItem gpi_folder_operation_map[] = {
674  { "none", GP_FOLDER_OPERATION_NONE },
675  { "delete_all", GP_FOLDER_OPERATION_DELETE_ALL },
676  { "put_file", GP_FOLDER_OPERATION_PUT_FILE },
677  { "make_dir", GP_FOLDER_OPERATION_MAKE_DIR },
678  { "remove_dir", GP_FOLDER_OPERATION_REMOVE_DIR },
679  { NULL, 0 },
680 };
681 
682 /* enum GphotoDeviceType */
683 const StringFlagItem gpi_gphoto_device_type_map[] = {
684  { "still_camera", GP_DEVICE_STILL_CAMERA },
685  { "audio_player", GP_DEVICE_AUDIO_PLAYER },
686  { NULL, 0 },
687 };
688 
689 /* enum CameraDriverStatus */
690 const StringFlagItem gpi_camera_driver_status_map[] = {
691  { "production", GP_DRIVER_STATUS_PRODUCTION },
692  { "testing", GP_DRIVER_STATUS_TESTING },
693  { "experimental", GP_DRIVER_STATUS_EXPERIMENTAL },
694  { "deprecated", GP_DRIVER_STATUS_DEPRECATED },
695  { NULL, 0 },
696 };
697 
698 #endif /* _GPHOTO2_INTERNAL_CODE */
699 
700 
701 /*
702  * Local Variables:
703  * c-file-style:"linux"
704  * indent-tabs-mode:t
705  * End:
706  */
gp_abilities_list_detect
int gp_abilities_list_detect(CameraAbilitiesList *list, GPPortInfoList *info_list, CameraList *l, GPContext *context)
Definition: gphoto2-abilities-list.c:400
CameraAbilities
Describes the properties of a specific camera.
Definition: gphoto2-abilities-list.h:120
GP_OPERATION_CAPTURE_PREVIEW
@ GP_OPERATION_CAPTURE_PREVIEW
Definition: gphoto2-abilities-list.h:66
_GPPortInfo
Definition: gphoto2-port-info.h:32
foreach_data_t::result
int result
Definition: gphoto2-abilities-list.c:139
gp_port_info_get_path
int gp_port_info_get_path(GPPortInfo info, char **path)
Get path of a specific port entry.
Definition: gphoto2-port-info-list.c:523
GP_FOLDER_OPERATION_NONE
@ GP_FOLDER_OPERATION_NONE
Definition: gphoto2-abilities-list.h:87
remove_colon_from_string
static void remove_colon_from_string(char *str)
Remove first colon from string, if any. Replace it by a space.
Definition: gphoto2-abilities-list.c:489
GP_OPERATION_CAPTURE_IMAGE
@ GP_OPERATION_CAPTURE_IMAGE
Definition: gphoto2-abilities-list.h:63
CameraAbilities::model
char model[128]
name of camera model
Definition: gphoto2-abilities-list.h:121
GP_FILE_OPERATION_AUDIO
@ GP_FILE_OPERATION_AUDIO
Definition: gphoto2-abilities-list.h:79
GP_FOLDER_OPERATION_DELETE_ALL
@ GP_FOLDER_OPERATION_DELETE_ALL
Definition: gphoto2-abilities-list.h:88
CameraAbilities::usb_vendor
int usb_vendor
USB Vendor D.
Definition: gphoto2-abilities-list.h:134
gp_abilities_list_load_dir
int gp_abilities_list_load_dir(CameraAbilitiesList *list, const char *dir, GPContext *context)
Definition: gphoto2-abilities-list.c:157
gp_abilities_list_sort
static int gp_abilities_list_sort(CameraAbilitiesList *)
Definition: gphoto2-abilities-list.c:576
gp_abilities_list_append
int gp_abilities_list_append(CameraAbilitiesList *list, CameraAbilities abilities)
Append the abilities to the list.
Definition: gphoto2-abilities-list.c:510
_GPPortInfoList
Definition: gphoto2-port-info-list.c:74
gp_list_get_name
int gp_list_get_name(CameraList *list, int index, const char **name)
Definition: gphoto2-list.c:280
gp_abilities_list_lookup_model
int gp_abilities_list_lookup_model(CameraAbilitiesList *list, const char *model)
Search the list for an entry of given model name.
Definition: gphoto2-abilities-list.c:607
GP_DRIVER_STATUS_DEPRECATED
@ GP_DRIVER_STATUS_DEPRECATED
Definition: gphoto2-abilities-list.h:45
_CameraAbilitiesList::count
int count
Definition: gphoto2-abilities-list.c:63
bindtextdomain
#define bindtextdomain(Domain, Directory)
Definition: gphoto2-abilities-list.c:52
gp_port_new
int gp_port_new(GPPort **port)
Create new GPPort.
Definition: gphoto2-port.c:94
gp_abilities_list_load
int gp_abilities_list_load(CameraAbilitiesList *list, GPContext *context)
Scans the system for camera drivers.
Definition: gphoto2-abilities-list.c:302
gp_port_set_info
int gp_port_set_info(GPPort *port, GPPortInfo info)
Configure a port.
Definition: gphoto2-port.c:149
gp_list_count
int gp_list_count(CameraList *list)
Definition: gphoto2-list.c:229
gp_context_cancel
GPContextFeedback gp_context_cancel(GPContext *context)
Definition: gphoto2-context.c:323
CameraAbilities::usb_product
int usb_product
USB Product ID.
Definition: gphoto2-abilities-list.h:135
foreach_func
static int foreach_func(const char *filename, lt_ptr data)
Definition: gphoto2-abilities-list.c:144
CameraAbilities::library
char library[1024]
(Internal) library filename
Definition: gphoto2-abilities-list.h:141
gp_list_reset
int gp_list_reset(CameraList *list)
Definition: gphoto2-list.c:148
cmp_abilities
static int cmp_abilities(const void *a, const void *b)
Definition: gphoto2-abilities-list.c:568
_CameraAbilitiesList::maxcount
int maxcount
Definition: gphoto2-abilities-list.c:64
_CameraAbilitiesList::abilities
CameraAbilities * abilities
Definition: gphoto2-abilities-list.c:65
gp_port_usb_find_device
int gp_port_usb_find_device(GPPort *port, int idvendor, int idproduct)
Find USB device by vendor/product.
Definition: gphoto2-port.c:790
gp_list_free
int gp_list_free(CameraList *list)
Definition: gphoto2-list.c:120
gp_context_progress_start
unsigned int gp_context_progress_start(GPContext *context, float target, const char *format,...)
Start progress tracking.
Definition: gphoto2-context.c:155
GP_DRIVER_STATUS_PRODUCTION
@ GP_DRIVER_STATUS_PRODUCTION
Definition: gphoto2-abilities-list.h:42
GP_FOLDER_OPERATION_PUT_FILE
@ GP_FOLDER_OPERATION_PUT_FILE
Definition: gphoto2-abilities-list.h:89
GP_ERROR_MODEL_NOT_FOUND
#define GP_ERROR_MODEL_NOT_FOUND
Specified camera model was not found.
Definition: gphoto2-result.h:59
GP_OPERATION_CONFIG
@ GP_OPERATION_CONFIG
Definition: gphoto2-abilities-list.h:67
gp_port_free
int gp_port_free(GPPort *port)
Free the port structure.
Definition: gphoto2-port.c:341
gp_port_info_list_get_info
int gp_port_info_list_get_info(GPPortInfoList *list, int n, GPPortInfo *info)
Get port information of specific entry.
Definition: gphoto2-port-info-list.c:460
GP_FILE_OPERATION_RAW
@ GP_FILE_OPERATION_RAW
Definition: gphoto2-abilities-list.h:78
_GPPort
The GPhoto port structure.
Definition: gphoto2-port.h:143
gp_list_append
int gp_list_append(CameraList *list, const char *name, const char *value)
Definition: gphoto2-list.c:174
CameraAbilities::id
char id[1024]
(Internal) camera ID name
Definition: gphoto2-abilities-list.h:142
gphoto2-result.h
GP_FILE_OPERATION_EXIF
@ GP_FILE_OPERATION_EXIF
Definition: gphoto2-abilities-list.h:80
gp_abilities_list_new
int gp_abilities_list_new(CameraAbilitiesList **list)
Allocate the memory for a new abilities list.
Definition: gphoto2-abilities-list.c:101
foreach_data_t
Definition: gphoto2-abilities-list.c:137
CameraLibraryAbilitiesFunc
int(* CameraLibraryAbilitiesFunc)(CameraAbilitiesList *list)
Adds the abilities of the supported models to the supplied list.
Definition: gphoto2-library.h:51
GP_PORT_USB
@ GP_PORT_USB
USB port.
Definition: gphoto2-port-info-list.h:37
GP_PORT_USB_SCSI
@ GP_PORT_USB_SCSI
USB Mass Storage raw SCSI port.
Definition: gphoto2-port-info-list.h:41
_CameraAbilitiesList
Definition: gphoto2-abilities-list.c:62
GP_OK
#define GP_OK
Everything is OK.
Definition: gphoto2-port-result.h:30
gp_abilities_list_count
int gp_abilities_list_count(CameraAbilitiesList *list)
Count the entries in the supplied list.
Definition: gphoto2-abilities-list.c:560
gp_abilities_list_reset
int gp_abilities_list_reset(CameraAbilitiesList *list)
Reset the list.
Definition: gphoto2-abilities-list.c:541
GP_DEVICE_AUDIO_PLAYER
@ GP_DEVICE_AUDIO_PLAYER
Definition: gphoto2-abilities-list.h:54
GP_OPERATION_CAPTURE_AUDIO
@ GP_OPERATION_CAPTURE_AUDIO
Definition: gphoto2-abilities-list.h:65
bind_textdomain_codeset
#define bind_textdomain_codeset(Domain, Charset)
Definition: gphoto2-abilities-list.c:53
GP_FOLDER_OPERATION_MAKE_DIR
@ GP_FOLDER_OPERATION_MAKE_DIR
Definition: gphoto2-abilities-list.h:90
GP_FILE_OPERATION_DELETE
@ GP_FILE_OPERATION_DELETE
Definition: gphoto2-abilities-list.h:76
gp_context_progress_stop
void gp_context_progress_stop(GPContext *context, unsigned int id)
Definition: gphoto2-context.c:192
GP_ERROR_IO_USB_FIND
#define GP_ERROR_IO_USB_FIND
Error when trying to find USB device.
Definition: gphoto2-port-result.h:106
GP_PORT_USB_DISK_DIRECT
@ GP_PORT_USB_DISK_DIRECT
Direct IO to an usb mass storage device.
Definition: gphoto2-port-info-list.h:40
gp_port_message_codeset
const char * gp_port_message_codeset(const char *)
Specify codeset for translations.
Definition: gphoto2-port-info-list.c:96
foreach_data_t::list
CameraList * list
Definition: gphoto2-abilities-list.c:138
gp_abilities_list_detect_usb
static int gp_abilities_list_detect_usb(CameraAbilitiesList *list, int *ability, GPPort *port)
Definition: gphoto2-abilities-list.c:316
gp_port_info_get_type
int gp_port_info_get_type(GPPortInfo info, GPPortType *type)
Get type of a specific port entry.
Definition: gphoto2-port-info-list.c:554
GP_ERROR
#define GP_ERROR
Generic Error.
Definition: gphoto2-port-result.h:34
gp_abilities_list_free
int gp_abilities_list_free(CameraAbilitiesList *list)
Free the given CameraAbilitiesList object.
Definition: gphoto2-abilities-list.c:125
GP_DEVICE_STILL_CAMERA
@ GP_DEVICE_STILL_CAMERA
Definition: gphoto2-abilities-list.h:53
gp_port_info_list_count
int gp_port_info_list_count(GPPortInfoList *list)
Number of ports in the list.
Definition: gphoto2-port-info-list.c:305
GP_FILE_OPERATION_PREVIEW
@ GP_FILE_OPERATION_PREVIEW
Definition: gphoto2-abilities-list.h:77
GP_DRIVER_STATUS_TESTING
@ GP_DRIVER_STATUS_TESTING
Definition: gphoto2-abilities-list.h:43
gp_message_codeset
const char * gp_message_codeset(const char *codeset)
Set the current character codeset libgphoto2 is operating in.
Definition: gphoto2-abilities-list.c:84
_
#define _(String)
Definition: gphoto2-abilities-list.c:54
CameraText::text
char text[32 *1024]
Character string containing the translated text.
Definition: gphoto2-camera.h:69
gp_context_error
void gp_context_error(GPContext *context, const char *format,...)
Definition: gphoto2-context.c:203
gp_list_new
int gp_list_new(CameraList **list)
Creates a new CameraList.
Definition: gphoto2-list.c:63
GP_OPERATION_NONE
@ GP_OPERATION_NONE
Definition: gphoto2-abilities-list.h:62
gp_abilities_list_lookup_id
static int gp_abilities_list_lookup_id(CameraAbilitiesList *, const char *)
Definition: gphoto2-abilities-list.c:586
CameraAbilities::usb_class
int usb_class
USB device class.
Definition: gphoto2-abilities-list.h:136
gp_context_progress_update
void gp_context_progress_update(GPContext *context, unsigned int id, float current)
Definition: gphoto2-context.c:181
GP_CONTEXT_FEEDBACK_CANCEL
@ GP_CONTEXT_FEEDBACK_CANCEL
Definition: gphoto2-context.h:57
CameraAbilities::usb_protocol
int usb_protocol
USB device protocol.
Definition: gphoto2-abilities-list.h:138
GP_DRIVER_STATUS_EXPERIMENTAL
@ GP_DRIVER_STATUS_EXPERIMENTAL
Definition: gphoto2-abilities-list.h:44
_CameraList
Definition: gphoto2-list.c:47
gphoto2-port-log.h
gp_abilities_list_get_abilities
int gp_abilities_list_get_abilities(CameraAbilitiesList *list, int index, CameraAbilities *abilities)
Retrieve the camera abilities of entry with supplied index number.
Definition: gphoto2-abilities-list.c:636
gp_port_set_error
int gp_port_set_error(GPPort *port, const char *format,...)
Set verbose port error message.
Definition: gphoto2-port.c:1180
CameraText
CameraText structure used in various functions.
Definition: gphoto2-camera.h:68
gp_port_usb_find_device_by_class
int gp_port_usb_find_device_by_class(GPPort *port, int mainclass, int subclass, int protocol)
Find USB device by interface class.
Definition: gphoto2-port.c:814
GP_PORT_DISK
@ GP_PORT_DISK
Disk / local mountpoint port.
Definition: gphoto2-port-info-list.h:38
CameraLibraryIdFunc
int(* CameraLibraryIdFunc)(CameraText *id)
Returns a unique id for the camera driver.
Definition: gphoto2-library.h:42
gphoto2-abilities-list.h
List of supported camera models including their abilities.
CameraAbilities::usb_subclass
int usb_subclass
USB device subclass.
Definition: gphoto2-abilities-list.h:137
GP_FILE_OPERATION_NONE
@ GP_FILE_OPERATION_NONE
Definition: gphoto2-abilities-list.h:75
GP_ERROR_CANCEL
#define GP_ERROR_CANCEL
Cancellation successful.
Definition: gphoto2-result.h:107
GP_FOLDER_OPERATION_REMOVE_DIR
@ GP_FOLDER_OPERATION_REMOVE_DIR
Definition: gphoto2-abilities-list.h:91
CameraAbilities::port
GPPortType port
Supported port types.
Definition: gphoto2-abilities-list.h:125
_GPPort::type
GPPortType type
Actual type of this port.
Definition: gphoto2-port.h:145
CHECK_RESULT
#define CHECK_RESULT(result)
Definition: gphoto2-abilities-list.c:59
gphoto2-library.h
Camery driver header.
GP_OPERATION_CAPTURE_VIDEO
@ GP_OPERATION_CAPTURE_VIDEO
Definition: gphoto2-abilities-list.h:64
_GPContext
Definition: gphoto2-context.c:39
GP_PORT_PTPIP
@ GP_PORT_PTPIP
PTP/IP port.
Definition: gphoto2-port-info-list.h:39
GPPortType
GPPortType
The gphoto port type.
Definition: gphoto2-port-info-list.h:34