/****************************************************************************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****************************************************************************/3132#include "form.priv.h"3334MODULE_ID("$Id$")3536/* "Template" macro to generate function to set application specific hook */37#define GEN_HOOK_SET_FUNCTION( typ, name ) \38int set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\39{\40(Normalize_Form( form ) -> typ ## name) = func ;\41RETURN(E_OK);\42}4344/* "Template" macro to generate function to get application specific hook */45#define GEN_HOOK_GET_FUNCTION( typ, name ) \46Form_Hook typ ## _ ## name ( const FORM *form )\47{\48return ( Normalize_Form( form ) -> typ ## name );\49}5051/*---------------------------------------------------------------------------52| Facility : libnform53| Function : int set_field_init(FORM *form, Form_Hook f)54|55| Description : Assigns an application defined initialization function56| to be called when the form is posted and just after57| the current field changes.58|59| Return Values : E_OK - success60+--------------------------------------------------------------------------*/61GEN_HOOK_SET_FUNCTION(field,init)6263/*---------------------------------------------------------------------------64| Facility : libnform65| Function : Form_Hook field_init(const FORM *form)66|67| Description : Retrieve field initialization routine address.68|69| Return Values : The address or NULL if no hook defined.70+--------------------------------------------------------------------------*/71GEN_HOOK_GET_FUNCTION(field,init)7273/*---------------------------------------------------------------------------74| Facility : libnform75| Function : int set_field_term(FORM *form, Form_Hook f)76|77| Description : Assigns an application defined finalization function78| to be called when the form is unposted and just before79| the current field changes.80|81| Return Values : E_OK - success82+--------------------------------------------------------------------------*/83GEN_HOOK_SET_FUNCTION(field,term)8485/*---------------------------------------------------------------------------86| Facility : libnform87| Function : Form_Hook field_term(const FORM *form)88|89| Description : Retrieve field finalization routine address.90|91| Return Values : The address or NULL if no hook defined.92+--------------------------------------------------------------------------*/93GEN_HOOK_GET_FUNCTION(field,term)9495/*---------------------------------------------------------------------------96| Facility : libnform97| Function : int set_form_init(FORM *form, Form_Hook f)98|99| Description : Assigns an application defined initialization function100| to be called when the form is posted and just after101| a page change.102|103| Return Values : E_OK - success104+--------------------------------------------------------------------------*/105GEN_HOOK_SET_FUNCTION(form,init)106107/*---------------------------------------------------------------------------108| Facility : libnform109| Function : Form_Hook form_init(const FORM *form)110|111| Description : Retrieve form initialization routine address.112|113| Return Values : The address or NULL if no hook defined.114+--------------------------------------------------------------------------*/115GEN_HOOK_GET_FUNCTION(form,init)116117/*---------------------------------------------------------------------------118| Facility : libnform119| Function : int set_form_term(FORM *form, Form_Hook f)120|121| Description : Assigns an application defined finalization function122| to be called when the form is unposted and just before123| a page change.124|125| Return Values : E_OK - success126+--------------------------------------------------------------------------*/127GEN_HOOK_SET_FUNCTION(form,term)128129/*---------------------------------------------------------------------------130| Facility : libnform131| Function : Form_Hook form_term(const FORM *form)132|133| Description : Retrieve form finalization routine address.134|135| Return Values : The address or NULL if no hook defined.136+--------------------------------------------------------------------------*/137GEN_HOOK_GET_FUNCTION(form,term)138139/* frm_hook.c ends here */140141142