gphoto2-port-info-list.h
Go to the documentation of this file.
#ifndef __GPHOTO2_PORT_INFO_LIST_H__
#define __GPHOTO2_PORT_INFO_LIST_H__
typedef enum {
GP_PORT_NONE = 0,
GP_PORT_SERIAL = 1 << 0,
GP_PORT_USB = 1 << 2,
GP_PORT_DISK = 1 << 3,
GP_PORT_PTPIP = 1 << 4,
GP_PORT_USB_DISK_DIRECT = 1 << 5,
GP_PORT_USB_SCSI = 1 << 6
} GPPortType;
struct _GPPortInfo;
typedef struct _GPPortInfo *GPPortInfo;
#include <gphoto2/gphoto2-port.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef _GPHOTO2_INTERNAL_CODE
#include <gphoto2/gphoto2-port-log.h>
extern const StringFlagItem gpi_gphoto_port_type_map[];
#endif
int gp_port_info_new (GPPortInfo *info);
int gp_port_info_get_name (GPPortInfo info, char **name);
int gp_port_info_set_name (GPPortInfo info, const char *name);
int gp_port_info_get_path (GPPortInfo info, char **path);
int gp_port_info_set_path (GPPortInfo info, const char *path);
int gp_port_info_get_type (GPPortInfo info, GPPortType *type);
int gp_port_info_set_type (GPPortInfo info, const GPPortType type);
int gp_port_info_get_library_filename (GPPortInfo info, char **lib);
int gp_port_info_set_library_filename (GPPortInfo info, char *lib);
/* Internals are private */
typedef struct _GPPortInfoList GPPortInfoList;
int gp_port_info_list_new (GPPortInfoList **list);
int gp_port_info_list_free (GPPortInfoList *list);
int gp_port_info_list_append (GPPortInfoList *list, GPPortInfo info);
int gp_port_info_list_load (GPPortInfoList *list);
int gp_port_info_list_count (GPPortInfoList *list);
int gp_port_info_list_lookup_path (GPPortInfoList *list, const char *path);
int gp_port_info_list_lookup_name (GPPortInfoList *list, const char *name);
int gp_port_info_list_get_info (GPPortInfoList *list, int n, GPPortInfo *info);
const char *gp_port_message_codeset (const char*);
#ifdef _GPHOTO2_INTERNAL_CODE
#define IOLIBDIR_ENV "IOLIBS"
#endif /* _GPHOTO2_INTERNAL_CODE */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GPHOTO2_PORT_INFO_LIST_H__ */
gp_port_info_list_lookup_path
int gp_port_info_list_lookup_path(GPPortInfoList *list, const char *path)
Lookup a specific path in the list.
Definition: gphoto2-port-info-list.c:334
gphoto2-port.h
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:458
_GPPortInfo::name
char * name
The name of this port (usb:)
Definition: gphoto2-port-info.h:34
gp_port_info_set_name
int gp_port_info_set_name(GPPortInfo info, const char *name)
Set name of a specific port entry.
Definition: gphoto2-port-info-list.c:506
GP_PORT_USB_SCSI
USB Mass Storage raw SCSI port.
Definition: gphoto2-port-info-list.h:41
gp_port_info_new
int gp_port_info_new(GPPortInfo *info)
Create a new portinfo.
Definition: gphoto2-port-info-list.c:583
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:552
GP_PORT_SERIAL
Serial port.
Definition: gphoto2-port-info-list.h:36
gp_port_info_list_load
int gp_port_info_list_load(GPPortInfoList *list)
Load system ports.
Definition: gphoto2-port-info-list.c:272
gp_port_info_list_lookup_name
int gp_port_info_list_lookup_name(GPPortInfoList *list, const char *name)
Look up a name in the list.
Definition: gphoto2-port-info-list.c:429
gp_port_info_list_new
int gp_port_info_list_new(GPPortInfoList **list)
Create a new GPPortInfoList.
Definition: gphoto2-port-info-list.c:109
GP_PORT_PTPIP
PTP/IP port.
Definition: gphoto2-port-info-list.h:39
GP_PORT_USB_DISK_DIRECT
Direct IO to an usb mass storage device.
Definition: gphoto2-port-info-list.h:40
gphoto2-port-log.h
GP_PORT_USB
USB port.
Definition: gphoto2-port-info-list.h:37
gp_port_info_set_path
int gp_port_info_set_path(GPPortInfo info, const char *path)
Set path of a specific port entry.
Definition: gphoto2-port-info-list.c:537
GP_PORT_DISK
Disk / local mountpoint port.
Definition: gphoto2-port-info-list.h:38
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:521
GP_PORT_NONE
No specific type associated.
Definition: gphoto2-port-info-list.h:35
_GPPortInfoList
Definition: gphoto2-port-info-list.c:72
_GPPortInfo::path
char * path
The path of this port (usb:001,023)
Definition: gphoto2-port-info.h:35
gp_port_message_codeset
const char * gp_port_message_codeset(const char *)
Specify codeset for translations.
Definition: gphoto2-port-info-list.c:94
gp_port_info_list_free
int gp_port_info_list_free(GPPortInfoList *list)
Free a GPPortInfo list.
Definition: gphoto2-port-info-list.c:133
_GPPortInfo::type
GPPortType type
The type of this port.
Definition: gphoto2-port-info.h:33
_GPPortInfo
Definition: gphoto2-port-info.h:32
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:303
gp_port_info_list_append
int gp_port_info_list_append(GPPortInfoList *list, GPPortInfo info)
Append a portinfo to the port information list.
Definition: gphoto2-port-info-list.c:175
gp_port_info_set_type
int gp_port_info_set_type(GPPortInfo info, const GPPortType type)
Set type of a specific port entry.
Definition: gphoto2-port-info-list.c:568
GPPortType
GPPortType
The gphoto port type.
Definition: gphoto2-port-info-list.h:34
gp_port_info_get_name
int gp_port_info_get_name(GPPortInfo info, char **name)
Get name of a specific port entry.
Definition: gphoto2-port-info-list.c:490