libgphoto2 photo camera library (libgphoto2) Internals  2.5.26
gphoto2-result.c File Reference
#include "config.h"
#include <gphoto2/gphoto2-result.h>
#include <stddef.h>

Go to the source code of this file.

Macros

#define _(String)   (String)
 
#define N_(String)   (String)
 

Functions

const char * gp_result_as_string (int result)
 Translate a gphoto error code into a localized string. More...
 

Variables

struct {
   int   result
 
   const char *   description
 
result_descriptions []
 

Detailed Description

Author
Copyright 2000 Scott Fritzinger
License
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file gphoto2-result.c.

Macro Definition Documentation

◆ _

#define _ (   String)    (String)

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

◆ N_

#define N_ (   String)    (String)

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

Function Documentation

◆ gp_result_as_string()

const char* gp_result_as_string ( int  result)

Translate a gphoto error code into a localized string.

Parameters
resulta 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 73 of file gphoto2-result.c.

References _, description, gp_port_result_as_string(), N_, result, and result_descriptions.

Referenced by gp_filesystem_delete_all(), and gp_filesystem_get_file().

Variable Documentation

◆ description

const char* description

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

Referenced by gp_result_as_string().

◆ result

◆ 

struct { ... } result_descriptions[]
Initial value:
= {
{GP_ERROR_CORRUPTED_DATA, N_("Corrupted data")},
{GP_ERROR_FILE_EXISTS, N_("File exists")},
{GP_ERROR_MODEL_NOT_FOUND, N_("Unknown model")},
{GP_ERROR_DIRECTORY_NOT_FOUND, N_("Directory not found")},
{GP_ERROR_FILE_NOT_FOUND, N_("File not found")},
{GP_ERROR_DIRECTORY_EXISTS, N_("Directory exists")},
{GP_ERROR_CAMERA_BUSY, N_("I/O in progress")},
{GP_ERROR_PATH_NOT_ABSOLUTE, N_("Path not absolute")},
{GP_ERROR_CANCEL, N_("Operation cancelled")},
{GP_ERROR_CAMERA_ERROR, N_("Camera could not complete operation")},
{GP_ERROR_OS_FAILURE, N_("OS error in camera communication")},
{GP_ERROR_NO_SPACE, N_("Not enough free space")},
{0, NULL}
}
#define N_(String)
#define GP_ERROR_CAMERA_BUSY
The camera is already busy.
#define GP_ERROR_PATH_NOT_ABSOLUTE
Path is not absolute.
#define GP_ERROR_CANCEL
Cancellation successful.
#define GP_ERROR_NO_SPACE
Not enough space.
#define GP_ERROR_FILE_EXISTS
File already exists.
#define GP_ERROR_FILE_NOT_FOUND
Specified file was not found.
#define GP_ERROR_OS_FAILURE
Unspecified failure of the operating system.
#define GP_ERROR_DIRECTORY_NOT_FOUND
Specified directory was not found.
#define GP_ERROR_DIRECTORY_EXISTS
Specified directory already exists.
#define GP_ERROR_MODEL_NOT_FOUND
Specified camera model was not found.
#define GP_ERROR_CAMERA_ERROR
Unspecified camera error.
#define GP_ERROR_CORRUPTED_DATA
Corrupted data received.

Referenced by gp_result_as_string().