1 /* 2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/> 3 * (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com> 4 * 5 * This file is part of lsp-plugins 6 * Created on: 25 марта 2016 г. 7 * 8 * lsp-plugins is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU Lesser General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * any later version. 12 * 13 * lsp-plugins is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with lsp-plugins. If not, see <https://www.gnu.org/licenses/>. 20 */ 21 22 #ifndef CORE_STATUS_H_ 23 #define CORE_STATUS_H_ 24 25 typedef int status_t; 26 27 namespace lsp 28 { 29 enum status_codes 30 { 31 STATUS_OK, 32 STATUS_UNSPECIFIED, 33 STATUS_LOADING, 34 STATUS_IN_PROCESS, 35 STATUS_UNKNOWN_ERR, 36 STATUS_NO_MEM, 37 STATUS_NOT_FOUND, 38 STATUS_BAD_FORMAT, 39 STATUS_UNSUPPORTED_FORMAT, 40 STATUS_CORRUPTED_FILE, 41 STATUS_NO_DATA, 42 STATUS_INVALID_UID, 43 STATUS_DISCONNECTED, 44 STATUS_BAD_ARGUMENTS, 45 STATUS_NOT_BOUND, 46 STATUS_BAD_STATE, 47 STATUS_NOT_IMPLEMENTED, 48 STATUS_ALREADY_EXISTS, 49 STATUS_OVERFLOW, 50 STATUS_BAD_HIERARCHY, 51 STATUS_DUPLICATED, 52 STATUS_TOO_BIG, 53 STATUS_PERMISSION_DENIED, 54 STATUS_IO_ERROR, 55 STATUS_NO_FILE, 56 STATUS_EOF, 57 STATUS_CLOSED, 58 STATUS_NOT_SUPPORTED, 59 STATUS_INVALID_VALUE, 60 STATUS_BAD_LOCALE, 61 STATUS_NO_DEVICE, 62 STATUS_UNSUPPORTED_DEVICE, 63 STATUS_OPENED, 64 STATUS_BAD_TYPE, 65 STATUS_CORRUPTED, 66 STATUS_INSUFFICIENT, 67 STATUS_KILLED, 68 STATUS_TIMED_OUT, 69 STATUS_FAILED, 70 STATUS_SKIP, 71 STATUS_CANCELLED, 72 STATUS_NOT_EMPTY, 73 STATUS_IS_DIRECTORY, 74 STATUS_NOT_DIRECTORY, 75 STATUS_REMOVED, 76 STATUS_BREAK_POINT, // This is special status for step-by-step tracing algorithms 77 STATUS_READONLY, 78 STATUS_NULL, 79 STATUS_LOCKED, 80 STATUS_REJECTED, 81 STATUS_ALREADY_BOUND, 82 STATUS_NO_CAPTURES, 83 STATUS_NO_SOURCES, 84 STATUS_BAD_PATH, 85 STATUS_PROTOCOL_ERROR, 86 STATUS_BAD_TOKEN, 87 STATUS_NO_GRAB, 88 STATUS_UNDERFLOW, 89 90 STATUS_TOTAL, 91 STATUS_MAX = STATUS_TOTAL - 1, 92 STATUS_SUCCESS = STATUS_OK 93 }; 94 95 const char *get_status(status_t code); 96 const char *get_status_lc_key(status_t code); 97 98 bool status_is_success(status_t code); 99 bool status_is_preliminary(status_t code); 100 bool status_is_error(status_t code); 101 } 102 103 #endif /* CORE_STATUS_H_ */ 104