gphoto2-port-info-list.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /** \file
  2. *
  3. * \author Copyright 2001 Lutz Mueller <lutz@users.sf.net>
  4. *
  5. * \par License
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * \par
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * \par
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  21. * Boston, MA 02110-1301 USA
  22. */
  23. #ifndef __GPHOTO2_PORT_INFO_LIST_H__
  24. #define __GPHOTO2_PORT_INFO_LIST_H__
  25. /**
  26. * \brief The gphoto port type.
  27. *
  28. * Enumeration specifying the port type.
  29. * The enum is providing bitmasks, but most code uses it as
  30. * just the one specific values.
  31. */
  32. typedef enum {
  33. GP_PORT_NONE = 0, /**< \brief No specific type associated. */
  34. GP_PORT_SERIAL = 1 << 0, /**< \brief Serial port. */
  35. GP_PORT_USB = 1 << 2, /**< \brief USB port. */
  36. GP_PORT_DISK = 1 << 3, /**< \brief Disk / local mountpoint port. */
  37. GP_PORT_PTPIP = 1 << 4, /**< \brief PTP/IP port. */
  38. GP_PORT_USB_DISK_DIRECT = 1 << 5, /**< \brief Direct IO to an usb mass storage device. */
  39. GP_PORT_USB_SCSI = 1 << 6 /**< \brief USB Mass Storage raw SCSI port. */
  40. } GPPortType;
  41. /**
  42. * \brief Information about the current port.
  43. *
  44. * Specific information about the current port. Usually taken from the
  45. * "--port=XXXX" setting from the frontend.
  46. *
  47. * This is not to be confused with the driver configurable port settings
  48. * in \ref GPPortSettings.
  49. */
  50. struct _GPPortInfo;
  51. typedef struct _GPPortInfo *GPPortInfo;
  52. #include <gphoto2/gphoto2-port.h>
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif /* __cplusplus */
  56. #ifdef _GPHOTO2_INTERNAL_CODE
  57. #include <gphoto2/gphoto2-port-log.h>
  58. extern const StringFlagItem gpi_gphoto_port_type_map[];
  59. #endif
  60. int gp_port_info_new (GPPortInfo *info);
  61. int gp_port_info_get_name (GPPortInfo info, char **name);
  62. int gp_port_info_set_name (GPPortInfo info, const char *name);
  63. int gp_port_info_get_path (GPPortInfo info, char **path);
  64. int gp_port_info_set_path (GPPortInfo info, const char *path);
  65. int gp_port_info_get_type (GPPortInfo info, GPPortType *type);
  66. int gp_port_info_set_type (GPPortInfo info, const GPPortType type);
  67. int gp_port_info_get_library_filename (GPPortInfo info, char **lib);
  68. int gp_port_info_set_library_filename (GPPortInfo info, char *lib);
  69. /* Internals are private */
  70. typedef struct _GPPortInfoList GPPortInfoList;
  71. int gp_port_info_list_new (GPPortInfoList **list);
  72. int gp_port_info_list_free (GPPortInfoList *list);
  73. int gp_port_info_list_append (GPPortInfoList *list, GPPortInfo info);
  74. int gp_port_info_list_load (GPPortInfoList *list);
  75. int gp_port_info_list_count (GPPortInfoList *list);
  76. int gp_port_info_list_lookup_path (GPPortInfoList *list, const char *path);
  77. int gp_port_info_list_lookup_name (GPPortInfoList *list, const char *name);
  78. int gp_port_info_list_get_info (GPPortInfoList *list, int n, GPPortInfo *info);
  79. const char *gp_port_message_codeset (const char*);
  80. /**
  81. * Name of the environment variable which may contain the path where
  82. * to look for the IO libs. If this environment variable is not defined,
  83. * use the compiled-in default constant.
  84. *
  85. * \internal Internal use only.
  86. */
  87. #ifdef _GPHOTO2_INTERNAL_CODE
  88. #define IOLIBDIR_ENV "IOLIBS"
  89. #endif /* _GPHOTO2_INTERNAL_CODE */
  90. #ifdef __cplusplus
  91. }
  92. #endif /* __cplusplus */
  93. #endif /* __GPHOTO2_PORT_INFO_LIST_H__ */