+ improve manual pages for form field-types.
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3603 2020/12/05 21:40:07 tom Exp $
+-- $Id: NEWS,v 1.3605 2020/12/12 20:00:21 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20201212
+ + improve manual pages for form field-types.
+
20201205
+ amend build-fixes for gnat 10 to work with certain systems lacking
gprbuild (cf: 20200627).
-5:0:10 6.2 20201205
+5:0:10 6.2 20201212
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1388 2020/12/05 12:53:06 tom Exp $
+# $Id: dist.mk,v 1.1389 2020/12/12 11:43:33 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 2
-NCURSES_PATCH = 20201205
+NCURSES_PATCH = 20201212
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
the filename or entry. If <STRONG>TERMCAP</STRONG> is a full pathname to a file, only
the terminal whose name is specified in the environment variable <STRONG>TERM</STRONG>
is extracted from that file. If the environment variable <STRONG>TERMCAP</STRONG> is
- not set, then the file <STRONG>/usr/share/terminfo</STRONG> is read.
+ not set, then the file <STRONG>/usr/local/ncurses/lib/terminfo</STRONG> is read.
<STRONG>-v</STRONG> print out tracing information on standard error as the program
runs.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- /usr/share/terminfo Compiled terminal description database.
+ /usr/local/ncurses/lib/terminfo
+ Compiled terminal description database.
</PRE><H2><a name="h2-TRANSLATIONS-FROM-NONSTANDARD-CAPABILITIES">TRANSLATIONS FROM NONSTANDARD CAPABILITIES</a></H2><PRE>
PD kN XENIX key_npage
PN po XENIX prtr_off
PS pf XENIX prtr_on
- PU kP XENIX key_ppage
+ PU kP XENIX key_ppage
RT @8 XENIX kent
UP ku XENIX kcuu1
KA k; Tek key_f10
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: form.3x,v 1.35 2020/03/28 19:06:28 tom Exp @
+ * @Id: form.3x,v 1.36 2020/12/12 16:34:33 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
</PRE><H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE>
The following table lists each <STRONG>form</STRONG> routine and the name of the manual
- page on which it is described.
+ page on which it is described. Routines flagged with "*" are ncurses-
+ specific, not present in SVr4.
<STRONG>curses</STRONG> Routine Name Manual Page Name
--------------------------------------------------
field_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
field_type <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
field_userptr <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
- form_driver <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>
+ form_driver <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>
form_driver_w <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>*
form_fields <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
form_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
form_opts_off <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
form_opts_on <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
form_page <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
- form_request_by_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
- form_request_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
+ form_request_by_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>*
+ form_request_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>*
form_sub <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
form_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
form_userptr <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
set_form_win <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
set_max_field <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
set_new_page <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
- unfocus_current_field <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
+ unfocus_current_field <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>*
unpost_form <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- Routines that return pointers return <STRONG>NULL</STRONG> on error, and set <STRONG>errno</STRONG> to
- the corresponding error-code returned by functions returning an inte-
+ Routines that return pointers return <STRONG>NULL</STRONG> on error, and set <STRONG>errno</STRONG> to
+ the corresponding error-code returned by functions returning an inte-
ger. Routines that return an integer return one of the following error
codes:
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
- The header file <STRONG><form.h></STRONG> automatically includes the header files
+ The header file <STRONG><form.h></STRONG> automatically includes the header files
<STRONG><curses.h></STRONG> and <STRONG><eti.h></STRONG>.
In your library list, libform.a should be before libncurses.a; that is,
- you want to say "-lform -lncurses", not the other way around (which
+ you want to say "-lform -lncurses", not the other way around (which
would give you a link error when using static libraries).
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- These routines emulate the System V forms library. They were not sup-
+ These routines emulate the System V forms library. They were not sup-
ported on Version 7 or BSD versions.
- The menu facility was documented in SVr4.2 in <EM>Character</EM> <EM>User</EM> <EM>Interface</EM>
+ The menu facility was documented in SVr4.2 in <EM>Character</EM> <EM>User</EM> <EM>Interface</EM>
<EM>Programming</EM> <EM>(UNIX</EM> <EM>SVR4.2)</EM>.
It is not part of X/Open Curses.
<STRONG>o</STRONG> NetBSD curses.
- A few functions in this implementation are extensions added for
+ A few functions in this implementation are extensions added for
ncurses, but not provided by other implementations, e.g.,
<STRONG>form_driver_w</STRONG>, <STRONG>unfocus_current_field</STRONG>.
</PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
- Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric S.
+ Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric S.
Raymond.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for detailed
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for detailed
descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: form_field_validation.3x,v 1.27 2020/10/18 00:07:45 tom Exp @
+ * @Id: form_field_validation.3x,v 1.33 2020/12/12 19:57:55 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
<STRONG>#include</STRONG> <STRONG><form.h></STRONG>
- <STRONG>int</STRONG> <STRONG>set_field_type(FIELD</STRONG> <STRONG>*</STRONG><EM>field</EM><STRONG>,</STRONG> <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG><EM>type</EM><STRONG>,</STRONG> <STRONG>...);</STRONG>
- <STRONG>FIELDTYPE</STRONG> <STRONG>*field_type(const</STRONG> <STRONG>FIELD</STRONG> <STRONG>*</STRONG><EM>field</EM><STRONG>);</STRONG>
<STRONG>void</STRONG> <STRONG>*field_arg(const</STRONG> <STRONG>FIELD</STRONG> <STRONG>*</STRONG><EM>field</EM><STRONG>);</STRONG>
+ <STRONG>FIELDTYPE</STRONG> <STRONG>*field_type(const</STRONG> <STRONG>FIELD</STRONG> <STRONG>*</STRONG><EM>field</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>set_field_type(FIELD</STRONG> <STRONG>*</STRONG><EM>field</EM><STRONG>,</STRONG> <STRONG>FIELDTYPE</STRONG> <STRONG>*</STRONG><EM>type</EM><STRONG>,</STRONG> <STRONG>...);</STRONG>
+ /* predefined field types */
<STRONG>FIELDTYPE</STRONG> <STRONG>*TYPE_ALNUM;</STRONG>
<STRONG>FIELDTYPE</STRONG> <STRONG>*TYPE_ALPHA;</STRONG>
<STRONG>FIELDTYPE</STRONG> <STRONG>*TYPE_ENUM;</STRONG>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
- The function <STRONG>set_field_type</STRONG> declares a data type for a given form
- field. This is the type checked by validation functions. The prede-
- fined types are as follows:
+ By default, no validation is done on form fields. You can associate a
+ form with with a <EM>field</EM> <EM>type</EM>, making the form library validate input.
+
+
+</PRE><H3><a name="h3-field_arg">field_arg</a></H3><PRE>
+ Returns a pointer to the field's argument block. The <EM>argument</EM> <EM>block</EM> is
+ an opaque structure containing a copy of the arguments provided in a
+ <STRONG>set_field_type</STRONG> call.
+
+
+</PRE><H3><a name="h3-field_type">field_type</a></H3><PRE>
+ Returns a pointer to the <EM>field</EM> <EM>type</EM> associated with the form field,
+ i.e., by calling <STRONG>set_field_type</STRONG>.
+
+
+</PRE><H3><a name="h3-set_field_type">set_field_type</a></H3><PRE>
+ The function <STRONG>set_field_type</STRONG> associates a field type with a given form
+ field. This is the type checked by validation functions. Most field
+ types are configurable, via arguments which the caller provides when
+ calling <STRONG>set_field_type</STRONG>.
+
+ Several field types are predefined by the form library.
+
+
+</PRE><H3><a name="h3-Predefined-types">Predefined types</a></H3><PRE>
+ It is possible to set up new programmer-defined field types. Field
+ types are implemented via the <STRONG>FIELDTYPE</STRONG> data structure, which contains
+ several pointers to functions.
+
+ See the <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG> manual page, which describes functions which
+ can be used to construct a field-type dynamically.
+
+ The predefined types are as follows:
TYPE_ALNUM
- Alphanumeric data. Requires a third <STRONG>int</STRONG> argument, a minimum field
- width.
+ Alphanumeric data. Required parameter:
+
+ <STRONG>o</STRONG> a third <STRONG>int</STRONG> argument, a minimum field width.
TYPE_ALPHA
- Character data. Requires a third <STRONG>int</STRONG> argument, a minimum field
- width.
+ Character data. Required parameter:
+
+ <STRONG>o</STRONG> a third <STRONG>int</STRONG> argument, a minimum field width.
TYPE_ENUM
- Accept one of a specified set of strings. Requires additional
- parameters:
+ Accept one of a specified set of strings. Required parameters:
<STRONG>o</STRONG> a third <STRONG>(char</STRONG> <STRONG>**)</STRONG> argument pointing to a string list;
<STRONG>o</STRONG> a fourth <STRONG>int</STRONG> flag argument to enable case-sensitivity;
- <STRONG>o</STRONG> and a fifth <STRONG>int</STRONG> flag argument specifying whether a partial
- match must be a unique one. If this flag is off, a prefix
- matches the first of any set of more than one list elements
- with that prefix.
+ <STRONG>o</STRONG> a fifth <STRONG>int</STRONG> flag argument specifying whether a partial match
+ must be a unique one. If this flag is off, a prefix matches
+ the first of any set of more than one list elements with that
+ prefix.
- The library copies the string list, so you may use a list that
- lives in automatic variables on the stack.
+ The library copies the string list, so you may use a list that
+ lives in automatic variables on the stack.
TYPE_INTEGER
- Integer data, parsable to an integer by <STRONG>atoi(3)</STRONG>. Requires addi-
- tional parameters:
+ Integer data, parsable to an integer by <STRONG>atoi(3)</STRONG>. Required parame-
+ ters:
<STRONG>o</STRONG> a third <STRONG>int</STRONG> argument controlling the precision,
<STRONG>o</STRONG> a fourth <STRONG>long</STRONG> argument constraining minimum value,
- <STRONG>o</STRONG> and a fifth <STRONG>long</STRONG> constraining maximum value. If the maximum
- value is less than or equal to the minimum value, the range is
- simply ignored. On return, the field buffer is formatted
- according to the <STRONG>printf</STRONG> format specification ".*ld", where the
- "*" is replaced by the precision argument.
+ <STRONG>o</STRONG> a fifth <STRONG>long</STRONG> constraining maximum value. If the maximum value
+ is less than or equal to the minimum value, the range is sim-
+ ply ignored.
+
+ On return, the field buffer is formatted according to the <STRONG>printf</STRONG>
+ format specification ".*ld", where the "*" is replaced by the pre-
+ cision argument.
- For details of the precision handling see <STRONG>printf(3)</STRONG>.
+ For details of the precision handling see <STRONG>printf(3)</STRONG>.
TYPE_NUMERIC
- Numeric data (may have a decimal-point part). This requires addi-
- tional parameters:
+ Numeric data (may have a decimal-point part). Required parame-
+ ters:
<STRONG>o</STRONG> a third <STRONG>int</STRONG> argument controlling the precision,
<STRONG>o</STRONG> a fourth <STRONG>double</STRONG> argument constraining minimum value,
<STRONG>o</STRONG> and a fifth <STRONG>double</STRONG> constraining maximum value. If your system
- supports locales, the decimal point character must be the one
- specified by your locale. If the maximum value is less than
+ supports locales, the decimal point character must be the one
+ specified by your locale. If the maximum value is less than
or equal to the minimum value, the range is simply ignored.
- On return, the field buffer is formatted according to the
- <STRONG>printf</STRONG> format specification ".*f", where the "*" is replaced
- by the precision argument.
+ On return, the field buffer is formatted according to the <STRONG>printf</STRONG>
+ format specification ".*f", where the "*" is replaced by the pre-
+ cision argument.
- For details of the precision handling see <STRONG>printf(3)</STRONG>.
+ For details of the precision handling see <STRONG>printf(3)</STRONG>.
TYPE_REGEXP
- Regular expression data. Requires a regular expression <STRONG>(char</STRONG> <STRONG>*)</STRONG>
- third argument. The data is valid if the regular expression
- matches it.
+ Regular expression data. Required parameter:
+
+ <STRONG>o</STRONG> a third argument, a regular expression <STRONG>(char</STRONG> <STRONG>*)</STRONG> string. The
+ data is valid if the regular expression matches it.
Regular expressions are in the format of <STRONG>regcomp</STRONG> and <STRONG>regexec</STRONG>.
trailing spaces around the digits.
TYPE_IPV4
- An Internet Protocol Version 4 address. This requires no addi-
- tional argument. The library checks whether or not the buffer has
- the form a.b.c.d, where a,b,c and d are numbers between 0 and 255.
- Trailing blanks in the buffer are ignored. The address itself is
+ An Internet Protocol Version 4 address. Required parameter:
+
+ <STRONG>o</STRONG> none
+
+ The form library checks whether or not the buffer has the form
+ <EM>a.b.c.d</EM>, where <EM>a</EM>, <EM>b</EM>, <EM>c</EM>, and <EM>d</EM> are numbers in the range 0 to 255.
+ Trailing blanks in the buffer are ignored. The address itself is
not validated.
This is an ncurses extension; this field type may not be available
in other curses implementations.
- It is possible to set up new programmer-defined field types. See the
- <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG> manual page.
-
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
The functions <STRONG>field_type</STRONG> and <STRONG>field_arg</STRONG> return <STRONG>NULL</STRONG> on error. The func-
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>, <STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>.
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>, <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>, <STRONG><A HREF="form_variables.3x.html">form_variables(3x)</A></STRONG>.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
<ul>
<li><a href="#h2-NAME">NAME</a></li>
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
-<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
+<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
+<ul>
+<li><a href="#h3-field_arg">field_arg</a></li>
+<li><a href="#h3-field_type">field_type</a></li>
+<li><a href="#h3-set_field_type">set_field_type</a></li>
+<li><a href="#h3-Predefined-types">Predefined types</a></li>
+</ul>
+</li>
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
<li><a href="#h2-NOTES">NOTES</a></li>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: form_fieldtype.3x,v 1.23 2020/10/24 09:05:17 tom Exp @
+ * @Id: form_fieldtype.3x,v 1.28 2020/12/12 17:11:21 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
+
+</PRE><H3><a name="h3-new_fieldtype">new_fieldtype</a></H3><PRE>
The function <STRONG>new_fieldtype</STRONG> creates a new field type usable for data
- validation. You supply it with <EM>field</EM><STRONG>_</STRONG><EM>check</EM>, a predicate to check the
- validity of an entered data string whenever the user attempts to leave
- a field. The (FIELD *) argument is passed in so the validation predi-
- cate can see the field's buffer, sizes and other attributes; the second
- argument is an argument-block structure, about which more below.
+ validation. Its parameters are function pointers:
+
+ <EM>field</EM><STRONG>_</STRONG><EM>check</EM>
+ This function checks the validity of an entered data string when-
+ ever the user attempts to leave a field. It has two arguments:
+
+ <STRONG>o</STRONG> The (FIELD *) argument is passed in so the validation predi-
+ cate can see the field's buffer, sizes and other attributes.
+
+ <STRONG>o</STRONG> The second argument is an argument-block structure, about
+ which more below.
+
+ <EM>char</EM><STRONG>_</STRONG><EM>check</EM>
+ This function validates input characters as they are entered. The
+ form library passes it the character to be checked and a pointer
+ to an argument-block structure.
- You also supply <STRONG>new_fieldtype</STRONG> with <EM>char</EM><STRONG>_</STRONG><EM>check</EM>, a function to validate
- input characters as they are entered; it will be passed the character
- to be checked and a pointer to an argument-block structure.
- The function <STRONG>free_fieldtype</STRONG> frees the space allocated for a given vali-
- dation type.
+</PRE><H3><a name="h3-free_fieldtype">free_fieldtype</a></H3><PRE>
+ The <STRONG>free_fieldtype</STRONG> function frees the space allocated for a given vali-
+ dation type by <STRONG>new_fieldtype</STRONG>.
+
+</PRE><H3><a name="h3-set_fieldtype_arg">set_fieldtype_arg</a></H3><PRE>
The function <STRONG>set_fieldtype_arg</STRONG> associates three storage-management
- functions with a field type. The <EM>make</EM><STRONG>_</STRONG><EM>arg</EM> function is automatically
- applied to the list of arguments you give <STRONG>set_field_type</STRONG> when attaching
- validation to a field; its job is to bundle these into an allocated
- argument-block object which can later be passed to validation predi-
- cated. The other two hook arguments should copy and free argument-
- block structures. They will be used by the forms-driver code. You
- must supply the <EM>make</EM><STRONG>_</STRONG><EM>arg</EM> function, the other two are optional, you may
- supply NULL for them. In this case it is assumed that <EM>make</EM><STRONG>_</STRONG><EM>arg</EM> does
- not allocate memory but simply loads the argument into a single scalar
- value.
+ functions with a field type:
+
+ <EM>make</EM><STRONG>_</STRONG><EM>arg</EM>
+ This function is automatically applied to the list of arguments
+ you give <STRONG>set_field_type</STRONG> when attaching validation to a field. It
+ stores the arguments in an allocated argument-block object which
+ is used when validating input.
+
+ <EM>copy</EM><STRONG>_</STRONG><EM>arg</EM>
+ This function may be used by applications to copy argument-blocks.
+
+ <EM>free</EM><STRONG>_</STRONG><EM>arg</EM>
+ Frees an argument-block structure.
+ You must supply the <EM>make</EM><STRONG>_</STRONG><EM>arg</EM> function. The other two are optional: you
+ may supply NULL for them. In this case, the form library assumes that
+ <EM>make</EM><STRONG>_</STRONG><EM>arg</EM> does not allocate memory but simply loads the argument into a
+ single scalar value.
+
+
+</PRE><H3><a name="h3-set_fieldtype_choice">set_fieldtype_choice</a></H3><PRE>
+ The form driver requests <STRONG>REQ_NEXT_CHOICE</STRONG> and <STRONG>REQ_PREV_CHOICE</STRONG> assume
+ that the possible values of a field form an ordered set, and provide
+ the forms user with a way to move through the set.
+
+ The <STRONG>set_fieldtype_choice</STRONG> function allows forms programmers to define
+ successor and predecessor functions for the field type. These func-
+ tions take the field pointer and an argument-block structure as argu-
+ ments.
+
+
+</PRE><H3><a name="h3-link_fieldtype">link_fieldtype</a></H3><PRE>
The function <STRONG>link_fieldtype</STRONG> creates a new field type from the two given
types. They are connected by an logical 'OR'.
- The form driver requests <STRONG>REQ_NEXT_CHOICE</STRONG> and <STRONG>REQ_PREV_CHOICE</STRONG> assume
- that the possible values of a field form an ordered set, and provide
- the forms user with a way to move through the set. The <STRONG>set_field-</STRONG>
- <STRONG>type_choice</STRONG> function allows forms programmers to define successor and
- predecessor functions for the field type. These functions take the
- field pointer and an argument-block structure as arguments.
-
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
The pointer-valued routines return NULL on error. They set <STRONG>errno</STRONG>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>.
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>, <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
The header file <STRONG><form.h></STRONG> automatically includes the header file
<STRONG><curses.h></STRONG>.
- All of the <STRONG>(char</STRONG> <STRONG>*)</STRONG> arguments of these functions should actually be
- <STRONG>(void</STRONG> <STRONG>*)</STRONG>. The type has been left uncorrected for strict compatibility
- with System V.
-
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
These routines emulate the System V forms library. They were not sup-
<ul>
<li><a href="#h2-NAME">NAME</a></li>
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
-<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
+<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
+<ul>
+<li><a href="#h3-new_fieldtype">new_fieldtype</a></li>
+<li><a href="#h3-free_fieldtype">free_fieldtype</a></li>
+<li><a href="#h3-set_fieldtype_arg">set_fieldtype_arg</a></li>
+<li><a href="#h3-set_fieldtype_choice">set_fieldtype_choice</a></li>
+<li><a href="#h3-link_fieldtype">link_fieldtype</a></li>
+</ul>
+</li>
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
<li><a href="#h2-NOTES">NOTES</a></li>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: form_requestname.3x,v 1.15 2020/10/24 09:01:37 tom Exp @
+ * @Id: form_requestname.3x,v 1.16 2020/12/12 16:37:14 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
+
+</PRE><H3><a name="h3-form_request_name">form_request_name</a></H3><PRE>
The function <STRONG>form_request_name</STRONG> returns the printable name of a form
request code.
+
+
+</PRE><H3><a name="h3-form_request_name_by_name">form_request_name_by_name</a></H3><PRE>
The function <STRONG>form_request_by_name</STRONG> searches in the name-table for a
request with the given name and returns its request code. Otherwise
E_NO_MATCH is returned.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
<STRONG>form_request_name</STRONG> returns <STRONG>NULL</STRONG> on error and sets <STRONG>errno</STRONG> to <STRONG>E_BAD_ARGU-</STRONG>
<STRONG>MENT</STRONG>.
+
<STRONG>form_request_by_name</STRONG> returns <STRONG>E_NO_MATCH</STRONG> on error. It does not set
<STRONG>errno</STRONG>.
<ul>
<li><a href="#h2-NAME">NAME</a></li>
<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
-<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
+<li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
+<ul>
+<li><a href="#h3-form_request_name">form_request_name</a></li>
+<li><a href="#h3-form_request_name_by_name">form_request_name_by_name</a></li>
+</ul>
+</li>
<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
<li><a href="#h2-NOTES">NOTES</a></li>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: form_variables.3x,v 1.6 2020/02/02 23:34:34 tom Exp @
+ * @Id: form_variables.3x,v 1.7 2020/12/12 14:45:16 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
These are building blocks for the form library, defining fields that
- can be created using <STRONG><A HREF="form_fieldtype.3x.html">set_fieldtype(3x)</A></STRONG>. Each provides functions for
- field- and character-validation, according to the given datatype.
+ can be created using the <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG> functions. Each provides
+ functions for field- and character-validation, according to the given
+ datatype.
</PRE><H3><a name="h3-TYPE_ALNUM">TYPE_ALNUM</a></H3><PRE>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- The <STRONG>TYPE_IPV4</STRONG> variable is an extension not provided by older implemen-
+ The <STRONG>TYPE_IPV4</STRONG> variable is an extension not provided by older implemen-
tations of the form library.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- /usr/share/terminfo Compiled terminal description database.
+ /usr/local/ncurses/lib/terminfo
+ Compiled terminal description database.
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
https://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- /usr/share/terminfo Compiled terminal description database.
+ /usr/local/ncurses/lib/terminfo
+ Compiled terminal description database.
</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for detailed
descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
method of updating character screens with reasonable optimization.
This implementation is "new curses" (ncurses) and is the approved
replacement for 4.4BSD classic curses, which has been discontinued.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
The <STRONG>ncurses</STRONG> library emulates the curses library of System V Release 4
UNIX, and XPG4 (X/Open Portability Guide) curses (also known as XSI
standard place. For example, if <STRONG>TERM</STRONG> is set to <STRONG>att4424</STRONG>, then the com-
piled terminal definition is found in
- <STRONG>/usr/share/terminfo/a/att4424</STRONG>.
+ <STRONG>/usr/local/ncurses/lib/terminfo/a/att4424</STRONG>.
(The <STRONG>a</STRONG> is copied from the first letter of <STRONG>att4424</STRONG> to avoid creation of
huge directories.) However, if <STRONG>TERMINFO</STRONG> is set to <STRONG>$HOME/myterms</STRONG>,
and if that fails, it then checks
- <STRONG>/usr/share/terminfo/a/att4424</STRONG>.
+ <STRONG>/usr/local/ncurses/lib/terminfo/a/att4424</STRONG>.
This is useful for developing experimental definitions or when write
- permission in <STRONG>/usr/share/terminfo</STRONG> is not available.
+ permission in <STRONG>/usr/local/ncurses/lib/terminfo</STRONG> is not available.
The integer variables <STRONG>LINES</STRONG> and <STRONG>COLS</STRONG> are defined in <STRONG><curses.h></STRONG> and will
be filled in by <STRONG>initscr</STRONG> with the size of the screen. The constants
<STRONG>o</STRONG> /usr/local/ncurses/share/terminfo:/usr/share/terminfo (corre-
sponding to the TERMINFO_DIRS variable)
- <STRONG>o</STRONG> /usr/share/terminfo (corresponding to the TERMINFO variable)
+ <STRONG>o</STRONG> /usr/local/ncurses/lib/terminfo (corresponding to the TER-
+ MINFO variable)
</PRE><H3><a name="h3-TERMINFO_DIRS">TERMINFO_DIRS</a></H3><PRE>
- Specifies a list of locations to search for terminal descriptions.
- Each location in the list is a terminal database as described in the
- section on the <STRONG>TERMINFO</STRONG> variable. The list is separated by colons
+ Specifies a list of locations to search for terminal descriptions.
+ Each location in the list is a terminal database as described in the
+ section on the <STRONG>TERMINFO</STRONG> variable. The list is separated by colons
(i.e., ":") on Unix, semicolons on OS/2 EMX.
There is no corresponding feature in System V terminfo; it is an exten-
</PRE><H3><a name="h3-TERMPATH">TERMPATH</a></H3><PRE>
- If <STRONG>TERMCAP</STRONG> does not hold a file name then <STRONG>ncurses</STRONG> checks the <STRONG>TERMPATH</STRONG>
- environment variable. This is a list of filenames separated by spaces
+ If <STRONG>TERMCAP</STRONG> does not hold a file name then <STRONG>ncurses</STRONG> checks the <STRONG>TERMPATH</STRONG>
+ environment variable. This is a list of filenames separated by spaces
or colons (i.e., ":") on Unix, semicolons on OS/2 EMX.
- If the <STRONG>TERMPATH</STRONG> environment variable is not set, <STRONG>ncurses</STRONG> looks in the
+ If the <STRONG>TERMPATH</STRONG> environment variable is not set, <STRONG>ncurses</STRONG> looks in the
files
/etc/termcap, /usr/share/misc/termcap and $HOME/.termcap,
in that order.
The library may be configured to disregard the following variables when
- the current user is the superuser (root), or if the application uses
+ the current user is the superuser (root), or if the application uses
setuid or setgid permissions:
$TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
</PRE><H2><a name="h2-ALTERNATE-CONFIGURATIONS">ALTERNATE CONFIGURATIONS</a></H2><PRE>
Several different configurations are possible, depending on the config-
- ure script options used when building <STRONG>ncurses</STRONG>. There are a few main
- options whose effects are visible to the applications developer using
+ ure script options used when building <STRONG>ncurses</STRONG>. There are a few main
+ options whose effects are visible to the applications developer using
<STRONG>ncurses</STRONG>:
--disable-overwrite
<STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
- This option is used to avoid filename conflicts when <STRONG>ncurses</STRONG> is
+ This option is used to avoid filename conflicts when <STRONG>ncurses</STRONG> is
not the main implementation of curses of the computer. If <STRONG>ncurses</STRONG>
- is installed disabling overwrite, it puts its headers in a subdi-
+ is installed disabling overwrite, it puts its headers in a subdi-
rectory, e.g.,
<STRONG>#include</STRONG> <STRONG><ncurses/curses.h></STRONG>
- It also omits a symbolic link which would allow you to use
+ It also omits a symbolic link which would allow you to use
<STRONG>-lcurses</STRONG> to build executables.
--enable-widec
- The configure script renames the library and (if the <STRONG>--dis-</STRONG>
- <STRONG>able-overwrite</STRONG> option is used) puts the header files in a differ-
+ The configure script renames the library and (if the <STRONG>--dis-</STRONG>
+ <STRONG>able-overwrite</STRONG> option is used) puts the header files in a differ-
ent subdirectory. All of the library names have a "w" appended to
them, i.e., instead of
<STRONG>-lncursesw</STRONG>
- You must also enable the wide-character features in the header
- file when compiling for the wide-character library to use the
- extended (wide-character) functions. The symbol which enables
+ You must also enable the wide-character features in the header
+ file when compiling for the wide-character library to use the
+ extended (wide-character) functions. The symbol which enables
these features has changed since XSI Curses, Issue 4:
- <STRONG>o</STRONG> Originally, the wide-character feature required the symbol
+ <STRONG>o</STRONG> Originally, the wide-character feature required the symbol
<STRONG>_XOPEN_SOURCE_EXTENDED</STRONG> but that was only valid for XPG4
(1996).
- <STRONG>o</STRONG> Later, that was deemed conflicting with <STRONG>_XOPEN_SOURCE</STRONG> defined
+ <STRONG>o</STRONG> Later, that was deemed conflicting with <STRONG>_XOPEN_SOURCE</STRONG> defined
to 500.
- <STRONG>o</STRONG> As of mid-2018, none of the features in this implementation
- require a <STRONG>_XOPEN_SOURCE</STRONG> feature greater than 600. However,
+ <STRONG>o</STRONG> As of mid-2018, none of the features in this implementation
+ require a <STRONG>_XOPEN_SOURCE</STRONG> feature greater than 600. However,
X/Open Curses, Issue 7 (2009) recommends defining it to 700.
- <STRONG>o</STRONG> Alternatively, you can enable the feature by defining
- <STRONG>NCURSES_WIDECHAR</STRONG> with the caveat that some other header file
- than <STRONG>curses.h</STRONG> may require a specific value for <STRONG>_XOPEN_SOURCE</STRONG>
+ <STRONG>o</STRONG> Alternatively, you can enable the feature by defining
+ <STRONG>NCURSES_WIDECHAR</STRONG> with the caveat that some other header file
+ than <STRONG>curses.h</STRONG> may require a specific value for <STRONG>_XOPEN_SOURCE</STRONG>
(or a system-specific symbol).
- The <STRONG>curses.h</STRONG> file which is installed for the wide-character
- library is designed to be compatible with the normal library's
- header. Only the size of the <STRONG>WINDOW</STRONG> structure differs, and very
+ The <STRONG>curses.h</STRONG> file which is installed for the wide-character
+ library is designed to be compatible with the normal library's
+ header. Only the size of the <STRONG>WINDOW</STRONG> structure differs, and very
few applications require more than a pointer to <STRONG>WINDOW</STRONG>s.
- If the headers are installed allowing overwrite, the wide-charac-
- ter library's headers should be installed last, to allow applica-
- tions to be built using either library from the same set of head-
+ If the headers are installed allowing overwrite, the wide-charac-
+ ter library's headers should be installed last, to allow applica-
+ tions to be built using either library from the same set of head-
ers.
--with-pthread
- The configure script renames the library. All of the library
- names have a "t" appended to them (before any "w" added by
+ The configure script renames the library. All of the library
+ names have a "t" appended to them (before any "w" added by
<STRONG>--enable-widec</STRONG>).
The global variables such as <STRONG>LINES</STRONG> are replaced by macros to allow
read-only access. At the same time, setter-functions are provided
- to set these values. Some applications (very few) may require
+ to set these values. Some applications (very few) may require
changes to work with this convention.
--with-shared
--with-debug
--with-profile
- The shared and normal (static) library names differ by their suf-
- fixes, e.g., <STRONG>libncurses.so</STRONG> and <STRONG>libncurses.a</STRONG>. The debug and pro-
- filing libraries add a "_g" and a "_p" to the root names respec-
+ The shared and normal (static) library names differ by their suf-
+ fixes, e.g., <STRONG>libncurses.so</STRONG> and <STRONG>libncurses.a</STRONG>. The debug and pro-
+ filing libraries add a "_g" and a "_p" to the root names respec-
tively, e.g., <STRONG>libncurses_g.a</STRONG> and <STRONG>libncurses_p.a</STRONG>.
--with-termlib
- Low-level functions which do not depend upon whether the library
+ Low-level functions which do not depend upon whether the library
supports wide-characters, are provided in the tinfo library.
- By doing this, it is possible to share the tinfo library between
- wide/normal configurations as well as reduce the size of the
+ By doing this, it is possible to share the tinfo library between
+ wide/normal configurations as well as reduce the size of the
library when only low-level functions are needed.
Those functions are described in these pages:
<STRONG>o</STRONG> <STRONG><A HREF="curs_util.3x.html">curs_util(3x)</A></STRONG> - miscellaneous <STRONG>curses</STRONG> utility routines
--with-trace
- The <STRONG>trace</STRONG> function normally resides in the debug library, but it
+ The <STRONG>trace</STRONG> function normally resides in the debug library, but it
is sometimes useful to configure this in the shared library. Con-
- figure scripts should check for the function's existence rather
+ figure scripts should check for the function's existence rather
than assuming it is always in the debug library.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
/usr/share/tabset
- directory containing initialization files for the terminal capa-
- bility database /usr/share/terminfo terminal capability database
+ directory containing initialization files for the terminal capa-
+ bility database /usr/local/ncurses/lib/terminfo terminal capabil-
+ ity database
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG>--terminfo</STRONG>
echos the $TERMINFO terminfo database path, e.g.,
- /usr/share/terminfo
+ /usr/local/ncurses/lib/terminfo
<STRONG>--terminfo-dirs</STRONG>
echos the $TERMINFO_DIRS directory list, e.g.,
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H3><a name="h3-STORAGE-LOCATION">STORAGE LOCATION</a></H3><PRE>
Compiled terminfo descriptions are placed under the directory
- <STRONG>/usr/share/terminfo</STRONG>. Two configurations are supported (when building
- the <STRONG>ncurses</STRONG> libraries):
+ <STRONG>/usr/local/ncurses/lib/terminfo</STRONG>. Two configurations are supported
+ (when building the <STRONG>ncurses</STRONG> libraries):
<STRONG>directory</STRONG> <STRONG>tree</STRONG>
A two-level scheme is used to avoid a linear search of a huge UNIX
- system directory: <STRONG>/usr/share/terminfo/c/name</STRONG> where <EM>name</EM> is the
- name of the terminal, and <EM>c</EM> is the first character of <EM>name</EM>. Thus,
- <EM>act4</EM> can be found in the file <STRONG>/usr/share/terminfo/a/act4</STRONG>. Syn-
- onyms for the same terminal are implemented by multiple links to
- the same compiled file.
+ system directory: <STRONG>/usr/local/ncurses/lib/terminfo/c/name</STRONG> where
+ <EM>name</EM> is the name of the terminal, and <EM>c</EM> is the first character of
+ <EM>name</EM>. Thus, <EM>act4</EM> can be found in the file
+ <STRONG>/usr/local/ncurses/lib/terminfo/a/act4</STRONG>. Synonyms for the same
+ terminal are implemented by multiple links to the same compiled
+ file.
<STRONG>hashed</STRONG> <STRONG>database</STRONG>
Using Berkeley database, two types of records are stored: the ter-
- minfo data in the same format as stored in a directory tree with
- the terminfo's primary name as a key, and records containing only
+ minfo data in the same format as stored in a directory tree with
+ the terminfo's primary name as a key, and records containing only
aliases pointing to the primary name.
- If built to write hashed databases, <STRONG>ncurses</STRONG> can still read ter-
- minfo databases organized as a directory tree, but cannot write
- entries into the directory tree. It can write (or rewrite)
+ If built to write hashed databases, <STRONG>ncurses</STRONG> can still read ter-
+ minfo databases organized as a directory tree, but cannot write
+ entries into the directory tree. It can write (or rewrite)
entries in the hashed database.
- <STRONG>ncurses</STRONG> distinguishes the two cases in the TERMINFO and TER-
- MINFO_DIRS environment variable by assuming a directory tree for
+ <STRONG>ncurses</STRONG> distinguishes the two cases in the TERMINFO and TER-
+ MINFO_DIRS environment variable by assuming a directory tree for
entries that correspond to an existing directory, and hashed data-
base otherwise.
</PRE><H3><a name="h3-LEGACY-STORAGE-FORMAT">LEGACY STORAGE FORMAT</a></H3><PRE>
The format has been chosen so that it will be the same on all hardware.
- An 8 or more bit byte is assumed, but no assumptions about byte order-
+ An 8 or more bit byte is assumed, but no assumptions about byte order-
ing or sign extension are made.
The compiled file is created with the <STRONG>tic</STRONG> program, and read by the rou-
f) <EM>string</EM> <EM>table</EM>.
- The <EM>header</EM> section begins the file. This section contains six short
+ The <EM>header</EM> section begins the file. This section contains six short
integers in the format described below. These integers are
(1) the <EM>magic</EM> <EM>number</EM> (octal 0432);
(6) the size, in bytes, of the <EM>string</EM> <EM>table</EM>.
- The capabilities in the <EM>boolean</EM> <EM>flags</EM>, <EM>numbers</EM>, and <EM>strings</EM> sections
+ The capabilities in the <EM>boolean</EM> <EM>flags</EM>, <EM>numbers</EM>, and <EM>strings</EM> sections
are in the same order as the file <term.h>.
- Short integers are signed, in the range -32768 to 32767. They are
- stored as two 8-bit bytes. The first byte contains the least signifi-
+ Short integers are signed, in the range -32768 to 32767. They are
+ stored as two 8-bit bytes. The first byte contains the least signifi-
cant 8 bits of the value, and the second byte contains the most signif-
icant 8 bits. (Thus, the value represented is 256*second+first.) This
format corresponds to the hardware of the VAX and PDP-11 (that is, lit-
- tle-endian machines). Machines where this does not correspond to the
- hardware must read the integers as two bytes and compute the little-
+ tle-endian machines). Machines where this does not correspond to the
+ hardware must read the integers as two bytes and compute the little-
endian value.
Numbers in a terminal description, whether they are entries in the <EM>num-</EM>
- <EM>bers</EM> or <EM>strings</EM> table, are positive integers. Boolean flags are
- treated as positive one-byte integers. In each case, those positive
- integers represent a terminal capability. The terminal compiler tic
- uses negative integers to handle the cases where a capability is not
+ <EM>bers</EM> or <EM>strings</EM> table, are positive integers. Boolean flags are
+ treated as positive one-byte integers. In each case, those positive
+ integers represent a terminal capability. The terminal compiler tic
+ uses negative integers to handle the cases where a capability is not
available:
- <STRONG>o</STRONG> If a capability is absent from this terminal, tic stores a -1 in
+ <STRONG>o</STRONG> If a capability is absent from this terminal, tic stores a -1 in
the corresponding table.
The integer value -1 is represented by two bytes 0377, 0377.
Absent boolean values are represented by the byte 0 (false).
- <STRONG>o</STRONG> If a capability has been canceled from this terminal, tic stores a
+ <STRONG>o</STRONG> If a capability has been canceled from this terminal, tic stores a
-2 in the corresponding table.
The integer value -2 is represented by two bytes 0377, 0376.
<STRONG>o</STRONG> Other negative values are illegal.
- The <EM>terminal</EM> <EM>names</EM> section comes after the <EM>header</EM>. It contains the
- first line of the terminfo description, listing the various names for
- the terminal, separated by the "|" character. The <EM>terminal</EM> <EM>names</EM> sec-
+ The <EM>terminal</EM> <EM>names</EM> section comes after the <EM>header</EM>. It contains the
+ first line of the terminfo description, listing the various names for
+ the terminal, separated by the "|" character. The <EM>terminal</EM> <EM>names</EM> sec-
tion is terminated with an ASCII NUL character.
The <EM>boolean</EM> <EM>flags</EM> section has one byte for each flag. Boolean capabil-
ities are either 1 or 0 (true or false) according to whether the termi-
nal supports the given capability or not.
- Between the <EM>boolean</EM> <EM>flags</EM> section and the <EM>number</EM> section, a null byte
- will be inserted, if necessary, to ensure that the <EM>number</EM> section
- begins on an even byte This is a relic of the PDP-11's word-addressed
- architecture, originally designed to avoid traps induced by addressing
- a word on an odd byte boundary. All short integers are aligned on a
+ Between the <EM>boolean</EM> <EM>flags</EM> section and the <EM>number</EM> section, a null byte
+ will be inserted, if necessary, to ensure that the <EM>number</EM> section
+ begins on an even byte This is a relic of the PDP-11's word-addressed
+ architecture, originally designed to avoid traps induced by addressing
+ a word on an odd byte boundary. All short integers are aligned on a
short word boundary.
- The <EM>numbers</EM> section is similar to the <EM>boolean</EM> <EM>flags</EM> section. Each
- capability takes up two bytes, and is stored as a little-endian short
+ The <EM>numbers</EM> section is similar to the <EM>boolean</EM> <EM>flags</EM> section. Each
+ capability takes up two bytes, and is stored as a little-endian short
integer.
- The <EM>strings</EM> section is also similar. Each capability is stored as a
+ The <EM>strings</EM> section is also similar. Each capability is stored as a
short integer. The capability value is an index into the <EM>string</EM> <EM>table</EM>.
The <EM>string</EM> <EM>table</EM> is the last section. It contains all of the values of
- string capabilities referenced in the <EM>strings</EM> section. Each string is
+ string capabilities referenced in the <EM>strings</EM> section. Each string is
null-terminated. Special characters in ^X or \c notation are stored in
- their interpreted form, not the printing representation. Padding
- information $<nn> and parameter information %x are stored intact in
+ their interpreted form, not the printing representation. Padding
+ information $<nn> and parameter information %x are stored intact in
uninterpreted form.
</PRE><H3><a name="h3-EXTENDED-STORAGE-FORMAT">EXTENDED STORAGE FORMAT</a></H3><PRE>
The previous section describes the conventional terminfo binary format.
- With some minor variations of the offsets (see PORTABILITY), the same
- binary format is used in all modern UNIX systems. Each system uses a
+ With some minor variations of the offsets (see PORTABILITY), the same
+ binary format is used in all modern UNIX systems. Each system uses a
predefined set of boolean, number or string capabilities.
The <STRONG>ncurses</STRONG> libraries and applications support extended terminfo binary
- format, allowing users to define capabilities which are loaded at run-
+ format, allowing users to define capabilities which are loaded at run-
time. This extension is made possible by using the fact that the other
- implementations stop reading the terminfo data when they have reached
- the end of the size given in the header. <STRONG>ncurses</STRONG> checks the size, and
- if it exceeds that due to the predefined data, continues to parse
+ implementations stop reading the terminfo data when they have reached
+ the end of the size given in the header. <STRONG>ncurses</STRONG> checks the size, and
+ if it exceeds that due to the predefined data, continues to parse
according to its own scheme.
First, it reads the extended header (5 short integers):
(5) size of the extended string table in bytes
- The count- and size-values for the extended string table include the
+ The count- and size-values for the extended string table include the
extended capability <EM>names</EM> as well as extended capability <EM>values</EM>.
Using the counts and sizes, <STRONG>ncurses</STRONG> allocates arrays and reads data for
the extended capabilities in the same order as the header information.
- The extended string table contains values for string capabilities.
- After the end of these values, it contains the names for each of the
- extended capabilities in order, e.g., booleans, then numbers and
+ The extended string table contains values for string capabilities.
+ After the end of these values, it contains the names for each of the
+ extended capabilities in order, e.g., booleans, then numbers and
finally strings.
- Applications which manipulate terminal data can use the definitions
- described in <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG> which associate the long capability
+ Applications which manipulate terminal data can use the definitions
+ described in <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG> which associate the long capability
names with members of a <STRONG>TERMTYPE</STRONG> structure.
</PRE><H3><a name="h3-EXTENDED-NUMBER-FORMAT">EXTENDED NUMBER FORMAT</a></H3><PRE>
On occasion, 16-bit signed integers are not large enough. With <STRONG>ncurses</STRONG>
- 6.1, a new format was introduced by making a few changes to the legacy
+ 6.1, a new format was introduced by making a few changes to the legacy
format:
<STRONG>o</STRONG> a different magic number (octal 01036)
- <STRONG>o</STRONG> changing the type for the <EM>number</EM> array from signed 16-bit integers
+ <STRONG>o</STRONG> changing the type for the <EM>number</EM> array from signed 16-bit integers
to signed 32-bit integers.
- To maintain compatibility, the library presents the same data struc-
+ To maintain compatibility, the library presents the same data struc-
tures to direct users of the <STRONG>TERMTYPE</STRONG> structure as in previous formats.
- However, that cannot provide callers with the extended numbers. The
- library uses a similar but hidden data structure <STRONG>TERMTYPE2</STRONG> to provide
+ However, that cannot provide callers with the extended numbers. The
+ library uses a similar but hidden data structure <STRONG>TERMTYPE2</STRONG> to provide
data for the terminfo functions.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
</PRE><H3><a name="h3-setupterm">setupterm</a></H3><PRE>
- Note that it is possible for <STRONG>setupterm</STRONG> to expect a different set of
- capabilities than are actually present in the file. Either the data-
+ Note that it is possible for <STRONG>setupterm</STRONG> to expect a different set of
+ capabilities than are actually present in the file. Either the data-
base may have been updated since <STRONG>setupterm</STRONG> has been recompiled (result-
- ing in extra unrecognized entries in the file) or the program may have
- been recompiled more recently than the database was updated (resulting
- in missing entries). The routine <STRONG>setupterm</STRONG> must be prepared for both
- possibilities - this is why the numbers and sizes are included. Also,
- new capabilities must always be added at the end of the lists of bool-
+ ing in extra unrecognized entries in the file) or the program may have
+ been recompiled more recently than the database was updated (resulting
+ in missing entries). The routine <STRONG>setupterm</STRONG> must be prepared for both
+ possibilities - this is why the numbers and sizes are included. Also,
+ new capabilities must always be added at the end of the lists of bool-
ean, number, and string capabilities.
</PRE><H3><a name="h3-Binary-format">Binary format</a></H3><PRE>
- X/Open Curses does not specify a format for the terminfo database.
- UNIX System V curses used a directory-tree of binary files, one per
+ X/Open Curses does not specify a format for the terminfo database.
+ UNIX System V curses used a directory-tree of binary files, one per
terminal description.
- Despite the consistent use of little-endian for numbers and the other-
- wise self-describing format, it is not wise to count on portability of
- binary terminfo entries between commercial UNIX versions. The problem
- is that there are at least three versions of terminfo (under HP-UX,
- AIX, and OSF/1) which diverged from System V terminfo after SVr1, and
- have added extension capabilities to the string table that (in the
- binary format) collide with System V and XSI Curses extensions. See
- <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for detailed discussion of terminfo source compatibility
+ Despite the consistent use of little-endian for numbers and the other-
+ wise self-describing format, it is not wise to count on portability of
+ binary terminfo entries between commercial UNIX versions. The problem
+ is that there are at least three versions of terminfo (under HP-UX,
+ AIX, and OSF/1) which diverged from System V terminfo after SVr1, and
+ have added extension capabilities to the string table that (in the
+ binary format) collide with System V and XSI Curses extensions. See
+ <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for detailed discussion of terminfo source compatibility
issues.
- This implementation is by default compatible with the binary terminfo
- format used by Solaris curses, except in a few less-used details where
- it was found that the latter did not match X/Open Curses. The format
+ This implementation is by default compatible with the binary terminfo
+ format used by Solaris curses, except in a few less-used details where
+ it was found that the latter did not match X/Open Curses. The format
used by the other Unix versions can be matched by building ncurses with
different configuration options.
</PRE><H3><a name="h3-Magic-codes">Magic codes</a></H3><PRE>
- The magic number in a binary terminfo file is the first 16-bits (two
- bytes). Besides making it more reliable for the library to check that
- a file is terminfo, utilities such as <STRONG>file</STRONG> also use that to tell what
- the file-format is. System V defined more than one magic number, with
+ The magic number in a binary terminfo file is the first 16-bits (two
+ bytes). Besides making it more reliable for the library to check that
+ a file is terminfo, utilities such as <STRONG>file</STRONG> also use that to tell what
+ the file-format is. System V defined more than one magic number, with
0433, 0435 as screen-dumps (see <STRONG><A HREF="scr_dump.5.html">scr_dump(5)</A></STRONG>). This implementation uses
- 01036 as a continuation of that sequence, but with a different high-
+ 01036 as a continuation of that sequence, but with a different high-
order byte to avoid confusion.
</PRE><H3><a name="h3-The-TERMTYPE-structure">The TERMTYPE structure</a></H3><PRE>
Direct access to the <STRONG>TERMTYPE</STRONG> structure is provided for legacy applica-
- tions. Portable applications should use the <STRONG>tigetflag</STRONG> and related
+ tions. Portable applications should use the <STRONG>tigetflag</STRONG> and related
functions described in <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> for reading terminal capabili-
ties.
</PRE><H3><a name="h3-Mixed-case-terminal-names">Mixed-case terminal names</a></H3><PRE>
- A small number of terminal descriptions use uppercase characters in
- their names. If the underlying filesystem ignores the difference
- between uppercase and lowercase, <STRONG>ncurses</STRONG> represents the "first charac-
+ A small number of terminal descriptions use uppercase characters in
+ their names. If the underlying filesystem ignores the difference
+ between uppercase and lowercase, <STRONG>ncurses</STRONG> represents the "first charac-
ter" of the terminal name used as the intermediate level of a directory
tree in (two-character) hexadecimal form.
</PRE><H2><a name="h2-LIMITS">LIMITS</a></H2><PRE>
Some limitations:
- <STRONG>o</STRONG> total compiled entries cannot exceed 4096 bytes in the legacy for-
+ <STRONG>o</STRONG> total compiled entries cannot exceed 4096 bytes in the legacy for-
mat.
- <STRONG>o</STRONG> total compiled entries cannot exceed 32768 bytes in the extended
+ <STRONG>o</STRONG> total compiled entries cannot exceed 32768 bytes in the extended
format.
<STRONG>o</STRONG> the name field cannot exceed 128 bytes.
- Compiled entries are limited to 32768 bytes because offsets into the
+ Compiled entries are limited to 32768 bytes because offsets into the
<EM>strings</EM> <EM>table</EM> use two-byte integers. The legacy format could have sup-
ported 32768-byte entries, but was limited a virtual memory page's 4096
bytes.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- /usr/share/terminfo/*/* compiled terminal capability data base
+ /usr/local/ncurses/lib/terminfo/*/* compiled terminal capability
+ data base
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
line.
Terminal type descriptions are stored as files of capability data
- underneath /usr/share/terminfo. To browse a list of all terminal names
- recognized by the system, do
+ underneath /usr/local/ncurses/lib/terminfo. To browse a list of all
+ terminal names recognized by the system, do
toe | more
infocmp <EM>entry</EM><STRONG>_</STRONG><EM>name</EM>
where <EM>entry</EM><STRONG>_</STRONG><EM>name</EM> is the name of the type you wish to examine (and the
- name of its capability file the subdirectory of /usr/share/terminfo
- named for its first letter). This command dumps a capability file in
- the text format described by <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
+ name of its capability file the subdirectory of
+ /usr/local/ncurses/lib/terminfo named for its first letter). This com-
+ mand dumps a capability file in the text format described by <STRONG>ter-</STRONG>
+ <STRONG><A HREF="terminfo.5.html">minfo(5)</A></STRONG>.
- The first line of a <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> description gives the names by which
- terminfo knows a terminal, separated by "|" (pipe-bar) characters with
+ The first line of a <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> description gives the names by which
+ terminfo knows a terminal, separated by "|" (pipe-bar) characters with
the last name field terminated by a comma. The first name field is the
type's <EM>primary</EM> <EM>name</EM>, and is the one to use when setting <STRONG>TERM</STRONG>. The last
- name field (if distinct from the first) is actually a description of
- the terminal type (it may contain blanks; the others must be single
- words). Name fields between the first and last (if present) are
+ name field (if distinct from the first) is actually a description of
+ the terminal type (it may contain blanks; the others must be single
+ words). Name fields between the first and last (if present) are
aliases for the terminal, usually historical names retained for compat-
ibility.
- There are some conventions for how to choose terminal primary names
- that help keep them informative and unique. Here is a step-by-step
+ There are some conventions for how to choose terminal primary names
+ that help keep them informative and unique. Here is a step-by-step
guide to naming terminals that also explains how to parse them:
- First, choose a root name. The root will consist of a lower-case let-
- ter followed by up to seven lower-case letters or digits. You need to
+ First, choose a root name. The root will consist of a lower-case let-
+ ter followed by up to seven lower-case letters or digits. You need to
avoid using punctuation characters in root names, because they are used
- and interpreted as filenames and shell meta-characters (such as !, $,
+ and interpreted as filenames and shell meta-characters (such as !, $,
*, ?, etc.) embedded in them may cause odd and unhelpful behavior. The
- slash (/), or any other character that may be interpreted by anyone's
- file system (\, $, [, ]), is especially dangerous (terminfo is plat-
- form-independent, and choosing names with special characters could
- someday make life difficult for users of a future port). The dot (.)
- character is relatively safe as long as there is at most one per root
+ slash (/), or any other character that may be interpreted by anyone's
+ file system (\, $, [, ]), is especially dangerous (terminfo is plat-
+ form-independent, and choosing names with special characters could
+ someday make life difficult for users of a future port). The dot (.)
+ character is relatively safe as long as there is at most one per root
name; some historical terminfo names use it.
- The root name for a terminal or workstation console type should almost
- always begin with a vendor prefix (such as <STRONG>hp</STRONG> for Hewlett-Packard, <STRONG>wy</STRONG>
- for Wyse, or <STRONG>att</STRONG> for AT&T terminals), or a common name of the terminal
- line (<STRONG>vt</STRONG> for the VT series of terminals from DEC, or <STRONG>sun</STRONG> for Sun
- Microsystems workstation consoles, or <STRONG>regent</STRONG> for the ADDS Regent
- series. You can list the terminfo tree to see what prefixes are
- already in common use. The root name prefix should be followed when
+ The root name for a terminal or workstation console type should almost
+ always begin with a vendor prefix (such as <STRONG>hp</STRONG> for Hewlett-Packard, <STRONG>wy</STRONG>
+ for Wyse, or <STRONG>att</STRONG> for AT&T terminals), or a common name of the terminal
+ line (<STRONG>vt</STRONG> for the VT series of terminals from DEC, or <STRONG>sun</STRONG> for Sun
+ Microsystems workstation consoles, or <STRONG>regent</STRONG> for the ADDS Regent
+ series. You can list the terminfo tree to see what prefixes are
+ already in common use. The root name prefix should be followed when
appropriate by a model number; thus <STRONG>vt100</STRONG>, <STRONG>hp2621</STRONG>, <STRONG>wy50</STRONG>.
- The root name for a PC-Unix console type should be the OS name, i.e.,
- <STRONG>linux</STRONG>, <STRONG>bsdos</STRONG>, <STRONG>freebsd</STRONG>, <STRONG>netbsd</STRONG>. It should <EM>not</EM> be <STRONG>console</STRONG> or any other
+ The root name for a PC-Unix console type should be the OS name, i.e.,
+ <STRONG>linux</STRONG>, <STRONG>bsdos</STRONG>, <STRONG>freebsd</STRONG>, <STRONG>netbsd</STRONG>. It should <EM>not</EM> be <STRONG>console</STRONG> or any other
generic that might cause confusion in a multi-platform environment! If
- a model number follows, it should indicate either the OS release level
+ a model number follows, it should indicate either the OS release level
or the console driver release level.
- The root name for a terminal emulator (assuming it does not fit one of
+ The root name for a terminal emulator (assuming it does not fit one of
the standard ANSI or vt100 types) should be the program name or a read-
ily recognizable abbreviation of it (i.e., <STRONG>versaterm</STRONG>, <STRONG>ctrm</STRONG>).
- Following the root name, you may add any reasonable number of hyphen-
+ Following the root name, you may add any reasonable number of hyphen-
separated feature suffixes.
2p Has two pages of memory. Likewise 4p, 8p, etc.
- mc Magic-cookie. Some terminals (notably older Wyses) can only sup-
+ mc Magic-cookie. Some terminals (notably older Wyses) can only sup-
port one attribute without magic-cookie lossage. Their base entry
is usually paired with another that has this suffix and uses magic
cookies to support multiple attributes.
-m Mono mode - suppress color support.
- -na No arrow keys - termcap ignores arrow keys which are actually
+ -na No arrow keys - termcap ignores arrow keys which are actually
there on the terminal, so the user can use the arrow keys locally.
-nam No auto-margin - suppress am capability.
-w Wide; terminal is in 132-column mode.
- Conventionally, if your terminal type is a variant intended to specify
- a line height, that suffix should go first. So, for a hypothetical
- FuBarCo model 2317 terminal in 30-line mode with reverse video, best
+ Conventionally, if your terminal type is a variant intended to specify
+ a line height, that suffix should go first. So, for a hypothetical
+ FuBarCo model 2317 terminal in 30-line mode with reverse video, best
form would be <STRONG>fubar-30-rv</STRONG> (rather than, say, "fubar-rv-30").
- Terminal types that are written not as standalone entries, but rather
- as components to be plugged into other entries via <STRONG>use</STRONG> capabilities,
+ Terminal types that are written not as standalone entries, but rather
+ as components to be plugged into other entries via <STRONG>use</STRONG> capabilities,
are distinguished by using embedded plus signs rather than dashes.
Commands which use a terminal type to control display often accept a -T
- option that accepts a terminal name argument. Such programs should
- fall back on the <STRONG>TERM</STRONG> environment variable when no -T option is speci-
+ option that accepts a terminal name argument. Such programs should
+ fall back on the <STRONG>TERM</STRONG> environment variable when no -T option is speci-
fied.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- /usr/share/terminfo/?/*
+ /usr/local/ncurses/lib/terminfo/?/*
compiled terminal capability data base
/etc/inittab
</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
- /usr/share/terminfo/*/*
+ /usr/local/ncurses/lib/terminfo/*/*
</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
have, by specifying how to perform screen operations, and by specifying
padding requirements and initialization sequences.
- This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
An empty directory name (i.e., if the variable begins or ends with
a colon, or contains adjacent colons) is interpreted as the system
- location <EM>/usr/share/terminfo</EM>.
+ location <EM>/usr/local/ncurses/lib/terminfo</EM>.
<STRONG>o</STRONG> Finally, <STRONG>ncurses</STRONG> searches these compiled-in locations:
<STRONG>o</STRONG> a list of directories (/usr/local/ncurses/share/ter-
minfo:/usr/share/terminfo), and
- <STRONG>o</STRONG> the system terminfo directory, <EM>/usr/share/terminfo</EM> (the com-
- piled-in default).
+ <STRONG>o</STRONG> the system terminfo directory, <EM>/usr/local/ncurses/lib/terminfo</EM>
+ (the compiled-in default).
</PRE><H3><a name="h3-Preparing-Descriptions">Preparing Descriptions</a></H3><PRE>
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- /usr/share/terminfo/?/* files containing terminal descriptions
+ /usr/local/ncurses/lib/terminfo/?/*
+ files containing terminal descriptions
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
minfo" leaf, versus a "terminfo.db" file.
The results are normally placed in the system terminfo database
- <STRONG>/usr/share/terminfo</STRONG>. The compiled terminal description can be placed
- in a different terminfo database. There are two ways to achieve this:
+ <STRONG>/usr/local/ncurses/lib/terminfo</STRONG>. The compiled terminal description can
+ be placed in a different terminfo database. There are two ways to
+ achieve this:
- <STRONG>o</STRONG> First, you may override the system default either by using the <STRONG>-o</STRONG>
- option, or by setting the variable <STRONG>TERMINFO</STRONG> in your shell environ-
+ <STRONG>o</STRONG> First, you may override the system default either by using the <STRONG>-o</STRONG>
+ option, or by setting the variable <STRONG>TERMINFO</STRONG> in your shell environ-
ment to a valid database location.
- <STRONG>o</STRONG> Secondly, if <STRONG>tic</STRONG> cannot write in <EM>/usr/share/terminfo</EM> or the loca-
- tion specified using your TERMINFO variable, it looks for the
- directory <EM>$HOME/.terminfo</EM> (or hashed database <EM>$HOME/.terminfo.db)</EM>;
- if that location exists, the entry is placed there.
+ <STRONG>o</STRONG> Secondly, if <STRONG>tic</STRONG> cannot write in <EM>/usr/local/ncurses/lib/terminfo</EM> or
+ the location specified using your TERMINFO variable, it looks for
+ the directory <EM>$HOME/.terminfo</EM> (or hashed database <EM>$HOME/.ter-</EM>
+ <EM>minfo.db)</EM>; if that location exists, the entry is placed there.
- Libraries that read terminfo entries are expected to check in succes-
+ Libraries that read terminfo entries are expected to check in succes-
sion
<STRONG>o</STRONG> a location specified with the TERMINFO environment variable,
<STRONG>o</STRONG> directories listed in the TERMINFO_DIRS environment variable,
- <STRONG>o</STRONG> a compiled-in list of directories (/usr/local/ncurses/share/ter-
+ <STRONG>o</STRONG> a compiled-in list of directories (/usr/local/ncurses/share/ter-
minfo:/usr/share/terminfo), and
- <STRONG>o</STRONG> the system terminfo database (<EM>/usr/share/terminfo</EM>).
+ <STRONG>o</STRONG> the system terminfo database (<EM>/usr/local/ncurses/lib/terminfo</EM>).
</PRE><H3><a name="h3-ALIASES">ALIASES</a></H3><PRE>
- This is the same program as infotocap and captoinfo; usually those are
+ This is the same program as infotocap and captoinfo; usually those are
linked to, or copied from this program:
<STRONG>o</STRONG> When invoked as infotocap, tic sets the <STRONG>-I</STRONG> option.
<STRONG>-1</STRONG> restricts the output to a single column
- <STRONG>-a</STRONG> tells <STRONG>tic</STRONG> to retain commented-out capabilities rather than dis-
+ <STRONG>-a</STRONG> tells <STRONG>tic</STRONG> to retain commented-out capabilities rather than dis-
carding them. Capabilities are commented by prefixing them with
- a period. This sets the <STRONG>-x</STRONG> option, because it treats the com-
- mented-out entries as user-defined names. If the source is
- termcap, accept the 2-character names required by version 6.
+ a period. This sets the <STRONG>-x</STRONG> option, because it treats the com-
+ mented-out entries as user-defined names. If the source is
+ termcap, accept the 2-character names required by version 6.
Otherwise these are ignored.
- <STRONG>-C</STRONG> Force source translation to termcap format. Note: this differs
- from the <STRONG>-C</STRONG> option of <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG> in that it does not merely
+ <STRONG>-C</STRONG> Force source translation to termcap format. Note: this differs
+ from the <STRONG>-C</STRONG> option of <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG> in that it does not merely
translate capability names, but also translates terminfo strings
- to termcap format. Capabilities that are not translatable are
- left in the entry under their terminfo names but commented out
- with two preceding dots. The actual format used incorporates
- some improvements for escaped characters from terminfo format.
+ to termcap format. Capabilities that are not translatable are
+ left in the entry under their terminfo names but commented out
+ with two preceding dots. The actual format used incorporates
+ some improvements for escaped characters from terminfo format.
For a stricter BSD-compatible translation, add the <STRONG>-K</STRONG> option.
- If this is combined with <STRONG>-c</STRONG>, <STRONG>tic</STRONG> makes additional checks to
- report cases where the terminfo values do not have an exact
+ If this is combined with <STRONG>-c</STRONG>, <STRONG>tic</STRONG> makes additional checks to
+ report cases where the terminfo values do not have an exact
equivalent in termcap form. For example:
- <STRONG>o</STRONG> <STRONG>sgr</STRONG> usually will not convert, because termcap lacks the
- ability to work with more than two parameters, and because
- termcap lacks many of the arithmetic/logical operators used
+ <STRONG>o</STRONG> <STRONG>sgr</STRONG> usually will not convert, because termcap lacks the
+ ability to work with more than two parameters, and because
+ termcap lacks many of the arithmetic/logical operators used
in terminfo.
- <STRONG>o</STRONG> capabilities with more than one delay or with delays before
+ <STRONG>o</STRONG> capabilities with more than one delay or with delays before
the end of the string will not convert completely.
- <STRONG>-c</STRONG> tells <STRONG>tic</STRONG> to only check <EM>file</EM> for errors, including syntax prob-
- lems and bad use-links. If you specify <STRONG>-C</STRONG> (<STRONG>-I</STRONG>) with this
- option, the code will print warnings about entries which, after
- use resolution, are more than 1023 (4096) bytes long. Due to a
+ <STRONG>-c</STRONG> tells <STRONG>tic</STRONG> to only check <EM>file</EM> for errors, including syntax prob-
+ lems and bad use-links. If you specify <STRONG>-C</STRONG> (<STRONG>-I</STRONG>) with this
+ option, the code will print warnings about entries which, after
+ use resolution, are more than 1023 (4096) bytes long. Due to a
fixed buffer length in older termcap libraries, as well as buggy
- checking for the buffer length (and a documented limit in ter-
- minfo), these entries may cause core dumps with other implemen-
+ checking for the buffer length (and a documented limit in ter-
+ minfo), these entries may cause core dumps with other implemen-
tations.
<STRONG>tic</STRONG> checks string capabilities to ensure that those with parame-
predefined string capabilities; those which are defined with the
<STRONG>-x</STRONG> option are ignored.
- <STRONG>-D</STRONG> tells <STRONG>tic</STRONG> to print the database locations that it knows about,
+ <STRONG>-D</STRONG> tells <STRONG>tic</STRONG> to print the database locations that it knows about,
and exit. The first location shown is the one to which it would
- write compiled terminal descriptions. If <STRONG>tic</STRONG> is not able to
- find a writable database location according to the rules summa-
- rized above, it will print a diagnostic and exit with an error
+ write compiled terminal descriptions. If <STRONG>tic</STRONG> is not able to
+ find a writable database location according to the rules summa-
+ rized above, it will print a diagnostic and exit with an error
rather than printing a list of database locations.
<STRONG>-e</STRONG> <EM>names</EM>
- Limit writes and translations to the following comma-separated
- list of terminals. If any name or alias of a terminal matches
- one of the names in the list, the entry will be written or
+ Limit writes and translations to the following comma-separated
+ list of terminals. If any name or alias of a terminal matches
+ one of the names in the list, the entry will be written or
translated as normal. Otherwise no output will be generated for
- it. The option value is interpreted as a file containing the
+ it. The option value is interpreted as a file containing the
list if it contains a '/'. (Note: depending on how tic was com-
piled, this option may require <STRONG>-I</STRONG> or <STRONG>-C</STRONG>.)
- <STRONG>-f</STRONG> Display complex terminfo strings which contain
+ <STRONG>-f</STRONG> Display complex terminfo strings which contain
if/then/else/endif expressions indented for readability.
- <STRONG>-G</STRONG> Display constant literals in decimal form rather than their
+ <STRONG>-G</STRONG> Display constant literals in decimal form rather than their
character equivalents.
- <STRONG>-g</STRONG> Display constant character literals in quoted form rather than
+ <STRONG>-g</STRONG> Display constant character literals in quoted form rather than
their decimal equivalents.
<STRONG>-I</STRONG> Force source translation to terminfo format.
<STRONG>-K</STRONG> Suppress some longstanding ncurses extensions to termcap format,
e.g., "\s" for space.
- <STRONG>-L</STRONG> Force source translation to terminfo format using the long C
+ <STRONG>-L</STRONG> Force source translation to terminfo format using the long C
variable names listed in <<STRONG>term.h</STRONG>>
<STRONG>-N</STRONG> Disable smart defaults. Normally, when translating from termcap
- to terminfo, the compiler makes a number of assumptions about
- the defaults of string capabilities <STRONG>reset1_string</STRONG>, <STRONG>car-</STRONG>
+ to terminfo, the compiler makes a number of assumptions about
+ the defaults of string capabilities <STRONG>reset1_string</STRONG>, <STRONG>car-</STRONG>
<STRONG>riage_return</STRONG>, <STRONG>cursor_left</STRONG>, <STRONG>cursor_down</STRONG>, <STRONG>scroll_forward</STRONG>, <STRONG>tab</STRONG>,
<STRONG>newline</STRONG>, <STRONG>key_backspace</STRONG>, <STRONG>key_left</STRONG>, and <STRONG>key_down</STRONG>, then attempts to
- use obsolete termcap capabilities to deduce correct values. It
+ use obsolete termcap capabilities to deduce correct values. It
also normally suppresses output of obsolete termcap capabilities
- such as <STRONG>bs</STRONG>. This option forces a more literal translation that
+ such as <STRONG>bs</STRONG>. This option forces a more literal translation that
also preserves the obsolete capabilities.
- <STRONG>-o</STRONG><EM>dir</EM> Write compiled entries to given database location. Overrides
+ <STRONG>-o</STRONG><EM>dir</EM> Write compiled entries to given database location. Overrides
the TERMINFO environment variable.
- <STRONG>-Q</STRONG><EM>n</EM> Rather than show source in terminfo (text) format, print the
- compiled (binary) format in hexadecimal or base64 form, depend-
+ <STRONG>-Q</STRONG><EM>n</EM> Rather than show source in terminfo (text) format, print the
+ compiled (binary) format in hexadecimal or base64 form, depend-
ing on the option's value:
1 hexadecimal
source.
<STRONG>-R</STRONG><EM>subset</EM>
- Restrict output to a given subset. This option is for use with
- archaic versions of terminfo like those on SVr1, Ultrix, or
- HP/UX that do not support the full set of SVR4/XSI Curses ter-
- minfo; and outright broken ports like AIX 3.x that have their
- own extensions incompatible with SVr4/XSI. Available subsets
+ Restrict output to a given subset. This option is for use with
+ archaic versions of terminfo like those on SVr1, Ultrix, or
+ HP/UX that do not support the full set of SVR4/XSI Curses ter-
+ minfo; and outright broken ports like AIX 3.x that have their
+ own extensions incompatible with SVr4/XSI. Available subsets
are "SVr1", "Ultrix", "HP", "BSD" and "AIX"; see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for
details.
- <STRONG>-r</STRONG> Force entry resolution (so there are no remaining tc capabili-
- ties) even when doing translation to termcap format. This may
- be needed if you are preparing a termcap file for a termcap
- library (such as GNU termcap through version 1.3 or BSD termcap
- through 4.3BSD) that does not handle multiple tc capabilities
+ <STRONG>-r</STRONG> Force entry resolution (so there are no remaining tc capabili-
+ ties) even when doing translation to termcap format. This may
+ be needed if you are preparing a termcap file for a termcap
+ library (such as GNU termcap through version 1.3 or BSD termcap
+ through 4.3BSD) that does not handle multiple tc capabilities
per entry.
- <STRONG>-s</STRONG> Summarize the compile by showing the database location into
- which entries are written, and the number of entries which are
+ <STRONG>-s</STRONG> Summarize the compile by showing the database location into
+ which entries are written, and the number of entries which are
compiled.
- <STRONG>-T</STRONG> eliminates size-restrictions on the generated text. This is
- mainly useful for testing and analysis, since the compiled
- descriptions are limited (e.g., 1023 for termcap, 4096 for ter-
+ <STRONG>-T</STRONG> eliminates size-restrictions on the generated text. This is
+ mainly useful for testing and analysis, since the compiled
+ descriptions are limited (e.g., 1023 for termcap, 4096 for ter-
minfo).
- <STRONG>-t</STRONG> tells <STRONG>tic</STRONG> to discard commented-out capabilities. Normally when
- translating from terminfo to termcap, untranslatable capabili-
+ <STRONG>-t</STRONG> tells <STRONG>tic</STRONG> to discard commented-out capabilities. Normally when
+ translating from terminfo to termcap, untranslatable capabili-
ties are commented-out.
- <STRONG>-U</STRONG> tells <STRONG>tic</STRONG> to not post-process the data after parsing the source
+ <STRONG>-U</STRONG> tells <STRONG>tic</STRONG> to not post-process the data after parsing the source
file. Normally, it infers data which is commonly missing in older
terminfo data, or in termcaps.
<STRONG>-v</STRONG><EM>n</EM> specifies that (verbose) output be written to standard error trace
information showing <STRONG>tic</STRONG>'s progress.
- The optional parameter <EM>n</EM> is a number from 1 to 10, inclusive,
+ The optional parameter <EM>n</EM> is a number from 1 to 10, inclusive,
indicating the desired level of detail of information. If ncurses
- is built without tracing support, the optional parameter is
+ is built without tracing support, the optional parameter is
ignored. If <EM>n</EM> is omitted, the default level is 1. If <EM>n</EM> is speci-
fied and greater than 1, the level of detail is increased.
If the debug level <EM>n</EM> is not given, it is taken to be one.
- <STRONG>-W</STRONG> By itself, the <STRONG>-w</STRONG> option will not force long strings to be
+ <STRONG>-W</STRONG> By itself, the <STRONG>-w</STRONG> option will not force long strings to be
wrapped. Use the <STRONG>-W</STRONG> option to do this.
- If you specify both <STRONG>-f</STRONG> and <STRONG>-W</STRONG> options, the latter is ignored when
+ If you specify both <STRONG>-f</STRONG> and <STRONG>-W</STRONG> options, the latter is ignored when
<STRONG>-f</STRONG> has already split the line.
<STRONG>-w</STRONG><EM>n</EM> specifies the width of the output. The parameter is optional. If
it is omitted, it defaults to 60.
- <STRONG>-x</STRONG> Treat unknown capabilities as user-defined (see <STRONG>user_caps(5)</STRONG>).
+ <STRONG>-x</STRONG> Treat unknown capabilities as user-defined (see <STRONG>user_caps(5)</STRONG>).
That is, if you supply a capability name which <STRONG>tic</STRONG> does not recog-
- nize, it will infer its type (boolean, number or string) from the
- syntax and make an extended table entry for that. User-defined
+ nize, it will infer its type (boolean, number or string) from the
+ syntax and make an extended table entry for that. User-defined
capability strings whose name begins with "k" are treated as func-
tion keys.
</PRE><H3><a name="h3-PARAMETERS">PARAMETERS</a></H3><PRE>
- <EM>file</EM> contains one or more <STRONG>terminfo</STRONG> terminal descriptions in source
- format [see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>]. Each description in the file
+ <EM>file</EM> contains one or more <STRONG>terminfo</STRONG> terminal descriptions in source
+ format [see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>]. Each description in the file
describes the capabilities of a particular terminal.
- If <EM>file</EM> is "-", then the data is read from the standard input.
+ If <EM>file</EM> is "-", then the data is read from the standard input.
The <EM>file</EM> parameter may also be the path of a character-device.
</PRE><H3><a name="h3-PROCESSING">PROCESSING</a></H3><PRE>
- All but one of the capabilities recognized by <STRONG>tic</STRONG> are documented in
+ All but one of the capabilities recognized by <STRONG>tic</STRONG> are documented in
<STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>. The exception is the <STRONG>use</STRONG> capability.
When a <STRONG>use</STRONG>=<EM>entry</EM>-<EM>name</EM> field is discovered in a terminal entry currently
- being compiled, <STRONG>tic</STRONG> reads in the binary from <STRONG>/usr/share/terminfo</STRONG> to
- complete the entry. (Entries created from <EM>file</EM> will be used first.
- <STRONG>tic</STRONG> duplicates the capabilities in <EM>entry</EM>-<EM>name</EM> for the current entry,
- with the exception of those capabilities that explicitly are defined in
- the current entry.
-
- When an entry, e.g., <STRONG>entry_name_1</STRONG>, contains a <STRONG>use=</STRONG><EM>entry</EM>_<EM>name</EM>_<EM>2</EM> field,
- any canceled capabilities in <EM>entry</EM>_<EM>name</EM>_<EM>2</EM> must also appear in
- <STRONG>entry_name_1</STRONG> before <STRONG>use=</STRONG> for these capabilities to be canceled in
+ being compiled, <STRONG>tic</STRONG> reads in the binary from
+ <STRONG>/usr/local/ncurses/lib/terminfo</STRONG> to complete the entry. (Entries cre-
+ ated from <EM>file</EM> will be used first. <STRONG>tic</STRONG> duplicates the capabilities in
+ <EM>entry</EM>-<EM>name</EM> for the current entry, with the exception of those capabili-
+ ties that explicitly are defined in the current entry.
+
+ When an entry, e.g., <STRONG>entry_name_1</STRONG>, contains a <STRONG>use=</STRONG><EM>entry</EM>_<EM>name</EM>_<EM>2</EM> field,
+ any canceled capabilities in <EM>entry</EM>_<EM>name</EM>_<EM>2</EM> must also appear in
+ <STRONG>entry_name_1</STRONG> before <STRONG>use=</STRONG> for these capabilities to be canceled in
<STRONG>entry_name_1</STRONG>.
Total compiled entries cannot exceed 4096 bytes. The name field cannot
- exceed 512 bytes. Terminal names exceeding the maximum alias length
+ exceed 512 bytes. Terminal names exceeding the maximum alias length
(32 characters on systems with long filenames, 14 characters otherwise)
- will be truncated to the maximum alias length and a warning message
+ will be truncated to the maximum alias length and a warning message
will be printed.
</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
- System V Release 2 provided a <STRONG>tic</STRONG> utility. It accepted a single
- option: <STRONG>-v</STRONG> (optionally followed by a number). According to Ross
+ System V Release 2 provided a <STRONG>tic</STRONG> utility. It accepted a single
+ option: <STRONG>-v</STRONG> (optionally followed by a number). According to Ross
Ridge's comment in <EM>mytinfo</EM>, this version of <STRONG>tic</STRONG> was unable to represent
cancelled capabilities.
- System V Release 3 provided a different <STRONG>tic</STRONG> utility, written by Pavel
- Curtis, (originally named "compile" in <EM>pcurses</EM>). This added an option
- <STRONG>-c</STRONG> to check the file for errors, with the caveat that errors in "use="
+ System V Release 3 provided a different <STRONG>tic</STRONG> utility, written by Pavel
+ Curtis, (originally named "compile" in <EM>pcurses</EM>). This added an option
+ <STRONG>-c</STRONG> to check the file for errors, with the caveat that errors in "use="
links would not be reported. System V Release 3 documented a few warn-
ing messages which did not appear in <EM>pcurses</EM>. While the program itself
- was changed little as development continued with System V Release 4,
+ was changed little as development continued with System V Release 4,
the table of capabilities grew from 180 (<EM>pcurses</EM>) to 464 (Solaris).
- In early development of ncurses (1993), Zeyd Ben-Halim used the table
- from <EM>mytinfo</EM> to extend the <EM>pcurses</EM> table to 469 capabilities (456
- matched SVr4, 8 were only in SVr4, 13 were not in SVr4). Of those 13,
- 11 were ultimately discarded (perhaps to match the draft of X/Open
- Curses). The exceptions were <STRONG>memory_lock_above</STRONG> and <STRONG>memory_unlock</STRONG> (see
+ In early development of ncurses (1993), Zeyd Ben-Halim used the table
+ from <EM>mytinfo</EM> to extend the <EM>pcurses</EM> table to 469 capabilities (456
+ matched SVr4, 8 were only in SVr4, 13 were not in SVr4). Of those 13,
+ 11 were ultimately discarded (perhaps to match the draft of X/Open
+ Curses). The exceptions were <STRONG>memory_lock_above</STRONG> and <STRONG>memory_unlock</STRONG> (see
<STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>).
- Eric Raymond incorporated parts of <EM>mytinfo</EM> into ncurses to implement
- the termcap-to-terminfo source conversion, and extended that to begin
+ Eric Raymond incorporated parts of <EM>mytinfo</EM> into ncurses to implement
+ the termcap-to-terminfo source conversion, and extended that to begin
development of the corresponding terminfo-to-termcap source conversion,
- Thomas Dickey completed that development over the course of several
+ Thomas Dickey completed that development over the course of several
years.
- In 1999, Thomas Dickey added the <STRONG>-x</STRONG> option to support user-defined
+ In 1999, Thomas Dickey added the <STRONG>-x</STRONG> option to support user-defined
capabilities.
- In 2010, Roy Marples provided a <STRONG>tic</STRONG> program and terminfo library for
- NetBSD. That implementation adapts several features from ncurses,
+ In 2010, Roy Marples provided a <STRONG>tic</STRONG> program and terminfo library for
+ NetBSD. That implementation adapts several features from ncurses,
including <STRONG>tic</STRONG>'s <STRONG>-x</STRONG> option.
- The <STRONG>-c</STRONG> option tells <STRONG>tic</STRONG> to check for problems in the terminfo source
+ The <STRONG>-c</STRONG> option tells <STRONG>tic</STRONG> to check for problems in the terminfo source
file. Continued development provides additional checks:
<STRONG>o</STRONG> <EM>pcurses</EM> had 8 warnings
The checking done in ncurses' <STRONG>tic</STRONG> helps with the conversion to termcap,
as well as pointing out errors and inconsistencies. It is also used to
- ensure consistency with the user-defined capabilities. There are 527
- distinct capabilities in ncurses' terminal database; 128 of those are
+ ensure consistency with the user-defined capabilities. There are 527
+ distinct capabilities in ncurses' terminal database; 128 of those are
user-defined.
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
- X/Open Curses, Issue 7 (2009) provides a brief description of <STRONG>tic</STRONG>. It
- lists one option: <STRONG>-c</STRONG>. The omission of <STRONG>-v</STRONG> is unexpected. The change
- history states that the description is derived from True64 UNIX.
- According to its manual pages, that system also supported the <STRONG>-v</STRONG>
+ X/Open Curses, Issue 7 (2009) provides a brief description of <STRONG>tic</STRONG>. It
+ lists one option: <STRONG>-c</STRONG>. The omission of <STRONG>-v</STRONG> is unexpected. The change
+ history states that the description is derived from True64 UNIX.
+ According to its manual pages, that system also supported the <STRONG>-v</STRONG>
option.
- Shortly after Issue 7 was released, Tru64 was discontinued. As of
- 2019, the surviving implementations of <STRONG>tic</STRONG> are SVr4 (AIX, HP-UX and
+ Shortly after Issue 7 was released, Tru64 was discontinued. As of
+ 2019, the surviving implementations of <STRONG>tic</STRONG> are SVr4 (AIX, HP-UX and
Solaris), ncurses and NetBSD curses. The SVr4 <STRONG>tic</STRONG> programs all support
- the <STRONG>-v</STRONG> option. The NetBSD <STRONG>tic</STRONG> program follows X/Open's documentation,
+ the <STRONG>-v</STRONG> option. The NetBSD <STRONG>tic</STRONG> program follows X/Open's documentation,
omitting the <STRONG>-v</STRONG> option.
- The X/Open rationale states that some implementations of <STRONG>tic</STRONG> read ter-
- minal descriptions from the standard input if the <EM>file</EM> parameter is
- omitted. None of these implementations do that. Further, it comments
+ The X/Open rationale states that some implementations of <STRONG>tic</STRONG> read ter-
+ minal descriptions from the standard input if the <EM>file</EM> parameter is
+ omitted. None of these implementations do that. Further, it comments
that some may choose to read from "./terminfo.src" but that is obsoles-
- cent behavior from SVr2, and is not (for example) a documented feature
+ cent behavior from SVr2, and is not (for example) a documented feature
of SVr3.
</PRE><H3><a name="h3-COMPATIBILITY">COMPATIBILITY</a></H3><PRE>
- There is some evidence that historic <STRONG>tic</STRONG> implementations treated
- description fields with no whitespace in them as additional aliases or
+ There is some evidence that historic <STRONG>tic</STRONG> implementations treated
+ description fields with no whitespace in them as additional aliases or
short names. This <STRONG>tic</STRONG> does not do that, but it does warn when descrip-
- tion fields may be treated that way and check them for dangerous char-
+ tion fields may be treated that way and check them for dangerous char-
acters.
</PRE><H3><a name="h3-EXTENSIONS">EXTENSIONS</a></H3><PRE>
- Unlike the SVr4 <STRONG>tic</STRONG> command, this implementation can actually compile
- termcap sources. In fact, entries in terminfo and termcap syntax can
- be mixed in a single source file. See <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for the list of
+ Unlike the SVr4 <STRONG>tic</STRONG> command, this implementation can actually compile
+ termcap sources. In fact, entries in terminfo and termcap syntax can
+ be mixed in a single source file. See <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> for the list of
termcap names taken to be equivalent to terminfo names.
- The SVr4 manual pages are not clear on the resolution rules for <STRONG>use</STRONG>
- capabilities. This implementation of <STRONG>tic</STRONG> will find <STRONG>use</STRONG> targets any-
- where in the source file, or anywhere in the file tree rooted at <STRONG>TER-</STRONG>
- <STRONG>MINFO</STRONG> (if <STRONG>TERMINFO</STRONG> is defined), or in the user's <EM>$HOME/.terminfo</EM> data-
+ The SVr4 manual pages are not clear on the resolution rules for <STRONG>use</STRONG>
+ capabilities. This implementation of <STRONG>tic</STRONG> will find <STRONG>use</STRONG> targets any-
+ where in the source file, or anywhere in the file tree rooted at <STRONG>TER-</STRONG>
+ <STRONG>MINFO</STRONG> (if <STRONG>TERMINFO</STRONG> is defined), or in the user's <EM>$HOME/.terminfo</EM> data-
base (if it exists), or (finally) anywhere in the system's file tree of
compiled entries.
- The error messages from this <STRONG>tic</STRONG> have the same format as GNU C error
+ The error messages from this <STRONG>tic</STRONG> have the same format as GNU C error
messages, and can be parsed by GNU Emacs's compile facility.
Aside from <STRONG>-c</STRONG> and <STRONG>-v</STRONG>, options are not portable:
<STRONG>-a</STRONG> <STRONG>-o</STRONG> <STRONG>-x</STRONG>
- and adds <STRONG>-S</STRONG> (a feature which does the same thing as infocmp's <STRONG>-e</STRONG>
+ and adds <STRONG>-S</STRONG> (a feature which does the same thing as infocmp's <STRONG>-e</STRONG>
and <STRONG>-E</STRONG> options).
The SVr4 <STRONG>-c</STRONG> mode does not report bad "use=" links.
- System V does not compile entries to or read entries from your
+ System V does not compile entries to or read entries from your
<EM>$HOME/.terminfo</EM> database unless TERMINFO is explicitly set to it.
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- <STRONG>/usr/share/terminfo/?/*</STRONG>
+ <STRONG>/usr/local/ncurses/lib/terminfo/?/*</STRONG>
Compiled terminal description database.
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
<STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>. <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- <STRONG>/usr/share/terminfo/?/*</STRONG>
+ <STRONG>/usr/local/ncurses/lib/terminfo/?/*</STRONG>
Compiled terminal description database.
<STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG>ter-</STRONG>
<STRONG><A HREF="terminfo.5.html">minfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
</PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
- <STRONG>/usr/share/terminfo</STRONG>
+ <STRONG>/usr/local/ncurses/lib/terminfo</STRONG>
compiled terminal description database
<STRONG>/usr/share/tabset/*</STRONG>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
system port name to terminal type mapping database (BSD versions
only).
- /usr/share/terminfo
+ /usr/local/ncurses/lib/terminfo
terminal capability database
<STRONG>csh(1)</STRONG>, <STRONG>sh(1)</STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG>tty(4)</STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
<STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201205).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20201212).
#include "form.priv.h"
-MODULE_ID("$Id: fld_arg.c,v 1.17 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_arg.c,v 1.18 2020/12/11 22:05:24 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : void *field_arg(const FIELD *field)
|
-| Description : Retrieve pointer to the fields argument structure.
+| Description : Retrieve pointer to the field's argument structure.
|
| Return Values : Pointer to structure or NULL if none is defined.
+--------------------------------------------------------------------------*/
#include "form.priv.h"
-MODULE_ID("$Id: fld_attr.c,v 1.14 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_attr.c,v 1.15 2020/12/11 22:05:24 tom Exp $")
/*----------------------------------------------------------------------------
Field-Attribute manipulation routines
--------------------------------------------------------------------------*/
-/* "Template" macro to generate a function to set a fields attribute */
+/* "Template" macro to generate a function to set a field's attribute */
#define GEN_FIELD_ATTR_SET_FCT( name ) \
FORM_IMPEXP int NCURSES_API set_field_ ## name (FIELD * field, chtype attr)\
{\
RETURN(res);\
}
-/* "Template" macro to generate a function to get a fields attribute */
+/* "Template" macro to generate a function to get a field's attribute */
#define GEN_FIELD_ATTR_GET_FCT( name ) \
FORM_IMPEXP chtype NCURSES_API field_ ## name (const FIELD * field)\
{\
| Facility : libnform
| Function : chtype field_fore(const FIELD *)
|
-| Description : Retrieve fields foreground attribute
+| Description : Retrieve field's foreground attribute
|
| Return Values : The foreground attribute
+--------------------------------------------------------------------------*/
| Function : int set_field_back(FIELD *field, chtype attr)
|
| Description : Sets the background of the field used to display the
-| fields extend.
+| field's extend.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid attributes
| Facility : libnform
| Function : chtype field_back(const
|
-| Description : Retrieve fields background attribute
+| Description : Retrieve field's background attribute
|
| Return Values : The background attribute
+--------------------------------------------------------------------------*/
#include "form.priv.h"
-MODULE_ID("$Id: fld_info.c,v 1.13 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_info.c,v 1.15 2020/12/12 01:05:42 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| int *frow, int *fcol,
| int *nrow, int *nbuf)
|
-| Description : Retrieve infos about the fields creation parameters.
+| Description : Retrieve information about the field's creation parameters.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid field pointer
| int *drows, int *dcols,
| int *maxgrow)
|
-| Description : Retrieve informations about a dynamic fields current
+| Description : Retrieve information about a dynamic field's current
| dynamic parameters.
|
| Return Values : E_OK - success
#include "form.priv.h"
-MODULE_ID("$Id: fld_just.c,v 1.15 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_just.c,v 1.16 2020/12/11 23:16:37 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : int set_field_just(FIELD *field, int just)
|
-| Description : Set the fields type of justification.
+| Description : Set the field's type of justification.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - one of the arguments was incorrect
Normalize_Field(field);
if (field->just != just)
{
- field->just = (short) just;
+ field->just = (short)just;
res = _nc_Synchronize_Attributes(field);
}
else
| Facility : libnform
| Function : int field_just( const FIELD *field )
|
-| Description : Retrieve the fields type of justification
+| Description : Retrieve the field's type of justification
|
| Return Values : The justification type.
+--------------------------------------------------------------------------*/
#include "form.priv.h"
-MODULE_ID("$Id: fld_link.c,v 1.15 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_link.c,v 1.16 2020/12/11 23:20:32 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
{
T((T_CREATE("field %p"), (void *)New_Field));
*New_Field = *_nc_Default_Field;
- New_Field->frow = (short) frow;
- New_Field->fcol = (short) fcol;
+ New_Field->frow = (short)frow;
+ New_Field->fcol = (short)fcol;
New_Field->link = field->link;
field->link = New_Field;
#include "form.priv.h"
-MODULE_ID("$Id: fld_move.c,v 1.13 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_move.c,v 1.15 2020/12/11 23:48:05 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : int move_field(FIELD *field,int frow, int fcol)
|
| Description : Moves the disconnected field to the new location in
-| the forms subwindow.
+| the form's subwindow.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid argument passed
if (field->form)
RETURN(E_CONNECTED);
- field->frow = (short) frow;
- field->fcol = (short) fcol;
+ field->frow = (short)frow;
+ field->fcol = (short)fcol;
RETURN(E_OK);
}
#include "form.priv.h"
-MODULE_ID("$Id: fld_opts.c,v 1.14 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_opts.c,v 1.15 2020/12/11 22:05:24 tom Exp $")
/*----------------------------------------------------------------------------
Field-Options manipulation routines
| Facility : libnform
| Function : Field_Options field_opts(const FIELD *field)
|
-| Description : Retrieve the fields options.
+| Description : Retrieve the field's options.
|
| Return Values : The options.
+--------------------------------------------------------------------------*/
#include "form.priv.h"
-MODULE_ID("$Id: fld_pad.c,v 1.12 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_pad.c,v 1.13 2020/12/11 22:05:24 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : int field_pad(const FIELD *field)
|
-| Description : Retrieve the fields pad character.
+| Description : Retrieve the field's pad character.
|
| Return Values : The pad character.
+--------------------------------------------------------------------------*/
#include "form.priv.h"
-MODULE_ID("$Id: fld_page.c,v 1.14 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_page.c,v 1.15 2020/12/11 23:15:26 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Facility : libnform
| Function : bool new_page(const FIELD *field)
|
-| Description : Retrieve the info whether or not the field starts a
-| new page on the form.
+| Description : Retrieve the information whether or not the field starts
+| a new page on the form.
|
| Return Values : TRUE - field starts a new page
| FALSE - field doesn't start a new page
#include "form.priv.h"
-MODULE_ID("$Id: fld_stat.c,v 1.16 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_stat.c,v 1.17 2020/12/11 22:05:24 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : int set_field_status(FIELD *field, bool status)
|
| Description : Set or clear the 'changed' indication flag for that
-| fields primary buffer.
+| field's primary buffer.
|
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
| Function : bool field_status(const FIELD *field)
|
| Description : Retrieve the value of the 'changed' indication flag
-| for that fields primary buffer.
+| for that field's primary buffer.
|
| Return Values : TRUE - buffer has been changed
| FALSE - buffer has not been changed
#include "form.priv.h"
-MODULE_ID("$Id: fld_type.c,v 1.18 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_type.c,v 1.19 2020/12/11 23:20:37 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| E_SYSTEM_ERROR - system error
+--------------------------------------------------------------------------*/
FORM_EXPORT(int)
-set_field_type(FIELD *field, FIELDTYPE *type,...)
+set_field_type(FIELD *field, FIELDTYPE *type, ...)
{
va_list ap;
int res = E_SYSTEM_ERROR;
#include "form.priv.h"
-MODULE_ID("$Id: fld_user.c,v 1.18 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_user.c,v 1.19 2020/12/12 01:05:34 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : int set_field_userptr(FIELD *field, void *usrptr)
|
| Description : Set the pointer that is reserved in any field to store
-| application relevant informations
+| application relevant information.
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
| Function : void *field_userptr(const FIELD *field)
|
| Description : Return the pointer that is reserved in any field to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: form.priv.h,v 0.46 2020/05/24 01:40:20 anonymous.maarten Exp $ */
+/* $Id: form.priv.h,v 0.47 2020/12/11 23:20:11 tom Exp $ */
#ifndef FORM_PRIV_H
#define FORM_PRIV_H 1
#define Get_Form_Screen(form) CURRENT_SCREEN
#endif
-/* Retrieve forms window */
+/* Retrieve form's window */
#define Get_Form_Window(form) \
((form)->sub \
? (form)->sub \
#include "form.priv.h"
-MODULE_ID("$Id: frm_data.c,v 1.18 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.19 2020/12/11 23:20:37 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
}
}
#else
- cell = (FIELD_CELL) winch(w);
+ cell = (FIELD_CELL)winch(w);
if (ChCharOf(cell) != ChCharOf(pad))
{
result = FALSE;
#include "form.priv.h"
-MODULE_ID("$Id: frm_def.c,v 1.28 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.29 2020/12/11 23:47:16 tom Exp $")
/* this can't be readonly */
static FORM default_form =
};
FORM_EXPORT_VAR(FORM *) _nc_Default_Form = &default_form;
-\f
+
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static FIELD *Insert_Field_By_Position(
-| FIELD *new_field,
+| FIELD *new_field,
| FIELD *head )
-|
+|
| Description : Insert new_field into sorted fieldlist with head "head"
| and return new head of sorted fieldlist. Sorting
| criteria is (row,column). This is a circular list.
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static void Disconnect_Fields(FORM *form)
-|
+|
| Description : Break association between form and array of fields.
|
| Return Values : -
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static int Connect_Fields(FORM *form, FIELD **fields)
-|
+|
| Description : Set association between form and array of fields.
|
| Return Values : E_OK - no error
for (j = 0; j < field_cnt; j++)
{
if (j == 0)
- pg->pmin = (short) j;
+ pg->pmin = (short)j;
else
{
if (fields[j]->status & _NEWPAGE)
{
- pg->pmax = (short) (j - 1);
+ pg->pmax = (short)(j - 1);
pg++;
- pg->pmin = (short) j;
+ pg->pmin = (short)j;
}
}
maximum_col_in_field = fields[j]->fcol + fields[j]->cols;
if (form->rows < maximum_row_in_field)
- form->rows = (short) maximum_row_in_field;
+ form->rows = (short)maximum_row_in_field;
if (form->cols < maximum_col_in_field)
- form->cols = (short) maximum_col_in_field;
+ form->cols = (short)maximum_col_in_field;
}
- pg->pmax = (short) (field_cnt - 1);
- form->maxfield = (short) field_cnt;
- form->maxpage = (short) page_nr;
+ pg->pmax = (short)(field_cnt - 1);
+ form->maxfield = (short)field_cnt;
+ form->maxpage = (short)page_nr;
/* Sort fields on form pages */
for (page_nr = 0; page_nr < form->maxpage; page_nr++)
for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
{
- fields[j]->index = (short) j;
- fields[j]->page = (short) page_nr;
+ fields[j]->index = (short)j;
+ fields[j]->page = (short)page_nr;
fld = Insert_Field_By_Position(fields[j], fld);
}
if (fld)
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : static int Associate_Fields(FORM *form, FIELD **fields)
-|
-| Description : Set association between form and array of fields.
+|
+| Description : Set association between form and array of fields.
| If there are fields, position to first active field.
|
| Return Values : E_OK - success
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FORM *new_form_sp(SCREEN* sp, FIELD** fields )
-|
+|
| Description : Create new form with given array of fields.
|
| Return Values : Pointer to form. NULL if error occurred.
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FORM* new_form(FIELD** fields )
-|
+|
| Description : Create new form with given array of fields.
|
| Return Values : Pointer to form. NULL if error occurred.
#endif
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int free_form( FORM *form )
-|
+|
| Description : Release internal memory associated with form.
|
| Return Values : E_OK - no error
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int set_form_fields( FORM *form, FIELD **fields )
-|
+|
| Description : Set a new association of an array of fields to a form
|
| Return Values : E_OK - no error
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : FIELD **form_fields( const FORM *form )
-|
+|
| Description : Retrieve array of fields
|
| Return Values : Pointer to field array
}
/*---------------------------------------------------------------------------
-| Facility : libnform
+| Facility : libnform
| Function : int field_count( const FORM *form )
-|
+|
| Description : Retrieve number of fields
|
| Return Values : Number of fields, -1 if none are defined
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.130 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.133 2020/12/12 00:36:42 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
/* Calculate the position of a single row in a field buffer */
#define Position_Of_Row_In_Buffer(field,row) ((row)*(field)->dcols)
-/* Calculate start address for the fields buffer# N */
+/* Calculate start address for the field's buffer# N */
#define Address_Of_Nth_Buffer(field,N) \
((field)->buf + (N)*(1+Buffer_Length(field)))
-/* Calculate the start address of the row in the fields specified buffer# N */
+/* Calculate the start address of the row in the field's specified buffer# N */
#define Address_Of_Row_In_Nth_Buffer(field,N,row) \
(Address_Of_Nth_Buffer(field,N) + Position_Of_Row_In_Buffer(field,row))
-/* Calculate the start address of the row in the fields primary buffer */
+/* Calculate the start address of the row in the field's primary buffer */
#define Address_Of_Row_In_Buffer(field,row) \
Address_Of_Row_In_Nth_Buffer(field,0,row)
-/* Calculate the start address of the row in the forms current field
+/* Calculate the start address of the row in the form's current field
buffer# N */
#define Address_Of_Current_Row_In_Nth_Buffer(form,N) \
Address_Of_Row_In_Nth_Buffer((form)->current,N,(form)->currow)
-/* Calculate the start address of the row in the forms current field
+/* Calculate the start address of the row in the form's current field
primary buffer */
#define Address_Of_Current_Row_In_Buffer(form) \
Address_Of_Current_Row_In_Nth_Buffer(form,0)
-/* Calculate the address of the cursor in the forms current field
+/* Calculate the address of the cursor in the form's current field
primary buffer */
#define Address_Of_Current_Position_In_Nth_Buffer(form,N) \
(Address_Of_Current_Row_In_Nth_Buffer(form,N) + (form)->curcol)
-/* Calculate the address of the cursor in the forms current field
+/* Calculate the address of the cursor in the form's current field
buffer# N */
#define Address_Of_Current_Position_In_Buffer(form) \
Address_Of_Current_Position_In_Nth_Buffer(form,0)
/* Logic to determine whether or not a dynamic field may still grow */
#define Growable(field) ((field)->status & _MAY_GROW)
-/* Macro to set the attributes for a fields window */
+/* Macro to set the attributes for a field's window */
#define Set_Field_Window_Attributes(field,win) \
( wbkgdset((win),(chtype)((chtype)((field)->pad) | (field)->back)), \
(void) wattrset((win), (int)(field)->fore) )
| Facility : libnform
| Function : int _nc_Refresh_Current_Field(FORM * form)
|
-| Description : Propagate the changes in the fields window to the
+| Description : Propagate the changes in the field's window to the
| window of the form.
|
| Return Values : E_OK - on success
| Facility : libnform
| Function : int _nc_Synchronize_Attributes(FIELD * field)
|
-| Description : If a fields visual attributes have changed, this
+| Description : If a field's visual attributes have changed, this
| routine is called to propagate those changes to the
| screen.
|
| Function : int _nc_Synchronize_Options(FIELD * field,
| Field_Options newopts)
|
-| Description : If a fields options have changed, this routine is
+| Description : If a field's options have changed, this routine is
| called to propagate these changes to the screen and
| to really change the behavior of the field.
|
|
| Description : Get the next field after the given field on the current
| page. The order of fields is the one defined by the
-| fields array. Only visible and active fields are
+| field's array. Only visible and active fields are
| counted.
|
| Return Values : Pointer to the next field.
|
| Description : Get the previous field before the given field on the
| current page. The order of fields is the one defined by
-| the fields array. Only visible and active fields are
+| the field's array. Only visible and active fields are
| counted.
|
| Return Values : Pointer to the previous field.
| Function : static FIELD *Upper_Neighbor_Field(FIELD * field)
|
| Description : Because of the row-major nature of sorting the fields,
-| it is more difficult to define whats the upper neighbor
+| it is more difficult to define what the upper neighbor
| field really means. We define that it must be on a
| 'previous' line (cyclic order!) and is the rightmost
-| field laying on the left side of the given field. If
+| field lying on the left side of the given field. If
| this set is empty, we take the first field on the line.
|
| Return Values : Pointer to the upper neighbor field.
| Function : static FIELD *Down_Neighbor_Field(FIELD * field)
|
| Description : Because of the row-major nature of sorting the fields,
-| its more difficult to define whats the down neighbor
+| it's more difficult to define what the down neighbor
| field really means. We define that it must be on a
| 'next' line (cyclic order!) and is the leftmost
| field laying on the right side of the given field. If
| that the field is left and a new field is entered.
| So the field must be validated and the field init/term
| hooks must be called. Because also the page is changed,
-| the forms init/term hooks must be called also.
+| the form's init/term hooks must be called also.
|
| Return Values : E_OK - success
| E_INVALID_FIELD - field is invalid
FORM_EXPORT(int)
form_driver(FORM *form, int c)
{
- const Binding_Info *BI = (Binding_Info *) 0;
+ const Binding_Info *BI = (Binding_Info *)0;
int res = E_UNKNOWN_COMMAND;
move_after_insert = TRUE;
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
- size_t method = (size_t) ((BI->keycode >> ID_Shft) & 0xffff); /* see ID_Mask */
+ size_t method = (size_t)((BI->keycode >> ID_Shft) & 0xffff); /* see ID_Mask */
if ((method >= nMethods) || !(BI->cmd))
res = E_SYSTEM_ERROR;
FORM_EXPORT(int)
form_driver_w(FORM *form, int type, wchar_t c)
{
- const Binding_Info *BI = (Binding_Info *) 0;
+ const Binding_Info *BI = (Binding_Info *)0;
int res = E_UNKNOWN_COMMAND;
T((T_CALLED("form_driver(%p,%d)"), (void *)form, (int)c));
NULL /* Choice Request is generic */
};
size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
- size_t method = (size_t) (BI->keycode >> ID_Shft) & 0xffff; /* see ID_Mask */
+ size_t method = (size_t)(BI->keycode >> ID_Shft) & 0xffff; /* see ID_Mask */
if ((method >= nMethods) || !(BI->cmd))
res = E_SYSTEM_ERROR;
| For dynamic fields this may grow the fieldbuffers if
| the length of the value exceeds the current buffer
| length. For buffer 0 only printable values are allowed.
-| For static fields, the value needs not to be zero ter-
-| minated. It is copied up to the length of the buffer.
+| For static fields, the value must not be zero terminated.
+| It is copied up to the length of the buffer.
|
| Return Values : E_OK - success
| E_BAD_ARGUMENT - invalid argument
{
result[need] = wch;
}
- passed += (size_t) status;
+ passed += (size_t)status;
++need;
}
else
#include "form.priv.h"
-MODULE_ID("$Id: frm_opts.c,v 1.19 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_opts.c,v 1.20 2020/12/12 00:37:00 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
{
T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts));
- opts &= (Form_Options) ALL_FORM_OPTS;
+ opts &= (Form_Options)ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
form_opts(const FORM *form)
{
T((T_CALLED("form_opts(%p)"), (const void *)form));
- returnCode((Form_Options) ((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS));
+ returnCode((Form_Options)((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS));
}
/*---------------------------------------------------------------------------
{
T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts));
- opts &= (Form_Options) ALL_FORM_OPTS;
+ opts &= (Form_Options)ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
{
T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts));
- opts &= (Form_Options) ALL_FORM_OPTS;
+ opts &= (Form_Options)ALL_FORM_OPTS;
if ((unsigned)opts & ~ALL_FORM_OPTS)
RETURN(E_BAD_ARGUMENT);
else
#include "form.priv.h"
-MODULE_ID("$Id: frm_user.c,v 1.17 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_user.c,v 1.18 2020/12/12 01:05:20 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
| Function : int set_form_userptr(FORM *form, void *usrptr)
|
| Description : Set the pointer that is reserved in any form to store
-| application relevant informations
+| application relevant information.
|
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
| Function : void *form_userptr(const FORM *form)
|
| Description : Return the pointer that is reserved in any form to
-| store application relevant informations.
+| store application relevant information.
|
| Return Values : Value of pointer. If no such pointer has been set,
| NULL is returned
#include "form.priv.h"
-MODULE_ID("$Id: fty_alnum.c,v 1.26 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_alnum.c,v 1.29 2020/12/12 01:15:37 tom Exp $")
#define thisARG alnumARG
static void *
Generic_This_Type(void *arg)
{
- thisARG *argp = (thisARG *) 0;
+ thisARG *argp = (thisARG *)0;
if (arg)
{
Check_This_Character(int c, const void *argp GCC_UNUSED)
{
#if USE_WIDEC_SUPPORT
- if (iswalnum((wint_t) c))
+ if (iswalnum((wint_t)c))
return TRUE;
#endif
return (isalnum(UChar(c)) ? TRUE : FALSE);
#endif
};
-FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALNUM = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
FORM_EXPORT(FIELDTYPE *)
#include "form.priv.h"
-MODULE_ID("$Id: fty_alpha.c,v 1.28 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_alpha.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
#define thisARG alphaARG
static void *
Generic_This_Type(void *arg)
{
- thisARG *argp = (thisARG *) 0;
+ thisARG *argp = (thisARG *)0;
if (arg)
{
Check_This_Character(int c, const void *argp GCC_UNUSED)
{
#if USE_WIDEC_SUPPORT
- if (iswalpha((wint_t) c))
+ if (iswalpha((wint_t)c))
return TRUE;
#endif
return (isalpha(UChar(c)) ? TRUE : FALSE);
#endif
};
-FORM_EXPORT_VAR(FIELDTYPE*) TYPE_ALPHA = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
FORM_EXPORT(FIELDTYPE *)
#include "form.priv.h"
-MODULE_ID("$Id: fty_enum.c,v 1.28 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
typedef struct
{
Generic_Enum_Type(void *arg)
{
enumARG *argp = (enumARG *)0;
- enumParams *params = (enumParams *) arg;
+ enumParams *params = (enumParams *)arg;
if (params)
{
#endif
};
-FORM_EXPORT_VAR(FIELDTYPE *)
-TYPE_ENUM = &typeENUM;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM = &typeENUM;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
FORM_EXPORT(FIELDTYPE *)
#include "form.priv.h"
-MODULE_ID("$Id: fty_generic.c,v 1.11 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_generic.c,v 1.14 2020/12/12 17:27:44 tom Exp $")
/*
* This is not a full implementation of a field type, but adds some
* support for higher level languages with some restrictions to interop
- * with C language. Especially the collection of arguments for the
+ * with C language. In particular, the collection of arguments for the
* various fieldtypes is not based on the vararg C mechanism, but on a
- * iterator based callback mechanism that allowes the high level language
+ * iterator based callback mechanism that allows the high level language
* to provide the arguments as a structure. Most languages have mechanisms
* to layout structures so that they can be passed to C.
+ *
* The languages can register a new generic fieldtype dynamically and store
* a handle (key) to the calling object as an argument. Together with that
* it can register a freearg callback, so that the high level language
* remains in control of the memory management of the arguments they pass.
* The design idea is, that the high-level language - typically a OO
- * language like C# or Java, uses it's own dispatching mechanisms
+ * language like C# or Java, uses its own dispatching mechanisms
* (polymorphism) to call the proper check routines responsible for the
* argument type. So these language implement typically only one generic
* fieldtype they register with the forms library using this call.
*
- * For that purpose we have extended the fieldtype struc by a new element
+ * For that purpose we have extended the fieldtype structure by a new element
* that gets the arguments from a single struct passed by the caller.
*
*/
| Description : Get the current position of the form cursor position
| We also return the field window
|
-| Return Values : The fields Window or NULL on error
+| Return Values : The field's Window or NULL on error
+--------------------------------------------------------------------------*/
FORM_EXPORT(WINDOW *)
_nc_form_cursor(const FORM *form, int *pRow, int *pCol)
#include "form.priv.h"
-MODULE_ID("$Id: fty_int.c,v 1.28 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_int.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
#if USE_WIDEC_SUPPORT
#define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
static void *
Generic_This_Type(void *arg)
{
- thisARG *argp = (thisARG *) 0;
- thisARG *param = (thisARG *) arg;
+ thisARG *argp = (thisARG *)0;
+ thisARG *param = (thisARG *)arg;
if (param)
{
Copy_This_Type(const void *argp)
{
const thisARG *ap = (const thisARG *)argp;
- thisARG *result = (thisARG *) 0;
+ thisARG *result = (thisARG *)0;
if (argp)
{
result = typeMalloc(thisARG, 1);
+
if (result)
{
T((T_CREATE("thisARG %p"), (void *)result));
#endif
};
-FORM_EXPORT_VAR(FIELDTYPE*) TYPE_INTEGER = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
FORM_EXPORT(FIELDTYPE *)
#include "form.priv.h"
-MODULE_ID("$Id: fty_ipv4.c,v 1.12 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_ipv4.c,v 1.14 2020/12/12 01:15:37 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
#endif
};
-FORM_EXPORT_VAR(FIELDTYPE*) TYPE_IPV4 = &typeIPV4;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4 = &typeIPV4;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
FORM_EXPORT(FIELDTYPE *)
#include "form.priv.h"
-MODULE_ID("$Id: fty_num.c,v 1.33 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_num.c,v 1.36 2020/12/12 01:15:37 tom Exp $")
#if HAVE_LOCALE_H
#include <locale.h>
static void *
Generic_This_Type(void *arg)
{
- thisARG *argn = (thisARG *) 0;
- thisPARM *args = (thisPARM *) arg;
+ thisARG *argn = (thisARG *)0;
+ thisPARM *args = (thisPARM *)arg;
if (args)
{
Copy_This_Type(const void *argp)
{
const thisARG *ap = (const thisARG *)argp;
- thisARG *result = (thisARG *) 0;
+ thisARG *result = (thisARG *)0;
if (argp)
{
result = typeMalloc(thisARG, 1);
+
if (result)
{
T((T_CREATE("thisARG %p"), (void *)result));
#endif
};
-FORM_EXPORT_VAR(FIELDTYPE*) TYPE_NUMERIC = &typeTHIS;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC = &typeTHIS;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
FORM_EXPORT(FIELDTYPE *)
#include "form.priv.h"
-MODULE_ID("$Id: fty_regex.c,v 1.30 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fty_regex.c,v 1.32 2020/12/12 01:15:37 tom Exp $")
#if HAVE_REGEX_H_FUNCS || HAVE_LIB_PCRE2 /* We prefer POSIX regex */
#endif
};
-FORM_EXPORT_VAR(FIELDTYPE*) TYPE_REGEXP = &typeREGEXP;
+FORM_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP = &typeREGEXP;
#if NCURSES_INTEROP_FUNCS
/* The next routines are to simplify the use of ncurses from
- programming languages with restictions on interop with C level
+ programming languages with restrictions on interop with C level
constructs (e.g. variable access or va_list + ellipsis constructs)
*/
FORM_EXPORT(FIELDTYPE *)
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: form.3x,v 1.35 2020/03/28 19:06:28 tom Exp $
+.\" $Id: form.3x,v 1.36 2020/12/12 16:34:33 tom Exp $
.TH form 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.
The following table lists each \fBform\fR routine and the name of
the manual page on which it is described.
+Routines flagged with \*(``*\*(''
+are ncurses-specific, not present in SVr4.
.
.TS
l l
form_opts_off \fBform_opts\fR(3X)
form_opts_on \fBform_opts\fR(3X)
form_page \fBform_page\fR(3X)
-form_request_by_name \fBform_requestname\fR(3X)
-form_request_name \fBform_requestname\fR(3X)
+form_request_by_name \fBform_requestname\fR(3X)*
+form_request_name \fBform_requestname\fR(3X)*
form_sub \fBform_win\fR(3X)
form_term \fBform_hook\fR(3X)
form_userptr \fBform_userptr\fR(3X)
set_form_win \fBform_win\fR(3X)
set_max_field \fBform_field_buffer\fR(3X)
set_new_page \fBform_new_page\fR(3X)
-unfocus_current_field \fBform_page\fR(3X)
+unfocus_current_field \fBform_page\fR(3X)*
unpost_form \fBform_post\fR(3X)
.TE
.SH RETURN VALUE
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: form_field_validation.3x,v 1.27 2020/10/18 00:07:45 tom Exp $
+.\" $Id: form_field_validation.3x,v 1.33 2020/12/12 19:57:55 tom Exp $
.TH form_field_validation 3X ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.SH SYNOPSIS
\fB#include <form.h>\fR
.sp
-\fBint set_field_type(FIELD *\fP\fIfield\fP\fB, FIELDTYPE *\fP\fItype\fP\fB, ...);\fP
+\fBvoid *field_arg(const FIELD *\fP\fIfield\fP\fB);\fP
.br
\fBFIELDTYPE *field_type(const FIELD *\fP\fIfield\fP\fB);\fP
.br
-\fBvoid *field_arg(const FIELD *\fP\fIfield\fP\fB);\fP
+\fBint set_field_type(FIELD *\fP\fIfield\fP\fB, FIELDTYPE *\fP\fItype\fP\fB, ...);\fP
.sp
+/* predefined field types */
+.br
\fBFIELDTYPE *TYPE_ALNUM;\fP
.br
\fBFIELDTYPE *TYPE_ALPHA;\fP
\fBFIELDTYPE *TYPE_IPV4;\fP
.br
.SH DESCRIPTION
-The function \fBset_field_type\fR declares a data type for a given form field.
+By default, no validation is done on form fields.
+You can associate a form with with a \fIfield type\fP,
+making the form library validate input.
+.SS field_arg
+Returns a pointer to the field's argument block.
+The \fIargument block\fP is an opaque structure containing
+a copy of the arguments provided in a \fBset_field_type\fP call.
+.SS field_type
+Returns a pointer to the \fIfield type\fP associated with the form field,
+i.e., by calling \fBset_field_type\fP.
+.SS set_field_type
+The function \fBset_field_type\fR associates
+a field type with a given form field.
This is the type checked by validation functions.
+Most field types are configurable,
+via arguments which the caller provides when calling \fBset_field_type\fP.
+.PP
+Several field types are predefined by the form library.
+.SS Predefined types
+.PP
+It is possible to set up new programmer-defined field types.
+Field types are implemented via the \fBFIELDTYPE\fP data
+structure, which contains several pointers to functions.
+.PP
+See the \fBform_fieldtype\fR(3X) manual page,
+which describes functions which can be used to construct
+a field-type dynamically.
+.PP
The predefined types are as follows:
.TP 5
TYPE_ALNUM
Alphanumeric data.
-Requires a third \fBint\fR argument, a minimum field width.
+Required parameter:
+.RS
+.bP
+a third \fBint\fR argument, a minimum field width.
+.RE
.TP 5
TYPE_ALPHA
Character data.
-Requires a third \fBint\fR argument, a minimum field width.
+Required parameter:
+.RS
+.bP
+a third \fBint\fR argument, a minimum field width.
+.RE
.TP 5
TYPE_ENUM
Accept one of a specified set of strings.
-Requires additional parameters:
+Required parameters:
.RS
.bP
a third \fB(char **)\fR argument pointing to a string list;
.bP
a fourth \fBint\fR flag argument to enable case-sensitivity;
.bP
-and a fifth \fBint\fR flag argument specifying whether a partial
+a fifth \fBint\fR flag argument specifying whether a partial
match must be a unique one.
If this flag is off, a prefix matches the first
of any set of more than one list elements with that prefix.
+.RE
.IP
The library copies the string list,
so you may use a list that lives in automatic variables on the stack.
-.RE
.TP 5
TYPE_INTEGER
Integer data, parsable to an integer by \fBatoi\fP(3).
-Requires additional parameters:
+Required parameters:
.RS
.bP
a third \fBint\fR argument controlling the precision,
.bP
a fourth \fBlong\fR argument constraining minimum value,
.bP
-and a fifth \fBlong\fR constraining maximum value.
+a fifth \fBlong\fR constraining maximum value.
If the maximum value is less than or equal to the minimum value, the range is
simply ignored.
+.RE
+.IP
On return, the field buffer is formatted according to the
\fBprintf\fR format specification \*(``.*ld\*('',
where the \*(``*\*('' is replaced by the precision argument.
.IP
For details of the precision handling see \fBprintf\fR(3).
-.RE
.TP 5
TYPE_NUMERIC
Numeric data (may have a decimal-point part).
-This requires additional parameters:
+Required parameters:
.RS
.bP
a third \fBint\fR argument controlling the precision,
the decimal point character must be the one specified by your locale.
If the maximum value is less than or equal to the minimum value,
the range is simply ignored.
+.RE
.IP
On return, the field buffer is formatted according to the
\fBprintf\fR format specification \*(``.*f\*('',
where the \*(``*\*('' is replaced by the precision argument.
.IP
For details of the precision handling see \fBprintf\fR(3).
-.RE
.TP 5
TYPE_REGEXP
Regular expression data.
-Requires a regular expression \fB(char *)\fR third argument.
+Required parameter:
+.RS
+.bP
+a third argument, a regular expression \fB(char *)\fR string.
The data is valid if the regular expression matches it.
+.RE
.IP
Regular expressions
are in the format of \fBregcomp\fR and \fBregexec\fR.
.TP 5
TYPE_IPV4
An Internet Protocol Version 4 address.
-This requires no additional argument.
-The library checks whether or not the buffer has the form a.b.c.d,
-where a,b,c and d are numbers between 0 and 255.
+Required parameter:
+.RS
+.bP
+none
+.RE
+.IP
+The form library checks whether or not the buffer has the form \fIa.b.c.d\fP,
+where \fIa\fP, \fIb\fP, \fIc\fP, and \fId\fP are numbers in the range 0 to 255.
Trailing blanks in the buffer are ignored.
The address itself is not validated.
.IP
This is an ncurses extension;
this field type may not be available in other curses implementations.
-.PP
-It is possible to set up new programmer-defined field types.
-See the \fBform_fieldtype\fR(3X) manual page.
.SH RETURN VALUE
The functions \fBfield_type\fR and \fBfield_arg\fR return \fBNULL\fR on error.
The function \fBset_field_type\fR returns one of the following:
.SH SEE ALSO
\fBcurses\fR(3X),
\fBform\fR(3X),
+\fBform_fieldtype\fR(3X),
\fBform_variables\fR(3X).
.SH NOTES
The header file \fB<form.h>\fR automatically includes the header file
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: form_fieldtype.3x,v 1.23 2020/10/24 09:05:17 tom Exp $
+.\" $Id: form_fieldtype.3x,v 1.28 2020/12/12 17:11:21 tom Exp $
+.de bP
+.ie n .IP \(bu 4
+.el .IP \(bu 2
+..
.TH form_fieldtype 3X ""
.SH NAME
\fBform_fieldtype\fR \- define validation-field types
\fBFIELDTYPE *link_fieldtype(FIELDTYPE *\fP\fItype1\fP\fB,\fP
\fBFIELDTYPE *\fP\fItype2\fP\fB);\fP
.SH DESCRIPTION
+.SS new_fieldtype
The function \fBnew_fieldtype\fR creates a new field type usable for data
validation.
-You supply it with \fIfield_check\fR, a predicate to check the
+Its parameters are function pointers:
+.TP 5
+\fIfield_check\fR
+This function checks the
validity of an entered data string whenever the user attempts to leave a field.
+It has two arguments:
+.RS
+.bP
The (FIELD *) argument is passed in so the validation predicate can see the
-field's buffer, sizes and other attributes; the second argument is an
+field's buffer, sizes and other attributes.
+.bP
+The second argument is an
argument-block structure, about which more below.
+.RE
+.TP 5
+\fIchar_check\fR
+This function validates input characters as they are entered.
+The form library passes it the character to be checked
+and a pointer to an argument-block structure.
+.SS free_fieldtype
.PP
-You also supply \fBnew_fieldtype\fR with \fIchar_check\fR,
-a function to validate input characters as they are entered; it will be passed
-the character to be checked and a pointer to an argument-block structure.
-.PP
-The function \fBfree_fieldtype\fR frees the space allocated for a given
-validation type.
+The \fBfree_fieldtype\fR function
+frees the space allocated for a given validation type by \fBnew_fieldtype\fP.
+.SS set_fieldtype_arg
.PP
The function \fBset_fieldtype_arg\fR associates
-three storage-management functions with a field type.
-The \fImake_arg\fR function is automatically applied to the
+three storage-management functions with a field type:
+.TP 5
+\fImake_arg\fR
+This function is automatically applied to the
list of arguments you give \fBset_field_type\fR when attaching validation
-to a field; its job is to bundle these into an allocated argument-block
-object which can later be passed to validation predicated.
-The other two hook arguments should copy and free argument-block structures.
-They will be used by the forms-driver code.
-You must supply the \fImake_arg\fR function,
-the other two are optional, you may supply NULL for them.
-In this case it is assumed
+to a field.
+It stores the arguments in an allocated argument-block
+object which is used when validating input.
+.TP 5
+\fIcopy_arg\fR
+This function may be used by applications to copy argument-blocks.
+.TP 5
+\fIfree_arg\fR
+Frees an argument-block structure.
+.PP
+You must supply the \fImake_arg\fR function.
+The other two are optional: you may supply NULL for them.
+In this case, the form library assumes
that \fImake_arg\fR does not allocate memory but simply loads the
argument into a single scalar value.
-.PP
-The function \fBlink_fieldtype\fR creates
-a new field type from the two given types.
-They are connected by an logical 'OR'.
+.SS set_fieldtype_choice
.PP
The form driver requests \fBREQ_NEXT_CHOICE\fR and \fBREQ_PREV_CHOICE\fR assume
that the possible values of a field form an ordered set, and provide the forms
user with a way to move through the set.
+.PP
The \fBset_fieldtype_choice\fR
function allows forms programmers to define successor and predecessor functions
for the field type.
These functions take the field pointer and an
argument-block structure as arguments.
+.SS link_fieldtype
+.PP
+The function \fBlink_fieldtype\fR creates
+a new field type from the two given types.
+They are connected by an logical 'OR'.
.SH RETURN VALUE
The pointer-valued routines return NULL on error.
They set \fBerrno\fP according to their success:
.B E_SYSTEM_ERROR
System error occurred (see \fBerrno\fR(3)).
.SH SEE ALSO
-\fBcurses\fR(3X), \fBform\fR(3X).
+\fBcurses\fR(3X),
+\fBform\fR(3X),
+\fBform_field_validation\fR(3X).
.SH NOTES
The header file \fB<form.h>\fR automatically includes the header file
\fB<curses.h>\fR.
-.PP
-All of the \fB(char *)\fR arguments of these functions should actually be
-\fB(void *)\fR. The type has been left uncorrected for strict compatibility
-with System V.
.SH PORTABILITY
These routines emulate the System V forms library.
They were not supported on
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: form_requestname.3x,v 1.15 2020/10/24 09:01:37 tom Exp $
+.\" $Id: form_requestname.3x,v 1.16 2020/12/12 16:37:14 tom Exp $
.TH form_requestname 3X ""
.SH NAME
\fBform_request_by_name\fP,
\fBint form_request_by_name(const char *\fP\fIname\fP\fB);\fP
.br
.SH DESCRIPTION
+.SS form_request_name
The function \fBform_request_name\fR returns the printable name of a form
request code.
-.br
+.SS form_request_name_by_name
The function \fBform_request_by_name\fR searches in the name-table for a request
with the given name and returns its request code.
Otherwise E_NO_MATCH is returned.
.SH RETURN VALUE
\fBform_request_name\fR returns \fBNULL\fR on error and sets \fBerrno\fP
to \fBE_BAD_ARGUMENT\fR.
-.br
+.PP
\fBform_request_by_name\fR returns \fBE_NO_MATCH\fR on error.
It does not set \fBerrno\fP.
.SH SEE ALSO
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: form_variables.3x,v 1.6 2020/02/02 23:34:34 tom Exp $
+.\" $Id: form_variables.3x,v 1.7 2020/12/12 14:45:16 tom Exp $
.TH form_variables 3X ""
.na
.hy 0
.fi
.SH DESCRIPTION
These are building blocks for the form library,
-defining fields that can be created using \fBset_fieldtype\fP(3X).
+defining fields that can be created using
+the \fBform_fieldtype\fP(3X) functions.
Each provides functions for field- and character-validation,
according to the given datatype.
.SS TYPE_ALNUM
-# $Id: manhtml.aliases,v 1.18 2020/10/17 22:56:04 tom Exp $
+# $Id: manhtml.aliases,v 1.19 2020/12/12 14:45:55 tom Exp $
#***************************************************************************
# Copyright 2019,2020 Thomas E. Dickey *
# Copyright 2013,2017 Free Software Foundation, Inc. *
newterm(3X) curs_initscr(3X)
refresh(3X) curs_refresh(3X)
reset_shell_mode(3X) curs_kernel(3X)
-set_fieldtype(3X) form_fieldtype(3X)
set_term(3X) curs_initscr(3X)
setcchar(3X) curs_getcchar(3X)
setupterm(3X) curs_terminfo(3X)
#include "menu.priv.h"
-MODULE_ID("$Id: m_cursor.c,v 1.24 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.25 2020/12/12 00:38:02 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-_nc_menu_cursor_pos(const MENU * menu, const ITEM * item, int *pY, int *pX)
+_nc_menu_cursor_pos(const MENU *menu, const ITEM *item, int *pY, int *pX)
{
if (!menu || !pX || !pY)
return (E_BAD_ARGUMENT);
else
{
- if ((ITEM *) 0 == item)
+ if ((ITEM *)0 == item)
item = menu->curitem;
- assert(item != (ITEM *) 0);
+ assert(item != (ITEM *)0);
if (!(menu->status & _POSTED))
return (E_NOT_POSTED);
| E_NOT_POSTED - Menu is not posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-pos_menu_cursor(const MENU * menu)
+pos_menu_cursor(const MENU *menu)
{
WINDOW *win, *sub;
int x = 0, y = 0;
- int err = _nc_menu_cursor_pos(menu, (ITEM *) 0, &y, &x);
+ int err = _nc_menu_cursor_pos(menu, (ITEM *)0, &y, &x);
T((T_CALLED("pos_menu_cursor(%p)"), (const void *)menu));
#include "menu.priv.h"
-MODULE_ID("$Id: m_driver.c,v 1.35 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.36 2020/12/12 00:38:02 tom Exp $")
/* Macros */
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
_nc_Match_Next_Character_In_Item_Name
-(MENU * menu, int ch, ITEM ** item)
+(MENU *menu, int ch, ITEM **item)
{
bool found = FALSE, passed = FALSE;
int idx, last;
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-menu_driver(MENU * menu, int c)
+menu_driver(MENU *menu, int c)
{
#define NAVIGATE(dir) \
if (!item->dir)\
#include "menu.priv.h"
-MODULE_ID("$Id: m_format.c,v 1.20 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_format.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
#define minimum(a,b) ((a)<(b) ? (a): (b))
| E_POSTED - the menu is already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_format(MENU * menu, int rows, int cols)
+set_menu_format(MENU *menu, int rows, int cols)
{
int total_rows, total_cols;
| Return Values : -
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
-menu_format(const MENU * menu, int *rows, int *cols)
+menu_format(const MENU *menu, int *rows, int *cols)
{
if (rows)
*rows = Normalize_Menu(menu)->frows;
#include "menu.priv.h"
-MODULE_ID("$Id: m_global.c,v 1.31 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_global.c,v 1.32 2020/12/12 00:38:02 tom Exp $")
static char mark[] = "-";
/* *INDENT-OFF* */
| Return Values : -
+--------------------------------------------------------------------------*/
NCURSES_INLINE static void
-ComputeMaximum_NameDesc_Lengths(MENU * menu)
+ComputeMaximum_NameDesc_Lengths(MENU *menu)
{
unsigned MaximumNameLength = 0;
unsigned MaximumDescriptionLength = 0;
| Return Values : -
+--------------------------------------------------------------------------*/
NCURSES_INLINE static void
-ResetConnectionInfo(MENU * menu, ITEM ** items)
+ResetConnectionInfo(MENU *menu, ITEM **items)
{
ITEM **item;
for (item = items; *item; item++)
{
(*item)->index = 0;
- (*item)->imenu = (MENU *) 0;
+ (*item)->imenu = (MENU *)0;
}
if (menu->pattern)
free(menu->pattern);
menu->pattern = (char *)0;
menu->pindex = 0;
- menu->items = (ITEM **) 0;
+ menu->items = (ITEM **)0;
menu->nitems = 0;
}
| FALSE - connection failed
+--------------------------------------------------------------------------*/
MENU_EXPORT(bool)
-_nc_Connect_Items(MENU * menu, ITEM ** items)
+_nc_Connect_Items(MENU *menu, ITEM **items)
{
ITEM **item;
unsigned int ItemCount = 0;
| Return Values : -
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
-_nc_Disconnect_Items(MENU * menu)
+_nc_Disconnect_Items(MENU *menu)
{
if (menu && menu->items)
ResetConnectionInfo(menu, menu->items);
| Return Values : the width
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-_nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ )
+_nc_Calculate_Text_Width(const TEXT *item /*FIXME: limit length */ )
{
#if USE_WIDEC_SUPPORT
int result = item->length;
*/
#if USE_WIDEC_SUPPORT
static int
-calculate_actual_width(MENU * menu, bool name)
+calculate_actual_width(MENU *menu, bool name)
{
int width = 0;
int check = 0;
| Return Values : -
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
-_nc_Calculate_Item_Length_and_Width(MENU * menu)
+_nc_Calculate_Item_Length_and_Width(MENU *menu)
{
int l;
| Return Values : -
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
-_nc_Link_Items(MENU * menu)
+_nc_Link_Items(MENU *menu)
{
if (menu && menu->items && *(menu->items))
{
(cycle ? menu->items[(Last_in_Row >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Row] :
- (ITEM *) 0);
+ (ITEM *)0);
item->right = ((col < (Number_Of_Columns - 1)) &&
((i + 1) < Number_Of_Items)
)?
menu->items[i + 1] :
(cycle ? menu->items[row * Number_Of_Columns] :
- (ITEM *) 0
+ (ITEM *)0
);
Last_in_Column = (menu->rows - 1) * Number_Of_Columns + col;
(cycle ? menu->items[(Last_in_Column >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Column] :
- (ITEM *) 0);
+ (ITEM *)0);
item->down = ((i + Number_Of_Columns) < Number_Of_Items)
?
menu->items[i + Number_Of_Columns] :
(cycle ? menu->items[(row + 1) < menu->rows ?
Number_Of_Items - 1 : col] :
- (ITEM *) 0);
+ (ITEM *)0);
item->x = (short)col;
item->y = (short)row;
if (++col == Number_Of_Columns)
(cycle ? (Last_in_Column >= Number_Of_Items) ?
menu->items[Last_in_Column - Number_Of_Rows] :
menu->items[Last_in_Column] :
- (ITEM *) 0);
+ (ITEM *)0);
item->right = ((i + Number_Of_Rows) < Number_Of_Items)
?
menu->items[i + Number_Of_Rows] :
- (cycle ? menu->items[row] : (ITEM *) 0);
+ (cycle ? menu->items[row] : (ITEM *)0);
Last_in_Row = col * Number_Of_Rows + (Number_Of_Rows - 1);
menu->items[(Last_in_Row >= Number_Of_Items) ?
Number_Of_Items - 1 :
Last_in_Row] :
- (ITEM *) 0);
+ (ITEM *)0);
item->down = (row < (Number_Of_Rows - 1))
?
(col - 1) * Number_Of_Rows + row + 1]) :
(cycle ?
menu->items[col * Number_Of_Rows] :
- (ITEM *) 0
+ (ITEM *)0
);
item->x = (short)col;
| Return Values : -
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
-_nc_Show_Menu(const MENU * menu)
+_nc_Show_Menu(const MENU *menu)
{
WINDOW *win;
int maxy, maxx;
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
_nc_New_TopRow_and_CurrentItem(
- MENU * menu,
+ MENU *menu,
int new_toprow,
- ITEM * new_current_item)
+ ITEM *new_current_item)
{
ITEM *cur_item;
bool mterm_called = FALSE;
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_cur.c,v 1.20 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_cur.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_current_item(MENU * menu, ITEM * item)
+set_current_item(MENU *menu, ITEM *item)
{
T((T_CALLED("set_current_item(%p,%p)"), (void *)menu, (void *)item));
| Return Values : Item pointer or NULL if failure
+--------------------------------------------------------------------------*/
MENU_EXPORT(ITEM *)
-current_item(const MENU * menu)
+current_item(const MENU *menu)
{
T((T_CALLED("current_item(%p)"), (const void *)menu));
- returnItem((menu && menu->items) ? menu->curitem : (ITEM *) 0);
+ returnItem((menu && menu->items) ? menu->curitem : (ITEM *)0);
}
/*---------------------------------------------------------------------------
| Return Values : The index or ERR if this is an invalid item pointer
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-item_index(const ITEM * item)
+item_index(const ITEM *item)
{
T((T_CALLED("item_index(%p)"), (const void *)item));
returnCode((item && item->imenu) ? item->index : ERR);
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_nam.c,v 1.17 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_nam.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| Return Values : See above; returns NULL if item is invalid
+--------------------------------------------------------------------------*/
MENU_EXPORT(const char *)
-item_name(const ITEM * item)
+item_name(const ITEM *item)
{
T((T_CALLED("item_name(%p)"), (const void *)item));
returnCPtr((item) ? item->name.str : (char *)0);
| Return Values : See above; Returns NULL if item is invalid
+--------------------------------------------------------------------------*/
MENU_EXPORT(const char *)
-item_description(const ITEM * item)
+item_description(const ITEM *item)
{
T((T_CALLED("item_description(%p)"), (const void *)item));
returnCPtr((item) ? item->description.str : (char *)0);
#endif
#endif
-MODULE_ID("$Id: m_item_new.c,v 1.35 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.36 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
mbstowcs(temp, s, (unsigned)count);
for (n = 0; n < count; ++n)
- if (!iswprint((wint_t) temp[n]))
+ if (!iswprint((wint_t)temp[n]))
{
result = FALSE;
break;
if (!name || (*name == '\0') || !Is_Printable_String(name))
{
- item = (ITEM *) 0;
+ item = (ITEM *)0;
SET_ERROR(E_BAD_ARGUMENT);
}
else
{
item = typeCalloc(ITEM, 1);
+
if (item)
{
*item = _nc_Default_Item; /* hope we have struct assignment */
| E_CONNECTED - item is still connected to a menu
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-free_item(ITEM * item)
+free_item(ITEM *item)
{
T((T_CALLED("free_item(%p)"), (void *)item));
| E_SYSTEM_ERROR - no memory to store mark
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_mark(MENU * menu, const char *mark)
+set_menu_mark(MENU *menu, const char *mark)
{
short l;
| Return Values : The marker string pointer or NULL if no marker defined
+--------------------------------------------------------------------------*/
MENU_EXPORT(const char *)
-menu_mark(const MENU * menu)
+menu_mark(const MENU *menu)
{
T((T_CALLED("menu_mark(%p)"), (const void *)menu));
returnPtr(Normalize_Menu(menu)->mark);
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_opt.c,v 1.20 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_opt.c,v 1.21 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_BAD_ARGUMENT - invalid item options
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_item_opts(ITEM * item, Item_Options opts)
+set_item_opts(ITEM *item, Item_Options opts)
{
T((T_CALLED("set_menu_opts(%p,%d)"), (void *)item, opts));
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-item_opts_off(ITEM * item, Item_Options opts)
+item_opts_off(ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
| E_BAD_ARGUMENT - invalid options
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-item_opts_on(ITEM * item, Item_Options opts)
+item_opts_on(ITEM *item, Item_Options opts)
{
ITEM *citem = item; /* use a copy because set_item_opts must detect
| Return Values : Items options
+--------------------------------------------------------------------------*/
MENU_EXPORT(Item_Options)
-item_opts(const ITEM * item)
+item_opts(const ITEM *item)
{
T((T_CALLED("item_opts(%p)"), (const void *)item));
returnItemOpts(ALL_ITEM_OPTS & Normalize_Item(item)->opt);
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_top.c,v 1.13 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_NOT_CONNECTED - there are no items for the menu
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_top_row(MENU * menu, int row)
+set_top_row(MENU *menu, int row)
{
ITEM *item;
{
if (menu->status & _IN_DRIVER)
RETURN(E_BAD_STATE);
- if (menu->items == (ITEM **) 0)
+ if (menu->items == (ITEM **)0)
RETURN(E_NOT_CONNECTED);
if ((row < 0) || (row > (menu->rows - menu->arows)))
| Return Values : The row number or ERR if there is no row
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-top_row(const MENU * menu)
+top_row(const MENU *menu)
{
T((T_CALLED("top_row(%p)"), (const void *)menu));
if (menu && menu->items && *(menu->items))
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_use.c,v 1.20 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_use.c,v 1.21 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_item_userptr(ITEM * item, void *userptr)
+set_item_userptr(ITEM *item, void *userptr)
{
T((T_CALLED("set_item_userptr(%p,%p)"), (void *)item, (void *)userptr));
Normalize_Item(item)->userptr = userptr;
| NULL is returned.
+--------------------------------------------------------------------------*/
MENU_EXPORT(void *)
-item_userptr(const ITEM * item)
+item_userptr(const ITEM *item)
{
T((T_CALLED("item_userptr(%p)"), (const void *)item));
returnVoidPtr(Normalize_Item(item)->userptr);
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_val.c,v 1.17 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_REQUEST_DENIED - not selectable or single valued menu
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_item_value(ITEM * item, bool value)
+set_item_value(ITEM *item, bool value)
{
MENU *menu;
| FALSE - if item is not selected
+--------------------------------------------------------------------------*/
MENU_EXPORT(bool)
-item_value(const ITEM * item)
+item_value(const ITEM *item)
{
T((T_CALLED("item_value(%p)"), (const void *)item));
returnBool((Normalize_Item(item)->value) ? TRUE : FALSE);
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_vis.c,v 1.18 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_item_vis.c,v 1.19 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| FALSE if invisible
+--------------------------------------------------------------------------*/
MENU_EXPORT(bool)
-item_visible(const ITEM * item)
+item_visible(const ITEM *item)
{
MENU *menu;
#include "menu.priv.h"
-MODULE_ID("$Id: m_items.c,v 1.19 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_items.c,v 1.20 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| passed to the function
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_items(MENU * menu, ITEM ** items)
+set_menu_items(MENU *menu, ITEM **items)
{
T((T_CALLED("set_menu_items(%p,%p)"), (void *)menu, (void *)items));
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
MENU_EXPORT(ITEM **)
-menu_items(const MENU * menu)
+menu_items(const MENU *menu)
{
T((T_CALLED("menu_items(%p)"), (const void *)menu));
- returnItemPtr(menu ? menu->items : (ITEM **) 0);
+ returnItemPtr(menu ? menu->items : (ITEM **)0);
}
/*---------------------------------------------------------------------------
| Return Values : Number of items or -1 to indicate error.
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-item_count(const MENU * menu)
+item_count(const MENU *menu)
{
T((T_CALLED("item_count(%p)"), (const void *)menu));
returnCode(menu ? menu->nitems : -1);
#include "menu.priv.h"
-MODULE_ID("$Id: m_new.c,v 1.23 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_new.c,v 1.24 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| Return Values : NULL on error
+--------------------------------------------------------------------------*/
MENU_EXPORT(MENU *)
-NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
+NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM **items)
{
int err = E_SYSTEM_ERROR;
MENU *menu = typeCalloc(MENU, 1);
{
err = E_NOT_CONNECTED;
free(menu);
- menu = (MENU *) 0;
+ menu = (MENU *)0;
}
else
err = E_OK;
+--------------------------------------------------------------------------*/
#if NCURSES_SP_FUNCS
MENU_EXPORT(MENU *)
-new_menu(ITEM ** items)
+new_menu(ITEM **items)
{
return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items);
}
| E_POSTED - Menu is already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-free_menu(MENU * menu)
+free_menu(MENU *menu)
{
T((T_CALLED("free_menu(%p)"), (void *)menu));
if (!menu)
#include "menu.priv.h"
-MODULE_ID("$Id: m_opts.c,v 1.22 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_opts.c,v 1.23 2020/12/12 00:38:08 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_opts(MENU * menu, Menu_Options opts)
+set_menu_opts(MENU *menu, Menu_Options opts)
{
T((T_CALLED("set_menu_opts(%p,%d)"), (void *)menu, opts));
{
ITEM **item;
- if (((item = menu->items) != (ITEM **) 0))
+ if (((item = menu->items) != (ITEM **)0))
for (; *item; item++)
(*item)->value = FALSE;
}
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-menu_opts_off(MENU * menu, Menu_Options opts)
+menu_opts_off(MENU *menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-menu_opts_on(MENU * menu, Menu_Options opts)
+menu_opts_on(MENU *menu, Menu_Options opts)
{
MENU *cmenu = menu; /* use a copy because set_menu_opts must detect
| Return Values : Menu options
+--------------------------------------------------------------------------*/
MENU_EXPORT(Menu_Options)
-menu_opts(const MENU * menu)
+menu_opts(const MENU *menu)
{
T((T_CALLED("menu_opts(%p)"), (const void *)menu));
returnMenuOpts(ALL_MENU_OPTS & Normalize_Menu(menu)->opt);
#include "menu.priv.h"
-MODULE_ID("$Id: m_pad.c,v 1.15 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.16 2020/12/12 00:38:14 tom Exp $")
/* Macro to redraw menu if it is posted and changed */
#define Refresh_Menu(menu) \
| E_BAD_ARGUMENT - an invalid value has been passed
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_pad(MENU * menu, int pad)
+set_menu_pad(MENU *menu, int pad)
{
- bool do_refresh = (menu != (MENU *) 0);
+ bool do_refresh = (menu != (MENU *)0);
T((T_CALLED("set_menu_pad(%p,%d)"), (void *)menu, pad));
| Return Values : The pad character
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-menu_pad(const MENU * menu)
+menu_pad(const MENU *menu)
{
T((T_CALLED("menu_pad(%p)"), (const void *)menu));
returnCode(Normalize_Menu(menu)->pad);
#include "menu.priv.h"
-MODULE_ID("$Id: m_pattern.c,v 1.18 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_pattern.c,v 1.19 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| PatternString - as expected
+--------------------------------------------------------------------------*/
MENU_EXPORT(char *)
-menu_pattern(const MENU * menu)
+menu_pattern(const MENU *menu)
{
static char empty[] = "";
| E_NO_MATCH - no item matches pattern
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_pattern(MENU * menu, const char *p)
+set_menu_pattern(MENU *menu, const char *p)
{
ITEM *matchitem;
int matchpos;
#include "menu.priv.h"
-MODULE_ID("$Id: m_post.c,v 1.33 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_post.c,v 1.34 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| Return Values : -
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
-_nc_Post_Item(const MENU * menu, const ITEM * item)
+_nc_Post_Item(const MENU *menu, const ITEM *item)
{
int i;
chtype ch;
| Return Values : -
+--------------------------------------------------------------------------*/
MENU_EXPORT(void)
-_nc_Draw_Menu(const MENU * menu)
+_nc_Draw_Menu(const MENU *menu)
{
ITEM *item = menu->items[0];
ITEM *lasthor, *lastvert;
werase(menu->win);
wbkgdset(menu->win, s_bkgd);
- lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *) 0 : item;
+ lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : item;
do
{
wmove(menu->win, y, 0);
hitem = item;
- lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *) 0 : hitem;
+ lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
do
{
| E_POSTED - Menu already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-post_menu(MENU * menu)
+post_menu(MENU *menu)
{
T((T_CALLED("post_menu(%p)"), (void *)menu));
| E_NOT_POSTED - menu is not posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-unpost_menu(MENU * menu)
+unpost_menu(MENU *menu)
{
WINDOW *win;
#include "menu.priv.h"
-MODULE_ID("$Id: m_scale.c,v 1.12 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_scale.c,v 1.13 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_NOT_CONNECTED - no items are connected to menu
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-scale_menu(const MENU * menu, int *rows, int *cols)
+scale_menu(const MENU *menu, int *rows, int *cols)
{
T((T_CALLED("scale_menu(%p,%p,%p)"),
(const void *)menu,
#include "menu.priv.h"
-MODULE_ID("$Id: m_spacing.c,v 1.21 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_spacing.c,v 1.22 2020/12/12 00:38:14 tom Exp $")
#define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
#define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col)
+set_menu_spacing(MENU *menu, int s_desc, int s_row, int s_col)
{
MENU *m; /* split for ATAC workaround */
| Return Values : E_OK - on success
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-menu_spacing(const MENU * menu, int *s_desc, int *s_row, int *s_col)
+menu_spacing(const MENU *menu, int *s_desc, int *s_row, int *s_col)
{
const MENU *m; /* split for ATAC workaround */
#include "menu.priv.h"
-MODULE_ID("$Id: m_sub.c,v 1.14 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_sub.c,v 1.15 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_sub(MENU * menu, WINDOW *win)
+set_menu_sub(MENU *menu, WINDOW *win)
{
T((T_CALLED("set_menu_sub(%p,%p)"), (void *)menu, (void *)win));
| Return Values : NULL on error, otherwise a pointer to the window
+--------------------------------------------------------------------------*/
MENU_EXPORT(WINDOW *)
-menu_sub(const MENU * menu)
+menu_sub(const MENU *menu)
{
const MENU *m = Normalize_Menu(menu);
#include "menu.priv.h"
-MODULE_ID("$Id: m_trace.c,v 1.8 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_trace.c,v 1.9 2020/12/12 00:38:14 tom Exp $")
MENU_EXPORT(ITEM *)
-_nc_retrace_item(ITEM * code)
+_nc_retrace_item(ITEM *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
MENU_EXPORT(ITEM **)
-_nc_retrace_item_ptr(ITEM ** code)
+_nc_retrace_item_ptr(ITEM **code)
{
T((T_RETURN("%p"), (void *)code));
return code;
}
MENU_EXPORT(MENU *)
-_nc_retrace_menu(MENU * code)
+_nc_retrace_menu(MENU *code)
{
T((T_RETURN("%p"), (void *)code));
return code;
#include "menu.priv.h"
-MODULE_ID("$Id: m_userptr.c,v 1.20 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_userptr.c,v 1.21 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| Return Values : E_OK - success
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_userptr(MENU * menu, void *userptr)
+set_menu_userptr(MENU *menu, void *userptr)
{
T((T_CALLED("set_menu_userptr(%p,%p)"), (void *)menu, (void *)userptr));
Normalize_Menu(menu)->userptr = userptr;
| NULL is returned
+--------------------------------------------------------------------------*/
MENU_EXPORT(void *)
-menu_userptr(const MENU * menu)
+menu_userptr(const MENU *menu)
{
T((T_CALLED("menu_userptr(%p)"), (const void *)menu));
returnVoidPtr(Normalize_Menu(menu)->userptr);
#include "menu.priv.h"
-MODULE_ID("$Id: m_win.c,v 1.19 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_win.c,v 1.20 2020/12/12 00:38:14 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
| E_POSTED - menu is already posted
+--------------------------------------------------------------------------*/
MENU_EXPORT(int)
-set_menu_win(MENU * menu, WINDOW *win)
+set_menu_win(MENU *menu, WINDOW *win)
{
T((T_CALLED("set_menu_win(%p,%p)"), (void *)menu, (void *)win));
| Return Values : NULL on error, otherwise pointer to window
+--------------------------------------------------------------------------*/
MENU_EXPORT(WINDOW *)
-menu_win(const MENU * menu)
+menu_win(const MENU *menu)
{
const MENU *m = Normalize_Menu(menu);
* Author: Juergen Pfeifer, 1995,1997 *
****************************************************************************/
-/* $Id: menu.h,v 1.25 2020/07/04 20:38:43 tom Exp $ */
+/* $Id: menu.h,v 1.26 2020/12/12 00:38:02 tom Exp $ */
#ifndef ETI_MENU
#define ETI_MENU
#include <eti.h>
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
#if defined(BUILDING_MENU)
#define MENU_EXPORT(type) MENU_IMPEXP type NCURSES_API
#define MENU_EXPORT_VAR(type) MENU_IMPEXP type
-typedef int Menu_Options;
-typedef int Item_Options;
+ typedef int Menu_Options;
+ typedef int Item_Options;
/* Menu options: */
#define O_ONEVALUE (0x01)
#define O_SELECTABLE (0x01)
#if !NCURSES_OPAQUE_MENU
-typedef struct
-{
- const char* str;
- unsigned short length;
-} TEXT;
-#endif /* !NCURSES_OPAQUE_MENU */
+ typedef struct
+ {
+ const char *str;
+ unsigned short length;
+ }
+ TEXT;
+#endif /* !NCURSES_OPAQUE_MENU */
-struct tagMENU;
+ struct tagMENU;
-typedef struct tagITEM
+ typedef struct tagITEM
#if !NCURSES_OPAQUE_MENU
-{
- TEXT name; /* name of menu item */
- TEXT description; /* description of item, optional in display */
- struct tagMENU *imenu; /* Pointer to parent menu */
- void *userptr; /* Pointer to user defined per item data */
- Item_Options opt; /* Item options */
- short index; /* Item number if connected to a menu */
- short y; /* y and x location of item in menu */
- short x;
- bool value; /* Selection value */
-
- struct tagITEM *left; /* neighbor items */
- struct tagITEM *right;
- struct tagITEM *up;
- struct tagITEM *down;
-
-}
-#endif /* !NCURSES_OPAQUE_MENU */
-ITEM;
-
-typedef void (*Menu_Hook)(struct tagMENU *);
-
-typedef struct tagMENU
-#if 1 /* not yet: !NCURSES_OPAQUE_MENU */
-{
- short height; /* Nr. of chars high */
- short width; /* Nr. of chars wide */
- short rows; /* Nr. of items high */
- short cols; /* Nr. of items wide */
- short frows; /* Nr. of formatted items high */
- short fcols; /* Nr. of formatted items wide */
- short arows; /* Nr. of items high (actual) */
- short namelen; /* Max. name length */
- short desclen; /* Max. description length */
- short marklen; /* Length of mark, if any */
- short itemlen; /* Length of one item */
- short spc_desc; /* Spacing for descriptor */
- short spc_cols; /* Spacing for columns */
- short spc_rows; /* Spacing for rows */
- char *pattern; /* Buffer to store match chars */
- short pindex; /* Index into pattern buffer */
- WINDOW *win; /* Window containing menu */
- WINDOW *sub; /* Subwindow for menu display */
- WINDOW *userwin; /* User's window */
- WINDOW *usersub; /* User's subwindow */
- ITEM **items; /* array of items */
- short nitems; /* Nr. of items in menu */
- ITEM *curitem; /* Current item */
- short toprow; /* Top row of menu */
- chtype fore; /* Selection attribute */
- chtype back; /* Nonselection attribute */
- chtype grey; /* Inactive attribute */
- unsigned char pad; /* Pad character */
-
- Menu_Hook menuinit; /* User hooks */
- Menu_Hook menuterm;
- Menu_Hook iteminit;
- Menu_Hook itemterm;
-
- void *userptr; /* Pointer to menus user data */
- char *mark; /* Pointer to marker string */
-
- Menu_Options opt; /* Menu options */
- unsigned short status; /* Internal state of menu */
-}
-#endif /* !NCURSES_OPAQUE_MENU */
-MENU;
-
+ {
+ TEXT name; /* name of menu item */
+ TEXT description; /* description of item, optional in display */
+ struct tagMENU *imenu; /* Pointer to parent menu */
+ void *userptr; /* Pointer to user defined per item data */
+ Item_Options opt; /* Item options */
+ short index; /* Item number if connected to a menu */
+ short y; /* y and x location of item in menu */
+ short x;
+ bool value; /* Selection value */
+
+ struct tagITEM *left; /* neighbor items */
+ struct tagITEM *right;
+ struct tagITEM *up;
+ struct tagITEM *down;
+
+ }
+#endif /* !NCURSES_OPAQUE_MENU */
+ ITEM;
+
+ typedef void (*Menu_Hook) (struct tagMENU *);
+
+ typedef struct tagMENU
+#if 1 /* not yet: !NCURSES_OPAQUE_MENU */
+ {
+ short height; /* Nr. of chars high */
+ short width; /* Nr. of chars wide */
+ short rows; /* Nr. of items high */
+ short cols; /* Nr. of items wide */
+ short frows; /* Nr. of formatted items high */
+ short fcols; /* Nr. of formatted items wide */
+ short arows; /* Nr. of items high (actual) */
+ short namelen; /* Max. name length */
+ short desclen; /* Max. description length */
+ short marklen; /* Length of mark, if any */
+ short itemlen; /* Length of one item */
+ short spc_desc; /* Spacing for descriptor */
+ short spc_cols; /* Spacing for columns */
+ short spc_rows; /* Spacing for rows */
+ char *pattern; /* Buffer to store match chars */
+ short pindex; /* Index into pattern buffer */
+ WINDOW *win; /* Window containing menu */
+ WINDOW *sub; /* Subwindow for menu display */
+ WINDOW *userwin; /* User's window */
+ WINDOW *usersub; /* User's subwindow */
+ ITEM **items; /* array of items */
+ short nitems; /* Nr. of items in menu */
+ ITEM *curitem; /* Current item */
+ short toprow; /* Top row of menu */
+ chtype fore; /* Selection attribute */
+ chtype back; /* Nonselection attribute */
+ chtype grey; /* Inactive attribute */
+ unsigned char pad; /* Pad character */
+
+ Menu_Hook menuinit; /* User hooks */
+ Menu_Hook menuterm;
+ Menu_Hook iteminit;
+ Menu_Hook itemterm;
+
+ void *userptr; /* Pointer to menus user data */
+ char *mark; /* Pointer to marker string */
+
+ Menu_Options opt; /* Menu options */
+ unsigned short status; /* Internal state of menu */
+ }
+#endif /* !NCURSES_OPAQUE_MENU */
+ MENU;
/* Define keys */
# define MAX_COMMAND (KEY_MAX + 128)
#endif
-
/* --------- prototypes for libmenu functions ----------------------------- */
-extern MENU_EXPORT(ITEM **) menu_items (const MENU *);
-extern MENU_EXPORT(ITEM *) current_item (const MENU *);
-extern MENU_EXPORT(ITEM *) new_item (const char *,const char *);
-
-extern MENU_EXPORT(MENU *) new_menu (ITEM **);
-
-extern MENU_EXPORT(Item_Options) item_opts (const ITEM *);
-extern MENU_EXPORT(Menu_Options) menu_opts (const MENU *);
-
-extern MENU_EXPORT(Menu_Hook) item_init (const MENU *);
-extern MENU_EXPORT(Menu_Hook) item_term (const MENU *);
-extern MENU_EXPORT(Menu_Hook) menu_init (const MENU *);
-extern MENU_EXPORT(Menu_Hook) menu_term (const MENU *);
-
-extern MENU_EXPORT(WINDOW *) menu_sub (const MENU *);
-extern MENU_EXPORT(WINDOW *) menu_win (const MENU *);
-
-extern MENU_EXPORT(const char *) item_description (const ITEM *);
-extern MENU_EXPORT(const char *) item_name (const ITEM *);
-extern MENU_EXPORT(const char *) menu_mark (const MENU *);
-extern MENU_EXPORT(const char *) menu_request_name (int);
-
-extern MENU_EXPORT(char *) menu_pattern (const MENU *);
-
-extern MENU_EXPORT(void *) menu_userptr (const MENU *);
-extern MENU_EXPORT(void *) item_userptr (const ITEM *);
-
-extern MENU_EXPORT(chtype) menu_back (const MENU *);
-extern MENU_EXPORT(chtype) menu_fore (const MENU *);
-extern MENU_EXPORT(chtype) menu_grey (const MENU *);
-
-extern MENU_EXPORT(int) free_item (ITEM *);
-extern MENU_EXPORT(int) free_menu (MENU *);
-extern MENU_EXPORT(int) item_count (const MENU *);
-extern MENU_EXPORT(int) item_index (const ITEM *);
-extern MENU_EXPORT(int) item_opts_off (ITEM *,Item_Options);
-extern MENU_EXPORT(int) item_opts_on (ITEM *,Item_Options);
-extern MENU_EXPORT(int) menu_driver (MENU *,int);
-extern MENU_EXPORT(int) menu_opts_off (MENU *,Menu_Options);
-extern MENU_EXPORT(int) menu_opts_on (MENU *,Menu_Options);
-extern MENU_EXPORT(int) menu_pad (const MENU *);
-extern MENU_EXPORT(int) pos_menu_cursor (const MENU *);
-extern MENU_EXPORT(int) post_menu (MENU *);
-extern MENU_EXPORT(int) scale_menu (const MENU *,int *,int *);
-extern MENU_EXPORT(int) set_current_item (MENU *menu,ITEM *item);
-extern MENU_EXPORT(int) set_item_init (MENU *, Menu_Hook);
-extern MENU_EXPORT(int) set_item_opts (ITEM *,Item_Options);
-extern MENU_EXPORT(int) set_item_term (MENU *, Menu_Hook);
-extern MENU_EXPORT(int) set_item_userptr (ITEM *, void *);
-extern MENU_EXPORT(int) set_item_value (ITEM *,bool);
-extern MENU_EXPORT(int) set_menu_back (MENU *,chtype);
-extern MENU_EXPORT(int) set_menu_fore (MENU *,chtype);
-extern MENU_EXPORT(int) set_menu_format (MENU *,int,int);
-extern MENU_EXPORT(int) set_menu_grey (MENU *,chtype);
-extern MENU_EXPORT(int) set_menu_init (MENU *, Menu_Hook);
-extern MENU_EXPORT(int) set_menu_items (MENU *,ITEM **);
-extern MENU_EXPORT(int) set_menu_mark (MENU *, const char *);
-extern MENU_EXPORT(int) set_menu_opts (MENU *,Menu_Options);
-extern MENU_EXPORT(int) set_menu_pad (MENU *,int);
-extern MENU_EXPORT(int) set_menu_pattern (MENU *,const char *);
-extern MENU_EXPORT(int) set_menu_sub (MENU *,WINDOW *);
-extern MENU_EXPORT(int) set_menu_term (MENU *, Menu_Hook);
-extern MENU_EXPORT(int) set_menu_userptr (MENU *,void *);
-extern MENU_EXPORT(int) set_menu_win (MENU *,WINDOW *);
-extern MENU_EXPORT(int) set_top_row (MENU *,int);
-extern MENU_EXPORT(int) top_row (const MENU *);
-extern MENU_EXPORT(int) unpost_menu (MENU *);
-extern MENU_EXPORT(int) menu_request_by_name (const char *);
-extern MENU_EXPORT(int) set_menu_spacing (MENU *,int,int,int);
-extern MENU_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *);
-
-
-extern MENU_EXPORT(bool) item_value (const ITEM *);
-extern MENU_EXPORT(bool) item_visible (const ITEM *);
-
-extern MENU_EXPORT(void) menu_format (const MENU *,int *,int *);
+ extern MENU_EXPORT(ITEM **) menu_items(const MENU *);
+ extern MENU_EXPORT(ITEM *) current_item(const MENU *);
+ extern MENU_EXPORT(ITEM *) new_item(const char *, const char *);
+
+ extern MENU_EXPORT(MENU *) new_menu(ITEM **);
+
+ extern MENU_EXPORT(Item_Options) item_opts(const ITEM *);
+ extern MENU_EXPORT(Menu_Options) menu_opts(const MENU *);
+
+ extern MENU_EXPORT(Menu_Hook) item_init(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) item_term(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) menu_init(const MENU *);
+ extern MENU_EXPORT(Menu_Hook) menu_term(const MENU *);
+
+ extern MENU_EXPORT(WINDOW *) menu_sub(const MENU *);
+ extern MENU_EXPORT(WINDOW *) menu_win(const MENU *);
+
+ extern MENU_EXPORT(const char *) item_description(const ITEM *);
+ extern MENU_EXPORT(const char *) item_name(const ITEM *);
+ extern MENU_EXPORT(const char *) menu_mark(const MENU *);
+ extern MENU_EXPORT(const char *) menu_request_name(int);
+
+ extern MENU_EXPORT(char *) menu_pattern(const MENU *);
+
+ extern MENU_EXPORT(void *) menu_userptr(const MENU *);
+ extern MENU_EXPORT(void *) item_userptr(const ITEM *);
+
+ extern MENU_EXPORT(chtype) menu_back(const MENU *);
+ extern MENU_EXPORT(chtype) menu_fore(const MENU *);
+ extern MENU_EXPORT(chtype) menu_grey(const MENU *);
+
+ extern MENU_EXPORT(int) free_item(ITEM *);
+ extern MENU_EXPORT(int) free_menu(MENU *);
+ extern MENU_EXPORT(int) item_count(const MENU *);
+ extern MENU_EXPORT(int) item_index(const ITEM *);
+ extern MENU_EXPORT(int) item_opts_off(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) item_opts_on(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) menu_driver(MENU *, int);
+ extern MENU_EXPORT(int) menu_opts_off(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) menu_opts_on(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) menu_pad(const MENU *);
+ extern MENU_EXPORT(int) pos_menu_cursor(const MENU *);
+ extern MENU_EXPORT(int) post_menu(MENU *);
+ extern MENU_EXPORT(int) scale_menu(const MENU *, int *, int *);
+ extern MENU_EXPORT(int) set_current_item(MENU *menu, ITEM *item);
+ extern MENU_EXPORT(int) set_item_init(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_item_opts(ITEM *, Item_Options);
+ extern MENU_EXPORT(int) set_item_term(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_item_userptr(ITEM *, void *);
+ extern MENU_EXPORT(int) set_item_value(ITEM *, bool);
+ extern MENU_EXPORT(int) set_menu_back(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_fore(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_format(MENU *, int, int);
+ extern MENU_EXPORT(int) set_menu_grey(MENU *, chtype);
+ extern MENU_EXPORT(int) set_menu_init(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_menu_items(MENU *, ITEM **);
+ extern MENU_EXPORT(int) set_menu_mark(MENU *, const char *);
+ extern MENU_EXPORT(int) set_menu_opts(MENU *, Menu_Options);
+ extern MENU_EXPORT(int) set_menu_pad(MENU *, int);
+ extern MENU_EXPORT(int) set_menu_pattern(MENU *, const char *);
+ extern MENU_EXPORT(int) set_menu_sub(MENU *, WINDOW *);
+ extern MENU_EXPORT(int) set_menu_term(MENU *, Menu_Hook);
+ extern MENU_EXPORT(int) set_menu_userptr(MENU *, void *);
+ extern MENU_EXPORT(int) set_menu_win(MENU *, WINDOW *);
+ extern MENU_EXPORT(int) set_top_row(MENU *, int);
+ extern MENU_EXPORT(int) top_row(const MENU *);
+ extern MENU_EXPORT(int) unpost_menu(MENU *);
+ extern MENU_EXPORT(int) menu_request_by_name(const char *);
+ extern MENU_EXPORT(int) set_menu_spacing(MENU *, int, int, int);
+ extern MENU_EXPORT(int) menu_spacing(const MENU *, int *, int *, int *);
+
+ extern MENU_EXPORT(bool) item_value(const ITEM *);
+ extern MENU_EXPORT(bool) item_visible(const ITEM *);
+
+ extern MENU_EXPORT(void) menu_format(const MENU *, int *, int *);
#if NCURSES_SP_FUNCS
-extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **);
+ extern MENU_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN *, ITEM **);
#endif
#ifdef __cplusplus
- }
+}
#endif
-#endif /* ETI_MENU */
+#endif /* ETI_MENU */
# endif
#endif
-MODULE_ID("$Id: tinfo_driver.c,v 1.70 2020/08/29 21:03:50 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.71 2020/12/12 01:06:40 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
if ((i + 1) == SIZEOF(DriverTable)) {
/* For Windows >= 10.0.17763 Windows Console interface implements
virtual Terminal functionality.
- If on Windows td_CanHandle returned FALSE althoug the terminal name
- is empty, we default to ms-terminal as tinfo TERM type.
+ If on Windows td_CanHandle returned FALSE although the terminal
+ name is empty, we default to ms-terminal as tinfo TERM type.
*/
if (name == 0 || *name == 0 || (strcmp(name, "unknown") == 0)) {
name = MS_TERMINAL;
-ncurses6 (6.2+20201205) unstable; urgency=low
+ncurses6 (6.2+20201212) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 05 Dec 2020 07:53:06 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Fri, 11 Dec 2020 16:43:33 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.2+20201205) unstable; urgency=low
+ncurses6 (6.2+20201212) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 05 Dec 2020 07:53:06 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Fri, 11 Dec 2020 16:43:33 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.2+20201205) unstable; urgency=low
+ncurses6 (6.2+20201212) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 05 Dec 2020 07:53:06 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Fri, 11 Dec 2020 16:43:33 -0500
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.432 2020/12/05 12:53:06 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.433 2020/12/12 11:43:33 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "2"\r
!define VERSION_YYYY "2020"\r
-!define VERSION_MMDD "1205"\r
+!define VERSION_MMDD "1212"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.2
-Release: 20201205
+Release: 20201212
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.2
-Release: 20201205
+Release: 20201212
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.2
-Release: 20201205
+Release: 20201212
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz