home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / screen-3.5.1 / part01 next >
Text File  |  1993-08-08  |  136KB  |  4,744 lines

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