1
/* Message list test for ASCII character set.
2
Copyright (C) 2001-2002 Free Software Foundation, Inc.
3
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2, or (at your option)
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software Foundation,
17
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
25
#include "msgl-ascii.h"
30
/* This file's structure parallels msgl-iconv.c. */
34
is_ascii_string (const char *string)
36
for (; *string; string++)
37
if (!c_isascii ((unsigned char) *string))
43
is_ascii_string_list (string_list_ty *slp)
48
for (i = 0; i < slp->nitems; i++)
49
if (!is_ascii_string (slp->item[i]))
55
is_ascii_message (message_ty *mp)
57
const char *p = mp->msgstr;
58
const char *p_end = p + mp->msgstr_len;
60
for (; p < p_end; p++)
61
if (!c_isascii ((unsigned char) *p))
64
if (!is_ascii_string_list (mp->comment))
66
if (!is_ascii_string_list (mp->comment_dot))
69
/* msgid and msgid_plural are normally ASCII, so why checking?
70
Because in complete UTF-8 environments they can be UTF-8, not ASCII. */
71
if (!is_ascii_string (mp->msgid))
73
if (mp->msgid_plural != NULL && !is_ascii_string (mp->msgid_plural))
80
is_ascii_message_list (message_list_ty *mlp)
84
for (j = 0; j < mlp->nitems; j++)
85
if (!is_ascii_message (mlp->item[j]))