/*
* 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 (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/* LINTLIBRARY */
#include "stdio.h"
#include "string.h"
#include "oam.h"
#include <stdlib.h>
#include <widec.h>
#include <libintl.h>
#include <locale.h>
"HALT",
"ERROR",
"WARNING",
"INFO"
};
/**
** fmtmsg()
**/
void
{
/*
* Return if the severity isn't recognized.
*/
return;
if (indent_len < tofix_len)
return;
return;
return;
}
return;
}
/**
** wrap() - PUT OUT "STUFF: string", WRAPPING string AS REQUIRED
**/
static int
{
/*
* Display the initial stuff followed by a colon.
*/
else
if (n <= 0)
return (-1);
/* Check for bogus indent_len */
if (maxlen < 1) {
return (-1);
}
/*
* Loop once for each line of the string to display.
*/
for (p = str; *p; ) {
/*
* Display the next "len" bytes of the string, where
* "len" is the smallest of:
*
* - LINE_LEN
* - # bytes before control character
* - # bytes left in string
*
*/
/* calc how many columns the string will take */
/*
* How many characters fit into our desired line length
*/
pw = p;
tmpcol = 0;
while (*pw) {
break;
else
pw++;
}
/*
* At this point, pw may point to:
* A null character: EOL found (should never happen, though)
* The character that just overruns the maxlen.
*/
if (!*pw) {
/*
* Found a EOL.
* This should never happen.
*/
goto printline;
}
/*
* Don't split words
*
* Bugid 4202307 - liblpoam in lp internal library doesn't
* handle multibyte character.
*/
while (pw > p) {
break;
} else {
pw--;
}
}
if (pw != p) {
} else {
/*
* Failed to find the best place to fold.
* So, prints as much characters as maxlen allows
*/
}
}
for (n = 0; n < len; n++, p++) {
if (iswprint(*p)) {
return (-1);
}
}
}
/*
* If we displayed up to a control character,
* put out the control character now; otherwise,
* put out a newline unless we've put out all
* the text.
*/
if (*p == L'\r' || *p == L'\n') {
while (*p == L'\r' || *p == L'\n') {
return (-1);
p++;
}
} else if (*p) {
return (-1);
}
while (iswspace(*p))
p++;
/*
* If the loop won't end this time (because we
* have more stuff to display) put out leading
* blanks to align the next line with the previous
* lines.
*/
if (*p) {
for (n = 0; n < indent_len + 2; n++)
}
}
return (1);
}