gphoto2-port-result.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /** \file gphoto2-port-result.h
  2. *
  3. * Copyright 2001 Lutz Mueller <lutz@users.sf.net>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18. * Boston, MA 02110-1301 USA
  19. */
  20. #ifndef __GPHOTO2_PORT_RESULT_H__
  21. #define __GPHOTO2_PORT_RESULT_H__
  22. /* Return values. gphoto2-port should only return values from 0 to -99 */
  23. /**
  24. * \brief Everything is OK
  25. *
  26. * Note that this is also the value 0, and every error is negative (lower).
  27. */
  28. #define GP_OK 0
  29. /**
  30. * \brief Generic Error
  31. */
  32. #define GP_ERROR -1
  33. /**
  34. * \brief Bad parameters passed
  35. */
  36. #define GP_ERROR_BAD_PARAMETERS -2
  37. /**
  38. * \brief Out of memory
  39. */
  40. #define GP_ERROR_NO_MEMORY -3
  41. /**
  42. * \brief Error in the camera driver
  43. */
  44. #define GP_ERROR_LIBRARY -4
  45. /**
  46. * \brief Unknown libgphoto2 port passed
  47. */
  48. #define GP_ERROR_UNKNOWN_PORT -5
  49. /**
  50. * \brief Functionality not supported
  51. */
  52. #define GP_ERROR_NOT_SUPPORTED -6
  53. /**
  54. * \brief Generic I/O error
  55. */
  56. #define GP_ERROR_IO -7
  57. /**
  58. * \brief Buffer overflow of internal structure
  59. */
  60. #define GP_ERROR_FIXED_LIMIT_EXCEEDED -8
  61. /**
  62. * \brief Operation timed out
  63. */
  64. #define GP_ERROR_TIMEOUT -10
  65. /**
  66. * \brief Serial ports not supported
  67. */
  68. #define GP_ERROR_IO_SUPPORTED_SERIAL -20
  69. /**
  70. * \brief USB ports not supported
  71. */
  72. #define GP_ERROR_IO_SUPPORTED_USB -21
  73. /**
  74. * \brief Error initialising I/O
  75. */
  76. #define GP_ERROR_IO_INIT -31
  77. /**
  78. * \brief I/O during read
  79. */
  80. #define GP_ERROR_IO_READ -34
  81. /**
  82. * \brief I/O during write
  83. */
  84. #define GP_ERROR_IO_WRITE -35
  85. /**
  86. * \brief I/O during update of settings
  87. */
  88. #define GP_ERROR_IO_UPDATE -37
  89. /**
  90. * \brief Specified serial speed not possible.
  91. */
  92. #define GP_ERROR_IO_SERIAL_SPEED -41
  93. /**
  94. * \brief Error during USB Clear HALT
  95. */
  96. #define GP_ERROR_IO_USB_CLEAR_HALT -51
  97. /**
  98. * \brief Error when trying to find USB device
  99. */
  100. #define GP_ERROR_IO_USB_FIND -52
  101. /**
  102. * \brief Error when trying to claim the USB device
  103. */
  104. #define GP_ERROR_IO_USB_CLAIM -53
  105. /**
  106. * \brief Error when trying to lock the device
  107. */
  108. #define GP_ERROR_IO_LOCK -60
  109. /**
  110. * \brief Unspecified error when talking to HAL
  111. */
  112. #define GP_ERROR_HAL -70
  113. const char *gp_port_result_as_string (int result);
  114. #endif /* __GPHOTO2_PORT_RESULT_H__ */