Logo Search packages:      
Sourcecode: libgphoto2 version File versions  Download package

int gp_port_set_error ( GPPort port,
const char *  format,

Set verbose port error message.

port a GPPort
format printf style format string
... variable arguments depending on format string
Sets an error message that can later be retrieved using gp_port_get_error.

a gphoto2 error code

Definition at line 1081 of file gphoto2-port.c.

References _GPPortPrivateCore::error, GP_ERROR_BAD_PARAMETERS, gp_log(), GP_LOG_ERROR, GP_OK, and _GPPort::pc.

Referenced by gp_abilities_list_detect().

      va_list args;

      if (!port)
            return (GP_ERROR_BAD_PARAMETERS);

      if (format) {
            va_start (args, format);
            vsnprintf (port->pc->error, sizeof (port->pc->error),
                     _(format), args);
            gp_log (GP_LOG_ERROR, "gphoto2-port", "%s", port->pc->error);
            va_end (args);
      } else
            port->pc->error[0] = '\0';

      return (GP_OK);

Generated by  Doxygen 1.6.0   Back to index