home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2406 < prev    next >
Internet Message Format  |  1990-12-28  |  42KB

  1. From: pjc@pcbox.UUCP (Paul J. Condie)
  2. Newsgroups: alt.sources
  3. Subject: menu(1) part 1 of 14
  4. Message-ID: <435@pcbox.UUCP>
  5. Date: 26 Dec 90 20:02:53 GMT
  6.  
  7.  
  8. #!/bin/sh
  9. # shar:    Shell Archiver  (v1.22)
  10. #
  11. # This is part 1 of a multipart archive                                    
  12. # do not concatenate these parts, unpack them in order with /bin/sh        
  13. #
  14. #      A Brief Description:
  15. #           Menu(1) is an easy-to-use menu utility that allows users to
  16. #           operate an application system in a user-friendly, menu-
  17. #           driven environment.  Any application software, regardless of
  18. #           source language or operating system process can be executed
  19. #           from menus designed with Menu(1).
  20. #
  21. #           For systems requiring multi-level menus for a diverse number
  22. #           of users, Menu(1) allows a single menu to call any number of
  23. #           submenus, which may in turn call more menus or execute any
  24. #           number of processes.  Menus can be nested to any level
  25. #           without increasing startup time or memory requirements.
  26. #
  27. #           Menus can also be designed to function as user-friendly data
  28. #           entry screens for capturing data, which can then be used as
  29. #           input for a process.  Text items such as "displays",
  30. #           "choices" and "responses" can be added within any of these
  31. #           defined boundaries, and will automatically adjust if any
  32. #           boundaries are changed.  Special screen attributes, such as
  33. #           highlighting and reverse video, can be defined to add
  34. #           special emphasis.
  35. #
  36. #           The menu script file contains all of the menu instructions,
  37. #           and can be edited using a standard system editor, such as
  38. #           vi.  Menus and utilities can be added or deleted by editing
  39. #           the appropriate script file, even while the menu is in use.
  40. #########
  41. #
  42. #
  43. #    Run the following text with /bin/sh to create:
  44. #      README
  45. #      VERSIONHISTORY
  46. #      SHAREWARE
  47. #      makefile
  48. #      menu.1
  49. #      Main.c
  50. #      LoadKeys.c
  51. #      parsedrive.c
  52. #      showdriver.c
  53. #      rundriver.c
  54. #      ParseOpton.c
  55. #      ParseBaner.c
  56. #      ParseTitle.c
  57. #      ParseBox.c
  58. #      ParseWindo.c
  59. #      ParseLine.c
  60. #      ParseComnt.c
  61. #      ParseUnix.c
  62. #      ParseGname.c
  63. #      ParseAuthr.c
  64. #      ParseText.c
  65. #      ParseCur.c
  66. #      ParseSpace.c
  67. #      ParInclude.c
  68. #      ParAssign.c
  69. #      ParAftMenu.c
  70. #      ShowOption.c
  71. #      RunSystem.c
  72. #      RunExit.c
  73. #      RunSetenv.c
  74. #      RunMenu.c
  75. #      RunPopMenu.c
  76. #      RunGetI.c
  77. #      RunAftMenu.c
  78. #      GetOption.c
  79. #      EndWindow.c
  80. #      displaytxt.c
  81. #      SetTerm.c
  82. #      systime.c
  83. #      sysdate.c
  84. #      checkmail.c
  85. #      anymail.c
  86. #      setenv.c
  87. #      strmatch.c
  88. #      setvar.c
  89. #      drawline.c
  90. #      initmenu.c
  91. #      keyboard.c
  92. #      runscreen.c
  93. #      getval.c
  94. #      clean_menu.c
  95. #      slength.c
  96. #      runpopen.c
  97. #      mygetch.c
  98. #      menu.h
  99. #      terminal.h
  100. #      LexDeSrn.l
  101. #      menu.hlp
  102. #      runrealid.c
  103. #      ParseDeSrn.y
  104. #      utilities.d/libgeti.d/AdjField.c
  105. #      utilities.d/libgeti.d/BuildMenu.c
  106. #      utilities.d/libgeti.d/DateFun.c
  107. #      utilities.d/libgeti.d/DisPrmpt.c
  108. #      utilities.d/libgeti.d/FindSet.c
  109. #      utilities.d/libgeti.d/GetInput.c
  110. #      utilities.d/libgeti.d/GetSetLen.c
  111. #      utilities.d/libgeti.d/InitGetI.c
  112. #      utilities.d/libgeti.d/IsDate.c
  113. #      utilities.d/libgeti.d/IsFldOk.c
  114. #      utilities.d/libgeti.d/IsMask.c
  115. #      utilities.d/libgeti.d/IsRange.c
  116. #      utilities.d/libgeti.d/IsState.c
  117. #      utilities.d/libgeti.d/IsTime.c
  118. #      utilities.d/libgeti.d/ReDispFld.c
  119. #      utilities.d/libgeti.d/RingMenu.c
  120. #      utilities.d/libgeti.d/ScrnOut.c
  121. #      utilities.d/libgeti.d/ShowChar.c
  122. #      utilities.d/libgeti.d/ShowHelp.c
  123. #      utilities.d/libgeti.d/ShowSet.c
  124. #      utilities.d/libgeti.d/_Main.c
  125. #      utilities.d/libgeti.d/checkmask.c
  126. #      utilities.d/libgeti.d/doinsert.c
  127. #      utilities.d/libgeti.d/drawbox.c
  128. #      utilities.d/libgeti.d/findfile.c
  129. #      utilities.d/libgeti.d/getmmddyy.c
  130. #      utilities.d/libgeti.d/popmenu.c
  131. #      utilities.d/libgeti.d/stricmp.c
  132. #      utilities.d/libgeti.d/substr.c
  133. #      utilities.d/libgeti.d/upper.c
  134. #      utilities.d/libgeti.d/GetInput.h
  135. #      utilities.d/libgeti.d/keys.h
  136. #      utilities.d/libgeti.d/makefile
  137. #      utilities.d/libgeti.d/GetInput.3X
  138. #      utilities.d/libgeti.d/RingMenu.3
  139. #      utilities.d/libgeti.d/ShowHelp.3
  140. #      utilities.d/libgeti.d/drawbox.3
  141. #      utilities.d/libgeti.d/popmenu.3
  142. #      utilities.d/libgeti.d/GetInput.hlp
  143. #      utilities.d/checkpass.d/checkpass.1
  144. #      utilities.d/checkpass.d/checkpass.c
  145. #      utilities.d/lock.d/junk
  146. #      utilities.d/lock.d/lock.1
  147. #      utilities.d/lock.d/lock.c
  148. #      utilities.d/lock.d/unlock.1
  149. #      utilities.d/lock.d/unlock.c
  150. #      utilities.d/lock.d/uulock.c
  151. #      utilities.d/m.d/adduser
  152. #      utilities.d/m.d/adduser.old
  153. #      utilities.d/m.d/deluser
  154. #      utilities.d/m.d/junk
  155. #      utilities.d/m.d/junk.m
  156. #      utilities.d/m.d/passwdsrn.m
  157. #      utilities.d/m.d/printer2.sh
  158. #      utilities.d/m.d/printers.m
  159. #      utilities.d/m.d/printers.sh
  160. #      utilities.d/m.d/reportsrn.m
  161. #      utilities.d/m.d/sadmin.m
  162. #      utilities.d/m.d/sample.m
  163. #      utilities.d/m.d/setdbaperm
  164. #      utilities.d/m.d/suid_exec.c
  165. #      utilities.d/msgbox.d/displaytxt.c
  166. #      utilities.d/msgbox.d/makefile
  167. #      utilities.d/msgbox.d/msgbox.1
  168. #      utilities.d/msgbox.d/msgbox.c
  169. #      utilities.d/MenuMsg.d/MenuMsg.1
  170. #      utilities.d/MenuMsg.d/MenuMsg.c
  171. #      utilities.d/MenuMsg.d/MenuPrompt.1
  172. #      utilities.d/MenuMsg.d/MenuPrompt.c
  173. #      utilities.d/MenuMsg.d/makefile
  174. #
  175. mkdir utilities.d
  176. mkdir utilities.d/checkpass.d
  177. mkdir utilities.d/libgeti.d
  178. mkdir utilities.d/lock.d
  179. mkdir utilities.d/m.d
  180. mkdir utilities.d/msgbox.d
  181. mkdir utilities.d/MenuMsg.d
  182. if test -r s2_seq_.tmp
  183. then echo "Must unpack archives in sequence!"
  184.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  185.      exit 1; fi
  186. echo "x - extracting README (Text)"
  187. sed 's/^X//' << 'SHAR_EOF' > README &&
  188. Xmenu directory structure:
  189. X
  190. X                             |-MenuAccess.d    MenuAccess(1) program
  191. X  menu(1)                    |-checkpass.d    checkpass(1) program
  192. Xsource code --|-utilities.d--|-libgeti.d    GetInput(3X) library
  193. X                             |-lock.d        lock(1) & unlock(1)
  194. X                             |-m.d        Sample menu script files.
  195. X                             |-msgbox.d        msgbox(1) program
  196. X
  197. XTo install menu(1):
  198. X
  199. X    1.   cd to where you want to keep the source code
  200. X    2.   unpack the package
  201. X         cpio -iBcdumv < menu.cpio  or  unshar menu.shar.xx
  202. X    3.   vi makefile and set where you want to install menu
  203. X    4.   make
  204. X    5.   make install
  205. X
  206. XTo test menu(1):
  207. X    -   set menu directory to some sample menus
  208. X        MENUDIR=utilities.d/m.d; export MENUDIR
  209. X    -   tell menu where you installed the help file
  210. X        HELPDIR=/usr/local/bin; export HELPDIR
  211. X    -   run a sample menu
  212. X        menu sample.m
  213. X
  214. XNotes:
  215. X    - The MenuAccess(1) program is not implemented yet.
  216. X    - Refer to VERSIONHISTORY file for changes since previous versions.
  217. SHAR_EOF
  218. chmod 0644 README || echo "restore of README fails"
  219. echo "x - extracting VERSIONHISTORY (Text)"
  220. sed 's/^X//' << 'SHAR_EOF' > VERSIONHISTORY &&
  221. X*** VERSION HISTORY ***
  222. XVersion Number: A new keyword or major enhancements gets version bumped by a .10
  223. X        Bug fixes small enhancements bumped .01
  224. X
  225. XVERSION 3.63 - Submitted to NetNews
  226. X.  modified makefiles so CC would get carried to other makefiles    12/90
  227. X.  fixed major bug if command line was greater than BUFSIZ but less than
  228. X    MAXLEN - menu would core dump    10/90
  229. X
  230. XVERSION 3.62
  231. X.  port to the sun    9/90
  232. X.  clean_menu(3) - fixed bug in freeing memory    9/90
  233. X.  popmenu(3) - KeyIC toggles between full and single char matching  sslok 9/90
  234. X
  235. XVVERSION 3.61
  236. X.  GetInput() - popmenu tries to fit all options on the screen    9/90
  237. X.  .POPMENU - fixed bug if # of items go off the screen    9/90
  238. X.  do keypad (stdscr, TRUE) after each system() call    9/90
  239. X.  GetInput() fixed REVERSE video on fields with no input    8/90
  240. X.  popmenu() - added character matching        sslok 8/90
  241. X    probably not downward compatible
  242. X.  popmenu() - would core dump if only one item also increased max items
  243. X    in a pop menu to 200    sslok    7/90
  244. X.  GETINPUT added variable=value    8/90
  245. X.  GETINPUT now adjusts (LFADJ_BFIL) the values set in popen calls    8/90
  246. X.  popmenu() fixed bug where title would disappear when scrolling
  247. X    off the last item    8/90
  248. X.  popmenu() took off hi-lighted help on dimmed windows    8/90
  249. X.  AFTER_MENU may now be used in a POPMENU    8/90
  250. X.  after_field now get executed before a exit_last_field    8/90
  251. X.  increased MAXFIELDS to 40    8/90
  252. X
  253. XVERSION 3.60
  254. X.  added MenuMsg(1) utility    7/90
  255. X.  added MenuPrompt(1) utility    7/90
  256. X.  allow comment (#) on variable=value line    7/90
  257. X.  popmenu(), drawbox() - added elevator    sslok 7/90
  258. X.  ParAssign() - malloc assignment    7/90
  259. X.  added exitoncancel in DEFINE_SCREEN    7/90
  260. X.  field_range - added "`command`"     7/90
  261. X.  after_field/before_field - allow "$field_name=value ..."    7/90
  262. X.  after_field - changed runscreen() to setenv after GetInput() instead of
  263. X    after KEY_ACCEPT    7/90
  264. X.  added -notrap to command line    7/90
  265. X.  DEFINE_SCREEN title default is now the option description text    7/90
  266. X.  DEFINE_SCREEN window_rows & window_cols may automatically be calculated 7/90
  267. X.  GetInput() a MENU type field will now exit the field upon selecting a option
  268. X    in the popmenu    6/90
  269. X.  GetInput() now reads .menuinit file to set key values in InitGetI()    6/90
  270. X.  GetInput() now does range checking on sun-sat,no_holidays,gt_today,
  271. X    ge_today,lt_today,le_today for date fields    7/90
  272. X.  GetInput() fixed bug where if value was entered then cleared the
  273. X    function reported invalid range    7/90
  274. X.  did away with the NULL on GETINPUT fields    7/90
  275. X
  276. XVERSION 3.50
  277. X.  menu now ignores SIGINT, SIGQUIT    4/90
  278. X.  added text option to DEFINE_SCREEN    4/90
  279. X.  added field_before_input option to DEFINE_SCREEN    4/90
  280. X.  added field_after_input option to DEFINE_SCREEN    4/90
  281. X.  added .AFTER_MENU    4/90
  282. X.  added after_menu to DEFINE_SCREEN    4/90
  283. X.  added utility msgbox.1    rsprice 4/90
  284. X
  285. XVERSION 3.42
  286. X.  .INCLUDE - the menufile argument can now be an environment variable or
  287. X    absolute pathname    4/90
  288. X.  fixed warning message in rundriver.c during compile    4/90
  289. X
  290. XVERSION 3.41 - released to alt.sources    4/90
  291. X.  ParAssign.c - increased var=value to allow value to be BUFSIZE*2   sslok 4/90
  292. X.  RunSystem.c - changed message "One moment loading program to say the
  293. X        actual option you picked    sslok 4/90
  294. X.  getval.c - fixed problem on 3b2/700 -- int/char casting    sslok 4/90
  295. X.  popmenu.c - 3b2/700 -- int/char casting problem with toupper    sslok 4/90
  296. X
  297. XVERSION 3.40
  298. X.  DEFINE_SCREEN - window_title, window_pos accepts a $var    2/90
  299. X.  moved the GETINPUT screen on AUTO to end of description    2/90
  300. X.  GETINPUT helpfile accepts double quotes and the fieldname becomes
  301. X   the tagname in the helpfile    2/90
  302. X.  ShowHelp - added table of contents    2/90
  303. X.  fldadjust does not work in getinput screen    2/90
  304. X.  help in getinput screen does not work if there is no toc    2/90
  305. X
  306. XVERSION 3.32 - released to comp.sources.unix and unix/c library
  307. X.  changed (case ?) casting declarations for Xneix    11/89
  308. X.  ssl added number matching on popmenu so "1.  xxx" may be placed in a
  309. X   popmenu text
  310. X.  .AUTHORIZE now checks the real uid instead of LOGNAME    11/89
  311. X.  add character matching    11/89
  312. X.  ssl added System() reset shell mode to the real uid    11/89
  313. X.  combining attributes now work \R\D    11/89
  314. X.  attributes work better on option description line    11/89
  315. X.  increased field_range maximum to 1k    11/89
  316. X
  317. XVERSION 3.31
  318. X.  added KEY_EXITMENU,KEY_MAINMENU,KEY_PREVMENU,KEY_POPGNAME, KEY_GNAME
  319. X   to .menuinit    8/89
  320. X.  fixed anymail() when set uid is set on menu    9/89
  321. X.  fixed non numeric entry in selecting option    9/89
  322. X
  323. XVERSION 3.30 - Released to Unix/C library
  324. X.  added field_protect    6/89
  325. X.  added GETINPUT to .UNIX    6/89
  326. X.  added GETINPUT to .MENU    6/89
  327. X.  added REDRAW to .UNIX    6/89
  328. X.  .UNIX command exit 4 = NOWAYJOSE, etc.    6/89
  329. X.  added curses attributes to -keys    6/89
  330. X
  331. XVERSION 3.26
  332. X.  mainly port to the sun
  333. X.  GetInput allow for row and col for fldErrRow/fldMsgRow    6/89
  334. X.  fixed ShowHelp to be more more like    6/89
  335. X.  popmenu/GETINPUT automatically figure out where to put the window    6/89
  336. X.  tilde expansion
  337. X.  fixed clean_menu for RunPopMenu    6/89
  338. X.  .TEXT a -0 should work    6/89
  339. X.  changed selectable option to REVERSE as in popmenu    6/89
  340. X.  put clearok in ParseUnix in case .UNIX messes up the screen    6/89
  341. X
  342. XVERSION 3.25 - pbcast
  343. X.  install getval()  ${parameter}    5/89
  344. X.  *=*  add PATH=$PATH:/usr/me
  345. X
  346. XVERSION 3.24
  347. X.  added \ to .AUTHORIZE
  348. X.  .INCLUDE - now menu will display the filename if it can't find it    4/89
  349. X.  fixed .WINDOW bug    5/89
  350. X.  refresh before a .EXIT
  351. X.  added HOTKEYS to .menuinit
  352. X.  fixed ShowHelp() bug when help file > 2 pages    5/89
  353. X.  var=value can now be put in a .INCLUDE file    5/89
  354. X.  findfile()  replaced access(3) with stat(3) for suid on menu    5/89
  355. X.  for G and ! do away with the carraige after the G or !    4/89
  356. X.  ability to turn off shell escape
  357. X
  358. XVERSION 3.23 - Released to Unix/C Library
  359. X.  installed sam's new version on popmenu(3)    3/89
  360. X
  361. XVERSION 3.22
  362. X.  GETINPUT error message did not clear err row.    1/89
  363. X.  exit_last_field on last field in GETINPUT    1/89
  364. X.  fixed SKIPJUNK    1/89
  365. X.  POPMENU multiple popmenus in the same menu did not work    1/89
  366. X.  ShowHelp - put More on bar line    1/89
  367. X.  bumped YYLMAX to MAXLEN    2/89
  368. X.  allowed _ in field_name    2/89
  369. X
  370. XVERSION 3.21 -  Released
  371. X.  fixed popen for field_defaults    12/88
  372. X.  added field_noinput    12/88
  373. X.  a new ShowHelp(3)    12/88
  374. X
  375. XVERSION 3.20 - Released
  376. X.  added continuation \ to .UNIX    12/88
  377. X.  *=* keyword - variable=value    12/88
  378. X.  increase length of command    12/88
  379. X.  cleared prompt line when exiting GETINPUT    12/88
  380. X.  add field_init to DEFINE_SCREEN    12/88
  381. X.  fix getenv on returning NULL
  382. X
  383. XVERSION 3.10 - Released
  384. X.  .DEFINE_SCREEN    11/88
  385. X.  .GETINPUT - user input into fields/environment var    11/88
  386. X.  menu -keys    11/88
  387. X.  .INCLUDE    11/88
  388. X.  renamed Menu.hlp to menu.hlp    11/88
  389. X.  menufile nameing format = menufile.m    11/88
  390. X.  GetInput()  added MENU    11/88
  391. X.  GetInput()  clear field and home cursor    11/88
  392. X.  GetInput()  delete a character    11/88
  393. X.  GetInput()  type-over/insert    11/88
  394. X.  GetInput()  KEY_BEG, KEY_END 11/88
  395. X.  comments in a .DEFINE_SCREEN    11/88
  396. X.  .GETINPUT  format the default value to the mask    11/88
  397. X.  GetInput()  have down and up arrow accept field input
  398. X
  399. XVERSION 2.81 - Released
  400. X.  check for mail being forwarded    10/88
  401. X.  fixed .POPMENU with no var=value    10/88
  402. X.  Dim does not work    10/88
  403. X.  The space terminater for enviroment var should not be counted in text 10/88
  404. X.  .menuinit - popup menu key GNAME    10/88
  405. X.  take out LoadKeys in RunPopMenu    10/88
  406. X.  reparsed menu on return from RunPopMenu & RunSetenv    10/88
  407. X.  check if terminal has DrawLine capability    11/88
  408. X.  popmenu - last item selected is displayed    11/88
  409. X
  410. XVERSION 2.8 - Released
  411. X.  on goto popup menu put heading of GOTO MENU    10/88
  412. X.  .POPMENU    10/88
  413. X.  .menuinit with ^h etc. configurable    10/88
  414. X.  .unix changed to .UNIX    10/88
  415. X
  416. XVERSION 2.72 - Released
  417. X.  lock option so only one can run at a time - lock(1) utilities.d 10/88
  418. X.  speeded up the box redraw - clrtobot(). 10/88
  419. X.  added multiple variable setting on .SETENV 10/88
  420. X.  fixed .MENU and .SETENV to allow quoted values for variables 10/88
  421. X.  took out restriction of clear(1) - now tput clear         10/88
  422. X.  BELL on .SETENV ??    10/88
  423. X
  424. XVERSION 2.71 - Released
  425. X.  fix mAiL display
  426. X.  ^r redraw screen
  427. X.  fixed the if [ $? -eq 0 ] \  etc... on the command line
  428. X      be able to authorize down to the option level
  429. X
  430. XVERSION 2.7 - Released
  431. X.  EXIT command
  432. X.  ? for help
  433. X
  434. XVERSION 2.6 - Released  pbody pbhyf
  435. X.  relative addresses for .TEXT .CURSOR - = calc from LINES,COLS    5/88
  436. X.  got screen size from LINES,COLS
  437. X
  438. XVERSION 2.5 - Released  lacm pbuddy
  439. X.  a debuging feature
  440. X
  441. XVERSION 2.4 - Released  3b2a
  442. X.  modify rundriver that anytime a run function returns        5/88
  443. X   SUBMENU    - display a new menu
  444. X   MAINMENU    - goto main menu
  445. X   PREVMENU    - previous menu
  446. X        - goto a menu name
  447. X   QUIT        - exit menu
  448. X.  updated menu.1 for adding new keywords    5/88
  449. X
  450. XVERSION 2.3 - Released  pbody
  451. X.  fixed ^g  5/88
  452. X.  changed .SETENV var=value
  453. X
  454. XVERSION 2.2 - Released  pbody
  455. X.  some way to pass data to another submenu 5/88
  456. X.  reworked .MENU to RunMenu  5/88
  457. X
  458. XVERSION 2.1 - Released  pbody
  459. X.  enviroment vars in .TEXT  5/88
  460. X
  461. XVERSION 2.0 - Released  pbody
  462. X.  build mail notifier into menu    4/88
  463. X.  increase length of command line    4/88
  464. X.  .TEXT row col text  - display text at specified location    4/88
  465. X.  .CURSOR row col  - allow user to specify where to put cursor    4/88
  466. X.  display "enter h for help screen"    4/88  use .TEXT
  467. X.  .SPACE keyword    4/88
  468. X.  menu -v  print version 4/88
  469. SHAR_EOF
  470. chmod 0644 VERSIONHISTORY || echo "restore of VERSIONHISTORY fails"
  471. echo "x - extracting SHAREWARE (Text)"
  472. sed 's/^X//' << 'SHAR_EOF' > SHAREWARE &&
  473. XMenu is released as ShareWare, which means it can be freely copied and
  474. Xshared.  Due to the increased demand on my time, if you use menu(1) and
  475. Xlike it, I'm asking for a voluntary contribution of $35 to help differ
  476. Xthe costs of on-going support and future enhancements.
  477. X
  478. X    Paul J. Condie
  479. X    2133 Fieldcrest Ave
  480. X    Fairfield, Ca.  94546
  481. X
  482. X
  483. SHAR_EOF
  484. chmod 0644 SHAREWARE || echo "restore of SHAREWARE fails"
  485. echo "x - extracting makefile (Text)"
  486. sed 's/^X//' << 'SHAR_EOF' > makefile &&
  487. X# %W%   DeltaDate %G%   ExtrDate %H%
  488. XTITLE = "MENU"
  489. X
  490. X# SYS5    - System V
  491. X# BSD    - Berkely
  492. XOSVER = SYS5
  493. X
  494. X# For the $MAIL (mail notification).
  495. X# On some systems the alarm() does not come into effect while in the middle
  496. X# of a getch().  The alarms get buffered up until the user hits a key and
  497. X# then all the bells notifying of mail goes off.  You should take out the
  498. X# -DALARM on the CFLAGS to get around this.
  499. X# Works ok on:        -DALARM
  500. X#    AT&T 3b1
  501. X#    AT&T 3b2
  502. X# Does not work on:
  503. X#    SUN
  504. X#    Arete
  505. X#    AT&T 3b15
  506. X#    AT&T 3b20
  507. X#    CT megaframe
  508. X#
  509. X#  -DSINGLE
  510. X#    Causes static references to terminal capabilities instead of dynamic 
  511. X#    references.  This results in smaller code. See /usr/include/term.h
  512. X#  -DLEXDEBUG
  513. X#    Only if you need more debugging for .DEFINE_SCREEN
  514. X#  -DYYDEBUG
  515. X#    Only if you need more debugging for .DEFINE_SCREEN
  516. X#  -DSUN
  517. X#    Sun compilation with 5bin/cc (SYS5)
  518. X
  519. X
  520. XINSTALLDIR = /usr/lbin
  521. XHELPDIR = /usr/lbin
  522. XMD = /usr/man/man1
  523. XINCDIR = .
  524. XLIBDIR =
  525. X### Sun
  526. X#CC    = /usr/5bin/cc
  527. X### Sys V
  528. XCC    = cc
  529. X
  530. X###  Various CFLAG settings
  531. X
  532. X###  Sys5
  533. XCFLAGS = -I$(INCDIR) -O -D$(OSVER) -DSINGLE
  534. X###  Xenix
  535. X#CFLAGS = -I$(INCDIR) -O -D$(OSVER) -DSINGLE -DM_TERMINFO -LARGE -Ml -Mlt34 -F 10000 -SEG 500
  536. X###  Sun (5bin)
  537. X#CFLAGS = -I$(INCDIR) -O -D$(OSVER) -DSINGLE -DSUN
  538. X
  539. XYFLAGS = -d
  540. X
  541. X###  Libraries
  542. X
  543. X###  Sys5
  544. XLIBS = libgeti.a -lcurses -ltermcap -lc -lm -ll -ly
  545. X#LIBS = libgeti.a -lcurses -ll -ly
  546. X###  Xenix
  547. X#LIBS = libgeti.a -ltinfo -lx -ll -ly
  548. X
  549. XCFILES = Main.c LoadKeys.c parsedrive.c showdriver.c rundriver.c \
  550. X    ParseOpton.c ParseBaner.c ParseTitle.c ParseBox.c ParseWindo.c \
  551. X    ParseLine.c ParseComnt.c ParseUnix.c ParseGname.c ParseAuthr.c \
  552. X    ParseText.c ParseCur.c ParseSpace.c ParInclude.c ParAssign.c \
  553. X    ParAftMenu.c \
  554. X    ShowOption.c \
  555. X    RunSystem.c RunExit.c RunSetenv.c RunMenu.c RunPopMenu.c RunGetI.c \
  556. X    RunAftMenu.c \
  557. X    GetOption.c \
  558. X    EndWindow.c displaytxt.c SetTerm.c \
  559. X    systime.c sysdate.c checkmail.c anymail.c setenv.c \
  560. X    strmatch.c setvar.c drawline.c initmenu.c keyboard.c \
  561. X    runscreen.c getval.c clean_menu.c slength.c \
  562. X    runpopen.c mygetch.c
  563. X
  564. XLFILES = LexDeSrn.l
  565. XYFILES = ParseDeSrn.y
  566. X
  567. XHFILES = menu.h terminal.h
  568. X
  569. XMANPAGES = menu.1
  570. X
  571. XMENUFILES = utilities.d/m.d/*.m
  572. XSHARFILES = README VERSIONHISTORY SHAREWARE makefile $(MANPAGES) $(CFILES) \
  573. X    $(HFILES) $(LFILES) \
  574. X    menu.hlp runrealid.c $(YFILES) \
  575. X    utilities.d/libgeti.d/*.c utilities.d/libgeti.d/*.h \
  576. X    utilities.d/libgeti.d/makefile utilities.d/libgeti.d/*.3* \
  577. X    utilities.d/libgeti.d/*.hlp \
  578. X    utilities.d/checkpass.d/* utilities.d/lock.d/* utilities.d/m.d/* \
  579. X    utilities.d/msgbox.d/* utilities.d/MenuMsg.d/*
  580. X
  581. XOBJECTS = $(CFILES:.c=.o) $(YFILES:.y=.o) $(LFILES:.l=.o)
  582. X
  583. Xall:    menu runrealid checkpass lock msgbox MenuMsg MenuPrompt
  584. X
  585. Xmenu:    libgeti $(OBJECTS) 
  586. X    $(CC) $(CFLAGS) $(OBJECTS) $(LIBDIR) $(LIBS) -o $@
  587. X    size menu
  588. X    @echo 
  589. X
  590. Xrunrealid: runrealid.c
  591. X    $(CC) $(CFLAGS) runrealid.c -o $@
  592. X
  593. Xlibgeti:
  594. X    cd utilities.d/libgeti.d; $(MAKE) CC=$(CC) install
  595. X#    For SUN
  596. X#    ranlib libgeti.a
  597. X
  598. Xcheckpass:
  599. X    cd utilities.d/checkpass.d; $(MAKE) CC=$(CC) checkpass
  600. X
  601. Xlock:
  602. X    cd utilities.d/lock.d; $(MAKE) CC=$(CC) lock
  603. X    cd utilities.d/lock.d; $(MAKE) CC=$(CC) unlock
  604. Xmsgbox:
  605. X    cd utilities.d/msgbox.d; $(MAKE) CC=$(CC)
  606. XMenuMsg:
  607. X    cd utilities.d/MenuMsg.d; $(MAKE) CC=$(CC) MenuMsg
  608. XMenuPrompt:
  609. X    cd utilities.d/MenuMsg.d; $(MAKE) CC=$(CC) MenuPrompt
  610. X
  611. Xinstall:
  612. X    strip menu
  613. X    cp menu $(INSTALLDIR)
  614. X    cp menu.hlp $(HELPDIR)
  615. X#    cp sample.m $(INSTALLDIR)
  616. X#    cp printers.m $(INSTALLDIR)
  617. X#    cp reportsrn.m $(INSTALLDIR)
  618. X    strip runrealid
  619. X    cp runrealid $(INSTALLDIR)
  620. X    cp utilities.d/checkpass.d/checkpass $(INSTALLDIR)
  621. X    cp utilities.d/lock.d/lock $(INSTALLDIR)
  622. X    cp utilities.d/lock.d/unlock $(INSTALLDIR)
  623. X    cp utilities.d/msgbox.d/msgbox $(INSTALLDIR)
  624. X    cp utilities.d/MenuMsg.d/MenuMsg $(INSTALLDIR)
  625. X    cp utilities.d/MenuMsg.d/MenuPrompt $(INSTALLDIR)
  626. X#    cp menu.1 $(MD)
  627. X#    cp utilities.d/checkpass.d/checkpass.1 $(MD)
  628. X#    cp utilities.d/lock.d/lock.1 $(MD)
  629. X#    cp utilities.d/lock.d/unlock.1 $(MD)
  630. X#    cp utilities.d/msgbox.d/msgbox.1 $(MD)
  631. X#    cp utilities.d/MenuMsg.d/MenuMsg.1 $(MD)
  632. X#    cp utilities.d/MenuMsg.d/MenuPrompt.1 $(MD)
  633. X
  634. Xlint:
  635. X    lint -D LINT -I $(INCDIR) -I /usr/5include $(CFILES) -l curses -l c > menu.lint 
  636. X
  637. Xxref:
  638. X    cxref -o menu.xref -c -t -I$(INCDIR) $(CFILES) > menu.xref
  639. X
  640. Xflow:
  641. X    cflow -I$(INCDIR) $(CFILES) > menu.flow
  642. X
  643. Xprint:
  644. X    ppgm -t$(TITLE) menu.1 makefile $(CFILES) $(HFILES) $(LFILES) $(YFILES)
  645. X
  646. Xshar:
  647. X#    shar -b -c README makefile $(CFILES) $(HFILES) $(LFILES) $(YFILES) menu.hlp \
  648. X#    $(MANPAGES) > menu.shar
  649. X#    compress menu.shar
  650. X#
  651. X#    include HEADER file begining of file
  652. X#    mkdir utilities.d directories
  653. X    xshar -vcfx -l40 -omenu.shar. $(SHARFILES)
  654. X
  655. Xcpio:
  656. X    cpio -oBcv > menu.cpio < Files
  657. X    compress menu.cpio
  658. X
  659. Xclean:
  660. X    rm -f *.o core menu menu.lint menu.shar* menu.xref menu.flow \
  661. X    menu.shar.Z y.tab.h menu.cpio.Z runrealid
  662. X    cd utilities.d/libgeti.d; $(MAKE) clean
  663. X    rm -f utilities.d/lock.d/lock utilities.d/lock.d/unlock
  664. X    rm -f utilities.d/lock.d/*.o
  665. X    rm -f utilities.d/checkpass.d/checkpass utilities.d/checkpass.d/*.o
  666. X    rm -f utilities.d/msgbox.d/msgbox utilities.d/msgbox.d/*.o
  667. X    rm -f utilities.d/MenuMsg.d/MenuMsg utilities.d/MenuMsg.d/*.o
  668. X    rm -f utilities.d/MenuMsg.d/MenuPrompt
  669. X
  670. Xlinks:
  671. X    ln /usr/src/libgeti.d/findfile.c utilities.d/MenuAccess.d/findfile.c
  672. X    ln /usr/src/libgeti.d/GetInput.c utilities.d/libgeti.d/GetInput.c
  673. X
  674. X#####
  675. X#####
  676. X
  677. XMain.o:        Main.c menu.h
  678. XParseOpton.o:    ParseOpton.c menu.h
  679. XParseBaner.o:    ParseBaner.c menu.h
  680. XParseBox.o:    ParseBox.c menu.h
  681. XParseTitle.o:    ParseTitle.c menu.h
  682. XParseLine.o:    ParseLine.c menu.h
  683. XParseWindo.o:    ParseWindo.c menu.h
  684. XParseComnt.o:    ParseComnt.c menu.h
  685. XParseUnix.o:    ParseUnix.c menu.h
  686. XParseGname.o:    ParseGname.c menu.h
  687. XParseAuthr.o:    ParseAuthr.c menu.h
  688. XParseText.o:    ParseText.c menu.h
  689. XParseCur.o:    ParseCur.c menu.h
  690. XParseSpace.o:    menu.h
  691. XParInclude.o:    menu.h
  692. XParAssign.o:    menu.h
  693. XParAftMenu.o:    menu.h
  694. XParseDeSrn.o:     ParseDeSrn.y LexDeSrn.l menu.h
  695. X        yacc $(YFLAGS) ParseDeSrn.y
  696. X        $(CC) $(CFLAGS) -c y.tab.c
  697. X        mv y.tab.o ParseDeSrn.o
  698. X        rm -f y.tab.c
  699. X
  700. XShowOption.o:    ShowOption.c menu.h
  701. X
  702. XRunSystem.o:    RunSystem.c menu.h
  703. XRunMenu.o:    RunMenu.c menu.h
  704. XRunPopMenu.o:    RunPopMenu.c menu.h
  705. XRunExit.o:    menu.h
  706. XRunSetenv.o:    menu.h
  707. XRunPopMenu.o:    menu.h
  708. XRunGetI.o:    menu.h
  709. X
  710. Xparsedrive.o:    parsedrive.c menu.h
  711. Xshowdriver.o:    showdriver.c menu.h 
  712. Xrundriver.o:    rundriver.c menu.h terminal.h
  713. XLoadKeys.o:    LoadKeys.c menu.h
  714. XEndWindow.o:    EndWindow.c menu.h
  715. XGetOption.o:    menu.h terminal.h
  716. XSetTerm.o:    menu.h
  717. Xsetvar.o:    menu.h
  718. Xinitmenu.o:    menu.h
  719. Xrunscreen.o:    menu.h terminal.h
  720. XLexDeSrn.o:     LexDeSrn.l ParseDeSrn.y menu.h
  721. X        lex LexDeSrn.l
  722. X        $(CC) -c $(CFLAGS) lex.yy.c
  723. X        mv lex.yy.o LexDeSrn.o
  724. X        rm -f lex.yy.c
  725. X        rm -f y.tab.h
  726. X
  727. X#tokens.h:     y.tab.h
  728. X#        @if /bin/diff tokens.h y.tab.h > /dev/null 2> /dev/null;\
  729. X#                then :; \
  730. X#           else cp y.tab.h tokens.h; \
  731. X#        fi
  732. X#calc.o:     calc.y calc.l
  733. X#        yacc $(YFLAGS) calc.y
  734. X#        lex calc.l
  735. X#        sed "s/#define YYABORT        return(1)/#define YYABORT return(-999)/" y.tab.c > junkme
  736. X#        mv junkme y.tab.c
  737. X#        rm -f junkme
  738. X#        $(CC) $(CFLAGS) -c y.tab.c
  739. X#        mv y.tab.o calc.o
  740. X#        rm -f y.tab.c
  741. X#        rm -f lex.yy.c
  742. X#        rm -f y.tab.h
  743. X
  744. Xclean_menu.o:    menu.h
  745. X
  746. X
  747. X#####
  748. X#####    Inference Rules
  749. X#####
  750. X
  751. X.SUFFIXES:
  752. X.SUFFIXES: .o .ec .ec~ .c .c~ .h .h~
  753. X
  754. X.c~.c:
  755. X    $(GET) $<
  756. X.h~.h:
  757. X    $(GET) $<
  758. X.c.o:
  759. X    $(CC) -c $(CFLAGS) $*.c
  760. X.c~.o:
  761. X    $(GET) -p $<> $*.c
  762. X    $(CC) -c $(CFLAGS) $*.c
  763. X    rm $*.c
  764. X.ec.o:
  765. X    esql $(CFLAGS) -c $<
  766. X    rm -f $*.c
  767. X.ec~.o:
  768. X    $(GET) -p $<> $*.ec
  769. X    esql $(CFLAGS) -c $<
  770. X    rm $*.ec
  771. X    rm $*.c
  772. SHAR_EOF
  773. chmod 0644 makefile || echo "restore of makefile fails"
  774. echo "x - extracting menu.1 (Text)"
  775. sed 's/^X//' << 'SHAR_EOF' > menu.1 &&
  776. X. \ %W% DeltaDate %G% ExtrDate %H% 
  777. X.po 6
  778. X.TH MENU 1 "Version 3.63"
  779. X.SH NAME
  780. X.TP 12
  781. Xmenu 
  782. X\- a menu program
  783. X.SH SYNOPSIS
  784. X.B "menu  [ -v ] [ -p row,col ] [ -d ] [ -keys ] [ -notrap ]  menufile"
  785. X
  786. X.SH DESCRIPTION 
  787. X\fBMenu(1)\fP is an easy-to-use menu utility that allows
  788. Xusers to operate an application system in a user-friendly, menu-driven
  789. Xenvironment.  Any application software, regardless of source language or
  790. Xoperating system process can be executed from menus designed with
  791. X\fIMenu(1)\fP.
  792. X
  793. XFor systems requiring multi-level menus for a diverse number of users,
  794. X\fIMenu(1)\fP allows a single menu to call any number of submenus, which
  795. Xmay in turn call more menus or execute any number of processes.
  796. XMenus can be nested to any level without increasing
  797. Xstartup time or memory requirements.
  798. X
  799. XMenus can also be designed to function as user-friendly data entry 
  800. Xscreens for capturing data, which can then be used as input for a process.
  801. XText items such as "displays", "choices" and "responses" can be added within 
  802. Xany of these defined boundaries, and will automatically adjust if any 
  803. Xboundaries are changed.  Special screen attributes, such as highlighting and
  804. Xreverse video, can be defined to add special emphasis.
  805. X
  806. XThe menu script file contains all of the menu instructions, and can
  807. Xbe edited using a standard system editor, such as vi.  Menus and utilities
  808. Xcan be added or deleted by editing the appropriate script file, even while
  809. Xthe menu is in use.  
  810. X
  811. XMenu provides flexibility in designing how you want your
  812. Xmenus to look, yet, strives to maintain some consistency and functionality from
  813. Xone menu to another.  Menu was designed with "hooks" built in, so that, if 
  814. Xadditional features/functionality for an application is required 
  815. Xthe programmers
  816. Xnew "keyword" modules could be linked in to the driver routines in menu(1)
  817. X(see Programming Notes).  Menu(1) could be used as a prototyping tool.
  818. X.PP
  819. XMenu is keyword driven.  
  820. XThe menufile (script file) is parsed and when a defined keyword is found the
  821. Xassociated function for that keyword is called.
  822. XThe menufile is first searched for in your current directory and
  823. Xthen in getenv("MENUDIR").  Menufile should be in basename format, use
  824. XMENUDIR to get the full path name.  To be consistent with other file naming
  825. Xconventions, I recommend that all menu script files be suffixed with a ".m"
  826. Xfor menu.
  827. XThe "menu.hlp" file contains the on-line help screen.
  828. XThe help file is
  829. Xfirst searched for in the current directory, then in getenv("HELPDIR"),
  830. Xthen in getenv("MENUDIR").  Look in the directory where menu is installed
  831. Xfor the help file (menu.hlp).  If you want to customize the help file, copy it
  832. Xto another directory and set HELPDIR.
  833. XMenu uses curses(3X) so you need to have your TERM variable set.
  834. X.PP
  835. XMenu provides a shell escape (!) depending upon whether the SHELL environment
  836. Xvariable is set.  You should \fIunset SHELL\fP if you want to restrict the user
  837. Xfrom the shell.  If the set uid bit is set on menu and a shell escape command
  838. Xis selected by the user.  The uid and gid is set back to the real uid/gid
  839. Xbefore executing the shell command.
  840. X
  841. X.SS Command Line Options
  842. X.TP 6
  843. X-v
  844. XThe [-v] command line option will print the version of the menu program
  845. Xyou are running.  The version number increasing by tenths usually indicate
  846. Xnew capabilities/keywords, 
  847. Xhundredths indicate bug fixes/enchancements to existing keywords/capabilities.
  848. X.TP 6
  849. X-p row,col
  850. XTells menu what row and column (upper left corner) you
  851. Xwant the pop-up menu, for goto menu names, to appear.
  852. XSee .GNAME below.  Default is [6,8].  I would try to keep the pop-up 
  853. Xmenu high and to the left, 
  854. Xthere is no real intelligence built in if the number or length of GNAMES puts
  855. Xit off the screen.
  856. X.TP 6
  857. X-d
  858. XPrints debugging information to stderr.
  859. X.TP 6
  860. X-keys
  861. XDetermine the various key values on your keyboard.  This displays what is
  862. Xreturned from a curses getch() call with the keypad turned on.
  863. XThis information can be used to custom tailor your .menuinit file.
  864. X.TP 6
  865. X-notrap
  866. XDon't trap and ignore SIGINT,SIGQUIT signals.  This is good for testing so you
  867. Xdon't lock up your terminal.  The default is to ignore those signals.
  868. X
  869. X.SS Syntax Used In This Man Page
  870. XThe position of the arguments for the various keywords is important.  All
  871. Xarguments including any
  872. Xoptional arguments that are used must appear in the position shown in
  873. Xthe synopsis for that keyword, unless stated otherwise.
  874. X
  875. X.TP 6
  876. X[ ]
  877. XThroughout this man page the "\fB[ ]\fP" indicate that what is enclosed is 
  878. Xoptional.
  879. X.TP 6
  880. X[ \\\\\\ ]
  881. XA keyword synopsis that has "\fB[ \\ ]\fP" as the last argument 
  882. Xindicates that the continuation 
  883. Xcharacter (\\) may be placed as the last character on the line to continue 
  884. Xto the next line.
  885. X.TP 6
  886. X[!]
  887. XIndicates a conditional environment variable setting.  If the variable is not
  888. Xalready set (getenv(variable) == NULL) then the variable is set to the specified
  889. Xvalue, otherwise it is not changed.  Same operation as doing a 
  890. Xshell ${parameter:-word}.
  891. X
  892. X.SH KEYWORD SYNOPSIS
  893. XThe following keywords are placed in a menu script file to tell \fImenu(1)\fP
  894. Xwhat to do.  They are listed in alphabetical order, with special character
  895. Xkeywords listed first.
  896. X
  897. X
  898. X\fB[!]variable=value\fP
  899. X.IP "" 6
  900. XA environment variable assignment statement.  The environment variable defined
  901. Xby \fIvariable\fP is set equal to the \fIvalue\fP specified.  The variable is 
  902. Xset as soon as it is found while parsing the menufile, it becomes
  903. Xpart of the menu environment so that all subsequent programs that are spawned
  904. Xwill inherit these variables.
  905. X
  906. XThe character "$" in \fIvalue\fP is used to introduce substitutable 
  907. Xparameters, in the form of ${\fIparameter\fP}.
  908. XThe value, if any, of the \fIparameter\fP is substituted.  The braces are 
  909. Xrequired only when \fIvalue\fP is followed by a letter, digit, or 
  910. Xunderscore that is not to be interpreted as part of its name.
  911. X
  912. XThe character "~" in \fIvalue\fP is used to introduce tilde expansion.  
  913. XMenu checks the value
  914. Xto see if a "~" appears after the "=".  If it does menu checks the word that
  915. Xfollows up to a "/".  A "~" by itself equals $HOME. A "~user" equals home(user).
  916. X
  917. XA pair of grave accents (`command`) introduce command substitution.  The
  918. Xstandard output from the \fIcommand\fP is assigned to the variable.
  919. X
  920. XWarning: If you reset a environment variable in a GETINPUT that you have
  921. Xdefined here.  The variable will get reset back to this value when the menufile
  922. Xis re-parsed, unless you use the "!".
  923. X. \ --------------------------------------------------------------------------
  924. X.PP
  925. X\fB###\fP  Comment text.
  926. X.IP "" 6
  927. XA comment line.  The entire line is ignored.  May be placed anywhere in
  928. Xthe menufile.
  929. X. \ --------------------------------------------------------------------------
  930. X
  931. X.PP
  932. X\fB###NAME\fP  Alias menu name.
  933. X.IP "" 6
  934. XThis optional comment line is used by the MenuAccess(1) program to display
  935. Xa different name on the screen for the menu instead of the unix file name,
  936. Xmore user friendly.  This is recommended if you plan to use MenuAccess.
  937. X. \ --------------------------------------------------------------------------
  938. X
  939. X.PP
  940. X \fB.AFTER_MENU\fP  [ REDRAW ]  [ GETINPUT screen_name ]  command  [ \\ ]
  941. X.IP "" 6
  942. XA command that is run after the user exits/gets out of/returns from a menu
  943. XSee \fI.UNIX\fP for more info.
  944. X. \ --------------------------------------------------------------------------
  945. X
  946. X.PP
  947. X \fB.AUTHORIZE\fP  logname  [ logname ... ]  [ \\ ]
  948. X.IP "" 6
  949. XAuthorize only certain login's to be able to access a menu.  For example
  950. Xapplication administration functions to be done by application administrators
  951. Xonly.  This can be done by putting those functions in one menu and
  952. Xusing the .AUTHORIZE keyword.  \fILogname\fP is the login name of a user you
  953. Xwant to allow to see this menu.  Only the
  954. Xfirst .AUTHORIZE keyword will be used, so all lognames must be listed on 
  955. Xthat line.
  956. XIf no .AUTHORIZE is given in menufile then that menu is open to every one.
  957. XIf a .AUTHORIZE is given in the main menu (first) then restriction would apply
  958. Xto someone trying to get into the application.
  959. X.br
  960. XThis keyword is used by the \fIMenuAccess(1)\fP program.
  961. X.br
  962. X
  963. X.br
  964. XThis keyword authorizes a login at the menu level.  If you need to authorize
  965. Xat the option level you could try something like this. (see .SYSTEM)
  966. X.nf
  967. X    .SYSTEM  if [ $LOGNAME = "stella" ] \\
  968. X                               then  run_program \\
  969. X                               else  echo "Sorry honey, Not Authorized." \\
  970. X                       fi
  971. X    Option Description Text.
  972. X.fi
  973. X. \ --------------------------------------------------------------------------
  974. X
  975. X.PP
  976. X.nf
  977. X \fB.BANNER\fP [ linecount ]
  978. X .section  text
  979. X.fi
  980. X.IP "" 6
  981. XDraws a banner page.  Linecount should be the number of lines
  982. Xfollowing .BANNER, each consisting of ".section text".  Section
  983. Xmay be either .U to display text in upper section or .L to
  984. Xdisplay text in lower section.  Only four lines in each section
  985. Xallowed.
  986. XThe idea behind this was to provide some kind of welcome (to your
  987. Xapplication) screen.
  988. XIf .BANNER is used it should be the first keyword in menufile.
  989. XThis one is really worthless!  It's too slooooow.
  990. X
  991. XNot supported in a \fI.POPMENU\fP menu.
  992. X. \ --------------------------------------------------------------------------
  993. X
  994. X.PP
  995. X \fB.BOX\fP [ StandoutLine ] [ DumbLine ]
  996. X.IP "" 6
  997. XDraws a box around the menu window.
  998. XThe \fIBOX\fP will use the top line of the screen so the first \fI.TITLE\fP
  999. Xline should be null.  The box will also use the first and last column,
  1000. Xyour title lines should take that into account.  You get a different effect
  1001. Xdepending on whether you place the .BOX before (with a .LINE) or after 
  1002. Xthe .TITLE lines.
  1003. X
  1004. XThe arguments specify what type of line you want to use to draw the box with.
  1005. XThe second argument specifies the type of line to use to dim the menu.
  1006. X.br
  1007. XAny one of the following may be used:
  1008. X.nf
  1009. X    DumbLine    \fIDefault line used in dimming.\fP
  1010. X    StandoutLine    \fIDefault line.\fP
  1011. X    SingleLine    \fIAlternate character line.\fP
  1012. X    MosaicLine    \fIAlternate character line.\fP
  1013. X    DiamondLine    \fIAlternate character line.\fP
  1014. X    DotLine        \fIAlternate character line.\fP
  1015. X    PlusLine        \fIAlternate character line.\fP
  1016. X.fi
  1017. XThe alternate character lines are dependent on your terminal (try "menu -key").
  1018. XNot all terminals have the capability to draw these lines.
  1019. XIf one of the alternate character lines is specified
  1020. Xand it is found that the terminal does not support it, the line will be
  1021. Xdrawn in StandoutLine.  Check your terminal manual and the terminfo definition
  1022. Xfor alternate character set.
  1023. X
  1024. XNot supported in a \fI.POPMENU\fP menu.  
  1025. XAll pop-up menus automatically get boxed.
  1026. X. \ --------------------------------------------------------------------------
  1027. X
  1028. X.PP
  1029. X.nf
  1030. X \fB.CURSOR\fP [-]row [-]column
  1031. X.fi
  1032. X.IP "" 6
  1033. XWhere do you want the cursor to appear on the screen?  If no \fI.CURSOR\fP
  1034. Xis specified it defaults to row=lastrow-2, column=lastcol-4.  
  1035. XSee explanation under .TEXT for negative row/column.
  1036. XThe \fI.CURSOR\fP
  1037. Xis only active for the current menu.  If you want the same cursor location
  1038. Xin every menu you will need to put a \fI.CURSOR\fP in every menu.
  1039. X
  1040. XNot supported in a \fI.POPMENU\fP menu.
  1041. X. \ --------------------------------------------------------------------------
  1042. X
  1043. X.PP
  1044. X.nf
  1045. X \fB.DEFINE_SCREEN\fP  screen_name
  1046. X                    [ window_rows = number ]
  1047. X                    [ window_cols = number ]
  1048. X                    [ window_pos = number  number ]
  1049. X                    [ window_title = string ]
  1050. X                    [ window_border = string [ string ] ]
  1051. X                    [ helpfile = string ]
  1052. X                    [ field_defaults = "string" ]
  1053. X                    [ after_screen = "string" ]
  1054. X                    [ exit_last_field ]
  1055. X                    [ exit_on_cancel ]
  1056. X                    [ text = number number string ]
  1057. X
  1058. X                      ###  The following repeat for each field.
  1059. X
  1060. X                      field_name = $string
  1061. X                      field_row = number
  1062. X                      field_col = number
  1063. X                      field_length = number
  1064. X                    [ field_label = string ]
  1065. X                    [ field_mask = string ]
  1066. X                    [ field_edits = string ]
  1067. X                    [ field_range = string ]
  1068. X                    [ field_min = number ]
  1069. X                    [ field_adjust = string ]
  1070. X                    [ field_mustenter ]
  1071. X                    [ field_prompt = string ]
  1072. X                    [ field_terminator = string ]
  1073. X                    [ field_noinput ]
  1074. X                    [ before_field = "string" ]
  1075. X                    [ after_field = "string" ]
  1076. X ENDSCREEN
  1077. X.fi
  1078. X
  1079. X.RS 6
  1080. XThis keyword defines a input screen that can be used with the .GETINPUT keyword.
  1081. XIf you want the same screen definition in all menus you have
  1082. Xto place it in all menus (see .INCLUDE).
  1083. XThe ordering of the arguments is unimportant except for field_name, see below.
  1084. XThe screen arguments may be placed on the same line if separated by a comma.
  1085. XThe screen arguments are listed below with the default value
  1086. Xspecified for those arguments that are optional.
  1087. XSee GetInput(3X) man page for more information.
  1088. X
  1089. XYou may have a maximum of ten screens (MAXSCREENS) defined in any one menu and
  1090. Xa maximum of forty fields (MAXFIELDS) for any one screen.  This may be
  1091. Xincreased via the menu.h file.
  1092. X
  1093. XThe following arguments are listed in the order they are shown above.
  1094. X
  1095. XScreen Arguments:
  1096. X.RS 4
  1097. X.TP 15
  1098. Xscreen_name
  1099. XScreen Name.  Used with .GETINPUT to find screen definition.
  1100. XMaximum length of name is 30 characters.
  1101. X.TP 15
  1102. X[ window_rows ]
  1103. XNumber of rows in window.
  1104. X.br
  1105. XIf either window_rows or window_cols is zero, they will be set to the value 
  1106. Xof (screen_lines-window_pos(row)) and (screen_cols-window_pos(col)).
  1107. XIf the window_rows, window_cols and window_pos fields are all set to zero
  1108. Xa full-screen will be used.  See newwin(curses 3X) for more info.
  1109. XIf this argument is omitted then it will be automatically calculated.
  1110. X.TP 15
  1111. X[ window_cols ]
  1112. XNumber of columns in window.  See window_rows.
  1113. XIf this argument is omitted then it will be automatically calculated.
  1114. X.TP 15
  1115. X[ window_pos ]
  1116. XTop left corner to place the window at,  where the first number indicates the
  1117. Xrow and the second number indicates the column.  See window_rows.
  1118. XIf this argument is omitted then the window will be placed as close to, and to
  1119. Xthe right of, the option that selected it.  This argument is not optional if
  1120. Xthe screen is to be used with a .UNIX keyword.
  1121. XThere is no intelligence built in to check if you put the window outside 
  1122. Xthe screen dimensions.
  1123. X.br
  1124. XA environment variable may be specified for the arguments to window_pos.
  1125. X.TP 15
  1126. X[ window_title ]
  1127. XA title to be centered on line zero of the window.  A environment variable may 
  1128. Xbe specified in the title.  The title may not exceed 100 bytes.
  1129. XIf no window_title is specified a default of the option description text 
  1130. Xthat selected the \fIGETINPUT\fP screen is used.
  1131. X.TP 15
  1132. X[ window_border = Standout ]
  1133. XThe type of box you want around the window.  A standout box is the default.
  1134. XSee \fI.BOX\fP for description of line types.
  1135. X.TP 15
  1136. X[ helpfile = "menu.hlp" ]
  1137. XA help file associated with this window.  The helpfile should be in
  1138. Xdouble quotes if it has a "." in the name, and should be in basename format.
  1139. XThe helpfile is first looked for
  1140. Xin the current directory and then in \fI$HELPDIR\fP.  The fieldname (excluding
  1141. Xthe "$") becomes the tagname in the help file.  See \fIHELP SCREENS\fP in this 
  1142. Xdocument for more information.
  1143. XSet helpfile = "" if you don't want the Help message to appear in lower
  1144. Xright corner of window.
  1145. X.TP 15
  1146. X[ field_defaults = "" ]
  1147. XThis is used to initialize your fields to a default value at runtime.  
  1148. XWhat goes into the quoted
  1149. Xstring is a shell command that is passed into a popen(3) call.  What the shell
  1150. Xcommand should echo to stdout is the values you want to set your fields to.
  1151. XNo edit checks against the range values, if any, are performed on the default 
  1152. Xvalues.
  1153. XMaximum length of the shell command is 1k.
  1154. XField values composed of multiple strings should be quoted.  The quote should
  1155. Xalso be double escaped (\\\\"). If the number of
  1156. Xvalues echoed to stdout is less than the number of screen fields the remainder
  1157. Xof the screen fields are set to "".  To force a field value to "" echo \\"\\" to
  1158. Xstdout.
  1159. X.nf
  1160. SHAR_EOF
  1161. echo "End of part 1"
  1162. echo "File menu.1 is continued in part 2"
  1163. echo "2" > s2_seq_.tmp
  1164. exit 0
  1165.