Platform-agnostic error codes and checking macros. More...
Go to the source code of this file.
Macros | |
| #define | PAL_ERR_TO_NAME(err) |
Convert a pal_err_t code to its human-readable name. | |
| #define | PAL_CHECK(x, tag, msg) |
Macro that evaluates an expression and call a return if the result is different from PAL_OK. | |
| #define | PAL_CHECK_COND(cond, tag, msg) |
Macro that evaluates a boolean condition and call a return if the result is false. | |
Error Codes | |
| #define | PAL_OK 0 |
| Operation completed successfully. | |
| #define | PAL_FAIL -1 |
| Generic failure. | |
| #define | PAL_ERR_NO_MEM -2 |
| Memory allocation failed. | |
| #define | PAL_ERR_INVALID_ARG -3 |
| One or more arguments are invalid. | |
| #define | PAL_ERR_INVALID_STATE -4 |
| The current state does not permit this operation. | |
| #define | PAL_ERR_INVALID_SIZE -5 |
| A size value is out of the valid range. | |
| #define | PAL_ERR_NOT_FOUND -6 |
| Requested resource was not found. | |
| #define | PAL_ERR_NOT_SUPPORTED -7 |
| Operation or feature is not supported. | |
| #define | PAL_ERR_TIMEOUT -8 |
| Operation timed out. | |
| #define | PAL_ERR_INVALID_CRC -9 |
| CRC check failed. | |
| #define | PAL_ERR_NOT_FINISHED -10 |
| Operation has not finished yet. | |
| #define | PAL_ERR_NOT_ALLOWED -11 |
| Operation is not permitted in the current context. | |
Typedefs | |
| typedef int | pal_err_t |
Functions | |
| static const char * | _pal_err_to_name (pal_err_t err) |
Convert a pal_err_t code to its human-readable name. | |
Platform-agnostic error codes and checking macros.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.