Branch data Line data Source code
1 : : // Copyright 2014-2025 David Robillard <d@drobilla.net> 2 : : // SPDX-License-Identifier: ISC 3 : : 4 : : #include <zix/attributes.h> 5 : : #include <zix/status.h> 6 : : 7 : : ZIX_REALTIME const char* 8 : 50 : zix_strerror(const ZixStatus status) 9 : : { 10 [ + + + + : 50 : switch (status) { + + + + + + + + + + + ] 11 : 1 : case ZIX_STATUS_SUCCESS: 12 : 1 : return "Success"; 13 : 1 : case ZIX_STATUS_ERROR: 14 : 1 : return "Unknown error"; 15 : 35 : case ZIX_STATUS_NO_MEM: 16 : 35 : return "Out of memory"; 17 : 1 : case ZIX_STATUS_NOT_FOUND: 18 : 1 : return "Not found"; 19 : 1 : case ZIX_STATUS_EXISTS: 20 : 1 : return "Exists"; 21 : 1 : case ZIX_STATUS_BAD_ARG: 22 : 1 : return "Bad argument"; 23 : 1 : case ZIX_STATUS_BAD_PERMS: 24 : 1 : return "Bad permissions"; 25 : 1 : case ZIX_STATUS_REACHED_END: 26 : 1 : return "Reached end"; 27 : 1 : case ZIX_STATUS_TIMEOUT: 28 : 1 : return "Timeout"; 29 : 1 : case ZIX_STATUS_OVERFLOW: 30 : 1 : return "Overflow"; 31 : 1 : case ZIX_STATUS_NOT_SUPPORTED: 32 : 1 : return "Not supported"; 33 : 1 : case ZIX_STATUS_UNAVAILABLE: 34 : 1 : return "Resource unavailable"; 35 : 1 : case ZIX_STATUS_NO_SPACE: 36 : 1 : return "Out of storage space"; 37 : 1 : case ZIX_STATUS_MAX_LINKS: 38 : 1 : return "Too many links"; 39 : : } 40 : 2 : return "Unknown error"; 41 : : }