libp7/doc/p7_error.3.txt

102 lines
3.0 KiB
Plaintext

P7_ERROR(3)
===========
Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libp7
:man manual: libp7 manual
NAME
----
p7_error - all errors from libp7
SYNOPSIS
--------
[source,c]
----
#include <libp7.h>
int err = p7_some_function(handle, ...);
if (err) switch (err) {
case p7_error_...:
/* oh my god! they killed kenny! */
break;
}
----
DESCRIPTION
-----------
Every function in libp7 returns either zero if everything went alright, or
the code of the error that happened. This used to be stored in a global called
*p7_error*, but it isn't since *2.0*. The error codes are the following:
*p7_error_uninitialized*::
User sent a NULL handle! (handles are created using *p7_init*)
*p7_error_nocalc*::
Calculator was disconnected.
*p7_error_noaccess*::
Could not get access to the calculator.
*p7_error_nochar*::
Provided file wasn't a char device.
*p7_error_timeout*::
Calculator has timed out.
*p7_error_irrecoverable*::
Irrecoverable error (double error or received invalid checksum when
packet shifting was on). Just bad luck, try again.
*p7_error_nostream*::
Provided stream was NULL.
*p7_error_noread*::
Provided stream was not readable.
*p7_error_nowrite*::
Provided stream was not writable.
*p7_error_noseek*::
Provided stream was not seekable.
*p7_error_active*::
Was active when protocol required active mode, or the other way round.
Initialize libp7 with correct mode before running the protocol.
*p7_error_doubleshift*::
Tried to shift when was already shifted. Don't. Bad.
*p7_error_empty*::
Provided file was empty.
*p7_error_filename*::
Provided filename was missing or incorrect (12 chars max !).
*p7_error_dirname*::
Provided directory name was incorrect (8 chars max !).
*p7_error_fullmem*::
File was too large for the left memory.
*p7_error_notfound*::
File wasn't found. In case of a command that acts on a distant file
(request, delete), could also be that the device is unsupported (this
is because of a protocol failure).
*p7_error_denied_overwrite*::
User denied overwrite (with or without callback). Not really an error, but
informs that the action hasn't been performed.
*p7_error_terminated*::
The communication was terminated by a previous command or error.
*p7_error_interrupted*::
User interrupted the communication on the calculator.
*p7_error_unsupported*::
Unsupported command. This usually comes from:
* the confusion between receive mode and OS Update, that support different
ranges of commands ;
* the fact that the command is no longer implemented on the calculator.
*p7_error_unsupported_device*::
Unsupported storage device. For some actions, *p7_error_notfound* will be
returned instead of this one -- see the error for more info.
*p7_error_alloc*::
A dynamic allocation has failed. That happens sometimes...
*p7_error_unknown*::
An unknown error has occured (the calculator probably didn't act as
planned). User should end and re-run receive mode on his calculator.
String descriptions of the errors can be dynamically obtained by using
*p7_strerror*.
SEE ALSO
--------
*libp7*(3),
*p7_strerror*(3)