/****************************************************************************1* Copyright (c) 1998 Free Software Foundation, Inc. *2* *3* Permission is hereby granted, free of charge, to any person obtaining a *4* copy of this software and associated documentation files (the *5* "Software"), to deal in the Software without restriction, including *6* without limitation the rights to use, copy, modify, merge, publish, *7* distribute, distribute with modifications, sublicense, and/or sell *8* copies of the Software, and to permit persons to whom the Software is *9* furnished to do so, subject to the following conditions: *10* *11* The above copyright notice and this permission notice shall be included *12* in all copies or substantial portions of the Software. *13* *14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *15* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *16* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *17* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *18* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *19* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *20* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *21* *22* Except as contained in this notice, the name(s) of the above copyright *23* holders shall not be used in advertising or otherwise to promote the *24* sale, use or other dealings in this Software without prior written *25* authorization. *26****************************************************************************/2728/****************************************************************************29* Author: Juergen Pfeifer <[email protected]> 1995,1997 *30****************************************************************************/31#include "form.priv.h"3233MODULE_ID("$Id$")3435/*---------------------------------------------------------------------------36| Facility : libnform37| Function : int set_field_pad(FIELD *field, int ch)38|39| Description : Set the pad character used to fill the field. This must40| be a printable character.41|42| Return Values : E_OK - success43| E_BAD_ARGUMENT - invalid field pointer or pad character44| E_SYSTEM_ERROR - system error45+--------------------------------------------------------------------------*/46int set_field_pad(FIELD * field, int ch)47{48int res = E_BAD_ARGUMENT;4950Normalize_Field( field );51if (isprint((unsigned char)ch))52{53if (field->pad != ch)54{55field->pad = ch;56res = _nc_Synchronize_Attributes( field );57}58else59res = E_OK;60}61RETURN(res);62}6364/*---------------------------------------------------------------------------65| Facility : libnform66| Function : int field_pad(const FIELD *field)67|68| Description : Retrieve the fields pad character.69|70| Return Values : The pad character.71+--------------------------------------------------------------------------*/72int field_pad(const FIELD * field)73{74return Normalize_Field( field )->pad;75}7677/* fld_pad.c ends here */787980