/* $Id: kLdrErr.c 2955 2007-02-07 07:07:16Z bird $ */ /** @file * * kLdr - The Dynamic Loader, Error Code Methods. * * Copyright (c) 2007 knut st. osmundsen * * * This file is part of kLdr. * * kLdr is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * kLdr 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with kLdr; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /******************************************************************************* * Header Files * *******************************************************************************/ #include /** * Translate the error code into a string containing * the error constant. * * @returns Read only string with the constant name. * @param rc The error code. */ const char *kLdrErrStr(int rc) { switch (rc) { case 0: return "SUCCESS"; #define ERR_CONST(c) case c: return #c; #include "kldrErrConsts.h" #undef ERR_CONST default: break; } return "KLDR_ERR_UNKNOWN_ERROR"; }