home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / pscmenu / part02 < prev    next >
Text File  |  1993-08-29  |  34KB  |  1,317 lines

  1. Newsgroups: comp.sources.misc
  2. From: Ted Wisniewski <ted@oz.plymouth.edu>
  3. Subject: v39i061:  pscmenu - tty based menu system v2.3, Part02/02
  4. Message-ID: <1993Aug29.165511.24767@sparky.sterling.com>
  5. X-Md4-Signature: 4c312bfbb32ec8ff61e9a14164e04e36
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Reply-To: ted@oz.plymouth.edu (The Wizard of Oz)
  8. Organization: Plymouth State College - Plymouth, N.H.
  9. Date: Sun, 29 Aug 1993 16:55:11 GMT
  10. Approved: kent@sparky.sterling.com
  11.  
  12. Submitted-by: Ted Wisniewski <ted@oz.plymouth.edu>
  13. Posting-number: Volume 39, Issue 61
  14. Archive-name: pscmenu/part02
  15. Environment: UNIX, curses
  16. Supersedes: pscmenu: Volume 22, Issue 98-99
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then feed it
  20. # into a shell via "sh file" or similar.  To overwrite existing files,
  21. # type "sh file -c".
  22. # Contents:  MENU/Makefile MENU/README MENU/config.h
  23. #   MENU/demos/HELP/cat.help MENU/demos/HELP/copy.help
  24. #   MENU/demos/HELP/mail.help MENU/demos/HELP/man.help
  25. #   MENU/demos/HELP/remove.help MENU/demos/HELP/sub_menu.help
  26. #   MENU/demos/HELP/vi.help MENU/demos/main.menu MENU/demos/printers
  27. #   MENU/dir.h MENU/menu.desc MENU/printers MENU/proto.h MENU/screen.c
  28. #   MENU/signals.c MENU/time.c MENU/utils.c MENU/utils.h
  29. # Wrapped by kent@sparky on Sun Aug 29 11:50:48 1993
  30. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  31. echo If this archive is complete, you will see the following message:
  32. echo '          "shar: End of archive 2 (of 2)."'
  33. if test -f 'MENU/Makefile' -a "${1}" != "-c" ; then 
  34.   echo shar: Will not clobber existing file \"'MENU/Makefile'\"
  35. else
  36.   echo shar: Extracting \"'MENU/Makefile'\" \(1377 characters\)
  37.   sed "s/^X//" >'MENU/Makefile' <<'END_OF_FILE'
  38. XCC     = cc
  39. X#CC     = gcc
  40. XCFLAGS = -O -g3
  41. X
  42. X# Some Systems may not require "-ltermcap" and may instead need "-ltermlib"
  43. X# 
  44. XLIBS   = -lcurses -ltermcap
  45. X#LIBS  = -lcurses -ltermlib
  46. XMENUDIR= /usr/local/lib/menus
  47. XDEFS   = 
  48. XTARGET = menu
  49. X
  50. XHDRS  = menu.h utils.h dir.h config.h
  51. XSRCS  = menu.c appl.c utils.c files.c signals.c dir.c screen.c terminal.c time.c
  52. XOBJS  = menu.o appl.o utils.o files.o signals.o dir.o screen.o terminal.o time.o
  53. X
  54. X$(TARGET): $(OBJS) $(SRCS) $(HDRS)
  55. X    $(CC) $(CFLAGS) $(OBJS) -o $(TARGET) $(LIBS)
  56. X
  57. Xmenu.o  : menu.c menu.h config.h
  58. X    $(CC) $(CFLAGS) $(DEFS) -c menu.c
  59. X
  60. Xappl.o  : appl.c menu.h config.h
  61. X    $(CC) $(CFLAGS) $(DEFS) -c appl.c
  62. X
  63. Xutils.o : utils.c utils.h config.h
  64. X    $(CC) $(CFLAGS) $(DEFS) -c utils.c
  65. X
  66. Xfiles.o : files.c menu.h config.h
  67. X    $(CC) $(CFLAGS) $(DEFS) -c files.c
  68. X
  69. Xsignals.o : signals.c  config.h
  70. X    $(CC) $(CFLAGS) $(DEFS) -c signals.c
  71. X
  72. Xscreen.o : screen.c  config.h
  73. X    $(CC) $(CFLAGS) $(DEFS) -c screen.c
  74. X
  75. Xterminal.o : terminal.c  config.h
  76. X    $(CC) $(CFLAGS) $(DEFS) -c terminal.c
  77. X
  78. Xdir.o : dir.c dir.h config.h
  79. X    $(CC) $(CFLAGS) $(DEFS) -c dir.c
  80. X
  81. Xtime.o : time.c menu.h config.h
  82. X    $(CC) $(CFLAGS) $(DEFS) -c time.c
  83. X
  84. Xinstall:
  85. X    -chmod 711 /usr/local/bin/menu
  86. X    install -c -m 1711 -o root -g system -s menu /usr/local/bin/menu
  87. X    -mkdir $(MENUDIR)
  88. X    -chmod 755 $(MENUDIR)
  89. X
  90. Xclean:
  91. X    rm -f $(OBJS) ./menu core core.menu
  92. X
  93. Xlint:
  94. X    lint -DDFLAGS $(SRCS) > LINT.OUT
  95. END_OF_FILE
  96.   if test 1377 -ne `wc -c <'MENU/Makefile'`; then
  97.     echo shar: \"'MENU/Makefile'\" unpacked with wrong size!
  98.   fi
  99.   # end of 'MENU/Makefile'
  100. fi
  101. if test -f 'MENU/README' -a "${1}" != "-c" ; then 
  102.   echo shar: Will not clobber existing file \"'MENU/README'\"
  103. else
  104.   echo shar: Extracting \"'MENU/README'\" \(2731 characters\)
  105.   sed "s/^X//" >'MENU/README' <<'END_OF_FILE'
  106. XPSCmenu 2.3
  107. X
  108. XChanges Since 2.2:
  109. X
  110. X    - Some minor tweeks for smoother operation.
  111. X    - Added support for 386BSD/NetBSD.
  112. X    - Ability to have as many as 14 menu choices.
  113. X    - Removed some old code.
  114. X    - Streamlined include files.
  115. X    - Added config.h and proto.h
  116. X
  117. XSystems tested on:
  118. X
  119. X    Ultrix4.2a, AIX(version ???), 386BSD/NetBSD
  120. X
  121. XNotes from Author:
  122. X
  123. X    *    PSCmenu is free, however, if you like it and intend
  124. X        on using it I would appreciate it if you send me a
  125. X        post-card; please include: your name, title
  126. X        and organization.   Send it to:
  127. X
  128. X            Ted Wisniewski
  129. X            Academic Computing
  130. X            Lamson Library
  131. X            Plymouth State College
  132. X            Plymouth NH, 03264
  133. X
  134. XInstall Notes:
  135. X
  136. XInstall Notes for PSCmenu2.3
  137. X
  138. X    This Menu system should compile on just about any machine.  I have
  139. Xit working under Ultrix, AIX (IBM system V), SUN and *HP-UX*.  These are the 
  140. Xonly variations of UNIX that I know it has worked on.  If you have problems
  141. Xjust ask.  If you need to make changes to get menu to run on your system
  142. Xplease send me the following information:
  143. X
  144. X* I have not actually seen it it run on HP-UX systems.
  145. X
  146. X    1.     Computer Type.
  147. X    2.    Your variaton of UNIX. (Ultrix, AIX, SUN-OS, ...)
  148. X    3.    Code you had to modify.
  149. X
  150. XTo compile:
  151. X
  152. X    If you have the 'shar' file:
  153. X
  154. X       unshar the shell archive via: % sh menu.shar
  155. X    
  156. X    then edit the header files "config.h" and the Makefile to set 
  157. X    appropriate paths and definitions for your system.
  158. X    
  159. X    Things to edit:
  160. X
  161. X    config.h:
  162. X
  163. X        Various System definitions.  Make sure you select ones
  164. X        to fit your system.
  165. X
  166. X        MENU_DIR    - The directory containing menu files.
  167. X
  168. X         PRINT_PATH    - Set to path/name of file containg print
  169. X                  commands.
  170. X        PRT_TO_SCR    - Name of program that prints to screen.
  171. X
  172. X    Makefile:
  173. X
  174. X        Make sure 'MENU_DIR' in the config.h and 'MENUDIR' in the 
  175. X        Makefile agree.
  176. X    
  177. X    printers:
  178. X
  179. X        If you are using the builtin priting support, edit the file
  180. X        called printers to agree with your printing commands.
  181. X
  182. X    then
  183. X    
  184. X    do: % make
  185. X
  186. XTo Test:
  187. X
  188. X    do: % ./menu ./demos
  189. X
  190. X    This should show you a working example of how this menu
  191. X    works, the demo is set up for what this site is using so
  192. X    the applications called may not be on your system.
  193. X
  194. X
  195. XTo install:
  196. X
  197. X    do: % make install 
  198. X
  199. X    * Edit 'printers' and copy to the 'MENU_DIR'.  You may have
  200. X      up to 30 specified printers.
  201. X
  202. X      File format for 'printers':
  203. X
  204. X         ? Printer description
  205. X        * Printing Command to be used.
  206. X
  207. X    * Edit 'demos/main.menu' and copy to the 'MENU_DIR'.
  208. X    * Make both files read-able to those using the menu.
  209. X
  210. XProblems or Questions:
  211. X
  212. X    Send E-Mail to: ted@oz.plymouth.edu
  213. X
  214. XHP-UX Compatability, Thanks to:
  215. X     Barry Mc Innes - barry@giaea.oz.au
  216. X
  217. X
  218. XUp to date Versions are available via Anonymous ftp from:
  219. X
  220. X    oz.plymouth.edu  -> /pub/psc/    -> All day.
  221. X    wiz.plymouth.edu -> /pub/psc/    -> 11pm to 3pm
  222. END_OF_FILE
  223.   if test 2731 -ne `wc -c <'MENU/README'`; then
  224.     echo shar: \"'MENU/README'\" unpacked with wrong size!
  225.   fi
  226.   # end of 'MENU/README'
  227. fi
  228. if test -f 'MENU/config.h' -a "${1}" != "-c" ; then 
  229.   echo shar: Will not clobber existing file \"'MENU/config.h'\"
  230. else
  231.   echo shar: Extracting \"'MENU/config.h'\" \(1388 characters\)
  232.   sed "s/^X//" >'MENU/config.h' <<'END_OF_FILE'
  233. X# define    __CONFIG_H
  234. X
  235. X/*
  236. X   Systems, Comment out or uncomment the appropriate define(s)
  237. X   for your system.
  238. X*/
  239. X
  240. X/*# define    AIX        /* IBM unix (SYSV)    */
  241. X# define    ULTRIX        /* DEC Ultrix (BSD)    */
  242. X/*# define    PC_BSD        /* 386BSD/NetBSD (BSD)    */
  243. X/*# define    HPUX        /* Hewlet Packard (SYSV)*/
  244. X/*# define    SUN        /* Sun Systems (BSD?)    */
  245. X
  246. X/* System Types */
  247. X
  248. X/*# define    SYSTEM_FIVE    /* For system V machines              */
  249. X/*# define    BSD43        /* For some BSD machines, try without 1st */
  250. X
  251. X/* Other */
  252. X
  253. X/*# define    TERM_INFO    /* For Systems with terminfo    */
  254. X
  255. X/*
  256. X   Comment out PRINT_TIME if you compiler barfs when compiling
  257. X   time.c,  I have not yet tested this code on many machines.
  258. X*/
  259. X
  260. X# define    PRINT_TIME    /* To print time/date on screen */
  261. X
  262. X/*
  263. X    The directory where the system default menu files will be
  264. X    located.
  265. X*/
  266. X
  267. X# define    MENU_DIR    "/usr/local/lib/menus/"
  268. X
  269. X# define    ENABLE_PRINT    /* Comment to disable printing menu */
  270. X
  271. X/*
  272. X    Full pathname to printer support file.
  273. X*/
  274. X
  275. X# define  PRINT_PATH    "/usr/local/lib/menus/printers"
  276. X
  277. X/*
  278. X    Full pathname to the 'more' command.
  279. X*/
  280. X
  281. X# ifndef HPUX
  282. X#     define  PRT_TO_SCR    "/usr/ucb/more"
  283. X# else
  284. X#     define  PRT_TO_SCR    "/usr/bin/more"
  285. X# endif HPUX
  286. X
  287. X
  288. X/*
  289. X    Other Configurations.
  290. X*/
  291. X
  292. X/* The 'getwd(buf) routine fails for NetBSD and perhaps others
  293. X   define 'USE_CWD' to use the 'getcwd(buf, size) instead.
  294. X*/
  295. X
  296. X/*# define    USE_CWD        /* Use getcwd(buf,size) and not getwd(buf) */
  297. X
  298. END_OF_FILE
  299.   if test 1388 -ne `wc -c <'MENU/config.h'`; then
  300.     echo shar: \"'MENU/config.h'\" unpacked with wrong size!
  301.   fi
  302.   # end of 'MENU/config.h'
  303. fi
  304. if test -f 'MENU/demos/HELP/cat.help' -a "${1}" != "-c" ; then 
  305.   echo shar: Will not clobber existing file \"'MENU/demos/HELP/cat.help'\"
  306. else
  307.   echo shar: Extracting \"'MENU/demos/HELP/cat.help'\" \(32 characters\)
  308.   sed "s/^X//" >'MENU/demos/HELP/cat.help' <<'END_OF_FILE'
  309. XThis is an example of cat help.
  310. END_OF_FILE
  311.   if test 32 -ne `wc -c <'MENU/demos/HELP/cat.help'`; then
  312.     echo shar: \"'MENU/demos/HELP/cat.help'\" unpacked with wrong size!
  313.   fi
  314.   # end of 'MENU/demos/HELP/cat.help'
  315. fi
  316. if test -f 'MENU/demos/HELP/copy.help' -a "${1}" != "-c" ; then 
  317.   echo shar: Will not clobber existing file \"'MENU/demos/HELP/copy.help'\"
  318. else
  319.   echo shar: Extracting \"'MENU/demos/HELP/copy.help'\" \(33 characters\)
  320.   sed "s/^X//" >'MENU/demos/HELP/copy.help' <<'END_OF_FILE'
  321. XThis is an example of copy help.
  322. END_OF_FILE
  323.   if test 33 -ne `wc -c <'MENU/demos/HELP/copy.help'`; then
  324.     echo shar: \"'MENU/demos/HELP/copy.help'\" unpacked with wrong size!
  325.   fi
  326.   # end of 'MENU/demos/HELP/copy.help'
  327. fi
  328. if test -f 'MENU/demos/HELP/mail.help' -a "${1}" != "-c" ; then 
  329.   echo shar: Will not clobber existing file \"'MENU/demos/HELP/mail.help'\"
  330. else
  331.   echo shar: Extracting \"'MENU/demos/HELP/mail.help'\" \(33 characters\)
  332.   sed "s/^X//" >'MENU/demos/HELP/mail.help' <<'END_OF_FILE'
  333. XThis is an example of mail help.
  334. END_OF_FILE
  335.   if test 33 -ne `wc -c <'MENU/demos/HELP/mail.help'`; then
  336.     echo shar: \"'MENU/demos/HELP/mail.help'\" unpacked with wrong size!
  337.   fi
  338.   # end of 'MENU/demos/HELP/mail.help'
  339. fi
  340. if test -f 'MENU/demos/HELP/man.help' -a "${1}" != "-c" ; then 
  341.   echo shar: Will not clobber existing file \"'MENU/demos/HELP/man.help'\"
  342. else
  343.   echo shar: Extracting \"'MENU/demos/HELP/man.help'\" \(32 characters\)
  344.   sed "s/^X//" >'MENU/demos/HELP/man.help' <<'END_OF_FILE'
  345. XThis is an example of man help.
  346. END_OF_FILE
  347.   if test 32 -ne `wc -c <'MENU/demos/HELP/man.help'`; then
  348.     echo shar: \"'MENU/demos/HELP/man.help'\" unpacked with wrong size!
  349.   fi
  350.   # end of 'MENU/demos/HELP/man.help'
  351. fi
  352. if test -f 'MENU/demos/HELP/remove.help' -a "${1}" != "-c" ; then 
  353.   echo shar: Will not clobber existing file \"'MENU/demos/HELP/remove.help'\"
  354. else
  355.   echo shar: Extracting \"'MENU/demos/HELP/remove.help'\" \(35 characters\)
  356.   sed "s/^X//" >'MENU/demos/HELP/remove.help' <<'END_OF_FILE'
  357. XThis is an example of remove help.
  358. END_OF_FILE
  359.   if test 35 -ne `wc -c <'MENU/demos/HELP/remove.help'`; then
  360.     echo shar: \"'MENU/demos/HELP/remove.help'\" unpacked with wrong size!
  361.   fi
  362.   # end of 'MENU/demos/HELP/remove.help'
  363. fi
  364. if test -f 'MENU/demos/HELP/sub_menu.help' -a "${1}" != "-c" ; then 
  365.   echo shar: Will not clobber existing file \"'MENU/demos/HELP/sub_menu.help'\"
  366. else
  367.   echo shar: Extracting \"'MENU/demos/HELP/sub_menu.help'\" \(37 characters\)
  368.   sed "s/^X//" >'MENU/demos/HELP/sub_menu.help' <<'END_OF_FILE'
  369. XThis is an example of sub-menu help.
  370. END_OF_FILE
  371.   if test 37 -ne `wc -c <'MENU/demos/HELP/sub_menu.help'`; then
  372.     echo shar: \"'MENU/demos/HELP/sub_menu.help'\" unpacked with wrong size!
  373.   fi
  374.   # end of 'MENU/demos/HELP/sub_menu.help'
  375. fi
  376. if test -f 'MENU/demos/HELP/vi.help' -a "${1}" != "-c" ; then 
  377.   echo shar: Will not clobber existing file \"'MENU/demos/HELP/vi.help'\"
  378. else
  379.   echo shar: Extracting \"'MENU/demos/HELP/vi.help'\" \(31 characters\)
  380.   sed "s/^X//" >'MENU/demos/HELP/vi.help' <<'END_OF_FILE'
  381. XThis is an example of vi help.
  382. END_OF_FILE
  383.   if test 31 -ne `wc -c <'MENU/demos/HELP/vi.help'`; then
  384.     echo shar: \"'MENU/demos/HELP/vi.help'\" unpacked with wrong size!
  385.   fi
  386.   # end of 'MENU/demos/HELP/vi.help'
  387. fi
  388. if test -f 'MENU/demos/main.menu' -a "${1}" != "-c" ; then 
  389.   echo shar: Will not clobber existing file \"'MENU/demos/main.menu'\"
  390. else
  391.   echo shar: Extracting \"'MENU/demos/main.menu'\" \(838 characters\)
  392.   sed "s/^X//" >'MENU/demos/main.menu' <<'END_OF_FILE'
  393. X! PSC Menu Executive (14-option)
  394. X...........................................
  395. X1 /usr/ucb/vi
  396. X# ./HELP/vi.help
  397. X? Use the vi editor.
  398. X...........................................
  399. X2 /bin/cp -i 
  400. X# ./HELP/copy.help
  401. X? Make a copy of a file.
  402. X...........................................
  403. X3 /usr/ucb/mail
  404. X# ./HELP/mail.help
  405. X? Send Mail (Asks for a user name).
  406. X...........................................
  407. X4 /usr/ucb/man 
  408. X# ./HELP/man.help
  409. X? Read the Manual (Asks for a topic).
  410. X...........................................
  411. X5 /bin/rm -i
  412. X# ./HELP/remove.help
  413. X? Remove file (Use visual Dir. C-shell).
  414. X...........................................
  415. X6 /bin/cat 
  416. X# ./HELP/cat.help
  417. X? Cat a file (Use visual Dir. PIPE).
  418. X...........................................
  419. X& sub_menu.menu
  420. X# ./HELP/sub_menu.help
  421. X? Load A Sub-Menu.
  422. X...........................................
  423. END_OF_FILE
  424.   if test 838 -ne `wc -c <'MENU/demos/main.menu'`; then
  425.     echo shar: \"'MENU/demos/main.menu'\" unpacked with wrong size!
  426.   fi
  427.   # end of 'MENU/demos/main.menu'
  428. fi
  429. if test -f 'MENU/demos/printers' -a "${1}" != "-c" ; then 
  430.   echo shar: Will not clobber existing file \"'MENU/demos/printers'\"
  431. else
  432.   echo shar: Extracting \"'MENU/demos/printers'\" \(449 characters\)
  433.   sed "s/^X//" >'MENU/demos/printers' <<'END_OF_FILE'
  434. X......................................
  435. X.. Example Printer Definition File ...
  436. X......................................
  437. X? Print on the Screen.
  438. X* /usr/ucb/more
  439. X......................................
  440. X? Library (wide)
  441. X* /usr/local/bin/lprlib
  442. X......................................
  443. X? Library (narrow)
  444. X* /usr/local/bin/lprlibx
  445. X......................................
  446. X? Library (Letter Quality)
  447. X* /usr/local/bin/lprlibz
  448. X......................................
  449. END_OF_FILE
  450.   if test 449 -ne `wc -c <'MENU/demos/printers'`; then
  451.     echo shar: \"'MENU/demos/printers'\" unpacked with wrong size!
  452.   fi
  453.   # end of 'MENU/demos/printers'
  454. fi
  455. if test -f 'MENU/dir.h' -a "${1}" != "-c" ; then 
  456.   echo shar: Will not clobber existing file \"'MENU/dir.h'\"
  457. else
  458.   echo shar: Extracting \"'MENU/dir.h'\" \(1266 characters\)
  459.   sed "s/^X//" >'MENU/dir.h' <<'END_OF_FILE'
  460. X# ifndef __DIR_H
  461. X# define __DIR_H
  462. X
  463. X# include <ctype.h>
  464. X
  465. X# define  PRT_MENU    "Choose a printer: arrow keys to move, return to select, 'q' to quit"
  466. X
  467. X/*
  468. X# define  PRINT_PATH    "/usr/local/lib/menus/printers"
  469. X# ifndef HPUX
  470. X# define  PRT_TO_SCR    "/usr/ucb/more"
  471. X# else
  472. X# define  PRT_TO_SCR    "/usr/bin/more"
  473. X# endif HPUX
  474. X*/
  475. X
  476. X# define  OTHER_LINE    "n)ext page p)revious page"
  477. X
  478. X# define    UP        252
  479. X# define    DOWN        253
  480. X# define    LEFT        254
  481. X# define    RIGHT        255
  482. X
  483. X# define    MAX_PRINTERS    30
  484. X# define    MAX_ENT        1024
  485. X# define    ENT_LEN        20
  486. X
  487. X# define    isposodd(x) (x % 2)
  488. X# define    in_col_one(x) ((x / 2) + (x % 2))
  489. X# define    in_col_two(x) (x - in_col_one(x))
  490. X
  491. Xstruct print_options
  492. X{
  493. X    char selection[80];
  494. X    int option;
  495. X    int x;
  496. X    int y;
  497. X};
  498. X
  499. Xstatic struct print_options print_opts[6] = {
  500. X    {"CANCEL",0,5,22},
  501. X    {"PRINT",0,16,22},
  502. X    {"(Spacing %d)",0,26,22},
  503. X    {"(Skip Page Break %s)",0,41,22},
  504. X    {"(Copies %d)",0,65,22}
  505. X};
  506. X
  507. Xtypedef struct
  508. X{
  509. X    char comment[40];
  510. X    char command[128];
  511. X}printer;
  512. X
  513. Xtypedef struct 
  514. X{
  515. X    int max_row;
  516. X    int max_col;
  517. X}dir_info;
  518. X
  519. Xextern DIR *opendir();
  520. X# if defined (SUN) || defined (BSD43)
  521. Xstruct direct *readdir();
  522. X# else
  523. Xstruct dirent *readdir();
  524. X# endif (SUN || BSD43)
  525. X# ifdef BSD43
  526. Xextern struct direct *readdir();
  527. Xvoid closedir();
  528. X# else
  529. Xint closedir();
  530. X# endif BSD43
  531. X
  532. X# endif __DIR_H
  533. END_OF_FILE
  534.   if test 1266 -ne `wc -c <'MENU/dir.h'`; then
  535.     echo shar: \"'MENU/dir.h'\" unpacked with wrong size!
  536.   fi
  537.   # end of 'MENU/dir.h'
  538. fi
  539. if test -f 'MENU/menu.desc' -a "${1}" != "-c" ; then 
  540.   echo shar: Will not clobber existing file \"'MENU/menu.desc'\"
  541. else
  542.   echo shar: Extracting \"'MENU/menu.desc'\" \(2261 characters\)
  543.   sed "s/^X//" >'MENU/menu.desc' <<'END_OF_FILE'
  544. XMenu file key descriptions:
  545. X
  546. XThe key is the first character on each line
  547. Xin a menu file.
  548. X
  549. X'$'        Menu header.  This is the text that will appear at the top
  550. X        of the menu.  7 option menu style.
  551. X
  552. X'!'        Menu header.  Same as above, but selects 14 option menu
  553. X        style.
  554. X
  555. X'?'        Menu comment.  Text that describes what will be used when
  556. X        the user presses the corresponding key.
  557. X
  558. X'+'        Execute in a pipe.  Execute a process in a pipe.  The process
  559. X        called must not require user interaction. Good examples
  560. X        would be "ls" or "cat filename".
  561. X
  562. X'#'        Name of help file.  The name of the help file for the 
  563. X        corresponding menu option.
  564. X
  565. X'*'        Execute commend in a subshell.  Output does not use the
  566. X        menu window.  Upon completion of the command the user
  567. X        will be prompted to press the space key to continue.
  568. X
  569. X'%'        Execute command in a subshell.  Essentially identical
  570. X        to '*' with the exception that it returns without
  571. X        prompting the user to press the space key.  Returns
  572. X        immediately upon completion of the command.
  573. X
  574. X'&'        The name of a menu file is specified for loading.
  575. X
  576. X'@'        The name of a menu file is specified for loading.  In this
  577. X        case the loaded menu file is specified to be the main
  578. X        menu.  This may be useful for sub-menu grouping.  The only
  579. X        way a user can get back to the real "main" menu is by
  580. X        use of the 'm' menu command.  The return key or the 'p' key
  581. X        will only take the user back as far as a menu specified
  582. X        with the '@' character.
  583. X
  584. X'1'        Execute a C-Shell command, but ask for a file name to use
  585. X        as an argument for the command.
  586. X
  587. X'2'        Execute a C-Shell command, but ask for two file names
  588. X        as arguments for the command.  Good for use with the
  589. X        "mv" command.
  590. X
  591. X'3'        Execute a C-Shell command, but ask for a persons login
  592. X        name.  Useful when using the "talk" command.
  593. X
  594. X'4'        Execute a C-Shell command, but ask for a topic.  Useful
  595. X        when using the "man" command.
  596. X
  597. X'5'        Execute a C-Shell command with a file name as an argument.
  598. X        Uses visual directory listing and a file is selected by
  599. X        using the arrow keys.  Useful when you know the file
  600. X        must exist.
  601. X
  602. X'6'        Execute a command in a pipe with a file name as an argument.
  603. X        Uses visual directory listing and a file is selected by
  604. X        using the arrow keys.  Useful when you know the file
  605. X        must exist.
  606. END_OF_FILE
  607.   if test 2261 -ne `wc -c <'MENU/menu.desc'`; then
  608.     echo shar: \"'MENU/menu.desc'\" unpacked with wrong size!
  609.   fi
  610.   # end of 'MENU/menu.desc'
  611. fi
  612. if test -f 'MENU/printers' -a "${1}" != "-c" ; then 
  613.   echo shar: Will not clobber existing file \"'MENU/printers'\"
  614. else
  615.   echo shar: Extracting \"'MENU/printers'\" \(449 characters\)
  616.   sed "s/^X//" >'MENU/printers' <<'END_OF_FILE'
  617. X......................................
  618. X.. Example Printer Definition File ...
  619. X......................................
  620. X? Print on the Screen.
  621. X* /usr/ucb/more
  622. X......................................
  623. X? Library (wide)
  624. X* /usr/local/bin/lprlib
  625. X......................................
  626. X? Library (narrow)
  627. X* /usr/local/bin/lprlibx
  628. X......................................
  629. X? Library (Letter Quality)
  630. X* /usr/local/bin/lprlibz
  631. X......................................
  632. END_OF_FILE
  633.   if test 449 -ne `wc -c <'MENU/printers'`; then
  634.     echo shar: \"'MENU/printers'\" unpacked with wrong size!
  635.   fi
  636.   # end of 'MENU/printers'
  637. fi
  638. if test -f 'MENU/proto.h' -a "${1}" != "-c" ; then 
  639.   echo shar: Will not clobber existing file \"'MENU/proto.h'\"
  640. else
  641.   echo shar: Extracting \"'MENU/proto.h'\" \(1683 characters\)
  642.   sed "s/^X//" >'MENU/proto.h' <<'END_OF_FILE'
  643. X/* Others */
  644. X
  645. Xchar *getwd(char *);
  646. X
  647. X/* For curses */
  648. X
  649. Xint tgetent();
  650. Xint waddch();
  651. Xint addch();
  652. Xint refresh();
  653. Xint wrefresh();
  654. Xint wstandout();
  655. Xint wstandend();
  656. Xint wmove();
  657. Xint endwin();
  658. Xint stty();
  659. Xint gtty();
  660. Xint wclear();
  661. Xint wprintw();
  662. Xint wclrtobot();
  663. Xint wclrtoeol();
  664. Xint getch();
  665. Xint wgetch();
  666. X
  667. X# ifndef __TERMINAL_C
  668. X
  669. Xunsigned short my_getchar();
  670. Xvoid setup_modes();
  671. Xvoid unset_modes();
  672. Xvoid start_up();
  673. Xvoid end_up();
  674. Xvoid move_csr();
  675. Xvoid my_print();
  676. Xvoid hi_lite();
  677. Xvoid print_char();
  678. Xvoid hi_lite_char();
  679. Xvoid clear_window();
  680. Xvoid clear_to_eol();
  681. Xvoid clear_to_bot();
  682. X
  683. X# endif
  684. X
  685. X# ifndef __APPL_C
  686. X
  687. Xvoid check_dirname();
  688. Xvoid do_padding();
  689. Xvoid disp_menu();
  690. Xvoid do_menu();
  691. Xvoid chop_str();
  692. Xvoid pad_str();
  693. X
  694. X# endif
  695. X
  696. X# ifndef __DIR_C
  697. X
  698. Xvoid replace_spaces();
  699. Xvoid move_entry();
  700. Xvoid show_printers();
  701. Xvoid do_printers();
  702. Xchar *select_item();
  703. Xchar *choose_print();
  704. Xchar *do_selection();
  705. Xint is_directory();
  706. Xint get_dir();
  707. Xint print_dir();
  708. Xint read_printers();
  709. X
  710. X# endif
  711. X
  712. X# ifndef __FILES_C
  713. X
  714. Xvoid read_menu();
  715. Xint check_file();
  716. X
  717. X# endif
  718. X
  719. X# ifndef __UTILS_C
  720. X
  721. Xvoid quit();
  722. Xvoid read_str();
  723. Xvoid rm_lf();
  724. Xvoid clear_array();
  725. Xint get_term();
  726. Xint get_input();
  727. X
  728. X# endif
  729. X
  730. X# ifndef __SCREEN_C
  731. X
  732. Xvoid center_line();
  733. Xvoid box_screen();
  734. Xvoid box_window();
  735. X
  736. X# endif
  737. X
  738. X# ifndef __SIGNALS_C
  739. X
  740. Xvoid catch();
  741. Xvoid setup_sigs();
  742. Xvoid log_out();
  743. X
  744. X# endif
  745. X
  746. X# ifndef __TIME_C
  747. X
  748. Xvoid print_time();
  749. Xvoid set_alarm();
  750. Xvoid unset_alarm();
  751. Xchar *extract_mins();
  752. X
  753. X# endif
  754. X
  755. X# ifndef __MENU_C
  756. X
  757. Xvoid erase_line();
  758. Xvoid continue_it();
  759. Xvoid clr_area();
  760. Xvoid print_output();
  761. Xvoid exec_pipe();
  762. Xvoid prt_curdir();
  763. Xvoid exec_cshell();
  764. Xvoid setup_screen();
  765. Xvoid initialize();
  766. Xvoid check_run();
  767. Xint cont_it();
  768. X
  769. X# endif
  770. END_OF_FILE
  771.   if test 1683 -ne `wc -c <'MENU/proto.h'`; then
  772.     echo shar: \"'MENU/proto.h'\" unpacked with wrong size!
  773.   fi
  774.   # end of 'MENU/proto.h'
  775. fi
  776. if test -f 'MENU/screen.c' -a "${1}" != "-c" ; then 
  777.   echo shar: Will not clobber existing file \"'MENU/screen.c'\"
  778. else
  779.   echo shar: Extracting \"'MENU/screen.c'\" \(2580 characters\)
  780.   sed "s/^X//" >'MENU/screen.c' <<'END_OF_FILE'
  781. X# define    __SCREEN_C
  782. X
  783. X# include "config.h"
  784. X# include "proto.h"
  785. X# include <stdio.h>
  786. X# include <curses.h>
  787. X
  788. X# define    SCREEN_WIDTH    80
  789. X# define    FIRST_LINE    0
  790. X# define    FIRST_COL    0
  791. X# define    LAST_COL    79
  792. X# define    LAST_LINE    23
  793. X# define    SPACE        ' '
  794. X# define    RETURN        '\r'
  795. X# define    LINE_FEED    '\n'
  796. X# define    BACK_SPACE    '\b'
  797. X# define    BLANK_LINE    " "
  798. X# define    NORMAL        0
  799. X# define    REVERSE        1
  800. X
  801. XWINDOW *view_port;
  802. X
  803. X/*
  804. X *    Routine        : center_line();
  805. X *    
  806. X *    Purpose        : Center a line in a window.
  807. X *
  808. X *    Parameters    : window_name     - Curses window
  809. X *              string     - The text to center.
  810. X *              line_number    - The line in the window to print on.
  811. X *              width        - The width of the window.
  812. X *              flag        - To Hi-lite or not, that is the quest?
  813. X *
  814. X *    Last Modify    : 11-10-91
  815. X *
  816. X *    Example call    : center_line(WIN,"Hello",2,20,1);
  817. X *
  818. X */
  819. X
  820. Xvoid center_line(window_name,string,line_number,width,flag)
  821. XWINDOW *window_name;
  822. Xchar *string;
  823. Xunsigned short line_number,width,flag;     /* flag = 0 normal, flag = 1 hi-lite */
  824. X{
  825. X    if(flag == NORMAL)
  826. X      my_print(window_name,string,((width/2)-(strlen(string)/2)),line_number);
  827. X    else
  828. X      hi_lite(window_name,string,((width/2)-(strlen(string)/2)),line_number);
  829. X}
  830. X
  831. X/*
  832. X *    Routine        : box_screen()
  833. X *    
  834. X *    Purpose        : Place a hi-lited box around the screen.
  835. X *
  836. X *    Parameters    : top_line    - String Containing Screen Heading.
  837. X *
  838. X *    Last Modify    : 11-10-91
  839. X *
  840. X *    Example call    : box_screen("Hello World");
  841. X *
  842. X */
  843. X
  844. Xvoid box_screen(top_line)
  845. Xchar *top_line;
  846. X{
  847. X    char line[SCREEN_WIDTH+5];
  848. X    int index;
  849. X
  850. X    (void) sprintf(line,"%80s",BLANK_LINE);
  851. X    clear_window(stdscr);
  852. X    hi_lite(stdscr,line,FIRST_COL,FIRST_LINE);
  853. X    hi_lite(stdscr,line,FIRST_COL,LAST_LINE-1);
  854. X    for(index=FIRST_LINE;index<LAST_LINE;index++)
  855. X       hi_lite_char(stdscr,SPACE,FIRST_COL,index);
  856. X    for(index=FIRST_LINE;index<LAST_LINE;index++)
  857. X       hi_lite_char(stdscr,SPACE,LAST_COL,index);
  858. X    center_line(stdscr,top_line,FIRST_LINE,SCREEN_WIDTH,REVERSE);
  859. X    move_csr(stdscr,0,23);
  860. X}
  861. X
  862. X/*
  863. X *    Routine        : box_window()
  864. X *    
  865. X *    Purpose        : Place a box around a window.
  866. X *
  867. X *    Parameters    : window_name     - Curses window structure pointer.
  868. X *
  869. X *    Last Modify    : 11-10-91
  870. X *
  871. X *    Example call    : box_window(stdscr);
  872. X *
  873. X */
  874. X
  875. Xvoid box_window(window_name)
  876. XWINDOW *window_name;
  877. X{
  878. X    int index,max_x, max_y;
  879. X    char print_buff[80];
  880. X
  881. X    (void) sprintf(print_buff,"   ");
  882. X    max_x = window_name->_maxx;
  883. X    max_y = window_name->_maxy;
  884. X    do_padding(print_buff,(max_x-2));
  885. X    hi_lite(window_name,print_buff,0,0);
  886. X    hi_lite(window_name,print_buff,0,(max_y-1));
  887. X    for(index=1;index<(max_y-1);index++){
  888. X       hi_lite_char(window_name,SPACE,0,index);
  889. X       hi_lite_char(window_name,SPACE,max_x-1,index);
  890. X    }
  891. X
  892. X}
  893. END_OF_FILE
  894.   if test 2580 -ne `wc -c <'MENU/screen.c'`; then
  895.     echo shar: \"'MENU/screen.c'\" unpacked with wrong size!
  896.   fi
  897.   # end of 'MENU/screen.c'
  898. fi
  899. if test -f 'MENU/signals.c' -a "${1}" != "-c" ; then 
  900.   echo shar: Will not clobber existing file \"'MENU/signals.c'\"
  901. else
  902.   echo shar: Extracting \"'MENU/signals.c'\" \(1664 characters\)
  903.   sed "s/^X//" >'MENU/signals.c' <<'END_OF_FILE'
  904. X# define    __SIGNALS_C
  905. X
  906. X# include "config.h"
  907. X# include "proto.h"
  908. X# include <signal.h>
  909. X# include "menu.h"
  910. X
  911. X/*    PSC MENU COPYRIGHT NOTICE
  912. X
  913. X    Part of PSCMenu
  914. X
  915. X    This software is to be considered to be public domain, it
  916. Xmay be copied, modified and parts of it may be used in other programs
  917. Xas long as this copyright notice remains intact.
  918. X
  919. X    Copyright()   PSC - Plymouth State College
  920. X    Written by:   Ted Wisniewski 12-9-1990
  921. X*/
  922. X
  923. X/*
  924. X *    void setup_sigs():
  925. X *
  926. X *    Parameters:    None.
  927. X *
  928. X *    Description:    Set up signal handling.
  929. X *
  930. X *    Returns:    None.
  931. X *
  932. X *    Last Modify:    05-8-91 (TW)
  933. X *
  934. X */
  935. X
  936. X/*
  937. X *    catch():
  938. X *
  939. X *    Parameters:    signo - The signal ID #.
  940. X *
  941. X *    Description:    Routine to catch specific signals.
  942. X *
  943. X *    Returns:    None.
  944. X *
  945. X *    Last Modify:    05-8-91 (TW)
  946. X *
  947. X */
  948. X
  949. Xvoid catch(signo)
  950. Xint signo;
  951. X{
  952. X    switch (signo){
  953. X       case SIGHUP:
  954. X        exit(1);
  955. X       break;
  956. X       case SIGSEGV:
  957. X       case SIGBUS:
  958. X        clear_window(stdscr);  
  959. X        unset_modes();
  960. X        perror("BUS ERROR");
  961. X        exit(1);
  962. X       break;
  963. X    }
  964. X}
  965. X
  966. Xvoid setup_sigs()
  967. X{
  968. X    (void) signal(SIGHUP,catch);
  969. X    (void) signal(SIGSEGV,catch);
  970. X    (void) signal(SIGBUS,catch);
  971. X    (void) signal(SIGINT,SIG_IGN);
  972. X    (void) signal(SIGTSTP,SIG_IGN);
  973. X    (void) signal(SIGQUIT,SIG_IGN);
  974. X}
  975. X
  976. X/*
  977. X *     log_out():
  978. X *
  979. X *    Parameters:    None.
  980. X *
  981. X *    Description:    Kill The process group of the parent to the menu,
  982. X *            hopefully this will be the users login shell.
  983. X *
  984. X *    Returns:    None.
  985. X *
  986. X *    Last Modify:    09-04-91 (TW)
  987. X *
  988. X */
  989. X
  990. Xvoid log_out()
  991. X{
  992. X# ifndef HPUX
  993. X    killpg(getppid(),SIGHUP);    /* Kill Parent Process        */
  994. X    killpg(getpid(),SIGHUP);    /* Suicide: Kill self.        */
  995. X# else
  996. X    kill(getppid(),SIGHUP);        /* Kill Parent Process        */
  997. X    kill(getpid(),SIGHUP);        /* Suicide: Kill self.        */
  998. X# endif HPUX
  999. X}
  1000. END_OF_FILE
  1001.   if test 1664 -ne `wc -c <'MENU/signals.c'`; then
  1002.     echo shar: \"'MENU/signals.c'\" unpacked with wrong size!
  1003.   fi
  1004.   # end of 'MENU/signals.c'
  1005. fi
  1006. if test -f 'MENU/time.c' -a "${1}" != "-c" ; then 
  1007.   echo shar: Will not clobber existing file \"'MENU/time.c'\"
  1008. else
  1009.   echo shar: Extracting \"'MENU/time.c'\" \(1264 characters\)
  1010.   sed "s/^X//" >'MENU/time.c' <<'END_OF_FILE'
  1011. X# define    __TIME_C
  1012. X
  1013. X# include "config.h"
  1014. X
  1015. X# ifdef PRINT_TIME
  1016. X# include "proto.h"
  1017. X# include "menu.h"
  1018. X# ifdef AIX
  1019. X#    include <time.h>
  1020. X# else
  1021. X#    include <sys/time.h>
  1022. X# endif
  1023. X# include <signal.h>
  1024. X
  1025. Xchar t_buf[3];
  1026. X
  1027. Xstatic char days[7][4] = {
  1028. X    "Sun","Mon","Tue","Wed","Thu","Fri","Sat"
  1029. X};
  1030. X
  1031. Xstatic char months[12][4] = {
  1032. X    "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"
  1033. X};
  1034. X
  1035. Xchar *extract_mins(minute)
  1036. Xint minute;
  1037. X{
  1038. X    if(minute < 10)
  1039. X      (void) sprintf(t_buf,"0%d",minute);
  1040. X    else
  1041. X      (void) sprintf(t_buf,"%d",minute);
  1042. X    return(t_buf);
  1043. X}
  1044. X
  1045. Xvoid print_time()
  1046. X{
  1047. X    long t_ptr;
  1048. X    struct tm *local, *localtime();
  1049. X    char buffer[80], buffer2[40];
  1050. X    
  1051. X    time(&t_ptr);
  1052. X    local = localtime(&t_ptr);
  1053. X    if(local->tm_hour > 12)
  1054. X      (void) sprintf(buffer,"%d:%s pm",local->tm_hour-12,extract_mins(local->tm_min));
  1055. X    else
  1056. X      (void) sprintf(buffer,"%d:%s am",local->tm_hour,extract_mins(local->tm_min));
  1057. X    (void) sprintf(buffer2,"%s, %s %d",days[local->tm_wday],months[local->tm_mon],local->tm_mday);
  1058. X    hi_lite(stdscr,buffer,72,0);
  1059. X    hi_lite(stdscr,buffer2,0,0);
  1060. X    my_print(stdscr,"",0,23);
  1061. X    alarm(TIME_OUT);
  1062. X}
  1063. X
  1064. Xvoid set_alarm()
  1065. X{
  1066. X    (void) signal(SIGALRM,print_time);
  1067. X    alarm_on = TRUE;
  1068. X    alarm(TIME_OUT);
  1069. X}
  1070. X
  1071. Xvoid unset_alarm()
  1072. X{
  1073. X    alarm_on = FALSE;
  1074. X    alarm(OFF);
  1075. X}
  1076. X
  1077. X# endif PRINT_TIME
  1078. END_OF_FILE
  1079.   if test 1264 -ne `wc -c <'MENU/time.c'`; then
  1080.     echo shar: \"'MENU/time.c'\" unpacked with wrong size!
  1081.   fi
  1082.   # end of 'MENU/time.c'
  1083. fi
  1084. if test -f 'MENU/utils.c' -a "${1}" != "-c" ; then 
  1085.   echo shar: Will not clobber existing file \"'MENU/utils.c'\"
  1086. else
  1087.   echo shar: Extracting \"'MENU/utils.c'\" \(2781 characters\)
  1088.   sed "s/^X//" >'MENU/utils.c' <<'END_OF_FILE'
  1089. X# define    __UTILS_C
  1090. X
  1091. X# include "config.h"
  1092. X# include "proto.h"
  1093. X# include "utils.h"
  1094. X
  1095. X/*
  1096. X    This file contains basic low level utilities.
  1097. X*/
  1098. X
  1099. Xint get_term()
  1100. X/*
  1101. X       This routine gets the terminal specific escape sequences
  1102. X       and saves them in the appropriate variable for use by
  1103. X       tputs() and tgoto()
  1104. X*/
  1105. X{
  1106. X    char bp[1024], termtype[MAXL];
  1107. X    static char buf[100];
  1108. X    char *buf_ptr = buf;
  1109. X# ifdef TERM_INFO
  1110. X    int status;
  1111. X# endif
  1112. X
  1113. X
  1114. X    if(getenv("TERM") != NULL)
  1115. X      (void) strcpy(termtype, getenv("TERM"));
  1116. X    else
  1117. X      return(-1);
  1118. X    initscr();
  1119. X
  1120. X# ifdef TERM_INFO
  1121. X    setupterm(termtype,1,&status);
  1122. X    if(status != 1)
  1123. X       return(-1);
  1124. X
  1125. X    KU = key_up;
  1126. X    KD = key_down;
  1127. X    KL = key_left;
  1128. X    KR = key_right;
  1129. X    
  1130. X# else TERM_INFO
  1131. X
  1132. X    if(tgetent(bp,termtype) != 1)
  1133. X       return(-1);
  1134. X    if((KU = tgetstr("ku",&buf_ptr)) == (char *)NULL)
  1135. X       return (1);
  1136. X    if((KD = tgetstr("kd",&buf_ptr)) == (char *)NULL)
  1137. X       return (1);
  1138. X    if((KL = tgetstr("kl",&buf_ptr)) == (char *)NULL)
  1139. X       return (1);
  1140. X    if((KR = tgetstr("kr",&buf_ptr)) == (char *)NULL)
  1141. X       return (1);
  1142. X# endif TERM_INFO
  1143. X    return(0);
  1144. X}
  1145. X
  1146. Xvoid quit()
  1147. X{
  1148. X    clear_window(stdscr);        /* Clear screen routine             */
  1149. X    move_csr(stdscr,0,LAST_LINE);
  1150. X    end_up();
  1151. X    exit(0);
  1152. X}
  1153. X    
  1154. Xvoid rm_lf(array)
  1155. Xchar *array;
  1156. X/*    
  1157. X    Remove Trailing line feed from a line.
  1158. X*/
  1159. X{
  1160. X    if(array[strlen(array)-1] == '\n')
  1161. X      array[strlen(array)-1] = NULL;
  1162. X}
  1163. X
  1164. Xvoid read_str(window_name,string,max_length)
  1165. XWINDOW *window_name;
  1166. Xchar *string;
  1167. Xint max_length;
  1168. X{
  1169. X    char *str;
  1170. X    int length = 0;
  1171. X
  1172. X    str = string;
  1173. X    while((*str =my_getchar(window_name)) != LF && *str != RETURN && length <= max_length){
  1174. X       if(*str ==  DEL  || *str == BS)
  1175. X          if(*str != *string){
  1176. X         waddch(window_name,DEL);
  1177. X         waddch(window_name,SPACE);
  1178. X         waddch(window_name,DEL);
  1179. X         wrefresh(window_name);
  1180. X         *str--;
  1181. X         length--;
  1182. X          }else
  1183. X         continue;
  1184. X       else{
  1185. X          if(length == max_length)
  1186. X            waddch(window_name,0x07);
  1187. X          else{
  1188. X            waddch(window_name,*str);
  1189. X            *str++;
  1190. X            length++;
  1191. X          }
  1192. X          wrefresh(window_name);
  1193. X       }
  1194. X    }
  1195. X    *str = NULL;
  1196. X}
  1197. X
  1198. X
  1199. Xvoid clear_array(array)
  1200. Xchar *array;
  1201. X{
  1202. X    for(;*array != NULL;*array++)
  1203. X        *array = NULL;
  1204. X}
  1205. X
  1206. Xint get_input()
  1207. X{
  1208. X    char c, buffer[80];
  1209. X    int ct = 0, len;
  1210. X
  1211. X    if((len = strlen(KU)-1) < 2)
  1212. X      len = 1;
  1213. X    while((c = my_getchar(stdscr)) && (ct < len)){
  1214. X       if((c == 0x1b) || (ct > 0)){
  1215. X         buffer[ct] = c;
  1216. X         ct++; 
  1217. X       }else
  1218. X         return(c);
  1219. X    }
  1220. X    buffer[ct] = c;
  1221. X    buffer[ct+1] = NULL;
  1222. X    if((strcmp(KU,buffer)) == 0 || strcmp("\033[A",buffer) == 0)
  1223. X      return(UP);
  1224. X    else
  1225. X      if((strcmp(KD,buffer)) == 0 || strcmp("\033[B",buffer) == 0)
  1226. X        return(DOWN);
  1227. X      else
  1228. X        if((strcmp(KR,buffer)) == 0 || strcmp("\033[C",buffer) == 0)
  1229. X          return(RIGHT);
  1230. X        else
  1231. X          if((strcmp(KL,buffer)) == 0 || strcmp("\033[D",buffer) == 0)
  1232. X            return(LEFT);
  1233. X          else
  1234. X            return(NULL);
  1235. X}
  1236. END_OF_FILE
  1237.   if test 2781 -ne `wc -c <'MENU/utils.c'`; then
  1238.     echo shar: \"'MENU/utils.c'\" unpacked with wrong size!
  1239.   fi
  1240.   # end of 'MENU/utils.c'
  1241. fi
  1242. if test -f 'MENU/utils.h' -a "${1}" != "-c" ; then 
  1243.   echo shar: Will not clobber existing file \"'MENU/utils.h'\"
  1244. else
  1245.   echo shar: Extracting \"'MENU/utils.h'\" \(852 characters\)
  1246.   sed "s/^X//" >'MENU/utils.h' <<'END_OF_FILE'
  1247. X# ifndef __UTILS_H
  1248. X# define __UTILS_H
  1249. X
  1250. X# include <stdio.h>
  1251. X#    include <curses.h>
  1252. X# ifdef TERM_INFO
  1253. X#    include <term.h>
  1254. X# endif TERM_INFO 
  1255. X
  1256. X# include <sys/types.h>
  1257. X# include <unistd.h>
  1258. X
  1259. X/*    PSC MENU COPYRIGHT NOTICE
  1260. X
  1261. X    Part of PSCMenu
  1262. X
  1263. X    This software is to be considered to be public domain, it
  1264. Xmay be copied, modified and parts of it may be used in other programs
  1265. Xas long as this copyright notice remains intact.
  1266. X
  1267. X    Copyright()   PSC - Plymouth State College
  1268. X    Written by:   Ted Wisniewski 12-9-1990
  1269. X*/
  1270. X
  1271. X# define         MAXL        80
  1272. X# define          THIS_TTY    0
  1273. X# define        DEL        '\b'
  1274. X# define        BS        0x7f
  1275. X# define        SPACE        ' '
  1276. X# define        LF        '\n'
  1277. X# define         RETURN        '\r'
  1278. X# define        LAST_LINE    23
  1279. X
  1280. X# define        UP        252
  1281. X# define        DOWN        253
  1282. X# define        LEFT        254
  1283. X# define        RIGHT        255
  1284. X
  1285. Xchar *getenv(), *tgetstr(), *tgoto();
  1286. X
  1287. Xint outc();
  1288. X
  1289. Xchar *KU, *KD, *KL, *KR;
  1290. X
  1291. X# endif __UTILS_H
  1292. END_OF_FILE
  1293.   if test 852 -ne `wc -c <'MENU/utils.h'`; then
  1294.     echo shar: \"'MENU/utils.h'\" unpacked with wrong size!
  1295.   fi
  1296.   # end of 'MENU/utils.h'
  1297. fi
  1298. echo shar: End of archive 2 \(of 2\).
  1299. cp /dev/null ark2isdone
  1300. MISSING=""
  1301. for I in 1 2 ; do
  1302.     if test ! -f ark${I}isdone ; then
  1303.     MISSING="${MISSING} ${I}"
  1304.     fi
  1305. done
  1306. if test "${MISSING}" = "" ; then
  1307.     echo You have unpacked both archives.
  1308.     rm -f ark[1-9]isdone
  1309. else
  1310.     echo You still must unpack the following archives:
  1311.     echo "        " ${MISSING}
  1312. fi
  1313. exit 0
  1314. exit 0 # Just in case...
  1315.