/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "gnu_msgfmt.h"
static int
{
unsigned char c;
int dotseen;
int prevarg;
int max = 0;
int lflag;
if (*fmt == '%') {
if (*++fmt == '%')
continue;
if (!*fmt)
break;
t = 0;
if (*fmt == '$') {
fmt++;
}
if (!*fmt)
goto end;
dotseen = 0;
flag = 0;
lflag = 0;
/* Skip flags */
while ((c = *fmt) != '\0') {
if (c == '\'' || c == '+' || c == '-' ||
c == ' ' || c == '#' || c == '0') {
fmt++;
continue;
}
break;
}
fmt++;
if (*fmt == '*') {
fmt++;
t = 0;
if (*fmt == '$') {
/*
* %*4$
*/
ap = t - 1;
/* error in format */
return (-1);
} else {
}
}
/*
* If digits follow a '*', it is
* not loaded as an argument, the
* digits are used instead.
*/
} else {
/*
* %*
*/
fmt++;
} else {
/* error in format */
return (-1);
} else {
}
}
}
fmt++;
}
if (dotseen)
return (-1);
dotseen = 1;
fmt++;
goto again;
}
if (!*fmt)
goto end;
while (*fmt) {
switch (*fmt) {
case 'l':
if (lflag) {
} else {
}
}
lflag++;
break;
case 'L':
break;
case 'w':
break;
case 'h':
else
break;
case 'j':
break;
case 'z':
case 't':
}
break;
case '\'':
case '+':
case '-':
case ' ':
case '#':
case '.':
case '*':
goto again;
default:
goto again;
else
goto done;
}
fmt++;
}
done:
if (!*fmt)
goto end;
if ((c = *fmt) == 'C') {
conv = 'c';
} else if (c == 'd') {
conv = 'd';
} else if (c == 'S') {
conv = 's';
} else if (c == 's') {
conv = 's';
} else if (c == 'i') {
conv = 'i';
} else if (c == 'o') {
conv = 'o';
} else if (c == 'u') {
conv = 'u';
} else if (c == 'c') {
conv = 'c';
} else if (c == 'x') {
conv = 'x';
} else if (c == 'X') {
conv = 'X';
} else if (c == 'e') {
conv = 'e';
} else if (c == 'E') {
conv = 'E';
} else if (c == 'f') {
conv = 'f';
} else if (c == 'F') {
conv = 'F';
} else if (c == 'a') {
conv = 'a';
} else if (c == 'A') {
conv = 'A';
} else if (c == 'g') {
conv = 'g';
} else if (c == 'G') {
conv = 'G';
} else if (c == 'p') {
conv = 'p';
} else if (c == 'n') {
conv = 'n';
} else {
continue;
}
return (-1);
} else {
}
}
}
end:
return (-1);
}
return (max);
}
void
{
int i, n;
int *pstr_fmt;
char **pstr_norm;
struct loc *p;
/*
* null string: header entry
* no check is performed
*/
return;
}
/* plural */
} else {
/* no plural form */
}
/*
* First checking the newline
*/
if (!plural) {
/* no plural form */
if (id_b_newline && !str_b_newline) {
po_error++;
} else if (!id_b_newline && str_b_newline) {
po_error++;
}
if (id_e_newline && !str_e_newline) {
po_error++;
} else if (!id_e_newline && str_e_newline) {
po_error++;
}
} else {
/* plural form */
/* between msgid and msgid_plural */
if (id_b_newline && !plural_b_newline) {
po_error++;
} else if (!id_b_newline && plural_b_newline) {
po_error++;
}
if (id_e_newline && !plural_e_newline) {
po_error++;
} else if (!id_e_newline && plural_e_newline) {
po_error++;
}
if (id_b_newline && !str_b_newline) {
po_error++;
} else if (!id_b_newline && str_b_newline) {
po_error++;
}
if (id_e_newline && !str_e_newline) {
po_error++;
} else if (!id_e_newline && str_e_newline) {
po_error++;
}
}
}
/*
* if c-format is not specified, no printf-format check
* is performed.
*/
if (!is_c_format) {
return;
}
if (id_fmt == -1) {
po_error++;
}
if (!plural) {
/* no plural */
if (str_fmt == -1) {
po_error++;
}
po_error++;
} else {
for (n = 0; n < id_fmt; n++) {
if ((id_norm[n * 2] !=
str_norm[n * 2]) ||
n + 1);
po_error++;
}
}
}
return;
}
/* plural */
if (plural_fmt == -1) {
po_error++;
}
if (pstr_fmt[i] == -1) {
po_error++;
}
}
/* between msgid and msgid_plural */
if (id_fmt != plural_fmt) {
po_error++;
} else {
for (n = 0; n < id_fmt; n++) {
if ((id_norm[n * 2] !=
plural_norm[n * 2]) ||
n + 1);
po_error++;
}
}
}
/* between msgid and msgstr */
po_error++;
} else {
for (n = 0; n < id_fmt; n++) {
if ((id_norm[n * 2] !=
pstr_norm[i][n * 2]) ||
n + 1);
po_error++;
}
}
}
}
}