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

  1. From: pjc@pcbox.UUCP (Paul J. Condie)
  2. Newsgroups: alt.sources
  3. Subject: menu(1) part 1 of 11
  4. Message-ID: <423@pcbox.UUCP>
  5. Date: 6 Apr 90 17:29:28 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. #      In appreciation of the many things I've pulled off the net,
  15. #      I give you this.
  16. #
  17. #      A Brief Description:
  18. #           Menu(1) is an easy-to-use menu utility that allows users to
  19. #           operate an application system in a user-friendly, menu-
  20. #           driven environment.  Any application software, regardless of
  21. #           source language or operating system process can be executed
  22. #           from menus designed with Menu(1).
  23. #
  24. #           For systems requiring multi-level menus for a diverse number
  25. #           of users, Menu(1) allows a single menu to call any number of
  26. #           submenus, which may in turn call more menus or execute any
  27. #           number of processes.  Menus can be nested to any level
  28. #           without increasing startup time or memory requirements.
  29. #
  30. #           Menus can also be designed to function as user-friendly data
  31. #           entry screens for capturing data, which can then be used as
  32. #           input for a process.  Text items such as "displays",
  33. #           "choices" and "responses" can be added within any of these
  34. #           defined boundaries, and will automatically adjust if any
  35. #           boundaries are changed.  Special screen attributes, such as
  36. #           highlighting and reverse video, can be defined to add
  37. #           special emphasis.
  38. #
  39. #           The menu script file contains all of the menu instructions,
  40. #           and can be edited using a standard system editor, such as
  41. #           vi.  Menus and utilities can be added or deleted by editing
  42. #           the appropriate script file, even while the menu is in use.
  43. #
  44. #    Run the following text with /bin/sh to create:
  45. #      README
  46. #      makefile
  47. #      menu.1
  48. #      Main.c
  49. #      LoadKeys.c
  50. #      parsedrive.c
  51. #      showdriver.c
  52. #      rundriver.c
  53. #      ParseOpton.c
  54. #      ParseBaner.c
  55. #      ParseTitle.c
  56. #      ParseBox.c
  57. #      ParseWindo.c
  58. #      ParseLine.c
  59. #      ParseComnt.c
  60. #      ParseUnix.c
  61. #      ParseGname.c
  62. #      ParseAuthr.c
  63. #      ParseText.c
  64. #      ParseCur.c
  65. #      ParseSpace.c
  66. #      ParInclude.c
  67. #      ParAssign.c
  68. #      ShowOption.c
  69. #      RunSystem.c
  70. #      RunExit.c
  71. #      RunSetenv.c
  72. #      RunMenu.c
  73. #      RunPopMenu.c
  74. #      RunGetI.c
  75. #      GetOption.c
  76. #      EndWindow.c
  77. #      displaytxt.c
  78. #      SetTerm.c
  79. #      systime.c
  80. #      sysdate.c
  81. #      TrapSignal.c
  82. #      checkmail.c
  83. #      anymail.c
  84. #      setenv.c
  85. #      strmatch.c
  86. #      setvar.c
  87. #      findfile.c
  88. #      drawline.c
  89. #      initmenu.c
  90. #      keyboard.c
  91. #      runscreen.c
  92. #      getval.c
  93. #      clean_menu.c
  94. #      System.c
  95. #      slength.c
  96. #      upper.c
  97. #      substr.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/popmenu.c
  129. #      utilities.d/libgeti.d/GetInput.h
  130. #      utilities.d/libgeti.d/keys.h
  131. #      utilities.d/libgeti.d/makefile
  132. #      utilities.d/libgeti.d/GetInput.3X
  133. #      utilities.d/libgeti.d/RingMenu.3
  134. #      utilities.d/libgeti.d/ShowHelp.3
  135. #      utilities.d/libgeti.d/drawbox.3
  136. #      utilities.d/libgeti.d/popmenu.3
  137. #      utilities.d/libgeti.d/GetInput.hlp
  138. #      utilities.d/checkpass.d/checkpass.1
  139. #      utilities.d/checkpass.d/checkpass.c
  140. #      utilities.d/lock.d/junk
  141. #      utilities.d/lock.d/lock.1
  142. #      utilities.d/lock.d/lock.c
  143. #      utilities.d/lock.d/unlock.1
  144. #      utilities.d/lock.d/unlock.c
  145. #      utilities.d/m.d/adduser
  146. #      utilities.d/m.d/deluser
  147. #      utilities.d/m.d/junk.m
  148. #      utilities.d/m.d/passwdsrn.m
  149. #      utilities.d/m.d/printer2.sh
  150. #      utilities.d/m.d/printers.m
  151. #      utilities.d/m.d/printers.sh
  152. #      utilities.d/m.d/reportsrn.m
  153. #      utilities.d/m.d/sadmin.m
  154. #      utilities.d/m.d/sample.m
  155. #      utilities.d/m.d/suid_exec.c
  156. #
  157. if test -r s2_seq_.tmp
  158. then echo "Must unpack archives in sequence!"
  159.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  160.      exit 1; fi
  161. mkdir utilities.d
  162. mkdir utilities.d/libgeti.d
  163. mkdir utilities.d/m.d
  164. mkdir utilities.d/lock.d
  165. mkdir utilities.d/checkpass.d
  166. echo "x - extracting README (Text)"
  167. sed 's/^X//' << 'SHAR_EOF' > README &&
  168. XThis menu program is being released as public domain software, and as
  169. Xsuch, you have the right to use/abuse it as you see fit so long as no
  170. Xprofit is made from it.
  171. X                    Paul J. Condie
  172. X                    (Author)
  173. X
  174. Xmenu directory structure:
  175. X
  176. X                             |-MenuAccess.d    MenuAccess(1) program
  177. X  menu(1)                    |-checkpass.d    checkpass(1) program
  178. Xsource code --|-utilities.d--|-libgeti.d    GetInput(3X) library
  179. X                             |-lock.d        lock(1) & unlock(1)
  180. X                             |-m.d        Sample menu script files.
  181. X
  182. XTo install menu(1):
  183. X
  184. X    1.   cd to where you want to keep the source code
  185. X    2.   unpack the package
  186. X         cpio -iBcdumv < menu.cpio  or  unshar menu.shar.xx
  187. X    3.   vi makefile and set where you want to install menu
  188. X    4.   make
  189. X    5.   make install
  190. X
  191. XTo test menu(1):
  192. X    -   set menu directory to some sample menus
  193. X        MENUDIR=utilities.d/m.d
  194. X    -   tell menu where you installed the help file
  195. X        HELPDIR=/usr/local/bin
  196. X    -   run a sample menu
  197. X        menu sample.m
  198. X
  199. XNotes:
  200. X    - The MenuAccess(1) program is not implemented yet.
  201. SHAR_EOF
  202. chmod 0644 README || echo "restore of README fails"
  203. echo "x - extracting makefile (Text)"
  204. sed 's/^X//' << 'SHAR_EOF' > makefile &&
  205. X# %W%   DeltaDate %G%   ExtrDate %H%
  206. XTITLE = "MENU"
  207. X
  208. X# SYS5    - System V
  209. X# BSD    - Berkely
  210. XOSVER = SYS5
  211. X
  212. X# For the $MAIL (mail notification).
  213. X# On some systems the alarm() does not come into effect while in the middle
  214. X# of a getch().  The alarms get buffered up until the user hits a key and
  215. X# then all the bells notifying of mail goes off.  You should take out the
  216. X# -DALARM on the CFLAGS to get around this.
  217. X# Works ok on:        -DALARM
  218. X#    AT&T 3b1
  219. X#    AT&T 3b2
  220. X# Does not work on:
  221. X#    SUN
  222. X#    Arete
  223. X#    AT&T 3b15
  224. X#    AT&T 3b20
  225. X#    CT megaframe
  226. X#
  227. X#  -DSINGLE
  228. X#    Causes static references to terminal capabilities instead of dynamic 
  229. X#    references.  This results in smaller code. See /usr/include/term.h
  230. X#  -DLEXDEBUG
  231. X#    Only if you need more debugging for .DEFINE_SCREEN
  232. X#  -DYYDEBUG
  233. X#    Only if you need more debugging for .DEFINE_SCREEN
  234. X#  -DSUN
  235. X#    Sun compilation with 5bin/cc (SYS5)
  236. X
  237. X
  238. XINSTALLDIR = /usr/lbin
  239. XHELPDIR = /usr/lbin
  240. XMD = /usr/man/man1
  241. XINCDIR = .
  242. XLIBDIR =
  243. X
  244. X###  Various CFLAG settings
  245. X
  246. X###  Sys5
  247. XCFLAGS = -I$(INCDIR) -O -D$(OSVER) -DSINGLE
  248. X###  Xenix
  249. X#CFLAGS = -I$(INCDIR) -O -D$(OSVER) -DSINGLE -DM_TERMINFO -LARGE -Ml -Mlt34 -F 10000 -SEG 500
  250. X
  251. XYFLAGS = -d
  252. X
  253. X###  Libraries
  254. X
  255. X###  Sys5
  256. XLIBS = libgeti.a -lcurses -ltermcap -lc -lm -ll -ly
  257. X#LIBS = libgeti.a -lcurses -ll -ly
  258. X###  Xenix
  259. X#LIBS = libgeti.a -ltinfo -lx -ll -ly
  260. X
  261. XCFILES = Main.c LoadKeys.c parsedrive.c showdriver.c rundriver.c \
  262. X    ParseOpton.c ParseBaner.c ParseTitle.c ParseBox.c ParseWindo.c \
  263. X    ParseLine.c ParseComnt.c ParseUnix.c ParseGname.c ParseAuthr.c \
  264. X    ParseText.c ParseCur.c ParseSpace.c ParInclude.c ParAssign.c \
  265. X    ShowOption.c \
  266. X    RunSystem.c RunExit.c RunSetenv.c RunMenu.c RunPopMenu.c RunGetI.c \
  267. X    GetOption.c \
  268. X    EndWindow.c displaytxt.c SetTerm.c \
  269. X    systime.c sysdate.c TrapSignal.c checkmail.c anymail.c setenv.c \
  270. X    strmatch.c setvar.c findfile.c drawline.c initmenu.c keyboard.c \
  271. X    runscreen.c getval.c clean_menu.c System.c slength.c upper.c substr.c
  272. X
  273. XLFILES = LexDeSrn.l
  274. XYFILES = ParseDeSrn.y
  275. X
  276. XHFILES = menu.h terminal.h
  277. X
  278. XMANPAGES = menu.1
  279. X
  280. XMENUFILES = utilities.d/m.d/*.m
  281. XSHARFILES = README makefile $(MANPAGES) $(CFILES) $(HFILES) $(LFILES) \
  282. X    menu.hlp runrealid.c $(YFILES) utilities.d/libgeti.d/*.c \
  283. X    utilities.d/libgeti.d/*.h utilities.d/libgeti.d/makefile \
  284. X    utilities.d/libgeti.d/*.3* utilities.d/libgeti.d/*.hlp \
  285. X    utilities.d/checkpass.d/* utilities.d/lock.d/* utilities.d/m.d/*
  286. X
  287. XOBJECTS = $(CFILES:.c=.o) $(YFILES:.y=.o) $(LFILES:.l=.o)
  288. X
  289. Xall:    menu runrealid checkpass lock
  290. X
  291. Xmenu:    libgeti $(OBJECTS) 
  292. X    $(CC) $(CFLAGS) $(OBJECTS) $(LIBDIR) $(LIBS) -o $@
  293. X    size menu
  294. X    @echo 
  295. X
  296. Xrunrealid: runrealid.c
  297. X    $(CC) $(CFLAGS) runrealid.c -o $@
  298. X
  299. Xlibgeti:
  300. X    cd utilities.d/libgeti.d; $(MAKE) install
  301. X
  302. Xcheckpass:
  303. X    cd utilities.d/checkpass.d; $(MAKE) checkpass
  304. X
  305. Xlock:
  306. X    cd utilities.d/lock.d; $(MAKE) lock
  307. X    cd utilities.d/lock.d; $(MAKE) unlock
  308. X
  309. Xinstall:
  310. X    strip menu
  311. X    cp menu $(INSTALLDIR)
  312. X    cp menu.hlp $(HELPDIR)
  313. X#    cp sample.m $(INSTALLDIR)
  314. X#    cp printers.m $(INSTALLDIR)
  315. X#    cp reportsrn.m $(INSTALLDIR)
  316. X#    cp menu.1 $(MD)
  317. X    strip runrealid
  318. X    cp runrealid $(INSTALLDIR)
  319. X    cp utilities.d/checkpass.d/checkpass $(INSTALLDIR)
  320. X#    cp utilities.d/checkpass.d/checkpass.1 $(MD)
  321. X    cp utilities.d/lock.d/lock $(INSTALLDIR)
  322. X    cp utilities.d/lock.d/unlock $(INSTALLDIR)
  323. X#    cp utilities.d/lock.d/lock.1 $(MD)
  324. X#    cp utilities.d/lock.d/unlock.1 $(MD)
  325. X
  326. Xlint:
  327. X    lint -D LINT -I $(INCDIR) -I /usr/5include $(CFILES) -l curses -l c > menu.lint 
  328. X
  329. Xxref:
  330. X    cxref -o menu.xref -c -t -I$(INCDIR) $(CFILES) > menu.xref
  331. X
  332. Xflow:
  333. X    cflow -I$(INCDIR) $(CFILES) > menu.flow
  334. X
  335. Xprint:
  336. X    ppgm -t$(TITLE) menu.1 makefile $(CFILES) $(HFILES) $(LFILES) $(YFILES)
  337. X
  338. Xshar:
  339. X#    shar -b -c README makefile $(CFILES) $(HFILES) $(LFILES) $(YFILES) menu.hlp \
  340. X#    $(MANPAGES) > menu.shar
  341. X#    compress menu.shar
  342. X    xshar -vcfx -l40 -omenu.shar. $(SHARFILES)
  343. X
  344. Xcpio:
  345. X    cpio -oBcv > menu.cpio < Files
  346. X    compress menu.cpio
  347. X
  348. Xclean:
  349. X    rm -f *.o core menu menu.lint menu.shar* menu.xref menu.flow \
  350. X    menu.shar.Z y.tab.h menu.cpio.Z runrealid
  351. X    cd utilities.d/libgeti.d; $(MAKE) clean
  352. X    rm -f utilities.d/lock.d/lock utilities.d/lock.d/unlock
  353. X    rm -f utilities.d/lock.d/*.o
  354. X    rm -f utilities.d/checkpass.d/checkpass utilities.d/checkpass.d/*.o
  355. X
  356. Xlinks:
  357. X    ln findfile.c utilities.d/MenuAccess.d/findfile.c
  358. X    ln /usr/src/libgeti.d/GetInput.c utilities.d/libgeti.d/GetInput.c
  359. X
  360. X#####
  361. X#####
  362. X
  363. XMain.o:        Main.c menu.h
  364. XParseOpton.o:    ParseOpton.c menu.h
  365. XParseBaner.o:    ParseBaner.c menu.h
  366. XParseBox.o:    ParseBox.c menu.h
  367. XParseTitle.o:    ParseTitle.c menu.h
  368. XParseLine.o:    ParseLine.c menu.h
  369. XParseWindo.o:    ParseWindo.c menu.h
  370. XParseComnt.o:    ParseComnt.c menu.h
  371. XParseUnix.o:    ParseUnix.c menu.h
  372. XParseGname.o:    ParseGname.c menu.h
  373. XParseAuthr.o:    ParseAuthr.c menu.h
  374. XParseText.o:    ParseText.c menu.h
  375. XParseCur.o:    ParseCur.c menu.h
  376. XParseSpace.o:    menu.h
  377. XParInclude.o:    menu.h
  378. XParAssign.o:    menu.h
  379. XParseDeSrn.o:     ParseDeSrn.y LexDeSrn.l menu.h
  380. X        yacc $(YFLAGS) ParseDeSrn.y
  381. X        cc $(CFLAGS) -c y.tab.c
  382. X        mv y.tab.o ParseDeSrn.o
  383. X        rm -f y.tab.c
  384. X
  385. XShowOption.o:    ShowOption.c menu.h
  386. X
  387. XRunSystem.o:    RunSystem.c menu.h
  388. XRunMenu.o:    RunMenu.c menu.h
  389. XRunPopMenu.o:    RunPopMenu.c menu.h
  390. XRunExit.o:    menu.h
  391. XRunSetenv.o:    menu.h
  392. XRunPopMenu.o:    menu.h
  393. XRunGetI.o:    menu.h
  394. X
  395. Xparsedrive.o:    parsedrive.c menu.h
  396. Xshowdriver.o:    showdriver.c menu.h 
  397. Xrundriver.o:    rundriver.c menu.h terminal.h
  398. XLoadKeys.o:    LoadKeys.c menu.h
  399. XEndWindow.o:    EndWindow.c menu.h
  400. XGetOption.o:    menu.h terminal.h
  401. XSetTerm.o:    menu.h
  402. Xsetvar.o:    menu.h
  403. Xinitmenu.o:    menu.h
  404. Xrunscreen.o:    menu.h terminal.h
  405. XLexDeSrn.o:     LexDeSrn.l ParseDeSrn.y menu.h
  406. X        lex LexDeSrn.l
  407. X        cc -c $(CFLAGS) lex.yy.c
  408. X        mv lex.yy.o LexDeSrn.o
  409. X        rm -f lex.yy.c
  410. X        rm -f y.tab.h
  411. X
  412. X#tokens.h:     y.tab.h
  413. X#        @if /bin/diff tokens.h y.tab.h > /dev/null 2> /dev/null;\
  414. X#                then :; \
  415. X#           else cp y.tab.h tokens.h; \
  416. X#        fi
  417. X#calc.o:     calc.y calc.l
  418. X#        yacc $(YFLAGS) calc.y
  419. X#        lex calc.l
  420. X#        sed "s/#define YYABORT        return(1)/#define YYABORT return(-999)/" y.tab.c > junkme
  421. X#        mv junkme y.tab.c
  422. X#        rm -f junkme
  423. X#        cc $(CFLAGS) -c y.tab.c
  424. X#        mv y.tab.o calc.o
  425. X#        rm -f y.tab.c
  426. X#        rm -f lex.yy.c
  427. X#        rm -f y.tab.h
  428. X
  429. Xclean_menu.o:    menu.h
  430. X
  431. X
  432. X#####
  433. X#####    Inference Rules
  434. X#####
  435. X
  436. X.SUFFIXES:
  437. X.SUFFIXES: .o .ec .ec~ .c .c~ .h .h~
  438. X
  439. X.c~.c:
  440. X    $(GET) $<
  441. X.h~.h:
  442. X    $(GET) $<
  443. X.c.o:
  444. X    $(CC) -c $(CFLAGS) $*.c
  445. X.c~.o:
  446. X    $(GET) -p $<> $*.c
  447. X    $(CC) -c $(CFLAGS) $*.c
  448. X    rm $*.c
  449. X.ec.o:
  450. X    esql $(CFLAGS) -c $<
  451. X    rm -f $*.c
  452. X.ec~.o:
  453. X    $(GET) -p $<> $*.ec
  454. X    esql $(CFLAGS) -c $<
  455. X    rm $*.ec
  456. X    rm $*.c
  457. SHAR_EOF
  458. chmod 0644 makefile || echo "restore of makefile fails"
  459. echo "x - extracting menu.1 (Text)"
  460. sed 's/^X//' << 'SHAR_EOF' > menu.1 &&
  461. X. \ %W% DeltaDate %G% ExtrDate %H% 
  462. X.po 6
  463. X.TH MENU 1 "Version 3.41"
  464. X.SH NAME
  465. X.TP 12
  466. Xmenu 
  467. X\- a menu program
  468. X.SH SYNOPSIS
  469. X.B "menu  [ -v ] [ -p row,col ] [ -d ] [ -keys ]  menufile"
  470. X
  471. X.SH DESCRIPTION 
  472. X\fBMenu(1)\fP is an easy-to-use menu utility that allows
  473. Xusers to operate an application system in a user-friendly, menu-driven
  474. Xenvironment.  Any application software, regardless of source language or
  475. Xoperating system process can be executed from menus designed with
  476. X\fIMenu(1)\fP.
  477. X
  478. XFor systems requiring multi-level menus for a diverse number of users,
  479. X\fIMenu(1)\fP allows a single menu to call any number of submenus, which
  480. Xmay in turn call more menus or execute any number of processes.
  481. XMenus can be nested to any level without increasing
  482. Xstartup time or memory requirements.
  483. X
  484. XMenus can also be designed to function as user-friendly data entry 
  485. Xscreens for capturing data, which can then be used as input for a process.
  486. XText items such as "displays", "choices" and "responses" can be added within 
  487. Xany of these defined boundaries, and will automatically adjust if any 
  488. Xboundaries are changed.  Special screen attributes, such as highlighting and
  489. Xreverse video, can be defined to add special emphasis.
  490. X
  491. XThe menu script file contains all of the menu instructions, and can
  492. Xbe edited using a standard system editor, such as vi.  Menus and utilities
  493. Xcan be added or deleted by editing the appropriate script file, even while
  494. Xthe menu is in use.  
  495. X
  496. XMenu provides flexibility in designing how you want your
  497. Xmenus to look, yet, strives to maintain some consistency and functionality from
  498. Xone menu to another.  Menu was designed with "hooks" built in, so that, if 
  499. Xadditional features/functionality for an application is required 
  500. Xthe programmers
  501. Xnew "keyword" modules could be linked in to the driver routines in menu(1)
  502. X(see Programming Notes).
  503. X.br
  504. XThis could be used as a prototyping tool.
  505. X.PP
  506. XMenu is keyword driven.  
  507. XThe menufile (script file) is parsed and when a defined keyword is found the
  508. Xassociated function for that keyword is called.
  509. XThe menufile is first searched for in your current directory and
  510. Xthen in getenv("MENUDIR").  Menufile should be in basename format, use
  511. XMENUDIR to get the full path name.  To be consistent with other file naming
  512. Xconventions, I recommend that all menu script files be suffixed with a ".m"
  513. Xfor menu.
  514. XThe "menu.hlp" file contains the on-line help screen.
  515. XThe help file is
  516. Xfirst searched for in the current directory, then in getenv("HELPDIR"),
  517. Xthen in getenv("MENUDIR").  Look in the directory where menu is installed
  518. Xfor the help file (menu.hlp).  If you want to customize the help file, copy it
  519. Xto another directory and set HELPDIR.  There should be a sample menufile
  520. X(\fIsample.m\fP) in the same directory where menu is installed 
  521. Xtry "\fImenu sample.m\fP".
  522. XMenu uses curses(3X) so you need to have your TERM variable set.
  523. X.PP
  524. XMenu provides a shell escape (!) depending upon whether the SHELL environment
  525. Xvariable is set.  You should \fIunset SHELL\fP if you want to restrict the user
  526. Xfrom the shell.  If the set uid bit is set on menu and a shell escape command
  527. Xis selected by the user.  The uid and gid is set back to the real uid/gid
  528. Xbefore executing the shell command.
  529. X
  530. X.SS Command Line Options
  531. X.TP 6
  532. X-v
  533. XThe [-v] command line option will print the version of the menu program
  534. Xyou are running.  The version number increasing by tenths usually indicate
  535. Xnew capabilities/keywords, 
  536. Xhundredths indicate bug fixes/enchancements to existing keywords/capabilities.
  537. X.TP 6
  538. X-p row,col
  539. XTells menu what row and column (upper left corner) you
  540. Xwant the pop-up menu, for goto menu names, to appear.
  541. XSee .GNAME below.  Default is [6,8].  I would try to keep the pop-up 
  542. Xmenu high and to the left, 
  543. Xthere is no real intelligence built in if the number or length of GNAMES puts
  544. Xit off the screen.
  545. X.TP 6
  546. X-d
  547. XPrints debugging information to stderr.
  548. X.TP 6
  549. X-keys
  550. XDetermine the various key values on your keyboard.  This displays what is
  551. Xreturned from a curses getch() call with the keypad turned on.
  552. XThis information can be used to custom tailor your .menuinit file.
  553. X
  554. X.SS Syntax Used In This Man Page
  555. XThe position of the arguments for the various keywords is important.  All
  556. Xarguments including any
  557. Xoptional arguments that are used must appear in the position shown in
  558. Xthe synopsis for that keyword, unless stated otherwise.
  559. X
  560. X.TP 6
  561. X[ ]
  562. XThroughout this man page the "\fB[ ]\fP" indicate that what is enclosed is 
  563. Xoptional.
  564. X.TP 6
  565. X[ \\\\\\ ]
  566. XA keyword synopsis that has "\fB[ \\ ]\fP" as the last argument 
  567. Xindicates that the continuation 
  568. Xcharacter (\\) may be placed as the last character on the line to continue 
  569. Xto the next line.
  570. X.TP 6
  571. X[!]
  572. XIndicates a conditional enviroment variable setting.  If the variable is not
  573. Xalready set (getenv(variable) == NULL) then the variable is set to the specified
  574. Xvalue, otherwise it is not changed.  Same operation as doing a 
  575. Xshell ${parameter:-word}.
  576. X
  577. X.SH KEYWORD SYNOPSIS
  578. XThe following keywords are placed in a menu script file to tell \fImenu(1)\fP
  579. Xwhat to do.
  580. X
  581. X
  582. X\fB[!]variable=value\fP
  583. X.IP "" 6
  584. XA environment variable assignment statement.  The environment variable defined
  585. Xby \fIvariable\fP is set equal to the \fIvalue\fP specified.  The variable is 
  586. Xset as soon as it is found while parsing the menufile, it becomes
  587. Xpart of the menu environment so that all subsequent programs that are spawned
  588. Xwill inherit these variables.
  589. X
  590. XThe character $ in \fIvalue\fP is used to introduce substitutable 
  591. Xparameters, in the form of ${\fIparameter\fP}.
  592. XThe value, if any, of the \fIparameter\fP is substituted.  The braces are 
  593. Xrequired only when \fIvalue\fP is followed by a letter, digit, or 
  594. Xunderscore that is not to be interpreted as part of its name.
  595. X
  596. XThe character ~ in \fIvalue\fP is used to introduce tilde expansion.  
  597. XMenu checks the value
  598. Xto see if a "~" appears after the "=".  If it does menu checks the word that
  599. Xfollows up to a "/".  A "~" by itself equals $HOME. A "~user" equals home(user).
  600. X
  601. XA pair of grave accents (`command`) introduce command substitution.  The
  602. Xstandard output from the \fIcommand\fP is assigned to the variable.
  603. X
  604. XWarning: If you reset a environment variable in a GETINPUT that you have
  605. Xdefined here.  The variable will get reset back to this value when the menufile
  606. Xis re-parsed, unless you use the "!".
  607. X. \ --------------------------------------------------------------------------
  608. X.PP
  609. X\fB###\fP  Comment text.
  610. X.IP "" 6
  611. XA comment line.  The entire line is ignored.  May be placed anywhere in
  612. Xthe menufile.
  613. X. \ --------------------------------------------------------------------------
  614. X
  615. X.PP
  616. X\fB###NAME\fP  Alias menu name.
  617. X.IP "" 6
  618. XThis optional comment line is used by the MenuAccess(1) program to display
  619. Xa different name on the screen for the menu instead of the unix file name,
  620. Xmore user friendly.  This is recommended if you plan to use MenuAccess.
  621. X. \ --------------------------------------------------------------------------
  622. X
  623. X.PP
  624. X \fB.AUTHORIZE\fP  logname  [ logname ... ]  [ \\ ]
  625. X.IP "" 6
  626. XAuthorize only certain login's to be able to access a menu.  For example
  627. Xapplication administration functions to be done by application administrators
  628. Xonly.  This can be done by putting those functions in one menu and
  629. Xusing the .AUTHORIZE keyword.  \fILogname\fP is the login name of a user you
  630. Xwant to allow to see this menu.  Only the
  631. Xfirst .AUTHORIZE keyword will be used, so all lognames must be listed on 
  632. Xthat line.
  633. XIf no .AUTHORIZE is given in menufile then that menu is open to every one.
  634. XIf a .AUTHORIZE is given in the main menu (first) then restriction would apply
  635. Xto someone trying to get into the application.
  636. X.br
  637. XThis keyword is used by the \fIMenuAccess(1)\fP program.
  638. X.br
  639. X
  640. X.br
  641. XThis keyword authorizes a login at the menu level.  If you need to authorize
  642. Xat the option level you could try something like this. (see .SYSTEM)
  643. X.nf
  644. X    .SYSTEM  if [ $LOGNAME = "stella" ] \\
  645. X                               then  run_program \\
  646. X                               else  echo "Sorry honey, Not Authorized." \\
  647. X                       fi
  648. X    Option Description Text.
  649. X.fi
  650. X. \ --------------------------------------------------------------------------
  651. X
  652. X.PP
  653. X.nf
  654. X \fB.BANNER\fP [ linecount ]
  655. X .section  text
  656. X.fi
  657. X.IP "" 6
  658. XDraws a banner page.  Linecount should be the number of lines
  659. Xfollowing .BANNER, each consisting of ".section text".  Section
  660. Xmay be either .U to display text in upper section or .L to
  661. Xdisplay text in lower section.  Only four lines in each section
  662. Xallowed.
  663. XThe idea behind this was to provide some kind of welcome (to your
  664. Xapplication) screen.
  665. XIf .BANNER is used it should be the first keyword in menufile.
  666. XThis one is really worthless!  It's too slooooow.
  667. X
  668. XNot supported in a \fI.POPMENU\fP menu.
  669. X. \ --------------------------------------------------------------------------
  670. X
  671. X.PP
  672. X \fB.BOX\fP [ StandoutLine ] [ DumbLine ]
  673. X.IP "" 6
  674. XDraws a box around the menu window.
  675. XThe \fIBOX\fP will use the top line of the screen so the first \fI.TITLE\fP
  676. Xline should be null.  The box will also use the first and last column,
  677. Xyour title lines should take that into account.  You get a different effect
  678. Xdepending on whether you place the .BOX before (with a .LINE) or after 
  679. Xthe .TITLE lines.
  680. X
  681. XThe arguments specify what type of line you want to use to draw the box with.
  682. XThe second argument specifies the type of line to use to dim the menu.
  683. X.br
  684. XAny one of the following may be used:
  685. X.nf
  686. X    DumbLine    \fIDefault line used in dimming.\fP
  687. X    StandoutLine    \fIDefault line.\fP
  688. X    SingleLine    \fIAlternate character line.\fP
  689. X    MosaicLine    \fIAlternate character line.\fP
  690. X    DiamondLine    \fIAlternate character line.\fP
  691. X    DotLine        \fIAlternate character line.\fP
  692. X    PlusLine        \fIAlternate character line.\fP
  693. X.fi
  694. XThe alternate character lines are dependant on your terminal (try "menu -key").
  695. XNot all terminals have the capability to draw these lines.
  696. XIf one of the alternate character lines is specified
  697. Xand it is found that the terminal does not support it, the line will be
  698. Xdrawn in StandoutLine.  Check your terminal manual and the terminfo definition
  699. Xfor alternate character set.
  700. X
  701. XNot supported in a \fI.POPMENU\fP menu.  
  702. XAll pop-up menus automatically get boxed.
  703. X. \ --------------------------------------------------------------------------
  704. X
  705. X.PP
  706. X.nf
  707. X \fB.CURSOR\fP [-]row [-]column
  708. X.fi
  709. X.IP "" 6
  710. XWhere do you want the cursor to appear on the screen?  If no \fI.CURSOR\fP
  711. Xis specified it defaults to row=lastrow-2, column=lastcol-4.  
  712. XSee explanation under .TEXT for negative row/column.
  713. XThe \fI.CURSOR\fP
  714. Xis only active for the current menu.  If you want the same cursor location
  715. Xin every menu you will need to put a \fI.CURSOR\fP in every menu.
  716. X
  717. XNot supported in a \fI.POPMENU\fP menu.
  718. X. \ --------------------------------------------------------------------------
  719. X
  720. X.PP
  721. X.nf
  722. X \fB.DEFINE_SCREEN\fP  screen_name
  723. X                      window_rows = number
  724. X                      window_cols = number
  725. X                    [ window_pos = number  number ]
  726. X                    [ window_title = string ]
  727. X                    [ window_border = string [ string ] ]
  728. X                    [ helpfile = string ]
  729. X                    [ field_defaults = "string" ]
  730. X                    [ exit_last_field ]
  731. X
  732. X                      ###  The following repeat for each field.
  733. X
  734. X                      field_name = $string
  735. X                      field_row = number
  736. X                      field_col = number
  737. X                      field_length = number
  738. X                    [ field_label = string ]
  739. X                    [ field_mask = string ]
  740. X                    [ field_edits = string ]
  741. X                    [ field_range = string ]
  742. X                    [ field_min = number ]
  743. X                    [ field_adjust = string ]
  744. X                    [ field_mustenter ]
  745. X                    [ field_prompt = string ]
  746. X                    [ field_terminator = string ]
  747. X                    [ field_noinput ]
  748. X ENDSCREEN
  749. X.fi
  750. X
  751. X.RS 6
  752. XThis keyword defines a input screen that can be used with the .GETINPUT keyword.
  753. XIf you want the same screen definition in all menus you have
  754. Xto place it in all menus (see .INCLUDE).
  755. XThe ordering of the arguments is unimportant except for field_name, see below.
  756. XThe screen arguments may be placed on the same line if separated by a comma.
  757. XThe screen arguments are listed below with the default value
  758. Xspecified for those arguments that are optional.
  759. XSee GetInput(3X) man page for more information.
  760. X
  761. XYou may have a maximum of ten screens (MAXSCREENS) defined in any one menu and
  762. Xa maximum of twenty fields (MAXFIELDS) for any one screen.  This may be
  763. Xincreased via the menu.h file.
  764. X
  765. XScreen Arguments:
  766. X.RS 4
  767. X.TP 15
  768. Xscreen_name
  769. XScreen Name.  Used in .GETINPUT to find screen definition.
  770. X.TP 15
  771. Xwindow_rows
  772. XNumber of rows in window.
  773. X.br
  774. XIf either window_rows or window_cols is zero, they will be set to the value 
  775. Xof (screen_lines-window_pos(row)) and (screen_cols-window_pos(col)).
  776. XIf the window_rows, window_cols and window_pos fields are all set to zero
  777. Xa full-screen will be used.  See newwin(curses 3X) for more info.
  778. X.TP 15
  779. Xwindow_cols
  780. XNumber of columns in window.  See window_rows.
  781. X.TP 15
  782. X[ window_pos ]
  783. XTop left corner to place the window at,  where the first number indicates the
  784. Xrow and the second number indicates the column.  See window_rows.
  785. XIf this argument is omitted then the window will be placed as close to, and to
  786. Xthe right of, the option that selected it.  This argument is not optional if
  787. Xthe screen is to be used with a .UNIX keyword.
  788. XThere is no intellegence built in to check if you put the window outside 
  789. Xthe screen dimensions.
  790. X.br
  791. XA environment variable may be specified for the arguments to window_pos.
  792. X.TP 15
  793. X[ window_title = "" ]
  794. XA title to be centered on line zero of the window.  A environment variable may 
  795. Xbe specified in the title.  The title may not exceed 100 bytes.
  796. X.TP 15
  797. X[ window_border = Standout ]
  798. XThe type of box you want around the window.  A standout box is the default.
  799. XSee \fI.BOX\fP for description of line types.
  800. X.TP 15
  801. X[ helpfile = "menu.hlp" ]
  802. XA help file assiciated with this window.  The helpfile should be in
  803. Xdouble quotes if it has a "." in the name, and shoud be in basename format.
  804. XThe helpfile is first looked for
  805. Xin the current directory and then in \fI$HELPDIR\fP.  The fieldname (excluding
  806. Xthe "$") becomes the tagname in the help file.  See \fIHELP SCREENS\fP in this 
  807. Xdocument for more information.
  808. X.TP 15
  809. X[ field_defaults = "" ]
  810. XThis is used to initialize your fields to a default value at runtime.  
  811. XWhat goes into the quoted
  812. Xstring is a shell command that is passed into a popen(3) call.  What the shell
  813. Xcommand should echo to stdout is the values you want to set your fields to.
  814. XMaximum length of the shell command is 1k.
  815. XField values composed of multiple strings should be quoted.  The quote should
  816. Xalso be escaped. If the number of
  817. Xvalues echoed to stdout is less than the number of screen fields the remainder
  818. Xof the screen fields are set to "".  To force a field value to "" echo NULL to
  819. Xstdout.
  820. X.nf
  821. XFor example:
  822. XAssuming $SNAME is a multiple worded value to be assigned to a field.
  823. X
  824. X    field_defaults = "cat \fIfilename\fP |
  825. X        while [ $? -eq 0 ]
  826. X        do
  827. X            read LINE
  828. X            [ $? -ne 0 ] && break
  829. X            set $LINE
  830. X            SCODE=$1
  831. X            shift
  832. X            SNAME=$*
  833. X            echo $SCODE  \\\\"$SNAME\\\\"
  834. X        done"
  835. X.fi
  836. X.TP 15
  837. X[ exit_last_field ]
  838. XIf exit_last_field is specified, after the user presses return on the last field
  839. Xthe input will be accepted and the user will exit the screen (this is as if the
  840. Xuser had pressed the KEY_ACCEPT).  Don't ask me Lee wanted it.
  841. X.TP 15
  842. Xfield_name
  843. XThe environment variable name that the data will be assigned to.  The field_name
  844. Xmust begin with a "$", just to remind you that it is a environment variable 
  845. Xthat I 
  846. Xam using.  Although, the "$" is not actually used in the environment variable 
  847. Xname.  This screen argument (field_name) tells menu that you are starting 
  848. Xa new field
  849. Xdefinition.  ..soooo...  It has to be the first argument for a field.  
  850. XAll other field
  851. Xarguments for that field_name follows after, but before the next field_name.
  852. X.TP 15
  853. Xfield_row
  854. XThe row this field will appear on (base zero).
  855. XThe window is drawn with a box on the outer edge, row zero and the last 
  856. Xrow (window_rows) is used for the box.
  857. X.TP 15
  858. Xfield_col
  859. XThe starting column for this field (base zero).  
  860. XIf you have a field_label you need to allow enough room to place the label 
  861. Xto the left of the field, also, the field terminators.
  862. XThe window is drawn with
  863. Xa box on the outer edge, so, column zero and the last column (window_cols) 
  864. Xis used for the box.
  865. X.TP 15
  866. Xfield_length
  867. XMaximum length of this field.  For field types SET and MENU this argument
  868. Xbecomes optional, the field length is automatically set to the longest set value
  869. Xin the field_range.
  870. X.TP 15
  871. X[ field_label = "" ]
  872. XA Label to be placed to the left of the field.
  873. X. \ **********************************
  874. X.TP 15
  875. X[ field_mask = "" ]
  876. XValid masks for a field depend upon the type of field
  877. Xyou specified, see (field_edits).  Basically the mask says what character
  878. Xpositions in the field you allow input, what type of character allowed at that
  879. Xposition, and what kind of a format do you want for the field.
  880. X
  881. XThe \fIfield_length\fP should not include character positions where no input
  882. Xis allowed in the mask (format characters), because format characters
  883. Xare not returned into \fIfield_name\fP.  For example, \fIfield_edits = DATE,
  884. Xfield_mask = "MM/DD/YY"\fP.  The "/" is a format character.  The cursor
  885. Xwill skip over those positions in the field.  Only the characters typed in
  886. Xthe MM DD YY positions will be in the environment variable \fIfield_name\fP.
  887. XThe field_length would be six.
  888. X
  889. XBecause the mask is so closely tied to the \fIfield_edits\fP, a complete
  890. Xdescription of what mask characters are valid with what field types is 
  891. Xdescribed under
  892. X\fIfield_edits\fP.  Any character in the mask that is not listed as a valid
  893. Xmask character for that field type becomes a format character.
  894. X. \ ---------------------------------
  895. X.TP 15
  896. X[ field_edits = UPPER_AN ]
  897. XThis argument defines edit checks to be performed on the
  898. Xinput characters as they are being typed in.  If no mask is provided then
  899. Xthe field type itself determines the edit checks to be performed on all
  900. Xcharacters in the field.
  901. X.RS 15
  902. X.TP 11
  903. XALPHANUM
  904. XAny alpha/numeric character is allowed.
  905. X.br
  906. XValid mask characters:
  907. X.nf
  908. X    space    alpha/numeric
  909. X    A    alpha
  910. X    9    numeric
  911. X    U    alpha only - convert to upper case
  912. X    V    alpha/numeric - convert alpha to upper case
  913. X    H    ???
  914. X.fi
  915. X.TP
  916. XALPHA
  917. XAlpha only.
  918. X.br
  919. XValid mask characters:
  920. X.nf
  921. X    A    alpha
  922. X.fi
  923. X.TP
  924. XNUMERIC
  925. XNumeric only.
  926. X.br
  927. XValid mask characters:
  928. X.nf
  929. X    9    numeric
  930. X.fi
  931. X.TP
  932. XUPPER
  933. XConvert to upper case.  Only alpha permitted.
  934. X.br
  935. XValid mask characters:
  936. X.nf
  937. X    U    upper alpha
  938. X.fi
  939. X.TP
  940. XUPPER_AN
  941. XAlpha and numeric permitted.  Convert alpha characters to upper-case.
  942. X.br
  943. XValid mask characters:
  944. X.nf
  945. X    V    upper alpha/numeric
  946. X.fi
  947. X.TP
  948. XHEX
  949. XOnly hex characters permitted.
  950. X.br
  951. XValid mask characters:
  952. X.nf
  953. X    H    ???
  954. X    space    ???
  955. X.fi
  956. X.TP
  957. XSTATE
  958. XValid two character Post Office abbreviations for the fifty states.
  959. XA edit check is done for a valid state.
  960. X.br
  961. XValid mask characters:
  962. X.nf
  963. X    SS    two character state
  964. X    S    ???
  965. X    space    ???
  966. X.fi
  967. X.TP
  968. XZIP
  969. XPost Office zip code.
  970. X.br
  971. XValid mask characters:
  972. X.nf
  973. X    99999-9999    ???
  974. X.fi
  975. X.TP
  976. XDATE
  977. XA valid date.
  978. X.br
  979. XValid mask characters:
  980. X.nf
  981. X    MM    month  (01-12)
  982. X    DD    day  (01-31)
  983. X    YY    year  (00-99)
  984. X    YYYY    full year with century
  985. X.fi
  986. XThe mask must contain at least MM and DD.  If no mask is specified for the
  987. Xfield a default mask of "MMDDYY" is used.
  988. X.br
  989. XSome examples:
  990. X.nf
  991. X    MMDDYY
  992. X    MM/DD/YY
  993. X    YY-MM-DD
  994. X    MM  DD  YYYY
  995. X.fi
  996. X.TP
  997. XTIME
  998. XA time field.
  999. X.br
  1000. XValid mask characters:
  1001. X.nf
  1002. X    HH    hours  (01-12)
  1003. X    MM    minutes  (00-59)
  1004. X    SS    seconds  (00-59)
  1005. X    TT    tenths  (00-99)
  1006. X    II    military hours  (00-24)
  1007. X.fi
  1008. XSome examples:
  1009. X.nf
  1010. X    HH:MM
  1011. X    HH:MM:SS
  1012. X    HH:MM:SS:TT
  1013. X    II:MM
  1014. X    II:MM:SS
  1015. X    II:MM:SS:TT
  1016. X.fi
  1017. X.TP
  1018. XSET
  1019. XThis field type specifies a set of values that are acceptable in the input 
  1020. Xfield.
  1021. XThe acceptable values within the set are specified in the \fIfield_range\fP 
  1022. Xargument.  
  1023. XThe user selects one of the set values specified in the field range by
  1024. Xpressing the space bar, which will toggle through the set values,
  1025. Xor by pressing the first character in the desired value.
  1026. X
  1027. XThe format of the field_range can only be comma separated values 
  1028. X(ex. "CA,ID,TX").  
  1029. XRange values, such as "1-5", don't work.  You would have to say "1,2,3,4,5".
  1030. X.br
  1031. XThe field length is automatically set to the longest set value in the 
  1032. Xfield_range.
  1033. X.TP
  1034. XMENU
  1035. XThis field type is similar to the SET type.  The difference is when the user
  1036. Xattempts to type something in the field a pop-up menu of available choices
  1037. Xare displayed, as specified in field_range.  
  1038. XThe user makes a selection by hi-lighting the choice and pressing return.
  1039. X.br
  1040. XSee SET type for specifying the field range.
  1041. XThe limit is ten items in the field range.
  1042. X.TP
  1043. XPROTECT
  1044. XThis X's out the field so that what is entered on the keyboard can not be seen
  1045. Xon the screen.  Useful for password entry.
  1046. X.RE
  1047. X. \ ---------------------------------
  1048. X.TP 15
  1049. X[ field_range = "" ]
  1050. XA set of valid ranges permitted for this field. 
  1051. XRanges may be specified as comma separated values ("ONE,TWO,THREE") 
  1052. Xor as a range ("1-5"), or a combination of both ("1-5,M,E").
  1053. XRange values must be compatible with the field_edits that you have selected.
  1054. XMaximum length of this field is 1k.
  1055. X.br
  1056. XSome examples:
  1057. X.nf
  1058. X    "1-10"
  1059. X    "5,10,15,16"
  1060. X    "1-10,20,M,E,32-40"
  1061. X    "CA,TX,ID"
  1062. X.fi
  1063. X. \ ---------------------------------
  1064. X.TP 15
  1065. X[ field_min = 0 ]
  1066. XIf field_mustenter is selected then this is the minimum
  1067. Xrequired input.  Otherwise, it is the minimum required input only if they try 
  1068. Xto input something.
  1069. X.TP 15
  1070. X[ field_adjust = NOFILL ]
  1071. XIndicates whether to adjust the text right or left within the field
  1072. Xand whether or not to zero or blank fill the field.
  1073. X.RS 15
  1074. X.TP 15
  1075. XNOFILL
  1076. Xno action.
  1077. X.TP
  1078. XRTADJ_ZFILL
  1079. Xright adjust, zero fill
  1080. X.TP
  1081. XRTADJ_BFILL
  1082. Xright adjust, blank fill
  1083. X.TP
  1084. XLFADJ_ZFILL
  1085. Xleft adjust, zero fill
  1086. X.TP
  1087. XLFADJ_BFILL
  1088. Xleft adjust, blank fill
  1089. X.RE
  1090. X. \ ---------------------------------
  1091. X.TP 15
  1092. X[ field_mustenter ]
  1093. XMarks this as a must enter field.  Default is that the field is not
  1094. Xa must enter field.
  1095. X. \ ---------------------------------
  1096. X.TP 15
  1097. X[ field_prompt = "" ]
  1098. XPrompt message to be displayed.
  1099. X. \ ---------------------------------
  1100. X.TP 15
  1101. X[ field_terminator = "[]" ]
  1102. XCharacters to terminate the field with.  The left one goes on the left, 
  1103. Xthe right one goes on the right.  Funny how that works.
  1104. X. \ ---------------------------------
  1105. X.TP 15
  1106. X[ field_noinput ]
  1107. XIf field_noinput is selected then the cursor will skip over this field.  A
  1108. Xdisplay only field.
  1109. X.RE
  1110. X.RE
  1111. X. \ --------------------------------------------------------------------------
  1112. X
  1113. X.PP
  1114. X.nf
  1115. X \fB.EXIT\fP [ command ]   [ \\ ]
  1116. XExit description text.
  1117. X.fi
  1118. X.IP "" 6
  1119. XExit menu program.  This can be used if you want to exit as a user
  1120. Xselectable option.  There should be only one .EXIT per menu.
  1121. X.br
  1122. XIf command is present a system(3S) will be called, with command as the
  1123. Xargument, before exiting.  The command will be executed even if the user uses
  1124. Xthe "E" command (see help) to exit, as long as there is a .EXIT 
  1125. Xin current menu.  If you
  1126. Xwant to make sure a particular command gets executed when the user exits you
  1127. Xshould have a ".EXIT command" in every menu.
  1128. X. \ --------------------------------------------------------------------------
  1129. X
  1130. X.PP
  1131. X.nf
  1132. X \fB.GETINPUT\fP  screen_name
  1133. XOption description text.
  1134. X.fi
  1135. X.IP "" 6
  1136. XDisplays a predefined screen and prompts for input
  1137. Xas outlined in the screen definition.
  1138. XAfter the user has pressed the \fIKEY_ACCEPT\fP
  1139. Xthe environment variables, specified by the \fIfield_name\fP argument
  1140. Xis set equal to the data the user entered in that field.
  1141. XIf no data was entered for a field the environment variable is set equal to
  1142. X"NULL".  The logic behind the "NULL" is to maintain the positional parameters
  1143. Xwhen the environment variables are passed to a program.
  1144. XIf \fIKEY_CANCEL\fP is pressed the environment variables are not set.
  1145. X.br
  1146. XThe screen_name is what was used in the .DEFINE_SCREEN keyword.
  1147. X.br
  1148. X
  1149. XThe cursor moves from field to field based upon the order of the fields in
  1150. Xthe \fI.DEFINE_SCREEN\fP keyword.  
  1151. XBelow is listed the various keys used in a GETINPUT, the action they perform 
  1152. Xand their default value.  In addition to the default values, if the terminal
  1153. Xhas a associated curses key defined (see curses.h) that key may also be used.
  1154. XFor example, ^j is the default value to traverse forwards through the fields
  1155. Xbut if the down arrow is defined for KEY_DOWN, in curses, then the down arrow 
  1156. Xmay also be used.  Not all keys may have an associated curses key.
  1157. XThe "^" indicates press and hold the control key.
  1158. X.br
  1159. XSee \fIMenu Initialization File\fP to customize the values of the keys.
  1160. X
  1161. XMover Keys:
  1162. X.nf
  1163. X    KEY_RETURN  (^m)    Traverse forwards through the fields.
  1164. X    KEY_DOWN  (^j)    Traverse forwards through the fields.
  1165. X    KEY_UP  (^k)        Traverse backwards through the fields.
  1166. X    KEY_TAB  (^i)        Fast forward through the fields.
  1167. X    KEY_BTAB          Fast reverse through the fields.
  1168. XField Editing Keys:
  1169. X    KEY_BEG  (^b)        Place cursor at beginning of field.
  1170. X    KEY_END  (^e)        Place cursor at end of input in field.
  1171. X    KEY_RIGHT  (^l)    Forward space within the field.
  1172. X    KEY_LEFT  (^h)        Backspace within the field (non-destructive).
  1173. X    KEY_BACKSPACE  (^h)    Same as KEY_LEFT.
  1174. X    KEY_EOL  (^d)        Delete from cursor to end of field.
  1175. X    KEY_DL  (^c)        Clear field and home cursor.
  1176. X    KEY_DC  (^x)        Delete a character.
  1177. X    KEY_IC  (^t)        Toggle between type-over and insert mode.
  1178. XOther Keys:
  1179. X    KEY_HELP  (?)        Display help screen.
  1180. X    KEY_REFRESH  (^r)    Redraw the screen.
  1181. X    KEY_ACCEPT  (^a)    Accept all input and exit screen.
  1182. X    KEY_CANCEL  (esc)    Cancel all input and exit screen.
  1183. X    KEY_SAVE  (^f)        Save screen to a file.
  1184. X    KEY_PRINT  (^p)    Print screen to lp.
  1185. X.fi
  1186. X. \ --------------------------------------------------------------------------
  1187. X
  1188. X.PP
  1189. X \fB.GNAME\fP menuname menufile
  1190. X.IP "" 6
  1191. XDefine a goto name for a menu so that the user may go directly to that
  1192. Xmenu by typing in the menu name (G "return" menuname "return").  
  1193. XMenuname is the name you want
  1194. Xthe user to input.  Menuname has to be one word and is limited to fifteen
  1195. Xcharacters.
  1196. XMenufile is the unix filename for that menu.  The .GNAME
  1197. Xis not accessible to the user until the menufile that you have placed the .GNAME
  1198. Xin has been displayed.  If all .GNAME's have been placed in the main menu
  1199. Xthen they will all be accessible to the user as soon as the main menu has
  1200. Xbeen displayed.
  1201. X.br
  1202. XInstead of having the user type (G "return" menuname "return") try 
  1203. X(control g).
  1204. X
  1205. XNot supported in a \fI.POPMENU\fP menu.
  1206. X. \ --------------------------------------------------------------------------
  1207. X
  1208. X.PP
  1209. X \fB.INCLUDE\fP menufile
  1210. X.IP "" 6
  1211. XInclude a menu script file.  This is so you don't have to type the same 
  1212. Xscreen definition in all the menu files that you want to use it in.
  1213. XAlthough, it could be used for any menufile.
  1214. XIt is significant where you place the .INCLUDE in your menufile, depending on
  1215. Xwhat is in the .INCLUDE menufile.  Think of it as if you were typing it in
  1216. Xat this point in the menu file.
  1217. X. \ --------------------------------------------------------------------------
  1218. X
  1219. X.PP
  1220. X \fB.LINE\fP [ StandoutLine ] [ DumbLine ]
  1221. X.IP "" 6
  1222. XDraws a standout line underneath your last title line to
  1223. Xsplit the options portion of the screen from the title portion.
  1224. XPlace after last \fI.TITLE\fP.
  1225. X.br
  1226. XSee .BOX for description of line types.
  1227. X
  1228. XNot supported in a \fI.POPMENU\fP menu.
  1229. X. \ --------------------------------------------------------------------------
  1230. X
  1231. X.PP
  1232. X.nf
  1233. X \fB.MENU\fP menufile  [ GETINPUT screen_name ]  [ [!]variable=value  ... ]   [ \\ ]
  1234. SHAR_EOF
  1235. echo "End of part 1"
  1236. echo "File menu.1 is continued in part 2"
  1237. echo "2" > s2_seq_.tmp
  1238. exit 0
  1239.