home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / screen35 / part01 < prev    next >
Encoding:
Text File  |  1993-07-25  |  128.0 KB  |  4,533 lines

  1. Newsgroups: comp.sources.unix
  2. From: mlschroe@immd4.informatik.uni-erlangen.de (Michael Schroeder)
  3. Subject: v26i300: screen-3.5 - screen manager with VT100/ANSI terminal emulation, V3.5, Part01/10
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: mlschroe@immd4.informatik.uni-erlangen.de (Michael Schroeder)
  8. Posting-Number: Volume 26, Issue 300
  9. Archive-Name: screen-3.5/part01
  10.  
  11. [ there are some control characters in this package, which will work OK on
  12.   late B News, and all C News and INN systems, but not on older B News and
  13.   many news->mail gateways.  Be prepared to fetch this via anonymous FTP if
  14.   you get unpacking errors from these files:
  15.  
  16.     Found 22 control chars in "'terminfo/8bits'"
  17.     Found 3589 control chars in "'terminfo/test.txt'"
  18.     Found 1 control char in "'doc/screen.texinfo'"
  19.  
  20.   Here's the top of the man page:
  21.  
  22.   NAME
  23.        screen - screen manager with VT100/ANSI terminal emulation
  24.  
  25.   SYNOPSIS
  26.        screen [ -options ] [ cmd [ args ] ]
  27.        screen -r [ [pid.]tty[.host] ]
  28.  
  29.   DESCRIPTION
  30.        Screen is a full-screen window manager that multiplexes  a
  31.        physical  terminal  between  several  processes (typically
  32.        interactive shells).  Each virtual terminal  provides  the
  33.        functions  of  a DEC VT100 terminal and, in addition, sev-
  34.        eral control functions from the ANSI X3.64 (ISO 6429)  and
  35.        ISO  2022  standards  (e.g. insert/delete line and support
  36.        for multiple character sets).  There is a scrollback  his-
  37.        tory buffer for each virtual terminal and a copy-and-paste
  38.        mechanism that allows moving text regions between windows.
  39.  
  40.   --vix ]
  41.  
  42.                   ----------------------------
  43.                    What's new in screen-3.5 ?
  44.                   ----------------------------
  45.  
  46. * Texinfo manpage! Thanks to Jason Merrill.
  47.  
  48. * Screen now has a very large 'configure' script. If you have
  49.   problems with the resulting configuration please send mail to
  50.   screen@uni-erlangen.de.
  51.  
  52. * Stackable overlay planes.
  53.   All commands are available even if you work with an overlay. Thus
  54.   you can be in copy/paste mode on several windows!
  55.  
  56. * Unification of key bindings and screen commands. All keys now generate
  57.   commands.
  58.  
  59. * Screen now reads/writes only in asyncronous mode.
  60.  
  61. * Ansi parser speedup code resulting in much faster output of text.
  62.  
  63. * Changed the rc file syntax. Commands now directly affect the current
  64.   window. The default settings are changed with 'def...' commands.
  65.   The 'set' keyword no longer exists.
  66.   Please run the 'newsyntax' script on your old screenrc files!
  67.  
  68. * Emacs style isearch added to copy mode. Try ^A ESC ^R screen ^R ^R
  69.   to locate the last three occurences of the word 'screen' in the
  70.   history buffer.
  71.  
  72. * New command 'silence'. Alarms the user whenever there was inactivity
  73.   for a specified amount of time on a certain window.
  74.   Useful if you want to wait for a compilation to end.
  75.  
  76. * Much better margin handling:
  77.   Screen now handles autowrapped lines correctly in the redisplay and
  78.   copy/paste functions.
  79.  
  80. * New commands for pastebuffer management:
  81.   'copy_reg' copies the pastebuffer to a register,
  82.   'ins_reg' pastes a register,
  83.   'register' fills a register with a string,
  84.   'process' stuffs a register into strings input queue.
  85.  
  86. * Autonuke feature. Flush the output buffer if the window gets
  87.   cleared. Enable this with 'autonuke on'.
  88.  
  89. * Modifications to save memory: Empty attribute and font lines don't
  90.   get allocated. This is very useful if you have a lage scrollback.
  91.  
  92. * Multi display support:
  93.   You can now attach from more than one terminal to a session with
  94.   the '-x' option.
  95.  
  96. * New option '-S' to specify socket name.
  97.  
  98. * Experimental multiuser support added:
  99.   You can start screen in multiuser Mode by prepending the socket
  100.   name with a '/' (or by the command 'multiuser on').
  101.   If another user wants to attach to the screen session, he can do
  102.   this by prepending the socketname with 'screenuser/'.
  103.   Of course he must be in the access control list for a successful
  104.   attach (see the acladd/acldel command).
  105.   
  106. * Extension to the 'screen' command: You can now specify tty lines
  107.   instead of programs. This can be used for console management.
  108.   Added the command 'break' to send a break to the tty line.
  109.   Not really a new feature, but terminal initialisation  now works
  110.   on suns.
  111.  
  112. * Input/output filters added. This has been implemented to allow the
  113.   user to configure an open tty line, but got soon exended to allow
  114.   all sorts of filters. For more information read the explanation
  115.   of the 'exec' command in the man page and check the 'fdpat.ps'
  116.   document.
  117.  
  118. * Screen can now be started detached (screen -d -m -S sockname).
  119.   This is usefull if you want to start screen in your /etc/rc file
  120.   (e.g. as a console multiplexer)
  121.  
  122. * Console grabbing added ('console on' command). 
  123.  
  124. * Windows can now be selected by akas, too. (Per default bound to the
  125.   >'< key.)
  126.  
  127. * New terminal capabiliteise CS/CE for cursorkey control.
  128.  
  129. * setenv/unsetenv commands added.
  130.  
  131. * Expansion of environment variables ($VAR) and terminal capabilities
  132.   ($:TC:) in the screenrc files and detach messages.
  133.   Example: pow_detach_msg "Session of \$LOGNAME \$:cr:\$:nl:ended."
  134.    
  135. * New commands:
  136.   'hardcopydir' and 'logdir' to change the output directories,
  137.   'partial' and 'allpartial' to make screen only refresh the line
  138.   containing the cursor if a window is selected (useful for slow
  139.   modem connections).
  140.  
  141. * Cleanup of the provided termcap/terminfo file. Please install
  142.   the new one!
  143.  
  144. * The program 'terminfo/checktc.c' does a visual check of a
  145.   termcap/terminfo entry. Please try it before calling screen and
  146.   in a screen session.
  147.  
  148. * LOTS of bugfixes and code cleanup.
  149.  
  150. Thanks to all the beta testers who helped porting screen to at least
  151. the following platforms: Ultrix, SunOS, Solaris, BSD43, linux, NEWSOS,
  152. Irix, OSF/1, Harris CX/UX, hpux, dynix/ptx, AIX.
  153. And even more thanks to the brave who attempted to use the 'exec'
  154. command features.
  155.  
  156.     Donnate patches, bugreports, suggestions, money, beer & pizza to
  157.             screen@uni-erlangen.de
  158.  
  159. #! /bin/sh
  160. # This is a shell archive.  Remove anything before this line, then unpack
  161. # it by saving it into a file and typing "sh file".  To overwrite existing
  162. # files, type "sh file -c".  You can also feed this as standard input via
  163. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  164. # will see the following message at the end:
  165. #        "End of archive 1 (of 10)."
  166. # Contents:  .iscreenrc INSTALL MANIFEST NEWS acl.h ansi.h comm.c
  167. #   comm.h.dist comm.sh display.h doc doc/Makefile doc/readme.quick
  168. #   etcscreenrc input.c loadav.c mark.h misc.c newsyntax overlay.h
  169. #   pty.c putenv.c rcs.h screen.h term.c term.h.dist term.sh terminfo
  170. #   terminfo/8bits terminfo/README terminfo/checktc.c
  171. #   terminfo/screen-sco.mail terminfo/screencap
  172. #   terminfo/screeninfo.src terminfo/tetris.c window.h
  173. # Wrapped by vixie@gw.home.vix.com on Sun Jul 25 12:57:11 1993
  174. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  175. if test -f '.iscreenrc' -a "${1}" != "-c" ; then 
  176.   echo shar: Will not clobber existing file \"'.iscreenrc'\"
  177. else
  178. echo shar: Extracting \"'.iscreenrc'\" \(1845 characters\)
  179. sed "s/^X//" >'.iscreenrc' <<'END_OF_FILE'
  180. X#password ODSJQf.4IJN7E    # "1234"
  181. X
  182. Xvbell on
  183. Xautodetach on
  184. Xstartup_message off
  185. X
  186. Xtermcap  vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
  187. Xterminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC
  188. X
  189. Xterminfo vt100 B8=\E*<\EN:G0
  190. X
  191. X#xterm understands both im/ic and doesn't have a status line.
  192. X#Note: Do not specify im and ic in the real termcap/info file as
  193. X#some programs (e.g. vi) will not work anymore.
  194. Xtermcap  xterm|fptwist hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
  195. Xterminfo xterm|fptwist hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
  196. Xtermcap  xterm Z0=\E[?3h:Z1=\E[?3l
  197. Xterminfo xterm Z0=\E[?3h:Z1=\E[?3l
  198. X
  199. X#xterms is xterm with status line in title bar
  200. Xtermcap  xterms 'hs:ts=\E]0;:fs=\007:ds=\E]0;iScreen\007:cs=\E[%i%d;%dr:LP:G0:im=\E[4h:ei=\E[4l'
  201. Xterminfo xterms 'hs:ts=\E]0;:fs=\007:ds=\E]0;iScreen\007:cs=\E[%i%p1%d;%p2%dr:LP:G0:im=\E[4h:ei=\E[4l'
  202. X
  203. X#make hp700 termcap/info better
  204. Xtermcap  hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
  205. Xterminfo hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
  206. X
  207. X#wyse-75-42 must have flow control (xo = "terminal uses xon/xoff")
  208. X#essential to have it here, as this is a slow terminal.
  209. Xtermcap wy75-42 xo
  210. Xterminfo wy75-42 xo
  211. X
  212. X
  213. X#remove some stupid / dangerous key bindings
  214. Xbind k
  215. Xbind K
  216. Xbind .
  217. Xbind ^k
  218. Xbind ^\
  219. Xbind \\
  220. Xbind ^h
  221. Xbind h
  222. X#make them better
  223. Xbind '\\' quit
  224. Xbind 'K' kill
  225. Xbind 'I' login on
  226. Xbind 'O' login off
  227. Xbind '}' history
  228. Xbind ')' screen -k faui09 rlogin faui09 -8
  229. Xbind '#' screen -k faui43 rlogin faui43 -8
  230. Xbind '%' screen -k faui45 rlogin faui45 -8
  231. Xpow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
  232. Xtermcap wy* CS=\E[?1h:CE=\E[?1l
  233. Xterminfo wy* CS=\E[?1h:CE=\E[?1l
  234. X
  235. Xtermcap xterm* OL=10000
  236. Xterminfo xterm* OL=10000
  237. END_OF_FILE
  238. if test 1845 -ne `wc -c <'.iscreenrc'`; then
  239.     echo shar: \"'.iscreenrc'\" unpacked with wrong size!
  240. fi
  241. # end of '.iscreenrc'
  242. fi
  243. if test -f 'INSTALL' -a "${1}" != "-c" ; then 
  244.   echo shar: Will not clobber existing file \"'INSTALL'\"
  245. else
  246. echo shar: Extracting \"'INSTALL'\" \(2097 characters\)
  247. sed "s/^X//" >'INSTALL' <<'END_OF_FILE'
  248. XInstallation of screen3.3
  249. X
  250. X0.)
  251. XUnpack. Screen comes as a compressed tar archive. You need gzip to uncompress.
  252. XBut... you probably already managed that step, when you are reading this.
  253. X
  254. X1.)
  255. XRun configure. This should create a Makefile and a config.h file
  256. Xsuited for your machine. Rename config.status to reflect the architecture 
  257. X(hostname) where it was built. To reconfigure quickly for that architecture
  258. Xjust run that config.status file.
  259. XIf this process fails, try to find out what configure did do and what it
  260. Xshould have checked. Mail me.
  261. X
  262. X2.)
  263. XLook through the Makefile & user configuration section in config.h and check the
  264. Xpathnames. Change them to suit your installation requirements.
  265. X
  266. X3.)
  267. XYou may well run screen from your private binary directory and with a 
  268. Xprivate socket directory like $HOME/.screen. But to have a full featured
  269. Xscreen and (from a users point of view) more secure pty's you should
  270. Xconsult a system administrator and discuss installing screen setuid-root
  271. Xin some globally accessible directory like /usr/local/bin.
  272. X
  273. XConsider this, when deciding whether you install screen setuid-root:
  274. X- On some machines root priviliges are required to open pty's. 
  275. X- Pty's should be owned by the user, so that she can do chmod to prevent
  276. X  intrudor attacks.
  277. X- The ^At feature may need to lseek and read the kernel file to retrieve 
  278. X  the load average.
  279. X- On most machines utmp slots can only be created/manipulated with root
  280. X  privileges. 
  281. X
  282. X4.)
  283. XThe man page screen.1 should go to /usr/local/man/man1, or some similar
  284. Xdirectory. It should format nicely with nroff -man. If it does not, then
  285. Xtry removing extra dots with: sed -e 's/^\.\././' < screen.1 | nroff -man 
  286. XLook through the etcscreenrc file for system wide defaults that you like to 
  287. Xset. e.g. autodetach off, startup_message off, ... 
  288. XInstall it to match the pathname specified in config.h
  289. X
  290. X5.)
  291. XSince version 3.2.15 the screenrc file syntax changed slightly. All rc files
  292. Xfrom previous versions should be run through the newsyntax script that comes 
  293. Xwith this package.
  294. X
  295. XJuergen Weigert. (screen@immd4.informatik.uni-erlangen.de)
  296. END_OF_FILE
  297. if test 2097 -ne `wc -c <'INSTALL'`; then
  298.     echo shar: \"'INSTALL'\" unpacked with wrong size!
  299. fi
  300. # end of 'INSTALL'
  301. fi
  302. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  303.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  304. else
  305. echo shar: Extracting \"'MANIFEST'\" \(2191 characters\)
  306. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  307. X   File Name        Archive #    Description
  308. X-----------------------------------------------------------
  309. X .iscreenrc                 1    
  310. X COPYING                    3    
  311. X ChangeLog                  2    
  312. X INSTALL                    1    
  313. X MANIFEST                   1    This shipping list
  314. X Makefile.in                2    
  315. X NEWS                       1    
  316. X acl.c                      2    
  317. X acl.h                      1    
  318. X ansi.c                     6    
  319. X ansi.h                     1    
  320. X attacher.c                 3    
  321. X comm.c                     1    
  322. X comm.h.dist                1    
  323. X comm.sh                    1    
  324. X config.h                   2    
  325. X config.h.in                2    
  326. X configure                  7    
  327. X configure.in               4    
  328. X display.c                  5    
  329. X display.h                  1    
  330. X doc                        1    
  331. X doc/Makefile               1    
  332. X doc/fdpat.ps               8    
  333. X doc/readme.quick           1    
  334. X doc/screen.1               9    
  335. X doc/screen.texinfo        10    
  336. X etcscreenrc                1    
  337. X extern.h                   2    
  338. X fileio.c                   3    
  339. X help.c                     3    
  340. X input.c                    1    
  341. X loadav.c                   1    
  342. X mark.c                     4    
  343. X mark.h                     1    
  344. X misc.c                     1    
  345. X newsyntax                  1    
  346. X os.h                       2    
  347. X overlay.h                  1    
  348. X patchlevel.h               2    
  349. X process.c                  7    
  350. X pty.c                      1    
  351. X putenv.c                   1    
  352. X rcs.h                      1    
  353. X resize.c                   2    
  354. X screen.c                   6    
  355. X screen.h                   1    
  356. X search.c                   2    
  357. X socket.c                   5    
  358. X term.c                     1    
  359. X term.h.dist                1    
  360. X term.sh                    1    
  361. X termcap.c                  3    
  362. X terminfo                   1    
  363. X terminfo/8bits             1    
  364. X terminfo/README            1    
  365. X terminfo/checktc.c         1    
  366. X terminfo/screen-sco.mail   1    
  367. X terminfo/screencap         1    
  368. X terminfo/screeninfo.src    1    
  369. X terminfo/test.txt          5    
  370. X terminfo/tetris.c          1    
  371. X tty.c.dist                 4    
  372. X tty.sh                     4    
  373. X utmp.c                     3    
  374. X window.c                   4    
  375. X window.h                   1    
  376. END_OF_FILE
  377. if test 2191 -ne `wc -c <'MANIFEST'`; then
  378.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  379. fi
  380. # end of 'MANIFEST'
  381. fi
  382. if test -f 'NEWS' -a "${1}" != "-c" ; then 
  383.   echo shar: Will not clobber existing file \"'NEWS'\"
  384. else
  385. echo shar: Extracting \"'NEWS'\" \(4444 characters\)
  386. sed "s/^X//" >'NEWS' <<'END_OF_FILE'
  387. X
  388. X                  ----------------------------
  389. X                   What's new in screen-3.5 ?
  390. X                  ----------------------------
  391. X
  392. X
  393. X* Texinfo manpage! Thanks to Jason Merrill.
  394. X
  395. X* Screen now has a very large 'configure' script. If you have
  396. X  problems with the resulting configuration please send mail to
  397. X  screen@uni-erlangen.de.
  398. X
  399. X* Stackable overlay planes.
  400. X  All commands are available even if you work with an overlay. Thus
  401. X  you can be in copy/paste mode on several windows!
  402. X
  403. X* Unification of key bindings and screen commands. All keys now generate
  404. X  commands.
  405. X
  406. X* Screen now reads/writes only in asyncronous mode.
  407. X
  408. X* Ansi parser speedup code resulting in much faster output of text.
  409. X
  410. X* Changed the rc file syntax. Commands now directly affect the current
  411. X  window. The default settings are changed with 'def...' commands.
  412. X  The 'set' keyword no longer exists.
  413. X  Please run the 'newsyntax' script on your old screenrc files!
  414. X
  415. X* Emacs style isearch added to copy mode. Try ^A ESC ^R screen ^R ^R
  416. X  to locate the last three occurences of the word 'screen' in the
  417. X  history buffer.
  418. X
  419. X* New command 'silence'. Alarms the user whenever there was inactivity
  420. X  for a specified amount of time on a certain window.
  421. X  Useful if you want to wait for a compilation to end.
  422. X
  423. X* Much better margin handling:
  424. X  Screen now handles autowrapped lines correctly in the redisplay and
  425. X  copy/paste functions.
  426. X
  427. X* New commands for pastebuffer management:
  428. X  'copy_reg' copies the pastebuffer to a register,
  429. X  'ins_reg' pastes a register,
  430. X  'register' fills a register with a string,
  431. X  'process' stuffs a register into strings input queue.
  432. X
  433. X* Autonuke feature. Flush the output buffer if the window gets
  434. X  cleared. Enable this with 'autonuke on'.
  435. X
  436. X* Modifications to save memory: Empty attribute and font lines don't
  437. X  get allocated. This is very useful if you have a lage scrollback.
  438. X
  439. X* Multi display support:
  440. X  You can now attach from more than one terminal to a session with
  441. X  the '-x' option.
  442. X
  443. X* New option '-S' to specify socket name.
  444. X
  445. X* Experimental multiuser support added:
  446. X  You can start screen in multiuser Mode by prepending the socket
  447. X  name with a '/' (or by the command 'multiuser on').
  448. X  If another user wants to attach to the screen session, he can do
  449. X  this by prepending the socketname with 'screenuser/'.
  450. X  Of course he must be in the access control list for a successful
  451. X  attach (see the acladd/acldel command).
  452. X  
  453. X* Extension to the 'screen' command: You can now specify tty lines
  454. X  instead of programs. This can be used for console management.
  455. X  Added the command 'break' to send a break to the tty line.
  456. X  Not really a new feature, but terminal initialisation  now works
  457. X  on suns.
  458. X
  459. X* Input/output filters added. This has been implemented to allow the
  460. X  user to configure an open tty line, but got soon exended to allow
  461. X  all sorts of filters. For more information read the explanation
  462. X  of the 'exec' command in the man page and check the 'fdpat.ps'
  463. X  document.
  464. X
  465. X* Screen can now be started detached (screen -d -m -S sockname).
  466. X  This is usefull if you want to start screen in your /etc/rc file
  467. X  (e.g. as a console multiplexer)
  468. X
  469. X* Console grabbing added ('console on' command). 
  470. X
  471. X* Windows can now be selected by akas, too. (Per default bound to the
  472. X  >'< key.)
  473. X
  474. X* New terminal capabiliteise CS/CE for cursorkey control.
  475. X
  476. X* setenv/unsetenv commands added.
  477. X
  478. X* Expansion of environment variables ($VAR) and terminal capabilities
  479. X  ($:TC:) in the screenrc files and detach messages.
  480. X  Example: pow_detach_msg "Session of \$LOGNAME \$:cr:\$:nl:ended."
  481. X   
  482. X* New commands:
  483. X  'hardcopydir' and 'logdir' to change the output directories,
  484. X  'partial' and 'allpartial' to make screen only refresh the line
  485. X  containing the cursor if a window is selected (useful for slow
  486. X  modem connections).
  487. X
  488. X* Cleanup of the provided termcap/terminfo file. Please install
  489. X  the new one!
  490. X
  491. X* The program 'terminfo/checktc.c' does a visual check of a
  492. X  termcap/terminfo entry. Please try it before calling screen and
  493. X  in a screen session.
  494. X
  495. X* LOTS of bugfixes and code cleanup.
  496. X
  497. XThanks to all the beta testers who helped porting screen to at least
  498. Xthe following platforms: Ultrix, SunOS, Solaris, BSD43, linux, NEWSOS,
  499. XIrix, OSF/1, Harris CX/UX, hpux, dynix/ptx, AIX.
  500. XAnd even more thanks to the brave who attempted to use the 'exec'
  501. Xcommand features.
  502. X
  503. X    Donnate patches, bugreports, suggestions, money, beer & pizza to
  504. X            screen@uni-erlangen.de
  505. X
  506. END_OF_FILE
  507. if test 4444 -ne `wc -c <'NEWS'`; then
  508.     echo shar: \"'NEWS'\" unpacked with wrong size!
  509. fi
  510. # end of 'NEWS'
  511. fi
  512. if test -f 'acl.h' -a "${1}" != "-c" ; then 
  513.   echo shar: Will not clobber existing file \"'acl.h'\"
  514. else
  515. echo shar: Extracting \"'acl.h'\" \(2284 characters\)
  516. sed "s/^X//" >'acl.h' <<'END_OF_FILE'
  517. X/* Copyright (c) 1993
  518. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  519. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  520. X * Copyright (c) 1987 Oliver Laumann
  521. X *
  522. X * This program is free software; you can redistribute it and/or modify
  523. X * it under the terms of the GNU General Public License as published by
  524. X * the Free Software Foundation; either version 2, or (at your option)
  525. X * any later version.
  526. X *
  527. X * This program is distributed in the hope that it will be useful,
  528. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  529. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  530. X * GNU General Public License for more details.
  531. X *
  532. X * You should have received a copy of the GNU General Public License
  533. X * along with this program (see the file COPYING); if not, write to the
  534. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  535. X *
  536. X ****************************************************************
  537. X * RCS_ID("$Id: acl.h,v 1.6 1993/07/16 14:04:15 mlschroe Exp $ FAU")
  538. X */
  539. X
  540. X#ifdef MULTIUSER
  541. X
  542. X/* three known bits: */
  543. X#define ACL_EXEC 0        
  544. X#define ACL_WRITE 1
  545. X#define ACL_READ 2
  546. X
  547. X#define ACL_BITS_PER_CMD 1    /* for comm.h */
  548. X#define ACL_BITS_PER_WIN 3    /* for window.h */
  549. X
  550. X#define USER_CHUNK 8
  551. X
  552. X#define ACLBYTE(data, w)   ((data)[(w) >> 3])
  553. X#define ACLBIT(w)   (0x80 >> ((w) & 7))
  554. X
  555. Xtypedef unsigned char * AclBits;
  556. X
  557. X/* a bitfield for windows and one for commands */
  558. Xtypedef struct
  559. X{
  560. X  char name[20 + 1];
  561. X  AclBits wins, cmds;
  562. X} AclGroup;
  563. X
  564. X/* 
  565. X * An AclGroupList is a chaind list of pointers to AclGroups.
  566. X * Each user has such a list to reference groups he is in.
  567. X * The aclgrouproot anchors all AclGroups. Delete and create
  568. X * groups there.
  569. X */
  570. Xtypedef struct grouplist
  571. X{
  572. X  AclGroup *group;
  573. X  struct grouplist *next;
  574. X} AclGroupList;
  575. X
  576. X#endif
  577. X
  578. X/***************
  579. X *  ==> user.h
  580. X */
  581. X
  582. X/*
  583. X * A User has a list of groups, and points to other users.
  584. X * acluserroot is the User entry of the session owner (creator)
  585. X * and anchors all other users. Add/Delete users there.
  586. X */
  587. Xtypedef struct user
  588. X{
  589. X  char u_name[20+1];        /* login name how he showed up */
  590. X  char u_password[20+1];    /* his password (may be zero length). */
  591. X  struct user *u_next;
  592. X#ifdef MULTIUSER
  593. X  int id;            /* a uniq index in the bitfields. */
  594. X#endif
  595. X} User;
  596. X
  597. END_OF_FILE
  598. if test 2284 -ne `wc -c <'acl.h'`; then
  599.     echo shar: \"'acl.h'\" unpacked with wrong size!
  600. fi
  601. # end of 'acl.h'
  602. fi
  603. if test -f 'ansi.h' -a "${1}" != "-c" ; then 
  604.   echo shar: Will not clobber existing file \"'ansi.h'\"
  605. else
  606. echo shar: Extracting \"'ansi.h'\" \(2507 characters\)
  607. sed "s/^X//" >'ansi.h' <<'END_OF_FILE'
  608. X/* Copyright (c) 1993
  609. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  610. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  611. X * Copyright (c) 1987 Oliver Laumann
  612. X *
  613. X * This program is free software; you can redistribute it and/or modify
  614. X * it under the terms of the GNU General Public License as published by
  615. X * the Free Software Foundation; either version 2, or (at your option)
  616. X * any later version.
  617. X *
  618. X * This program is distributed in the hope that it will be useful,
  619. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  620. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  621. X * GNU General Public License for more details.
  622. X *
  623. X * You should have received a copy of the GNU General Public License
  624. X * along with this program (see the file COPYING); if not, write to the
  625. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  626. X *
  627. X ****************************************************************
  628. X * $Id: ansi.h,v 1.2 1993/07/16 14:04:22 mlschroe Exp $ FAU
  629. X */
  630. X
  631. X#define NATTR        6
  632. X
  633. X#define ATTR_DI        0    /* Dim mode */
  634. X#define ATTR_US        1    /* Underscore mode */
  635. X#define ATTR_BD        2    /* Bold mode */
  636. X#define ATTR_RV        3    /* Reverse mode */
  637. X#define ATTR_SO        4    /* Standout mode */
  638. X#define ATTR_BL        5    /* Blinking */
  639. X
  640. X#define A_DI    (1<<ATTR_DI)
  641. X#define A_US    (1<<ATTR_US)
  642. X#define A_BD    (1<<ATTR_BD)
  643. X#define A_RV    (1<<ATTR_RV)
  644. X#define A_SO    (1<<ATTR_SO)
  645. X#define A_BL    (1<<ATTR_BL)
  646. X#define A_MAX    (1<<(NATTR-1))
  647. X
  648. X/*
  649. X *  Parser state
  650. X */
  651. Xenum state_t 
  652. X{
  653. X  LIT,                /* Literal input */
  654. X  ESC,                /* Start of escape sequence */
  655. X  ASTR,                /* Start of control string */
  656. X  STRESC,            /* ESC seen in control string */
  657. X  CSI,                /* Reading arguments in "CSI Pn ;...*/
  658. X  PRIN,                /* Printer mode */
  659. X  PRINESC,            /* ESC seen in printer mode */
  660. X  PRINCSI,            /* CSI seen in printer mode */
  661. X  PRIN4                /* CSI 4 seen in printer mode */
  662. X};
  663. X
  664. Xenum string_t 
  665. X{
  666. X  NONE,
  667. X  DCS,                /* Device control string */
  668. X  OSC,                /* Operating system command */
  669. X  APC,                /* Application program command */
  670. X  PM,                /* Privacy message */
  671. X  AKA,                /* a.k.a. for current screen */
  672. X  GM                /* Global message to every display */
  673. X};
  674. X
  675. X/*
  676. X *  Types of movement used by GotoPos()
  677. X */
  678. Xenum move_t {
  679. X    M_NONE,
  680. X    M_UP,
  681. X    M_CUP,
  682. X    M_DO,
  683. X    M_CDO,
  684. X    M_LE,
  685. X    M_CLE,
  686. X    M_RI,
  687. X    M_CRI,
  688. X    M_RW,
  689. X    M_CR    /* CR and rewrite */
  690. X};
  691. X
  692. X#define EXPENSIVE     1000
  693. X
  694. X#define G0             0
  695. X#define G1             1
  696. X#define G2             2
  697. X#define G3             3
  698. X
  699. X#define ASCII         0
  700. X
  701. X#ifdef TOPSTAT
  702. X#define STATLINE     (0)
  703. X#else
  704. X#define STATLINE     (d_height-1)
  705. X#endif
  706. X
  707. END_OF_FILE
  708. if test 2507 -ne `wc -c <'ansi.h'`; then
  709.     echo shar: \"'ansi.h'\" unpacked with wrong size!
  710. fi
  711. # end of 'ansi.h'
  712. fi
  713. if test -f 'comm.c' -a "${1}" != "-c" ; then 
  714.   echo shar: Will not clobber existing file \"'comm.c'\"
  715. else
  716. echo shar: Extracting \"'comm.c'\" \(5417 characters\)
  717. sed "s/^X//" >'comm.c' <<'END_OF_FILE'
  718. X/* Copyright (c) 1993
  719. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  720. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  721. X * Copyright (c) 1987 Oliver Laumann
  722. X *
  723. X * This program is free software; you can redistribute it and/or modify
  724. X * it under the terms of the GNU General Public License as published by
  725. X * the Free Software Foundation; either version 2, or (at your option)
  726. X * any later version.
  727. X *
  728. X * This program is distributed in the hope that it will be useful,
  729. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  730. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  731. X * GNU General Public License for more details.
  732. X *
  733. X * You should have received a copy of the GNU General Public License
  734. X * along with this program (see the file COPYING); if not, write to the
  735. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  736. X *
  737. X ****************************************************************
  738. X */
  739. X
  740. X#include "rcs.h"
  741. XRCS_ID("$Id: comm.c,v 1.4 1993/07/21 15:42:50 mlschroe Exp $ FAU")
  742. X
  743. X#include "config.h"
  744. X#include "acl.h"
  745. X#include "comm.h"
  746. X
  747. X/* Must be in alpha order ! */
  748. X
  749. Xstruct comm comms[RC_LAST + 1] =
  750. X{
  751. X#ifdef MULTIUSER
  752. X  { "acladd",        ARGS_ONE },
  753. X  { "aclchg",        ARGS_TWO },
  754. X  { "acldel",        ARGS_ONE },
  755. X  { "aclgrp",        ARGS_ONE },
  756. X#endif
  757. X  { "activity",        ARGS_ONE },
  758. X  { "aka",        NEED_FORE|ARGS_ZEROONE },
  759. X  { "allpartial",    ARGS_ONE },
  760. X  { "autodetach",    ARGS_ONE },
  761. X#ifdef AUTO_NUKE
  762. X  { "autonuke",        NEED_DISPLAY|ARGS_ONE },
  763. X#endif
  764. X  { "bell",        ARGS_ONE },
  765. X  { "bind",        ARGS_ONE|ARGS_ORMORE },
  766. X  { "break",        NEED_FORE|ARGS_ZEROONE },
  767. X#ifdef COPY_PASTE
  768. X  { "bufferfile",    ARGS_ZEROONE },
  769. X#endif
  770. X  { "chdir",        ARGS_ZEROONE },
  771. X  { "clear",        NEED_FORE|ARGS_ZERO },
  772. X#ifdef MULTI
  773. X  { "clone",        NEED_DISPLAY|ARGS_ONE|ARGS_ORMORE },
  774. X#endif
  775. X  { "colon",        NEED_DISPLAY|ARGS_ZERO },
  776. X  { "console",        NEED_FORE|ARGS_ZEROONE },
  777. X#ifdef COPY_PASTE
  778. X  { "copy",        NEED_FORE|ARGS_ZERO },
  779. X  { "copy_reg",        ARGS_ZEROONE },
  780. X  { "crlf",        ARGS_ONE },
  781. X#endif
  782. X#ifdef AUTO_NUKE
  783. X  { "defautonuke",    ARGS_ONE },
  784. X#endif
  785. X  { "defflow",        ARGS_ONETWO },
  786. X#ifdef UTMPOK
  787. X  { "deflogin",        ARGS_ONE },
  788. X#endif
  789. X  { "defmode",        ARGS_ONE },
  790. X  { "defmonitor",    ARGS_ONE },
  791. X  { "defobuflimit",    ARGS_ONE },
  792. X#ifdef COPY_PASTE
  793. X  { "defscrollback",    ARGS_ONE },
  794. X#endif
  795. X  { "defwrap",        ARGS_ONE },
  796. X  { "detach",        NEED_DISPLAY|ARGS_ZERO },
  797. X  { "dumptermcap",    ARGS_ZERO },
  798. X  { "duplicate",    ARGS_ZERO|ARGS_ORMORE },
  799. X  { "echo",        ARGS_ONETWO },
  800. X  { "escape",        ARGS_ONE },
  801. X#ifdef PSEUDOS
  802. X  { "exec",         NEED_FORE|ARGS_ZERO|ARGS_ORMORE },
  803. X#endif
  804. X  { "flow",        NEED_FORE|ARGS_ZEROONE },
  805. X  { "hardcopy",        NEED_FORE|ARGS_ZERO },
  806. X  { "hardcopy_append",    ARGS_ONE },
  807. X  { "hardcopydir",    ARGS_ONE },
  808. X  { "hardstatus",    ARGS_ZEROONE },
  809. X  { "height",        NEED_DISPLAY|ARGS_ZEROONE },
  810. X  { "help",        NEED_DISPLAY|ARGS_ZERO },
  811. X#ifdef COPY_PASTE
  812. X  { "history",        NEED_FORE|ARGS_ZERO },
  813. X#endif
  814. X  { "info",        NEED_DISPLAY|ARGS_ZERO },
  815. X#ifdef COPY_PASTE
  816. X  { "ins_reg",        NEED_DISPLAY|ARGS_ZEROONE },
  817. X#endif
  818. X  { "kill",        NEED_FORE|ARGS_ZERO },
  819. X  { "lastmsg",        NEED_DISPLAY|ARGS_ZERO },
  820. X  { "license",        NEED_DISPLAY|ARGS_ZERO },
  821. X#ifdef LOCK
  822. X  { "lockscreen",    NEED_DISPLAY|ARGS_ZERO },
  823. X#endif
  824. X  { "log",        ARGS_ZEROONE },
  825. X  { "logdir",        ARGS_ONE },
  826. X#ifdef UTMPOK
  827. X  { "login",        NEED_FORE|ARGS_ZEROONE },
  828. X#endif
  829. X#ifdef COPY_PASTE
  830. X  { "markkeys",        ARGS_ONE },
  831. X#endif
  832. X  { "meta",        NEED_DISPLAY|ARGS_ZERO },
  833. X  { "monitor",        NEED_FORE|ARGS_ZEROONE },
  834. X  { "msgminwait",    ARGS_ONE },
  835. X  { "msgwait",        ARGS_ONE },
  836. X#ifdef MULTIUSER
  837. X  { "multiuser",    ARGS_ONE },
  838. X#endif
  839. X#ifdef NETHACK
  840. X  { "nethack",        ARGS_ONE },
  841. X#endif
  842. X  { "next",        ARGS_ZERO },
  843. X  { "number",        NEED_FORE|ARGS_ZEROONE },
  844. X  { "obuflimit",    NEED_DISPLAY|ARGS_ZEROONE },
  845. X  { "other",        NEED_DISPLAY|ARGS_ZERO },
  846. X  { "partial",        NEED_FORE|ARGS_ZEROONE },
  847. X#ifdef PASSWORD
  848. X  { "password",        ARGS_ZEROONE },
  849. X#endif
  850. X#ifdef COPY_PASTE
  851. X  { "paste",        NEED_DISPLAY|ARGS_ZERO },
  852. X#endif
  853. X  { "pow_break",    NEED_FORE|ARGS_ZEROONE },
  854. X#ifdef POW_DETACH
  855. X  { "pow_detach",    NEED_DISPLAY|ARGS_ZERO },
  856. X  { "pow_detach_msg",    ARGS_ONE },
  857. X#endif
  858. X  { "prev",        ARGS_ZERO },
  859. X  { "process",        NEED_DISPLAY|ARGS_ZEROONE },
  860. X  { "quit",        ARGS_ZERO },
  861. X#ifdef COPY_PASTE
  862. X  { "readbuf",        NEED_DISPLAY|ARGS_ZERO },
  863. X#endif
  864. X  { "redisplay",    ARGS_ZERO },
  865. X  { "register",        ARGS_TWO },
  866. X#ifdef COPY_PASTE
  867. X  { "removebuf",    ARGS_ZERO },
  868. X#endif
  869. X  { "reset",        NEED_FORE|ARGS_ZERO },
  870. X  { "screen",        ARGS_ZERO|ARGS_ORMORE },
  871. X#ifdef COPY_PASTE
  872. X  { "scrollback",    NEED_FORE|ARGS_ONE },
  873. X#endif
  874. X  { "select",        ARGS_ZEROONE },
  875. X  { "sessionname",    ARGS_ZEROONE },
  876. X  { "setenv",        ARGS_TWO },
  877. X  { "shell",        ARGS_ONE },
  878. X  { "shellaka",        ARGS_ONE },
  879. X  { "silence",        NEED_FORE|ARGS_ZEROONE },
  880. X  { "silencewait",    ARGS_ONE },
  881. X  { "sleep",        ARGS_ONE },
  882. X  { "slowpaste",    ARGS_ONE },
  883. X  { "startup_message",    ARGS_ONE },
  884. X#ifdef BSDJOBS
  885. X  { "suspend",        NEED_DISPLAY|ARGS_ZERO },
  886. X#endif
  887. X  { "term",        ARGS_ONE },
  888. X  { "termcap",        ARGS_TWOTHREE },
  889. X  { "terminfo",        ARGS_TWOTHREE },
  890. X  { "time",        ARGS_ZERO },
  891. X  { "unsetenv",        ARGS_ONE },
  892. X  { "vbell",        ARGS_ZEROONE },
  893. X  { "vbell_msg",    ARGS_ONE },
  894. X  { "vbellwait",    ARGS_ONE },
  895. X  { "version",        ARGS_ZERO },
  896. X  { "width",        NEED_DISPLAY|ARGS_ZEROONE },
  897. X  { "windows",        ARGS_ZERO },
  898. X  { "wrap",        NEED_FORE|ARGS_ZEROONE },
  899. X#ifdef COPY_PASTE
  900. X  { "writebuf",        NEED_DISPLAY|ARGS_ZERO },
  901. X#endif
  902. X  { "writelock",    NEED_FORE|ARGS_ZEROONE },
  903. X  { "xoff",        NEED_DISPLAY|ARGS_ZERO },
  904. X  { "xon",        NEED_DISPLAY|ARGS_ZERO }
  905. X};
  906. END_OF_FILE
  907. if test 5417 -ne `wc -c <'comm.c'`; then
  908.     echo shar: \"'comm.c'\" unpacked with wrong size!
  909. fi
  910. # end of 'comm.c'
  911. fi
  912. if test -f 'comm.h.dist' -a "${1}" != "-c" ; then 
  913.   echo shar: Will not clobber existing file \"'comm.h.dist'\"
  914. else
  915. echo shar: Extracting \"'comm.h.dist'\" \(3040 characters\)
  916. sed "s/^X//" >'comm.h.dist' <<'END_OF_FILE'
  917. X/*
  918. X * This file is automagically created from comm.c -- DO NOT EDIT
  919. X */
  920. X
  921. Xstruct comm
  922. X{
  923. X  char *name;
  924. X  int flags;
  925. X#ifdef MULTIUSER
  926. X  AclBits userbits[ACL_BITS_PER_CMD];
  927. X#endif
  928. X};
  929. X
  930. X#define ARGS_MASK    (3)
  931. X
  932. X#define ARGS_ZERO    (0)
  933. X#define ARGS_ONE    (1)
  934. X#define ARGS_TWO    (2)
  935. X#define ARGS_THREE    (3)
  936. X
  937. X#define ARGS_PLUSONE    (1<<2)
  938. X#define ARGS_ORMORE    (1<<3)
  939. X
  940. X#define NEED_FORE    (1<<4)    /* this command needs a fore window */
  941. X#define NEED_DISPLAY    (1<<5)    /* this command needs a display */
  942. X
  943. X#define ARGS_ZEROONE    (ARGS_ZERO|ARGS_PLUSONE)
  944. X#define ARGS_ONETWO    (ARGS_ONE |ARGS_PLUSONE)
  945. X#define ARGS_TWOTHREE    (ARGS_TWO |ARGS_PLUSONE)
  946. X
  947. Xstruct action
  948. X{
  949. X  int nr;
  950. X  char **args;
  951. X};
  952. X
  953. X#define RC_ILLEGAL -1
  954. X
  955. X#define RC_ACLADD 0
  956. X#define RC_ACLCHG 1
  957. X#define RC_ACLDEL 2
  958. X#define RC_ACLGRP 3
  959. X#define RC_ACTIVITY 4
  960. X#define RC_AKA 5
  961. X#define RC_ALLPARTIAL 6
  962. X#define RC_AUTODETACH 7
  963. X#define RC_AUTONUKE 8
  964. X#define RC_BELL 9
  965. X#define RC_BIND 10
  966. X#define RC_BREAK 11
  967. X#define RC_BUFFERFILE 12
  968. X#define RC_CHDIR 13
  969. X#define RC_CLEAR 14
  970. X#define RC_CLONE 15
  971. X#define RC_COLON 16
  972. X#define RC_CONSOLE 17
  973. X#define RC_COPY 18
  974. X#define RC_COPY_REG 19
  975. X#define RC_CRLF 20
  976. X#define RC_DEFAUTONUKE 21
  977. X#define RC_DEFFLOW 22
  978. X#define RC_DEFLOGIN 23
  979. X#define RC_DEFMODE 24
  980. X#define RC_DEFMONITOR 25
  981. X#define RC_DEFOBUFLIMIT 26
  982. X#define RC_DEFSCROLLBACK 27
  983. X#define RC_DEFWRAP 28
  984. X#define RC_DETACH 29
  985. X#define RC_DUMPTERMCAP 30
  986. X#define RC_DUPLICATE 31
  987. X#define RC_ECHO 32
  988. X#define RC_ESCAPE 33
  989. X#define RC_EXEC 34
  990. X#define RC_FLOW 35
  991. X#define RC_HARDCOPY 36
  992. X#define RC_HARDCOPY_APPEND 37
  993. X#define RC_HARDCOPYDIR 38
  994. X#define RC_HARDSTATUS 39
  995. X#define RC_HEIGHT 40
  996. X#define RC_HELP 41
  997. X#define RC_HISTORY 42
  998. X#define RC_INFO 43
  999. X#define RC_INS_REG 44
  1000. X#define RC_KILL 45
  1001. X#define RC_LASTMSG 46
  1002. X#define RC_LICENSE 47
  1003. X#define RC_LOCKSCREEN 48
  1004. X#define RC_LOG 49
  1005. X#define RC_LOGDIR 50
  1006. X#define RC_LOGIN 51
  1007. X#define RC_MARKKEYS 52
  1008. X#define RC_META 53
  1009. X#define RC_MONITOR 54
  1010. X#define RC_MSGMINWAIT 55
  1011. X#define RC_MSGWAIT 56
  1012. X#define RC_MULTIUSER 57
  1013. X#define RC_NETHACK 58
  1014. X#define RC_NEXT 59
  1015. X#define RC_NUMBER 60
  1016. X#define RC_OBUFLIMIT 61
  1017. X#define RC_OTHER 62
  1018. X#define RC_PARTIAL 63
  1019. X#define RC_PASSWORD 64
  1020. X#define RC_PASTE 65
  1021. X#define RC_POW_BREAK 66
  1022. X#define RC_POW_DETACH 67
  1023. X#define RC_POW_DETACH_MSG 68
  1024. X#define RC_PREV 69
  1025. X#define RC_PROCESS 70
  1026. X#define RC_QUIT 71
  1027. X#define RC_READBUF 72
  1028. X#define RC_REDISPLAY 73
  1029. X#define RC_REGISTER 74
  1030. X#define RC_REMOVEBUF 75
  1031. X#define RC_RESET 76
  1032. X#define RC_SCREEN 77
  1033. X#define RC_SCROLLBACK 78
  1034. X#define RC_SELECT 79
  1035. X#define RC_SESSIONNAME 80
  1036. X#define RC_SETENV 81
  1037. X#define RC_SHELL 82
  1038. X#define RC_SHELLAKA 83
  1039. X#define RC_SILENCE 84
  1040. X#define RC_SILENCEWAIT 85
  1041. X#define RC_SLEEP 86
  1042. X#define RC_SLOWPASTE 87
  1043. X#define RC_STARTUP_MESSAGE 88
  1044. X#define RC_SUSPEND 89
  1045. X#define RC_TERM 90
  1046. X#define RC_TERMCAP 91
  1047. X#define RC_TERMINFO 92
  1048. X#define RC_TIME 93
  1049. X#define RC_UNSETENV 94
  1050. X#define RC_VBELL 95
  1051. X#define RC_VBELL_MSG 96
  1052. X#define RC_VBELLWAIT 97
  1053. X#define RC_VERSION 98
  1054. X#define RC_WIDTH 99
  1055. X#define RC_WINDOWS 100
  1056. X#define RC_WRAP 101
  1057. X#define RC_WRITEBUF 102
  1058. X#define RC_WRITELOCK 103
  1059. X#define RC_XOFF 104
  1060. X#define RC_XON 105
  1061. X
  1062. X#define RC_LAST 105
  1063. END_OF_FILE
  1064. if test 3040 -ne `wc -c <'comm.h.dist'`; then
  1065.     echo shar: \"'comm.h.dist'\" unpacked with wrong size!
  1066. fi
  1067. # end of 'comm.h.dist'
  1068. fi
  1069. if test -f 'comm.sh' -a "${1}" != "-c" ; then 
  1070.   echo shar: Will not clobber existing file \"'comm.sh'\"
  1071. else
  1072. echo shar: Extracting \"'comm.sh'\" \(1263 characters\)
  1073. sed "s/^X//" >'comm.sh' <<'END_OF_FILE'
  1074. X#!/bin/sh
  1075. X
  1076. Xif test -z "$AWK"; then
  1077. X  AWK=awk
  1078. Xfi
  1079. Xif test -z "$CC"; then
  1080. X  CC=cc
  1081. Xfi
  1082. X
  1083. Xrm -f comm.h
  1084. Xcat << EOF > comm.h
  1085. X/*
  1086. X * This file is automagically created from comm.c -- DO NOT EDIT
  1087. X */
  1088. X
  1089. Xstruct comm
  1090. X{
  1091. X  char *name;
  1092. X  int flags;
  1093. X#ifdef MULTIUSER
  1094. X  AclBits userbits[ACL_BITS_PER_CMD];
  1095. X#endif
  1096. X};
  1097. X
  1098. X#define ARGS_MASK    (3)
  1099. X
  1100. X#define ARGS_ZERO    (0)
  1101. X#define ARGS_ONE    (1)
  1102. X#define ARGS_TWO    (2)
  1103. X#define ARGS_THREE    (3)
  1104. X
  1105. X#define ARGS_PLUSONE    (1<<2)
  1106. X#define ARGS_ORMORE    (1<<3)
  1107. X
  1108. X#define NEED_FORE    (1<<4)    /* this command needs a fore window */
  1109. X#define NEED_DISPLAY    (1<<5)    /* this command needs a display */
  1110. X
  1111. X#define ARGS_ZEROONE    (ARGS_ZERO|ARGS_PLUSONE)
  1112. X#define ARGS_ONETWO    (ARGS_ONE |ARGS_PLUSONE)
  1113. X#define ARGS_TWOTHREE    (ARGS_TWO |ARGS_PLUSONE)
  1114. X
  1115. Xstruct action
  1116. X{
  1117. X  int nr;
  1118. X  char **args;
  1119. X};
  1120. X
  1121. X#define RC_ILLEGAL -1
  1122. X
  1123. XEOF
  1124. X$AWK < comm.c >> comm.h '
  1125. X/^  [{] ".*/    {   if (old > $2) {
  1126. X        printf("***ERROR: %s <= %s !!!\n\n", $2, old);
  1127. X        exit 1;
  1128. X        }
  1129. X    old = $2;
  1130. X    }
  1131. X'
  1132. X$CC -E comm.c > comm.cpp
  1133. Xsed < comm.cpp \
  1134. X  -n \
  1135. X  -e '/^  { "/y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
  1136. X  -e '/^  { "/s/^  { "\([^"]*\)".*/\1/p' \
  1137. X| $AWK '
  1138. X/.*/ {    printf "#define RC_%s %d\n",$0,i++;
  1139. X     }
  1140. XEND  {    printf "\n#define RC_LAST %d\n",i-1;
  1141. X     }
  1142. X' >> comm.h
  1143. Xchmod a-w comm.h
  1144. Xrm -f comm.cpp
  1145. END_OF_FILE
  1146. if test 1263 -ne `wc -c <'comm.sh'`; then
  1147.     echo shar: \"'comm.sh'\" unpacked with wrong size!
  1148. fi
  1149. # end of 'comm.sh'
  1150. fi
  1151. if test -f 'display.h' -a "${1}" != "-c" ; then 
  1152.   echo shar: Will not clobber existing file \"'display.h'\"
  1153. else
  1154. echo shar: Extracting \"'display.h'\" \(6764 characters\)
  1155. sed "s/^X//" >'display.h' <<'END_OF_FILE'
  1156. X/* Copyright (c) 1993
  1157. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  1158. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  1159. X * Copyright (c) 1987 Oliver Laumann
  1160. X *
  1161. X * This program is free software; you can redistribute it and/or modify
  1162. X * it under the terms of the GNU General Public License as published by
  1163. X * the Free Software Foundation; either version 2, or (at your option)
  1164. X * any later version.
  1165. X *
  1166. X * This program is distributed in the hope that it will be useful,
  1167. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1168. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1169. X * GNU General Public License for more details.
  1170. X *
  1171. X * You should have received a copy of the GNU General Public License
  1172. X * along with this program (see the file COPYING); if not, write to the
  1173. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1174. X *
  1175. X ****************************************************************
  1176. X * $Id: display.h,v 1.3 1993/07/21 15:43:05 mlschroe Exp $ FAU
  1177. X */
  1178. X
  1179. Xstruct win;            /* forward declaration */
  1180. X
  1181. Xstruct display
  1182. X{
  1183. X  struct display *_d_next;    /* linked list */
  1184. X  struct user *_d_user;        /* user who owns that display */
  1185. X  struct LayFuncs *_d_layfn;    /* current layer functions */
  1186. X  struct layer *_d_lay;        /* layers on the display */
  1187. X  struct win *_d_fore;        /* pointer to fore window */
  1188. X  struct win *_d_other;        /* pointer to other window */
  1189. X  char  _d_termname[20 + 1];    /* $TERM */
  1190. X  char    _d_tentry[TERMCAP_BUFSIZE];    /* buffer for tgetstr */
  1191. X  int    _d_tcinited;        /* termcap inited flag */
  1192. X  int    _d_width, _d_height;    /* width/height of the screen */
  1193. X  int    _d_defwidth, _d_defheight;    /* default width/height of windows */
  1194. X  int    _d_top, _d_bot;        /* scrollregion start/end */
  1195. X  int    _d_x, _d_y;        /* cursor position */
  1196. X  char    _d_attr;        /* current attributes */
  1197. X  char    _d_font;        /* current font */
  1198. X  int    _d_insert;        /* insert mode flag */
  1199. X  int    _d_keypad;        /* application keypad flag */
  1200. X  int    _d_cursorkeys;        /* application cursorkeys flag */
  1201. X  int    _d_flow;        /* flow control on/off flag*/
  1202. X  int    _d_lp_missing;        /* last character on bot line missing */
  1203. X  int    _d_lp_image;        /* missing image */
  1204. X  int    _d_lp_attr;        /* missing attr */
  1205. X  int    _d_lp_font;        /* missing font */
  1206. X  int    _d_status;        /* is status displayed? */
  1207. X  time_t _d_status_time;    /* time of status display */
  1208. X  int    _d_status_bell;        /* is it only a vbell? */
  1209. X  int    _d_status_len;        /* length of status line */
  1210. X  char *_d_status_lastmsg;    /* last displayed message */
  1211. X  int   _d_status_buflen;    /* last message buffer len */
  1212. X  int    _d_status_lastx;    /* position of the cursor */
  1213. X  int    _d_status_lasty;    /*   before status was displayed */
  1214. X  int    _d_ESCseen;        /* Was the last char an ESC (^a) */
  1215. X  int    _d_userpid;        /* pid of attacher */
  1216. X  char    _d_usertty[MAXPATHLEN];    /* tty we are attached to */
  1217. X  int    _d_userfd;        /* fd of the tty */
  1218. X  struct mode _d_OldMode;    /* tty mode when screen was started */
  1219. X  struct mode _d_NewMode;    /* New tty mode */
  1220. X  char  *_d_obuf;        /* output buffer */
  1221. X  int   _d_obuflen;        /* len of buffer */
  1222. X  int    _d_obufmax;        /* len where we are blocking the pty */
  1223. X  char  *_d_obufp;        /* pointer in buffer */
  1224. X  int   _d_obuffree;        /* free bytes in buffer */
  1225. X#ifdef AUTO_NUKE
  1226. X  int    _d_auto_nuke;        /* autonuke flag */
  1227. X#endif
  1228. X#ifdef COPY_PASTE
  1229. X  char    *_d_copybuffer;
  1230. X  int    _d_copylen;
  1231. X#endif
  1232. X  union    tcu _d_tcs[T_N];    /* terminal capabilities */
  1233. X  char    *_d_attrtab[NATTR];
  1234. X  short    _d_dospeed;        /* baudrate of tty */
  1235. X  char _d_c0_tab[256];        /* conversion for C0 */
  1236. X  int _d_UPcost, _d_DOcost, _d_LEcost, _d_NDcost;
  1237. X  int _d_CRcost, _d_IMcost, _d_EIcost, _d_NLcost;
  1238. X#ifdef UTMPOK
  1239. X  slot_t _d_loginslot;        /* offset, where utmp_logintty belongs */
  1240. X  struct utmp _d_utmp_logintty;    /* here the original utmp structure is stored */
  1241. X# ifdef _SEQUENT_
  1242. X  char _d_loginhost[100+1];
  1243. X# endif /* _SEQUENT_ */
  1244. X#endif
  1245. X};
  1246. X
  1247. X#ifdef MULTI
  1248. X# define DISPLAY(x) display->x
  1249. X#else
  1250. Xextern struct display TheDisplay;
  1251. X# define DISPLAY(x) TheDisplay.x
  1252. X#endif
  1253. X
  1254. X#define d_user        DISPLAY(_d_user)
  1255. X#define d_username    (DISPLAY(_d_user) ? DISPLAY(_d_user)->u_name : 0)
  1256. X#define d_layfn        DISPLAY(_d_layfn)
  1257. X#define d_lay        DISPLAY(_d_lay)
  1258. X#define d_fore        DISPLAY(_d_fore)
  1259. X#define d_other        DISPLAY(_d_other)
  1260. X#define d_termname    DISPLAY(_d_termname)
  1261. X#define d_tentry    DISPLAY(_d_tentry)
  1262. X#define d_tcinited    DISPLAY(_d_tcinited)
  1263. X#define d_width        DISPLAY(_d_width)
  1264. X#define d_height    DISPLAY(_d_height)
  1265. X#define d_defwidth    DISPLAY(_d_defwidth)
  1266. X#define d_defheight    DISPLAY(_d_defheight)
  1267. X#define d_top        DISPLAY(_d_top)
  1268. X#define d_bot        DISPLAY(_d_bot)
  1269. X#define d_x        DISPLAY(_d_x)
  1270. X#define d_y        DISPLAY(_d_y)
  1271. X#define d_attr        DISPLAY(_d_attr)
  1272. X#define d_font        DISPLAY(_d_font)
  1273. X#define d_insert    DISPLAY(_d_insert)
  1274. X#define d_keypad    DISPLAY(_d_keypad)
  1275. X#define d_cursorkeys    DISPLAY(_d_cursorkeys)
  1276. X#define d_flow        DISPLAY(_d_flow)
  1277. X#define d_lp_missing    DISPLAY(_d_lp_missing)
  1278. X#define d_lp_image    DISPLAY(_d_lp_image)
  1279. X#define d_lp_attr    DISPLAY(_d_lp_attr)
  1280. X#define d_lp_font    DISPLAY(_d_lp_font)
  1281. X#define d_status    DISPLAY(_d_status)
  1282. X#define d_status_time    DISPLAY(_d_status_time)
  1283. X#define d_status_bell    DISPLAY(_d_status_bell)
  1284. X#define d_status_len    DISPLAY(_d_status_len)
  1285. X#define d_status_lastmsg    DISPLAY(_d_status_lastmsg)
  1286. X#define d_status_buflen    DISPLAY(_d_status_buflen)
  1287. X#define d_status_lastx    DISPLAY(_d_status_lastx)
  1288. X#define d_status_lasty    DISPLAY(_d_status_lasty)
  1289. X#define d_ESCseen    DISPLAY(_d_ESCseen)
  1290. X#define d_userpid    DISPLAY(_d_userpid)
  1291. X#define d_usertty    DISPLAY(_d_usertty)
  1292. X#define d_userfd    DISPLAY(_d_userfd)
  1293. X#define d_OldMode    DISPLAY(_d_OldMode)
  1294. X#define d_NewMode    DISPLAY(_d_NewMode)
  1295. X#define d_obuf        DISPLAY(_d_obuf)
  1296. X#define d_obuflen    DISPLAY(_d_obuflen)
  1297. X#define d_obufmax    DISPLAY(_d_obufmax)
  1298. X#define d_obufp        DISPLAY(_d_obufp)
  1299. X#define d_obuffree    DISPLAY(_d_obuffree)
  1300. X#define d_auto_nuke    DISPLAY(_d_auto_nuke)
  1301. X#define d_copybuffer    DISPLAY(_d_copybuffer)
  1302. X#define d_copylen    DISPLAY(_d_copylen)
  1303. X#define d_tcs        DISPLAY(_d_tcs)
  1304. X#define d_attrtab    DISPLAY(_d_attrtab)
  1305. X#define d_dospeed    DISPLAY(_d_dospeed)
  1306. X#define d_c0_tab    DISPLAY(_d_c0_tab)
  1307. X#define d_UPcost    DISPLAY(_d_UPcost)
  1308. X#define d_DOcost    DISPLAY(_d_DOcost)
  1309. X#define d_LEcost    DISPLAY(_d_LEcost)
  1310. X#define d_NDcost    DISPLAY(_d_NDcost)
  1311. X#define d_CRcost    DISPLAY(_d_CRcost)
  1312. X#define d_IMcost    DISPLAY(_d_IMcost)
  1313. X#define d_EIcost    DISPLAY(_d_EIcost)
  1314. X#define d_NLcost    DISPLAY(_d_NLcost)
  1315. X#define d_loginslot    DISPLAY(_d_loginslot)
  1316. X#define d_utmp_logintty    DISPLAY(_d_utmp_logintty)
  1317. X#define d_loginhost    DISPLAY(_d_loginhost)
  1318. X
  1319. X
  1320. X#define GRAIN 4096  /* Allocation grain size for output buffer */
  1321. X#define OBUF_MAX 256
  1322. X   /* Maximum amount of buffered output before input is blocked */
  1323. X
  1324. X#define OUTPUT_BLOCK_SIZE 256  /* Block size of output to tty */
  1325. X
  1326. X#define AddChar(c) \
  1327. X  { \
  1328. X    if (--d_obuffree == 0) \
  1329. X      Resize_obuf(); \
  1330. X    *d_obufp++ = (c); \
  1331. X  }
  1332. X
  1333. END_OF_FILE
  1334. if test 6764 -ne `wc -c <'display.h'`; then
  1335.     echo shar: \"'display.h'\" unpacked with wrong size!
  1336. fi
  1337. # end of 'display.h'
  1338. fi
  1339. if test ! -d 'doc' ; then
  1340.     echo shar: Creating directory \"'doc'\"
  1341.     mkdir 'doc'
  1342. fi
  1343. if test -f 'doc/Makefile' -a "${1}" != "-c" ; then 
  1344.   echo shar: Will not clobber existing file \"'doc/Makefile'\"
  1345. else
  1346. echo shar: Extracting \"'doc/Makefile'\" \(463 characters\)
  1347. sed "s/^X//" >'doc/Makefile' <<'END_OF_FILE'
  1348. XINSTALL = cp
  1349. Xinfodir = /local/emacs/info
  1350. X
  1351. Xall: screen.dvi screen.info
  1352. X
  1353. Xdvi screen.dvi: screen.texinfo clean
  1354. X    texi2dvi screen.texinfo
  1355. X
  1356. Xinfo screen.info: screen.texinfo
  1357. X    makeinfo screen.texinfo
  1358. X
  1359. Xinstall: screen.info
  1360. X    $(INSTALL) screen.info $(infodir)/screen
  1361. X    $(INSTALL) screen.info-? $(infodir)/
  1362. X    
  1363. Xclean:
  1364. X    -rm -f *.cp *.cps *.fn *.fns *.ky *.kys *.pg *.tp *.vr
  1365. X    -rm -f *.log *.aux *.toc *~
  1366. X
  1367. Xdistclean realclean clobber: clean
  1368. X    -rm -f *.dvi
  1369. X    -rm -f *.info *.info-?
  1370. X
  1371. END_OF_FILE
  1372. if test 463 -ne `wc -c <'doc/Makefile'`; then
  1373.     echo shar: \"'doc/Makefile'\" unpacked with wrong size!
  1374. fi
  1375. # end of 'doc/Makefile'
  1376. fi
  1377. if test -f 'doc/readme.quick' -a "${1}" != "-c" ; then 
  1378.   echo shar: Will not clobber existing file \"'doc/readme.quick'\"
  1379. else
  1380. echo shar: Extracting \"'doc/readme.quick'\" \(3036 characters\)
  1381. sed "s/^X//" >'doc/readme.quick' <<'END_OF_FILE'
  1382. X
  1383. XShort introduction to screen (Version 3.0.7)                  jw 7.9.91
  1384. X
  1385. Xscreen 
  1386. X  provides you with an ansi/vt100 terminal emulator, which can multiplex
  1387. X  up to 10 pseudo-terminals. On startup, it executes $SHELL in window 0.
  1388. X  Then it reads $HOME/.screenrc to learn configuration, keybindings, 
  1389. X  and may open more windows.
  1390. X
  1391. X  C-A C        Create new windows.
  1392. X
  1393. X  C-A SPACE    Advance from window to window (with wraparound)
  1394. X
  1395. X  C-A C-A    Toggle between two windows.
  1396. X
  1397. X  C-A 0
  1398. X   ...
  1399. X  C-A 9        Switch to window nr. 0 ... 9.
  1400. X
  1401. X  C-A w        Show a list of windows in the Statusline.
  1402. X
  1403. X  C-A a        (Think of goto-start-of-line in emacs or tcsh).
  1404. X  C-A s        (Think of i-search in emacs).
  1405. X  C-A q        Send a literal C-A/C-S/C-Q to the process in the window.
  1406. X
  1407. X  C-A l        Redraw this window.
  1408. X
  1409. X  C-A W        Toggle between 80 & 132 columns mode. 
  1410. X
  1411. X  C-A L        Try to toggle the utmp-slot for this window.
  1412. X
  1413. X  C-A A        Prompt for a new name for this window. (see C-A w).
  1414. X
  1415. X  C-A z        Suspend the whole screen.
  1416. X
  1417. X  C-A x        Execute /usr/bin/lock or $LOCKCMD or a builtin terminallock.
  1418. X
  1419. X  C-A C-[    Start copy&paste mode. Move cursor with h,j,k,l. Set 2 marks
  1420. X        with SPACE or y. Abort with ESC. Note that "C-[" is ESC.
  1421. X        NOTE: there is a userdefined amount of scrollback history.
  1422. X                The history buffer is entered, when the cursor hits the top
  1423. X        of the window.
  1424. X
  1425. X  C-A C-]    paste in current window's stdin. see C-A C-[.
  1426. X
  1427. X  C-A <
  1428. X  C-A >        Read or write the copybuffer from/to the exchange file.
  1429. X        Multiple screen users on the same host may thus transfer text.
  1430. X
  1431. X  C-A d        Detach screen. All processes continue and may spool output
  1432. X        to their pty's, but screen disconnects from your terminal.
  1433. X        reattach with "screen -r".
  1434. X
  1435. X  C-A D D    Power detach. Disconnect like C-A d and kill the parent shell.
  1436. X
  1437. X  C-A K        Kill a window and send SIGHUP to its processgroup. Per default
  1438. X        this would be C-A C-k. But it is redefined in the demo .screenrc
  1439. X        (think of killing a whole line in emacs).
  1440. X
  1441. X  C-A :set all  Show all keybindings. The above list is not at all complete and
  1442. X        may even be wrong, as keys can be redefined in .screenrc or
  1443. X        with "C-A :bind 'X' keyname [arguments]".
  1444. X
  1445. X  C-A : ....  Online configuration change.
  1446. X
  1447. X
  1448. Xscreen -r [host.tty]
  1449. X  Reattach a detached screen session. The terminal emulator reconfigures
  1450. X  according to your $TERMCAP or $TERM settings. '-R' brings up a detached
  1451. X  session or (if none) creates a new session. You should specify a socket
  1452. X  when there you have multiple screens detached. 
  1453. X
  1454. Xscreen -d [host.tty]
  1455. X  Detach a screen session from remote. Has the same effect as typing 'C-A d'
  1456. X  on the controlling terminal. '-D' will power-detach.
  1457. X
  1458. Xscreen -list
  1459. Xscreen -ls
  1460. X  Show all available sockets. If there are (DEAD???) sockets, you may consider 
  1461. X  removing them. If there are sockets missing, you may send a SIGCHLD to its
  1462. X  process 'SCREEN' and the process will re-establish the socket. (think of 
  1463. X  someone cleaning /tmp thoroughly).
  1464. X
  1465. Xscreen -h 200
  1466. X  Starts a new screen session and sets the number of lines in the scrollback
  1467. X  buffer to 200. The default is 50 lines.
  1468. END_OF_FILE
  1469. if test 3036 -ne `wc -c <'doc/readme.quick'`; then
  1470.     echo shar: \"'doc/readme.quick'\" unpacked with wrong size!
  1471. fi
  1472. # end of 'doc/readme.quick'
  1473. fi
  1474. if test -f 'etcscreenrc' -a "${1}" != "-c" ; then 
  1475.   echo shar: Will not clobber existing file \"'etcscreenrc'\"
  1476. else
  1477. echo shar: Extracting \"'etcscreenrc'\" \(4365 characters\)
  1478. sed "s/^X//" >'etcscreenrc' <<'END_OF_FILE'
  1479. X#3.3
  1480. X# This is a global screenrc file
  1481. X# Install this file as /usr/local/etc/screenrc. See config.h
  1482. X#
  1483. X# Flaws of termcap and standard settings are done here.
  1484. X# Note: This file should not be shared between different hosts.
  1485. X#       The 'termcap' lines are written in termcap syntax.
  1486. X#       The syntax for a terminfo based host is slightly different.
  1487. X#
  1488. X#echo "-----------------------------------------------------------------------"
  1489. X#echo ""
  1490. X#echo "     This is iScreen version 3.2.13  -- Enjoy :-)"
  1491. X#echo ""
  1492. X#echo "     Coredumps zu mir, Beschwerden nach /dev/null! "
  1493. X#echo "     Vorbeugend bitte schon mal alle screenrc files"
  1494. X#echo "     genau einmal mit ~jnweiger/trojan_horse/newsyntax bearbeiten!"
  1495. X#echo "     -- und in hartnaeckigen Faellen screen.old verwenden"
  1496. X#echo ""
  1497. X#echo "            Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)"
  1498. X#echo "-----------------------------------------------------------------------"
  1499. X#echo "       >>>>>>>>>>>> Press RETURN to continue <<<<<<<<<<<<"
  1500. X#sleep 5
  1501. X#startup_message off
  1502. X
  1503. X#defflow on # will force iScreen to process ^S/^Q
  1504. X
  1505. Xdeflogin on
  1506. X#autodetach off
  1507. X
  1508. X# 'vbell on' without the prepended 'set' keyword will change the default for 
  1509. X# subsequently opened windows. With the 'set' keyword we would change
  1510. X# the setting of the currently active window.
  1511. Xvbell on
  1512. Xvbell_msg "   Wuff  ----  Wuff!!  "
  1513. X
  1514. X# all termcap entries are now duplicated as terminfo entries.
  1515. X# only difference should be the slightly modified syntax, and check for
  1516. X# terminfo entries, that are already corected in the database.
  1517. X# 
  1518. X# G0     we have a SEMI-GRAPHICS-CHARACTER-MODE
  1519. X# WS    this sequence resizes our window.
  1520. X# cs    this sequence changes the scrollregion
  1521. X# hs@    we have no hardware statusline. iScreen will only believe that
  1522. X#       there is a hardware status line if hs,ts,fs,ds are all set.
  1523. X# ts    to statusline
  1524. X# fs    from statusline
  1525. X# ds    delete statusline
  1526. X# al    add one line
  1527. X# AL    add multiple lines
  1528. X# dl    delete one line
  1529. X# DL    delete multiple lines
  1530. X# ic    insert one char (space)
  1531. X# IC    insert multiple chars
  1532. X# xo    terminal uses xon/xoff
  1533. X
  1534. Xtermcap  facit|vt100|xterm LP:G0
  1535. Xterminfo facit|vt100|xterm LP:G0
  1536. X
  1537. X#the vt100 description does not mention "dl". *sigh*
  1538. Xtermcap  vt100 dl=5\E[M
  1539. Xterminfo vt100 dl=5\E[M
  1540. X
  1541. X#facit's "al" / "dl"  are buggy if the current / last line
  1542. X#contain attributes...
  1543. Xtermcap  facit al=\E[L\E[K:AL@:dl@:DL@:cs=\E[%i%d;%dr:ic@
  1544. Xterminfo facit al=\E[L\E[K:AL@:dl@:DL@:cs=\E[%i%p1%d;%p2%dr:ic@
  1545. X
  1546. X#make sun termcap/info better
  1547. Xtermcap  sun 'up=^K:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:IC=\E[%d@:WS=1000\E[8;%d;%dt'
  1548. Xterminfo sun 'up=^K:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC:IC=\E[%p1%d@:WS=\E[8;%p1%d;%p2%dt$<1000>'
  1549. X
  1550. X#xterm understands both im/ic and doesn't have a status line.
  1551. X#Note: Do not specify im and ic in the real termcap/info file as
  1552. X#some programs (e.g. vi) will not work anymore.
  1553. Xtermcap  xterm|fptwist hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
  1554. Xterminfo xterm|fptwist hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
  1555. X
  1556. X# xs is xterm's two letter name.
  1557. X# story ... in earlier versions I used xterms here ... buggy sequent termcap
  1558. X# routines allowes 32 :tc=...: references per lifetime.... gave lots of OOPS
  1559. X# at the 32. reattach. ... to avoid that, I added the name Xterm as an alias 
  1560. X# to xterm in our termcap file.
  1561. X# why I don't take the entry called xterm? well, I own a verion of xterm that
  1562. X# allows window resizing. My private .iscreenrc adds WS to this entry.
  1563. X
  1564. Xtermcap  xs 'hs:ts=\E]0;:fs=\007:ds=\E]0;iScreen\007:cs=\E[%i%d;%dr:LP:G0:im=\E[4h:ei=\E[4l'
  1565. Xterminfo xs 'hs:ts=\E]0;:fs=\007:ds=\E]0;iScreen\007:cs=\E[%i%p1%d;%p2%dr:LP:G0:im=\E[4h:ei=\E[4l'
  1566. X
  1567. X#make hp700 termcap/info better
  1568. Xtermcap  hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
  1569. Xterminfo hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
  1570. X
  1571. X#wyse-75-42 must have defflow control (xo = "terminal uses xon/xoff")
  1572. X#essential to have it here, as this is a slow terminal.
  1573. Xtermcap wy75-42 xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
  1574. Xterminfo wy75-42 xo:Z0=\E[?3h\E[31h:Z1=\E[?3l\E[31h
  1575. X
  1576. X#remove some stupid / dangerous key bindings
  1577. Xbind '-' prev
  1578. Xbind '^k'
  1579. X#bind 'L'
  1580. Xbind '^\'
  1581. X#make them better
  1582. Xbind '\\' quit
  1583. Xbind 'K' kill
  1584. Xbind 'I' login on
  1585. Xbind 'O' login off
  1586. Xbind '}' history
  1587. END_OF_FILE
  1588. if test 4365 -ne `wc -c <'etcscreenrc'`; then
  1589.     echo shar: \"'etcscreenrc'\" unpacked with wrong size!
  1590. fi
  1591. # end of 'etcscreenrc'
  1592. fi
  1593. if test -f 'input.c' -a "${1}" != "-c" ; then 
  1594.   echo shar: Will not clobber existing file \"'input.c'\"
  1595. else
  1596. echo shar: Extracting \"'input.c'\" \(6219 characters\)
  1597. sed "s/^X//" >'input.c' <<'END_OF_FILE'
  1598. X/* Copyright (c) 1993
  1599. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  1600. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  1601. X * Copyright (c) 1987 Oliver Laumann
  1602. X *
  1603. X * This program is free software; you can redistribute it and/or modify
  1604. X * it under the terms of the GNU General Public License as published by
  1605. X * the Free Software Foundation; either version 2, or (at your option)
  1606. X * any later version.
  1607. X *
  1608. X * This program is distributed in the hope that it will be useful,
  1609. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1610. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1611. X * GNU General Public License for more details.
  1612. X *
  1613. X * You should have received a copy of the GNU General Public License
  1614. X * along with this program (see the file COPYING); if not, write to the
  1615. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1616. X *
  1617. X ****************************************************************
  1618. X */
  1619. X
  1620. X#include "rcs.h"
  1621. XRCS_ID("$Id: input.c,v 1.1.1.1 1993/06/16 23:51:12 jnweiger Exp $ FAU")
  1622. X
  1623. X#include <sys/types.h>
  1624. X#include "config.h"
  1625. X#include "screen.h"
  1626. X#include "extern.h"
  1627. X
  1628. Xstatic void InpProcess __P((char **, int *));
  1629. Xstatic void InpAbort __P((void));
  1630. Xstatic void InpRedisplayLine __P((int, int, int, int));
  1631. Xstatic void InpSetCursor __P((void));
  1632. X
  1633. Xextern struct display *display;
  1634. X
  1635. Xstruct inpdata
  1636. X{
  1637. X  char    inpbuf[101];
  1638. X  int    inplen;
  1639. X  int    inpmaxlen;
  1640. X  char    *inpstring;
  1641. X  int    inpstringlen;
  1642. X  int    inpmode;
  1643. X  void    (*inpfinfunc)();
  1644. X};
  1645. X
  1646. Xstatic struct LayFuncs InpLf =
  1647. X{
  1648. X  InpProcess,
  1649. X  InpAbort,
  1650. X  InpRedisplayLine,
  1651. X  DefClearLine,
  1652. X  DefRewrite,
  1653. X  InpSetCursor,
  1654. X  DefResize,
  1655. X  DefRestore
  1656. X};
  1657. X
  1658. X/*
  1659. X**   Here is the input routine
  1660. X*/
  1661. X
  1662. Xvoid
  1663. Xinp_setprompt(p, s)
  1664. Xchar *p, *s;
  1665. X{
  1666. X  struct inpdata *inpdata;
  1667. X  
  1668. X  inpdata = (struct inpdata *)d_lay->l_data;
  1669. X  if (p)
  1670. X    {
  1671. X      inpdata->inpstringlen = strlen(p);
  1672. X      inpdata->inpstring = p;
  1673. X    }
  1674. X  if (s)
  1675. X    {
  1676. X      strncpy(inpdata->inpbuf, s, sizeof(inpdata->inpbuf) - 1);
  1677. X      inpdata->inpbuf[sizeof(inpdata->inpbuf) - 1] = 0;
  1678. X      inpdata->inplen = strlen(inpdata->inpbuf);
  1679. X    }
  1680. X  RefreshLine(STATLINE, 0, d_width - 1, 0);
  1681. X}
  1682. X
  1683. X/*
  1684. X * We dont use HS status line with Input().
  1685. X * If we would use it, then we should check e_tgetflag("es") if
  1686. X * we are allowed to use esc sequences there.
  1687. X *
  1688. X * mode is an OR of
  1689. X * INP_NOECHO == suppress echoing of characters.
  1690. X * INP_RAW    == raw mode. call finfunc after each character typed.
  1691. X */
  1692. Xvoid
  1693. XInput(istr, len, finfunc, mode)
  1694. Xchar *istr;
  1695. Xint len;
  1696. Xvoid (*finfunc)();
  1697. Xint mode;
  1698. X{
  1699. X  int maxlen;
  1700. X  struct inpdata *inpdata;
  1701. X  
  1702. X  if (len > 100)
  1703. X    len = 100;
  1704. X  if (!(mode & INP_NOECHO))
  1705. X    {
  1706. X      maxlen = d_width - strlen(istr);
  1707. X      if (!CLP && STATLINE == d_bot)
  1708. X    maxlen--;
  1709. X      if (len > maxlen)
  1710. X    len = maxlen;
  1711. X    }
  1712. X  if (len < 0)
  1713. X    {
  1714. X      Msg(0, "Width %d chars too small", -len);
  1715. X      return;
  1716. X    }
  1717. X  if (InitOverlayPage(sizeof(*inpdata), &InpLf, 1))
  1718. X    return;
  1719. X  inpdata = (struct inpdata *)d_lay->l_data;
  1720. X  inpdata->inpmaxlen = len;
  1721. X  inpdata->inpfinfunc = finfunc;
  1722. X  inpdata->inplen = 0;
  1723. X  inpdata->inpmode = mode;
  1724. X  inp_setprompt(istr, (char *)NULL);
  1725. X}
  1726. X
  1727. Xstatic void
  1728. XInpSetCursor()
  1729. X{
  1730. X  struct inpdata *inpdata;
  1731. X  
  1732. X  inpdata = (struct inpdata *)d_lay->l_data;
  1733. X  GotoPos(inpdata->inpstringlen + (inpdata->inpmode & INP_NOECHO ? 0 : inpdata->inplen), STATLINE);
  1734. X}
  1735. X
  1736. Xstatic void
  1737. XInpProcess(ppbuf, plen)
  1738. Xchar **ppbuf;
  1739. Xint *plen;
  1740. X{
  1741. X  int len, x;
  1742. X  char *pbuf;
  1743. X  char ch;
  1744. X  struct inpdata *inpdata;
  1745. X  
  1746. X  inpdata = (struct inpdata *)d_lay->l_data;
  1747. X
  1748. X  GotoPos(inpdata->inpstringlen + (inpdata->inpmode & INP_NOECHO ? 0 : inpdata->inplen), STATLINE);
  1749. X  if (ppbuf == 0)
  1750. X    {
  1751. X      InpAbort();
  1752. X      return;
  1753. X    }
  1754. X  x = inpdata->inpstringlen + inpdata->inplen;
  1755. X  len = *plen;
  1756. X  pbuf = *ppbuf;
  1757. X  while (len)
  1758. X    {
  1759. X      ch = *pbuf++;
  1760. X      len--;
  1761. X      if (inpdata->inpmode & INP_RAW)
  1762. X    {
  1763. X          (*inpdata->inpfinfunc)(&ch, 1);    /* raw */
  1764. X      if (ch)
  1765. X        continue;
  1766. X    }
  1767. X      if ((unsigned char)ch >= ' ' && ch != 0177 && inpdata->inplen < inpdata->inpmaxlen)
  1768. X    {
  1769. X      inpdata->inpbuf[inpdata->inplen++] = ch;
  1770. X      if (!(inpdata->inpmode & INP_NOECHO))
  1771. X        {
  1772. X          GotoPos(x, STATLINE);
  1773. X          SetAttrFont(A_SO, ASCII);
  1774. X          PUTCHAR(ch);
  1775. X          x++;
  1776. X        }
  1777. X    }
  1778. X      else if ((ch == '\b' || ch == 0177) && inpdata->inplen > 0)
  1779. X    {
  1780. X      inpdata->inplen--;
  1781. X      if (!(inpdata->inpmode & 1))
  1782. X        {
  1783. X          x--;
  1784. X          GotoPos(x, STATLINE);
  1785. X          SetAttrFont(0, ASCII);
  1786. X          PUTCHAR(' ');
  1787. X          GotoPos(x, STATLINE);
  1788. X        }
  1789. X    }
  1790. X      else if (ch == '\004' || ch == '\003' || ch == '\007' || ch == '\033' ||
  1791. X           ch == '\000' || ch == '\n' || ch == '\r')
  1792. X    {
  1793. X          if (ch != '\033' && ch != '\n' && ch != '\r')
  1794. X        inpdata->inplen = 0;
  1795. X      inpdata->inpbuf[inpdata->inplen] = 0;
  1796. X      
  1797. X        d_lay->l_data = 0;
  1798. X          InpAbort(); /* redisplays... */
  1799. X      *ppbuf = pbuf;
  1800. X      *plen = len;
  1801. X          if ((inpdata->inpmode & INP_RAW) == 0)
  1802. X            (*inpdata->inpfinfunc)(inpdata->inpbuf, inpdata->inplen);
  1803. X      else
  1804. X            (*inpdata->inpfinfunc)(pbuf - 1, 0);
  1805. X      free(inpdata);
  1806. X      return;
  1807. X    }
  1808. X    }
  1809. X  *ppbuf = pbuf;
  1810. X  *plen = len;
  1811. X}
  1812. X
  1813. Xstatic void
  1814. XInpAbort()
  1815. X{
  1816. X  LAY_CALL_UP(RefreshLine(STATLINE, 0, d_width - 1, 0));
  1817. X  ExitOverlayPage();
  1818. X}
  1819. X
  1820. Xstatic void
  1821. XInpRedisplayLine(y, xs, xe, isblank)
  1822. Xint y, xs, xe, isblank;
  1823. X{
  1824. X  int q, r, s, l, v;
  1825. X  struct inpdata *inpdata;
  1826. X  
  1827. X  inpdata = (struct inpdata *)d_lay->l_data;
  1828. X
  1829. X  if (y != STATLINE)
  1830. X    {
  1831. X      LAY_CALL_UP(RefreshLine(y, xs, xe, isblank));
  1832. X      return;
  1833. X    }
  1834. X  inpdata->inpbuf[inpdata->inplen] = 0;
  1835. X  GotoPos(xs, y);
  1836. X  q = xs;
  1837. X  v = xe - xs + 1;
  1838. X  s = 0;
  1839. X  r = inpdata->inpstringlen;
  1840. X  if (v > 0 && q < r)
  1841. X    {
  1842. X      SetAttrFont(A_SO, ASCII);
  1843. X      l = v;
  1844. X      if (l > r-q)
  1845. X    l = r-q;
  1846. X      AddStrn(inpdata->inpstring + q - s, l);
  1847. X      q += l;
  1848. X      v -= l;
  1849. X    }
  1850. X  s = r;
  1851. X  r += inpdata->inplen;
  1852. X  if (!(inpdata->inpmode & INP_NOECHO) && v > 0 && q < r)
  1853. X    {
  1854. X      SetAttrFont(A_SO, ASCII);
  1855. X      l = v;
  1856. X      if (l > r-q)
  1857. X    l = r-q;
  1858. X      AddStrn(inpdata->inpbuf + q - s, l);
  1859. X      q += l;
  1860. X      v -= l;
  1861. X    }
  1862. X  s = r;
  1863. X  r = d_width;
  1864. X  if (!isblank && v > 0 && q < r)
  1865. X    {
  1866. X      SetAttrFont(0, ASCII);
  1867. X      l = v;
  1868. X      if (l > r-q)
  1869. X    l = r-q;
  1870. X      AddStrn("", l);
  1871. X      q += l;
  1872. X    }
  1873. X  SetLastPos(q, y);
  1874. X}
  1875. END_OF_FILE
  1876. if test 6219 -ne `wc -c <'input.c'`; then
  1877.     echo shar: \"'input.c'\" unpacked with wrong size!
  1878. fi
  1879. # end of 'input.c'
  1880. fi
  1881. if test -f 'loadav.c' -a "${1}" != "-c" ; then 
  1882.   echo shar: Will not clobber existing file \"'loadav.c'\"
  1883. else
  1884. echo shar: Extracting \"'loadav.c'\" \(4640 characters\)
  1885. sed "s/^X//" >'loadav.c' <<'END_OF_FILE'
  1886. X/* Copyright (c) 1993
  1887. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  1888. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  1889. X * Copyright (c) 1987 Oliver Laumann
  1890. X *
  1891. X * This program is free software; you can redistribute it and/or modify
  1892. X * it under the terms of the GNU General Public License as published by
  1893. X * the Free Software Foundation; either version 2, or (at your option)
  1894. X * any later version.
  1895. X *
  1896. X * This program is distributed in the hope that it will be useful,
  1897. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1898. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1899. X * GNU General Public License for more details.
  1900. X *
  1901. X * You should have received a copy of the GNU General Public License
  1902. X * along with this program (see the file COPYING); if not, write to the
  1903. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1904. X *
  1905. X ****************************************************************
  1906. X */
  1907. X
  1908. X#include "rcs.h"
  1909. XRCS_ID("$Id: loadav.c,v 1.1.1.1 1993/06/16 23:51:13 jnweiger Exp $ FAU")
  1910. X
  1911. X#include <sys/types.h>
  1912. X#include <fcntl.h>
  1913. X
  1914. X#include "config.h"
  1915. X#include "screen.h"
  1916. X
  1917. X#include "extern.h"
  1918. X
  1919. X#ifdef LOADAV
  1920. X
  1921. Xstatic int GetLoadav __P((void));
  1922. X
  1923. Xstatic LOADAV_TYPE loadav[LOADAV_NUM];
  1924. Xstatic int loadok;
  1925. X
  1926. X
  1927. X
  1928. X/***************************************************************/
  1929. X
  1930. X#if defined(linux) && !defined(LOADAV_DONE)
  1931. X#define LOADAV_DONE
  1932. X/*
  1933. X * This is the easy way. It relies in /proc being mounted.
  1934. X * For the big and ugly way refer to previous screen version.
  1935. X */
  1936. Xvoid
  1937. XInitLoadav()
  1938. X{
  1939. X  loadok = 1;
  1940. X}
  1941. X
  1942. Xstatic int
  1943. XGetLoadav()
  1944. X{
  1945. X  FILE *fp;
  1946. X  double d[3];
  1947. X  int i;
  1948. X
  1949. X  if ((fp = secfopen("/proc/loadavg", "r")) == NULL)
  1950. X    return 0;
  1951. X  fscanf(fp, "%lf %lf %lf\n", d, d+1, d+2);
  1952. X  fclose(fp);
  1953. X  for (i = 0; i < LOADAV_NUM; i++)
  1954. X    loadav[i] = d[i];
  1955. X  return LOADAV_NUM;
  1956. X}
  1957. X#endif /* linux */
  1958. X
  1959. X/***************************************************************/
  1960. X
  1961. X#if defined(LOADAV_GETLOADAVG) && !defined(LOADAV_DONE)
  1962. X#define LOADAV_DONE
  1963. Xvoid
  1964. XInitLoadav()
  1965. X{
  1966. X  loadok = 1;
  1967. X}
  1968. X
  1969. Xstatic int
  1970. XGetLoadav()
  1971. X{
  1972. X  return getloadavg(loadav, LOADAV_NUM);
  1973. X}
  1974. X#endif
  1975. X
  1976. X/***************************************************************/
  1977. X
  1978. X#if defined(apollo) && !defined(LOADAV_DONE)
  1979. X#define LOADAV_DONE
  1980. Xvoid
  1981. XInitLoadav()
  1982. X{
  1983. X  loadok = 1;
  1984. X}
  1985. X
  1986. Xstatic int
  1987. XGetLoadav()
  1988. X{
  1989. X  proc1_$get_loadav(loadav);
  1990. X  return LOADAV_NUM;
  1991. X}
  1992. X#endif
  1993. X
  1994. X/***************************************************************/
  1995. X
  1996. X#if defined(NeXT) && !defined(LOADAV_DONE)
  1997. X#define LOADAV_DONE
  1998. X
  1999. X#include <mach.h>
  2000. X
  2001. Xstatic processor_set_t default_set;
  2002. X
  2003. Xvoid
  2004. XInitLoadav()
  2005. X{
  2006. X  kern_return_t error;
  2007. X
  2008. X  error = processor_set_default(host_self(), &default_set);
  2009. X  if (error != KERN_SUCCESS)
  2010. X    mach_error("Error calling processor_set_default", error);
  2011. X  else
  2012. X    loadok = 1;
  2013. X}
  2014. X
  2015. Xstatic int
  2016. XGetLoadav()
  2017. X{
  2018. X  unsigned int info_count;
  2019. X  struct processor_set_basic_info info;
  2020. X  host_t host;
  2021. X
  2022. X  info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
  2023. X  if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO, &host, (processor_set_info_t)&info, &info_count) != KERN_SUCCESS)
  2024. X    return 0;
  2025. X  loadav[0] = (float)info.load_average / LOAD_SCALE;
  2026. X  return 1;
  2027. X}
  2028. X#endif
  2029. X
  2030. X/***************************************************************/
  2031. X
  2032. X#if !defined(LOADAV_DONE)
  2033. X/*
  2034. X * The old fashion way: open kernel and read avenrun
  2035. X *
  2036. X * Header File includes
  2037. X */
  2038. X
  2039. X# ifdef NLIST_STRUCT
  2040. X#  include <nlist.h>
  2041. X# else
  2042. X#  include <a.out.h>
  2043. X# endif
  2044. X# ifndef NLIST_DECLARED
  2045. Xextern int nlist __P((char *, struct nlist *));
  2046. X# endif
  2047. X
  2048. Xstatic struct nlist nl[2];
  2049. Xstatic int kmemf;
  2050. X
  2051. Xvoid
  2052. XInitLoadav()
  2053. X{
  2054. X  debug("Init Kmem...\n");
  2055. X  kmemf = open("/dev/kmem", O_RDONLY);
  2056. X  if (kmemf == -1)
  2057. X    return;
  2058. X  debug("Kmem opened\n");
  2059. X# ifdef NLIST_NAME_UNION
  2060. X  nl[0].n_un.n_name = LOADAV_AVENRUN;
  2061. X# else
  2062. X  nl[0].n_name = LOADAV_AVENRUN;
  2063. X# endif
  2064. X  debug2("Searching in %s for %s\n", LOADAV_UNIX, nl[0].n_name);
  2065. X  nlist(LOADAV_UNIX, nl);
  2066. X  if (nl[0].n_value == 0)
  2067. X    {
  2068. X      close(kmemf);
  2069. X      return;
  2070. X    }
  2071. X# ifdef sgi
  2072. X  nl[0].n_value &= ~(1 << 31);    /* clear upper bit */
  2073. X# endif /* sgi */
  2074. X  debug1("AvenrunSym found (0x%lx)!!\n", nl[0].n_value);
  2075. X  loadok = 1;
  2076. X}
  2077. X
  2078. Xstatic int
  2079. XGetLoadav()
  2080. X{
  2081. X  if (lseek(kmemf, (off_t) nl[0].n_value, 0) == (off_t) - 1)
  2082. X    return 0;
  2083. X  if (read(kmemf, (char *) loadav, sizeof(loadav)) != sizeof(loadav))
  2084. X    return 0;
  2085. X  return LOADAV_NUM;
  2086. X}
  2087. X#endif
  2088. X
  2089. X/***************************************************************/
  2090. X
  2091. X
  2092. Xvoid
  2093. XAddLoadav(p)
  2094. Xchar *p;
  2095. X{
  2096. X  int i, j;
  2097. X  if (loadok == 0)
  2098. X    return;
  2099. X  j = GetLoadav();
  2100. X  for (i = 0; i < j; i++)
  2101. X    {
  2102. X      sprintf(p, " %2.2f", (double)loadav[i] / LOADAV_SCALE);
  2103. X      p += strlen(p);
  2104. X    }
  2105. X}
  2106. X
  2107. X#endif /* LOADAV */
  2108. END_OF_FILE
  2109. if test 4640 -ne `wc -c <'loadav.c'`; then
  2110.     echo shar: \"'loadav.c'\" unpacked with wrong size!
  2111. fi
  2112. # end of 'loadav.c'
  2113. fi
  2114. if test -f 'mark.h' -a "${1}" != "-c" ; then 
  2115.   echo shar: Will not clobber existing file \"'mark.h'\"
  2116. else
  2117. echo shar: Extracting \"'mark.h'\" \(1876 characters\)
  2118. sed "s/^X//" >'mark.h' <<'END_OF_FILE'
  2119. X/* Copyright (c) 1993
  2120. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  2121. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  2122. X * Copyright (c) 1987 Oliver Laumann
  2123. X *
  2124. X * This program is free software; you can redistribute it and/or modify
  2125. X * it under the terms of the GNU General Public License as published by
  2126. X * the Free Software Foundation; either version 2, or (at your option)
  2127. X * any later version.
  2128. X *
  2129. X * This program is distributed in the hope that it will be useful,
  2130. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2131. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2132. X * GNU General Public License for more details.
  2133. X *
  2134. X * You should have received a copy of the GNU General Public License
  2135. X * along with this program (see the file COPYING); if not, write to the
  2136. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2137. X *
  2138. X ****************************************************************
  2139. X * $Id: mark.h,v 1.1.1.1 1993/06/16 23:51:13 jnweiger Exp $ FAU
  2140. X */
  2141. X
  2142. Xstruct markdata
  2143. X{
  2144. X  int    cx, cy;        /* cursor Position in WIN coords*/
  2145. X  int    x1, y1;        /* first mark in WIN coords */
  2146. X  int    second;        /* first mark dropped flag */
  2147. X  int    left_mar, right_mar, nonl;
  2148. X  int    rep_cnt;    /* number of repeats */
  2149. X  int    append_mode;    /* shall we overwrite or append to copybuffer */
  2150. X  int    write_buffer;    /* shall we do a KEY_WRITE_EXCHANGE right away? */
  2151. X  int    hist_offset;    /* how many lines are on top of the screen */
  2152. X  char    isstr[100];    /* string we are searching for */
  2153. X  int    isstrl;
  2154. X  char    isistr[200];    /* string of chars user has typed */
  2155. X  int    isistrl;
  2156. X  int    isdir;        /* current search direction */
  2157. X  int    isstartpos;    /* position where isearch was started */
  2158. X  int    isstartdir;    /* direction when isearch was started */
  2159. X};
  2160. X
  2161. X
  2162. X#define W2D(y) ((y) - markdata->hist_offset)
  2163. X#define D2W(y) ((y) + markdata->hist_offset)
  2164. X
  2165. END_OF_FILE
  2166. if test 1876 -ne `wc -c <'mark.h'`; then
  2167.     echo shar: \"'mark.h'\" unpacked with wrong size!
  2168. fi
  2169. # end of 'mark.h'
  2170. fi
  2171. if test -f 'misc.c' -a "${1}" != "-c" ; then 
  2172.   echo shar: Will not clobber existing file \"'misc.c'\"
  2173. else
  2174. echo shar: Extracting \"'misc.c'\" \(5041 characters\)
  2175. sed "s/^X//" >'misc.c' <<'END_OF_FILE'
  2176. X/* Copyright (c) 1993
  2177. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  2178. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  2179. X * Copyright (c) 1987 Oliver Laumann
  2180. X *
  2181. X * This program is free software; you can redistribute it and/or modify
  2182. X * it under the terms of the GNU General Public License as published by
  2183. X * the Free Software Foundation; either version 2, or (at your option)
  2184. X * any later version.
  2185. X *
  2186. X * This program is distributed in the hope that it will be useful,
  2187. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2188. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2189. X * GNU General Public License for more details.
  2190. X *
  2191. X * You should have received a copy of the GNU General Public License
  2192. X * along with this program (see the file COPYING); if not, write to the
  2193. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2194. X *
  2195. X ****************************************************************
  2196. X */
  2197. X
  2198. X#include "rcs.h"
  2199. XRCS_ID("$Id: misc.c,v 1.3 1993/07/21 15:43:14 mlschroe Exp $ FAU")
  2200. X
  2201. X#include <sys/types.h>
  2202. X#include <signal.h>
  2203. X
  2204. X#include "config.h"
  2205. X#include "screen.h"
  2206. X#include "extern.h"
  2207. X
  2208. X#ifdef SVR4
  2209. X# include <sys/resource.h>
  2210. X#endif
  2211. X
  2212. Xextern char *blank;
  2213. Xextern struct display *display;
  2214. Xextern int eff_uid, real_uid;
  2215. Xextern int eff_gid, real_gid;
  2216. X
  2217. Xchar *
  2218. XSaveStr(str)
  2219. Xregister const char *str;
  2220. X{
  2221. X  register char *cp;
  2222. X
  2223. X  if ((cp = malloc(strlen(str) + 1)) == NULL)
  2224. X    Panic(0, strnomem);
  2225. X  else
  2226. X    strcpy(cp, str);
  2227. X  return cp;
  2228. X}
  2229. X
  2230. Xvoid
  2231. Xcenterline(str)
  2232. Xchar *str;
  2233. X{
  2234. X  int l, n;
  2235. X
  2236. X  n = strlen(str);
  2237. X  if (n > d_width - 1)
  2238. X    n = d_width - 1;
  2239. X  l = (d_width - 1 - n) / 2;
  2240. X  if (l > 0)
  2241. X    AddStrn("", l);
  2242. X  AddStrn(str, n);
  2243. X  AddStr("\r\n");
  2244. X}
  2245. X
  2246. Xchar *
  2247. XFilename(s)
  2248. Xchar *s;
  2249. X{
  2250. X  register char *p = s;
  2251. X
  2252. X  if (p)
  2253. X    while (*p)
  2254. X      if (*p++ == '/')
  2255. X        s = p;
  2256. X  return s;
  2257. X}
  2258. X
  2259. Xchar *
  2260. Xstripdev(nam)
  2261. Xchar *nam;
  2262. X{
  2263. X#ifdef apollo
  2264. X  char *p;
  2265. X  
  2266. X  if (nam == NULL)
  2267. X    return NULL;
  2268. X  if (p = strstr(nam,"/dev/"))
  2269. X    return p + 5;
  2270. X#else /* apollo */
  2271. X  if (nam == NULL)
  2272. X    return NULL;
  2273. X  if (strncmp(nam, "/dev/", 5) == 0)
  2274. X    return nam + 5;
  2275. X#endif /* apollo */
  2276. X  return nam;
  2277. X}
  2278. X
  2279. X#ifdef hpux
  2280. X/*
  2281. X * hpux has berkeley signal semantics if we use sigvector,
  2282. X * but not, if we use signal, so we define our own signal() routine.
  2283. X * (jw)
  2284. X */
  2285. Xvoid (*signal(sig, func)) ()
  2286. Xint sig;
  2287. Xvoid (*func) ();
  2288. X{
  2289. X  struct sigvec osv, sv;
  2290. X
  2291. X  sv.sv_handler = func;
  2292. X  sv.sv_mask = sigmask(sig);
  2293. X  sv.sv_flags = SV_BSDSIG;
  2294. X  if (sigvector(sig, &sv, &osv) < 0)
  2295. X    return (BADSIG);
  2296. X  return (osv.sv_handler);
  2297. X}
  2298. X#endif    /* hpux */
  2299. X
  2300. X#ifdef NEED_OWN_BCOPY
  2301. Xvoid
  2302. X#ifdef linux
  2303. Xbcopy(ss1, ss2, len)
  2304. Xregister const void *ss1;
  2305. Xregister void *ss2;
  2306. X#else
  2307. Xbcopy(s1, s2, len)
  2308. Xregister char *s1, *s2;
  2309. X#endif
  2310. X
  2311. Xregister int len;
  2312. X{
  2313. X#ifdef linux
  2314. X  register char *s1 = (char *)ss1;
  2315. X  register char *s2 = (char *)ss2;
  2316. X#endif
  2317. X  if (s1 < s2 && s2 < s1 + len)
  2318. X    {
  2319. X      s1 += len;
  2320. X      s2 += len;
  2321. X      while (len-- > 0)
  2322. X    *--s2 = *--s1;
  2323. X    }
  2324. X  else
  2325. X    while (len-- > 0)
  2326. X      *s2++ = *s1++;
  2327. X}
  2328. X#endif    /* NEED_OWN_BCOPY */
  2329. X
  2330. Xvoid
  2331. Xbclear(p, n)
  2332. Xchar *p;
  2333. Xint n;
  2334. X{
  2335. X  bcopy(blank, p, n);
  2336. X}
  2337. X
  2338. Xvoid
  2339. XKill(pid, sig)
  2340. Xint pid, sig;
  2341. X{
  2342. X  if (pid < 2)
  2343. X    return;
  2344. X  (void) kill(pid, sig);
  2345. X}
  2346. X
  2347. Xvoid
  2348. Xcloseallfiles(except)
  2349. Xint except;
  2350. X{
  2351. X  int f;
  2352. X#ifdef SVR4
  2353. X  int getrlimit __P((int, struct rlimit *));
  2354. X  struct rlimit rl;
  2355. X  
  2356. X  if ((getrlimit(RLIMIT_NOFILE, &rl) == 0) && rl.rlim_max != RLIM_INFINITY)
  2357. X    f = rl.rlim_max;
  2358. X  else
  2359. X#endif /* SVR4 */
  2360. X#if defined(SYSV) && !defined(ISC)
  2361. X  f = NOFILE;
  2362. X#else /* SYSV && !ISC */
  2363. X  f = getdtablesize();
  2364. X#endif /* SYSV && !ISC */
  2365. X  while (--f > 2)
  2366. X    if (f != except)
  2367. X      close(f);
  2368. X}
  2369. X
  2370. X
  2371. X#ifdef NOREUID
  2372. Xstatic int UserPID;
  2373. Xstatic sig_t (*Usersigcld)__P(SIGPROTOARG);
  2374. X#endif
  2375. Xstatic int UserSTAT;
  2376. X
  2377. Xint
  2378. XUserContext()
  2379. X{
  2380. X#ifdef NOREUID
  2381. X  if (eff_uid == real_uid)
  2382. X    return(1);
  2383. X  Usersigcld = signal(SIGCHLD, SIG_DFL);
  2384. X  debug("UserContext: forking.\n");
  2385. X  switch (UserPID = fork())
  2386. X    {
  2387. X    case -1:
  2388. X      Msg(errno, "fork");
  2389. X      return -1;
  2390. X    case 0:
  2391. X      signal(SIGHUP, SIG_DFL);
  2392. X      signal(SIGINT, SIG_IGN);
  2393. X      signal(SIGQUIT, SIG_DFL);
  2394. X      signal(SIGTERM, SIG_DFL);
  2395. X# ifdef BSDJOBS
  2396. X      signal(SIGTTIN, SIG_DFL);
  2397. X      signal(SIGTTOU, SIG_DFL);
  2398. X# endif
  2399. X      setuid(real_uid);
  2400. X      setgid(real_gid);
  2401. X      return 1;
  2402. X    default:
  2403. X      return 0;
  2404. X    }
  2405. X#else
  2406. X  setreuid(eff_uid, real_uid);
  2407. X  setregid(eff_gid, real_gid);
  2408. X  return 1;
  2409. X#endif
  2410. X}
  2411. X
  2412. Xvoid
  2413. XUserReturn(val)
  2414. Xint val;
  2415. X{
  2416. X#if defined(NOREUID)
  2417. X  if (eff_uid == real_uid)
  2418. X    UserSTAT = val;
  2419. X  else
  2420. X    exit(val);
  2421. X#else
  2422. X  setreuid(real_uid, eff_uid);
  2423. X  setregid(real_gid, eff_gid);
  2424. X  UserSTAT = val;
  2425. X#endif
  2426. X}
  2427. X
  2428. Xint
  2429. XUserStatus()
  2430. X{
  2431. X#ifdef NOREUID
  2432. X  int i;
  2433. X# ifdef BSDWAIT
  2434. X  union wait wstat;
  2435. X# else
  2436. X  int wstat;
  2437. X# endif
  2438. X
  2439. X  if (eff_uid == real_uid)
  2440. X    return UserSTAT;
  2441. X  if (UserPID < 0)
  2442. X    return -1;
  2443. X  while ((errno = 0, i = wait(&wstat)) != UserPID)
  2444. X    if (i < 0 && errno != EINTR)
  2445. X      break;
  2446. X  (void) signal(SIGCHLD, Usersigcld);
  2447. X  if (i == -1)
  2448. X    return -1;
  2449. X  return (WEXITSTATUS(wstat));
  2450. X#else
  2451. X  return UserSTAT;
  2452. X#endif
  2453. X}
  2454. END_OF_FILE
  2455. if test 5041 -ne `wc -c <'misc.c'`; then
  2456.     echo shar: \"'misc.c'\" unpacked with wrong size!
  2457. fi
  2458. # end of 'misc.c'
  2459. fi
  2460. if test -f 'newsyntax' -a "${1}" != "-c" ; then 
  2461.   echo shar: Will not clobber existing file \"'newsyntax'\"
  2462. else
  2463. echo shar: Extracting \"'newsyntax'\" \(1825 characters\)
  2464. sed "s/^X//" >'newsyntax' <<'END_OF_FILE'
  2465. X#!/bin/sh
  2466. X#
  2467. X# newsyntax -- update a screenrc file from 3.2 to 3.3 syntax
  2468. X#
  2469. X# please check all comments after running this script and watch out 
  2470. X# for funny passages.
  2471. X#
  2472. Xif [ $# != 1 ]; then
  2473. X  echo "usage $0 screenrcfile"
  2474. X  exit 1;
  2475. Xfi
  2476. X
  2477. Xexec < $1
  2478. Xread a
  2479. Xif [ ."$a" = '.#3.3' ]; then
  2480. X  echo "$1 already updated"
  2481. X  exit 0
  2482. Xfi
  2483. X
  2484. Xcp $1 $1.old
  2485. Xecho "#3.3" > $1
  2486. Xecho "# Do not remove the above line. This screen rc file was updated" >> $1
  2487. Xecho "# by the newsyntax script." >> $1
  2488. Xsed < $1.old >> $1 \
  2489. X-e 's/\([     #]\)flow/\1defflow/g' \
  2490. X-e 's/^flow/defflow/g' \
  2491. X-e 's/\([     #]\)set[     ]*defflow/\1flow/g' \
  2492. X-e 's/^set[     ]*defflow/flow/g' \
  2493. X-e 's/\([     #]\)mode/\1defmode/g' \
  2494. X-e 's/^mode/defmode/g' \
  2495. X-e 's/\([     #]\)set[     ]*defmode/\1defmode/g' \
  2496. X-e 's/^set[     ]*defmode/defmode/g' \
  2497. X-e 's/\([     #]\)monitor/\1defmonitor/g' \
  2498. X-e 's/^monitor/defmonitor/g' \
  2499. X-e 's/\([     #]\)set[     ]*defmonitor/\1monitor/g' \
  2500. X-e 's/^set[     ]*defmonitor/monitor/g' \
  2501. X-e 's/\([     #]\)login/\1deflogin/g' \
  2502. X-e 's/^login/deflogin/g' \
  2503. X-e 's/\([     #]\)set[     ]*deflogin/\1login/g' \
  2504. X-e 's/^set[     ]*deflogin/login/g' \
  2505. X-e 's/\([     #]\)wrap/\1defwrap/g' \
  2506. X-e 's/^wrap/defwrap/g' \
  2507. X-e 's/\([     #]\)set[     ]*defwrap/\1wrap/g' \
  2508. X-e 's/^set[     ]*defwrap/wrap/g' \
  2509. X-e 's/\([     #]\)scrollback/\1defscrollback/g' \
  2510. X-e 's/^scrollback/defscrollback/g' \
  2511. X-e 's/\([     #]\)set[     ]*defscrollback/\1scrollback/g' \
  2512. X-e 's/^set[     ]*defscrollback/scrollback/g' \
  2513. X-e 's/\([     #]\)refresh/\1allPARtial/g' \
  2514. X-e 's/^refresh/allPARtial/g' \
  2515. X-e 's/\([     #]\)redraw/\1allPARtial/g' \
  2516. X-e 's/^redraw/allPARtial/g' \
  2517. X-e 's/\([     #]\)set[     ]*allPARtial/\1PARtial/g' \
  2518. X-e 's/^set[     ]*allPARtial/PARtial/g' \
  2519. X-e 's/\([     #]\)visualbell/\1vbell/g' \
  2520. X-e 's/^visualbell/vbell/g' \
  2521. X-e 's/PARtial\([     ]*\)on/partial\1off/g' \
  2522. X-e 's/PARtial\([     ]*\)off/partial\1on/g' \
  2523. X-e 's/allPARtial/refresh/g' \
  2524. X-e 's/^set[     ]//g'
  2525. X
  2526. END_OF_FILE
  2527. if test 1825 -ne `wc -c <'newsyntax'`; then
  2528.     echo shar: \"'newsyntax'\" unpacked with wrong size!
  2529. fi
  2530. chmod +x 'newsyntax'
  2531. # end of 'newsyntax'
  2532. fi
  2533. if test -f 'overlay.h' -a "${1}" != "-c" ; then 
  2534.   echo shar: Will not clobber existing file \"'overlay.h'\"
  2535. else
  2536. echo shar: Extracting \"'overlay.h'\" \(2149 characters\)
  2537. sed "s/^X//" >'overlay.h' <<'END_OF_FILE'
  2538. X/* Copyright (c) 1993
  2539. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  2540. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  2541. X * Copyright (c) 1987 Oliver Laumann
  2542. X *
  2543. X * This program is free software; you can redistribute it and/or modify
  2544. X * it under the terms of the GNU General Public License as published by
  2545. X * the Free Software Foundation; either version 2, or (at your option)
  2546. X * any later version.
  2547. X *
  2548. X * This program is distributed in the hope that it will be useful,
  2549. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2550. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2551. X * GNU General Public License for more details.
  2552. X *
  2553. X * You should have received a copy of the GNU General Public License
  2554. X * along with this program (see the file COPYING); if not, write to the
  2555. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2556. X *
  2557. X ****************************************************************
  2558. X * $Id: overlay.h,v 1.2 1993/06/23 22:49:11 mlschroe Exp $ FAU
  2559. X */
  2560. X
  2561. X/*
  2562. X * This is the overlay structure. It is used to create a seperate
  2563. X * layer over the current windows.
  2564. X */
  2565. X
  2566. Xstruct LayFuncs
  2567. X{
  2568. X  void    (*LayProcess) __P((char **, int *));
  2569. X  void    (*LayAbort) __P((void));
  2570. X  void    (*LayRedisplayLine) __P((int, int, int, int));
  2571. X  void    (*LayClearLine) __P((int, int, int));
  2572. X  int    (*LayRewrite) __P((int, int, int, int));
  2573. X  void    (*LaySetCursor) __P((void));
  2574. X  int    (*LayResize) __P((int, int));
  2575. X  void    (*LayRestore) __P((void));
  2576. X};
  2577. X
  2578. Xstruct layer
  2579. X{
  2580. X  struct layer *l_next;
  2581. X  int    l_block;
  2582. X  struct LayFuncs *l_layfn;
  2583. X  char    *l_data;        /* should be void * */
  2584. X};
  2585. X
  2586. X#define Process        (*d_layfn->LayProcess)
  2587. X#define Abort        (*d_layfn->LayAbort)
  2588. X#define RedisplayLine    (*d_layfn->LayRedisplayLine)
  2589. X#define ClearLine    (*d_layfn->LayClearLine)
  2590. X#define Rewrite        (*d_layfn->LayRewrite)
  2591. X#define SetCursor    (*d_layfn->LaySetCursor)
  2592. X#define Resize        (*d_layfn->LayResize)
  2593. X#define Restore        (*d_layfn->LayRestore)
  2594. X
  2595. X#define LAY_CALL_UP(fn) \
  2596. X    { \
  2597. X      struct layer *oldlay = d_lay; \
  2598. X      d_lay = d_lay->l_next; \
  2599. X      d_layfn = d_lay->l_layfn; \
  2600. X      fn; \
  2601. X      d_lay = oldlay; \
  2602. X      d_layfn = d_lay->l_layfn; \
  2603. X    }
  2604. X
  2605. END_OF_FILE
  2606. if test 2149 -ne `wc -c <'overlay.h'`; then
  2607.     echo shar: \"'overlay.h'\" unpacked with wrong size!
  2608. fi
  2609. # end of 'overlay.h'
  2610. fi
  2611. if test -f 'pty.c' -a "${1}" != "-c" ; then 
  2612.   echo shar: Will not clobber existing file \"'pty.c'\"
  2613. else
  2614. echo shar: Extracting \"'pty.c'\" \(5976 characters\)
  2615. sed "s/^X//" >'pty.c' <<'END_OF_FILE'
  2616. X/* Copyright (c) 1993
  2617. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  2618. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  2619. X * Copyright (c) 1987 Oliver Laumann
  2620. X *
  2621. X * This program is free software; you can redistribute it and/or modify
  2622. X * it under the terms of the GNU General Public License as published by
  2623. X * the Free Software Foundation; either version 2, or (at your option)
  2624. X * any later version.
  2625. X *
  2626. X * This program is distributed in the hope that it will be useful,
  2627. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2628. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2629. X * GNU General Public License for more details.
  2630. X *
  2631. X * You should have received a copy of the GNU General Public License
  2632. X * along with this program (see the file COPYING); if not, write to the
  2633. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2634. X *
  2635. X ****************************************************************
  2636. X */
  2637. X
  2638. X#include "rcs.h"
  2639. XRCS_ID("$Id: pty.c,v 1.1.1.1 1993/06/16 23:51:15 jnweiger Exp $ FAU")
  2640. X
  2641. X#include <sys/types.h>
  2642. X#include <sys/stat.h>
  2643. X#include <fcntl.h>
  2644. X#include <signal.h>
  2645. X
  2646. X#include "config.h"
  2647. X#include "screen.h"
  2648. X
  2649. X#ifndef sun
  2650. X#include <sys/ioctl.h>
  2651. X#endif
  2652. X
  2653. X#ifdef ISC
  2654. X# include <sys/tty.h>
  2655. X# include <sys/sioctl.h>
  2656. X# include <sys/pty.h>
  2657. X#endif
  2658. X
  2659. X#include "extern.h"
  2660. X
  2661. X/*
  2662. X * if no PTYRANGE[01] is in the config file, we pick a default
  2663. X */
  2664. X#ifndef PTYRANGE0
  2665. X# define PTYRANGE0 "qpr"
  2666. X#endif
  2667. X#ifndef PTYRANGE1
  2668. X# define PTYRANGE1 "0123456789abcdef"
  2669. X#endif
  2670. X
  2671. Xextern int eff_uid;
  2672. X
  2673. X/* used for opening a new pty-pair: */
  2674. Xstatic char PtyName[32], TtyName[32];
  2675. X
  2676. X#if !(defined(sequent) || defined(_SEQUENT_) || defined(SVR4))
  2677. X# ifdef hpux
  2678. Xstatic char PtyProto[] = "/dev/ptym/ptyXY";
  2679. Xstatic char TtyProto[] = "/dev/pty/ttyXY";
  2680. X# else
  2681. Xstatic char PtyProto[] = "/dev/ptyXY";
  2682. Xstatic char TtyProto[] = "/dev/ttyXY";
  2683. X# endif /* hpux */
  2684. X#endif
  2685. X
  2686. X
  2687. X#if defined(sequent) || defined(_SEQUENT_)
  2688. X
  2689. Xint
  2690. XOpenPTY(ttyn)
  2691. Xchar **ttyn;
  2692. X{
  2693. X  char *m, *s;
  2694. X  register int f;
  2695. X
  2696. X  if ((f = getpseudotty(&s, &m)) < 0)
  2697. X    return -1;
  2698. X#ifdef _SEQUENT_
  2699. X  fvhangup(s);
  2700. X#endif
  2701. X  strncpy(PtyName, m, sizeof(PtyName));
  2702. X  strncpy(TtyName, s, sizeof(TtyName));
  2703. X#ifdef POSIX
  2704. X  tcflush(f, TCIOFLUSH);
  2705. X#else
  2706. X# ifdef TIOCFLUSH
  2707. X  (void) ioctl(f, TIOCFLUSH, (char *) 0);
  2708. X# endif
  2709. X#endif
  2710. X#ifdef LOCKPTY
  2711. X  (void) ioctl(f, TIOCEXCL, (char *) 0);
  2712. X#endif
  2713. X  *ttyn = TtyName;
  2714. X  return f;
  2715. X}
  2716. X
  2717. X#else
  2718. X# ifdef SVR4
  2719. X
  2720. Xint
  2721. XOpenPTY(ttyn)
  2722. Xchar **ttyn;
  2723. X{
  2724. X  char *m;
  2725. X  register int f;
  2726. X  char *ptsname();
  2727. X  int unlockpt __P((int)), grantpt __P((int));
  2728. X  sig_t (*sigcld)__P(SIGPROTOARG);
  2729. X
  2730. X  if ((f = open("/dev/ptmx", O_RDWR)) == -1)
  2731. X    return -1;
  2732. X
  2733. X  /*
  2734. X   * SIGCHLD set to SIG_DFL for grantpt() because it fork()s and
  2735. X   * exec()s pt_chmod
  2736. X   */
  2737. X  sigcld = signal(SIGCHLD, SIG_DFL);
  2738. X       
  2739. X  if ((m = ptsname(f)) == NULL || unlockpt(f) || grantpt(f))
  2740. X    {
  2741. X      signal(SIGCHLD, sigcld);
  2742. X      close(f);
  2743. X      return -1;
  2744. X    } 
  2745. X  signal(SIGCHLD, sigcld);
  2746. X  strncpy(TtyName, m, sizeof(TtyName));
  2747. X#ifdef POSIX
  2748. X  tcflush(f, TCIOFLUSH);
  2749. X#else
  2750. X# ifdef TIOCFLUSH
  2751. X  (void) ioctl(f, TIOCFLUSH, (char *) 0);
  2752. X# endif
  2753. X#endif
  2754. X#ifdef LOCKPTY
  2755. X  (void) ioctl(f, TIOCEXCL, (char *) 0);
  2756. X#endif
  2757. X  *ttyn = TtyName;
  2758. X  return f;
  2759. X}
  2760. X
  2761. X# else /* not SVR4 */
  2762. X
  2763. X#  ifdef MIPS
  2764. X#   ifdef __sgi /* __sgi -> IRIX 4.0 */
  2765. X
  2766. Xint
  2767. XOpenPTY(ttyn)
  2768. Xchar **ttyn;
  2769. X{
  2770. X  int f;
  2771. X  char *name; 
  2772. X  sig_t (*sigcld)__P(SIGPROTOARG);
  2773. X
  2774. X  /*
  2775. X   * SIGCHLD set to SIG_DFL for _getpty() because it may fork() and
  2776. X   * exec() /usr/adm/mkpts
  2777. X   */
  2778. X  sigcld = signal(SIGCHLD, SIG_DFL);
  2779. X  name = _getpty(&f, O_RDWR | O_NDELAY, 0600, 0);
  2780. X  signal(SIGCHLD, sigcld);
  2781. X
  2782. X  if (name == NULL)
  2783. X    return -1;
  2784. X#ifdef LOCKPTY
  2785. X  (void) ioctl(f, TIOCEXCL, (char *) 0);
  2786. X#endif
  2787. X  *ttyn = name;
  2788. X  return f;
  2789. X}
  2790. X
  2791. X#   else /* __sgi */
  2792. X
  2793. Xint
  2794. XOpenPTY(ttyn)
  2795. Xchar **ttyn;
  2796. X{
  2797. X  register int f;
  2798. X  register int my_minor;
  2799. X  struct stat buf;
  2800. X   
  2801. X  strcpy(PtyName, "/dev/ptc");
  2802. X  f = open(PtyName, O_RDWR | O_NDELAY);
  2803. X  if (f < 0)
  2804. X    return -1;
  2805. X  if (fstat(f, &buf) < 0)
  2806. X    {
  2807. X      close(f);
  2808. X      return -1;
  2809. X    }
  2810. X  my_minor = minor(buf.st_rdev);
  2811. X  sprintf(TtyName, "/dev/ttyq%d", my_minor);
  2812. X#ifdef LOCKPTY
  2813. X  (void) ioctl(f, TIOCEXCL, (char *) 0);
  2814. X#endif
  2815. X  *ttyn = TtyName;
  2816. X  return f;
  2817. X}
  2818. X
  2819. X#   endif /* __sgi */
  2820. X#  else /* MIPS */
  2821. X
  2822. X#   ifdef _AIX /* RS6000 */
  2823. X
  2824. Xint
  2825. XOpenPTY(ttyn)
  2826. Xchar **ttyn;
  2827. X{
  2828. X  register int f;
  2829. X
  2830. X  /* a dumb looking loop replaced by mycrofts code: */
  2831. X  strcpy (PtyName, "/dev/ptc");
  2832. X  if ((f = open (PtyName, O_RDWR)) < 0)
  2833. X    return -1;
  2834. X  strcpy (TtyName, ttyname(f));
  2835. X  strcpy (PtyName, TtyName);
  2836. X  PtyName [7] = 'c'; 
  2837. X  if (eff_uid && access(TtyName, R_OK | W_OK))
  2838. X    {
  2839. X      close(f);
  2840. X      return -1;
  2841. X    }
  2842. X#ifdef LOCKPTY
  2843. X  if (ioctl (f, TIOCEXCL, (char *) 0) == -1)
  2844. X    return -1;
  2845. X#endif /* LOCKPTY */
  2846. X  *ttyn = TtyName;
  2847. X  return f;
  2848. X}
  2849. X
  2850. X#   else /* _AIX, RS6000 */
  2851. X
  2852. Xint
  2853. XOpenPTY(ttyn)
  2854. Xchar **ttyn;
  2855. X{
  2856. X  register char *p, *q, *l, *d;
  2857. X  register int f;
  2858. X
  2859. X  debug("OpenPTY: Using BSD style ptys.\n");
  2860. X  strcpy(PtyName, PtyProto);
  2861. X  strcpy(TtyName, TtyProto);
  2862. X  for (p = PtyName; *p != 'X'; ++p)
  2863. X    ;
  2864. X  for (q = TtyName; *q != 'X'; ++q)
  2865. X    ;
  2866. X  for (l = PTYRANGE0; (*p = *l) != '\0'; ++l)
  2867. X    {
  2868. X      for (d = PTYRANGE1; (p[1] = *d) != '\0'; ++d)
  2869. X    {
  2870. X      debug1("OpenPTY tries '%s'\n", PtyName);
  2871. X      if ((f = open(PtyName, O_RDWR)) == -1)
  2872. X        continue;
  2873. X      q[0] = *l;
  2874. X      q[1] = *d;
  2875. X      if (eff_uid && access(TtyName, R_OK | W_OK))
  2876. X        {
  2877. X          close(f);
  2878. X          continue;
  2879. X        }
  2880. X#if defined(sun) && defined(TIOCGPGRP)
  2881. X      /* Hack to ensure that the slave side of the pty is
  2882. X       * unused. May not work in anything other than SunOS4.1
  2883. X       */
  2884. X        {
  2885. X          int pgrp;
  2886. X
  2887. X          /* tcgetpgrp does not work (uses TIOCGETPGRP)! */
  2888. X          if (ioctl(f, TIOCGPGRP, &pgrp) != -1 || errno != EIO)
  2889. X        {
  2890. X          close(f);
  2891. X          continue;
  2892. X        }
  2893. X        }
  2894. X#endif
  2895. X#ifdef LOCKPTY
  2896. X      (void) ioctl(f, TIOCEXCL, (char *) 0);
  2897. X#endif
  2898. X      *ttyn = TtyName;
  2899. X      return f;
  2900. X    }
  2901. X    }
  2902. X  return -1;
  2903. X}
  2904. X
  2905. X#   endif /* _AIX, RS6000 */
  2906. X#  endif /* MIPS */
  2907. X# endif /* SVR4 */
  2908. X#endif /* sequent || SEQUENT */
  2909. END_OF_FILE
  2910. if test 5976 -ne `wc -c <'pty.c'`; then
  2911.     echo shar: \"'pty.c'\" unpacked with wrong size!
  2912. fi
  2913. # end of 'pty.c'
  2914. fi
  2915. if test -f 'putenv.c' -a "${1}" != "-c" ; then 
  2916.   echo shar: Will not clobber existing file \"'putenv.c'\"
  2917. else
  2918. echo shar: Extracting \"'putenv.c'\" \(5413 characters\)
  2919. sed "s/^X//" >'putenv.c' <<'END_OF_FILE'
  2920. X/* Copyright (c) 1993
  2921. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  2922. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  2923. X * Copyright (c) 1987 Oliver Laumann
  2924. X *
  2925. X * This program is free software; you can redistribute it and/or modify
  2926. X * it under the terms of the GNU General Public License as published by
  2927. X * the Free Software Foundation; either version 2, or (at your option)
  2928. X * any later version.
  2929. X *
  2930. X * This program is distributed in the hope that it will be useful,
  2931. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2932. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2933. X * GNU General Public License for more details.
  2934. X *
  2935. X * You should have received a copy of the GNU General Public License
  2936. X * along with this program (see the file COPYING); if not, write to the
  2937. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2938. X *
  2939. X ****************************************************************
  2940. X */
  2941. X
  2942. X/*
  2943. X *  putenv  --  put value into environment
  2944. X *
  2945. X *  Usage:  i = putenv (string)
  2946. X *    int i;
  2947. X *    char  *string;
  2948. X *
  2949. X *  where string is of the form <name>=<value>.
  2950. X *  If "value" is 0, then "name" will be deleted from the environment.
  2951. X *  Putenv returns 0 normally, -1 on error (not enough core for malloc).
  2952. X *
  2953. X *  Putenv may need to add a new name into the environment, or to
  2954. X *  associate a value longer than the current value with a particular
  2955. X *  name.  So, to make life simpler, putenv() copies your entire
  2956. X *  environment into the heap (i.e. malloc()) from the stack
  2957. X *  (i.e. where it resides when your process is initiated) the first
  2958. X *  time you call it.
  2959. X *
  2960. X *  HISTORY
  2961. X *  3-Sep-91 Michael Schroeder (mlschroe). Modified to behave as
  2962. X *    as putenv.
  2963. X * 16-Aug-91 Tim MacKenzie (tym) at Monash University. Modified for
  2964. X *    use in screen (iScreen) (ignores final int parameter)
  2965. X * 14-Oct-85 Michael Mauldin (mlm) at Carnegie-Mellon University
  2966. X *      Ripped out of CMU lib for Rob-O-Matic portability
  2967. X * 20-Nov-79  Steven Shafer (sas) at Carnegie-Mellon University
  2968. X *    Created for VAX.  Too bad Bell Labs didn't provide this.  It's
  2969. X *    unfortunate that you have to copy the whole environment onto the
  2970. X *    heap, but the bookkeeping-and-not-so-much-copying approach turns
  2971. X *    out to be much hairier.  So, I decided to do the simple thing,
  2972. X *    copying the entire environment onto the heap the first time you
  2973. X *    call putenv(), then doing realloc() uniformly later on.
  2974. X */
  2975. X#include "rcs.h"
  2976. XRCS_ID("$Id: putenv.c,v 1.1.1.1 1993/06/16 23:51:15 jnweiger Exp $ FAU")
  2977. X
  2978. X#include "config.h"
  2979. X
  2980. X#if defined(NEEDPUTENV)
  2981. X
  2982. X#define EXTRASIZE 5        /* increment to add to env. size */
  2983. X
  2984. Xchar *malloc(), *realloc();
  2985. X
  2986. Xstatic int  envsize = -1;    /* current size of environment */
  2987. Xextern char **environ;        /* the global which is your env. */
  2988. X
  2989. Xstatic int  findenv();        /* look for a name in the env. */
  2990. Xstatic int  newenv();        /* copy env. from stack to heap */
  2991. Xstatic int  moreenv();        /* incr. size of env. */
  2992. X
  2993. Xint
  2994. Xunsetenv(name)
  2995. Xchar *name;
  2996. X{
  2997. X  register int i;
  2998. X  
  2999. X  if (envsize < 0)
  3000. X    {                /* first time putenv called */
  3001. X      if (newenv() < 0)        /* copy env. to heap */
  3002. X    return -1;
  3003. X    }
  3004. X  i = findenv(name);
  3005. X  if (i < 0)
  3006. X    return 0;            /* Already here */
  3007. X  
  3008. X  free(environ[i]);
  3009. X  if (envsize > 0)
  3010. X    envsize--;
  3011. X  for (; environ[i]; i++)
  3012. X    environ[i] = environ[i+1];
  3013. X  return 0;            /* Already here */
  3014. X}
  3015. X
  3016. Xint
  3017. Xputenv(string)
  3018. Xchar *string;
  3019. X{ 
  3020. X  register int  i;
  3021. X  register char *p;
  3022. X  
  3023. X  if (envsize < 0)
  3024. X    {                /* first time putenv called */
  3025. X      if (newenv() < 0)        /* copy env. to heap */
  3026. X    return -1;
  3027. X    }
  3028. X  
  3029. X  i = findenv(string);        /* look for name in environment */
  3030. X
  3031. X  if (i < 0)
  3032. X    {            /* name must be added */
  3033. X      for (i = 0; environ[i]; i++);
  3034. X      if (i >= (envsize - 1))
  3035. X    {            /* need new slot */
  3036. X      if (moreenv() < 0)
  3037. X        return -1;
  3038. X    }
  3039. X      p = malloc(strlen(string) + 1);
  3040. X      if (p == 0)        /* not enough core */
  3041. X    return -1;
  3042. X      environ[i + 1] = 0;    /* new end of env. */
  3043. X    }
  3044. X  else
  3045. X    {            /* name already in env. */
  3046. X      p = realloc(environ[i], strlen(string) + 1);
  3047. X      if (p == 0)
  3048. X    return -1;
  3049. X    }
  3050. X  sprintf(p, "%s", string); /* copy into env. */
  3051. X  environ[i] = p;
  3052. X  
  3053. X  return 0;
  3054. X}
  3055. X
  3056. Xstatic int
  3057. Xfindenv(name)
  3058. Xchar *name;
  3059. X{
  3060. X  register char *namechar, *envchar;
  3061. X  register int  i, found;
  3062. X  
  3063. X  found = 0;
  3064. X  for (i = 0; environ[i] && !found; i++)
  3065. X    { 
  3066. X      envchar = environ[i];
  3067. X      namechar = name;
  3068. X      while (*namechar && *namechar != '=' && (*namechar == *envchar))
  3069. X        { 
  3070. X      namechar++;
  3071. X      envchar++;
  3072. X        }
  3073. X      found = ((*namechar == '\0' || *namechar == '=') && *envchar == '=');
  3074. X    }
  3075. X  return found ? i - 1 : -1;
  3076. X}
  3077. X
  3078. Xstatic int
  3079. Xnewenv()
  3080. X{ 
  3081. X  register char **env, *elem;
  3082. X  register int i, esize;
  3083. X
  3084. X  for (i = 0; environ[i]; i++)
  3085. X    ;
  3086. X  esize = i + EXTRASIZE + 1;
  3087. X  env = (char **)malloc(esize * sizeof (elem));
  3088. X  if (env == 0)
  3089. X    return -1;
  3090. X
  3091. X  for (i = 0; environ[i]; i++)
  3092. X    { 
  3093. X      elem = malloc(strlen(environ[i]) + 1);
  3094. X      if (elem == 0)
  3095. X    return (-1);
  3096. X      env[i] = elem;
  3097. X      strcpy(elem, environ[i]);
  3098. X    }
  3099. X   
  3100. X  env[i] = 0;
  3101. X  environ = env;
  3102. X  envsize = esize;
  3103. X  return 0;
  3104. X}
  3105. X
  3106. Xstatic int
  3107. Xmoreenv()
  3108. X{ 
  3109. X  register int  esize;
  3110. X  register char **env;
  3111. X  
  3112. X  esize = envsize + EXTRASIZE;
  3113. X  env = (char **)realloc(environ, esize * sizeof (*env));
  3114. X  if (env == 0)
  3115. X    return -1;
  3116. X  environ = env;
  3117. X  envsize = esize;
  3118. X  return 0;
  3119. X}
  3120. X
  3121. X#endif /* NEEDPUTENV */
  3122. X
  3123. X
  3124. END_OF_FILE
  3125. if test 5413 -ne `wc -c <'putenv.c'`; then
  3126.     echo shar: \"'putenv.c'\" unpacked with wrong size!
  3127. fi
  3128. # end of 'putenv.c'
  3129. fi
  3130. if test -f 'rcs.h' -a "${1}" != "-c" ; then 
  3131.   echo shar: Will not clobber existing file \"'rcs.h'\"
  3132. else
  3133. echo shar: Extracting \"'rcs.h'\" \(1516 characters\)
  3134. sed "s/^X//" >'rcs.h' <<'END_OF_FILE'
  3135. X/* Copyright (c) 1993
  3136. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  3137. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  3138. X * Copyright (c) 1987 Oliver Laumann
  3139. X *
  3140. X * This program is free software; you can redistribute it and/or modify
  3141. X * it under the terms of the GNU General Public License as published by
  3142. X * the Free Software Foundation; either version 2, or (at your option)
  3143. X * any later version.
  3144. X *
  3145. X * This program is distributed in the hope that it will be useful,
  3146. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3147. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3148. X * GNU General Public License for more details.
  3149. X *
  3150. X * You should have received a copy of the GNU General Public License
  3151. X * along with this program (see the file COPYING); if not, write to the
  3152. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3153. X *
  3154. X ****************************************************************
  3155. X * $Id: rcs.h,v 1.1.1.1 1993/06/16 23:51:16 jnweiger Exp $ FAU
  3156. X */
  3157. X
  3158. X/*
  3159. X * rcs.h
  3160. X *
  3161. X * jw 9.2.92
  3162. X **************************************************
  3163. X * RCS_ID("$Id: rcs.h,v 1.1.1.1 1993/06/16 23:51:16 jnweiger Exp $ FAU");
  3164. X */
  3165. X
  3166. X#ifndef __RCS_H__
  3167. X# define __RCS_H__
  3168. X
  3169. X# if !defined(lint)
  3170. X#  ifdef __GNUC__
  3171. X#   define RCS_ID(id) static char *rcs_id() { return rcs_id(id); }
  3172. X#  else
  3173. X#   define RCS_ID(id) static char *rcs_id = id;
  3174. X#  endif /* !__GNUC__ */
  3175. X# else
  3176. X#  define RCS_ID(id)      /* Nothing */
  3177. X# endif /* !lint */
  3178. X
  3179. X#endif /* __RCS_H__ */
  3180. END_OF_FILE
  3181. if test 1516 -ne `wc -c <'rcs.h'`; then
  3182.     echo shar: \"'rcs.h'\" unpacked with wrong size!
  3183. fi
  3184. # end of 'rcs.h'
  3185. fi
  3186. if test -f 'screen.h' -a "${1}" != "-c" ; then 
  3187.   echo shar: Will not clobber existing file \"'screen.h'\"
  3188. else
  3189. echo shar: Extracting \"'screen.h'\" \(5833 characters\)
  3190. sed "s/^X//" >'screen.h' <<'END_OF_FILE'
  3191. X/* Copyright (c) 1993
  3192. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  3193. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  3194. X * Copyright (c) 1987 Oliver Laumann
  3195. X *
  3196. X * This program is free software; you can redistribute it and/or modify
  3197. X * it under the terms of the GNU General Public License as published by
  3198. X * the Free Software Foundation; either version 2, or (at your option)
  3199. X * any later version.
  3200. X *
  3201. X * This program is distributed in the hope that it will be useful,
  3202. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3203. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3204. X * GNU General Public License for more details.
  3205. X *
  3206. X * You should have received a copy of the GNU General Public License
  3207. X * along with this program (see the file COPYING); if not, write to the
  3208. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3209. X *
  3210. X ****************************************************************
  3211. X * $Id: screen.h,v 1.5 1993/07/21 15:43:23 mlschroe Exp $ FAU
  3212. X */
  3213. X
  3214. X#include "os.h"
  3215. X
  3216. X#if defined(__STDC__)
  3217. X# ifndef __P
  3218. X#  define __P(a) a
  3219. X# endif
  3220. X#else
  3221. X# ifndef __P
  3222. X#  define __P(a) ()
  3223. X# endif
  3224. X# define const
  3225. X#endif
  3226. X
  3227. X#include "ansi.h"
  3228. X#include "acl.h"
  3229. X#include "comm.h"
  3230. X#include "overlay.h"
  3231. X#include "term.h"
  3232. X
  3233. X
  3234. X#ifdef DEBUG
  3235. X#    define debug(x) {fprintf(dfp,x);fflush(dfp);}
  3236. X#    define debug1(x,a) {fprintf(dfp,x,a);fflush(dfp);}
  3237. X#    define debug2(x,a,b) {fprintf(dfp,x,a,b);fflush(dfp);}
  3238. X#    define debug3(x,a,b,c) {fprintf(dfp,x,a,b,c);fflush(dfp);}
  3239. X    extern FILE *dfp;
  3240. X#else
  3241. X#    define debug(x) {}
  3242. X#    define debug1(x,a) {}
  3243. X#    define debug2(x,a,b) {}
  3244. X#    define debug3(x,a,b,c) {}
  3245. X#endif
  3246. X
  3247. X#ifndef DEBUG
  3248. X# define NOASSERT
  3249. X#endif
  3250. X
  3251. X#ifndef NOASSERT
  3252. X# if defined(__STDC__)
  3253. X#  define ASSERT(lousy_cpp) {if (!(lousy_cpp)) {debug2("ASSERT("#lousy_cpp")ion failed file %s line %d\n", __FILE__, __LINE__);abort();}}
  3254. X# else
  3255. X#  define ASSERT(lousy_cpp) {if (!(lousy_cpp)) {debug2("ASSERT(lousy_cpp)ion failed file %s line %d\n", __FILE__, __LINE__);abort();}}
  3256. X# endif
  3257. X#else
  3258. X# define ASSERT(lousy_cpp) {;}
  3259. X#endif
  3260. X
  3261. X/* here comes my own Free: jw. */
  3262. X#define Free(a) {if ((a) == 0) abort(); else free((void *)(a)); (a)=0;}
  3263. X
  3264. X#define Ctrl(c) ((c)&037)
  3265. X
  3266. X#define MAXSTR        256
  3267. X#define MAXARGS     64
  3268. X#define MSGWAIT     5
  3269. X#define MSGMINWAIT     1
  3270. X#define SILENCEWAIT    30
  3271. X
  3272. X/*
  3273. X * if a nasty user really wants to try a history of 3000 lines on all 10
  3274. X * windows, he will allocate 8 MegaBytes of memory, which is quite enough.
  3275. X */
  3276. X#define MAXHISTHEIGHT        3000
  3277. X#define DEFAULTHISTHEIGHT    100
  3278. X#define DEFAULT_BUFFERFILE    "/tmp/screen-exchange"
  3279. X
  3280. X#define    TTY_FLAG_PLAIN        0x01
  3281. X
  3282. Xstruct tty_attr
  3283. X{
  3284. X  int flags;            /* a PLAIN tty or a process behind */
  3285. X};
  3286. X
  3287. Xstruct mode
  3288. X{
  3289. X#ifdef POSIX
  3290. X  struct termios tio;
  3291. X# ifdef hpux
  3292. X  struct ltchars m_ltchars;
  3293. X# endif /* hpux */
  3294. X#else /* POSIX */
  3295. X# ifdef TERMIO
  3296. X  struct termio tio;
  3297. X# else /* TERMIO */
  3298. X  struct sgttyb m_ttyb;
  3299. X  struct tchars m_tchars;
  3300. X  struct ltchars m_ltchars;
  3301. X  int m_ldisc;
  3302. X  int m_lmode;
  3303. X# endif /* TERMIO */
  3304. X#endif /* POSIX */
  3305. X};
  3306. X
  3307. X#include "display.h"
  3308. X#include "window.h"
  3309. X
  3310. X/*
  3311. X * Parameters for the Detach() routine
  3312. X */
  3313. X#define D_DETACH    0
  3314. X#define D_STOP        1
  3315. X#define D_REMOTE    2
  3316. X#define D_POWER     3
  3317. X#define D_REMOTE_POWER    4
  3318. X#define D_LOCK        5
  3319. X
  3320. X/*
  3321. X * Here are the messages the attacher sends to the backend
  3322. X */
  3323. X#define MSG_CREATE    0
  3324. X#define MSG_ERROR    1
  3325. X#define MSG_ATTACH    2
  3326. X#define MSG_CONT    3
  3327. X#define MSG_DETACH    4
  3328. X#define MSG_POW_DETACH    5
  3329. X#define MSG_WINCH    6
  3330. X#define MSG_HANGUP    7
  3331. X
  3332. Xstruct msg
  3333. X{
  3334. X  int type;
  3335. X  char m_tty[MAXPATHLEN];    /* ttyname */
  3336. X  union
  3337. X    {
  3338. X      struct
  3339. X    {
  3340. X      int lflag;
  3341. X      int aflag;
  3342. X      int flowflag;
  3343. X      int hheight;        /* size of scrollback buffer */
  3344. X      int nargs;
  3345. X      char line[MAXPATHLEN];
  3346. X      char dir[MAXPATHLEN];
  3347. X      char screenterm[20];    /* is screen really "screen" ? */
  3348. X    }
  3349. X      create;
  3350. X      struct
  3351. X    {
  3352. X      char auser[20 + 1];    /* username */
  3353. X      int apid;        /* pid of frontend */
  3354. X      int adaptflag;    /* adapt window size? */
  3355. X      int lines, columns;    /* display size */
  3356. X      char password[20];
  3357. X      char envterm[20 + 1];    /* terminal type */
  3358. X    }
  3359. X      attach;
  3360. X      struct 
  3361. X    {
  3362. X      char duser[20 + 1];    /* username */
  3363. X      char password[20];
  3364. X      int dpid;        /* pid of frontend */
  3365. X    }
  3366. X      detach;
  3367. X      char message[MAXPATHLEN * 2];
  3368. X    } m;
  3369. X};
  3370. X
  3371. X/*
  3372. X * And the signals the attacher receives from the backend
  3373. X */
  3374. X#define SIG_BYE        SIGHUP
  3375. X#define SIG_POWER_BYE    SIGUSR1
  3376. X#define SIG_LOCK    SIGUSR2
  3377. X#define SIG_STOP    SIGTSTP
  3378. X#define SIG_PW_OK    SIGUSR1
  3379. X#define SIG_PW_FAIL    SIG_BYE
  3380. X
  3381. X
  3382. X#define BELL        (Ctrl('g'))
  3383. X#define VBELLWAIT    1 /* No. of seconds a vbell will be displayed */
  3384. X
  3385. X#define BELL_OFF    0 /* No bell has occurred in the window */
  3386. X#define BELL_ON     1 /* A bell has occurred, but user not yet notified */
  3387. X#define BELL_MSG    2 /* A bell has occured, user sees a message */
  3388. X#define BELL_DONE    3 /* A bell has occured, user has been notified */
  3389. X#define BELL_VISUAL     4 /* A bell has occured in fore win, notify him visually */
  3390. X
  3391. X#define MON_OFF     0 /* Monitoring is off in the window */
  3392. X#define MON_ON        1 /* No activity has occurred in the window */
  3393. X#define MON_FOUND    2 /* Activity has occured, but user not yet notified */
  3394. X#define MON_MSG        3 /* Activity has occured, user sees a message */
  3395. X#define MON_DONE    4 /* Activity has occured, user has been notified */
  3396. X
  3397. X#define DUMP_TERMCAP    0 /* WriteFile() options */
  3398. X#define DUMP_HARDCOPY    1
  3399. X#define DUMP_EXCHANGE    2
  3400. X
  3401. Xextern char strnomem[];
  3402. X
  3403. X
  3404. Xstruct NewWindow
  3405. X{
  3406. X  int    StartAt;    /* where to start the search for the slot */
  3407. X  char    *aka;        /* aka string */
  3408. X  char    **args;        /* argv vector */
  3409. X  char    *dir;        /* directory for chdir */
  3410. X  char    *term;        /* TERM to be set instead of "screen" */
  3411. X  int    aflag;
  3412. X  int    flowflag;
  3413. X  int    lflag;
  3414. X  int    histheight;
  3415. X  int    monitor;
  3416. X};
  3417. X
  3418. X/*
  3419. X * line modes used by Input()
  3420. X */
  3421. X#define INP_COOKED    0
  3422. X#define INP_NOECHO    1
  3423. X#define INP_RAW        2
  3424. X
  3425. X
  3426. X#ifdef MULTIUSER
  3427. Xstruct acl
  3428. X{
  3429. X  struct acl *next;
  3430. X  char *name;
  3431. X};
  3432. X#endif
  3433. X
  3434. END_OF_FILE
  3435. if test 5833 -ne `wc -c <'screen.h'`; then
  3436.     echo shar: \"'screen.h'\" unpacked with wrong size!
  3437. fi
  3438. # end of 'screen.h'
  3439. fi
  3440. if test -f 'term.c' -a "${1}" != "-c" ; then 
  3441.   echo shar: Will not clobber existing file \"'term.c'\"
  3442. else
  3443. echo shar: Extracting \"'term.c'\" \(4399 characters\)
  3444. sed "s/^X//" >'term.c' <<'END_OF_FILE'
  3445. X/* Copyright (c) 1993
  3446. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  3447. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  3448. X * Copyright (c) 1987 Oliver Laumann
  3449. X *
  3450. X * This program is free software; you can redistribute it and/or modify
  3451. X * it under the terms of the GNU General Public License as published by
  3452. X * the Free Software Foundation; either version 2, or (at your option)
  3453. X * any later version.
  3454. X *
  3455. X * This program is distributed in the hope that it will be useful,
  3456. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  3457. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3458. X * GNU General Public License for more details.
  3459. X *
  3460. X * You should have received a copy of the GNU General Public License
  3461. X * along with this program (see the file COPYING); if not, write to the
  3462. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3463. X *
  3464. X ****************************************************************
  3465. X */
  3466. X
  3467. X#include "rcs.h"
  3468. XRCS_ID("$Id: term.c,v 1.1.1.1 1993/06/16 23:51:18 jnweiger Exp $ FAU")
  3469. X
  3470. X#include "term.h"
  3471. X
  3472. Xstruct term term[T_N] =
  3473. X{
  3474. X/* display size */
  3475. X  { "li", T_NUM  },
  3476. X  { "co", T_NUM  },
  3477. X
  3478. X/* terminal types*/
  3479. X  { "hc", T_FLG  },
  3480. X  { "os", T_FLG  },
  3481. X  { "ns", T_FLG  },
  3482. X/* cursor movement */
  3483. X  { "cm", T_STR  },
  3484. X  { "ho", T_STR  },
  3485. X  { "cr", T_STR  },
  3486. X  { "up", T_STR  },
  3487. X  { "UP", T_STR  },
  3488. X  { "do", T_STR  },
  3489. X  { "DO", T_STR  },
  3490. X  { "bs", T_FLG  },
  3491. X  { "bc", T_STR  },
  3492. X  { "le", T_STR  },
  3493. X  { "LE", T_STR  },
  3494. X  { "nd", T_STR  },
  3495. X  { "RI", T_STR  },
  3496. X
  3497. X/* scroll */
  3498. X  { "cs", T_STR  },
  3499. X  { "nl", T_STR  },
  3500. X  { "sf", T_STR  },
  3501. X  { "sr", T_STR  },
  3502. X  { "al", T_STR  },
  3503. X  { "AL", T_STR  },
  3504. X  { "dl", T_STR  },
  3505. X  { "DL", T_STR  },
  3506. X
  3507. X/* insert/delete */
  3508. X  { "in", T_FLG  },
  3509. X  { "im", T_STR  },
  3510. X  { "ei", T_STR  },
  3511. X  { "ic", T_STR  },
  3512. X  { "IC", T_STR  },
  3513. X  { "dc", T_STR  },
  3514. X  { "DC", T_STR  },
  3515. X
  3516. X/* erase */
  3517. X  { "cl", T_STR  },
  3518. X  { "cd", T_STR  },
  3519. X  { "ce", T_STR  },
  3520. X  { "cb", T_STR  },
  3521. X
  3522. X/* initialise */
  3523. X  { "is", T_STR  },
  3524. X  { "ti", T_STR  },
  3525. X  { "te", T_STR  },
  3526. X
  3527. X/* bell */
  3528. X  { "bl", T_STR  },
  3529. X  { "vb", T_STR  },
  3530. X
  3531. X/* resizing */
  3532. X  { "WS", T_STR  },
  3533. X  { "Z0", T_STR  },
  3534. X  { "Z1", T_STR  },
  3535. X
  3536. X/* attributes */
  3537. X/* define T_ATTR */
  3538. X  { "mh", T_STR  },
  3539. X  { "us", T_STR  },
  3540. X  { "md", T_STR  },
  3541. X  { "mr", T_STR  },
  3542. X  { "so", T_STR  },
  3543. X  { "mb", T_STR  },
  3544. X  { "ue", T_STR  },
  3545. X  { "se", T_STR  },
  3546. X  { "me", T_STR  },
  3547. X  { "ms", T_FLG  },
  3548. X  { "sg", T_FLG  },
  3549. X  { "ug", T_FLG  },
  3550. X
  3551. X/* keypad/cursorkeys */
  3552. X  { "ks", T_STR  },
  3553. X  { "ke", T_STR  },
  3554. X  { "CS", T_STR  },
  3555. X  { "CE", T_STR  },
  3556. X
  3557. X/* printer */
  3558. X  { "po", T_STR  },
  3559. X  { "pf", T_STR  },
  3560. X
  3561. X/* status line */
  3562. X  { "hs", T_FLG  },
  3563. X  { "ws", T_NUM  },
  3564. X  { "ts", T_STR  },
  3565. X  { "fs", T_STR  },
  3566. X  { "ds", T_STR  },
  3567. X
  3568. X/* cursor visibility */
  3569. X  { "vi", T_STR  },
  3570. X  { "ve", T_STR  },
  3571. X  { "vs", T_STR  },
  3572. X
  3573. X/* margin handling */
  3574. X  { "am", T_FLG  },
  3575. X  { "xv", T_FLG  },
  3576. X  { "xn", T_FLG  },
  3577. X  { "OP", T_FLG  },
  3578. X  { "LP", T_FLG  },
  3579. X
  3580. X/* special settings */
  3581. X  { "NF", T_FLG  },
  3582. X  { "xo", T_FLG  },
  3583. X  { "AN", T_FLG  },
  3584. X  { "OL", T_NUM  },
  3585. X
  3586. X/* d_font setting */
  3587. X  { "G0", T_FLG  },
  3588. X  { "S0", T_STR  },
  3589. X  { "E0", T_STR  },
  3590. X  { "C0", T_STR  },
  3591. X  { "as", T_STR  },
  3592. X  { "ae", T_STR  },
  3593. X  { "ac", T_STR  },
  3594. X  { "B8", T_STR  },
  3595. X
  3596. X/* keycaps */
  3597. X/* define T_CAPS */
  3598. X/* nolist */
  3599. X  { "km", T_FLG  },
  3600. X  { "k0", T_STR  },
  3601. X  { "k1", T_STR  },
  3602. X  { "k2", T_STR  },
  3603. X  { "k3", T_STR  },
  3604. X  { "k4", T_STR  },
  3605. X  { "k5", T_STR  },
  3606. X  { "k6", T_STR  },
  3607. X  { "k7", T_STR  },
  3608. X  { "k8", T_STR  },
  3609. X  { "k9", T_STR  },
  3610. X  { "k;", T_STR  },
  3611. X  { "kb", T_STR  },
  3612. X  { "kd", T_STR  },
  3613. X  { "kh", T_STR  },
  3614. X  { "kl", T_STR  },
  3615. X  { "ko", T_STR  },
  3616. X  { "kr", T_STR  },
  3617. X  { "ku", T_STR  },
  3618. X  { "K1", T_STR  },
  3619. X  { "K2", T_STR  },
  3620. X  { "K3", T_STR  },
  3621. X  { "K4", T_STR  },
  3622. X  { "K5", T_STR  },
  3623. X  { "l0", T_STR  },
  3624. X  { "l1", T_STR  },
  3625. X  { "l2", T_STR  },
  3626. X  { "l3", T_STR  },
  3627. X  { "l4", T_STR  },
  3628. X  { "l5", T_STR  },
  3629. X  { "l6", T_STR  },
  3630. X  { "l7", T_STR  },
  3631. X  { "l8", T_STR  },
  3632. X  { "l9", T_STR  },
  3633. X  { "la", T_STR  },
  3634. X/* more keys for Andrew A. Chernov (ache@astral.msk.su) */
  3635. X  { "kA", T_STR  },
  3636. X  { "ka", T_STR  },
  3637. X  { "kC", T_STR  },
  3638. X  { "kD", T_STR  },
  3639. X  { "kE", T_STR  },
  3640. X  { "kF", T_STR  },
  3641. X  { "kH", T_STR  },
  3642. X  { "kI", T_STR  },
  3643. X  { "kL", T_STR  },
  3644. X  { "kM", T_STR  },
  3645. X  { "kN", T_STR  },
  3646. X  { "kP", T_STR  },
  3647. X  { "kR", T_STR  },
  3648. X  { "kS", T_STR  },
  3649. X  { "kT", T_STR  },
  3650. X  { "kt", T_STR  },
  3651. X/* list */
  3652. X/* define T_ECAPS */
  3653. X/* define T_N */
  3654. X};
  3655. END_OF_FILE
  3656. if test 4399 -ne `wc -c <'term.c'`; then
  3657.     echo shar: \"'term.c'\" unpacked with wrong size!
  3658. fi
  3659. # end of 'term.c'
  3660. fi
  3661. if test -f 'term.h.dist' -a "${1}" != "-c" ; then 
  3662.   echo shar: Will not clobber existing file \"'term.h.dist'\"
  3663. else
  3664. echo shar: Extracting \"'term.h.dist'\" \(2680 characters\)
  3665. sed "s/^X//" >'term.h.dist' <<'END_OF_FILE'
  3666. X/*
  3667. X * This file is automagically created from term.c -- DO NOT EDIT
  3668. X */
  3669. X
  3670. X#define T_FLG 0
  3671. X#define T_NUM 1
  3672. X#define T_STR 2
  3673. X
  3674. Xstruct term
  3675. X{
  3676. X  char *tcname;
  3677. X  int type;
  3678. X};
  3679. X
  3680. Xunion tcu
  3681. X{
  3682. X  int flg;
  3683. X  int num;
  3684. X  char *str;
  3685. X};
  3686. X
  3687. X#define LI (d_tcs[0].num)
  3688. X#define CO (d_tcs[1].num)
  3689. X#define HC (d_tcs[2].flg)
  3690. X#define OS (d_tcs[3].flg)
  3691. X#define NS (d_tcs[4].flg)
  3692. X#define CM (d_tcs[5].str)
  3693. X#define HO (d_tcs[6].str)
  3694. X#define CR (d_tcs[7].str)
  3695. X#define UP (d_tcs[8].str)
  3696. X#define CUP (d_tcs[9].str)
  3697. X#define DO (d_tcs[10].str)
  3698. X#define CDO (d_tcs[11].str)
  3699. X#define BS (d_tcs[12].flg)
  3700. X#define BC (d_tcs[13].str)
  3701. X#define LE (d_tcs[14].str)
  3702. X#define CLE (d_tcs[15].str)
  3703. X#define ND (d_tcs[16].str)
  3704. X#define CRI (d_tcs[17].str)
  3705. X#define CS (d_tcs[18].str)
  3706. X#define NL (d_tcs[19].str)
  3707. X#define SF (d_tcs[20].str)
  3708. X#define SR (d_tcs[21].str)
  3709. X#define AL (d_tcs[22].str)
  3710. X#define CAL (d_tcs[23].str)
  3711. X#define DL (d_tcs[24].str)
  3712. X#define CDL (d_tcs[25].str)
  3713. X#define IN (d_tcs[26].flg)
  3714. X#define IM (d_tcs[27].str)
  3715. X#define EI (d_tcs[28].str)
  3716. X#define IC (d_tcs[29].str)
  3717. X#define CIC (d_tcs[30].str)
  3718. X#define DC (d_tcs[31].str)
  3719. X#define CDC (d_tcs[32].str)
  3720. X#define CL (d_tcs[33].str)
  3721. X#define CD (d_tcs[34].str)
  3722. X#define CE (d_tcs[35].str)
  3723. X#define CB (d_tcs[36].str)
  3724. X#define IS (d_tcs[37].str)
  3725. X#define TI (d_tcs[38].str)
  3726. X#define TE (d_tcs[39].str)
  3727. X#define BL (d_tcs[40].str)
  3728. X#define VB (d_tcs[41].str)
  3729. X#define CWS (d_tcs[42].str)
  3730. X#define CZ0 (d_tcs[43].str)
  3731. X#define CZ1 (d_tcs[44].str)
  3732. X#define T_ATTR 45
  3733. X#define MH (d_tcs[45].str)
  3734. X#define US (d_tcs[46].str)
  3735. X#define MD (d_tcs[47].str)
  3736. X#define MR (d_tcs[48].str)
  3737. X#define SO (d_tcs[49].str)
  3738. X#define MB (d_tcs[50].str)
  3739. X#define UE (d_tcs[51].str)
  3740. X#define SE (d_tcs[52].str)
  3741. X#define ME (d_tcs[53].str)
  3742. X#define MS (d_tcs[54].flg)
  3743. X#define SG (d_tcs[55].flg)
  3744. X#define UG (d_tcs[56].flg)
  3745. X#define KS (d_tcs[57].str)
  3746. X#define KE (d_tcs[58].str)
  3747. X#define CCS (d_tcs[59].str)
  3748. X#define CCE (d_tcs[60].str)
  3749. X#define PO (d_tcs[61].str)
  3750. X#define PF (d_tcs[62].str)
  3751. X#define HS (d_tcs[63].flg)
  3752. X#define WS (d_tcs[64].num)
  3753. X#define TS (d_tcs[65].str)
  3754. X#define FS (d_tcs[66].str)
  3755. X#define DS (d_tcs[67].str)
  3756. X#define VI (d_tcs[68].str)
  3757. X#define VE (d_tcs[69].str)
  3758. X#define VS (d_tcs[70].str)
  3759. X#define AM (d_tcs[71].flg)
  3760. X#define XV (d_tcs[72].flg)
  3761. X#define XN (d_tcs[73].flg)
  3762. X#define COP (d_tcs[74].flg)
  3763. X#define CLP (d_tcs[75].flg)
  3764. X#define CNF (d_tcs[76].flg)
  3765. X#define XO (d_tcs[77].flg)
  3766. X#define CAN (d_tcs[78].flg)
  3767. X#define COL (d_tcs[79].num)
  3768. X#define CG0 (d_tcs[80].flg)
  3769. X#define CS0 (d_tcs[81].str)
  3770. X#define CE0 (d_tcs[82].str)
  3771. X#define CC0 (d_tcs[83].str)
  3772. X#define AS (d_tcs[84].str)
  3773. X#define AE (d_tcs[85].str)
  3774. X#define AC (d_tcs[86].str)
  3775. X#define CB8 (d_tcs[87].str)
  3776. X#define T_CAPS 88
  3777. X#define T_ECAPS 139
  3778. X#define T_N 139
  3779. END_OF_FILE
  3780. if test 2680 -ne `wc -c <'term.h.dist'`; then
  3781.     echo shar: \"'term.h.dist'\" unpacked with wrong size!
  3782. fi
  3783. # end of 'term.h.dist'
  3784. fi
  3785. if test -f 'term.sh' -a "${1}" != "-c" ; then 
  3786.   echo shar: Will not clobber existing file \"'term.sh'\"
  3787. else
  3788. echo shar: Extracting \"'term.sh'\" \(737 characters\)
  3789. sed "s/^X//" >'term.sh' <<'END_OF_FILE'
  3790. X#!/bin/sh
  3791. X
  3792. Xif test -z "$AWK"; then
  3793. X  AWK=awk
  3794. Xfi
  3795. X
  3796. Xrm -f term.h
  3797. Xcat << EOF > term.h
  3798. X/*
  3799. X * This file is automagically created from term.c -- DO NOT EDIT
  3800. X */
  3801. X
  3802. X#define T_FLG 0
  3803. X#define T_NUM 1
  3804. X#define T_STR 2
  3805. X
  3806. Xstruct term
  3807. X{
  3808. X  char *tcname;
  3809. X  int type;
  3810. X};
  3811. X
  3812. Xunion tcu
  3813. X{
  3814. X  int flg;
  3815. X  int num;
  3816. X  char *str;
  3817. X};
  3818. X
  3819. XEOF
  3820. X
  3821. Xsed < term.c \
  3822. X  -e '/"[A-Z]."/s/"/"C/' \
  3823. X  -e '/"/y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
  3824. X| $AWK '
  3825. X/^  [{] ".*$/{
  3826. Xa=substr($2,2,length($2)-3);
  3827. Xb=substr($3,3,3);
  3828. Xif (nolist == 0)
  3829. X  printf "#define %s (d_tcs[%d].%s)\n",a,s,b
  3830. Xs++;
  3831. X}
  3832. X/\/* define/{
  3833. Xprintf "#define %s %d\n",$3,s
  3834. X}
  3835. X/\/* nolist/{
  3836. Xnolist = 1;
  3837. X}
  3838. X/\/* list/{
  3839. Xnolist = 0;
  3840. X}
  3841. X' | sed -e s/NUM/num/ -e s/STR/str/ -e s/FLG/flg/ \
  3842. X>> term.h
  3843. Xchmod a-w term.h
  3844. X
  3845. END_OF_FILE
  3846. if test 737 -ne `wc -c <'term.sh'`; then
  3847.     echo shar: \"'term.sh'\" unpacked with wrong size!
  3848. fi
  3849. # end of 'term.sh'
  3850. fi
  3851. if test ! -d 'terminfo' ; then
  3852.     echo shar: Creating directory \"'terminfo'\"
  3853.     mkdir 'terminfo'
  3854. fi
  3855. if test -f 'terminfo/8bits' -a "${1}" != "-c" ; then 
  3856.   echo shar: Will not clobber existing file \"'terminfo/8bits'\"
  3857. else
  3858. echo shar: Extracting \"'terminfo/8bits'\" \(720 characters\)
  3859. sed "s/^X//" >'terminfo/8bits' <<'END_OF_FILE'
  3860. X
  3861. XWe test some umlauts and other characters coded in
  3862. Xthe ISO 8859-1 (Latin 1) standard:
  3863. X
  3864. Xumlaut A          ─                  umlaut a          Σ
  3865. Xumlaut O          ╓                  umlaut o          ÷
  3866. Xumlaut U          ▄                  umlaut u          ⁿ
  3867. Xsharp s           ▀                  paragraph         º
  3868. Xe + /             Θ                  e + \             Φ
  3869. Xe + ^             Ω                  a + \             α
  3870. Xu + \             ∙                  degree            ░
  3871. Xlog. not          ¼                  + over -          ▒
  3872. X<<                ½                  >>                ╗
  3873. Xfraction 1/2      ╜                  fraction 1/4      ╝
  3874. Xpower of 2        ▓                  middle dot        ╖
  3875. X
  3876. X---
  3877. END_OF_FILE
  3878. echo shar: 22 control characters may be missing from \"'terminfo/8bits'\"
  3879. if test 720 -ne `wc -c <'terminfo/8bits'`; then
  3880.     echo shar: \"'terminfo/8bits'\" unpacked with wrong size!
  3881. fi
  3882. # end of 'terminfo/8bits'
  3883. fi
  3884. if test -f 'terminfo/README' -a "${1}" != "-c" ; then 
  3885.   echo shar: Will not clobber existing file \"'terminfo/README'\"
  3886. else
  3887. echo shar: Extracting \"'terminfo/README'\" \(444 characters\)
  3888. sed "s/^X//" >'terminfo/README' <<'END_OF_FILE'
  3889. X
  3890. XThis directory contains various file for termcap/terminfo installation
  3891. Xand testing:
  3892. X
  3893. Xscreencap        Termcap entry for screen. Add to /etc/termcap.
  3894. X
  3895. Xscreeninfo.src        Terminfo entry. Use 'tic screeninfo.src'
  3896. X            to install (Sun: /usr/5bin/tic).
  3897. X
  3898. Xchecktc.c        Termcap/info test program. Checks margin
  3899. X            handling and other things.
  3900. X
  3901. X8bits            Some chars from the ISO 8859-1 charset.
  3902. X
  3903. Xtest.txt        Test file for alternate charset.
  3904. X
  3905. Xtetris.c        The popular game.
  3906. X
  3907. END_OF_FILE
  3908. if test 444 -ne `wc -c <'terminfo/README'`; then
  3909.     echo shar: \"'terminfo/README'\" unpacked with wrong size!
  3910. fi
  3911. # end of 'terminfo/README'
  3912. fi
  3913. if test -f 'terminfo/checktc.c' -a "${1}" != "-c" ; then 
  3914.   echo shar: Will not clobber existing file \"'terminfo/checktc.c'\"
  3915. else
  3916. echo shar: Extracting \"'terminfo/checktc.c'\" \(4448 characters\)
  3917. sed "s/^X//" >'terminfo/checktc.c' <<'END_OF_FILE'
  3918. X#include <stdio.h>
  3919. X
  3920. Xchar *CL, *CM, *CS, *SR;
  3921. Xint CO, LI, AM, XN;
  3922. X
  3923. Xchar *tgetstr(), *getenv();
  3924. Xvoid PutStr(), CPutStr(), CCPutStr(), GotoPos(), RETURN();
  3925. X
  3926. Xmain()
  3927. X{
  3928. X  char *term, *s;
  3929. X  char tcbuf[1024];
  3930. X  char tcstr[1024], *tp;
  3931. X
  3932. X  if ((term = getenv("TERM")) == 0)
  3933. X    {
  3934. X      fprintf(stderr, "No $TERM set\n");
  3935. X      exit(1);
  3936. X    }
  3937. X  switch (tgetent(tcbuf, term))
  3938. X    {
  3939. X    case -1:
  3940. X      fprintf(stderr, "Could not open termcap file\n");
  3941. X      exit(1);
  3942. X    case 0:
  3943. X      fprintf(stderr, "I don't know what a '%s' terminal is.\n", term);
  3944. X      exit(1);
  3945. X    }
  3946. X  tp = tcstr;
  3947. X  if ((CL = tgetstr("cl", &tp)) == 0)
  3948. X    {
  3949. X      fprintf(stderr, "cl capability required\n");
  3950. X      exit(1);
  3951. X    }
  3952. X  if ((CM = tgetstr("cm", &tp)) == 0)
  3953. X    {
  3954. X      fprintf(stderr, "cm capability required\n");
  3955. X      exit(1);
  3956. X    }
  3957. X  
  3958. X  if (s = getenv("COLUMNS"))
  3959. X      CO = atoi(s);
  3960. X  if (s = getenv("LINES"))
  3961. X      LI = atoi(s);
  3962. X  if (CO == 0)
  3963. X      CO = tgetnum("co");
  3964. X  if (LI == 0)
  3965. X      LI = tgetnum("li");
  3966. X  if (CO == 0)
  3967. X      CO = 80;
  3968. X  if (LI == 0)
  3969. X      LI = 24;
  3970. X  GotoPos(5, 1);
  3971. X  printf("******* cl capability does not work !!! *******");
  3972. X  GotoPos(5, 2);
  3973. X  PutStr(CL);
  3974. X  printf("******* cl capability does not home cursor *******");
  3975. X  GotoPos(0, 0);
  3976. X  printf("                                                  ");
  3977. X  GotoPos(5, 4);
  3978. X  printf("******* cm capability does not work !!! *******");
  3979. X  GotoPos(5, 4);
  3980. X  printf("                                               ");
  3981. X  GotoPos(CO/2-12, LI/2);
  3982. X  printf("Your terminal size is");
  3983. X  GotoPos(CO/2-3, LI/2+1);
  3984. X  printf("%dx%d", CO, LI);
  3985. X  GotoPos(CO/2-2, 0);
  3986. X  printf("top");
  3987. X  GotoPos(CO/2-3, LI-1);
  3988. X  printf("bottom");
  3989. X  GotoPos(0, LI/2-2);printf("l");
  3990. X  GotoPos(0, LI/2-1);printf("e");
  3991. X  GotoPos(0, LI/2+0);printf("f");
  3992. X  GotoPos(0, LI/2+1);printf("t");
  3993. X  GotoPos(CO-1, LI/2-2);printf("r");
  3994. X  GotoPos(CO-1, LI/2-1);printf("i");
  3995. X  GotoPos(CO-1, LI/2+0);printf("g");
  3996. X  GotoPos(CO-1, LI/2+1);printf("h");
  3997. X  GotoPos(CO-1, LI/2+2);printf("t");
  3998. X  GotoPos(CO/2-15, LI/2+3);
  3999. X  RETURN();
  4000. X  AM = tgetflag("am");
  4001. X  printf("Termcap: terminal does %sauto-wrap", AM ? "" : "not ");
  4002. X  GotoPos(0, 5);
  4003. X  if (AM)
  4004. X    {
  4005. X      printf(" am capability set, but terminal does not wrap");
  4006. X      GotoPos(CO-1, 3);
  4007. X    }
  4008. X  else
  4009. X    {
  4010. X      printf(" am capability not set, but terminal does wrap");
  4011. X      GotoPos(CO-1, 4);
  4012. X    }
  4013. X  printf("  \n                                                  ");
  4014. X  GotoPos(0, 10);
  4015. X  RETURN();
  4016. X  if (AM)
  4017. X    {
  4018. X      XN = tgetflag("xn");
  4019. X      printf("Termcap: terminal has %smagic margins", XN ? "" : "no ");
  4020. X      GotoPos(0, 5);
  4021. X      if (XN = tgetflag("xn"))
  4022. X    {
  4023. X      printf(" xn capability set, but terminal has no magic-margins");
  4024. X      GotoPos(CO-1, 4);
  4025. X    }
  4026. X      else
  4027. X    {
  4028. X      printf(" xn capability not set, but terminal has magic-margins");
  4029. X      GotoPos(CO-1, 3);
  4030. X    }
  4031. X      printf(" \n");
  4032. X      printf("                                                       ");
  4033. X      GotoPos(0, 10);
  4034. X      RETURN();
  4035. X      if (XN)
  4036. X        {
  4037. X          GotoPos(0, 6);
  4038. X      printf(" last col in last row is not usable");
  4039. X          GotoPos(CO-1, LI-1);
  4040. X      printf(" ");
  4041. X          GotoPos(0, 6);
  4042. X      printf("                                          ");
  4043. X      GotoPos(0, 0);
  4044. X      printf("testing magic margins in last row");
  4045. X      GotoPos(0, 10);
  4046. X      RETURN();
  4047. X        }
  4048. X    }
  4049. X  if (CS = tgetstr("cs", &tp))
  4050. X    {
  4051. X      printf("Termcap: terminal has scrollregions");
  4052. X      GotoPos(0, 5);
  4053. X      printf(" cs capability set, but doesn't work");
  4054. X      CCPutStr(CS, 4, 5);
  4055. X      GotoPos(0, 5);
  4056. X      printf("\n\n");
  4057. X      CCPutStr(CS, 0, LI-1);
  4058. X      GotoPos(0, 10);
  4059. X      RETURN();
  4060. X    }
  4061. X  if (SR = tgetstr("sr", &tp))
  4062. X    {
  4063. X      GotoPos(0, 5);
  4064. X      printf(" sr capability set, but doesn't work");
  4065. X      GotoPos(0, 0);
  4066. X      PutStr(SR);
  4067. X      GotoPos(0, 6);
  4068. X      printf("                                    ");
  4069. X      GotoPos(0, 0);
  4070. X      printf("Termcap: terminal can scroll backwards");
  4071. X      GotoPos(0, 10);
  4072. X      RETURN();
  4073. X    }
  4074. X}
  4075. X
  4076. Xvoid
  4077. Xputcha(c)
  4078. Xchar c;
  4079. X{
  4080. X  putchar(c);
  4081. X}
  4082. X
  4083. Xvoid
  4084. XPutStr(s)
  4085. Xchar *s;
  4086. X{
  4087. X  tputs(s, 1, putcha);
  4088. X  fflush(stdout);
  4089. X}
  4090. X
  4091. Xvoid CPutStr(s, c)
  4092. Xchar *s;
  4093. Xint c;
  4094. X{
  4095. X  tputs(tgoto(s, 0, c), 1, putcha);
  4096. X  fflush(stdout);
  4097. X}
  4098. X
  4099. Xvoid CCPutStr(s, x, y)
  4100. Xchar *s;
  4101. Xint x, y;
  4102. X{
  4103. X  tputs(tgoto(s, y, x), 1, putcha);
  4104. X  fflush(stdout);
  4105. X}
  4106. X
  4107. Xvoid GotoPos(x,y)
  4108. Xint x,y;
  4109. X{
  4110. X  tputs(tgoto(CM, x, y), 1, putcha);
  4111. X  fflush(stdout);
  4112. X}
  4113. X
  4114. Xvoid
  4115. XRETURN()
  4116. X{
  4117. X  printf("Press <RETURN> to continue");
  4118. X  fflush(stdout);
  4119. X  while(getchar() != '\n');
  4120. X  PutStr(CL);
  4121. X}
  4122. END_OF_FILE
  4123. if test 4448 -ne `wc -c <'terminfo/checktc.c'`; then
  4124.     echo shar: \"'terminfo/checktc.c'\" unpacked with wrong size!
  4125. fi
  4126. # end of 'terminfo/checktc.c'
  4127. fi
  4128. if test -f 'terminfo/screen-sco.mail' -a "${1}" != "-c" ; then 
  4129.   echo shar: Will not clobber existing file \"'terminfo/screen-sco.mail'\"
  4130. else
  4131. echo shar: Extracting \"'terminfo/screen-sco.mail'\" \(3056 characters\)
  4132. sed "s/^X//" >'terminfo/screen-sco.mail' <<'END_OF_FILE'
  4133. XFrom root%mjbtn.UUCP@uunet.UU.NET Tue Oct 22 03:09:14 1991
  4134. XReceived: from relay2.UU.NET by immd4.informatik.uni-erlangen.de  with SMTP (5.64+/7.3a-FAU)
  4135. X    id AA10018; Tue, 22 Oct 91 03:09:04 +0100
  4136. XReceived: from uunet.uu.net (via LOCALHOST.UU.NET) by relay2.UU.NET with SMTP 
  4137. X    (5.61/UUNET-internet-primary) id AA09640; Mon, 21 Oct 91 22:09:07 -0400
  4138. XReceived: from mjbtn.UUCP by uunet.uu.net with UUCP/RMAIL
  4139. X    (queueing-rmail) id 220830.17203; Mon, 21 Oct 1991 22:08:30 EDT
  4140. XReceived: by mjbtn.jobsoft.com (/\==/\ Smail3.1.21.1); Mon, 21 Oct 91 20:49 CDT
  4141. XMessage-Id: <m0kZBFd-0007XHC@mjbtn.jobsoft.com>
  4142. XFrom: root@mjbtn.jobsoft.com (Mark J. Bailey [ADMIN])
  4143. XSubject: Re: oh yes
  4144. XTo: jnweiger%immd4.informatik.uni-erlangen.de%uunet.UUCP@uunet.UU.NET (Juergen Weigert)
  4145. XDate: Mon, 21 Oct 91 20:49:49 CDT
  4146. XIn-Reply-To: <9110212148.AA01737@faui43.informatik.uni-erlangen.de>; from "Juergen Weigert" at Oct 21, 91 10:48 pm
  4147. XX-Mailer: ELM [version 2.3 PL11]
  4148. XStatus: OR
  4149. X
  4150. XHi,
  4151. X
  4152. XWell, more playing and finally some progress!  :-)
  4153. X
  4154. XThis is my .screenrc:
  4155. X
  4156. Xterminfo ansi G0:hs@:am:LP@:OP
  4157. X
  4158. XNow, I am not worried about its total accurracy, but I just wanted to show
  4159. Xyou what I tried.  I also fixed a screen-25 terminfo entry:
  4160. X
  4161. Xscreen-25|VT 100/ANSI X3.64 virtual terminal,
  4162. X    am, msgr, xon,
  4163. X    cols#80, it#8, lines#25,
  4164. X    bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
  4165. X    clear=\E[H\E[J, cr=\r, csr=\E[%i%p1%d;%p2%dr,
  4166. X    cub=\E[%p1%dD, cub1=\b, cud=\E[%p1%dB, cud1=\n,
  4167. X    cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
  4168. X    cuu=\E[%p1%dA, cuu1=\EM, dl=\E[%p1%dM, dl1=\E[M,
  4169. X    ed=\E[J, el=\E[K, home=\E[H, ht=\t, hts=\EH,
  4170. X    il=\E[%p1%dL, il1=\E[L, ind=\n, is2=\E)0, kbs=\b,
  4171. X    kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
  4172. X    kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, khome=\E?,
  4173. X    ll=\E[25H, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM,
  4174. X    rmkx=\E>, rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7,
  4175. X    sgr0=\E[m, smkx=\E=, smso=\E[3m, smul=\E[4m,
  4176. X    tbc=\E[3g,
  4177. X
  4178. XAnd notice for SCO Unix that I added 'am' to the entry for screen-25.  Even
  4179. Xthough the external (login shell) type 'ansi' was modified with the .screenrc,
  4180. Xwhen I added 'am' to the screen window term screen-25, it functioned flawlessly
  4181. Xand I am not sure why.  Anyway, vi and all the others seem to work great 
  4182. Xnow.  Next, I need to work on the G0 -> C0 graphics character mappings.  I 
  4183. Xdon't fully understand that yet.  Anyway, this should be of help to others
  4184. Xunder SCO.  BTW, that copy of the message you got from me that I sent to
  4185. XRonald Khoo -- I applied SCO SLS patch xnx141 (for xenix) to fix the bug 
  4186. Xin select() when dealing with pipes, and it solved my problems on xenix.
  4187. X
  4188. XMark.
  4189. X
  4190. X-- 
  4191. XMark J. Bailey, N4XHX                              _______/====X11====\_______
  4192. XUSMAIL: 511 Memorial Blvd., Murfreesboro, TN 37129 |         JobSoft         |
  4193. XVOICE:  +1 615 893 0098                            | Design & Development Co.|
  4194. XUUCP:   ...!uunet!mjbtn!mjb, ...!raider!mjbtn!mjb  |  Murfreesboro, TN  USA  |
  4195. XDOMAIN: mjb@mjbtn.JOBSOFT.COM      CIS: 76314,160  ---------------------------
  4196. X<KA9Q-UNIX-USERS Mailing List-Subscribe: ka9q-unix-requests@mjbtn.jobsoft.com>
  4197. X
  4198. END_OF_FILE
  4199. if test 3056 -ne `wc -c <'terminfo/screen-sco.mail'`; then
  4200.     echo shar: \"'terminfo/screen-sco.mail'\" unpacked with wrong size!
  4201. fi
  4202. # end of 'terminfo/screen-sco.mail'
  4203. fi
  4204. if test -f 'terminfo/screencap' -a "${1}" != "-c" ; then 
  4205.   echo shar: Will not clobber existing file \"'terminfo/screencap'\"
  4206. else
  4207. echo shar: Extracting \"'terminfo/screencap'\" \(685 characters\)
  4208. sed "s/^X//" >'terminfo/screencap' <<'END_OF_FILE'
  4209. XSC|screen|VT 100/ANSI X3.64 virtual terminal:\
  4210. X    :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:bs:bt=\E[Z:\
  4211. X    :cd=\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\
  4212. X    :do=^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\
  4213. X    :le=^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:xv:\
  4214. X    :li#24:co#80:LP:us=\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:\
  4215. X    :mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:ms:sr=\EM:al=\E[L:\
  4216. X    :AL=\E[%dL:dl=\E[M:DL=\E[%dM:cs=\E[%i%d;%dr:dc=\E[P:\
  4217. X    :DC=\E[%dP:im=\E[4h:ei=\E[4l:mi:IC=\E[%d@:\
  4218. X    :ks=\E=:ke=\E>:G0:\
  4219. X        :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:km:\
  4220. X        :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:
  4221. XSW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\
  4222. X    :co#132:tc=screen:
  4223. END_OF_FILE
  4224. if test 685 -ne `wc -c <'terminfo/screencap'`; then
  4225.     echo shar: \"'terminfo/screencap'\" unpacked with wrong size!
  4226. fi
  4227. # end of 'terminfo/screencap'
  4228. fi
  4229. if test -f 'terminfo/screeninfo.src' -a "${1}" != "-c" ; then 
  4230.   echo shar: Will not clobber existing file \"'terminfo/screeninfo.src'\"
  4231. else
  4232. echo shar: Extracting \"'terminfo/screeninfo.src'\" \(1492 characters\)
  4233. sed "s/^X//" >'terminfo/screeninfo.src' <<'END_OF_FILE'
  4234. Xscreen|VT 100/ANSI X3.64 virtual terminal,
  4235. X    mir, msgr, xon, km,
  4236. X    cols#80, it#8, lines#24,
  4237. X    bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
  4238. X    clear=\E[H\E[J, cr=\r, csr=\E[%i%p1%d;%p2%dr,
  4239. X    cub=\E[%p1%dD, cub1=\b, cud=\E[%p1%dB, cud1=\n,
  4240. X    cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
  4241. X    cuu=\E[%p1%dA, cuu1=\EM, dch=\E[%p1%dP, dch1=\E[P,
  4242. X    dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
  4243. X    ht=\t, hts=\EH, ich=\E[%p1%d@,
  4244. X    il=\E[%p1%dL, il1=\E[L, ind=\n, is2=\E)0, kbs=\b,
  4245. X    kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
  4246. X    kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=\EE,
  4247. X    rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E>,
  4248. X    rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, sgr0=\E[m,
  4249. X    smir=\E[4h, smkx=\E=, smso=\E[3m, smul=\E[4m,
  4250. X    tbc=\E[3g,
  4251. Xscreen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols,
  4252. X    mir, msgr, xon, km,
  4253. X    cols#132, it#8, lines#24,
  4254. X    bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
  4255. X    clear=\E[H\E[J, cr=\r, csr=\E[%i%p1%d;%p2%dr,
  4256. X    cub=\E[%p1%dD, cub1=\b, cud=\E[%p1%dB, cud1=\n,
  4257. X    cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
  4258. X    cuu=\E[%p1%dA, cuu1=\EM, dch=\E[%p1%dP, dch1=\E[P,
  4259. X    dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
  4260. X    ht=\t, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
  4261. X    il=\E[%p1%dL, il1=\E[L, ind=\n, is2=\E)0, kbs=\b,
  4262. X    kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
  4263. X    kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=\EE,
  4264. X    rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E>,
  4265. X    rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, sgr0=\E[m,
  4266. X    smir=\E[4h, smkx=\E=, smso=\E[3m, smul=\E[4m,
  4267. X    tbc=\E[3g,
  4268. END_OF_FILE
  4269. if test 1492 -ne `wc -c <'terminfo/screeninfo.src'`; then
  4270.     echo shar: \"'terminfo/screeninfo.src'\" unpacked with wrong size!
  4271. fi
  4272. # end of 'terminfo/screeninfo.src'
  4273. fi
  4274. if test -f 'terminfo/tetris.c' -a "${1}" != "-c" ; then 
  4275.   echo shar: Will not clobber existing file \"'terminfo/tetris.c'\"
  4276. else
  4277. echo shar: Extracting \"'terminfo/tetris.c'\" \(1468 characters\)
  4278. sed "s/^X//" >'terminfo/tetris.c' <<'END_OF_FILE'
  4279. Xlong h[4];t(){h[3]-=h[3]/3000;setitimer(0,h,0);}c,d,l,v[]={(int)t,0,2},w,s,I,K
  4280. X=0,i=276,j,k,q[276],Q[276],*n=q,*m,x=17,f[]={7,-13,-12,1,8,-11,-12,-1,9,-1,1,
  4281. X12,3,-13,-12,-1,12,-1,11,1,15,-1,13,1,18,-1,1,2,0,-12,-1,11,1,-12,1,13,10,-12,
  4282. X1,12,11,-12,-1,1,2,-12,-1,12,13,-12,12,13,14,-11,-1,1,4,-13,-12,12,16,-11,-12,
  4283. X12,17,-13,1,-1,5,-12,12,11,6,-12,12,24};u(){for(i=11;++i<264;)if((k=q[i])-Q[i]
  4284. X){Q[i]=k;if(i-++I||i%12<1)printf("\033[%d;%dH",(I=i)/12,i%12*2+28);printf(
  4285. X"\033[%dm  "+(K-k?0:5),k);K=k;}Q[263]=c=getchar();}G(b){for(i=4;i--;)if(q[i?b+
  4286. Xn[i]:b])return 0;return 1;}g(b){for(i=4;i--;q[i?x+n[i]:x]=b);}main(C,V,a)char*
  4287. X*V,*a;{h[3]=1000000/(l=C>1?atoi(V[1]):2);for(a=C>2?V[2]:"jkl pq";i;i--)*n++=i<
  4288. X25||i%12<2?7:0;srand(getpid());system("stty cbreak -echo stop u");sigvec(14,v,
  4289. X0);t();puts("\033[H\033[J");for(n=f+rand()%7*4;;g(7),u(),g(0)){if(c<0){if(G(x+
  4290. X12))x+=12;else{g(7);++w;for(j=0;j<252;j=12*(j/12+1))for(;q[++j];)if(j%12==10){
  4291. Xfor(;j%12;q[j--]=0);u();for(;--j;q[j+12]=q[j]);u();}n=f+rand()%7*4;G(x=17)||(c
  4292. X=a[5]);}}if(c==*a)G(--x)||++x;if(c==a[1])n=f+4**(m=n),G(x)||(n=m);if(c==a[2])G
  4293. X(++x)||--x;if(c==a[3])for(;G(x+12);++w)x+=12;if(c==a[4]||c==a[5]){s=sigblock(
  4294. X8192);printf("\033[H\033[J\033[0m%d\n",w);if(c==a[5])break;for(j=264;j--;Q[j]=
  4295. X0);while(getchar()-a[4]);puts("\033[H\033[J\033[7m");sigsetmask(s);}}d=popen(
  4296. X"stty -cbreak echo stop \023;sort -mnr -o HI - HI;cat HI","w");fprintf(d,
  4297. X"%4d from level %1d by %s\n",w,l,getlogin());pclose(d);}
  4298. X
  4299. END_OF_FILE
  4300. if test 1468 -ne `wc -c <'terminfo/tetris.c'`; then
  4301.     echo shar: \"'terminfo/tetris.c'\" unpacked with wrong size!
  4302. fi
  4303. # end of 'terminfo/tetris.c'
  4304. fi
  4305. if test -f 'window.h' -a "${1}" != "-c" ; then 
  4306.   echo shar: Will not clobber existing file \"'window.h'\"
  4307. else
  4308. echo shar: Extracting \"'window.h'\" \(6747 characters\)
  4309. sed "s/^X//" >'window.h' <<'END_OF_FILE'
  4310. X/* Copyright (c) 1993
  4311. X *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
  4312. X *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
  4313. X * Copyright (c) 1987 Oliver Laumann
  4314. X *
  4315. X * This program is free software; you can redistribute it and/or modify
  4316. X * it under the terms of the GNU General Public License as published by
  4317. X * the Free Software Foundation; either version 2, or (at your option)
  4318. X * any later version.
  4319. X *
  4320. X * This program is distributed in the hope that it will be useful,
  4321. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  4322. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  4323. X * GNU General Public License for more details.
  4324. X *
  4325. X * You should have received a copy of the GNU General Public License
  4326. X * along with this program (see the file COPYING); if not, write to the
  4327. X * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  4328. X *
  4329. X ****************************************************************
  4330. X * $Id: window.h,v 1.6 1993/07/21 15:43:44 mlschroe Exp $ FAU
  4331. X */
  4332. X
  4333. X#ifndef MAXWIN
  4334. X# define MAXWIN    10
  4335. X#endif
  4336. X
  4337. Xstruct win;
  4338. X
  4339. X#ifdef PSEUDOS
  4340. X
  4341. Xstruct pseudowin
  4342. X{
  4343. X  int fdpat;
  4344. X  int p_pid;
  4345. X  int p_ptyfd;
  4346. X  char p_cmd[MAXSTR];
  4347. X  char p_tty[MAXSTR];
  4348. X  char p_inbuf[IOSIZE];        /* buffered writing to p_ptyfd */
  4349. X  int p_inlen;
  4350. X};
  4351. X
  4352. X/* bits for fdpat: */
  4353. X#define F_PMASK     0x0003
  4354. X#define F_PSHIFT    2
  4355. X#define F_PFRONT    0x0001            /* . */
  4356. X#define F_PBACK     0x0002            /* ! */
  4357. X#define F_PBOTH     (F_PFRONT | F_PBACK)    /* : */
  4358. X
  4359. X#define F_UWP        0x1000            /* | */
  4360. X
  4361. X/* The screen process ...)
  4362. X * ... wants to write to pseudo */
  4363. X#define W_WP(w) ((w)->w_pwin && ((w)->w_pwin->fdpat & F_PFRONT))
  4364. X
  4365. X/* ... wants to write to window: user writes to window 
  4366. X * or stdout/stderr of pseudo are duplicated to window */
  4367. X#define W_WW(w) (!((w)->w_pwin) || \
  4368. X(((w)->w_pwin->fdpat & F_PMASK) == F_PBACK) || \
  4369. X((((w)->w_pwin->fdpat >> F_PSHIFT) & F_PMASK) == F_PBOTH) || \
  4370. X((((w)->w_pwin->fdpat >> (F_PSHIFT * 2)) & F_PMASK) == F_PBOTH))
  4371. X
  4372. X/* ... wants to read from pseudowin */
  4373. X#define W_RP(w) ((w)->w_pwin && ((w)->w_pwin->fdpat & \
  4374. X((F_PFRONT << (F_PSHIFT * 2)) | (F_PFRONT << F_PSHIFT)) ))
  4375. X
  4376. X/* ... wants to read from window */
  4377. X#define W_RW(w) (!((w)->w_pwin) || ((w)->w_pwin->fdpat & F_PFRONT))
  4378. X
  4379. X/* user input is written to pseudo */
  4380. X#define W_UWP(w) ((w)->w_pwin && ((w)->w_pwin->fdpat & F_UWP))
  4381. X
  4382. X/* pseudo output has to be stuffed in window */
  4383. X#define W_PTOW(w) (\
  4384. X((w)->w_pwin->fdpat & F_PMASK << F_PSHIFT) == F_PBOTH << F_PSHIFT || \
  4385. X((w)->w_pwin->fdpat & F_PMASK << F_PSHIFT * 2) == F_PBOTH << F_PSHIFT * 2 )
  4386. X
  4387. X/* window output has to be stuffed in pseudo */
  4388. X#define W_WTOP(w) (((w)->w_pwin->fdpat & F_PMASK) == F_PBOTH)
  4389. X
  4390. X#endif /* PSEUDOS */
  4391. X
  4392. X
  4393. Xstruct win 
  4394. X{
  4395. X  struct win *w_next;        /* next window */
  4396. X#ifdef PSEUDOS
  4397. X  struct pseudowin *w_pwin;    /* ptr to pseudo */
  4398. X#endif
  4399. X  struct display *w_display;    /* pointer to our display */
  4400. X  int     w_number;        /* window number */
  4401. X  int     w_active;        /* is window fore ? */
  4402. X  struct layer *w_lay;        /* the layer of the window */
  4403. X  struct layer w_winlay;    /* the layer of the window */
  4404. X  int     w_pid;            /* process at the other end of ptyfd */    
  4405. X  int     w_ptyfd;        /* fd of the master pty */
  4406. X  int     w_aflag;        /* (used for DUMP_TERMCAP) */
  4407. X  char     w_inbuf[IOSIZE];
  4408. X  int     w_inlen;
  4409. X  char     w_outbuf[IOSIZE];
  4410. X  int     w_outlen;
  4411. X  char  *w_aka;            /* name of the window */
  4412. X  char  *w_akachange;        /* autoaka hack */
  4413. X  int     w_autoaka;        /* autoaka hack */
  4414. X  char     w_akabuf[MAXSTR];    /* aka buffer */
  4415. X  char     w_tty[MAXSTR];
  4416. X  struct tty_attr w_t;
  4417. X  int     w_intermediate;    /* char used while parsing ESC-seq */
  4418. X  int     w_args[MAXARGS];
  4419. X  int     w_NumArgs;
  4420. X  slot_t w_slot;        /* utmp slot */
  4421. X#if defined (UTMPOK)
  4422. X  struct utmp w_savut;        /* utmp entry of this window */
  4423. X#endif
  4424. X  char **w_image;
  4425. X  char **w_attr;
  4426. X  char **w_font;
  4427. X  int     w_x, w_y;        /* Cursor position */
  4428. X  int     w_width, w_height;    /* window size */
  4429. X  char     w_Attr;        /* character attributes */
  4430. X  char     w_Font;        /* character font */
  4431. X  int     w_Charset;        /* charset number */
  4432. X  int     w_charsets[4];        /* Font = charsets[Charset] */
  4433. X  int     w_ss;        
  4434. X  int     w_saved;
  4435. X  int     w_Saved_x, w_Saved_y;
  4436. X  char     w_SavedAttr;
  4437. X  int     w_SavedCharset;
  4438. X  int     w_SavedCharsets[4];
  4439. X  int     w_top, w_bot;        /* scrollregion */
  4440. X  int     w_wrap;        /* autowrap */
  4441. X  int     w_origin;        /* origin mode */
  4442. X  int     w_insert;        /* window is in insert mode */
  4443. X  int     w_keypad;        /* keypad mode */
  4444. X  int     w_cursorkeys;        /* appl. cursorkeys mode */
  4445. X#ifdef COPY_PASTE
  4446. X  char    *w_pastebuffer;        /* this gets pasted in the window */
  4447. X  int     w_pastelen;        /* bytes left to paste */
  4448. X  int     w_histheight;        /* all histbases are malloced with width * histheight */
  4449. X  int     w_histidx;        /* 0 <= histidx < histheight; where we insert lines */
  4450. X  char **w_ihist;         /* the history buffer image */
  4451. X  char **w_ahist;         /* attributes */
  4452. X  char **w_fhist;         /* fonts */
  4453. X#endif
  4454. X  enum state_t w_state;        /* parser state */
  4455. X  enum string_t w_StringType;
  4456. X  char     w_string[MAXSTR];
  4457. X  char    *w_stringp;
  4458. X  char    *w_tabs;        /* line with tabs */
  4459. X  int     w_bell;        /* bell status of this window */
  4460. X  int     w_flow;        /* flow flags */
  4461. X  FILE    *w_logfp;        /* log to file */
  4462. X  int     w_monitor;        /* monitor status */
  4463. X  struct lastio_s
  4464. X    {
  4465. X      time_t lastio;        /* timestamp of last filedescriptor activity */
  4466. X      int seconds;        /* tell us when lastio + seconds < time() */
  4467. X    } w_tstamp;
  4468. X  int    w_dupto;        /* duplicate the output to this window */
  4469. X  char     w_vbwait;            
  4470. X  char     w_cursor_invisible;
  4471. X  char     w_norefresh;        /* dont redisplay when switching to that win */
  4472. X  char   w_wlock;        /* WLOCK_AUTO, WLOCK_OFF, WLOCK_ON */
  4473. X  struct user *w_wlockuser;    /* NULL when unlocked or user who writes */
  4474. X#ifdef MULTIUSER
  4475. X  AclBits w_userbits[ACL_BITS_PER_WIN];
  4476. X#endif
  4477. X};
  4478. X
  4479. X/* definitions for wlocktype */
  4480. X#define WLOCK_OFF    0    /* all who are in w_userbits can write */
  4481. X#define WLOCK_AUTO    1    /* who selects first, can write */
  4482. X#define WLOCK_ON    2    /* w_wlockuser writes even if deselected */
  4483. X
  4484. X/*
  4485. X * Definitions for flow
  4486. X *   000  -(-)
  4487. X *   001  +(-)
  4488. X *   010  -(+)
  4489. X *   011  +(+)
  4490. X *   100  -(a)
  4491. X *   111  +(a)
  4492. X */
  4493. X#define FLOW_NOW    (1<<0)
  4494. X#define FLOW_AUTO    (1<<1)
  4495. X#define FLOW_AUTOFLAG    (1<<2)
  4496. X
  4497. X
  4498. X/*
  4499. X * iWIN gives us a reference to line y of the *whole* image
  4500. X * where line 0 is the oldest line in our history.
  4501. X * y must be in WIN coordinate system, not in display.
  4502. X */
  4503. X#define iWIN(y) ((y < fore->w_histheight) ? fore->w_ihist[(fore->w_histidx + y)\
  4504. X                % fore->w_histheight] : fore->w_image[y - fore->w_histheight])
  4505. X#define aWIN(y) ((y < fore->w_histheight) ? fore->w_ahist[(fore->w_histidx + y)\
  4506. X                % fore->w_histheight] : fore->w_attr[y - fore->w_histheight])
  4507. X#define fWIN(y) ((y < fore->w_histheight) ? fore->w_fhist[(fore->w_histidx + y)\
  4508. X                % fore->w_histheight] : fore->w_font[y - fore->w_histheight])
  4509. X
  4510. END_OF_FILE
  4511. if test 6747 -ne `wc -c <'window.h'`; then
  4512.     echo shar: \"'window.h'\" unpacked with wrong size!
  4513. fi
  4514. # end of 'window.h'
  4515. fi
  4516. echo shar: End of archive 1 \(of 10\).
  4517. cp /dev/null ark1isdone
  4518. MISSING=""
  4519. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  4520.     if test ! -f ark${I}isdone ; then
  4521.     MISSING="${MISSING} ${I}"
  4522.     fi
  4523. done
  4524. if test "${MISSING}" = "" ; then
  4525.     echo You have unpacked all 10 archives.
  4526.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  4527. else
  4528.     echo You still need to unpack the following archives:
  4529.     echo "        " ${MISSING}
  4530. fi
  4531. ##  End of shell archive.
  4532. exit 0
  4533.