Whole document tree
    

Whole document tree

GPhoto2-Port-Info-List

GPhoto2-Port-Info-List

Name

GPhoto2-Port-Info-List -- 

Description

Details

enum GPPortType

typedef enum { 
	GP_PORT_NONE        =      0,
	GP_PORT_SERIAL      = 1 << 0,
	GP_PORT_USB         = 1 << 2,
} GPPortType;


struct GPPortInfo

struct GPPortInfo {
	GPPortType type;
	char name[64];
	char path[64];

	/* Private */
	char library_filename[1024];
};


struct GPPortInfoList

struct GPPortInfoList;

The internals of this list are private.


gp_port_info_list_new ()

int         gp_port_info_list_new           (GPPortInfoList **list);

Creates a new list which can later be filled with port infos (GPPortInfo) using gp_port_info_list_load.


gp_port_info_list_free ()

int         gp_port_info_list_free          (GPPortInfoList *list);

Frees a list.


gp_port_info_list_load ()

int         gp_port_info_list_load          (GPPortInfoList *list);

Searches the system for io-drivers and appends them to the list. You would normally call this function once after gp_port_info_list_new and then use this list in order to supply gp_port_set_info with parameters.


gp_port_info_list_count ()

int         gp_port_info_list_count         (GPPortInfoList *list);

Returns the number of entries in the list.


gp_port_info_list_get_info ()

int         gp_port_info_list_get_info      (GPPortInfoList *list,
                                             int n,
                                             GPPortInfo *info);

Retreives an entry from the list.


gp_port_info_list_lookup_path ()

int         gp_port_info_list_lookup_path   (GPPortInfoList *list,
                                             const char *path);

Looks for an entry in the list with the supplied path. If no exact match can be found, a regex search will be performed in the hope some driver claimed ports like "serial:*".


gp_port_info_list_lookup_name ()

int         gp_port_info_list_lookup_name   (GPPortInfoList *list,
                                             const char *name);

Looks for an entry in the list with the given name.


gp_port_info_list_append ()

int         gp_port_info_list_append        (GPPortInfoList *list,
                                             GPPortInfo info);

Appends an entry to the list. This function is typically called by an io-driver during gp_port_library_list. If you leave info.name blank, gp_port_info_list_lookup_path will try to match non-existent paths against info.path and - if successfull - will append this entry to the list.