![]() | ![]() | ![]() | GPhoto2 API Reference Manual | ![]() |
---|
CameraList; int gp_list_new (CameraList **list); int gp_list_ref (CameraList *list); int gp_list_unref (CameraList *list); int gp_list_free (CameraList *list); int gp_list_count (CameraList *list); int gp_list_set_name (CameraList *list, int index, const char *name); int gp_list_set_value (CameraList *list, int index, const char *value); int gp_list_get_name (CameraList *list, int index, const char **name); int gp_list_get_value (CameraList *list, int index, const char **value); int gp_list_append (CameraList *list, const char *name, const char *value); int gp_list_populate (CameraList *list, const char *format, int count); int gp_list_reset (CameraList *list); int gp_list_sort (CameraList *list);
typedef struct { int count; struct { char name [128]; char value [128]; } entry [MAX_ENTRIES]; int ref_count; } CameraList;
int gp_list_new (CameraList **list);
Creates a new CameraList.
list : | |
Returns : | a gphoto2 error code |
int gp_list_ref (CameraList *list);
Increments the reference count of the list
.
list : | |
Returns : | a gphoto2 error code. |
int gp_list_unref (CameraList *list);
Decrements the reference count of the list
. If there are no references
left, the list
will be freed.
list : | |
Returns : | a gphoto2 error code |
int gp_list_free (CameraList *list);
Frees the list
. It is recommended to use gp_list_unref instead.
list : | the CameraList to be freed |
Returns : | a gphoto2 error code |
int gp_list_count (CameraList *list);
Counts the entries in the list
.
list : | |
Returns : | a gphoto2 error code |
int gp_list_set_name (CameraList *list, int index, const char *name);
Sets the name of an entry.
list : | |
index : | index of entry |
name : | name to be set |
Returns : | a gphoto2 error code |
int gp_list_set_value (CameraList *list, int index, const char *value);
Sets the value
of an entry.
list : | |
index : | index of the entry |
value : | the value to be set |
Returns : | a gphoto2 error code |
int gp_list_get_name (CameraList *list, int index, const char **name);
Retrieves the name
of entry with index
.
list : | |
index : | index of the entry |
name : | |
Returns : | a gphoto2 error code. |
int gp_list_get_value (CameraList *list, int index, const char **value);
Retrieves the value of entry with index
.
list : | |
index : | index of the entry |
value : | |
Returns : | a gphoto2 error code |
int gp_list_append (CameraList *list, const char *name, const char *value);
Appends name
and value
to the list
.
list : | |
name : | the name of the entry to append |
value : | the value of the entry to append |
Returns : | a gphoto2 error code |
int gp_list_populate (CameraList *list, const char *format, int count);
Adds count
entries to the list. Typically, this function is called by
a camera driver when there is no way of retrieving the real name of a
picture. In this case, when asked for a file list
(see CameraFilesystemListFunc), the list is populated with dummy
names generated by this function.
list : | |
format : | the format |
count : | number of entries to be added to the |
Returns : | a gphoto2 error code |
int gp_list_reset (CameraList *list);
Resets the list
and removes all entries.
list : | |
Returns : | a gphoto2 error code |
int gp_list_sort (CameraList *list);
Sorts the list
entries with respect to the names.
list : | |
Returns : | a gphoto2 error code |
<<< CameraWidget | CameraAbilitiesList >>> |