Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ new_fieldtype(3X) — DG/UX 5.4.2A

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

curses(3X)

forms(3X)



form_fieldtype(3X)               DG/UX 5.4.2              form_fieldtype(3X)


NAME
       formfieldtype:  newfieldtype, freefieldtype, setfieldtypearg,
       setfieldtypechoice, linkfieldtype - forms fieldtype routines

SYNOPSIS
       #include <form.h>

       FIELDTYPE *newfieldtype(int (* fieldcheck)(FIELD *, char *),
            int (* charcheck)(int, char *));
       int freefieldtype(FIELDTYPE *fieldtype);
       int setfieldtypearg(FIELDTYPE *fieldtype,
            char *(* makarg)(valist *),
            char *(* copyarg)(char *), void (* freearg)(char *));
       int setfieldtypechoice(FIELDTYPE *fieldtype,
            int (* nextchoice)(FIELD *, char *),
            int (* prevchoice)(FIELD *, char *));
       FIELDTYPE *linkfieldtype(FIELDTYPE *type1, FIELDTYPE *type2);

DESCRIPTION
       newfieldtype creates a new field type.  The  application  programmer
       must write the function fieldcheck, which validates the field value,
       and  the  function  charcheck,  which  validates   each   character.
       freefieldtype frees the space allocated for the field type.

       By associating function pointers with a field type, setfieldtypearg
       connects to the field  type  additional  arguments  necessary  for  a
       setfieldtype  call.  Function makarg allocates a structure for the
       field specific parameters to setfieldtype and returns a pointer  to
       the  saved  data.  Function copyarg duplicates the structure created
       by makearg.   Function  freearg  frees  any  storage  allocated  by
       makearg or copyarg.

       The  formdriver requests REQNEXTCHOICE and REQPREVCHOICE let the
       user request the next or previous value of a field type comprising an
       ordered  set  of values.  setfieldtypechoice allows the application
       programmer to implement these requests for the given field type.   It
       associates  with  the  given  field  type  those  application-defined
       functions that return pointers to the next or previous choice for the
       field.

       linkfieldtype returns a pointer to the field type built from the two
       given types.  The constituent types may be any application-defined or
       pre-defined types.

RETURN VALUE
       Routines  that return pointers always return NULL on error.  Routines
       that return an integer return one of the following:
       EOK           - The function returned successfully.
       ESYSTEMERROR - System error.
       EBADARGUMENT - An argument is incorrect.
       ECONNECTED    - Type is connected to one or more fields.

NOTES
       The header file <form.h>  automatically  includes  the  header  files



Licensed material--property of copyright holder(s)                         1




form_fieldtype(3X)               DG/UX 5.4.2              form_fieldtype(3X)


       <eti.h> and <curses.h>.

SEE ALSO
       curses(3X), forms(3X).





















































Licensed material--property of copyright holder(s)                         2


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026