3 * Dianostic definitions
5 * (c) 2024 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of Xyla, a library of binary trees.
12 * Xyla is free software: you can redistribute it and/or modify it under
13 * the terms of the GNU Lesser General Public License as published by the
14 * Free Software Foundation; either version 3 of the License, or (at your
15 * option) any later version.
17 * Xyla is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20 * License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with Xyla. If not, see <https://www.gnu.org/licenses/>.
26 /*----- Header files ------------------------------------------------------*/
31 /*----- Main code ---------------------------------------------------------*/
33 const char *xyla_strerror(int rc)
35 /* Return the message string associated with the return code RC. */
37 static const char *const msgtab[] = {
38 #define MSG(tag, msg) msg,
44 if (XYLA_RC_LOSELIMIT <= rc && rc < XYLA_RC_WINLIMIT)
45 return (msgtab[rc - XYLA_RC_LOSELIMIT]);
47 return ("#<unknown libxyla error code>");
50 /*----- That's all, folks -------------------------------------------------*/