/*
parted - a frontend to libparted
Copyright (C) 1999-2001, 2007, 2009-2010 Free Software Foundation,
Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "xalloc.h"
#ifdef ENABLE_NLS
#define __USE_GNU
#include <wchar.h>
#include <wctype.h>
#endif /* !ENABLE_NLS */
#include "strlist.h"
#define MIN(a,b) ( (a<b)? a : b )
int
{
#ifdef ENABLE_NLS
#else
#endif
}
{
#ifdef ENABLE_NLS
#else
#endif
}
int
{
#ifdef ENABLE_NLS
return wcscasecmp (a, b);
#else
return strcasecmp (a, b);
#endif
}
int
{
#ifdef ENABLE_NLS
return wcsncasecmp (a, b, n);
#else
return strncasecmp (a, b, n);
#endif
}
{
#ifdef ENABLE_NLS
#else
#endif
}
/* converts a string from the encoding in the gettext catalogues to wide
* character strings (of type wchar_t*).
*/
#ifdef ENABLE_NLS
static wchar_t*
{
int count;
if (!result)
goto error;
goto error;
return result;
exit (EXIT_FAILURE);
}
#else /* ENABLE_NLS */
static wchar_t*
{
}
#endif /* !ENABLE_NLS */
#ifdef ENABLE_NLS
static char*
{
char* result;
char* out_buf;
size_t i;
if (!result)
goto error;
for (i = 0; i < count; i++) {
goto error;
}
goto error;
return result;
exit (EXIT_FAILURE);
}
#else /* ENABLE_NLS */
static char*
{
char* result;
return result;
}
#endif /* !ENABLE_NLS */
static void
{
}
static StrList*
{
return list;
}
void
{
if (list) {
}
}
void
{
free (p);
}
{
return result;
}
{
if (list)
else
return NULL;
}
{
if (walk) {
return a;
} else {
return b;
}
}
static StrList*
{
if (list) {
} else {
}
return list;
}
{
}
{
return list;
}
}
}
}
{
}
{
char* str;
if (first) {
}
return list;
}
{
char* str;
if (first) {
}
return list;
}
char*
{
}
char*
{
int pos = 0;
}
}
return str;
}
void
{
}
}
static int
{
int i;
for (i=0; i<n; i++)
if (str [i] == c)
return i;
return -1;
}
/* Japanese don't leave spaces between words, so ALL Japanese characters
* are treated as delimiters. Note: since the translations should already
* be properly formatted (eg: spaces after commas), there should be no
* need to include them. Best not to avoid side effects, like 3.
14159 :-)
* FIXME: how do we exclude "." and "(" ?
* FIXME: glibc doesn't like umlaute. i.e. \"o (TeX notation), which should
* look like: �
*/
static int
{
#ifdef ENABLE_NLS
#else
#endif
}
/* NOTE: this should not return '\n' as a space, because explicit '\n' may
* be placed inside strings.
*/
static int
{
#ifdef ENABLE_NLS
#else
return c == ' ';
#endif
}
void
int indent)
{
int str_len;
int cut_right;
int cut_left;
int line_left;
int search_result;
int line_break;
continue;
line_break = 0;
/* we can have a space "over", but not a comma */
cut_left++;
cut_left--;
cut_left--;
/* str [cut_left] is either the end of a word, or a
* Japanese character, or the start of a blank line.
*/
if (search_result != -1) {
line_break = 1;
}
cut_right++);
if (cut_left > 0)
else if (line_break)
putchar ('\n');
}
print_wchar (str, 0);
}
}
static int
{
return 2;
return 1;
return 0;
}
int
{
int status;
return status;
}
/* returns: 2 for full match
1 for partial match
0 for no match
*/
int
{
int best_status = 0;
if (this_status > best_status)
}
return best_status;
}
{
int ambiguous = 0;
case 2:
case 1:
if (partial_match)
ambiguous = 1;
}
}
}
int
{
int length = 0;
length++;
return length;
}