CameraList

CameraList —

Synopsis




struct      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);

Description

Details

struct CameraList

struct CameraList {

	int  count;
	struct {
		char name  [128];
		char value [128];
	} entry [MAX_ENTRIES];
	int ref_count;
};


gp_list_new ()

int         gp_list_new                     (CameraList **list);

Creates a new CameraList.

list :
Returns : a gphoto2 error code

gp_list_ref ()

int         gp_list_ref                     (CameraList *list);

Increments the reference count of the list.

list : a CameraList
Returns : a gphoto2 error code.

gp_list_unref ()

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 : a CameraList
Returns : a gphoto2 error code

gp_list_free ()

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

gp_list_count ()

int         gp_list_count                   (CameraList *list);

Counts the entries in the list.

list : a CameraList
Returns : a gphoto2 error code

gp_list_set_name ()

int         gp_list_set_name                (CameraList *list,
                                             int index,
                                             const char *name);

Sets the name of an entry.

list : a CameraList
index : index of entry
name : name to be set
Returns : a gphoto2 error code

gp_list_set_value ()

int         gp_list_set_value               (CameraList *list,
                                             int index,
                                             const char *value);

Sets the value of an entry.

list : a CameraList
index : index of the entry
value : the value to be set
Returns : a gphoto2 error code

gp_list_get_name ()

int         gp_list_get_name                (CameraList *list,
                                             int index,
                                             const char **name);

Retrieves the name of entry with index.

list : a CameraList
index : index of the entry
name :
Returns : a gphoto2 error code.

gp_list_get_value ()

int         gp_list_get_value               (CameraList *list,
                                             int index,
                                             const char **value);

Retrieves the value of entry with index.

list : a CameraList
index : index of the entry
value :
Returns : a gphoto2 error code

gp_list_append ()

int         gp_list_append                  (CameraList *list,
                                             const char *name,
                                             const char *value);

Appends name and value to the list.

list : a CameraList
name : the name of the entry to append
value : the value of the entry to append
Returns : a gphoto2 error code

gp_list_populate ()

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 : a CameraList
format : the format
count : number of entries to be added to the list
Returns : a gphoto2 error code

gp_list_reset ()

int         gp_list_reset                   (CameraList *list);

Resets the list and removes all entries.

list : a CameraList
Returns : a gphoto2 error code

gp_list_sort ()

int         gp_list_sort                    (CameraList *list);

Sorts the list entries with respect to the names.

list : a CameraList
Returns : a gphoto2 error code