X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=form%2Ffld_stat.c;h=62d782edd89d3a146d908505c134b573021804f9;hb=4a864172ab2e7d301d9db9e80fb4c617e3ed7b6e;hp=be265b0c1471ad6453c06a3a67d532d6487c4f6f;hpb=a8987e73ec254703634802b4f7ee30d3a485524d;p=ncurses.git diff --git a/form/fld_stat.c b/form/fld_stat.c index be265b0c..62d782ed 100644 --- a/form/fld_stat.c +++ b/form/fld_stat.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. * + * Copyright 2020,2021 Thomas E. Dickey * + * Copyright 1998-2010,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,44 +33,48 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_stat.c,v 1.9 2003/10/25 15:17:08 tom Exp $") +MODULE_ID("$Id: fld_stat.c,v 1.18 2021/06/17 21:20:30 tom Exp $") /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : int set_field_status(FIELD *field, bool status) -| +| | Description : Set or clear the 'changed' indication flag for that -| fields primary buffer. +| field's primary buffer. | | Return Values : E_OK - success +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(int) -set_field_status (FIELD * field, bool status) +FORM_EXPORT(int) +set_field_status(FIELD *field, bool status) { - Normalize_Field( field ); + T((T_CALLED("set_field_status(%p,%d)"), (void *)field, status)); + + Normalize_Field(field); if (status) - field->status |= _CHANGED; + SetStatus(field, _CHANGED); else - field->status &= ~_CHANGED; + ClrStatus(field, _CHANGED); - return(E_OK); + RETURN(E_OK); } /*--------------------------------------------------------------------------- -| Facility : libnform +| Facility : libnform | Function : bool field_status(const FIELD *field) -| +| | Description : Retrieve the value of the 'changed' indication flag -| for that fields primary buffer. +| for that field's primary buffer. | | Return Values : TRUE - buffer has been changed | FALSE - buffer has not been changed +--------------------------------------------------------------------------*/ -NCURSES_EXPORT(bool) -field_status (const FIELD * field) +FORM_EXPORT(bool) +field_status(const FIELD *field) { - return ((Normalize_Field(field)->status & _CHANGED) ? TRUE : FALSE); + T((T_CALLED("field_status(%p)"), (const void *)field)); + + returnBool((Normalize_Field(field)->status & _CHANGED) ? TRUE : FALSE); } /* fld_stat.c ends here */