getfield.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 1992 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <curses.h>
#include "token.h"
#include "wish.h"
#include "winp.h"
#include "fmacs.h"
#include "terror.h"
static char *getfixedval();
static char *getscrollval();
/*
* GETFIELD will return the contents of the current field. It is not
* stable as of yet and does not account for scrolling field.
*/
char *
char *buff;
{
if (Flags & I_INVISIBLE) {
else
}
val = getscrollval();
else
val = getfixedval();
/*
* getscrollval() and getfixedval() return NULL from
* time to time - causing calling functions to segfault.
*/
else {
}
return(fbuf);
}
static char *
{
register int row;
register char *bptr;
return(Value);
/*
* If this field does not already have a value then
* allocate space equal to the size of the field dimensions
* (Buffer is guarenteed to be at least this size if there
* already is a field value)
*/
/*
* Read the field value from the window map and eat
* trailing new-line characters
*/
*bptr++ = '\n';
}
*bptr = '\0';
return(Value);
}
static char *
{
register char *dptr;
char *dest;
return(Value);
/*
* HORIZONTAL SCROLL FIELD
*
* - syncronize the window map with the scroll buffer.
* - set Value to the result
*
*/
;
if (Value)
return(Value);
}
/*
* VERTICAL SCROLL FIELD
*
* - syncronize the window map with the scroll buffer.
* - "pack" the scoll buffer (remove trailing blanks).
* - append the remaining (unprocessed) text pointed to by Valptr.
* - eat trailing new-lines
* - set Value to the result.
*
*/
}
}
*dptr = '\0';
if (Valptr) { /* append unprocessed text */
}
if (Value)
return(Value);
}