1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef NSTACKX_ERROR_H 17 #define NSTACKX_ERROR_H 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 #define NSTACKX_EOK 0 /* OK */ 24 #define NSTACKX_EFAILED (-1) /* Operation failed */ 25 26 /* 27 * Description:Invalid argument. 28 * Solution: Verify that related input parameters are correctly set. 29 */ 30 #define NSTACKX_EINVAL (-2) 31 #define NSTACKX_EINPROGRESS (-3) /* Operation now in progress */ 32 33 /* 34 * Description: Device or resource busy. 35 * Solution: Please retry later. 36 */ 37 #define NSTACKX_EBUSY (-4) 38 39 /* 40 * Description: Out of memory. 41 * Solution: 1. Verify whether the memory has exceeded the threshold. 42 * 2. Release the memory and try again. 43 */ 44 #define NSTACKX_ENOMEM (-5) 45 #define NSTACKX_EEXIST (-6) /* Resource already exist */ 46 47 /* 48 * Description: The resource is temporarily unavailable. 49 * Solution: Try again later. 50 */ 51 #define NSTACKX_EAGAIN (-7) 52 53 /* 54 * Description: Timeout. 55 * Solution: Try again. 56 */ 57 #define NSTACKX_ETIMEOUT (-8) 58 59 /* 60 * Description: Overflow. 61 * Solution: Try again. 62 */ 63 #define NSTACKX_OVERFLOW (-9) 64 65 /* 66 * Description: Not exist. 67 * Solution: Try again. 68 */ 69 #define NSTACKX_NOEXIST (-10) 70 71 /* 72 * Description: Interrupted system call. 73 * Solution: Try again. 74 */ 75 #define NSTACKX_EINTR (-11) 76 77 #define NSTACKX_TRUE 1 78 #define NSTACKX_FALSE 0 79 80 #define NSTACKX_NOTSUPPORT (-12) 81 82 #define NSTACKX_PEER_CLOSE (-13) 83 #ifdef __cplusplus 84 } 85 #endif 86 87 #endif // NSTACKX_ERROR_H 88