/*--------------------------------------------------------------------------- | Facility : libnform | Function : int set_field_opts(FIELD *field, Field_Options opts) | | Description : Turns on the named options for this field and turns | off all the remaining options. | | Return Values : E_OK - success | E_CURRENT - the field is the current field | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ int set_field_opts(FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; opts &= ALL_FIELD_OPTS; if (!(opts & ~ALL_FIELD_OPTS)) res = _nc_Synchronize_Options( Normalize_Field(field), opts ); RETURN(res); }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : int field_opts_on(FIELD *field, Field_Options opts) | | Description : Turns on the named options for this field and all the | remaining options are unchanged. | | Return Values : E_OK - success | E_CURRENT - the field is the current field | E_BAD_ARGUMENT - invalid options | E_SYSTEM_ERROR - system error +--------------------------------------------------------------------------*/ int field_opts_on(FIELD * field, Field_Options opts) { int res = E_BAD_ARGUMENT; opts &= ALL_FIELD_OPTS; if (!(opts & ~ALL_FIELD_OPTS)) { Normalize_Field( field ); res = _nc_Synchronize_Options( field, field->opts | opts ); } RETURN(res); }
field_opts_off(FIELD *field, Field_Options opts) { int res = E_BAD_ARGUMENT; T((T_CALLED("field_opts_off(%p,%d)"), field, opts)); opts &= ALL_FIELD_OPTS; if (!(opts & ~ALL_FIELD_OPTS)) { Normalize_Field(field); res = _nc_Synchronize_Options(field, field->opts & ~opts); } RETURN(res); }