libgphoto2 photo camera library (libgphoto2) Internals
2.5.26
|
List of supported camera models including their abilities. More...
#include "config.h"
#include <gphoto2/gphoto2-abilities-list.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ltdl.h>
#include <gphoto2/gphoto2-result.h>
#include <gphoto2/gphoto2-port-log.h>
#include <gphoto2/gphoto2-library.h>
Go to the source code of this file.
Data Structures | |
struct | _CameraAbilitiesList |
struct | foreach_data_t |
Macros | |
#define | textdomain(String) (String) |
#define | gettext(String) (String) |
#define | dgettext(Domain, Message) (Message) |
#define | dcgettext(Domain, Message, Type) (Message) |
#define | bindtextdomain(Domain, Directory) (Domain) |
#define | bind_textdomain_codeset(Domain, Charset) (Domain) |
#define | _(String) (String) |
#define | N_(String) (String) |
#define | CHECK_RESULT(result) {int r = (result); if (r < 0) return (r);} |
Functions | |
static int | gp_abilities_list_lookup_id (CameraAbilitiesList *, const char *) |
static int | gp_abilities_list_sort (CameraAbilitiesList *) |
const char * | gp_message_codeset (const char *codeset) |
Set the current character codeset libgphoto2 is operating in. More... | |
int | gp_abilities_list_new (CameraAbilitiesList **list) |
Allocate the memory for a new abilities list. More... | |
int | gp_abilities_list_free (CameraAbilitiesList *list) |
Free the given CameraAbilitiesList object. More... | |
static int | foreach_func (const char *filename, lt_ptr data) |
int | gp_abilities_list_load_dir (CameraAbilitiesList *list, const char *dir, GPContext *context) |
int | gp_abilities_list_load (CameraAbilitiesList *list, GPContext *context) |
Scans the system for camera drivers. More... | |
static int | gp_abilities_list_detect_usb (CameraAbilitiesList *list, int *ability, GPPort *port) |
int | gp_abilities_list_detect (CameraAbilitiesList *list, GPPortInfoList *info_list, CameraList *l, GPContext *context) |
static void | remove_colon_from_string (char *str) |
Remove first colon from string, if any. Replace it by a space. More... | |
int | gp_abilities_list_append (CameraAbilitiesList *list, CameraAbilities abilities) |
Append the abilities to the list. More... | |
int | gp_abilities_list_reset (CameraAbilitiesList *list) |
Reset the list. More... | |
int | gp_abilities_list_count (CameraAbilitiesList *list) |
Count the entries in the supplied list. More... | |
static int | cmp_abilities (const void *a, const void *b) |
int | gp_abilities_list_lookup_model (CameraAbilitiesList *list, const char *model) |
Search the list for an entry of given model name. More... | |
int | gp_abilities_list_get_abilities (CameraAbilitiesList *list, int index, CameraAbilities *abilities) |
Retrieve the camera abilities of entry with supplied index number. More... | |
List of supported camera models including their abilities.
Definition in file gphoto2-abilities-list.c.
#define _ | ( | String | ) | (String) |
Definition at line 54 of file gphoto2-abilities-list.c.
#define bind_textdomain_codeset | ( | Domain, | |
Charset | |||
) | (Domain) |
Definition at line 53 of file gphoto2-abilities-list.c.
#define bindtextdomain | ( | Domain, | |
Directory | |||
) | (Domain) |
Definition at line 52 of file gphoto2-abilities-list.c.
Definition at line 59 of file gphoto2-abilities-list.c.
#define dcgettext | ( | Domain, | |
Message, | |||
Type | |||
) | (Message) |
Definition at line 51 of file gphoto2-abilities-list.c.
#define dgettext | ( | Domain, | |
Message | |||
) | (Message) |
Definition at line 50 of file gphoto2-abilities-list.c.
#define gettext | ( | String | ) | (String) |
Definition at line 49 of file gphoto2-abilities-list.c.
#define N_ | ( | String | ) | (String) |
Definition at line 55 of file gphoto2-abilities-list.c.
#define textdomain | ( | String | ) | (String) |
Definition at line 48 of file gphoto2-abilities-list.c.
|
static |
Definition at line 568 of file gphoto2-abilities-list.c.
References CameraAbilities::model.
Referenced by gp_abilities_list_sort().
|
static |
Definition at line 144 of file gphoto2-abilities-list.c.
References gp_list_append(), GP_OK, foreach_data_t::list, and foreach_data_t::result.
Referenced by gp_abilities_list_load_dir().
int gp_abilities_list_append | ( | CameraAbilitiesList * | list, |
CameraAbilities | abilities | ||
) |
Append the abilities to the list.
list | CameraAbilitiesList |
abilities | CameraAbilities |
This function is called by a camera library on camera_abilities() in order to inform libgphoto2 about a supported camera model.
Definition at line 510 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, _CameraAbilitiesList::count, GP_OK, _CameraAbilitiesList::maxcount, CameraAbilities::model, and remove_colon_from_string().
Referenced by camera_abilities().
int gp_abilities_list_count | ( | CameraAbilitiesList * | list | ) |
Count the entries in the supplied list.
list | a CameraAbilitiesList |
Definition at line 560 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::count.
Referenced by gp_abilities_list_detect_usb(), and gp_abilities_list_load_dir().
int gp_abilities_list_detect | ( | CameraAbilitiesList * | list, |
GPPortInfoList * | info_list, | ||
CameraList * | l, | ||
GPContext * | context | ||
) |
list | a CameraAbilitiesList |
info_list | the GPPortInfoList of ports to use for detection |
l | a CameraList that contains the autodetected cameras after the call |
context | a GPContext |
Tries to detect any camera connected to the computer using the supplied list of supported cameras and the supplied info_list of ports.
Definition at line 400 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, CHECK_RESULT, gp_abilities_list_detect_usb(), gp_list_append(), gp_list_reset(), GP_OK, GP_PORT_DISK, gp_port_free(), gp_port_info_get_path(), gp_port_info_get_type(), gp_port_info_list_count(), gp_port_info_list_get_info(), gp_port_new(), GP_PORT_PTPIP, gp_port_set_error(), gp_port_set_info(), GP_PORT_USB, GP_PORT_USB_DISK_DIRECT, GP_PORT_USB_SCSI, and CameraAbilities::model.
Referenced by gp_camera_autodetect(), and gp_camera_init().
|
static |
Definition at line 316 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, CHECK_RESULT, gp_abilities_list_count(), GP_ERROR_IO_USB_FIND, GP_OK, gp_port_usb_find_device(), gp_port_usb_find_device_by_class(), CameraAbilities::model, CameraAbilities::port, _GPPort::type, CameraAbilities::usb_class, CameraAbilities::usb_product, CameraAbilities::usb_protocol, CameraAbilities::usb_subclass, and CameraAbilities::usb_vendor.
Referenced by gp_abilities_list_detect().
int gp_abilities_list_free | ( | CameraAbilitiesList * | list | ) |
Free the given CameraAbilitiesList object.
list | a CameraAbilitiesList |
Definition at line 125 of file gphoto2-abilities-list.c.
References CHECK_RESULT, gp_abilities_list_reset(), and GP_OK.
Referenced by gp_camera_autodetect(), and gp_camera_init().
int gp_abilities_list_get_abilities | ( | CameraAbilitiesList * | list, |
int | index, | ||
CameraAbilities * | abilities | ||
) |
Retrieve the camera abilities of entry with supplied index number.
list | a CameraAbilitiesList |
index | index |
abilities | pointer to CameraAbilities for returned data. |
Retrieves the camera abilities of entry with supplied index number. Typically, you would call gp_camera_set_abilities() afterwards in order to prepare the initialization of a camera.
Definition at line 636 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, and GP_OK.
Referenced by gp_camera_init().
int gp_abilities_list_load | ( | CameraAbilitiesList * | list, |
GPContext * | context | ||
) |
Scans the system for camera drivers.
list | a CameraAbilitiesList |
context | a GPContext |
All supported camera models will then be added to the list.
Definition at line 302 of file gphoto2-abilities-list.c.
References CHECK_RESULT, gp_abilities_list_load_dir(), gp_abilities_list_sort(), and GP_OK.
Referenced by gp_camera_autodetect(), and gp_camera_init().
int gp_abilities_list_load_dir | ( | CameraAbilitiesList * | list, |
const char * | dir, | ||
GPContext * | context | ||
) |
Definition at line 157 of file gphoto2-abilities-list.c.
References _, _CameraAbilitiesList::abilities, CHECK_RESULT, foreach_func(), gp_abilities_list_count(), gp_abilities_list_lookup_id(), gp_context_cancel(), gp_context_error(), GP_CONTEXT_FEEDBACK_CANCEL, gp_context_progress_start(), gp_context_progress_stop(), gp_context_progress_update(), GP_ERROR, GP_ERROR_CANCEL, gp_list_count(), gp_list_free(), gp_list_get_name(), gp_list_new(), gp_list_reset(), GP_OK, CameraAbilities::id, CameraAbilities::library, foreach_data_t::list, foreach_data_t::result, and CameraText::text.
Referenced by gp_abilities_list_load().
|
static |
Definition at line 586 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, _CameraAbilitiesList::count, GP_ERROR, and CameraAbilities::id.
Referenced by gp_abilities_list_load_dir().
int gp_abilities_list_lookup_model | ( | CameraAbilitiesList * | list, |
const char * | model | ||
) |
Search the list for an entry of given model name.
list | a CameraAbilitiesList |
model | a camera model name |
Definition at line 607 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, _CameraAbilitiesList::count, GP_ERROR_MODEL_NOT_FOUND, and CameraAbilities::model.
Referenced by gp_camera_init().
int gp_abilities_list_new | ( | CameraAbilitiesList ** | list | ) |
Allocate the memory for a new abilities list.
Function to allocate the memory for a new abilities list.
list | CameraAbilitiesList object to initialize |
You would then call gp_abilities_list_load() in order to populate it.
Definition at line 101 of file gphoto2-abilities-list.c.
References bindtextdomain, and GP_OK.
Referenced by gp_camera_autodetect(), and gp_camera_init().
int gp_abilities_list_reset | ( | CameraAbilitiesList * | list | ) |
Reset the list.
list | a CameraAbilitiesList |
Definition at line 541 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, _CameraAbilitiesList::count, GP_OK, and _CameraAbilitiesList::maxcount.
Referenced by gp_abilities_list_free().
|
static |
Definition at line 576 of file gphoto2-abilities-list.c.
References _CameraAbilitiesList::abilities, cmp_abilities(), _CameraAbilitiesList::count, and GP_OK.
Referenced by gp_abilities_list_load().
const char* gp_message_codeset | ( | const char * | codeset | ) |
Set the current character codeset libgphoto2 is operating in.
Set the codeset for all messages returned by libgphoto2.
codeset | New codeset for the messages. For instance "utf-8". |
You would then call gp_abilities_list_load() in order to populate it.
Definition at line 84 of file gphoto2-abilities-list.c.
References bind_textdomain_codeset, and gp_port_message_codeset().
|
static |
Remove first colon from string, if any. Replace it by a space.
str | a char * string |
Definition at line 489 of file gphoto2-abilities-list.c.
Referenced by gp_abilities_list_append().