io.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 1993 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <ctype.h>
#include "wish.h"
#include "eval.h"
#include "terror.h"
#include "moremacros.h"
#define INCREMENT 1024
/* only called once in evstr.c */
int size;
{
/* ehr3 (not necessary given only call is in evstr.c)
if (iop->mu.str.val)
free(iop->mu.str.val);
*/
}
IOSTRUCT *
int flags;
char *ptr;
{
else {
if (flags & EV_READONLY)
else
}
else {
}
}
return iop;
}
{
return FAIL;
return SUCCESS;
}
unsigned pos;
{
else
return FAIL;
else
return SUCCESS;
}
/*
* CAVEAT: This routine is DESTRUCTIVE for fp's, but NOT for strings!
*/
char *
{
else
}
else {
register char *buf;
register int fd;
register int size;
long lseek();
return buf;
}
}
return NULL;
}
}
/*
* be careful not to modify this string!
* (unless, of course, you are going to io_seek to 0 right afterward)
*/
char *
{
}
else
/* not supported until we need it */
return nil;
}
{
else {
}
}
return SUCCESS;
}
{
}
else {
register int c;
return c;
}
return '\0';
}
int c;
{
}
else
return c;
}
int c;
{
{
{
}
else /* changed else clause to match putastr. abs k17 */
{
{
/*
* reallocate (needed blocks * BLOCKSIZE)
*/
}
}
** iop->mu.str.val =
** abs k17
*/
}
else
return c;
}
{
register int c;
return 0;
}
IOSTRUCT *
{
return stack;
}
IOSTRUCT *
{
return NULL;
return stack;
}
int flags;
{
int tmp;
return tmp;
}
char *
char *s;
int n;
{
register char *p;
register int c;
for (p = s; n > 1; p++) {
*s++ = c;
if (c == '\n')
break;
}
else
break;
}
if (n > 0)
*s = '\0';
return (p == s) ? NULL : s;
}
char *s;
{
{
register int len, c;
int strlen();
char *strcpy();
{
}
else
{
{
/*
* reallocate (needed blocks * BLOCKSIZE)
*/
}
}
}
else
/* original body of putastr
while (*s)
putac(*s++, iop);
*/
}