field_stat.c revision 2
1N/A/*
1N/A * CDDL HEADER START
1N/A *
1N/A * The contents of this file are subject to the terms of the
1N/A * Common Development and Distribution License, Version 1.0 only
1N/A * (the "License"). You may not use this file except in compliance
1N/A * with the License.
1N/A *
1N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1N/A * or http://www.opensolaris.org/os/licensing.
1N/A * See the License for the specific language governing permissions
1N/A * and limitations under the License.
1N/A *
1N/A * When distributing Covered Code, include this CDDL HEADER in each
1N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1N/A * If applicable, add the following below this CDDL HEADER, with the
1N/A * fields enclosed by brackets "[]" replaced with your own identifying
1N/A * information: Portions Copyright [yyyy] [name of copyright owner]
1N/A *
1N/A * CDDL HEADER END
1N/A */
1N/A/* Copyright (c) 1988 AT&T */
1N/A/* All Rights Reserved */
1N/A
1N/A
1N/A/*
1N/A * Copyright (c) 1997, by Sun Microsystems, Inc.
1N/A * All rights reserved.
1N/A */
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
1N/A
1N/A/*LINTLIBRARY*/
1N/A
1N/A#include <sys/types.h>
1N/A#include "utility.h"
1N/A
1N/Aint
1N/Aset_field_status(FIELD *f, int status)
1N/A{
1N/A f = Field(f);
1N/A
1N/A if (status)
1N/A Set(f, USR_CHG);
1N/A else
1N/A Clr(f, USR_CHG);
1N/A
1N/A return (E_OK);
1N/A}
1N/A
1N/Aint
field_status(FIELD *f)
{
/*
* field_status may not be accurate on the current field unless
* called from within the check validation function or the
* form/field init/term functions.
* field_status is always accurate on validated fields.
*/
if (Status(Field(f), USR_CHG))
return (TRUE);
else
return (FALSE);
}