/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "streams_wide.h"
#include "streams_common.h"
#define SHELF_VACANT 0
/*
* Wide character streams implementation
*
* The wide character streams implementation is, for the most part, a
* reimplementation of the stdio streams implementation, using wide character
* string routines. However, fgetws(3C) retains the newline that fgets(3C)
* discards while reading a complete line. As a result, the wide character
* routines need to guard against coincidental exhaustion of the buffer, as
* well as overwriting the end-of-line character and correcting the
* l_data_length field.
*/
static int
{
PROT_WRITE, MAP_PRIVATE, 0);
}
if (stream_is_primed(str)) {
shelf_state == SHELF_OCCUPIED ||
return (PRIME_SUCCEEDED);
}
/*LINTED ALIGNMENT*/
str->s_buffer_size);
else {
return (PRIME_FAILED_EMPTY_FILE);
}
} else {
}
return (PRIME_SUCCEEDED);
}
static ssize_t
{
int ret_val;
if (shelf == SHELF_VACANT)
graft_pt--;
if (dist_to_buf_end <= 1) {
return (NEXT_LINE_INCOMPLETE);
}
else
}
dist_to_buf_end)) == NULL) {
} else {
}
L'\n') {
if (shelf == SHELF_OCCUPIED)
} else {
}
} else {
L'\0';
}
return (ret_val);
}
{
else
}
L'\n') {
} else {
}
}
return (NEXT_LINE_COMPLETE);
}
static void
{
}
static void
{
if (line->l_data_length >= 0) {
__S(stats_incr_puts());
} else
}
}
void
{
line->l_data_length >= 0) {
sizeof (wchar_t);
}
/* LINTED ALIGNMENT */
}
}
static int
{
int retval = 0;
return (1);
shelf == SHELF_VACANT &&
retval = 1;
}
return (retval);
}
/*ARGSUSED*/
static void
{
}
};