LibInsane: /build/libinsane/src/libinsane/subprojects/libinsane/include/libinsane/error.h Source File

| LibInsane 1.0.10 Cross-platform Cross-API Cross-driver Cross-image-scanner Image Scan Library

Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1#ifndef __LIBINSANE_ERROR_H
2#define __LIBINSANE_ERROR_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#define LIS_ENUM_ERROR 0xFFFFFFF
9
10#define LIS_ERR_BIT (1 << 30)
11#define LIS_ERR_INTERNAL_BIT (1 << 29)
12
13 enum lis_error {
14 LIS_OK = 0,
15 LIS_WARMING_UP,
17 LIS_ERR_DEVICE_BUSY = LIS_ERR_BIT,
18 LIS_ERR_CANCELLED,
20 LIS_ERR_UNSUPPORTED,
21 LIS_ERR_INVALID_VALUE,
22 LIS_ERR_JAMMED,
23 LIS_ERR_COVER_OPEN,
24 LIS_ERR_IO_ERROR,
25 LIS_ERR_NO_MEM,
26 LIS_ERR_ACCESS_DENIED,
27 LIS_ERR_HW_IS_LOCKED,
32 LIS_ERR_INTERNAL_IMG_FORMAT_NOT_SUPPORTED = LIS_ERR_BIT | LIS_ERR_INTERNAL_BIT,
33 LIS_ERR_INTERNAL_NOT_IMPLEMENTED,
34 LIS_ERR_INTERNAL_UNKNOWN_ERROR,
35 LIS_ERR_OFFLINE,
36};
37
38#define LIS_IS_OK(err) (!((err) & LIS_ERR_BIT))
39#define LIS_IS_ERROR(err) ((err) & LIS_ERR_BIT)
40
45 extern const char *lis_strerror(enum lis_error);
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif
lis_error
lis_error
Definition error.h:13
LIS_ERR_HW_IS_LOCKED
@ LIS_ERR_HW_IS_LOCKED
Definition error.h:27
LIS_ERR_INTERNAL_NOT_IMPLEMENTED
@ LIS_ERR_INTERNAL_NOT_IMPLEMENTED
Definition error.h:33
LIS_ERR_INTERNAL_UNKNOWN_ERROR
@ LIS_ERR_INTERNAL_UNKNOWN_ERROR
Definition error.h:34
LIS_ERR_ACCESS_DENIED
@ LIS_ERR_ACCESS_DENIED
Definition error.h:26
LIS_ERR_DEVICE_BUSY
@ LIS_ERR_DEVICE_BUSY
Definition error.h:17
LIS_ERR_UNSUPPORTED
@ LIS_ERR_UNSUPPORTED
Definition error.h:20
LIS_ERR_JAMMED
@ LIS_ERR_JAMMED
Definition error.h:22
LIS_ERR_INVALID_VALUE
@ LIS_ERR_INVALID_VALUE
Definition error.h:21
LIS_OK
@ LIS_OK
Definition error.h:14
LIS_ERR_OFFLINE
@ LIS_ERR_OFFLINE
Definition error.h:35
LIS_ERR_INTERNAL_IMG_FORMAT_NOT_SUPPORTED
@ LIS_ERR_INTERNAL_IMG_FORMAT_NOT_SUPPORTED
Image format is not supported by LibInsane.
Definition error.h:32
LIS_ERR_IO_ERROR
@ LIS_ERR_IO_ERROR
Definition error.h:24
LIS_WARMING_UP
@ LIS_WARMING_UP
Definition error.h:15
LIS_ERR_COVER_OPEN
@ LIS_ERR_COVER_OPEN
Definition error.h:23
LIS_ERR_CANCELLED
@ LIS_ERR_CANCELLED
Definition error.h:18
LIS_ERR_NO_MEM
@ LIS_ERR_NO_MEM
Definition error.h:25
lis_strerror
const char * lis_strerror(enum lis_error)
returns an English message corresponding to the error code.
LIS_ERR_BIT
#define LIS_ERR_BIT
Definition error.h:10
LIS_ERR_INTERNAL_BIT
#define LIS_ERR_INTERNAL_BIT
Definition error.h:11