set_form_userptr(FORM *form, void *usrptr) { T((T_CALLED("set_form_userptr(%p,%p)"), form, usrptr)); Normalize_Form(form)->usrptr = usrptr; RETURN(E_OK); }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : int set_form_sub(FORM *form, WINDOW *win) | | Description : Set the subwindow of the form to win. | | Return Values : E_OK - success | E_POSTED - form is posted +--------------------------------------------------------------------------*/ int set_form_sub(FORM * form, WINDOW * win) { if (form && (form->status & _POSTED)) RETURN(E_POSTED); Normalize_Form( form )->sub = win; RETURN(E_OK); }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : int form_opts_on(FORM *form, Form_Options opts) | | Description : Turns on the named options; no other options are | changed. | | Return Values : E_OK - success | E_BAD_ARGUMENT - invalid options +--------------------------------------------------------------------------*/ int form_opts_on(FORM * form, Form_Options opts) { opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else { Normalize_Form( form )->opts |= opts; RETURN(E_OK); } }
form_opts_on(FORM *form, Form_Options opts) { T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts)); opts &= ALL_FORM_OPTS; if (opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else { Normalize_Form(form)->opts |= opts; RETURN(E_OK); } }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : WINDOW *form_sub(const FORM *) | | Description : Retrieve the window of the form. | | Return Values : The pointer to the Subwindow. +--------------------------------------------------------------------------*/ WINDOW *form_sub(const FORM * form) { const FORM* f = Normalize_Form( form ); return Get_Form_Window(f); }
form_userptr (const FORM * form) { return Normalize_Form(form)->usrptr; }
set_form_userptr (FORM * form, void *usrptr) { Normalize_Form(form)->usrptr = usrptr; RETURN(E_OK); }
field_count(const FORM *form) { T((T_CALLED("field_count(%p)"), (const void *)form)); returnCode(Normalize_Form(form)->maxfield); }
form_fields(const FORM *form) { T((T_CALLED("form_field(%p)"), (const void *)form)); returnFieldPtr(Normalize_Form(form)->field); }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : int form_page(const FORM * form) | | Description : Return the current page of the form. | | Return Values : >= 0 : current page number | -1 : invalid form pointer +--------------------------------------------------------------------------*/ int form_page(const FORM * form) { return Normalize_Form(form)->curpage; }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : int field_count( const FORM *form ) | | Description : Retrieve number of fields | | Return Values : Number of fields, -1 if none are defined +--------------------------------------------------------------------------*/ int field_count(const FORM * form) { return (Normalize_Form( form )->maxfield); }
form_win (const FORM * form) { const FORM* f = Normalize_Form( form ); return (f->win ? f->win : stdscr); }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : Form_Options form_opts(const FORM *) | | Description : Retrieves the current form options. | | Return Values : The option flags. +--------------------------------------------------------------------------*/ Form_Options form_opts(const FORM * form) { return (Normalize_Form(form)->opts & ALL_FORM_OPTS); }
form_page(const FORM *form) { T((T_CALLED("form_page(%p)"), form)); returnCode(Normalize_Form(form)->curpage); }
form_opts(const FORM *form) { T((T_CALLED("form_opts(%p)"), (const void *)form)); returnCode((int)(Normalize_Form(form)->opts & ALL_FORM_OPTS)); }
form_userptr(const FORM *form) { T((T_CALLED("form_userptr(%p)"), form)); returnVoidPtr(Normalize_Form(form)->usrptr); }
/*--------------------------------------------------------------------------- | Facility : libnform | Function : FIELD *current_field(const FORM * form) | | Description : Return the current field. | | Return Values : Pointer to the current field. +--------------------------------------------------------------------------*/ FIELD *current_field(const FORM * form) { return Normalize_Form(form)->current; }