21 #ifndef _LWPA_ERROR_H_
22 #define _LWPA_ERROR_H_
102 #define LWPA_NUM_ERROR_CODES 27
108 extern const char *lwpa_error_strings[LWPA_NUM_ERROR_CODES];
115 #define lwpa_strerror(errcode) \
116 (((int)errcode <= 0 && (int)errcode > -LWPA_NUM_ERROR_CODES) ? lwpa_error_strings[-((int)errcode)] : NULL)
lwpa_error_t
A set of error codes that can be returned by library functions.
Definition: lwpa_error.h:37
@ LWPA_NOTIMPL
A function or specific use of a function is not implemented yet.
Definition: lwpa_error.h:96
@ LWPA_NODATA
Returned from a function that is meant to be called repeatedly to indicate that there is no more data...
Definition: lwpa_error.h:56
@ LWPA_NOTINIT
An API function was called from a module that was not previously initialized.
Definition: lwpa_error.h:91
@ LWPA_INPROGRESS
The operation requested is now in progress and will complete later.
Definition: lwpa_error.h:85
@ LWPA_BUFSIZE
A buffer provided to a function was not big enough to hold the data that needed to be packed into it.
Definition: lwpa_error.h:88
@ LWPA_NOMEM
A dynamic memory allocation failed, or there is no space left in a statically allocated array.
Definition: lwpa_error.h:45
@ LWPA_EXIST
The item being created already exists.
Definition: lwpa_error.h:49
@ LWPA_TIMEDOUT
A connection timed out.
Definition: lwpa_error.h:79
@ LWPA_ADDRINUSE
The requested address is already in use.
Definition: lwpa_error.h:62
@ LWPA_NOTFOUND
An identifier or handle passed to a function was not valid or not previously initialized.
Definition: lwpa_error.h:42
@ LWPA_NOIFACES
No network interfaces were found on the system, or there are no network interfaces of a type that can...
Definition: lwpa_error.h:94
@ LWPA_ALREADY
The operation requested is already in progress.
Definition: lwpa_error.h:83
@ LWPA_CONNREFUSED
A connection was refused.
Definition: lwpa_error.h:81
@ LWPA_PROTERR
A protocol parsing function encountered a malformed packet.
Definition: lwpa_error.h:58
@ LWPA_WOULDBLOCK
The requested operation would block.
Definition: lwpa_error.h:53
@ LWPA_SHUTDOWN
Transport endpoint is shut down.
Definition: lwpa_error.h:77
@ LWPA_MSGSIZE
Message too long.
Definition: lwpa_error.h:60
@ LWPA_OK
The call was successful, no error occurred.
Definition: lwpa_error.h:39
@ LWPA_NOTCONN
Transport endpoint is not connected.
Definition: lwpa_error.h:75
@ LWPA_INVALID
An invalid argument was provided to an API function.
Definition: lwpa_error.h:51
@ LWPA_CONNCLOSED
A connection was gracefully closed by the remote peer.
Definition: lwpa_error.h:71
@ LWPA_CONNRESET
A connection was reset (hard/abortive close) by the remote peer.
Definition: lwpa_error.h:68
@ LWPA_BUSY
The resource being requested is temporarily unavailable.
Definition: lwpa_error.h:47
@ LWPA_SYSERR
A system call or C library call failed in a way not covered by other errors.
Definition: lwpa_error.h:99
@ LWPA_ADDRNOTAVAIL
Cannot assign the requested address.
Definition: lwpa_error.h:64
@ LWPA_ISCONN
Transport endpoint is already connected.
Definition: lwpa_error.h:73
@ LWPA_NETERR
The operation failed because a network was down or unreachable.
Definition: lwpa_error.h:66