strerror-punycode.c

Go to the documentation of this file.
00001 /* strerror-punycode.c --- Convert punycode errors into text.
00002  * Copyright (C) 2004  Simon Josefsson
00003  *
00004  * This file is part of GNU Libidn.
00005  *
00006  * GNU Libidn is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * GNU Libidn is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with GNU Libidn; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
00019  *
00020  */
00021 
00022 #if HAVE_CONFIG_H
00023 # include "config.h"
00024 #endif
00025 
00026 #include "punycode.h"
00027 
00028 #include "gettext.h"
00029 #define _(String) dgettext (PACKAGE, String)
00030 
00048 const char *
00049 punycode_strerror (Punycode_status rc)
00050 {
00051   const char *p;
00052 
00053   bindtextdomain (PACKAGE, LOCALEDIR);
00054 
00055   switch (rc)
00056     {
00057     case PUNYCODE_SUCCESS:
00058       p = _("Success");
00059       break;
00060 
00061     case PUNYCODE_BAD_INPUT:
00062       p = _("Invalid input");
00063       break;
00064 
00065     case PUNYCODE_BIG_OUTPUT:
00066       p = _("Output would exceed the buffer space provided");
00067       break;
00068 
00069     case PUNYCODE_OVERFLOW:
00070       p = _("String size limit exceeded");
00071       break;
00072 
00073     default:
00074       p = _("Unknown error");
00075       break;
00076     }
00077 
00078   return p;
00079 }

Generated on Wed Sep 13 10:20:31 2006 for libidn by  doxygen 1.4.7