libgphoto2 photo camera library (libgphoto2) Internals  2.5.23
gphoto2-port-result.c
Go to the documentation of this file.
1 
21 #include "config.h"
23 
24 #ifdef ENABLE_NLS
25 # include <libintl.h>
26 # undef _
27 # define _(String) dgettext (GETTEXT_PACKAGE, String)
28 # ifdef gettext_noop
29 # define N_(String) gettext_noop (String)
30 # else
31 # define N_(String) (String)
32 # endif
33 #else
34 # define textdomain(String) (String)
35 # define gettext(String) (String)
36 # define dgettext(Domain,Message) (Message)
37 # define dcgettext(Domain,Message,Type) (Message)
38 # define bindtextdomain(Domain,Directory) (Domain)
39 # define _(String) (String)
40 # define N_(String) (String)
41 #endif
42 
53 const char *
55 {
56  switch (result) {
57  case GP_OK:
58  return _("No error");
59  case GP_ERROR:
60  return _("Unspecified error");
61  case GP_ERROR_IO:
62  return _("I/O problem");
64  return _("Bad parameters");
66  return _("Unsupported operation");
68  return _("Fixed limit exceeded");
69  case GP_ERROR_TIMEOUT:
70  return _("Timeout reading from or writing to the port");
72  return _("Serial port not supported");
74  return _("USB port not supported");
76  return _("Unknown port");
77  case GP_ERROR_NO_MEMORY:
78  return _("Out of memory");
79  case GP_ERROR_LIBRARY:
80  return _("Error loading a library");
81  case GP_ERROR_IO_INIT:
82  return _("Error initializing the port");
83  case GP_ERROR_IO_READ:
84  return _("Error reading from the port");
85  case GP_ERROR_IO_WRITE:
86  return _("Error writing to the port");
87  case GP_ERROR_IO_UPDATE:
88  return _("Error updating the port settings");
90  return _("Error setting the serial port speed");
92  return _("Error clearing a halt condition on the USB port");
94  return _("Could not find the requested device on the USB port");
96  return _("Could not claim the USB device");
97  case GP_ERROR_IO_LOCK:
98  return _("Could not lock the device");
99  case GP_ERROR_HAL:
100  return _("libhal error");
101  default:
102  return _("Unknown error");
103  }
104 }
GP_ERROR_IO
#define GP_ERROR_IO
Generic I/O error.
Definition: gphoto2-port-result.h:58
GP_ERROR_FIXED_LIMIT_EXCEEDED
#define GP_ERROR_FIXED_LIMIT_EXCEEDED
Buffer overflow of internal structure.
Definition: gphoto2-port-result.h:62
GP_ERROR_UNKNOWN_PORT
#define GP_ERROR_UNKNOWN_PORT
Unknown libgphoto2 port passed.
Definition: gphoto2-port-result.h:50
GP_ERROR_IO_READ
#define GP_ERROR_IO_READ
I/O during read.
Definition: gphoto2-port-result.h:84
GP_ERROR_IO_INIT
#define GP_ERROR_IO_INIT
Error initialising I/O.
Definition: gphoto2-port-result.h:80
GP_ERROR_NO_MEMORY
#define GP_ERROR_NO_MEMORY
Out of memory.
Definition: gphoto2-port-result.h:42
GP_ERROR_HAL
#define GP_ERROR_HAL
Unspecified error when talking to HAL.
Definition: gphoto2-port-result.h:120
gphoto2-port-result.h
result
int result
Definition: gphoto2-result.c:44
GP_ERROR_IO_LOCK
#define GP_ERROR_IO_LOCK
Error when trying to lock the device.
Definition: gphoto2-port-result.h:115
GP_ERROR_IO_WRITE
#define GP_ERROR_IO_WRITE
I/O during write.
Definition: gphoto2-port-result.h:88
gp_port_result_as_string
const char * gp_port_result_as_string(int result)
Definition: gphoto2-port-result.c:54
GP_ERROR_IO_USB_CLEAR_HALT
#define GP_ERROR_IO_USB_CLEAR_HALT
Error during USB Clear HALT.
Definition: gphoto2-port-result.h:102
GP_ERROR_BAD_PARAMETERS
#define GP_ERROR_BAD_PARAMETERS
Bad parameters passed.
Definition: gphoto2-port-result.h:38
GP_OK
#define GP_OK
Everything is OK.
Definition: gphoto2-port-result.h:30
_
#define _(String)
Definition: gphoto2-port-result.c:39
GP_ERROR_IO_SUPPORTED_USB
#define GP_ERROR_IO_SUPPORTED_USB
USB ports not supported.
Definition: gphoto2-port-result.h:75
GP_ERROR_IO_USB_FIND
#define GP_ERROR_IO_USB_FIND
Error when trying to find USB device.
Definition: gphoto2-port-result.h:106
GP_ERROR_IO_USB_CLAIM
#define GP_ERROR_IO_USB_CLAIM
Error when trying to claim the USB device.
Definition: gphoto2-port-result.h:110
GP_ERROR
#define GP_ERROR
Generic Error.
Definition: gphoto2-port-result.h:34
GP_ERROR_IO_SERIAL_SPEED
#define GP_ERROR_IO_SERIAL_SPEED
Specified serial speed not possible.
Definition: gphoto2-port-result.h:97
GP_ERROR_LIBRARY
#define GP_ERROR_LIBRARY
Error in the camera driver.
Definition: gphoto2-port-result.h:46
GP_ERROR_IO_UPDATE
#define GP_ERROR_IO_UPDATE
I/O during update of settings.
Definition: gphoto2-port-result.h:92
GP_ERROR_TIMEOUT
#define GP_ERROR_TIMEOUT
Operation timed out.
Definition: gphoto2-port-result.h:66
GP_ERROR_IO_SUPPORTED_SERIAL
#define GP_ERROR_IO_SUPPORTED_SERIAL
Serial ports not supported.
Definition: gphoto2-port-result.h:71
GP_ERROR_NOT_SUPPORTED
#define GP_ERROR_NOT_SUPPORTED
Functionality not supported.
Definition: gphoto2-port-result.h:54