/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <libintl.h>
#include <locale.h>
#include <libgen.h>
#include <ctype.h>
#include <unistd.h>
#include <signal.h>
#include "genmsg.h"
extern int suppress_error; /* from main.c */
extern void warning(char *); /* from genmsg.l */
struct _SetID {
int id;
char *comment;
};
struct _MsgID {
int no_write;
int id;
char *msg;
int line;
char *file;
char *comment;
};
/* Top pointer of the setid list. */
/* comment for messages. */
static char *msg_comment;
/* comment for set numbers. */
static char *set_comment;
/* List of set number's maximum message numbers. */
/* Quote character to surround messages. */
/* Internal functions. */
static void add_setid(int, int, char *, char *, int, int);
static SetID lookup_setid(int);
static void print_prefix(FILE *, char *, int, char *);
static int is_bs_terminated(char *);
static char *ustrdup(char *);
static void makeup_msg(char **);
void
{
return; /* we already have the one. */
} else {
}
} else {
}
}
int
{
return (TRUE);
return (TRUE);
return (FALSE);
}
void
{
file);
return;
}
if (IsActiveMode(AppendMode)) {
mode = "a";
}
return;
}
if (quote) {
} else {
pquote[0] = '\0';
}
/* AppendMode is already turned off if the file doesn't exist. */
if (!IsActiveMode(AppendMode)) {
}
while (si) {
while (mi) {
continue;
}
} else {
}
}
}
if (!IsActiveMode(BackCommentMode)) {
"$ File:%s, line:%d\n",
}
}
if (IsActiveMode(DoubleLineMode)) {
}
}
if (IsActiveMode(BackCommentMode)) {
"$ File:%s, line:%d\n",
}
}
if (IsActiveMode(DoubleLineMode)) {
}
}
}
}
}
static SetID
{
while (si) {
return (si);
}
}
return (NULL);
}
static MsgID
{
while (mi) {
/* same setid & msgid, but different msg. */
"multiple messages: set number %d, message number %d\n"
" current : \"%s\"\n"
" previous: \"%s\" : \"%s\", line %d"),
msg,
}
return (mi);
}
}
return (NULL);
}
static void
{
if (msgid == 0) {
msgid);
return;
}
msgid);
return;
}
if (len > NL_TEXTMAX) {
return;
}
while (mi) {
break;
}
}
}
if (msg_comment) {
msg_comment = NULL;
} else {
}
} else {
}
}
static void
{
while (si) {
break;
}
}
}
if (set_comment) {
set_comment = NULL;
} else {
}
} else {
}
}
static void
{
while (*str) {
str++;
continue;
}
}
str++;
}
}
}
int
{
return (0);
}
return (0);
}
char *p = line;
SkipSpace(p);
if (*p == '#' || *p == '\n') {
continue;
}
if (n == 2) {
continue;
}
} else {
"warning: %s: missing or invalid entry"), file);
}
}
return (1);
}
void
{
register int i;
file);
return;
}
return;
}
for (i = 1; i <= NL_SETMAX; i++) {
if (msgid_table[i] > 0) {
if (IsActiveMode(SetCommentMode) &&
}
}
}
}
}
}
int
{
while (si) {
while (mi) {
}
}
}
}
id++;
gettext("run out of message number in set number: %d"),
setid);
return (NOMSGID);
}
}
void
{
}
}
void
{
? &msg_comment : &set_comment;
return;
}
if (*comment) {
}
}
void
{
char c = 0;
int line = 0;
return;
}
return;
}
quote = c;
/*CONSTCOND*/
while (1) {
char *ptr;
break;
}
line++;
continue;
}
setid = 0;
}
continue;
sizeof (DELSET_TOKEN) - 1) == 0) {
unsetid = -1;
}
continue;
sizeof (QUOTE_TOKEN) - 1) == 0) {
c = 0;
}
quote = c;
continue;
}
continue;
}
if (inmsg) {
if (is_bs_terminated(ptr)) {
} else {
}
}
continue;
}
char *pptr;
if (is_bs_terminated(ptr)) {
if (c && (*ptr == c)) {
ptr++;
}
} else {
if (c && ((*ptr == c) &&
ptr++;
}
}
}
}
}
static int
{
while (--len >= 0) {
continue;
len--;
return (0);
return (1);
} else {
return (0);
}
}
return (0);
}
static char *
{
}
return (tmp);
}
int
{
int c;
(void) sigemptyset(&newmask);
goto done;
}
goto done;
}
done:
return (ret);
}
static void
{
char *msg;
buf[0] = '\0';
/* there is no '%' in message. */
} else {
}
}
buf[0] = '\0';
if (IsActiveMode(PrefixMode)) {
}
buf[0] = '\0';
if (IsActiveMode(SuffixMode)) {
} else {
}
}
}
void
{
/* LINTED: E_SEC_PRINTF_VAR_FMT */
}
void
{
if (suppress_error == TRUE) {
return;
}
/* LINTED: E_SEC_PRINTF_VAR_FMT */
}