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

const char* gp_result_as_string ( int  result  ) 

Translate a gphoto error code into a localized string.

Parameters:
result a gphoto2 error code
Translates a gphoto2 error code into a human readable string. If the error occurred in combination with a camera, gp_camera_get_result_as_string should be used instead.

Returns:
A string representation of a gphoto2 error code

Definition at line 72 of file gphoto2-result.c.

References gp_port_result_as_string().

Referenced by gp_filesystem_delete_all(), and gp_filesystem_get_file().

{
      unsigned int i;

      /* IOlib error? Pass through. */
      if ((result <= 0) && (result >= -99))
            return gp_port_result_as_string (result);

      /* Camlib error? */
      if (result <= -1000)
            return (N_("Unknown camera library error")); 

      for (i = 0; result_descriptions[i].description; i++)
            if (result_descriptions[i].result == result)
                  return _(result_descriptions[i].description);

      return (N_("Unknown error"));
}


Generated by  Doxygen 1.6.0   Back to index