Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fieldtype(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

curses(S)

field(S)

form(S)

item(S)

menu(S)

panel(S)

tam(S)


 fieldtype(S)                   6 January 1993                   fieldtype(S)


 Name

    fieldtype - FIELDTYPE library routines

 Syntax


    cc  . . .  -lform -lcurses


    #include  <form.h>

    typedef int (* PTF_int) ();

    FIELDTYPE * new_fieldtype (field_check, char_check)
    PTF_int field_check;
    PTF_int char_check;

    int free_fieldtype(fieldtype);
    FIELDTYPE * fieldtype;

    typedef char * (* PTF_charP) ();
    typedef void  (* PTF_void) ();

    int set_fieldtype_arg (fieldtype, makearg, copyarg, freearg)
    FIELDTYPE * fieldtype;
    PTF_charP makearg;
    PTF_charP copyarg;
    PTF_void freearg;

    typedef char * (* PTF_charP) ();

    int set_fieldtype_choice (fieldtype, next, prev)
    FIELDTYPE * fieldtype;
    PTF_int next;
    PTF_int prev;

    int _nextchoice (FIELD * f, char * arg);
    int _prevchoice (FIELD * f, char * arg);

    FIELDTYPE * link_fieldtype (type1, type2)
    FIELDTYPE * type1;
    FIELDTYPE * type2;


 Description

    These FIELDTYPE routines run on any terminal supported by the curses(S)
    library.  Once you compile your program, sourcing the header file form.h
    with the #include statement, you should link it with the form and curses
    library routines.

 Functions

    The following is a list of FIELDTYPE routines:

    newfieldtype (fieldcheck, charcheck) creates a new field type.  You
    must write functions fieldcheck, which validates the field values, and
    charcheck, which validates each character.

    freefieldtype (fieldtype) frees the space allocated for the given field
    type.

    By associating the given function pointers with the field type,
    setfieldtypearg (fieldtype, makearg, copyarg, freearg) connects to the
    field type additional arguments necessary for a setfieldtype() call.
    Function makearg 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.

    Use REQNEXTCHOICE or REQPREVCHOICE to choose the next or previous
    value of a field type comprising an ordered set of values.
    setfieldtypechoice (fieldtype, nextchoice, prevchoice) enables you to
    implement these requests for the given field type.  It associates with
    the given field type application-defined functions that return pointers
    to the next or previous choice for the field.

    linkfieldtype (type1, type2) returns a pointer to the field type built
    from the two given types.  The constituent types may be any application-
    defined or curses-defined types.

 Diagnostics

    The following values are returned by one or more routines that return an
    integer.

    EBADARGUMENT           argument is incorrect

    EBADSTATE              called from inappropriate routine

    ECONNECTED              object is connected

    ECURRENT                field is current field

    EINVALIDFIELD          field is invalid

    EOK                     function returned successfully

    ENOTCONNECTED          object is not connected

    ENOROOM                form does not fit in subwindow

    EPOSTED                 form is posted

    EREQUESTDENIED         recognized request failed

    ESYSTEMERROR           system error

    EUNKNOWNCOMMAND        unknown command was given to the form driver


 See also

    curses(S), field(S), form(S), item(S), menu(S), panel(S), tam(S)

 Standards conformance

    fieldtype is not part of any currently supported standard; it is an
    extension of AT&T System V provided by the Santa Cruz Operation.


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