form.3x.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  2. <!--
  3. * t
  4. ****************************************************************************
  5. * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
  6. * *
  7. * Permission is hereby granted, free of charge, to any person obtaining a *
  8. * copy of this software and associated documentation files (the *
  9. * "Software"), to deal in the Software without restriction, including *
  10. * without limitation the rights to use, copy, modify, merge, publish, *
  11. * distribute, distribute with modifications, sublicense, and/or sell *
  12. * copies of the Software, and to permit persons to whom the Software is *
  13. * furnished to do so, subject to the following conditions: *
  14. * *
  15. * The above copyright notice and this permission notice shall be included *
  16. * in all copies or substantial portions of the Software. *
  17. * *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
  19. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
  20. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
  21. * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
  22. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
  23. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
  24. * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  25. * *
  26. * Except as contained in this notice, the name(s) of the above copyright *
  27. * holders shall not be used in advertising or otherwise to promote the *
  28. * sale, use or other dealings in this Software without prior written *
  29. * authorization. *
  30. ****************************************************************************
  31. * @Id: form.3x,v 1.22 2008/10/11 20:48:11 tom Exp @
  32. -->
  33. <HTML>
  34. <HEAD>
  35. <TITLE>form 3x</TITLE>
  36. <link rev=made href="mailto:bug-ncurses@gnu.org">
  37. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  38. </HEAD>
  39. <BODY>
  40. <H1>form 3x</H1>
  41. <HR>
  42. <PRE>
  43. <!-- Manpage converted by man2html 3.0.1 -->
  44. <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG> <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>
  45. </PRE>
  46. <H2>NAME</H2><PRE>
  47. <STRONG>form</STRONG> - curses extension for programming forms
  48. </PRE>
  49. <H2>SYNOPSIS</H2><PRE>
  50. <STRONG>#include</STRONG> <STRONG>&lt;form.h&gt;</STRONG>
  51. </PRE>
  52. <H2>DESCRIPTION</H2><PRE>
  53. The <STRONG>form</STRONG> library provides terminal-independent facilities
  54. for composing form screens on character-cell terminals.
  55. The library includes: field routines, which create and
  56. modify form fields; and form routines, which group fields
  57. into forms, display forms on the screen, and handle inter-
  58. action with the user.
  59. The <STRONG>form</STRONG> library uses the <STRONG>curses</STRONG> libraries. To use the
  60. <STRONG>form</STRONG> library, link with the options <STRONG>-lform</STRONG> <STRONG>-lcurses</STRONG>.
  61. Your program should set up the locale, e.g.,
  62. <STRONG>setlocale(LC_ALL,</STRONG> <STRONG>"");</STRONG>
  63. so that input/output processing will work.
  64. A curses initialization routine such as <STRONG>initscr</STRONG> must be
  65. called before using any of these functions.
  66. <STRONG>Current</STRONG> <STRONG>Default</STRONG> <STRONG>Values</STRONG> <STRONG>for</STRONG> <STRONG>Field</STRONG> <STRONG>Attributes</STRONG>
  67. The <STRONG>form</STRONG> library maintains a default value for field
  68. attributes. You can get or set this default by calling
  69. the appropriate <STRONG>set_</STRONG> or retrieval routine with a <STRONG>NULL</STRONG>
  70. field pointer. Changing this default with a <STRONG>set_</STRONG> function
  71. affects future field creations, but does not change the
  72. rendering of fields already created.
  73. <STRONG>Routine</STRONG> <STRONG>Name</STRONG> <STRONG>Index</STRONG>
  74. The following table lists each <STRONG>form</STRONG> routine and the name
  75. of the manual page on which it is described.
  76. <STRONG>curses</STRONG> Routine Name Manual Page Name
  77. -------------------------------------------------
  78. current_field <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
  79. data_ahead <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
  80. data_behind <STRONG><A HREF="form_data.3x.html">form_data(3x)</A></STRONG>
  81. dup_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
  82. dynamic_field_info <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
  83. field_arg <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
  84. field_back <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
  85. field_buffer <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
  86. field_count <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
  87. field_fore <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
  88. field_index <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
  89. field_info <STRONG><A HREF="form_field_info.3x.html">form_field_info(3x)</A></STRONG>
  90. field_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  91. field_just <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
  92. field_opts <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
  93. field_opts_off <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
  94. field_opts_on <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
  95. field_pad <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
  96. field_status <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
  97. field_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  98. field_type <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
  99. field_userptr <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
  100. form_driver <STRONG><A HREF="form_driver.3x.html">form_driver(3x)</A></STRONG>
  101. form_fields <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
  102. form_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  103. form_opts <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
  104. form_opts_off <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
  105. form_opts_on <STRONG><A HREF="form_opts.3x.html">form_opts(3x)</A></STRONG>
  106. form_page <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
  107. form_request_by_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
  108. form_request_name <STRONG><A HREF="form_requestname.3x.html">form_requestname(3x)</A></STRONG>
  109. form_sub <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
  110. form_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  111. form_userptr <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
  112. form_win <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
  113. free_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
  114. free_fieldtype <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
  115. free_form <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
  116. link_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
  117. link_fieldtype <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
  118. move_field <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
  119. new_field <STRONG><A HREF="form_field_new.3x.html">form_field_new(3x)</A></STRONG>
  120. new_fieldtype <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
  121. new_form <STRONG><A HREF="form_new.3x.html">form_new(3x)</A></STRONG>
  122. new_page <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
  123. pos_form_cursor <STRONG><A HREF="form_cursor.3x.html">form_cursor(3x)</A></STRONG>
  124. post_form <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
  125. scale_form <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
  126. set_current_field <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
  127. set_field_back <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
  128. set_field_buffer <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
  129. set_field_fore <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
  130. set_field_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  131. set_field_just <STRONG><A HREF="form_field_just.3x.html">form_field_just(3x)</A></STRONG>
  132. set_field_opts <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
  133. set_field_pad <STRONG><A HREF="form_field_attributes.3x.html">form_field_attributes(3x)</A></STRONG>
  134. set_field_status <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
  135. set_field_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  136. set_field_type <STRONG><A HREF="form_field_validation.3x.html">form_field_validation(3x)</A></STRONG>
  137. set_field_userptr <STRONG><A HREF="form_field_userptr.3x.html">form_field_userptr(3x)</A></STRONG>
  138. set_fieldtype_arg <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
  139. set_fieldtype_choice <STRONG><A HREF="form_fieldtype.3x.html">form_fieldtype(3x)</A></STRONG>
  140. set_form_fields <STRONG><A HREF="form_field.3x.html">form_field(3x)</A></STRONG>
  141. set_form_init <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  142. set_form_opts <STRONG><A HREF="form_field_opts.3x.html">form_field_opts(3x)</A></STRONG>
  143. set_form_page <STRONG><A HREF="form_page.3x.html">form_page(3x)</A></STRONG>
  144. set_form_sub <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
  145. set_form_term <STRONG><A HREF="form_hook.3x.html">form_hook(3x)</A></STRONG>
  146. set_form_userptr <STRONG><A HREF="form_userptr.3x.html">form_userptr(3x)</A></STRONG>
  147. set_form_win <STRONG><A HREF="form_win.3x.html">form_win(3x)</A></STRONG>
  148. set_max_field <STRONG><A HREF="form_field_buffer.3x.html">form_field_buffer(3x)</A></STRONG>
  149. set_new_page <STRONG><A HREF="form_new_page.3x.html">form_new_page(3x)</A></STRONG>
  150. unpost_form <STRONG><A HREF="form_post.3x.html">form_post(3x)</A></STRONG>
  151. </PRE>
  152. <H2>RETURN VALUE</H2><PRE>
  153. Routines that return pointers return <STRONG>NULL</STRONG> on error, and
  154. set errno to the corresponding error-code returned by
  155. functions returning an integer. Routines that return an
  156. integer return one of the following error codes:
  157. <STRONG>E_OK</STRONG> The routine succeeded.
  158. <STRONG>E_BAD_ARGUMENT</STRONG>
  159. Routine detected an incorrect or out-of-range argu-
  160. ment.
  161. <STRONG>E_BAD_STATE</STRONG>
  162. Routine was called from an initialization or termina-
  163. tion function.
  164. <STRONG>E_CONNECTED</STRONG>
  165. The field is already connected to a form.
  166. <STRONG>E_INVALID_FIELD</STRONG>
  167. Contents of a field are not valid.
  168. <STRONG>E_NOT_CONNECTED</STRONG>
  169. No fields are connected to the form.
  170. <STRONG>E_NOT_POSTED</STRONG>
  171. The form has not been posted.
  172. <STRONG>E_NO_ROOM</STRONG>
  173. Form is too large for its window.
  174. <STRONG>E_POSTED</STRONG>
  175. The form is already posted.
  176. <STRONG>E_REQUEST_DENIED</STRONG>
  177. The form driver could not process the request.
  178. <STRONG>E_SYSTEM_ERROR</STRONG>
  179. System error occurred (see <STRONG>errno</STRONG>).
  180. <STRONG>E_UNKNOWN_COMMAND</STRONG>
  181. The form driver code saw an unknown request code.
  182. </PRE>
  183. <H2>SEE ALSO</H2><PRE>
  184. <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for
  185. detailed descriptions of the entry points.
  186. </PRE>
  187. <H2>NOTES</H2><PRE>
  188. The header file <STRONG>&lt;form.h&gt;</STRONG> automatically includes the header
  189. files <STRONG>&lt;curses.h&gt;</STRONG> and <STRONG>&lt;eti.h&gt;</STRONG>.
  190. In your library list, libform.a should be before libn-
  191. curses.a; that is, you want to say `-lform -lncurses', not
  192. the other way around (which would give you a link error
  193. using most linkers).
  194. </PRE>
  195. <H2>PORTABILITY</H2><PRE>
  196. These routines emulate the System V forms library. They
  197. were not supported on Version 7 or BSD versions.
  198. </PRE>
  199. <H2>AUTHORS</H2><PRE>
  200. Juergen Pfeifer. Manual pages and adaptation for ncurses
  201. by Eric S. Raymond.
  202. </PRE>
  203. <H2>SEE ALSO</H2><PRE>
  204. This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
  205. <STRONG><A HREF="form.3x.html">form(3x)</A></STRONG>
  206. </PRE>
  207. <HR>
  208. <ADDRESS>
  209. Man(1) output converted with
  210. <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
  211. </ADDRESS>
  212. </BODY>
  213. </HTML>